Update modalità simulazione allarmi

This commit is contained in:
Samuele Locatelli
2022-07-01 09:42:36 +02:00
parent 3b429a8008
commit 2f9e194beb
15 changed files with 27 additions and 18 deletions
+3 -3
View File
@@ -43,10 +43,10 @@ MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
; gestione cambio ODL automatico (minuti minimi durata)
MIN_DURATA_ODL=240
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 1 secondo)
PER_BASE=10100
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10100
SIM_PZCNT=5|1
SIM_ALARM=500|20
SIM_ALARM=100|10
SIM_MANU=50|6
; indica gestione e simulazione bit 5 --> slow
SIM_SLOW=3600|20
+1 -1
View File
@@ -37,7 +37,7 @@ CHANGE_ODL_IDLE_MIN=0
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9500
SIM_PZCNT=8|1
SIM_ALARM=900|15
+1 -1
View File
@@ -38,7 +38,7 @@ CHANGE_ODL_IDLE_MIN=0
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10400
SIM_PZCNT=15|1
SIM_ALARM=1000|20
+1 -1
View File
@@ -37,7 +37,7 @@ CHANGE_ODL_IDLE_MIN=0
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10300
SIM_PZCNT=13|1
SIM_ALARM=1000|20
+1 -1
View File
@@ -37,7 +37,7 @@ CHANGE_ODL_IDLE_MIN=0
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10200
SIM_PZCNT=13|1
SIM_ALARM=1000|20
+1 -1
View File
@@ -37,7 +37,7 @@ CHANGE_ODL_IDLE_MIN=0
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9600
SIM_PZCNT=13|1
SIM_ALARM=1000|20
+1 -1
View File
@@ -37,7 +37,7 @@ CHANGE_ODL_IDLE_MIN=0
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9900
SIM_PZCNT=13|1
SIM_ALARM=200|20
+1 -1
View File
@@ -37,7 +37,7 @@ CHANGE_ODL_IDLE_MIN=10
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=13|1
SIM_ALARM=200|10
+1 -1
View File
@@ -44,7 +44,7 @@ ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MIN_DURATA_ODL=240
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10500
SIM_PZCNT=10|3
SIM_ALARM=1000|20
+1 -1
View File
@@ -44,7 +44,7 @@ ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MIN_DURATA_ODL=240
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10400
SIM_PZCNT=10|2
SIM_ALARM=1000|20
+1 -1
View File
@@ -38,7 +38,7 @@ DISABLE_SIM_STATUS=true
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=13|1
SIM_ALARM=200|10
+1 -1
View File
@@ -38,7 +38,7 @@ DISABLE_SIM_STATUS=true
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=13|1
SIM_ALARM=200|10
+1 -1
View File
@@ -38,7 +38,7 @@ DISABLE_SIM_STATUS=true
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=13|1
SIM_ALARM=200|10
+1 -1
View File
@@ -38,7 +38,7 @@ DISABLE_SIM_STATUS=true
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE, default 1 secondo)
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=13|1
SIM_ALARM=200|10
+11 -2
View File
@@ -57,6 +57,11 @@ namespace IOB_WIN_NEXT
/// </summary>
protected DateTime lastSimData;
/// <summary>
/// Ultimo istante in cui sono stati ridotti dati simulazione duration
/// </summary>
protected DateTime lastRedDuration;
/// <summary>
/// Matricola OPR simulato
/// </summary>
@@ -139,6 +144,7 @@ namespace IOB_WIN_NEXT
lastWarnODL = adesso;
lastEvCheck = adesso;
lastSimData = adesso;
lastRedDuration = adesso;
// setup allarmi simulati
for (int i = 1; i <= 8; i++)
{
@@ -213,7 +219,7 @@ namespace IOB_WIN_NEXT
/// <param name="bit2proc"></param>
protected void tryRedDuration(int bit2proc)
{
if (lastEvCheck.AddMilliseconds(periodoMSec) < DateTime.Now)
if (lastRedDuration.AddMilliseconds(periodoMSec) < DateTime.Now)
{
switch (bit2proc)
{
@@ -238,7 +244,7 @@ namespace IOB_WIN_NEXT
default:
break;
}
lastEvCheck = DateTime.Now;
lastRedDuration = DateTime.Now;
}
}
@@ -639,6 +645,9 @@ namespace IOB_WIN_NEXT
answ.wait = rnd.Next(answ.wait / 5, answ.wait * 9 / 5);
// simulo valore duration: in media target, range +/- 50%
answ.duration = rnd.Next(answ.duration / 2, answ.duration * 3 / 2);
// verifico siano > 0...
answ.wait = answ.wait > 0 ? answ.wait : 1;
answ.duration = answ.duration > 0 ? answ.duration : 1;
}
}
}