From d11d9db560cb4c0af7dcd57841ae5edb499c5e98 Mon Sep 17 00:00:00 2001 From: zebra Date: Tue, 8 Aug 2023 14:27:14 +0200 Subject: [PATCH] fix valve readback the ccu4 firmware does not report changes on valves upon the ? command. fix it: poll explicitly --- tcl/drivers/ccu4.tcl | 18 +++++++++++++++++- tcl/jtccr.config | 4 ---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tcl/drivers/ccu4.tcl b/tcl/drivers/ccu4.tcl index 79fe429..8c99f2e 100644 --- a/tcl/drivers/ccu4.tcl +++ b/tcl/drivers/ccu4.tcl @@ -385,12 +385,14 @@ proc stdConfig::ccu4 {{title CCU4} args} { } elseif {[string match valve* $a]} { set nvalve [string range $a 5 end] for {set ch 1} {$ch <= 12} {incr ch} { - node v$ch upd + node v$ch rd -int 10 + prop read ccu4::readValve v$ch prop enum valve_off,valve_on,no_valve,timeout,timeout1,boost if {$ch > $nvalve} { prop visible false } node vc$ch out -int + prop write ccu4::writeValve v$ch prop enum valve_off,valve_on if {$ch > $nvalve} { prop visible false @@ -404,6 +406,20 @@ proc stdConfig::ccu4 {{title CCU4} args} { return "CCU4" } +proc ccu4::readValve {valve} { + # for some strange reason, v... are not queried with '?' + # we have to do it here + sct send $valve + return ccu4::complete +} + +proc ccu4::writeValve {valve} { + set res [ccu4::write] + # update readback value immediately + hupdate [sct parent]/$valve [sct target] + return $res +} + proc ccu4::completeStart {name} { set resval(cid) 0 set resval(cir) "" diff --git a/tcl/jtccr.config b/tcl/jtccr.config index 9cddd1f..b029595 100644 --- a/tcl/jtccr.config +++ b/tcl/jtccr.config @@ -30,10 +30,6 @@ GraphAdd p4 bar p4 yellow makenv -objname pressreg -driver bronkpreg -port jtccr-ts:3005 18 GraphAdd pressreg bar preg magenta -#makenv -objname v -driver svumot -port jtccr-ts:3006 { -# v1 1 v2 2 v3 3 v4 4 v5 5 v6 6 v7 7 v8 mot -#} - makenv epc epc8210 -port jtccr-ts:3007 {jt-compressor 1 jt-pump 2 ccr-compressor 3}