mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
Rx roi zmq (#726)
adding rx_roi also in the zmq header for external guis to put the "yellow box".. sending full roi instead of -1, and sending for each zmq port. "(multiple yellow boxes)".
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
#include "sls/sls_detector_exceptions.h"
|
||||
|
||||
#include <map>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
// Selective suppression of warning in gcc,
|
||||
@ -83,6 +84,8 @@ struct zmqHeader {
|
||||
bool completeImage{false};
|
||||
/** additional json header */
|
||||
std::map<std::string, std::string> addJsonHeader;
|
||||
/** (xmin, xmax, ymin, ymax) roi only in files written */
|
||||
std::array<int,4> rx_roi{};
|
||||
};
|
||||
|
||||
class ZmqSocket {
|
||||
|
@ -254,6 +254,8 @@ int ZmqSocket::SendHeader(int index, zmqHeader header) {
|
||||
}
|
||||
oss << " } ";
|
||||
}
|
||||
oss << ", \"rx_roi\":[" << header.rx_roi[0] << ", " << header.rx_roi[1]
|
||||
<< ", " << header.rx_roi[2] << ", " << header.rx_roi[3] << "]";
|
||||
oss << "}\n";
|
||||
std::string message = oss.str();
|
||||
int length = message.length();
|
||||
@ -375,6 +377,11 @@ int ZmqSocket::ParseHeader(const int index, int length, char *buff,
|
||||
}
|
||||
}
|
||||
|
||||
const Value &a = document["rx_roi"].GetArray();
|
||||
for (SizeType i = 0; i != a.Size(); ++i) {
|
||||
zHeader.rx_roi[i] = a[i].GetInt();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user