From 56d63ebc3018ea64f45145df030d969249612b0f Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Fri, 16 Jan 2015 16:20:01 +1100 Subject: [PATCH] SICS-842: Added 'enable' and 'disable' device control commands. --- .../instrument/bilby/bilby_configuration.tcl | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/site_ansto/instrument/bilby/bilby_configuration.tcl b/site_ansto/instrument/bilby/bilby_configuration.tcl index 22553f05..c0dcfd24 100644 --- a/site_ansto/instrument/bilby/bilby_configuration.tcl +++ b/site_ansto/instrument/bilby/bilby_configuration.tcl @@ -52,6 +52,46 @@ fileeval $cfPath(commands)/hvcommands.tcl source gumxml.tcl +# Define 'enable' and 'disable' commands to allow or prevent control of some +# devices. +proc dev_control {dev allow} { + switch $dev { + "roughing" { + if {$allow} { + set ::scobj::shutters::rough_slits_enabled 1 + } else { + set ::scobj::shutters::rough_slits_enabled 0 + } + } + "ss1" { + if {$allow} { + ss1d fixed -1 + ss1l fixed -1 + ss1r fixed -1 + ss1u fixed -1 + } else { + ss1d fixed 1 + ss1l fixed 1 + ss1r fixed 1 + ss1u fixed 1 + } + } + "help" { + clientput "Valid devices are roughing, ss1" + } + default { + error "You cannot disable or enable control on $dev. Call with 'help' to get a list." + } + } +} +proc enable {dev} { + dev_control $dev 1 +} +publish enable mugger +proc disable {dev} { + dev_control $dev 0 +} +publish disable mugger ::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false ::anticollider::protect_detector "true"