mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-06 06:24:13 +02:00
last image recv also closes the file
This commit is contained in:
@@ -52,7 +52,7 @@ int main (int argc, char *argv[])
|
|||||||
JFH5Writer writer(config.detector_name);
|
JFH5Writer writer(config.detector_name);
|
||||||
WriterStats stats(config.detector_name, IMAGE_N_BYTES);
|
WriterStats stats(config.detector_name, IMAGE_N_BYTES);
|
||||||
|
|
||||||
char recv_buffer[8192];
|
char recv_buffer[12288];
|
||||||
while (true) {
|
while (true) {
|
||||||
zmq_recv(receiver, &recv_buffer, sizeof(recv_buffer), 0);
|
zmq_recv(receiver, &recv_buffer, sizeof(recv_buffer), 0);
|
||||||
|
|
||||||
@@ -67,14 +67,6 @@ int main (int argc, char *argv[])
|
|||||||
const int i_image = document["i_image"].GetInt();
|
const int i_image = document["i_image"].GetInt();
|
||||||
const int n_images = document["n_images"].GetInt();
|
const int n_images = document["n_images"].GetInt();
|
||||||
|
|
||||||
// i_image == n_images -> end of run.
|
|
||||||
if (i_image == n_images) {
|
|
||||||
writer.close_run();
|
|
||||||
|
|
||||||
stats.end_run();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// i_image == 0 -> we have a new run.
|
// i_image == 0 -> we have a new run.
|
||||||
if (i_image == 0) {
|
if (i_image == 0) {
|
||||||
auto image_meta = (ImageMetadata*)
|
auto image_meta = (ImageMetadata*)
|
||||||
@@ -105,5 +97,12 @@ int main (int argc, char *argv[])
|
|||||||
writer.write_meta(run_id, i_image, image_meta);
|
writer.write_meta(run_id, i_image, image_meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// i_image == n_images -> end of run.
|
||||||
|
if (i_image == n_images - 1) {
|
||||||
|
writer.close_run();
|
||||||
|
stats.end_run();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user