fixed 32 bit gui masking problem in qdrawplot (conversion from char* to double) mythen clause not activated

This commit is contained in:
Dhanya Maliakal
2017-10-03 10:49:26 +02:00
parent 5a7800768b
commit 34062b6e0b

View File

@ -2163,7 +2163,6 @@ void qDrawPlot::toDoublePixelData(double* dest, char* source,int size, int datab
int halfbyte=0; int halfbyte=0;
char cbyte = '\0'; char cbyte = '\0';
int mask=0x00ffffff; int mask=0x00ffffff;
bool jungfrau = (detType == slsDetectorDefs::JUNGFRAU);
switch(dr) { switch(dr) {
@ -2185,8 +2184,7 @@ void qDrawPlot::toDoublePixelData(double* dest, char* source,int size, int datab
break; break;
case 16: case 16:
// jungfrau if (detType == slsDetectorDefs::JUNGFRAU) {
if (jungfrau) {
// show gain plot // show gain plot
if(gaindest!=NULL) { if(gaindest!=NULL) {
@ -2213,28 +2211,28 @@ void qDrawPlot::toDoublePixelData(double* dest, char* source,int size, int datab
source += 2; source += 2;
} }
} }
break;
} }
// other detectors // other detectors
else {
for (ichan = 0; ichan < size; ++ichan) { for (ichan = 0; ichan < size; ++ichan) {
dest[ichan] = *((u_int16_t*)source); dest[ichan] = *((u_int16_t*)source);
source += 2; source += 2;
} }
}
break; break;
default: default:
// mythen if (detType == slsDetectorDefs::MYTHEN) {
for (ichan=0; ichan < size; ++ichan) { for (ichan = 0; ichan < size; ++ichan) {
dest[ichan] = (*((u_int32_t*)source) & mask); dest[ichan] = (*((u_int32_t*)source) & mask);
source += 4; source += 4;
} }
break;
}
// other detectors // other detectors
for (ichan=0; ichan < size; ++ichan) { for (ichan = 0; ichan < size; ++ichan) {
dest[ichan] = *((u_int32_t*)source); dest[ichan] = *((u_int32_t*)source);
source += 4; source += 4;
} }