void FormGenChoiceCompositionRadioContainer::addElement(const QString &label, FormGenElement *element)
{
    auto *w = new QWidget;
    auto *radio = new QRadioButton;
    mGroup->addButton(radio);

    element->setEnabled(false);
    connect(radio, SIGNAL(toggled(bool)), mMapper, SLOT(map()));
    mMapper->setMapping(radio, mContainerList.size());
    mContainerList.append(ElementContainer(radio, element));

    if( element->frameWidget() ) {
        element->frameWidget()->setTitle(label);

        auto innerLayout = new QGridLayout;
        innerLayout->setContentsMargins(0, 0, 0, 0);
        innerLayout->addWidget(radio, 0, 0);
        innerLayout->addWidget(element, 0, 1, 2, 1);
        innerLayout->setRowStretch(1, 1);
        innerLayout->setColumnStretch(1, 1);

        w->setLayout(innerLayout);
        mLayout->addRow(w);
    } else {
        auto innerLayout = new QHBoxLayout;
        innerLayout->setContentsMargins(0, 0, 0, 0);
        innerLayout->addWidget(radio);
        innerLayout->addWidget(element);

        w->setLayout(innerLayout);
        mLayout->addRow(label, w);
    }

    mContainerList.first().button->setChecked(true);
}
void WindowMaterialDaylightRedirectionDeviceInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit2();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Daylight Redirection Device Type

  label = new QLabel("Daylight Redirection Device Type: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_daylightRedirectionDeviceType = new OSComboBox2();
  mainGridLayout->addWidget(m_daylightRedirectionDeviceType, row, 0, 1, 3);

  ++row;

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
void MaterialAirGapInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Thermal Resistance

  label = new QLabel("Thermal Resistance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thermalResistance = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialAirGapInspectorView::toggleUnitsClicked, m_thermalResistance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thermalResistance,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
Ejemplo n.º 4
0
void CameraLayout::updateLayout(){
    calculateCellsSize();
    for (int r = 0; r < rowCount(); ++r ){
        for (int c = 0; c < columnCount(); ++c ){
                QLayoutItem *item = itemAtPosition( r, c );
                if ( item ){
                        if ( item->widget() ){
                            item->widget()->setFixedSize( d->cellsSize );
                            setColumnStretch( c, d->cellsSize.width() );
                            setRowStretch( c, d->cellsSize.height() );
                        }
                }
            }
        }
}
Ejemplo n.º 5
0
BorderedWidget::BorderedWidget(QWidget *pWidget, bool pTop, bool pLeft,
                               bool pBottom, bool pRight) :
    Widget(pWidget->parentWidget()),
    mWidget(pWidget)
{
    // We want our widget to be bordered by a single line which colour matches
    // that of the application's theme. Because of that colour requirement, we
    // can't use a QFrame, so instead we rely on the use of a grid layout and
    // newLineWidget()...

    // Create a grid layout for ourselves

    auto gridLayout = new QGridLayout(this);

    gridLayout->setContentsMargins(QMargins());
    gridLayout->setSpacing(0);

    setLayout(gridLayout);

    // Add some real line widgets to the top, left, bottom and/or right of
    // ourselves, if required

    mTopBorder = newLineWidget(this);
    mLeftBorder = newLineWidget(false, this);
    mBottomBorder = newLineWidget(this);
    mRightBorder = newLineWidget(false, this);

    gridLayout->addWidget(mTopBorder, 0, 0, 1, 3);
    gridLayout->addWidget(mLeftBorder, 1, 0);
    gridLayout->addWidget(pWidget, 1, 1);
    gridLayout->addWidget(mRightBorder, 1, 2);
    gridLayout->addWidget(mBottomBorder, 2, 0, 1, 3);

    setTopBorderVisible(pTop);
    setLeftBorderVisible(pLeft);
    setBottomBorderVisible(pBottom);
    setRightBorderVisible(pRight);

    // Make sure that our widget takes as much space as possible

    gridLayout->setRowStretch(1, 1);
    gridLayout->setColumnStretch(1, 1);
}
Ejemplo n.º 6
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();
}
void WindowMaterialGlazingRefractionExtinctionMethodInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Thickness

  label = new QLabel("Thickness: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thickness = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_thickness, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thickness,row++,0,1,3);

  // Solar Index Of Refraction

  label = new QLabel("Solar Index Of Refraction: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarIndexOfRefraction = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_solarIndexOfRefraction, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_solarIndexOfRefraction,row++,0,1,3);

  // Solar Extinction Coefficient

  label = new QLabel("Solar Extinction Coefficient: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarExtinctionCoefficient = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_solarExtinctionCoefficient, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_solarExtinctionCoefficient,row++,0,1,3);

  // Visible Index of Refraction

  label = new QLabel("Visible Index of Refraction: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_visibleIndexOfRefraction = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_visibleIndexOfRefraction, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_visibleIndexOfRefraction,row++,0,1,3);

  // Visible Extinction Coefficient

  label = new QLabel("Visible Extinction Coefficient: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_visibleExtinctionCoefficient = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_visibleExtinctionCoefficient, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_visibleExtinctionCoefficient,row++,0,1,3);

  // Infrared Transmittance At Normal Incidence

  label = new QLabel("Infrared Transmittance At Normal Incidence: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_infraredTransmittanceAtNormalIncidence = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_infraredTransmittanceAtNormalIncidence, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_infraredTransmittanceAtNormalIncidence,row++,0,1,3);

  // Infrared Hemispherical Emissivity

  label = new QLabel("Infrared Hemispherical Emissivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_infraredHemisphericalEmissivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_infraredHemisphericalEmissivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_infraredHemisphericalEmissivity,row++,0,1,3);

  // Conductivity

  label = new QLabel("Conductivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_conductivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_conductivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_conductivity,row++,0,1,3);

  // Dirt Correction Factor For Solar And Visible Transmittance

  label = new QLabel("Dirt Correction Factor For Solar And Visible Transmittance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_dirtCorrectionFactorForSolarAndVisibleTransmittance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingRefractionExtinctionMethodInspectorView::toggleUnitsClicked, m_dirtCorrectionFactorForSolarAndVisibleTransmittance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_dirtCorrectionFactorForSolarAndVisibleTransmittance,row++,0,1,3);

  // Solar Diffusing

  label = new QLabel("Solar Diffusing: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarDiffusing = new OSSwitch();
  mainGridLayout->addWidget(m_solarDiffusing,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
Ejemplo n.º 8
0
MainWindow::MainWindow(Settings& settings, Model& model, QWidget* parent)
    : QMainWindow(parent)
    , m_settings(settings)
    , m_model(model)
{
    m_tableView = new QTableView(this);
    m_tableView->setModel(&m_model);
    setCentralWidget(m_tableView);

    m_tableView->setAlternatingRowColors(true);
    m_tableView->sortByColumn(0, Qt::AscendingOrder);
    m_tableView->setSortingEnabled(true);
    m_tableView->setSelectionMode(QAbstractItemView::SingleSelection);
    m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    m_tableView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    m_tableView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);

    m_tableView->verticalHeader()->setVisible(false);
    m_tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
    m_tableView->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);

    connect(m_tableView, &QTableView::activated, this, &MainWindow::activated);
    connect(m_tableView->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::currentChanged);

    const auto searchDock = new QDockWidget(tr("Search"), this);
    searchDock->setObjectName(QStringLiteral("searchDock"));
    addDockWidget(Qt::BottomDockWidgetArea, searchDock);

    const auto searchWidget = new QWidget(searchDock);
    searchDock->setWidget(searchWidget);

    const auto searchLayout = new QFormLayout(searchWidget);
    searchWidget->setLayout(searchLayout);

    m_searchTimer = new QTimer(this);
    m_searchTimer->setInterval(searchTimeout);

    m_channelBox = new QComboBox(searchWidget);
    m_channelBox->setModel(m_model.channels());
    m_channelBox->setEditable(true);
    m_channelBox->setMinimumContentsLength(minimumChannelLength);
    m_channelBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
    searchLayout->addRow(tr("Channel"), m_channelBox);

    m_topicBox = new QComboBox(searchWidget);
    m_topicBox->setModel(m_model.topics());
    m_topicBox->setEditable(true);
    m_topicBox->setMinimumContentsLength(minimumTopicLength);
    m_topicBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
    searchLayout->addRow(tr("Topic"), m_topicBox);

    m_titleEdit = new QLineEdit(searchWidget);
    m_titleEdit->setFocus();
    searchLayout->addRow(tr("Title"), m_titleEdit);

    connect(m_searchTimer, &QTimer::timeout, this, &MainWindow::timeout);

    constexpr auto startTimer = static_cast< void (QTimer::*)() >(&QTimer::start);
    connect(m_channelBox, &QComboBox::currentTextChanged, m_searchTimer, startTimer);
    connect(m_topicBox, &QComboBox::currentTextChanged, m_searchTimer, startTimer);
    connect(m_titleEdit, &QLineEdit::textChanged, m_searchTimer, startTimer);

    const auto buttonsWidget = new QWidget(searchWidget);
    searchLayout->addWidget(buttonsWidget);
    searchLayout->setAlignment(buttonsWidget, Qt::AlignRight);

    const auto buttonsLayout = new QBoxLayout(QBoxLayout::LeftToRight, buttonsWidget);
    buttonsWidget->setLayout(buttonsLayout);
    buttonsLayout->setSizeConstraint(QLayout::SetFixedSize);

    const auto resetFilterButton = new QPushButton(QIcon::fromTheme(QStringLiteral("edit-clear")), QString(), buttonsWidget);
    buttonsLayout->addWidget(resetFilterButton);

    const auto updateDatabaseButton = new QPushButton(QIcon::fromTheme(QStringLiteral("view-refresh")), QString(), buttonsWidget);
    buttonsLayout->addWidget(updateDatabaseButton);

    const auto editSettingsButton = new QPushButton(QIcon::fromTheme(QStringLiteral("preferences-system")), QString(), buttonsWidget);
    buttonsLayout->addWidget(editSettingsButton);

    connect(resetFilterButton, &QPushButton::pressed, this, &MainWindow::resetFilterPressed);
    connect(updateDatabaseButton, &QPushButton::pressed, this, &MainWindow::updateDatabasePressed);
    connect(editSettingsButton, &QPushButton::pressed, this, &MainWindow::editSettingsPressed);

    const auto detailsDock = new QDockWidget(tr("Details"), this);
    detailsDock->setObjectName(QStringLiteral("detailsDock"));
    addDockWidget(Qt::BottomDockWidgetArea, detailsDock);

    const auto detailsWidget = new QWidget(detailsDock);
    detailsDock->setWidget(detailsWidget);

    const auto detailsLayout = new QGridLayout(detailsWidget);
    detailsWidget->setLayout(detailsLayout);

    detailsLayout->setRowStretch(2, 1);
    detailsLayout->setColumnStretch(1, 1);

    m_descriptionEdit = new QTextEdit(detailsWidget);
    m_descriptionEdit->setReadOnly(true);
    m_descriptionEdit->setLineWrapMode(QTextEdit::WidgetWidth);
    detailsLayout->addWidget(m_descriptionEdit, 0, 1, 3, 1);

    m_websiteLabel = new QLabel(detailsWidget);
    detailsLayout->addWidget(m_websiteLabel, 3, 1);

    connect(m_websiteLabel, &QLabel::linkActivated, QDesktopServices::openUrl);

    const auto playButton = new QPushButton(QIcon::fromTheme(QStringLiteral("media-playback-start")), QString(), detailsWidget);
    detailsLayout->addWidget(playButton, 0, 0);

    const auto downloadButton = new QPushButton(QIcon::fromTheme(QStringLiteral("media-record")), QString(), detailsWidget);
    detailsLayout->addWidget(downloadButton, 1, 0);

    connect(playButton, &QPushButton::pressed, this, &MainWindow::playPressed);
    connect(downloadButton, &QPushButton::pressed, this, &MainWindow::downloadPressed);

    const auto quitShortcut = new QShortcut(QKeySequence::Quit, this);
    connect(quitShortcut, &QShortcut::activated, this, &MainWindow::close);

    restoreGeometry(m_settings.mainWindowGeometry());
    restoreState(m_settings.mainWindowState());

    statusBar()->showMessage(tr("Ready"), messageTimeout);
}
Ejemplo n.º 9
0
Gui_Groups::Gui_Groups(LinqClient* c, QWidget* parent) : QGridLayout(parent), _client(c) {
    Gui_Avatar* portrait = new Gui_Avatar(QString::fromStdString(_client->avatar()));
    QPushButton* create = new QPushButton("CREATE");
    QLabel* title = new QLabel("NEW GROUP");
    showgrp = new Gui_DisplayInfo;
    newpost = new QTextEdit;
    newgrp = new QLineEdit;
    search = new QLineEdit;
    newbox = new QGroupBox;
    memlbl = new QLabel("Members");
    memlbl->setMaximumSize(80,20);

    grpname = new QLineEdit;
    newgrplayout = new QFormLayout;
    newgrplayout->setSpacing(15);
    newgrplayout->addRow(title);
    newgrplayout->addRow("Group name:", grpname);
    newgrplayout->addRow("Group description:", newgrp);
    newgrplayout->addRow(create);

    newbox->setLayout(newgrplayout);
    if(_client->level() < executive) newbox->hide();

    search->setPlaceholderText("Search group..");
    search->hide();
    connect(search,  SIGNAL(returnPressed()), this, SLOT(searchGroup()));

    post = new QPushButton("POST");
    grplist = new QListWidget;
    memlist = new QListWidget;
    QLabel* grplbl = new QLabel("Groups");
    grplbl->setMaximumSize(120,20);
    createGroups();
    QFormLayout* frm = new QFormLayout;
    mbuttons[0] = new QPushButton;
    mbuttons[0]->setIcon(QPixmap("img/document185.png"));
    mbuttons[0]->setToolTip("New group");
    mbuttons[1] = new QPushButton;
    mbuttons[1]->setIcon(QPixmap("img/cross108.png"));
    mbuttons[1]->setToolTip("Delete group");
    mbuttons[2] = new QPushButton;
    mbuttons[2]->setIcon(QPixmap("img/mop2.png"));
    mbuttons[2]->setToolTip("Delete all posts");
    mbuttons[3] = new QPushButton;
    mbuttons[3]->setIcon(QPixmap("img/exit6.png"));
    mbuttons[3]->setToolTip("Leave this group");
    mbuttons[4] = new QPushButton;
    mbuttons[4]->setIcon(QPixmap("img/enter3.png"));
    mbuttons[4]->setToolTip("Join this group");

    frm->addRow(mbuttons[0]);
    frm->addRow(mbuttons[3]);
    frm->addRow(mbuttons[4]);
    frm->addRow(mbuttons[1]);
    frm->addRow(mbuttons[2]);

    connect(mbuttons[0], SIGNAL(clicked()), this, SLOT(showNewGroup()));
    connect(create, SIGNAL(clicked()), this, SLOT(newGroup()));
    connect(mbuttons[1], SIGNAL(clicked()), this, SLOT(deleteGroup()));
    connect(mbuttons[2], SIGNAL(clicked()), this, SLOT(clearPosts()));
    connect(mbuttons[3], SIGNAL(clicked()), this, SLOT(leaveGroup()));
    connect(mbuttons[4], SIGNAL(clicked()), this, SLOT(addGroup()));

    mbuttons[0]->hide();
    mbuttons[1]->hide();
    mbuttons[2]->hide();
    mbuttons[3]->hide();
    mbuttons[4]->hide();
    if(_client->level() >= executive)
        mbuttons[0]->show();
    tbar = new QToolBar;
    tbuttons[0] = new QToolButton(tbar);
    tbuttons[0]->setIcon(QPixmap("img/cross108.png"));
    tbar->addWidget(tbuttons[0]);

    newpost->setStyleSheet("background: #1a1a1a; font-weight:400");
    newpost->setPlaceholderText("Insert new post into this group.");
    newpost->hide();
    post->hide();
    showgrp->hide();
    memlbl->hide();
    memlist->hide();
    memlist->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(memlist, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(memListMenu(const QPoint&)));

    addWidget(newbox, 0, 1, 1, 1);
    addWidget(portrait, 0, 0, 1, 1, Qt::AlignTop);
    addWidget(showgrp, 0, 1, 3, 1);
    addLayout(frm, 0, 2, 1, 1, Qt::AlignRight);
    addWidget(newpost, 3, 1, 2, 3);
    addWidget(post, 5, 4, 1, 1, Qt::AlignRight);
    addWidget(grplbl, 1, 0, 1, 1);
    addWidget(grplist, 2, 0, 1, 1);
    addWidget(memlbl, 3, 0, 1, 1);
    addWidget(memlist, 4, 0, 1, 1);
    addWidget(search, 5, 0, 1, 1);
    setRowStretch(0, 0);
    setRowStretch(1, 10);
    setColumnStretch(0, 1);
    setColumnStretch(1, 5);
    connect(grplist, SIGNAL(clicked(QModelIndex)), this, SLOT(showGroup()));
    connect(post, SIGNAL(clicked()), this, SLOT(sendPost()));
    connect(this, SIGNAL(created(int)), this, SLOT(refresh(int)));
}
Ejemplo n.º 10
0
void MaterialInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);
  m_standardsInformationWidget->showComposite();

  ++row;

  QVBoxLayout * vLayout = nullptr;

  // Roughness
  vLayout = new QVBoxLayout();

  label = new QLabel("Roughness: ");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_roughness = new OSComboBox();
  m_roughness->addItem("Very Rough");
  m_roughness->addItem("Rough");
  m_roughness->addItem("Medium Rough");
  m_roughness->addItem("Medium Smooth");
  m_roughness->addItem("Smooth");
  m_roughness->addItem("Very Smooth");
  vLayout->addWidget(m_roughness);

  mainGridLayout->addLayout(vLayout, row, 0);

  // Thickness
  vLayout = new QVBoxLayout();

  label = new QLabel("Thickness: ");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_thickness = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialInspectorView::toggleUnitsClicked, m_thickness, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_thickness);

  mainGridLayout->addLayout(vLayout, row++, 1);

  // Conductivity
  vLayout = new QVBoxLayout();

  label = new QLabel("Conductivity: ");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_conductivity = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialInspectorView::toggleUnitsClicked, m_conductivity, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_conductivity);

  mainGridLayout->addLayout(vLayout, row, 0);

  // Density
  vLayout = new QVBoxLayout();

  label = new QLabel("Density: ");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_density = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialInspectorView::toggleUnitsClicked, m_density, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_density);

  mainGridLayout->addLayout(vLayout, row++, 1);

  // Specific Heat
  vLayout = new QVBoxLayout();

  label = new QLabel("Specific Heat: ");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_specificHeat = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialInspectorView::toggleUnitsClicked, m_specificHeat, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_specificHeat);

  mainGridLayout->addLayout(vLayout, row, 0);

  // Thermal Absorptance
  vLayout = new QVBoxLayout();

  label = new QLabel("Thermal Absorptance: ");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_thermalAbsorptance = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialInspectorView::toggleUnitsClicked, m_thermalAbsorptance, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_thermalAbsorptance);

  mainGridLayout->addLayout(vLayout, row++, 1);

  // Solar Absorptance
  vLayout = new QVBoxLayout();

  label = new QLabel("Solar Absorptance: ");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_solarAbsorptance = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialInspectorView::toggleUnitsClicked, m_solarAbsorptance, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_solarAbsorptance);

  mainGridLayout->addLayout(vLayout, row, 0);

  // Visible Absorptance
  vLayout = new QVBoxLayout();

  label = new QLabel("Visible Absorptance: ");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_visibleAbsorptance = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialInspectorView::toggleUnitsClicked, m_visibleAbsorptance, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_visibleAbsorptance);

  mainGridLayout->addLayout(vLayout, row++, 1);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
void WindowMaterialGasMixtureInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Thickness

  label = new QLabel("Thickness: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thickness = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasMixtureInspectorView::toggleUnitsClicked, m_thickness, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thickness,row++,0,1,3);

  // Number Of Gases In Mixture

  label = new QLabel("Number Of Gases In Mixture: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_numberOfGasesInMixture = new OSIntegerEdit();
  mainGridLayout->addWidget(m_numberOfGasesInMixture,row++,0,1,3);

  //************************* 1 *************************

  // Gas Fraction

  label = new QLabel("Gas 1 Fraction: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gas1Fraction = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasMixtureInspectorView::toggleUnitsClicked, m_gas1Fraction, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_gas1Fraction,row++,0,1,3);

  // Gas Type

  label = new QLabel("Gas 1 Type: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gas1Type = new OSComboBox();
  m_gas1Type->addItem("Air");
  m_gas1Type->addItem("Argon");
  m_gas1Type->addItem("Krypton");
  m_gas1Type->addItem("Xenon");
  mainGridLayout->addWidget(m_gas1Type,row++,0,1,3);


  //************************* 2 *************************

  // Gas Fraction

  label = new QLabel("Gas 2 Fraction: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gas2Fraction = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasMixtureInspectorView::toggleUnitsClicked, m_gas2Fraction, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_gas2Fraction,row++,0,1,3);

  // Gas Type

  label = new QLabel("Gas 2 Type: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gas2Type = new OSComboBox();
  m_gas2Type->addItem("Air");
  m_gas2Type->addItem("Argon");
  m_gas2Type->addItem("Krypton");
  m_gas2Type->addItem("Xenon");
  mainGridLayout->addWidget(m_gas2Type,row++,0,1,3);

  //************************* 3 *************************

  // Gas Fraction

  label = new QLabel("Gas 3 Fraction: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gas3Fraction = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasMixtureInspectorView::toggleUnitsClicked, m_gas3Fraction, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_gas3Fraction,row++,0,1,3);

  // Gas Type

  label = new QLabel("Gas 3 Type: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gas3Type = new OSComboBox();
  m_gas3Type->addItem("Air");
  m_gas3Type->addItem("Argon");
  m_gas3Type->addItem("Krypton");
  m_gas3Type->addItem("Xenon");
  mainGridLayout->addWidget(m_gas3Type,row++,0,1,3);

  //************************* 4 *************************

  // Gas Fraction

  label = new QLabel("Gas 4 Fraction: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gas4Fraction = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasMixtureInspectorView::toggleUnitsClicked, m_gas4Fraction, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_gas4Fraction,row++,0,1,3);

  // Gas Type

  label = new QLabel("Gas 4 Type: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gas4Type = new OSComboBox();
  m_gas4Type->addItem("Air");
  m_gas4Type->addItem("Argon");
  m_gas4Type->addItem("Krypton");
  m_gas4Type->addItem("Xenon");
  mainGridLayout->addWidget(m_gas4Type,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
void WindowMaterialShadeInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Solar Transmittance

  label = new QLabel("Solar Transmittance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarTransmittance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_solarTransmittance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_solarTransmittance,row++,0,1,3);

  // Solar Reflectance

  label = new QLabel("Solar Reflectance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarReflectance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_solarReflectance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_solarReflectance,row++,0,1,3);

  // Visible Transmittance

  label = new QLabel("Visible Transmittance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_visibleTransmittance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_visibleTransmittance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_visibleTransmittance,row++,0,1,3);

  // Visible Reflectance

  label = new QLabel("Visible Reflectance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_visibleReflectance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_visibleReflectance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_visibleReflectance,row++,0,1,3);

  // Thermal Hemispherical Emissivity

  label = new QLabel("Thermal Hemispherical Emissivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thermalHemisphericalEmissivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_thermalHemisphericalEmissivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thermalHemisphericalEmissivity,row++,0,1,3);

  // Thermal Transmittance

  label = new QLabel("Thermal Transmittance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thermalTransmittance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_thermalTransmittance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thermalTransmittance,row++,0,1,3);

  // Thickness

  label = new QLabel("Thickness: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thickness = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_thickness, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thickness,row++,0,1,3);

  // Conductivity

  label = new QLabel("Conductivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_conductivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_conductivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_conductivity,row++,0,1,3);

  // Shade To Glass Distance

  label = new QLabel("Shade To Glass Distance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_shadeToGlassDistance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_shadeToGlassDistance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_shadeToGlassDistance,row++,0,1,3);

  // Top Opening Multiplier

  label = new QLabel("Top Opening Multiplier: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_topOpeningMultiplier = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_topOpeningMultiplier, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_topOpeningMultiplier,row++,0,1,3);

  // Bottom Opening Multiplier

  label = new QLabel("Bottom Opening Multiplier: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_bottomOpeningMultiplier = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_bottomOpeningMultiplier, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_bottomOpeningMultiplier,row++,0,1,3);

  // Left-Side Opening Multiplier

  label = new QLabel("Left-Side Opening Multiplier: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_leftSideOpeningMultiplier = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_leftSideOpeningMultiplier, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_leftSideOpeningMultiplier,row++,0,1,3);

  // Right-Side Opening Multiplier

  label = new QLabel("Right-Side Opening Multiplier: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_rightSideOpeningMultiplier = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_rightSideOpeningMultiplier, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_rightSideOpeningMultiplier,row++,0,1,3);

  // Airflow Permeability

  label = new QLabel("Airflow Permeability: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_airflowPermeability = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialShadeInspectorView::toggleUnitsClicked, m_airflowPermeability, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_airflowPermeability,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
Ejemplo n.º 13
0
LuminaireDefinitionInspectorView::LuminaireDefinitionInspectorView(bool isIP, const openstudio::model::Model& model, QWidget * parent)
  : ModelObjectInspectorView(model, true, parent)
{
  m_isIP = isIP;

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7,7,7,7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  // Name

  QLabel * label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,0,0);

  m_nameEdit = new OSLineEdit2();
  mainGridLayout->addWidget(m_nameEdit,1,0,1,2);

  // Lighting Power

  label = new QLabel("Lighting Power: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,2,0);

  m_lightingPowerEdit = new OSQuantityEdit2("W","W","W", m_isIP);
  connect(this, &LuminaireDefinitionInspectorView::toggleUnitsClicked, m_lightingPowerEdit, &OSQuantityEdit2::onUnitSystemChange);
  mainGridLayout->addWidget(m_lightingPowerEdit,3,0);

  // Fraction Radiant

  label = new QLabel("Fraction Radiant: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,4,0);

  m_fractionRadiantEdit = new OSQuantityEdit2("","","", m_isIP);
  connect(this, &LuminaireDefinitionInspectorView::toggleUnitsClicked, m_fractionRadiantEdit, &OSQuantityEdit2::onUnitSystemChange);
  mainGridLayout->addWidget(m_fractionRadiantEdit,5,0);

  // Fraction Visible

  label = new QLabel("Fraction Visible: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,4,1);

  m_fractionVisibleEdit = new OSQuantityEdit2("","","", m_isIP);
  connect(this, &LuminaireDefinitionInspectorView::toggleUnitsClicked, m_fractionVisibleEdit, &OSQuantityEdit2::onUnitSystemChange);
  mainGridLayout->addWidget(m_fractionVisibleEdit,5,1);

  // Return Air Fraction

  label = new QLabel("Return Air Fraction: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,6,0);

  m_returnAirFractionEdit = new OSQuantityEdit2("","","", m_isIP);
  connect(this, &LuminaireDefinitionInspectorView::toggleUnitsClicked, m_returnAirFractionEdit, &OSQuantityEdit2::onUnitSystemChange);
  mainGridLayout->addWidget(m_returnAirFractionEdit,7,0);

  // Stretch

  mainGridLayout->setRowStretch(8,100);

  mainGridLayout->setColumnStretch(2,100);
}
void WindowMaterialGlazingInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Optical Data Type

  label = new QLabel("Optical Data Type: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_opticalDataType = new OSComboBox();
  m_opticalDataType->addItem("Spectral Average");
  m_opticalDataType->addItem("Spectral");
  mainGridLayout->addWidget(m_opticalDataType,row++,0,1,3);

  // Window Glass Spectral Data Set Name

  label = new QLabel("Window Glass Spectral Data Set Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_windowGlassSpectralDataSetName = new OSLineEdit();
  mainGridLayout->addWidget(m_windowGlassSpectralDataSetName,row++,0,1,3);

  // Thickness

  label = new QLabel("Thickness: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thickness = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_thickness, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thickness,row++,0,1,3);

    // Solar Transmittance At Normal Incidence

  label = new QLabel("Solar Transmittance At Normal Incidence: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarTransmittanceAtNormalIncidence = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_solarTransmittanceAtNormalIncidence, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_solarTransmittanceAtNormalIncidence,row++,0,1,3);

  // Front Side Solar Reflectance At Normal Incidence

  label = new QLabel("Front Side Solar Reflectance At Normal Incidence: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_frontSideSolarReflectanceAtNormalIncidence = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_frontSideSolarReflectanceAtNormalIncidence, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_frontSideSolarReflectanceAtNormalIncidence,row++,0,1,3);

  // Back Side Solar Reflectance At Normal Incidence

  label = new QLabel("Back Side Solar Reflectance At Normal Incidence: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_backSideSolarReflectanceAtNormalIncidence = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_backSideSolarReflectanceAtNormalIncidence, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_backSideSolarReflectanceAtNormalIncidence,row++,0,1,3);

  // Visible Transmittance At Normal Incidence

  label = new QLabel("Visible Transmittance At Normal Incidence: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_visibleTransmittanceAtNormalIncidence = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_visibleTransmittanceAtNormalIncidence, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_visibleTransmittanceAtNormalIncidence,row++,0,1,3);

  // Front Side Visible Reflectance At Normal Incidence

  label = new QLabel("Front Side Visible Reflectance At Normal Incidence: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_frontSideVisibleReflectanceAtNormalIncidence = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_frontSideVisibleReflectanceAtNormalIncidence, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_frontSideVisibleReflectanceAtNormalIncidence,row++,0,1,3);

  // Back Side Visible Reflectance At Normal Incidence

  label = new QLabel("Back Side Visible Reflectance At Normal Incidence: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_backSideVisibleReflectanceAtNormalIncidence = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_backSideVisibleReflectanceAtNormalIncidence, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_backSideVisibleReflectanceAtNormalIncidence,row++,0,1,3);

  // Infrared Transmittance at Normal Incidence

  label = new QLabel("Infrared Transmittance at Normal Incidence: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_infraredTransmittanceAtNormalIncidence = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_infraredTransmittanceAtNormalIncidence, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_infraredTransmittanceAtNormalIncidence,row++,0,1,3);

  // Front Side Infrared Hemispherical Emissivity

  label = new QLabel("Front Side Infrared Hemispherical Emissivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_frontSideInfraredHemisphericalEmissivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_frontSideInfraredHemisphericalEmissivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_frontSideInfraredHemisphericalEmissivity,row++,0,1,3);

  // Back Side Infrared Hemispherical Emissivity

  label = new QLabel("Back Side Infrared Hemispherical Emissivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_backSideInfraredHemisphericalEmissivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_backSideInfraredHemisphericalEmissivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_backSideInfraredHemisphericalEmissivity,row++,0,1,3);

  // Conductivity

  label = new QLabel("Conductivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_conductivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_conductivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_conductivity,row++,0,1,3);

  // Dirt Correction Factor For Solar And Visible Transmittance

  label = new QLabel("Dirt Correction Factor For Solar And Visible Transmittance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_dirtCorrectionFactorForSolarAndVisibleTransmittance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGlazingInspectorView::toggleUnitsClicked, m_dirtCorrectionFactorForSolarAndVisibleTransmittance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_dirtCorrectionFactorForSolarAndVisibleTransmittance,row++,0,1,3);

  // Solar Diffusing

  label = new QLabel("Solar Diffusing: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarDiffusing = new OSSwitch();
  mainGridLayout->addWidget(m_solarDiffusing,row++,0,1,3); 

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
void WindowMaterialScreenInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Reflected Beam Transmittance Accounting Method

  label = new QLabel("Reflected Beam Transmittance Accounting Method: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_reflectedBeamTransmittanceAccountingMethod = new OSComboBox();
  m_reflectedBeamTransmittanceAccountingMethod->addItem("Do Not Model");
  m_reflectedBeamTransmittanceAccountingMethod->addItem("Model As Direct Beam");
  m_reflectedBeamTransmittanceAccountingMethod->addItem("Model As Diffuse");
  mainGridLayout->addWidget(m_reflectedBeamTransmittanceAccountingMethod,row++,0,1,3);

  // Diffuse Solar Reflectance

  label = new QLabel("Diffuse Solar Reflectance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_diffuseSolarReflectance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_diffuseSolarReflectance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_diffuseSolarReflectance,row++,0,1,3);

  // Diffuse Visible Reflectance

  label = new QLabel("Diffuse Visible Reflectance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_diffuseVisibleReflectance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_diffuseVisibleReflectance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_diffuseVisibleReflectance,row++,0,1,3);

  // Thermal Hemispherical Emissivity

  label = new QLabel("Thermal Hemispherical Emissivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thermalHemisphericalEmissivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_thermalHemisphericalEmissivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thermalHemisphericalEmissivity,row++,0,1,3);

  // Conductivity

  label = new QLabel("Conductivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_conductivity = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_conductivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_conductivity,row++,0,1,3);

  // Screen Material Spacing

  label = new QLabel("Screen Material Spacing: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_screenMaterialSpacing = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_screenMaterialSpacing, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_screenMaterialSpacing,row++,0,1,3);

  // Screen Material Diameter

  label = new QLabel("Screen Material Diameter: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_screenMaterialDiameter = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_screenMaterialDiameter, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_screenMaterialDiameter,row++,0,1,3);

  // Screen To Glass Distance

  label = new QLabel("Screen To Glass Distance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_screenToGlassDistance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_screenToGlassDistance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_screenToGlassDistance,row++,0,1,3);

  // Top Opening Multiplier

  label = new QLabel("Top Opening Multiplier: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_topOpeningMultiplier = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_topOpeningMultiplier, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_topOpeningMultiplier,row++,0,1,3);

  // Bottom Opening Multiplier

  label = new QLabel("Bottom Opening Multiplier: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_bottomOpeningMultiplier = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_bottomOpeningMultiplier, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_bottomOpeningMultiplier,row++,0,1,3);

  // Left Side Opening Multiplier

  label = new QLabel("Left Side Opening Multiplier: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_leftSideOpeningMultiplier = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_leftSideOpeningMultiplier, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_leftSideOpeningMultiplier,row++,0,1,3);

  // Right Side Opening Multiplier

  label = new QLabel("Right Side Opening Multiplier: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_rightSideOpeningMultiplier = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialScreenInspectorView::toggleUnitsClicked, m_rightSideOpeningMultiplier, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_rightSideOpeningMultiplier,row++,0,1,3);  

  // Angle Of Resolution For Screen Transmittance Output Map

  label = new QLabel("Angle Of Resolution For Screen Transmittance Output Map: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_angleOfResolutionForScreenTransmittanceOutputMap = new OSComboBox();
  m_angleOfResolutionForScreenTransmittanceOutputMap->addItem("0"); // TODO needs OS to bind to model
  m_angleOfResolutionForScreenTransmittanceOutputMap->addItem("2");
  m_angleOfResolutionForScreenTransmittanceOutputMap->addItem("3");
  m_angleOfResolutionForScreenTransmittanceOutputMap->addItem("4");
  m_angleOfResolutionForScreenTransmittanceOutputMap->addItem("5");
  mainGridLayout->addWidget(m_angleOfResolutionForScreenTransmittanceOutputMap,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
void MaterialRoofVegetationInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Height Of Plants

  label = new QLabel("Height Of Plants: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_heightOfPlants = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_heightOfPlants, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_heightOfPlants,row++,0,1,3);

  // Leaf Area Index

  label = new QLabel("Leaf Area Index: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_leafAreaIndex = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_leafAreaIndex, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_leafAreaIndex,row++,0,1,3);

  // Leaf Reflectivity

  label = new QLabel("Leaf Reflectivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_leafReflectivity = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_leafReflectivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_leafReflectivity,row++,0,1,3);

  // Leaf Emissivity

  label = new QLabel("Leaf Emissivity: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_leafEmissivity = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_leafEmissivity, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_leafEmissivity,row++,0,1,3);

  // Minimum Stomatal Resistance

  label = new QLabel("Minimum Stomatal Resistance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_minimumStomatalResistance = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_minimumStomatalResistance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_minimumStomatalResistance,row++,0,1,3);

  // Soil Layer Name

  label = new QLabel("Soil Layer Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_soilLayerName = new OSLineEdit();
  mainGridLayout->addWidget(m_soilLayerName,row++,0,1,3);

 // Roughness

  label = new QLabel("Roughness: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_roughness = new OSComboBox();
  m_roughness->addItem("Very Rough");
  m_roughness->addItem("Rough");
  m_roughness->addItem("Medium Rough");
  m_roughness->addItem("Medium Smooth");
  m_roughness->addItem("Smooth");
  m_roughness->addItem("Very Smooth");
  mainGridLayout->addWidget(m_roughness,row++,0,1,3);

  // Thickness

  label = new QLabel("Thickness: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thickness = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_thickness, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thickness,row++,0,1,3);

  // Conductivity Of Dry Soil

  label = new QLabel("Conductivity Of Dry Soil: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_conductivityOfDrySoil = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_conductivityOfDrySoil, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_conductivityOfDrySoil,row++,0,1,3);

  // Density Of Dry Soil

  label = new QLabel("Density Of Dry Soil: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_densityOfDrySoil = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_densityOfDrySoil, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_densityOfDrySoil,row++,0,1,3);

  // Specific Heat Of Dry Soil

  label = new QLabel("Specific Heat Of Dry Soil: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_specificHeatOfDrySoil = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_specificHeatOfDrySoil, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_specificHeatOfDrySoil,row++,0,1,3);

  // Thermal Absorptance

  label = new QLabel("Thermal Absorptance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thermalAbsorptance = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_thermalAbsorptance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thermalAbsorptance,row++,0,1,3);

  // Solar Absorptance

  label = new QLabel("Solar Absorptance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarAbsorptance = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_solarAbsorptance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_solarAbsorptance,row++,0,1,3);

  // Visible Absorptance

  label = new QLabel("Visible Absorptance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_visibleAbsorptance = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_visibleAbsorptance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_visibleAbsorptance,row++,0,1,3);

  // Saturation Volumetric Moisture Content Of The Soil Layer

  label = new QLabel("Saturation Volumetric Moisture Content Of The Soil Layer: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_saturationVolumetricMoistureContentOfTheSoilLayer = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_saturationVolumetricMoistureContentOfTheSoilLayer, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_saturationVolumetricMoistureContentOfTheSoilLayer,row++,0,1,3);

  // Residual Volumetric Moisture Content Of The Soil Layer

  label = new QLabel("Residual Volumetric Moisture Content Of The Soil Layer: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_residualVolumetricMoistureContentOfTheSoilLayer = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_residualVolumetricMoistureContentOfTheSoilLayer, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_residualVolumetricMoistureContentOfTheSoilLayer,row++,0,1,3);

  // Initial Volumetric Moisture Content Of The Soil Layer

  label = new QLabel("Initial Volumetric Moisture Content Of The Soil Layer: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_initialVolumetricMoistureContentOfTheSoilLayer = new OSQuantityEdit(m_isIP);
  connect(this, &MaterialRoofVegetationInspectorView::toggleUnitsClicked, m_initialVolumetricMoistureContentOfTheSoilLayer, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_initialVolumetricMoistureContentOfTheSoilLayer,row++,0,1,3);

  // Moisture Diffusion Calculation Method

  label = new QLabel("Moisture Diffusion Calculation Method: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_moistureDiffusionCalculationMethod = new OSLineEdit();
  mainGridLayout->addWidget(m_moistureDiffusionCalculationMethod,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) :
    m_buildConfiguration(bc),
    m_configModel(new ConfigModel(this)),
    m_configFilterModel(new Utils::CategorySortFilterModel),
    m_configTextFilterModel(new Utils::CategorySortFilterModel)
{
    QTC_CHECK(bc);

    setDisplayName(tr("CMake"));

    auto vbox = new QVBoxLayout(this);
    vbox->setMargin(0);
    auto container = new Utils::DetailsWidget;
    container->setState(Utils::DetailsWidget::NoSummary);
    vbox->addWidget(container);

    auto details = new QWidget(container);
    container->setWidget(details);

    auto mainLayout = new QGridLayout(details);
    mainLayout->setMargin(0);
    mainLayout->setColumnStretch(1, 10);

    auto project = static_cast<CMakeProject *>(bc->project());

    auto buildDirChooser = new Utils::PathChooser;
    buildDirChooser->setBaseFileName(project->projectDirectory());
    buildDirChooser->setFileName(bc->buildDirectory());
    connect(buildDirChooser, &Utils::PathChooser::rawPathChanged, this,
            [this](const QString &path) {
                m_configModel->flush(); // clear out config cache...
                m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(path));
            });

    int row = 0;
    mainLayout->addWidget(new QLabel(tr("Build directory:")), row, 0);
    mainLayout->addWidget(buildDirChooser->lineEdit(), row, 1);
    mainLayout->addWidget(buildDirChooser->buttonAtIndex(0), row, 2);

    ++row;
    mainLayout->addItem(new QSpacerItem(20, 10), row, 0);

    ++row;
    m_errorLabel = new QLabel;
    m_errorLabel->setPixmap(Utils::Icons::CRITICAL.pixmap());
    m_errorLabel->setVisible(false);
    m_errorMessageLabel = new QLabel;
    m_errorMessageLabel->setVisible(false);
    auto boxLayout = new QHBoxLayout;
    boxLayout->addWidget(m_errorLabel);
    boxLayout->addWidget(m_errorMessageLabel);
    mainLayout->addLayout(boxLayout, row, 0, 1, 3, Qt::AlignHCenter);

    ++row;
    m_warningLabel = new QLabel;
    m_warningLabel->setPixmap(Utils::Icons::WARNING.pixmap());
    m_warningLabel->setVisible(false);
    m_warningMessageLabel = new QLabel;
    m_warningMessageLabel->setVisible(false);
    auto boxLayout2 = new QHBoxLayout;
    boxLayout2->addWidget(m_warningLabel);
    boxLayout2->addWidget(m_warningMessageLabel);
    mainLayout->addLayout(boxLayout2, row, 0, 1, 3, Qt::AlignHCenter);

    ++row;
    mainLayout->addItem(new QSpacerItem(20, 10), row, 0);

    ++row;
    m_filterEdit = new Utils::FancyLineEdit;
    m_filterEdit->setPlaceholderText(tr("Filter"));
    m_filterEdit->setFiltering(true);
    mainLayout->addWidget(m_filterEdit, row, 0, 1, 2);

    ++row;
    auto tree = new Utils::TreeView;
    connect(tree, &Utils::TreeView::activated,
            tree, [tree](const QModelIndex &idx) { tree->edit(idx); });
    m_configView = tree;

    m_configView->viewport()->installEventFilter(this);

    m_configFilterModel->setSourceModel(m_configModel);
    m_configFilterModel->setFilterKeyColumn(0);
    m_configFilterModel->setFilterRole(ConfigModel::ItemIsAdvancedRole);
    m_configFilterModel->setFilterFixedString("0");

    m_configTextFilterModel->setSourceModel(m_configFilterModel);
    m_configTextFilterModel->setSortRole(Qt::DisplayRole);
    m_configTextFilterModel->setFilterKeyColumn(-1);
    m_configTextFilterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);

    connect(m_configTextFilterModel, &QAbstractItemModel::layoutChanged, this, [this]() {
        QModelIndex selectedIdx = m_configView->currentIndex();
        if (selectedIdx.isValid())
            m_configView->scrollTo(selectedIdx);
    });

    m_configView->setModel(m_configTextFilterModel);
    m_configView->setMinimumHeight(300);
    m_configView->setUniformRowHeights(true);
    m_configView->setSortingEnabled(true);
    m_configView->sortByColumn(0, Qt::AscendingOrder);
    auto stretcher = new Utils::HeaderViewStretcher(m_configView->header(), 0);
    m_configView->setSelectionMode(QAbstractItemView::SingleSelection);
    m_configView->setSelectionBehavior(QAbstractItemView::SelectItems);
    m_configView->setFrameShape(QFrame::NoFrame);
    m_configView->setItemDelegate(new ConfigModelItemDelegate(m_buildConfiguration->project()->projectDirectory(),
                                                              m_configView));
    QFrame *findWrapper = Core::ItemViewFind::createSearchableWrapper(m_configView, Core::ItemViewFind::LightColored);
    findWrapper->setFrameStyle(QFrame::StyledPanel);

    m_progressIndicator = new Utils::ProgressIndicator(Utils::ProgressIndicatorSize::Large, findWrapper);
    m_progressIndicator->attachToWidget(findWrapper);
    m_progressIndicator->raise();
    m_progressIndicator->hide();
    m_showProgressTimer.setSingleShot(true);
    m_showProgressTimer.setInterval(50); // don't show progress for < 50ms tasks
    connect(&m_showProgressTimer, &QTimer::timeout, [this]() { m_progressIndicator->show(); });

    mainLayout->addWidget(findWrapper, row, 0, 1, 2);

    auto buttonLayout = new QVBoxLayout;
    m_addButton = new QPushButton(tr("&Add"));
    m_addButton->setToolTip(tr("Add a new configuration value."));
    buttonLayout->addWidget(m_addButton);
    {
        m_addButtonMenu = new QMenu;
        m_addButtonMenu->addAction(tr("&Boolean"))->setData(
                    QVariant::fromValue(static_cast<int>(ConfigModel::DataItem::BOOLEAN)));
        m_addButtonMenu->addAction(tr("&String"))->setData(
                    QVariant::fromValue(static_cast<int>(ConfigModel::DataItem::STRING)));
        m_addButtonMenu->addAction(tr("&Directory"))->setData(
                    QVariant::fromValue(static_cast<int>(ConfigModel::DataItem::DIRECTORY)));
        m_addButtonMenu->addAction(tr("&File"))->setData(
                    QVariant::fromValue(static_cast<int>(ConfigModel::DataItem::FILE)));
        m_addButton->setMenu(m_addButtonMenu);
    }
    m_editButton = new QPushButton(tr("&Edit"));
    m_editButton->setToolTip(tr("Edit the current CMake configuration value."));
    buttonLayout->addWidget(m_editButton);
    m_unsetButton = new QPushButton(tr("&Unset"));
    m_unsetButton->setToolTip(tr("Unset a value in the CMake configuration."));
    buttonLayout->addWidget(m_unsetButton);
    m_resetButton = new QPushButton(tr("&Reset"));
    m_resetButton->setToolTip(tr("Reset all unapplied changes."));
    m_resetButton->setEnabled(false);
    buttonLayout->addWidget(m_resetButton);
    buttonLayout->addItem(new QSpacerItem(10, 10, QSizePolicy::Fixed, QSizePolicy::Fixed));
    m_showAdvancedCheckBox = new QCheckBox(tr("Advanced"));
    buttonLayout->addWidget(m_showAdvancedCheckBox);
    buttonLayout->addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding));

    mainLayout->addLayout(buttonLayout, row, 2);

    connect(m_configView->selectionModel(), &QItemSelectionModel::currentChanged,
            this, &CMakeBuildSettingsWidget::updateSelection);

    ++row;
    m_reconfigureButton = new QPushButton(tr("Apply Configuration Changes"));
    m_reconfigureButton->setEnabled(false);
    mainLayout->addWidget(m_reconfigureButton, row, 0, 1, 3);

    updateAdvancedCheckBox();
    setError(bc->error());
    setWarning(bc->warning());

    connect(project, &ProjectExplorer::Project::parsingStarted, this, [this]() {
        updateButtonState();
        m_configView->setEnabled(false);
        m_showProgressTimer.start();
    });

    if (m_buildConfiguration->isParsing())
        m_showProgressTimer.start();
    else {
        m_configModel->setConfiguration(m_buildConfiguration->configurationFromCMake());
        m_configView->expandAll();
    }

    connect(project, &ProjectExplorer::Project::parsingFinished,
            this, [this, buildDirChooser, stretcher]() {
        m_configModel->setConfiguration(m_buildConfiguration->configurationFromCMake());
        m_configView->expandAll();
        m_configView->setEnabled(true);
        stretcher->stretch();
        updateButtonState();
        buildDirChooser->triggerChanged(); // refresh valid state...
        m_showProgressTimer.stop();
        m_progressIndicator->hide();
    });
    connect(m_buildConfiguration, &CMakeBuildConfiguration::errorOccured,
            this, [this]() {
        m_showProgressTimer.stop();
        m_progressIndicator->hide();
    });
    connect(m_configTextFilterModel, &QAbstractItemModel::modelReset, this, [this, stretcher]() {
        m_configView->expandAll();
        stretcher->stretch();
    });

    connect(m_configModel, &QAbstractItemModel::dataChanged,
            this, &CMakeBuildSettingsWidget::updateButtonState);
    connect(m_configModel, &QAbstractItemModel::modelReset,
            this, &CMakeBuildSettingsWidget::updateButtonState);

    connect(m_showAdvancedCheckBox, &QCheckBox::stateChanged,
            this, &CMakeBuildSettingsWidget::updateAdvancedCheckBox);

    connect(m_filterEdit, &QLineEdit::textChanged,
            m_configTextFilterModel, &QSortFilterProxyModel::setFilterFixedString);

    connect(m_resetButton, &QPushButton::clicked, m_configModel, &ConfigModel::resetAllChanges);
    connect(m_reconfigureButton, &QPushButton::clicked, this, [this]() {
        m_buildConfiguration->setConfigurationForCMake(m_configModel->configurationForCMake());
    });
    connect(m_unsetButton, &QPushButton::clicked, this, [this]() {
        m_configModel->toggleUnsetFlag(mapToSource(m_configView, m_configView->currentIndex()));
    });
    connect(m_editButton, &QPushButton::clicked, this, [this]() {
        QModelIndex idx = m_configView->currentIndex();
        if (idx.column() != 1)
            idx = idx.sibling(idx.row(), 1);
        m_configView->setCurrentIndex(idx);
        m_configView->edit(idx);
    });
    connect(m_addButtonMenu, &QMenu::triggered, this, [this](QAction *action) {
        ConfigModel::DataItem::Type type =
                static_cast<ConfigModel::DataItem::Type>(action->data().value<int>());
        QString value = tr("<UNSET>");
        if (type == ConfigModel::DataItem::BOOLEAN)
            value = QString::fromLatin1("OFF");

        m_configModel->appendConfiguration(tr("<UNSET>"), value, type);
        const Utils::TreeItem *item = m_configModel->findNonRootItem([&value, type](Utils::TreeItem *item) {
                ConfigModel::DataItem dataItem = ConfigModel::dataItemFromIndex(item->index());
                return dataItem.key == tr("<UNSET>") && dataItem.type == type && dataItem.value == value;
        });
        QModelIndex idx = m_configModel->indexForItem(item);
        idx = m_configTextFilterModel->mapFromSource(m_configFilterModel->mapFromSource(idx));
        m_configView->scrollTo(idx);
        m_configView->setCurrentIndex(idx);
        m_configView->edit(idx);
    });

    connect(bc, &CMakeBuildConfiguration::errorOccured, this, &CMakeBuildSettingsWidget::setError);
    connect(bc, &CMakeBuildConfiguration::warningOccured, this, &CMakeBuildSettingsWidget::setWarning);

    updateFromKit();
    connect(m_buildConfiguration->target(), &ProjectExplorer::Target::kitChanged,
            this, &CMakeBuildSettingsWidget::updateFromKit);
    connect(m_buildConfiguration, &CMakeBuildConfiguration::enabledChanged,
            this, [this]() {
        setError(m_buildConfiguration->disabledReason());
        setConfigurationForCMake();
    });
    connect(m_buildConfiguration, &CMakeBuildConfiguration::configurationForCMakeChanged,
            this, [this]() { setConfigurationForCMake(); });

    updateSelection(QModelIndex(), QModelIndex());
}
ElectricEquipmentDefinitionInspectorView::ElectricEquipmentDefinitionInspectorView(bool isIP, const openstudio::model::Model& model, QWidget * parent)
  : ModelObjectInspectorView(model, true, parent)
{
  m_isIP = isIP;

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7,7,7,7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  // Name

  QLabel* label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,0,0);

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit,1,0,1,3);

  // Design Level

  label = new QLabel("Design Level: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,2,0);

  m_designLevelEdit = new OSQuantityEdit(m_isIP);
  connect(this, &ElectricEquipmentDefinitionInspectorView::toggleUnitsClicked, m_designLevelEdit, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_designLevelEdit,3,0);

  // Energy Per Space Floor Area

  label = new QLabel("Energy Per Space Floor Area: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,2,1);

  m_wattsPerSpaceFloorAreaEdit = new OSQuantityEdit(m_isIP);
  connect(this, &ElectricEquipmentDefinitionInspectorView::toggleUnitsClicked, m_wattsPerSpaceFloorAreaEdit, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_wattsPerSpaceFloorAreaEdit,3,1);

  // Energy Per Person

  label = new QLabel("Energy Per Person: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,2,2);

  m_wattsPerPersonEdit = new OSQuantityEdit(m_isIP);
  connect(this, &ElectricEquipmentDefinitionInspectorView::toggleUnitsClicked, m_wattsPerPersonEdit, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_wattsPerPersonEdit,3,2);

  // Fraction Latent

  label = new QLabel("Fraction Latent: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,4,0);

  m_fractionLatentEdit = new OSQuantityEdit(m_isIP);
  connect(this, &ElectricEquipmentDefinitionInspectorView::toggleUnitsClicked, m_fractionLatentEdit, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_fractionLatentEdit,5,0);

  // Fraction Radiant

  label = new QLabel("Fraction Radiant: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,4,1);

  m_fractionRadiantEdit = new OSQuantityEdit(m_isIP);
  connect(this, &ElectricEquipmentDefinitionInspectorView::toggleUnitsClicked, m_fractionRadiantEdit, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_fractionRadiantEdit,5,1);

  // Fraction Lost

  label = new QLabel("Fraction Lost: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,6,0);

  m_fractionLostEdit = new OSQuantityEdit(m_isIP);
  connect(this, &ElectricEquipmentDefinitionInspectorView::toggleUnitsClicked, m_fractionLostEdit, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_fractionLostEdit,7,0);

  // Stretch

  mainGridLayout->setRowStretch(8,100);

  mainGridLayout->setColumnStretch(3,100);
}
Ejemplo n.º 19
0
  FacilityShadingGridView::FacilityShadingGridView(bool isIP, const model::Model & model, QWidget * parent)
    : GridViewSubTab(isIP, model, parent)
  {
    auto modelObjects = subsetCastVector<model::ModelObject>(model.getModelObjects<model::ShadingSurfaceGroup>());
    std::sort(modelObjects.begin(), modelObjects.end(), ModelObjectNameSorter());

    m_gridController = new FacilityShadingGridController(isIP, "Shading Surface Group", IddObjectType::OS_ShadingSurfaceGroup, model, modelObjects);
    m_gridView = new OSGridView(m_gridController, "Shading Surface Group", "Drop\nShading Surface Group", false, parent);

    setGridController(m_gridController);
    setGridView(m_gridView);

    // Filters

    QLabel * label = nullptr;

    QVBoxLayout * layout = nullptr;

    auto filterGridLayout = new QGridLayout();
    filterGridLayout->setContentsMargins(7, 4, 0, 8);
    filterGridLayout->setSpacing(5);

    label = new QLabel();
    label->setText("Filters:");
    label->setObjectName("H2");
    filterGridLayout->addWidget(label, filterGridLayout->rowCount(), filterGridLayout->columnCount(), Qt::AlignTop | Qt::AlignLeft);

    // SHADINGSURFACEGROUPNAME

    layout = new QVBoxLayout();

    label = new QLabel();
    label->setText(SHADINGSURFACENAME);
    label->setObjectName("H3");
    layout->addWidget(label, Qt::AlignTop | Qt::AlignLeft);

    m_nameFilter = new QLineEdit();
    m_nameFilter->setFixedWidth(OSItem::ITEM_WIDTH);
    // Evan note: there are issues with using the signal textChanged or textEdited, related to the design and updating of the gridview (loss of focus, and updates per key stroke)
    connect(m_nameFilter, &QLineEdit::editingFinished, this, &openstudio::FacilityShadingGridView::nameFilterChanged);

    QRegExp nameRegex("^\\S.*");
    auto nameValidator = new QRegExpValidator(nameRegex, this);
    m_nameFilter->setValidator(nameValidator);

    layout->addWidget(m_nameFilter, Qt::AlignTop | Qt::AlignLeft);
    layout->addStretch();
    filterGridLayout->addLayout(layout, filterGridLayout->rowCount() - 1, filterGridLayout->columnCount());

    // SHADINGSURFACETYPE

    layout = new QVBoxLayout();

    label = new QLabel();
    label->setText(SHADINGSURFACETYPE);
    label->setObjectName("H3");
    layout->addWidget(label, Qt::AlignTop | Qt::AlignLeft);

    m_typeFilter = new QComboBox();
    m_typeFilter->addItem("Site");
    m_typeFilter->addItem("Building");
    m_typeFilter->addItem("Space");
    m_typeFilter->setFixedWidth(OSItem::ITEM_WIDTH);
    connect(m_typeFilter, &QComboBox::currentTextChanged, this, &openstudio::FacilityShadingGridView::typeFilterChanged);

    layout->addWidget(m_typeFilter, Qt::AlignTop | Qt::AlignLeft);
    layout->addStretch();
    filterGridLayout->addLayout(layout, filterGridLayout->rowCount() - 1, filterGridLayout->columnCount());

    // TILTGREATERTHAN

    layout = new QVBoxLayout();

    label = new QLabel();
    label->setText(TILTGREATERTHAN);
    label->setObjectName("H3");
    layout->addWidget(label, Qt::AlignTop | Qt::AlignLeft);

    m_tiltGreaterThanFilter = new QLineEdit();
    m_tiltGreaterThanFilter->setFixedWidth(OSItem::ITEM_WIDTH);
    connect(m_tiltGreaterThanFilter, &QLineEdit::editingFinished, this, &openstudio::FacilityShadingGridView::tiltFilterChanged);

    QRegExp regex("^(-?\\d*\\.?\\d+)?$");
    auto validator = new QRegExpValidator(regex, this);
    m_tiltGreaterThanFilter->setValidator(validator);

    layout->addWidget(m_tiltGreaterThanFilter, Qt::AlignTop | Qt::AlignLeft);
    layout->addStretch();
    filterGridLayout->addLayout(layout, filterGridLayout->rowCount() - 1, filterGridLayout->columnCount());

    //TILTLESSTHAN

    layout = new QVBoxLayout();

    label = new QLabel();
    label->setText(TILTLESSTHAN);
    label->setObjectName("H3");
    layout->addWidget(label, Qt::AlignTop | Qt::AlignLeft);

    m_tiltLessThanFilter = new QLineEdit();
    m_tiltLessThanFilter->setFixedWidth(OSItem::ITEM_WIDTH);
    // Evan note: there are issues with using the signal textChanged or textEdited, related to the design and updating of the gridview (loss of focus, and updates per key stroke)
    connect(m_tiltLessThanFilter, &QLineEdit::editingFinished, this, &openstudio::FacilityShadingGridView::tiltFilterChanged);

    validator = new QRegExpValidator(regex, this);
    m_tiltLessThanFilter->setValidator(validator);

    layout->addWidget(m_tiltLessThanFilter, Qt::AlignTop | Qt::AlignLeft);
    layout->addStretch();
    filterGridLayout->addLayout(layout, filterGridLayout->rowCount() - 1, filterGridLayout->columnCount());

    // ORIENTATIONGREATERTHAN

    layout = new QVBoxLayout();

    label = new QLabel();
    label->setText(ORIENTATIONGREATERTHAN);
    label->setObjectName("H3");
    layout->addWidget(label, Qt::AlignTop | Qt::AlignLeft);

    m_orientationGreaterThanFilter = new QLineEdit();
    m_orientationGreaterThanFilter->setFixedWidth(OSItem::ITEM_WIDTH);
    connect(m_orientationGreaterThanFilter, &QLineEdit::editingFinished, this, &openstudio::FacilityShadingGridView::orientationFilterChanged);

    validator = new QRegExpValidator(regex, this);
    m_orientationGreaterThanFilter->setValidator(validator);

    layout->addWidget(m_orientationGreaterThanFilter, Qt::AlignTop | Qt::AlignLeft);
    layout->addStretch();
    filterGridLayout->addLayout(layout, filterGridLayout->rowCount() - 1, filterGridLayout->columnCount());

    // ORIENTATIONLESSTHAN

    layout = new QVBoxLayout();

    label = new QLabel();
    label->setText(ORIENTATIONLESSTHAN);
    label->setObjectName("H3");
    layout->addWidget(label, Qt::AlignTop | Qt::AlignLeft);

    m_orientationLessThanFilter = new QLineEdit();
    m_orientationLessThanFilter->setFixedWidth(OSItem::ITEM_WIDTH);
    // Evan note: there are issues with using the signal textChanged or textEdited, related to the design and updating of the gridview (loss of focus, and updates per key stroke)
    connect(m_orientationLessThanFilter, &QLineEdit::editingFinished, this, &openstudio::FacilityShadingGridView::orientationFilterChanged);

    validator = new QRegExpValidator(regex, this);
    m_orientationLessThanFilter->setValidator(validator);

    layout->addWidget(m_orientationLessThanFilter, Qt::AlignTop | Qt::AlignLeft);
    layout->addStretch();
    filterGridLayout->addLayout(layout, filterGridLayout->rowCount() - 1, filterGridLayout->columnCount());

    filterGridLayout->setRowStretch(filterGridLayout->rowCount(), 100);
    filterGridLayout->setColumnStretch(filterGridLayout->columnCount(), 100);

    m_gridView->m_contentLayout->addLayout(filterGridLayout);

    m_gridView->m_contentLayout->addSpacing(7);
  }
ScheduleSetInspectorView::ScheduleSetInspectorView(const model::Model& model,
  QWidget * parent)
  : ModelObjectInspectorView(model, true, parent),
  m_nameEdit(nullptr),

  m_hoursOfOperationDZ(nullptr),
  m_numberOfPeopleDZ(nullptr),
  m_peopleActivityScheduleDZ(nullptr),
  m_lightingScheduleDZ(nullptr),
  m_electricEquipmentScheduleDZ(nullptr),
  m_gasEquipmentScheduleDZ(nullptr),
  m_hotWaterEquipmentScheduleDZ(nullptr),
  m_infiltrationScheduleDZ(nullptr),
  m_ventilationPerPersonScheduleDZ(nullptr),
  m_ventilationPerFloorAreaScheduleDZ(nullptr),

  m_hoursOfOperationVC(nullptr),
  m_numberOfPeopleVC(nullptr),
  m_peopleActivityScheduleVC(nullptr),
  m_lightingScheduleVC(nullptr),
  m_electricEquipmentScheduleVC(nullptr),
  m_gasEquipmentScheduleVC(nullptr),
  m_hotWaterEquipmentScheduleVC(nullptr),
  m_infiltrationScheduleVC(nullptr),
  m_steamEquipmentScheduleVC(nullptr),
  m_otherEquipmentScheduleVC(nullptr),

  m_vectorControllers(std::vector<ModelObjectVectorController *>()),
  m_dropZones(std::vector<OSDropZone *>())
{
  QLabel * label = nullptr;

  label = new QLabel();
  label->setObjectName("H2");
  label->setWordWrap(true);
  label->setText("Name");

  m_nameEdit = new OSLineEdit();

  auto gridLayout = new QGridLayout();
  gridLayout->setContentsMargins(10,10,10,10);
  gridLayout->setSpacing(10);

  int leftCol = 0;
  int rightCol = 1;
  int row = 0;

  gridLayout->addWidget(label,row,0);

  row++;

  gridLayout->addWidget(m_nameEdit,row,0,1,2);

  row++;

  QFrame * line;

  line = new QFrame();
  line->setFrameShape(QFrame::HLine);
  line->setFrameShadow(QFrame::Sunken);
  gridLayout->addWidget(line,row,0,1,-1);
  row++;

  label = new QLabel();
  label->setText("Default Schedules");
  label->setObjectName("H2");
  //label->setContentsMargins(padding,0,padding,0);
  gridLayout->addWidget(label,row,0,1,2);
  row++;

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Hours of Operation");
  m_hoursOfOperationVC = new HoursOfOperationVC();
  m_vectorControllers.push_back(m_hoursOfOperationVC);
  m_hoursOfOperationDZ = new OSDropZone(m_hoursOfOperationVC);
  m_dropZones.push_back(m_hoursOfOperationDZ);
  gridLayout->addWidget(label,row,leftCol);
  gridLayout->addWidget(m_hoursOfOperationDZ,row+1,leftCol);

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Number of People");
  m_numberOfPeopleVC = new NumberOfPeopleVC();
  m_vectorControllers.push_back(m_numberOfPeopleVC);
  m_numberOfPeopleDZ = new OSDropZone(m_numberOfPeopleVC);
  m_dropZones.push_back(m_numberOfPeopleDZ);
  gridLayout->addWidget(label,row,rightCol);
  gridLayout->addWidget(m_numberOfPeopleDZ,row+1,rightCol);

  row += 2;

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("People Activity");
  m_peopleActivityScheduleVC = new PeopleActivityScheduleVC();
  m_vectorControllers.push_back(m_peopleActivityScheduleVC);
  m_peopleActivityScheduleDZ = new OSDropZone(m_peopleActivityScheduleVC);
  m_dropZones.push_back(m_peopleActivityScheduleDZ);
  gridLayout->addWidget(label,row,leftCol);
  gridLayout->addWidget(m_peopleActivityScheduleDZ,row+1,leftCol);

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Lighting");
  m_lightingScheduleVC = new LightingScheduleVC();
  m_vectorControllers.push_back(m_lightingScheduleVC);
  m_lightingScheduleDZ = new OSDropZone(m_lightingScheduleVC);
  m_dropZones.push_back(m_lightingScheduleDZ);
  gridLayout->addWidget(label,row,rightCol);
  gridLayout->addWidget(m_lightingScheduleDZ,row+1,rightCol);

  row += 2;

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Electric Equipment");
  m_electricEquipmentScheduleVC = new ElectricEquipmentScheduleVC();
  m_vectorControllers.push_back(m_electricEquipmentScheduleVC);
  m_electricEquipmentScheduleDZ = new OSDropZone(m_electricEquipmentScheduleVC);
  m_dropZones.push_back(m_electricEquipmentScheduleDZ);
  gridLayout->addWidget(label,row,leftCol);
  gridLayout->addWidget(m_electricEquipmentScheduleDZ,row+1,leftCol);

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Gas Equipment");
  m_gasEquipmentScheduleVC = new GasEquipmentScheduleVC();
  m_vectorControllers.push_back(m_gasEquipmentScheduleVC);
  m_gasEquipmentScheduleDZ = new OSDropZone(m_gasEquipmentScheduleVC);
  m_dropZones.push_back(m_gasEquipmentScheduleDZ);
  gridLayout->addWidget(label,row,rightCol);
  gridLayout->addWidget(m_gasEquipmentScheduleDZ,row+1,rightCol);

  row += 2;

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Hot Water Equipment");
  m_hotWaterEquipmentScheduleVC = new HotWaterEquipmentScheduleVC();
  m_vectorControllers.push_back(m_hotWaterEquipmentScheduleVC);
  m_hotWaterEquipmentScheduleDZ = new OSDropZone(m_hotWaterEquipmentScheduleVC);
  m_dropZones.push_back(m_hotWaterEquipmentScheduleDZ);
  gridLayout->addWidget(label,row,leftCol);
  gridLayout->addWidget(m_hotWaterEquipmentScheduleDZ,row+1,leftCol);

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Steam Equipment");
  m_steamEquipmentScheduleVC = new SteamEquipmentScheduleVC();
  m_vectorControllers.push_back(m_steamEquipmentScheduleVC);
  m_ventilationPerPersonScheduleDZ = new OSDropZone(m_steamEquipmentScheduleVC);
  m_dropZones.push_back(m_ventilationPerPersonScheduleDZ);
  gridLayout->addWidget(label,row,rightCol);
  gridLayout->addWidget(m_ventilationPerPersonScheduleDZ,row+1,rightCol);

  row += 2;

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Other Equipment");
  m_otherEquipmentScheduleVC = new OtherEquipmentScheduleVC();
  m_vectorControllers.push_back(m_otherEquipmentScheduleVC);
  m_ventilationPerFloorAreaScheduleDZ = new OSDropZone(m_otherEquipmentScheduleVC);
  m_dropZones.push_back(m_ventilationPerFloorAreaScheduleDZ);
  gridLayout->addWidget(label,row,leftCol);
  gridLayout->addWidget(m_ventilationPerFloorAreaScheduleDZ,row+1,leftCol);

  label = new QLabel();
  label->setObjectName("H2");
  label->setText("Infiltration");
  m_infiltrationScheduleVC = new InfiltrationScheduleVC();
  m_vectorControllers.push_back(m_infiltrationScheduleVC);
  m_infiltrationScheduleDZ = new OSDropZone(m_infiltrationScheduleVC);
  m_dropZones.push_back(m_infiltrationScheduleDZ);
  gridLayout->addWidget(label,row,rightCol);
  gridLayout->addWidget(m_infiltrationScheduleDZ,row+1,rightCol);

  row += 2;

  OS_ASSERT(m_vectorControllers.size() == 10);

  configDropZones();

  //QVBoxLayout * mainVLayout = new QVBoxLayout();
  //mainVLayout->setContentsMargins(padding,padding,padding,padding);
  //mainVLayout->setSpacing(0);

  gridLayout->setColumnStretch(2,100);
  gridLayout->setRowStretch(row,100);

  //mainVLayout->addLayout(hLayout);
  //mainVLayout->addLayout(gridLayout);

  auto widget = new QWidget();
  //widget->setLayout(mainVLayout);
  widget->setLayout(gridLayout);

  // ETH@20130222 - Commented out lines below, replacing two with lines immediately below them,
  // to get rid of warning.
  // int index;
  auto hiddenWidget = new QWidget();
  // index = this->stackedWidget()->addWidget(hiddenWidget);
  this->stackedWidget()->addWidget(hiddenWidget);
  // index = this->stackedWidget()->addWidget(widget);
  this->stackedWidget()->addWidget(widget);
}
Ejemplo n.º 21
0
DlRawfileDescTab::DlRawfileDescTab(QWidget* parent, DlProject* dlProject) :
    QWidget(parent),
    dlProject_(dlProject),
    rawSettingsDialog(nullptr),
    fieldSepTOB1Flag_(false)
{
    DEBUG_FUNC_NAME

    variableView_ = new VariableView(this);
    variableModel_ = new VariableModel(variableView_, dlProject_->variables());
    variableDelegate_ = new VariableDelegate(variableView_);

    variableView_->setModel(variableModel_);
    variableView_->setItemDelegate(variableDelegate_);
    variableView_->setSelectionMode(QAbstractItemView::SingleSelection);
    variableView_->setSelectionBehavior(QAbstractItemView::SelectColumns);
    variableView_->setCornerButtonEnabled(false);
    variableView_->setWordWrap(false);

    QHeaderView *hHeaderView = variableView_->horizontalHeader();
    hHeaderView->setDefaultSectionSize(175);
    hHeaderView->setSectionResizeMode(QHeaderView::Fixed);
    hHeaderView->setSectionsClickable(true);
    hHeaderView->setHighlightSections(true);
    hHeaderView->setSectionsMovable(false);

    variableView_->setMinimumHeight(298);
    variableView_->resizeRowsToContents();
    variableView_->resizeColumnsToContents();
    for (int i = 0; i < variableModel_->rowCount(); i++)
    {
        variableView_->verticalHeader()->resizeSection(i, 20);
    }

    auto addButton = new QToolButton;
    addButton->setObjectName(QStringLiteral("plusButton"));
    addButton->setToolTip(tr("<b>+</b> Add a variable."));

    auto removeButton = new QToolButton;
    removeButton->setObjectName(QStringLiteral("minusButton"));
    removeButton->setToolTip(tr("<b>-</b> Remove a variable."));

    auto buttonsLayout = new QVBoxLayout;
    buttonsLayout->addWidget(addButton);
    buttonsLayout->addWidget(removeButton);
    buttonsLayout->addStretch();

    rawSettingsButton = new QPushButton(tr("Raw File Settings..."));
    rawSettingsButton->setProperty("mdButton", true);
    rawSettingsButton->setStyleSheet(QStringLiteral("QPushButton {margin-top: 15px}"));

    clearCustomVarsButton = new QPushButton(tr("Clear Custom Variables"));
    clearCustomVarsButton->setProperty("mdButton", true);
    clearCustomVarsButton->setStyleSheet(QStringLiteral("QPushButton {margin-top: 15px}"));

    auto varLayout = new QGridLayout;
    varLayout->addWidget(variableView_, 0, 0, -1, 1);
    varLayout->addLayout(buttonsLayout, 0, 1, 1, 1);
    varLayout->setColumnStretch(0, 1);
    varLayout->setColumnStretch(1, 0);
    varLayout->setRowStretch(2, 0);
    varLayout->setSizeConstraint(QLayout::SetNoConstraint);

    auto varGroup = new QGroupBox(tr("Data Columns Info"));
    varGroup->setObjectName(QStringLiteral("simpleGroupBox"));
    varGroup->setFlat(true);
    varGroup->setLayout(varLayout);

    auto varScrollArea = new QScrollArea;
    varScrollArea->setWidget(varGroup);
    varScrollArea->setWidgetResizable(true);

    auto mainlayout = new QGridLayout(this);
    mainlayout->setRowMinimumHeight(0, 18);
    mainlayout->addWidget(rawSettingsButton, 1, 0, 1, 1, Qt::AlignTop);
    mainlayout->addWidget(clearCustomVarsButton, 2, 0, 1, 1, Qt::AlignTop);
    mainlayout->addWidget(varScrollArea, 0, 1, -1, -1);
    mainlayout->setRowStretch(3, 1);
    mainlayout->setColumnStretch(1, 1);
    mainlayout->setSizeConstraint(QLayout::SetNoConstraint);
    setLayout(mainlayout);

    connect(variableModel_, &VariableModel::modified, [=]()
            { dlProject_->setModified(true); });

    connect(dlProject, &DlProject::projectModified,
            this, &DlRawfileDescTab::updateModels);

    connect(dlProject, &DlProject::projectChanged,
            this, &DlRawfileDescTab::updateModels);

    connect(addButton, &QToolButton::clicked,
            variableView_, &VariableView::addVar);
    connect(removeButton, &QToolButton::clicked,
            variableView_, &VariableView::removeVar);

    connect(rawSettingsButton, &QPushButton::clicked,
            this, &DlRawfileDescTab::showRawSettingsDialog);

    connect(clearCustomVarsButton, &QPushButton::clicked,[=]()
            { variableDelegate_->clearCustomVariableBuffer(); });

    // to trigger table editing with single click without altering the
    // editTriggers property, because that way the column selection
    // clicking on the header trigger the first cell editor
    connect(variableView_, SIGNAL(clicked(const QModelIndex &)),
            variableView_, SLOT(edit(const QModelIndex &)));
}
void ConstructionFfactorGroundFloorInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit2();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationConstructionWidget(m_isIP, mainGridLayout, row);
  m_standardsInformationWidget->hideFenestration();
  m_standardsInformationWidget->disableFenestration();

  ++row;

  // F-Factor

  label = new QLabel("F-Factor: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_ffactorEdit = new OSQuantityEdit2("W/m*K", "W/m*K", "Btu/hr*ft*R", m_isIP);
  connect(this, &ConstructionFfactorGroundFloorInspectorView::toggleUnitsClicked, m_ffactorEdit, &OSQuantityEdit2::onUnitSystemChange);
  mainGridLayout->addWidget(m_ffactorEdit, row, 0);

  ++row;

  // Area

  label = new QLabel("Area: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_areaEdit = new OSQuantityEdit2("m^2","m^2","ft^2", m_isIP);
  connect(this, &ConstructionFfactorGroundFloorInspectorView::toggleUnitsClicked, m_areaEdit, &OSQuantityEdit2::onUnitSystemChange);
  mainGridLayout->addWidget(m_areaEdit, row, 0);

  ++row;

  // Perimeter Exposed

  label = new QLabel("Perimeter Exposed: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_perimeterExposedEdit = new OSQuantityEdit2("m","m","ft", m_isIP);
  connect(this, &ConstructionFfactorGroundFloorInspectorView::toggleUnitsClicked, m_perimeterExposedEdit, &OSQuantityEdit2::onUnitSystemChange);
  mainGridLayout->addWidget(m_perimeterExposedEdit, row, 0);

  ++row;

  // Stretch

  mainGridLayout->setRowStretch(row, 100);

  mainGridLayout->setColumnStretch(100, 100);
}
void WindowMaterialSimpleGlazingSystemInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // U-Factor

  label = new QLabel("U-Factor: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_uFactor = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialSimpleGlazingSystemInspectorView::toggleUnitsClicked, m_uFactor, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_uFactor,row++,0,1,3);

  // Solar Heat Gain Coefficient

  label = new QLabel("Solar Heat Gain Coefficient: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_solarHeatGainCoefficient = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialSimpleGlazingSystemInspectorView::toggleUnitsClicked, m_solarHeatGainCoefficient, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_solarHeatGainCoefficient,row++,0,1,3);

  // Visible Transmittance

  label = new QLabel("Visible Transmittance: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_visibleTransmittance = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialSimpleGlazingSystemInspectorView::toggleUnitsClicked, m_visibleTransmittance, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_visibleTransmittance,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}