prun and pdrive macros now check arguments and allow driving non posit motors too.
This commit is contained in:
@ -54,7 +54,15 @@ publish reldrive user
|
|||||||
proc prun {args} {
|
proc prun {args} {
|
||||||
if [ catch {
|
if [ catch {
|
||||||
foreach {mot pname} $args {
|
foreach {mot pname} $args {
|
||||||
lappend drlist $mot [SplitReply [$mot posit2unit $pname]]
|
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
|
clientput run {*}$drlist
|
||||||
anstocapture run {*}$drlist
|
anstocapture run {*}$drlist
|
||||||
@ -75,7 +83,15 @@ publish prun user
|
|||||||
proc pdrive {args} {
|
proc pdrive {args} {
|
||||||
if [ catch {
|
if [ catch {
|
||||||
foreach {mot pname} $args {
|
foreach {mot pname} $args {
|
||||||
lappend drlist $mot [SplitReply [$mot posit2unit $pname]]
|
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
|
clientput drive {*}$drlist
|
||||||
anstocapture drive {*}$drlist
|
anstocapture drive {*}$drlist
|
||||||
|
Reference in New Issue
Block a user