SICS-842: Added 'enable' and 'disable' device control commands.

This commit is contained in:
Ferdi Franceschini
2015-01-16 16:20:01 +11:00
parent 06f1f2f62a
commit 56d63ebc30

View File

@ -52,6 +52,46 @@ fileeval $cfPath(commands)/hvcommands.tcl
source gumxml.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 ::utility::mkVar ::anticollider::protect_detector text manager protect_detector false detector true false
::anticollider::protect_detector "true" ::anticollider::protect_detector "true"