mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +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; }
|
||||
|
||||
Reference in New Issue
Block a user