From 515e06f853f465612cbcdf6fdb48c7c28b00fcff Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 15 Dec 2023 11:09:34 +0100 Subject: [PATCH] Fix display progressbar --- MP-TAB-SERV/Components/CmpFooter.razor | 4 +--- MP-TAB-SERV/Components/CmpFooter.razor.cs | 19 +++++++++++++------ MP-TAB-SERV/MP-TAB-SERV.csproj | 6 +++--- MP-TAB-SERV/Resources/ChangeLog.html | 2 +- MP-TAB-SERV/Resources/VersNum.txt | 2 +- MP-TAB-SERV/Resources/manifest.xml | 2 +- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/MP-TAB-SERV/Components/CmpFooter.razor b/MP-TAB-SERV/Components/CmpFooter.razor index 25b798f0..b433d9e4 100644 --- a/MP-TAB-SERV/Components/CmpFooter.razor +++ b/MP-TAB-SERV/Components/CmpFooter.razor @@ -3,9 +3,7 @@ MP-TAB2 @(DateTime.Today.Year) | v.@version
-
-
-
+
@($"{DateTime.Now:HH:mm:ss}") | Egalware diff --git a/MP-TAB-SERV/Components/CmpFooter.razor.cs b/MP-TAB-SERV/Components/CmpFooter.razor.cs index cfaecd10..57939cca 100644 --- a/MP-TAB-SERV/Components/CmpFooter.razor.cs +++ b/MP-TAB-SERV/Components/CmpFooter.razor.cs @@ -18,17 +18,21 @@ namespace MP_TAB_SERV.Components } } - protected string dtScadProg { get; set; } = ""; + public double CurrExpVal { get; set; } = 50; + public double MaxExpVal { get; set; } = 100; + public double yLimit { get; set; } = 30; + public double rLimit { get; set; } = 10; + public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e) { var pUpd = Task.Run(async () => - { - var diffOfTime = DateTime.Now.Subtract(MsgServ.dtLastAction); - dtScadProg = $"{((int)diffOfTime.TotalMinutes * 100) / dtScadLogin}%"; - await InvokeAsync(() => StateHasChanged()); - }); + { + var diffOfTime = DateTime.Now.Subtract(MsgServ.dtLastAction); + CurrExpVal = MaxExpVal - diffOfTime.TotalMinutes; + await InvokeAsync(() => StateHasChanged()); + }); pUpd.Wait(); } @@ -66,6 +70,9 @@ namespace MP_TAB_SERV.Components var rawVers = typeof(Program).Assembly.GetName().Version; version = rawVers != null ? rawVers : new Version("0.0.0.0"); dtScadLogin = SMServ.GetConfInt("TAB_dtTimerScadLogin"); + MaxExpVal = dtScadLogin; + yLimit = MaxExpVal * 0.3; + rLimit = MaxExpVal * 0.1; StartTimer(); } diff --git a/MP-TAB-SERV/MP-TAB-SERV.csproj b/MP-TAB-SERV/MP-TAB-SERV.csproj index bea92305..a6bea2e8 100644 --- a/MP-TAB-SERV/MP-TAB-SERV.csproj +++ b/MP-TAB-SERV/MP-TAB-SERV.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2312.1510 + 6.16.2312.1511 enable MP_TAB_SERV @@ -17,8 +17,8 @@ - - + + diff --git a/MP-TAB-SERV/Resources/ChangeLog.html b/MP-TAB-SERV/Resources/ChangeLog.html index a5d4db60..26129563 100644 --- a/MP-TAB-SERV/Resources/ChangeLog.html +++ b/MP-TAB-SERV/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2312.1510

+

Versione: 6.16.2312.1511


Note di rilascio: