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
This commit is contained in:
Ferdi Franceschini
2012-06-04 20:16:07 +10:00
committed by Douglas Clowes
parent 6b3f71cc6a
commit d5da9eba15

View File

@@ -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