mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
[AFV] Style, Doxygen
This commit is contained in:
@@ -39,8 +39,10 @@ namespace BlackCore
|
|||||||
//! PDU identifier
|
//! PDU identifier
|
||||||
static QString pdu() { return "$CQ"; }
|
static QString pdu() { return "$CQ"; }
|
||||||
|
|
||||||
|
//! Properties @{
|
||||||
ClientQueryType m_queryType = ClientQueryType::Unknown;
|
ClientQueryType m_queryType = ClientQueryType::Unknown;
|
||||||
QStringList m_queryData;
|
QStringList m_queryData;
|
||||||
|
//! @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ClientQuery();
|
ClientQuery();
|
||||||
|
|||||||
@@ -34,9 +34,10 @@ namespace BlackCore
|
|||||||
//! PDU identifier
|
//! PDU identifier
|
||||||
static QString pdu() { return QStringLiteral("#DP"); }
|
static QString pdu() { return QStringLiteral("#DP"); }
|
||||||
|
|
||||||
QString m_cid;
|
QString m_cid; //!< id
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
//! Ctor
|
||||||
DeletePilot();
|
DeletePilot();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -206,17 +206,17 @@ namespace BlackCore
|
|||||||
Q_ASSERT((m_versionMajor + m_versionMinor) > 0);
|
Q_ASSERT((m_versionMajor + m_versionMinor) > 0);
|
||||||
Q_ASSERT(m_capabilities != Capabilities::None);
|
Q_ASSERT(m_capabilities != Capabilities::None);
|
||||||
|
|
||||||
if (m_hostApplication.isEmpty()) { m_hostApplication = getSimulatorNameAndVersion().replace(':', ' '); }
|
if (m_hostApplication.isEmpty()) { m_hostApplication = this->getSimulatorNameAndVersion().replace(':', ' '); }
|
||||||
|
|
||||||
clearState();
|
this->clearState();
|
||||||
m_filterPasswordFromLogin = true;
|
m_filterPasswordFromLogin = true;
|
||||||
|
|
||||||
updateConnectionStatus(CConnectionStatus::Connecting);
|
this->updateConnectionStatus(CConnectionStatus::Connecting);
|
||||||
|
|
||||||
QString host = m_server.getAddress();
|
const QString host = m_server.getAddress();
|
||||||
quint16 port = static_cast<quint16>(m_server.getPort());
|
const quint16 port = static_cast<quint16>(m_server.getPort());
|
||||||
m_socket.connectToHost(host, port);
|
m_socket.connectToHost(host, port);
|
||||||
startPositionTimers();
|
this->startPositionTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFSDClient::disconnectFromServer()
|
void CFSDClient::disconnectFromServer()
|
||||||
@@ -225,10 +225,10 @@ namespace BlackCore
|
|||||||
this->updateConnectionStatus(CConnectionStatus::Disconnecting);
|
this->updateConnectionStatus(CConnectionStatus::Disconnecting);
|
||||||
|
|
||||||
// allow also to close if broken
|
// allow also to close if broken
|
||||||
if (!m_socket.isOpen())
|
if (m_socket.isOpen())
|
||||||
{
|
{
|
||||||
if (m_loginMode.isPilot()) { sendDeletePilot(); }
|
if (m_loginMode.isPilot()) { this->sendDeletePilot(); }
|
||||||
else if (m_loginMode.isObserver()) { sendDeleteAtc(); }
|
else if (m_loginMode.isObserver()) { this->sendDeleteAtc(); }
|
||||||
}
|
}
|
||||||
m_socket.close();
|
m_socket.close();
|
||||||
|
|
||||||
|
|||||||
@@ -42,15 +42,18 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
|
||||||
|
//! Protocol version @{
|
||||||
#define PROTOCOL_REVISION_CLASSIC 9
|
#define PROTOCOL_REVISION_CLASSIC 9
|
||||||
#define PROTOCOL_REVISION_VATSIM_ATC 10
|
#define PROTOCOL_REVISION_VATSIM_ATC 10
|
||||||
#define PROTOCOL_REVISION_VATSIM_AUTH 100
|
#define PROTOCOL_REVISION_VATSIM_AUTH 100
|
||||||
|
//! @}
|
||||||
|
|
||||||
namespace BlackFsdTest { class CTestFSDClient; }
|
namespace BlackFsdTest { class CTestFSDClient; }
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
namespace Fsd
|
namespace Fsd
|
||||||
{
|
{
|
||||||
|
//! Message groups
|
||||||
enum class TextMessageGroups
|
enum class TextMessageGroups
|
||||||
{
|
{
|
||||||
AllClients,
|
AllClients,
|
||||||
@@ -59,10 +62,9 @@ namespace BlackCore
|
|||||||
AllSups
|
AllSups
|
||||||
};
|
};
|
||||||
|
|
||||||
//! TODO:
|
//! FSD client
|
||||||
//! Send (interim) data updates automatically
|
//! Todo: Send (interim) data updates automatically
|
||||||
//! Check ':' in FSD messages. Disconnect if there is a wrong one
|
//! Todo Check ':' in FSD messages. Disconnect if there is a wrong one
|
||||||
|
|
||||||
class BLACKCORE_EXPORT CFSDClient :
|
class BLACKCORE_EXPORT CFSDClient :
|
||||||
public QObject,
|
public QObject,
|
||||||
public BlackMisc::Network::IEcosystemProvider, // provide info about used ecosystem
|
public BlackMisc::Network::IEcosystemProvider, // provide info about used ecosystem
|
||||||
@@ -102,9 +104,16 @@ namespace BlackCore
|
|||||||
void setAtcRating(AtcRating rating) { m_atcRating = rating; }
|
void setAtcRating(AtcRating rating) { m_atcRating = rating; }
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
//! Get the server
|
||||||
const BlackMisc::Network::CServer &getServer() const { return m_server; }
|
const BlackMisc::Network::CServer &getServer() const { return m_server; }
|
||||||
|
|
||||||
|
//! List of all preset values
|
||||||
QStringList getPresetValues() const;
|
QStringList getPresetValues() const;
|
||||||
|
|
||||||
|
//! Callsign
|
||||||
BlackMisc::Aviation::CCallsign getPresetPartnerCallsign() const { return m_partnerCallsign; }
|
BlackMisc::Aviation::CCallsign getPresetPartnerCallsign() const { return m_partnerCallsign; }
|
||||||
|
|
||||||
|
//! Mode
|
||||||
BlackMisc::Network::CLoginMode getLoginMode() const;
|
BlackMisc::Network::CLoginMode getLoginMode() const;
|
||||||
|
|
||||||
//! Conenct/disconnect {
|
//! Conenct/disconnect {
|
||||||
@@ -112,8 +121,10 @@ namespace BlackCore
|
|||||||
void disconnectFromServer();
|
void disconnectFromServer();
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
//! Interim positions @{
|
||||||
void addInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver) { m_interimPositionReceivers.push_back(receiver); }
|
void addInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver) { m_interimPositionReceivers.push_back(receiver); }
|
||||||
void removeInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver) { m_interimPositionReceivers.remove(receiver); }
|
void removeInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver) { m_interimPositionReceivers.remove(receiver); }
|
||||||
|
//! @}
|
||||||
|
|
||||||
//! Convenience functions for sendClientQuery
|
//! Convenience functions for sendClientQuery
|
||||||
//! \private
|
//! \private
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace BlackCore
|
|||||||
//! PDU identifier
|
//! PDU identifier
|
||||||
static QString pdu() { return "$PI"; }
|
static QString pdu() { return "$PI"; }
|
||||||
|
|
||||||
QString m_timestamp;
|
QString m_timestamp; //!< timestamp
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ping();
|
Ping();
|
||||||
|
|||||||
@@ -22,10 +22,9 @@ namespace BlackCore
|
|||||||
class BLACKCORE_EXPORT PlaneInfoRequest : public MessageBase
|
class BLACKCORE_EXPORT PlaneInfoRequest : public MessageBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
//! Ctor
|
||||||
PlaneInfoRequest(const QString &sender, const QString &receiver);
|
PlaneInfoRequest(const QString &sender, const QString &receiver);
|
||||||
|
|
||||||
virtual ~PlaneInfoRequest() {}
|
|
||||||
|
|
||||||
//! Message converted to tokens
|
//! Message converted to tokens
|
||||||
QStringList toTokens() const;
|
QStringList toTokens() const;
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ namespace BlackCore
|
|||||||
const QString &aircraftIcaoCombinedType,
|
const QString &aircraftIcaoCombinedType,
|
||||||
const QString &sendMModelString);
|
const QString &sendMModelString);
|
||||||
|
|
||||||
virtual ~PlaneInfoRequestFsinn() {}
|
|
||||||
|
|
||||||
//! Message converted to tokens
|
//! Message converted to tokens
|
||||||
QStringList toTokens() const;
|
QStringList toTokens() const;
|
||||||
|
|
||||||
@@ -40,10 +38,12 @@ namespace BlackCore
|
|||||||
//! PDU identifier
|
//! PDU identifier
|
||||||
static QString pdu() { return QStringLiteral("#SB"); }
|
static QString pdu() { return QStringLiteral("#SB"); }
|
||||||
|
|
||||||
|
//! Properties @{
|
||||||
QString m_airlineIcao;
|
QString m_airlineIcao;
|
||||||
QString m_aircraftIcao;
|
QString m_aircraftIcao;
|
||||||
QString m_aircraftIcaoCombinedType;
|
QString m_aircraftIcaoCombinedType;
|
||||||
QString m_sendMModelString;
|
QString m_sendMModelString;
|
||||||
|
//! @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PlaneInfoRequestFsinn();
|
PlaneInfoRequestFsinn();
|
||||||
|
|||||||
@@ -34,9 +34,11 @@ namespace BlackCore
|
|||||||
//! PDU identifier
|
//! PDU identifier
|
||||||
static QString pdu() { return "#SB"; }
|
static QString pdu() { return "#SB"; }
|
||||||
|
|
||||||
|
//! Properties @{
|
||||||
QString m_aircraft;
|
QString m_aircraft;
|
||||||
QString m_airline;
|
QString m_airline;
|
||||||
QString m_livery;
|
QString m_livery;
|
||||||
|
//! @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -668,10 +668,10 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CSetupReader::networkReplyProgress(int logId, qint64 current, qint64 max, const QUrl &url)
|
void CSetupReader::networkReplyProgress(int logId, qint64 current, qint64 max, const QUrl &url)
|
||||||
{
|
{
|
||||||
Q_UNUSED(url);
|
Q_UNUSED(url)
|
||||||
Q_UNUSED(logId);
|
Q_UNUSED(logId)
|
||||||
Q_UNUSED(current);
|
Q_UNUSED(current)
|
||||||
Q_UNUSED(max);
|
Q_UNUSED(max)
|
||||||
}
|
}
|
||||||
|
|
||||||
CStatusMessageList CSetupReader::manageSetupAvailability(bool webRead, bool localRead)
|
CStatusMessageList CSetupReader::manageSetupAvailability(bool webRead, bool localRead)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
|
|||||||
//! [SwiftApplicationDemo]
|
//! [SwiftApplicationDemo]
|
||||||
CGuiApplication::highDpiScreenSupport(CGuiApplication::parseScaleFactor(argc, argv));
|
CGuiApplication::highDpiScreenSupport(CGuiApplication::parseScaleFactor(argc, argv));
|
||||||
QApplication qa(argc, argv); // needed
|
QApplication qa(argc, argv); // needed
|
||||||
Q_UNUSED(qa);
|
Q_UNUSED(qa)
|
||||||
CGuiApplication a(CApplicationInfo::swiftLauncher(), CApplicationInfo::Laucher, CIcons::swiftLauncher1024());
|
CGuiApplication a(CApplicationInfo::swiftLauncher(), CApplicationInfo::Laucher, CIcons::swiftLauncher1024());
|
||||||
a.addVatlibOptions(); // so it can be passed (hand over) to started applications
|
a.addVatlibOptions(); // so it can be passed (hand over) to started applications
|
||||||
a.addParserOption({{"i", "installer"}, QCoreApplication::translate("main", "Installer setup.")});
|
a.addParserOption({{"i", "installer"}, QCoreApplication::translate("main", "Installer setup.")});
|
||||||
|
|||||||
Reference in New Issue
Block a user