mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
refs #207, fixed signal/slot connection in runtime
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
#include "blackcore/context_runtime.h"
|
#include "blackcore/context_runtime.h"
|
||||||
#include "blackmisc/nwserver.h"
|
|
||||||
#include "blackmisc/statusmessagelist.h"
|
|
||||||
#include "blackmisc/avaircraft.h"
|
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
|
||||||
|
|
||||||
#include "blackcore/context_application_impl.h"
|
#include "blackcore/context_application_impl.h"
|
||||||
#include "blackcore/context_network_impl.h"
|
#include "blackcore/context_network_impl.h"
|
||||||
@@ -16,6 +12,15 @@
|
|||||||
#include "blackcore/context_audio_proxy.h"
|
#include "blackcore/context_audio_proxy.h"
|
||||||
#include "blackcore/context_simulator_proxy.h"
|
#include "blackcore/context_simulator_proxy.h"
|
||||||
|
|
||||||
|
#include "blacksim/blacksimfreefunctions.h"
|
||||||
|
|
||||||
|
#include "blackmisc/nwserver.h"
|
||||||
|
#include "blackmisc/statusmessagelist.h"
|
||||||
|
#include "blackmisc/avaircraft.h"
|
||||||
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
@@ -230,6 +235,7 @@ namespace BlackCore
|
|||||||
if (m_init) return;
|
if (m_init) return;
|
||||||
BlackMisc::registerMetadata();
|
BlackMisc::registerMetadata();
|
||||||
BlackMisc::initResources();
|
BlackMisc::initResources();
|
||||||
|
BlackSim::registerMetadata();
|
||||||
|
|
||||||
// upfront reading of settings, as DBus server already relies on settings
|
// upfront reading of settings, as DBus server already relies on settings
|
||||||
CContextSettings *settings = nullptr;
|
CContextSettings *settings = nullptr;
|
||||||
@@ -334,19 +340,24 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CRuntime::initPostSetup()
|
void CRuntime::initPostSetup()
|
||||||
{
|
{
|
||||||
|
bool c;
|
||||||
|
Q_UNUSED(c); // for release version
|
||||||
if (this->m_contextSettings && this->m_contextAudio && this->m_contextSettings->usingLocalObjects())
|
if (this->m_contextSettings && this->m_contextAudio && this->m_contextSettings->usingLocalObjects())
|
||||||
{
|
{
|
||||||
// only, when both contexts exists and only if settings originate locally
|
// only, when both contexts exists and only if settings originate locally
|
||||||
connect(this->m_contextSettings, &IContextSettings::changedSettings,
|
c = connect(this->m_contextSettings, &IContextSettings::changedSettings,
|
||||||
this->getCContextAudio(), &CContextAudio::settingsChanged);
|
this->getCContextAudio(), &CContextAudio::settingsChanged);
|
||||||
|
Q_ASSERT(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->m_contextSimulator && this->m_contextSimulator->usingLocalObjects() && this->m_contextNetwork)
|
if (this->m_contextSimulator && this->m_contextSimulator->usingLocalObjects() && this->m_contextNetwork)
|
||||||
{
|
{
|
||||||
|
// only connect if simulator running locally, no roundtrips
|
||||||
if (this->getCContextSimulator()->m_simulator)
|
if (this->getCContextSimulator()->m_simulator)
|
||||||
{
|
{
|
||||||
connect(this->m_contextNetwork, SIGNAL(aircraftSituationUpdate(BlackMisc::Aviation::CCallsign, BlackMisc::Aviation::CAircraftSituation)),
|
c = connect(this->m_contextNetwork, &IContextNetwork::changedAircraftSituation,
|
||||||
this->getCContextSimulator()->m_simulator, SLOT(addAircraftSituation(BlackMisc::Aviation::CCallsign, BlackMisc::Aviation::CAircraftSituation)));
|
this->getCContextSimulator()->m_simulator, &ISimulator::addAircraftSituation);
|
||||||
|
Q_ASSERT(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user