Remove superfluous trailing white space from TCL files
This commit is contained in:
@@ -97,7 +97,7 @@ set NXgeometry_template {
|
||||
|
||||
set NXaperture_template [subst -novariables {
|
||||
NXaperture {
|
||||
$name {
|
||||
$name {
|
||||
sobjlist {$paramarr(material) $paramarr(description)}
|
||||
[ set NXgeometry_template ]
|
||||
}
|
||||
@@ -192,7 +192,7 @@ proc ::hdb::MakeVelocity_Selector {name paramlist} {
|
||||
# A NeXus-class template is a keyed-list which has Tcl variables for some of the nodes,
|
||||
# if the Tcl variables aren't defined for some branch then that branch is removed.
|
||||
# All other variables are expanded in place, also all 'sobjlists' are split up into type
|
||||
# specific lists. This is intended as a helper function for commands which generate
|
||||
# specific lists. This is intended as a helper function for commands which generate
|
||||
# NeXus-class keyed lists from a simple set of optional parameters.
|
||||
#
|
||||
# @param NXklist, This is a keyed list representation of the NeXus class which will be augmented
|
||||
@@ -215,7 +215,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
|
||||
foreach var $v {
|
||||
if {[string index $var 0] == "$"} {
|
||||
set vn [string range $var 1 end]
|
||||
upvar $level $vn lvar
|
||||
upvar $level $vn lvar
|
||||
if [info exists lvar] {
|
||||
foreach sobj $lvar {
|
||||
lappend [getatt $sobj type]_list $sobj
|
||||
@@ -244,7 +244,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
|
||||
array set linkinfo $v
|
||||
if {[string index $linkinfo(target) 0] == "$"} {
|
||||
set vn [string range $linkinfo(target) 1 end]
|
||||
upvar $level $vn lvar
|
||||
upvar $level $vn lvar
|
||||
if [info exists lvar] {
|
||||
set linktarget $lvar
|
||||
}
|
||||
@@ -253,7 +253,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
|
||||
}
|
||||
if {[string index $linkinfo(nxalias) 0] == "$"} {
|
||||
set vn [string range $linkinfo(nxalias) 1 end]
|
||||
upvar $level $vn avar
|
||||
upvar $level $vn avar
|
||||
if [info exists avar] {
|
||||
set linkname $avar
|
||||
}
|
||||
@@ -268,7 +268,7 @@ proc prune_NX {NXklist nx_template {path ""} {node ""} {level 1}} {
|
||||
default {
|
||||
if {[string range $n 0 1] == "NX"} {
|
||||
set node $n
|
||||
} elseif {[string index $n 0] == "$"} {
|
||||
} elseif {[string index $n 0] == "$"} {
|
||||
set vn [string range $n 1 end]
|
||||
upvar $level $vn lvar
|
||||
if [info exists lvar] {
|
||||
@@ -316,14 +316,14 @@ proc ::hdb::set_subtree_props {st_name klass {control "true"} {privilege "user"}
|
||||
publish $st_name mugger
|
||||
sicslist setatt $st_name klass $klass
|
||||
sicslist setatt $st_name control $control
|
||||
sicslist setatt $st_name privilege $privilege
|
||||
sicslist setatt $st_name privilege $privilege
|
||||
sicslist setatt $st_name kind "hdb_subtree"
|
||||
sicslist setatt $st_name long_name "@none"
|
||||
sicslist setatt $st_name data "true"
|
||||
sicslist setatt $st_name nxsave "true"
|
||||
}
|
||||
|
||||
# @brief Add a subtree to a given hipadaba path.
|
||||
# @brief Add a subtree to a given hipadaba path.
|
||||
#
|
||||
# @param hpath, Basepath for subtree
|
||||
# @param object, SICS object name
|
||||
@@ -331,10 +331,10 @@ proc ::hdb::set_subtree_props {st_name klass {control "true"} {privilege "user"}
|
||||
# @param type, the SICS object type if we are adding SICS object node. Optional, default = @none.
|
||||
# @param makenode, type of node to make. Optional, default = @none.
|
||||
proc ::hdb::add_subtree {hpath subtree {object @none} {type @none} {makenode @none}} {
|
||||
set ::errorInfo ""
|
||||
set ::errorInfo ""
|
||||
set SICStypes {sicsvariable macro}
|
||||
if [catch {
|
||||
switch $makenode {
|
||||
switch $makenode {
|
||||
"@none" {
|
||||
foreach {n v} $subtree {
|
||||
if {[lsearch -exact $::nexus_classes $n] >= 0} {
|
||||
@@ -360,7 +360,7 @@ proc ::hdb::add_subtree {hpath subtree {object @none} {type @none} {makenode @no
|
||||
if {$item==$object} {
|
||||
error "ERROR: Infinite recursion, cannot add $item as a node to it's own hdb subtree"
|
||||
}
|
||||
set objtype [getatt $item type]
|
||||
set objtype [getatt $item type]
|
||||
if {$type != $objtype} {
|
||||
error "ERROR: Specified type of '$type' doesn't match actual type, '$objtype', for $item"
|
||||
}
|
||||
@@ -468,7 +468,7 @@ proc ::hdb::add_node {basePath args} {
|
||||
|
||||
array unset arg_array
|
||||
set catch_status [ catch {
|
||||
array set arg_array $args
|
||||
array set arg_array $args
|
||||
if {[info exists arg_array(path)] && [info exists arg_array(prop_list)]} {
|
||||
add_hpath $basePath $arg_array(path)
|
||||
if {$basePath == "/"} {
|
||||
@@ -499,7 +499,7 @@ proc ::hdb::add_node {basePath args} {
|
||||
array set attribute [::utility::normalattlist $node_name]
|
||||
switch $arg_array(kind) {
|
||||
command {
|
||||
# A command is a macro, node=macro name
|
||||
# A command is a macro, node=macro name
|
||||
set command $node_name
|
||||
set cmd_path [add_command $basePath $command]
|
||||
set node_path $cmd_path
|
||||
@@ -508,7 +508,7 @@ proc ::hdb::add_node {basePath args} {
|
||||
if {[string length [info procs ${command}_parameters]] > 0} {
|
||||
${command}_parameters add_node $cmd_path
|
||||
} else {
|
||||
$command -map param ::hdb::add_cmd_par $cmd_path
|
||||
$command -map param ::hdb::add_cmd_par $cmd_path
|
||||
}
|
||||
if {[string length [info procs ${command}_feedback]] > 0} {
|
||||
add_hpath $cmd_path feedback
|
||||
@@ -517,7 +517,7 @@ proc ::hdb::add_node {basePath args} {
|
||||
} else {
|
||||
add_hpath $cmd_path feedback
|
||||
hsetprop $cmd_path/feedback type part
|
||||
$command -map feedback ::hdb::add_feedback $cmd_path/feedback
|
||||
$command -map feedback ::hdb::add_feedback $cmd_path/feedback
|
||||
}
|
||||
}
|
||||
hobj {
|
||||
@@ -561,7 +561,7 @@ proc ::hdb::add_node {basePath args} {
|
||||
#hmakescript $node_path $arg_array(rscript) $arg_array(wscript) $arg_array(dtype) $arg_array(dlen)
|
||||
}
|
||||
}
|
||||
if {[info exists attribute(units)]} {
|
||||
if {[info exists attribute(units)]} {
|
||||
hsetprop $node_path units [normalgetatt $node_name units]
|
||||
}
|
||||
if {[info exists arg_array(prop_list)]} {
|
||||
@@ -569,10 +569,10 @@ proc ::hdb::add_node {basePath args} {
|
||||
hsetprop $node_path $prop $pval
|
||||
}
|
||||
}
|
||||
if {[info exists attribute(depends)]} {
|
||||
if {[info exists attribute(depends)]} {
|
||||
foreach dep [split [normalgetatt $node_name depends] , ] {
|
||||
set sobjadd_state(depends) true
|
||||
::hdb::sobjadd $node_path $dep
|
||||
::hdb::sobjadd $node_path $dep
|
||||
set sobjadd_state(depends) false
|
||||
}
|
||||
}
|
||||
@@ -612,7 +612,7 @@ proc ::hdb::add_command {basePath command} {
|
||||
hsetprop $cmd_path nxsave $cmd_atts(nxsave)
|
||||
hsetprop $cmd_path sicsdev $cmd_atts(id)
|
||||
return $cmd_path
|
||||
}
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Retrieve the list of attributes for the given sics object
|
||||
@@ -624,7 +624,7 @@ proc ::hdb::attlist {sicsobj} {
|
||||
foreach att [tolower_sicslist $sicsobj] {
|
||||
lappend atts [split [string range $att 0 end-1] =]
|
||||
}
|
||||
return [join $atts]
|
||||
return [join $atts]
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
@@ -722,7 +722,7 @@ proc ::hdb::sobjadd {hpath sobj args} {
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
|
||||
}
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
|
||||
set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)]
|
||||
if {[catch {hsetprop $node_path sicsdev $sobj} err]} {clientput $err error}
|
||||
@@ -733,19 +733,19 @@ proc ::hdb::sobjadd {hpath sobj args} {
|
||||
if {[catch {hsetprop $node_path privilege $sobjatt(privilege)} err]} {clientput $err error}
|
||||
} else {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
}
|
||||
}
|
||||
}
|
||||
node {
|
||||
}
|
||||
singlecounter {
|
||||
# TODO
|
||||
# TODO
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
}
|
||||
histmem {
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
|
||||
}
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
|
||||
set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)]
|
||||
if {[catch {hsetprop $node_path savecmd $sobjatt(savecmd)} err]} {clientput $err error}
|
||||
@@ -761,7 +761,7 @@ proc ::hdb::sobjadd {hpath sobj args} {
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
hsetprop $hpath type part
|
||||
}
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
|
||||
set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)]
|
||||
hsetprop $node_path sicsdev $sobj
|
||||
@@ -772,18 +772,18 @@ proc ::hdb::sobjadd {hpath sobj args} {
|
||||
hsetprop $node_path privilege $sobjatt(privilege)
|
||||
} else {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
}
|
||||
}
|
||||
}
|
||||
nxscript {
|
||||
# TODO
|
||||
# TODO
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
}
|
||||
sicsdata {
|
||||
# TODO
|
||||
# TODO
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
}
|
||||
scanobject {
|
||||
# TODO
|
||||
# TODO
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
}
|
||||
# TODO Can this be replaced with a sct_* glob?
|
||||
@@ -836,7 +836,7 @@ proc ::hdb::sobjtypeadd {hpath sobjtype given_klass} {
|
||||
|
||||
|
||||
##
|
||||
# @brief Remove empty instrument dictionary nodes
|
||||
# @brief Remove empty instrument dictionary nodes
|
||||
#
|
||||
# @param instdict name of the instrument dictionary structure
|
||||
#
|
||||
@@ -853,7 +853,7 @@ proc ::hdb::prune {instdict} {
|
||||
while {[expr [llength $candidates]] > 0} {
|
||||
set new_candidates ""
|
||||
foreach name $candidates {
|
||||
array unset dictval
|
||||
array unset dictval
|
||||
array set dictval $dictarr($name)
|
||||
if {[lsearch $dictval(property) nxvgroup] >= 0} {
|
||||
# Link targets are not candidates for pruning
|
||||
@@ -939,7 +939,7 @@ upvar #0 $instDict dictionary
|
||||
#
|
||||
# @param hpath The save state of the nodes below this path will be set
|
||||
# @param mode true or false
|
||||
# @param top This is just here to make the recursion work from the top level, You don't need
|
||||
# @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 [ catch {
|
||||
@@ -956,7 +956,7 @@ if [ catch {
|
||||
foreach ps [lrange [split [string trim $hnode /] /] 0 end-1] {
|
||||
set hp $hp/$ps
|
||||
hsetprop $hp nxsave true
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hsetprop $hnode nxsave $mode
|
||||
|
||||
Reference in New Issue
Block a user