From d5da9eba151f0f1127c11396b66f9c56867ed442 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 4 Jun 2012 20:16:07 +1000 Subject: [PATCH] SICS-477 Added the "detector" parameter to the "runscan" command tree with a default value of "histmem". Also created a "detector" convenience macro so that the detector type can be easily queried and set from the command line. r3590 | ffr | 2012-06-04 20:16:07 +1000 (Mon, 04 Jun 2012) | 5 lines --- .../config/commands/commands_common.tcl | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/site_ansto/instrument/config/commands/commands_common.tcl b/site_ansto/instrument/config/commands/commands_common.tcl index 70a407b0..9f70dec5 100644 --- a/site_ansto/instrument/config/commands/commands_common.tcl +++ b/site_ansto/instrument/config/commands/commands_common.tcl @@ -105,6 +105,7 @@ command hdb_bmonscan { } ::scan::hdb_bmonscan -addfb text mode float preset float scan_variable_value int scanpoint int counts text status ::scan::hdb_bmonscan -set feedback status IDLE +sicslist setatt ::scan::hdb_bmonscan long_name bmonscan command runscan_cmd [subst { @@ -117,6 +118,7 @@ command hdb_bmonscan { text=[join [array names ::nexus::histmem_filetype_spec] , ] datatype text=save,nosave savetype text=true,false force + text=histmem,bmon detector }] { variable parameters @@ -124,11 +126,13 @@ command hdb_bmonscan { set parameters(preset) $preset ::scan::runscan $scan_variable $scan_start $scan_stop $numpoints $mode $preset savetype $savetype datatype $datatype force $force } + ::scan::runscan_cmd -set detector "histmem" ::scan::runscan_cmd -addfb float scan_variable_value float scan_step int scanpoint text status ::scan::runscan_cmd -set feedback status IDLE sicslist setatt ::scan::runscan_cmd long_name runscan + } -sicslist setatt ::scan::hdb_bmonscan long_name bmonscan + ################################################################################ ################################################################################ @@ -175,3 +179,24 @@ scriptcallback connect bm COUNTEND "::monitor::count -set feedback status IDLE } } } + +# Convenience proc for setting the 'runscan' command's detector type +proc detector {{det "report"}} { + set det [string tolower $det] + + switch $det { + "report" { + return [::scan::runscan_cmd -get detector] + } + "histmem" { + ::scan::runscan_cmd -set detector "histmem" + } + "bmon" { + ::scan::runscan_cmd -set detector "bmon" + } + default { + return -code error "ERROR: detector type must be either 'histmem' or bmon' not $det" + } + } +} +publish detector user