diff --git a/IOB-WIN/DATA/CONF/IMI_50.ini b/IOB-WIN/DATA/CONF/IMI_50.ini index 05f918fb..ecb457e0 100644 --- a/IOB-WIN/DATA/CONF/IMI_50.ini +++ b/IOB-WIN/DATA/CONF/IMI_50.ini @@ -59,6 +59,7 @@ DISABLE_PZCOUNT=TRUE ENABLE_DYN_DATA=FALSE FORCE_DYN_DATA=TRUE ENABLE_DATA_FILTER=TRUE +ENABLE_MTC_RESTART=TRUE ; conf parametri memoria READ/WRITE PARAM_CONF=IMI_50.json diff --git a/IOB-WIN/IobMTC.cs b/IOB-WIN/IobMTC.cs index 57b2f3f5..1c500d26 100644 --- a/IOB-WIN/IobMTC.cs +++ b/IOB-WIN/IobMTC.cs @@ -39,6 +39,14 @@ namespace IOB_WIN /// protected DateTime vetoCheckStatus = DateTime.Now; /// + /// Ultimo current received x gestione update periodico... + /// + protected DateTime lastCurrent = DateTime.Now.AddMinutes(-1); + /// + /// Abilitazione restart (da opt par...) + /// + protected bool enableMtcRestart = false; + /// /// Secondi standard x veto check status e log /// protected int vetoSeconds = 5; @@ -78,6 +86,12 @@ namespace IOB_WIN { bool.TryParse(getOptPar("ENABLE_DATA_FILTER"), out enableDataFilter); } + // gestione restart MTC client... + if (!string.IsNullOrEmpty(getOptPar("ENABLE_MTC_RESTART"))) + { + bool.TryParse(getOptPar("ENABLE_MTC_RESTART"), out enableMtcRestart); + } + // init datetime counters lastPzCountSend = DateTime.Now; lastWarnODL = DateTime.Now; } @@ -1047,13 +1061,40 @@ namespace IOB_WIN // se ho run mode != auto --> manual B_input += (1 << 4); } - // solo se non ho veto check + + DateTime adesso = DateTime.Now; + int vFactor = 1; + // controllo SE HO dati per fare verifiche... + if (string.IsNullOrEmpty(currRun) || string.IsNullOrEmpty(currExe) || string.IsNullOrEmpty(currUnOpStatus)) + { + // se ho parametro x gestione reset... + if (enableMtcRestart) + { + // controllo se ho ricevuto il current da OLTRE 1 minuto... + if (lastCurrent.AddMinutes(1) < adesso) + { + // stop... + lgInfo("Fermato MTC_ref per mancanza dati current"); + MTC_ref.Stop(); + Thread.Sleep(2000); + // restart + lgInfo("Riavviato MTC_ref per mancanza dati current"); + MTC_ref.Start(); + } + } + } + else + { + vFactor = 2; + } + + // solo se non ho veto check if (vetoCheckStatus < adesso) { lgInfo($"Stato variabili: currRun: {currRun} | currExe: {currExe} | currUnOpStatus: {currUnOpStatus}"); // imposto veto per vetoSeconds... - vetoCheckStatus = adesso.AddSeconds(vetoSeconds); + vetoCheckStatus = adesso.AddSeconds(vetoSeconds * vFactor); } #if false diff --git a/Jenkinsfile b/Jenkinsfile index c047dd45..3819e84f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=567']) { + withEnv(['NEXT_BUILD_NUMBER=568']) { // env.versionNumber = VersionNumber(versionNumberString : '2.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '2.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'