-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmainwindow.h
More file actions
238 lines (225 loc) · 5.8 KB
/
mainwindow.h
File metadata and controls
238 lines (225 loc) · 5.8 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGlobal>
#include <QMainWindow>
#include <QTimer>
#include <QtSerialPort/QSerialPort>
#include <QDateTime>
#include "slavethread.h"
#include "device.h"
#include "lcdtester.h"
#include "utils.h"
#include "gpiocontroller.h"
#include <QSettings>
namespace Ui {
class MainWindow;
}
class timedialog;
class QIntValidator;
class DeviceDiscoveryDialog;
class LCDTester;
class GpioController;
class epflash;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QString executableName, QWidget *parent = 0);
void closeEvent(QCloseEvent *event) override;
void showEvent(QShowEvent *event) override;
~MainWindow();
private slots:
void SetCurrentTime();
void syncTime();
void OpenLed();
void CloseLed();
void OpenLed2();
void CloseLed2();
void AudioTest();
void RecordTest();
void ChangeVolume();
void EnableBuzzer();
void DisableBuzzer();
void ChangeBuzzerState();
void Enable2Can();
void Disable2Can();
void ChangeCanState();
void RelayNC();
void RelayNO();
void ChangeRelayState();
void VideoTest();
void LCDTest();
void TouchTest();
void ChangeBacklight();
int MaxBacklighValue();
int GetBacklightValue();
void checkCustomBaudRatePolicy(int);
void checkCustomDevicePathPolicy(int);
void updateSettings();
void openSerialPort();
void closeSerialPort();
void clearSerialText();
void rs485Init();
void rs485SendEnable(bool);
void readDate();
void writeDate();
void BluetoothTest();
void ConnmanTest();
void wifiEnable();
void wifiDisable();
void wifiInfoDisplay();
QString getGPIOValue(QString);
void setGPIOValue(QString,QString);
void setGPIOModel(QString,QString);
QString getGPIOValueRaw(QString);
void setGPIOValueRaw(QString,QString);
void setGPIOModelRaw(QString,QString);
void setGPIOInStatu();
void setGPIOOutStatu();
void setGPIOOutAllHigh();
void setGPIOOutAllLow();
void checkCustomCanNumPolicy(int);
void canStart();
void canSend();
void canStop();
void canReceive();
void checkCustom4gNumPolicy(int idx);
void simcom4gEnable();
void mobile4gEnable();
void mobile4gDisable();
void readGPSData();
void gpsEnable();
void gpsDisable();
void gpsInit();
void autoTest();
void getusbInfo();
void getipInfo();
void AudioLoop();
void VideoLoop();
void readalltestresult();
void alltest();
void alltestInit();
void displayInfo();
bool has4GModule();
void check4GModule();
bool checkRK3588CPU(QWidget *);
bool hasBl();
bool checkRelay();
private:
Ui::MainWindow *ui;
QString ledpath;
QString ledpath2;
QString audiopath;
QString cueaudiopath;
QString videopath;
QString buzzerpath;
QString relaypath;
QString volumepath;
QString backlightpath;
QString maxbacklightpath;
QString board;
QString cpuplat;
QString debiancodename;
QString kernelversion;
QString machine;
QString ipaddrpath;
QByteArray autodata;
QIntValidator *intValidator;
timedialog *timeset;
DeviceDiscoveryDialog *bluetoothdialog;
LCDTester *lcd;
Utils utils;
QTimer *setTimeTimer;
QTimer *gpioInStatuTimer;
QTimer *gpioOutStatuTimer;
QTimer *serialReceiveTimer;
QTimer *canReceiveTimer;
QTimer *usbautotestTimer;
QTimer *ipautotestTimer;
QSerialPort *serial;
QSerialPort *serial1;
QSerialPort *serial2;
QSerialPort *serial3;
QSerialPort *serial4;
QSerialPort *atport;
QSerialPort *gpsport;
QSerialPort *fgport;
QTimer *autoTesttimer;
QTimer * readTimer;
QTimer * writeTimer;
QTimer * gpsreadTimer;
QTimer * audioloopTimer;
QTimer * videoloopTimer;
QTimer * alltestTimer;
QTimer *displayinfotimer;
SlaveThread thread;
QVector<GpioController*> out;
QVector<GpioController*> in;
GpioController *buzzer;
bool buzzerflag;
bool relayflag;
bool audioflag;
bool canflag;
bool autoflag;
bool vautoflag;
int lcdwidth;
int lcdheight;
bool ispifive = false;
bool fgisquetel = false;
bool fgissimcom = false;
bool hasbl = true;
QString exeName;
epflash *epflashdialog;
struct serailSettings {
QString name;
qint32 baudRate;
QString stringBaudRate;
QSerialPort::DataBits dataBits;
QString stringDataBits;
QSerialPort::Parity parity;
QString stringParity;
QSerialPort::StopBits stopBits;
QString stringStopBits;
QSerialPort::FlowControl flowControl;
QString stringFlowControl;
};
serailSettings currentSettings;
QString gpioInArray[8];
QString gpioOutArray[4];
void BoardSetting();
QString GetTempFileValue();
QString GetFileValue(QString);
QString GetComResult(QString);
#if QT_VERSION >= QT_VERSION_CHECK(5,15,8)
QString executeShellCommand(const QString &command, const QStringList &arguments);
#endif
QString GetPlat();
QString GetResolution();
QString GetBoard();
QString GetMachine();
QString GetDebianCodeName();
QString GetKernelVersion();
void Delay_MSec_Suspend(int);
void fillPortsParameters();
void gpioExport(QString);
void screenInit();
void boardInit();
void dateTimeInit();
void ledInit();
void audioInit();
void CueAudio();
void displayInit();
void serialInit();
void networkInit();
void networkautotest();
void usbInit();
void gpioInit();
void canInit();
void autotestInit();
void mobile4gInit();
void showRequest(const QString &s);
void showcanRequest(const QString &s);
public:
QSettings *settings;
};
#endif // MAINWINDOW_H