add sniffer

This commit is contained in:
canpadawan
2016-07-07 16:47:43 +02:00
parent e9d3b718c9
commit 314ea0769d
10 changed files with 862 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
#ifndef SNIFFERITEM_H
#define SNIFFERITEM_H
#include <QVariant>
#include <QTime>
#include "can_structs.h"
struct fstCan
{
quint64 data;
int len;
};
enum dc
{
NO,
INC,
DEC
};
class SnifferItem
{
public:
explicit SnifferItem(const CANFrame& pFrame);
virtual ~SnifferItem();
quint64 getId() const;
float getDelta() const;
int getData(uchar i) const;
dc dataChange(uchar) const;
int elapsed() const;
void update(const CANFrame& pFrame);
void updateMarker();
void notch(bool);
private:
quint64 mID;
struct fstCan mLast;
struct fstCan mCurrent;
struct fstCan mLastMarker;
struct fstCan mMarker;
quint64 mNotch;
quint64 mLastTime;
quint64 mCurrentTime;
QTime mTime;
};
#endif // SNIFFERITEM_H