reordering WIP

This commit is contained in:
2020-06-17 15:25:59 +02:00
parent b5781e1f9b
commit 1f3fd010a7
10 changed files with 1148 additions and 1540 deletions

View File

@ -338,49 +338,7 @@ int ClientInterface::get_version(Interface &socket) {
int ClientInterface::setup_receiver(Interface &socket) {
auto arg = socket.Receive<rxParameters>();
LOG(logDEBUG) << "detType:" << arg.detType << std::endl
<< "numberOfDetector.x:" << arg.numberOfDetector.x
<< std::endl
<< "numberOfDetector.y:" << arg.numberOfDetector.y
<< std::endl
<< "detId:" << arg.detId << std::endl
<< "hostname:" << arg.hostname << std::endl
<< "udpInterfaces:" << arg.udpInterfaces << std::endl
<< "udp_dstport:" << arg.udp_dstport << std::endl
<< "udp_dstip:" << sls::IpAddr(arg.udp_dstip) << std::endl
<< "udp_dstmac:" << sls::MacAddr(arg.udp_dstmac) << std::endl
<< "udp_dstport2:" << arg.udp_dstport2 << std::endl
<< "udp_dstip2:" << sls::IpAddr(arg.udp_dstip2) << std::endl
<< "udp_dstmac2:" << sls::MacAddr(arg.udp_dstmac2)
<< std::endl
<< "frames:" << arg.frames << std::endl
<< "triggers:" << arg.triggers << std::endl
<< "bursts:" << arg.bursts << std::endl
<< "analogSamples:" << arg.analogSamples << std::endl
<< "digitalSamples:" << arg.digitalSamples << std::endl
<< "expTimeNs:" << arg.expTimeNs << std::endl
<< "periodNs:" << arg.periodNs << std::endl
<< "subExpTimeNs:" << arg.subExpTimeNs << std::endl
<< "subDeadTimeNs:" << arg.subDeadTimeNs << std::endl
<< "activate:" << arg.activate << std::endl
<< "quad:" << arg.quad << std::endl
<< "dynamicRange:" << arg.dynamicRange << std::endl
<< "timMode:" << arg.timMode << std::endl
<< "tenGiga:" << arg.tenGiga << std::endl
<< "roMode:" << arg.roMode << std::endl
<< "adcMask:" << arg.adcMask << std::endl
<< "adc10gMask:" << arg.adc10gMask << std::endl
<< "roi.xmin:" << arg.roi.xmin << std::endl
<< "roi.xmax:" << arg.roi.xmax << std::endl
<< "countermask:" << arg.countermask << std::endl
<< "burstType:" << arg.burstType << std::endl
<< "exptime1:" << arg.expTime1Ns << std::endl
<< "exptime2:" << arg.expTime2Ns << std::endl
<< "exptime3:" << arg.expTime3Ns << std::endl
<< "gateDelay1:" << arg.gateDelay1Ns << std::endl
<< "gateDelay2:" << arg.gateDelay2Ns << std::endl
<< "gateDelay3:" << arg.gateDelay3Ns << std::endl
<< "gates:" << arg.gates << std::endl;
LOG(logDEBUG) << sls::ToString(arg);
// if object exists, verify unlocked and idle, else only verify lock
// (connecting first time)
@ -394,7 +352,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
int msize[2] = {arg.numberOfDetector.x, arg.numberOfDetector.y};
impl()->setDetectorSize(msize);
}
impl()->setDetectorPositionId(arg.detId);
impl()->setModulePositionId(arg.moduleId);
impl()->setDetectorHostname(arg.hostname);
// udp setup

View File

@ -55,7 +55,7 @@ void Implementation::InitializeMembers() {
myDetectorType = GENERIC;
for (int i = 0; i < MAX_DIMENSIONS; ++i)
numDet[i] = 0;
detID = 0;
modulePos = 0;
detHostname = "";
silentMode = false;
fifoDepth = 0;
@ -350,31 +350,32 @@ void Implementation::setDetectorSize(const int *size) {
LOG(logINFO) << log_message;
}
int Implementation::getDetectorPositionId() const {
int Implementation::getModulePositionId() const {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
return detID;
return modulePos;
}
void Implementation::setDetectorPositionId(const int id) {
void Implementation::setModulePositionId(const int id) {
LOG(logDEBUG3) << __SHORT_AT__ << " called";
detID = id;
LOG(logINFO) << "Detector Position Id:" << detID;
modulePos = id;
LOG(logINFO) << "Module Position Id:" << modulePos;
// update zmq port
streamingPort =
DEFAULT_ZMQ_RX_PORTNO + (detID * (myDetectorType == EIGER ? 2 : 1));
DEFAULT_ZMQ_RX_PORTNO + (modulePos * (myDetectorType == EIGER ? 2 : 1));
for (unsigned int i = 0; i < dataProcessor.size(); ++i) {
dataProcessor[i]->SetupFileWriter(
fileWriteEnable, (int *)numDet, &framesPerFile, &fileName,
&filePath, &fileIndex, &overwriteEnable, &detID, &numThreads,
&filePath, &fileIndex, &overwriteEnable, &modulePos, &numThreads,
&numberOfTotalFrames, &dynamicRange, &udpPortNum[i], generalData);
}
assert(numDet[1] != 0);
for (unsigned int i = 0; i < listener.size(); ++i) {
uint16_t row = 0, col = 0;
row = (detID % numDet[1]) * ((numUDPInterfaces == 2) ? 2 : 1); // row
col = (detID / numDet[1]) * ((myDetectorType == EIGER) ? 2 : 1) +
row =
(modulePos % numDet[1]) * ((numUDPInterfaces == 2) ? 2 : 1); // row
col = (modulePos / numDet[1]) * ((myDetectorType == EIGER) ? 2 : 1) +
i; // col for horiz. udp ports
listener[i]->SetHardCodedPosition(row, col);
}
@ -555,9 +556,9 @@ void Implementation::setFileWriteEnable(const bool b) {
for (unsigned int i = 0; i < dataProcessor.size(); ++i) {
dataProcessor[i]->SetupFileWriter(
fileWriteEnable, (int *)numDet, &framesPerFile, &fileName,
&filePath, &fileIndex, &overwriteEnable, &detID, &numThreads,
&numberOfTotalFrames, &dynamicRange, &udpPortNum[i],
generalData);
&filePath, &fileIndex, &overwriteEnable, &modulePos,
&numThreads, &numberOfTotalFrames, &dynamicRange,
&udpPortNum[i], generalData);
}
}
@ -1064,7 +1065,7 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
// update (from 1 to 2 interface) & also for printout
setDetectorSize(numDet);
// update row and column in dataprocessor
setDetectorPositionId(detID);
setModulePositionId(modulePos);
// update call backs
if (rawDataReadyCallBack) {

View File

@ -30,8 +30,8 @@ class Implementation : private virtual slsDetectorDefs {
void setDetectorType(const detectorType d);
int *getDetectorSize() const;
void setDetectorSize(const int *size);
int getDetectorPositionId() const;
void setDetectorPositionId(const int id);
int getModulePositionId() const;
void setModulePositionId(const int id);
std::string getDetectorHostname() const;
void setDetectorHostname(const std::string &c);
bool getSilentMode() const;
@ -265,7 +265,7 @@ class Implementation : private virtual slsDetectorDefs {
int numThreads;
detectorType myDetectorType;
int numDet[MAX_DIMENSIONS];
int detID;
int modulePos;
std::string detHostname;
bool silentMode;
uint32_t fifoDepth;