firmware reverses slave channels

This commit is contained in:
2022-03-17 12:11:51 +01:00
parent 509946d964
commit 06281ccae9
2 changed files with 7 additions and 8 deletions

View File

@ -94,7 +94,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
void rearrangeGotthard25data(double *data); void rearrangeGotthard25data(double *data);
static const int NUM_PEDESTAL_FRAMES = 20; static const int NUM_PEDESTAL_FRAMES = 20;
static const int NUM_GOTTHARD25_CHANS = 2560; static const int NUM_GOTTHARD25_CHANS = 1280;
sls::Detector *det; sls::Detector *det;
slsDetectorDefs::detectorType detType; slsDetectorDefs::detectorType detType;

View File

@ -1156,15 +1156,14 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
void qDrawPlot::rearrangeGotthard25data(double *data) { void qDrawPlot::rearrangeGotthard25data(double *data) {
const int nChans = NUM_GOTTHARD25_CHANS; const int nChans = NUM_GOTTHARD25_CHANS;
double temp[nChans] = {0.0}; double temp[nChans * 2] = {0.0};
int nChansMod = nChans / 2; for (int i = 0; i != nChans; ++i) {
for (int i = 0; i != nChansMod; ++i) { // master module
// master module (interleave from front)
temp[i * 2] = data[i]; temp[i * 2] = data[i];
// slave module (reverse interleave) // slave module
temp[(nChansMod - 1 - i) * 2 + 1] = data[nChansMod + i]; temp[i * 2 + 1] = data[nChans + i];
} }
memcpy(data, temp, nChans * sizeof(double)); memcpy(data, temp, nChans * 2 * sizeof(double));
} }
void qDrawPlot::UpdatePlot() { void qDrawPlot::UpdatePlot() {