From 2996889ea5dfe5815730fff7bebf5a94bd773eb1 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Tue, 17 Jun 2014 07:20:27 +1000 Subject: [PATCH] The timing chopper isn't necessarily the same as the master chopper. --- .../bilby/config/chopper/chopper.tcl | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/site_ansto/instrument/bilby/config/chopper/chopper.tcl b/site_ansto/instrument/bilby/config/chopper/chopper.tcl index 656ed476..ae30efe2 100644 --- a/site_ansto/instrument/bilby/config/chopper/chopper.tcl +++ b/site_ansto/instrument/bilby/config/chopper/chopper.tcl @@ -1,20 +1,20 @@ namespace eval chopper { variable sim_mode [SplitReply [chopper_simulation]] - set master_chopper_id_simvar 1 + set t0_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 t0_chopper_id {args} { variable sim_mode [SplitReply [chopper_simulation]] if {$sim_mode == false} { if {$args == ""} { chopsel send {get master chopper} - return "master_chopper_id = [SplitReply [chopsel send {get master chopper}]]" + return "t0_chopper_id = [SplitReply [chopsel send {get master chopper}]]" } else { chopsel send "get master chopper" chopsel send "enable chopper selection" @@ -23,12 +23,16 @@ if {$sim_mode == false} { } } else { if {$args == ""} { - return master_chopper_id = $::chopper::master_chopper_id_simvar + if {$::chopper::t0_chopper_id_simvar < 1 || $::chopper::t0_chopper_id_simvar > 4} { + return -code error "Your simulated chopper returned an error" + } else { + return t0_chopper_id = $::chopper::t0_chopper_id_simvar + } } else { - set ::chopper::master_chopper_id_simvar $args + set ::chopper::t0_chopper_id_simvar $args } } } -sicslist setatt master_chopper_id klass NXdisk_chopper -sicslist setatt master_chopper_id long_name master_chopper_id -sicslist setatt master_chopper_id mutable false +sicslist setatt t0_chopper_id klass NXdisk_chopper +sicslist setatt t0_chopper_id long_name t0_chopper_id +sicslist setatt t0_chopper_id mutable false