gotthard2: gain plot fix with clones

This commit is contained in:
2020-03-04 14:39:44 +01:00
parent 6e4a3353a3
commit 4e2f685b76
6 changed files with 16 additions and 12 deletions

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>500</width> <width>376</width>
<height>350</height> <height>425</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -240,7 +240,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>500</width> <width>376</width>
<height>28</height> <height>28</height>
</rect> </rect>
</property> </property>

View File

@ -31,6 +31,7 @@ class qDefs : public QWidget {
static const int Q_FONT_SIZE=9; static const int Q_FONT_SIZE=9;
static const int DATA_GAIN_PLOT_RATIO=5; static const int DATA_GAIN_PLOT_RATIO=5;
static const int MIN_HEIGHT_GAIN_PLOT_1D=75;
static void DisplayExceptions(std::string emsg, std::string src) { static void DisplayExceptions(std::string emsg, std::string src) {
try { try {

View File

@ -55,14 +55,22 @@ void qCloneWidget::SetupWidgetWindow(QString title) {
if (gainplot2d == nullptr) { if (gainplot2d == nullptr) {
plotLayout->addWidget(plot2d); plotLayout->addWidget(plot2d);
} else { } else {
gainplot2d->setFixedWidth(plot2d->width() / qDefs::DATA_GAIN_PLOT_RATIO);
gainplot2d->setFixedHeight(plot2d->height() / qDefs::DATA_GAIN_PLOT_RATIO);
int ratio = qDefs::DATA_GAIN_PLOT_RATIO - 1; int ratio = qDefs::DATA_GAIN_PLOT_RATIO - 1;
plotLayout->addWidget(plot2d, 0, 0, ratio, ratio); plotLayout->addWidget(plot2d, 0, 0, ratio, ratio);
plotLayout->addWidget(gainplot2d, 0, ratio, 1, 1, Qt::AlignRight | Qt::AlignTop); plotLayout->addWidget(gainplot2d, 0, ratio, 1, 1, Qt::AlignRight | Qt::AlignTop);
} }
} }
connect(actionSaveClone, SIGNAL(triggered()), this, SLOT(SavePlot())); connect(actionSaveClone, SIGNAL(triggered()), this, SLOT(SavePlot()));
this->show();
if (gainplot1d != nullptr) {
gainplot1d->setMinimumHeight(qDefs::MIN_HEIGHT_GAIN_PLOT_1D);
gainplot1d->setFixedWidth(plot1d->width());
// gainplot1d->setFixedHeight(plot1d->height() / qDefs::DATA_GAIN_PLOT_RATIO - 1);
}
if (gainplot2d != nullptr) {
gainplot2d->setFixedWidth(plot2d->width() / qDefs::DATA_GAIN_PLOT_RATIO);
gainplot2d->setFixedHeight(plot2d->height() / qDefs::DATA_GAIN_PLOT_RATIO);
}
} }
void qCloneWidget::DisplayStats(bool enable, QString min, QString max, QString sum) { void qCloneWidget::DisplayStats(bool enable, QString min, QString max, QString sum) {

View File

@ -561,14 +561,9 @@ void qDrawPlot::ClonePlot() {
} }
} }
qCloneWidget* q = new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D, new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D,
clonegainplot2D, boxPlot->title(), fileSavePath, fileSaveName, currentAcqIndex, clonegainplot2D, boxPlot->title(), fileSavePath, fileSaveName, currentAcqIndex,
displayStatistics, lblMinDisp->text(), lblMaxDisp->text(), lblSumDisp->text()); displayStatistics, lblMinDisp->text(), lblMaxDisp->text(), lblSumDisp->text());
q->show();
if (clonegainplot1D != nullptr) {
clonegainplot1D->setFixedWidth(cloneplot1D->width());
//clonegainplot1D->setFixedHeight(cloneplot1D->height());// / qDefs::DATA_GAIN_PLOT_RATIO - 1);
}
} }
void qDrawPlot::SavePlot() { void qDrawPlot::SavePlot() {

View File

@ -8,5 +8,5 @@
#define APIRECEIVER 0x200227 #define APIRECEIVER 0x200227
#define APIGUI 0x200227 #define APIGUI 0x200227
#define APICTB 0x200227 #define APICTB 0x200227
#define APIGOTTHARD2 0x200304
#define APIMOENCH 0x200304 #define APIMOENCH 0x200304
#define APIGOTTHARD2 0x200304