| @record.IdxMacchina |
@record.KeyRichiesta
@@ -76,25 +77,25 @@
@record.CodArticolo
@record.DescArticolo
|
- @record.DataInizio |
- @record.DataFine |
+ @record.DataInizio |
+ @record.DataFine |
@if (dynMode)
{
- @($"{record.TotCount01:N0}") @GetUM("TotCount01") |
+ @($"{record.TotCount01:N0}") @GetUM("TotCount01") |
@if (numCount > 1)
{
- @($"{record.TotCount02:N0}") @GetUM("TotCount02") |
+ @($"{record.TotCount02:N0}") @GetUM("TotCount02") |
}
@if (numCount > 2)
{
- @($"{record.TotCount03:N0}") @GetUM("TotCount03") |
+ @($"{record.TotCount03:N0}") @GetUM("TotCount03") |
}
-
+ |
@($"{record.TotEn01:N2}") @GetUM("TotEn01")
|
-
+ |
@righDiv(record.TotEn01, record.TotCount01).ToString("N3") @GetUM("TotEn01")/@GetUM("TotCount01")
@@ -113,12 +114,12 @@
|
@if (numTotEn > 1)
{
-
+ |
@($"{record.TotEn02:N2}") @GetUM("TotEn02")
|
-
+ |
@righDiv(record.TotEn02, record.TotCount01).ToString("N3") @GetUM("TotEn02")/@GetUM("TotCount01")
@@ -138,12 +139,12 @@
}
@if (numTotEn > 2)
{
- |
+ |
@($"{record.TotEn03:N2}") @GetUM("TotEn03")
|
-
+ |
@righDiv(record.TotEn03, record.TotCount01).ToString("N3") @GetUM("TotEn02")/@GetUM("TotCount01")
@@ -164,8 +165,8 @@
}
else
{
- | @(record.TotCount.ToString("N0")) m |
-
+ | @(record.TotCount.ToString("N0")) m |
+
@record.TotWatt.ToString("N2") kWh
@@ -173,7 +174,7 @@
@righDiv(record.TotWatt, record.TotCount).ToString("N3") kWh/m
|
-
+ |
@record.TotGas.ToString("N2") m3
diff --git a/MP.Stats/Pages/Energy.razor.cs b/MP.Stats/Pages/Energy.razor.cs
index f4a9b001..1ff0d186 100644
--- a/MP.Stats/Pages/Energy.razor.cs
+++ b/MP.Stats/Pages/Energy.razor.cs
@@ -35,6 +35,8 @@ namespace MP.Stats.Pages
protected string fileName = "ODL_Energy.csv";
+ protected int totalCount = 0;
+
#endregion Protected Fields
#region Protected Properties
@@ -51,8 +53,6 @@ namespace MP.Stats.Pages
[Inject]
protected MpStatsService StatService { get; set; }
- protected int totalCount = 0;
-
[Inject]
protected TranslateSrv TradService { get; set; }
@@ -65,14 +65,15 @@ namespace MP.Stats.Pages
///
///
///
- protected string checkCurrent(OdlEnergyModel testRec)
+ protected string CheckCurrent(OdlEnergyModel testRec)
{
string answ = "";
if (testRec != null)
{
try
{
- answ = (testRec.TotCount01 + testRec.TotCount02 + testRec.TotCount03) == 0 || testRec.DataFine == null ? "table-warning opacity-50" : "";
+ answ = (testRec.TotCount01 + testRec.TotCount02 + testRec.TotCount03) == 0 || testRec.DataFine == null ? "text-secondary" : "";
+ //answ = (testRec.TotCount01 + testRec.TotCount02 + testRec.TotCount03) == 0 || testRec.DataFine == null ? "table-info opacity-75" : "";
}
catch
{ }
@@ -184,6 +185,7 @@ namespace MP.Stats.Pages
private bool dynMode = false;
private List ListRecords;
+ private int MaxDisplay = 20;
private int numCount = 1;
private int numTotEn = 1;
private List SearchRecords;
@@ -224,7 +226,7 @@ namespace MP.Stats.Pages
await Task.Run(() => File.Delete(fullPath));
}
- private string convVal(string chiave)
+ private string confVal(string chiave)
{
string answ = "";
if (ConfigList != null && ConfigList.Count > 0)
@@ -241,6 +243,8 @@ namespace MP.Stats.Pages
private void DisplayData()
{
ListRecords = SearchRecords
+ .OrderByDescending(x => x.DataInizio)
+ .ThenBy(x => x.IdxMacchina)
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
@@ -257,19 +261,77 @@ namespace MP.Stats.Pages
private async Task LoadConfData()
{
ConfigList = await StatService.ConfigGetAll();
- dynMode = convVal("STATS_EnergyMode") == "Dynamic";
- var sNumCount = convVal("STATS_EnergyNumCount");
- int.TryParse(convVal("STATS_EnergyNumCount"), out numCount);
- int.TryParse(convVal("STATS_EnergyNumTotEn"), out numTotEn);
+ ListMacchine = await StatService.MachineList(true);
+ dynMode = confVal("STATS_EnergyMode") == "Dynamic";
+ var sNumCount = confVal("STATS_EnergyNumCount");
+ int.TryParse(confVal("STATS_EnergyNumCount"), out numCount);
+ int.TryParse(confVal("STATS_EnergyNumTotEn"), out numTotEn);
+ int.TryParse(confVal("STATS_EnergyMaxSelect"), out MaxDisplay);
}
+ protected List ListMacchine = new List();
+
private async Task ReloadData()
{
- SearchRecords = await StatService.StatOdlEnergyGetAll(currFilter, MServ.SearchVal);
+ if (SearchRecords != null)
+ {
+ SearchRecords.Clear();
+ }
+ else
+ {
+ SearchRecords = new List();
+ }
+ // se seleziona tutte...
+ if (currFilter.ListIdxMaccSel == null || currFilter.ListIdxMaccSel.Count == 0)
+ {
+ SearchRecords = await StatService.StatOdlEnergyGetAll(currFilter, MServ.SearchVal);
+ }
+ else
+ {
+ foreach (var idxMacc in currFilter.ListIdxMaccSel)
+ {
+ currFilter.IdxMacchina = idxMacc;
+ var tempRec = await StatService.StatOdlEnergyGetAll(currFilter, MServ.SearchVal);
+ SearchRecords.AddRange(tempRec);
+ tempRec = null;
+ }
+ }
totalCount = SearchRecords.Count;
DisplayData();
}
+ ///
+ /// Elimina da dict macchina indicata
+ ///
+ ///
+ private async Task RemoveMachine(string idxMacc)
+ {
+ // in primis se contiene spazio --> prendo prima aprte che è idxMacc...
+ if (idxMacc.Contains(" "))
+ {
+ var sVals = idxMacc.Split(' ');
+ idxMacc = sVals[0];
+ }
+ // se fosse vuoto --> popolo!
+ if (currFilter.ListIdxMaccSel.Count == 0)
+ {
+ currFilter.ListIdxMaccSel = ListMacchine.Select(x => x.ValueField).ToList();
+ }
+
+ if (currFilter.ListIdxMaccSel.Contains(idxMacc))
+ {
+ currFilter.ListIdxMaccSel.Remove(idxMacc);
+ // se ora fosse vuoto --> resetto!
+ if (currFilter.ListIdxMaccSel.Count == 0)
+ {
+ currFilter.ListIdxMaccSel = ListMacchine.Select(x => x.ValueField).ToList();
+ }
+
+ GC.Collect();
+ await ReloadData();
+ }
+ }
+
#endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MP.Stats/Pages/TrendAnalysis.razor b/MP.Stats/Pages/TrendAnalysis.razor
index cdeb2cb4..efaeaef0 100644
--- a/MP.Stats/Pages/TrendAnalysis.razor
+++ b/MP.Stats/Pages/TrendAnalysis.razor
@@ -5,7 +5,7 @@
@if (isLoading)
diff --git a/MP.Stats/Pages/TrendAnalysis.razor.cs b/MP.Stats/Pages/TrendAnalysis.razor.cs
index 8963512c..e1aafb87 100644
--- a/MP.Stats/Pages/TrendAnalysis.razor.cs
+++ b/MP.Stats/Pages/TrendAnalysis.razor.cs
@@ -208,7 +208,7 @@ namespace MP.Stats.Pages
private int MaxDisplay = 10;
private int NumMacc = 0;
- private List PlotRecords;
+ private List PlotRecords = new List();
///
/// Dizionario liste valori da mostrare
@@ -254,7 +254,14 @@ namespace MP.Stats.Pages
private void FiltData()
{
// in primis suddivido in un dizionario x ogni macchina...
- PlotRecords = new List();
+ if (PlotRecords != null)
+ {
+ PlotRecords.Clear(); // = new List();
+ }
+ else
+ {
+ PlotRecords = new List();
+ }
// per ogni valore recupero timeserie downsampled fino al num max di quelle ottenibili...
int numAdd = 0;
SelCount = 0;
@@ -280,40 +287,51 @@ namespace MP.Stats.Pages
private async Task LoadConfData()
{
ConfigList = await StatService.ConfigGetAll();
- if (ConfigList.Count > 0)
+ int.TryParse(confVal("STATS_TrendMaxSelect"), out MaxDisplay);
+ CodFluxList = await StatService.FluxTypeList();
+ ListMacchine = await StatService.MachineList(true);
+ }
+ private string confVal(string chiave)
+ {
+ string answ = "";
+ if (ConfigList != null && ConfigList.Count > 0)
{
- var recConf = ConfigList.Where(x => x.Chiave == "STATS_TrendMaxSelect").FirstOrDefault();
- if (recConf != null)
+ var searchRec = ConfigList.First(x => x.Chiave == chiave);
+ if (searchRec != null)
{
- int.TryParse(recConf.Valore, out MaxDisplay);
+ answ = searchRec.Valore;
}
}
- CodFluxList = await StatService.FluxTypeList();
+ return answ;
}
+ protected List ListMacchine = new List();
+
private async Task ReloadData()
{
isLoading = true;
- var listMacchine = await StatService.MachineList(true);
- NumMacc = listMacchine.Count;
+ NumMacc = ListMacchine.Count;
// ciclo caricando info x ogni macchina selezionata...
- SearchRecords = new Dictionary>();
+ if (SearchRecords != null)
+ {
+ SearchRecords.Clear();// = new Dictionary>();
+ }
+ else
+ {
+ SearchRecords = new Dictionary>();
+ }
if (currFilter.ListIdxMaccSel.Count > 0)
{
foreach (var idxMacc in currFilter.ListIdxMaccSel)
{
currFilter.IdxMacchina = idxMacc;
- var tempRec = await StatService.FluxLogRawData(currFilter, CodFluxSel, MServ.SearchVal);
+ List tempRec = await StatService.FluxLogRawData(currFilter, CodFluxSel, MServ.SearchVal);
SearchRecords.Add(idxMacc, tempRec);
+ tempRec = null;
}
}
-#if false
- SearchRecords = await StatService.FluxLogRawData(currFilter, CodFluxSel, MServ.SearchVal);
-#endif
TotalCount = SearchRecords.Count;
- // se ho un elenco di macchine mostro grafici, altrimenti resoconto
-
FiltData();
isLoading = false;
}
@@ -334,6 +352,7 @@ namespace MP.Stats.Pages
{
currFilter.ListIdxMaccSel.Remove(idxMacc);
SearchRecords.Remove(idxMacc);
+ GC.Collect();
await ReloadData();
}
}
diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html
index a42a1e7c..40ed2e37 100644
--- a/MP.Stats/Resources/ChangeLog.html
+++ b/MP.Stats/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo statistiche MAPO
- Versione: 6.16.2507.0711
+ Versione: 6.16.2507.0714
Note di rilascio:
diff --git a/MP.Stats/Resources/VersNum.txt b/MP.Stats/Resources/VersNum.txt
index fb38c36b..f6e37c01 100644
--- a/MP.Stats/Resources/VersNum.txt
+++ b/MP.Stats/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2507.0711
+6.16.2507.0714
diff --git a/MP.Stats/Resources/manifest.xml b/MP.Stats/Resources/manifest.xml
index aa11a96c..67c736ea 100644
--- a/MP.Stats/Resources/manifest.xml
+++ b/MP.Stats/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2507.0711
+ 6.16.2507.0714
https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip
https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html
false
|