SICS-842: Added 'enable' and 'disable' device control commands.
This commit is contained in:
@ -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"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user