From 5e36c0099b154a3ddac0a4f83082c3d7d1c8a8b2 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 7 Nov 2023 17:43:56 +0100 Subject: [PATCH] FIX gestione calcolo timespan/double x tempo --- MP-TAB-SERV/Components/OdlMan.razor.cs | 8 +++---- MP-TAB-SERV/Components/SelTempoMSMC.razor.cs | 22 +++++++++++--------- MP-TAB-SERV/MP-TAB-SERV.csproj | 2 +- 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(+), 18 deletions(-) diff --git a/MP-TAB-SERV/Components/OdlMan.razor.cs b/MP-TAB-SERV/Components/OdlMan.razor.cs index f3b83f9d..32bd0cd0 100644 --- a/MP-TAB-SERV/Components/OdlMan.razor.cs +++ b/MP-TAB-SERV/Components/OdlMan.razor.cs @@ -148,7 +148,7 @@ namespace MP_TAB_SERV.Components await ReloadData(false); } - protected void SaveTCRich(double newTCRich) + protected void SaveTCRich(decimal newTCRich) { tcRichAttr = newTCRich; } @@ -244,7 +244,7 @@ namespace MP_TAB_SERV.Components // se vedesse TCRich a zero lo reimposta a quello assegnato... if (tcRichAttr == 0) { - tcRichAttr = (double)currPodl.Tcassegnato; + tcRichAttr = currPodl.Tcassegnato; } if (enableSplitODL) { @@ -443,7 +443,7 @@ namespace MP_TAB_SERV.Components private bool showAll = false; private bool showOdlDetail = false; - private double tcRichAttr = 1; + private decimal tcRichAttr = 1; #endregion Private Fields @@ -583,7 +583,7 @@ namespace MP_TAB_SERV.Components if (IdxPOdlSel != lastIdxPOdl) { lastIdxPOdl = IdxPOdlSel; - tcRichAttr = (double)currPodl.Tcassegnato; + tcRichAttr = currPodl.Tcassegnato; } } } diff --git a/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs b/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs index c1efc09e..8fd6a164 100644 --- a/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs +++ b/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs @@ -46,7 +46,7 @@ namespace MP_TAB_SERV.Components [Parameter] - public EventCallback E_TCRich { get; set; } + public EventCallback E_TCRich { get; set; } /// /// modalità rendering controllo @@ -66,7 +66,7 @@ namespace MP_TAB_SERV.Components /// Valore tempo (centesimale) /// [Parameter] - public double TempoMC + public decimal TempoMC { get => _tempoMC; set @@ -83,7 +83,7 @@ namespace MP_TAB_SERV.Components /// /// tempo min.cent /// - protected double _tempoMC { get; set; } = 0; + protected decimal _tempoMC { get; set; } = 0; //protected timeMode modoTempo //{ @@ -108,7 +108,7 @@ namespace MP_TAB_SERV.Components [Inject] protected SharedMemService SMServ { get; set; } = null!; [Inject] - protected MessageService MsgServ { get; set; } = null!; + protected MessageService MsgServ { get; set; } = null!; protected string tcMode { @@ -140,9 +140,9 @@ namespace MP_TAB_SERV.Components /// /// /// - protected TimeSpan minCent2Sec(double valore) + protected TimeSpan minCent2Sec(decimal valore) { - TimeSpan answ = TimeSpan.FromMinutes(valore); + TimeSpan answ = TimeSpan.FromSeconds((double)valore * 60); return answ; } @@ -151,9 +151,11 @@ namespace MP_TAB_SERV.Components /// /// /// - protected double minSec2Cent(TimeSpan valore) + protected decimal minSec2Cent(TimeSpan valore) { - double answ = Math.Round(valore.TotalMinutes, 3); + + decimal answ = 0; + decimal.TryParse($"{Math.Floor(valore.TotalMinutes) + (double)valore.Seconds / 60}", out answ); return answ; } @@ -232,8 +234,8 @@ namespace MP_TAB_SERV.Components { if (tcMode == "mc") { - double tMC = 1; - double.TryParse(value, out tMC); + decimal tMC = 1; + decimal.TryParse(value, out tMC); TempoMC = tMC; } else diff --git a/MP-TAB-SERV/MP-TAB-SERV.csproj b/MP-TAB-SERV/MP-TAB-SERV.csproj index 972a0e06..d863617d 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.2311.716 + 6.16.2311.717 enable MP_TAB_SERV diff --git a/MP-TAB-SERV/Resources/ChangeLog.html b/MP-TAB-SERV/Resources/ChangeLog.html index 8c31ce1a..9117a407 100644 --- a/MP-TAB-SERV/Resources/ChangeLog.html +++ b/MP-TAB-SERV/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2311.716

+

Versione: 6.16.2311.717


Note di rilascio:
  • diff --git a/MP-TAB-SERV/Resources/VersNum.txt b/MP-TAB-SERV/Resources/VersNum.txt index b980696d..3e6d87f5 100644 --- a/MP-TAB-SERV/Resources/VersNum.txt +++ b/MP-TAB-SERV/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2311.716 +6.16.2311.717 diff --git a/MP-TAB-SERV/Resources/manifest.xml b/MP-TAB-SERV/Resources/manifest.xml index b295e334..d9ac748e 100644 --- a/MP-TAB-SERV/Resources/manifest.xml +++ b/MP-TAB-SERV/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2311.716 + 6.16.2311.717 https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html false