fix: Fix errors from pull request

Co-authored-by: Lars Toenning <dev@ltoenning.de>
This commit is contained in:
tzobler
2025-11-21 14:48:49 +01:00
parent 5951f75fe1
commit 52a727dc45
22 changed files with 31 additions and 86 deletions

4
.gitignore vendored
View File

@@ -51,6 +51,4 @@ cmake-build-*/
/out/
/dist/
CMakeUserPresets.json
/third_party/externals
/src/plugins/simulator/msfs2024/simulatormsfs2024.cpp_
/src/plugins/simulator/msfs2024/simulatormsfs2024.h_
/third_party/externals

View File

@@ -787,10 +787,6 @@ namespace swift::core
}
}
// for request
// #SBBER750:DAL483:FSIPIR:0:BER:A320:::::L2J:PMDG 737-800 AIRBERLIN (D-ABKM)
// and also for information
// #SBFSC751 : BER636 : FSIPI : 0 ::EC35:: :: : H2T : AIRBUS H135 NORSK LUFTAMBULANSE
void CAirspaceMonitor::onCustomFSInnPacketReceived(const CCallsign &callsign, const QString &airlineIcaoDesignator,
const QString &aircraftIcaoDesignator,
const QString &combinedAircraftType, const QString &modelString)
@@ -865,16 +861,15 @@ namespace swift::core
// in order not to override swift livery string data, we ignore those
if (!usedModelString.isEmpty())
{
const CSimulatedAircraft aircraft = this->addOrUpdateAircraftInRange(
callsign, aircraftIcaoDesignator, airlineIcaoDesignator, QString(), usedModelString,
CAircraftModel::TypeFSInnData, pReverseLookupMessages);
this->addOrUpdateAircraftInRange(callsign, aircraftIcaoDesignator, airlineIcaoDesignator, QString(),
usedModelString, CAircraftModel::TypeFSInnData,
pReverseLookupMessages);
this->addReverseLookupMessages(callsign, reverseLookupMessages);
}
this->sendReadyForModelMatching(callsign, ReceivedFsInnPacket); // from FSInn
}
}
// #SBDAL483:BER636:PI:GEN:EQUIPMENT=B738:AIRLINE=DAL:LIVERY=swift_l1855a1787m13853
void CAirspaceMonitor::onIcaoCodesReceived(const CCallsign &callsign, const QString &aircraftIcaoDesignator,
const QString &airlineIcaoDesignator, const QString &livery)
{
@@ -1227,14 +1222,6 @@ namespace swift::core
// we do not change manually assigned models (msfs2024)
if (!aircraft.getModel().hasValidDbKey() && aircraft.getModelType() != CAircraftModel::TypeManuallySet)
{
CLogMessage(this).warning(u"CAirspaceMonitor::reverseLookupModelWithFlightplanData "
u"aircraft.getModelType %1 "
u"callsign %2 "
u"aircraftIcao %3 "
u"incomming modelType %4 ")
<< aircraft.getModelType() << callsign.toQString() << aircraftIcao << modelType;
CAircraftModel model = this->reverseLookupModelWithFlightplanData(callsign, aircraftIcao, airlineIcao,
livery, modelString, modelType, log);
model.updateMissingParts(aircraft.getModel());

View File

@@ -49,7 +49,7 @@ namespace swift::core
}
else
{
if (!options.testFlag(ShowAllInstalledModells))
if (!options.testFlag(ShowAllInstalledModels))
// without any information we can not use them
modelSet = modelSet.findWithKnownAircraftDesignator();
}

View File

@@ -35,7 +35,7 @@ namespace swift::core
Incremental = 1 << 3,
SortByDistributors = 1 << 4,
ConsolidateWithDb = 1 << 5,
ShowAllInstalledModells = 1 << 6,
ShowAllInstalledModels = 1 << 6,
};
Q_DECLARE_FLAGS(Builder, BuilderFlag)

View File

