From f28cd74b4ba68ff29530d9a5b8b868057c1fb8c5 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 27 Feb 2020 15:31:20 +0100 Subject: [PATCH] Inserita mitigazione x evitare prolemi con loop send contapezzi --- IOB-WIN/DATA/CONF/SIMUL_01.ini | 2 +- IOB-WIN/IobGeneric.cs | 18 ++++++++++++++++++ Jenkinsfile | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/IOB-WIN/DATA/CONF/SIMUL_01.ini b/IOB-WIN/DATA/CONF/SIMUL_01.ini index 2697886d..850caedd 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_01.ini +++ b/IOB-WIN/DATA/CONF/SIMUL_01.ini @@ -39,7 +39,7 @@ PZCOUNT_MODE=BIT ENABLE_PZ_RESET=TRUE ;gestione invio pezzi in blocco ENABLE_SEND_PZC_BLOCK=TRUE -MIN_SEND_PZC_BLOCK=5 +MIN_SEND_PZC_BLOCK=0 MAX_SEND_PZC_BLOCK=100 ; conf parametri memoria READ/WRITE PARAM_CONF=SIMUL_01.json diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index b1d6a765..3032f91c 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -1422,6 +1422,9 @@ namespace IOB_WIN private void svuotaCodaContapezzi() { + // permetto al max 2 tentativi infruttuosi... + int maxTry = 2; + int oldContapezzi = contapezzi; // se ho contapezzi OLTRE limite... while ((MPOnline) && (lastCountCNC > contapezzi + minSendPzCountBlock)) { @@ -1429,6 +1432,21 @@ namespace IOB_WIN pzCntReload(true); // provo invio trySendPzCountBlock(); + // verifica per evitare loop infinito invio fallito + if (oldContapezzi == contapezzi) + { + maxTry--; + } + else + { + maxTry = 2; + oldContapezzi = contapezzi; + } + // verifico maxTry: se li ho esauriti esco! + if (maxTry <= 0) + { + return; + } // aspetto x dare tempo calcolo Thread.Sleep(300); } diff --git a/Jenkinsfile b/Jenkinsfile index 746cf47a..78e4a6b1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=679']) { + withEnv(['NEXT_BUILD_NUMBER=680']) { // env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'