Yes, I still need to move it into dynamic library and out of the main program.
50 lines
842 B
C++
50 lines
842 B
C++
#ifndef SNIFFERITEM_H
|
|
#define SNIFFERITEM_H
|
|
|
|
#include <QVariant>
|
|
#include <QTime>
|
|
#include "can_structs.h"
|
|
|
|
struct fstCan
|
|
{
|
|
quint64 data;
|
|
int len;
|
|
};
|
|
|
|
enum dc
|
|
{
|
|
NO,
|
|
INC,
|
|
DEINC
|
|
};
|
|
|
|
|
|
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
|