From fd69a196d274c852762f8057f967087015800c91 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 21 Oct 2022 09:24:13 +0200 Subject: [PATCH] fix date snapshot --- MP.SPEC/Components/ListPARAMS.razor.cs | 29 ++++++++++++++++++++++++++ MP.SPEC/Components/ParamsFilter.razor | 2 +- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index 2ef8726a..31574c02 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -3,6 +3,7 @@ using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.SPEC.Data; using System.Diagnostics; +using MP.Data; namespace MP.SPEC.Components { @@ -156,6 +157,7 @@ namespace MP.SPEC.Components protected async Task resetSel() { currRecord = null; + setDtMax(); await RecordSel.InvokeAsync(null); } @@ -163,6 +165,8 @@ namespace MP.SPEC.Components { currRecord = selRec; SelFilter.IdxMacchina = selRec.IdxMacchina; + SelDtMax = selRec.dtEvento; + //selDtMin = RoundDatetime(5).AddHours(-25); await reloadData(false); await RecordSel.InvokeAsync(selRec); } @@ -224,8 +228,33 @@ namespace MP.SPEC.Components private DateTime? SelDtMax { get => SelFilter.dtMax; + set => SelFilter.dtMax = value; + } + protected void setDtMax() + { + // copio il filtro + var currFilt = SelFilter; + // fermo update + currFilt.LiveUpdate = true; + currFilt.CurrPage = 0; + currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}"; + currFilt.dtMax = RoundDatetime(5); + currFilt.dtMin = RoundDatetime(5).AddHours(-25); + SelFilter = currFilt; } + /// + /// Inizializzazione con periodo e arrotondamento + /// + /// + /// + public static DateTime RoundDatetime(int minRound) + { + TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today); + int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound; + DateTime endRounded = DateTime.Today.AddMinutes(minDay); + return endRounded; + } private int totalCount { get => _totalCount; diff --git a/MP.SPEC/Components/ParamsFilter.razor b/MP.SPEC/Components/ParamsFilter.razor index 769761eb..ae01c039 100644 --- a/MP.SPEC/Components/ParamsFilter.razor +++ b/MP.SPEC/Components/ParamsFilter.razor @@ -38,7 +38,7 @@ - +
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 64c4f598..78cd04e0 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.2017 + 6.16.2210.2108 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 2728c632..d09628d3 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.2017

+

Versione: 6.16.2210.2108


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 8564b4af..2c89aa63 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.2017 +6.16.2210.2108 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 286026b9..d0f6c5a6 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.2017 + 6.16.2210.2108 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