This block is used to compute the stage index of the plant or of multiple lead/lag units such as pump groups.
At initial time, stage #0 is active.
The transition to stage #1 is triggered when stage #0 has been active
for the minimum runtime and when either the Enable signal u1
has a rising edge or when the stage up signal u1Up is true.
From stage #i, the transition to stage #i+1 (resp. i-1) is triggered
when stage #i has been active for the minimum runtime and when the
stage up signal u1Up (resp. stage down signal u1Dow)
is true.
From stage #i, the transition to stage #0 is triggered
when stage #i has been active for the minimum runtime and the Enable signal
u1 is false.