Implement driveable and end of drive condition

r3148 | dcl | 2011-05-20 10:21:08 +1000 (Fri, 20 May 2011) | 1 line
This commit is contained in:
Douglas Clowes
2011-05-20 10:21:08 +10:00
parent 8b995f6d71
commit f0ac8f82d9

View File

@@ -114,6 +114,10 @@ debug_log "rdValue [sct] [sct result]"
debug_log "update result data=$data, oldval=[sct oldval]"
}
# TODO handle end of drive command
if {abs([hval $tc_root/setpoint] - [hval $tc_root/sensor/value]) <= [hval $tc_root/tolerance]} {
sct driving 0
sct print "drivestatus: idle"
}
}
}
}
@@ -732,7 +736,7 @@ debug_log "setPoint $cmd $par"
set rslt [scan $data "DR%6x%4x%6x%2x%4x%2x" the_t the_c the_v the_e the_s the_r]
debug_log "scan result rslt=$rslt, the_t=$the_t , the_c=$the_c , the_v=$the_v , the_e=$the_e , the_s=$the_s , the_r=$the_r"
if {$rslt == 6} {
# TODO handle test start
# handle RVA indication of test start
if {$the_r != 0} {
set data 1
} else {
@@ -812,11 +816,15 @@ debug_log "chkWrite new data for $tc_root [sct] result=$data"
debug_log "drivestatus $tc_root driving=[sct driving]"
if {[sct driving]} {
# TODO handle end of drive command
return busy
} else {
if {abs([hval $tc_root/setpoint] - [hval $tc_root/sensor/value]) <= [hval $tc_root/tolerance]} {
sct driving 0
sct print "drivestatus: idle"
return idle
}
return busy
}
sct print "drivestatus: idle"
return idle
}
proc halt {tc_root} {
@@ -930,7 +938,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable\
set deviceCommand {\
sensor value 1 0 0 float user {RST} {rdTemp} {0} {} {}\
{} setpoint 0 1 0 float user {} {} {0} {setTemp.chkWrite} {}\
{} setpoint 0 1 1 float user {} {} {0} {setTemp.chkWrite} {}\
{} speed 1 1 0 float user {RSR} {rdSpeed} {0} {setSpeed.chkWrite} {}\
{} power 1 0 0 float internal {RSC} {rdPower} {0} {} {}\
{} tower 1 0 0 float internal {RSD} {rdTower} {0} {} {}\