Ref T732, renamed to CFsdClient adjustments

This commit is contained in:
Klaus Basan
2019-09-19 11:03:47 +02:00
committed by Mat Sutcliffe
parent a24d948acd
commit 5e3b758e44
8 changed files with 82 additions and 82 deletions

View File

@@ -32,7 +32,7 @@ using namespace BlackCore::Fsd;
namespace BlackCore
{
CAirspaceAnalyzer::CAirspaceAnalyzer(IOwnAircraftProvider *ownAircraftProvider, FSDClient *fsdClient, CAirspaceMonitor *airspaceMonitorParent) :
CAirspaceAnalyzer::CAirspaceAnalyzer(IOwnAircraftProvider *ownAircraftProvider, CFSDClient *fsdClient, CAirspaceMonitor *airspaceMonitorParent) :
CContinuousWorker(airspaceMonitorParent, "CAirspaceAnalyzer"),
COwnAircraftAware(ownAircraftProvider),
CRemoteAircraftAware(airspaceMonitorParent)
@@ -47,17 +47,17 @@ namespace BlackCore
Q_ASSERT(c);
// network connected
c = connect(fsdClient, &FSDClient::deletePilotReceived, this, &CAirspaceAnalyzer::watchdogRemoveAircraftCallsign, Qt::QueuedConnection);
c = connect(fsdClient, &CFSDClient::deletePilotReceived, this, &CAirspaceAnalyzer::watchdogRemoveAircraftCallsign, Qt::QueuedConnection);
Q_ASSERT(c);
c = connect(fsdClient, &FSDClient::deleteAtcReceived, this, &CAirspaceAnalyzer::watchdogRemoveAtcCallsign, Qt::QueuedConnection);
c = connect(fsdClient, &CFSDClient::deleteAtcReceived, this, &CAirspaceAnalyzer::watchdogRemoveAtcCallsign, Qt::QueuedConnection);
Q_ASSERT(c);
c = connect(fsdClient, &FSDClient::connectionStatusChanged, this, &CAirspaceAnalyzer::onConnectionStatusChanged, Qt::QueuedConnection);
c = connect(fsdClient, &CFSDClient::connectionStatusChanged, this, &CAirspaceAnalyzer::onConnectionStatusChanged, Qt::QueuedConnection);
Q_ASSERT(c);
// network situations
c = connect(fsdClient, &FSDClient::pilotDataUpdateReceived, this, &CAirspaceAnalyzer::onNetworkPositionUpdate, Qt::QueuedConnection);
c = connect(fsdClient, &CFSDClient::pilotDataUpdateReceived, this, &CAirspaceAnalyzer::onNetworkPositionUpdate, Qt::QueuedConnection);
Q_ASSERT(c);
c = connect(fsdClient, &FSDClient::atcDataUpdateReceived, this, &CAirspaceAnalyzer::watchdogTouchAtcCallsign, Qt::QueuedConnection);
c = connect(fsdClient, &CFSDClient::atcDataUpdateReceived, this, &CAirspaceAnalyzer::watchdogTouchAtcCallsign, Qt::QueuedConnection);
Q_ASSERT(c);
// Monitor

View File

@@ -65,7 +65,7 @@ namespace BlackCore
//! Constructor
CAirspaceAnalyzer(BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
Fsd::FSDClient *fsdClient,
Fsd::CFSDClient *fsdClient,
CAirspaceMonitor *airspaceMonitorParent);
//! Destructor

View File

@@ -65,7 +65,7 @@ using namespace BlackCore::Vatsim;
namespace BlackCore
{
CAirspaceMonitor::CAirspaceMonitor(IOwnAircraftProvider *ownAircraftProvider, IAircraftModelSetProvider *modelSetProvider, FSDClient *fsdClient, QObject *parent)
CAirspaceMonitor::CAirspaceMonitor(IOwnAircraftProvider *ownAircraftProvider, IAircraftModelSetProvider *modelSetProvider, CFSDClient *fsdClient, QObject *parent)
: CRemoteAircraftProvider(parent),
COwnAircraftAware(ownAircraftProvider),
CAircraftModelSetAware(modelSetProvider),
@@ -75,24 +75,24 @@ namespace BlackCore
this->setObjectName("CAirspaceMonitor");
this->enableReverseLookupMessages(sApp->isDeveloperFlagSet() || CBuildConfig::isLocalDeveloperDebugBuild() ? RevLogEnabled : RevLogEnabledSimplified);
connect(m_fsdClient, &FSDClient::atcDataUpdateReceived, this, &CAirspaceMonitor::onAtcPositionUpdate);
connect(m_fsdClient, &CFSDClient::atcDataUpdateReceived, this, &CAirspaceMonitor::onAtcPositionUpdate);
// FSD TODO
connect(m_fsdClient, &FSDClient::atisReplyReceived, this, &CAirspaceMonitor::onAtisReceived);
connect(m_fsdClient, &FSDClient::atisVoiceRoomReplyReceived, this, &CAirspaceMonitor::onAtisVoiceRoomReceived);
connect(m_fsdClient, &FSDClient::atisLogoffTimeReplyReceived, this, &CAirspaceMonitor::onAtisLogoffTimeReceived);
connect(m_fsdClient, &FSDClient::flightPlanReceived, this, &CAirspaceMonitor::onFlightPlanReceived);
connect(m_fsdClient, &FSDClient::realNameResponseReceived, this, &CAirspaceMonitor::onRealNameReplyReceived);
connect(m_fsdClient, &FSDClient::planeInformationReceived, this, &CAirspaceMonitor::onIcaoCodesReceived);
connect(m_fsdClient, &FSDClient::deletePilotReceived, this, &CAirspaceMonitor::onPilotDisconnected);
connect(m_fsdClient, &FSDClient::deleteAtcReceived, this, &CAirspaceMonitor::onAtcControllerDisconnected);
connect(m_fsdClient, &FSDClient::pilotDataUpdateReceived, this, &CAirspaceMonitor::onAircraftUpdateReceived);
connect(m_fsdClient, &FSDClient::interimPilotDataUpdatedReceived, this, &CAirspaceMonitor::onAircraftInterimUpdateReceived);
connect(m_fsdClient, &FSDClient::com1FrequencyResponseReceived, this, &CAirspaceMonitor::onFrequencyReceived);
connect(m_fsdClient, &FSDClient::capabilityResponseReceived, this, &CAirspaceMonitor::onCapabilitiesReplyReceived);
connect(m_fsdClient, &FSDClient::planeInformationFsinnReceived, this, &CAirspaceMonitor::onCustomFSInnPacketReceived);
connect(m_fsdClient, &FSDClient::serverResponseReceived, this, &CAirspaceMonitor::onServerReplyReceived);
connect(m_fsdClient, &FSDClient::aircraftConfigReceived, this, &CAirspaceMonitor::onAircraftConfigReceived);
connect(m_fsdClient, &FSDClient::connectionStatusChanged, this, &CAirspaceMonitor::onConnectionStatusChanged);
connect(m_fsdClient, &CFSDClient::atisReplyReceived, this, &CAirspaceMonitor::onAtisReceived);
connect(m_fsdClient, &CFSDClient::atisVoiceRoomReplyReceived, this, &CAirspaceMonitor::onAtisVoiceRoomReceived);
connect(m_fsdClient, &CFSDClient::atisLogoffTimeReplyReceived, this, &CAirspaceMonitor::onAtisLogoffTimeReceived);
connect(m_fsdClient, &CFSDClient::flightPlanReceived, this, &CAirspaceMonitor::onFlightPlanReceived);
connect(m_fsdClient, &CFSDClient::realNameResponseReceived, this, &CAirspaceMonitor::onRealNameReplyReceived);
connect(m_fsdClient, &CFSDClient::planeInformationReceived, this, &CAirspaceMonitor::onIcaoCodesReceived);
connect(m_fsdClient, &CFSDClient::deletePilotReceived, this, &CAirspaceMonitor::onPilotDisconnected);
connect(m_fsdClient, &CFSDClient::deleteAtcReceived, this, &CAirspaceMonitor::onAtcControllerDisconnected);
connect(m_fsdClient, &CFSDClient::pilotDataUpdateReceived, this, &CAirspaceMonitor::onAircraftUpdateReceived);
connect(m_fsdClient, &CFSDClient::interimPilotDataUpdatedReceived, this, &CAirspaceMonitor::onAircraftInterimUpdateReceived);
connect(m_fsdClient, &CFSDClient::com1FrequencyResponseReceived, this, &CAirspaceMonitor::onFrequencyReceived);
connect(m_fsdClient, &CFSDClient::capabilityResponseReceived, this, &CAirspaceMonitor::onCapabilitiesReplyReceived);
connect(m_fsdClient, &CFSDClient::planeInformationFsinnReceived, this, &CAirspaceMonitor::onCustomFSInnPacketReceived);
connect(m_fsdClient, &CFSDClient::serverResponseReceived, this, &CAirspaceMonitor::onServerReplyReceived);
connect(m_fsdClient, &CFSDClient::aircraftConfigReceived, this, &CAirspaceMonitor::onAircraftConfigReceived);
connect(m_fsdClient, &CFSDClient::connectionStatusChanged, this, &CAirspaceMonitor::onConnectionStatusChanged);
// AutoConnection: this should also avoid race conditions by updating the bookings
Q_ASSERT_X(sApp && sApp->getWebDataServices(), Q_FUNC_INFO, "Missing data reader");

View File

@@ -75,7 +75,7 @@ namespace BlackCore
//! Constructor
CAirspaceMonitor(BlackMisc::Simulation::IOwnAircraftProvider *ownAircraft,
BlackMisc::Simulation::IAircraftModelSetProvider *modelSetProvider,
Fsd::FSDClient *fsdClient,
Fsd::CFSDClient *fsdClient,
QObject *parent);
//! Members not implenented or fully implenented by CRemoteAircraftProvider
@@ -257,7 +257,7 @@ namespace BlackCore
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TModelMatching> m_matchingSettings { this }; //!< settings
QQueue<BlackMisc::Aviation::CCallsign> m_queryAtis; //!< query the ATIS
QQueue<BlackMisc::Aviation::CCallsign> m_queryPilot; //!< query the pilot data
Fsd::FSDClient *m_fsdClient = nullptr; //!< corresponding network interface
Fsd::CFSDClient *m_fsdClient = nullptr; //!< corresponding network interface
CAirspaceAnalyzer *m_analyzer = nullptr; //!< owned analyzer
bool m_bookingsRequested = false; //!< bookings have been requested, it can happen we receive an BlackCore::Vatsim::CVatsimBookingReader::atcBookingsReadUnchanged signal
QTimer m_processTimer;

View File

@@ -68,12 +68,12 @@ namespace BlackCore
CContextNetwork::registerHelp();
// 1. Init by "network driver"
m_fsdClient = new FSDClient(this, this->getRuntime()->getCContextOwnAircraft(), this, this);
connect(m_fsdClient, &FSDClient::connectionStatusChanged, this, &CContextNetwork::onFsdConnectionStatusChanged);
connect(m_fsdClient, &FSDClient::killRequestReceived, this, &CContextNetwork::kicked);
connect(m_fsdClient, &FSDClient::textMessagesReceived, this, &CContextNetwork::textMessagesReceived);
m_fsdClient = new CFSDClient(this, this->getRuntime()->getCContextOwnAircraft(), this, this);
connect(m_fsdClient, &CFSDClient::connectionStatusChanged, this, &CContextNetwork::onFsdConnectionStatusChanged);
connect(m_fsdClient, &CFSDClient::killRequestReceived, this, &CContextNetwork::kicked);
connect(m_fsdClient, &CFSDClient::textMessagesReceived, this, &CContextNetwork::textMessagesReceived);
// connect(m_fsdClient, &FSDClient::textMessagesReceived, this, &CContextNetwork::checkForSupervisiorTextMessage);
connect(m_fsdClient, &FSDClient::textMessageSent, this, &CContextNetwork::textMessageSent);
connect(m_fsdClient, &CFSDClient::textMessageSent, this, &CContextNetwork::textMessageSent);
// 2. Update timer for data (network data such as frequency)
// we use 2 timers so we can query at different times (not too many queirs at once)
@@ -1201,7 +1201,7 @@ namespace BlackCore
// bind does not allow to define connection type, so we use receiver as workaround
const QMetaObject::Connection uc; // unconnected
const QMetaObject::Connection c = rawFsdMessageReceivedSlot ? connect(m_fsdClient, &FSDClient::rawFsdMessage, receiver, rawFsdMessageReceivedSlot) : uc;
const QMetaObject::Connection c = rawFsdMessageReceivedSlot ? connect(m_fsdClient, &CFSDClient::rawFsdMessage, receiver, rawFsdMessageReceivedSlot) : uc;
Q_ASSERT_X(c || !rawFsdMessageReceivedSlot, Q_FUNC_INFO, "connect failed");
return c;
}

View File

@@ -150,7 +150,7 @@ namespace BlackCore
//! \remarks public so values can be logged/monitored
//! @{
//! Network library
Fsd::FSDClient *fsdClient() const { return m_fsdClient; }
Fsd::CFSDClient *fsdClient() const { return m_fsdClient; }
//! Airspace
CAirspaceMonitor *airspace() const { return m_airspace; }
@@ -293,7 +293,7 @@ namespace BlackCore
private:
CAirspaceMonitor *m_airspace = nullptr;
Fsd::FSDClient *m_fsdClient = nullptr;
Fsd::CFSDClient *m_fsdClient = nullptr;
BlackMisc::Network::CLoginMode m_currentMode = BlackMisc::Network::CLoginMode::Pilot; //!< current modeM
QTimer *m_requestAircraftDataTimer = nullptr; //!< general updates such as frequencies, see requestAircraftDataUpdates()
QTimer *m_requestAtisTimer = nullptr; //!< general updates such as ATIS