mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
got rid of segmentation fault in update offfsets
This commit is contained in:
parent
a149d7fb2e
commit
36d6538104
@ -102,6 +102,9 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
|
|||||||
}
|
}
|
||||||
id--;
|
id--;
|
||||||
|
|
||||||
|
for (int id=0; id<MAXDET; id++) {
|
||||||
|
detectors[id]=NULL;
|
||||||
|
}
|
||||||
if (thisMultiDetector->alreadyExisting==0) {
|
if (thisMultiDetector->alreadyExisting==0) {
|
||||||
|
|
||||||
|
|
||||||
@ -250,8 +253,8 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
|
|||||||
// 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);
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int i=thisMultiDetector->numberOfDetectors; i<MAXDET; i++)
|
// for (int i=thisMultiDetector->numberOfDetectors; i<MAXDET; i++)
|
||||||
detectors[i]=NULL;
|
// detectors[i]=NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -363,7 +366,7 @@ void multiSlsDetector::updateOffsets(){
|
|||||||
thisMultiDetector->maxNumberOfChannel[Y] = 0;
|
thisMultiDetector->maxNumberOfChannel[Y] = 0;
|
||||||
|
|
||||||
//0th position
|
//0th position
|
||||||
if (detectors[0]){
|
if ((detectors[0]) && (thisMultiDetector->numberOfDetectors > 0)){
|
||||||
offsetX = thisMultiDetector->offsetX[0] = 0;
|
offsetX = thisMultiDetector->offsetX[0] = 0;
|
||||||
offsetY = thisMultiDetector->offsetY[0] = 0;
|
offsetY = thisMultiDetector->offsetY[0] = 0;
|
||||||
numX = thisMultiDetector->numberOfChannel[X] = detectors[0]->getTotalNumberOfChannels(X);
|
numX = thisMultiDetector->numberOfChannel[X] = detectors[0]->getTotalNumberOfChannels(X);
|
||||||
@ -774,7 +777,6 @@ int multiSlsDetector::removeSlsDetector(int pos) {
|
|||||||
return thisMultiDetector->numberOfDetectors;
|
return thisMultiDetector->numberOfDetectors;
|
||||||
|
|
||||||
//j=pos;
|
//j=pos;
|
||||||
|
|
||||||
for (j=mi; j<ma; j++) {
|
for (j=mi; j<ma; j++) {
|
||||||
|
|
||||||
if (detectors[j]) {
|
if (detectors[j]) {
|
||||||
@ -784,9 +786,9 @@ int multiSlsDetector::removeSlsDetector(int pos) {
|
|||||||
thisMultiDetector->maxNumberOfChannels-=detectors[j]->getMaxNumberOfChannels();
|
thisMultiDetector->maxNumberOfChannels-=detectors[j]->getMaxNumberOfChannels();
|
||||||
|
|
||||||
delete detectors[j];
|
delete detectors[j];
|
||||||
|
detectors[j]=0;
|
||||||
thisMultiDetector->numberOfDetectors--;
|
thisMultiDetector->numberOfDetectors--;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (single) {
|
if (single) {
|
||||||
for (int i=j+1; i<thisMultiDetector->numberOfDetectors+1; i++) {
|
for (int i=j+1; i<thisMultiDetector->numberOfDetectors+1; i++) {
|
||||||
@ -3943,11 +3945,11 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << endl;
|
cout << endl;
|
||||||
for (int ia=0; ia<iargval; ia++) cout << args[ia] << " ??????? ";
|
for (int ia=0; ia<iargval; ia++) cout << args[ia] << " ??????? ";
|
||||||
cout << endl;
|
cout << endl;
|
||||||
#endif
|
#endif
|
||||||
cmd=new multiSlsDetectorClient(iargval, args, PUT_ACTION, this);
|
cmd=new multiSlsDetectorClient(iargval, args, PUT_ACTION, this);
|
||||||
delete cmd;
|
delete cmd;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user