sct_julabo_lh45.tcl
Create object when in simulation mode nxscripts_common_1.tcl Set units attributes on script context objects data sans aperture_configuration.tcl Update rotary attenuator lookup table. Set parameters when motors positions are within tolerance of the lookup table positions. sans, parameters.tcl sct_velsel.tcl Set units and update parameter names to be consistent quokka_configuration.tcl Add convenience command to load environment controllers. server_config.tcl Make sure that controllers are properly generated when loading them from the ext raconfig.tcl. r2881 | ffr | 2010-01-29 16:50:51 +1100 (Fri, 29 Jan 2010) | 20 lines
This commit is contained in:
committed by
Douglas Clowes
parent
ce113f26fd
commit
4f3fb5e250
@@ -92,44 +92,31 @@ namespace eval ::scobj::velocity_selector {
|
||||
}
|
||||
|
||||
|
||||
array set paramindex {
|
||||
state 0
|
||||
rspeed 1
|
||||
aspeed 2
|
||||
sspeed 3
|
||||
aveto 4
|
||||
ploss 5
|
||||
splos 6
|
||||
ttang 7
|
||||
rtemp 8
|
||||
wflow 9
|
||||
winlt 10
|
||||
woutt 11
|
||||
vacum 12
|
||||
wvalv 13
|
||||
vvalv 14
|
||||
vibrt 15
|
||||
bcuun 16
|
||||
}
|
||||
array set paramtype {
|
||||
state text
|
||||
rspeed float
|
||||
aspeed float
|
||||
sspeed float
|
||||
aveto text
|
||||
ploss float
|
||||
splos float
|
||||
ttang float
|
||||
rtemp float
|
||||
wflow float
|
||||
winlt float
|
||||
woutt float
|
||||
vacum float
|
||||
wvalv text
|
||||
vvalv text
|
||||
vibrt float
|
||||
bcuun float
|
||||
}
|
||||
foreach {
|
||||
param index type units } {
|
||||
state 0 text @none
|
||||
rspeed 1 float rpm
|
||||
aspeed 2 float rpm
|
||||
sspeed 3 float Hz
|
||||
aveto 4 text @none
|
||||
ploss 5 float @none
|
||||
splos 6 float @none
|
||||
ttang 7 float degrees
|
||||
rtemp 8 float degrees
|
||||
wflow 9 float @none
|
||||
winlt 10 float @none
|
||||
woutt 11 float @none
|
||||
vacum 12 float @none
|
||||
wvalv 13 text @none
|
||||
vvalv 14 text @none
|
||||
vibrt 15 float @none
|
||||
bcuun 16 float @none
|
||||
} {
|
||||
set paramindex($param) $index
|
||||
set paramtype($param) $type
|
||||
set paramunits($param) $units
|
||||
}
|
||||
|
||||
MakeSICSObj velsel_poller SCT_OBJECT
|
||||
MakeSICSObj velocity_selector SCT_OBJECT
|
||||
sicslist setatt velocity_selector klass NXvelocity_selector
|
||||
@@ -193,7 +180,7 @@ proc rdPwdAck {} {
|
||||
statemon stop nvs_lambda
|
||||
if [hgetpropval $root/setspeed driving] {
|
||||
hsetprop $root/setspeed driving 0
|
||||
hsetprop $root/setLambdaA driving 0
|
||||
hsetprop $root/setLambda driving 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,7 +195,7 @@ proc rdPwdAck {} {
|
||||
statemon stop nvs_lambda
|
||||
if [hgetpropval $root/setspeed driving] {
|
||||
hsetprop $root/setspeed driving 0
|
||||
hsetprop $root/setLambdaA driving 0
|
||||
hsetprop $root/setLambda driving 0
|
||||
}
|
||||
}
|
||||
sct oldstate $state
|
||||
@@ -260,14 +247,14 @@ proc rdPwdAck {} {
|
||||
set angle [lindex [hval $statuspath] $paramindex(ttang) end]
|
||||
set lambda [AngleSpeedToWavelength $angle $speed]
|
||||
sct target $speed
|
||||
hsetprop $vs_root/setLambdaA target $lambda
|
||||
hsetprop $vs_root/setLambda target $lambda
|
||||
hset $vs_root/status "busy"
|
||||
statemon start nvs_speed
|
||||
statemon start nvs_lambda
|
||||
if {[sct writestatus] == "start"} {
|
||||
# Called by drive adapter
|
||||
hsetprop $vs_root/setspeed driving 1
|
||||
hsetprop $vs_root/setLambdaA driving 1
|
||||
hsetprop $vs_root/setLambda driving 1
|
||||
}
|
||||
return $nextState
|
||||
}
|
||||
@@ -407,7 +394,7 @@ proc checkBlockedWavelengths {statuspath} {
|
||||
|
||||
proc halt {root} {
|
||||
hsetprop $root/setspeed driving 0
|
||||
hsetprop $root/setLambdaA driving 0
|
||||
hsetprop $root/setLambda driving 0
|
||||
hset $root/status "idle"
|
||||
statemon stop nvs_speed
|
||||
statemon stop nvs_lambda
|
||||
@@ -439,7 +426,7 @@ proc halt {root} {
|
||||
statemon start nvs_lambda
|
||||
if {[sct writestatus] == "start"} {
|
||||
# Called by drive adapter
|
||||
hsetprop $vs_root/setLambdaA driving 1
|
||||
hsetprop $vs_root/setLambda driving 1
|
||||
hsetprop $vs_root/setspeed driving 1
|
||||
}
|
||||
return $nextState
|
||||
@@ -475,17 +462,23 @@ proc halt {root} {
|
||||
hfactory $velselPath/LambdaResFWHM_percent plain user float
|
||||
hfactory $velselPath/geometry plain spy none
|
||||
hfactory $velselPath/geometry/position plain spy none
|
||||
hfactory $velselPath/geometry/position/VelSelPosXmm plain user float
|
||||
hfactory $velselPath/geometry/position/VelSelPosYmm plain user float
|
||||
hfactory $velselPath/geometry/position/VelSelPosZmm plain user float
|
||||
hfactory $velselPath/geometry/position/VelSelPosX plain user float
|
||||
hsetprop $velselPath/geometry/position/VelSelPosX units "mm"
|
||||
hfactory $velselPath/geometry/position/VelSelPosY plain user float
|
||||
hsetprop $velselPath/geometry/position/VelSelPosY units "mm"
|
||||
hfactory $velselPath/geometry/position/VelSelPosZ plain user float
|
||||
hsetprop $velselPath/geometry/position/VelSelPosZ units "mm"
|
||||
hfactory $velselPath/geometry/position/VelSelCoordScheme plain user text
|
||||
|
||||
# Get parameters from state report
|
||||
# Setup nodes for state report parameters
|
||||
foreach par [lsort [array names paramindex]] {
|
||||
hfactory $velselPath/$par plain spy $paramtype($par)
|
||||
hsetprop $velselPath/$par read ${scobjNS}::getpar rdpar
|
||||
hsetprop $velselPath/$par rdpar ${scobjNS}::updatepar $statusPath $paramindex($par)
|
||||
hsetprop $velselPath/$par oldval "UNKNOWN"
|
||||
if {$paramunits($par) != "@none"} {
|
||||
hsetprop $velselPath/$par units $paramunits($par)
|
||||
}
|
||||
}
|
||||
# Initialise turntable command
|
||||
hfactory $velselPath/ttinit plain spy none
|
||||
@@ -500,24 +493,28 @@ proc halt {root} {
|
||||
hsetprop $velselPath/set_ttang check ${scobjNS}::ttableCheck $statusPath ignore
|
||||
hsetprop $velselPath/set_ttang write ${scobjNS}::setPar TTANGL ignore
|
||||
hsetprop $velselPath/set_ttang ignore ${scobjNS}::noResponse
|
||||
hsetprop $velselPath/set_ttang units "degrees"
|
||||
|
||||
|
||||
# Get Lambda
|
||||
hfactory $velselPath/LambdaA plain spy float
|
||||
hsetprop $velselPath/LambdaA read ${scobjNS}::getpar rdpar
|
||||
hsetprop $velselPath/LambdaA rdpar ${scobjNS}::readLambda $statusPath
|
||||
hsetprop $velselPath/LambdaA oldval "UNKNOWN"
|
||||
hfactory $velselPath/Lambda plain spy float
|
||||
hsetprop $velselPath/Lambda read ${scobjNS}::getpar rdpar
|
||||
hsetprop $velselPath/Lambda rdpar ${scobjNS}::readLambda $statusPath
|
||||
hsetprop $velselPath/Lambda oldval "UNKNOWN"
|
||||
hsetprop $velselPath/Lambda units "Angstrom"
|
||||
|
||||
# Set Lambda
|
||||
hfactory $velselPath/setLambdaA plain spy float
|
||||
hsetprop $velselPath/setLambdaA check ${scobjNS}::checkBlockedWavelengths $statusPath
|
||||
hsetprop $velselPath/setLambdaA write ${scobjNS}::setLambda $velselPath $statusPath ignore
|
||||
hsetprop $velselPath/setLambdaA ignore ${scobjNS}::noResponse
|
||||
hsetprop $velselPath/setLambdaA driving 0
|
||||
#TODO WARNING remove sicsdev and type if setLambdaA gets a drive addapter
|
||||
# hsetprop $velselPath/setLambdaA sicsdev "nvs_lambda"
|
||||
hsetprop $velselPath/setLambdaA type "drivable"
|
||||
hsetprop $velselPath/setLambdaA target 0
|
||||
hsetprop $velselPath/setLambdaA writestatus "UNKNOWN"
|
||||
hfactory $velselPath/setLambda plain spy float
|
||||
hsetprop $velselPath/setLambda check ${scobjNS}::checkBlockedWavelengths $statusPath
|
||||
hsetprop $velselPath/setLambda write ${scobjNS}::setLambda $velselPath $statusPath ignore
|
||||
hsetprop $velselPath/setLambda ignore ${scobjNS}::noResponse
|
||||
hsetprop $velselPath/setLambda driving 0
|
||||
#TODO WARNING remove sicsdev and type if setLambda gets a drive addapter
|
||||
# hsetprop $velselPath/setLambda sicsdev "nvs_lambda"
|
||||
hsetprop $velselPath/setLambda type "drivable"
|
||||
hsetprop $velselPath/setLambda target 0
|
||||
hsetprop $velselPath/setLambda writestatus "UNKNOWN"
|
||||
hsetprop $velselPath/setLambda units "Angstrom"
|
||||
|
||||
# Set speed
|
||||
hfactory $velselPath/setspeed plain spy int
|
||||
@@ -528,6 +525,7 @@ proc halt {root} {
|
||||
hsetprop $velselPath/setspeed type "drivable"
|
||||
hsetprop $velselPath/setspeed target 0
|
||||
hsetprop $velselPath/setspeed writestatus "UNKNOWN"
|
||||
hsetprop $velselPath/setspeed units "rpm"
|
||||
|
||||
# Stop velocity selector (brake or idle)
|
||||
hfactory $velselPath/cmd plain spy text
|
||||
@@ -552,16 +550,18 @@ proc halt {root} {
|
||||
hsetprop $velselPath/geometry/position type instrument
|
||||
hsetprop $velselPath/geometry/position data true
|
||||
hsetprop $velselPath/geometry/position control true
|
||||
foreach {hpath klass control data nxsave mutable priv alias} {
|
||||
LambdaA parameter true true true true user velsel_lambdaa
|
||||
foreach {
|
||||
hpath klass control data nxsave mutable priv alias
|
||||
} {
|
||||
Lambda parameter true true true true user velsel_lambdaa
|
||||
LambdaResFWHM_percent parameter true true true true spy velsel_lambdaresfwhm_percent
|
||||
rspeed parameter true true true true spy velsel_rspeed
|
||||
aspeed parameter true true true true user velsel_aspeed
|
||||
ttang parameter true true true true user velsel_ttang
|
||||
ttinit parameter true false false true user velsel_ttang
|
||||
geometry/position/VelSelPosXmm parameter true true true false user VelSelPosXmm
|
||||
geometry/position/VelSelPosYmm parameter true true true false user VelSelPosYmm
|
||||
geometry/position/VelSelPosZmm parameter true true true false user VelSelPosZmm
|
||||
geometry/position/VelSelPosX parameter true true true false user VelSelPosX
|
||||
geometry/position/VelSelPosY parameter true true true false user VelSelPosY
|
||||
geometry/position/VelSelPosZ parameter true true true false user VelSelPosZ
|
||||
geometry/position/VelSelCoordScheme parameter true true true false user VelSelCoordScheme
|
||||
} {
|
||||
hsetprop $velselPath/$hpath nxalias $alias
|
||||
@@ -578,16 +578,16 @@ proc halt {root} {
|
||||
hsetprop $velselPath/setspeed checkstatus ${scobjNS}::drivestatus
|
||||
hsetprop $velselPath/setspeed halt ${scobjNS}::halt $velselPath
|
||||
|
||||
hsetprop $velselPath/setLambdaA checklimits ${scobjNS}::checkBlockedWavelengths $statusPath
|
||||
hsetprop $velselPath/setLambdaA checkstatus ${scobjNS}::drivestatus
|
||||
hsetprop $velselPath/setLambdaA halt ${scobjNS}::halt $velselPath
|
||||
hsetprop $velselPath/setLambda checklimits ${scobjNS}::checkBlockedWavelengths $statusPath
|
||||
hsetprop $velselPath/setLambda checkstatus ${scobjNS}::drivestatus
|
||||
hsetprop $velselPath/setLambda halt ${scobjNS}::halt $velselPath
|
||||
|
||||
##
|
||||
# @brief This is the position of the velocity selector bunker face. It is used
|
||||
# as the reference for other positions. x=y=z=0.
|
||||
hset $velselPath/geometry/position/VelSelPosXmm 0.0
|
||||
hset $velselPath/geometry/position/VelSelPosYmm 0.0
|
||||
hset $velselPath/geometry/position/VelSelPosZmm 0.0
|
||||
hset $velselPath/geometry/position/VelSelPosX 0.0
|
||||
hset $velselPath/geometry/position/VelSelPosY 0.0
|
||||
hset $velselPath/geometry/position/VelSelPosZ 0.0
|
||||
hset $velselPath/geometry/position/VelSelCoordScheme "Cartesian"
|
||||
|
||||
|
||||
@@ -601,12 +601,12 @@ proc halt {root} {
|
||||
}
|
||||
sct_velsel write $velselPath/ttinit
|
||||
sct_velsel write $velselPath/set_ttang
|
||||
sct_velsel poll $velselPath/LambdaA $pollrate
|
||||
sct_velsel write $velselPath/setLambdaA
|
||||
sct_velsel poll $velselPath/Lambda $pollrate
|
||||
sct_velsel write $velselPath/setLambda
|
||||
sct_velsel write $velselPath/setspeed
|
||||
sct_velsel write $velselPath/cmd
|
||||
ansto_makesctdrive nvs_speed $velselPath/setspeed $velselPath/aspeed sct_velsel
|
||||
ansto_makesctdrive nvs_lambda $velselPath/setLambdaA $velselPath/LambdaA sct_velsel
|
||||
ansto_makesctdrive nvs_lambda $velselPath/setLambda $velselPath/Lambda sct_velsel
|
||||
}
|
||||
if {$sim_mode == "false"} {
|
||||
makesctcontroller sct_velsel astvelsel $velsel_IP:$velsel_port "" 10
|
||||
|
||||
Reference in New Issue
Block a user