diff --git a/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl b/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl index db8cb21a..9638485d 100644 --- a/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/bilby/config/anticollider/anticollider.tcl @@ -2,6 +2,27 @@ source $cfPath(anticollider)/anticollider_common.tcl +namespace eval ::anticollider { + set guide_posit 1 + set aperture_posit 2 + set ap100X100_posit 1 + set coltol 0.1 + set aptol 0.1 + + for {set n 1} {$n < 8} {incr n} { + foreach {col ap} "col$n ap$n ap$n col$n" { + set col_limit [expr [SplitReply [$col posit2unit $aperture_posit]] - $coltol] + set ap_limit [expr [SplitReply [$ap posit2unit $ap100X100_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 {-inf $ap_limit} }] + 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"} { @@ -11,4 +32,3 @@ proc ::anticollider::enable {args} { } } -::anticollider::loadscript acscript.txt