aptenswidget.hh 3.37 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef RSM_RSMWIDGETSEXAMPLE_APTENSWIDGET_HH_
#define RSM_RSMWIDGETSEXAMPLE_APTENSWIDGET_HH_

#include <QCheckBox>
#include <QComboBox>
#include <QGroupBox>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
#include <QPushButton>

#include "aptensdatamodel.hh"

namespace AptEns
{
class StyledLabel : public QLabel
{
 public:
  StyledLabel(const QString &title, QWidget *parent = Q_NULLPTR);
};

class CenterTitleGroupBox : public QGroupBox
{
 public:
  CenterTitleGroupBox(const QString &title, QWidget *parent = Q_NULLPTR);
};

class LeftTitleGroupBox : public QGroupBox
{
 public:
  LeftTitleGroupBox(const QString &title, QWidget *parent = Q_NULLPTR);
};

class LineEditFocusSelectAll : public QLineEdit
{
 public:
  LineEditFocusSelectAll(QWidget *parent = Q_NULLPTR);
  LineEditFocusSelectAll(const QString &text, QWidget *parent = Q_NULLPTR);

 protected:
  void focusInEvent(QFocusEvent *event) override;
};

class APTEnsWidget : public QWidget
{
  Q_OBJECT

 private:
  APTEnsDataModel mDataModel;

  CenterTitleGroupBox *mEventDefBox;
  CenterTitleGroupBox *mYieldEnsBox;
  CenterTitleGroupBox *mHeightOfBurstEnsBox;
  CenterTitleGroupBox *mMeteorologyBox;
  CenterTitleGroupBox *mDispPhysEnsBox;
  CenterTitleGroupBox *mTurbEnsBox;
  CenterTitleGroupBox *mMetEnsBox;

  StyledLabel *mLatLabel;
  LineEditFocusSelectAll *mLatLineEdit;
61
  StyledLabel *mLonLabel;
62
  LineEditFocusSelectAll *mLonLineEdit;
63
  StyledLabel *mAltLabel;
64
  LineEditFocusSelectAll *mAltLineEdit;
65
  StyledLabel *mSoilTypeLabel;
66
  QComboBox *mSoilTypeComboBox;
67
  StyledLabel *mFissionIDLabel;
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
  QComboBox *mFissionIDComboBox;

  StyledLabel *mTotalYieldLabel;
  LineEditFocusSelectAll *mTotalYieldLineEdit;
  // TODO: enable/disable all other controls in group box
  QCheckBox *mYieldDefineEnsCheckBox;
  StyledLabel *mNumYieldsLabel;
  LineEditFocusSelectAll *mNumYieldsLineEdit;
  StyledLabel *mMinYieldLabel;
  LineEditFocusSelectAll *mMinYieldLineEdit;
  StyledLabel *mMaxYieldLabel;
  LineEditFocusSelectAll *mMaxYieldLineEdit;
  StyledLabel *mYieldSamplingLabel;
  QComboBox *mYieldSamplingComboBox;

  StyledLabel *mHOBLabel;
  LineEditFocusSelectAll *mHOBLineEdit;
  // TODO: enable/disable all other controls in group box
  QCheckBox *mHOBDefineEnsCheckBox;
  StyledLabel *mNumHOBsLabel;
  LineEditFocusSelectAll *mNumHOBsLineEdit;
  StyledLabel *mMinHOBLabel;
  LineEditFocusSelectAll *mMinHOBLineEdit;
  StyledLabel *mMaxHOBLabel;
  LineEditFocusSelectAll *mMaxHOBLineEdit;
  StyledLabel *mHOBSamplingLabel;
  QComboBox *mHOBSamplingComboBox;

  LeftTitleGroupBox *mMetFileSetsBox;
  QListWidget *mMetFileSetsListWidget;
  QPushButton *mMetAddSetButton;
  QPushButton *mMetRemoveSetButton;
  QPushButton *mMetAddButton;
  QPushButton *mMetRemoveButton;

  LeftTitleGroupBox *mSetupCfgsBox;
  QListWidget *mSetupCfgsListWidget;
  QPushButton *mSetupCfgsImportButton;
  QPushButton *mSetupCfgsRemoveButton;

  StyledLabel *mTurbEnsNumLabel;
  LineEditFocusSelectAll *mTurbEnsNumLineEdit;

  StyledLabel *mMetEnsNumLabel;
  LineEditFocusSelectAll *mMetEnsNumLineEdit;

  void readInputsFromDM();

 public:
  APTEnsWidget(QWidget *parent = nullptr);

 public slots:
120
121
  void yieldDefineEnsStateChange(int state);
  void hobDefineEnsStateChange(int state);
122
123
124
125
126

  void addMeteorologyFile();
  void removeMeteorologyFile();
  void importSetupCfgFile();
  void removeSetupCfgtFile();
127
128
129
130
};
}  // namespace AptEns

#endif  // RSM_RSMWIDGETSEXAMPLE_APTENSWIDGET_HH_