SICS-561: Wait for the hmm COUNTEND event in blocking mode.

Also allow veto when scanning.
This commit is contained in:
Ferdi Franceschini
2013-03-02 17:02:30 +11:00
parent ed95f3aaaf
commit 94f21f832e
2 changed files with 10 additions and 22 deletions

View File

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

View File

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