* making quad work in developer branch

* binary added

* minor changes

* bug fix to set quad to 0 when more than 1 detector
This commit is contained in:
Dhanya Thattil
2019-07-22 16:41:03 +02:00
committed by GitHub
parent 0fa63f8be2
commit e7a76ccea1
23 changed files with 432 additions and 70 deletions

View File

@ -240,19 +240,42 @@ public:
/**
* Send Message Header
* @param buf message
* @param length length of message
* @param dummy true if end of acquistion else false
* @param index self index for debugging
* @param dummy true if a dummy message for end of acquisition
* @param jsonversion json version
* @param dynamicrange dynamic range
* @param fileIndex file or acquisition index
* @param ndetx number of detectors in x axis
* @param ndety number of detectors in y axis
* @param npixelsx number of pixels/channels in x axis for this zmq socket
* @param npixelsy number of pixels/channels in y axis for this zmq socket
* @param imageSize number of bytes for an image in this socket
* @param frameNumber current frame number
* @param expLength exposure length or subframe index if eiger
* @param packetNumber number of packets caught for this frame
* @param bunchId bunch id
* @param timestamp time stamp
* @param modId module Id
* @param row row index in complete detector
* @param column column index in complete detector
* @param reserved reserved
* @param debug debug
* @param roundRNumber not used yet
* @param detType detector enum
* @param version detector header version
* @param gapPixelsEnable gap pixels enable (exception: if gap pixels enable for 4 bit mode, data is not yet gap pixel enabled in receiver)
* @param flippedDataX if it is flipped across x axis
* @param additionalJsonHeader additional json header
* @returns 0 if error, else 1
*/
int SendHeaderData ( int index, bool dummy, uint32_t jsonversion, uint32_t dynamicrange = 0, uint64_t fileIndex = 0,
uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
uint32_t ndetx = 0, uint32_t ndety = 0, uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
uint64_t acqIndex = 0, uint64_t fIndex = 0, const char* fname = NULL,
uint64_t frameNumber = 0, uint32_t expLength = 0, uint32_t packetNumber = 0,
uint64_t bunchId = 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,
uint8_t detType = 0, uint8_t version = 0, int* flippedData = 0,
uint8_t detType = 0, uint8_t version = 0, int gapPixelsEnable = 0, int flippedDataX = 0,
char* additionalJsonHeader = 0) {
@ -263,6 +286,7 @@ public:
"\"jsonversion\":%u, "
"\"bitmode\":%u, "
"\"fileIndex\":%lu, "
"\"detshape\":[%u, %u], "
"\"shape\":[%u, %u], "
"\"size\":%u, "
"\"acqIndex\":%lu, "
@ -285,12 +309,13 @@ public:
"\"version\":%u, "
//additional stuff
"\"flippedDataX\":%u"
"\"gappixels\":%u, "
"\"flippedDataX\":%u"
;//"}\n";
char buf[MAX_STR_LENGTH] = "";
sprintf(buf, jsonHeaderFormat,
jsonversion, dynamicrange, fileIndex, npixelsx, npixelsy, imageSize,
jsonversion, dynamicrange, fileIndex, ndetx, ndety, npixelsx, npixelsy, imageSize,
acqIndex, fIndex, (fname == NULL)? "":fname, dummy?0:1,
frameNumber, expLength, packetNumber, bunchId, timestamp,
@ -298,7 +323,8 @@ public:
detType, version,
//additional stuff
((flippedData == 0 ) ? 0 :flippedData[0])
gapPixelsEnable,
flippedDataX
);
if (additionalJsonHeader && strlen(additionalJsonHeader)) {

View File

@ -89,6 +89,8 @@ enum detFuncs{
F_EXTERNAL_SAMPLING, /**< enable/disable external sampling for ctb */
F_SET_STARTING_FRAME_NUMBER,
F_GET_STARTING_FRAME_NUMBER,
F_SET_QUAD,
F_GET_QUAD,
NUM_DET_FUNCTIONS,
RECEIVER_ENUM_START = 128, /**< detector function should not exceed this (detector server should not compile anyway) */
@ -146,6 +148,7 @@ enum detFuncs{
F_SET_RECEIVER_DBIT_LIST, /** < set receiver digital bit list */
F_GET_RECEIVER_DBIT_LIST, /** < get receiver digital bit list */
F_RECEIVER_DBIT_OFFSET, /** < set/get reciever digital bit offset */
F_SET_RECEIVER_QUAD,
NUM_REC_FUNCTIONS
};
@ -231,6 +234,8 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_EXTERNAL_SAMPLING: return "F_EXTERNAL_SAMPLING";
case F_SET_STARTING_FRAME_NUMBER: return "F_SET_STARTING_FRAME_NUMBER";
case F_GET_STARTING_FRAME_NUMBER: return "F_GET_STARTING_FRAME_NUMBER";
case F_SET_QUAD: return "F_SET_QUAD";
case F_GET_QUAD: return "F_GET_QUAD";
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
@ -288,7 +293,8 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_SET_RECEIVER_DBIT_LIST: return "F_SET_RECEIVER_DBIT_LIST";
case F_GET_RECEIVER_DBIT_LIST: return "F_GET_RECEIVER_DBIT_LIST";
case F_RECEIVER_DBIT_OFFSET: return "F_RECEIVER_DBIT_OFFSET";
case F_SET_RECEIVER_QUAD: return "F_SET_RECEIVER_QUAD";
case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS";
default: return "Unknown Function";
}

View File

@ -5,6 +5,6 @@
#define APIRECEIVER 0x190604
#define APIGUI 0x190405
#define APICTB 0x190604
#define APIEIGER 0x190712
#define APIGOTTHARD 0x190715
#define APIJUNGFRAU 0x190718
#define APIEIGER 0x190722