-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplicatinconfigure.h
407 lines (330 loc) · 11.3 KB
/
applicatinconfigure.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
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
#ifndef APPLICATINCONFIGURE_H
#define APPLICATINCONFIGURE_H
#include <QWidget>
#include <QListView>
#include <QSplitter>
#include <QGridLayout>
#include <widgetitle.h>
#include <QStringListModel>
#include <QMouseEvent>
#include <QListWidget>
#include <QScroller>
#include <QScrollBar>
#include <QLabel>
#include <QSpinBox>
#include <QSlider>
#include <QLineEdit>
#include <QComboBox>
#include <QGroupBox>
#include <Windows.h>
#include <QDebug>
#include <QCheckBox>
#include <QButtonGroup>
#include "systemdata.h"
#include <QMessageBox>
#include <QDebug>
#include "wingdi.h"
#include "WinUser.h"
#include "PluginManager/pluginmanagerwidget.h"
class DisplayConfigWidget : public QGridLayout{
Q_OBJECT
public:
class CGammaRamp
{
protected:
HMODULE hGDI32 = NULL;
HMODULE hUser32 = NULL;
HDC hScreenDC;
typedef BOOL (WINAPI *Type_SetDeviceGammaRamp)(HDC hDC, LPVOID lpRamp);
typedef BOOL (WINAPI *Type_GetDeviceGammaRamp)(HDC hDC, LPVOID lpRamp);
typedef HDC (WINAPI *Type_getDC)(HDC hDC);
typedef int (WINAPI *Type_releaseDC)(HDC hDC, LPVOID lpRamp);
Type_GetDeviceGammaRamp pGetDeviceGammaRamp;
Type_SetDeviceGammaRamp pSetDeviceGammaRamp;
Type_getDC pGetDC;
Type_releaseDC pReleaseDC;
public:
CGammaRamp();
~CGammaRamp();
BOOL LoadWinLibrary();
void FreeLibrary();
BOOL LoadLibraryIfNeeded();
BOOL SetDeviceGammaRamp(HDC hDC, LPVOID lpRamp);
BOOL GetDeviceGammaRamp(HDC hDC, LPVOID lpRamp);
HDC getDC(HDC hDC);
BOOL SetBrightness(HDC hDC, WORD wBrightness);
BOOL getBrightness(HDC hDC, WORD wBrightness);
};
public:
DisplayConfigWidget(QWidget *parent = nullptr);
private:
void widgetInit();
void connectSignalAndSlot();
void initialize();
private:
void changedSystemGamma(int);
private:
QLabel *gammaValueLabel = nullptr;
QSpinBox *gammaValueEdit = nullptr;
QSlider *gammaValueSlider = nullptr;
QLabel *modeLabel = nullptr;
QCheckBox *powerSavingModel = nullptr;
QCheckBox *brightLightModel = nullptr;
QButtonGroup *modelButtonGroup = nullptr;
private:
DlsplayData *data = SystemData::getDisplayData();
private slots:
void gammaValueEditChangedSlot(QString);
void gammaValueSliderChangedSlot(int);
void buttonClickedSlot(QAbstractButton *);
};
#if 0
/*光电连接设置*/
class PhotoelectricConfigWidget : public QGridLayout{
Q_OBJECT
public:
PhotoelectricConfigWidget();
private:
void widgetInit();
void connectSignalAndSlot();
void initialize();
private:
QLabel *linkMode = nullptr; //连接方式 (rtsp_transport)tcp/udp/rtp
QComboBox *linkModeComboBox = nullptr;
QLabel *urlLabel = nullptr;
QComboBox *urlComboBox = nullptr;
QLabel *codecMode = nullptr; //编码方式(preset) ultrafast、superfast、veryfast、faster、fast、medium、slow、slower、veryslow、placebo
QComboBox *codecModeComboBox = nullptr;
QLabel *bufferSize = nullptr; //缓冲区大小(buffersize)
QLineEdit *bufferSizeEdit = nullptr;
QLabel *maxDelay = nullptr; //最大延时微秒(maxdelay)
QLineEdit *maxDelayEdit = nullptr;
QLabel *cfrLabel = nullptr; //质量(cfr)
QComboBox *cfrComboBox = nullptr;
QLabel *stimeoutLabel = nullptr; //超时(stimeout)
QLineEdit *stimeoutEdit = nullptr;
QLabel *fpsLabel = nullptr; //fps
QComboBox *fpsComboBox = nullptr;
QPushButton *connectButton = nullptr;
QPushButton *saveButton = nullptr;
private:
PhotoelectricData *data = SystemData::getPhotoelectricData();
private slots:
void linkModelChangedSlot(QString text);
void connectButtonClickedSlot();
void saveButtonClickedSlot();
signals:
void photoelectricConnectSignal();
};
#endif
/*语音告警设置*/
class VoiceAlarmWidget : public QGridLayout{
public:
VoiceAlarmWidget();
private:
void widgetInit();
void connectSignalAndSlot();
private:
QLabel *enableLabel = nullptr;
QCheckBox *enableCheckBox = nullptr;
QCheckBox *disenableCheckBox = nullptr;
QButtonGroup *enableButtonGroup = nullptr;
QLabel *engineLabel = nullptr;
QComboBox *engineComboBox = nullptr;
QLabel *languageLabel = nullptr;
QComboBox *languageComboBox = nullptr;
QLabel *ttsLevelLabel = nullptr;
QCheckBox *infoLevelCheckBox = nullptr;
QCheckBox *worningLevelCheckBox = nullptr;
QCheckBox *errorLevelCheckBox = nullptr;
QLabel *levelSortLabel = nullptr;
QCheckBox *levelSortCheckBox = nullptr;
QCheckBox *orderCheckBox = nullptr;
QLabel *levelBreakLabel = nullptr;
QCheckBox *levelBreakComboBox = nullptr;
QLabel *volumeLabel = nullptr;
QSpinBox *volumeSpinBox = nullptr;
QSlider *volumeSlider = nullptr;
QLabel *rateLabel = nullptr;
QSpinBox *rateSpinBox = nullptr;
QSlider *rateSlider = nullptr;
QLabel *pitchLabel = nullptr;
QSpinBox *pitchSpinBox = nullptr;
QSlider *pitchSlider = nullptr;
private:
TextToSpeedData *data = SystemData::getTextToSpeedData();
};
/*语言设置*/
class LanguageWidget : public QGridLayout{
public:
LanguageWidget();
private:
void widgetInit();
void connectSignalAndSlot();
private:
QLabel *languageSwitchLabel = nullptr;
QComboBox *languageSwitchC0mboBox = nullptr;
QPushButton *selectButton = nullptr;
private:
LanguageData *data = SystemData::getLanguageData();
};
/*地图源设置*/
class MapSourcesWidget : public QGridLayout{
Q_OBJECT
public:
MapSourcesWidget();
private:
void widgetInit();
void connectSignalAndSlot();
void initialize();
private:
QLabel *mapLabel = nullptr;
QComboBox *mapNameComboBox = nullptr;
QLabel *mapTypeLabel = nullptr;
QComboBox *mapTypeComboBox = nullptr;
QLabel *levelLabel = nullptr;
QLabel *mapMinLevelLabel = nullptr;
QSpinBox *mapMinLevelSpinBox = nullptr;
QLabel *mapMaxLevelLabel = nullptr;
QSpinBox *mapMaxLevelSpinBox = nullptr;
QLabel *mapLevelLabel = nullptr;
QSpinBox *mapLevelSpinBox = nullptr;
QPushButton *connectButton = nullptr;
QPushButton *saveButton = nullptr;
private:
MapData *data = SystemData::getMapData();
int lastMinVal = 0;
int lastMaxVal = 21;
int lastDefVal = 17;
private slots:
void mapNameChangedSlot(QString name);
void connectButtonClickedSlot();
void saveButtonClickedSlot();
void spinValueChangedSlot(int val);
signals:
void mapSourcesChangedSignal();
};
/*HUD设置*/
class HUDConfigWidget : public QGridLayout{
public:
HUDConfigWidget();
private:
void widgetInit();
void connectSignalAndSlot();
private:
};
/*快捷键设置*/
class ShortcutsConfigWidget : public QGridLayout{
public:
ShortcutsConfigWidget();
private:
void widgetInit();
void connectSignalAndSlot();
private:
};
/*日志系统设置*/
class LogSystemConfigWidget : public QGridLayout{
public:
LogSystemConfigWidget();
private:
void widgetInit();
void connectSignalAndSlot();
private:
};
/*转发与透传*/
class TransmitWidget : public QGridLayout{
public:
TransmitWidget();
private:
void widgetInit();
void connectSignalAndSlot();
private:
};
/*存储与缓存清理*/
class StorageAndCachingClearWidget: public QGridLayout{
public:
StorageAndCachingClearWidget();
private:
void widgetInit();
void connectSignalAndSlot();
};
/*系统重置*/
class SystemResetWidget : public QGridLayout{
public:
SystemResetWidget();
private:
void widgetInit();
void connectSignalAndSlot();
};
class ApplicatinConfigure : public QWidget
{
Q_OBJECT
public:
class StringListModel : public QStringListModel{
public:
inline StringListModel(QObject *parent = nullptr) : QStringListModel(parent){};
inline QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const{
if(role == Qt::TextAlignmentRole){
return Qt::AlignCenter;
}else{
return QStringListModel::data(index,role);
}
};
};
public:
ApplicatinConfigure(QWidget *parent = nullptr) ;
private:
void initWidget();
void connectSignalAndSlot();
void listWidgetInit();
private:
QListView *actionWidget = nullptr;
QListWidget *listWidget = nullptr;
QSplitter *splitterWidget = nullptr;
QGridLayout *widgetLayout = nullptr;
WidgetTitle *w_title = nullptr;
private:
DisplayConfigWidget *displayConfigWidget = nullptr; //显示设置
// PhotoelectricConfigWidget *photoConfigWidget = nullptr; //光电吊舱参数设置
VoiceAlarmWidget *voiceAlarmConfigWidget = nullptr; //语音告警参数设置
LanguageWidget *languageConfigWidget = nullptr; //语言家设置
MapSourcesWidget *mapSourcesConfigWidget = nullptr; //地图源设置
HUDConfigWidget *hudConfigWidget = nullptr; //HUD显示设置
ShortcutsConfigWidget *shortcutsConfigWidget = nullptr; //系统快捷键设置
LogSystemConfigWidget *logSystemConfigWidget = nullptr; //日志系统设置
TransmitWidget *transmitWidget = nullptr; //转发与透传
StorageAndCachingClearWidget *storageClearWidget = nullptr; //内存清理
SystemResetWidget *systemResetWidget = nullptr; //系统还原
private:
QMap<QString,QListWidgetItem *>widgetMap = {};
StringListModel *listViewModel = nullptr;
protected:
// /**========= 窗口支持鼠标拖动 =========**/
// QPoint dragPosition;
// void mousePressEvent(QMouseEvent *event)
// {
// if (event->button() == Qt::LeftButton) {
// dragPosition = event->globalPos() - frameGeometry().topLeft();
// event->accept();
// }
// };
// void mouseMoveEvent(QMouseEvent *event)
// {
// if (event->buttons() & Qt::LeftButton) {
// move(event->globalPos() - dragPosition);
// event->accept();
// }
// };
public:
signals:
void signalCloseEvent();
public slots:
void addNewWidget(QString,QGridLayout*);
void listWidgetItemPressedSlot(QModelIndex index);
public:
signals:
void mapSourcesChangedSignal(); //地图源设置界面“选择”按钮
void photoelectricConnectSignal(); //光电吊舱参数设置界面"连接"按钮
private slots:
};
#endif // APPLICATINCONFIGURE_H