forked from collin80/SavvyCAN
-
Notifications
You must be signed in to change notification settings - Fork 1
/
motorcontrollerconfigwindow.h
69 lines (55 loc) · 1.21 KB
/
motorcontrollerconfigwindow.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
#ifndef MOTORCONTROLLERCONFIGWINDOW_H
#define MOTORCONTROLLERCONFIGWINDOW_H
#include <QDialog>
#include <QTimer>
#include "can_structs.h"
namespace Ui {
class MotorControllerConfigWindow;
}
//Serial_Number_EEPROM , 0x0113, uint, dec, 16, 6, spr, spr, spr
enum PARAM_TYPE
{
DEC,
HEX,
ASCII,
};
enum PARAM_SIGNED
{
UNSIGNED,
SIGNED,
Q15
};
class PARAM
{
public:
QString paramName;
uint32_t paramID;
PARAM_TYPE paramType;
PARAM_SIGNED signedType;
uint16_t value;
};
class MotorControllerConfigWindow : public QDialog
{
Q_OBJECT
public:
explicit MotorControllerConfigWindow(const QVector<CANFrame> *frames, QWidget *parent = 0);
~MotorControllerConfigWindow();
signals:
void sendCANFrame(const CANFrame *, int);
void sendFrameBatch(const QList<CANFrame> *);
private slots:
void updatedFrames(int numFrames);
void refreshData();
void saveData();
void timerTick();
void loadFile();
private:
Ui::MotorControllerConfigWindow *ui;
const QVector<CANFrame> *modelFrames;
QTimer timer;
CANFrame outFrame;
bool doingRequest;
int transmitStep;
QList<PARAM> params;
};
#endif // MOTORCONTROLLERCONFIGWINDOW_H