Commit af1f38c0 authored by Huff, Israel's avatar Huff, Israel
Browse files

aptens changes

- put yield ensemble and HOB ensemble side-by-side
- made soil type and fission id combo boxes with preset lists
- populated data model with initial values and started reading from it while building GUI
parent 3c43ce5f
Pipeline #97534 failed with stages
in 43 seconds
......@@ -477,8 +477,8 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
int row = 0;
layout->addWidget(mEventDefBox, row, 0, 1, 2);
layout->addWidget(mYieldEnsBox, ++row, 0, 1, 2);
layout->addWidget(mHeightOfBurstEnsBox, ++row, 0, 1, 2);
layout->addWidget(mYieldEnsBox, ++row, 0);
layout->addWidget(mHeightOfBurstEnsBox, row, 1);
layout->addWidget(mMeteorologyBox, ++row, 0, 1, 2);
layout->addWidget(mDispPhysEnsBox, ++row, 0, 1, 2);
layout->addWidget(mTurbEnsBox, ++row, 0);
......@@ -494,9 +494,21 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
mLatLineEdit = new QLineEdit(mEventDefBox);
mLonLineEdit = new QLineEdit(mEventDefBox);
mAltLineEdit = new QLineEdit(mEventDefBox);
mSoilTypeLineEdit = new QLineEdit(mEventDefBox);
mFissionIDLineEdit = new QLineEdit(mEventDefBox);
row = 0;
mSoilTypeComboBox = new QComboBox(mEventDefBox);
mFissionIDComboBox = new QComboBox(mEventDefBox);
mSoilTypeComboBox->setEditable(true);
mSoilTypeComboBox->setInsertPolicy(QComboBox::NoInsert);
mSoilTypeComboBox->addItem("siliceous");
mSoilTypeComboBox->addItem("calcareous");
mFissionIDComboBox->setEditable(true);
mFissionIDComboBox->setInsertPolicy(QComboBox::NoInsert);
mFissionIDComboBox->addItem("u235fi");
mFissionIDComboBox->addItem("u238fi");
mFissionIDComboBox->addItem("pu239fi");
mFissionIDComboBox->addItem("u235he");
mFissionIDComboBox->addItem("u238he");
mFissionIDComboBox->addItem("pu239he");
row = 0;
edLayout->addWidget(mLatLabel, row, 0);
edLayout->addWidget(mLatLineEdit, row, 1);
edLayout->addWidget(mLonLabel, row, 2);
......@@ -504,9 +516,9 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
edLayout->addWidget(mAltLabel, ++row, 0);
edLayout->addWidget(mAltLineEdit, row, 1);
edLayout->addWidget(mSoilTypeLabel, row, 2);
edLayout->addWidget(mSoilTypeLineEdit, row, 3);
edLayout->addWidget(mSoilTypeComboBox, row, 3);
edLayout->addWidget(mFissionIDLabel, ++row, 0);
edLayout->addWidget(mFissionIDLineEdit, row, 1);
edLayout->addWidget(mFissionIDComboBox, row, 1);
// build yield ensemble box
QGridLayout *yeLayout = new QGridLayout(mYieldEnsBox);
......@@ -521,12 +533,12 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
mMaxYieldLineEdit = new QLineEdit(mYieldEnsBox);
mYieldSamplingLabel = new StyledLabel("Sampling", mYieldEnsBox);
mYieldSamplingComboBox = new QComboBox(mYieldEnsBox);
mYieldSamplingComboBox->addItem("Uniform");
mYieldSamplingComboBox->addItem("Gaussian");
mYieldSamplingComboBox->addItem("uniform");
mYieldSamplingComboBox->addItem("gaussian");
row = 0;
yeLayout->addWidget(mTotalYieldLabel, row, 0);
yeLayout->addWidget(mTotalYieldLineEdit, row, 1);
yeLayout->addWidget(mYieldDefineEnsCheckBox, row, 3);
yeLayout->addWidget(mYieldDefineEnsCheckBox, row, 2, 1, 2, Qt::AlignRight);
yeLayout->addWidget(mNumYieldsLabel, ++row, 0);
yeLayout->addWidget(mNumYieldsLineEdit, row, 1);
yeLayout->addWidget(mMinYieldLabel, row, 2);
......@@ -550,12 +562,12 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
mMaxHOBLineEdit = new QLineEdit(mHeightOfBurstEnsBox);
mHOBSamplingLabel = new StyledLabel("Sampling", mHeightOfBurstEnsBox);
mHOBSamplingComboBox = new QComboBox(mHeightOfBurstEnsBox);
mHOBSamplingComboBox->addItem("Uniform");
mHOBSamplingComboBox->addItem("Gaussian");
mHOBSamplingComboBox->addItem("uniform");
mHOBSamplingComboBox->addItem("gaussian");
row = 0;
hobLayout->addWidget(mHOBLabel, row, 0);
hobLayout->addWidget(mHOBLineEdit, row, 1);
hobLayout->addWidget(mHOBDefineEnsCheckBox, row, 3);
hobLayout->addWidget(mHOBDefineEnsCheckBox, row, 2, 1, 2, Qt::AlignRight);
hobLayout->addWidget(mNumHOBsLabel, ++row, 0);
hobLayout->addWidget(mNumHOBsLineEdit, row, 1);
hobLayout->addWidget(mMinHOBLabel, row, 2);
......@@ -575,8 +587,6 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
mMetAddButton = new QPushButton("Add", mMeteorologyBox);
mMetRemoveButton = new QPushButton("Remove", mMeteorologyBox);
metFSLayout->addWidget(mMetFileSetsListWidget);
mMetFileSetsListWidget->addItem("asdf");
mMetFileSetsListWidget->addItem("zxcv");
row = 0;
metLayout->addWidget(mMetFileSetsBox, row, 0, 1, 5);
QWidget *metSpacer = new QWidget(mMeteorologyBox);
......@@ -595,8 +605,6 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
mSetupCfgsImportButton = new QPushButton("Add Set", mDispPhysEnsBox);
mSetupCfgsRemoveButton = new QPushButton("Remove Set", mDispPhysEnsBox);
dpeSFLayout->addWidget(mSetupCfgsListWidget);
mSetupCfgsListWidget->addItem("asdf");
mSetupCfgsListWidget->addItem("zxcv");
row = 0;
dpeLayout->addWidget(mSetupCfgsBox, row, 0, 1, 5);
QWidget *dpeSpacer = new QWidget(mDispPhysEnsBox);
......@@ -624,6 +632,40 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
meLayout->addWidget(mMetEnsNumLabel, 0, 0);
meLayout->addWidget(mMetEnsNumLineEdit, 0, 1);
meLayout->addWidget(meSpacer, 0, 2);
readInputsFromDM();
}
void APTEnsWidget::readInputsFromDM()
{
mLatLineEdit->setText(QString::number(mDataModel.latitude()));
mLonLineEdit->setText(QString::number(mDataModel.longitude()));
mAltLineEdit->setText(QString::number(mDataModel.altitude()));
// TODO: fission id
// TODO: soil type
mTotalYieldLineEdit->setText(QString::number(mDataModel.totalYield()));
mNumYieldsLineEdit->setText(QString::number(mDataModel.numYields()));
mMinYieldLineEdit->setText(QString::number(mDataModel.minYield()));
mMaxYieldLineEdit->setText(QString::number(mDataModel.maxYield()));
// TODO: sampling
mHOBLineEdit->setText(QString::number(mDataModel.heightOfBurst()));
mNumHOBsLineEdit->setText(QString::number(mDataModel.numHOBs()));
mMinHOBLineEdit->setText(QString::number(mDataModel.minHOB()));
mMaxHOBLineEdit->setText(QString::number(mDataModel.maxHOB()));
// TODO: sampling
mDataModel.metFileSets().append("asdf");
mDataModel.metFileSets().append("zxcv");
mMetFileSetsListWidget->addItems(mDataModel.metFileSets());
mDataModel.setupCfgs().append("sdfg");
mDataModel.setupCfgs().append("xcvb");
mSetupCfgsListWidget->addItems(mDataModel.setupCfgs());
mTurbEnsNumLineEdit->setText(QString::number(mDataModel.turbEnsNum()));
mMetEnsNumLineEdit->setText(QString::number(mDataModel.metEnsNum()));
}
// ----------------------------------------------------------------------------
......
......@@ -98,24 +98,18 @@ class ExamplePortalWidget : public QWidget
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);
};
......@@ -123,61 +117,59 @@ class LeftTitleGroupBox : public QGroupBox
class APTEnsDataModel
{
private:
double mLatitude;
double mLongitude;
double mAltitude;
double mSoilType;
double mFissionID;
double mTotalYield;
bool mYieldDefEnsemble;
unsigned mNumYields;
double mMinYield;
double mMaxYield;
unsigned mYieldSampling;
double mHeightOfBurst;
bool mHOBDefEnsemble;
unsigned mNumHOBs;
double mMinHOB;
double mMaxHOB;
unsigned mHOBSampling;
double mLatitude = 0.;
double mLongitude = 0.;
double mAltitude = 0.;
QString mSoilType = "";
QString mFissionID = "";
double mTotalYield = 0.;
bool mYieldDefEnsemble = false;
unsigned mNumYields = 0;
double mMinYield = 0.;
double mMaxYield = 0.;
QString mYieldSampling = "";
double mHeightOfBurst = 0.;
bool mHOBDefEnsemble = false;
unsigned mNumHOBs = 0;
double mMinHOB = 0.;
double mMaxHOB = 0.;
QString mHOBSampling = "";
QStringList mMetFileSets;
QStringList mDispPhysSetupCfgs;
QStringList mSetupCfgs;
unsigned mTurbEnsNum;
unsigned mTurbEnsNum = 0;
unsigned mMetEnsNum;
unsigned mMetEnsNum = 0;
public:
APTEnsDataModel();
// getters
double latitude() { return mLatitude; }
double longitude() { return mLongitude; }
double altitude() { return mAltitude; }
double soilType() { return mSoilType; }
double fissionID() { return mFissionID; }
QString soilType() { return mSoilType; }
QString fissionID() { return mFissionID; }
double totalYield() { return mTotalYield; }
bool yieldDefEnsemble() { return mYieldDefEnsemble; }
unsigned numYields() { return mNumYields; }
double minYield() { return mMinYield; }
double maxYield() { return mMaxYield; }
unsigned yieldSampling() { return mYieldSampling; }
QString yieldSampling() { return mYieldSampling; }
double heightOfBurst() { return mHeightOfBurst; }
bool hobDefEnsemble() { return mHOBDefEnsemble; }
unsigned numHOBs() { return mNumHOBs; }
double minHOB() { return mMinHOB; }
double maxHOB() { return mMaxHOB; }
unsigned hobSampling() { return mHOBSampling; }
QString hobSampling() { return mHOBSampling; }
QStringList &metFileSets() { return mMetFileSets; }
QStringList &dispPhysSetupCfgs() { return mDispPhysSetupCfgs; }
QStringList &setupCfgs() { return mSetupCfgs; }
unsigned turbEnsNum() { return mTurbEnsNum; }
......@@ -187,22 +179,22 @@ class APTEnsDataModel
void setLatitude(double a) { mLatitude = a; }
void setLongitude(double a) { mLongitude = a; }
void setAltitude(double a) { mAltitude = a; }
void setSoilType(double a) { mSoilType = a; }
void setFissionID(double a) { mFissionID = a; }
void setSoilType(QString a) { mSoilType = a; }
void setFissionID(QString a) { mFissionID = a; }
void setTotalYield(double a) { mTotalYield = a; }
void setYieldDefEnsemble(bool a) { mYieldDefEnsemble = a; }
void setNumYields(unsigned a) { mNumYields = a; }
void setMinYield(double a) { mMinYield = a; }
void setMaxYield(double a) { mMaxYield = a; }
void setYieldSampling(unsigned a) { mYieldSampling = a; }
void setYieldSampling(QString a) { mYieldSampling = a; }
void setHeightOfBurst(double a) { mHeightOfBurst = a; }
void setHOBDefEnsemble(bool a) { mHOBDefEnsemble = a; }
void setNumHOBs(unsigned a) { mNumHOBs = a; }
void setMinHOB(double a) { mMinHOB = a; }
void setMaxHOB(double a) { mMaxHOB = a; }
void setHOBSampling(unsigned a) { mHOBSampling = a; }
void setHOBSampling(QString a) { mHOBSampling = a; }
void setTurbEnsNum(unsigned a) { mTurbEnsNum = a; }
......@@ -212,7 +204,10 @@ class APTEnsDataModel
class APTEnsWidget : public QWidget
{
Q_OBJECT
private:
APTEnsDataModel mDataModel;
CenterTitleGroupBox *mEventDefBox;
CenterTitleGroupBox *mYieldEnsBox;
CenterTitleGroupBox *mHeightOfBurstEnsBox;
......@@ -229,11 +224,12 @@ class APTEnsWidget : public QWidget
QLineEdit *mLatLineEdit;
QLineEdit *mLonLineEdit;
QLineEdit *mAltLineEdit;
QLineEdit *mSoilTypeLineEdit;
QLineEdit *mFissionIDLineEdit;
QComboBox *mSoilTypeComboBox;
QComboBox *mFissionIDComboBox;
StyledLabel *mTotalYieldLabel;
QLineEdit *mTotalYieldLineEdit;
// TODO: enable/disable all other controls in group box
QCheckBox *mYieldDefineEnsCheckBox;
StyledLabel *mNumYieldsLabel;
QLineEdit *mNumYieldsLineEdit;
......@@ -246,6 +242,7 @@ class APTEnsWidget : public QWidget
StyledLabel *mHOBLabel;
QLineEdit *mHOBLineEdit;
// TODO: enable/disable all other controls in group box
QCheckBox *mHOBDefineEnsCheckBox;
StyledLabel *mNumHOBsLabel;
QLineEdit *mNumHOBsLineEdit;
......@@ -274,6 +271,8 @@ class APTEnsWidget : public QWidget
StyledLabel *mMetEnsNumLabel;
QLineEdit *mMetEnsNumLineEdit;
void readInputsFromDM();
public:
APTEnsWidget(QWidget *parent = nullptr);
......
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