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--;
|
||||
|
||||
for (int id=0; id<MAXDET; id++) {
|
||||
detectors[id]=NULL;
|
||||
}
|
||||
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);
|
||||
|
||||
}
|
||||
for (int i=thisMultiDetector->numberOfDetectors; i<MAXDET; i++)
|
||||
detectors[i]=NULL;
|
||||
// for (int i=thisMultiDetector->numberOfDetectors; i<MAXDET; i++)
|
||||
// detectors[i]=NULL;
|
||||
|
||||
|
||||
|
||||
@ -363,7 +366,7 @@ void multiSlsDetector::updateOffsets(){
|
||||
thisMultiDetector->maxNumberOfChannel[Y] = 0;
|
||||
|
||||
//0th position
|
||||
if (detectors[0]){
|
||||
if ((detectors[0]) && (thisMultiDetector->numberOfDetectors > 0)){
|
||||
offsetX = thisMultiDetector->offsetX[0] = 0;
|
||||
offsetY = thisMultiDetector->offsetY[0] = 0;
|
||||
numX = thisMultiDetector->numberOfChannel[X] = detectors[0]->getTotalNumberOfChannels(X);
|
||||
@ -774,7 +777,6 @@ int multiSlsDetector::removeSlsDetector(int pos) {
|
||||
return thisMultiDetector->numberOfDetectors;
|
||||
|
||||
//j=pos;
|
||||
|
||||
for (j=mi; j<ma; j++) {
|
||||
|
||||
if (detectors[j]) {
|
||||
@ -784,10 +786,10 @@ int multiSlsDetector::removeSlsDetector(int pos) {
|
||||
thisMultiDetector->maxNumberOfChannels-=detectors[j]->getMaxNumberOfChannels();
|
||||
|
||||
delete detectors[j];
|
||||
detectors[j]=0;
|
||||
thisMultiDetector->numberOfDetectors--;
|
||||
|
||||
|
||||
|
||||
if (single) {
|
||||
for (int i=j+1; i<thisMultiDetector->numberOfDetectors+1; i++) {
|
||||
detectors[i-1]=detectors[i];
|
||||
|
Loading…
x
Reference in New Issue
Block a user