mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
merge from 7.0.0
This commit is contained in:
@ -59,6 +59,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
void ClonePlot();
|
||||
void SavePlot();
|
||||
void SetGapPixels(bool enable);
|
||||
void UpdatePlot();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
@ -67,7 +68,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
void Zoom1DGainPlot(const QRectF &rect);
|
||||
void Zoom2DGainPlot(const QRectF &rect);
|
||||
void SetSaveFileName(QString val);
|
||||
void UpdatePlot();
|
||||
|
||||
signals:
|
||||
void AcquireFinishedSignal();
|
||||
|
@ -47,6 +47,7 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
|
||||
private:
|
||||
void SetupWidgetWindow();
|
||||
void Initialization();
|
||||
bool VerifyGapPixelsAllowed();
|
||||
void Select1DPlot(bool enable);
|
||||
void GetGapPixels();
|
||||
void GetStreamingFrequency();
|
||||
@ -60,7 +61,8 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
|
||||
|
||||
Detector *det;
|
||||
qDrawPlot *plot;
|
||||
bool is1d;
|
||||
bool is1d{false};
|
||||
bool isGapPixelsAllowed{false};
|
||||
|
||||
/** default plot and axis titles */
|
||||
static QString defaultPlotTitle;
|
||||
|
@ -180,8 +180,10 @@ void qTabDataOutput::BrowseOutputDir() {
|
||||
LOG(logDEBUG) << "Browsing output directory";
|
||||
QString directory = QFileDialog::getExistingDirectory(
|
||||
this, tr("Choose Output Directory "), dispOutputDir->text());
|
||||
if (!directory.isEmpty())
|
||||
if (!directory.isEmpty()) {
|
||||
dispOutputDir->setText(directory);
|
||||
ForceSetOutputDir();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetOutputDir(bool force) {
|
||||
|
@ -16,7 +16,7 @@ QString qTabPlot::defaultImageYAxisTitle("Pixel");
|
||||
QString qTabPlot::defaultImageZAxisTitle("Intensity");
|
||||
|
||||
qTabPlot::qTabPlot(QWidget *parent, Detector *detector, qDrawPlot *p)
|
||||
: QWidget(parent), det(detector), plot(p), is1d(false) {
|
||||
: QWidget(parent), det(detector), plot(p) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
LOG(logDEBUG) << "Plot ready";
|
||||
@ -57,11 +57,7 @@ void qTabPlot::SetupWidgetWindow() {
|
||||
chkGainPlot1D->setChecked(true);
|
||||
plot->EnableGainPlot(true);
|
||||
break;
|
||||
case slsDetectorDefs::EIGER:
|
||||
chkGapPixels->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::JUNGFRAU:
|
||||
chkGapPixels->setEnabled(true);
|
||||
chkGainPlot->setEnabled(true);
|
||||
chkGainPlot->setChecked(true);
|
||||
plot->EnableGainPlot(true);
|
||||
@ -74,6 +70,8 @@ void qTabPlot::SetupWidgetWindow() {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
isGapPixelsAllowed = VerifyGapPixelsAllowed();
|
||||
chkGapPixels->setEnabled(isGapPixelsAllowed);
|
||||
|
||||
Select1DPlot(is1d);
|
||||
Initialization();
|
||||
@ -200,6 +198,29 @@ void qTabPlot::Initialization() {
|
||||
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(isZMaxModified()));
|
||||
}
|
||||
|
||||
bool qTabPlot::VerifyGapPixelsAllowed() {
|
||||
try {
|
||||
switch (det->getDetectorType().squash()) {
|
||||
case slsDetectorDefs::JUNGFRAU:
|
||||
return true;
|
||||
case slsDetectorDefs::EIGER:
|
||||
if (det->getQuad().squash(false)) {
|
||||
return true;
|
||||
}
|
||||
// full modules
|
||||
if (det->getModuleGeometry().y % 2 == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
CATCH_DISPLAY("Could not verify if gap pixels allowed.",
|
||||
"qTabPlot::VerifyGapPixelsAllowed")
|
||||
return false;
|
||||
}
|
||||
|
||||
void qTabPlot::Select1DPlot(bool enable) {
|
||||
LOG(logDEBUG) << "Selecting " << (enable ? "1" : "2") << "D Plot";
|
||||
is1d = enable;
|
||||
@ -492,6 +513,7 @@ void qTabPlot::SetXYRange() {
|
||||
}
|
||||
|
||||
plot->SetXYRangeChanged(disablezoom, xyRange, isRange);
|
||||
plot->UpdatePlot();
|
||||
emit DisableZoomSignal(disablezoom);
|
||||
}
|
||||
|
||||
@ -629,6 +651,7 @@ void qTabPlot::SetZRange() {
|
||||
zRange[1] = val;
|
||||
}
|
||||
plot->SetZRange(zRange, isZRange);
|
||||
plot->UpdatePlot();
|
||||
}
|
||||
|
||||
void qTabPlot::GetStreamingFrequency() {
|
||||
@ -775,15 +798,10 @@ void qTabPlot::Refresh() {
|
||||
boxFrequency->setEnabled(true);
|
||||
GetStreamingFrequency();
|
||||
GetHwm();
|
||||
// gain plot, gap pixels enable
|
||||
// gain plot
|
||||
switch (det->getDetectorType().squash()) {
|
||||
case slsDetectorDefs::EIGER:
|
||||
chkGapPixels->setEnabled(true);
|
||||
GetGapPixels();
|
||||
break;
|
||||
case slsDetectorDefs::JUNGFRAU:
|
||||
chkGainPlot->setEnabled(true);
|
||||
chkGapPixels->setEnabled(true);
|
||||
GetGapPixels();
|
||||
break;
|
||||
case slsDetectorDefs::MOENCH:
|
||||
@ -795,6 +813,11 @@ void qTabPlot::Refresh() {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// gap pixels
|
||||
if (isGapPixelsAllowed) {
|
||||
chkGapPixels->setEnabled(true);
|
||||
GetGapPixels();
|
||||
}
|
||||
} else {
|
||||
boxFrequency->setEnabled(false);
|
||||
chkGainPlot->setEnabled(false);
|
||||
|
Reference in New Issue
Block a user