DesignAltHeaderView::DesignAltHeaderView(bool t_isBaseline)
  : OSHeader(new HeaderToggleButton())
{
  setFixedHeight(40);

  QHBoxLayout * mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(5,0,5,0);
  mainHLayout->setSpacing(5);
  mainHLayout->setAlignment(Qt::AlignLeft);
  setLayout(mainHLayout);

  mainHLayout->addWidget(toggleButton);

  QRegExp nameRegex("^\\S.*");
  QRegExpValidator* validator = new QRegExpValidator(nameRegex, this);

  designAltNameEdit = new QLineEdit();
  designAltNameEdit->setAcceptDrops(false);
  designAltNameEdit->setValidator(validator);
  mainHLayout->addWidget(designAltNameEdit);

  removeButton = new SofterRemoveButton();
  mainHLayout->addWidget(removeButton);

  if (t_isBaseline)
  {
    designAltNameEdit->setVisible(false);
    removeButton->setVisible(false);

    QLabel *lbl = new QLabel("Baseline and Measures Applied to All");
    lbl->setStyleSheet("color:#FFFFFF; font:italic bold");
    mainHLayout->addWidget(lbl);
  }

 }
		std::string MatchName(std::vector<std::string> inputTextCollection, const std::string email)
		{
			std::regex nameRegex("^(([a-z]|[A-Z])(([a-z]|[A-Z])*|\\.) *){1,2}([a-z][a-z]+-?)+$");
			std::smatch matchedStrings;
			for each (std::string inputText in inputTextCollection)
			{
				if (std::regex_search(inputText, matchedStrings, nameRegex))
				{
					return MatchEmailToName(matchedStrings, email);
				}
				
			}
			return "";
		}
Пример #3
0
VariableHeaderView::VariableHeaderView(bool t_fixed)
  : OSHeader(new HeaderToggleButton()), measureListView(nullptr), m_fixed(t_fixed)
{
  setFixedHeight(40);


  auto mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(5,0,5,0);
  mainHLayout->setSpacing(5);
  mainHLayout->setAlignment(Qt::AlignLeft);
  setLayout(mainHLayout);
  
  mainHLayout->addWidget(toggleButton);
  
  QRegExp nameRegex("^\\S.*");
  auto validator = new QRegExpValidator(nameRegex, this);

  variableNameEdit = new QLineEdit();
  variableNameEdit->setStyleSheet("font:italic");
  variableNameEdit->setAcceptDrops(false);
  variableNameEdit->setValidator(validator);
  mainHLayout->addWidget(variableNameEdit);

  if (t_fixed)
  {
    measureListView = new OSListView();
    measureListView->setContentsMargins(0,0,0,0);
    mainHLayout->addWidget(measureListView);

    toggleButton->setVisible(false);
    variableNameEdit->setVisible(false);
    setStyleSheet("openstudio--measuretab--VariableHeaderView { background: #F4F4F4; border: 2px solid #A5A5A5; }");
  } else {
    setStyleSheet("openstudio--measuretab--VariableHeaderView { background: #D5D5D5;  }");
  }

  removeButton = new SofterRemoveButton();
  mainHLayout->addWidget(removeButton);

  mainHLayout->addSpacing(50);

  downButton = new DownButton();
  mainHLayout->addWidget(downButton);

  upButton = new UpButton();
  mainHLayout->addWidget(upButton);
}
Пример #4
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);
  }
Пример #5
0
EditRubyMeasureView::EditRubyMeasureView()
  : QWidget()
{
  QVBoxLayout * layout = new QVBoxLayout();
  layout->setContentsMargins(0,0,0,0);
  setLayout(layout);
  QScrollArea * scrollArea = new QScrollArea();
  layout->addWidget(scrollArea);
  scrollArea->setWidgetResizable(true);

  QWidget * scrollWidget = new QWidget();
  scrollWidget->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Preferred);
  scrollArea->setWidget(scrollWidget);

  m_mainVLayout = new QVBoxLayout();
  m_mainVLayout->setContentsMargins(5,5,5,5);
  m_mainVLayout->setSpacing(5);
  m_mainVLayout->setAlignment(Qt::AlignTop);
  scrollWidget->setLayout(m_mainVLayout);

  QLabel * measureOptionTitleLabel = new QLabel("Name");
  measureOptionTitleLabel->setObjectName("H2");
  m_mainVLayout->addWidget(measureOptionTitleLabel);

  QRegExp nameRegex("^\\S.*");
  QRegExpValidator* validator = new QRegExpValidator(nameRegex, this);

  nameLineEdit = new QLineEdit();
  nameLineEdit->setValidator(validator);
  m_mainVLayout->addWidget(nameLineEdit);

  QLabel * descriptionTitleLabel = new QLabel("Description");
  descriptionTitleLabel->setObjectName("H2");
  m_mainVLayout->addWidget(descriptionTitleLabel);

  descriptionTextEdit = new QTextEdit();
  descriptionTextEdit->setFixedHeight(70);
  descriptionTextEdit->setAcceptRichText(false);
  descriptionTextEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  descriptionTextEdit->setTabChangesFocus(true);
  m_mainVLayout->addWidget(descriptionTextEdit);

  QLabel * modelerDescriptionTitleLabel = new QLabel("Modeler Description");
  modelerDescriptionTitleLabel->setObjectName("H2");
  m_mainVLayout->addWidget(modelerDescriptionTitleLabel);

  modelerDescriptionLabel = new QLabel();
  modelerDescriptionLabel->setWordWrap(true);
  m_mainVLayout->addWidget(modelerDescriptionLabel);

  QFrame * line2 = new QFrame();
  line2->setFrameShape(QFrame::HLine);
  line2->setFrameShadow(QFrame::Sunken);
  m_mainVLayout->addWidget(line2);

  QLabel * inputsTitleLabel = new QLabel("Inputs");
  inputsTitleLabel->setObjectName("H2");
  m_mainVLayout->addWidget(inputsTitleLabel);

  m_inputsVLayout = new QVBoxLayout();
  m_inputsVLayout->setContentsMargins(0,0,0,0);
  m_inputsVLayout->setSpacing(10);

  m_mainVLayout->addLayout(m_inputsVLayout);

  m_mainVLayout->addStretch();
}