Construct motor hipadaba paths from type and group info

in the "motor part" field.

r1785 | ffr | 2007-04-02 18:19:17 +1000 (Mon, 02 Apr 2007) | 3 lines
This commit is contained in:
Ferdi Franceschini
2007-04-02 18:19:17 +10:00
committed by Douglas Clowes
parent 105cc5650c
commit f38e44c8d8

View File

@@ -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;