53 lines
1.4 KiB
Tcl
53 lines
1.4 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} {
|
|
foreach {prop propval} [subst {
|
|
klass parameter
|
|
long_name $scobj
|
|
}] {
|
|
if {[hpropexists $hpath $prop] == false} {
|
|
sicslist setatt $scobj $prop $propval
|
|
} else {
|
|
sicslist setatt $scobj $prop [hgetpropval $hpath $prop]
|
|
}
|
|
}
|
|
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 {par "@none"}} {
|
|
if {$par == "@none"} {
|
|
set hpath /sics/$scobj
|
|
::scobj::hinit_scobjprops $scobj $hpath
|
|
} else {
|
|
set hpath /sics/$scobj/$par
|
|
::scobj::hinit_nodeprops ${scobj}_$par $hpath
|
|
}
|
|
}
|