From 803c7829ccdd045922f4fbf863316e5cb32fef0d Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 25 Jul 2018 17:37:54 +0200 Subject: [PATCH] aggiunta note decodifica modi siemens/torri + decodifica in sw x modo corrente --- IOB-WIN/DATA/CONF/MMapR.map | 9 +++++ IOB-WIN/IobSiemensTorri.cs | 73 ++++++++++++++++++++++++++++++++----- Jenkinsfile | 2 +- 3 files changed, 74 insertions(+), 10 deletions(-) diff --git a/IOB-WIN/DATA/CONF/MMapR.map b/IOB-WIN/DATA/CONF/MMapR.map index 369dc4db..b2e299d2 100644 --- a/IOB-WIN/DATA/CONF/MMapR.map +++ b/IOB-WIN/DATA/CONF/MMapR.map @@ -23,6 +23,15 @@ 018|AUTO_POWER_OFF |BYTE 019|OVR_FEED |BYTE 020|OVR_SPEED |BYTE +# CURR MODE diviso in BIT: +# B0 (01) = AUTO +# B1 (02) = MDI +# B2 (04) = JOG +# B3 (08) = TeachIN (associato a MDI --> 10) +# B4 (16) = Repos (associato a JOG --> 20) +# B5 (32) = RefPoint (associato a Jog --> 36) +# B6 (64) = Incr1 (associato a Jog --> 68) +# B7 (128) = Incr10 (associato a Jog --> -124 / 132 se UInt) 021|CURR_MODE |BYTE # valori word come UINT 16bit/Word 32bit/DWord 022|COUNT_TOT |WORD diff --git a/IOB-WIN/IobSiemensTorri.cs b/IOB-WIN/IobSiemensTorri.cs index c7271b95..90353bdd 100644 --- a/IOB-WIN/IobSiemensTorri.cs +++ b/IOB-WIN/IobSiemensTorri.cs @@ -516,6 +516,7 @@ namespace IOB_WIN // !!!FARE!!! recuperare da conf memoria, ora HARD CODED outVal.Add("FEED_OVER", RawInput[19].ToString()); outVal.Add("RAPID_OVER", RawInput[20].ToString()); + outVal.Add("CURR_MODE", decodeCurrMode(RawInput[21])); return outVal; } @@ -536,20 +537,74 @@ namespace IOB_WIN decodeToBaseBitmap(); decodeOtherData(); } + + /// + /// decodifica da bitmap il CURRENT MODE del controllo + /// + /// + /// + protected string decodeCurrMode(byte currModeBitmap) + { + string answ = ""; + if (verboseLog) lgInfo(string.Format("CURR_MODE raw data: {0}", utils.binaryForm((int)currModeBitmap))); + // decodifica del MODO... B21 + /* + * CURR MODE diviso in BIT: + * B0 (01) = AUTO + * B1 (02) = MDI + * B2 (04) = JOG + * B3 (08) = TeachIN (associato a MDI --> 10) + * B4 (16) = Repos (associato a JOG --> 20) + * B5 (32) = RefPoint (associato a Jog --> 36) + * B6 (64) = Incr1 (associato a Jog --> 68) + * B7 (128) = Incr10 (associato a Jog --> -124 / 132 se UInt) + * */ + + // modi principali + if (currModeBitmap.SelectBit(0)) + { + answ = "AUTO"; + } + else if (currModeBitmap.SelectBit(1)) + { + answ = "MDI"; + } + else if (currModeBitmap.SelectBit(2)) + { + answ = "JOG"; + } + // modi accessori + if (currModeBitmap.SelectBit(3)) + { + answ += " | TEACH-IN"; + } + if (currModeBitmap.SelectBit(4)) + { + answ += " | REPOS"; + } + if (currModeBitmap.SelectBit(5)) + { + answ += " | REF-POINT"; + } + if (currModeBitmap.SelectBit(6)) + { + answ += " | INCR-1"; + } + if (currModeBitmap.SelectBit(7)) + { + answ += " | INCR-10"; + } + return answ; + } /// /// Decodifica il resto dell'area TORRI x i dati accessori (allarmi, ...) /// private void decodeOtherData() { - //if (verboseLog) - //{ - // int i = 0; - // foreach (var item in RawInput) - // { - // lgInfo(string.Format("Byte[{0:00}]: {1}", i, utils.binaryForm((int)item))); - // i++; - // } - //} + if (verboseLog) + { + + } } /// diff --git a/Jenkinsfile b/Jenkinsfile index ce1f987c..63915b17 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=278']) { + withEnv(['NEXT_BUILD_NUMBER=280']) { // env.versionNumber = VersionNumber(versionNumberString : '1.18.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '1.18.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'