Files
sics/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl
2014-02-02 17:48:22 +11:00

35 lines
1003 B
Tcl

# Author: Ferdi Franceschini (ffr@ansto.gov.au)
source $cfPath(anticollider)/anticollider_common.tcl
namespace eval ::anticollider {
set guide_posit 1
set aperture_posit 2
set apD10_posit 1
set coltol 0.5
set aptol 0.1
for {set n 1} {$n < 8} {incr n} {
foreach {col ap} "col$n ap$n" {
set col_limit [expr [SplitReply [$col posit2unit $aperture_posit]] - $coltol]
set ap_limit [expr [SplitReply [$ap posit2unit $apD10_posit]] + $aptol]
set acrule [subst {forbid {-inf inf} for $ap when $col in {-inf $col_limit} }]
lappend ::anticollider::prog $acrule
clientput $acrule
set acrule [subst {forbid {-inf inf} for $col when $ap in {$ap_limit inf} }]
lappend ::anticollider::prog $acrule
clientput $acrule
}
}
}
# NOTE: This is called with a list of motorname target pairs
proc ::anticollider::enable {args} {
if {[SplitReply [::anticollider::protect_detector]] == "false"} {
return "false"
} else {
return "true"
}
}