dblctrl: smart selection of mode (up, down, stable)
when switching from inactive to active
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user