mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
* set infobar status correctly when GUI connects after the core has been started * more detailed information in information statusbar * allow to obtain currently connected server in network context * made many network vatlib slots normal member functions * fixed rendered aircraft flag setting in FSX driver
This commit is contained in:
committed by
Mathew Sutcliffe
parent
1d89862080
commit
3c15f2ad89
@@ -194,10 +194,13 @@ namespace BlackCore
|
||||
virtual BlackMisc::Aviation::CCallsignSet getFastPositionEnabledCallsigns() = 0;
|
||||
|
||||
//! Connect to Network
|
||||
//! \return messages gererated during connecting
|
||||
//! \return messages generated during connecting
|
||||
//! \see INetwork::LoginMode
|
||||
virtual BlackMisc::CStatusMessage connectToNetwork(const BlackMisc::Network::CServer &server, uint loginMode) = 0;
|
||||
|
||||
//! Server which is connected, if not connected empty default object.
|
||||
virtual BlackMisc::Network::CServer getConnectedServer() const = 0;
|
||||
|
||||
//! Disconnect from network
|
||||
//! \return messages generated during disconnecting
|
||||
virtual BlackMisc::CStatusMessage disconnectFromNetwork() = 0;
|
||||
|
||||
@@ -104,6 +104,13 @@ namespace BlackCore
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextNetwork::getConnectedServer
|
||||
virtual BlackMisc::Network::CServer getConnectedServer() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return BlackMisc::Network::CServer();
|
||||
}
|
||||
|
||||
//! \copydoc IContextNetwork::sendTextMessages()
|
||||
virtual void sendTextMessages(const BlackMisc::Network::CTextMessageList &textMessages) override
|
||||
{
|
||||
|
||||
@@ -189,6 +189,18 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
CServer CContextNetwork::getConnectedServer() const
|
||||
{
|
||||
if (this->isConnected())
|
||||
{
|
||||
return this->m_network->getPresetServer();
|
||||
}
|
||||
else
|
||||
{
|
||||
return CServer();
|
||||
}
|
||||
}
|
||||
|
||||
CStatusMessage CContextNetwork::disconnectFromNetwork()
|
||||
{
|
||||
if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
|
||||
@@ -127,6 +127,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextNetwork::connectToNetwork()
|
||||
virtual BlackMisc::CStatusMessage connectToNetwork(const BlackMisc::Network::CServer &server, uint mode) override;
|
||||
|
||||
//! \copydoc IContextNetwork::getConnectedServer
|
||||
virtual BlackMisc::Network::CServer getConnectedServer() const override;
|
||||
|
||||
//! \copydoc IContextNetwork::disconnectFromNetwork()
|
||||
virtual BlackMisc::CStatusMessage disconnectFromNetwork() override;
|
||||
|
||||
@@ -256,13 +259,8 @@ namespace BlackCore
|
||||
//! Check if a supervisor message was received
|
||||
void ps_checkForSupervisiorTextMessage(const BlackMisc::Network::CTextMessageList &messages);
|
||||
|
||||
/*!
|
||||
* \brief Connection status changed?
|
||||
* \param from old status
|
||||
* \param to new status
|
||||
*/
|
||||
//! Connection status changed
|
||||
void ps_fsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -243,6 +243,11 @@ namespace BlackCore
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("isConnected"));
|
||||
}
|
||||
|
||||
CServer CContextNetworkProxy::getConnectedServer() const
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::Network::CServer>(QLatin1Literal("getConnectedServer"));
|
||||
}
|
||||
|
||||
bool CContextNetworkProxy::parseCommandLine(const QString &commandLine, const QString &originator)
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1Literal("commandLineEntered"), commandLine, originator);
|
||||
|
||||
@@ -84,6 +84,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextNetwork::isConnected()
|
||||
virtual bool isConnected() const override;
|
||||
|
||||
//! \copydoc IContextNetwork::getConnectedServer
|
||||
virtual BlackMisc::Network::CServer getConnectedServer() const override;
|
||||
|
||||
//! \copydoc IContextNetwork::parseCommandLine
|
||||
virtual bool parseCommandLine(const QString &commandLine, const QString &originator) override;
|
||||
|
||||
|
||||
@@ -139,23 +139,26 @@ namespace BlackCore
|
||||
status == DisconnectedFailed || status == DisconnectedLost;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//! \name Network slots
|
||||
//! @{
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
/*!
|
||||
* Returns true if the current ConnectionStatus is a connected state.
|
||||
*/
|
||||
virtual bool isConnected() const = 0;
|
||||
|
||||
/*!
|
||||
* Get preset server.
|
||||
*/
|
||||
virtual BlackMisc::Network::CServer getPresetServer() const = 0;
|
||||
|
||||
/*!
|
||||
* Returns true if the current ConnectionStatus is in transition, e.g. connecting.
|
||||
*/
|
||||
virtual bool isPendingConnection() const = 0;
|
||||
|
||||
public slots:
|
||||
////////////////////////////////////////////////////////////////
|
||||
//! \name Network slots
|
||||
//! @{
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
/*!
|
||||
* Set the server which will be connected to.
|
||||
* \pre Network must be disconnected when calling this function.
|
||||
|
||||
@@ -277,7 +277,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
/********************************** * * * * * * * * * * * * * * * * * * * ************************************/
|
||||
/********************************** INetwork slots ************************************/
|
||||
/********************************** INetwork functions ************************************/
|
||||
/********************************** * * * * * * * * * * * * * * * * * * * ************************************/
|
||||
|
||||
void CNetworkVatlib::presetServer(const CServer &server)
|
||||
|
||||
@@ -39,9 +39,10 @@ namespace BlackCore
|
||||
//! Destructor
|
||||
virtual ~CNetworkVatlib();
|
||||
|
||||
//! \name Network slots
|
||||
//! \name Network functions
|
||||
//! @{
|
||||
virtual bool isConnected() const override { return m_status == vatStatusConnected; }
|
||||
virtual BlackMisc::Network::CServer getPresetServer() const override { return m_server; }
|
||||
virtual bool isPendingConnection() const override { return m_status == vatStatusConnecting; }
|
||||
virtual void presetLoginMode(LoginMode mode) override;
|
||||
virtual void presetServer(const BlackMisc::Network::CServer &server) override;
|
||||
@@ -62,12 +63,12 @@ namespace BlackCore
|
||||
virtual void sendAircraftConfigQuery(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
//! @}
|
||||
|
||||
//! \name Text message slots
|
||||
//! \name Text message functions
|
||||
//! @{
|
||||
virtual void sendTextMessages(const BlackMisc::Network::CTextMessageList &messages) override;
|
||||
//! @}
|
||||
|
||||
//! \name ATC slots
|
||||
//! \name ATC functions
|
||||
//! @{
|
||||
virtual void sendAtcQuery(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual void sendAtisQuery(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
@@ -75,7 +76,7 @@ namespace BlackCore
|
||||
virtual void sendFlightPlanQuery(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
//! @}
|
||||
|
||||
//! \name Aircraft slots
|
||||
//! \name Aircraft functions
|
||||
//! @{
|
||||
virtual void sendCapabilitiesQuery(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual void sendIcaoCodesQuery(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
@@ -84,7 +85,7 @@ namespace BlackCore
|
||||
virtual void sendInterimPositions(const BlackMisc::Aviation::CCallsignSet &receiver) override;
|
||||
//! @}
|
||||
|
||||
//! \name Weather slots
|
||||
//! \name Weather functions
|
||||
//! @{
|
||||
virtual void sendMetarQuery(const BlackMisc::Aviation::CAirportIcao &airportIcao) override;
|
||||
virtual void sendWeatherDataQuery(const BlackMisc::Aviation::CAirportIcao &airportIcao) override;
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace BlackCore
|
||||
//! ISimulator status
|
||||
enum SimulatorStatus
|
||||
{
|
||||
Disconnected = 0,
|
||||
Connected = 1 << 0, //!< Is the plugin connected to the simulator?
|
||||
Running = 1 << 1, //!< Is the simulator actually simulating?
|
||||
Paused = 1 << 2, //!< Is the simulator paused?
|
||||
|
||||
Reference in New Issue
Block a user