From 0f3d4666fa21ba99f042130fb0da064891fc2885 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 21 Jan 2014 17:49:21 +0100 Subject: [PATCH] Comments / order of methods * Reordered methods a bit * Fixed Doxygen * Removed unwanted comments --- src/blackcore/context_network.h | 8 +- src/blackcore/context_network_interface.cpp | 205 ++++++++------------ src/blackcore/context_network_interface.h | 45 ++--- 3 files changed, 108 insertions(+), 150 deletions(-) diff --git a/src/blackcore/context_network.h b/src/blackcore/context_network.h index 1add027a0..c5254856c 100644 --- a/src/blackcore/context_network.h +++ b/src/blackcore/context_network.h @@ -122,9 +122,7 @@ namespace BlackCore virtual bool isConnected() const; /*! - * \brief Set own aircraft - * \param aircraft my own aircraft - * \return + * \copydoc IContextNetwork::setOwnAircraft() */ virtual BlackMisc::CStatusMessageList setOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft); @@ -172,12 +170,12 @@ namespace BlackCore virtual BlackMisc::Voice::CVoiceRoomList getSelectedVoiceRooms() const; /*! - * \brief Get all users + * \copydoc IContextNetwork::getUsers() */ virtual BlackMisc::Network::CUserList getUsers() const; /*! - * \brief All users with callsign, e.g. for voice room resolution + * \copydoc IContextNetwork::getUsersForCallsigns */ virtual BlackMisc::Network::CUserList getUsersForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const; diff --git a/src/blackcore/context_network_interface.cpp b/src/blackcore/context_network_interface.cpp index 23fc2ae6e..c6c4a58be 100644 --- a/src/blackcore/context_network_interface.cpp +++ b/src/blackcore/context_network_interface.cpp @@ -44,126 +44,6 @@ namespace BlackCore "textMessagesReceived", this, SIGNAL(textMessagesReceived(BlackMisc::Network::CTextMessageList))); } - /* - * Relay to DBus - */ - void IContextNetwork::readAtcBookingsFromSource() const - { - this->m_dBusInterface->callDBus(QLatin1Literal("readAtcBookingsFromSource")); - } - - /* - * Relay to DBus - */ - const BlackMisc::Aviation::CAtcStationList IContextNetwork::getAtcStationsOnline() const - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAtcStationsOnline")); - } - - /* - * Relay to DBus - */ - const BlackMisc::Aviation::CAtcStationList IContextNetwork::getAtcStationsBooked() const - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAtcStationsBooked")); - } - - /* - * Relay to DBus - */ - const BlackMisc::Aviation::CAircraftList IContextNetwork::getAircraftsInRange() const - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAircraftsInRange")); - } - - /* - * Relay to DBus - */ - BlackMisc::Aviation::CAircraft IContextNetwork::getOwnAircraft() const - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("getOwnAircraft")); - } - - /* - * Relay to DBus - */ - BlackMisc::CStatusMessageList IContextNetwork::connectToNetwork() - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("connectToNetwork")); - } - - /* - * Relay to DBus - */ - BlackMisc::CStatusMessageList IContextNetwork::disconnectFromNetwork() - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("disconnectFromNetwork")); - } - - /* - * Relay to DBus - */ - bool IContextNetwork::isConnected() const - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("isConnected")); - } - - /* - * Relay to DBus - */ - BlackMisc::CStatusMessageList IContextNetwork::setOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft) - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("setOwnAircraft"), aircraft); - } - - /* - * Relay to DBus - */ - void IContextNetwork::updateOwnPosition(const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::Aviation::CAltitude &altitude) - { - this->m_dBusInterface->callDBus(QLatin1Literal("updateOwnPosition"), position, altitude); - } - - /* - * Relay to DBus - */ - void IContextNetwork::updateOwnSituation(const BlackMisc::Aviation::CAircraftSituation &situation) - { - this->m_dBusInterface->callDBus(QLatin1Literal("updateOwnSituation"), situation); - } - - /* - * Relay to DBus - */ - void IContextNetwork::updateOwnCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder) - { - this->m_dBusInterface->callDBus(QLatin1Literal("updateOwnCockpit"), com1, com2, transponder); - } - - /* - * Relay to DBus - */ - void IContextNetwork::sendTextMessages(const BlackMisc::Network::CTextMessageList &textMessages) - { - this->m_dBusInterface->callDBus(QLatin1Literal("sendTextMessages"), textMessages); - } - - /* - * Relay to DBus - */ - BlackMisc::Aviation::CInformationMessage IContextNetwork::getMetar(const QString &airportIcaoCode) - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("getMetar"), airportIcaoCode); - } - - /* - * Relay to DBus - */ - BlackMisc::Voice::CVoiceRoomList IContextNetwork::getSelectedVoiceRooms() const - { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("getSelectedVoiceRooms")); - } - /* * Logging */ @@ -181,4 +61,89 @@ namespace BlackCore qDebug() << " LOG: " << method << m1 << m2 << m3 << m4; } + void IContextNetwork::readAtcBookingsFromSource() const + { + this->m_dBusInterface->callDBus(QLatin1Literal("readAtcBookingsFromSource")); + } + + const BlackMisc::Aviation::CAtcStationList IContextNetwork::getAtcStationsOnline() const + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAtcStationsOnline")); + } + + const BlackMisc::Aviation::CAtcStationList IContextNetwork::getAtcStationsBooked() const + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAtcStationsBooked")); + } + + const BlackMisc::Aviation::CAircraftList IContextNetwork::getAircraftsInRange() const + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getAircraftsInRange")); + } + + BlackMisc::Network::CUserList IContextNetwork::getUsers() const + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getUsers")); + } + + BlackMisc::Network::CUserList IContextNetwork::getUsersForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getUsersForCallsigns"), callsigns); + } + + BlackMisc::Voice::CVoiceRoomList IContextNetwork::getSelectedVoiceRooms() const + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getSelectedVoiceRooms")); + } + + BlackMisc::Aviation::CAircraft IContextNetwork::getOwnAircraft() const + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getOwnAircraft")); + } + + BlackMisc::CStatusMessageList IContextNetwork::connectToNetwork() + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("connectToNetwork")); + } + + BlackMisc::CStatusMessageList IContextNetwork::disconnectFromNetwork() + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("disconnectFromNetwork")); + } + + bool IContextNetwork::isConnected() const + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("isConnected")); + } + + BlackMisc::CStatusMessageList IContextNetwork::setOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft) + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("setOwnAircraft"), aircraft); + } + + void IContextNetwork::updateOwnPosition(const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::Aviation::CAltitude &altitude) + { + this->m_dBusInterface->callDBus(QLatin1Literal("updateOwnPosition"), position, altitude); + } + + void IContextNetwork::updateOwnSituation(const BlackMisc::Aviation::CAircraftSituation &situation) + { + this->m_dBusInterface->callDBus(QLatin1Literal("updateOwnSituation"), situation); + } + + void IContextNetwork::updateOwnCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder) + { + this->m_dBusInterface->callDBus(QLatin1Literal("updateOwnCockpit"), com1, com2, transponder); + } + + void IContextNetwork::sendTextMessages(const BlackMisc::Network::CTextMessageList &textMessages) + { + this->m_dBusInterface->callDBus(QLatin1Literal("sendTextMessages"), textMessages); + } + + BlackMisc::Aviation::CInformationMessage IContextNetwork::getMetar(const QString &airportIcaoCode) + { + return this->m_dBusInterface->callDBusRet(QLatin1Literal("getMetar"), airportIcaoCode); + } + } // namespace diff --git a/src/blackcore/context_network_interface.h b/src/blackcore/context_network_interface.h index 89c189f9c..21a5ed14d 100644 --- a/src/blackcore/context_network_interface.h +++ b/src/blackcore/context_network_interface.h @@ -10,6 +10,7 @@ #include "blackmisc/statusmessage.h" #include "blackmisc/statusmessagelist.h" #include "blackmisc/nwtextmessagelist.h" +#include "blackmisc/nwuserlist.h" #include "blackmisc/genericdbusinterface.h" #include "blackcore/network_vatlib.h" #include "blackmisc/vvoiceroomlist.h" @@ -139,15 +140,14 @@ namespace BlackCore /*! * \brief Connection status changed - * \param from - * \param to + * \param from old status + * \param to new status + * \remarks If I use the enum, adaptor / interface are not created correctly */ - // If I use the enum, adaptor / interface are not created correctly void connectionStatusChanged(uint from, uint to); /*! * \brief Text messages (also private chat messages) - * \param textMessage */ void textMessagesReceived(const BlackMisc::Network::CTextMessageList &textMessages); @@ -160,94 +160,89 @@ namespace BlackCore virtual void readAtcBookingsFromSource() const; /*! - * \brief The "central" ATC list with online ATC controllers - * \return + * \brief The ATC list with online ATC controllers + * \remarks If I make this &getAtcStations XML is not generated correctly */ - // If I make this &getAtcStations XML is not generated correctly virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsOnline() const; /*! * \brief ATC list, with booked controllers - * \return */ virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const; /*! * \brief Aircraft list - * \return */ virtual const BlackMisc::Aviation::CAircraftList getAircraftsInRange() const; + /*! + * \brief Get all users + */ + virtual BlackMisc::Network::CUserList getUsers() const; + + /*! + * \brief All users with callsign, e.g. for voice room resolution + */ + virtual BlackMisc::Network::CUserList getUsersForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const; + /*! * \brief Get own aircraft - * \return */ virtual BlackMisc::Aviation::CAircraft getOwnAircraft() const; /*! * \brief Connect to Network - * \return + * \return messages gererated during connecting */ virtual BlackMisc::CStatusMessageList connectToNetwork(); /*! * \brief Disconnect from network - * \return + * \return messages gererated during disconnecting */ virtual BlackMisc::CStatusMessageList disconnectFromNetwork(); /*! * \brief Network connected? - * \return */ virtual bool isConnected() const; /*! * Set own aircraft * \param aircraft - * \return + * \return message list, as aircraft can only be set prior connecting */ virtual BlackMisc::CStatusMessageList setOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft); /*! * \brief Own position, be aware height is terrain height - * \param Position - * \param altitude - * \return */ virtual void updateOwnPosition(const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::Aviation::CAltitude &altitude); /*! * \brief Complete situation update - * \param Situation - * \return */ virtual void updateOwnSituation(const BlackMisc::Aviation::CAircraftSituation &situation); /*! * \brief Update own cockpit - * \param com1 - * \param com2 - * \param transponder */ virtual void updateOwnCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder); /*! * \brief Text messages (radio and private chat messages) - * \param textMessage */ virtual void sendTextMessages(const BlackMisc::Network::CTextMessageList &textMessages); /*! * \brief Get METAR, if not available request it - * \param airportIcaoCode + * \param airportIcaoCode such as EDDF, KLAX * \return */ virtual BlackMisc::Aviation::CInformationMessage getMetar(const QString &airportIcaoCode); /*! * \brief Use the selected COM1/2 frequencies, and get the corresponding voice room for it - * \return */ virtual BlackMisc::Voice::CVoiceRoomList getSelectedVoiceRooms() const; };