-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.h
115 lines (82 loc) · 2.87 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "sshInterface.h"
#include "treemodel.h"
#include "parametermodel.h"
#include "parametereditdelegate.h"
#include <QMainWindow>
#include "QtCore"
#include "QtGui"
#include "QFileDialog"
#include <QSqlTableModel>
#include <QFile>
#include <QHBoxLayout>
#include <QLabel>
#include "plotter.h"
#include "sqlinterface.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_pushConnect_clicked();
void on_pushDisconnect_clicked();
void on_pushRun_clicked();
void on_pushRunOptimizer_clicked();
void on_pushLoadProject_clicked();
void on_pushSaveParameters_clicked();
void on_pushCreateDatabase_clicked();
void on_pushUploadInputs_clicked();
void on_pushExportParameters_clicked();
void on_pushExportResults_clicked();
void closeEvent (QCloseEvent *);
void updateParameterView(const QItemSelection &, const QItemSelection &);
void updateGraphsAndResultSummary();
void clearGraphsAndResultSummary();
//void handleModelSelect(int index);
void copyToClipboard(bool);
void undo(bool);
void updateGraphToolTip(QMouseEvent *event);
void getCurrentRange(QWheelEvent* event);
void parameterWasEdited(ParameterEditAction);
void handleInvoluntarySSHDisconnect();
void log(const QString &);
void logError(const QString &);
void logSSHError(const QString&);
void on_widgetPlotResults_windowTitleChanged(const QString &title);
private:
void setParametersHaveBeenEditedSinceLastSave(bool);
bool runModelProcessLocally(const QString& program, const QStringList& arguments);
void runModel();
void setWeExpectToBeConnected(bool);
void loadParameterDatabase(QString fileName);
bool getDataSets(const char *dbname, const QVector<int> &IDs, const char *table, QVector<QVector<double>> &seriesout, QVector<int64_t> &startdatesout);
void loadParameterData();
void loadResultAndInputStructure(const char *remoteResultDb, const char *RemoteInputDb);
void resetWindowTitle();
void updateRunButtonState();
Ui::MainWindow *ui;
TreeModel *treeParameters_, *treeResults_, *treeInputs_;
ParameterModel *parameterModel_;
ParameterEditDelegate *lineEditDelegate;
Plotter *plotter_;
bool parametersHaveBeenEditedSinceLastSave_ = false;
bool weExpectToBeConnected_ = false;
QVector<ParameterEditAction> editUndoStack_;
QString lastWorkingDirectory_;
QString selectedParameterDbPath_;
bool parameterDbWasSelected_ = false;
QDir projectDirectory_;
SSHInterface *sshInterface_;
SQLInterface projectDb_;
int maxresultID_ = 0;
bool inputFileWasSelected_ = false;
bool inputFileWasUploaded_ = false;
QString selectedInputFilePath_;
};
#endif // MAINWINDOW_H