mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-05 17:40:40 +02:00
dev: legal gain values in jungfrau simulator (#1044)
* legal gain values in jungfrau simulator * typo
This commit is contained in:
parent
f1ffc6057a
commit
4829429abd
@ -2254,7 +2254,6 @@ int setThresholdTemperature(int val) {
|
|||||||
|
|
||||||
double ftemp = (double)temp / 1000.00;
|
double ftemp = (double)temp / 1000.00;
|
||||||
LOG(logDEBUG1, ("Threshold Temperature read %f °C\n", ftemp));
|
LOG(logDEBUG1, ("Threshold Temperature read %f °C\n", ftemp));
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2791,9 +2790,9 @@ void *start_timer(void *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((i % 1024) < 300) {
|
if ((i % 1024) < 300) {
|
||||||
gainVal = 1;
|
gainVal = 0;
|
||||||
} else if ((i % 1024) < 600) {
|
} else if ((i % 1024) < 600) {
|
||||||
gainVal = 2;
|
gainVal = 1;
|
||||||
} else {
|
} else {
|
||||||
gainVal = 3;
|
gainVal = 3;
|
||||||
}
|
}
|
||||||
@ -2830,17 +2829,29 @@ void *start_timer(void *arg) {
|
|||||||
clock_gettime(CLOCK_REALTIME, &begin);
|
clock_gettime(CLOCK_REALTIME, &begin);
|
||||||
usleep(expUs);
|
usleep(expUs);
|
||||||
|
|
||||||
|
#ifdef TEST_CHANGE_GAIN_EVERY_FRAME
|
||||||
// change gain and data for every frame
|
// change gain and data for every frame
|
||||||
{
|
{
|
||||||
const int npixels = (NCHAN * NCHIP);
|
const int npixels = (NCHAN * NCHIP);
|
||||||
|
|
||||||
|
// random gain values, 2 becomes 3 as 2 is invalid
|
||||||
|
int randomGainValues[3] = {0};
|
||||||
|
srand(time(0));
|
||||||
|
for (int i = 0; i != 3; ++i) {
|
||||||
|
int r = rand() % 3;
|
||||||
|
if (r == 2)
|
||||||
|
r = 3;
|
||||||
|
randomGainValues[i] = r;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < npixels; ++i) {
|
for (int i = 0; i < npixels; ++i) {
|
||||||
int gainVal = 0;
|
int gainVal = 0;
|
||||||
if ((i % 1024) < 300) {
|
if ((i % 1024) < 300) {
|
||||||
gainVal = 1 + iframes;
|
gainVal = randomGainValues[0];
|
||||||
} else if ((i % 1024) < 600) {
|
} else if ((i % 1024) < 600) {
|
||||||
gainVal = 2 + iframes;
|
gainVal = randomGainValues[1];
|
||||||
} else {
|
} else {
|
||||||
gainVal = 3 + iframes;
|
gainVal = randomGainValues[2];
|
||||||
}
|
}
|
||||||
int dataVal =
|
int dataVal =
|
||||||
*((uint16_t *)(imageData + i * sizeof(uint16_t)));
|
*((uint16_t *)(imageData + i * sizeof(uint16_t)));
|
||||||
@ -2851,7 +2862,7 @@ void *start_timer(void *arg) {
|
|||||||
(uint16_t)pixelVal;
|
(uint16_t)pixelVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
int srcOffset = 0;
|
int srcOffset = 0;
|
||||||
int srcOffset2 = DATA_BYTES / 2;
|
int srcOffset2 = DATA_BYTES / 2;
|
||||||
int row0 = (numInterfaces == 1 ? detPos[1] : detPos[3]);
|
int row0 = (numInterfaces == 1 ? detPos[1] : detPos[3]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user