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.
65 lines
1.4 KiB
65 lines
1.4 KiB
#ifndef HONALOWLEVELAPI_H
|
|
#define HONALOWLEVELAPI_H
|
|
|
|
#include <QObject>
|
|
#include "include/LowLevel/Setting/Setting.h"
|
|
#include "include/LowLevel/HonaPacket.h"
|
|
|
|
#include "LowLevel/Setting/Setting.h"
|
|
#include "HonaPacket.h"
|
|
#include "QWaitCondition"
|
|
#include "QMutex"
|
|
#include "include/LowLevel/Exception/HonaAlreadyStartedException.h"
|
|
|
|
class HonaLowLevelAPI : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
bool _hsruIsStarted;
|
|
bool _hiruIsStarted;
|
|
HonaSettings _honaSetting;
|
|
QWaitCondition _hsruReadDone, _hsruUpdateAck, _hsruStopEvent;
|
|
QMutex _mutex;
|
|
int _threadSforValue = 0;
|
|
bool _isReaderThreadFree = false;
|
|
bool _isUpdateThreadFree = false;
|
|
quint32 honaRegisterBuffer[8];
|
|
|
|
public:
|
|
explicit HonaLowLevelAPI(QObject* parent = nullptr);
|
|
bool isHsruStarted();
|
|
bool isHiruStarted();
|
|
void deviceReset();
|
|
|
|
void setConfig(HonaSettings* honaSetting);
|
|
HonaSettings getConfig();
|
|
QString getSwVersion();
|
|
QString getDeviceId();
|
|
void hsruStart();
|
|
|
|
void hiruStart();
|
|
void init();
|
|
|
|
bool getHsruIsStarted() const;
|
|
void setHsruIsStarted(bool hsruIsStarted);
|
|
|
|
bool getHiruIsStarted() const;
|
|
void setHiruIsStarted(bool hiruIsStarted);
|
|
|
|
private:
|
|
void writeSettingToRegisters(HonaSettings& settings);
|
|
void setConfig();
|
|
void hsruMainThread();
|
|
void hsruReadThread();
|
|
void hsruUpdateThread();
|
|
int hiruGetDOA();
|
|
|
|
signals:
|
|
void signalToTop(QList<HonaPacket*> honaPacketList, int i, int j);
|
|
//uncrustify off
|
|
public slots:
|
|
//uncrustify on
|
|
};
|
|
|
|
#endif //HONALOWLEVELAPI_H
|
|
|