Commit 889909a7 authored by Huff, Israel's avatar Huff, Israel
Browse files

initial layout of aptens temporarily set up as a tab in example program

parent 268a3e13
Pipeline #97483 passed with stages
in 5 minutes and 25 seconds
......@@ -13,6 +13,7 @@
#include <QInputDialog>
#include <QLabel>
#include <QMessageBox>
#include <QTabWidget>
#include "radixbug/bug.hh"
using namespace rsm;
......@@ -419,13 +420,224 @@ void ExamplePortalWidget::execFinished()
execingCommandType = "";
}
// ----------------------------------------------------------------------------
StyledLabel::StyledLabel(const QString &title, QWidget *parent)
: QLabel(title, parent)
{
setAlignment(Qt::AlignRight);
}
// ----------------------------------------------------------------------------
CenterTitleGroupBox::CenterTitleGroupBox(const QString &title, QWidget *parent)
: QGroupBox(title, parent)
{
setStyleSheet(R"foo(
QGroupBox {
padding: 1.4em 0em 0em 0em;
}
QGroupBox::title {
subcontrol-origin: padding;
subcontrol-position: top center;
padding: 0.7em 0em 0em 0em;
}
)foo");
}
// ----------------------------------------------------------------------------
LeftTitleGroupBox::LeftTitleGroupBox(const QString &title, QWidget *parent)
: QGroupBox(title, parent)
{
setStyleSheet(R"foo(
QGroupBox {
padding: 0em 0em 0em 0em;
}
QGroupBox::title {
subcontrol-origin: padding;
subcontrol-position: top left;
padding: 0.7em 0em 0em 0em;
left: 1em;
}
)foo");
}
// ----------------------------------------------------------------------------
APTEnsWidget::APTEnsWidget(QWidget *parent)
: QWidget(parent)
{
QGridLayout *layout = new QGridLayout(this);
eventDefBox = new CenterTitleGroupBox("Event Definition", this);
yieldEnsBox = new CenterTitleGroupBox("Yield Ensemble", this);
heightOfBurstEnsBox =
new CenterTitleGroupBox("Height of Burst Ensemble", this);
meteorologyBox = new CenterTitleGroupBox("Meteorology", this);
dispPhysEnsBox = new CenterTitleGroupBox("Dispersion Physics Ensemble", this);
turbEnsBox = new CenterTitleGroupBox("Turbulence Ensemble", this);
metEnsBox = new CenterTitleGroupBox("Meteorology Ensemble", this);
int row = 0;
layout->addWidget(eventDefBox, row, 0);
layout->addWidget(yieldEnsBox, ++row, 0);
layout->addWidget(heightOfBurstEnsBox, ++row, 0);
layout->addWidget(meteorologyBox, ++row, 0);
layout->addWidget(dispPhysEnsBox, ++row, 0);
layout->addWidget(turbEnsBox, ++row, 0);
layout->addWidget(metEnsBox, ++row, 0);
// build event definition box
QGridLayout *edLayout = new QGridLayout(eventDefBox);
latLabel = new StyledLabel("Latitude", eventDefBox);
lonLabel = new StyledLabel("Longitude", eventDefBox);
altLabel = new StyledLabel("Altitude", eventDefBox);
soilTypeLabel = new StyledLabel("Soil Type", eventDefBox);
fissionIDLabel = new StyledLabel("Fission ID", eventDefBox);
latLineEdit = new QLineEdit(eventDefBox);
lonLineEdit = new QLineEdit(eventDefBox);
altLineEdit = new QLineEdit(eventDefBox);
soilTypeLineEdit = new QLineEdit(eventDefBox);
fissionIDLineEdit = new QLineEdit(eventDefBox);
row = 0;
edLayout->addWidget(latLabel, row, 0);
edLayout->addWidget(latLineEdit, row, 1);
edLayout->addWidget(lonLabel, row, 2);
edLayout->addWidget(lonLineEdit, row, 3);
edLayout->addWidget(altLabel, ++row, 0);
edLayout->addWidget(altLineEdit, row, 1);
edLayout->addWidget(soilTypeLabel, row, 2);
edLayout->addWidget(soilTypeLineEdit, row, 3);
edLayout->addWidget(fissionIDLabel, ++row, 0);
edLayout->addWidget(fissionIDLineEdit, row, 1);
// build yield ensemble box
QGridLayout *yeLayout = new QGridLayout(yieldEnsBox);
totalYieldLabel = new StyledLabel("Total Yield", yieldEnsBox);
totalYieldLineEdit = new QLineEdit(yieldEnsBox);
yieldDefineEnsCheckBox = new QCheckBox("Define Ensemble", yieldEnsBox);
numYieldsLabel = new StyledLabel("# of Yields", yieldEnsBox);
numYieldsLineEdit = new QLineEdit(yieldEnsBox);
minYieldLabel = new StyledLabel("Min Yields", yieldEnsBox);
minYieldLineEdit = new QLineEdit(yieldEnsBox);
maxYieldLabel = new StyledLabel("Max Yields", yieldEnsBox);
maxYieldLineEdit = new QLineEdit(yieldEnsBox);
yieldSamplingLabel = new StyledLabel("Sampling", yieldEnsBox);
yieldSamplingComboBox = new QComboBox(yieldEnsBox);
yieldSamplingComboBox->addItem("Uniform");
yieldSamplingComboBox->addItem("Gaussian");
row = 0;
yeLayout->addWidget(totalYieldLabel, row, 0);
yeLayout->addWidget(totalYieldLineEdit, row, 1);
yeLayout->addWidget(yieldDefineEnsCheckBox, row, 3);
yeLayout->addWidget(numYieldsLabel, ++row, 0);
yeLayout->addWidget(numYieldsLineEdit, row, 1);
yeLayout->addWidget(minYieldLabel, row, 2);
yeLayout->addWidget(minYieldLineEdit, row, 3);
yeLayout->addWidget(maxYieldLabel, ++row, 0);
yeLayout->addWidget(maxYieldLineEdit, row, 1);
yeLayout->addWidget(yieldSamplingLabel, row, 2);
yeLayout->addWidget(yieldSamplingComboBox, row, 3);
// build height of burst ensemble box
QGridLayout *hobLayout = new QGridLayout(heightOfBurstEnsBox);
hobLabel = new StyledLabel("Height of Burst", heightOfBurstEnsBox);
hobLineEdit = new QLineEdit(heightOfBurstEnsBox);
hobDefineEnsCheckBox = new QCheckBox("Define Ensemble", heightOfBurstEnsBox);
numHOBsLabel = new StyledLabel("# of HoB", heightOfBurstEnsBox);
numHOBsLineEdit = new QLineEdit(heightOfBurstEnsBox);
minHOBLabel = new StyledLabel("Min HoB", heightOfBurstEnsBox);
minHOBLineEdit = new QLineEdit(heightOfBurstEnsBox);
maxHOBLabel = new StyledLabel("Max HoB", heightOfBurstEnsBox);
maxHOBLineEdit = new QLineEdit(heightOfBurstEnsBox);
hobSamplingLabel = new StyledLabel("Sampling", heightOfBurstEnsBox);
hobSamplingComboBox = new QComboBox(heightOfBurstEnsBox);
hobSamplingComboBox->addItem("Uniform");
hobSamplingComboBox->addItem("Gaussian");
row = 0;
hobLayout->addWidget(hobLabel, row, 0);
hobLayout->addWidget(hobLineEdit, row, 1);
hobLayout->addWidget(hobDefineEnsCheckBox, row, 3);
hobLayout->addWidget(numHOBsLabel, ++row, 0);
hobLayout->addWidget(numHOBsLineEdit, row, 1);
hobLayout->addWidget(minHOBLabel, row, 2);
hobLayout->addWidget(minHOBLineEdit, row, 3);
hobLayout->addWidget(maxHOBLabel, ++row, 0);
hobLayout->addWidget(maxHOBLineEdit, row, 1);
hobLayout->addWidget(hobSamplingLabel, row, 2);
hobLayout->addWidget(hobSamplingComboBox, row, 3);
// build meteorology box
QGridLayout *metLayout = new QGridLayout(meteorologyBox);
metFileSetsBox = new LeftTitleGroupBox("File Sets", meteorologyBox);
metFileSetsListWidget = new QListWidget(metFileSetsBox);
QGridLayout *metFSLayout = new QGridLayout(metFileSetsBox);
metAddSetButton = new QPushButton("Add Set", meteorologyBox);
metRemoveSetButton = new QPushButton("Remove Set", meteorologyBox);
metAddButton = new QPushButton("Add", meteorologyBox);
metRemoveButton = new QPushButton("Remove", meteorologyBox);
metFSLayout->addWidget(metFileSetsListWidget);
metFileSetsListWidget->addItem("asdf");
metFileSetsListWidget->addItem("zxcv");
row = 0;
metLayout->addWidget(metFileSetsBox, row, 0, 1, 5);
QWidget *metSpacer = new QWidget(meteorologyBox);
metSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
metLayout->addWidget(metSpacer, ++row, 0);
metLayout->addWidget(metAddSetButton, row, 1);
metLayout->addWidget(metRemoveSetButton, row, 2);
metLayout->addWidget(metAddButton, row, 3);
metLayout->addWidget(metRemoveButton, row, 4);
// dispersion physics ensemble box
QGridLayout *dpeLayout = new QGridLayout(dispPhysEnsBox);
setupCFGsBox = new LeftTitleGroupBox("SETUP.CFG Files", dispPhysEnsBox);
setupCFGsListWidget = new QListWidget(setupCFGsBox);
QGridLayout *dpeSFLayout = new QGridLayout(setupCFGsBox);
setupCFGsImportButton = new QPushButton("Add Set", dispPhysEnsBox);
setupCFGsRemoveButton = new QPushButton("Remove Set", dispPhysEnsBox);
dpeSFLayout->addWidget(setupCFGsListWidget);
setupCFGsListWidget->addItem("asdf");
setupCFGsListWidget->addItem("zxcv");
row = 0;
dpeLayout->addWidget(setupCFGsBox, row, 0, 1, 5);
QWidget *dpeSpacer = new QWidget(dispPhysEnsBox);
dpeSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
dpeLayout->addWidget(dpeSpacer, ++row, 0);
dpeLayout->addWidget(setupCFGsImportButton, row, 1);
dpeLayout->addWidget(setupCFGsRemoveButton, row, 2);
// turbulence ensemble box
QGridLayout *teLayout = new QGridLayout(turbEnsBox);
turbEnsNumLabel = new StyledLabel("Number", turbEnsBox);
turbEnsNumLineEdit = new QLineEdit(turbEnsBox);
QWidget *teSpacer = new QWidget(turbEnsBox);
teSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
teLayout->addWidget(turbEnsNumLabel, 0, 0);
teLayout->addWidget(turbEnsNumLineEdit, 0, 1);
teLayout->addWidget(teSpacer, 0, 2);
// meteorology ensemble box
QGridLayout *meLayout = new QGridLayout(metEnsBox);
metEnsNumLabel = new StyledLabel("Number", metEnsBox);
metEnsNumLineEdit = new QLineEdit(metEnsBox);
QWidget *meSpacer = new QWidget(metEnsBox);
meSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
meLayout->addWidget(metEnsNumLabel, 0, 0);
meLayout->addWidget(metEnsNumLineEdit, 0, 1);
meLayout->addWidget(meSpacer, 0, 2);
}
// ----------------------------------------------------------------------------
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
setGeometry(120, 120, 720, 720);
ExamplePortalWidget *portalView = new ExamplePortalWidget(this);
setCentralWidget(portalView);
QTabWidget *tab = new QTabWidget(this);
ExamplePortalWidget *portalView = new ExamplePortalWidget(tab);
APTEnsWidget *aptEnsView = new APTEnsWidget(tab);
tab->addTab(portalView, "connect");
tab->addTab(aptEnsView, "ensemble");
tab->setCurrentIndex(1);
setCentralWidget(tab);
}
MainWindow::~MainWindow() {}
......
......@@ -3,8 +3,12 @@
#include <QAbstractTableModel>
#include <QButtonGroup>
#include <QCheckBox>
#include <QComboBox>
#include <QGroupBox>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
#include <QMainWindow>
#include <QPushButton>
#include <QRadioButton>
......@@ -92,6 +96,104 @@ class ExamplePortalWidget : public QWidget
void execFinished();
};
class StyledLabel : public QLabel
{
// Q_OBJECT
public:
StyledLabel(const QString &title, QWidget *parent = Q_NULLPTR);
};
class CenterTitleGroupBox : public QGroupBox
{
// Q_OBJECT
public:
CenterTitleGroupBox(const QString &title, QWidget *parent = Q_NULLPTR);
};
class LeftTitleGroupBox : public QGroupBox
{
// Q_OBJECT
public:
LeftTitleGroupBox(const QString &title, QWidget *parent = Q_NULLPTR);
};
class APTEnsWidget : public QWidget
Please register or sign in to reply
{
Q_OBJECT
private:
CenterTitleGroupBox *eventDefBox;
  • Please use the snack-case m_eventDefBox or lazyCamel mEventDefBox for member variables.

Please register or sign in to reply
CenterTitleGroupBox *yieldEnsBox;
CenterTitleGroupBox *heightOfBurstEnsBox;
CenterTitleGroupBox *meteorologyBox;
CenterTitleGroupBox *dispPhysEnsBox;
CenterTitleGroupBox *turbEnsBox;
CenterTitleGroupBox *metEnsBox;
StyledLabel *latLabel;
StyledLabel *lonLabel;
StyledLabel *altLabel;
StyledLabel *soilTypeLabel;
StyledLabel *fissionIDLabel;
QLineEdit *latLineEdit;
QLineEdit *lonLineEdit;
QLineEdit *altLineEdit;
QLineEdit *soilTypeLineEdit;
QLineEdit *fissionIDLineEdit;
StyledLabel *totalYieldLabel;
QLineEdit *totalYieldLineEdit;
QCheckBox *yieldDefineEnsCheckBox;
StyledLabel *numYieldsLabel;
QLineEdit *numYieldsLineEdit;
StyledLabel *minYieldLabel;
QLineEdit *minYieldLineEdit;
StyledLabel *maxYieldLabel;
QLineEdit *maxYieldLineEdit;
StyledLabel *yieldSamplingLabel;
QComboBox *yieldSamplingComboBox;
StyledLabel *hobLabel;
QLineEdit *hobLineEdit;
QCheckBox *hobDefineEnsCheckBox;
StyledLabel *numHOBsLabel;
QLineEdit *numHOBsLineEdit;
StyledLabel *minHOBLabel;
QLineEdit *minHOBLineEdit;
StyledLabel *maxHOBLabel;
QLineEdit *maxHOBLineEdit;
StyledLabel *hobSamplingLabel;
QComboBox *hobSamplingComboBox;
LeftTitleGroupBox *metFileSetsBox;
QListWidget *metFileSetsListWidget;
QPushButton *metAddSetButton;
QPushButton *metRemoveSetButton;
QPushButton *metAddButton;
QPushButton *metRemoveButton;
LeftTitleGroupBox *setupCFGsBox;
QListWidget *setupCFGsListWidget;
QPushButton *setupCFGsImportButton;
QPushButton *setupCFGsRemoveButton;
StyledLabel *turbEnsNumLabel;
QLineEdit *turbEnsNumLineEdit;
StyledLabel *metEnsNumLabel;
QLineEdit *metEnsNumLineEdit;
public:
APTEnsWidget(QWidget *parent = nullptr);
public slots:
// void execOutputReady();
// void execFailed(QString message);
// void execFinished();
};
class MainWindow : public QMainWindow
{
Q_OBJECT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment