From 25ed89891192087e01cce8d2f3232a14464fa6cc Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 16 Nov 2017 18:54:46 +0100 Subject: [PATCH] COrretto gestione override (dava errore x memorie pasticciate tra dynData e overrides...) --- IOB-WIN/IobFanuc.cs | 40 +++++++++++++++------------------ IOB-WIN/IobGeneric.cs | 51 +++++++++++++++++++++++-------------------- Jenkinsfile | 2 +- 3 files changed, 46 insertions(+), 47 deletions(-) diff --git a/IOB-WIN/IobFanuc.cs b/IOB-WIN/IobFanuc.cs index d45022d0..666410e5 100644 --- a/IOB-WIN/IobFanuc.cs +++ b/IOB-WIN/IobFanuc.cs @@ -492,32 +492,28 @@ namespace IOB_WIN { Dictionary outVal = new Dictionary(); inizio = DateTime.Now; - - if (utils.CRB("enableOverrides")) + // leggo da G0 a G30 perché DOVREBBE contenere tutto quanto mi serve: G12 FeedOver, G30 SpeedOver... + try { - // leggo da G0 a G30 perché DOVREBBE contenere tutto quanto mi serve: G12 FeedOver, G30 SpeedOver... - try - { - inizio = DateTime.Now; - int memIndex = 0; - byte[] MemBlock = new byte[30]; - FanucMemRW(R, FANUC.MemType.G, memIndex, ref MemBlock); - if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-G", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks); + inizio = DateTime.Now; + int memIndex = 0; + byte[] MemBlock = new byte[30]; + FanucMemRW(R, FANUC.MemType.G, memIndex, ref MemBlock); + if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-G", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks); - // SALVO! G12 e G30... - string allG = ""; - for (int i = 0; i < MemBlock.Length; i++) - { - allG += string.Format("{0}:{1}#", i, MemBlock[i]); - } - outVal.Add("OVERRIDES", allG); - //outVal.Add("FEED_OVER", string.Format("G10 {0}#G11 {1}#G12 {3}", MemBlock[10], MemBlock[11], MemBlock[12])); - //outVal.Add("SPEED_OVER", string.Format("G27 {0}#G28 {1}#G29 {3}", MemBlock[27], MemBlock[28], MemBlock[29])); - } - catch (Exception exc) + // SALVO! G12 e G30... + string allG = ""; + for (int i = 0; i < MemBlock.Length; i++) { - lg.Error(exc, "Errore in getOverrides"); + allG += string.Format("{0}:{1}#", i, MemBlock[i]); } + outVal.Add("OVERRIDES", allG); + //outVal.Add("FEED_OVER", string.Format("G10 {0}#G11 {1}#G12 {3}", MemBlock[10], MemBlock[11], MemBlock[12])); + //outVal.Add("SPEED_OVER", string.Format("G27 {0}#G28 {1}#G29 {3}", MemBlock[27], MemBlock[28], MemBlock[29])); + } + catch (Exception exc) + { + lg.Error(exc, "Errore in getOverrides"); } return outVal; } diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index 13063f98..b90ea734 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -1621,32 +1621,35 @@ namespace IOB_WIN /// public virtual void processOverride() { - Dictionary currOverride = new Dictionary(); - if (!DemoIn) + if (utils.CRB("enableOverrides")) { - currOverride = getDynData(); - } - else - { - currOverride.Add("OVERRIDES", string.Format("D-{0:HHmm}", DateTime.Now)); - } - // verifico SE sia cambiato il programma... - if (lastOverride != currOverride["OVERRIDES"]) - { - // salvo! - lastDynData = currOverride["OVERRIDES"]; - // per ogni valore del dizionario mostro ed accodo! - string sVal = ""; - foreach (var item in currOverride) + Dictionary currOverride = new Dictionary(); + if (!DemoIn) { - sVal = string.Format("[OVERRIDES]{0}|{1}", item.Key, item.Value); - displayOtherData(sVal); - // --> accodo (valore già formattato)! - QueueFLog.Enqueue(qEncodeFLog(item.Key, item.Value)); - // Gestione counter FLog! - counterFLog++; - // se supera 10k resetto... - if (counterFLog > 9999) counterFLog = 0; + currOverride = getOverrides(); + } + else + { + currOverride.Add("OVERRIDES", string.Format("D-{0:HHmm}", DateTime.Now)); + } + // verifico SE sia cambiato il programma... + if (lastOverride != currOverride["OVERRIDES"]) + { + // salvo! + lastOverride = currOverride["OVERRIDES"]; + // per ogni valore del dizionario mostro ed accodo! + string sVal = ""; + foreach (var item in currOverride) + { + sVal = string.Format("[OVERRIDES]{0}|{1}", item.Key, item.Value); + displayOtherData(sVal); + // --> accodo (valore già formattato)! + QueueFLog.Enqueue(qEncodeFLog(item.Key, item.Value)); + // Gestione counter FLog! + counterFLog++; + // se supera 10k resetto... + if (counterFLog > 9999) counterFLog = 0; + } } } } diff --git a/Jenkinsfile b/Jenkinsfile index dcc1b3ed..0347c8f1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=179']) { + withEnv(['NEXT_BUILD_NUMBER=180']) { // env.versionNumber = VersionNumber(versionNumberString : '1.15.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '1.15.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'