dblctrl: smart selection of mode (up, down, stable)

when switching from inactive to active
This commit is contained in:
2024-10-22 10:28:58 +02:00
parent 40487dcb31
commit 6fa7cf8867

View File

@ -447,7 +447,16 @@ proc trun::read_run {} {
}
if {$dblctrl} {
if {[hval [sct]/dblctrl/mode] == 0} { # inactive -> stable
hupdate [sct]/dblctrl/mode 1
set tol [hvali [sct]/tolerance]
set tg [silent $tsample sct target]
if {$tg > $tsample + $tol} {
set dmode 2 ;# up
} elseif {$tg < $tsample - $tol} {
set dmode 3 ;# down
} else {
set dmode 1 ;# stable
}
hupdate [sct]/dblctrl/mode $dmode
}
set value $tsample
} else {