Doxygen, renaming, formatting

* Formatting, renaming to current schema
* Minor tweaks
This commit is contained in:
Klaus Basan
2014-09-08 22:47:53 +02:00
parent 681201377a
commit 2127238ed4
19 changed files with 83 additions and 67 deletions

View File

@@ -31,7 +31,7 @@ namespace BlackCore
this->connect(this->m_network, &INetwork::atisVoiceRoomReplyReceived, this, &CAirspaceMonitor::ps_atisVoiceRoomReceived);
this->connect(this->m_network, &INetwork::atisLogoffTimeReplyReceived, this, &CAirspaceMonitor::ps_atisLogoffTimeReceived);
this->connect(this->m_network, &INetwork::metarReplyReceived, this, &CAirspaceMonitor::ps_metarReceived);
this->connect(this->m_network, &INetwork::flightPlanReplyReceived, this, &CAirspaceMonitor::ps_flightplanReceived);
this->connect(this->m_network, &INetwork::flightPlanReplyReceived, this, &CAirspaceMonitor::ps_flightPlanReceived);
this->connect(this->m_network, &INetwork::realNameReplyReceived, this, &CAirspaceMonitor::ps_realNameReplyReceived);
this->connect(this->m_network, &INetwork::icaoCodesReplyReceived, this, &CAirspaceMonitor::ps_icaoCodesReceived);
this->connect(this->m_network, &INetwork::pilotDisconnected, this, &CAirspaceMonitor::ps_pilotDisconnected);
@@ -434,9 +434,9 @@ namespace BlackCore
// Logic to set logoff time
bool ok;
int h = zuluTime.left(2).toInt(&ok);
if (!ok) return;
if (!ok) { return; }
int m = zuluTime.right(2).toInt(&ok);
if (!ok) return;
if (!ok) { return; }
QDateTime logoffDateTime = QDateTime::currentDateTimeUtc();
logoffDateTime.setTime(QTime(h, m));
CIndexVariantMap vm(CAtcStation::IndexBookedUntil, logoffDateTime);

View File

@@ -106,7 +106,7 @@ namespace BlackCore
//! Own aircraft model updated
void setOwnAircraftModel(const BlackMisc::Network::CAircraftModel &model) { m_ownAircraftModel = model; }
public:
//! Clear the contents
void clear()
@@ -122,16 +122,16 @@ namespace BlackCore
private:
BlackMisc::Aviation::CAtcStationList m_atcStationsOnline;
BlackMisc::Aviation::CAtcStationList m_atcStationsBooked;
BlackMisc::Aviation::CAircraftList m_aircraftsInRange;
BlackMisc::Network::CClientList m_otherClients;
BlackMisc::Aviation::CAircraftList m_aircraftsInRange;
BlackMisc::Network::CClientList m_otherClients;
QMap<BlackMisc::Aviation::CAirportIcao, BlackMisc::Aviation::CInformationMessage> m_metarCache;
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Aviation::CFlightPlan> m_flightPlanCache;
BlackMisc::Aviation::CAircraft m_ownAircraft;
BlackMisc::Aviation::CAircraft m_ownAircraft;
BlackMisc::Network::CAircraftModel m_ownAircraftModel;
INetwork *m_network;
CVatsimBookingReader *m_vatsimBookingReader;
CVatsimBookingReader *m_vatsimBookingReader;
CVatsimDataFileReader *m_vatsimDataFileReader;
// FIXME (MS) should be in INetwork
@@ -145,8 +145,7 @@ namespace BlackCore
void ps_fsipirCustomPacketReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &, const QString &, const QString &, const QString &model);
void ps_serverReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &server);
void ps_metarReceived(const QString &metarMessage);
void ps_flightplanReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CFlightPlan &flightPlan);
void ps_receivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations);
void ps_flightPlanReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CFlightPlan &flightPlan);
void ps_atcPositionUpdate(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &frequency, const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::PhysicalQuantities::CLength &range);
void ps_atcControllerDisconnected(const BlackMisc::Aviation::CCallsign &callsign);
void ps_atisReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CInformationMessage &atisMessage);
@@ -156,6 +155,10 @@ namespace BlackCore
void ps_aircraftUpdateReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CTransponder &transponder);
void ps_pilotDisconnected(const BlackMisc::Aviation::CCallsign &callsign);
void ps_frequencyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &frequency);
void ps_receivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations);
void ps_receivedDataFile();
};
} // namespace

View File

