Files
sics/site_ansto/instrument/util/script_context_util.tcl
Ferdi Franceschini b8811330f1 script_context_util.tcl
hinitprops can now be called with a list of parameters.
SICS-403 hinitprops will now check for "argtype" and "values" attributes on script context objects to create drop down lists valid arguments for GumTree

sct_positmotor_common.tcl
SICS-403 Now sets "argtype" and a list of "values" properties so GumTree can create drop-down lists of arguments.

quokka positmotor_configuration.tcl
SICS-401 diameter and sampleNum selectors report communications errors

sct_rfamp.c
The controller state should be set before calling AsconError.

r2931 | ffr | 2010-05-22 13:56:13 +1000 (Sat, 22 May 2010) | 13 lines
2012-11-15 17:03:11 +11:00

61 lines
1.7 KiB
Tcl

namespace eval ::scobj { }
proc ::scobj::set_required_props {hpath} {
foreach child [hlist $hpath] {
hsetprop $hpath/$child data false
::scobj::set_required_props $hpath/$child
}
}
proc ::scobj::hinit_nodeprops {node hpath} {
hsetprop $hpath nxalias $node
foreach {prop propval} [subst {
control true
data true
nxsave true
mutable true
klass parameter
sdsinfo ::nexus::scobj::sdsinfo
long_name $node
}] {
if {[hpropexists $hpath $prop] == false} {
hsetprop $hpath $prop $propval
}
}
}
proc ::scobj::hinit_scobjprops {scobj hpath} {
if {[hpropexists $hpath klass]} {
sicslist setatt $scobj klass [hgetpropval $hpath klass]
}
if {[hpropexists $hpath long_name]} {
sicslist setatt $scobj long_name [hgetpropval $hpath long_name]
} else {
sicslist setatt $scobj long_name $scobj
}
if [sicslist exists $scobj "argtype"] {
hsetprop $hpath argtype [SplitReply [sicslist $scobj argtype]]
}
if [sicslist exists $scobj "values"] {
hsetprop $hpath values [SplitReply [sicslist $scobj values]]
}
hsetprop $hpath sicsdev $scobj
::scobj::hinit_nodeprops $scobj $hpath
}
##
# @brief Initialise the hdb properties required for generating the GumTree interface and
# saving data for script context objects
# @param scobj, name of script context object
# @param par, optional parameter
proc ::scobj::hinitprops {scobj args} {
if {$args == ""} {
set hpath /sics/$scobj
::scobj::hinit_scobjprops $scobj $hpath
} else {
set hpath /sics/$scobj
::scobj::hinit_scobjprops $scobj $hpath
foreach p $args {
set hpath /sics/$scobj/$p
::scobj::hinit_nodeprops ${scobj}_$p $hpath
}
}
}