-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
218 lines (185 loc) · 5.32 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtConcurrent/QtConcurrent>
#include <QFileDialog>
#include <QMessageBox>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <QSyntaxHighlighter>
#include <QTemporaryFile>
#include "highlighter.h"
#include "codeeditor.h"
#include "ui_about.h"
#include "verificationrun.h"
#include "simulationrun.h"
#include "syntaxrun.h"
#include "settingswindow.h"
#include "ui_mainwindow.h"
#ifdef __linux__
#define OS "linux"
#else
#define OS "nonLinux"
#endif
using namespace std;
using boost::spirit::standard::space;
typedef parser::p_grammar<std::string::const_iterator> p_grammar;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void runSyntax(QString ltl);
private:
settingsWindow* settings = new settingsWindow();
QString ltl = "";
QString path;
QString LTLpath;
QString filename;
QStatusBar *status;
CodeEditor *editor;
QTextEdit *outputLog;
QRadioButton *radioSafety;
QRadioButton *radioAcceptance;
QRadioButton *radioLiveness;
QRadioButton* radioInteractive;
QRadioButton* radioGuided;
QCheckBox *checkFair;
QCheckBox *checkHSize;
QCheckBox *checkOptDepth;
QCheckBox *checkSaveDepth;
QSpinBox *spinBoxHSize;
QSpinBox *spinBoxSteps;
QSpinBox *spinBoxSDepth;
QComboBox *comboBoxSearch;
QComboBox *comboBoxMem;
QListWidget *simulationSteps;
QListWidget *simulationSteps_I;
QListWidget *listChoises;
QProcess *process;
SyntaxRun *syntaxRun;
VerificationRun *verificationRun;
SimulationRun *simulationRun;
SimulationRun *interactiveRun;
QFile file;
QTemporaryDir tempDir;
QString tempFilePath = tempDir.path();
QString tempFilename = "promela.pml";
QFile LTLfile; // Could be local
int selectedLtl;
SimulationRun::SimulationType simType;
VerificationRun::VerificationType verType;
QListWidget* ltlList;
QStringList compileOpts;
QStringList runOpts;
QTableWidget* variableTable;
QTableWidget* processTable;
QTableWidget* variableTable_I;
QTableWidget* processTable_I;
QAction* actionCheckSyntax;
QPushButton* newltlButton;
QPushButton* deleteltlButton;
QPushButton* buttonForwardSim;
QPushButton* buttonBackSim;
QPushButton* buttonVerify;
QPushButton* buttonRandomSim;
QPushButton* buttonInteractiveSim;
QGroupBox* groupBox_log;
// Verification tab
QLabel *spinVerLabel;
QLabel *evalLabel;
QLabel *partialLabel;
QLabel *neverLabel;
QLabel *assertionLabel;
QLabel *acceptanceLabel;
QLabel *invalidLabel;
QLabel *simulationTypeLabel;
QLabel *fileLabel;
QLabel *fileLabel_I;
QLabel *CycleTypeLabel;
QLabel * errorLabel;
QLabel * depthLabel;
QLabel * storedstatesLabel;
QLabel * matchedstatesLabel;
QLabel * transitionLabel;
QLabel * atomicLabel;
QLabel * statesizeLabel;
QLabel * hashconflictsLabel;
QLabel * hashsizeLabel;
QLabel * statememoryLabel;
QLabel * hashmemoryLabel;
QLabel * DFSmemoryLabel;
QLabel * totalmemoryLabel;
QLabel * timestampLabel;
bool newVerification = false;
QThread *thread;
Ui::MainWindow *ui;
QStringList getRunOptions();
QStringList getCompileOptions();
QString getLtl();
bool prepareRun(bool clearLog=true);
QThread* connectProcess(SpinRun* run);
void clearVerificationTab();
void clearSimulationTab();
void clearInteractiveTab();
void updateStepList(QListWidget *stepList ,SimulationRun *run);
void updateSimulationTab(SimulationRun *run, QTableWidget *variableTable, QTableWidget *processTable, QListWidget *stepList);
void populateSimulationLists(SimulationRun* run, QTableWidget* variableTable, QTableWidget* processTable, QListWidget *stepList);
void closeEvent(QCloseEvent *event);
int hashSize();
void saveLtlFile();
void iconFallback();
bool saveWarning();
void clearUI();
QString showOpenFileDialog(QString caption, QString filter);
p_grammar grammar;
signals:
void closeProcess();
private slots:
void loadPmlFile();
void loadLtlFile();
void showAbout();
void showSettings();
void saveFile();
void saveFileAs();
void newFile();
void runVerify();
void runSimulation();
void terminateProcess();
void fileCleanup();
void runCheckSyntax();
void processFinished(SpinRun* run);
void processReadReady(SpinRun* run);
void processStatusChange(SpinRun* run);
void displayErrors();
void updateVerificationTab();
void createSimulationTab();
void createInteractiveTab();
void simulationStepForward();
void simulationStepBackwards();
void verify();
void simulation();
void simulationStepClicked();
void runInteractive();
void listChoiseActivated(QModelIndex index);
void newLtl();
void deleteLtl();
void interactiveStepClicked();
void interactive();
void enableRunButtons();
void disableRunButtons();
void processError(QString);
void showHideLog(bool show);
void exit();
bool parserTest();
// void editorTextChanged();
void loadSettings();
void saveSettings();
void clearLog();
void reloadFile();
};
#endif // MAINWINDOW_H