Copied in-situ modifications from ics1-quokka.

This commit is contained in:
Ferdi Franceschini
2013-02-20 18:19:44 +11:00
parent b5b4d7a747
commit e7a478489e
17 changed files with 299 additions and 78 deletions

View File

@@ -208,7 +208,8 @@ proc rdPwdAck {} {
set speedvar [expr 0.2*$rspeed/100]
if {[hval $root/status] == "busy"} {
set target [hgetpropval $root/setspeed target]
if {$rspeed != $target} {
# rspeed doesn't always match the speed you sent, eg If you send 15922 the velsel says it got 15923
if {[expr abs($rspeed - $target)] > 1} {
hset $root/device_error "Resending target speed $target"
hset $root/setspeed $target"
return idle
@@ -459,7 +460,7 @@ proc halt {root} {
set fmtspeed [format "%5d" $speed]
sct send "N#SOS#SPEED $fmtspeed"
sct target $lambda
hsetprop $vs_root/setspeed target $speed
hsetprop $vs_root/setspeed target $fmtspeed
hset $vs_root/status "busy"
statemon start nvs_speed
statemon start nvs_lambda

View File

@@ -5,6 +5,21 @@ namespace eval ::scobj::velocity_selector {
variable blocked_speeds
variable velsel_IP
variable velsel_port
variable nvs40Par
variable nvs43Par
variable velsel_ID
set nvs40Par(m_dTwistAngle) 48.30
set nvs40Par(m_dLength) 0.250
set nvs40Par(m_iMaxSpeed) 28300.0
set nvs40Par(rBeamCenter) 0.1100
set nvs40Par(VNeutron) 3955.98
set nvs43Par(m_dTwistAngle) 37.6
set nvs43Par(m_dLength) 0.250
set nvs43Par(m_iMaxSpeed) 21000.0
set nvs43Par(rBeamCenter) 0.1100
set nvs43Par(VNeutron) 3955.98
# Set configuration parameters for either the NVS40 or NVS43 velocity selector
set ::currVelSel [string tolower $::currVelSel]
@@ -13,11 +28,6 @@ namespace eval ::scobj::velocity_selector {
set velsel_ID "NVS40"
set velsel_IP "137.157.202.73"
set velsel_port 10000
set m_dTwistAngle 48.30
set m_dLength 0.250
set m_iMaxSpeed 28300.0
set rBeamCenter 0.1100
set VNeutron 3955.98
set ::scobj::velocity_selector::UID "NVS"
set ::scobj::velocity_selector::PWD "NVS"
set ::scobj::velocity_selector::blocked_speeds {
@@ -32,11 +42,6 @@ namespace eval ::scobj::velocity_selector {
set velsel_ID "NVS43"
set velsel_IP "137.157.202.74"
set velsel_port 10000
set m_dTwistAngle 37.6
set m_dLength 0.250
set m_iMaxSpeed 21000.0
set rBeamCenter 0.1100
set VNeutron 3955.98
set ::scobj::velocity_selector::UID "NVS"
set ::scobj::velocity_selector::PWD "NVS"
set ::scobj::velocity_selector::blocked_speeds {