diff --git a/site_ansto/instrument/config/anticollider/anticollider_common.tcl b/site_ansto/instrument/config/anticollider/anticollider_common.tcl index f464fa31..53d52383 100644 --- a/site_ansto/instrument/config/anticollider/anticollider_common.tcl +++ b/site_ansto/instrument/config/anticollider/anticollider_common.tcl @@ -1,5 +1,5 @@ -# $Revision: 1.2 $ -# $Date: 2008-05-30 00:26:54 $ +# $Revision: 1.3 $ +# $Date: 2008-06-12 02:55:28 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ @@ -72,6 +72,16 @@ proc ::anticollider::genveto {vprog} { } } +## +# @brief Instrument specific configurations should re-implement this if they want +# to override the anticollision detection on some conditions +# +# @param args list of motorname target pairs +# @return "true" (default) enables anticollision detection +# @return "false" disables anticollision detection +proc ::anticollider::enable {args} { + return "true" +} ## # @brief Generic anti-collision script for simple collision avoidance. # @@ -84,6 +94,12 @@ proc ::anticollider::genveto {vprog} { proc ::anticollider::acscript {args} { variable veto_region + if {[::anticollider::enable $args] == "false"} { + foreach {regmot target} $args { + anticollision add 0 $regmot $target + } + return + } foreach {regmot target} $args { foreach row $veto_region($regmot) { if { [lindex $row 1] == "@and"} { diff --git a/site_ansto/instrument/config/commands/commands_common.tcl b/site_ansto/instrument/config/commands/commands_common.tcl index abd884c2..37d2263e 100644 --- a/site_ansto/instrument/config/commands/commands_common.tcl +++ b/site_ansto/instrument/config/commands/commands_common.tcl @@ -78,8 +78,5 @@ namespace eval monitor { } ::monitor::count -addfb int counts text status ::monitor::count -set feedback status IDLE - array set fbarr [::monitor::count -list feedback] - ::utility::mkData $fbarr(counts) data monitor privilege user mutable true - array unset fbarr } ################################################################################ diff --git a/site_ansto/instrument/reflectometer/config/anticollider/anticollider.tcl b/site_ansto/instrument/reflectometer/config/anticollider/anticollider.tcl index 87660bcf..b7558a67 100644 --- a/site_ansto/instrument/reflectometer/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/reflectometer/config/anticollider/anticollider.tcl @@ -1,8 +1,18 @@ -# $Revision: 1.2 $ -# $Date: 2008-05-30 00:26:56 $ +# $Revision: 1.3 $ +# $Date: 2008-06-12 02:55:28 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ source $cfPath(anticollider)/anticollider_common.tcl + +# 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" + } +} + ::anticollider::loadscript acscript.txt diff --git a/site_ansto/instrument/sans/config/anticollider/anticollider.tcl b/site_ansto/instrument/sans/config/anticollider/anticollider.tcl index edb84062..b7558a67 100644 --- a/site_ansto/instrument/sans/config/anticollider/anticollider.tcl +++ b/site_ansto/instrument/sans/config/anticollider/anticollider.tcl @@ -1,8 +1,18 @@ -# $Revision: 1.2 $ -# $Date: 2008-05-30 00:26:57 $ +# $Revision: 1.3 $ +# $Date: 2008-06-12 02:55:28 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ source $cfPath(anticollider)/anticollider_common.tcl + +# 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" + } +} + ::anticollider::loadscript acscript.txt