Create pas/config/source/source.tcl
config/source/source_common.tcl
pelican_configuration.tcl

deploySICS.sh
Don't deploy script validator configs, they are obsolete

server_config.tcl
Source config has been moved to  config/source and is specialised for each instrument by calling the instrument specific initialiser ::source:isc_initalize

commands_common_1.tcl
The monitor mode and preset are recorded when running the count command

counter_common_1.tcl
Report and record the counts and time for the multicounter and each monitor.  Also record the mode and preset for the multicounter.

hmm_configuration_common_1.tcl
Cleanup, remove obsolete code.
Report and record the hmm total counts and time.
Allow monitor controlled acquisition from the histogram server

nxscripts_common_1.tcl
Add DataType to NXdata section, preserve case in text attributes.

scan_common_1.tcl
Provide sensible feedback for our bmonscan and hmscan objects.
Set run_mode when doing a scan.  Allow users to select the datatype for histmem scans and to force a scan

wombat_configuration.tcl
echidna_configuration.tcl
platypus_configuration.tcl
kowari_configuration.tcl
quokka_configuration.tcl
Load source config.

quokka_configuration.tcl
SICS-198 HACK, Add AttrotDeg and RotApDeg status feedback.

sans/commands/commands.tcl
Add status feedback for quokka "guide" command.

sans/parameters/parameters.tcl
Make sure data can be saved as xml (replace % with _percent)
SICS-198 HACK, add AttRotDeg and RotApDeg status feedback.

utility.tcl
Fix nasty "params array generator" bug.  SICS commands execute at runlevel 0 which means that the params anonymous array must be made at this level.
Provide the normalattlist command to enable creating attribute lists with the case preserved.

Added the runsics, runtestsics and sicsclient scripts to CVS.
Added source configurations for echidna, wombat, kowari, quokka, platypus, and pelican to CVS

r2644 | ffr | 2008-07-11 11:09:57 +1000 (Fri, 11 Jul 2008) | 53 lines
This commit is contained in:
Ferdi Franceschini
2008-07-11 11:09:57 +10:00
committed by Douglas Clowes
parent b4fb916018
commit 01be487c52
33 changed files with 779 additions and 393 deletions

View File

@@ -1,2 +1,14 @@
This directory contains common configuration files shared by the instrument specific configurations.
How to add a new configuration section
mkdir config/newcomp
Create the common config file, eg
config/newcomp/newcomp_common.tcl
Create the instrument specific config file which sources the common config
hrpd/config/newcomp/newcomp.tcl
Add the path for the common config file to the common config list
hrpd/config/INSTCFCOMMON.TXT
DON'T FORGET TO ADD THE NEW FILES AND DIRECTORIES TO CVS

View File

@@ -72,7 +72,9 @@ namespace eval monitor {
} {
::monitor::count -set feedback status BUSY
bm setmode $mode
bm_mode $mode
bm count $preset
bm_preset $preset
::monitor::count -set feedback counts [SplitReply [bm getcounts]];
::monitor::count -set feedback status IDLE
}

View File

