vers 298: decodifica bit segnali!!!

This commit is contained in:
Samuele E. Locatelli
2018-11-23 10:50:19 +01:00
parent 138f0bca90
commit 64d0c393e0
8 changed files with 30 additions and 106 deletions
Binary file not shown.
+2 -8
View File
@@ -20,13 +20,7 @@ CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
BITRED=Y8.4
BITYELLOW=Y8.5
BITGREEN=Y8.6
AREAD_START=0
AREAD_SIZE=9999
AREAY_START=0
AREAY_SIZE=64
BIT2=PZCOUNT.MEM.350
[BLINK]
;MAX_COUNTER_BLINK = 30
@@ -44,7 +38,7 @@ BLINK_FILT=0
[OPTPAR]
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=STD.MEM.250
PZCOUNT_MODE=STD.MEM.350
PZ_CAD_MADDR=1602
PZ_REQ_MADDR=1603
PZ_DONE_MADDR=1604
+2 -8
View File
@@ -19,14 +19,8 @@ CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
BITRED=Y8.4
BITYELLOW=Y8.5
BITGREEN=Y8.6
AREAD_START=0
AREAD_SIZE=9999
AREAY_START=0
AREAY_SIZE=64
[MEMORY]
BIT2=PZCOUNT.MEM.250
[BLINK]
;MAX_COUNTER_BLINK = 30
+2 -8
View File
@@ -20,13 +20,7 @@ CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
BITRED=Y8.4
BITYELLOW=Y8.5
BITGREEN=Y8.6
AREAD_START=0
AREAD_SIZE=9999
AREAY_START=0
AREAY_SIZE=64
BIT2=PZCOUNT.MEM.350
[BLINK]
;MAX_COUNTER_BLINK = 30
@@ -44,7 +38,7 @@ BLINK_FILT=0
[OPTPAR]
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=STD.MEM.250
PZCOUNT_MODE=STD.MEM.350
PZ_CAD_MADDR=1602
PZ_REQ_MADDR=1603
PZ_DONE_MADDR=1604
+2 -8
View File
@@ -19,14 +19,8 @@ CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
BITRED=Y8.4
BITYELLOW=Y8.5
BITGREEN=Y8.6
AREAD_START=0
AREAD_SIZE=9999
AREAY_START=0
AREAY_SIZE=64
[MEMORY]
BIT2=PZCOUNT.MEM.250
[BLINK]
;MAX_COUNTER_BLINK = 30
+2 -8
View File
@@ -22,14 +22,8 @@ CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
BITRED=Y8.4
BITYELLOW=Y8.5
BITGREEN=Y8.6
AREAD_START=0
AREAD_SIZE=9999
AREAY_START=0
AREAY_SIZE=64
[MEMORY]
BIT2=PZCOUNT.MEM.29
[BLINK]
;MAX_COUNTER_BLINK = 30
+19 -65
View File
@@ -500,7 +500,6 @@ namespace IOB_WIN
processMemoryDiscon();
}
}
/// <summary>
/// lettura principale (bit semafori)
/// </summary>
@@ -550,15 +549,7 @@ namespace IOB_WIN
// decodifico impiegando dictionary... cercando il TIPO di memoria & co...
string bKey = "";
string bVal = "";
char area;
// valore INVERTED (default è false)
bool invSignal = false;
string memArea = "";
string[] memIdx;
int bitNum = 0;
int byteNum = 0;
int byte2check = 0;
string bVal = "";
for (int i = 0; i < 8; i++)
{
bKey = string.Format("BIT{0}", i);
@@ -624,62 +615,25 @@ namespace IOB_WIN
}
}
}
else // area "normale" byte.bit
// controllo le condizioni x costruire il bit1 RUN!
if (oData.mode_select == 2 && oData.status == 2)
{
// di norma è segnale normale => 1, altrimenti inverse => 0...
invSignal = false;
// cerco se sia inverse (ultimo char "!") --> registro e elimino char...
invSignal = bVal.StartsWith("!");
// tolgo comunque inversione...
bVal = bVal.Replace("!", "");
// recupero area...
area = bVal[0];
// altrimenti decodifico area...
memArea = bVal.Substring(1, bVal.Length - 1);
memIdx = memArea.Split('.');
// calcolo bit e byte number...
int.TryParse(memIdx[0], out byteNum);
if (memIdx.Length > 1)
{
int.TryParse(memIdx[1], out bitNum);
}
// in base al nome cerco in una delle aree.. e prendo solo solo quel bit di quel byte...
#if false
switch (area)
{
case 'G':
byte2check = MemBlockG[byteNum];
break;
case 'R':
byte2check = MemBlockR[byteNum];
break;
case 'X':
byte2check = MemBlockX[byteNum];
break;
case 'Y':
byte2check = MemBlockY[byteNum];
break;
default:
break;
}
#endif
// a secondo che sia segnale normale o inverso...
if (invSignal)
{
// controllo se il bit sia NON attivo (basso)... == 0...
if ((byte2check & (1 << bitNum)) == 0)
{
B_input += 1 << i;
}
}
else
{
// controllo se il bit sia attivo (alto)... != 0
if ((byte2check & (1 << bitNum)) != 0)
{
B_input += 1 << i;
}
}
B_input += 1 << 1;
}
// errore su bit3
if (oData.mode_select == 6)
{
B_input += 1 << 3;
}
// auto su bit4
if (oData.mode_select != 2)
{
B_input += 1 << 4;
}
// emergenza su bit5
if (oData.mode_select == 9)
{
B_input += 1 << 5;
}
}
}
Vendored
+1 -1
View File
@@ -16,7 +16,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=297']) {
withEnv(['NEXT_BUILD_NUMBER=298']) {
// 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'