Style, Doxygen

This commit is contained in:
Klaus Basan
2019-10-22 14:01:41 +02:00
parent 6e42889ecb
commit 767aab6592
13 changed files with 61 additions and 36 deletions

View File

@@ -25,7 +25,7 @@ namespace BlackCore
class BLACKCORE_EXPORT AddPilot : public MessageBase class BLACKCORE_EXPORT AddPilot : public MessageBase
{ {
public: public:
// Constructor //! Constructor
AddPilot(const QString &callsign, const QString &cid, const QString &password, PilotRating rating, int protocolRevision, SimType simType, const QString &realName); AddPilot(const QString &callsign, const QString &cid, const QString &password, PilotRating rating, int protocolRevision, SimType simType, const QString &realName);
//! Get user cid //! Get user cid

View File

@@ -52,7 +52,7 @@ namespace BlackCore
{ {
BlackMisc::CLogMessage(static_cast<AtcDataUpdate *>(nullptr)).warning(u"Wrong number of arguments."); BlackMisc::CLogMessage(static_cast<AtcDataUpdate *>(nullptr)).warning(u"Wrong number of arguments.");
return {}; return {};
}; }
AtcDataUpdate packet(tokens[0], tokens[1].toInt() + 100000, fromQString<CFacilityType>(tokens[2]), tokens[3].toInt(), fromQString<AtcRating>(tokens[4]), AtcDataUpdate packet(tokens[0], tokens[1].toInt() + 100000, fromQString<CFacilityType>(tokens[2]), tokens[3].toInt(), fromQString<AtcRating>(tokens[4]),
tokens[5].toDouble(), tokens[6].toDouble(), tokens[7].toInt()); tokens[5].toDouble(), tokens[6].toDouble(), tokens[7].toInt());

View File

@@ -24,6 +24,8 @@ namespace BlackCore
//! FSD Message: ATC data update //! FSD Message: ATC data update
class BLACKCORE_EXPORT AtcDataUpdate : public MessageBase class BLACKCORE_EXPORT AtcDataUpdate : public MessageBase
{ {
friend bool operator==(const AtcDataUpdate &, const AtcDataUpdate &);
public: public:
//! Constructor //! Constructor
AtcDataUpdate(const QString &sender, int frequencykHz, BlackMisc::Network::CFacilityType facility, int visibleRange, AtcRating rating, AtcDataUpdate(const QString &sender, int frequencykHz, BlackMisc::Network::CFacilityType facility, int visibleRange, AtcRating rating,
@@ -35,9 +37,7 @@ namespace BlackCore
//! Construct from tokens //! Construct from tokens
static AtcDataUpdate fromTokens(const QStringList &tokens); static AtcDataUpdate fromTokens(const QStringList &tokens);
//! PDU identifier //! Properties @{
static QString pdu() { return "%"; }
int m_frequencykHz = 0.0; int m_frequencykHz = 0.0;
BlackMisc::Network::CFacilityType m_facility; BlackMisc::Network::CFacilityType m_facility;
int m_visibleRange = 0.0; int m_visibleRange = 0.0;
@@ -45,8 +45,13 @@ namespace BlackCore
double m_latitude = 0.0; double m_latitude = 0.0;
double m_longitude = 0.0; double m_longitude = 0.0;
int m_elevation = 0.0; int m_elevation = 0.0;
//! @}
//! PDU identifier
static QString pdu() { return "%"; }
private: private:
//! Ctor
AtcDataUpdate(); AtcDataUpdate();
}; };

View File

@@ -34,7 +34,7 @@ namespace BlackCore
//! PDU identifier //! PDU identifier
static QString pdu() { return QStringLiteral("$ZR"); } static QString pdu() { return QStringLiteral("$ZR"); }
QString m_response; QString m_response; //!< response
private: private:
AuthResponse(); AuthResponse();

View File

@@ -37,6 +37,7 @@ namespace BlackCore
//! PDU identifier //! PDU identifier
static QString pdu() { return "$ID"; } static QString pdu() { return "$ID"; }
//! Properties @{
std::uint16_t m_clientId = 0; std::uint16_t m_clientId = 0;
QString m_clientName; QString m_clientName;
int m_clientVersionMajor = BlackConfig::CBuildConfig::getVersion().majorVersion(); int m_clientVersionMajor = BlackConfig::CBuildConfig::getVersion().majorVersion();
@@ -44,6 +45,7 @@ namespace BlackCore
QString m_userCid; QString m_userCid;
QString m_sysUid; QString m_sysUid;
QString m_initialChallenge; QString m_initialChallenge;
//! @}
private: private:
ClientIdentification(); ClientIdentification();

View File

@@ -25,6 +25,7 @@ namespace BlackCore
//! Constructor //! Constructor
ClientResponse(const QString &sender, const QString &receiver, ClientQueryType queryType, const QStringList &responseData); ClientResponse(const QString &sender, const QString &receiver, ClientQueryType queryType, const QStringList &responseData);
//! Unknow query?
bool isUnknownQuery() const { return m_queryType == ClientQueryType::Unknown; } bool isUnknownQuery() const { return m_queryType == ClientQueryType::Unknown; }
//! Message converted to tokens //! Message converted to tokens
@@ -36,8 +37,10 @@ namespace BlackCore
//! PDU identifier //! PDU identifier
static QString pdu() { return "$CR"; } static QString pdu() { return "$CR"; }
//! Properties @{
ClientQueryType m_queryType; ClientQueryType m_queryType;
QStringList m_responseData; QStringList m_responseData;
//! @}
private: private:
ClientResponse(); ClientResponse();

View File

@@ -171,12 +171,13 @@ namespace BlackCore
AircraftConfig = (1 << 8) AircraftConfig = (1 << 8)
}; };
//! Operators @{
inline Capabilities operator | (Capabilities lhs, Capabilities rhs) inline Capabilities operator | (Capabilities lhs, Capabilities rhs)
{ {
return static_cast<Capabilities>(static_cast<int>(lhs) | static_cast<int>(rhs)); return static_cast<Capabilities>(static_cast<int>(lhs) | static_cast<int>(rhs));
} }
inline Capabilities& operator |= (Capabilities& lhs, Capabilities rhs) inline Capabilities &operator |= (Capabilities &lhs, Capabilities rhs)
{ {
lhs = lhs | rhs; lhs = lhs | rhs;
return lhs; return lhs;
@@ -186,7 +187,9 @@ namespace BlackCore
{ {
return static_cast<int>(lhs) & static_cast<int>(rhs); return static_cast<int>(lhs) & static_cast<int>(rhs);
} }
//! @}
//! ATIS line type
enum class AtisLineType enum class AtisLineType
{ {
Unknown, Unknown,

View File

@@ -37,6 +37,7 @@ namespace BlackCore
//! PDU identifier //! PDU identifier
static QString pdu() { return "$FP"; } static QString pdu() { return "$FP"; }
//! Properties @{
FlightType m_flightType; FlightType m_flightType;
QString m_aircraftIcaoType; QString m_aircraftIcaoType;
int m_trueCruisingSpeed = 0; int m_trueCruisingSpeed = 0;
@@ -52,6 +53,7 @@ namespace BlackCore
QString m_altAirport; QString m_altAirport;
QString m_remarks; QString m_remarks;
QString m_route; QString m_route;
//! @
protected: protected:
FlightPlan(); FlightPlan();

View File

@@ -56,7 +56,6 @@ namespace BlackCore
//! Constructor //! Constructor
MessageBase(const QString &sender, const QString &receiver); MessageBase(const QString &sender, const QString &receiver);
virtual ~MessageBase() {}
//! Set callsign //! Set callsign
void setCallsign(const QString &sender) { m_sender = sender; } void setCallsign(const QString &sender) { m_sender = sender; }

View File

@@ -79,9 +79,7 @@ namespace chunkware_simple
}; // end SimpleComp class }; // end SimpleComp class
//------------------------------------------------------------- //! Simple compressor with RMS detection
// simple compressor with RMS detection
//-------------------------------------------------------------
class SimpleCompRms : public SimpleComp class SimpleCompRms : public SimpleComp
{ {
public: public:

View File

@@ -42,13 +42,16 @@ namespace chunkware_simple
// USE: // USE:
// 1. init envelope state to DC_OFFSET before processing // 1. init envelope state to DC_OFFSET before processing
// 2. add to input before envelope runtime function // 2. add to input before envelope runtime function
static const double DC_OFFSET = 1.0E-25; static constexpr double DC_OFFSET = 1.0E-25;
//! envelope detector //! Envelope detector
class EnvelopeDetector class EnvelopeDetector
{ {
public: public:
//! Ctor
EnvelopeDetector(double ms = 1.0, double sampleRate = 44100.0); EnvelopeDetector(double ms = 1.0, double sampleRate = 44100.0);
//! Dtor
virtual ~EnvelopeDetector() {} virtual ~EnvelopeDetector() {}
//! set time constant //! set time constant
@@ -70,34 +73,40 @@ namespace chunkware_simple
} }
protected: protected:
//! Set coefficients
virtual void setCoef(void); //!< coef calculation
double sampleRate_; //!< sample rate double sampleRate_; //!< sample rate
double ms_; //!< time constant in ms double ms_; //!< time constant in ms
double coef_; //!< runtime coefficient double coef_; //!< runtime coefficient
virtual void setCoef(void); //!< coef calculation
}; // end SimpleComp class }; // end SimpleComp class
//! attack/release envelope //! attack/release envelope
class AttRelEnvelope class AttRelEnvelope
{ {
public: public:
//! Ctor
AttRelEnvelope(double att_ms = 10.0, double rel_ms = 100.0, double sampleRate = 44100.0); AttRelEnvelope(double att_ms = 10.0, double rel_ms = 100.0, double sampleRate = 44100.0);
//! Dtor
virtual ~AttRelEnvelope() {} virtual ~AttRelEnvelope() {}
// attack time constant //! Attack time constant @{
virtual void setAttack(double ms); virtual void setAttack(double ms);
virtual double getAttack(void) const { return att_.getTc(); } virtual double getAttack(void) const { return att_.getTc(); }
//! @}
// release time constant //! Release time constant @{
virtual void setRelease(double ms); virtual void setRelease(double ms);
virtual double getRelease(void) const { return rel_.getTc(); } virtual double getRelease(void) const { return rel_.getTc(); }
//! @}
// sample rate dependencies //! Sample rate dependencies @{
virtual void setSampleRate(double sampleRate); virtual void setSampleRate(double sampleRate);
virtual double getSampleRate(void) const { return att_.getSampleRate(); } virtual double getSampleRate(void) const { return att_.getSampleRate(); }
//! @}
// runtime function //! Runtime function
INLINE void run(double in, double &state) INLINE void run(double in, double &state)
{ {
@@ -114,7 +123,6 @@ namespace chunkware_simple
} }
private: private:
EnvelopeDetector att_; EnvelopeDetector att_;
EnvelopeDetector rel_; EnvelopeDetector rel_;

View File

@@ -28,8 +28,8 @@
*/ */
#ifndef __SIMPLE_GATE_H__ #ifndef chunkware__SIMPLE_GATE_H
#define __SIMPLE_GATE_H__ #define chunkware__SIMPLE_GATE_H
#include "SimpleHeader.h" // common header #include "SimpleHeader.h" // common header
#include "SimpleEnvelope.h" // for base class #include "SimpleEnvelope.h" // for base class
@@ -53,11 +53,13 @@ namespace chunkware_simple
//! get threshold //! get threshold
virtual double getThresh(void) const { return threshdB_; } virtual double getThresh(void) const { return threshdB_; }
// init runtime //! Init runtime
virtual void initRuntime(void); // call before runtime (in resume()) //! \remark call before runtime (in resume())
virtual void initRuntime(void);
//! Process audio //! Process audio
void process(double &in1, double &in2); // gate runtime process //! \remark gate runtime process
void process(double &in1, double &in2);
//! Process audio stereo-linked //! Process audio stereo-linked
void process(double &in1, double &in2, double keyLinked); // with stereo-linked key in void process(double &in1, double &in2, double keyLinked); // with stereo-linked key in
@@ -71,7 +73,7 @@ namespace chunkware_simple
double env_; //!< over-threshold envelope (linear) double env_; //!< over-threshold envelope (linear)
}; };
//! simple gate with RMS detection //! Simple gate with RMS detection
class SimpleGateRms : public SimpleGate class SimpleGateRms : public SimpleGate
{ {
public: public:

View File

@@ -28,8 +28,8 @@
*/ */
#ifndef __SIMPLE_LIMIT_H__ #ifndef chunkware_SIMPLE_LIMIT_H
#define __SIMPLE_LIMIT_H__ #define chunkware_SIMPLE_LIMIT_H
#include "SimpleHeader.h" // common header #include "SimpleHeader.h" // common header
#include "SimpleEnvelope.h" // for base class of FastEnvelope #include "SimpleEnvelope.h" // for base class of FastEnvelope
@@ -76,18 +76,21 @@ namespace chunkware_simple
protected: protected:
//! class for faster attack/release //! Class for faster attack/release
class FastEnvelope : public EnvelopeDetector class FastEnvelope : public EnvelopeDetector
{ {
public: public:
//! Ctor
FastEnvelope(double ms = 1.0, double sampleRate = 44100.0) FastEnvelope(double ms = 1.0, double sampleRate = 44100.0)
: EnvelopeDetector(ms, sampleRate) : EnvelopeDetector(ms, sampleRate)
{} {}
virtual ~FastEnvelope() {}
//! Dtor
virtual ~FastEnvelope() override {}
protected: protected:
// override setCoef() - coefficient calculation //! Override setCoef() - coefficient calculation
virtual void setCoef(void); virtual void setCoef(void) override;
}; };
private: private:
@@ -123,4 +126,4 @@ namespace chunkware_simple
// include inlined process function // include inlined process function
#include "SimpleLimitProcess.inl" #include "SimpleLimitProcess.inl"
#endif // end __SIMPLE_LIMIT_H__ #endif // guard