Update processo avvio sessioni
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
"Cycle": false,
|
||||
"Description": "Check Connection Status",
|
||||
"Max2Keep": 10,
|
||||
"RetrySec": 30,
|
||||
"RetrySec": 20,
|
||||
"SessionName": "SESS0000",
|
||||
"SessionType": "IsConnected",
|
||||
"StepOrder": 0,
|
||||
@@ -46,7 +46,7 @@
|
||||
"Cycle": false,
|
||||
"Description": "Get ID data",
|
||||
"Max2Keep": 10,
|
||||
"RetrySec": 30,
|
||||
"RetrySec": 20,
|
||||
"SessionName": "SESS0001",
|
||||
"SessionType": "GetId",
|
||||
"StepOrder": 1,
|
||||
@@ -65,7 +65,7 @@
|
||||
"2": {
|
||||
"Cycle": false,
|
||||
"Description": "Set DateTime on machine at start",
|
||||
"RetrySec": 30,
|
||||
"RetrySec": 20,
|
||||
"SessionName": "SESS0002",
|
||||
"SessionType": "SetDateTime",
|
||||
"ValidityMinutes": 0.0,
|
||||
@@ -85,7 +85,7 @@
|
||||
"3": {
|
||||
"Cycle": false,
|
||||
"Description": "Abort All prev requests",
|
||||
"RetrySec": 30,
|
||||
"RetrySec": 20,
|
||||
"SessionName": "SESS0003",
|
||||
"SessionType": "AbortAll",
|
||||
"ValidityMinutes": 0.0,
|
||||
|
||||
@@ -103,6 +103,23 @@ namespace IOB_WIN
|
||||
/// </summary>
|
||||
/// <param name="session"></param>
|
||||
/// <returns></returns>
|
||||
protected bool checkRequest(Eurom63.Session session)
|
||||
{
|
||||
bool answ = false;
|
||||
string fileName = "";
|
||||
if (session != null)
|
||||
{
|
||||
fileName = $"{BaseDir}\\{session.SessionName}.REQ";
|
||||
answ = File.Exists(fileName);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se ci sia una risposta POSITIVA
|
||||
/// </summary>
|
||||
/// <param name="session"></param>
|
||||
/// <returns></returns>
|
||||
protected bool checkResp(Eurom63.Session session)
|
||||
{
|
||||
bool answ = false;
|
||||
@@ -122,11 +139,6 @@ namespace IOB_WIN
|
||||
rawData = textReader.ReadToEnd();
|
||||
}
|
||||
answ = rawData.Contains(session.RespOk);
|
||||
if (!answ)
|
||||
{
|
||||
// se NON ok faccio pulizia...
|
||||
cleanupSession(session);
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
@@ -212,7 +224,7 @@ namespace IOB_WIN
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
// evito di richiedere SE non fosse già scaduta richiesta...
|
||||
if (adesso > connectSession.RetryVeto)
|
||||
if (adesso > connectSession.RetryVeto || !checkRequest(connectSession))
|
||||
{
|
||||
// pulisco eventuali risp vecchie
|
||||
cleanupResp(connectSession.SessionName);
|
||||
|
||||
Reference in New Issue
Block a user