Files
sics/site_ansto/instrument/sans/config/parameters/parameters.tcl
Ferdi Franceschini 01be487c52 pelican
Create pas/config/source/source.tcl
config/source/source_common.tcl
pelican_configuration.tcl

deploySICS.sh
Don't deploy script validator configs, they are obsolete

server_config.tcl
Source config has been moved to  config/source and is specialised for each instrument by calling the instrument specific initialiser ::source:isc_initalize

commands_common_1.tcl
The monitor mode and preset are recorded when running the count command

counter_common_1.tcl
Report and record the counts and time for the multicounter and each monitor.  Also record the mode and preset for the multicounter.

hmm_configuration_common_1.tcl
Cleanup, remove obsolete code.
Report and record the hmm total counts and time.
Allow monitor controlled acquisition from the histogram server

nxscripts_common_1.tcl
Add DataType to NXdata section, preserve case in text attributes.

scan_common_1.tcl
Provide sensible feedback for our bmonscan and hmscan objects.
Set run_mode when doing a scan.  Allow users to select the datatype for histmem scans and to force a scan

wombat_configuration.tcl
echidna_configuration.tcl
platypus_configuration.tcl
kowari_configuration.tcl
quokka_configuration.tcl
Load source config.

quokka_configuration.tcl
SICS-198 HACK, Add AttrotDeg and RotApDeg status feedback.

sans/commands/commands.tcl
Add status feedback for quokka "guide" command.

sans/parameters/parameters.tcl
Make sure data can be saved as xml (replace % with _percent)
SICS-198 HACK, add AttRotDeg and RotApDeg status feedback.

utility.tcl
Fix nasty "params array generator" bug.  SICS commands execute at runlevel 0 which means that the params anonymous array must be made at this level.
Provide the normalattlist command to enable creating attribute lists with the case preserved.

Added the runsics, runtestsics and sicsclient scripts to CVS.
Added source configurations for echidna, wombat, kowari, quokka, platypus, and pelican to CVS

r2644 | ffr | 2008-07-11 11:09:57 +1000 (Fri, 11 Jul 2008) | 53 lines
2012-11-15 13:40:07 +11:00

387 lines
12 KiB
Tcl

