mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 12:15:29 +08:00
refs #316 Removed old statusMessage signals and sendStatusMessage slots.
This commit is contained in:
@@ -30,7 +30,6 @@ Client::Client(QObject *parent)
|
|||||||
connect(m_net, &INetwork::pongReceived, this, &Client::pongReceived);
|
connect(m_net, &INetwork::pongReceived, this, &Client::pongReceived);
|
||||||
connect(m_net, &INetwork::textMessagesReceived, this, &Client::textMessagesReceived);
|
connect(m_net, &INetwork::textMessagesReceived, this, &Client::textMessagesReceived);
|
||||||
connect(m_net, &INetwork::customPacketReceived, this, &Client::customPacketReceived);
|
connect(m_net, &INetwork::customPacketReceived, this, &Client::customPacketReceived);
|
||||||
connect(m_net, &INetwork::statusMessage, this, &Client::statusMessage);
|
|
||||||
|
|
||||||
connect(this, &Client::presetServer, m_net, &INetwork::presetServer);
|
connect(this, &Client::presetServer, m_net, &INetwork::presetServer);
|
||||||
connect(this, &Client::presetCallsign, m_net, &INetwork::presetCallsign);
|
connect(this, &Client::presetCallsign, m_net, &INetwork::presetCallsign);
|
||||||
@@ -565,9 +564,3 @@ void Client::customPacketReceived(const BlackMisc::Aviation::CCallsign &callsign
|
|||||||
}
|
}
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::statusMessage(const BlackMisc::CStatusMessage &message)
|
|
||||||
{
|
|
||||||
std::cout << "STATUS " << message.getSeverityAsString().toStdString() << " " << message.getTypeAsString().toStdString() << " "
|
|
||||||
<< message.getMessage().toStdString() << "\n";
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ public slots: //to receive from INetwork
|
|||||||
void pongReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CTime &elapsedTime);
|
void pongReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CTime &elapsedTime);
|
||||||
void textMessagesReceived(const BlackMisc::Network::CTextMessageList &messages);
|
void textMessagesReceived(const BlackMisc::Network::CTextMessageList &messages);
|
||||||
void customPacketReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &packetId, const QStringList &data);
|
void customPacketReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &packetId, const QStringList &data);
|
||||||
void statusMessage(const BlackMisc::CStatusMessage &message);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMap<QString, std::function<void(QTextStream &)>> m_commands;
|
QMap<QString, std::function<void(QTextStream &)>> m_commands;
|
||||||
|
|||||||
@@ -83,14 +83,6 @@ namespace BlackCore
|
|||||||
virtual ~IContextApplication() {}
|
virtual ~IContextApplication() {}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! \brief Status message
|
|
||||||
//! \remarks not to be called directly, use IContextApplication::sendStatusMessage
|
|
||||||
void statusMessage(const BlackMisc::CStatusMessage &message);
|
|
||||||
|
|
||||||
//! Send status messages
|
|
||||||
//! \remarks not to be called directly, use IContextApplication::sendStatusMessage(s)
|
|
||||||
void statusMessages(const BlackMisc::CStatusMessageList &messages);
|
|
||||||
|
|
||||||
//! A component changes
|
//! A component changes
|
||||||
void componentChanged(uint component, uint action);
|
void componentChanged(uint component, uint action);
|
||||||
|
|
||||||
@@ -99,12 +91,6 @@ namespace BlackCore
|
|||||||
//! \brief Ping a token, used to check if application is alive
|
//! \brief Ping a token, used to check if application is alive
|
||||||
virtual qint64 ping(qint64 token) const = 0;
|
virtual qint64 ping(qint64 token) const = 0;
|
||||||
|
|
||||||
//! Status message
|
|
||||||
virtual void sendStatusMessage(const BlackMisc::CStatusMessage &message) = 0;
|
|
||||||
|
|
||||||
//! Send status messages
|
|
||||||
virtual void sendStatusMessages(const BlackMisc::CStatusMessageList &messages) = 0;
|
|
||||||
|
|
||||||
//! A component has changed its state
|
//! A component has changed its state
|
||||||
virtual void notifyAboutComponentChange(uint component, uint action) = 0;
|
virtual void notifyAboutComponentChange(uint component, uint action) = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -30,22 +30,6 @@ namespace BlackCore
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Status message
|
|
||||||
*/
|
|
||||||
void CContextApplication::sendStatusMessage(const CStatusMessage &message)
|
|
||||||
{
|
|
||||||
emit this->statusMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Status messages
|
|
||||||
*/
|
|
||||||
void CContextApplication::sendStatusMessages(const CStatusMessageList &messages)
|
|
||||||
{
|
|
||||||
emit this->statusMessages(messages);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Component has changed
|
* Component has changed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,12 +28,6 @@ namespace BlackCore
|
|||||||
//! \copydoc IContextApplication::ping()
|
//! \copydoc IContextApplication::ping()
|
||||||
virtual qint64 ping(qint64 token) const override;
|
virtual qint64 ping(qint64 token) const override;
|
||||||
|
|
||||||
//! Status message
|
|
||||||
virtual void sendStatusMessage(const BlackMisc::CStatusMessage &message) override;
|
|
||||||
|
|
||||||
//! Send status messages
|
|
||||||
virtual void sendStatusMessages(const BlackMisc::CStatusMessageList &messages) override;
|
|
||||||
|
|
||||||
//! \copydoc IContextApplication::notifyAboutComponentChange
|
//! \copydoc IContextApplication::notifyAboutComponentChange
|
||||||
virtual void notifyAboutComponentChange(uint component, uint action) override;
|
virtual void notifyAboutComponentChange(uint component, uint action) override;
|
||||||
|
|
||||||
|
|||||||
@@ -34,12 +34,6 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
// signals originating from impl side
|
// signals originating from impl side
|
||||||
bool s = connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
|
bool s = connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
|
||||||
"statusMessage", this, SIGNAL(statusMessage(BlackMisc::CStatusMessage)));
|
|
||||||
Q_ASSERT(s);
|
|
||||||
s = connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
|
|
||||||
"statusMessages", this, SIGNAL(statusMessages(BlackMisc::CStatusMessageList)));
|
|
||||||
Q_ASSERT(s);
|
|
||||||
s = connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
|
|
||||||
"componentChanged", this, SIGNAL(componentChanged(uint, uint)));
|
"componentChanged", this, SIGNAL(componentChanged(uint, uint)));
|
||||||
Q_ASSERT(s);
|
Q_ASSERT(s);
|
||||||
|
|
||||||
@@ -54,22 +48,6 @@ namespace BlackCore
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Status messages
|
|
||||||
*/
|
|
||||||
void CContextApplicationProxy::sendStatusMessage(const BlackMisc::CStatusMessage &message)
|
|
||||||
{
|
|
||||||
this->m_dBusInterface->callDBus(QLatin1Literal("sendStatusMessage"), message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Status messages
|
|
||||||
*/
|
|
||||||
void CContextApplicationProxy::sendStatusMessages(const BlackMisc::CStatusMessageList &messages)
|
|
||||||
{
|
|
||||||
this->m_dBusInterface->callDBus(QLatin1Literal("sendStatusMessages"), messages);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Component has changed
|
* Component has changed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -27,12 +27,6 @@ namespace BlackCore
|
|||||||
//! \copydoc IContextApplication::ping()
|
//! \copydoc IContextApplication::ping()
|
||||||
virtual qint64 ping(qint64 token) const override;
|
virtual qint64 ping(qint64 token) const override;
|
||||||
|
|
||||||
//! Status message
|
|
||||||
virtual void sendStatusMessage(const BlackMisc::CStatusMessage &message) override;
|
|
||||||
|
|
||||||
//! Send status messages
|
|
||||||
virtual void sendStatusMessages(const BlackMisc::CStatusMessageList &messages) override;
|
|
||||||
|
|
||||||
//! \copydoc IContextApplication::notifyAboutComponentChange
|
//! \copydoc IContextApplication::notifyAboutComponentChange
|
||||||
virtual void notifyAboutComponentChange(uint component, uint action) override;
|
virtual void notifyAboutComponentChange(uint component, uint action) override;
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ namespace BlackCore
|
|||||||
connect(this->m_voice, &CVoiceVatlib::micTestFinished, this, &CContextAudio::audioTestCompleted);
|
connect(this->m_voice, &CVoiceVatlib::micTestFinished, this, &CContextAudio::audioTestCompleted);
|
||||||
connect(this->m_voice, &CVoiceVatlib::squelchTestFinished, this, &CContextAudio::audioTestCompleted);
|
connect(this->m_voice, &CVoiceVatlib::squelchTestFinished, this, &CContextAudio::audioTestCompleted);
|
||||||
//connect(this->m_voice, &CVoiceVatlib::connectionStatusChanged, this, &CContextAudio::ps_connectionStatusChanged);
|
//connect(this->m_voice, &CVoiceVatlib::connectionStatusChanged, this, &CContextAudio::ps_connectionStatusChanged);
|
||||||
if (this->getIContextApplication()) this->connect(this->m_voice, &IVoice::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage);
|
|
||||||
|
|
||||||
m_channelCom1 = m_voice->getVoiceChannel(0);
|
m_channelCom1 = m_voice->getVoiceChannel(0);
|
||||||
m_channelCom1->setMyAircraftCallsign(getIContextOwnAircraft()->getOwnAircraft().getCallsign());
|
m_channelCom1->setMyAircraftCallsign(getIContextOwnAircraft()->getOwnAircraft().getCallsign());
|
||||||
|
|||||||
@@ -76,12 +76,6 @@ namespace BlackCore
|
|||||||
this->connect(this->m_airspace, &CAirspaceMonitor::changedAircraftSituation, this, &CContextNetwork::changedAircraftSituation);
|
this->connect(this->m_airspace, &CAirspaceMonitor::changedAircraftSituation, this, &CContextNetwork::changedAircraftSituation);
|
||||||
this->connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraft, this->m_airspace, &CAirspaceMonitor::setOwnAircraft);
|
this->connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraft, this->m_airspace, &CAirspaceMonitor::setOwnAircraft);
|
||||||
this->connect(this->getIContextSimulator(), &IContextSimulator::ownAircraftModelChanged, this->m_airspace, &CAirspaceMonitor::setOwnAircraftModel);
|
this->connect(this->getIContextSimulator(), &IContextSimulator::ownAircraftModelChanged, this->m_airspace, &CAirspaceMonitor::setOwnAircraftModel);
|
||||||
|
|
||||||
// FIXME (MS) conditional increases the number of scenarios which must be considered and continuously tested
|
|
||||||
if (this->getIContextApplication())
|
|
||||||
{
|
|
||||||
this->connect(this->m_network, &INetwork::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -159,18 +159,6 @@ namespace BlackCore
|
|||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// only if application runs locally
|
|
||||||
if (this->m_contextApplication && this->m_contextApplication->usingLocalObjects())
|
|
||||||
{
|
|
||||||
c = connect(this->m_contextApplication, &IContextApplication::statusMessage,
|
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_statusMessageReceived);
|
|
||||||
Q_ASSERT(c);
|
|
||||||
|
|
||||||
c = connect(this->m_contextApplication, &IContextApplication::statusMessages,
|
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_statusMessagesReceived);
|
|
||||||
Q_ASSERT(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
// connect local simulator and settings and load plugin
|
// connect local simulator and settings and load plugin
|
||||||
if (this->m_contextSettings)
|
if (this->m_contextSettings)
|
||||||
{
|
{
|
||||||
@@ -258,18 +246,6 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRuntime::sendStatusMessage(const CStatusMessage &message)
|
|
||||||
{
|
|
||||||
if (!this->getIContextApplication()) return;
|
|
||||||
this->getIContextApplication()->sendStatusMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRuntime::sendStatusMessages(const CStatusMessageList &messages)
|
|
||||||
{
|
|
||||||
if (!this->getIContextApplication()) return;
|
|
||||||
this->getIContextApplication()->sendStatusMessages(messages);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRuntime::initDBusConnection(const QString &address)
|
void CRuntime::initDBusConnection(const QString &address)
|
||||||
{
|
{
|
||||||
if (this->m_initDBusConnection) return;
|
if (this->m_initDBusConnection) return;
|
||||||
|
|||||||
@@ -52,14 +52,6 @@ namespace BlackCore
|
|||||||
//! Clean up (will be connected to signal QCoreApplication::aboutToQuit)
|
//! Clean up (will be connected to signal QCoreApplication::aboutToQuit)
|
||||||
void gracefulShutdown();
|
void gracefulShutdown();
|
||||||
|
|
||||||
//! \copydoc IContextApplication::sendStatusMessage
|
|
||||||
//! \remarks fail safe
|
|
||||||
void sendStatusMessage(const BlackMisc::CStatusMessage &message);
|
|
||||||
|
|
||||||
//! \copydoc IContextApplication::sendStatusMessage
|
|
||||||
//! \remarks fail safe
|
|
||||||
void sendStatusMessages(const BlackMisc::CStatusMessageList &messages);
|
|
||||||
|
|
||||||
// ------- Context as interface, normal way to access a context
|
// ------- Context as interface, normal way to access a context
|
||||||
|
|
||||||
//! Context for network
|
//! Context for network
|
||||||
|
|||||||
@@ -165,16 +165,6 @@ namespace BlackCore
|
|||||||
|
|
||||||
connect(m_simulator, &ISimulator::statusChanged, this, &CContextSimulator::ps_setConnectionStatus);
|
connect(m_simulator, &ISimulator::statusChanged, this, &CContextSimulator::ps_setConnectionStatus);
|
||||||
connect(m_simulator, &ISimulator::aircraftModelChanged, this, &IContextSimulator::ownAircraftModelChanged);
|
connect(m_simulator, &ISimulator::aircraftModelChanged, this, &IContextSimulator::ownAircraftModelChanged);
|
||||||
if (this->getIContextApplication() && this->getIContextApplication()->usingLocalObjects())
|
|
||||||
{
|
|
||||||
// relay status messages
|
|
||||||
connect(m_simulator, &ISimulator::sendStatusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage);
|
|
||||||
connect(m_simulator, &ISimulator::sendStatusMessages, this->getIContextApplication(), &IContextApplication::sendStatusMessages);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qFatal("No application context or application context not local");
|
|
||||||
}
|
|
||||||
|
|
||||||
CAirspaceMonitor *airspace = this->getRuntime()->getCContextNetwork()->getAirspaceMonitor();
|
CAirspaceMonitor *airspace = this->getRuntime()->getCContextNetwork()->getAirspaceMonitor();
|
||||||
connect(airspace, &CAirspaceMonitor::addedAircraft, this, &CContextSimulator::ps_addRemoteAircraft);
|
connect(airspace, &CAirspaceMonitor::addedAircraft, this, &CContextSimulator::ps_addRemoteAircraft);
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pqtime.h"
|
||||||
#include "blackmisc/nwserverlist.h"
|
#include "blackmisc/nwserverlist.h"
|
||||||
#include "blackmisc/nwtextmessagelist.h"
|
#include "blackmisc/nwtextmessagelist.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
|
||||||
#include "blackmisc/avinformationmessage.h"
|
#include "blackmisc/avinformationmessage.h"
|
||||||
#include "blackmisc/avflightplan.h"
|
#include "blackmisc/avflightplan.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@@ -476,11 +475,6 @@ namespace BlackCore
|
|||||||
//! @{
|
//! @{
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/*!
|
|
||||||
* We sent a message about the status of the network connection, for the attention of the user.
|
|
||||||
*/
|
|
||||||
void statusMessage(const BlackMisc::CStatusMessage &message);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* We were kicked from the network. (A connectionStatusChanged signal will also be sent.)
|
* We were kicked from the network. (A connectionStatusChanged signal will also be sent.)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -118,12 +118,6 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! Simulator stopped;
|
//! Simulator stopped;
|
||||||
void simulatorStopped();
|
void simulatorStopped();
|
||||||
|
|
||||||
//! Send a message to be displayed (from simulator to contexts)
|
|
||||||
void sendStatusMessage(const BlackMisc::CStatusMessage &message);
|
|
||||||
|
|
||||||
//! Send messages to be displayed (from simulator to contexts)
|
|
||||||
void sendStatusMessages(const BlackMisc::CStatusMessageList &messages);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Factory pattern class to create instances of ISimulator
|
//! Factory pattern class to create instances of ISimulator
|
||||||
|
|||||||
@@ -96,8 +96,6 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig)
|
|||||||
|
|
||||||
// signal / slots contexts / timers
|
// signal / slots contexts / timers
|
||||||
bool connect;
|
bool connect;
|
||||||
this->connect(this->getIContextApplication(), &IContextApplication::statusMessage, this, &MainWindow::ps_displayStatusMessageInGui);
|
|
||||||
this->connect(this->getIContextApplication(), &IContextApplication::statusMessages, this, &MainWindow::ps_displayStatusMessagesInGui);
|
|
||||||
this->connect(this->getIContextNetwork(), &IContextNetwork::connectionTerminated, this, &MainWindow::ps_onConnectionTerminated);
|
this->connect(this->getIContextNetwork(), &IContextNetwork::connectionTerminated, this, &MainWindow::ps_onConnectionTerminated);
|
||||||
this->connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &MainWindow::ps_onConnectionStatusChanged);
|
this->connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &MainWindow::ps_onConnectionStatusChanged);
|
||||||
connect = this->connect(this->getIContextNetwork(), SIGNAL(textMessagesReceived(BlackMisc::Network::CTextMessageList)), this->ui->comp_MainInfoArea->getTextMessageComponent(), SLOT(appendTextMessagesToGui(BlackMisc::Network::CTextMessageList)));
|
connect = this->connect(this->getIContextNetwork(), SIGNAL(textMessagesReceived(BlackMisc::Network::CTextMessageList)), this->ui->comp_MainInfoArea->getTextMessageComponent(), SLOT(appendTextMessagesToGui(BlackMisc::Network::CTextMessageList)));
|
||||||
|
|||||||
Reference in New Issue
Block a user