@@ -773,6 +773,14 @@ namespace swift::core
773773 const QString &aircraftIcaoDesignator,
774774 const QString &combinedAircraftType, const QString &modelString)
775775 {
776+ // TODO TZ remove when testing is done
777+ CLogMessage (this ).info (u" CAirspaceMonitor::onCustomFSInnPacketReceived CHECK:"
778+ u" callsign %1 "
779+ u" airlineIcaoDesignator %2 "
780+ u" aircraftIcaoDesignator %3 "
781+ u" modelString %4 " )
782+ << callsign << airlineIcaoDesignator << aircraftIcaoDesignator << modelString;
783+
776784 // it can happen this is called before any queries
777785 // ES sends FsInn packets for callsigns such as ACCGER1, which are hard to distinguish
778786 // 1) checking if they are already in the list checks again ATC position which is safe
@@ -834,9 +842,9 @@ namespace swift::core
834842 // in order not to override swift livery string data, we ignore those
835843 if (!usedModelString.isEmpty ())
836844 {
837- this ->addOrUpdateAircraftInRange (callsign, aircraftIcaoDesignator, airlineIcaoDesignator, QString (),
838- usedModelString, CAircraftModel::TypeFSInnData ,
839- pReverseLookupMessages);
845+ const CSimulatedAircraft aircraft = this ->addOrUpdateAircraftInRange (
846+ callsign, aircraftIcaoDesignator, airlineIcaoDesignator, QString (), usedModelString ,
847+ CAircraftModel::TypeFSInnData, pReverseLookupMessages);
840848 this ->addReverseLookupMessages (callsign, reverseLookupMessages);
841849 }
842850 this ->sendReadyForModelMatching (callsign, ReceivedFsInnPacket); // from FSInn
@@ -846,6 +854,14 @@ namespace swift::core
846854 void CAirspaceMonitor::onIcaoCodesReceived (const CCallsign &callsign, const QString &aircraftIcaoDesignator,
847855 const QString &airlineIcaoDesignator, const QString &livery)
848856 {
857+ // TODO TZ remove when testing is done
858+ CLogMessage (this ).info (u" CAirspaceMonitor::onIcaoCodesReceived CHECK:"
859+ u" callsign %1 "
860+ u" aircraftIcaoDesignator %2 "
861+ u" airlineIcaoDesignator %3 "
862+ u" livery %4 " )
863+ << callsign << aircraftIcaoDesignator << airlineIcaoDesignator << livery;
864+
849865 Q_ASSERT_X (CThreadUtils::isInThisThread (this ), Q_FUNC_INFO, " not in main thread" );
850866 if (!this ->isConnectedAndNotShuttingDown ()) { return ; }
851867 if (CBuildConfig::isLocalDeveloperDebugBuild ())
@@ -865,13 +881,16 @@ namespace swift::core
865881 CAirspaceMonitor::getLogCategories ());
866882
867883 const CClient client = this ->getClientOrDefaultForCallsign (callsign);
868- this ->addOrUpdateAircraftInRange (callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery,
869- client.getQueriedModelString (), CAircraftModel::TypeQueriedFromNetwork,
870- pReverseLookupMessages);
871- this ->addReverseLookupMessages (callsign, reverseLookupMessages);
872- this ->sendReadyForModelMatching (callsign, ReceivedIcaoCodes); // ICAO codes received
884+ const CSimulatedAircraft aircraft = this ->addOrUpdateAircraftInRange (
885+ callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery, client.getQueriedModelString (),
886+ CAircraftModel::TypeQueriedFromNetwork, pReverseLookupMessages);
887+ if (aircraft.getModel ().getModelType () != CAircraftModel::TypeManuallySet)
888+ {
889+ this ->addReverseLookupMessages (callsign, reverseLookupMessages);
890+ this ->sendReadyForModelMatching (callsign, ReceivedIcaoCodes); // ICAO codes received
873891
874- emit this ->requestedNewAircraft (callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery);
892+ emit this ->requestedNewAircraft (callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery);
893+ }
875894 }
876895
877896 CAircraftModel CAirspaceMonitor::reverseLookupModelWithFlightplanData (
@@ -1178,9 +1197,26 @@ namespace swift::core
11781197 const CSimulatedAircraft aircraft = this ->getAircraftInRangeForCallsign (callsign);
11791198 if (aircraft.hasValidCallsign ())
11801199 {
1200+ // TODO TZ at this point we have a poblem if the model has no DB key yet (msfs2024 liveries)
11811201 // only if we do not have a DB model yet
1182- if (!aircraft.getModel ().hasValidDbKey ())
1202+ // int testType = aircraft.getModelType();1
1203+ CLogMessage (this ).info (u" CAirspaceMonitor::addOrUpdateAircraftInRange CHECK:"
1204+ u" aircraft.getModelType %1 "
1205+ u" callsign %2 "
1206+ u" aircraftIcao %3 "
1207+ u" incomming modelType %4 " )
1208+ << aircraft.getModelType () << callsign.toQString () << aircraftIcao << modelType;
1209+
1210+ if (!aircraft.getModel ().hasValidDbKey () && aircraft.getModelType () != CAircraftModel::TypeManuallySet)
11831211 {
1212+
1213+ CLogMessage (this ).warning (u" CAirspaceMonitor::reverseLookupModelWithFlightplanData "
1214+ u" aircraft.getModelType %1 "
1215+ u" callsign %2 "
1216+ u" aircraftIcao %3 "
1217+ u" incomming modelType %4 " )
1218+ << aircraft.getModelType () << callsign.toQString () << aircraftIcao << modelType;
1219+
11841220 CAircraftModel model = this ->reverseLookupModelWithFlightplanData (callsign, aircraftIcao, airlineIcao,
11851221 livery, modelString, modelType, log);
11861222 model.updateMissingParts (aircraft.getModel ());
0 commit comments