From 2da9e293d9eb2583e0253d9ef7aca36478df4038 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 8 Jul 2025 09:22:48 +0200 Subject: [PATCH 1/3] Update comportamento energy su gestione selezione amcchine --- MP.Stats/Components/ModalSearchMacc.razor | 17 +- MP.Stats/Components/ModalSearchMacc.razor.cs | 59 ++- MP.Stats/MP.Stats.csproj | 4 +- MP.Stats/Pages/Energy.razor | 363 ++++++++++--------- MP.Stats/Pages/Energy.razor.cs | 30 +- MP.Stats/Pages/TrendAnalysis.razor | 2 +- MP.Stats/Resources/ChangeLog.html | 2 +- MP.Stats/Resources/VersNum.txt | 2 +- MP.Stats/Resources/manifest.xml | 2 +- 9 files changed, 272 insertions(+), 209 deletions(-) diff --git a/MP.Stats/Components/ModalSearchMacc.razor b/MP.Stats/Components/ModalSearchMacc.razor index 1881a845..73a479db 100644 --- a/MP.Stats/Components/ModalSearchMacc.razor +++ b/MP.Stats/Components/ModalSearchMacc.razor @@ -10,11 +10,6 @@ - @*
- Sel. Impianti: - @ListSelected - (@numSelected / @MaxSelection) -
*@ + } + + } + else + { +
+
+
+ Selezionare impianti (fino a @MaxDisplay) per visualizzare i dati +
+
+ # Impianti: @NumMacc | # Rec tot: @TotalCount.ToString("N0") +
+
- + } } + \ No newline at end of file diff --git a/MP.Stats/Pages/Energy.razor.cs b/MP.Stats/Pages/Energy.razor.cs index 1ff0d186..433178ec 100644 --- a/MP.Stats/Pages/Energy.razor.cs +++ b/MP.Stats/Pages/Energy.razor.cs @@ -35,7 +35,9 @@ namespace MP.Stats.Pages protected string fileName = "ODL_Energy.csv"; - protected int totalCount = 0; + protected List ListMacchine = new List(); + protected int NumMacc = 0; + protected int TotalCount = 0; #endregion Protected Fields @@ -44,6 +46,14 @@ namespace MP.Stats.Pages [Inject] protected IJSRuntime JSRuntime { get; set; } + /// + /// Verifica validità selezione macchine + /// + protected bool MaccSelValid + { + get => currFilter.MaccSelValid; + } + [Inject] protected Data.MessageService MServ { get; set; } @@ -215,7 +225,7 @@ namespace MP.Stats.Pages private bool isLoading { get; set; } = false; private int numRecord { get; set; } = 10; - private bool ShowCharts { get; set; } = false; + private bool ShowCharts { get; set; } = true; #endregion Private Properties @@ -262,6 +272,7 @@ namespace MP.Stats.Pages { ConfigList = await StatService.ConfigGetAll(); ListMacchine = await StatService.MachineList(true); + NumMacc = ListMacchine.Count(); dynMode = confVal("STATS_EnergyMode") == "Dynamic"; var sNumCount = confVal("STATS_EnergyNumCount"); int.TryParse(confVal("STATS_EnergyNumCount"), out numCount); @@ -269,8 +280,6 @@ namespace MP.Stats.Pages int.TryParse(confVal("STATS_EnergyMaxSelect"), out MaxDisplay); } - protected List ListMacchine = new List(); - private async Task ReloadData() { if (SearchRecords != null) @@ -296,7 +305,7 @@ namespace MP.Stats.Pages tempRec = null; } } - totalCount = SearchRecords.Count; + TotalCount = SearchRecords.Count; DisplayData(); } @@ -312,21 +321,10 @@ namespace MP.Stats.Pages 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(); } diff --git a/MP.Stats/Pages/TrendAnalysis.razor b/MP.Stats/Pages/TrendAnalysis.razor index efaeaef0..6c1aa347 100644 --- a/MP.Stats/Pages/TrendAnalysis.razor +++ b/MP.Stats/Pages/TrendAnalysis.razor @@ -23,7 +23,7 @@
- Selezionare impianti per attivare grafici (fino a @MaxDisplay) + Selezionare impianti (fino a @MaxDisplay) per attivare grafici
# Impianti: @NumMacc | # Rec tot: @TotalCount.ToString("N0") diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html index 40ed2e37..f2c9e813 100644 --- a/MP.Stats/Resources/ChangeLog.html +++ b/MP.Stats/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

Versione: 6.16.2507.0714

+

Versione: 6.16.2507.0809


Note di rilascio:
    diff --git a/MP.Stats/Resources/VersNum.txt b/MP.Stats/Resources/VersNum.txt index f6e37c01..ec4bb5fa 100644 --- a/MP.Stats/Resources/VersNum.txt +++ b/MP.Stats/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2507.0714 +6.16.2507.0809 diff --git a/MP.Stats/Resources/manifest.xml b/MP.Stats/Resources/manifest.xml index 67c736ea..42577645 100644 --- a/MP.Stats/Resources/manifest.xml +++ b/MP.Stats/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2507.0714 + 6.16.2507.0809 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 From 430f243e18a6e537f17909f77bd27fc60915a34e Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 8 Jul 2025 09:26:02 +0200 Subject: [PATCH 2/3] Ancora update sel macchine --- MP.Stats/Components/SelectionFilter.razor.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/MP.Stats/Components/SelectionFilter.razor.cs b/MP.Stats/Components/SelectionFilter.razor.cs index 36617010..bdeccd0f 100644 --- a/MP.Stats/Components/SelectionFilter.razor.cs +++ b/MP.Stats/Components/SelectionFilter.razor.cs @@ -217,11 +217,13 @@ namespace MP.Stats.Components } set { +#if false if (!SelFilter.ListIdxMaccSel.SequenceEqual(value)) { - SelFilter.ListIdxMaccSel = value; - reportChange(); - } + } +#endif + SelFilter.ListIdxMaccSel = value; + reportChange(); } } From 87c9f15de4e2abb0c2b95900109134e5c95adb48 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 8 Jul 2025 09:26:49 +0200 Subject: [PATCH 3/3] code cleanup --- MP.Stats/Components/SelectionFilter.razor.cs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/MP.Stats/Components/SelectionFilter.razor.cs b/MP.Stats/Components/SelectionFilter.razor.cs index bdeccd0f..af903ce4 100644 --- a/MP.Stats/Components/SelectionFilter.razor.cs +++ b/MP.Stats/Components/SelectionFilter.razor.cs @@ -194,19 +194,6 @@ namespace MP.Stats.Components protected List ddlMacchineMult { get => ddlMacchine.Where(x => x.ValueField != "*").ToList(); -#if false - { - List answ = new List(); - foreach (var item in ddlMacchine) - { - if (!ListIdxMaccSel.Contains(item.ValueField) && item.ValueField != "*") - { - answ.Add(item); - } - } - return answ; - } -#endif } protected List ListIdxMaccSel @@ -217,11 +204,6 @@ namespace MP.Stats.Components } set { -#if false - if (!SelFilter.ListIdxMaccSel.SequenceEqual(value)) - { - } -#endif SelFilter.ListIdxMaccSel = value; reportChange(); }