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,20 +227,24 @@ void Correlate(FrameStatus *stat) {
|
|||||||
msg_list.insert(msg_list.end(),
|
msg_list.insert(msg_list.end(),
|
||||||
stat->frames[port][fnum].begin(),
|
stat->frames[port][fnum].begin(),
|
||||||
stat->frames[port][fnum].end());
|
stat->frames[port][fnum].end());
|
||||||
stat->frames[port].erase(fnum);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG(printHeadersLevel)
|
LOG(printHeadersLevel)
|
||||||
<< "Sending data packets for fnum " << fnum;
|
<< "Sending data packets for fnum " << fnum;
|
||||||
zmq_send_multipart(socket, msg_list);
|
zmq_send_multipart(socket, msg_list);
|
||||||
|
// clean up
|
||||||
for (const auto &it : stat->frames) {
|
for (const auto &it : stat->frames) {
|
||||||
const uint16_t port = it.first;
|
const uint16_t port = it.first;
|
||||||
// clean up
|
const FrameMap &frame_map = it.second;
|
||||||
for (zmq_msg_t *msg : stat->frames[port][fnum]) {
|
auto frame = frame_map.find(fnum);
|
||||||
if (msg) {
|
if (frame != frame_map.end()) {
|
||||||
zmq_msg_close(msg);
|
for (zmq_msg_t *msg : frame->second) {
|
||||||
delete msg;
|
if (msg) {
|
||||||
|
zmq_msg_close(msg);
|
||||||
|
delete msg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
stat->frames[port].erase(fnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,6 +260,21 @@ void Correlate(FrameStatus *stat) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stat->ends.clear();
|
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