From 94f21f832edaf436b8e86ee58b4f3480d5b0ed7a Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Sat, 2 Mar 2013 17:02:30 +1100 Subject: [PATCH] SICS-561: Wait for the hmm COUNTEND event in blocking mode. Also allow veto when scanning. --- .../config/hmm/hmm_configuration_common_1.tcl | 30 ++++++------------- site_ansto/instrument/util/eventutil.tcl | 2 +- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl index a33a1801..493db772 100644 --- a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl +++ b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl @@ -1588,26 +1588,22 @@ Publish SAT_TABLE user error "ERROR: Valid options are $options" } ::histogram_memory::pre_count - hmm init + set hm_start {hmm init} if {$monitor_controlled == "true"} { - hmm count + set hm_start {hmm count} } else { bm setmode timer bm setpreset 32000000 if {$oscmd_controlled == "true"} { - hmm count + set hm_start {hmm count} } else { - hmc start 1000000000 timer pause 1 + set hm_start {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" - } - clientput "histmem started" value if {$blocking == "block"} { - blockctr count 0 - ::histogram_memory::pause + eval waitfor hmm $hm_start + } else { + eval $hm_start } } message ] { return -code error "([info level 0]) $message" @@ -1634,18 +1630,10 @@ Publish SAT_TABLE user proc ::histogram_memory::veto {action} { switch $action { "on" { - if {[status] == "status = Counting"} { - hmm veto - } else { - error "ERROR: veto only allowed while counting" - } + hmm veto } "off" { - if {[status] == "status = Paused"} { - hmm noveto - } else { - error "ERROR: disabling veto not allowed in this state" - } + hmm noveto } default { error "ERROR: $action must be 'on' or 'off'" diff --git a/site_ansto/instrument/util/eventutil.tcl b/site_ansto/instrument/util/eventutil.tcl index 6017e1ba..e39e7ea7 100644 --- a/site_ansto/instrument/util/eventutil.tcl +++ b/site_ansto/instrument/util/eventutil.tcl @@ -37,7 +37,7 @@ proc ::event::waitfor {sobj args} { set oldStatus [lindex [SplitReply [status]] 0] eval $args while {$sobjBusy == 1} { - wait 2 + wait 1 } scriptcallback remove $sobj $CBID SetStatus $oldStatus