-
Notifications
You must be signed in to change notification settings - Fork 1
/
centralwidget.h
134 lines (105 loc) · 3.38 KB
/
centralwidget.h
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
61
62
63
64
65
66
67
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef CENTRALWIDGET_H
#define CENTRALWIDGET_H
#include <QWidget>
#include <QGridLayout>
#include <QPushButton>
#include <QTableWidget>
#include <QTreeWidget>
#include <QCheckBox>
#include <QComboBox>
#include <qcustomplot/qcustomplot.h>
#include <plot.h>
#include <QVector>
#include <datamodels.h>
typedef std::vector< std::pair< std::string, std::vector<datamodels::ObsCatElem> > > CatObsTree;
class CentralWidget : public QWidget
{
Q_OBJECT
public:
explicit CentralWidget(QWidget *parent = nullptr);
~CentralWidget();
void clearHighlightConnections();
private:
QGridLayout *grid1, *grid2, *grid3, *grid4, *grid5, *grid6;
QPushButton *next1btn, *next2btn, *next3btn, *next4btn, *next5btn;
QPushButton *reset1btn, *reset2btn, *reset3btn, *reset4btn;
// step 1
QTableWidget *catObsTableView;
QTreeWidget *catObsTreeView;
QPushButton *selObsBtn, *switchObsViewBtn;
QCheckBox *checkOrig, *checkNew;
QVector<QMetaObject::Connection> highlightConnections;
int nrObs;
// step 2
QTableWidget *catCalTableView;
QPushButton *calBeforeBtn, *calAfterBtn;
QComboBox *calBeforeBox, *calAfterBox;
QCustomPlot *calBefore_plot, *calAfter_plot;
int countCalSelected, calSelected;
// step 3
QPushButton *esc_pBtn, *undo_pBtn, *up_pBtn, *down_pBtn, *filtBtn;
Plot *omc_plot;
// step 4
QPushButton *recalcTRB_pBtn;
// step 5
QTextEdit *polyTable;
QCustomPlot *residDist_plot, *nql_plot;
// step 6
QTextEdit *npt_content, *frd_content;
QLabel *nptf_label, *frdf_label;
QPushButton *send;
signals:
void plotOmcResult(bool save, DropFlags df, int npointsleft);
public slots:
void setup1();
void reset1();
void setup2();
void checkReady2();
void reset2();
void setup3();
void reset3();
void setup4();
void reset4();
void setup5();
void setup6();
void updateCatCalTable(std::vector<datamodels::CalCatElem> &cat, QTableWidget* table);
void updateCatObsTable(std::vector<datamodels::ObsCatElem> &cat, QTableWidget *table);
void updateCatObsTreeView(std::vector<datamodels::ObsCatElem>& cat);
void obsHighlighted(int,int);
void plotOmc(QVector<double> X, QVector<double> Y, QString h1, QString h2);
void onPlotOmcFinished(bool save);
void showPolyFitTable(QString content);
};
namespace centralwidget {
// ------------Classes useful for CentralWidget------------------
// this class derivered from QTableWidgetItem for unique customization of table cells
class CatTableItem : public QTableWidgetItem
{
public:
explicit CatTableItem(const QString &text, int type = Type);
virtual ~CatTableItem();
};
// this class derivered from QLabel for unique customization of step titles
class CustomTitle : public QLabel
{
public:
explicit CustomTitle(const QString& text, QWidget* parent=nullptr);
virtual ~CustomTitle();
};
// this class represents button serving to expand/collapse nested content in tree
class QtCategoryButton : public QPushButton
{
Q_OBJECT
public:
QtCategoryButton(const QString& a_Text, QTreeWidget* a_pParent, QTreeWidgetItem* a_pItem)
: QPushButton(a_Text, a_pParent), m_pItem(a_pItem)
{
connect(this, &QtCategoryButton::pressed, this, [&](){
m_pItem->setExpanded( !m_pItem->isExpanded() );
});
}
private:
QTreeWidgetItem* m_pItem;
};
}
#endif // CENTRALWIDGET_H