Eliminate the speed is to low error message when the actual speed is less than 3100 rpm, just set lamba=99999

Update message prefix for new velocity selector controller.

r2872 | ffr | 2010-01-20 15:13:24 +1100 (Wed, 20 Jan 2010) | 3 lines
This commit is contained in:
Ferdi Franceschini
2010-01-20 15:13:24 +11:00
committed by Douglas Clowes
parent 4068f99180
commit 30002eb404

View File

@@ -155,7 +155,7 @@ proc rdPwdAck {} {
## ##
# @brief Request a state report from the velocity selector # @brief Request a state report from the velocity selector
proc getStatus {} { proc getStatus {} {
sct send "#SOS#STATE " sct send "N#SOS#STATE "
return rdState return rdState
} }
@@ -172,7 +172,7 @@ proc rdPwdAck {} {
if {[string match {*#SES#You are not a valid user*} $staterep]} { if {[string match {*#SES#You are not a valid user*} $staterep]} {
return sendUID return sendUID
} }
if {[string match {#SOS#*} $staterep] == 0 } { if {[string match {N#SOS#*} $staterep] == 0 } {
hset $root/device_error $staterep hset $root/device_error $staterep
return idle return idle
} }
@@ -256,7 +256,7 @@ proc rdPwdAck {} {
variable paramindex variable paramindex
set speed [format "%5d" [sct target]] set speed [format "%5d" [sct target]]
sct send "#SOS#SPEED $speed" sct send "N#SOS#SPEED $speed"
set angle [lindex [hval $statuspath] $paramindex(ttang) end] set angle [lindex [hval $statuspath] $paramindex(ttang) end]
set lambda [AngleSpeedToWavelength $angle $speed] set lambda [AngleSpeedToWavelength $angle $speed]
sct target $speed sct target $speed
@@ -276,13 +276,13 @@ proc rdPwdAck {} {
set state [string tolower [sct target]] set state [string tolower [sct target]]
switch $state { switch $state {
"idle" { "idle" {
sct send "#SOS#IDLE " sct send "N#SOS#IDLE "
} }
"brake" { "brake" {
sct send "#SOS#BRAKE " sct send "N#SOS#BRAKE "
} }
"init" { "init" {
sct send "#SOS#TTINIT" sct send "N#SOS#TTINIT"
} }
default { default {
return idle return idle
@@ -297,7 +297,11 @@ proc rdPwdAck {} {
set angle [lindex [hval $statuspath] $paramindex(ttang) end] set angle [lindex [hval $statuspath] $paramindex(ttang) end]
set aspeed [lindex [hval $statuspath] $paramindex(aspeed) end] set aspeed [lindex [hval $statuspath] $paramindex(aspeed) end]
set lambda [AngleSpeedToWavelength $angle $aspeed] if {$aspeed >= 3100} {
set lambda [AngleSpeedToWavelength $angle $aspeed]
} else {
set lambda 99999
}
if {$lambda != [sct oldval]} { if {$lambda != [sct oldval]} {
sct oldval $lambda sct oldval $lambda
sct update $lambda sct update $lambda
@@ -416,7 +420,7 @@ proc halt {root} {
proc setPar {par nextState} { proc setPar {par nextState} {
set val [sct target] set val [sct target]
sct send "#SOS#$par $val" sct send "N#SOS#$par $val"
return $nextState return $nextState
} }
@@ -427,7 +431,7 @@ proc halt {root} {
set angle [lindex [hval $statuspath] $paramindex(ttang) end] set angle [lindex [hval $statuspath] $paramindex(ttang) end]
set speed [WavelengthToSpeed $angle $lambda] set speed [WavelengthToSpeed $angle $lambda]
set fmtspeed [format "%5d" $speed] set fmtspeed [format "%5d" $speed]
sct send "#SOS#SPEED $fmtspeed" sct send "N#SOS#SPEED $fmtspeed"
sct target $lambda sct target $lambda
hsetprop $vs_root/setspeed target $speed hsetprop $vs_root/setspeed target $speed
hset $vs_root/status "busy" hset $vs_root/status "busy"