File: flowviewwindow.h

package info (click to toggle)
savvycan 220-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,456 kB
  • sloc: cpp: 61,803; sh: 293; javascript: 91; python: 44; makefile: 8
file content (97 lines) | stat: -rw-r--r-- 2,415 bytes parent folder | download
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
#ifndef FLOWVIEWWINDOW_H
#define FLOWVIEWWINDOW_H

#include <QDialog>
#include <QLocale>
#include <QSlider>
#include "qcustomplot.h"
#include "can_structs.h"

namespace Ui {
class FlowViewWindow;
}

enum TABLE_BYTE
{
    BKEY,
    CURR,
    REF,
    TRIGGER,
    GRAPH_EN,
    GRAPH_COLOR,
};

class FlowViewWindow : public QDialog
{
    Q_OBJECT

public:
    explicit FlowViewWindow(const QVector<CANFrame> *frames, QWidget *parent = 0);
    ~FlowViewWindow();
    void showEvent(QShowEvent*);

private slots:
    void btnBackOneClick();
    void btnPauseClick();
    void btnReverseClick();
    void btnStopClick();
    void btnPlayClick();
    void btnFwdOneClick();
    void changePlaybackSpeed(int newSpeed);
    void changeLooping(bool check);
    void timerTriggered();
    void changeID(QString);
    void updatedFrames(int);
    void contextMenuRequestFlow(QPoint pos);
    void contextMenuRequestGraph(QPoint pos);
    void saveFileFlow();
    void saveFileGraph();
    void plottableDoubleClick(QCPAbstractPlottable* plottable, QMouseEvent* event);
    void gotCenterTimeID(uint32_t ID, double timestamp);
    void gotCellClick(int bitPosition);
    void graphRangeChanged(int range);
    void handleTableCellChange(int row, int col);
    void selectAllGraphs();
    void selectNoGraphs();

signals:
    void sendCenterTimeID(uint32_t ID, double timestamp);

private:
    Ui::FlowViewWindow *ui;
    QList<quint32> foundID;
    QList<CANFrame> frameCache;
    const QVector<CANFrame> *modelFrames;
    unsigned char refBytes[64];
    unsigned char currBytes[64];
    int triggerValues[64];
    uint64_t triggerBits[64];
    int currentPosition;
    QTimer *playbackTimer;
    bool playbackActive;
    bool playbackForward;
    static const QColor graphColors[8];
    bool secondsMode;
    bool openGLMode;
    bool useHexTicker;
    QVector<double> x[64], y[64];
    QCPGraph *graphRef[64];
    bool inhibitChangeCallback;

    void refreshIDList();
    void updateFrameLabel();
    void updatePosition(bool forward);
    void processNewPosition();
    void gotoFrame(int frame);
    void updateDataView();
    void removeAllGraphs();
    void createGraph(int);
    void updateGraphLocation();
    void closeEvent(QCloseEvent *event);
    void readSettings();
    void writeSettings();
    bool eventFilter(QObject *obj, QEvent *event);
    void setupByteTable(int bytes);
};

#endif // FLOWVIEWWINDOW_H