@@ -97,10 +97,7 @@ namespace swift::gui::components
ui->tvp_OwnAircraftModels->setCustomMenu(new CConsolidateWithDbDataMenu(ui->tvp_OwnAircraftModels, this));
}
CDbOwnModelsComponent::~CDbOwnModelsComponent()
{
// void
}
CDbOwnModelsComponent::~CDbOwnModelsComponent() = default;
const QStringList &CDbOwnModelsComponent::getLogCategories()
{
@@ -282,7 +279,7 @@ namespace swift::gui::components
QStringLiteral("Completely reload '%1' models from disk?").arg(simulator.toQString(true)),
QMessageBox::Yes | QMessageBox::No, this);
msgBox.setDefaultButton(QMessageBox::Cancel);
const QMessageBox::StandardButton reply = static_cast<QMessageBox::StandardButton>(msgBox.exec());
const auto reply = static_cast<QMessageBox::StandardButton>(msgBox.exec());
if (reply != QMessageBox::Yes) { return; }
this->requestSimulatorModels(simulator, IAircraftModelLoader::InBackgroundNoCache);
@@ -513,7 +510,7 @@ namespace swift::gui::components
"override the loaded models from the simulator.\nNormally you would not want that (cancel).",
QMessageBox::Save | QMessageBox::Cancel, this);
msgBox.setDefaultButton(QMessageBox::Cancel);
const QMessageBox::StandardButton reply = static_cast<QMessageBox::StandardButton>(msgBox.exec());
const auto reply = static_cast<QMessageBox::StandardButton>(msgBox.exec());
if (reply != QMessageBox::Cancel) { return; }
const CAircraftModelList models = ui->tvp_OwnAircraftModels->container();
if (models.isEmpty()) { return; }

View File

