inserita gestioen chaive x permettere un secondo reset a fine setup 8tranne siemens torri che blocca DURANTE TUTTO SETUP)

This commit is contained in:
Samuele E. Locatelli
2019-06-21 15:35:24 +02:00
parent 27c56036d5
commit 2f629be025
5 changed files with 37 additions and 44 deletions
Binary file not shown.
+7 -6
View File
@@ -1,6 +1,4 @@
using CncLib.CNC;
using IOB_UT;
using System;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.NetworkInformation;
@@ -275,8 +273,11 @@ namespace IOB_WIN
answ.Add(item.Key, "RESET: SETUP START");
break;
case "stopSetup":
// reset contapezzi fine setup
resetContapezziCNC();
// reset contapezzi fine setup SE ESPLICITAMENTE IMPOSTATO
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
{
resetContapezziCNC();
}
answ.Add(item.Key, "RESET: SETUP END");
break;
default:
@@ -989,7 +990,7 @@ namespace IOB_WIN
}
}
}
catch(Exception exc)
catch (Exception exc)
{
lgError(exc, "Eccezione in processOtherCounters");
}
+6 -3
View File
@@ -852,7 +852,7 @@ namespace IOB_WIN
/// <param name="task2exe"></param>
public virtual Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti...
// Verificare il protocollo: dovrebbe togliere SOLO i task eseguiti...
Dictionary<string, string> taskDone = new Dictionary<string, string>();
bool taskOk = false;
string taskVal = "";
@@ -870,8 +870,11 @@ namespace IOB_WIN
taskVal = taskOk ? "RESET: SETUP START" : "PZ RESET DISABLED | NO EXEC";
break;
case "stopSetup":
// reset contapezzi fine setup
taskOk = resetContapezziCNC();
// reset contapezzi fine setup SE ESPLICITAMENTE IMPOSTATO
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
{
taskOk = resetContapezziCNC();
}
taskVal = taskOk ? "RESET: SETUP END" : "PZ RESET DISABLED | NO EXEC";
break;
default:
+18 -14
View File
@@ -167,8 +167,10 @@ namespace IOB_WIN
/// <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> answ = new Dictionary<string, string>();
// Verificare il protocollo: dovrebbe togliere SOLO i task eseguiti...
Dictionary<string, string> taskDone = new Dictionary<string, string>();
bool taskOk = false;
string taskVal = "";
// cerco task specifici: se ho startSetup --> imposto bit DBB701.DBB0.4
foreach (var item in task2exe)
@@ -178,29 +180,31 @@ namespace IOB_WIN
{
case "forceResetPzCount":
// reset contapezzi inizio setup
resetContapezziCNC();
answ.Add(item.Key, "FORCE RESET PZ COUNT");
taskOk = resetContapezziCNC();
taskVal = taskOk ? "FORCE RESET PZ COUNT" : "FORCE RESET DISABLED | NO EXEC";
break;
case "startSetup":
// reset contapezzi inizio setup
resetContapezziCNC();
answ.Add(item.Key, "RESET: SETUP START");
taskOk = resetContapezziCNC();
taskVal = taskOk ? "RESET: SETUP START" : "PZ RESET DISABLED | NO EXEC";
break;
#if false
case "stopSetup":
// reset contapezzi fine setup
resetContapezziCNC();
answ.Add(item.Key, "RESET: SETUP END");
// reset contapezzi fine setup // reset contapezzi fine setup SE ESPLICITAMENTE IMPOSTATO
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
{
resetContapezziCNC();
}
taskVal = taskOk ? "RESET: SETUP END" : "PZ RESET DISABLED | NO EXEC";
break;
#endif
default:
// anche se non faccio nulla SEGNO con value = NOT DONE
answ.Add(item.Key, "UNKNOWN KEY | NO EXEC");
// anche se non faccio nulla SEGNO con value = SKIPPED
taskVal = "SKIPPED | NO EXEC";
break;
}
taskDone.Add(item.Key, taskVal);
}
return answ;
return taskDone;
}
/// <summary>
/// Effettua reset del contapezzi
+6 -21
View File
@@ -34,30 +34,15 @@ namespace IOB_WIN
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti...
Dictionary<string, string> answ = new Dictionary<string, string>();
Dictionary<string, string> taskDone = new Dictionary<string, string>();
bool taskOk = false;
string taskVal = "";
// inizio con 1 byte VUOTO
byte[] MemBlock = new byte[1];
string taskVal = "";
// cerco task specifici: se ho startSetup --> imposto bit DBB701.DBB0.4
foreach (var item in task2exe)
{
#if false
// primo metodo: sul VALORE
switch (item.Value)
{
case "startSetup":
MemBlock[0] += (1 << 4);
answ.Add(item.Key, item.Value);
break;
case "stopSetup":
answ.Add(item.Key, item.Value);
break;
default:
// anche se non faccio nulla SEGNO con value = NOT DONE
break;
}
#endif
{
taskVal = "";
// controllo sulal KEY
switch (item.Key)
@@ -74,12 +59,12 @@ namespace IOB_WIN
taskVal = "UNKNOWN KEY | NO EXEC";
break;
}
answ.Add(item.Key, taskVal);
taskDone.Add(item.Key, taskVal);
}
// scrivo comunque!
bool fatto = S7WriteBB(ref MemBlock);
return answ;
return taskDone;
}
#region da verificare