mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
using detid to calculte zmq port in case of shmget error and det id does not start with 0 and 1 as in receiver zmq server ports
This commit is contained in:
parent
790cef37ff
commit
dd9387ef29
@ -5070,9 +5070,11 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy){
|
|||||||
|
|
||||||
//number of sockets
|
//number of sockets
|
||||||
int numSockets = thisMultiDetector->numberOfDetectors;
|
int numSockets = thisMultiDetector->numberOfDetectors;
|
||||||
if(getDetectorsType() == EIGER)
|
int numSocketsPerDetector = 1;
|
||||||
numSockets *= 2;
|
if(getDetectorsType() == EIGER){
|
||||||
|
numSocketsPerDetector = 2;
|
||||||
|
}
|
||||||
|
numSockets *= numSocketsPerDetector;
|
||||||
|
|
||||||
if(destroy){
|
if(destroy){
|
||||||
cprintf(MAGENTA,"Going to destroy data sockets\n");
|
cprintf(MAGENTA,"Going to destroy data sockets\n");
|
||||||
@ -5099,7 +5101,7 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy){
|
|||||||
//get name of rx_hostname
|
//get name of rx_hostname
|
||||||
char rx_hostname[100];
|
char rx_hostname[100];
|
||||||
strcpy(dataSocketServerDetails[i],"tcp://");
|
strcpy(dataSocketServerDetails[i],"tcp://");
|
||||||
strcpy(rx_hostname, detectors[i/numSockets]->getReceiver());
|
strcpy(rx_hostname, detectors[i/numSocketsPerDetector]->getReceiver());
|
||||||
cout<<"rx_hostname:"<<rx_hostname<<endl;
|
cout<<"rx_hostname:"<<rx_hostname<<endl;
|
||||||
//append it (first into ip) to tcp://
|
//append it (first into ip) to tcp://
|
||||||
if(strchr(rx_hostname,'.')!=NULL)
|
if(strchr(rx_hostname,'.')!=NULL)
|
||||||
@ -5114,7 +5116,8 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy){
|
|||||||
strcat(dataSocketServerDetails[i],inet_ntoa(*(struct in_addr*)he->h_addr));
|
strcat(dataSocketServerDetails[i],inet_ntoa(*(struct in_addr*)he->h_addr));
|
||||||
}
|
}
|
||||||
//add port
|
//add port
|
||||||
sprintf(dataSocketServerDetails[i],"%s:%d",dataSocketServerDetails[i],DEFAULT_ZMQ_PORTNO + i);
|
sprintf(dataSocketServerDetails[i],"%s:%d",dataSocketServerDetails[i],DEFAULT_ZMQ_PORTNO +
|
||||||
|
(detectors[i/numSocketsPerDetector]->getDetectorId())*numSocketsPerDetector + (i%numSocketsPerDetector));//using this instead of i in the offchance, detid doesnt start at 0 (shmget error)
|
||||||
|
|
||||||
//create context
|
//create context
|
||||||
context[i] = zmq_ctx_new();
|
context[i] = zmq_ctx_new();
|
||||||
@ -5272,7 +5275,7 @@ void multiSlsDetector::readFrameFromReceiver(){
|
|||||||
ny = getTotalNumberOfChannels(slsDetectorDefs::Y);
|
ny = getTotalNumberOfChannels(slsDetectorDefs::Y);
|
||||||
//calculating offsets (for eiger interleaving ports)
|
//calculating offsets (for eiger interleaving ports)
|
||||||
int offsetX[numSockets]; int offsetY[numSockets];
|
int offsetX[numSockets]; int offsetY[numSockets];
|
||||||
bool bottom[numSockets];
|
int bottom[numSockets];
|
||||||
if(maxX){
|
if(maxX){
|
||||||
for(int i=0; i<numSockets; ++i){
|
for(int i=0; i<numSockets; ++i){
|
||||||
offsetY[i] = (maxY - (thisMultiDetector->offsetY[i/numSocketsPerSLSDetector] + slsmaxY)) * maxX * bytesperchannel;
|
offsetY[i] = (maxY - (thisMultiDetector->offsetY[i/numSocketsPerSLSDetector] + slsmaxY)) * maxX * bytesperchannel;
|
||||||
|
@ -754,6 +754,8 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
|||||||
|
|
||||||
thisDetector->tenGigaEnable=0;
|
thisDetector->tenGigaEnable=0;
|
||||||
thisDetector->acquiringFlag = false;
|
thisDetector->acquiringFlag = false;
|
||||||
|
thisDetector->flippedData[0] = 0;
|
||||||
|
thisDetector->flippedData[1] = 0;
|
||||||
|
|
||||||
for (int ia=0; ia<MAX_ACTIONS; ia++) {
|
for (int ia=0; ia<MAX_ACTIONS; ia++) {
|
||||||
strcpy(thisDetector->actionScript[ia],"none");
|
strcpy(thisDetector->actionScript[ia],"none");
|
||||||
|
@ -268,7 +268,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
/** flag for acquiring */
|
/** flag for acquiring */
|
||||||
bool acquiringFlag;
|
bool acquiringFlag;
|
||||||
/** flipped data across x or y axis */
|
/** flipped data across x or y axis */
|
||||||
bool flippedData[2];
|
int flippedData[2];
|
||||||
|
|
||||||
} sharedSlsDetector;
|
} sharedSlsDetector;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user