From b257413fd04fd7055ab49b3c6eb36c535093cb1c Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 3 Feb 2014 23:28:56 +1100 Subject: [PATCH] Added chopper id command --- .../instrument/bilby/bilby_configuration.tcl | 1 + .../bilby/config/chopper/chopper.tcl | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 site_ansto/instrument/bilby/config/chopper/chopper.tcl diff --git a/site_ansto/instrument/bilby/bilby_configuration.tcl b/site_ansto/instrument/bilby/bilby_configuration.tcl index 22ac8031..a96cbd51 100644 --- a/site_ansto/instrument/bilby/bilby_configuration.tcl +++ b/site_ansto/instrument/bilby/bilby_configuration.tcl @@ -23,6 +23,7 @@ fileeval $cfPath(motors)/positmotor_configuration.tcl fileeval $cfPath(velsel)/velsel.tcl fileeval $cfPath(parameters)/parameters.tcl fileeval $cfPath(plc)/plc.tcl +fileeval $cfPath(chopper)/chopper.tcl fileeval $cfPath(optics)/optics.tcl fileeval $cfPath(counter)/counter.tcl fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl diff --git a/site_ansto/instrument/bilby/config/chopper/chopper.tcl b/site_ansto/instrument/bilby/config/chopper/chopper.tcl new file mode 100644 index 00000000..4a6e0744 --- /dev/null +++ b/site_ansto/instrument/bilby/config/chopper/chopper.tcl @@ -0,0 +1,28 @@ + +namespace eval chopper { + variable sim_mode [SplitReply [chopper_simulation]] + set master_chopper_id_simvar 1 +} + +::utility::macro::getset int master_chopper_id {args} { + variable sim_mode [SplitReply [chopper_simulation]] + + if {$sim_mode == "false"} { + if {$args == ""} { + return "master_chopper_id = [sct_chopper_t0 transact {get master chopper}]" + } else { + sct_chopper_t0 transact "enable chopper selection" + sct_chopper_t0 transact "set master chopper=$args" + sct_chopper_t0 transact "disable chopper selection" + } + } else { + if {$args == ""} { + return master_chopper_id = $::chopper::master_chopper_id_simvar + } else { + set ::chopper::master_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