prun and pdrive macros now check arguments and allow driving non posit motors too.
This commit is contained in:
@ -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 ] {
|
||||
|
Reference in New Issue
Block a user