Merge branch 'release/FixFiltroEventiMTConnect'

This commit is contained in:
Samuele Locatelli
2021-12-14 09:33:35 +01:00
3 changed files with 69 additions and 37 deletions
+3 -3
View File
@@ -202,9 +202,9 @@ namespace IOB_UT_NEXT
public List<diCheckCondition> condWork { get; set; } = new List<diCheckCondition>();
/// <summary>
/// Indica se l'emergenza armata va indicata come TRUE
/// true --> armata --> bit 1
/// false --> triggered --> bit 1
/// Indica se l'emergenza armata va riportata verso Mapo come bit a TRUE
/// True --> armata = 1 / triggered = 0
/// False --> triggered = 1 / armata = 0
/// </summary>
public bool emergencyArmedTrue { get; set; } = true;
+32 -15
View File
@@ -1,30 +1,47 @@
{
"keyPartCount": "part_count_all_1",
"keyPartCount": "M7010B4214N_56",
"keyPartReq": "",
"keyPartId": "",
"keyProgName": "program_1",
"keyRunMode": "controller_mode_1",
"keyEStop": "emergency_stop",
"pingAsPowerOn": true,
"keyProgName": "M7010B4214N_64",
"keyRunMode": "M7010B4214N_46",
"keyEStop": "M7010B4214N_3",
"pingAsPowerOn": false,
"emergencyArmedTrue": false,
"condPowerOn": {
"keyName": "availability",
"keyName": "M7010B4214N_2",
"targetValue": "AVAILABLE"
},
"condWork": [
{
"keyName": "execution_1",
"keyName": "M7010B4214N_53",
"targetValue": "ACTIVE"
}
],
"fluxLogVeto": [
"M7010B4214N_9",
"M7010B4214N_19",
"M7010B4214N_14",
"M7010B4214N_26",
"M7010B4214N_32",
"M7010B4214N_36",
"M7010B4214N_45",
"M7010B4214N_49",
"M7010B4214N_50",
"M7010B4214N_54",
"M7010B4214N_55",
"M7010B4214N_59",
"M7010B4214N_60",
"M7010B4214N_63"
],
"itemTranslation": {
"availability": "Machine Available",
"execution_1": "Execution Mode",
"controller_mode_1": "Controller Mode",
"program_1": "Program Name",
"part_count_all_1": "Contapezzi",
"part_count_target_1": "Qta Richiesta",
"path_feedrate_override_prog_1": "PATH FEED OVERRIDE",
"path_feedrate_override_rapid_1": "PATH RAPID OVERRIDE"
"M7010B4214N_2": "Machine Available",
"M7010B4214N_53": "Execution Mode",
"M7010B4214N_46": "Controller Mode",
"M7010B4214N_64": "Program Name",
"M7010B4214N_56": "Contapezzi",
"M7010B4214N_58": "Qta Richiesta",
"M7010B4214N_61": "PATH FEED OVERRIDE",
"M7010B4214N_62": "PATH RAPID OVERRIDE"
},
"paramsEndThresh": {
"PosAct": 50,
+34 -19
View File
@@ -237,10 +237,21 @@ namespace IOB_WIN_NEXT
// verifico se salvare
bool changed = checkSaveItem(dataItem);
// cerco se non sia un dato filtrato in FLUXLOG...
if (changed || forceSend)
// cerco se non sia un dato filtrato in FLUXLOG...
bool isFiltered = mtcParams.fluxLogVeto.Contains(dataItem.DataItemId);
if (isFiltered)
{
accodaFLog(sVal, qEncodeFLog(time2, descr, dataItem.CDATA));
if (isVerboseLog)
{
lgInfo($"NON ACCODATO sample per {dataItem.DataItemId} poiché trovato VETO in fluxLogVeto", false);
}
}
else
{
if (changed || forceSend)
{
accodaFLog(sVal, qEncodeFLog(time2, descr, dataItem.CDATA));
}
}
}
}
@@ -318,22 +329,19 @@ namespace IOB_WIN_NEXT
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
* B5: emergenza (dipende da state machine se riportare 1 = armata/premuta, vedere conf mtcParams.emergencyArmedTrue)
----------------------------------------------------- */
// Controllo booleano PING e POWERON...
string currPowerOn = getDataItemValue(mtcParams.condPowerOn.keyName);
// se valido il check ping lo eseguo... altrimenti lo do x buono
bool checkPing = !mtcParams.pingAsPowerOn;
if (!checkPing)
{
checkPing = (testPingMachine == IPStatus.Success);
}
bool isPingOk = (testPingMachine == IPStatus.Success);
// verifico da target value richiesto...
bool checkPowerOn = (currPowerOn == mtcParams.condPowerOn.targetValue);
// bit 0 (poweron) imposto a 1 SE pingo o PowerOn=="ON"...
B_input = (checkPing || checkPowerOn) ? 1 : 0;
B_input = ((isPingOk && mtcParams.pingAsPowerOn) || checkPowerOn) ? 1 : 0;
// variabili RUN...
string currRun = getDataItemValue(mtcParams.keyRunMode);
@@ -358,11 +366,6 @@ namespace IOB_WIN_NEXT
B_input += (1 << 1);
}
}
// emergenza premuta = 1
else if (hasEStopTriggered && !mtcParams.emergencyArmedTrue)
{
B_input += (1 << 5);
}
// se ho almeno 1 allarme E NON SONO IN AUTO --> ALARM!
else if (hasError)
{
@@ -374,11 +377,23 @@ namespace IOB_WIN_NEXT
B_input += (1 << 4);
}
// emergenza armata = 1
if (!hasEStopTriggered && mtcParams.emergencyArmedTrue)
// emergenza armata da riportare con bit True/ 1
if (mtcParams.emergencyArmedTrue)
{
B_input += (1 << 5);
//se NON premuta lazo il bit
if (!hasEStopTriggered)
{
B_input += (1 << 5);
}
}
// emergenza armata da riportare come False/0 (!mtcParams.emergencyArmedTrue)
else
{
// se premuta alzo il bit...
if (hasEStopTriggered)
{
B_input += (1 << 5);
}
}
DateTime adesso = DateTime.Now;