-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwinmain.h
executable file
·230 lines (190 loc) · 5.3 KB
/
winmain.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
219
220
221
222
223
224
225
226
227
228
229
230
#ifndef WINMAIN_H
#define WINMAIN_H
#include <QMainWindow>
#include <iostream>
#include <QDebug>
#include <unistd.h>
#include <QProcess>
#include <QListWidget>
#include <QCloseEvent>
#include <QTimer>
#include "wincredits.h"
#include "wininfotests.h"
#include "wintestplot.h"
#include "utilities.h"
#include "winsettings.h"
#include "data.h"
#define DEBUG
#define NUM_UI_ELEM 2
using namespace std;
namespace Ui {
class WinMain;
}
class WinMain : public QMainWindow
{
Q_OBJECT
public:
explicit WinMain(QWidget *parent = 0);
~WinMain();
private slots:
/**
* @brief Launch the correct script for the test
*/
void on_btn_start_clicked();
/**
* @brief Update Gui during the test session
*/
void update_test();
/**
* @brief Kill the current test.
* After got the current test's pid, the function send the SIGINT signal to the test
* to terminate it.
*/
void kill_process();
/**
* @brief display the info window of the benchmark's tests
*/
void on_actionInfo_benchmark_triggered();
/**
* @brief Handle the end of a single test
* @param exit_status of the test just ended
*/
void handle_test_finished(int exit_status);
/**
* @brief Update the progress bar during the test session
*/
void update_progress_bar();
/**
* @brief get process output and set the startup iterator variable
* for the STARTUP test.
*/
void process_output();
/**
* @brief Change the description and parameters of the test
* for a light benchmark
*/
void on_rbtn_light_clicked();
/**
* @brief Change type_test_t variable of the test and the
* description label properly, based on the type_test_t.
* @param index used to know the test type:
* index 0: throughput-->AGGR
* index 1: reponsivness-->STARTUP
*/
void on_test_selector_currentIndexChanged(int index);
/**
* @brief Change the description and parameters of the test
* for an heavy benchmark.
*/
void on_rbtn_heavy_clicked();
/**
* @brief Open the Settings window
*/
void on_btn_custom_clicked();
/**
* @brief Set the UI and enable custom button
*/
void on_rbtn_custom_clicked();
/**
* @brief clean history of realized test
*/
void on_btn_clean_clicked();
/**
* @brief draw the graph of the selected test
* @param selected
*/
void on_lst_history_itemDoubleClicked(QListWidgetItem *item);
/**
* @brief display credits window
*/
void on_actionCredits_triggered();
private:
/** Main interface */
Ui::WinMain* ui;
/** Settings interface */
WinSettings Win_settings;
/** Info interface */
WinInfoTests Win_info_tests;
/** Plot interface */
WinTestPlot Win_test_plot;
/** Credits interface */
WinCredits Win_credits;
/** Main process variable */
QProcess script_process;
/** Timer for the test*/
QTimer timer_test;
/** Mask that stored the scheduler(s) choosen by the user
* It's never changed, it's used fake_mask instead.
*/
unsigned int real_mask;
/** Mask used to switch to next scheduler for the test.
* It's changed when a single test ends with the
* correct scheduler's mask
*/
unsigned int fake_mask;
QVector<QString> stat_files;
/** QVector of WinTestPlot pointers that stores the plot interfaces
* for the history test
*/
QVector<WinTestPlot*> Win_test_plots;
/** Iterator for the progress bar*/
int startup_iterator;
/**
* @brief Setup the UI when the application starts
*/
void setupGui();
/**
* @brief setup the UI when a test starts
*/
void setupGui_test_start();
/**
* @brief setup the UI when a test ends
*/
void setupGui_test_ended();
/**
* @brief Handle the window's close event
* @param event
*/
void closeEvent (QCloseEvent *event);
/**
* @brief Setup all the UI and disconnect everything when a test
* session ends. Display the graphics stats of the test session just
* ended.
*/
void test_ended();
/**
* @brief read the schedulers' check box to set real and fake mask.
*/
void set_mask();
/**
* @brief enable the scheduler that the user have.
*/
void enable_scheduler_box();
/**
* @brief remove the flag into fake_mask of the next scheduler to process.
* It also set this scheduler into settings of test
* @return false if there aren't scheduler to process.
*/
bool set_scheduler_for_test();
/**
* @brief Setup the test and start the session
*/
void start_test();
/**
* @brief Change the progress bar test depending on the scheduler
* @return QString of the progress bar format test
*/
QString draw_sched_for_progress_bar();
/**
* @brief read the file into the results folder and adds them in the
* listview.
*/
void create_list_history();
/**
* @brief save the stats of the test just finished in a file into the
* result tests folder
* @param settings of the file fust finished
*/
void save_new_stats(const test_settings_t &test);
};
#endif // WINMAIN_H