From 6c4d535b92e72af34a7b27c6a1225c06c3119607 Mon Sep 17 00:00:00 2001 From: Mehrabi Date: Wed, 8 Dec 2021 08:21:28 -0500 Subject: [PATCH] Mr Mehrabi add utils, setting,honapacket --- Plx/include/LowLevel/HonaPacket.h | 60 +++++++++++++-- Plx/include/LowLevel/Setting/Setting.h | 41 ++++++++++ Plx/include/LowLevel/Utils/Utils.h | 69 +++++++++++++++++ Plx/src/LowLevel/HonaPacket.cpp | 102 ++++++++++++++++++++++++- 4 files changed, 264 insertions(+), 8 deletions(-) create mode 100644 Plx/include/LowLevel/Setting/Setting.h create mode 100644 Plx/include/LowLevel/Utils/Utils.h diff --git a/Plx/include/LowLevel/HonaPacket.h b/Plx/include/LowLevel/HonaPacket.h index ef819c2..f9ae66a 100644 --- a/Plx/include/LowLevel/HonaPacket.h +++ b/Plx/include/LowLevel/HonaPacket.h @@ -1,17 +1,63 @@ #ifndef HONAPACKET_H #define HONAPACKET_H -#include +#include +#include "include/LowLevel/Utils/Utils.h" -class HonaPacket : public QObject + +class HonaPacket { - Q_OBJECT -public: - explicit HonaPacket(QObject *parent = nullptr); +private: -signals: + qreal toaClock; + honaPacketType m_PacketType; + quint32 m_PacketNumber; + qulonglong m_Toa; + quint32 m_Doa; + quint32 m_Pa1; + quint32 m_Pa2; + quint32 m_Pa3; + quint32 m_Pa4; + quint32 m_Code; + quint32 m_CodeL; + quint32 m_CodeM; -public slots: +public: + HonaPacket(); + /******************************************************************/ + honaPacketType getPacketType(void); + void setPacketType(honaPacketType &temp); + /******************************************************************/ + quint32 getPacketNumber(void); + void setPacketNumber(quint32 temp); + /******************************************************************/ + qulonglong getToa(void); + void setToa(qulonglong temp); + /******************************************************************/ + quint32 getDoa(void); + void setDoa(quint32 temp); + /******************************************************************/ + quint32 getPa1(void); + void setPa1(quint32 temp); + /******************************************************************/ + quint32 getPa2(void); + void setPa2(quint32 temp); + /******************************************************************/ + quint32 getPa3(void); + void setPa3(quint32 temp); + /******************************************************************/ + quint32 getPa4(void); + void setPa4(quint32 temp); + /******************************************************************/ + quint32 getCode(void); + void setCode(quint32 temp); + /******************************************************************/ + quint32 getCodeL(void); + void setCodeL(quint32 temp); + /******************************************************************/ + quint32 getCodeM(void); + void setCodeM(quint32 temp); + /******************************************************************/ }; #endif // HONAPACKET_H diff --git a/Plx/include/LowLevel/Setting/Setting.h b/Plx/include/LowLevel/Setting/Setting.h new file mode 100644 index 0000000..60aae31 --- /dev/null +++ b/Plx/include/LowLevel/Setting/Setting.h @@ -0,0 +1,41 @@ + +#ifndef SETTINGS_H +#define SETTINGS_H + +#include +#include "include/LowLevel/Utils/Utils.h" + +/***********************************************************************************************/ +typedef struct _HIRUSETTINGS +{ + recorderStart recordStard; + recorderMode recordMode; + quint32 recordChannel; + quint32 threshold = 0; + quint32 timeout = 1000; + quint32 count = 5; + +}hiruSettings; +/***********************************************************************************************/ +typedef struct _HSRUSETTINGS +{ + bool isReal = true; + quint32 honaInt123CTHR = 128; + quint32 honaRes123CTHR = 128; + quint32 honaIntSTHR = 20; + quint32 honaResSTHR = 20; + quint32 honaSPTHR = 20; //mode4 + quint32 intM4_THR = 20; //mode4 + quint32 resM4_THR = 20; //mode4 + +}hsruSettings; +/***********************************************************************************************/ +typedef struct _HONASETTINGS +{ + quint32 hsruSettings; + quint32 hiruSettings; + +}honaSettings; +/***********************************************************************************************/ + +#endif // SETTING_H diff --git a/Plx/include/LowLevel/Utils/Utils.h b/Plx/include/LowLevel/Utils/Utils.h new file mode 100644 index 0000000..7bbb95d --- /dev/null +++ b/Plx/include/LowLevel/Utils/Utils.h @@ -0,0 +1,69 @@ +#ifndef UTILS_H +#define UTILS_H + + +/*************************************************************************************************/ +typedef enum _APIRESULT +{ + success, + alreadyStarted, + busy, + error + +}apiResult; +/*************************************************************************************************/ +typedef enum _DRXDEVICEIFCHANNEL +{ + ifChannel11, + ifChannel12 + +}drxDeviceIfChannel; +/*************************************************************************************************/ +typedef enum _HONARECEIVERS +{ + int123C, + intS, + resS, + int4, //Mode 4 + res4, //Mode 4 + signalPulse //Mode 4 + +}honaReceivers; +/*************************************************************************************************/ +typedef enum _RECORDERMODE +{ + signalChannel, + dualChannel + +}recorderMode; +/*************************************************************************************************/ +typedef enum _RECORDSTART +{ + selfTestCounter, + freeRunRecording + +}recorderStart; +/*************************************************************************************************/ +typedef enum _HONAPACKETTYPE +{ + interrogationMode123C, + interrogationModeS56, + interrogationModeS112, + interrogationMode4, + + responseMode123C, + responseModeS56, + responseModeS112, + + responseMode4, + signalPulseMode4 + +}honaPacketType; +/*************************************************************************************************/ + + + + + + +#endif // UTILS_H diff --git a/Plx/src/LowLevel/HonaPacket.cpp b/Plx/src/LowLevel/HonaPacket.cpp index 15c70a3..084f80b 100644 --- a/Plx/src/LowLevel/HonaPacket.cpp +++ b/Plx/src/LowLevel/HonaPacket.cpp @@ -1,6 +1,106 @@ #include "../../include/LowLevel/HonaPacket.h" -HonaPacket::HonaPacket(QObject *parent) : QObject(parent) +HonaPacket::HonaPacket() { } +/*************************************************************************************************/ +honaPacketType HonaPacket::getPacketType(void) +{ + return m_PacketType; +} + void HonaPacket::setPacketType(honaPacketType &temp) +{ + m_PacketType = temp; +} +/*************************************************************************************************/ + quint32 HonaPacket::getPacketNumber(void) + { + return m_PacketNumber; + } + void HonaPacket::setPacketNumber(quint32 temp) + { + m_PacketNumber = temp; + } +/*************************************************************************************************/ + qulonglong HonaPacket::getToa(void) + { + return m_Toa; + } + void HonaPacket::setToa(qulonglong temp) + { + m_Toa = temp; + } +/*************************************************************************************************/ + quint32 HonaPacket::getDoa(void) + { + return m_Doa; + } + void HonaPacket::setDoa(quint32 temp) + { + m_Doa = temp; + } +/*************************************************************************************************/ + quint32 HonaPacket::getPa1(void) + { + return m_Pa1; + } + void HonaPacket::setPa1(quint32 temp) + { + m_Pa1 = temp; + } +/*************************************************************************************************/ + quint32 HonaPacket::getPa2(void) + { + return m_Pa2; + } + void HonaPacket::setPa2(quint32 temp) + { + m_Pa2 = temp; + } +/*************************************************************************************************/ + quint32 HonaPacket::getPa3(void) + { + return m_Pa3; + } + void HonaPacket::setPa3(quint32 temp) + { + m_Pa3= temp; + } +/*************************************************************************************************/ + quint32 HonaPacket::getPa4(void) + { + return m_Pa4; + } + void HonaPacket::setPa4(quint32 temp) + { + m_Pa4= temp; + } +/*************************************************************************************************/ + quint32 HonaPacket::getCode(void) + { + return m_Code; + } + void HonaPacket::setCode(quint32 temp) + { + m_Code = temp; + } +/*************************************************************************************************/ + quint32 HonaPacket::getCodeL(void) + { + return m_CodeL; + } + void HonaPacket::setCodeL(quint32 temp) + { + m_CodeL = temp; + } +/*************************************************************************************************/ + quint32 HonaPacket::getCodeM(void) + { + return m_CodeM; + } + void HonaPacket::setCodeM(quint32 temp) + { + m_CodeM= temp; + } +/*************************************************************************************************/