Exemplo n.º 1
0
        void onCreate( SpinSlider * pThis ) {

            auto gridLayout = new QGridLayout( pThis );

            if ( orientation_ == Qt::Horizontal ) {
                gridLayout->setHorizontalSpacing(6);
                gridLayout->setVerticalSpacing(2);
            } else {
                gridLayout->setHorizontalSpacing(2);
                gridLayout->setVerticalSpacing(2);
            }
            onCreate( gridLayout, 0, 0, pThis );
        }
void MAbstractLayoutPolicy::applyStyle()
{
    Q_D(MAbstractLayoutPolicy);
    //Do not change the margins if the user manually set them or the margins
    //have not changed

    d->disableInvalidateLayoutAndPolicy = true;

    if (!d->userSetContentsMargins &&
            (d->marginLeft != (int)d->style->marginLeft() ||
             d->marginTop != (int)d->style->marginTop() ||
             d->marginRight != (int)d->style->marginRight() ||
             d->marginBottom != (int)d->style->marginBottom())) {
        d->marginLeft = (int)d->style->marginLeft();
        d->marginTop = (int)d->style->marginTop();
        d->marginRight = (int)d->style->marginRight();
        d->marginBottom = (int)d->style->marginBottom();
        invalidatePolicyAndLayout();
    }

    if (!d->userSetHorizontalSpacing) {
        setHorizontalSpacing(d->style->horizontalSpacing()); //This is a virtual function so we have to call it so that subclasses receive this
        d->userSetHorizontalSpacing = false;
    }

    if (!d->userSetVerticalSpacing) {
        setVerticalSpacing(d->style->verticalSpacing()); //This is a virtual function so we have to call it so that subclasses receive this
        d->userSetVerticalSpacing = false;
    }

    d->disableInvalidateLayoutAndPolicy = false;
    if (d->layoutInvalidateCalledWhileDisabled) {
        invalidatePolicyAndLayout();
    }
}
Exemplo n.º 3
0
QgsDetailedItemDelegate::QgsDetailedItemDelegate( QObject * parent ) :
    QAbstractItemDelegate( parent ),
    mpWidget( new QgsDetailedItemWidget() ),
    mpCheckBox( new QCheckBox() )

{
  //mpWidget->setFixedHeight(80);
  mpCheckBox->resize( mpCheckBox->sizeHint().height(), mpCheckBox->sizeHint().height() );
  setVerticalSpacing( 3 );
  setHorizontalSpacing( 5 );
}
void MAbstractLayoutPolicy::setSpacing(qreal spacing)
{
    Q_D(MAbstractLayoutPolicy);
    d->disableInvalidateLayoutAndPolicy = true;

    setHorizontalSpacing(spacing);
    setVerticalSpacing(spacing);

    d->disableInvalidateLayoutAndPolicy = false;
    if (d->layoutInvalidateCalledWhileDisabled)
        invalidatePolicyAndLayout();
}
int QFormLayout::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QLayout::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< FieldGrowthPolicy*>(_v) = fieldGrowthPolicy(); break;
        case 1: *reinterpret_cast< RowWrapPolicy*>(_v) = rowWrapPolicy(); break;
        case 2: *reinterpret_cast< Qt::Alignment*>(_v) = labelAlignment(); break;
        case 3: *reinterpret_cast< Qt::Alignment*>(_v) = formAlignment(); break;
        case 4: *reinterpret_cast< int*>(_v) = horizontalSpacing(); break;
        case 5: *reinterpret_cast< int*>(_v) = verticalSpacing(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setFieldGrowthPolicy(*reinterpret_cast< FieldGrowthPolicy*>(_v)); break;
        case 1: setRowWrapPolicy(*reinterpret_cast< RowWrapPolicy*>(_v)); break;
        case 2: setLabelAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break;
        case 3: setFormAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break;
        case 4: setHorizontalSpacing(*reinterpret_cast< int*>(_v)); break;
        case 5: setVerticalSpacing(*reinterpret_cast< int*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        switch (_id) {
        case 0: resetFieldGrowthPolicy(); break;
        case 1: resetRowWrapPolicy(); break;
        case 2: resetLabelAlignment(); break;
        case 3: resetFormAlignment(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemplo n.º 6
0
void EmojiWidget::showCategory(const QString &category)
{
    if (scrollArea->widget()->layout()) {
        auto gridLayout = qobject_cast<QGridLayout *>(scrollArea->widget()->layout());
        clearLayout(gridLayout);
        delete gridLayout;
    }

    scrollArea->verticalScrollBar()->setValue(0); // scrool to top

    auto gridLayout = new QGridLayout();
    gridLayout->setContentsMargins(0, 0, 0, 0);
    gridLayout->setHorizontalSpacing(0);
    gridLayout->setVerticalSpacing(0);
    scrollArea->widget()->setLayout(gridLayout);

    int maxCollumns = (width() - scrollArea->verticalScrollBar()->width())/BUTTONS_SIZE;

    QList<Emoji> emojis = emojiManager->getByCategory(category);

    uint index = 0;

    for (const Emoji &emoji : emojis) {
        auto button = new QToolButton();
        button->setIcon(QPixmap(emojiManager->getEmojiIconUrl(emoji)));
        button->setIconSize(QSize(EmojiManager::ICONS_SIZE, EmojiManager::ICONS_SIZE));
        button->setMinimumSize(QSize(EmojiWidget::BUTTONS_SIZE, EmojiWidget::BUTTONS_SIZE));
        QString toolTip = QString(emoji.name).replace(QChar('_'), QString(" "));
        button->setToolTip(toolTip);

        connect(button, &QToolButton::clicked, [=](){
            emojiManager->addRecent(emoji.unifiedCode);

            emit emojiSelected(emoji.unifiedCode);

            recentButton->setEnabled(emojiManager->hasRecents());
        });

        uint row = index / maxCollumns;
        uint collumn = index % maxCollumns;
        gridLayout->addWidget(button, row, collumn, 1, 1, Qt::AlignTop);

        index++;
    }

    scrollArea->widget()->updateGeometry();
    scrollArea->updateGeometry();
}
Exemplo n.º 7
0
TimeLagSettingsDialog::TimeLagSettingsDialog(QWidget *parent, EcProject *ecProject, ConfigState* config) :
    QDialog(parent),
    ecProject_(ecProject),
    configState_(config)
{
    setWindowModality(Qt::WindowModal);
    setWindowTitle(tr("Time Lag Optimization Settings"));
    WidgetUtils::removeContextHelpButton(this);

    auto groupTitle = new QLabel;
    groupTitle->setText(tr("Configure smart time lag detection, "
                           "providing quality selection criteria and initial "
                           "time lag windows"));

    auto hrLabel = new QLabel;
    hrLabel->setObjectName(QStringLiteral("hrLabel"));

    existingRadio = new QRadioButton(tr("Time lag file available : "));
    existingRadio->setToolTip(tr("<b>Time lag file available:</b> If you have a satisfactory time lag assessment from a previous run and it applies to the current dataset, you can use it by providing the path to the file 'eddypro_timelag_opt_ID.txt' that was generated by EddyPro in the previous run and contains the results of the assessment. This will shorten program execution time and assure full comparability between the current and previous results."));

    nonExistingRadio = new QRadioButton(tr("Time lag file not available :"));
    nonExistingRadio->setToolTip(tr("<b>Time lag file not available:</b> Choose this option and provide the following information if you need to optimize time lags for your dataset. EddyPro will complete the time lag optimization first and then complete the raw data processing and flux computation procedures."));

    subsetCheckBox = new QCheckBox;
    subsetCheckBox->setProperty("subperiod", true);
    subsetCheckBox->setText(tr("Select a different period"));
    subsetCheckBox->setToolTip(tr("<b>Select a different period:</b> Select this option and set the corresponding dates, to identify the time period EddyPro will use for the Time lag optimization. This subperiod must fall within the time period defined by the available raw data."));

    startDateLabel = new ClickLabel(this);
    startDateLabel->setText(tr("Start :"));
    startDateLabel->setToolTip(tr("<b>Start:</b> Starting date of the time period to be used for time lag optimization. This time should not be shorter than about 1-2 months. As a general recommendation, select a time period during which the instrument setup did not undergo major modifications. Results obtained using a given time period (e.g., 2 months) can be used for processing a longer time period, in which major modifications did not occur in the setup. The stricter the threshold setup in this dialogue, the longer the period should be in order to get robust results."));
    startDateEdit = new QDateEdit;
    startDateEdit->setToolTip(startDateLabel->toolTip());
    startDateEdit->setCalendarPopup(true);
    WidgetUtils::customizeCalendar(startDateEdit->calendarWidget());

    startTimeEdit = new QTimeEdit;
    startTimeEdit->setDisplayFormat(QStringLiteral("hh:mm"));
    startTimeEdit->setAccelerated(true);

    lockedIcon = new QLabel;
    auto pixmap = QPixmap(QStringLiteral(":/icons/vlink-locked"));
#if defined(Q_OS_MAC)
    pixmap.setDevicePixelRatio(2.0);
#endif
    lockedIcon->setPixmap(pixmap);

    endDateLabel = new ClickLabel(this);
    endDateLabel->setText(tr("End :"));
    endDateLabel->setToolTip(tr("<b>End:</b> End date of the time period to be used for time lag optimization. This time should not be shorter than about 1-2 months As a general recommendation, select a time period during which the instrumental setup did not undergo major modifications. Results obtained using a given time period (e.g., 2 months) can be used for processing a longer time period, in which major modifications did not occur in the setup. The stricter the threshold setup in this dialogue, the longer the period should be in order to get robust results."));
    endDateEdit = new QDateEdit;
    endDateEdit->setToolTip(endDateLabel->toolTip());
    endDateEdit->setCalendarPopup(true);
    WidgetUtils::customizeCalendar(endDateEdit->calendarWidget());

    endTimeEdit = new QTimeEdit;
    endTimeEdit->setDisplayFormat(QStringLiteral("hh:mm"));
    endTimeEdit->setAccelerated(true);

    auto dateTimeContainer = new QGridLayout;
    dateTimeContainer->addWidget(startDateEdit, 0, 1);
    dateTimeContainer->addWidget(startTimeEdit, 0, 2);
    dateTimeContainer->addWidget(lockedIcon, 0, 0, 2, 1);
    dateTimeContainer->addWidget(endDateEdit, 1, 1);
    dateTimeContainer->addWidget(endTimeEdit, 1, 2);
    dateTimeContainer->setColumnStretch(1, 1);
    dateTimeContainer->setColumnStretch(2, 1);
    dateTimeContainer->setColumnStretch(3, 2);
    dateTimeContainer->setContentsMargins(0, 0, 0, 0);
    dateTimeContainer->setVerticalSpacing(3);

    fileBrowse = new FileBrowseWidget;
    fileBrowse->setToolTip(tr("<b>Load:</b> Load an existing time lag file"));
    fileBrowse->setDialogTitle(tr("Select the Time Lag Optimization File"));
    fileBrowse->setDialogWorkingDir(WidgetUtils::getSearchPathHint());
    fileBrowse->setDialogFilter(tr("All Files (*.*)"));

    auto existingFileLayout = new QHBoxLayout;
    existingFileLayout->addWidget(existingRadio);
    existingFileLayout->addWidget(fileBrowse);
    existingFileLayout->setStretch(2, 1);
    existingFileLayout->setContentsMargins(0, 0, 0, 0);
    existingFileLayout->setSpacing(0);

    radioGroup = new QButtonGroup(this);
    radioGroup->addButton(existingRadio, 0);
    radioGroup->addButton(nonExistingRadio, 1);

    h2oTitleLabel = WidgetUtils::createBlueLabel(this, tr("Water vapor time lag as a function of relative humidity"));

    pgRangeLabel = new ClickLabel(tr("Plausibility range around median value :"));
    pgRangeLabel->setToolTip(tr("<b>Plausibility range around median value:</b> The plausibility range is defined as the median time lag, %1 <i>n</i> times the MAD (median of the absolute deviations from the median time lag). Specify <i>n</i> here. The value of 1.5 was heuristically found to be optimal.").arg(Defs::PLUSMINUS));
    pgRangeSpin = new QDoubleSpinBox;
    pgRangeSpin->setDecimals(1);
    pgRangeSpin->setRange(0.1, 100.0);
    pgRangeSpin->setSingleStep(0.1);
    pgRangeSpin->setAccelerated(true);
    pgRangeSpin->setSuffix(tr("  [mad]"));
    pgRangeSpin->setToolTip(pgRangeLabel->toolTip());
    pgRangeLabel_2 = new QLabel(tr("(<tt>%1%2n%3mad</tt>, where you set <tt>n</tt>)").arg(Defs::MICRO, Defs::PLUSMINUS, Defs::MID_DOT));

    rhClassLabel = new ClickLabel(tr("Number of RH classes :"));
    rhClassLabel->setToolTip(tr("<b>Number of RH classes:</b> Select the number or relative humidity classes, to assess water vapor time lag as a function of RH. The whole range or RH variation (0-100%) will be evenly divided according to the selected number of classes. For example, selecting 10 classes causes EddyPro to assess water vapor time lags for the classes 0-10%, 10-20%,..., 90-100%. Selecting 1 class, the label <b><i>Do not sort in RH classes</i></b> appears and will cause EddyPro to treat water vapor exactly like other passive gases. This option is only suitable for open path systems, or closed path systems with short and heated sampling lines."));

    rhClassSpin = new QSpinBox;
    rhClassSpin->setRange(1, 20);
    rhClassSpin->setSingleStep(1);
    rhClassSpin->setAccelerated(true);
    rhClassSpin->setSpecialValueText(tr("Do not sort in RH classes"));
    rhClassSpin->setToolTip(rhClassLabel->toolTip());

    gasTitleLabel = WidgetUtils::createBlueLabel(this, tr("Passive gases"));

    co2MinFluxLabel = new ClickLabel(tr("Minimum (absolute) %1 flux :").arg(Defs::CO2_STRING));
    co2MinFluxLabel->setToolTip(tr("<b>Minimum (absolute) %1 flux:</b> %1 time lags corresponding to fluxes smaller (in module) than this value will not be considered in the time lag optimization. Selecting high-enough fluxes assures that well developed turbulent conditions are met and the correlation function is well characterized.").arg(Defs::CO2_STRING));
    co2MinFluxSpin = new QDoubleSpinBox;
    co2MinFluxSpin->setDecimals(3);
    co2MinFluxSpin->setRange(0.0, 100.0);
    co2MinFluxSpin->setSingleStep(0.001);
    co2MinFluxSpin->setAccelerated(true);
    co2MinFluxSpin->setSuffix(tr("  [%1]").arg(Defs::UMOL_M2S_STRING));
    co2MinFluxSpin->setToolTip(co2MinFluxLabel->toolTip());

    ch4MinFluxLabel = new ClickLabel(tr("Minimum (absolute) %1 flux :").arg(Defs::CH4_STRING));
    ch4MinFluxLabel->setToolTip(tr("<b>Minimum (absolute) %1 flux:</b> %1 time lags corresponding to fluxes smaller (in module) than this value will not be considered in the time lag optimization. Selecting high-enough fluxes assures that well developed turbulent conditions are met and the correlation function is well characterized.").arg(Defs::CH4_STRING));
    ch4MinFluxSpin = new QDoubleSpinBox;
    ch4MinFluxSpin->setDecimals(3);
    ch4MinFluxSpin->setRange(0.0, 100.0);
    ch4MinFluxSpin->setSingleStep(0.001);
    ch4MinFluxSpin->setAccelerated(true);
    ch4MinFluxSpin->setSuffix(tr("  [%1]").arg(Defs::UMOL_M2S_STRING));
    ch4MinFluxSpin->setToolTip(ch4MinFluxLabel->toolTip());

    gas4MinFluxLabel = new ClickLabel(tr("Minimum (absolute) %1 gas flux :").arg(Defs::GAS4_STRING));
    gas4MinFluxLabel->setToolTip(tr("<b>Minimum (absolute) %1 gas flux:</b> %1 gas time lags corresponding to fluxes smaller (in module) than this value will not be considered in the time lag optimization. Selecting high-enough fluxes assures that well developed turbulent conditions are met and the correlation function is well characterized.").arg(Defs::GAS4_STRING));
    gas4MinFluxSpin = new QDoubleSpinBox;
    gas4MinFluxSpin->setDecimals(3);
    gas4MinFluxSpin->setRange(0.0, 100.0);
    gas4MinFluxSpin->setSingleStep(0.001);
    gas4MinFluxSpin->setAccelerated(true);
    gas4MinFluxSpin->setSuffix(tr("  [%1]").arg(Defs::UMOL_M2S_STRING));
    gas4MinFluxSpin->setToolTip(gas4MinFluxLabel->toolTip());

    leMinFluxLabel = new ClickLabel(tr("Minimum latent heat flux :"));
    leMinFluxLabel->setToolTip(tr("<b>Minimum latent heat flux:</b> Minimum latent heat flux: H<sub>2</sub>O time lags corresponding to latent heat fluxes smaller than this value will not be considered in the time lag optimization. Selecting high-enough fluxes assures that well developed turbulent conditions are met and the correlation function is well characterized."));
    leMinFluxSpin = new QDoubleSpinBox;
    leMinFluxSpin->setDecimals(1);
    leMinFluxSpin->setRange(0.0, 1000.0);
    leMinFluxSpin->setSingleStep(0.1);
    leMinFluxSpin->setAccelerated(true);
    leMinFluxSpin->setSuffix(tr("  [%1]").arg(Defs::W_M2_STRING));
    leMinFluxSpin->setToolTip(leMinFluxLabel->toolTip());

    searchWindowLabel = WidgetUtils::createBlueLabel(this, tr("Time lag searching windows"));

    minLabel = WidgetUtils::createBlueLabel(this, tr("Minimum"));
    minLabel->setToolTip(tr("<b>Minimum:</b> Minimum time lag for each gas, for initializing the time lag optimization procedure. The searching window defined by Minimum and Maximum should be large enough to accommodate all possible time lags. Leave as <i>Not set</i> if in doubt, EddyPro will initialize it automatically."));

    maxLabel = WidgetUtils::createBlueLabel(this, tr("Maximum"));
    maxLabel->setToolTip(tr("<b>Maximum:</b> Maximum time lag for each gas, for initializing the time lag optimization procedure. The searching window defined by Minimum and Maximum should be large enough to accommodate all possible time lags. In particular, maximum time lags of water vapor in closed path systems can up to ten times higher than its nominal value, or even higher. Leave as <i>Not set</i> if in doubt, EddyPro will initialize it automatically."));

    co2Label = new ClickLabel(tr("%1 :").arg(Defs::CO2_STRING));

    minCo2TlSpin = new QDoubleSpinBox;
    minCo2TlSpin->setDecimals(1);
    minCo2TlSpin->setRange(-1000.1, 1000.0);
    minCo2TlSpin->setSingleStep(0.1);
    minCo2TlSpin->setSpecialValueText(tr("Detect automatically"));
    minCo2TlSpin->setAccelerated(true);
    minCo2TlSpin->setSuffix(tr("  [s]"));
    minCo2TlSpin->setToolTip(minLabel->toolTip());

    maxCo2TlSpin = new QDoubleSpinBox;
    maxCo2TlSpin->setDecimals(1);
    maxCo2TlSpin->setRange(-1000.1, 1000.0);
    maxCo2TlSpin->setSingleStep(0.1);
    maxCo2TlSpin->setSpecialValueText(tr("Detect automatically"));
    maxCo2TlSpin->setAccelerated(true);
    maxCo2TlSpin->setSuffix(tr("  [s]"));
    maxCo2TlSpin->setToolTip(maxLabel->toolTip());

    h2oLabel = new ClickLabel(tr("%1 :").arg(Defs::H2O_STRING));

    minH2oTlSpin = new QDoubleSpinBox;
    minH2oTlSpin->setDecimals(1);
    minH2oTlSpin->setRange(-1000.1, 1000.0);
    minH2oTlSpin->setSingleStep(0.1);
    minH2oTlSpin->setSpecialValueText(tr("Detect automatically"));
    minH2oTlSpin->setAccelerated(true);
    minH2oTlSpin->setSuffix(tr("  [s]"));
    minH2oTlSpin->setToolTip(minLabel->toolTip());

    maxH2oTlSpin = new QDoubleSpinBox;
    maxH2oTlSpin->setDecimals(1);
    maxH2oTlSpin->setRange(-1000.1, 1000.0);
    maxH2oTlSpin->setSingleStep(0.1);
    maxH2oTlSpin->setSpecialValueText(tr("Detect automatically"));
    maxH2oTlSpin->setAccelerated(true);
    maxH2oTlSpin->setSuffix(tr("  [s]"));
    maxH2oTlSpin->setToolTip(maxLabel->toolTip());

    ch4Label = new ClickLabel(tr("%1 :").arg(Defs::CH4_STRING));

    minCh4TlSpin = new QDoubleSpinBox;
    minCh4TlSpin->setDecimals(1);
    minCh4TlSpin->setRange(-1000.1, 1000.0);
    minCh4TlSpin->setSingleStep(0.1);
    minCh4TlSpin->setSpecialValueText(tr("Detect automatically"));
    minCh4TlSpin->setAccelerated(true);
    minCh4TlSpin->setSuffix(tr("  [s]"));
    minCh4TlSpin->setToolTip(minLabel->toolTip());

    maxCh4TlSpin = new QDoubleSpinBox;
    maxCh4TlSpin->setDecimals(1);
    maxCh4TlSpin->setRange(-1000.1, 1000.0);
    maxCh4TlSpin->setSingleStep(0.1);
    maxCh4TlSpin->setSpecialValueText(tr("Detect automatically"));
    maxCh4TlSpin->setAccelerated(true);
    maxCh4TlSpin->setSuffix(tr("  [s]"));
    maxCh4TlSpin->setToolTip(maxLabel->toolTip());

    gas4Label = new ClickLabel(tr("%1 gas :").arg(Defs::GAS4_STRING));

    minGas4TlSpin = new QDoubleSpinBox;
    minGas4TlSpin->setDecimals(1);
    minGas4TlSpin->setRange(-1000.1, 1000.0);
    minGas4TlSpin->setSingleStep(0.1);
    minGas4TlSpin->setSpecialValueText(tr("Detect automatically"));
    minGas4TlSpin->setAccelerated(true);
    minGas4TlSpin->setSuffix(tr("  [s]"));
    minGas4TlSpin->setToolTip(minLabel->toolTip());

    maxGas4TlSpin = new QDoubleSpinBox;
    maxGas4TlSpin->setDecimals(1);
    maxGas4TlSpin->setRange(-1000.1, 1000.0);
    maxGas4TlSpin->setSingleStep(0.1);
    maxGas4TlSpin->setSpecialValueText(tr("Detect automatically"));
    maxGas4TlSpin->setAccelerated(true);
    maxGas4TlSpin->setSuffix(tr("  [s]"));
    maxGas4TlSpin->setToolTip(maxLabel->toolTip());

    auto propertiesLayout = new QGridLayout;
    propertiesLayout->addLayout(existingFileLayout, 0, 0, 1, -1);
    propertiesLayout->addWidget(nonExistingRadio, 1, 0);
    propertiesLayout->addWidget(subsetCheckBox, 1, 1, 1, 1, Qt::AlignLeft);
    propertiesLayout->addWidget(startDateLabel, 1, 1, Qt::AlignRight);
    propertiesLayout->addLayout(dateTimeContainer, 1, 2, 2, 1);
    propertiesLayout->addWidget(endDateLabel, 2, 1, Qt::AlignRight);
    propertiesLayout->addWidget(pgRangeLabel, 3, 1, 1, 1, Qt::AlignRight);
    propertiesLayout->addWidget(pgRangeSpin, 3, 2);
    propertiesLayout->addWidget(pgRangeLabel_2, 3, 3);

    propertiesLayout->addWidget(h2oTitleLabel, 4, 0, 1, 2);

    propertiesLayout->addWidget(rhClassLabel, 5, 1, Qt::AlignRight);
    propertiesLayout->addWidget(rhClassSpin, 5, 2);
    propertiesLayout->addWidget(leMinFluxLabel, 6, 1, Qt::AlignRight);
    propertiesLayout->addWidget(leMinFluxSpin, 6, 2);

    propertiesLayout->addWidget(gasTitleLabel, 7, 0);

    propertiesLayout->addWidget(co2MinFluxLabel, 8, 1, Qt::AlignRight);
    propertiesLayout->addWidget(co2MinFluxSpin, 8, 2);
    propertiesLayout->addWidget(ch4MinFluxLabel, 9, 1, Qt::AlignRight);
    propertiesLayout->addWidget(ch4MinFluxSpin, 9, 2);
    propertiesLayout->addWidget(gas4MinFluxLabel, 10, 1, Qt::AlignRight);
    propertiesLayout->addWidget(gas4MinFluxSpin, 10, 2);

    propertiesLayout->addWidget(searchWindowLabel, 11, 0);
    propertiesLayout->addWidget(minLabel, 12, 1);
    propertiesLayout->addWidget(maxLabel, 12, 2);
    propertiesLayout->addWidget(co2Label, 13, 0, Qt::AlignRight);
    propertiesLayout->addWidget(minCo2TlSpin, 13, 1);
    propertiesLayout->addWidget(maxCo2TlSpin, 13, 2);
    propertiesLayout->addWidget(h2oLabel, 14, 0, Qt::AlignRight);
    propertiesLayout->addWidget(minH2oTlSpin, 14, 1);
    propertiesLayout->addWidget(maxH2oTlSpin, 14, 2);
    propertiesLayout->addWidget(ch4Label, 15, 0, Qt::AlignRight);
    propertiesLayout->addWidget(minCh4TlSpin, 15, 1);
    propertiesLayout->addWidget(maxCh4TlSpin, 15, 2);
    propertiesLayout->addWidget(gas4Label, 16, 0, Qt::AlignRight);
    propertiesLayout->addWidget(minGas4TlSpin, 16, 1);
    propertiesLayout->addWidget(maxGas4TlSpin, 16, 2);
    propertiesLayout->setVerticalSpacing(3);
    propertiesLayout->setRowMinimumHeight(2, 10);
    propertiesLayout->setContentsMargins(3, 3, 3, 3);

    auto propertiesFrame = new QWidget;
    propertiesFrame->setLayout(propertiesLayout);
    propertiesFrame->setMinimumWidth(propertiesFrame->sizeHint().width());

    auto okButton = WidgetUtils::createCommonButton(this, tr("Ok"));

    auto mainLayout = new QGridLayout(this);
    mainLayout->addWidget(groupTitle, 0, 0);
    mainLayout->addWidget(hrLabel, 1, 0);
    mainLayout->addWidget(propertiesFrame, 2, 0);
    mainLayout->addWidget(okButton, 3, 0, 1, 1, Qt::AlignCenter);
    mainLayout->setVerticalSpacing(10);
    mainLayout->setContentsMargins(30, 30, 30, 30);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);
    setLayout(mainLayout);

    connect(radioGroup, SIGNAL(buttonClicked(int)),
            this, SLOT(updateTlMode(int)));

    connect(radioGroup, SIGNAL(buttonClicked(int)),
            this, SLOT(radioClicked(int)));

    connect(fileBrowse, &FileBrowseWidget::pathChanged,
            this, &TimeLagSettingsDialog::updateFile);
    connect(fileBrowse, &FileBrowseWidget::pathSelected,
        this, &TimeLagSettingsDialog::testSelectedFile);

    connect(subsetCheckBox, &QCheckBox::toggled,
            this, &TimeLagSettingsDialog::updateSubsetSelection);

    connect(startDateLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onStartDateLabelClicked);
    connect(startDateEdit, &QDateEdit::dateChanged,
            this, &TimeLagSettingsDialog::updateStartDate);
    connect(startTimeEdit, &QTimeEdit::timeChanged,
            this, &TimeLagSettingsDialog::updateStartTime);

    connect(endDateLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onEndDateLabelClicked);
    connect(endDateEdit, &QDateEdit::dateChanged,
            this, &TimeLagSettingsDialog::updateEndDate);
    connect(endTimeEdit, &QTimeEdit::timeChanged,
            this, &TimeLagSettingsDialog::updateEndTime);

    connect(rhClassLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onRhClassClicked);
    connect(rhClassSpin, SIGNAL(valueChanged(int)),
            this, SLOT(updateRhClass(int)));

    connect(co2MinFluxLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onCo2MinFluxClicked);
    connect(co2MinFluxSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateCo2MinFlux(double)));

    connect(ch4MinFluxLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onCh4MinFluxClicked);
    connect(ch4MinFluxSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateCh4MinFlux(double)));

    connect(gas4MinFluxLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onGas4MinFluxClicked);
    connect(gas4MinFluxSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateGas4MinFlux(double)));

    connect(leMinFluxLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onLeMinFluxClicked);
    connect(leMinFluxSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateLeMinFlux(double)));

    connect(pgRangeLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onPgRangeLabelClicked);
    connect(pgRangeSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updatePgRange(double)));

    connect(co2Label, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onCo2LabelClicked);
    connect(minCo2TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMinCo2Tl(double)));
    connect(maxCo2TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMaxCo2Tl(double)));

    connect(h2oLabel, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onH2oLabelClicked);
    connect(minH2oTlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMinH2oTl(double)));
    connect(maxH2oTlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMaxH2oTl(double)));

    connect(ch4Label, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onCh4LabelClicked);
    connect(minCh4TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMinCh4Tl(double)));
    connect(maxCh4TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMaxCh4Tl(double)));

    connect(gas4Label, &ClickLabel::clicked,
            this, &TimeLagSettingsDialog::onGas4LabelClicked);
    connect(minGas4TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMinGas4Tl(double)));
    connect(maxGas4TlSpin, SIGNAL(valueChanged(double)),
            this, SLOT(updateMaxGas4Tl(double)));

    connect(okButton, &QPushButton::clicked,
            this, &TimeLagSettingsDialog::close);

    // init
    forceEndDatePolicy();
    forceEndTimePolicy();
}
Exemplo n.º 8
0
BinarySettingsDialog::BinarySettingsDialog(QWidget* parent, EcProject *ecProject)
    : QDialog(parent),
    ecProject_(ecProject)
{
    setWindowModality(Qt::WindowModal);
    setWindowTitle(tr("Generic Binary File Settings"));
    WidgetUtils::removeContextHelpButton(this);

    auto groupTitle = new QLabel;
    groupTitle->setText(tr("Please provide details of your binary format."));

    auto hrLabel = new QLabel;
    hrLabel->setObjectName(QStringLiteral("hrLabel"));

    binaryHLinesLabel = new ClickLabel(tr("Number of ASCII header lines :"));
    binaryHLinesLabel->setToolTip(tr("<b>Number of ASCII header lines:</b> Enter the number of ASCII (readable text) header lines present at the beginning of your binary files. Enter 0 if there is no ASCII header."));
    binaryHLinesSpin = new QSpinBox(this);
    binaryHLinesSpin->setRange(-1, 100);
    binaryHLinesSpin->setSingleStep(1);
    binaryHLinesSpin->setSpecialValueText(tr("Not set"));
    binaryHLinesSpin->setAccelerated(true);
    binaryHLinesSpin->setToolTip(binaryHLinesLabel->toolTip());

    qDebug() << "binaryHLinesSpin 1" << binaryHLinesSpin->focusPolicy();

    binaryEolLabel = new ClickLabel(tr("ASCII header end of line :"));
    binaryEolLabel->setToolTip(tr("<b>ASCII header end of line:</b> If an ASCII header is present in the files, specify the line terminator. Typically, Windows OS uses <i>CR+LF</i> (0x0D+0x0A), Linux OS and Mac OS X use <i>LF</i> (0x0A), while Mac OS up to version 9 and OS-9 use <i>CR</i> (0x0D)."));
    binaryEolCombo = new QComboBox;
    binaryEolCombo->addItem(tr("CR+LF"));
    binaryEolCombo->addItem(tr("CR"));
    binaryEolCombo->addItem(tr("LF"));
    binaryEolCombo->setToolTip(binaryEolLabel->toolTip());

    binaryNBytesLabel = new ClickLabel(tr("Number of bytes per variable :"));
    binaryNBytesLabel->setToolTip(tr("<b>Number of bytes per variable:</b> Specify the number of bytes reserved for each variable stored as a single precision number. Typically 2 bytes are reserved for each number."));
    binaryNBytesSpin = new QSpinBox(this);
    binaryNBytesSpin->setRange(0, 8);
    binaryNBytesSpin->setSingleStep(1);
    binaryNBytesSpin->setSpecialValueText(tr("Not set"));
    binaryNBytesSpin->setAccelerated(true);
    binaryNBytesSpin->setToolTip(binaryNBytesLabel->toolTip());

    binaryEndianessLabel = new ClickLabel(tr("Endianess :"));
    binaryEndianessLabel->setToolTip(tr("<b>Endianess:</b> In a multi-bytes binary word, <i>Little endian</i> means that the most significant byte is the last byte (highest address); <i>Big endian</i> means that the most significant byte is the first byte (lowest address)."));
    binaryEndianessCombo = new QComboBox;
    binaryEndianessCombo->addItem(tr("Big endian"));
    binaryEndianessCombo->addItem(tr("Little endian"));
    binaryEndianessCombo->setMinimumWidth(10);
    binaryEndianessCombo->setToolTip(binaryEndianessLabel->toolTip());

    auto binPropertiesLayout = new QGridLayout;
    binPropertiesLayout->addWidget(binaryHLinesLabel, 0, 0, 1, 1, Qt::AlignRight);
    binPropertiesLayout->addWidget(binaryHLinesSpin, 0, 1);
    binPropertiesLayout->addWidget(binaryEolLabel, 1, 0, 1, 1, Qt::AlignRight);
    binPropertiesLayout->addWidget(binaryEolCombo, 1, 1);
    binPropertiesLayout->addWidget(binaryNBytesLabel, 2, 0, 1, 1, Qt::AlignRight);
    binPropertiesLayout->addWidget(binaryNBytesSpin, 2, 1);
    binPropertiesLayout->addWidget(binaryEndianessLabel, 3, 0, 1, 1, Qt::AlignRight);
    binPropertiesLayout->addWidget(binaryEndianessCombo, 3, 1);
    binPropertiesLayout->setVerticalSpacing(3);
    binPropertiesLayout->setContentsMargins(3, 3, 3, 3);

    auto binPropertiesWidget = new QWidget;
    binPropertiesWidget->setLayout(binPropertiesLayout);

    auto okButton = WidgetUtils::createCommonButton(this, tr("Ok"));

    auto mainLayout = new QGridLayout(this);
    mainLayout->addWidget(groupTitle, 0, 0);
    mainLayout->addWidget(hrLabel, 1, 0);
    mainLayout->addWidget(binPropertiesWidget, 2, 0);
    mainLayout->addWidget(okButton, 3, 0, 1, 1, Qt::AlignCenter);
    mainLayout->setVerticalSpacing(10);
    mainLayout->setContentsMargins(30, 30, 30, 30);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);
    setLayout(mainLayout);

    connect(binaryHLinesLabel, &ClickLabel::clicked,
            this, &BinarySettingsDialog::onBinaryHLinesLabelClicked);
    connect(binaryHLinesSpin, SIGNAL(valueChanged(int)),
            this, SLOT(updateBinaryHLine(int)));

    connect(binaryEolLabel, &ClickLabel::clicked,
            this, &BinarySettingsDialog::onBinaryClickEolLabel);
    connect(binaryEolCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(updateBinaryEol(int)));

    connect(binaryNBytesLabel, &ClickLabel::clicked,
            this, &BinarySettingsDialog::onBinaryNBytesLabelClicked);
    connect(binaryNBytesSpin, SIGNAL(valueChanged(int)),
            this, SLOT(updateBinaryNBytes(int)));

    connect(binaryEndianessLabel, &ClickLabel::clicked,
            this, &BinarySettingsDialog::onBinaryClickEndianessLabel);
    connect(binaryEndianessCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(updateBinaryEndianess(int)));

    connect(okButton, &QPushButton::clicked,
            this, &BinarySettingsDialog::close);
}
Exemplo n.º 9
0
CalibrationDialog::CalibrationDialog(QWidget* parent, EcProject *ecProject, ConfigState* config) :
    QDialog(parent),
    ecProject_(ecProject),
    configState_(config)
{
    setWindowModality(Qt::WindowModal);
    setWindowTitle(tr("Calibration Values"));
    WidgetUtils::removeContextHelpButton(this);

    auto calibDateTitle = WidgetUtils::createBlueLabel(this, tr("Calibration date"));

    calibDate = new QDateTimeEdit;
    calibDate->setDisplayFormat(QStringLiteral("yyyy-MM-dd HH:mm:ss"));
    calibDate->setDate(QDate::currentDate());
    calibDate->setTime(QTime::currentTime());

    auto co2ValuesTitle = WidgetUtils::createBlueLabel(this,
                            tr("%1 calibration values").arg(Defs::CO2_STRING));

    auto co2_A_title = new QLabel;
    co2_A_title->setText(QStringLiteral("A :"));
    auto co2_B_title = new QLabel;
    co2_B_title->setText(QStringLiteral("B :"));
    auto co2_C_title = new QLabel;
    co2_C_title->setText(QStringLiteral("C :"));
    auto co2_D_title = new QLabel;
    co2_D_title->setText(QStringLiteral("D :"));
    auto co2_E_title = new QLabel;
    co2_E_title->setText(QStringLiteral("E :"));
    auto co2_XS_title = new QLabel;
    co2_XS_title->setText(QStringLiteral("XS :"));
    auto co2_Z_title = new QLabel;
    co2_Z_title->setText(QStringLiteral("Z :"));

    co2_A_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_B_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_C_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_D_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_E_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_XS_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_Z_spinbox = WidgetUtils::createCalibrationSpinbox(this);

    auto h2oValuesTitle = WidgetUtils::createBlueLabel(this,
                            tr("%1 calibration values").arg(Defs::H2O_STRING));

    auto h2o_A_title = new QLabel;
    h2o_A_title->setText(QStringLiteral("A :"));
    auto h2o_B_title = new QLabel;
    h2o_B_title->setText(QStringLiteral("B :"));
    auto h2o_C_title = new QLabel;
    h2o_C_title->setText(QStringLiteral("C :"));
    auto h2o_XS_title = new QLabel;
    h2o_XS_title->setText(QStringLiteral("XS :"));
    auto h2o_Z_title = new QLabel;
    h2o_Z_title->setText(QStringLiteral("Z :"));

    h2o_A_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    h2o_B_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    h2o_C_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    h2o_XS_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    h2o_Z_spinbox = WidgetUtils::createCalibrationSpinbox(this);

    auto zeroSpanDateTitle = WidgetUtils::createBlueLabel(this, tr("Zero/Span date"));

    zeroDate = new QDateTimeEdit;
    zeroDate->setDisplayFormat(QStringLiteral("yyyy-MM-dd HH:mm:ss"));
    zeroDate->setDate(QDate::currentDate());
    zeroDate->setTime(QTime::currentTime());

    auto zeroSpanValuesTitle = WidgetUtils::createBlueLabel(this, tr("Zero/Span values"));

    auto co2_Zero_title = new QLabel;
    co2_Zero_title->setText(QStringLiteral("%1 Zero :").arg(Defs::CO2_STRING));
    auto co2_Span_title = new QLabel;
    co2_Span_title->setText(QStringLiteral("%1 Span :").arg(Defs::CO2_STRING));
    auto co2_SpanTarget_title = new QLabel;
    co2_SpanTarget_title->setText(QStringLiteral("at :"));
    auto co2_Span2_title = new QLabel;
    co2_Span2_title->setText(QStringLiteral("%1 Span 2 :").arg(Defs::CO2_STRING));
    auto co2_Span2Target_title = new QLabel;
    co2_Span2Target_title->setText(QStringLiteral("at :"));
    auto co2_CX_title = new QLabel;
    co2_CX_title->setText(QStringLiteral("CX :"));

    co2_Zero_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_Span_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_SpanTarget_spinbox = new QDoubleSpinBox;
    co2_SpanTarget_spinbox->setSuffix(QStringLiteral(" [ppm]"));

    co2_Span2_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    co2_Span2Target_spinbox = new QDoubleSpinBox;
    co2_Span2Target_spinbox->setSuffix(QStringLiteral(" [ppm]"));
    co2_CX_spinbox = WidgetUtils::createCalibrationSpinbox(this);

    auto h2o_Zero_title = new QLabel;
    h2o_Zero_title->setText(QStringLiteral("%1 Zero :").arg(Defs::H2O_STRING));
    auto h2o_Span_title = new QLabel;
    h2o_Span_title->setText(QStringLiteral("%1 Span :").arg(Defs::H2O_STRING));
    auto h2o_SpanTarget_title = new QLabel;
    h2o_SpanTarget_title->setText(QStringLiteral("at :"));
    auto h2o_Span2_title = new QLabel;
    h2o_Span2_title->setText(QStringLiteral("%1 Span 2 :").arg(Defs::H2O_STRING));
    auto h2o_Span2Target_title = new QLabel;
    h2o_Span2Target_title->setText(QStringLiteral("at :"));
    auto h2o_WX_title = new QLabel;
    h2o_WX_title->setText(QStringLiteral("WX :"));

    h2o_Zero_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    h2o_Span_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    h2o_SpanTarget_spinbox = new QDoubleSpinBox;
    h2o_SpanTarget_spinbox->setSuffix(QStringLiteral(" [%1]").arg(Defs::DEGREE_C));
    h2o_Span2_spinbox = WidgetUtils::createCalibrationSpinbox(this);
    h2o_Span2Target_spinbox = new QDoubleSpinBox;
    h2o_Span2Target_spinbox->setSuffix(QStringLiteral(" [%1]").arg(Defs::DEGREE_C));
    h2o_WX_spinbox = WidgetUtils::createCalibrationSpinbox(this);

    auto okButton = WidgetUtils::createCommonButton(this, tr("Ok"));

    auto mainLayout = new QGridLayout(this);
    mainLayout->addWidget(calibDateTitle, 0, 0);
    mainLayout->addWidget(calibDate, 0, 1, 1, 2);

    mainLayout->addWidget(co2ValuesTitle, 1, 0, 1, 2);
    mainLayout->addWidget(co2_A_title, 2, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_A_spinbox, 2, 1);
    mainLayout->addWidget(co2_B_title, 3, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_B_spinbox, 3, 1);
    mainLayout->addWidget(co2_C_title, 4, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_C_spinbox, 4, 1);
    mainLayout->addWidget(co2_D_title, 5, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_D_spinbox, 5, 1);
    mainLayout->addWidget(co2_E_title, 6, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_E_spinbox, 6, 1);
    mainLayout->addWidget(co2_XS_title, 7, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_XS_spinbox, 7, 1);
    mainLayout->addWidget(co2_Z_title, 8, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_Z_spinbox, 8, 1);

    mainLayout->addWidget(h2oValuesTitle, 1, 4, 1, 2);
    mainLayout->addWidget(h2o_A_title, 2, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_A_spinbox, 2, 5);
    mainLayout->addWidget(h2o_B_title, 3, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_B_spinbox, 3, 5);
    mainLayout->addWidget(h2o_C_title, 4, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_C_spinbox, 4, 5);
    mainLayout->addWidget(h2o_XS_title, 5, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_XS_spinbox, 5, 5);
    mainLayout->addWidget(h2o_Z_title, 6, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_Z_spinbox, 6, 5);

    mainLayout->addWidget(zeroSpanDateTitle, 10, 0);
    mainLayout->addWidget(zeroDate, 10, 1, 1, 2);

    mainLayout->addWidget(zeroSpanValuesTitle, 12, 0);
    mainLayout->addWidget(co2_Zero_title, 13, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_Zero_spinbox, 13, 1);
    mainLayout->addWidget(co2_Span_title, 14, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_Span_spinbox, 14, 1);
    mainLayout->addWidget(co2_SpanTarget_title, 14, 2, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_SpanTarget_spinbox, 14, 3);
    mainLayout->addWidget(co2_Span2_title, 15, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_Span2_spinbox, 15, 1);
    mainLayout->addWidget(co2_Span2Target_title, 15, 2, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_Span2Target_spinbox, 15, 3);
    mainLayout->addWidget(co2_CX_title, 16, 0, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(co2_CX_spinbox, 16, 1);

    mainLayout->addWidget(h2o_Zero_title, 13, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_Zero_spinbox, 13, 5);
    mainLayout->addWidget(h2o_Span_title, 14, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_Span_spinbox, 14, 5);
    mainLayout->addWidget(h2o_SpanTarget_title, 14, 6, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_SpanTarget_spinbox, 14, 7);
    mainLayout->addWidget(h2o_Span2_title, 15, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_Span2_spinbox, 15, 5);
    mainLayout->addWidget(h2o_Span2Target_title, 15, 6, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_Span2Target_spinbox, 15, 7);
    mainLayout->addWidget(h2o_WX_title, 16, 4, 1, 1, Qt::AlignRight);
    mainLayout->addWidget(h2o_WX_spinbox, 16, 5);

    mainLayout->addWidget(okButton, 17, 0, 1, -1, Qt::AlignCenter);
    mainLayout->setVerticalSpacing(3);
    mainLayout->setContentsMargins(30, 30, 30, 30);
    mainLayout->setRowMinimumHeight(9, 30);
    mainLayout->setRowMinimumHeight(17, 30);
    setLayout(mainLayout);

    connect(okButton, &QPushButton::clicked,
            this, &CalibrationDialog::close);
}