diff --git a/MP-TAB3/Components/OdlMan.razor.cs b/MP-TAB3/Components/OdlMan.razor.cs index c3b8d3be..31b390e9 100644 --- a/MP-TAB3/Components/OdlMan.razor.cs +++ b/MP-TAB3/Components/OdlMan.razor.cs @@ -733,7 +733,7 @@ namespace MP_TAB3.Components { if (!setupActive) { - if (RecMSE != null) + if (RecMSE != null && !RecMSE.Equals(lastRecMSE)) { if (string.IsNullOrEmpty(IdxMaccSel)) { @@ -749,11 +749,20 @@ namespace MP_TAB3.Components } } IdxMaccParent = getIdxMaccParent(); + checkAll(); +#if false + } +#endif + // verifica stato inAttr + await CheckAttr(); +#if false + if (RecMSE != null && !RecMSE.Equals(lastRecMSE)) + { +#endif + await ReloadData(true); + //salvo lastRec... + lastRecMSE = RecMSE; } - checkAll(); - // verifica stato inAttr - await CheckAttr(); - await ReloadData(true); } // verifica conferma produzione datiProdAct = await TabDServ.StatoProdMacchina(IdxMaccSel, DateTime.Now); @@ -1136,6 +1145,7 @@ namespace MP_TAB3.Components private ODLExpModel currOdl { get; set; } = new ODLExpModel(); private PODLExpModel currPodl { get; set; } = new PODLExpModel(); private MappaStatoExpl? currRecMSE { get; set; } = null; + private MappaStatoExpl? lastRecMSE { get; set; } = null; /// /// Verifica se l'ALTRA macchina NON abbia ODL valido (== 0) diff --git a/MP.Data/DatabaseModels/MappaStatoExpl.cs b/MP.Data/DatabaseModels/MappaStatoExpl.cs index e76a8963..276feae3 100644 --- a/MP.Data/DatabaseModels/MappaStatoExpl.cs +++ b/MP.Data/DatabaseModels/MappaStatoExpl.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; +using System.Data; #nullable disable // @@ -159,5 +160,102 @@ namespace MP.Data.DatabaseModels return PezziProd >= NumPezzi; } } + + public override bool Equals(object obj) + { + if (!(obj is MappaStatoExpl item)) + return false; + + if (RowNum != item.RowNum) + return false; + + if (LastUpdate != item.LastUpdate) + return false; + + if (IdxMacchina != item.IdxMacchina) + return false; + + if (CodMacchina != item.CodMacchina) + return false; + + if (Nome != item.Nome) + return false; + + if (Url != item.Url) + return false; + + if (IdxOdl != item.IdxOdl) + return false; + + if (IdxPOdl != item.IdxPOdl) + return false; + + if (CodArticolo != item.CodArticolo) + return false; + + if (Disegno != item.Disegno) + return false; + + if (NumPezzi != item.NumPezzi) + return false; + + if (TCAssegnato != item.TCAssegnato) + return false; + + if (DataInizioOdl != item.DataInizioOdl) + return false; + + if (Semaforo != item.Semaforo) + return false; + + if (IdxStato != item.IdxStato) + return false; + + if (DescrizioneStato != item.DescrizioneStato) + return false; + + if (Durata != item.Durata) + return false; + + if (PezziProd != item.PezziProd) + return false; + + if (PezziConf != item.PezziConf) + return false; + + if (TempoOn != item.TempoOn) + return false; + + if (TempoAuto != item.TempoAuto) + return false; + + if (TempoRun != item.TempoRun) + return false; + + if (TCMedio != item.TCMedio) + return false; + + if (TCLav != item.TCLav) + return false; + + if (TCEff != item.TCEff) + return false; + + if (TCMedioRt != item.TCMedioRt) + return false; + + if (TCLavRT != item.TCLavRT) + return false; + + if (TCEffRT != item.TCEffRT) + return false; + + return true; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } } }