61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
#ifndef CANDEVICE_H
|
|
#define CANDEVICE_H
|
|
|
|
#include "defines.h"
|
|
#include <QObject>
|
|
#include "CANAnalyzer.h"
|
|
#include "CANMessage.h"
|
|
#include "PCANInterface.h"
|
|
#include "CANDatabase.h"
|
|
#include <QList>
|
|
#include "PCANBasic.h"
|
|
#include "CANDeviceConfig.h"
|
|
#include "CANDataLogger.h"
|
|
#include "MQTTMessage.h"
|
|
//#include "MQTTClientWrapper.h"
|
|
|
|
class CMQTTClientWrapper;
|
|
class COtarcikCan;
|
|
|
|
class CCANDevice : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit CCANDevice(QObject *parent = 0);
|
|
CCANDevice(CCANDeviceConfig &SysConfig, CMQTTClientWrapper* MQTTClient = 0);
|
|
~CCANDevice();
|
|
|
|
int Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod);
|
|
int Init();
|
|
|
|
public:
|
|
CCANDeviceConfig mDeviceConfigInfo;
|
|
|
|
COtarcikCan *mProgramPtr;
|
|
bool mMessagesListLoaded;
|
|
CCANAnalyzer mCANAnalyzer; //The module that handles the USB puck and decodes the data
|
|
CCANDatabase mCANDatabase; //The device's database loaded from dbc file
|
|
CCANDataLogger mCANDataLogger;
|
|
CMQTTClientWrapper *mCANMQTTClient;
|
|
|
|
QList<CCANMessage*> mMessageList;
|
|
QList<CMQTTMessage> *GetMQTTMessagesList();
|
|
|
|
// CCANDevice &operator=(const CCANDevice *source);
|
|
|
|
int NewMessageParsed();
|
|
|
|
private:
|
|
bool mConfigSet;
|
|
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
};
|
|
|
|
QDataStream &operator<<(QDataStream &out, const CCANDevice &source);
|
|
QDataStream &operator>>(QDataStream &in, CCANDevice &dest);
|
|
|
|
#endif // CANDEVICE_H
|