From a89bd65d873cc06382fd18023736c96f50fe8844 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 8 Nov 2019 21:40:13 +0100 Subject: [PATCH] Evitato (forse...) threadLock su chiusura con 50+ rec --- IOB-WIN/IobGeneric.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index 7f8171b3..c72e81ac 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -1170,16 +1170,21 @@ namespace IOB_WIN } currDispData.semIn = Semaforo.SR; } - // segnalo refresh! - if (eh_refreshed != null) + raiseRefresh(currDispData); + } + + private void raiseRefresh(newDisplayData currDispData) + { + if (currDispData.hasData) { - // !!!FIXME !!!FARE migliorare controllo di QUANDO sollevare evento - if (currDispData.semIn != Semaforo.ND || currDispData.semOut != Semaforo.ND || !string.IsNullOrWhiteSpace(currDispData.newLiveLogData)) + // segnalo refresh! + if (eh_refreshed != null) { eh_refreshed(this, new iobRefreshedEventArgs(currDispData)); } } } + /// /// Cerca di inviare su un altro thread i vari dati accumulati... /// @@ -1234,10 +1239,7 @@ namespace IOB_WIN { currDispData.semOut = Semaforo.SR; } - if (currDispData.hasData) - { - parentForm.updateFormDisplay(currDispData); - } + raiseRefresh(currDispData); } /// @@ -2733,7 +2735,7 @@ namespace IOB_WIN { currDispData.semIn = Semaforo.SR; } - parentForm.updateFormDisplay(currDispData); + raiseRefresh(currDispData); } /// /// Effettua gestioen programma: legge e mostra su display... @@ -3306,7 +3308,7 @@ namespace IOB_WIN { currDispData.semOut = Semaforo.SR; } - parentForm.updateFormDisplay(currDispData); + raiseRefresh(currDispData); } /// /// Effettua invio a MoonPro del valore richiesto @@ -3375,7 +3377,7 @@ namespace IOB_WIN { currDispData.semOut = Semaforo.SR; } - parentForm.updateFormDisplay(currDispData); + raiseRefresh(currDispData); } #endregion