add flow ctrl hysteresis

with automatic nv, do not open nv before value is above
0.5 * (flowmax + flowstd)
This commit is contained in:
2023-10-24 13:16:22 +02:00
parent 5c5f0d3ef7
commit b54a51def2

View File

@ -30,7 +30,17 @@ proc flow::loop {difget flowget flowset path flowstd flowlim} {
set flowtarget $setval
}
putIntoLimits flowtarget $flowstd $flowlim
hupdate $path/flowtarget $flowtarget
set suppress_auto [silent 0 sct suppress_auto]
if {$suppress_auto || $flowtarget > ($flowstd + $flowlim) * 0.5} {
sct suppress_auto 0
hupdate $path/flowtarget $flowtarget
} else {
if {$flowtarget < $flowstd + 0.1} {
sct suppress_auto 1
} else {
hupdate $path/flowtarget $flowtarget
}
}
}
proc flow::bufferPut {path name var value} {