diff --git a/tcl/drivers/cryotel.tcl b/tcl/drivers/cryotel.tcl index f4eb3ea..801cdd7 100644 --- a/tcl/drivers/cryotel.tcl +++ b/tcl/drivers/cryotel.tcl @@ -26,10 +26,9 @@ proc stdConfig::cryotel {} { node cool wr prop label Cool - prop enum on,off - prop writecmd "SET SSTOP=%i" - prop readcmd "SET SSTOP{2}" - prop readfmt "SET SSTOP ,%i" + prop enum 1 + prop write cryotel::writecool + prop read cryotel::readcool node control wr default 1 @@ -219,3 +218,23 @@ proc cryotel::checkcontrol {} { hsetprop [sct] write stdSct::write } } + +proc cryotel::writecool {} { + set flag [expr ! [sct target]] + sct send "SET SSTOP=$flag" + sct update [sct target] + return stdSct::complete +} + +proc cryotel::readcool {} { + sct send "SET SSTOP{2}" + return cryotelboa::updatecool +} + +proc cryotel::updatecool {} { + lassign [split [sct result] ,] _ value + sct update [expr $value == 0] + return idle +} + + diff --git a/tcl/drivers/cryotelboa.tcl b/tcl/drivers/cryotelboa.tcl index f87021c..c86f64a 100644 --- a/tcl/drivers/cryotelboa.tcl +++ b/tcl/drivers/cryotelboa.tcl @@ -28,10 +28,9 @@ proc stdConfig::cryotelboa {} { node cool wr prop label Cool - prop enum on,off - prop writecmd "SET SSTOP=%i" - prop readcmd "SET SSTOP{2}" - prop readfmt "SET SSTOP ,%i" + prop enum 1 + prop read cryotelboa::readcool + prop write cryotelboa::writecool node control wr default 1 @@ -193,3 +192,22 @@ proc cryotelboa::checkcontrol {} { sct write stdSct::write } } + +proc cryotelboa::writecool {} { + set flag [expr ! [sct target]] + sct send "SET SSTOP=$flag" + sct update [sct target] + return stdSct::complete +} + +proc cryotelboa::readcool {} { + sct send "SET SSTOP{2}" + return cryotelboa::updatecool +} + +proc cryotelboa::updatecool {} { + lassign [split [sct result] ,] _ value + sct update [expr $value == 0] + return idle +} +