receiver and client: changed xcoord to row and ycoord to column, zcoord to reserved

This commit is contained in:
maliakal_d 2018-09-26 15:03:04 +02:00
parent 970d448e73
commit c2db073d5e
14 changed files with 77 additions and 76 deletions

View File

@ -348,8 +348,8 @@ CONTENTS
continue to have them.
2. Depending on 1d position of detectors and detsizechan in config file,
xcoord and ycoord are given to detector servers (Eiger and Jungfrau)
to encode into the udp header.
row and column (previously xcoord and ycoord) are given to detector
servers (Eiger and Jungfrau) to encode into the udp header.
3. (Eiger) Setting threshold energy changes such as CAL dac is irrelevant
when interpolating between two energies and VRS dac is interpolated, not copied.
@ -382,7 +382,8 @@ CONTENTS
1. slsMultiReceiver executable added that creates multiple receiver child processes.
./slsMultiReceiver [start_tcp_port] [num_receivers] [1 for call back, 0 for none]
2. Default xcoord and ycoord are hardcoded for missing packets. (Eiger and Jungfrau)
2. Default row and column (previously xcoord and ycoord) are hardcoded
for missing packets. (Eiger and Jungfrau)
Gui

View File

@ -99,18 +99,18 @@ void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p){
slsReceiverDefs::sls_receiver_header* header = (slsReceiverDefs::sls_receiver_header*)metadata;
slsReceiverDefs::sls_detector_header detectorHeader = header->detHeader;
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.xCoord,
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.row,
"#### %d GetData: ####\n"
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu"
"\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u"
"row: %u\t\tcolumn: %u\t\treserved: %u\t\tdebug: %u"
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
//"\t\tpacketsMask:%s"
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
detectorHeader.xCoord, (long long unsigned int)detectorHeader.frameNumber,
detectorHeader.row, (long long unsigned int)detectorHeader.frameNumber,
detectorHeader.expLength, detectorHeader.packetNumber, (long long unsigned int)detectorHeader.bunchId,
(long long unsigned int)detectorHeader.timestamp, detectorHeader.modId,
detectorHeader.xCoord, detectorHeader.yCoord, detectorHeader.zCoord,
detectorHeader.row, detectorHeader.column, detectorHeader.reserved,
detectorHeader.debug, detectorHeader.roundRNumber,
detectorHeader.detType, detectorHeader.version,
//header->packetsMask.to_string().c_str(),
@ -133,18 +133,18 @@ void GetData(char* metadata, char* datapointer, uint32_t &revDatasize, void* p){
slsReceiverDefs::sls_receiver_header* header = (slsReceiverDefs::sls_receiver_header*)metadata;
slsReceiverDefs::sls_detector_header detectorHeader = header->detHeader;
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.xCoord,
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.row,
"#### %d GetData: ####\n"
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu"
"\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u"
"row: %u\t\tcolumn: %u\t\treserved: %u\t\tdebug: %u"
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
//"\t\tpacketsMask:%s"
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
detectorHeader.xCoord, (long long unsigned int)detectorHeader.frameNumber,
detectorHeader.row, (long long unsigned int)detectorHeader.frameNumber,
detectorHeader.expLength, detectorHeader.packetNumber, (long long unsigned int)detectorHeader.bunchId,
(long long unsigned int)detectorHeader.timestamp, detectorHeader.modId,
detectorHeader.xCoord, detectorHeader.yCoord, detectorHeader.zCoord,
detectorHeader.row, detectorHeader.column, detectorHeader.reserved,
detectorHeader.debug, detectorHeader.roundRNumber,
detectorHeader.detType, detectorHeader.version,
//header->packetsMask.to_string().c_str(),

View File

@ -5078,11 +5078,11 @@ void multiSlsDetector::readFrameFromReceiver() {
currentFrameIndex = doc["fIndex"].GetUint64();
currentFileIndex = doc["fileIndex"].GetUint64();
currentSubFrameIndex = doc["expLength"].GetUint();
coordY = doc["xCoord"].GetUint();
coordX = doc["yCoord"].GetUint();
coordY = doc["row"].GetUint();
coordX = doc["column"].GetUint();
if (eiger)
coordY = (nY - 1) - coordY;
//cout << "X:" << doc["xCoord"].GetUint() <<" Y:"<<doc["yCoord"].GetUint();
//cout << "X:" << doc["row"].GetUint() <<" Y:"<<doc["column"].GetUint();
flippedDataX = doc["flippedDataX"].GetUint();
#ifdef VERBOSE
cprintf(BLUE, "(Debug) Header Info:\n"

View File

@ -139,8 +139,8 @@ class BinaryFileStatic {
"Dynamic Range : %d\n"
"Ten Giga : %d\n"
"Image Size : %d bytes\n"
"x : %d pixels\n"
"y : %d pixels\n"
"row : %d pixels\n"
"col : %d pixels\n"
"Max. Frames Per File : %u\n"
"Total Frames : %lld\n"
"Exptime (ns) : %lld\n"
@ -156,9 +156,9 @@ class BinaryFileStatic {
"Bunch ID : 8 bytes\n"
"Timestamp : 8 bytes\n"
"Module Id : 2 bytes\n"
"X Coordinate : 2 bytes\n"
"Y Coordinate : 2 bytes\n"
"Z Coordinate : 2 bytes\n"
"Row : 2 bytes\n"
"Column : 2 bytes\n"
"Reserved : 2 bytes\n"
"Debug : 4 bytes\n"
"Round Robin Number : 2 bytes\n"
"Detector Type : 1 byte\n"

View File

@ -213,9 +213,9 @@ public:
dset_para[3]->write(&header.bunchId, parameterDataTypes[3], memspace, *dspace_para);i=4;
dset_para[4]->write(&header.timestamp, parameterDataTypes[4], memspace, *dspace_para);i=5;
dset_para[5]->write(&header.modId, parameterDataTypes[5], memspace, *dspace_para);i=6;
dset_para[6]->write(&header.xCoord, parameterDataTypes[6], memspace, *dspace_para);i=7;
dset_para[7]->write(&header.yCoord, parameterDataTypes[7], memspace, *dspace_para);i=8;
dset_para[8]->write(&header.zCoord, parameterDataTypes[8], memspace, *dspace_para);i=9;
dset_para[6]->write(&header.row, parameterDataTypes[6], memspace, *dspace_para);i=7;
dset_para[7]->write(&header.column, parameterDataTypes[7], memspace, *dspace_para);i=8;
dset_para[8]->write(&header.reserved, parameterDataTypes[8], memspace, *dspace_para);i=9;
dset_para[9]->write(&header.debug, parameterDataTypes[9], memspace, *dspace_para);i=10;
dset_para[10]->write(&header.roundRNumber, parameterDataTypes[10], memspace, *dspace_para);i=11;
dset_para[11]->write(&header.detType, parameterDataTypes[11], memspace, *dspace_para);i=12;

View File

@ -141,12 +141,12 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
int CreateDummySocketForUDPSocketBufferSize(uint32_t s);
/**
* Set xcoord and y coord
* xcoord is in 1d if detector has not send them yet in firmware,
* xcoord is in 2d for jungfrau and eiger (for missing packets/deactivated eiger)
* ycoord when used is in 2d
* Set hard coded (calculated but not from detector) row and column
* r is in row index if detector has not send them yet in firmware,
* c is in col index for jungfrau and eiger (for missing packets/deactivated eiger)
* c when used is in 2d
*/
void SetHardCodedCoords(uint16_t x, uint16_t y);
void SetHardCodedPosition(uint16_t r, uint16_t c);
@ -251,14 +251,14 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
/** Silent Mode */
bool* silentMode;
/** x coord hardcoded as 1D or 2d,
/** row hardcoded as 1D or 2d,
* if detector does not send them yet or
* missing packets/deactivated (eiger/jungfrau sends 2d pos) **/
uint16_t xcoord;
uint16_t row;
/** y coord hardcoded as 2D,
/** column hardcoded as 2D,
* deactivated eiger/missing packets (eiger/jungfrau sends 2d pos) **/
uint16_t ycoord;
uint16_t column;
// acquisition start

View File

@ -248,7 +248,7 @@ public:
uint64_t acqIndex = 0, uint64_t fIndex = 0, 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 xCoord = 0, uint16_t yCoord = 0, uint16_t zCoord = 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,
char* additionalJsonHeader = 0) {
@ -274,9 +274,9 @@ public:
"\"bunchId\":%llu, "
"\"timestamp\":%llu, "
"\"modId\":%u, "
"\"xCoord\":%u, "
"\"yCoord\":%u, "
"\"zCoord\":%u, "
"\"row\":%u, "
"\"column\":%u, "
"\"reserved\":%u, "
"\"debug\":%u, "
"\"roundRNumber\":%u, "
"\"detType\":%u, "
@ -291,7 +291,7 @@ public:
acqIndex, fIndex, (fname == NULL)? "":fname, dummy?0:1,
frameNumber, expLength, packetNumber, bunchId, timestamp,
modId, xCoord, yCoord, zCoord, debug, roundRNumber,
modId, row, column, reserved, debug, roundRNumber,
detType, version,
//additional stuff

View File

@ -28,8 +28,8 @@
#define MAX_CHUNKED_IMAGES 1
//versions
#define HDF5_WRITER_VERSION 2.0 //1 decimal places
#define BINARY_WRITER_VERSION 2.0 //1 decimal places
#define HDF5_WRITER_VERSION 3.0 //1 decimal places
#define BINARY_WRITER_VERSION 3.0 //1 decimal places
//parameters to calculate fifo depth

View File

@ -37,8 +37,8 @@ typedef int int32_t;
#define DEFAULT_ZMQ_CL_PORTNO 30001
#define DEFAULT_ZMQ_RX_PORTNO 30001
#define SLS_DETECTOR_HEADER_VERSION 0x1
#define SLS_DETECTOR_JSON_HEADER_VERSION 0x2
#define SLS_DETECTOR_HEADER_VERSION 0x2
#define SLS_DETECTOR_JSON_HEADER_VERSION 0x3
/**
\file sls_receiver_defs.h
@ -143,9 +143,9 @@ public:
@li bunchId is the bunch id from beamline
@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 xCoord is the x coordinate in the complete detector system
@li yCoord is the y coordinate in the complete detector system
@li zCoord is the z coordinate in the complete detector system
@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 detType is the detector type see :: detectorType
@ -159,9 +159,9 @@ public:
uint64_t bunchId; /**< is the bunch id from beamline */
uint64_t timestamp; /**< is the time stamp with 10 MHz clock */
uint16_t modId; /**< is the unique module id (unique even for left, right, top, bottom) */
uint16_t xCoord; /**< is the x coordinate in the complete detector system */
uint16_t yCoord; /**< is the y coordinate in the complete detector system */
uint16_t zCoord; /**< is the z coordinate in the complete detector system */
uint16_t row; /**< is the row index in the complete detector system */
uint16_t column; /**< is the column index in the complete detector system */
uint16_t reserved; /**< is reserved */
uint32_t debug; /**< is for debugging purposes */
uint16_t roundRNumber; /**< is the round robin set number */
uint8_t detType; /**< is the detector type see :: detectorType */

View File

@ -265,7 +265,7 @@ int DataStreamer::SendHeader(sls_receiver_header* rheader, uint32_t size, uint32
nx, ny, size,
acquisitionIndex, frameIndex, fileNametoStream,
header.frameNumber, header.expLength, header.packetNumber, header.bunchId, header.timestamp,
header.modId, header.xCoord, header.yCoord, header.zCoord,
header.modId, header.row, header.column, header.reserved,
header.debug, header.roundRNumber,
header.detType, header.version,
flippedData,

View File

@ -63,13 +63,13 @@ HDF5File::HDF5File(int ind, uint32_t* maxf,
parameterNames.push_back("mod id");
parameterDataTypes.push_back(PredType::STD_U16LE);
parameterNames.push_back("x Coord");
parameterNames.push_back("row");
parameterDataTypes.push_back(PredType::STD_U16LE);
parameterNames.push_back("y Coord");
parameterNames.push_back("column");
parameterDataTypes.push_back(PredType::STD_U16LE);
parameterNames.push_back("z Coord");
parameterNames.push_back("reserved");
parameterDataTypes.push_back(PredType::STD_U16LE);
parameterNames.push_back("debug");

View File

@ -40,8 +40,8 @@ Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
activated(act),
deactivatedPaddingEnable(depaden),
silentMode(sm),
xcoord(0),
ycoord(0),
row(0),
column(0),
acquisitionStartedFlag(false),
measurementStartedFlag(false),
firstAcquisitionIndex(0),
@ -288,9 +288,9 @@ int Listener::CreateDummySocketForUDPSocketBufferSize(uint32_t s) {
return OK;
}
void Listener::SetHardCodedCoords(uint16_t x, uint16_t y) {
xcoord = x;
ycoord = y;
void Listener::SetHardCodedPosition(uint16_t r, uint16_t c) {
row = r;
column = c;
}
void Listener::ThreadExecution() {
@ -405,8 +405,8 @@ uint32_t Listener::ListenToAnImage(char* buf) {
++currentFrameIndex;
}
new_header->detHeader.frameNumber = currentFrameIndex;
new_header->detHeader.xCoord = xcoord;
new_header->detHeader.yCoord = ycoord;
new_header->detHeader.row = row;
new_header->detHeader.column = column;
new_header->detHeader.detType = (uint8_t) generalData->myDetectorType;
new_header->detHeader.version = (uint8_t) SLS_DETECTOR_HEADER_VERSION;
return generalData->imageSize;
@ -447,8 +447,8 @@ uint32_t Listener::ListenToAnImage(char* buf) {
}
new_header->detHeader.packetNumber = numpackets;
if(isHeaderEmpty) {
new_header->detHeader.xCoord = xcoord;
new_header->detHeader.yCoord = ycoord;
new_header->detHeader.row = row;
new_header->detHeader.column = column;
}
return generalData->imageSize;
}
@ -487,8 +487,8 @@ uint32_t Listener::ListenToAnImage(char* buf) {
// -------------------old header ------------------------------------------------------------------------------
else {
new_header->detHeader.frameNumber = fnum;
new_header->detHeader.xCoord = xcoord;
new_header->detHeader.yCoord = ycoord;
new_header->detHeader.row = row;
new_header->detHeader.column = column;
new_header->detHeader.detType = (uint8_t) generalData->myDetectorType;
new_header->detHeader.version = (uint8_t) SLS_DETECTOR_HEADER_VERSION;
}
@ -524,8 +524,8 @@ uint32_t Listener::ListenToAnImage(char* buf) {
}
new_header->detHeader.packetNumber = numpackets; //number of packets caught
if(isHeaderEmpty) {
new_header->detHeader.xCoord = xcoord;
new_header->detHeader.yCoord = ycoord;
new_header->detHeader.row = row;
new_header->detHeader.column = column;
}
return generalData->imageSize; //empty packet now, but not empty image
}
@ -583,8 +583,8 @@ uint32_t Listener::ListenToAnImage(char* buf) {
}
new_header->detHeader.packetNumber = numpackets; //number of packets caught
if(isHeaderEmpty) {
new_header->detHeader.xCoord = xcoord;
new_header->detHeader.yCoord = ycoord;
new_header->detHeader.row = row;
new_header->detHeader.column = column;
}
return generalData->imageSize;
}
@ -620,8 +620,8 @@ uint32_t Listener::ListenToAnImage(char* buf) {
// -------------------old header ------------------------------------------------------------------------------
else {
new_header->detHeader.frameNumber = fnum;
new_header->detHeader.xCoord = xcoord;
new_header->detHeader.yCoord = ycoord;
new_header->detHeader.row = row;
new_header->detHeader.column = column;
new_header->detHeader.detType = (uint8_t) generalData->myDetectorType;
new_header->detHeader.version = (uint8_t) SLS_DETECTOR_HEADER_VERSION;
}

View File

@ -441,15 +441,15 @@ void UDPStandardImplementation::setDetectorPositionId(const int i){
}
for (unsigned int i = 0; i < listener.size(); ++i) {
uint16_t x = 0, y = 0;
uint16_t row = 0, col = 0;
if (myDetectorType == EIGER || myDetectorType == JUNGFRAU) {
x = detID % numDet[1]; // row
y = (detID / numDet[1]) * ((myDetectorType == EIGER) ? 2 : 1) + i; // col for horiz. udp ports
row = detID % numDet[1]; // row
col = (detID / numDet[1]) * ((myDetectorType == EIGER) ? 2 : 1) + i; // col for horiz. udp ports
}
// calculate x in 1d
else
x = detID * numThreads + i;
listener[i]->SetHardCodedCoords(x,y);
row = detID * numThreads + i;
listener[i]->SetHardCodedPosition(row, col);
}
}

View File

@ -43,18 +43,18 @@ void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p){
slsReceiverDefs::sls_receiver_header* header = (slsReceiverDefs::sls_receiver_header*)metadata;
slsReceiverDefs::sls_detector_header detectorHeader = header->detHeader;
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.xCoord,
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.row,
"#### %d GetData: ####\n"
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu"
"\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u"
"xCrow%u\t\tcolumn: %u\t\tcolumn: %u\t\tdebug: %u"
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
//"\t\tpacketsMask:%s"
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
detectorHeader.xCoord, detectorHeader.frameNumber,
detectorHeader.row, detectorHeader.frameNumber,
detectorHeader.expLength, detectorHeader.packetNumber, detectorHeader.bunchId,
detectorHeader.timestamp, detectorHeader.modId,
detectorHeader.xCoord, detectorHeader.yCoord, detectorHeader.zCoord,
detectorHeader.row, detectorHeader.column, detectorHeader.column,
detectorHeader.debug, detectorHeader.roundRNumber,
detectorHeader.detType, detectorHeader.version,
//header->packetsMask.to_string().c_str(),