1 #ifndef MOTORCONTROLLERCONFIGWINDOW_H
2 #define MOTORCONTROLLERCONFIGWINDOW_H
3 
4 #include <QDialog>
5 #include <QTimer>
6 #include "can_structs.h"
7 
8 namespace Ui {
9 class MotorControllerConfigWindow;
10 }
11 
12 //Serial_Number_EEPROM                     , 0x0113, uint, dec, 16, 6, spr, spr, spr
13 
14 enum PARAM_TYPE
15 {
16     DEC,
17     HEX,
18     ASCII,
19 };
20 
21 enum PARAM_SIGNED
22 {
23     UNSIGNED,
24     SIGNED,
25     Q15
26 };
27 
28 class PARAM
29 {
30 public:
31     QString paramName;
32     uint32_t paramID;
33     PARAM_TYPE paramType;
34     PARAM_SIGNED signedType;
35     uint16_t value;
36 };
37 
38 
39 class MotorControllerConfigWindow : public QDialog
40 {
41     Q_OBJECT
42 
43 public:
44     explicit MotorControllerConfigWindow(const QVector<CANFrame> *frames, QWidget *parent = 0);
45     ~MotorControllerConfigWindow();
46 
47 signals:
48     void sendCANFrame(const CANFrame *, int);
49     void sendFrameBatch(const QList<CANFrame> *);
50 
51 private slots:
52     void updatedFrames(int numFrames);
53     void refreshData();
54     void saveData();
55     void timerTick();
56     void loadFile();
57 
58 private:
59     Ui::MotorControllerConfigWindow *ui;
60     const QVector<CANFrame> *modelFrames;
61     QTimer timer;
62     CANFrame outFrame;
63     bool doingRequest;
64     int transmitStep;
65     QList<PARAM> params;
66 
67 };
68 
69 #endif // MOTORCONTROLLERCONFIGWINDOW_H
70