Aggiunta metodi x set contapezzi in KAWASAKI

This commit is contained in:
Samuele E. Locatelli
2019-07-24 11:50:06 +02:00
parent edc437b5e5
commit df138a3cf9
2 changed files with 51 additions and 0 deletions
+9
View File
@@ -909,6 +909,15 @@ namespace IOB_WIN
{
return false;
}
/// <summary>
/// Metodo generico di IMPOSTAZIONE FORZATA del contapezzi...
/// </summary>
/// <param name="newPzCount">Pezzi richiesti</param>
/// <returns></returns>
public virtual bool setContapezziCNC(int newPzCount)
{
return false;
}
/// <summary>
/// Verifica e se necessario comprime directory log...
+42
View File
@@ -183,6 +183,20 @@ namespace IOB_WIN
taskOk = resetContapezziCNC();
taskVal = taskOk ? "FORCE RESET PZ COUNT" : "FORCE RESET DISABLED | NO EXEC";
break;
case "forceSetPzCount":
// reset contapezzi inizio setup
int newPzCount = 0;
int.TryParse(item.Value, out newPzCount);
if (newPzCount >= 0)
{
setContapezziCNC(newPzCount);
answ.Add(item.Key, $"FORCE SET PZ COUNT TO {newPzCount}");
}
else
{
answ.Add(item.Key, $"ERROR IN FORCE SET PZ COUNT TO {newPzCount}");
}
break;
case "startSetup":
// reset contapezzi inizio setup
taskOk = resetContapezziCNC();
@@ -234,6 +248,34 @@ namespace IOB_WIN
}
return answ;
}
/// <summary>
/// Effettua IMPOSTAZIONE FORZATA del contapezzi
/// </summary>
/// <returns></returns>
public override bool setContapezziCNC(int newPzCount)
{
bool answ = false;
// ...SE abilitato da conf IOB
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
{
// scrivo valore 0 x il contapezzi
try
{
pzCounter = newPzCount;
}
catch (Exception exc)
{
lgError(exc, "Errore in SET contapezzi KAWASAKI");
connectionOk = false;
}
answ = true;
}
else
{
lgError("Impossibile effettuare SET contapezzi KAWASAKI, mancanza parametro OPT:ENABLE_PZ_RESET");
}
return answ;
}
/// <summary>
/// Imposto connessione