mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-12 15:32:13 +02:00
moving the erasure of the fnum to after sending the zmg packets and also deleteing all old frames when end of acquisition
Some checks failed
CMake / Configure and build using cmake (push) Failing after 2s
Some checks failed
CMake / Configure and build using cmake (push) Failing after 2s
This commit is contained in:
parent
674865120b
commit
2c4cd80748
@ -227,21 +227,25 @@ void Correlate(FrameStatus *stat) {
|
||||
msg_list.insert(msg_list.end(),
|
||||
stat->frames[port][fnum].begin(),
|
||||
stat->frames[port][fnum].end());
|
||||
stat->frames[port].erase(fnum);
|
||||
}
|
||||
}
|
||||
LOG(printHeadersLevel)
|
||||
<< "Sending data packets for fnum " << fnum;
|
||||
zmq_send_multipart(socket, msg_list);
|
||||
// clean up
|
||||
for (const auto &it : stat->frames) {
|
||||
const uint16_t port = it.first;
|
||||
// clean up
|
||||
for (zmq_msg_t *msg : stat->frames[port][fnum]) {
|
||||
const FrameMap &frame_map = it.second;
|
||||
auto frame = frame_map.find(fnum);
|
||||
if (frame != frame_map.end()) {
|
||||
for (zmq_msg_t *msg : frame->second) {
|
||||
if (msg) {
|
||||
zmq_msg_close(msg);
|
||||
delete msg;
|
||||
}
|
||||
}
|
||||
stat->frames[port].erase(fnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -256,6 +260,21 @@ void Correlate(FrameStatus *stat) {
|
||||
}
|
||||
}
|
||||
stat->ends.clear();
|
||||
// clean up old frames
|
||||
for (auto &it : stat->frames) {
|
||||
FrameMap &frame_map = it.second;
|
||||
for (auto &frame : frame_map) {
|
||||
for (zmq_msg_t *msg : frame.second) {
|
||||
if (msg) {
|
||||
zmq_msg_close(msg);
|
||||
delete msg;
|
||||
}
|
||||
}
|
||||
frame.second.clear();
|
||||
}
|
||||
frame_map.clear();
|
||||
}
|
||||
stat->frames.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user