forked from pkaselj/CAN_PacketSniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainView.h
73 lines (55 loc) · 1.58 KB
/
MainView.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
73
#ifndef MAINVIEW_H
#define MAINVIEW_H
#include <QWidget>
#include <QTableWidget>
#include "Structures.h"
#include "can_parser.h"
#include "SerialReader.h"
#include "datalogger.h"
#include <QGridLayout>
#include <QHash>
#include <QtCharts/QChartView>
using GraphTable = QHash<unsigned int, QLine>;
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE
class MainView : public QWidget
{
Q_OBJECT
public:
MainView(QApplication* pMainApplication, QWidget *parent = nullptr);
~MainView();
const int ID_column = 0;
const int value_column = 1;
const int hex_column = 2;
const int unit_column = 3;
const int timestamp_column = 4;
const int endianness_column = 5;
public slots:
Q_SLOT void AddTableEntry(TableEntry tableEntry);
private slots:
void on_btnClearTable_clicked();
void on_btnCAN_DecodeParams_clicked();
void CreateChart(int row, int col);
void on_btnSerialPortSettings_clicked();
void on_chkFreezeFrame_stateChanged(int state);
private:
Ui::Widget *ui;
QApplication* m_pMainApplication;
CAN_Parser* m_pCAN_Parser;
SerialReader* m_pSerialReader;
DataLogger* m_pDataLogger;
QtCharts::QChartView* m_pChartContainer;
QTableWidget* m_pDataTable;
void setupUI();
void setupTable();
void setupCAN_Parser();
void setupSerialReader();
void setupDataLogger();
void setupCharts();
void FreezeFrame();
void UnfreezeFrame();
int ReturnRowID_ifEntryExists(unsigned int packetID);
void EditTableRow(unsigned int row, TableEntry& tableEntry);
};
#endif // MAINVIEW_H