mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +02:00
Merge pull request #371 from slsdetectorgroup/g225gui
Gotthard25um: gui image
This commit is contained in:
commit
2a1f6dc544
@ -91,8 +91,10 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
void Update2dPlot();
|
void Update2dPlot();
|
||||||
void Update1dXYRange();
|
void Update1dXYRange();
|
||||||
void Update2dXYRange();
|
void Update2dXYRange();
|
||||||
|
void rearrangeGotthard25data(double *data);
|
||||||
|
|
||||||
static const int NUM_PEDESTAL_FRAMES = 20;
|
static const int NUM_PEDESTAL_FRAMES = 20;
|
||||||
|
static const int NUM_GOTTHARD25_CHANS = 1280;
|
||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
slsDetectorDefs::detectorType detType;
|
slsDetectorDefs::detectorType detType;
|
||||||
|
|
||||||
@ -164,4 +166,5 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
uint32_t pixelMask{0};
|
uint32_t pixelMask{0};
|
||||||
uint32_t gainMask{0};
|
uint32_t gainMask{0};
|
||||||
int gainOffset{0};
|
int gainOffset{0};
|
||||||
|
bool gotthard25;
|
||||||
};
|
};
|
||||||
|
@ -80,6 +80,10 @@ void qDrawPlot::SetupWidgetWindow() {
|
|||||||
fileSaveName = "Image";
|
fileSaveName = "Image";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gotthard25 = ((detType == slsDetectorDefs::GOTTHARD2 ||
|
||||||
|
detType == slsDetectorDefs::GOTTHARD) &&
|
||||||
|
det->size() == 2);
|
||||||
|
|
||||||
SetupPlots();
|
SetupPlots();
|
||||||
SetDataCallBack(true);
|
SetDataCallBack(true);
|
||||||
det->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack),
|
det->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack),
|
||||||
@ -807,6 +811,11 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
isGainDataExtracted = false;
|
isGainDataExtracted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// gotthard25um rearranging
|
||||||
|
if (gotthard25) {
|
||||||
|
rearrangeGotthard25data(rawData);
|
||||||
|
}
|
||||||
|
|
||||||
// title and frame index titles
|
// title and frame index titles
|
||||||
plotTitle =
|
plotTitle =
|
||||||
plotTitlePrefix + QString(data->fileName.c_str()).section('/', -1);
|
plotTitlePrefix + QString(data->fileName.c_str()).section('/', -1);
|
||||||
@ -1145,6 +1154,18 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qDrawPlot::rearrangeGotthard25data(double *data) {
|
||||||
|
const int nChans = NUM_GOTTHARD25_CHANS;
|
||||||
|
double temp[nChans * 2] = {0.0};
|
||||||
|
for (int i = 0; i != nChans; ++i) {
|
||||||
|
// master module
|
||||||
|
temp[i * 2] = data[i];
|
||||||
|
// slave module
|
||||||
|
temp[i * 2 + 1] = data[nChans + i];
|
||||||
|
}
|
||||||
|
memcpy(data, temp, nChans * 2 * sizeof(double));
|
||||||
|
}
|
||||||
|
|
||||||
void qDrawPlot::UpdatePlot() {
|
void qDrawPlot::UpdatePlot() {
|
||||||
std::lock_guard<std::mutex> lock(mPlots);
|
std::lock_guard<std::mutex> lock(mPlots);
|
||||||
LOG(logDEBUG) << "Update Plot";
|
LOG(logDEBUG) << "Update Plot";
|
||||||
|
@ -281,6 +281,13 @@ void DetectorImpl::addModule(const std::string &hostname) {
|
|||||||
|
|
||||||
// get type by connecting
|
// get type by connecting
|
||||||
detectorType type = Module::getTypeFromDetector(host, port);
|
detectorType type = Module::getTypeFromDetector(host, port);
|
||||||
|
|
||||||
|
// gotthard cannot have more than 2 modules (50um=1, 25um=2
|
||||||
|
if ((type == GOTTHARD || type == GOTTHARD2) && modules.size() > 2) {
|
||||||
|
freeSharedMemory();
|
||||||
|
throw sls::RuntimeError("Gotthard cannot have more than 2 modules");
|
||||||
|
}
|
||||||
|
|
||||||
auto pos = modules.size();
|
auto pos = modules.size();
|
||||||
modules.emplace_back(
|
modules.emplace_back(
|
||||||
sls::make_unique<Module>(type, detectorIndex, pos, false));
|
sls::make_unique<Module>(type, detectorIndex, pos, false));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user