@@ -90,8 +90,6 @@ namespace swift::core
9090 connect (m_fsdClient, &CFSDClient::serverResponseReceived, this , &CAirspaceMonitor::onServerReplyReceived);
9191 connect (m_fsdClient, &CFSDClient::aircraftConfigReceived, this , &CAirspaceMonitor::onAircraftConfigReceived);
9292 connect (m_fsdClient, &CFSDClient::connectionStatusChanged, this , &CAirspaceMonitor::onConnectionStatusChanged);
93- connect (m_fsdClient, &CFSDClient::revbAircraftConfigReceived, this ,
94- &CAirspaceMonitor::onRevBAircraftConfigReceived);
9593
9694 Q_ASSERT_X (sApp && sApp ->hasWebDataServices (), Q_FUNC_INFO, " Missing data reader" );
9795
@@ -546,9 +544,21 @@ namespace swift::core
546544
547545 void CAirspaceMonitor::sendReadyForModelMatching (const CCallsign &callsign, MatchingReadinessFlag rf)
548546 {
547+
549548 if (!this ->isConnectedAndNotShuttingDown ()) { return ; }
550549 Q_ASSERT_X (!callsign.isEmpty (), Q_FUNC_INFO, " missing callsign" );
551550
551+ // TODO TZ remove when testing is done
552+ // CLogMessage(this).info(u"CAirspaceMonitor::sendReadyForModelMatching "
553+ // u"callsign %1 Flag %2 ")
554+ // << callsign << rf;
555+
556+ CStatusMessageList reverseLookupMessages;
557+ CCallsign::addLogDetailsToList (&reverseLookupMessages, callsign,
558+ QStringLiteral (" CAirspaceMonitor::sendReadyForModelMatching Flag: %1" ).arg (rf),
559+ CAirspaceMonitor::getLogCategories ());
560+ // TODO remove
561+
552562 // set flag and init ts
553563 Readiness &readiness = this ->addMatchingReadinessFlag (callsign, rf);
554564
@@ -668,6 +678,14 @@ namespace swift::core
668678
669679 // normally we should never get here
670680 CLogMessage (this ).info (u" Verified '%1' again, has ICAO codes, ready for matching!" ) << callsign;
681+
682+ // TODO TZ remove when testing is done
683+ CStatusMessageList reverseLookupMessages;
684+ CCallsign::addLogDetailsToList (&reverseLookupMessages, callsign,
685+ QStringLiteral (" CAirspaceMonitor::verifyReceivedIcaoData" ),
686+ CAirspaceMonitor::getLogCategories ());
687+ // end TZ remove
688+
671689 this ->sendReadyForModelMatching (callsign, Verified);
672690 }
673691
@@ -773,6 +791,15 @@ namespace swift::core
773791 const QString &aircraftIcaoDesignator,
774792 const QString &combinedAircraftType, const QString &modelString)
775793 {
794+ // TODO TZ remove when testing is done
795+ CLogMessage (this ).info (u" CAirspaceMonitor::onCustomFSInnPacketReceived CHECK:"
796+ u" callsign %1 "
797+ u" airlineIcaoDesignator %2 "
798+ u" aircraftIcaoDesignator %3 "
799+ u" combinedAircraftType %4 "
800+ u" modelString %5 " )
801+ << callsign << airlineIcaoDesignator << aircraftIcaoDesignator << combinedAircraftType << modelString;
802+
776803 // it can happen this is called before any queries
777804 // ES sends FsInn packets for callsigns such as ACCGER1, which are hard to distinguish
778805 // 1) checking if they are already in the list checks again ATC position which is safe
@@ -818,7 +845,7 @@ namespace swift::core
818845 usedModelString.clear ();
819846 CCallsign::addLogDetailsToList (
820847 pReverseLookupMessages, callsign,
821- QStringLiteral (" FsInn modelstring '%1' ignored because of setuo " ).arg (modelString));
848+ QStringLiteral (" FsInn modelstring '%1' ignored because of setup " ).arg (modelString));
822849 }
823850 else if (!CAircraftMatcher::isKnownModelString (modelString, callsign, pReverseLookupMessages))
824851 {
@@ -846,6 +873,15 @@ namespace swift::core
846873 void CAirspaceMonitor::onIcaoCodesReceived (const CCallsign &callsign, const QString &aircraftIcaoDesignator,
847874 const QString &airlineIcaoDesignator, const QString &livery)
848875 {
876+ // TODO TZ remove logmessage when testing is done
877+ CLogMessage (this ).info (u" CAirspaceMonitor::onIcaoCodesReceived CHECK:"
878+ u" callsign %1 "
879+ u" aircraftIcaoDesignator %2 "
880+ u" airlineIcaoDesignator %3 "
881+ u" livery %4 " )
882+ << callsign << aircraftIcaoDesignator << airlineIcaoDesignator << livery;
883+ // End TODO TZ
884+
849885 Q_ASSERT_X (CThreadUtils::isInThisThread (this ), Q_FUNC_INFO, " not in main thread" );
850886 if (!this ->isConnectedAndNotShuttingDown ()) { return ; }
851887 if (CBuildConfig::isLocalDeveloperDebugBuild ())
@@ -865,13 +901,18 @@ namespace swift::core
865901 CAirspaceMonitor::getLogCategories ());
866902
867903 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
904+ const CSimulatedAircraft aircraft = this ->addOrUpdateAircraftInRange (
905+ callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery, client.getQueriedModelString (),
906+ CAircraftModel::TypeQueriedFromNetwork, pReverseLookupMessages);
907+
908+ // we do not change manually assigned models
909+ if (aircraft.getModel ().getModelType () != CAircraftModel::TypeManuallySet)
910+ {
911+ this ->addReverseLookupMessages (callsign, reverseLookupMessages);
912+ this ->sendReadyForModelMatching (callsign, ReceivedIcaoCodes); // ICAO codes received
873913
874- emit this ->requestedNewAircraft (callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery);
914+ emit this ->requestedNewAircraft (callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery);
915+ }
875916 }
876917
877918 CAircraftModel CAirspaceMonitor::reverseLookupModelWithFlightplanData (
@@ -1178,8 +1219,8 @@ namespace swift::core
11781219 const CSimulatedAircraft aircraft = this ->getAircraftInRangeForCallsign (callsign);
11791220 if (aircraft.hasValidCallsign ())
11801221 {
1181- // only if we do not have a DB model yet
1182- if (!aircraft.getModel ().hasValidDbKey ())
1222+ // we do not change manually assigned models (msfs2024)
1223+ if (!aircraft.getModel ().hasValidDbKey () && aircraft. getModelType () != CAircraftModel::TypeManuallySet )
11831224 {
11841225 CAircraftModel model = this ->reverseLookupModelWithFlightplanData (callsign, aircraftIcao, airlineIcao,
11851226 livery, modelString, modelType, log);
@@ -1439,69 +1480,6 @@ namespace swift::core
14391480 this ->updateAircraftInRange (callsign, vm);
14401481 }
14411482
1442- void CAirspaceMonitor::onRevBAircraftConfigReceived (const CCallsign &callsign, const QString &config,
1443- qint64 currentOffsetMs)
1444- {
1445-
1446- Q_ASSERT (CThreadUtils::isInThisThread (this ));
1447- SWIFT_AUDIT_X (!callsign.isEmpty (), Q_FUNC_INFO, " Need callsign" );
1448- if (callsign.isEmpty ()) { return ; }
1449-
1450- unsigned long pp = 0 ;
1451- bool ok {};
1452- pp = config.toULong (&ok, 10 );
1453-
1454- bool gear = (pp & 1U );
1455- bool landLight = (pp & 2U );
1456- bool navLight = (pp & 4U );
1457- bool strobeLight = (pp & 8U );
1458- bool beaconLight = (pp & 16U );
1459- bool taxiLight = (pp & 32U );
1460- bool engine1Running = (pp & 64U );
1461- bool engine2Running = (pp & 128U );
1462- bool engine3Running = (pp & 256U );
1463- bool engine4Running = (pp & 512U );
1464-
1465- // CLogMessage(this).info(u"taxiLight %1 landLight %2 beaconLight %3 strobeLight %4 gear %5") << taxiLight <<
1466- // landLight << beaconLight << strobeLight << gear; CLogMessage(this).info(u"engine1Running %1 engine2Running %2
1467- // engine3Running %3 engine4Running %4") << engine1Running << engine2Running << engine3Running <<
1468- // engine4Running;
1469-
1470- CAircraftParts aircraftparts;
1471- aircraftparts.setGearDown (gear);
1472-
1473- CAircraftLights lights;
1474- lights.setStrobeOn (strobeLight);
1475- lights.setLandingOn (landLight);
1476- lights.setTaxiOn (taxiLight);
1477- lights.setBeaconOn (beaconLight);
1478- lights.setNavOn (navLight);
1479- aircraftparts.setLights (lights);
1480-
1481- CAircraftEngineList engines;
1482- engines.initEngines (4 , false );
1483- engines.setEngineOn (1 , engine1Running);
1484- engines.setEngineOn (2 , engine2Running);
1485- engines.setEngineOn (3 , engine3Running);
1486- engines.setEngineOn (4 , engine4Running);
1487- aircraftparts.setEngines (engines);
1488-
1489- // make sure in any case right time and correct details
1490- aircraftparts.setCurrentUtcTime ();
1491- aircraftparts.setTimeOffsetMs (currentOffsetMs);
1492- aircraftparts.setPartsDetails (CAircraftParts::FSDAircraftParts);
1493-
1494- // store parts
1495- this ->storeAircraftParts (callsign, aircraftparts, true );
1496-
1497- // update client capability
1498- CClient client = this ->getClientOrDefaultForCallsign (callsign);
1499- client.setUserCallsign (callsign); // make valid by setting a callsign
1500- if (client.hasCapability (CClient::FsdWithAircraftConfig)) { return ; }
1501- client.addCapability (CClient::FsdWithAircraftConfig);
1502- this ->setOtherClient (client);
1503- }
1504-
15051483 void CAirspaceMonitor::onAircraftConfigReceived (const CCallsign &callsign, const QJsonObject &jsonObject,
15061484 qint64 currentOffsetMs)
15071485 {
0 commit comments