forked from collin80/SavvyCAN
-
Notifications
You must be signed in to change notification settings - Fork 1
/
framesenderwindow.h
60 lines (52 loc) · 1.58 KB
/
framesenderwindow.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
#ifndef FRAMESENDERWINDOW_H
#define FRAMESENDERWINDOW_H
#include <QDialog>
#include <QTimer>
#include <QElapsedTimer>
#include <QTime>
#include "can_structs.h"
#include "can_trigger_structs.h"
namespace Ui {
class FrameSenderWindow;
}
class FrameSenderWindow : public QDialog
{
Q_OBJECT
public:
explicit FrameSenderWindow(const QVector<CANFrame> *frames, QWidget *parent = 0);
~FrameSenderWindow();
private slots:
void onCellChanged(int, int);
void handleTick();
void enableAll();
void disableAll();
void clearGrid();
void saveGrid();
void loadGrid();
void updatedFrames(int);
private:
Ui::FrameSenderWindow *ui;
QList<FrameSendData> sendingData;
QHash<int, CANFrame> frameCache; //hash with frame ID as the key and the most recent frame as the value
const QVector<CANFrame> *modelFrames;
QTimer *intervalTimer;
QElapsedTimer elapsedTimer;
bool inhibitChanged = false;
void createBlankRow();
void doModifiers(int);
int fetchOperand(int, ModifierOperand);
CANFrame* lookupFrame(int, int);
void processModifierText(int);
void processTriggerText(int);
void parseOperandString(QStringList tokens, ModifierOperand&);
ModifierOperationType parseOperation(QString);
void saveSenderFile(QString filename);
void loadSenderFile(QString filename);
void updateGridRow(int idx);
void processCellChange(int line, int col);
void buildFrameCache();
void processIncomingFrame(CANFrame *frame);
bool eventFilter(QObject *obj, QEvent *event);
void setupGrid();
};
#endif // FRAMESENDERWINDOW_H