diff --git a/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl b/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl index 26a23cc7..602643bd 100644 --- a/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl +++ b/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl @@ -16,6 +16,8 @@ InstallHdb namespace eval ::hdb { namespace export buildHDB attlist +set sobjadd_state(depends) false + set NXlog_template { NXlog { $name { @@ -462,6 +464,8 @@ proc ::hdb::add_feedback {hpath sobj name} { #\tor "node nnn kind kkk long_name junk prop_list {propA aaa propB bbb ...}" proc ::hdb::add_node {basePath args} { global nodeindex + variable sobjadd_state + array unset arg_array if [ catch { array set arg_array $args @@ -492,7 +496,7 @@ proc ::hdb::add_node {basePath args} { } if {[lsearch [hlist $basePath] $node_name] == -1} { #TODO allow hdb nodes of type drivable countable environment - array set attribute [attlist $node_name] + array set attribute [::utility::normalattlist $node_name] switch $arg_array(kind) { command { # A command is a macro, node=macro name @@ -527,7 +531,7 @@ proc ::hdb::add_node {basePath args} { hsetprop $node_path klass [getatt $node_name klass] if [info exists attribute(hdbchain)] { foreach pmot [split $attribute(hdbchain) ,] { - hchain $node_path [getatt $pmot hdb_path] + hchain $node_path [lindex [split [getatt $pmot hdb_path] ,] 0] } } foreach child [hlist $node_path] { @@ -567,10 +571,16 @@ proc ::hdb::add_node {basePath args} { } if {[info exists attribute(depends)]} { foreach dep [split [normalgetatt $node_name depends] , ] { + set sobjadd_state(depends) true ::hdb::sobjadd $node_path $dep + set sobjadd_state(depends) false } } - sicslist setatt $node_name hdb_path $node_path + if { $sobjadd_state(depends) == false && [info exists attribute(hdb_path)] } { + sicslist setatt $node_name hdb_path $attribute(hdb_path),$node_path + } else { + sicslist setatt $node_name hdb_path $node_path + } return $node_path } } message ] {