@@ -95,7 +95,7 @@ namespace BlackCore
void connectionTerminated();
/*!
* \brief Connection status changed
* Connection status changed
* \param from old status
* \param to new status
* \param message further details
@@ -113,7 +113,7 @@ namespace BlackCore
virtual void readAtcBookingsFromSource() const = 0;
/*!
* \brief The ATC list with online ATC controllers
* The ATC list with online ATC controllers
* \remarks If I make this &getAtcStations XML is not generated correctly
*/
virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsOnline() const = 0;
@@ -140,19 +140,19 @@ namespace BlackCore
virtual BlackMisc::Network::CClientList getOtherClientsForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const = 0;
/*!
* \brief Connect to Network
* Connect to Network
* \return messages gererated during connecting
* \see INetwork::LoginMode
*/
virtual BlackMisc::CStatusMessageList connectToNetwork(uint loginMode) = 0;
/*!
* \brief Disconnect from network
* Disconnect from network
* \return messages generated during disconnecting
*/
virtual BlackMisc::CStatusMessageList disconnectFromNetwork() = 0;
//! \brief Network connected?
//! Network connected?
virtual bool isConnected() const = 0;
//! Text messages (radio and private chat messages)
@@ -165,7 +165,7 @@ namespace BlackCore
virtual BlackMisc::Aviation::CFlightPlan loadFlightPlanFromNetwork(const BlackMisc::Aviation::CCallsign &callsign) const = 0;
/*!
* \brief Get METAR, if not available request it
* Get METAR, if not available request it
* \param airportIcaoCode such as EDDF, KLAX
* \return
*/

View File

@@ -45,19 +45,19 @@ namespace BlackCore
// 1. Init by "network driver"
this->m_network = new CNetworkVatlib(this);
this->connect(this->m_network, &INetwork::connectionStatusChanged, this, &CContextNetwork::ps_FsdConnectionStatusChanged);
this->connect(this->m_network, &INetwork::textMessagesReceived, this, &CContextNetwork::ps_FsdTextMessageReceived);
this->connect(this->m_network, &INetwork::connectionStatusChanged, this, &CContextNetwork::ps_fsdConnectionStatusChanged);
this->connect(this->m_network, &INetwork::textMessagesReceived, this, &CContextNetwork::ps_fsdTextMessageReceived);
// 2. VATSIM bookings
this->m_vatsimBookingReader = new CVatsimBookingReader(this->getRuntime()->getIContextSettings()->getNetworkSettings().getBookingServiceUrl(), this);
this->connect(this->m_vatsimBookingReader, &CVatsimBookingReader::dataRead, this, &CContextNetwork::ps_ReceivedBookings);
this->connect(this->m_vatsimBookingReader, &CVatsimBookingReader::dataRead, this, &CContextNetwork::ps_receivedBookings);
this->m_vatsimBookingReader->read(); // first read
this->m_vatsimBookingReader->setInterval(180 * 1000);
// 3. VATSIM data file
const QStringList dataFileUrls = { "http://info.vroute.net/vatsim-data.txt" };
this->m_vatsimDataFileReader = new CVatsimDataFileReader(dataFileUrls, this);
this->connect(this->m_vatsimDataFileReader, &CVatsimDataFileReader::dataRead, this, &CContextNetwork::ps_DataFileRead);
this->connect(this->m_vatsimDataFileReader, &CVatsimDataFileReader::dataRead, this, &CContextNetwork::ps_dataFileRead);
this->m_vatsimDataFileReader->read(); // first read
this->m_vatsimDataFileReader->setInterval(90 * 1000);
@@ -267,9 +267,8 @@ namespace BlackCore
/*
* Connection status changed
*/
void CContextNetwork::ps_FsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message)
void CContextNetwork::ps_fsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message)
{
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, { QString::number(from), QString::number(to) });
INetwork::ConnectionStatus fromOld = this->m_currentStatus;
this->m_currentStatus = to;
@@ -310,17 +309,19 @@ namespace BlackCore
/*
* Data file (VATSIM) has been read
*/
void CContextNetwork::ps_DataFileRead()
void CContextNetwork::ps_dataFileRead()
{
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO);
// TODO (MS) no test for if (this->getIContextApplication()) here?
this->getIContextApplication()->sendStatusMessage(CStatusMessage::getInfoMessage("Read VATSIM data file", CStatusMessage::TypeTrafficNetwork));
if (this->getIContextApplication())
{
this->getIContextApplication()->sendStatusMessage(CStatusMessage::getInfoMessage("Read VATSIM data file", CStatusMessage::TypeTrafficNetwork));
}
}
/*
* Radio text message received
*/
void CContextNetwork::ps_FsdTextMessageReceived(const CTextMessageList &messages)
void CContextNetwork::ps_fsdTextMessageReceived(const CTextMessageList &messages)
{
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, messages.toQString());
this->textMessagesReceived(messages); // relay
@@ -333,7 +334,7 @@ namespace BlackCore
return this->getRuntime()->getCContextOwnAircraft()->ownAircraft();
}
void CContextNetwork::ps_ChangedOwnAircraft(const CAircraft &aircraft, const QString &originator)
void CContextNetwork::ps_changedOwnAircraft(const CAircraft &aircraft, const QString &originator)
{
Q_ASSERT(this->m_network);
Q_UNUSED(originator);
@@ -352,7 +353,7 @@ namespace BlackCore
/*
* Updated bookings
*/
void CContextNetwork::ps_ReceivedBookings(const CAtcStationList &)
void CContextNetwork::ps_receivedBookings(const CAtcStationList &)
{
// TODO (MS) no test for if (this->getIContextApplication()) here?
this->getIContextApplication()->sendStatusMessage(CStatusMessage::getInfoMessage("Read bookings from network", CStatusMessage::TypeTrafficNetwork));

View File

@@ -7,11 +7,11 @@
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKCORE_CONTEXTNETWORK_IMPL_H
#define BLACKCORE_CONTEXTNETWORK_IMPL_H
//! \file
#include "blackcore/context_network.h"
#include "blackcore/context_settings.h"
#include "blackcore/context_runtime.h"
@@ -175,23 +175,23 @@ namespace BlackCore
private slots:
//! Own aircraft was updated
void ps_ChangedOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft, const QString &originator);
void ps_changedOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft, const QString &originator);
//! ATC bookings received
void ps_ReceivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations);
void ps_receivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations);
//! Data file has been read
void ps_DataFileRead();
void ps_dataFileRead();
/*!
* \brief Connection status changed?
* \param from old status
* \param to new status
*/
void ps_FsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message);
void ps_fsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message);
//! Radio text messages received
void ps_FsdTextMessageReceived(const BlackMisc::Network::CTextMessageList &messages);
void ps_fsdTextMessageReceived(const BlackMisc::Network::CTextMessageList &messages);
};
}

