Ref T658, adjusted matching with script

* return values changed
* pass in model and matched model
* JavaScript objects for web services, model set
* allow to pass back a model
This commit is contained in:
Klaus Basan
2019-06-05 00:14:35 +02:00
parent fab08b3606
commit 2c1370bee6
5 changed files with 251 additions and 65 deletions

View File

@@ -636,7 +636,7 @@ namespace BlackCore
MatchingLog whatToLog = m_logMatchingMessages;
CStatusMessageList matchingMessages;
CStatusMessageList *pMatchingMessages = m_logMatchingMessages > 0 ? &matchingMessages : nullptr;
CAircraftModel aircraftModel = m_aircraftMatcher.getClosestMatch(remoteAircraft, whatToLog, pMatchingMessages);
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());
if (!cg.isNull()) { aircraftModel.setCG(cg); }