diff --git a/MP.SPEC/Components/DossiersFilter.razor b/MP.SPEC/Components/DossiersFilter.razor index 906f5c56..f62d936c 100644 --- a/MP.SPEC/Components/DossiersFilter.razor +++ b/MP.SPEC/Components/DossiersFilter.razor @@ -18,8 +18,8 @@ } } - - + + diff --git a/MP.SPEC/Components/DossiersFilter.razor.cs b/MP.SPEC/Components/DossiersFilter.razor.cs index eefd1f4f..2ae4b100 100644 --- a/MP.SPEC/Components/DossiersFilter.razor.cs +++ b/MP.SPEC/Components/DossiersFilter.razor.cs @@ -37,6 +37,7 @@ namespace MP.SPEC.Components } } } + protected string selMacchina { diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs index 454b7827..f2989711 100644 --- a/MP.SPEC/Components/ParamsFilter.razor.cs +++ b/MP.SPEC/Components/ParamsFilter.razor.cs @@ -201,10 +201,12 @@ namespace MP.SPEC.Components // fermo udpate liveUpdate = false; // se non ho data rif uso adesso... - DateTime dtRif = SelFilter.dtRif == null ? DateTime.Now : (DateTime)SelFilter.dtRif; + DateTime dtMax = SelFilter.dtMax == null ? DateTime.Now : (DateTime)SelFilter.dtMax; + DateTime dtMin = SelFilter.dtMin == null ? DateTime.Now : (DateTime)SelFilter.dtMin; // aggiungo 2 sec - dtRif = dtRif.AddSeconds(1); - await MDService.DossiersTakeParamsSnapshot(selMacchina, 10, dtRif); + dtMax = dtMax.AddSeconds(15); + dtMin = dtMin.AddMinutes(-30); + await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax); lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}"; } @@ -261,6 +263,25 @@ namespace MP.SPEC.Components } } } + private DateTime? dtMin + { + get => SelFilter.dtMin; + set + { + if (SelFilter.dtMin != value) + { + // copio il filtro + var currFilt = SelFilter; + // fermo update + currFilt.LiveUpdate = false; + currFilt.CurrPage = 0; + currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}"; + currFilt.dtMin = value; + SelFilter = currFilt; + reportChange(); + } + } + } [Inject] private NavigationManager NavManager { get; set; } = null!; diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 7210a2a1..ab2d312b 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -368,6 +368,27 @@ namespace MP.SPEC.Data redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1)); return answ; } + + /// + /// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis + /// + /// macchina + /// NUm massimo secondi per recuperare dati correnti + /// DataOra riferimento x cui prendere valori antecedenti + /// + public async Task DossiersTakeParamsSnapshotLast(string IdxMacchina, DateTime dtMin, DateTime dtMax) + { + bool answ = false; + await Task.Delay(1); + // chiamo stored x salvare parametri + dbController.DossiersTakeParamsSnapshotLast(IdxMacchina, dtMin, dtMax); + // svuoto cache redis x macchina + string currKey = $"{redisDossByMac}:{IdxMacchina}"; + redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1)); + currKey = $"{redisDossByMac}:*"; + redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1)); + return answ; + } /// /// Restitusice elenco aziende diff --git a/MP.SPEC/Data/SelectFluxParams.cs b/MP.SPEC/Data/SelectFluxParams.cs index 4f416c7a..bf17616f 100644 --- a/MP.SPEC/Data/SelectFluxParams.cs +++ b/MP.SPEC/Data/SelectFluxParams.cs @@ -15,6 +15,7 @@ public int CurrPage { get; set; } = 1; public DateTime? dtRif { get; set; } = null; public DateTime? dtMax { get; set; } = null; + public DateTime? dtMin { get; set; } = null; public string IdxMacchina { get; set; } = "*"; public string lastUpdate { get; set; } = "-"; public bool LiveUpdate { get; set; } = true; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 1a5d061f..0a551df9 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2209.2716 + 6.16.2209.2717 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 55703e20..a728c15a 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2209.2716

+

Versione: 6.16.2209.2717


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index c950d49c..4d19dd32 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2209.2716 +6.16.2209.2717 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index e107bb05..f797a793 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2209.2716 + 6.16.2209.2717 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false