@@ -7,7 +7,6 @@ namespace eval counter {
proc ::counter::transferscript {} {
variable isc_numchannels
# set val "123.4 10 20 30 40 50 60 70 80"
set val [SplitReply [bm1 gettime]]
for {set i 1} {$i <= $isc_numchannels} {incr i} {
append val " [SplitReply [bm$i getcounts] ]"
@@ -29,30 +28,60 @@ proc ::counter::ic_initialize {} {
# MakeCounter bm SIM 0.0;
for {set n 1} {$n <= $isc_numchannels} {incr n} {
MakeCounter bm$n SIM 0.0
append bm_list "bm$n "
append bm_list "bm$n "
}
eval "MakeMultiCounter bm $bm_list"
} else {
# Make and configure an ANSTO beam monitor counter.
# This must be sourced before the hmm_configuration.tcl until we separate the scan setup from the hmm setup
for {set i 0; set n 1} {$i < $isc_numchannels} {incr i; incr n} {
MakeCounter bm$n anstomonitor [ params host $isc_monitor_address port [lindex $isc_portlist $i] ]
append bm_list "bm$n "
}
}
eval "MakeMultiCounter bm $bm_list"
bm transferscript ::counter::transferscript
bm SetExponent 0
sicslist setatt bm privilege internal
::utility::mkVar bm_mode Text user mode true monitor true true
::utility::mkVar bm_preset Float user preset true monitor true true
::utility::macro::getset float monitor_counts {} {
return "monitor_counts = [SplitReply [bm getcounts]]"
}
sicslist setatt monitor_counts klass monitor
sicslist setatt monitor_counts long_name data
sicslist setatt monitor_counts mutable true
::utility::macro::getset float monitor_time {} {
return "monitor_time = [SplitReply [bm gettime]]"
}
sicslist setatt monitor_time klass monitor
sicslist setatt monitor_time long_name time
sicslist setatt monitor_time mutable true
for {set bm_num 1} {$bm_num <= $isc_numchannels} {incr bm_num} {
set bm_counts bm${bm_num}_counts
set bmon bm${bm_num}
::utility::macro::getset int $bm_counts {} [subst -nocommands {
return "[$bmon getcounts]"
}]
sicslist setatt $bm_counts klass monitor
sicslist setatt $bm_counts long_name $bm_counts
sicslist setatt $bm_counts mutable true
set bm_time bm${bm_num}_time
set bmon bm${bm_num}
::utility::macro::getset float $bm_time {} [subst -nocommands {
return "[$bmon gettime]"
}]
sicslist setatt $bm_time klass monitor
sicslist setatt $bm_time long_name $bm_time
sicslist setatt $bm_time mutable true
}
} message ] {
if {$::errorCode=="NONE"} {return $message}
return -code error $message
}
}
::utility::macro::getset float monitor_counts {} {
return "monitor_counts = [SplitReply [bm getcounts]]"
}
sicslist setatt monitor_counts klass monitor
sicslist setatt monitor_counts long_name data
sicslist setatt monitor_counts mutable true

View File

