FSM Library - C++ version
MainWindow.h
1 /*
2  * Copyright. GaĆ«l Dottel, Christoph Hilken, and Jan Peleska 2016 - 2021
3  *
4  * Licensed under the EUPL V.1.1
5  */
6 #ifndef FSM_WINDOW_MAINWINDOW_H_
7 #define FSM_WINDOW_MAINWINDOW_H_
8 
9 #include <algorithm>
10 #include <vector>
11 
12 #include <qapplication.h>
13 #include <qerrormessage.h>
14 #include <qfiledialog.h>
15 #include <qinputdialog.h>
16 #include <qmainwindow.h>
17 #include <qmenubar.h>
18 #include <qmessagebox.h>
19 #include <qpainter.h>
20 
21 #include "window/ui_MainWindow.h"
22 #include "fsm/Dfsm.h"
23 #include "fsm/Fsm.h"
24 #include "fsm/InputTrace.h"
25 #include "interface/FsmPresentationLayer.h"
26 #include "trees/OutputTree.h"
27 #include "trees/TestSuite.h"
28 #include "trees/Tree.h"
29 #include "window/OpenFileWindow.h"
30 
31 #define SCALE 0.8
32 
33 namespace Ui
34 {
35  class MainWindow;
36 }
37 
38 class MainWindow : public QMainWindow
39 {
40  Q_OBJECT
41 public:
47  explicit MainWindow(QWidget * parent = 0);
48 
52  ~MainWindow();
53 private:
57  double scaleFactorFsm;
58 
62  double scaleFactorStateCover;
63 
67  double scaleFactorTransitionCover;
68 
72  Ui::MainWindow * ui;
73 
77  std::unique_ptr<OpenFileWindow> openFileWindow;
78 
82  std::shared_ptr<Fsm> currentFsm;
83 
87  int currentIndex;
88 
92  std::vector<std::shared_ptr<Fsm>> fsms;
93 
97  std::map<std::string, std::shared_ptr<TestSuite>> testSuites;
98 
103  void addFsm(std::shared_ptr<Fsm> newFsm);
104 
110  void scaleImage(const double & factor);
111 
116  void createImage();
117 
125  void dotCall(const std::string & name);
126 
131  void updateView();
132 
138  void storeTestCases(const std::string & fileName, const IOListContainer & testCases);
139 
145  void storeTestCase(const std::string & fileName, const std::vector<int> & testCase);
146 
151  IOListContainer readTestCases(const std::string & fileName);
152 
157  std::vector<int> readTestCase(const std::string & line);
158 
164  void storeTestSuite(const std::string & fileName, const TestSuite & testSuite);
165 
171  void storeOutputTree(const std::string & fileName, OutputTree & outputTree);
172 private slots:
177  void changeFsm(const QModelIndex & currentSelection);
178 
182  void openFile();
183 
187  void loadFile();
188 
192  void saveFile();
193 
197  void closeFile();
198 
202  void transformToObservable();
203 
207  void minimise();
208 
212  void calcCaracterisationSet();
213 
217  void intersection();
218 
223  void wpMethod();
224 
229  void wMethod();
230 
234  void createTestSuite();
235 
239  void createOutputTree();
240 
244  void runTestSuiteEquivalence();
245 
249  void runTestSuiteReduction();
250 
254  void zoomIn();
255 
259  void zoomOut();
260 
264  void zoomDefault();
265 };
266 #endif //FSM_WINDOW_MAINWINDOW_H_
Definition: MainWindow.h:33
~MainWindow()
Definition: MainWindow.cpp:48
Definition: OutputTree.h:15
Definition: IOListContainer.h:15
MainWindow(QWidget *parent=0)
Definition: MainWindow.cpp:8
Definition: MainWindow.h:38
Definition: TestSuite.h:15