mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-05 20:30:03 +02:00
passing multislsdetector reference to slsdetector constructor
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@293 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
733f5b1f3e
commit
5d9d26506f
@ -197,7 +197,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]);
|
detectors[i]=new slsDetector(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);
|
||||||
@ -307,7 +307,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);
|
detectors[pos]=new slsDetector(id, this);
|
||||||
thisMultiDetector->detectorIds[pos]=detectors[pos]->getDetectorId();
|
thisMultiDetector->detectorIds[pos]=detectors[pos]->getDetectorId();
|
||||||
thisMultiDetector->numberOfDetectors++;
|
thisMultiDetector->numberOfDetectors++;
|
||||||
|
|
||||||
@ -530,7 +530,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);
|
s=new slsDetector(id, this);
|
||||||
if (s->getHostname()==string(name))
|
if (s->getHostname()==string(name))
|
||||||
break;
|
break;
|
||||||
delete s;
|
delete s;
|
||||||
@ -569,7 +569,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);
|
s=new slsDetector(t, id, this);
|
||||||
if (online) {
|
if (online) {
|
||||||
s->setTCPSocket(name);
|
s->setTCPSocket(name);
|
||||||
setOnline(ONLINE_FLAG);
|
setOnline(ONLINE_FLAG);
|
||||||
@ -602,7 +602,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);
|
slsDetector *s=new slsDetector(t, id, this);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Adding it to the multi detector structure" << endl;
|
cout << "Adding it to the multi detector structure" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
@ -109,7 +109,7 @@ int slsDetector::freeSharedMemory() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetector::slsDetector(int id) :slsDetectorUtils(),
|
slsDetector::slsDetector(int id,multiSlsDetector *p) :slsDetectorUtils(),
|
||||||
thisDetector(NULL),
|
thisDetector(NULL),
|
||||||
detId(id),
|
detId(id),
|
||||||
shmId(-1),
|
shmId(-1),
|
||||||
@ -122,7 +122,8 @@ slsDetector::slsDetector(int id) :slsDetectorUtils(),
|
|||||||
dacs(NULL),
|
dacs(NULL),
|
||||||
adcs(NULL),
|
adcs(NULL),
|
||||||
chipregs(NULL),
|
chipregs(NULL),
|
||||||
chanregs(NULL)
|
chanregs(NULL),
|
||||||
|
parentDet(p)
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -157,7 +158,7 @@ slsDetector::slsDetector(int id) :slsDetectorUtils(),
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetector::slsDetector(detectorType type, int id): slsDetectorUtils(),
|
slsDetector::slsDetector(detectorType type, int id,multiSlsDetector *p): slsDetectorUtils(),
|
||||||
thisDetector(NULL),
|
thisDetector(NULL),
|
||||||
detId(id),
|
detId(id),
|
||||||
shmId(-1),
|
shmId(-1),
|
||||||
@ -170,7 +171,8 @@ slsDetector::slsDetector(detectorType type, int id): slsDetectorUtils(),
|
|||||||
dacs(NULL),
|
dacs(NULL),
|
||||||
adcs(NULL),
|
adcs(NULL),
|
||||||
chipregs(NULL),
|
chipregs(NULL),
|
||||||
chanregs(NULL)
|
chanregs(NULL),
|
||||||
|
parentDet(p)
|
||||||
{
|
{
|
||||||
while (shmId<0) {
|
while (shmId<0) {
|
||||||
/**Initlializes shared memory \sa initSharedMemory
|
/**Initlializes shared memory \sa initSharedMemory
|
||||||
@ -208,7 +210,7 @@ slsDetector::~slsDetector(){
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
slsDetector::slsDetector(char *name, int id, int cport) : slsDetectorUtils(),
|
slsDetector::slsDetector(char *name, int id, int cport,multiSlsDetector *p) : slsDetectorUtils(),
|
||||||
thisDetector(NULL),
|
thisDetector(NULL),
|
||||||
detId(id),
|
detId(id),
|
||||||
shmId(-1),
|
shmId(-1),
|
||||||
@ -221,7 +223,8 @@ slsDetector::slsDetector(char *name, int id, int cport) : slsDetectorUtils(),
|
|||||||
dacs(NULL),
|
dacs(NULL),
|
||||||
adcs(NULL),
|
adcs(NULL),
|
||||||
chipregs(NULL),
|
chipregs(NULL),
|
||||||
chanregs(NULL)
|
chanregs(NULL),
|
||||||
|
parentDet(p)
|
||||||
{
|
{
|
||||||
detectorType type=(detectorType)getDetectorType(name, cport);
|
detectorType type=(detectorType)getDetectorType(name, cport);
|
||||||
|
|
||||||
|
@ -272,18 +272,20 @@ 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 p is the parent multislsdet to access filename ,path etc
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
slsDetector(detectorType type=GENERIC, int id=0);
|
slsDetector(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 p is the parent multislsdet to access filename ,path etc
|
||||||
*/
|
*/
|
||||||
slsDetector(int id);
|
slsDetector(int id, multiSlsDetector *p=NULL);
|
||||||
|
|
||||||
|
|
||||||
slsDetector(char *name, int id=0, int cport=DEFAULT_PORTNO);
|
slsDetector(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 */
|
||||||
@ -1467,6 +1469,13 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
*/
|
*/
|
||||||
int detId;
|
int detId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
|
||||||
|
multiSlsDetector *parentDet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
shared memeory ID
|
shared memeory ID
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user