sct_oxford_ips.tcl

Set the "setpoint" type to drivable for GumTree and clear the "geterror" property when we get a new reading.

r2981 | ffr | 2010-07-19 17:38:02 +1000 (Mon, 19 Jul 2010) | 3 lines
This commit is contained in:
Ferdi Franceschini
2010-07-19 17:38:02 +10:00
committed by Douglas Clowes
parent 0cdd7119e1
commit 6c6ba7de86

View File

@@ -15,6 +15,9 @@ namespace eval ::scobj::ips120 {
# issue a command to read a register and expect a value response
proc getValue {tc_root nextState cmd} {
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
debug_log "getValue $cmd sct=[sct] root=$tc_root nextState=$nextState"
sct send "@2$cmd"
return $nextState
@@ -138,6 +141,9 @@ debug_log "rdValue new data for $tc_root [sct] result=$data"
# values in the controller in a sequence intended to transition the controller
# between states.
proc getState {tc_root nextState cmd} {
if { [hpropexists [sct] geterror] } {
hdelprop [sct] geterror
}
debug_log "getState $tc_root $nextState $cmd sct=[sct]"
if {[ catch {
set my_state "[SplitReply [hgetprop $tc_root/ips120_state my_state]]"
@@ -719,6 +725,7 @@ debug_log "Registering node $nodeName for write callback"
hsetprop $scobj_hpath privilege spy
::scobj::hinitprops $tempobj setpoint
if {[SplitReply [environment_simulation]]=="false"} {
hsetprop $scobj_hpath/setpoint type drivable
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/setpoint $scobj_hpath/sensor/value $sct_controller
}
} catch_message ]