From d99188ebc1e33be715d7408d8d580c95555be8d4 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 19 Apr 2017 12:31:21 +0200 Subject: [PATCH] verificata e corretta gestione lettura allarmi (web.config / mode) se mode == "debug --> leggo forzato tutto, altrimenti NO --- MTC_Adapter/MTC_Adapter/AdapterGeneric.cs | 9 ++++++--- MTC_Adapter/MTC_Adapter/AdapterOsai.cs | 7 +++++-- MTC_Adapter/MTC_Adapter/App.config | 2 ++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs b/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs index e6c0aa4..a3ce550 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs @@ -1613,9 +1613,12 @@ namespace MTC_Adapter getPath(); getAxis(); - // DELETEME!!!! - // PATH TEMPORANEO x forzare check allarmi... - forceAlarmCheck(); + // se NON in modalità PROD eseguo chiamate "extra" x allarmi + if (utils.CRS("mode") == "debug") + { + // SOLO in modalità testing forzo il controllo continuo allarmi... + forceAlarmCheck(); + } } // ciclo lento else if (ciclo == gatherCycle.LF) diff --git a/MTC_Adapter/MTC_Adapter/AdapterOsai.cs b/MTC_Adapter/MTC_Adapter/AdapterOsai.cs index d9a5033..93a284b 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterOsai.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterOsai.cs @@ -795,13 +795,16 @@ namespace MTC_Adapter try { // aggiorno vettore allarmi x intero! - Buffer.BlockCopy(MemBlock, 0, AlarmFlags, i, MemBlock.Length); + Buffer.BlockCopy(MemBlock, 0, AlarmFlags, i * 4, 4); } catch (Exception exc) { lg.Error(string.Format("Errore in BLOCKCOPY per indice i = {2},{0}{1}", Environment.NewLine, exc, i)); } - + if (utils.CRI("loglevel") > 5) + { + lg.Info("Bit {0}, MemBlock: {1}", i, MemBlock[0]); + } // segnalo allarme letto! memorizzo allarme nel vettore ack.... retACK_DW0 = utils.setBitOnStFlag(retACK_DW0, true, i); } diff --git a/MTC_Adapter/MTC_Adapter/App.config b/MTC_Adapter/MTC_Adapter/App.config index 5f52632..d3daaeb 100644 --- a/MTC_Adapter/MTC_Adapter/App.config +++ b/MTC_Adapter/MTC_Adapter/App.config @@ -38,6 +38,8 @@ + +