From f8960c0ea2967b9e153215b9e353e0af458a9296 Mon Sep 17 00:00:00 2001 From: Alireza Date: Wed, 8 Dec 2021 17:02:15 +0330 Subject: [PATCH] add func of HonaLowLevel --- .../LowLevel/Exception/HonaException.h | 23 +++-- Plx/include/LowLevel/HonaLowLevelAPI.h | 29 ++++++- Plx/src/LowLevel/Exception/HonaException.cpp | 6 -- Plx/src/LowLevel/HonaLowLevelAPI.cpp | 85 ++++++++++++++++++- 4 files changed, 124 insertions(+), 19 deletions(-) delete mode 100644 Plx/src/LowLevel/Exception/HonaException.cpp diff --git a/Plx/include/LowLevel/Exception/HonaException.h b/Plx/include/LowLevel/Exception/HonaException.h index 034119a..57f3ce1 100644 --- a/Plx/include/LowLevel/Exception/HonaException.h +++ b/Plx/include/LowLevel/Exception/HonaException.h @@ -1,17 +1,24 @@ #ifndef HONAEXCEPTION_H #define HONAEXCEPTION_H -#include +#include +#include -class HonaException : public QObject +class HonaException : public std::exception { - Q_OBJECT -public: - explicit HonaException(QObject *parent = nullptr); +private: + QString _str; -signals: +public: + HonaException(QString str) + { + _str = str; + } -public slots: + virtual const char* what() const throw() + { + return _str.toStdString().c_str(); + } }; -#endif // HONAEXCEPTION_H +#endif //HONAEXCEPTION_H diff --git a/Plx/include/LowLevel/HonaLowLevelAPI.h b/Plx/include/LowLevel/HonaLowLevelAPI.h index 38947e9..8a5c53f 100644 --- a/Plx/include/LowLevel/HonaLowLevelAPI.h +++ b/Plx/include/LowLevel/HonaLowLevelAPI.h @@ -6,12 +6,33 @@ class HonaLowLevelAPI : public QObject { Q_OBJECT + public: - explicit HonaLowLevelAPI(QObject *parent = nullptr); + explicit HonaLowLevelAPI(QObject* parent = nullptr); + bool isHsruStarted(); + bool isHiruStarted(); + void deviceReset(); + void setConfig(HonaSetting& honaSetting); + HonaSetting getConfig(); + QString getSwVersion(); + QString getDeviceId(); + void hsruStarte(); + void hiruStart(); + void init(); -signals: +private: + void writeSettingToRegisters(HonaSetting& honaSetting); + void setConfig(); + void hsruMainThread(); + void hiruReadThread(); + void hsruUpdateThread(); + int hiruGetDOA(); -public slots: +signals: + void signalToTop(QList<&HonaPacket> honaPacketList, int i, int j); + //uncrustify off +public slots: + //uncrustify on }; -#endif // HONALOWLEVELAPI_H +#endif //HONALOWLEVELAPI_H diff --git a/Plx/src/LowLevel/Exception/HonaException.cpp b/Plx/src/LowLevel/Exception/HonaException.cpp deleted file mode 100644 index 0ce05d2..0000000 --- a/Plx/src/LowLevel/Exception/HonaException.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "../../../include/LowLevel/Exception/HonaException.h" - -HonaException::HonaException(QObject *parent) : QObject(parent) -{ - -} diff --git a/Plx/src/LowLevel/HonaLowLevelAPI.cpp b/Plx/src/LowLevel/HonaLowLevelAPI.cpp index ef38c38..62509d5 100644 --- a/Plx/src/LowLevel/HonaLowLevelAPI.cpp +++ b/Plx/src/LowLevel/HonaLowLevelAPI.cpp @@ -1,6 +1,89 @@ #include "../../include/LowLevel/HonaLowLevelAPI.h" -HonaLowLevelAPI::HonaLowLevelAPI(QObject *parent) : QObject(parent) +HonaLowLevelAPI::HonaLowLevelAPI(QObject* parent) : QObject(parent) { +} +bool HonaLowLevelAPI::isHsruStarted() +{ + return true; } + +/*************************************************************************************************/ +bool HonaLowLevelAPI::isHiruStarted() +{ + return true; +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::deviceReset() +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::setConfig(HonaSetting& honaSetting) +{ +} + +/*************************************************************************************************/ +HonaSetting HonaLowLevelAPI::getConfig() +{ +} + +/*************************************************************************************************/ + +QString HonaLowLevelAPI::getSwVersion() +{ +} + +/*************************************************************************************************/ +QString HonaLowLevelAPI::getDeviceId() +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::hsruStarte() +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::hiruStart() +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::init() +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::writeSettingToRegisters(HonaSetting& honaSetting) +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::setConfig() +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::hsruMainThread() +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::hiruReadThread() +{ +} + +/*************************************************************************************************/ +void HonaLowLevelAPI::hsruUpdateThread() +{ +} + +/*************************************************************************************************/ +int HonaLowLevelAPI::hiruGetDOA() +{ +} + +/*************************************************************************************************/