cryotel: fix cool flag

This commit is contained in:
2023-07-04 11:37:56 +02:00
parent ec5b087613
commit 19e7b3e636
2 changed files with 45 additions and 8 deletions

View File

@ -26,10 +26,9 @@ proc stdConfig::cryotel {} {
node cool wr node cool wr
prop label Cool prop label Cool
prop enum on,off prop enum 1
prop writecmd "SET SSTOP=%i" prop write cryotel::writecool
prop readcmd "SET SSTOP{2}" prop read cryotel::readcool
prop readfmt "SET SSTOP ,%i"
node control wr node control wr
default 1 default 1
@ -219,3 +218,23 @@ proc cryotel::checkcontrol {} {
hsetprop [sct] write stdSct::write 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
}

View File

@ -28,10 +28,9 @@ proc stdConfig::cryotelboa {} {
node cool wr node cool wr
prop label Cool prop label Cool
prop enum on,off prop enum 1
prop writecmd "SET SSTOP=%i" prop read cryotelboa::readcool
prop readcmd "SET SSTOP{2}" prop write cryotelboa::writecool
prop readfmt "SET SSTOP ,%i"
node control wr node control wr
default 1 default 1
@ -193,3 +192,22 @@ proc cryotelboa::checkcontrol {} {
sct write stdSct::write 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
}