diff --git a/MP-TAB-SERV/Components/MachineBlock.razor b/MP-TAB-SERV/Components/MachineBlock.razor index 40234416..1e873a49 100644 --- a/MP-TAB-SERV/Components/MachineBlock.razor +++ b/MP-TAB-SERV/Components/MachineBlock.razor @@ -48,7 +48,7 @@ else
- @RecMSE.DescrizioneStato:   @(formatDurata(RecMSE.Durata)) + @RecMSE.DescrizioneStato:   @(FormatDurata(RecMSE.Durata))
@@ -95,7 +95,7 @@ else
@RecMSE.Nome
- @RecMSE.DescrizioneStato:   @(formatDurata(RecMSE.Durata)) + @RecMSE.DescrizioneStato:   @(FormatDurata(RecMSE.Durata))
@if (showCard) @@ -241,7 +241,7 @@ else @RecMSE.DescrizioneStato :
- @(formatDurata(RecMSE.Durata)) + @(FormatDurata(RecMSE.Durata))
diff --git a/MP-TAB-SERV/Components/MachineBlock.razor.cs b/MP-TAB-SERV/Components/MachineBlock.razor.cs index 5fe42ba1..14c65654 100644 --- a/MP-TAB-SERV/Components/MachineBlock.razor.cs +++ b/MP-TAB-SERV/Components/MachineBlock.razor.cs @@ -41,27 +41,22 @@ namespace MP_TAB_SERV.Components /// /// minuti /// - public static string formatDurata(double? minuti) + public static string FormatDurata(double? minuti) { string answ = "??"; - if (minuti != null) + TimeSpan tempo = TimeSpan.FromMinutes(minuti ?? 0); + if (tempo.TotalMinutes < 60) { - DateTime tempo = new DateTime(); - tempo = tempo.AddMinutes((double)minuti); - if (minuti < 60) - { - answ = $"{tempo.Minute:00}:{tempo.Second:00}"; - } - else if (minuti < 1440) - { - answ = $"{tempo.Hour}h {tempo.Minute}m"; - } - else - { - answ = $"{tempo.DayOfYear}g {tempo.Hour}h"; - } + answ = $"{tempo.Minutes:00}:{tempo.Seconds:00}"; + } + else if (tempo.TotalHours < 24) + { + answ = $"{tempo.Hours}h {tempo.Minutes}m"; + } + else + { + answ = $"{tempo.Days}g {tempo.Hours}h"; } - return answ; } diff --git a/MP-TAB-SERV/Components/MseSampler.razor.cs b/MP-TAB-SERV/Components/MseSampler.razor.cs index 81c4d4c8..0f96ac5a 100644 --- a/MP-TAB-SERV/Components/MseSampler.razor.cs +++ b/MP-TAB-SERV/Components/MseSampler.razor.cs @@ -71,7 +71,7 @@ namespace MP_TAB_SERV.Components var pUpd = Task.Run(async () => { aTimer.Interval = fastRefreshMs; - await RefreshData(); + await InvokeAsync(RefreshData); //Log.Trace("MseSampler Timer elapsed"); }); pUpd.Wait(); diff --git a/MP-TAB-SERV/Components/OdlMan.razor b/MP-TAB-SERV/Components/OdlMan.razor index 4aeb60be..d3f6e180 100644 --- a/MP-TAB-SERV/Components/OdlMan.razor +++ b/MP-TAB-SERV/Components/OdlMan.razor @@ -7,7 +7,7 @@ {
@lblWarnHead
-
@lblWarnBody @numPz2Conf
+
@lblWarnBody @numPz2Conf pz NC
@if (!odlOk) { @@ -19,10 +19,32 @@
Slave machine man
- @if (!needConfProd) - { -
- ODL setup (full) +
+ selettore PODL +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
- } + +
+
+ +
+
+ +
\ No newline at end of file diff --git a/MP-TAB-SERV/Components/OdlMan.razor.cs b/MP-TAB-SERV/Components/OdlMan.razor.cs index 8e51ff3f..184f7ba9 100644 --- a/MP-TAB-SERV/Components/OdlMan.razor.cs +++ b/MP-TAB-SERV/Components/OdlMan.razor.cs @@ -1,5 +1,6 @@ using global::Microsoft.AspNetCore.Components; using MP.Data.DatabaseModels; +using MP.Data.Services; namespace MP_TAB_SERV.Components { @@ -13,19 +14,26 @@ namespace MP_TAB_SERV.Components [Parameter] public EventCallback> E_Updated { get; set; } - /// - /// Verifica ODL OK (ovvero caricato x macchina...) - /// - public bool odlOk - { - get => (RecMSE != null && RecMSE.IdxOdl > 0); - } - [Parameter] public MappaStatoExpl? RecMSE { get; set; } = null; #endregion Public Properties + #region Protected Properties + + /// + /// Verifica ODL OK (ovvero caricato x macchina...) + /// + protected bool odlOk + { + get => (RecMSE != null && RecMSE.IdxOdl > 0); + } + + [Inject] + protected SharedMemService SMServ { get; set; } = null!; + + #endregion Protected Properties + #region Protected Methods /// @@ -40,6 +48,11 @@ namespace MP_TAB_SERV.Components await Task.Delay(1); } + protected override void OnInitialized() + { + baseLang = SMServ.GetConf("baseLang"); + } + protected override async Task OnParametersSetAsync() { await Task.Delay(1); @@ -56,16 +69,16 @@ namespace MP_TAB_SERV.Components await Task.Delay(10); } + protected string Traduci(string lemma) + { + return SMServ.Traduci($"{baseLang}_{lemma}".ToUpper()); + } + #endregion Protected Methods #region Private Fields - private string lblWarnBody = "Pezzi da confermare: "; - - private string lblWarnHead = "Attenzione"; - - private int numPz2Conf = 0; - + private string baseLang = "IT"; #endregion Private Fields @@ -80,6 +93,28 @@ namespace MP_TAB_SERV.Components private bool isProcessing { get; set; } = false; + private string lblWarnBody + { + get => odlOk ? Traduci("ConfProdBeforeContinueBody") : Traduci("setOdlBeforeContinueBody"); + } + + private string lblWarnHead + { + get => odlOk ? Traduci("ConfProdBeforeContinueHead") : Traduci("setOdlBeforeContinueHead"); + } + + private bool needConfProd + { + get => (RecMSE != null && RecMSE.PezziProd > RecMSE.PezziConf); + } + + private int numPz2Conf + { + get => RecMSE != null ? RecMSE.PezziProd - RecMSE.PezziConf : 0; + } + + protected bool forceCloseOdl = true; + #endregion Private Properties #region Private Methods @@ -89,7 +124,6 @@ namespace MP_TAB_SERV.Components checkConfProd(); } - private bool needConfProd = true; /// /// verifica se sia necessario confermare la produzione PRIMA di operare sull'ODL /// diff --git a/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs b/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs index 09e834dd..9c7624bf 100644 --- a/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs +++ b/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs @@ -91,12 +91,12 @@ namespace MP_TAB_SERV.Components protected override void OnInitialized() { imgBasePath = Environment.CurrentDirectory; + baseLang = SMServ.GetConf("baseLang"); + enableForceParamSchedaTecnica = SMServ.GetConfBool("enableForceParamSchedaTecnica"); } protected override void OnParametersSet() { - enableForceParamSchedaTecnica = SMServ.GetConfBool("enableForceParamSchedaTecnica"); - baseLang = SMServ.GetConf("baseLang"); if (CurrRec != null) { hasDeroga = false; diff --git a/MP-TAB-SERV/MP-TAB-SERV.csproj b/MP-TAB-SERV/MP-TAB-SERV.csproj index 2a2bed8d..b0ca5e40 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.2310.3110 + 6.16.2310.3111 enable MP_TAB_SERV diff --git a/MP-TAB-SERV/Resources/ChangeLog.html b/MP-TAB-SERV/Resources/ChangeLog.html index 823cb3b1..71928185 100644 --- a/MP-TAB-SERV/Resources/ChangeLog.html +++ b/MP-TAB-SERV/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2310.3110

+

Versione: 6.16.2310.3111


Note di rilascio: