36 lines
1.0 KiB
Tcl
36 lines
1.0 KiB
Tcl
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
|
|
|
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
|
|
|
|
# Default enable or disable anticollision for all axes
|
|
# TODO: Provide a list of motors to enable or disable
|
|
proc anticollider {args} {
|
|
set usage "Usage: anticollider (enable | disable)"
|
|
if {$args == "enable"} {
|
|
# TODO change protect_detector to just 'protect'
|
|
::anticollider::protect_detector "true"
|
|
} elseif {$args == "disable"} {
|
|
::anticollider::protect_detector "false"
|
|
} elseif {$args == "help"} {
|
|
clientput $usage
|
|
} else {
|
|
if {[SplitReply [::anticollider::protect_detector]] == "false"} {
|
|
clientput "Anticollision disabled on all axes"
|
|
} else {
|
|
clientput "Anticollision enabled on all axes"
|
|
}
|
|
}
|
|
}
|
|
publish anticollider user
|