mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
gui 12 bit mode done
This commit is contained in:
@ -1064,6 +1064,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
|
||||
// mythen3 / gotthard2 debugging
|
||||
int discardBits = numDiscardBits;
|
||||
|
||||
uint16_t temp = 0;
|
||||
switch (dr) {
|
||||
|
||||
case 4:
|
||||
@ -1083,6 +1084,28 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
|
||||
}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
for (ichan = 0; ichan < size; ++ichan) {
|
||||
// first 12 bit pixel
|
||||
// lsb (8 bytes)
|
||||
temp = (*((u_int8_t *)source)) & 0xFF;
|
||||
++source;
|
||||
// msb (4 bytes)
|
||||
temp |= (((*((u_int8_t *)source)) & 0xF) << 8);
|
||||
dest[ichan] = (double)temp;
|
||||
|
||||
// second 12bit pixel
|
||||
++ichan;
|
||||
// lsb (4 bytes)
|
||||
temp = (((*((u_int8_t *)source)) & 0xF0) >> 4);
|
||||
++source;
|
||||
// msb (8 bytes)
|
||||
temp |= (((*((u_int8_t *)source)) & 0xFF) << 4);
|
||||
++source;
|
||||
dest[ichan] = (double)temp;
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
if (detType == slsDetectorDefs::JUNGFRAU ||
|
||||
detType == slsDetectorDefs::GOTTHARD2) {
|
||||
|
Reference in New Issue
Block a user