prun and pdrive macros now check arguments and allow driving non posit motors too.

This commit is contained in:
Ferdi Franceschini
2014-09-30 15:06:02 +10:00
parent 78372baae9
commit a9c0cf3df6

View File

@ -54,8 +54,16 @@ publish reldrive user
proc prun {args} {
if [ catch {
foreach {mot pname} $args {
set posnames [SplitReply [$mot position_names]]
if {([llength $posnames] == 0) && [string is double $pname]} {
lappend drlist $mot $pname
} else {
if {[lsearch $posnames $pname] == -1} {
error "$pname must be one of $posnames for $mot"
}
lappend drlist $mot [SplitReply [$mot posit2unit $pname]]
}
}
clientput run {*}$drlist
anstocapture run {*}$drlist
} message ] {
@ -75,8 +83,16 @@ publish prun user
proc pdrive {args} {
if [ catch {
foreach {mot pname} $args {
set posnames [SplitReply [$mot position_names]]
if {([llength $posnames] == 0) && [string is double $pname]} {
lappend drlist $mot $pname
} else {
if {[lsearch $posnames $pname] == -1} {
error "$pname must be one of $posnames for $mot"
}
lappend drlist $mot [SplitReply [$mot posit2unit $pname]]
}
}
clientput drive {*}$drlist
anstocapture drive {*}$drlist
} message ] {