mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +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:
committed by
Mat Sutcliffe
parent
33c3ee68f1
commit
6d490e9a49
@@ -885,12 +885,21 @@ namespace BlackCore
|
||||
newAircraft.setRendered(false); // reset rendering
|
||||
newAircraft.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftPosition()); // distance from myself
|
||||
|
||||
Q_ASSERT_X(sApp->hasWebDataServices(), Q_FUNC_INFO, "No web services");
|
||||
if (this->getConnectedServer().getEcosystem() == CEcosystem::vatsim())
|
||||
{
|
||||
sApp->getWebDataServices()->updateWithVatsimDataFileData(newAircraft);
|
||||
}
|
||||
return CRemoteAircraftProvider::addNewAircraftInRange(newAircraft);
|
||||
const bool added = CRemoteAircraftProvider::addNewAircraftInRange(newAircraft);
|
||||
if (added && aircraft.hasModelString())
|
||||
{
|
||||
// most likely I could take the CG at this time from aircraft
|
||||
// to make sure it is really the DB value i query again
|
||||
const CAircraftModel model = sApp->getWebDataServices()->getModelForModelString(aircraft.getModelString());
|
||||
const CLength cg = model.hasValidDbKey() ? model.getCG() : CLength::null();
|
||||
this->rememberCGFromDB(cg, aircraft.getModelString());
|
||||
this->rememberCGFromDB(cg, aircraft.getCallsign());
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
void CAirspaceMonitor::asyncAddNewAircraftInRange(const CSimulatedAircraftList &aircraft, bool readyForModelMatching)
|
||||
@@ -1184,7 +1193,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
// CG from provider
|
||||
const CLength cg = this->getCG(callsign); // always x-check against simulator to override guessed values and reflect changed CGs
|
||||
const CLength cg = this->getSimulatorCG(callsign); // always x-check against simulator to override guessed values and reflect changed CGs
|
||||
if (!cg.isNull()) { correctedSituation.setCG(cg); }
|
||||
|
||||
// store corrected situation
|
||||
|
||||
Reference in New Issue
Block a user