Skip to content
Snippets Groups Projects
Commit 144fa05e authored by Giulio Gaio's avatar Giulio Gaio
Browse files

Enabled strict control on bunchnumber lost

parent 8af0bc40
No related merge requests found
......@@ -2907,6 +2907,8 @@ int32_t DataVampire::get_start_index(int32_t mode, int32_t num_samples, int32_t
{
int32_t last_idx, start = -1, end = -1;
bool bn_found = false;
int32_t bn_samples = 0;
// last valid sample index stored in circular buffer
last_idx = (array_idx - 1 + DATAVAMPIRE_MAX_SIZE) % DATAVAMPIRE_MAX_SIZE;
......@@ -2925,10 +2927,20 @@ int32_t DataVampire::get_start_index(int32_t mode, int32_t num_samples, int32_t
if (acq_array[idx].bn == bn_start) {
start = idx;
}
if (end != -1) {
//printf("INCREMENT bn_samples=%d\n",bn_samples);
bn_samples++;
}
if ((end != -1) && (start != -1)) {
bn_found = true; break;
}
}
if ((bn_end - bn_start + 1) != bn_samples) {
Tango::Except::throw_exception(
(const char *) "Failed to find buffer indexes",
(const char *) "Data missing",
__FUNCTION__, Tango::ERR);
}
if (bn_found) {
return start;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment