diff --git a/src/core/aircraftmatcher.cpp b/src/core/aircraftmatcher.cpp index fc79df142..c9a28fc57 100644 --- a/src/core/aircraftmatcher.cpp +++ b/src/core/aircraftmatcher.cpp @@ -1710,13 +1710,6 @@ namespace swift::core const QString &livery) { Q_UNUSED(livery) - // TODO TZ remove after testing - CLogMessage(this).info(u"CAircraftMatcher::onIcaoCodesReceived CHECK:" - u"callsign %1 " - u"aircraftIcao %2 " - u"airlineIcao %3 " - u"livery %4 ") - << callsign << aircraftIcao << airlineIcao << livery; Q_ASSERT_X(sApp && sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing web data services"); if (m_modelSet.isEmpty()) { return; } // ignore empty sets to not create silly stats diff --git a/src/core/airspacemonitor.cpp b/src/core/airspacemonitor.cpp index 26d1137df..566e71106 100644 --- a/src/core/airspacemonitor.cpp +++ b/src/core/airspacemonitor.cpp @@ -548,11 +548,6 @@ namespace swift::core if (!this->isConnectedAndNotShuttingDown()) { return; } Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "missing callsign"); - // TODO TZ remove when testing is done - // CLogMessage(this).info(u"CAirspaceMonitor::sendReadyForModelMatching " - // u"callsign %1 Flag %2 ") - // << callsign << rf; - CStatusMessageList reverseLookupMessages; CCallsign::addLogDetailsToList(&reverseLookupMessages, callsign, QStringLiteral("CAirspaceMonitor::sendReadyForModelMatching Flag: %1").arg(rf), @@ -679,13 +674,6 @@ namespace swift::core // normally we should never get here CLogMessage(this).info(u"Verified '%1' again, has ICAO codes, ready for matching!") << callsign; - // TODO TZ remove when testing is done - CStatusMessageList reverseLookupMessages; - CCallsign::addLogDetailsToList(&reverseLookupMessages, callsign, - QStringLiteral("CAirspaceMonitor::verifyReceivedIcaoData"), - CAirspaceMonitor::getLogCategories()); - // end TZ remove - this->sendReadyForModelMatching(callsign, Verified); } @@ -791,15 +779,6 @@ namespace swift::core const QString &aircraftIcaoDesignator, const QString &combinedAircraftType, const QString &modelString) { - // TODO TZ remove when testing is done - CLogMessage(this).info(u"CAirspaceMonitor::onCustomFSInnPacketReceived CHECK:" - u"callsign %1 " - u"airlineIcaoDesignator %2 " - u"aircraftIcaoDesignator %3 " - u"combinedAircraftType %4 " - u"modelString %5 ") - << callsign << airlineIcaoDesignator << aircraftIcaoDesignator << combinedAircraftType << modelString; - // it can happen this is called before any queries // ES sends FsInn packets for callsigns such as ACCGER1, which are hard to distinguish // 1) checking if they are already in the list checks again ATC position which is safe @@ -873,15 +852,6 @@ namespace swift::core void CAirspaceMonitor::onIcaoCodesReceived(const CCallsign &callsign, const QString &aircraftIcaoDesignator, const QString &airlineIcaoDesignator, const QString &livery) { - // TODO TZ remove logmessage when testing is done - CLogMessage(this).info(u"CAirspaceMonitor::onIcaoCodesReceived CHECK:" - u"callsign %1 " - u"aircraftIcaoDesignator %2 " - u"airlineIcaoDesignator %3 " - u"livery %4 ") - << callsign << aircraftIcaoDesignator << airlineIcaoDesignator << livery; - // End TODO TZ - Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "not in main thread"); if (!this->isConnectedAndNotShuttingDown()) { return; } if (CBuildConfig::isLocalDeveloperDebugBuild()) diff --git a/src/gui/components/logincomponent.cpp b/src/gui/components/logincomponent.cpp index e5a8e6f52..6484f36be 100644 --- a/src/gui/components/logincomponent.cpp +++ b/src/gui/components/logincomponent.cpp @@ -41,9 +41,7 @@ #include "misc/logmessage.h" #include "misc/network/connectionstatus.h" #include "misc/network/entityflags.h" -// TODO TZ remove after testing. it is in another branch already #include "misc/network/server.h" -// TODO TZ end remove afte testing #include "misc/network/serverlist.h" #include "misc/simulation/aircraftmodel.h" #include "misc/simulation/simulatedaircraft.h" @@ -301,13 +299,10 @@ namespace swift::gui::components { if (!m_updatePilotOnServerChanges) { return; } const bool vatsim = this->isVatsimNetworkTabSelected(); - // TODO TZ remove after testing. it is on another branch already - // const CUser user = vatsim ? this->getCurrentVatsimServer().getUser() : server.getUser(); const CUser user = server.getServerType() != CServer::FSDServer ? this->getCurrentVatsimServer().getUser() : server.getUser(); if ((vatsim && server.getServerType() != CServer::FSDServer) || (!vatsim && server.getServerType() == CServer::FSDServer)) - // End remove after testing ui->form_Pilot->setUser(user); } diff --git a/src/misc/simulation/msfs2024/aircraftmodelloadermsfs2024.cpp b/src/misc/simulation/msfs2024/aircraftmodelloadermsfs2024.cpp index ba2dc3776..1d27b6aaf 100644 --- a/src/misc/simulation/msfs2024/aircraftmodelloadermsfs2024.cpp +++ b/src/misc/simulation/msfs2024/aircraftmodelloadermsfs2024.cpp @@ -82,7 +82,6 @@ namespace swift::misc::simulation::msfs2024 if (m_parserWorker && !m_parserWorker->isFinished()) { return; } emit this->diskLoadingStarted(simulator, mode); - // TODO TZ need help: simplify, we don't need directories in this->performParsing for MSFS2024 m_parserWorker = CWorker::fromTask(this, "CAircraftModelLoaderMsfs2024::performParsing", [this, modelConsolidation]() { auto models = this->performParsing(); diff --git a/src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp b/src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp index a7c7e984d..ae5a716b0 100644 --- a/src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp +++ b/src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp @@ -857,18 +857,18 @@ namespace swift::simplugin::msfs2024common } // TODO TZ check if nessesary in MSFS2024 - void CSimulatorMsfs2024::removeCamera(CSimConnectObject &simObject) - { - // not in FSX - Q_UNUSED(simObject) - } + // void CSimulatorMsfs2024::removeCamera(CSimConnectObject &simObject) + //{ + // // not in FSX + // Q_UNUSED(simObject) + //} // TODO TZ check if nessesary in MSFS2024 - void CSimulatorMsfs2024::removeObserver(CSimConnectObject &simObject) - { - // not in FSX - Q_UNUSED(simObject) - } + // void CSimulatorMsfs2024::removeObserver(CSimConnectObject &simObject) + //{ + // // not in FSX + // Q_UNUSED(simObject) + //} bool CSimulatorMsfs2024::triggerAutoTraceSendId(qint64 traceTimeMs) { @@ -2065,8 +2065,8 @@ namespace swift::simplugin::msfs2024common // call in SIM const SIMCONNECT_DATA_REQUEST_ID requestId = simObject.getRequestId(CSimConnectDefinitions::SimObjectRemove); - this->removeCamera(simObject); - this->removeObserver(simObject); + // this->removeCamera(simObject); + // this->removeObserver(simObject); const HRESULT result = SimConnect_AIRemoveObject( m_hSimConnect, static_cast(simObject.getObjectId()), requestId); if (isOk(result)) @@ -2341,7 +2341,6 @@ namespace swift::simplugin::msfs2024common return ok; } - // TODO TZ under investigation, flaps retracting to 0 again and other issues bool CSimulatorMsfs2024::sendRemoteAircraftPartsToSimulator(const CSimConnectObject &simObject, const CAircraftParts &parts) { @@ -2367,7 +2366,7 @@ namespace swift::simplugin::msfs2024common traceId, simObject, "Failed so set parts", Q_FUNC_INFO, "SimConnect_SetDataOnSimObject::ddRemoteAircraftPartsWithoutLights"); - // Sim variable version, not working, setting the value, but flaps retracting to 0 again + // TODO TZ handle flaps more precisely // Sets flap handle to closest increment (0 to 16383) const DWORD flapsDw = static_cast(qMin(16383, qRound((parts.getFlapsPercent() / 100.0) * 16383))); const HRESULT hr2 = this->logAndTraceSendId( @@ -2481,104 +2480,6 @@ namespace swift::simplugin::msfs2024common return isOk(hr); } - // TODO TZ under investigation, toggling lights seems to be unreliable. The settings mentioned above can be used - // directly. void CSimulatorMsfs2024::sendToggledLightsToSimulator(const CSimConnectObject &simObj, - // const CAircraftLights &lightsWanted, bool force) - //{ - // if (!simObj.isReadyToSend()) { return; } // stale - - // const CAircraftLights lightsIsState = simObj.getCurrentLightsInSimulator(); - // if (lightsWanted == lightsIsState) { return; } - // if (!force && lightsWanted == simObj.getLightsAsSent()) { return; } - // const CCallsign callsign(simObj.getCallsign()); - - // // Update data - // if (m_simConnectObjects.contains(callsign)) - // { - // CSimConnectObject &simObjToUpdate = m_simConnectObjects[callsign]; - // simObjToUpdate.setLightsAsSent(lightsWanted); - // } - - // // state available, then I can toggle - // if (!lightsIsState.isNull()) - // { - // const DWORD objectId = simObj.getObjectId(); - // const bool trace = this->isTracingSendId(); - - // if (lightsWanted.isTaxiOn() != lightsIsState.isTaxiOn()) - // { - // this->logAndTraceSendId(SimConnect_TransmitClientEvent(m_hSimConnect, objectId, EventToggleTaxiLights, - // 0.0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, - // SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY), - // trace, simObj, "Toggle taxi lights", Q_FUNC_INFO, "EventToggleTaxiLights"); - // } - // if (lightsWanted.isNavOn() != lightsIsState.isNavOn()) - // { - // this->logAndTraceSendId(SimConnect_TransmitClientEvent(m_hSimConnect, objectId, EventToggleNavLights, - // 0.0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, - // SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY), - // trace, simObj, "Toggle nav.lights", Q_FUNC_INFO, "EventToggleNavLights"); - // } - // if (lightsWanted.isBeaconOn() != lightsIsState.isBeaconOn()) - // { - // this->logAndTraceSendId(SimConnect_TransmitClientEvent(m_hSimConnect, objectId, - // EventToggleBeaconLights, - // 0.0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, - // SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY), - // trace, simObj, "Toggle becon lights", Q_FUNC_INFO, "EventToggleBeaconLights"); - // } - // if (lightsWanted.isLogoOn() != lightsIsState.isLogoOn()) - // { - // this->logAndTraceSendId(SimConnect_TransmitClientEvent(m_hSimConnect, objectId, EventToggleLogoLights, - // 0.0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, - // SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY), - // trace, simObj, "Toggle logo lights", Q_FUNC_INFO, "EventToggleLogoLights"); - // } - // if (lightsWanted.isRecognitionOn() != lightsIsState.isRecognitionOn()) - // { - // this->logAndTraceSendId( - // SimConnect_TransmitClientEvent(m_hSimConnect, objectId, EventToggleRecognitionLights, 0.0, - // SIMCONNECT_GROUP_PRIORITY_HIGHEST, - // SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY), - // trace, simObj, "Toggle recognition lights", Q_FUNC_INFO, "EventToggleRecognitionLights"); - // } - // if (lightsWanted.isCabinOn() != lightsIsState.isCabinOn()) - // { - // this->logAndTraceSendId(SimConnect_TransmitClientEvent(m_hSimConnect, objectId, - // EventToggleCabinLights, - // 0.0, SIMCONNECT_GROUP_PRIORITY_HIGHEST, - // SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY), - // trace, simObj, "Toggle cabin lights", Q_FUNC_INFO, "EventToggleCabinLights"); - // } - // return; - // } - - // // missing lights info from simulator so far - // if (this->showDebugLogMessage()) - // { - // this->debugLogMessage(Q_FUNC_INFO, QStringLiteral("Missing light state in simulator for '%1', model '%2'") - // .arg(callsign.asString(), simObj.getAircraftModelString())); - // } - - // const QPointer myself(this); - // QTimer::singleShot(DeferResendingLights, this, [=] { - // if (!myself) { return; } - // if (!m_simConnectObjects.contains(callsign)) { return; } - // const CSimConnectObject currentSimObject = m_simConnectObjects[callsign]; - // if (!currentSimObject.isReadyToSend()) { return; } // stale - // if (lightsWanted != currentSimObject.getLightsAsSent()) - // { - // return; - // } // changed in between, so another call sendToggledLightsToSimulator is pending - // if (this->showDebugLogMessage()) - // { - // this->debugLogMessage(Q_FUNC_INFO, QStringLiteral("Resending light state for '%1', model '%2'") - // .arg(callsign.asString(), simObj.getAircraftModelString())); - // } - // this->sendToggledLightsToSimulator(currentSimObject, lightsWanted, true); - // }); - //} - SIMCONNECT_DATA_INITPOSITION CSimulatorMsfs2024::aircraftSituationToPosition(const CAircraftSituation &situation, bool sendGnd, bool forceUnderflowDetection, CStatusMessage *details) diff --git a/src/plugins/simulator/msfs2024/simulatormsfs2024common.h b/src/plugins/simulator/msfs2024/simulatormsfs2024common.h index a54d34001..0a78937d3 100644 --- a/src/plugins/simulator/msfs2024/simulatormsfs2024common.h +++ b/src/plugins/simulator/msfs2024/simulatormsfs2024common.h @@ -305,10 +305,10 @@ namespace swift::simplugin::msfs2024common bool removeSimObjectForTrace(const TraceFsxSendId &trace); //! Remove camera if any - virtual void removeCamera(CSimConnectObject &simObject); + // virtual void removeCamera(CSimConnectObject &simObject); //! Remove observer if any - virtual void removeObserver(CSimConnectObject &simObject); + // virtual void removeObserver(CSimConnectObject &simObject); //! Trace if required, log errors HRESULT logAndTraceSendId(HRESULT hr, const QString &warningMsg, const QString &functionName, @@ -472,13 +472,6 @@ namespace swift::simplugin::msfs2024common //! Send ATC data (callsign etc.) to simulator bool sendRemoteAircraftAtcDataToSimulator(const CSimConnectObject &simObject); - //! Send lights to simulator (those which have to be toggled) - //! \remark challenge here is that I can only sent those value if I have already obtained the current light - //! state from simulator \param force send lights even if they appear to be the same - // void sendToggledLightsToSimulator(const CSimConnectObject &simObject, - // const swift::misc::aviation::CAircraftLights &lightsWanted, - // bool force = false); - //! Call CSimulatorFsxCommon::updateRemoteAircraftFromSimulator asynchronously //! \remark do not to send SimConnect data in event loop void triggerUpdateRemoteAircraftFromSimulator(const CSimConnectObject &simObject,