aggiunto gest forcePzCOunt x SIM
This commit is contained in:
@@ -520,6 +520,65 @@ namespace IOB_WIN
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Processo i task richiesti e li elimino dalla coda 1:1 (in realtà SOLO forceSetPzCount x ora)
|
||||
/// </summary>
|
||||
/// <param name="task2exe"></param>
|
||||
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
|
||||
{
|
||||
// Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti...
|
||||
Dictionary<string, string> taskDone = new Dictionary<string, string>();
|
||||
string taskVal = "";
|
||||
// verifico non sia null
|
||||
if (task2exe != null)
|
||||
{
|
||||
// cerco task specifici
|
||||
foreach (var item in task2exe)
|
||||
{
|
||||
taskVal = "";
|
||||
// converto richiesta in enum...
|
||||
taskType tName = taskType.nihil;
|
||||
Enum.TryParse(item.Key, out tName);
|
||||
// controllo sulla KEY
|
||||
switch (tName)
|
||||
{
|
||||
case taskType.setArt:
|
||||
case taskType.nihil:
|
||||
case taskType.fixStopSetup:
|
||||
case taskType.forceResetPzCount:
|
||||
case taskType.sendWatchDogMes2Plc:
|
||||
case taskType.setComm:
|
||||
case taskType.setParameter:
|
||||
case taskType.setProg:
|
||||
case taskType.setPzComm:
|
||||
case taskType.startSetup:
|
||||
case taskType.stopSetup:
|
||||
taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED | NO EXEC";
|
||||
break;
|
||||
|
||||
case taskType.forceSetPzCount:
|
||||
// forzo sul SIM il valore pzCOunt dell'IOB...
|
||||
int newPzCount = contapezziPLC;
|
||||
bool fatto = int.TryParse(item.Value, out newPzCount);
|
||||
if (fatto)
|
||||
{
|
||||
contapezziPLC = newPzCount;
|
||||
taskVal = $"Set new contapezziPLC: {contapezziPLC}";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
taskVal = "SKIPPED | NO EXEC";
|
||||
break;
|
||||
}
|
||||
// aggiungo task!
|
||||
taskDone.Add(item.Key, taskVal);
|
||||
}
|
||||
}
|
||||
|
||||
return taskDone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera e processa allarmi CNC...
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user