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:
committed by
Douglas Clowes
parent
105cc5650c
commit
f38e44c8d8
@@ -27,18 +27,35 @@ hattach /experiment/user phone phone
|
|||||||
hattach /experiment dataFileName datafile
|
hattach /experiment dataFileName datafile
|
||||||
|
|
||||||
#--- Motors
|
#--- Motors
|
||||||
foreach {obj name part} $motor_hpath {
|
foreach {type path} $motor_hpath {
|
||||||
$obj long_name $name
|
if {[info exists pathlist(/$instrument/$path)] == 0} {
|
||||||
hattach /$instrument/$part $obj $name
|
hmake /$instrument/$path spy none;
|
||||||
#TODO Only ignore node deletion errors for simulated motors
|
hsetprop /$instrument/$path type part;
|
||||||
if [ catch {hdel /$instrument/$part/$name/axis} ] {}
|
set pathlist(/$instrument/$path) 1;
|
||||||
if [ catch {hdel /$instrument/$part/$name/units} ] {}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
#--- Configurable Virtual Motors
|
||||||
foreach {obj name part master_obj} $cvirtmotor_hpath {
|
foreach {obj name part master_obj} $cvirtmotor_hpath {
|
||||||
set path /$instrument/$part
|
set path /$instrument/$part
|
||||||
# hattach /$instrument/$part $obj $name
|
|
||||||
hattach $path $obj $name
|
hattach $path $obj $name
|
||||||
hchain $path/$name $path/$master_obj
|
hchain $path/$name $path/$master_obj
|
||||||
}
|
}
|
||||||
@@ -52,3 +69,5 @@ hsetprop /graphics type graphset
|
|||||||
::scancommand::commands_hpath_setup /commands
|
::scancommand::commands_hpath_setup /commands
|
||||||
::scancommand::graphics_hpath_setup /graphics
|
::scancommand::graphics_hpath_setup /graphics
|
||||||
::scancommand::init
|
::scancommand::init
|
||||||
|
|
||||||
|
unset pathlist;
|
||||||
|
|||||||
Reference in New Issue
Block a user