SICS-606 Allow defining multiple motors and ranges to forbid moves.
Added to support the anticollision requirements for the monochrommator axes on Pelican.
This commit is contained in:
@ -54,9 +54,9 @@ proc ::anticollider::genveto {vprog} {
|
||||
array set vp $line
|
||||
if [info exists vp(whenall)] {
|
||||
foreach {mot in range} $vp(whenall) {
|
||||
if {[llength [join $range]] != 2} {
|
||||
error "ERROR: $range is not a valid range for $mot. Line $lnum of the veto list"
|
||||
}
|
||||
# if {[llength [join $range]] != 2} {
|
||||
# error "ERROR: $range is not a valid range for $mot. Line $lnum of the veto list"
|
||||
# }
|
||||
lappend condlist $mot $range
|
||||
}
|
||||
lappend veto_region($vp(for)) [list $vp(forbid) @and $condlist]
|
||||
@ -101,16 +101,17 @@ proc ::anticollider::acscript {args} {
|
||||
foreach row $veto_region($regmot) {
|
||||
if { [lindex $row 1] == "@and"} {
|
||||
set forbid [lindex $row 0]
|
||||
set no_veto 0
|
||||
set veto 0
|
||||
foreach {mot range} [lindex $row 2] {
|
||||
set pos [SplitReply [$mot]]
|
||||
foreach {lower upper} $range {}
|
||||
if {$pos < $lower || $pos > $upper} {
|
||||
set no_veto 1
|
||||
foreach {lower upper} [join $range] {
|
||||
if {$pos >= $lower && $pos <= $upper} {
|
||||
set veto 1
|
||||
break
|
||||
}
|
||||
}
|
||||
if {$no_veto} {
|
||||
}
|
||||
if {!$veto} {
|
||||
continue
|
||||
} else {
|
||||
foreach {min max} $forbid {}
|
||||
@ -171,6 +172,7 @@ proc ::anticollider::init {} {
|
||||
anticollision register $motor
|
||||
}
|
||||
} message ] {
|
||||
clientput [info level 0] ERROR: $message
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
}
|
||||
|
Reference in New Issue
Block a user