From 2f629be0250a205cce8dd2df43138174abffe581 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 21 Jun 2019 15:35:24 +0200 Subject: [PATCH] inserita gestioen chaive x permettere un secondo reset a fine setup 8tranne siemens torri che blocca DURANTE TUTTO SETUP) --- CVCncLib/testSam.dll | Bin 967680 -> 967680 bytes IOB-WIN/IobFanuc.cs | 13 +++++++------ IOB-WIN/IobGeneric.cs | 9 ++++++--- IOB-WIN/IobKawasaki.cs | 32 ++++++++++++++++++-------------- IOB-WIN/IobSiemensTorri.cs | 27 ++++++--------------------- 5 files changed, 37 insertions(+), 44 deletions(-) diff --git a/CVCncLib/testSam.dll b/CVCncLib/testSam.dll index 039856f61e9916e591ba8bcb5560eeb8482af091..daf0039d88a8c081e6f8058804e216e9f3d81d27 100644 GIT binary patch delta 152 zcmZqZux{wEp3uP}dxs~sv8T0%v9*V(wTHR2ho!ZLwY7(>wTHd6hoiNJv$cn-wTF9a z50Ak@fl!5;n>Wc#bMHLm@;Np}^JM#(g*-sayZy{UzCV0mv!Gxh&zCYJCKM3@#*7SfsBQW0fmeLg^UA*j0A;@1%-?Tg^UM zW93|kr$wabL76UH{rv#|002WeTvc;ra&ugBVQqC~Y-KKUbY)>}cb5pU4jz{$u@29- I{IL!M5=68_+5i9m diff --git a/IOB-WIN/IobFanuc.cs b/IOB-WIN/IobFanuc.cs index 93c9fb15..5c65e0df 100644 --- a/IOB-WIN/IobFanuc.cs +++ b/IOB-WIN/IobFanuc.cs @@ -1,6 +1,4 @@ -using CncLib.CNC; -using IOB_UT; -using System; +using System; using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; @@ -275,8 +273,11 @@ namespace IOB_WIN answ.Add(item.Key, "RESET: SETUP START"); break; case "stopSetup": - // reset contapezzi fine setup - resetContapezziCNC(); + // reset contapezzi fine setup SE ESPLICITAMENTE IMPOSTATO + if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE") + { + resetContapezziCNC(); + } answ.Add(item.Key, "RESET: SETUP END"); break; default: @@ -989,7 +990,7 @@ namespace IOB_WIN } } } - catch(Exception exc) + catch (Exception exc) { lgError(exc, "Eccezione in processOtherCounters"); } diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index 1adaf792..2629233d 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -852,7 +852,7 @@ namespace IOB_WIN /// public virtual Dictionary executeTasks(Dictionary task2exe) { - // Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti... + // Verificare il protocollo: dovrebbe togliere SOLO i task eseguiti... Dictionary taskDone = new Dictionary(); bool taskOk = false; string taskVal = ""; @@ -870,8 +870,11 @@ namespace IOB_WIN taskVal = taskOk ? "RESET: SETUP START" : "PZ RESET DISABLED | NO EXEC"; break; case "stopSetup": - // reset contapezzi fine setup - taskOk = resetContapezziCNC(); + // reset contapezzi fine setup SE ESPLICITAMENTE IMPOSTATO + if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE") + { + taskOk = resetContapezziCNC(); + } taskVal = taskOk ? "RESET: SETUP END" : "PZ RESET DISABLED | NO EXEC"; break; default: diff --git a/IOB-WIN/IobKawasaki.cs b/IOB-WIN/IobKawasaki.cs index d692b6c4..910783c1 100644 --- a/IOB-WIN/IobKawasaki.cs +++ b/IOB-WIN/IobKawasaki.cs @@ -167,8 +167,10 @@ namespace IOB_WIN /// public override Dictionary executeTasks(Dictionary task2exe) { - // Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti... - Dictionary answ = new Dictionary(); + // Verificare il protocollo: dovrebbe togliere SOLO i task eseguiti... + Dictionary taskDone = new Dictionary(); + bool taskOk = false; + string taskVal = ""; // cerco task specifici: se ho startSetup --> imposto bit DBB701.DBB0.4 foreach (var item in task2exe) @@ -178,29 +180,31 @@ namespace IOB_WIN { case "forceResetPzCount": // reset contapezzi inizio setup - resetContapezziCNC(); - answ.Add(item.Key, "FORCE RESET PZ COUNT"); + taskOk = resetContapezziCNC(); + taskVal = taskOk ? "FORCE RESET PZ COUNT" : "FORCE RESET DISABLED | NO EXEC"; break; case "startSetup": // reset contapezzi inizio setup - resetContapezziCNC(); - answ.Add(item.Key, "RESET: SETUP START"); + taskOk = resetContapezziCNC(); + taskVal = taskOk ? "RESET: SETUP START" : "PZ RESET DISABLED | NO EXEC"; break; -#if false case "stopSetup": - // reset contapezzi fine setup - resetContapezziCNC(); - answ.Add(item.Key, "RESET: SETUP END"); + // reset contapezzi fine setup // reset contapezzi fine setup SE ESPLICITAMENTE IMPOSTATO + if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE") + { + resetContapezziCNC(); + } + taskVal = taskOk ? "RESET: SETUP END" : "PZ RESET DISABLED | NO EXEC"; break; -#endif default: - // anche se non faccio nulla SEGNO con value = NOT DONE - answ.Add(item.Key, "UNKNOWN KEY | NO EXEC"); + // anche se non faccio nulla SEGNO con value = SKIPPED + taskVal = "SKIPPED | NO EXEC"; break; } + taskDone.Add(item.Key, taskVal); } - return answ; + return taskDone; } /// /// Effettua reset del contapezzi diff --git a/IOB-WIN/IobSiemensTorri.cs b/IOB-WIN/IobSiemensTorri.cs index 71352a8c..0c83b33f 100644 --- a/IOB-WIN/IobSiemensTorri.cs +++ b/IOB-WIN/IobSiemensTorri.cs @@ -34,30 +34,15 @@ namespace IOB_WIN public override Dictionary executeTasks(Dictionary task2exe) { // Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti... - Dictionary answ = new Dictionary(); + Dictionary taskDone = new Dictionary(); + bool taskOk = false; + string taskVal = ""; // inizio con 1 byte VUOTO byte[] MemBlock = new byte[1]; - string taskVal = ""; // cerco task specifici: se ho startSetup --> imposto bit DBB701.DBB0.4 foreach (var item in task2exe) - { -#if false - // primo metodo: sul VALORE - switch (item.Value) - { - case "startSetup": - MemBlock[0] += (1 << 4); - answ.Add(item.Key, item.Value); - break; - case "stopSetup": - answ.Add(item.Key, item.Value); - break; - default: - // anche se non faccio nulla SEGNO con value = NOT DONE - break; - } -#endif + { taskVal = ""; // controllo sulal KEY switch (item.Key) @@ -74,12 +59,12 @@ namespace IOB_WIN taskVal = "UNKNOWN KEY | NO EXEC"; break; } - answ.Add(item.Key, taskVal); + taskDone.Add(item.Key, taskVal); } // scrivo comunque! bool fatto = S7WriteBB(ref MemBlock); - return answ; + return taskDone; } #region da verificare