From ac80bce1718cce0f7db3178eef58c1c41b46fad0 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Wed, 11 Jun 2014 21:05:25 +0100 Subject: [PATCH] refs #246 added comments to highlight issues of dependencies and large number of scenarios --- src/blackcore/context_network_atc.cpp | 1 + src/blackcore/context_network_impl.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/blackcore/context_network_atc.cpp b/src/blackcore/context_network_atc.cpp index dd5d57192..8dbd6a59b 100644 --- a/src/blackcore/context_network_atc.cpp +++ b/src/blackcore/context_network_atc.cpp @@ -56,6 +56,7 @@ namespace BlackCore this->m_atcStationsBooked.push_back(bookedStation); } + // TODO (MS) no test for if (this->getIContextApplication()) here? this->getIContextApplication()->sendStatusMessage(CStatusMessage::getInfoMessage("Read bookings from network", CStatusMessage::TypeTrafficNetwork)); } diff --git a/src/blackcore/context_network_impl.cpp b/src/blackcore/context_network_impl.cpp index 589eed41f..7d1e2eb32 100644 --- a/src/blackcore/context_network_impl.cpp +++ b/src/blackcore/context_network_impl.cpp @@ -76,7 +76,12 @@ namespace BlackCore this->connect(this->m_network, &INetwork::capabilitiesReplyReceived, this, &CContextNetwork::psFsdCapabilitiesReplyReceived); this->connect(this->m_network, &INetwork::customPacketReceived, this, &CContextNetwork::psFsdCustomPacketReceived); this->connect(this->m_network, &INetwork::serverReplyReceived, this, &CContextNetwork::psFsdServerReplyReceived); - if (this->getIContextApplication()) this->connect(this->m_network, &INetwork::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage); + + // 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); + } } /* @@ -347,7 +352,11 @@ namespace BlackCore if (!message.isEmpty()) m.append(" ").append(message); msgs.push_back(CStatusMessage(CStatusMessage::TypeTrafficNetwork, to == INetwork::DisconnectedError ? CStatusMessage::SeverityError : CStatusMessage::SeverityInfo, m)); - if (this->getIContextApplication()) this->getIContextApplication()->sendStatusMessages(msgs); + // FIXME (MS) conditional increases the number of scenarios which must be considered and continuously tested + if (this->getIContextApplication()) + { + this->getIContextApplication()->sendStatusMessages(msgs); + } // send as own signal emit this->connectionStatusChanged(from, to, message); @@ -377,6 +386,7 @@ namespace BlackCore void CContextNetwork::psDataFileRead() { 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)); } @@ -485,6 +495,7 @@ namespace BlackCore CAircraft me = this->ownAircraft(); CAircraftIcao icao = me.getIcaoInfo(); QString modelString; + // FIXME (MS) simulator context should send model string to own aircraft context, so we wouldn't need to interrogate the simulator context here. if (this->getIContextSimulator()) { if (this->getIContextSimulator()->isConnected()) modelString = this->getIContextSimulator()->getOwnAircraftModel().getQueriedModelString();