[AFV] Style, Doxygen

This commit is contained in:
Klaus Basan
2019-10-23 23:11:37 +02:00
parent d989bca919
commit cde18d23aa
11 changed files with 40 additions and 25 deletions

View File

@@ -223,7 +223,7 @@ namespace BlackCore
if (!server.getUser().hasCredentials()) { return CStatusMessage({ CLogCategory::validation() }, CStatusMessage::SeverityError, u"Invalid user credentials"); }
if (!this->ownAircraft().getAircraftIcaoCode().hasDesignator()) { return CStatusMessage({ CLogCategory::validation() }, CStatusMessage::SeverityError, u"Invalid ICAO data for own aircraft"); }
if (!CNetworkUtils::canConnect(server, msg, 5000)) { return CStatusMessage(CStatusMessage::SeverityError, msg); }
if (m_fsdClient->isConnected()) { return CStatusMessage({ CLogCategory::validation() }, CStatusMessage::SeverityError, u"Already connected"); }
if (m_fsdClient->isConnected()) { return CStatusMessage({ CLogCategory::validation() }, CStatusMessage::SeverityError, u"Already connected"); }
if (this->isPendingConnection()) { return CStatusMessage({ CLogCategory::validation() }, CStatusMessage::SeverityError, u"Pending connection, please wait"); }
this->getIContextOwnAircraft()->updateOwnAircraftPilot(server.getUser());

View File

@@ -39,8 +39,10 @@ namespace BlackCore
//! PDU identifier
static QString pdu() { return "$CQ"; }
//! Properties @{
ClientQueryType m_queryType = ClientQueryType::Unknown;
QStringList m_queryData;
//! @}
private:
ClientQuery();

View File

@@ -34,9 +34,10 @@ namespace BlackCore
//! PDU identifier
static QString pdu() { return QStringLiteral("#DP"); }
QString m_cid;
QString m_cid; //!< id
private:
//! Ctor
DeletePilot();
};

View File

@@ -206,17 +206,17 @@ namespace BlackCore
Q_ASSERT((m_versionMajor + m_versionMinor) > 0);
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;
updateConnectionStatus(CConnectionStatus::Connecting);
this->updateConnectionStatus(CConnectionStatus::Connecting);
QString host = m_server.getAddress();
quint16 port = static_cast<quint16>(m_server.getPort());
const QString host = m_server.getAddress();
const quint16 port = static_cast<quint16>(m_server.getPort());
m_socket.connectToHost(host, port);
startPositionTimers();
this->startPositionTimers();
}
void CFSDClient::disconnectFromServer()
@@ -225,10 +225,10 @@ namespace BlackCore
this->updateConnectionStatus(CConnectionStatus::Disconnecting);
// allow also to close if broken
if (!m_socket.isOpen())
if (m_socket.isOpen())
{
if (m_loginMode.isPilot()) { sendDeletePilot(); }
else if (m_loginMode.isObserver()) { sendDeleteAtc(); }
if (m_loginMode.isPilot()) { this->sendDeletePilot(); }
else if (m_loginMode.isObserver()) { this->sendDeleteAtc(); }
}
m_socket.close();

View File

@@ -42,15 +42,18 @@
#include <QTimer>
#include <QTextCodec>
//! Protocol version @{
#define PROTOCOL_REVISION_CLASSIC 9
#define PROTOCOL_REVISION_VATSIM_ATC 10
#define PROTOCOL_REVISION_VATSIM_AUTH 100
//! @}
namespace BlackFsdTest { class CTestFSDClient; }
namespace BlackCore
{
namespace Fsd
{
//! Message groups
enum class TextMessageGroups
{
AllClients,
@@ -59,10 +62,9 @@ namespace BlackCore
AllSups
};
//! TODO:
//! Send (interim) data updates automatically
//! Check ':' in FSD messages. Disconnect if there is a wrong one
//! FSD client
//! Todo: Send (interim) data updates automatically
//! Todo Check ':' in FSD messages. Disconnect if there is a wrong one
class BLACKCORE_EXPORT CFSDClient :
public QObject,
public BlackMisc::Network::IEcosystemProvider, // provide info about used ecosystem
@@ -102,9 +104,16 @@ namespace BlackCore
void setAtcRating(AtcRating rating) { m_atcRating = rating; }
//! @}
//! Get the server
const BlackMisc::Network::CServer &getServer() const { return m_server; }
//! List of all preset values
QStringList getPresetValues() const;
//! Callsign
BlackMisc::Aviation::CCallsign getPresetPartnerCallsign() const { return m_partnerCallsign; }
//! Mode
BlackMisc::Network::CLoginMode getLoginMode() const;
//! Conenct/disconnect {
@@ -112,8 +121,10 @@ namespace BlackCore
void disconnectFromServer();
//! @}
//! Interim positions @{
void addInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver) { m_interimPositionReceivers.push_back(receiver); }
void removeInterimPositionReceiver(const BlackMisc::Aviation::CCallsign &receiver) { m_interimPositionReceivers.remove(receiver); }
//! @}
//! Convenience functions for sendClientQuery
//! \private

View File

@@ -33,7 +33,7 @@ namespace BlackCore
//! PDU identifier
static QString pdu() { return "$PI"; }
QString m_timestamp;
QString m_timestamp; //!< timestamp
private:
Ping();

View File

@@ -22,10 +22,9 @@ namespace BlackCore
class BLACKCORE_EXPORT PlaneInfoRequest : public MessageBase
{
public:
//! Ctor
PlaneInfoRequest(const QString &sender, const QString &receiver);
virtual ~PlaneInfoRequest() {}
//! Message converted to tokens
QStringList toTokens() const;

View File

@@ -29,8 +29,6 @@ namespace BlackCore
const QString &aircraftIcaoCombinedType,
const QString &sendMModelString);
virtual ~PlaneInfoRequestFsinn() {}
//! Message converted to tokens
QStringList toTokens() const;
@@ -40,10 +38,12 @@ namespace BlackCore
//! PDU identifier
static QString pdu() { return QStringLiteral("#SB"); }
//! Properties @{
QString m_airlineIcao;
QString m_aircraftIcao;
QString m_aircraftIcaoCombinedType;
QString m_sendMModelString;
//! @}
private:
PlaneInfoRequestFsinn();

View File

@@ -34,9 +34,11 @@ namespace BlackCore
//! PDU identifier
static QString pdu() { return "#SB"; }
//! Properties @{
QString m_aircraft;
QString m_airline;
QString m_livery;
//! @}
private:

View File

@@ -668,10 +668,10 @@ namespace BlackCore
void CSetupReader::networkReplyProgress(int logId, qint64 current, qint64 max, const QUrl &url)
{
Q_UNUSED(url);
Q_UNUSED(logId);
Q_UNUSED(current);
Q_UNUSED(max);
Q_UNUSED(url)
Q_UNUSED(logId)
Q_UNUSED(current)
Q_UNUSED(max)
}
CStatusMessageList CSetupReader::manageSetupAvailability(bool webRead, bool localRead)

View File

@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
//! [SwiftApplicationDemo]
CGuiApplication::highDpiScreenSupport(CGuiApplication::parseScaleFactor(argc, argv));
QApplication qa(argc, argv); // needed
Q_UNUSED(qa);
Q_UNUSED(qa)
CGuiApplication a(CApplicationInfo::swiftLauncher(), CApplicationInfo::Laucher, CIcons::swiftLauncher1024());
a.addVatlibOptions(); // so it can be passed (hand over) to started applications
a.addParserOption({{"i", "installer"}, QCoreApplication::translate("main", "Installer setup.")});