now updating max number of modules when reading the number of modules

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@265 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi
2012-09-20 15:28:54 +00:00
parent dc9d295860
commit ae9b39fba3
3 changed files with 70 additions and 5 deletions

View File

@ -2893,9 +2893,16 @@ int multiSlsDetector::getMaxMods() {
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
if (detectors[idet]) {
ret1=detectors[idet]->getMaxMods();
#ifdef VERBOSE
cout << "detector " << idet << " maxmods " << ret1 << endl;
#endif
ret+=ret1;
}
}
#ifdef VERBOSE
cout << "max mods is " << ret << endl;
#endif
return ret;
}
@ -2948,14 +2955,15 @@ int multiSlsDetector::setNumberOfModules(int p, dimension d) {
int multiSlsDetector::decodeNMod(int i, int &id, int &im) {
#ifdef VERBOSE
cout << " Module " << i << " belongs to detector " << id ;
cout << " Module " << i << " belongs to detector " << id << endl;;
cout << getMaxMods();
#endif
if (i<0 || i>=getMaxMods()) {
id=-1;
im=-1;
#ifdef VERBOSE
cout << "A---------" << id << " position " << im << endl;
cout << " A---------" << id << " position " << im << endl;
#endif
return -1;
@ -2968,7 +2976,7 @@ int multiSlsDetector::decodeNMod(int i, int &id, int &im) {
id=idet;
im=i;
#ifdef VERBOSE
cout << "B---------" <<id << " position " << im << endl;
cout << " B---------" <<id << " position " << im << endl;
#endif
return im;
} else {
@ -2979,7 +2987,7 @@ int multiSlsDetector::decodeNMod(int i, int &id, int &im) {
id=-1;
im=-1;
#ifdef VERBOSE
cout <<"C---------" << id << " position " << im << endl;
cout <<" C---------" << id << " position " << im << endl;
#endif
return -1;