diff --git a/site_ansto/instrument/config/hipadaba/common_hipadaba_configuration.tcl b/site_ansto/instrument/config/hipadaba/common_hipadaba_configuration.tcl index eb13d2e2..94b3597b 100644 --- a/site_ansto/instrument/config/hipadaba/common_hipadaba_configuration.tcl +++ b/site_ansto/instrument/config/hipadaba/common_hipadaba_configuration.tcl @@ -27,18 +27,35 @@ hattach /experiment/user phone phone hattach /experiment dataFileName datafile #--- Motors -foreach {obj name part} $motor_hpath { - $obj long_name $name - hattach /$instrument/$part $obj $name - #TODO Only ignore node deletion errors for simulated motors - if [ catch {hdel /$instrument/$part/$name/axis} ] {} - if [ catch {hdel /$instrument/$part/$name/units} ] {} +foreach {type path} $motor_hpath { + if {[info exists pathlist(/$instrument/$path)] == 0} { + hmake /$instrument/$path spy none; + hsetprop /$instrument/$path type part; + set pathlist(/$instrument/$path) 1; + } +} + +array set mot_Pdic $motor_hpath; +foreach motor [sicslist type motor] { + if {$motor == "motor"} {continue} + set mpart [SplitReply [$motor part]]; + foreach {type group} [split $mpart .] {}; + set path $mot_Pdic($type); + if {$group != ""} { + if {[info exists pathlist(/$instrument/$path/$group)] == 0} { + hmake /$instrument/$path/$group spy none; + hsetprop /$instrument/$path/$group type part; + set pathlist(/$instrument/$path/$group) 1; + } + hattach /$instrument/$path/$group $motor [SplitReply [$motor long_name]]; + } else { + hattach /$instrument/$path $motor [SplitReply [$motor long_name]]; + } } #--- Configurable Virtual Motors foreach {obj name part master_obj} $cvirtmotor_hpath { set path /$instrument/$part -# hattach /$instrument/$part $obj $name hattach $path $obj $name hchain $path/$name $path/$master_obj } @@ -52,3 +69,5 @@ hsetprop /graphics type graphset ::scancommand::commands_hpath_setup /commands ::scancommand::graphics_hpath_setup /graphics ::scancommand::init + +unset pathlist;