@@ -136,7 +136,7 @@ namespace swift::gui::components
});
}
CLoginComponent::~CLoginComponent() {}
CLoginComponent::~CLoginComponent() = default;
void CLoginComponent::mainInfoAreaChanged(const QWidget *currentWidget)
{
@@ -313,7 +313,7 @@ namespace swift::gui::components
void CLoginComponent::onSimulatorStatusChanged(int status)
{
ISimulator::SimulatorStatus s = static_cast<ISimulator::SimulatorStatus>(status);
auto s = static_cast<ISimulator::SimulatorStatus>(status);
if (!this->hasValidContexts()) { return; }
m_simulatorConnected = s.testFlag(ISimulator::Connected);
this->updateUiConnectState();

View File

@@ -682,7 +682,7 @@ add_library(misc SHARED
weather/windlayer.h
weather/windlayerlist.cpp
weather/windlayerlist.h
)
)
if(APPLE)
target_sources(misc PRIVATE

View File

@@ -245,7 +245,7 @@ namespace swift::misc::simulation
return this->getAllModelStringsAndAliases() % " " % this->getDbKeyAsStringInParentheses();
}
QString CAircraftModel::getMsfs2024Modelstring()
QString CAircraftModel::getMsfs2024ModelString()
{
m_modelString = m_modelString.trimmed().toUpper() % u" " % m_modelLivery.trimmed().toUpper();
return m_modelString;

View File

@@ -211,7 +211,7 @@ namespace swift::misc
QString getAllModelStringsAliasesAndDbKey() const;
//! Get model string and Livery
QString getMsfs2024Modelstring();
QString getMsfs2024ModelString();
//! Model string alias
void setModelStringAlias(const QString &alias) { m_modelStringAlias = alias.trimmed().toUpper(); }

View File

@@ -29,7 +29,7 @@ namespace swift::misc::simulation::msfs2024
bool CAircraftModelLoaderMsfs2024::isLoadingFinished() const
{
return !m_parserWorker || m_parserWorker->isFinished();
;
}
CAircraftModelLoaderMsfs2024::CAircraftModelLoaderMsfs2024(QObject *parent)

View File

@@ -15,8 +15,6 @@ using namespace swift::misc::aviation;
namespace swift::misc::simulation::msfs2024
{
CSimConnectUtilities::CSimConnectUtilities() {}
QString CSimConnectUtilities::resolveEnumToString(const DWORD id, const char *enumName)
{
const int i = CSimConnectUtilities::staticMetaObject.indexOfEnumerator(enumName);

View File

@@ -152,14 +152,14 @@ namespace swift::misc::simulation::settings
}
}
void CSimulatorSettings::setPropertyModelSet(bool value) { value ? m_modelSet = true : m_modelSet = false; }
void CSimulatorSettings::setPropertyModelSet(bool value) { m_modelSet = value; }
void CSimulatorSettings::setPropertyWithDbEntry(bool value)
{
value ? m_withDbEntry = true : m_withDbEntry = false;
m_withDbEntry = value;
}
void CSimulatorSettings::setPropertyDistributorFiltered(bool value)
{
value ? m_distributorFiltered = true : m_distributorFiltered = false;
m_distributorFiltered = value;
}
void CSimulatorSettings::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)

View File

@@ -121,9 +121,9 @@ namespace swift::misc::simulation::settings
bool setRecordedGndRadius(const swift::misc::physical_quantities::CLength &radius);
//! Reads the settings for automatic loading when starting swiftgui
bool getPropertyWithDbEntry() { return m_withDbEntry; }
bool getPropertyModelSet() { return m_modelSet; }
bool getPropertyDistributorFiltered() { return m_distributorFiltered; }
bool getPropertyWithDbEntry() const { return m_withDbEntry; }
bool getPropertyModelSet() const { return m_modelSet; }
bool getPropertyDistributorFiltered() const { return m_distributorFiltered; }
//! Reset the paths
void resetPaths();

View File

@@ -82,7 +82,6 @@ namespace swift::simplugin::fsxcommon
hr += initSimulatorEnvironment(hSimConnect);
hr += initSbDataArea(hSimConnect);
if (simInfo.isMSFS()) { hr += initMSFSTransponder(hSimConnect); }
// if (simInfo.isMSFS2024()) { hr += initMSFS2024Transponder(hSimConnect); }
return hr;
}
@@ -423,22 +422,6 @@ namespace swift::simplugin::fsxcommon
return hr;
}
// HRESULT CSimConnectDefinitions::initMSFS2024Transponder(const HANDLE hSimConnect)
//{
// HRESULT hr = s_ok();
// hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataTransponderModeMSFS,
// "TRANSPONDER STATE:1", "Enum");
// hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataTransponderModeMSFS,
// "TRANSPONDER IDENT:1", "Bool");
// if (isFailure(hr))
// {
// CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr))
// .error(u"SimConnect error: MSFS2024 transponder data definitions %1")
// << hr;
// }
// return hr;
// }
DataDefinitionRemoteAircraftPartsWithoutLights::DataDefinitionRemoteAircraftPartsWithoutLights()
{
this->resetToInvalid();

View File

@@ -344,9 +344,6 @@ namespace swift::simplugin::fsxcommon
//! Initialize data definition for MSFS transponder
static HRESULT initMSFSTransponder(const HANDLE hSimConnect);
//! Initialize data definition for MSFS transponder
// static HRESULT initMSFS2024Transponder(const HANDLE hSimConnect);
};
} // namespace swift::simplugin::fsxcommon

View File

@@ -39,8 +39,6 @@ inline bool loadAndResolveP3DSimConnectByString(const QString &version)
FSXCOMMON_EXPORT bool loadAndResolveMSFSimConnect();
// FSXCOMMON_EXPORT bool loadAndResolveMSFS2024SimConnect();
#else
//! Load and resolve FSX SimConnect.

View File

@@ -17,8 +17,8 @@
// clang-format off
#include <Windows.h>
//#include <SimConnect.h>
#include "../third_party/externals/common/include/simconnect/P3D-v4/SimConnect.h"
#include <SimConnect.h>
//#include "../third_party/externals/common/include/simconnect/P3D-v4/SimConnect.h"
// clang-format on

View File

@@ -509,8 +509,7 @@ namespace swift::simplugin::fsxcommon
const CFsxP3DSettings settings = m_detailsSettings.getSettings(this->getSimulatorInfo());
m_useAddSimulatedObj = settings.isAddingAsSimulatedObjectEnabled();
m_useSbOffsets = settings.isSbOffsetsEnabled();
if (this->getSimulatorPluginInfo().getSimulatorInfo().isMSFS() ||
this->getSimulatorPluginInfo().getSimulatorInfo().isMSFS2024())
if (this->getSimulatorPluginInfo().getSimulatorInfo().isMSFS())
{
m_useSbOffsets = false; // Always disable SbOffsets for MSFS. Using new transponder mode property directly
}
@@ -528,8 +527,7 @@ namespace swift::simplugin::fsxcommon
SIMCONNECT_PERIOD_SECOND, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED),
"Cannot request title", Q_FUNC_INFO, "SimConnect_RequestDataOnSimObject");
if (!this->getSimulatorPluginInfo().getSimulatorInfo().isMSFS() &&
!this->getSimulatorPluginInfo().getSimulatorInfo().isMSFS2024())
if (!this->getSimulatorPluginInfo().getSimulatorInfo().isMSFS())
{
// Request the data from SB only when its changed and only ONCE so we don't have to run a 1sec event to
// get/set this info ;) there was a bug with SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, see
@@ -3015,16 +3013,6 @@ namespace swift::simplugin::fsxcommon
return connectedSimName.contains("fsx") || connectedSimName.contains("microsoft") ||
connectedSimName.contains("simulator x");
}
else if (pluginSim.isMSFS())
{
// MSFS 2020 drivers only works with MSFS
return connectedSimName.contains("kittyhawk");
}
else if (pluginSim.isMSFS2024())
{
// MSFS2024 drivers only works with MSFS2024
return connectedSimName.contains("sunrise");
}
return false;
}

View File

@@ -16,8 +16,8 @@ add_library(simulatormsfs2024 SHARED
simconnectdatadefinitionmsfs2024.cpp
simconnectdatadefinitionmsfs2024.h
simulatormsfs2024simconnectproc.cpp
msfs2024export.h)
msfs2024export.h
)
set_target_properties(simulatormsfs2024 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator)
set_target_properties(simulatormsfs2024 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator)

View File

@@ -508,7 +508,7 @@ namespace swift::simplugin::msfs2024common
bool incremnental = false;
bool sortByDistributor = true;
bool consolidateWithDb = false;
bool ShowAllInstalledModells = true; // msfs20424 always show all installed models
bool ShowAllInstalledModels = true; // msfs20424 always show all installed models
if (gui_application)
{
@@ -516,7 +516,7 @@ namespace swift::simplugin::msfs2024common
dbDataOnly = m_generic.getPropertyWithDbEntry();
incremnental = false;
consolidateWithDb = true;
ShowAllInstalledModells = true;
ShowAllInstalledModels = true;
}
// CDistributorList distributorList;
@@ -531,7 +531,7 @@ namespace swift::simplugin::msfs2024common
if (incremnental) { options |= CModelSetBuilder::Incremental; }
if (sortByDistributor) { options |= CModelSetBuilder::SortByDistributors; }
if (consolidateWithDb) { options |= CModelSetBuilder::ConsolidateWithDb; }
if (ShowAllInstalledModells) { options |= CModelSetBuilder::ShowAllInstalledModells; }
if (ShowAllInstalledModels) { options |= CModelSetBuilder::ShowAllInstalledModels; }
const CSimulatorInfo &simulator = this->getSimulatorInfo();
CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().synchronizeCache(simulator);

View File

@@ -260,7 +260,7 @@ namespace swift::simplugin::msfs2024common
CAircraftModel model(dataDefinitionModel->title, dataDefinitionModel->livery,
CAircraftModel::TypeOwnSimulatorModel);
simulatorMsfs2024->reverseLookupAndUpdateOwnAircraftModel(model.getMsfs2024Modelstring());
simulatorMsfs2024->reverseLookupAndUpdateOwnAircraftModel(model.getMsfs2024ModelString());
}
break;
}

View File

@@ -25,7 +25,6 @@ namespace Ui
namespace swift::core
{
class CWebDataServices;
// class CPluginManagerSimulator;
} // namespace swift::core
namespace swift::gui::components
{