changed detector header version to detector specific field names and incremented version number, also for zmq (#574)

This commit is contained in:
Dhanya Thattil
2022-11-17 15:24:12 +01:00
committed by GitHub
parent f108ec82ea
commit 4bb1a612f1
17 changed files with 206 additions and 100 deletions

View File

@ -60,14 +60,14 @@ struct zmqHeader {
uint64_t frameNumber{0};
uint32_t expLength{0};
uint32_t packetNumber{0};
uint64_t bunchId{0};
uint64_t detSpec1{0};
uint64_t timestamp{0};
uint16_t modId{0};
uint16_t row{0};
uint16_t column{0};
uint16_t reserved{0};
uint32_t debug{0};
uint16_t roundRNumber{0};
uint16_t detSpec2{0};
uint32_t detSpec3{0};
uint16_t detSpec4{0};
uint8_t detType{0};
uint8_t version{0};
/** if rows of image should be flipped */

View File

@ -45,8 +45,8 @@
#define MAX_UDP_DESTINATION 32
#define SLS_DETECTOR_HEADER_VERSION 0x2
#define SLS_DETECTOR_JSON_HEADER_VERSION 0x4
#define SLS_DETECTOR_HEADER_VERSION 0x3
#define SLS_DETECTOR_JSON_HEADER_VERSION 0x5
// ctb/ moench 1g udp (read from fifo)
#define UDP_PACKET_DATA_BYTES (1344)
@ -113,19 +113,20 @@ class slsDetectorDefs {
/**
@short structure for a Detector Packet or Image Header
Details at https://slsdetectorgroup.github.io/devdoc/udpheader.html
@li frameNumber is the frame number
@li expLength is the subframe number (32 bit eiger) or real time
exposure time in 100ns (others)
@li packetNumber is the packet number
@li bunchId is the bunch id from beamline
@li detSpec1 is detector specific field 1
@li timestamp is the time stamp with 10 MHz clock
@li modId is the unique module id (unique even for left, right, top,
bottom)
@li row is the row index in the complete detector system
@li column is the column index in the complete detector system
@li reserved is reserved
@li debug is for debugging purposes
@li roundRNumber is the round robin set number
@li detSpec2 is detector specific field 2
@li detSpec3 is detector specific field 3
@li detSpec4 is detector specific field 4
@li detType is the detector type see :: detectorType
@li version is the version number of this structure format
*/
@ -134,14 +135,14 @@ class slsDetectorDefs {
uint64_t frameNumber;
uint32_t expLength;
uint32_t packetNumber;
uint64_t bunchId;
uint64_t detSpec1;
uint64_t timestamp;
uint16_t modId;
uint16_t row;
uint16_t column;
uint16_t reserved;
uint32_t debug;
uint16_t roundRNumber;
uint16_t detSpec2;
uint32_t detSpec3;
uint16_t detSpec4;
uint8_t detType;
uint8_t version;
} sls_detector_header;

View File

@ -148,13 +148,13 @@ int ZmqSocket::SendHeader(int index, zmqHeader header) {
<< ", \"frameNumber\":" << header.frameNumber
<< ", \"expLength\":" << header.expLength
<< ", \"packetNumber\":" << header.packetNumber
<< ", \"bunchId\":" << header.bunchId
<< ", \"detSpec1\":" << header.detSpec1
<< ", \"timestamp\":" << header.timestamp
<< ", \"modId\":" << header.modId << ", \"row\":" << header.row
<< ", \"column\":" << header.column
<< ", \"reserved\":" << header.reserved
<< ", \"debug\":" << header.debug
<< ", \"roundRNumber\":" << header.roundRNumber
<< ", \"detSpec2\":" << header.detSpec2
<< ", \"detSpec3\":" << header.detSpec3
<< ", \"detSpec4\":" << header.detSpec4
<< ", \"detType\":" << static_cast<int>(header.detType)
<< ", \"version\":"
<< static_cast<int>(header.version)
@ -270,14 +270,14 @@ int ZmqSocket::ParseHeader(const int index, int length, char *buff,
zHeader.frameNumber = document["frameNumber"].GetUint64();
zHeader.expLength = document["expLength"].GetUint();
zHeader.packetNumber = document["packetNumber"].GetUint();
zHeader.bunchId = document["bunchId"].GetUint64();
zHeader.detSpec1 = document["detSpec1"].GetUint64();
zHeader.timestamp = document["timestamp"].GetUint64();
zHeader.modId = document["modId"].GetUint();
zHeader.row = document["row"].GetUint();
zHeader.column = document["column"].GetUint();
zHeader.reserved = document["reserved"].GetUint();
zHeader.debug = document["debug"].GetUint();
zHeader.roundRNumber = document["roundRNumber"].GetUint();
zHeader.detSpec2 = document["detSpec2"].GetUint();
zHeader.detSpec3 = document["detSpec3"].GetUint();
zHeader.detSpec4 = document["detSpec4"].GetUint();
zHeader.detType = document["detType"].GetUint();
zHeader.version = document["version"].GetUint();