You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.9 KiB

3 years ago
#ifndef HONALOWLEVELAPI_H
#define HONALOWLEVELAPI_H
#include <QObject>
3 years ago
#include "include/LowLevel/Setting/Setting.h"
#include "include/LowLevel/HonaPacket.h"
3 years ago
#include "LowLevel/Setting/Setting.h"
#include "HonaPacket.h"
#include "QWaitCondition"
#include "QMutex"
#include "include/LowLevel/HonaPacket.h"
#include "include/Wrapper/PlxWrapper.h"
3 years ago
3 years ago
class HonaLowLevelAPI : public QObject
{
3 years ago
Q_OBJECT
3 years ago
private:
3 years ago
bool _hsruIsStarted;
bool _hiruIsStarted;
3 years ago
HonaSettings _honaSetting;
3 years ago
QWaitCondition _hsruReadDone, _hsruUpdateAck, _hsruStopEvent;
QMutex _mutex;
int _threadSforValue = 0;
bool _isReaderThreadFree = false;
bool _isUpdateThreadFree = false;
QVector<quint32> honaRegisterBuffer;
QList<HonaPacket> honaPacketList;
PlxWrapper plxwrapper;
quint32 hsruLoss = 0;
static quint32 packetLenInt123C;
static quint32 packetLenRes123C;
static quint32 packetLenIntS;
static quint32 packetLenResS;
3 years ago
3 years ago
public:
3 years ago
explicit HonaLowLevelAPI(QObject* parent = nullptr);
bool isHsruStarted();
bool isHiruStarted();
void deviceReset();
3 years ago
3 years ago
void setConfig(HonaSettings* honaSetting);
HonaSettings getConfig();
3 years ago
QString getSwVersion();
QString getDeviceId();
void hsruStart();
3 years ago
3 years ago
void hiruStart();
void init();
3 years ago
bool getHsruIsStarted() const;
void setHsruIsStarted(bool hsruIsStarted);
3 years ago
bool getHiruIsStarted() const;
void setHiruIsStarted(bool hiruIsStarted);
3 years ago
private:
3 years ago
void writeSettingToRegisters(HonaSettings& settings);
3 years ago
void setConfig();
void hsruMainThread();
void hsruReadThread();
void hsruUpdateThread();
int hiruGetDOA();
3 years ago
void hsruReaderMethod();
QVector<quint32> hsruReadHonaBuffer(honaReceivers receiver);
quint32 hsruParserInt123C(quint32 honaData,QList<HonaPacket> honaPacketList);
signals:
3 years ago
void signalToTop(QList<HonaPacket*> honaPacketList, int i, int j);
//uncrustify off
public slots:
3 years ago
//uncrustify on
3 years ago
};
#endif //HONALOWLEVELAPI_H