mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
change the filenaming according to det position and not det id
This commit is contained in:
parent
a67f9d50de
commit
2a508435c7
@ -251,7 +251,7 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << thisMultiDetector->detectorIds[i] << endl;
|
cout << thisMultiDetector->detectorIds[i] << endl;
|
||||||
#endif
|
#endif
|
||||||
detectors[i]=new slsDetector(thisMultiDetector->detectorIds[i], this);
|
detectors[i]=new slsDetector(i, thisMultiDetector->detectorIds[i], this);
|
||||||
|
|
||||||
|
|
||||||
// setAngularConversionPointer(detectors[i]->getAngularConversionPointer(),detectors[i]->getNModsPointer(),detectors[i]->getNChans()*detectors[i]->getNChips(), i);
|
// setAngularConversionPointer(detectors[i]->getAngularConversionPointer(),detectors[i]->getNModsPointer(),detectors[i]->getNChans()*detectors[i]->getNChips(), i);
|
||||||
@ -372,7 +372,7 @@ int multiSlsDetector::addSlsDetector(int id, int pos) {
|
|||||||
cout << "Creating new detector " << pos << endl;
|
cout << "Creating new detector " << pos << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
detectors[pos]=new slsDetector(id, this);
|
detectors[pos]=new slsDetector(pos, id, this);
|
||||||
thisMultiDetector->detectorIds[pos]=detectors[pos]->getDetectorId();
|
thisMultiDetector->detectorIds[pos]=detectors[pos]->getDetectorId();
|
||||||
thisMultiDetector->numberOfDetectors++;
|
thisMultiDetector->numberOfDetectors++;
|
||||||
|
|
||||||
@ -687,7 +687,7 @@ int multiSlsDetector::addSlsDetector(const char *name, int pos) {
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Detector " << id << " already exists" << endl;
|
cout << "Detector " << id << " already exists" << endl;
|
||||||
#endif
|
#endif
|
||||||
s=new slsDetector(id, this);
|
s=new slsDetector(pos, id, this);
|
||||||
if (s->getHostname()==string(name))
|
if (s->getHostname()==string(name))
|
||||||
break;
|
break;
|
||||||
delete s;
|
delete s;
|
||||||
@ -728,7 +728,7 @@ int multiSlsDetector::addSlsDetector(const char *name, int pos) {
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Creating detector " << id << " of type " << getDetectorType(t) << endl;
|
cout << "Creating detector " << id << " of type " << getDetectorType(t) << endl;
|
||||||
#endif
|
#endif
|
||||||
s=new slsDetector(t, id, this);
|
s=new slsDetector(pos, t, id, this);
|
||||||
if (online) {
|
if (online) {
|
||||||
s->setTCPSocket(name);
|
s->setTCPSocket(name);
|
||||||
setOnline(ONLINE_FLAG);
|
setOnline(ONLINE_FLAG);
|
||||||
@ -761,7 +761,7 @@ int multiSlsDetector::addSlsDetector(detectorType t, int pos) {
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Creating detector " << id << " of type " << getDetectorType(t) << endl;
|
cout << "Creating detector " << id << " of type " << getDetectorType(t) << endl;
|
||||||
#endif
|
#endif
|
||||||
slsDetector *s=new slsDetector(t, id, this);
|
slsDetector *s=new slsDetector(pos, t, id, this);
|
||||||
s=NULL;
|
s=NULL;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Adding it to the multi detector structure" << endl;
|
cout << "Adding it to the multi detector structure" << endl;
|
||||||
@ -5122,7 +5122,7 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy){
|
|||||||
}
|
}
|
||||||
//add port
|
//add port
|
||||||
sprintf(dataSocketServerDetails[i],"%s:%d",dataSocketServerDetails[i],DEFAULT_ZMQ_PORTNO +
|
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)
|
(i/numSocketsPerDetector)*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();
|
||||||
|
@ -152,9 +152,10 @@ int slsDetector::freeSharedMemory() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetector::slsDetector(int id,multiSlsDetector *p) :slsDetectorUtils(),
|
slsDetector::slsDetector(int pos, int id, multiSlsDetector *p) :slsDetectorUtils(),
|
||||||
thisDetector(NULL),
|
thisDetector(NULL),
|
||||||
detId(id),
|
detId(id),
|
||||||
|
posId(pos),
|
||||||
parentDet(p),
|
parentDet(p),
|
||||||
shmId(-1),
|
shmId(-1),
|
||||||
controlSocket(NULL),
|
controlSocket(NULL),
|
||||||
@ -204,9 +205,10 @@ slsDetector::slsDetector(int id,multiSlsDetector *p) :slsDetectorUtils(),
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetector::slsDetector(detectorType type, int id,multiSlsDetector *p): slsDetectorUtils(),
|
slsDetector::slsDetector(int pos, detectorType type, int id, multiSlsDetector *p): slsDetectorUtils(),
|
||||||
thisDetector(NULL),
|
thisDetector(NULL),
|
||||||
detId(id),
|
detId(id),
|
||||||
|
posId(pos),
|
||||||
parentDet(p),
|
parentDet(p),
|
||||||
shmId(-1),
|
shmId(-1),
|
||||||
controlSocket(NULL),
|
controlSocket(NULL),
|
||||||
@ -260,9 +262,10 @@ slsDetector::~slsDetector(){
|
|||||||
delete thisReceiver;
|
delete thisReceiver;
|
||||||
};
|
};
|
||||||
|
|
||||||
slsDetector::slsDetector(char *name, int id, int cport,multiSlsDetector *p) : slsDetectorUtils(),
|
slsDetector::slsDetector(int pos, char *name, int id, int cport,multiSlsDetector *p) : slsDetectorUtils(),
|
||||||
thisDetector(NULL),
|
thisDetector(NULL),
|
||||||
detId(id),
|
detId(id),
|
||||||
|
posId(pos),
|
||||||
parentDet(p),
|
parentDet(p),
|
||||||
shmId(-1),
|
shmId(-1),
|
||||||
controlSocket(NULL),
|
controlSocket(NULL),
|
||||||
@ -7256,9 +7259,9 @@ string slsDetector::setFileName(string s) {
|
|||||||
pthread_mutex_lock(&ms);
|
pthread_mutex_lock(&ms);
|
||||||
fileIO::setFileName(s);
|
fileIO::setFileName(s);
|
||||||
if(thisDetector->myDetectorType == EIGER)
|
if(thisDetector->myDetectorType == EIGER)
|
||||||
parentDet->setDetectorIndex(detId);
|
parentDet->setDetectorIndex(posId);
|
||||||
else if(parentDet->getNumberOfDetectors()>1)
|
else if(parentDet->getNumberOfDetectors()>1)
|
||||||
parentDet->setDetectorIndex(detId);
|
parentDet->setDetectorIndex(posId);
|
||||||
s=parentDet->createReceiverFilePrefix();
|
s=parentDet->createReceiverFilePrefix();
|
||||||
pthread_mutex_unlock(&ms);
|
pthread_mutex_unlock(&ms);
|
||||||
}
|
}
|
||||||
|
@ -297,20 +297,22 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
/** (default) constructor
|
/** (default) constructor
|
||||||
\param type is needed to define the size of the detector shared memory 9defaults to GENERIC i.e. the largest shared memory needed by any slsDetector is allocated
|
\param type is needed to define the size of the detector shared memory 9defaults to GENERIC i.e. the largest shared memory needed by any slsDetector is allocated
|
||||||
\param id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently
|
\param id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently
|
||||||
|
\param pos is the index of object in the parent multislsdet array
|
||||||
\param p is the parent multislsdet to access filename ,path etc
|
\param p is the parent multislsdet to access filename ,path etc
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
slsDetector(detectorType type=GENERIC, int id=0, multiSlsDetector *p=NULL);
|
slsDetector(int pos, detectorType type=GENERIC, int id=0, multiSlsDetector *p=NULL);
|
||||||
|
|
||||||
/** constructor
|
/** constructor
|
||||||
\param id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently
|
\param id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently
|
||||||
|
\param pos is the index of object in the parent multislsdet array
|
||||||
\param p is the parent multislsdet to access filename ,path etc
|
\param p is the parent multislsdet to access filename ,path etc
|
||||||
*/
|
*/
|
||||||
slsDetector(int id, multiSlsDetector *p=NULL);
|
slsDetector(int pos, int id, multiSlsDetector *p=NULL);
|
||||||
|
|
||||||
|
|
||||||
slsDetector(char *name, int id=0, int cport=DEFAULT_PORTNO, multiSlsDetector *p=NULL);
|
slsDetector(int pos, char *name, int id=0, int cport=DEFAULT_PORTNO, multiSlsDetector *p=NULL);
|
||||||
//slsDetector(string const fname);
|
//slsDetector(string const fname);
|
||||||
// ~slsDetector(){while(dataQueue.size()>0){}};
|
// ~slsDetector(){while(dataQueue.size()>0){}};
|
||||||
/** destructor */
|
/** destructor */
|
||||||
@ -1415,6 +1417,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int getDetectorId(int i=-1) {return detId;};
|
int getDetectorId(int i=-1) {return detId;};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Receives a data frame from the detector socket
|
Receives a data frame from the detector socket
|
||||||
\returns pointer to the data (or NULL if failed)
|
\returns pointer to the data (or NULL if failed)
|
||||||
@ -1836,6 +1839,11 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
*/
|
*/
|
||||||
int detId;
|
int detId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
position ID
|
||||||
|
*/
|
||||||
|
int posId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parent multi detector
|
* parent multi detector
|
||||||
|
Loading…
x
Reference in New Issue
Block a user