##
# @brief We can't change the coordinate scheme at runtime because this would require
# restructuring the hdb tree, but we should save it.
foreach {var lname nxname} {
VelSelCoordScheme VelSelCoordScheme coordinate_scheme
SApCoordScheme SApCoordScheme coordinate_scheme
EApCoordScheme EApCoordScheme coordinate_scheme
SampleCoordScheme SampleCoordScheme coordinate_scheme
DetCoordScheme DetCoordScheme coordinate_scheme
BeamstopCoordScheme BeamstopCoordScheme coordinate_scheme
CollCoordScheme CollCoordScheme coordinate_scheme
} {
::utility::mkVar $var text readonly $lname true @none false true
$var Cartesian
$var lock
}
##
# @brief User privilege text variables
#
# TODO SICS-117 Redo as get/set macros like the "kind=command" macros but kind=getset and it is saveable
# The set parameter will have a domain. If the param is readonly then the hdb privilege is readonly
# Pros, GumTree will know the data type of the parameter (text params will have a list of valid values).
# Cons, There is no "instant" feedback, macros are polled on the hdb tree.
foreach {var lname nxname priv klass} {
SApShape SApShape shape user parameter
BSShape BSShape shape user parameter
} {
::utility::mkVar $var text $priv $lname true $klass true true
}
# The velocity selector position is used as the reference for other instrument
# component positions. For simplicity we set it as the origin x=y=z=0.
foreach {var lname nxname units klass} {
VelSelPosXmm VelSelPosXmm x mm @none
VelSelPosYmm VelSelPosYmm y mm @none
VelSelPosZmm VelSelPosZmm z mm @none
EndFacePosYmm EndFacePosYmm y mm parameter
RotApPosYmm RotApPosYmm y mm @none
} {
::utility::mkVar $var float readonly $lname true $klass true true
if {$units != 1} {
sicslist setatt $var units $units
}
}
::utility::mkVar SampleNum int readonly changer_position true parameter true true
# Parameter SicsVariables
foreach {var lname nxname units priv } {
LambdaA LambdaA wavelength nm user
LambdaResFWHM_percent LambdaResFWHM_percent wavelength_spread 1 user
VSdeg VSdeg twist degrees user
VSrpm VSrpm rotation_speed rpm user
EApYmm EApYmm y mm user
EApPosYmm EApPosYmm y mm user
SApXmm SApXmm x mm user
SApZmm SApZmm z mm user
SApPosXmm SApPosXmm x mm user
SApPosYmm SApPosYmm y mm user
SApPosZmm SApPosZmm z mm user
SamplePosXmm SamplePosXmm x mm user
SamplePosYmm SamplePosYmm y mm user
SamplePosZmm SamplePosZmm z mm user
DetPosYOffsetmm DetPosYOffsetmm detposyoffset mm user
BSXmm BSXmm x mm user
BSZmm BSZmm z mm user
} {
::utility::mkVar $var float $priv $lname true parameter true true
if {$units != 1} {
sicslist setatt $var units $units
}
}
# Derived Parameter SicsVariables
foreach {var type lname units depends} {
AttFactor float AttFactor 1 AttRotDeg,LambdaA,LambdaResFWHM_percent
PleXmm float PleXmm mm AttRotDeg
EApXmm float EApXmm mm RotApDeg
EApZmm float EApZmm mm RotApDeg
RotApXmm float RotApXmm mm RotApDeg
RotApZmm float RotApZmm mm RotApDeg
EApShape text EApShape 1 RotApDeg
RotApShape text RotApShape 1 RotApDeg
} {
::utility::mkVar $var $type user $lname true derived_parameter true true
sicslist setatt $var depends $depends
if {$units != 1} {
sicslist setatt $var units $units
}
}
proc sicsmsgfmt {args} {return "[info level -1] = $args"}
::utility::macro::getset float L1mm {} {
set efpy [SplitReply [EndFacePosYmm]]
set sapy [SplitReply [SApPosYmm]]
set eapy [SplitReply [EApPosYmm]]
return [sicsmsgfmt [expr {$efpy + $sapy - $eapy}]]
}
sicslist setatt L1mm long_name L1mm
sicslist setatt L1mm klass derived_parameter
sicslist setatt L1mm units mm
sicslist setatt L1mm depends EndFacePosYmm,SApPosYmm,EApPosYmm
::utility::macro::getset float L2mm {} {
set detpy [SplitReply [DetPosYmm]]
set detpyos [SplitReply [DetPosYOffsetmm]]
set sapy [SplitReply [SamplePosYmm]]
return [sicsmsgfmt [expr {$detpyos + $detpyos - $sapy}]]
}
sicslist setatt L2mm long_name L2mm
sicslist setatt L2mm klass derived_parameter
sicslist setatt L2mm units mm
sicslist setatt L2mm depends DetPosYmm,DetPosYOffsetmm,SamplePosYmm
# Derive motor parameters
foreach {pname motor units} {
DetPosXmm detoff mm
DetPosYmm det mm
BSPosXmm bsx mm
BSPosZmm bsz mm
SampleTiltXDeg samphi degrees
SampleTiltYDeg samchi degrees
SampleRotDeg samthet degrees
} {
::utility::macro::getset float $pname {} [subst -nocommands {
return [sicsmsgfmt [SplitReply [$motor]]]
}]
sicslist setatt $pname units $units
sicslist setatt $pname long_name $pname
sicslist setatt $pname klass derived_parameter
# sicslist setatt $pname depends $motor
}
foreach {pname motor units} {
AttRotDeg att degrees
} {
::utility::macro::getset float $pname {args} [subst -nocommands {
# TODO AttFactor
if {[set args] == ""} {
return [sicsmsgfmt [SplitReply [$motor]]]
} else {
set target [lindex [set args] 0]
Plexmm -1
${pname}_status "BUSY"
drive $motor \$target
set motpos [SplitReply [$motor]]
set tolerance [SplitReply [$motor precision] ]
if {[expr abs(\$motpos - \$target)] > \$tolerance} {
${pname}_status "IDLE"
error "ERROR: failed to set $pname target \$target"
} else {
Plexmm [::optics::AttRotLookup \$target]
}
${pname}_status "IDLE"
}
}]
sicslist setatt $pname units $units
sicslist setatt $pname long_name $pname
sicslist setatt $pname klass derived_parameter
# sicslist setatt $pname depends $motor
# TODO SICS-198 add feedback support to getset macro generator
VarMake ${pname}_status text mugger
${pname}_status "IDLE"
}
foreach {pname motor units} {
RotApDeg srce degrees
} {
::utility::macro::getset float $pname {args} [subst -nocommands {
if {[set args] == ""} {
return [sicsmsgfmt [SplitReply [$motor]]]
} else {
set target [lindex [set args] 0]
RotApXmm 0
RotApZmm 0
RotApShape "UNKNOWN"
EApXmm 0
EApZmm 0
EApShape "UNKNOWN"
${pname}_status "BUSY"
drive $motor \$target
set motpos [SplitReply [$motor]]
set tolerance [SplitReply [$motor precision] ]
if {[expr abs(\$motpos - \$target)] > \$tolerance} {
${pname}_status "IDLE"
error "ERROR: failed to set $pname target \$target"
} else {
set size [::optics::EApLookUp \$target "size"]
set shape [::optics::EApLookUp \$target "shape"]
RotApXmm \$size
RotApZmm \$size
RotApShape \$shape
EApXmm \$size
EApZmm \$size
EApShape \$shape
}
${pname}_status "IDLE"
}
}]
sicslist setatt $pname units $units
sicslist setatt $pname long_name $pname
sicslist setatt $pname klass derived_parameter
# sicslist setatt $pname depends $motor
# TODO SICS-198 add feedback support to getset macro generator
VarMake ${pname}_status text mugger
${pname}_status "IDLE"
}
################################################################################
##
# @brief This is the position of the velocity selector bunker face. It is used
# as the reference for other positions. x=y=z=0.
::hdb::MakeVelocity_Selector velocity_selector {
wavelength LambdaA
wavelength_spread LambdaResFWHM_percent
coordinate_scheme VelSelCoordScheme
position {VelSelPosXmm VelSelPosYmm VelSelPosZmm}
}
::hdb::MakeAperture sample_aperture {
shape SApShape
size {SApXmm SApZmm}
coordinate_scheme SApCoordScheme
position {SApPosXmm SApPosYmm SApPosZmm}
refpos {VelSelPosXmm EndFacePosYmm VelSelPosZmm}
}
::hdb::MakeAperture entrance_aperture {
shape EApShape
size {EApXmm EApYmm EApZmm}
coordinate_scheme EApCoordScheme
position EApPosYmm
refpos VelSelPosYmm
}
::hdb::MakeAperture rotary_aperture {
shape RotApShape
size {RotApXmm RotApZmm}
position RotApPosYmm
orientation RotApDeg
refpos VelSelPosYmm
}
#::hdb::MakeGeometry sample_geometry sample {
# coordinate_scheme SampleCoordScheme
# position {SamplePosXmm SamplePosYmm SamplePosZmm}
# orientation {SampleTiltXDeg SampleTiltYDeg SampleRotDeg}
# refpos {VelSelPosXmm EndFacePosYmm VelSelPosZmm}
#}
::hdb::MakeGeometry detector_geometry detector {
coordinate_scheme DetCoordScheme
position {DetPosXmm DetPosYmm}
offset DetPosYOffsetmm
refpos {VelSelPosXmm EndFacePosYmm}
}
::hdb::MakeGeometry collimator_geometry collimator {
coordinate_scheme CollCoordScheme
position EndFacePosYmm
refpos VelSelPosYmm
}
::hdb::MakeGeometry beamstop_geometry beam_stop {
shape BSShape
position {BSPosXmm BSPosZmm}
size {BSXmm BSZmm}
}
# INITIALISE PARAMETERS
# The collimation system aperture positions
# Reference position is outer wall of velocity selector bunker, ie VelSelPosYmm
array set collapposmm {
inputguide 633
apwheel 675
ap1 4929
ap2 6934
ap3 8949
ap4 10955
ap5 12943
ap6 14970
ap7 16971
ap9 19925
}
VelSelPosXmm 0.0
VelSelPosYmm 0.0
VelSelPosZmm 0.0
EndFacePosYmm 20095
RotApPosYmm 675
################################################################################
# Check Config
namespace eval parameters {
set paramlist {
AttFactor
AttRotDeg
BS1
BS2
BS3
BS4
BS5
BSPosXmm
BSPosZmm
BSShape
BSXmm
BSZmm
C1
C2
C3
C4
C5
C6
C7
C8
C9
DetPosXmm
DetPosYmm
DetPosYOffsetmm
EApPosYmm
EApShape
EApShape
EApXmm
EApYmm
EApZmm
EndFacePosYmm
L1mm
L2mm
LambdaA
LambdaResFWHM_percent
Pent
Plexmm
RotApDeg
RotApShape
RotApXmm
RotApZmm
SampleAttributes
SampleComments
SampleName
SampleNum
SamplePosXmm
SamplePosYmm
SamplePosYmm
SamplePosZmm
SampleRotDeg
SampleTiltXDeg
SampleTiltYDeg
SampleTitle
SApPosXmm
SApPosYmm
SApPosYmm
SApPosZmm
SApShape
SApXmm
SApZmm
VSdeg
VSrpm
}
}
##
# @brief List undefined parameters
proc ::parameters::missingparams {} {
variable paramlist
set num 0
foreach param $paramlist {
if {[sicslist match $param] == " "} {
clientput $param
incr num
}
}
if {$num > 0} {
clientput "There are $num missing parameters"
} else {
clientput "OK"
}
}
##
# @brief Check list
proc check {args} {
switch $args {
"missing" {
::parameters::missingparams
}
}
}
publish check user