diff --git a/MP.Stats/Components/ModalSearchMacc.razor b/MP.Stats/Components/ModalSearchMacc.razor index 2b09d2f3..1881a845 100644 --- a/MP.Stats/Components/ModalSearchMacc.razor +++ b/MP.Stats/Components/ModalSearchMacc.razor @@ -7,7 +7,7 @@

Imp Sel: @ListSelected

- +
@*
@@ -34,21 +34,21 @@ @foreach (var record in ListRecords) { - + @if (CurrList.Contains(record.ValueField)) { - + } else { if (numSelected < MaxSelection) { - + } else { - + } } @@ -67,6 +67,11 @@
+ diff --git a/MP.Stats/Components/ModalSearchMacc.razor.cs b/MP.Stats/Components/ModalSearchMacc.razor.cs index 25062bcf..4a6620e0 100644 --- a/MP.Stats/Components/ModalSearchMacc.razor.cs +++ b/MP.Stats/Components/ModalSearchMacc.razor.cs @@ -40,6 +40,20 @@ namespace MP.Stats.Components get => string.IsNullOrEmpty(SearchVal) ? "btn-outline-secondary" : "btn-primary"; } + protected string CheckSelect(AutocompleteModel currRec) + { + string answ = ""; + if (CurrList.Contains(currRec.ValueField)) + { + answ = "table-info"; + } + else if (numSelected >= MaxSelection) + { + answ = "opacity-25"; + } + return answ; + } + protected List ListRecords { get; set; } = null!; protected string ListSelected diff --git a/MP.Stats/MP.Stats.csproj b/MP.Stats/MP.Stats.csproj index f8d68ded..2d4bd31c 100644 --- a/MP.Stats/MP.Stats.csproj +++ b/MP.Stats/MP.Stats.csproj @@ -4,8 +4,8 @@ net6.0 MP.Stats 826e877c-ba70-4253-84cb-d0b1cafd4440 - 6.16.2507.0709 - 6.16.2507.0709 + 6.16.2507.0710 + 6.16.2507.0710 true $(NoWarn);1591 en diff --git a/MP.Stats/Pages/TrendAnalysis.razor b/MP.Stats/Pages/TrendAnalysis.razor index 53c4bc9d..a33d5541 100644 --- a/MP.Stats/Pages/TrendAnalysis.razor +++ b/MP.Stats/Pages/TrendAnalysis.razor @@ -23,10 +23,10 @@
- Selezionare impianti per attivare grafici + Selezionare impianti per attivare grafici (fino a @MaxDisplay)
- # Impianti: @NumMacc + # Impianti: @NumMacc | # Rec tot: @TotalCount.ToString("N0")
@@ -54,7 +54,7 @@
- # Rec Sel: @totalCount.ToString("N0") + # Rec Sel: @SelCount.ToString("N0")
diff --git a/MP.Stats/Pages/TrendAnalysis.razor.cs b/MP.Stats/Pages/TrendAnalysis.razor.cs index 11584d01..a24b4f05 100644 --- a/MP.Stats/Pages/TrendAnalysis.razor.cs +++ b/MP.Stats/Pages/TrendAnalysis.razor.cs @@ -3,6 +3,7 @@ using Microsoft.JSInterop; using MP.Data.DbModels; using MP.Data.Services; using MP.Stats.Data; +using NLog.Config; using Org.BouncyCastle.Utilities; using System; using System.Collections.Generic; @@ -37,7 +38,8 @@ namespace MP.Stats.Pages protected string CodFluxSel = "*"; protected string fileName = "TrendAnalysis.csv"; - protected int totalCount = 0; + protected int TotalCount = 0; + protected int SelCount = 0; #endregion Protected Fields @@ -100,6 +102,7 @@ namespace MP.Stats.Pages isLoading = false; } + protected async Task ResetFilter(SelectData newFilter) { SearchRecords = null; @@ -153,17 +156,22 @@ namespace MP.Stats.Pages _reqRes = value; if (value < ResolutionLevel.Custom) { + // verifico selcount valido... che sia almeno MaxDisp/ + if (SelCount == 0) + { + SelCount = TotalCount / NumMacc * MaxDisplay; + } int scale = 256; switch (value) { case ResolutionLevel.Low: - MaxPoints = (int)Math.Round(totalCount / 10 / (double)scale) * scale; + MaxPoints = (int)Math.Round(SelCount / 10 / (double)scale) * scale; break; case ResolutionLevel.Med: - MaxPoints = (int)Math.Round(totalCount / 3 / (double)scale) * scale; + MaxPoints = (int)Math.Round(SelCount / 3 / (double)scale) * scale; break; case ResolutionLevel.High: - MaxPoints = (int)Math.Round(totalCount / (double)scale) * scale; + MaxPoints = (int)Math.Round(SelCount / (double)scale) * scale; break; default: break; @@ -202,7 +210,7 @@ namespace MP.Stats.Pages #endregion Private Properties - private int MaxDisplay = 5; + private int MaxDisplay = 10; #region Private Methods @@ -230,6 +238,7 @@ namespace MP.Stats.Pages // per ogni valore recupero timeserie downsampled fino al num max di quelle ottenibili... int numAdd = 0; + SelCount = 0; var listSel = currFilter.ListIdxMaccSel; foreach (var item in grpDict) { @@ -237,6 +246,7 @@ namespace MP.Stats.Pages if (listSel.Contains(item.Key)) { numAdd++; + SelCount += item.Value.Count; // ora effettuo deduplica valori per tenere un subset minore ed evitare problemi visualizzazione... PlotRecords.AddRange(TimeSeriesUtils.DownsampleFluxModels(item.Value, MaxPoints)); // verifico comunque superamento limite amcchine @@ -251,6 +261,14 @@ namespace MP.Stats.Pages private async Task LoadConfData() { ConfigList = await StatService.ConfigGetAll(); + if (ConfigList.Count > 0) + { + var recConf = ConfigList.Where(x => x.Chiave == "STATS_TrendMaxSelect").FirstOrDefault(); + if (recConf != null) + { + int.TryParse(recConf.Valore, out MaxDisplay); + } + } CodFluxList = await StatService.FluxTypeList(); } @@ -260,7 +278,7 @@ namespace MP.Stats.Pages var listMacchine = await StatService.MachineList(true); NumMacc = listMacchine.Count; SearchRecords = await StatService.FluxLogRawData(currFilter, CodFluxSel, MServ.SearchVal); - totalCount = SearchRecords.Count; + TotalCount = SearchRecords.Count; // se ho un elenco di macchine mostro grafici, altrimenti resoconto FiltData(); diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html index 97817555..d52499ce 100644 --- a/MP.Stats/Resources/ChangeLog.html +++ b/MP.Stats/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

Versione: 6.16.2507.0709

+

Versione: 6.16.2507.0710


Note di rilascio: