This repository was archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathmainwindow.h
More file actions
278 lines (212 loc) · 7.93 KB
/
mainwindow.h
File metadata and controls
278 lines (212 loc) · 7.93 KB
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
///
/// @file
/// @copyright Copyright (C) 2017, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
///
/// @brief
///
#pragma once
#include "types.h"
#include "globject.h"
#include "appconfig.h"
#include <QMainWindow>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QPushButton>
#include <QTreeWidgetItem>
class GLWidget;
class TCPReceiver;
class FMUReceiver;
class AppConfig;
class OsiParser;
class OsiReader;
class DisplayObjectDialog;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget* parent = nullptr);
~MainWindow();
void LocalUpdate();
signals:
void UpdateGrid();
void UpdateLane();
void ConnectRequested(const QString& ipAddress,
const QString& port,
const DataType dataType);
void ConnectRequested2(const QString& ipAddress,
const QString& port,
const DataType dataType);
void FMUConnectRequested(const QString& ipAddress,
const QString& port,
const QString& fmuPath,
const DataType dataType);
void FMUConnectRequested2(const QString& ipAddress,
const QString& port,
const QString& fmuPath,
const DataType dataType);
void StartPlaybackRequested(const QString& fileName,
const DataType dataType,
const QString& fmuPath);
void StartPlaybackRequested2(const QString& fileName,
const DataType dataType,
const QString& fmuPath);
public slots:
void EnableExport(bool enable);
void EnableExport2(bool enable);
void SaveOSIMsgOverflow(int osiMsgSaveThreshold);
void SaveOSIMsgOverflow2(int osiMsgSaveThreshold);
void ToggleSaveOSIMessage();
void ToggleSaveOSIMessage2();
void Connected(DataType dataType);
void Connected2(DataType dataType);
void Disconnected(const QString& message);
void Disconnected2(const QString& message);
void UpdateSliderRange(int sliderRange);
void UpdateSliderRange2(int sliderRange);
void UpdateSliderValue(int sliderValue);
void UpdateSliderTime(int sliderValue);
void UpdateSliderValue2(int sliderValue);
void UpdateSliderTime2(int sliderValue);
void DisplayObjectInformation(GLObject* object);
void DisplayObjectInformation2(GLObject* object);
void SetTrackingEnabled(bool enable);
void SetTrackingEnabled2(bool enable);
// slots for menu
private slots:
void LockCheckBoxToggled(bool checked);
void ShowGridCheckBoxToggled(bool checked);
void ShowObjectOverview(bool checked);
void ChooseBoundaryLanes();
void ChooseCenterLanes();
void Quit();
private slots:
void RBConnection();
void RBConnection2();
void RBPlayback();
void RBPlayback2();
void CBDataTypeCon(int index);
void CBDataTypePlay(int index);
void CBDataTypeCon2(int index);
void CBDataTypePlay2(int index);
void ToggleShowFOV();
void ToggleShowFOV2();
void CheckBoxFMURx();
void CheckBoxFMURx2();
void LoadFMURxEdited(const QString& text);
void LoadFMURxBrowse();
void LoadFMURxEdited2(const QString& text);
void LoadFMURxBrowse2();
void CheckBoxFMUTx();
void CheckBoxFMUTx2();
void LoadFMUTxEdited(const QString& text);
void LoadFMUTxBrowse();
void LoadFMUTxEdited2(const QString& text);
void LoadFMUTxBrowse2();
void LoadFileEdited(const QString& text);
void LoadFileBrowse();
void LoadFileEdited2(const QString& text);
void LoadFileBrowse2();
void EnableSendToNetwork();
void EnableSendToNetwork2();
void PlayPauseButtonClicked();
void PlayPauseButtonClicked2();
void ShowContextMenu(const QPoint& pos);
void ConnectDisplayObjectInformation(QTreeWidgetItem* , int);
void ConnectDisplayObjectInformation2(QTreeWidgetItem* , int);
void DisplayObjectDialogFinished(int);
void DisplayObjectDialogFinished2(int);
void CombineChannels();
void ShowFOV();
void ShowFOV2();
private:
void closeEvent(QCloseEvent * event);
void ConnectSignalsToSlots();
void EnableSrcRadioButton(bool enable);
void EnableSrcRadioButton2(bool enable);
void ToggleSrcGroups();
void ToggleSrcGroups2();
void EnableSrcGroups(bool enable);
void EnableSrcGroups2(bool enable);
void EnableConnectionGroup1(bool enable);
void EnableConnectionGroup2(bool enable);
void EnablePlaybackGroup1(bool enable);
void EnablePlaybackGroup2(bool enable);
void EnableSlider(bool enable);
void EnableSlider2(bool enable);
void TogglePlayPauseButton();
void TogglePlayPauseButton2();
void CancelSaveOSIMessage();
void CancelSaveOSIMessage2();
void UpdateGLWidgetMessageSource();
void UpdateGLWidgetMessageSource2();
void UpdateFields();
void UpdateFields2();
bool UpdateConfigure();
bool UpdateConfigure2();
void InitLoadConfigure();
void InitComboBoxes();
void InitLaneTypeMenu();
void UpdateLegend();
void InitObjectTree();
void InitObjectTree2();
void InitLegendGroupBox();
QTreeWidgetItem* CreateTreeNode(const QString& text, const ObjectType& type);
void PythonCompare();
void LocalPlayPause();
void LocalPlayPause2();
void Play();
void TogglePause();
void Stop();
void Play2();
void TogglePause2();
void Stop2();
void ResetSliderTime();
void ResetSliderTime2();
QString GetStringFromMilliSecond(int milliSec);
void UpdateCombineChannelMenu();
bool CheckFieldsValidity();
bool CheckFieldsValidity2();
void ShowErrorMessage(const QString& errMsg);
void EnableShowFOV(const bool enable);
void EnableShowFOV2(const bool enable);
// Configurations
AppConfig config_;
// Source come from ethernet or input file
bool isSrcConnection_;
bool isSrcConnection2_;
// Play or Pause
bool isPlaying_;
bool isPlaying2_;
// ethernet connected
bool isConnected_;
bool isConnected2_;
// input file playback
bool isPlayed_;
bool isPlayed2_;
bool isSavingOSI_;
bool isSavingOSI2_;
bool isOverflow_;
bool isOverflow2_;
Ui::MainWindow *ui_;
GLWidget* glWidget_;
TCPReceiver* tcpReceiver_;
FMUReceiver* fmuReceiver_;
OsiReader* reader_;
OsiParser* osiparser_;
GLWidget* glWidget2_;
TCPReceiver* tcpReceiver2_;
FMUReceiver* fmuReceiver2_;
OsiReader* reader2_;
OsiParser* osiparser2_;
QMap<ObjectType, QWidget*> colorWidgets_;
QMap<ObjectType, QTreeWidgetItem*> treeNodes_;
QMap<ObjectType, QTreeWidgetItem*> treeNodes2_;
QIcon playIcon_;
QIcon pauseIcon_;
DisplayObjectDialog* displayObjectDlg_;
DisplayObjectDialog* displayObjectDlg2_;
};