From 0ab4a18bdab3eccd64f16b292d8a208ede3d5276 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 17 Nov 2018 23:07:50 +0100 Subject: [PATCH] Set correct model type and added model type "TypeReverseLookup" --- src/blackcore/aircraftmatcher.cpp | 5 ++++- src/blackmisc/simulation/aircraftmodel.cpp | 14 ++++++++------ src/blackmisc/simulation/aircraftmodel.h | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/blackcore/aircraftmatcher.cpp b/src/blackcore/aircraftmatcher.cpp index 95c710e15..d98f6cd25 100644 --- a/src/blackcore/aircraftmatcher.cpp +++ b/src/blackcore/aircraftmatcher.cpp @@ -252,10 +252,10 @@ namespace BlackCore // copy over callsign validate matchedModel.setCallsign(remoteAircraft.getCallsign()); + matchedModel.setModelType(CAircraftModel::TypeModelMatching); Q_ASSERT_X(!matchedModel.getCallsign().isEmpty(), Q_FUNC_INFO, "Missing callsign"); Q_ASSERT_X(matchedModel.hasModelString(), Q_FUNC_INFO, "Missing model string"); - Q_ASSERT_X(matchedModel.getModelType() != CAircraftModel::TypeUnknown, Q_FUNC_INFO, "Missing model type"); const QDateTime endTime = QDateTime::currentDateTimeUtc(); const qint64 matchingTime = startTime.msecsTo(endTime); @@ -271,6 +271,7 @@ namespace BlackCore CAircraftModel model(networkModelString, type, "", networkAircraftIcao, livery); model.setCallsign(callsign); model = CAircraftMatcher::reverseLookupModel(model, networkLiveryInfo, log); + model.setModelType(CAircraftModel::TypeReverseLookup); return model; } @@ -434,6 +435,7 @@ namespace BlackCore } } model.setCallsign(callsign); + model.setModelType(CAircraftModel::TypeReverseLookup); return model; } @@ -453,6 +455,7 @@ namespace BlackCore } } model.setCallsign(callsign); + model.setModelType(CAircraftModel::TypeReverseLookup); return model; } diff --git a/src/blackmisc/simulation/aircraftmodel.cpp b/src/blackmisc/simulation/aircraftmodel.cpp index e182786b0..7c7f65483 100644 --- a/src/blackmisc/simulation/aircraftmodel.cpp +++ b/src/blackmisc/simulation/aircraftmodel.cpp @@ -792,18 +792,20 @@ namespace BlackMisc static const QString set("manually set"); static const QString fsinn("FSInn"); static const QString probe("probe"); + static const QString reverse("reverse lookup"); static const QString unknown("unknown"); switch (type) { case TypeQueriedFromNetwork: return queried; - case TypeModelMatching: return matching; - case TypeDatabaseEntry: return db; + case TypeModelMatching: return matching; + case TypeDatabaseEntry: return db; + case TypeManuallySet: return set; + case TypeFSInnData: return fsinn; + case TypeTerrainProbe: return probe; + case TypeReverseLookup: return reverse; + case TypeOwnSimulatorModel: return ownSim; case TypeModelMatchingDefaultModel: return def; - case TypeOwnSimulatorModel: return ownSim; - case TypeManuallySet: return set; - case TypeFSInnData: return fsinn; - case TypeTerrainProbe: return probe; case TypeUnknown: default: return unknown; } diff --git a/src/blackmisc/simulation/aircraftmodel.h b/src/blackmisc/simulation/aircraftmodel.h index b4131aec7..78472cf2d 100644 --- a/src/blackmisc/simulation/aircraftmodel.h +++ b/src/blackmisc/simulation/aircraftmodel.h @@ -75,6 +75,7 @@ namespace BlackMisc TypeUnknown, TypeQueriedFromNetwork, //!< model was queried by network protocol TypeFSInnData, //!< model based on FSD ICAO data + TypeReverseLookup, //!< reverse lookup model TypeModelMatching, //!< model is result of model matching TypeModelMatchingDefaultModel, //!< a default model assigned by model matching TypeDatabaseEntry, //!< used along with mapping definition