-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwidget.h
72 lines (56 loc) · 1.46 KB
/
mainwidget.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
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
#include <QWidget>
#include "chart/chart.h"
#include "widgets/labelinput.h"
#include <QPushButton>
#include <QComboBox>
#include "serial.h"
#include "datasource.h"
#include "protocol/params.h"
#include "protocol/datas.h"
class MainWidget : public QWidget
{
Q_OBJECT
public:
MainWidget(QWidget *parent = nullptr);
~MainWidget();
private:
QWidget* makeLeftUI();
QWidget* makeRightUI();
private:
PARAMS_T m_params;
Serial *m_serial;
DataSource *m_ds;
Chart *m_angleChart;
Chart *m_velocityChart;
Chart *m_motorACurrentChart;
Chart *m_motorBCurrentChart;
QComboBox *m_serialSelecter;
QComboBox *m_motorSelecter;
QComboBox *m_modeSelecter;
QPushButton *m_readParamsButton;
QPushButton *m_writeParamsButton;
QPushButton *m_startButton;
QPushButton *m_stopButton;
QPushButton *m_openSerialButton;
QPushButton *m_updateParamsButton;
LabelInput *m_angle;
LabelInput *m_angleP;
LabelInput *m_angleI;
LabelInput *m_angleD;
LabelInput *m_velocity;
LabelInput *m_velocityP;
LabelInput *m_velocityI;
LabelInput *m_velocityD;
LabelInput *m_currentP;
LabelInput *m_currentI;
LabelInput *m_currentD;
private:
void loadParams(); // 将Params中的数据更新到界面
protected:
void paintEvent(QPaintEvent *event) override;
public slots:
void onParseDataFinish(const DATAS_T& data);
};
#endif // MAINWIDGET_H