@@ -1,5 +1,5 @@
# $Revision: 1.33 $
# $Date: 2008-07-01 07:02:26 $
# $Revision: 1.34 $
# $Date: 2008-07-11 01:09:56 $
# Author: Ferdi Franceschini
# Based on the examples in the hs_test.tcl sample configuration by Mark Lesha.
# http://gumtree.ansto.gov.au:9080/nbicms/bragg-systems/histogram-server/hs_test.tcl/view
@@ -18,6 +18,8 @@ namespace eval histogram_memory {
# Common config variables
variable histmem_simulation
variable ic_count_methods
variable preset_mult
variable monitor_controlled
# Instrument Specific Config variables
@@ -95,13 +97,13 @@ namespace eval histogram_memory {
array set default_frame_source_always_internal {
echidna "true"
koala "false"
kowari "false"
pelican "false"
platypus "false"
quokka "false"
taipan "false"
wombat "false"
koala "false"
kowari "false"
pelican "false"
platypus "false"
quokka "false"
taipan "false"
wombat "false"
}
::utility::mkVar detector_active_height_mm Float user active_height true detector true true
@@ -112,16 +114,7 @@ namespace eval histogram_memory {
::utility::mkVar hmm_user_configpath Text manager user_configpath false detector false false
hmm_user_configpath ../user_config/hmm
::utility::mkVar hmm_mode Text user mode true detector true true
::utility::mkVar _hmm_vert_axis Text user vert_axis true detector false true
::utility::mkVar _hmm_hor_axis Text user hor_axis true detector false true
::utility::mkVar _hmm_hor_axis_alias Text user hor_axis_alias true detector false true
::utility::mkVar _hmm_vert_axis_alias Text user vert_axis_alias true detector false true
::utility::mkVar _hmm_hor_channel_name Text user hor_channel_name true detector false true
_hmm_vert_axis y_pixel_offset
_hmm_vert_axis_alias dvaxis
_hmm_hor_axis polar_angle
_hmm_hor_axis_alias dtheta
_hmm_hor_channel_name horizontal_channel_number
::utility::mkVar hmm_preset Float user preset true detector true true
} message ] {
if {$::errorCode=="NONE"} {return $message}
return -code error $message
@@ -1549,6 +1542,33 @@ proc ::histogram_memory::t_max {} {
return -code error $message
}
}
##
# @brief Total counts in histogram defined by the OAT table.
::utility::macro::getset int ::histogram_memory::total_counts {} {
return "total_counts = [SplitReply [hmm configure num_events_filled_to_histo]]"
}
sicslist setatt ::histogram_memory::total_counts klass detector
sicslist setatt ::histogram_memory::total_counts long_name total_counts
sicslist setatt ::histogram_memory::total_counts mutable true
##
# @brief Histogram memory acquisition time
::utility::macro::getset float ::histogram_memory::time {} {
return "time = [SplitReply [hmm configure acq_dataset_active_sec]]"
}
sicslist setatt ::histogram_memory::time klass detector
sicslist setatt ::histogram_memory::time long_name time
sicslist setatt ::histogram_memory::time mutable true
sicslist setatt ::histogram_memory::time units seconds
##
# @brief Update the beam monitors when the histmem has finished counting.
proc ::histogram_memory::update_bm {} {
bm status
}
publish ::histogram_memory::update_bm user
##
# @brief Sets histogram server to default configuration, initialises SICS histogram memory
# dictionary values and clears SICS OAT BAT CAT FAT ... tables
@@ -1570,14 +1590,6 @@ proc ::histogram_memory::ic_initialize {} {
sicslist setatt $bm_status long_name $bm_status
sicslist setatt $bm_status mutable false
set bm_counts bm${bm_num}_counts
::utility::macro::getset int $bm_counts {} [subst -nocommands {
return "$bm_counts = [lindex [hmm configure $bm_counts] 2]"
}]
sicslist setatt $bm_counts klass monitor
sicslist setatt $bm_counts long_name $bm_counts
sicslist setatt $bm_counts mutable true
set bm_event_rate bm${bm_num}_event_rate
::utility::macro::getset float $bm_event_rate {} [subst -nocommands {
return "$bm_event_rate = [lindex [hmm configure $bm_event_rate] 2]"
@@ -1618,6 +1630,7 @@ proc ::histogram_memory::ic_initialize {} {
hmm configure hmDataPath ../HMData
hmm configure hmconfigscript $configuration
::histogram_memory::configure_dims
scriptcallback connect hmm COUNTEND ::histogram_memory::update_bm
} message ] {
if {$::errorCode=="NONE"} {return $message}
return -code error $message
@@ -1644,6 +1657,8 @@ proc ::histogram_memory::post_count {} {}
# @param block (optional) default="noblock"
proc ::histogram_memory::start {{blocking "noblock"}} {
variable histmem_simulation
variable monitor_controlled
if [ catch {
set options [list block noblock]
if {[lsearch $options $blocking] == -1} {
@@ -1651,7 +1666,11 @@ proc ::histogram_memory::post_count {} {}
}
::histogram_memory::pre_count
hmm init
hmc start 1000000000 timer pause 1
if {$monitor_controlled == "true"} {
hmm count
} else {
hmc start 1000000000 timer pause 1
}
set reply [SplitReply [hmm configure daq]]
if {$histmem_simulation==false && $reply != "Started"} {
error "ERROR: Histogram server failed to start"
@@ -1659,7 +1678,7 @@ proc ::histogram_memory::post_count {} {}
clientput "histmem started" value
if {$blocking == "block"} {
blockctr count 0
::histogram_memory::pause
::histogram_memory::pause
}
} message ] {
if {$::errorCode=="NONE"} {return $message}
@@ -1717,6 +1736,8 @@ proc ::histogram_memory::post_count {} {}
# @param method Set histmem mode or return current mode if blank
proc ::histogram_memory::count_method {{method ""}} {
variable ic_count_methods
variable preset_mult
variable monitor_controlled
if [ catch {
set modes $ic_count_methods
@@ -1726,10 +1747,21 @@ proc ::histogram_memory::post_count {} {}
if {[lsearch $modes $method] == -1} {
error "ERROR: Count mode, $method, must be one of $modes"
}
if {$method == "time"} {
set preset_mult 100
} else {
set preset_mult 1
}
hmm configure FAT_COUNT_METHOD $method
if {[string range $method 0 [string first "R_" $method]] == "MONITOR"} {
hmm configure FAT_${method}_CONTROL ENABLE
set bmchan [expr [string index $method end] - 1]
bm setchannel $bmchan
set monitor_controlled "true"
} else {
set monitor_controlled "false"
}
hmm stop
hmm init
hmm_mode $method
}
@@ -1746,6 +1778,8 @@ proc ::histogram_memory::post_count {} {}
# @see count_method
proc ::histogram_memory::count_size {{preset ""}} {
variable state
variable preset_mult
if [ catch {
if {$preset == ""} {
return $state(preset)
@@ -1753,9 +1787,10 @@ proc ::histogram_memory::post_count {} {}
if {[string is double $preset] == 0 || $preset < 0} {
error "ERROR: The preset must be a non-negative floating point number"
}
hmm configure FAT_COUNT_SIZE [expr {100.0 * $preset}]
hmm configure FAT_COUNT_SIZE [expr {$preset_mult * $preset}]
hmm init
set state(preset) $preset
hmm_preset $preset
}
} message ] {
if {$::errorCode=="NONE"} {return $message}

View File

@@ -11,12 +11,15 @@ sicsdatafactory new nxscript_data
::utility::mkVar eend Text user end_time true entry false true
::utility::mkVar timestamp int user time_stamp true entry false true
::utility::mkVar data_run_number int user run_number true instrument false true
::utility::mkVar nexus_datatype text user DataType true data false true
sicslist setatt data_run_number mutable true
sicslist setatt timestamp mutable true
sicslist setatt timestamp units seconds
sicslist setatt nexus_datatype mutable false
namespace eval nexus {
variable data_gp_path "/data"
nexus_datatype "UNKNOWN"
set exports [list newfile closefile save data]
eval namespace export $exports
if 0 {datafilename}
@@ -129,6 +132,7 @@ proc newFileName {postfix} {
}
proc ::nexus::process_filetype_policy {filetype filetype_spec} {
upvar $filetype_spec ft_spec
array set ft_spec_arr $ft_spec
if {[info exists ft_spec_arr($filetype)] == 0} {
@@ -265,8 +269,10 @@ proc ::nexus::newfile {type {namestyle data}} {
::hdb::set_save / false
hsetprop $data_gp_path currentfiletype UNKNOWN
hsetprop $data_gp_path datatype UNKNOWN
nexus_datatype "UNKNOWN"
} else {
::nexus::process_filetype_policy $type filetype_spec
nexus_datatype $type
}
} message ] {
if {$::errorCode=="NONE"} {return $message}
@@ -484,10 +490,10 @@ proc ::nexus::newfile {type {namestyle data}} {
}
"clear" {
debug_msg "'clear' case of switch"
foreach child [hlist $dpath] {
hsetprop $dpath/$child link @none
hsetprop $dpath/$child long_name @none
}
foreach child [hlist $dpath] {
hsetprop $dpath/$child link @none
hsetprop $dpath/$child long_name @none
}
}
"alias" {
debug_msg "'alias' case of switch"
@@ -808,7 +814,6 @@ proc ::nexus::histmem::save {hm nxalias data_type args} {
# TODO Get rank from /data
proc ::nexus::histmem::sdsinfo {hm data_type args} {
array set param $args
array set hm_prop [attlist $hm]
set rank [SplitReply [$hm configure rank]]
for {set i 0} {$i < $rank} {incr i} {lappend dimstr "\$(padim$i)"}
@@ -839,7 +844,7 @@ proc ::nexus::motor::save {motor nxalias data_type args} {
}
proc ::nexus::motor::sdsinfo {motor data_type args} {
array set param $args
array set attribute [attlist $motor]
array set attribute [::utility::normalattlist $motor]
set dtype [::nexus::hdb2nx_type $data_type]
if {[info exists attribute(units)]} {
set units_att " -attr {units,$attribute(units)} "
@@ -889,7 +894,7 @@ proc ::nexus::macro::getset_save {sobj nxalias data_type args} {
# @brief Define the scientific data set path for the nexus dictionary.
proc ::nexus::macro::getset_sdsinfo {sobj data_type args} {
array set param $args
array set attribute [attlist $sobj]
array set attribute [::utility::normalattlist $sobj]
set dtype [::nexus::hdb2nx_type $data_type]
if {[info exists attribute(units)]} {
set units_att " -attr {units,$attribute(units)} "
@@ -916,7 +921,7 @@ proc ::nexus::environment_controller::save {evc nxalias data_type args} {
}
proc ::nexus::environment_controller::sdsinfo {evc data_type args} {
array set param $args
array set attribute [attlist $evc]
array set attribute [::utility::normalattlist $evc]
set dtype [::nexus::hdb2nx_type $data_type]
if {[info exists attribute(units)]} {
set units_att " -attr {units,$attribute(units)} "
@@ -958,6 +963,8 @@ proc ::nexus::sicsvariable::save {svar nxalias data_type args} {
nxscript putattribute $nxalias units $attribute(units)
}
}
# TODO Add optional units to sicsvariables
proc ::nexus::sicsvariable::sdsinfo {svar data_type args} {
array set param $args
set dtype [::nexus::hdb2nx_type $data_type]
@@ -1053,7 +1060,7 @@ foreach expt $::nexus::exports {
set tmpstr [string map {"$" ""} {$Name: not supported by cvs2svn $}]
set nx_content_release_tag [lindex $tmpstr [expr [llength $tmpstr] - 1]]
set tmpstr [string map {"$" ""} {$Revision: 1.39 $}]
set tmpstr [string map {"$" ""} {$Revision: 1.40 $}]
set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
#namespace eval data {

View File

@@ -15,7 +15,7 @@
namespace eval scan {
variable ic_runscanpar
variable hmm_filetype
variable ic_hmm_datatype
variable save_filetype
variable reset_position
variable check_thread0
@@ -32,16 +32,47 @@ set reset_position "false"
set check_thread0 false
}
proc scan_collect {sobj uobj point} {
}
}
proc ::scan::bm_scan_collect {sobj uobj point} {
set vlist [split [$sobj getvarpar 0] = ];
set w(NP) $point
set sv [string trim [lindex [split [lindex $vlist 0] . ] 1]]
set header [format "%-4.4s %-9.9s %-14s %-11s %-11s %-11s %-7.7s" NP $sv Counts Channel0 Channel1 Channel2 Time]
set varval [SplitReply [$sv]]
set counts [SplitReply [bm getcounts]]
set mon1 [SplitReply [bm getmonitor 0]]
set mon2 [SplitReply [bm getmonitor 1]]
set mon3 [SplitReply [bm getmonitor 2]]
set time [SplitReply [bm gettime]]
set data [format "%-4d %-9.3f %-14d %-11d %-11d %-11d %-7.2f" $point $varval $counts $mon1 $mon2 $mon3 $time]
clientput $header
clientput $data
}
proc ::scan::hmm_scan_collect {sobj uobj point} {
set vlist [split [$sobj getvarpar 0] = ];
set w(NP) $point
set sv [string trim [lindex [split [lindex $vlist 0] . ] 1]]
set header [format "%-4.4s %-9.9s %-14s %-11s %-11s %-11s %-7.7s" NP $sv Counts Monitor1 Monitor2 Monitor3 Time]
set varval [SplitReply [$sv]]
set counts [SplitReply [::histogram_memory::total_counts]]
set mon1 [SplitReply [bm1 getcounts]]
set mon2 [SplitReply [bm2 getcounts]]
set mon3 [SplitReply [bm3 getcounts]]
set time [SplitReply [::histogram_memory::time]]
set data [format "%-4d %-9.3f %-14d %-11d %-11d %-11d %-7.2f" $point $varval $counts $mon1 $mon2 $mon3 $time]
clientput $header
clientput $data
}
proc ::scan::ic_initialize {} {
if [ catch {
variable ic_runscanpar
variable hmm_filetype
variable ic_hmm_datatype
set hmm_filetype HISTOGRAM_XYT
set ic_hmm_datatype HISTOGRAM_XYT
MakeScanCommand hmscan bm $::cfPath(scan)/scan_common_1.hdd recover.bin
MakeScanCommand bmonscan bm $::cfPath(scan)/scan_common_1.hdd recover.bin
@@ -50,18 +81,16 @@ proc ::scan::ic_initialize {} {
bmonscan function writeheader ::scan::donothing
bmonscan function writepoint ::scan::bm_writepoint
bmonscan function count ::scan::bm_count
#bmonscan function collect ::scan::scan_collect
bmonscan function collect ::scan::bm_scan_collect
bmonscan function prepare ::scan::bm_scan_prepare
bmonscan function finish ::scan::bm_scan_finish
hmscan configure script
#hmscan function prepare hdbprepare
#hmscan function collect hdbcollect
hmscan function writeheader ::scan::donothing
hmscan function writepoint ::scan::hmm_writepoint
hmscan function count ::scan::hmm_count
#hmscan function collect ::scan::scan_collect
hmscan function collect ::scan::hmm_scan_collect
hmscan function prepare ::scan::hmm_scan_prepare
hmscan function finish ::scan::hmm_scan_finish
@@ -151,7 +180,7 @@ proc ::scan::pre_hmm_scan_prepare {} {}
proc ::scan::hmm_scan_prepare {sobj uobj} {
variable scan_pt_start_time
variable save_filetype
variable hmm_filetype
variable ic_hmm_datatype
variable check_instrument_ready
variable force_scan
@@ -161,32 +190,33 @@ proc ::scan::hmm_scan_prepare {sobj uobj} {
::scan::check_scanvar $sobj $uobj
::scan::pre_hmm_scan_prepare
}] {
abortbatch
return -code error "HMSCAN ABORTED: $::errorInfo"
}
if [catch {
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar 0] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
::scan::hdb_hmscan -set NP $numpoints
::scan::hdb_hmscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]]
::scan::hdb_hmscan -set scan_start $scanstart
::scan::hdb_hmscan -set scan_increment $scanstep
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar 0] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
::scan::hdb_hmscan -set NP $numpoints
::scan::hdb_hmscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]]
::scan::hdb_hmscan -set scan_start $scanstart
::scan::hdb_hmscan -set scan_increment $scanstep
set scan_pt_start_time [sicstime]
set scan_pt_start_time [sicstime]
::scan::hdb_hmscan -set feedback status BUSY
::scan::hdb_hmscan -set feedback status BUSY
run_mode "hmscan"
::nexus::newfile $hmm_filetype $save_filetype
data axis 1 [::scan::hdb_hmscan -set scan_variable]
::nexus::newfile $ic_hmm_datatype $save_filetype
data axis 1 [::scan::hdb_hmscan -set scan_variable]
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
clientput "Filetype: $hmm_filetype"
# Prime DAE
hmm pause
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
clientput "Datatype: $ic_hmm_datatype"
# Prime DAE
hmm pause
}] {
run_mode "normal"
return -code error $::errorInfo
}
} else {
@@ -212,6 +242,7 @@ proc ::scan::hmm_scan_finish {sobj uobj} {
set $save_filetype "data"
::histogram_memory::stop
::scan::hdb_hmscan -set feedback status IDLE
run_mode "normal"
# Make sure that the next save command doesn't overwrite our scan data.
# and clear any data links
::nexus::newfile clear data
@@ -229,6 +260,7 @@ proc ::scan::hmm_scan_finish {sobj uobj} {
proc ::scan::bm_scan_finish {sobj uobj} {
variable reset_position
::scan::hdb_bmonscan -set feedback status IDLE
run_mode "normal"
# Make sure that the next save command doesn't overwrite our scan data.
# and clear any data links
::nexus::newfile clear data
@@ -278,55 +310,65 @@ proc ::scan::bm_count {sobj uobj point mode preset} {
proc ::scan::bm_scan_prepare {sobj uobj} {
variable scan_pt_start_time
variable check_instrument_ready
variable force_scan
if {[::plc::inst_ready] != 1} {
return -code error "HMSCAN ABORTED: Instrument not ready"
if {$force_scan || $check_instrument_ready && [::plc::inst_ready]} {
set force_scan false
if [catch {
::scan::check_scanvar $sobj $uobj
::scan::pre_hmm_scan_prepare
}] {
return -code error "BMONSCAN ABORTED: $::errorInfo"
}
if [catch {
#TODO Parameterise varindex in some way
set varindex 0;
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar $varindex] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
::scan::hdb_bmonscan -set feedback filename [SplitReply [dataFileName]]
::scan::hdb_bmonscan -set NP $numpoints
::scan::hdb_bmonscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]];
::scan::hdb_bmonscan -set scan_start $scanstart
::scan::hdb_bmonscan -set scan_increment $scanstep
set scanvar_pts [SplitReply [$sobj getvardata $varindex]]
todo_msg "SET START TIME [sicstime]"
::scan::hdb_bmonscan -set feedback status BUSY
run_mode "bmonscan"
array set bm_fb [::scan::hdb_bmonscan -list feedback]
::nexus::newfile BEAM_MONITOR data
::nexus::data axis 1 [::scan::hdb_bmonscan -set scan_variable]
#stdscan prepare $sobj $uobj;
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
clientput "Datatype: BEAM_MONITOR"
}] {
run_mode "normal"
return -code error $::errorInfo
}
} else {
return -code error "BMONSCAN ABORTED: Instrument not ready"
}
if [catch {
::scan::check_scanvar $sobj $uobj
::scan::pre_hmm_scan_prepare
}] {
abortbatch
return -code error "BMONSCAN ABORTED: $::errorInfo"
}
#TODO Parameterise varindex in some way
set varindex 0;
set numpoints [SplitReply [$sobj np]]
set vlist [split [$sobj getvarpar $varindex] = ]
set scanstart [lindex $vlist 1]
set scanstep [lindex $vlist 2]
::scan::hdb_bmonscan -set feedback filename [SplitReply [dataFileName]]
::scan::hdb_bmonscan -set NP $numpoints
::scan::hdb_bmonscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]];
::scan::hdb_bmonscan -set scan_start $scanstart
::scan::hdb_bmonscan -set scan_increment $scanstep
set scanvar_pts [SplitReply [$sobj getvardata $varindex]]
todo_msg "SET START TIME [sicstime]"
::scan::hdb_bmonscan -set feedback status BUSY
array set bm_fb [::scan::hdb_bmonscan -list feedback]
::nexus::newfile BEAM_MONITOR data
::nexus::data axis 1 [::scan::hdb_bmonscan -set scan_variable]
#stdscan prepare $sobj $uobj;
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
clientput "Filetype: BEAM_MONITOR"
}
Publish ::scan::scan_collect user
Publish ::scan::write_nxentry user
Publish ::scan::hmm_count user
Publish ::scan::hmm_scan_prepare user
Publish ::scan::hmm_scan_finish user
Publish ::scan::hmm_scan_collect user
Publish ::scan::hmm_writepoint user
Publish ::scan::donothing user
Publish ::scan::bm_scan_prepare user
Publish ::scan::bm_scan_finish user
Publish ::scan::bm_scan_collect user
Publish ::scan::bm_writepoint user
Publish ::scan::bm_count user
@@ -342,7 +384,7 @@ namespace eval scan {
# @param force true/false (default=false)
proc runscan {scanvar start stop numpoints mode preset args} {
variable hmm_filetype
variable ic_hmm_datatype
variable save_filetype
variable reset_position
variable force_scan
@@ -352,7 +394,7 @@ namespace eval scan {
set hm_ft_names [array names ::nexus::histmem_filetype_spec]
# Default filetype for histogram memory scans
set hmm_filetype "HISTOGRAM_XYT"
set ic_hmm_datatype "HISTOGRAM_XYT"
# Default save uniquely numbered files
set savetype "save"
set reset_position [SplitReply [::scan::runscan_reset_position]]
@@ -387,11 +429,11 @@ namespace eval scan {
error "ERROR: force must be true or false"
}
}
"filetype" {
"datatype" {
if {[lsearch $hm_ft_names $val] == -1} {
error "ERROR: filetype should be one of $hm_ft_names"
error "ERROR: datatype should be one of $hm_ft_names"
} else {
set hmm_filetype $val
set ic_hmm_datatype $val
}
}
"savetype" {
@@ -408,7 +450,7 @@ namespace eval scan {
}
}
default {
error "ERROR: $arg should be 'filetype' 'savetype' or 'force'"
error "ERROR: $arg should be 'datatype' 'savetype' or 'force'"
}
}
}