View File

@@ -457,7 +457,7 @@ namespace BlackCore
// inject updated own aircraft to network
c = this->connect(this->m_contextOwnAircraft, &IContextOwnAircraft::changedAircraft,
this->getCContextNetwork(), &CContextNetwork::ps_ChangedOwnAircraft);
this->getCContextNetwork(), &CContextNetwork::ps_changedOwnAircraft);
Q_ASSERT(c);
}
}

View File

@@ -7,11 +7,11 @@
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKCORE_VATSIMBOOKINGREADER_H
#define BLACKCORE_VATSIMBOOKINGREADER_H
//! \file
#include "blackmisc/threadedreader.h"
#include "blackmisc/avatcstationlist.h"

View File

@@ -304,7 +304,7 @@ namespace BlackCore
} // read success
nwReply->close();
nwReply->deleteLater(); // we are responsible for reading this
nwReply->deleteLater(); // we are responsible for deleting this
emit this->dataRead();
// warnings, if required

View File

@@ -37,7 +37,7 @@ namespace BlackCore
//! Constructor
explicit CVatsimDataFileReader(const QStringList &urls, QObject *parent = nullptr);
//! Read / re-read bookings
//! Read / re-read data file
void read();
//! Get aircrafts
@@ -92,9 +92,12 @@ namespace BlackCore
QStringList m_serviceUrls; /*!< URL of the service */
int m_currentUrlIndex;
QNetworkAccessManager *m_networkManager;
BlackMisc::Network::CServerList m_voiceServers;
BlackMisc::Network::CServerList m_voiceServers;
BlackMisc::Aviation::CAtcStationList m_atcStations;
BlackMisc::Aviation::CAircraftList m_aircrafts;
BlackMisc::Aviation::CAircraftList m_aircrafts;
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Network::CVoiceCapabilities> m_voiceCapabilities;
//! Split line and assign values to their corresponding attribute names
static const QMap<QString, QString> clientPartsToMap(const QString &currentLine, const QStringList &clientSectionAttributes);
//! Section in file
@@ -112,7 +115,6 @@ namespace BlackCore
signals:
//! Data have been read
void dataRead();
};
}