From b54a51def2fc44562b653a4e8054b6d02974f207 Mon Sep 17 00:00:00 2001 From: sans Date: Tue, 24 Oct 2023 13:16:22 +0200 Subject: [PATCH] add flow ctrl hysteresis with automatic nv, do not open nv before value is above 0.5 * (flowmax + flowstd) --- tcl/startup/flow_ctrl.tcl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tcl/startup/flow_ctrl.tcl b/tcl/startup/flow_ctrl.tcl index a2dc8b0..e63be9c 100644 --- a/tcl/startup/flow_ctrl.tcl +++ b/tcl/startup/flow_ctrl.tcl @@ -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} {