mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 18:40:42 +02:00
infinite loop with gettotalnumberofchannels in gappixels initialization resulting in bus error fix
This commit is contained in:
parent
678ef89e17
commit
1af065fdb1
@ -4299,9 +4299,9 @@ int multiSlsDetector::setFlippedData(dimension d, int value){
|
|||||||
|
|
||||||
int multiSlsDetector::enableGapPixels(int val) {
|
int multiSlsDetector::enableGapPixels(int val) {
|
||||||
|
|
||||||
if(getDetectorsType() != EIGER){
|
if(val > 0 && getDetectorsType() != EIGER){
|
||||||
std::cout << "Not implemented for this detector" << std::endl;
|
std::cout << "Not implemented for this detector" << std::endl;
|
||||||
return -1;
|
val = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret=-100,ret1;
|
int ret=-100,ret1;
|
||||||
@ -4314,15 +4314,17 @@ int multiSlsDetector::enableGapPixels(int val) {
|
|||||||
ret=-1;
|
ret=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update data bytes incl gap pixels
|
if (val != -1) {
|
||||||
thisMultiDetector->dataBytesInclGapPixels=0;
|
// update data bytes incl gap pixels
|
||||||
for (int i = 0; i < thisMultiDetector->numberOfDetectors; ++i) {
|
thisMultiDetector->dataBytesInclGapPixels=0;
|
||||||
if (detectors[i])
|
for (int i = 0; i < thisMultiDetector->numberOfDetectors; ++i) {
|
||||||
thisMultiDetector->dataBytesInclGapPixels += detectors[i]->getDataBytesInclGapPixels();
|
if (detectors[i])
|
||||||
}
|
thisMultiDetector->dataBytesInclGapPixels += detectors[i]->getDataBytesInclGapPixels();
|
||||||
|
}
|
||||||
|
|
||||||
// update offsets and number of channels incl gap pixels in multi level
|
// update offsets and number of channels incl gap pixels in multi level
|
||||||
updateOffsets();
|
updateOffsets();
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1747,7 +1747,10 @@ int slsDetector::getTotalNumberOfChannels() {
|
|||||||
thisDetector->nChans=thisDetector->nChan[X];
|
thisDetector->nChans=thisDetector->nChan[X];
|
||||||
thisDetector->dataBytes=thisDetector->nChans*thisDetector->nChips*thisDetector->nMods*2*thisDetector->timerValue[SAMPLES_JCTB];
|
thisDetector->dataBytes=thisDetector->nChans*thisDetector->nChips*thisDetector->nMods*2*thisDetector->timerValue[SAMPLES_JCTB];
|
||||||
// cout << "Total number of channels is "<< thisDetector->nChans*thisDetector->nChips*thisDetector->nMods << " data bytes is " << thisDetector->dataBytes << endl;
|
// cout << "Total number of channels is "<< thisDetector->nChans*thisDetector->nChips*thisDetector->nMods << " data bytes is " << thisDetector->dataBytes << endl;
|
||||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) *2*thisDetector->timerValue[SAMPLES_JCTB];
|
thisDetector->dataBytesInclGapPixels =
|
||||||
|
(thisDetector->nChan[X]*thisDetector->nChip[X]*thisDetector->nMod[X]) + (thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||||
|
(thisDetector->nChan[Y]*thisDetector->nChip[Y]*thisDetector->nMod[Y]) + (thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||||
|
2*thisDetector->timerValue[SAMPLES_JCTB];
|
||||||
} else {
|
} else {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "det type is "<< thisDetector->myDetectorType << endl;
|
cout << "det type is "<< thisDetector->myDetectorType << endl;
|
||||||
@ -2007,8 +2010,8 @@ int slsDetector::setFlippedData(dimension d, int value){
|
|||||||
|
|
||||||
int slsDetector::enableGapPixels(int val) {
|
int slsDetector::enableGapPixels(int val) {
|
||||||
|
|
||||||
if(thisDetector->myDetectorType!= EIGER)
|
if(val > 0 && thisDetector->myDetectorType!= EIGER)
|
||||||
return -1;
|
val = -1;
|
||||||
|
|
||||||
if (val >= 0) {
|
if (val >= 0) {
|
||||||
val=(val>0)?1:0;
|
val=(val>0)?1:0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user