Aggiunta stack trace su errore + condizione run esclusa se vuota

This commit is contained in:
Samuele Locatelli
2021-12-14 15:29:17 +01:00
parent 38eb421c78
commit 30e85e6627
2 changed files with 25 additions and 12 deletions
+20 -10
View File
@@ -500,7 +500,6 @@ namespace IOB_WIN_NEXT
private void UA_ref_eh_MonItChange(object sender, opcUaMonitItemChange e)
{
checkAndSend(e.CurrMonitoredItem, $"{e.CurrNotify.Value}", false);
lastCurrent = DateTime.Now;
}
@@ -548,19 +547,30 @@ namespace IOB_WIN_NEXT
// cerco nell'elenco delle condizioni che indicano lavora se sono ok faccio +1 conteggio......
foreach (var item in checkList)
{
if (getDataItemValue(item.keyName) == item.targetValue)
if (string.IsNullOrEmpty(item.keyName))
{
numCondOk++;
lgError($"Attenzione: item vuoto in checkMultiCondition{Environment.NewLine}StackTrace: {Environment.StackTrace}");
}
else
{
if (getDataItemValue(item.keyName) == item.targetValue)
{
numCondOk++;
}
}
}
if (checkMode == boolCheckMode.AND)
{
answ = (numCond == numCondOk);
}
else if (checkMode == boolCheckMode.OR)
{
answ = numCondOk > 0;
}
}
if (checkMode == boolCheckMode.AND)
else
{
answ = (numCond == numCondOk);
}
else if (checkMode == boolCheckMode.OR)
{
answ = numCondOk > 0;
answ = true;
}
return answ;
}
@@ -864,7 +874,7 @@ namespace IOB_WIN_NEXT
string answ = "";
if (string.IsNullOrEmpty(diKey))
{
lgError("Attenzione: richiesta chiave vuota in getDataItemValue");
lgError($"Attenzione: richiesta chiave vuota in getDataItemValue{Environment.NewLine}StackTrace: {Environment.StackTrace}");
}
else
{
+5 -2
View File
@@ -70,7 +70,7 @@ namespace IOB_WIN_NEXT
// se valido il check ping lo eseguo... altrimenti lo do x buono
bool checkPing = !opcUaParams.pingAsPowerOn;
string currRun = "";
string currRun = "N.A.";
if (!checkPing)
{
checkPing = (testPingMachine == IPStatus.Success);
@@ -83,7 +83,10 @@ namespace IOB_WIN_NEXT
B_input = powerOnOk ? 1 : 0;
// variabili RUN...
currRun = getDataItemValue(opcUaParams.keyRunMode);
if (!string.IsNullOrEmpty(opcUaParams.keyRunMode))
{
currRun = getDataItemValue(opcUaParams.keyRunMode);
}
// salvo running come = working...
isRunning = isWorking;