platypus sct_batmotor.tcl

Check for motor on when changing state to idle.
r3142 | ffr | 2011-05-19 08:45:25 +1000 (Thu, 19 May 2011) | 2 lines
This commit is contained in:
Ferdi Franceschini
2011-05-19 08:45:25 +10:00
committed by Douglas Clowes
parent 2e0729532a
commit 41a4f28517

View File

@@ -114,7 +114,7 @@ namespace eval ::scobj::galil {
# NOTE: If you change the status command you must also
# update the rdStatus procedure
proc getStatus {} {
sct send "MG OSCD,POS,_TPD,DBAND"
sct send "MG OSCD,POS,_TPD,DBAND,_MOD"
return rdStatus
}
@@ -132,16 +132,16 @@ namespace eval ::scobj::galil {
default {
if {$data != [sct oldval]} {
sct oldval $data
foreach {OSCD POS TPD DBAND} $data {}
foreach {OSCD POS TPD DBAND MOD} $data {}
if [expr $OSCD == $bat_state(OSC)] {
statemon busy $batName
set newStatus "busy"
} elseif [expr abs($TPD - $POS) < $DBAND] {
} elseif {[expr abs($TPD - $POS) < $DBAND] && $MOD } {
statemon idle $batName
set newStatus "idle"
} else {
statemon busy $batName
set newStatus "busy"
set newStatus "hwfault"
}
if {[sct oldStatus] != $newStatus} {
sct oldStatus $newStatus