Merged 2.4 branch
r2828 | ffr | 2009-11-25 09:56:49 +1100 (Wed, 25 Nov 2009) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
c58ee9fbcb
commit
2ec6505ef8
@@ -27,7 +27,7 @@ set instrument_dictionary [subst {
|
||||
property {data true control true nxsave false klass @none type graphset}
|
||||
}
|
||||
instrument {
|
||||
sobj {@any instrument @any NXvelocity_selector}
|
||||
sobj {@any instrument @any NXvelocity_selector @any NXaperture @any NXdetector}
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control true nxsave false klass NXinstrument type instrument}
|
||||
@@ -38,6 +38,11 @@ set instrument_dictionary [subst {
|
||||
datatype @none
|
||||
property {data true control true nxsave true klass NXparameter type part}
|
||||
}
|
||||
instrument/parameters/parameters_group {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias parameters_group}
|
||||
}
|
||||
instrument/parameters/derived_parameters {
|
||||
privilege spy
|
||||
sobj {@any derived_parameter}
|
||||
@@ -140,12 +145,6 @@ set instrument_dictionary [subst {
|
||||
datatype @none
|
||||
property {data true control true nxsave false klass NXsource type part}
|
||||
}
|
||||
instrument/velocity_selector {
|
||||
privilege spy
|
||||
sobj {@any velocity_selector}
|
||||
datatype @none
|
||||
property {data true control true nxsave false klass NXvelocity_selector type part}
|
||||
}
|
||||
instrument/detector {
|
||||
privilege spy
|
||||
sobj {@any detector}
|
||||
@@ -176,18 +175,17 @@ set instrument_dictionary [subst {
|
||||
datatype @none
|
||||
property {data true control true nxsave false klass NXsample type part}
|
||||
}
|
||||
sample/sample_group {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias sample_group}
|
||||
}
|
||||
monitor {
|
||||
privilege spy
|
||||
sobj {@any monitor}
|
||||
datatype @none
|
||||
property {data true control true nxsave false klass NXmonitor type part}
|
||||
}
|
||||
data {
|
||||
privilege spy
|
||||
sobj {@any data}
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass NXdata type part datatype UNKNOWN currentfiletype UNKNOWN}
|
||||
}
|
||||
event_data {
|
||||
privilege spy
|
||||
sobj {@any event_data}
|
||||
@@ -225,74 +223,15 @@ set instrument_dictionary [subst {
|
||||
datatype @none
|
||||
property {data false control true nxsave false klass @none type part}
|
||||
}
|
||||
data {
|
||||
privilege spy
|
||||
sobj {@any data}
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass NXdata type part datatype UNKNOWN currentfiletype UNKNOWN}
|
||||
}
|
||||
data/data_set {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias data_set link @none}
|
||||
}
|
||||
data/axis_1 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias axis_1 link @none}
|
||||
}
|
||||
data/axis_2 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias axis_2 link @none}
|
||||
}
|
||||
data/axis_3 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias axis_3 link @none}
|
||||
}
|
||||
data/axis_4 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias axis_4 link @none}
|
||||
}
|
||||
data/aux_data_1 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_1 link @none}
|
||||
}
|
||||
data/aux_data_2 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_2 link @none}
|
||||
}
|
||||
data/aux_data_3 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_3 link @none}
|
||||
}
|
||||
data/aux_data_4 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_4 link @none}
|
||||
}
|
||||
data/aux_data_5 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_5 link @none}
|
||||
}
|
||||
data/aux_data_6 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_6 link @none}
|
||||
}
|
||||
data/aux_data_7 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_7 link @none}
|
||||
}
|
||||
data/aux_data_8 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_8 link @none}
|
||||
}
|
||||
data/aux_data_9 {
|
||||
privilege spy
|
||||
datatype @none
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias aux_data_9 link @none}
|
||||
property {data true control false nxsave false klass @none type nxvgroup nxalias data_set}
|
||||
}
|
||||
}]
|
||||
|
||||
@@ -205,7 +205,6 @@ proc ::hdb::MakeVelocity_Selector {name paramlist} {
|
||||
# @param level, (optional,default=1) The location of the template parameters in the callstack.
|
||||
proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
|
||||
upvar $NXklist newtable
|
||||
# puts "[info level 0]\nCallstack depth = [info level]\nRecursion depth = [expr $level-1]"
|
||||
if {$path == ""} {
|
||||
set currpath $node
|
||||
} else {
|
||||
@@ -541,10 +540,6 @@ proc ::hdb::add_node {basePath args} {
|
||||
hsetprop $node_path/$child klass [getatt $node_name klass]
|
||||
}
|
||||
}
|
||||
scobj {
|
||||
set node_path ${basePath}/$node_name
|
||||
hfactory $node_path link $node_name
|
||||
}
|
||||
script - getset {
|
||||
# A r/w pair of scripts, node = a node path
|
||||
set node_path $basePath/[normalgetatt $node_name long_name]
|
||||
@@ -616,6 +611,7 @@ proc ::hdb::add_command {basePath command} {
|
||||
hsetprop $cmd_path control $cmd_atts(control)
|
||||
hsetprop $cmd_path klass $cmd_atts(klass)
|
||||
hsetprop $cmd_path nxsave $cmd_atts(nxsave)
|
||||
hsetprop $cmd_path sicsdev $cmd_atts(id)
|
||||
return $cmd_path
|
||||
}
|
||||
|
||||
@@ -687,7 +683,9 @@ proc ::hdb::sobjadd {hpath sobj args} {
|
||||
array unset sobjatt
|
||||
if [ catch {
|
||||
array set sobjatt [attlist $sobj]
|
||||
sicslist setatt $sobj id $sobj
|
||||
if {[sicslist exists $sobj id] == false} {
|
||||
sicslist setatt $sobj id $sobj
|
||||
}
|
||||
switch $sobjatt(type) {
|
||||
motor - configurablevirtualmotor {
|
||||
if {[info exists sobjatt(group)]} {
|
||||
@@ -791,8 +789,11 @@ proc ::hdb::sobjadd {hpath sobj args} {
|
||||
}
|
||||
# TODO Can this be replaced with a sct_* glob?
|
||||
sct_object {
|
||||
set sobjName [normalgetatt $sobj long_name]
|
||||
add_node $hpath node $sobjName long_name $sobjName kind scobj
|
||||
set node_name [normalgetatt $sobj long_name]
|
||||
set node_path $hpath/$node_name
|
||||
hfactory $node_path link $sobj
|
||||
hsetprop $node_path type $sobjatt(type)
|
||||
sicslist setatt $sobj hdb_path $node_path
|
||||
}
|
||||
environment_controller {
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
@@ -849,7 +850,9 @@ proc ::hdb::sobjtypeadd {hpath sobjtype given_klass} {
|
||||
proc ::hdb::prune {instdict} {
|
||||
upvar $instdict dict
|
||||
array set dictarr $dict
|
||||
set candidates [array names dictarr]
|
||||
foreach {n v} $dict {
|
||||
lappend candidates $n
|
||||
}
|
||||
# While there are candidates for removal remove the childless ones
|
||||
# which have an empty sobj list
|
||||
while {[expr [llength $candidates]] > 0} {
|
||||
@@ -870,6 +873,13 @@ proc ::hdb::prune {instdict} {
|
||||
if { [llength [join $sobjects]] == 0 } {
|
||||
if {[llength [array get dictarr $name/*]] == 0} {
|
||||
array unset dictarr $name
|
||||
foreach {n v} $dict {
|
||||
if {$n != $name} {
|
||||
lappend tempdict $n
|
||||
lappend tempdict $v
|
||||
}
|
||||
}
|
||||
set $dict $tempdict
|
||||
} else {
|
||||
if {[lsearch $candidates $name/*] >= 0} {
|
||||
lappend new_candidates $name
|
||||
@@ -879,7 +889,6 @@ proc ::hdb::prune {instdict} {
|
||||
}
|
||||
set candidates $new_candidates
|
||||
}
|
||||
set dict [array get dictarr]
|
||||
return
|
||||
}
|
||||
|
||||
@@ -922,32 +931,34 @@ upvar #0 $instDict dictionary
|
||||
# @param top This is just here to make the recursion work from the top level, You don't need
|
||||
# to set this
|
||||
proc ::hdb::set_save {hpath mode {top true}} {
|
||||
if {$hpath != "/"} {
|
||||
set hnode $hpath
|
||||
} else {
|
||||
foreach hp [hlist /] {
|
||||
::hdb::set_save /$hp $mode
|
||||
}
|
||||
return
|
||||
}
|
||||
if {[::utility::hgetplainprop $hnode data] == "false"} {
|
||||
return
|
||||
}
|
||||
foreach hp [hlist $hnode] {
|
||||
set_save $hnode/$hp $mode false
|
||||
}
|
||||
if {$top == "true"} {
|
||||
hsetprop $hnode nxsave $mode
|
||||
if {$mode == "true"} {
|
||||
set hp ""
|
||||
foreach ps [lrange [split [string trim $hnode /] /] 0 end-1] {
|
||||
set hp $hp/$ps
|
||||
hsetprop $hp nxsave true
|
||||
}
|
||||
if [ catch {
|
||||
if {$hpath != "/"} {
|
||||
set hnode $hpath
|
||||
if {[hpropexists $hnode data] && [hgetpropval $hnode data] != "false"} {
|
||||
foreach hp [hlist $hnode] {
|
||||
set_save $hnode/$hp $mode false
|
||||
}
|
||||
if {$top == "true"} {
|
||||
hsetprop $hnode nxsave $mode
|
||||
if {$mode == "true"} {
|
||||
set hp ""
|
||||
foreach ps [lrange [split [string trim $hnode /] /] 0 end-1] {
|
||||
set hp $hp/$ps
|
||||
hsetprop $hp nxsave true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hsetprop $hnode nxsave $mode
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach hp [hlist /] {
|
||||
::hdb::set_save /$hp $mode
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hsetprop $hnode nxsave $mode
|
||||
}
|
||||
} message ] {
|
||||
return -code error "([info level 0]) $message"
|
||||
}
|
||||
}
|
||||
|
||||
namespace import ::hdb::*
|
||||
|
||||
Reference in New Issue
Block a user