Add code to check pulse id when reading

This commit is contained in:
2020-04-23 12:47:39 +02:00
parent 25ce872dc2
commit 81077c395a
+10 -1
View File
@@ -90,7 +90,6 @@ int main (int argc, char *argv[]) {
uint64_t start_pulse_id = (uint64_t) atoll(argv[4]);
uint64_t stop_pulse_id = (uint64_t) atoll(argv[5]);
auto ctx = zmq_ctx_new();
auto socket = zmq_socket(ctx, ZMQ_PUSH);
@@ -116,6 +115,8 @@ int main (int argc, char *argv[]) {
auto path_suffixes =
BufferUtils::get_path_suffixes(start_pulse_id, stop_pulse_id);
size_t current_pulse_id = start_pulse_id;
for (const auto& suffix:path_suffixes) {
string filename =
@@ -144,6 +145,12 @@ int main (int argc, char *argv[]) {
module_id
};
if (module_frame.pulse_id != current_pulse_id) {
cout << "Unexpected pulse_id for module " << module_id;
cout << " Got " << module_frame.pulse_id;
cout << " expected " << current_pulse_id;
}
zmq_send(socket,
&module_frame,
sizeof(ModuleFrame),
@@ -154,6 +161,8 @@ int main (int argc, char *argv[]) {
(char*)(image_buffer.get() + buff_offset),
MODULE_N_BYTES,
0);
current_pulse_id++;
}
}
}