mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 06:35:41 +08:00
refs #310, adjusted components / GUI to use renamed methods
This commit is contained in:
@@ -131,7 +131,7 @@ namespace BlackCore
|
|||||||
bool CContextSimulator::loadSimulatorPlugin(const CSimulatorInfo &simulatorInfo)
|
bool CContextSimulator::loadSimulatorPlugin(const CSimulatorInfo &simulatorInfo)
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->getIContextApplication());
|
Q_ASSERT(this->getIContextApplication());
|
||||||
Q_ASSERT(this->getIContextApplication()->usingLocalObjects());
|
Q_ASSERT(this->getIContextApplication()->isUsingImplementingObject());
|
||||||
|
|
||||||
if (this->m_simulator && this->m_simulator->getSimulatorInfo() == simulatorInfo) { return true; } // already loaded
|
if (this->m_simulator && this->m_simulator->getSimulatorInfo() == simulatorInfo) { return true; } // already loaded
|
||||||
if (simulatorInfo.isUnspecified()) { return false; }
|
if (simulatorInfo.isUnspecified()) { return false; }
|
||||||
@@ -223,8 +223,9 @@ namespace BlackCore
|
|||||||
if (m_simulator)
|
if (m_simulator)
|
||||||
{
|
{
|
||||||
// depending on shutdown order, network might already have been deleted
|
// depending on shutdown order, network might already have been deleted
|
||||||
if (CContextNetwork *network = this->getRuntime()->getCContextNetwork())
|
if (this->getRuntime()->getIContextNetwork()->isUsingImplementingObject())
|
||||||
{
|
{
|
||||||
|
CContextNetwork *network = this->getRuntime()->getCContextNetwork();
|
||||||
network->getAirspaceMonitor()->QObject::disconnect(this);
|
network->getAirspaceMonitor()->QObject::disconnect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
Q_ASSERT(this->getIContextOwnAircraft());
|
Q_ASSERT(this->getIContextOwnAircraft());
|
||||||
// direct object from local context
|
// direct object from local context
|
||||||
if (this->getIContextOwnAircraft()->usingLocalObjects()) return this->getRuntime()->getCContextOwnAircraft()->ownAircraft();
|
if (this->getIContextOwnAircraft()->isUsingImplementingObject()) return this->getRuntime()->getCContextOwnAircraft()->ownAircraft();
|
||||||
|
|
||||||
// non local
|
// non local
|
||||||
if (this->canPingApplicationContext()) return this->getIContextOwnAircraft()->getOwnAircraft();
|
if (this->canPingApplicationContext()) return this->getIContextOwnAircraft()->getOwnAircraft();
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
if (this->getIContextApplication())
|
if (this->getIContextApplication())
|
||||||
{
|
{
|
||||||
if (this->getIContextApplication()->usingLocalObjects())
|
if (this->getIContextApplication()->isUsingImplementingObject())
|
||||||
{
|
{
|
||||||
this->ui->led_DBus->setOn(false);
|
this->ui->led_DBus->setOn(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,13 +111,13 @@ namespace BlackGui
|
|||||||
QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile);
|
QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile);
|
||||||
Q_ASSERT(!fileName.isEmpty());
|
Q_ASSERT(!fileName.isEmpty());
|
||||||
// write either local or remote file
|
// write either local or remote file
|
||||||
bool local = this->getIContextSimulator()->usingLocalObjects();
|
bool localSimulatorObject = this->getIContextSimulator()->isUsingImplementingObject();
|
||||||
bool success = local ?
|
bool success = localSimulatorObject ?
|
||||||
BlackSim::Fsx::CSimConnectUtilities::writeSimConnectCfg(fileName, address, p) :
|
BlackSim::Fsx::CSimConnectUtilities::writeSimConnectCfg(fileName, address, p) :
|
||||||
this->getIContextApplication()->writeToFile(fileName, CSimConnectUtilities::simConnectCfg(address, p));
|
this->getIContextApplication()->writeToFile(fileName, CSimConnectUtilities::simConnectCfg(address, p));
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
CLogMessage().info(this, local ? "Written local %1" : "Written remote %1") << fileName;
|
CLogMessage().info(this, localSimulatorObject ? "Written local %1" : "Written remote %1") << fileName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -149,7 +149,7 @@ namespace BlackGui
|
|||||||
if (!this->getIContextSimulator()) return;
|
if (!this->getIContextSimulator()) return;
|
||||||
QString fileName = BlackSim::Fsx::CSimConnectUtilities::getLocalSimConnectCfgFilename();
|
QString fileName = BlackSim::Fsx::CSimConnectUtilities::getLocalSimConnectCfgFilename();
|
||||||
QString m = QString("Deleted %1 ").append(fileName);
|
QString m = QString("Deleted %1 ").append(fileName);
|
||||||
if (this->getIContextSimulator()->usingLocalObjects())
|
if (this->getIContextSimulator()->isUsingImplementingObject())
|
||||||
{
|
{
|
||||||
QFile f(fileName);
|
QFile f(fileName);
|
||||||
f.remove();
|
f.remove();
|
||||||
@@ -166,7 +166,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (!this->getIContextSimulator()) return;
|
if (!this->getIContextSimulator()) return;
|
||||||
QString fileName = BlackSim::Fsx::CSimConnectUtilities::getLocalSimConnectCfgFilename();
|
QString fileName = BlackSim::Fsx::CSimConnectUtilities::getLocalSimConnectCfgFilename();
|
||||||
bool exists = this->getIContextSimulator()->usingLocalObjects() ?
|
bool exists = this->getIContextSimulator()->isUsingImplementingObject() ?
|
||||||
QFile::exists(fileName) :
|
QFile::exists(fileName) :
|
||||||
this->getIContextApplication()->existsFile(fileName);
|
this->getIContextApplication()->existsFile(fileName);
|
||||||
if (exists)
|
if (exists)
|
||||||
|
|||||||
@@ -383,8 +383,8 @@ void MainWindow::setContextAvailability()
|
|||||||
{
|
{
|
||||||
qint64 t = QDateTime::currentMSecsSinceEpoch();
|
qint64 t = QDateTime::currentMSecsSinceEpoch();
|
||||||
this->m_coreAvailable = this->getIContextApplication()->ping(t) == t;
|
this->m_coreAvailable = this->getIContextApplication()->ping(t) == t;
|
||||||
this->m_contextNetworkAvailable = this->m_coreAvailable || this->getIContextNetwork()->usingLocalObjects();
|
this->m_contextNetworkAvailable = this->m_coreAvailable || this->getIContextNetwork()->isUsingImplementingObject();
|
||||||
this->m_contextAudioAvailable = this->m_coreAvailable || this->getIContextAudio()->usingLocalObjects();
|
this->m_contextAudioAvailable = this->m_coreAvailable || this->getIContextAudio()->isUsingImplementingObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -396,7 +396,7 @@ void MainWindow::updateGuiStatusInformation()
|
|||||||
QString network("unavailable");
|
QString network("unavailable");
|
||||||
if (this->m_contextNetworkAvailable)
|
if (this->m_contextNetworkAvailable)
|
||||||
{
|
{
|
||||||
bool dbus = !this->getIContextNetwork()->usingLocalObjects();
|
bool dbus = !this->getIContextNetwork()->isUsingImplementingObject();
|
||||||
network = dbus ? now : "local";
|
network = dbus ? now : "local";
|
||||||
this->ui->comp_InfoBarStatus->setDBusStatus(dbus);
|
this->ui->comp_InfoBarStatus->setDBusStatus(dbus);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ void MainWindow::initGuiSignals()
|
|||||||
void MainWindow::initialDataReads()
|
void MainWindow::initialDataReads()
|
||||||
{
|
{
|
||||||
qint64 t = QDateTime::currentMSecsSinceEpoch();
|
qint64 t = QDateTime::currentMSecsSinceEpoch();
|
||||||
this->m_coreAvailable = (this->getIContextNetwork()->usingLocalObjects() || (this->getIContextApplication()->ping(t) == t));
|
this->m_coreAvailable = (this->getIContextNetwork()->isUsingImplementingObject() || (this->getIContextApplication()->ping(t) == t));
|
||||||
if (!this->m_coreAvailable)
|
if (!this->m_coreAvailable)
|
||||||
{
|
{
|
||||||
this->ps_displayStatusMessageInGui(CLogMessage().error(this, "no initial data read as network context is not available"));
|
this->ps_displayStatusMessageInGui(CLogMessage().error(this, "no initial data read as network context is not available"));
|
||||||
|
|||||||
Reference in New Issue
Block a user