mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Style, Doxygen
This commit is contained in:
@@ -25,7 +25,7 @@ namespace BlackCore
|
||||
class BLACKCORE_EXPORT AddPilot : public MessageBase
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
//! Constructor
|
||||
AddPilot(const QString &callsign, const QString &cid, const QString &password, PilotRating rating, int protocolRevision, SimType simType, const QString &realName);
|
||||
|
||||
//! Get user cid
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace BlackCore
|
||||
{
|
||||
BlackMisc::CLogMessage(static_cast<AtcDataUpdate *>(nullptr)).warning(u"Wrong number of arguments.");
|
||||
return {};
|
||||
};
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace BlackCore
|
||||
//! FSD Message: ATC data update
|
||||
class BLACKCORE_EXPORT AtcDataUpdate : public MessageBase
|
||||
{
|
||||
friend bool operator==(const AtcDataUpdate &, const AtcDataUpdate &);
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
AtcDataUpdate(const QString &sender, int frequencykHz, BlackMisc::Network::CFacilityType facility, int visibleRange, AtcRating rating,
|
||||
@@ -35,18 +37,21 @@ namespace BlackCore
|
||||
//! Construct from tokens
|
||||
static AtcDataUpdate fromTokens(const QStringList &tokens);
|
||||
|
||||
//! PDU identifier
|
||||
static QString pdu() { return "%"; }
|
||||
|
||||
//! Properties @{
|
||||
int m_frequencykHz = 0.0;
|
||||
BlackMisc::Network::CFacilityType m_facility;
|
||||
int m_visibleRange = 0.0;
|
||||
AtcRating m_rating = AtcRating::Unknown;
|
||||
double m_latitude = 0.0;
|
||||
double m_latitude = 0.0;
|
||||
double m_longitude = 0.0;
|
||||
int m_elevation = 0.0;
|
||||
//! @}
|
||||
|
||||
//! PDU identifier
|
||||
static QString pdu() { return "%"; }
|
||||
|
||||
private:
|
||||
//! Ctor
|
||||
AtcDataUpdate();
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace BlackCore
|
||||
//! PDU identifier
|
||||
static QString pdu() { return QStringLiteral("$ZR"); }
|
||||
|
||||
QString m_response;
|
||||
QString m_response; //!< response
|
||||
|
||||
private:
|
||||
AuthResponse();
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace BlackCore
|
||||
//! PDU identifier
|
||||
static QString pdu() { return "$ID"; }
|
||||
|
||||
//! Properties @{
|
||||
std::uint16_t m_clientId = 0;
|
||||
QString m_clientName;
|
||||
int m_clientVersionMajor = BlackConfig::CBuildConfig::getVersion().majorVersion();
|
||||
@@ -44,6 +45,7 @@ namespace BlackCore
|
||||
QString m_userCid;
|
||||
QString m_sysUid;
|
||||
QString m_initialChallenge;
|
||||
//! @}
|
||||
|
||||
private:
|
||||
ClientIdentification();
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace BlackCore
|
||||
//! Constructor
|
||||
ClientResponse(const QString &sender, const QString &receiver, ClientQueryType queryType, const QStringList &responseData);
|
||||
|
||||
//! Unknow query?
|
||||
bool isUnknownQuery() const { return m_queryType == ClientQueryType::Unknown; }
|
||||
|
||||
//! Message converted to tokens
|
||||
@@ -36,8 +37,10 @@ namespace BlackCore
|
||||
//! PDU identifier
|
||||
static QString pdu() { return "$CR"; }
|
||||
|
||||
//! Properties @{
|
||||
ClientQueryType m_queryType;
|
||||
QStringList m_responseData;
|
||||
QStringList m_responseData;
|
||||
//! @}
|
||||
|
||||
private:
|
||||
ClientResponse();
|
||||
|
||||
@@ -171,12 +171,13 @@ namespace BlackCore
|
||||
AircraftConfig = (1 << 8)
|
||||
};
|
||||
|
||||
//! Operators @{
|
||||
inline Capabilities operator | (Capabilities lhs, Capabilities 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;
|
||||
return lhs;
|
||||
@@ -186,7 +187,9 @@ namespace BlackCore
|
||||
{
|
||||
return static_cast<int>(lhs) & static_cast<int>(rhs);
|
||||
}
|
||||
//! @}
|
||||
|
||||
//! ATIS line type
|
||||
enum class AtisLineType
|
||||
{
|
||||
Unknown,
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace BlackCore
|
||||
//! PDU identifier
|
||||
static QString pdu() { return "$FP"; }
|
||||
|
||||
//! Properties @{
|
||||
FlightType m_flightType;
|
||||
QString m_aircraftIcaoType;
|
||||
int m_trueCruisingSpeed = 0;
|
||||
@@ -52,6 +53,7 @@ namespace BlackCore
|
||||
QString m_altAirport;
|
||||
QString m_remarks;
|
||||
QString m_route;
|
||||
//! @
|
||||
|
||||
protected:
|
||||
FlightPlan();
|
||||
|
||||
@@ -56,7 +56,6 @@ namespace BlackCore
|
||||
|
||||
//! Constructor
|
||||
MessageBase(const QString &sender, const QString &receiver);
|
||||
virtual ~MessageBase() {}
|
||||
|
||||
//! Set callsign
|
||||
void setCallsign(const QString &sender) { m_sender = sender; }
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace chunkware_simple
|
||||
//! @{ get parameters
|
||||
virtual double getThresh(void) const { return threshdB_; }
|
||||
virtual double getRatio(void) const { return ratio_; }
|
||||
double getMakeUpGain(void) const { return makeUpGain_; }
|
||||
double getMakeUpGain(void) const { return makeUpGain_; }
|
||||
//! @}
|
||||
|
||||
//! Init runtime
|
||||
@@ -79,9 +79,7 @@ namespace chunkware_simple
|
||||
|
||||
}; // end SimpleComp class
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// simple compressor with RMS detection
|
||||
//-------------------------------------------------------------
|
||||
//! Simple compressor with RMS detection
|
||||
class SimpleCompRms : public SimpleComp
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -42,13 +42,16 @@ namespace chunkware_simple
|
||||
// USE:
|
||||
// 1. init envelope state to DC_OFFSET before processing
|
||||
// 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
|
||||
{
|
||||
public:
|
||||
//! Ctor
|
||||
EnvelopeDetector(double ms = 1.0, double sampleRate = 44100.0);
|
||||
|
||||
//! Dtor
|
||||
virtual ~EnvelopeDetector() {}
|
||||
|
||||
//! set time constant
|
||||
@@ -70,34 +73,40 @@ namespace chunkware_simple
|
||||
}
|
||||
|
||||
protected:
|
||||
//! Set coefficients
|
||||
virtual void setCoef(void); //!< coef calculation
|
||||
|
||||
double sampleRate_; //!< sample rate
|
||||
double ms_; //!< time constant in ms
|
||||
double coef_; //!< runtime coefficient
|
||||
virtual void setCoef(void); //!< coef calculation
|
||||
|
||||
}; // end SimpleComp class
|
||||
|
||||
//! attack/release envelope
|
||||
class AttRelEnvelope
|
||||
{
|
||||
public:
|
||||
//! Ctor
|
||||
AttRelEnvelope(double att_ms = 10.0, double rel_ms = 100.0, double sampleRate = 44100.0);
|
||||
|
||||
//! Dtor
|
||||
virtual ~AttRelEnvelope() {}
|
||||
|
||||
// attack time constant
|
||||
//! Attack time constant @{
|
||||
virtual void setAttack(double ms);
|
||||
virtual double getAttack(void) const { return att_.getTc(); }
|
||||
//! @}
|
||||
|
||||
// release time constant
|
||||
//! Release time constant @{
|
||||
virtual void setRelease(double ms);
|
||||
virtual double getRelease(void) const { return rel_.getTc(); }
|
||||
//! @}
|
||||
|
||||
// sample rate dependencies
|
||||
//! Sample rate dependencies @{
|
||||
virtual void setSampleRate(double sampleRate);
|
||||
virtual double getSampleRate(void) const { return att_.getSampleRate(); }
|
||||
//! @}
|
||||
|
||||
// runtime function
|
||||
//! Runtime function
|
||||
INLINE void run(double in, double &state)
|
||||
{
|
||||
|
||||
@@ -114,7 +123,6 @@ namespace chunkware_simple
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
EnvelopeDetector att_;
|
||||
EnvelopeDetector rel_;
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __SIMPLE_GATE_H__
|
||||
#define __SIMPLE_GATE_H__
|
||||
#ifndef chunkware__SIMPLE_GATE_H
|
||||
#define chunkware__SIMPLE_GATE_H
|
||||
|
||||
#include "SimpleHeader.h" // common header
|
||||
#include "SimpleEnvelope.h" // for base class
|
||||
@@ -53,11 +53,13 @@ namespace chunkware_simple
|
||||
//! get threshold
|
||||
virtual double getThresh(void) const { return threshdB_; }
|
||||
|
||||
// init runtime
|
||||
virtual void initRuntime(void); // call before runtime (in resume())
|
||||
//! Init runtime
|
||||
//! \remark call before runtime (in resume())
|
||||
virtual void initRuntime(void);
|
||||
|
||||
//! 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
|
||||
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)
|
||||
};
|
||||
|
||||
//! simple gate with RMS detection
|
||||
//! Simple gate with RMS detection
|
||||
class SimpleGateRms : public SimpleGate
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __SIMPLE_LIMIT_H__
|
||||
#define __SIMPLE_LIMIT_H__
|
||||
#ifndef chunkware_SIMPLE_LIMIT_H
|
||||
#define chunkware_SIMPLE_LIMIT_H
|
||||
|
||||
#include "SimpleHeader.h" // common header
|
||||
#include "SimpleEnvelope.h" // for base class of FastEnvelope
|
||||
@@ -76,18 +76,21 @@ namespace chunkware_simple
|
||||
|
||||
protected:
|
||||
|
||||
//! class for faster attack/release
|
||||
//! Class for faster attack/release
|
||||
class FastEnvelope : public EnvelopeDetector
|
||||
{
|
||||
public:
|
||||
//! Ctor
|
||||
FastEnvelope(double ms = 1.0, double sampleRate = 44100.0)
|
||||
: EnvelopeDetector(ms, sampleRate)
|
||||
{}
|
||||
virtual ~FastEnvelope() {}
|
||||
|
||||
//! Dtor
|
||||
virtual ~FastEnvelope() override {}
|
||||
|
||||
protected:
|
||||
// override setCoef() - coefficient calculation
|
||||
virtual void setCoef(void);
|
||||
//! Override setCoef() - coefficient calculation
|
||||
virtual void setCoef(void) override;
|
||||
};
|
||||
|
||||
private:
|
||||
@@ -123,4 +126,4 @@ namespace chunkware_simple
|
||||
// include inlined process function
|
||||
#include "SimpleLimitProcess.inl"
|
||||
|
||||
#endif // end __SIMPLE_LIMIT_H__
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user