diff --git a/IOB-WIN/IobFanuc.cs b/IOB-WIN/IobFanuc.cs index 756dbf67..7081ba83 100644 --- a/IOB-WIN/IobFanuc.cs +++ b/IOB-WIN/IobFanuc.cs @@ -589,40 +589,6 @@ namespace IOB_WIN currDispData.semIn = Semaforo.SR; } } -#if false - /// - /// Riporta alla parentForm i valori di RawInput rilevati - /// - public override void reportRawInput() - { - try - { - newDisplayData currDispData = new newDisplayData(); - StringBuilder sb = new StringBuilder($"----------- Read Data Memory -----------"); - int i = 0; - foreach (var item in MemBlockR) - { - sb.Append($"R{i:00} --> {baseUtils.binaryForm(item)} = {(short)item}"); - i++; - } - foreach (var item in MemBlockX) - { - sb.Append($"X{i:00} --> {baseUtils.binaryForm(item)} = {(short)item}"); - i++; - } - foreach (var item in MemBlockY) - { - sb.Append($"Y{i:00} --> {baseUtils.binaryForm(item)} = {(short)item}"); - i++; - } - sb.Append("-------------------------------"); - currDispData.currBitmap = sb.ToString(); - parentForm.updateFormDisplay(currDispData); - } - catch - { } - } -#endif /// /// Effettua decodifica aree memoria alla bitmap usata x MAPO /// @@ -706,15 +672,14 @@ namespace IOB_WIN // verifico se variato contapezzi... if (lastCountCNC > contapezzi) { - // salvo nuovo contapezzi (incremento di 1...) + // salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio contapezzi++; + needRefreshPzCount = true; // salvo in semaforo! B_input += 1 << 2; // registro contapezzi lgInfo(string.Format("Contapezzi FANUC: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi)); } - - // invio a server contapezzi (aggiornato) string retVal = utils.callUrl(urlSetPzCount + contapezzi.ToString()); // verifica se tutto OK @@ -793,23 +758,7 @@ namespace IOB_WIN B_input += 1 << i; } } - -#if false - // da rivedere x gestione contapezzi a bit... - // verifico se si tratta di un segnale contapezzo... nel qual caso conteggio ed invio... - if (currIobConf.optPar["PZCOUNT_MODE"].StartsWith("BIT")) - { - // salvo nuovo contapezzi (incremento di 1...) - contapezzi++; - // invio a server contapezzi (aggiornato) - utils.callUrl(urlSetPzCount + contapezzi.ToString()); - lgInfo("Aggiornato contapezzi: {0}", contapezzi); - // resetto timer... - lastPzCountSend = DateTime.Now; - } -#endif } - } } } diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index cf5ac728..19fa0e6a 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -107,6 +107,10 @@ namespace IOB_WIN /// Indica impianto IN SETUP (fino a quando SMETTE di esserlo...) /// protected bool inSetup = false; + /// + /// Variabile booleana che indica se sia necessario fare refresh del contapezzi + /// + public bool needRefreshPzCount = true; /// /// Indicazione VETO PING a server sino alla data-ora indicata /// @@ -514,7 +518,6 @@ namespace IOB_WIN protected Dictionary VarArray = new Dictionary(); #endregion - /// /// Form chiamante @@ -1215,10 +1218,6 @@ namespace IOB_WIN catch (Exception exc) { string errore = $"Adapter NOT STARTED!!!{Environment.NewLine}{exc}"; - // !!!FARE !!!FIXME aggiungere metodo x status update... -#if false - parentForm.displayTaskAndLog(errore); -#endif adpCommAct = false; adpStartRun = DateTime.Now; currDispData.newLiveLogData = errore; @@ -1259,9 +1258,9 @@ namespace IOB_WIN { if (utils.CRB("enableContapezzi")) { - // rilettura contapezzi da server... SE ABILITATA - lgInfo("Ciclo VLF: pzCntReload(false)"); - pzCntReload(false); + // rilettura contapezzi da server... + lgInfo("Ciclo VLF: pzCntReload(true)"); + pzCntReload(true); // refresh associazione Macchina - IOB sendM2IOB(); } @@ -1428,7 +1427,7 @@ namespace IOB_WIN // se ho contapezzi OLTRE limite... while ((MPOnline) && (lastCountCNC > contapezzi + minSendPzCountBlock)) { - lgInfo($"Inizio svuotaCodaContapezzi --> lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi}"); + lgInfo($"Ciclo svuotaCodaContapezzi --> lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi}"); pzCntReload(true); // provo invio trySendPzCountBlock(); @@ -1448,7 +1447,7 @@ namespace IOB_WIN return; } // aspetto x dare tempo calcolo - Thread.Sleep(300); + Thread.Sleep(400); } } @@ -3269,6 +3268,12 @@ namespace IOB_WIN if (connectionOk) { readSemafori(ref currDispData); + // se richiesto effettuo refresh contapezzi + if (needRefreshPzCount) + { + pzCntReload(true); + needRefreshPzCount = false; + } } else { @@ -3364,8 +3369,6 @@ namespace IOB_WIN { // errore salvataggio contapezzi lgInfo($"trySendPzCountBlock: errore salvataggio contapezzi: contapezzi {contapezzi} | risposta: {retVal}"); - // rileggo il counter pezzi da server - pzCntReload(true); } } else @@ -4214,7 +4217,7 @@ namespace IOB_WIN // se oltre 1 min NON era online --> check pezzi! if (DateTime.Now.Subtract(lastIobOnline).TotalMinutes > 1) { - lgInfo($"sendDataBlock --> offline timeaout ({lastIobOnline}) --> pzCntReload(true)"); + lgInfo($"sendDataBlock --> offline timeout ({lastIobOnline}) --> pzCntReload(true)"); pzCntReload(true); } lastIobOnline = DateTime.Now; diff --git a/IOB-WIN/IobKawasaki.cs b/IOB-WIN/IobKawasaki.cs index 67c2ee12..1656d316 100644 --- a/IOB-WIN/IobKawasaki.cs +++ b/IOB-WIN/IobKawasaki.cs @@ -912,8 +912,9 @@ namespace IOB_WIN // verifico se variato contapezzi... e se passato ritardo minimo... if (lastCountCNC > contapezzi) { - // salvo nuovo contapezzi (incremento di 1...) + // salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio contapezzi++; + needRefreshPzCount = true; // salvo in semaforo! B_input += (1 << 2); // registro contapezzi diff --git a/IOB-WIN/IobOSAI.cs b/IOB-WIN/IobOSAI.cs index 3410c25c..3d4ec93d 100644 --- a/IOB-WIN/IobOSAI.cs +++ b/IOB-WIN/IobOSAI.cs @@ -381,8 +381,9 @@ namespace IOB_WIN // verifico se variato contapezzi in area STD PAR6711... e se passato ritardo minimo... if (lastCountCNC > contapezzi) { - // salvo nuovo contapezzi (incremento di 1...) + // salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio contapezzi++; + needRefreshPzCount = true; // salvo in semaforo! B_input += 1 << 2; // registro contapezzi diff --git a/IOB-WIN/IobSiemensFape.cs b/IOB-WIN/IobSiemensFape.cs index c11fafca..8372d1f7 100644 --- a/IOB-WIN/IobSiemensFape.cs +++ b/IOB-WIN/IobSiemensFape.cs @@ -222,8 +222,9 @@ namespace IOB_WIN // verifico se variato contapezzi... e se passato ritardo minimo... if (lastCountCNC > contapezzi) { - // salvo nuovo contapezzi (incremento di 1...) + // salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio contapezzi++; + needRefreshPzCount = true; // salvo in semaforo! B_input += (1 << 2); // registro contapezzi diff --git a/IOB-WIN/IobSiemensTorri.cs b/IOB-WIN/IobSiemensTorri.cs index 0fcb3f0f..922ea6ff 100644 --- a/IOB-WIN/IobSiemensTorri.cs +++ b/IOB-WIN/IobSiemensTorri.cs @@ -209,8 +209,9 @@ namespace IOB_WIN } if ((lastCountCNC > contapezzi)) { - // salvo nuovo contapezzi (incremento di 1...) + // salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio contapezzi++; + needRefreshPzCount = true; // salvo in semaforo! B_input += 1 << 2; // registro contapezzi diff --git a/IOB-WIN/IobSimula.cs b/IOB-WIN/IobSimula.cs index bdd7e7e6..782046b0 100644 --- a/IOB-WIN/IobSimula.cs +++ b/IOB-WIN/IobSimula.cs @@ -310,7 +310,9 @@ namespace IOB_WIN // segnalo BIT (1 pz) B_input += (1 << 2); sigPzCount = true; + // salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio contapezzi++; + needRefreshPzCount = true; // invio conferma contapezzi.. string retVal = utils.callUrl($"{urlSetPzCount}{contapezzi}"); // verifica salvataggio @@ -422,8 +424,9 @@ namespace IOB_WIN { bit2 = setupSimPar("SIM_PZCNT"); sendContapezzi = true; - // registro contapezzi + // salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio contapezzi++; + needRefreshPzCount = true; lgInfo($"S01: Valori contatori: contapezzi macchina lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi} - incremento contapezzi per bit2.duration <= 0"); } if (sendContapezzi) diff --git a/Jenkinsfile b/Jenkinsfile index 19a8f31e..7e666af6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=681']) { + withEnv(['NEXT_BUILD_NUMBER=682']) { // 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'