From b5840ebed800fd0f88847c592d4cb0c9d8b821f3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 7 Apr 2025 19:18:23 +0200 Subject: [PATCH] TAB3: - Update sequencer x completare 100% --- MP-TAB3/Components/InsManual.razor | 10 +- MP-TAB3/Components/InsManual.razor.cs | 145 +++++++++++++++----------- MP-TAB3/MP-TAB3.csproj | 2 +- MP-TAB3/Resources/ChangeLog.html | 2 +- MP-TAB3/Resources/VersNum.txt | 2 +- MP-TAB3/Resources/manifest.xml | 2 +- MP.Data/Services/TabDataService.cs | 4 +- 7 files changed, 95 insertions(+), 72 deletions(-) diff --git a/MP-TAB3/Components/InsManual.razor b/MP-TAB3/Components/InsManual.razor index 1d29cda2..ae47e4a7 100644 --- a/MP-TAB3/Components/InsManual.razor +++ b/MP-TAB3/Components/InsManual.razor @@ -25,7 +25,7 @@ @if (DayImportRatio != 1) {
- +
} else @@ -38,7 +38,7 @@ }
- +
@if (SeqStatus != null && SeqStatus.Count() > 0) @@ -46,7 +46,7 @@
-
Prod: @($"{DayMinLav:N1}") min (@($"{DayOee:P0}"))
+
Prod: @($"{DayMinLav:N1}") min (@($"{DayOee:P1}"))
Copert: @($"{DayMinTot:N0}") min
@@ -54,7 +54,7 @@
@foreach (var item in SeqStatus) { -
+
@item.Title
@($"{item.Value:N0}min")
@@ -192,7 +192,7 @@ Stato Art. Ora - Pezzi # + Pezzi T.Ciclo Minuti diff --git a/MP-TAB3/Components/InsManual.razor.cs b/MP-TAB3/Components/InsManual.razor.cs index 637099db..9e8028d7 100644 --- a/MP-TAB3/Components/InsManual.razor.cs +++ b/MP-TAB3/Components/InsManual.razor.cs @@ -44,34 +44,6 @@ namespace MP_TAB3.Components #endregion Protected Properties - /// - /// Boolear controllo visualizzazione ricerca articoli - /// - private bool doSearchArt = false; - - /// - /// Abilitazione edit DataOra inizio (solo x primo record, poi devono essere consecutivi... - /// - private bool enableEditTime = false; - - private void SearchArtToggle() - { - doSearchArt = !doSearchArt; - } - - /// - /// Salva selezione articolo - /// - /// - private void SetArtSelected(string codArt) - { - if (EditRecord != null) - { - EditRecord.CodArticolo = codArt; - doSearchArt = false; - } - } - #region Protected Methods protected void AddNew(bool isWork) @@ -105,6 +77,18 @@ namespace MP_TAB3.Components } } + /// + /// Annulla editing + /// + /// + protected void DoCancel() + { + doSearchArt = false; + EditRecord = null; + ReloadData(); + RecalcDayData(dtCurr); + } + /// /// impossta record x eliminazione /// @@ -150,17 +134,6 @@ namespace MP_TAB3.Components } EditRecord = selRec; } - /// - /// Annulla editing - /// - /// - protected void DoCancel() - { - doSearchArt = false; - EditRecord = null; - ReloadData(); - RecalcDayData(dtCurr); - } protected async Task DoSave() { @@ -179,6 +152,7 @@ namespace MP_TAB3.Components } else { + EditRecord.CodArticolo = "ND"; EditRecord.PzBuoni = 0; EditRecord.TCiclo = 0; } @@ -250,6 +224,11 @@ namespace MP_TAB3.Components /// private Dictionary DateCheck = new Dictionary(); + /// + /// % record importati + /// + private double DayImportRatio = 0; + /// /// Minuti lavorati (da sequencer) /// @@ -260,17 +239,23 @@ namespace MP_TAB3.Components /// private double DayMinTot = 0; - /// - /// % record importati - /// - private double DayImportRatio = 0; - /// /// OEE giornaliero (ore lav / 24h) /// private double DayOee = 0; + /// + /// Boolear controllo visualizzazione ricerca articoli + /// + private bool doSearchArt = false; + private InsManualiModel? EditRecord = null; + + /// + /// Abilitazione edit DataOra inizio (solo x primo record, poi devono essere consecutivi... + /// + private bool enableEditTime = false; + private List SeqStatus = new List(); #endregion Private Fields @@ -278,21 +263,27 @@ namespace MP_TAB3.Components #region Private Properties private bool confProdActive { get; set; } = false; + private MappaStatoExpl? currRecMSE { get; set; } = null; + private DateTime dtCurr { get; set; } = DateTime.Today; + private List? ListDay { get; set; } = new List(); + private List? ListDTO { get; set; } = new List(); + /// /// Eventi inseribili come fermate /// private List ListEvents { get; set; } = new List(); + + private List? ListPeriod { get; set; } = new List(); + /// /// Eventi inseribili come fermate /// private Dictionary ListTCiclo { get; set; } = new Dictionary(); - private List? ListPeriod { get; set; } = new List(); - private bool showDetail { get; set; } = false; #endregion Private Properties @@ -346,6 +337,25 @@ namespace MP_TAB3.Components return numChange; } + /// + /// Congela la definizione giornaliera di produzione + /// + /// + private async Task FreezeDay() + { + if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler confermare gli eventi della giornata? i valori non saranno più modificabili.")) + return; + + // esegue stored + bool fatto = false; + if (RecMSE != null) + { + string IdxMacc = RecMSE.IdxMacchina; + fatto = await TabDServ.InsManFreezeDay(IdxMacc, dtCurr); + } + return; + } + private bool IsTimeInfoOk(DateTime reqDate, bool reloadDay) { bool allOk = false; @@ -353,8 +363,13 @@ namespace MP_TAB3.Components if (ListDTO != null) { var dayDto = ListDTO.FirstOrDefault(x => x.DataRif == reqDate.Date); - if (dayDto != null && (ListDay != null || (reloadDay && ListPeriod != null))) + if (dayDto != null && ListDay != null && ListPeriod != null) { + // se listDay vuoto forzo reload... + if (ListDay.Count == 0) + { + reloadDay = true; + } if (reloadDay) { // calcolo eventi giorno @@ -379,22 +394,13 @@ namespace MP_TAB3.Components } /// - /// Congela la definizione giornaliera di produzione + /// Restitusice la % formattata in invariant con "." e senza spazi prima della % /// + /// /// - private async Task FreezeDay() + private string PercWidth(double value) { - if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler confermare gli eventi della giornata? i valori non saranno più modificabili.")) - return; - - // esegue stored - bool fatto = false; - if (RecMSE != null) - { - string IdxMacc = RecMSE.IdxMacchina; - fatto = await TabDServ.InsManFreezeDay(IdxMacc, dtCurr); - } - return; + return value.ToString("P2", CultureInfo.InvariantCulture).Replace(" ", ""); } /// @@ -513,7 +519,24 @@ namespace MP_TAB3.Components await Task.Delay(1); } - #endregion Private Methods + private void SearchArtToggle() + { + doSearchArt = !doSearchArt; + } + /// + /// Salva selezione articolo + /// + /// + private void SetArtSelected(string codArt) + { + if (EditRecord != null) + { + EditRecord.CodArticolo = codArt; + doSearchArt = false; + } + } + + #endregion Private Methods } } \ No newline at end of file diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj index abea74b6..70325420 100644 --- a/MP-TAB3/MP-TAB3.csproj +++ b/MP-TAB3/MP-TAB3.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2504.717 + 6.16.2504.719 enable MP_TAB3 diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html index 5453a690..e41aaedd 100644 --- a/MP-TAB3/Resources/ChangeLog.html +++ b/MP-TAB3/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2504.717

+

Versione: 6.16.2504.719


Note di rilascio:
  • diff --git a/MP-TAB3/Resources/VersNum.txt b/MP-TAB3/Resources/VersNum.txt index e5e3b4d6..d4d89163 100644 --- a/MP-TAB3/Resources/VersNum.txt +++ b/MP-TAB3/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2504.717 +6.16.2504.719 diff --git a/MP-TAB3/Resources/manifest.xml b/MP-TAB3/Resources/manifest.xml index 9c203f0c..ac1137d3 100644 --- a/MP-TAB3/Resources/manifest.xml +++ b/MP-TAB3/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2504.717 + 6.16.2504.719 https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html false diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs index efe09cdf..9ba9c38d 100644 --- a/MP.Data/Services/TabDataService.cs +++ b/MP.Data/Services/TabDataService.cs @@ -1152,7 +1152,7 @@ namespace MP.Data.Services } // se non arrivo a mezzanotte aggiungo "pad finale" var deltaFin = TimeSpan.FromHours(24).Subtract(periodEnd.TimeOfDay); - if (deltaFin.TotalMinutes > 1) + if (deltaFin.TotalMinutes > 0.01) { lastIdxTipo = 0; currRec = new ManualStatusDTO @@ -1160,7 +1160,7 @@ namespace MP.Data.Services IdxTipo = lastIdxTipo, CssBlock = "bg-light text-dark", Title = "missing", - Value = deltaFin.TotalMinutes, + Value = deltaFin.TotalMinutes, ValueMax = 1440 }; result.Add(currRec);