Added asynch queue to send commands to the chopper selector.

This commit is contained in:
Ferdi Franceschini
2014-02-17 14:45:28 +11:00
parent bacf578fdc
commit f7b7c27415

View File

@ -4,16 +4,22 @@ namespace eval chopper {
set master_chopper_id_simvar 1 set master_chopper_id_simvar 1
} }
if {$sim_mode == false} {
MakeAsyncProtocol std
MakeAsyncQueue chopsel std chopsel1-bilby 30000
}
::utility::macro::getset int master_chopper_id {args} { ::utility::macro::getset int master_chopper_id {args} {
variable sim_mode [SplitReply [chopper_simulation]] variable sim_mode [SplitReply [chopper_simulation]]
if {$sim_mode == "false"} { if {$sim_mode == false} {
if {$args == ""} { if {$args == ""} {
return "master_chopper_id = [sct_chopper_t0 transact {get master chopper}]" chopsel send {get master chopper}
return "master_chopper_id = [SplitReply [chopsel send {get master chopper}]]"
} else { } else {
sct_chopper_t0 transact "enable chopper selection" chopsel send "get master chopper"
sct_chopper_t0 transact "set master chopper=$args" chopsel send "enable chopper selection"
sct_chopper_t0 transact "disable chopper selection" chopsel send "set master chopper=$args"
chopsel send "disable chopper selection"
} }
} else { } else {
if {$args == ""} { if {$args == ""} {