forked from vedderb/vesc_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boardsetupwindow.h
100 lines (86 loc) · 2.66 KB
/
boardsetupwindow.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
#ifndef BOARDSETUPWINDOW_H
#define BOARDSETUPWINDOW_H
#include <QMainWindow>
#include <QLabel>
#include <QTimer>
#include <QProcess>
#include <QSettings>
#include <QMap>
#include "vescinterface.h"
#include "widgets/pagelistitem.h"
namespace Ui {
class BoardSetupWindow;
}
class BoardSetupWindow : public QMainWindow
{
Q_OBJECT
public:
explicit BoardSetupWindow(QWidget *parent = nullptr);
~BoardSetupWindow();
private slots:
void timerSlot();
void showStatusInfo(QString info, bool isGood);
void showMessageDialog(const QString &title, const QString &msg, bool isGood, bool richText);
void mcConfigCheckResult(QStringList paramsNotSet);
void pingCanRx(QVector<int> devs, bool isTimeout);
void fwUploadStatus(const QString &status, double progress, bool isOngoing);
// void loadMotorConfig(QString &path);
// void loadAppConfig(QString &path);
void on_motorConfigButton_clicked();
void on_appConfigButton_clicked();
void on_bleFirmwareButton_clicked();
void on_serialRefreshButton_clicked();
void on_startButton_clicked();
void on_bootloaderCheckBox_stateChanged();
void on_motorDetectionCheckBox_stateChanged();
void on_motorTolSlider_valueChanged(int value);
void on_appCheckBox_stateChanged();
void on_bleCheckBox_stateChanged();
void valuesReceived(MC_VALUES values, unsigned int mask);
private:
Ui::BoardSetupWindow *ui;
QSettings mSettings;
QString mVersion;
QString mcXmlPath;
QString appXmlPath;
QString testResultMsg;
bool testResult;
VescInterface *mVesc;
QTimer *mTimer;
QLabel *mStatusLabel;
QVector<int> CAN_IDs;
bool CAN_Timeout;
bool is_Bootloader;
bool is_Dual;
int num_VESCs;
QString HW_Name;
MC_VALUES values_now;
int app_enum_old = 0;
ConfigParams *mMcConfig_Target;
ConfigParams *mAppConfig_Target;
int mStatusInfoTime;
bool mKeyLeft;
bool mKeyRight;
bool mMcConfRead;
bool mAppConfRead;
ConfigParams mcConfig_Target;
QMap<QString, int> mPageNameIdList;
void uploadFw(bool allOverCan);
void loadAppConfXML(QString path);
void loadMotorConfXML(QString path);
void resetRoutine();
bool trySerialConnect();
bool tryBootloaderUpload();
bool tryFirmwareUpload();
bool tryBleFirmwareUpload();
bool tryCANScan();
bool tryFOCCalibration();
bool tryTestMotorParameters();
bool tryMotorDirection();
bool tryApplySlaveAppSettings();
bool tryApplyMasterAppSettings();
bool tryRemoteTest();
bool tryFinalDiagnostics();
bool mcConfigOutsideParamBounds(QString paramName, double tolerance);
};
#endif // BOARDSETUPWINDOW_H