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:
Klaus Basan
2019-06-10 19:54:35 +02:00
committed by Mat Sutcliffe
parent 33c3ee68f1
commit 6d490e9a49
14 changed files with 196 additions and 64 deletions

View File

@@ -638,7 +638,7 @@ namespace BlackCore
CStatusMessageList *pMatchingMessages = m_logMatchingMessages > 0 ? &matchingMessages : nullptr;
CAircraftModel aircraftModel = m_aircraftMatcher.getClosestMatch(remoteAircraft, whatToLog, pMatchingMessages, true);
Q_ASSERT_X(remoteAircraft.getCallsign() == aircraftModel.getCallsign(), Q_FUNC_INFO, "Mismatching callsigns");
const CLength cg = m_simulatorPlugin.second->getCGPerModelString(aircraftModel.getModelString());
const CLength cg = m_simulatorPlugin.second->getSimulatorCGPerModelString(aircraftModel.getModelString());
if (!cg.isNull()) { aircraftModel.setCG(cg); }
this->updateAircraftModel(callsign, aircraftModel, this->identifier());