calmierata riduzione status attivo

This commit is contained in:
Samuele E. Locatelli
2020-10-21 18:19:04 +02:00
parent 884c2bab05
commit 15d4cc2af5
2 changed files with 37 additions and 12 deletions
+36 -11
View File
@@ -17,6 +17,8 @@ namespace IOB_WIN
{
#region Protected Fields
protected static DateTime lastStatusDecr = DateTime.Now;
/// <summary>
/// step di comunicazione attivo
/// </summary>
@@ -87,18 +89,24 @@ namespace IOB_WIN
private void checkSessionActive(Eurom63.Session currSession, Eurom63.ComLevel nextLevel)
{
// SOLO SE ha senso che controllo (sono in sampling...)
if (actLevel > Eurom63.ComLevel.ChannelOk)
if (actLevel > Eurom63.ComLevel.HasInfo)
{
DateTime adesso = DateTime.Now;
// devono essere ATTIVE le sessioni di campionamento... e NON scadute
if (!currSession.Active || currSession.SessionValidUntil < adesso)
{
// elimino TUTTE le risposte...
cleanupResp(currSession.SessionName);
// imposto livellotornando indietro di 1 alla volta... senza andare in negativoS
actLevel = actLevel - 1;
actLevel = actLevel > 0 ? actLevel : 0;
lgInfo($"Sessione inattiva, {actLevel + 1} --> {actLevel}");
// controllo ultimo downgrade status
if (lastStatusDecr.AddSeconds(3) < adesso)
{
// elimino TUTTE le risposte...
cleanupResp(currSession.SessionName);
// registro downgrade status...
lastStatusDecr = adesso;
// imposto livellotornando indietro di 1 alla volta... senza andare in negativoS
actLevel = actLevel - 1;
actLevel = actLevel > 0 ? actLevel : 0;
lgInfo($"Sessione inattiva, {actLevel + 1} --> {actLevel}");
}
}
}
}
@@ -747,6 +755,19 @@ namespace IOB_WIN
lgError($"Lettura file stato in errore: trovate {numRow} linee");
}
}
// se valido RILEGGO ultimo curr status
if (Last_CurrStatus.ValidUntil > adesso)
{
currStatus = Last_CurrStatus.Value;
}
}
else
{
// se valido RILEGGO ultimo curr status
if (Last_CurrStatus.ValidUntil > adesso)
{
currStatus = Last_CurrStatus.Value;
}
}
}
else
@@ -756,10 +777,14 @@ namespace IOB_WIN
{
currStatus = Last_CurrStatus.Value;
}
else
{
actLevel = Eurom63.ComLevel.ChannelOk;
}
}
}
else
{
// se valido RILEGGO ultimo curr status
if (Last_CurrStatus.ValidUntil > adesso)
{
currStatus = Last_CurrStatus.Value;
}
}
Vendored
+1 -1
View File
@@ -9,7 +9,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=737']) {
withEnv(['NEXT_BUILD_NUMBER=738']) {
// env.versionNumber = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO-IOB-WIN'