SICS-561: Wait for the hmm COUNTEND event in blocking mode.
Also allow veto when scanning.
This commit is contained in:
@@ -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'"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user