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
This commit is contained in:
committed by
Douglas Clowes
parent
b4fb916018
commit
01be487c52
@@ -1,7 +1,7 @@
|
||||
# Some useful functions for SICS configuration.
|
||||
|
||||
# $Revision: 1.13 $
|
||||
# $Date: 2008-06-23 02:41:12 $
|
||||
# $Revision: 1.14 $
|
||||
# $Date: 2008-07-11 01:09:57 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by $Author: ffr $
|
||||
|
||||
@@ -215,110 +215,6 @@ proc ::environment::mkenvinfo {sobj paramlist} {
|
||||
}
|
||||
}
|
||||
|
||||
# Returns attribute name and value
|
||||
proc getatt {sicsobj att} {
|
||||
if [catch {
|
||||
lindex [split [tolower_sicslist $sicsobj $att] =] 1
|
||||
} reply ] {
|
||||
return -code error $reply
|
||||
} else {
|
||||
return $reply
|
||||
}
|
||||
}
|
||||
|
||||
proc normalgetatt {sicsobj att} {
|
||||
if [catch {
|
||||
lindex [split [sicslist $sicsobj $att] =] 1
|
||||
} reply ] {
|
||||
return -code error $reply
|
||||
} else {
|
||||
return $reply
|
||||
}
|
||||
}
|
||||
|
||||
# @brief Determine if a SICS object implements the drivable interface.
|
||||
#
|
||||
# @param sicsobj, Name of a SICS object
|
||||
# @return 1 if drivable, otherwise 0
|
||||
proc is_drivable {sicsobj} {
|
||||
if [catch {
|
||||
getatt $sicsobj drivable
|
||||
} reply] {
|
||||
return -code error $reply
|
||||
}
|
||||
if {$reply == "true"} {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
# Utility fucntion for setting the home and upper and lower
|
||||
# limits for a motor
|
||||
proc setHomeandRange {args} {
|
||||
set usage "
|
||||
Usage: setHomeandRange -motor motName -home homeVal -lowrange low -uprange high
|
||||
eg
|
||||
setHomeandRange -motor mchi -home 90 -lowrange 5 -uprange 7
|
||||
this sets the home position to 90 degreess for motor mchi
|
||||
with the lower limit at 85 and the upper limit at 97
|
||||
"
|
||||
if {$args == ""} {clientput $usage; return}
|
||||
array set params $args
|
||||
set motor $params(-motor)
|
||||
set home $params(-home)
|
||||
set lowlim [expr $home - $params(-lowrange)]
|
||||
set uplim [expr $home + $params(-uprange)]
|
||||
|
||||
uplevel 1 "$motor softlowerlim $lowlim"
|
||||
uplevel 1 "$motor softupperlim $uplim"
|
||||
uplevel 1 "$motor home $home"
|
||||
}
|
||||
|
||||
# Use this to create an array of named parameters to initialise motors.
|
||||
proc params {args} {
|
||||
upvar 1 "" x;
|
||||
if [info exists x] {unset x}
|
||||
foreach {k v} $args {set x([string tolower $k]) $v}
|
||||
}
|
||||
|
||||
# Parse motor readings for virtual motor scripts.
|
||||
proc SplitReply { text } {
|
||||
set l [split $text =]
|
||||
return [string trim [lindex $l 1]]
|
||||
}
|
||||
|
||||
# Sets motor position reading to pos by adjusting the softzero
|
||||
proc setpos {motor pos} {
|
||||
set currPos [SplitReply [$motor]]
|
||||
set oldZero [SplitReply [$motor softzero]]
|
||||
set newZero [expr $currPos - $pos + $oldZero]
|
||||
uplevel #0 "$motor softzero $newZero"
|
||||
}
|
||||
|
||||
proc getinfo {object} {
|
||||
set wc [format "%s_*" $object];
|
||||
set objlist [sicslist match $wc];
|
||||
foreach v $objlist {
|
||||
if { [SplitReply [sicslist $v type]]== "SicsVariable"} {
|
||||
clientput [$v];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Convenience function for setting klass group and name attributes
|
||||
# on sics object metadata
|
||||
proc set_sicsobj_atts {sobj aklass agroup aname acontrol adata} {
|
||||
sicslist setatt $sobj klass $aklass;
|
||||
if {$agroup != "@none"} {
|
||||
sicslist setatt $sobj group $agroup;
|
||||
}
|
||||
sicslist setatt $sobj long_name $aname;
|
||||
sicslist setatt $sobj control $acontrol;
|
||||
sicslist setatt $sobj data $adata;
|
||||
}
|
||||
|
||||
## TODO put all the utility macros in the utility namespace
|
||||
namespace eval utility {
|
||||
variable instrument_names [list echidna wombat kowari quokka platypus pelican taipan]
|
||||
@@ -404,6 +300,121 @@ proc mkData {sobj name aklass args} {
|
||||
return [info $option $args];
|
||||
}
|
||||
}
|
||||
# Returns attribute name and value
|
||||
proc getatt {sicsobj att} {
|
||||
if [catch {
|
||||
lindex [split [tolower_sicslist $sicsobj $att] =] 1
|
||||
} reply ] {
|
||||
return -code error $reply
|
||||
} else {
|
||||
return $reply
|
||||
}
|
||||
}
|
||||
|
||||
proc normalgetatt {sicsobj att} {
|
||||
if [catch {
|
||||
lindex [split [sicslist $sicsobj $att] =] 1
|
||||
} reply ] {
|
||||
return -code error $reply
|
||||
} else {
|
||||
return $reply
|
||||
}
|
||||
}
|
||||
|
||||
proc ::utility::normalattlist {sicsobj} {
|
||||
if [ catch {
|
||||
foreach att [sicslist $sicsobj] {
|
||||
lappend atts [split [string range $att 0 end-1] =]
|
||||
}
|
||||
return [join $atts]
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
}
|
||||
}
|
||||
# @brief Determine if a SICS object implements the drivable interface.
|
||||
#
|
||||
# @param sicsobj, Name of a SICS object
|
||||
# @return 1 if drivable, otherwise 0
|
||||
proc is_drivable {sicsobj} {
|
||||
if [catch {
|
||||
getatt $sicsobj drivable
|
||||
} reply] {
|
||||
return -code error $reply
|
||||
}
|
||||
if {$reply == "true"} {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
# Utility fucntion for setting the home and upper and lower
|
||||
# limits for a motor
|
||||
proc setHomeandRange {args} {
|
||||
set usage "
|
||||
Usage: setHomeandRange -motor motName -home homeVal -lowrange low -uprange high
|
||||
eg
|
||||
setHomeandRange -motor mchi -home 90 -lowrange 5 -uprange 7
|
||||
this sets the home position to 90 degreess for motor mchi
|
||||
with the lower limit at 85 and the upper limit at 97
|
||||
"
|
||||
if {$args == ""} {clientput $usage; return}
|
||||
array set params $args
|
||||
set motor $params(-motor)
|
||||
set home $params(-home)
|
||||
set lowlim [expr $home - $params(-lowrange)]
|
||||
set uplim [expr $home + $params(-uprange)]
|
||||
|
||||
uplevel 1 "$motor softlowerlim $lowlim"
|
||||
uplevel 1 "$motor softupperlim $uplim"
|
||||
uplevel 1 "$motor home $home"
|
||||
}
|
||||
|
||||
# Use this to create an array of named parameters to initialise motors.
|
||||
proc params {args} {
|
||||
upvar #0 "" x;
|
||||
if [info exists x] {unset x}
|
||||
foreach {k v} $args {set x([string tolower $k]) $v}
|
||||
}
|
||||
|
||||
# Parse motor readings for virtual motor scripts.
|
||||
proc SplitReply { text } {
|
||||
set l [split $text =]
|
||||
return [string trim [lindex $l 1]]
|
||||
}
|
||||
|
||||
# Sets motor position reading to pos by adjusting the softzero
|
||||
proc setpos {motor pos} {
|
||||
set currPos [SplitReply [$motor]]
|
||||
set oldZero [SplitReply [$motor softzero]]
|
||||
set newZero [expr $currPos - $pos + $oldZero]
|
||||
uplevel #0 "$motor softzero $newZero"
|
||||
}
|
||||
|
||||
proc getinfo {object} {
|
||||
set wc [format "%s_*" $object];
|
||||
set objlist [sicslist match $wc];
|
||||
foreach v $objlist {
|
||||
if { [SplitReply [sicslist $v type]]== "SicsVariable"} {
|
||||
clientput [$v];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Convenience function for setting klass group and name attributes
|
||||
# on sics object metadata
|
||||
proc set_sicsobj_atts {sobj aklass agroup aname acontrol adata} {
|
||||
sicslist setatt $sobj klass $aklass;
|
||||
if {$agroup != "@none"} {
|
||||
sicslist setatt $sobj group $agroup;
|
||||
}
|
||||
sicslist setatt $sobj long_name $aname;
|
||||
sicslist setatt $sobj control $acontrol;
|
||||
sicslist setatt $sobj data $adata;
|
||||
}
|
||||
|
||||
|
||||
proc debug {args} {
|
||||
clientput $args
|
||||
|
||||
Reference in New Issue
Block a user