-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquantaloader.h
More file actions
147 lines (107 loc) · 3.12 KB
/
Copy pathquantaloader.h
File metadata and controls
147 lines (107 loc) · 3.12 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
#ifndef QUANTALOADER_H
#define QUANTALOADER_H
#include <QMainWindow>
#include <QDebug>
#include <QFileDialog>
#include <QProgressBar>
#include <QMessageBox>
#include <QTimer>
#include <QSerialPortInfo>
#include "qs_guidefine.h"
#include "qs_cmdthread.h"
namespace Ui {
class QuantaLoader;
}
class QuantaLoader : public QMainWindow
{
Q_OBJECT
public:
explicit QuantaLoader(QWidget *parent = nullptr);
~QuantaLoader();
private slots:
/*!
* \brief onResponse: Slot catching the answer from serial
* \param s
*/
void onResponse(const QString &s);
/*!
* \brief onSendCmdTimeout. Timeout failure when sending command
* \param s: Error string
*/
void onSendCmdTimeout(const QString &s);
void on_m_btnChoosePanel_clicked();
void on_m_btn_clearUpgradeLog_clicked();
void on_m_btn_ClearCmdPanelLog_clicked();
void on_m_bnt_openDialog_clicked();
private:
Ui::QuantaLoader *ui;
QRect m_RefRect;
QMessageBox m_msgBox;
QTimer m_Tmr_UpdateFWProgBar;
QThread m_workerThread;
QS_CmdThread *m_p_CmdThread;
QS_PanelSection m_guiSection;
bool m_isConnected;
/*!
* \brief setGuiSection: Change the current section of the GUI
* \param _section: Target section
*/
void setGuiSection(QS_PanelSection _section);
/*!
* \brief getGuiSection: Get the current value of the section of the GUI
* \return
*/
QS_PanelSection getGuiSection() {return m_guiSection;}
/*!
* \brief displayCmdSection: Display command section of the GUI
*/
void displayCmdSection();
/*!
* \brief displayFwUpgradeSection: Display FW Upgrade Section of the GUI
*/
void displayFwUpgradeSection();
/*!
* \brief initProgressBar
*/
void initProgressBar();
/*!
* \brief activateProgBar
*/
void activateProgBar();
/*!
* \brief preSendCommand. Prepare the command to be sent to the low layer
* \return: true if the command has correctly send to the low layer
*/
bool preSendCommand(int _cmdId);
/*!
* \brief writeSendToLog: write current send command to serial log
*/
void writeSendToLog();
/*!
* \brief writeReadToLog: Write the command answer to the log
* \param _string
*/
void writeReadToLog(QString _string);
/*!
* \brief enableCmdButton: Enable/Disable all the command buttons on both panels
* \param _enable
*/
void enableCmdButton(bool _enable);
private slots:
void onCmdResultReady(bool _res);
void onFwUpdateUpdateprog();
void on_m_btn_reset_clicked();
void on_m_btn_startUpgrade_clicked();
void on_m_btn_readBoot_clicked();
void on_m_btn_readDID_clicked();
void on_m_btn_readRID_clicked();
void on_m_btn_readFW_clicked();
void on_m_btn_EraseFlash_clicked();
void on_m_btn_ReadFlash_clicked();
void on_m_btn_writeFlash_clicked();
void on_m_btn_startFwUpgrade_clicked();
void on_m_btn_connect_clicked();
signals:
void operate(int _operate);
};
#endif // QUANTALOADER_H