mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 14:07:35 +08:00
Ref T681, preparations to use CG from DB
* renamed to "getSimulatorCG" ... * pass simulator settings to sim.env.provider to decide what CG to use * store DB CG and init it when aircraft is added * style
This commit is contained in:
@@ -649,11 +649,11 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
ISimulator::ISimulator(const CSimulatorPluginInfo &pluginInfo,
|
||||
IOwnAircraftProvider *ownAircraftProvider,
|
||||
IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
IWeatherGridProvider *weatherGridProvider,
|
||||
IClientProvider *clientProvider,
|
||||
QObject *parent) :
|
||||
IOwnAircraftProvider *ownAircraftProvider,
|
||||
IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
IWeatherGridProvider *weatherGridProvider,
|
||||
IClientProvider *clientProvider,
|
||||
QObject *parent) :
|
||||
QObject(parent),
|
||||
COwnAircraftAware(ownAircraftProvider),
|
||||
CRemoteAircraftAware(remoteAircraftProvider),
|
||||
@@ -688,9 +688,11 @@ namespace BlackCore
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbAirportsRead, this, &ISimulator::onSwiftDbAirportsRead, Qt::QueuedConnection);
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbModelMatchingEntitiesRead, this, &ISimulator::onSwiftDbModelMatchingEntitiesRead, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
connect(sApp, &CApplication::aboutToShutdown, this, &ISimulator::unload, Qt::QueuedConnection);
|
||||
|
||||
// provider
|
||||
this->setNewPluginInfo(pluginInfo, m_multiSettings.getSettings(pluginInfo.getSimulatorInfo()));
|
||||
|
||||
// info data
|
||||
m_simulatorInternals.setSimulatorName(this->getSimulatorName());
|
||||
m_simulatorInternals.setSwiftPluginName(this->getSimulatorPluginInfo().toQString());
|
||||
@@ -833,7 +835,7 @@ namespace BlackCore
|
||||
m_simulatorInternals.setSimulatorInstallationDirectory(s.getSimulatorDirectoryOrDefault());
|
||||
}
|
||||
|
||||
void ISimulator::rememberElevationAndCG(const CCallsign &callsign, const QString &modelString, const Geo::CElevationPlane &elevation, const CLength &cg)
|
||||
void ISimulator::rememberElevationAndCG(const CCallsign &callsign, const QString &modelString, const CElevationPlane &elevation, const CLength &cg)
|
||||
{
|
||||
if (callsign.isEmpty()) { return; }
|
||||
if (!elevation.isNull())
|
||||
@@ -844,7 +846,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
const CLength cgO = this->overriddenCGorDefault(cg, modelString);
|
||||
if (!cgO.isNull() && !this->hasSameCG(cgO, callsign))
|
||||
if (!cgO.isNull() && !this->hasSameSimulatorCG(cgO, callsign))
|
||||
{
|
||||
this->insertCG(cgO, modelString, callsign); // per model string and CG
|
||||
|
||||
|
||||
Reference in New Issue
Block a user