Skip to content

Commit e0ff0df

Browse files
committed
refactor: Remove unnecessary comments
1 parent fd4f544 commit e0ff0df

File tree

8 files changed

+36
-120
lines changed

8 files changed

+36
-120
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ env:
2222
bitrock_version: qt-professional-24.7.0
2323
bitrock_url: https://releases.installbuilder.com/installbuilder
2424
externals: swift-project/externals
25-
externals_sha: 5787843a7acc6e4236ab5fe9182b18082469bbd9
25+
externals_sha: e1f1743ba159e11b0c065ea8f1ae1a0e91e3bf39
26+
2627

2728
use_externals: ${{ secrets.EXTERNALS_PAT != '' }}
2829

src/gui/components/dbownmodelscomponent.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ namespace swift::gui::components
339339
IAircraftModelLoader::LoadMode mode,
340340
const QStringList &modelDirectories)
341341
{
342+
Q_UNUSED(mode);
343+
Q_UNUSED(modelDirectories);
344+
342345
using namespace std::chrono_literals;
343346
const CStatusMessage msg = CLogMessage(this).info(u"Start loading models for %1") << simulator.toQString();
344347
this->showOverlayHTMLMessage(msg, 2s);
@@ -528,8 +531,7 @@ namespace swift::gui::components
528531
IAircraftModelLoader::LoadMode mode,
529532
const QStringList &modelDirectories)
530533
{
531-
// TODO TZ check
532-
// At this point, we switch how the models should be loaded: SimConnect or file search.
534+
// At this point, we switch how the models should be loaded: SimConnect or classic file search
533535
if (simulator.isMSFS2024())
534536
this->loadInstalledModelsSimConnect(simulator, mode, modelDirectories);
535537
else

src/misc/simulation/msfs2024/aircraftmodelloadermsfs2024.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ namespace swift::misc::simulation::msfs2024
5656
{
5757
CAircraftModelList allModels;
5858

59-
// TODO TZ implement model querying via SimConnect
60-
// at this point, we trigger SimConnect to query the model list
61-
// HRESULT hr = S_OK();
62-
// hr = CSimConnectDefinitions::initOwnAircraftList(CSimulatorMsfs2024::getSimConnectHandle());
59+
// TODO TZ Implement model queries via SimConnect if possible
60+
// misc shut not include simconnect headers or plugins directly
6361

6462
const CSimulatorInfo simulatorInfo = CSimulatorInfo::msfs2024();
6563
allModels =

src/misc/simulation/settings/simulatorsettings.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,9 @@ namespace swift::misc::simulation::settings
704704
}
705705
case CSimulatorInfo::MSFS2024:
706706
{
707-
// TODO TZ check
708707
// msfs2024 uses no model directories but uses the field "packages directory" for filtering modelstrings
708+
// Asterix stands for everything == no filtering
709709
static const QString msfs2024 = "*";
710-
// CFileUtils::normalizeFilePathToQtStandard(CFsDirectories::msfs2024PackagesDir());
711710
if (msfs2024.isEmpty()) { return e; }
712711
static const QStringList md { msfs2024 };
713712
return md;

src/misc/simulation/simulatedaircraft.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ namespace swift::misc
412412
//! Get model Livery MSFS2024
413413
const QString &getLiveryString() const { return m_models[CurrentModel].getModelLivery(); }
414414

415+
//! Get short model string (without livery)
416+
const QString getShortModelString() const { return m_models[CurrentModel].getShortModelString(); }
417+
415418
//! Set model string
416419
void setModelString(const QString &modelString);
417420

src/plugins/simulator/msfs2024/simconnectdatadefinitionmsfs2024.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ namespace swift::simplugin::msfs2024common
7676
HRESULT CSimConnectDefinitions::initDataDefinitionsWhenConnected(const HANDLE hSimConnect,
7777
const CSimulatorInfo &simInfo)
7878
{
79+
Q_UNUSED(simInfo);
80+
7981
HRESULT hr = s_ok();
8082
hr += initOwnAircraft(hSimConnect);
8183
hr += initRemoteAircraft(hSimConnect);

src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp

Lines changed: 22 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ namespace swift::simplugin::msfs2024common
390390
sSimmobjectLoadedState.bLoadStarted = true;
391391
CLogMessage(this).info(u"Start loading SimObjects and liverys from simulator");
392392

393-
// TODO TZ a message should be displayed here because the gui freezes during loading
393+
// TODO TZ a message should be displayed here because the gui freezes during loading large amounts of data
394394
const CStatusMessage m = CStatusMessage(this, CStatusMessage::SeverityInfo,
395395
u"Start loading SimObjects and liverys from simulator");
396396
}
@@ -411,24 +411,25 @@ namespace swift::simplugin::msfs2024common
411411
default: break;
412412
}
413413

414-
// if (sSimmobjectLoadedState.bAirplaneLoaded && sSimmobjectLoadedState.bHelicopterLoaded &&
415-
// sSimmobjectLoadedState.bHotAirLoaded)
416-
//{
414+
// sSimmobjectLoadedState.bHotAirLoaded
417415
if (sSimmobjectLoadedState.bAirplaneLoaded && sSimmobjectLoadedState.bHelicopterLoaded)
418416
{
419417
sSimmobjectLoadedState.bLoadStarted = false;
420418
size_t countmodels = vSimObjectsAndLiveries.size();
421419
CLogMessage(this).info(u"%1 SimObjects and Liveries loaded from SimConnect") << countmodels;
422420

423421
// now we try to create a new temporary model list
424-
createNewModelList();
422+
setSimObjectAndLiveries();
425423

426424
CLogMessage(this).info(u"finished new model set");
427425
}
428426
}
429427

430428
void CSimulatorMsfs2024::setSimObjectAndLiveries()
431429
{
430+
// TODO TZ a message should be displayed here because the gui freezes during loading
431+
// better: move to the background (e.g., use CWorker::fromTask(...)), avoid GUI freeze.
432+
432433
CLogMessage(this).info(u"%1 SimObjects and Liveries in vSimObjectsAndLiveries")
433434
<< vSimObjectsAndLiveries.size();
434435
// owner = this (QObject in main thread)
@@ -441,11 +442,8 @@ namespace swift::simplugin::msfs2024common
441442
worker->then(this, [=] { CLogMessage(this).info(u"SimObjects and Liveries in vSimObjectsAndLiveries ready"); });
442443
}
443444

444-
// TODO TZ under construction
445445
void CSimulatorMsfs2024::createNewModelList()
446446
{
447-
// TODO TZ a message should be displayed here because the gui freezes during loading
448-
// better: move to the background (e.g., use CWorker::fromTask(...)), avoid GUI freeze.
449447

450448
const CSpecializedSimulatorSettings settings = this->getSimulatorSettings();
451449
CSimulatorSettings m_generic = settings.getGenericSettings();
@@ -456,8 +454,6 @@ namespace swift::simplugin::msfs2024common
456454
if (guiName.contains("mapping")) gui_application = false;
457455

458456
CAircraftModelList newModels;
459-
// CAircraftModelList validModels;
460-
// CAircraftModelList invalidModels;
461457

462458
for (int i = 0; i < static_cast<int>(vSimObjectsAndLiveries.size()); ++i)
463459
{
@@ -477,9 +473,6 @@ namespace swift::simplugin::msfs2024common
477473
model.setModelType(CAircraftModel::TypeOwnSimulatorModel);
478474
model.setSimulator(this->getSimulatorInfo());
479475

480-
// if (gui_application)
481-
//{
482-
// filter certain models if needed with settings from settingssimulatormsfs2024.json
483476
bool excluded = false;
484477
for (const QString &rawPattern : excludePatterns)
485478
{
@@ -492,11 +485,8 @@ namespace swift::simplugin::msfs2024common
492485
}
493486
}
494487
if (excluded) continue; // skip adding this model
495-
//}
496-
newModels.replaceOrAddModelWithString(model, Qt::CaseInsensitive);
497488

498-
// TODO TZ do we need valid/invalid models here? I think not
499-
// newModels.addAsValidOrInvalidModel(model, true, validModels, invalidModels);
489+
newModels.replaceOrAddModelWithString(model, Qt::CaseInsensitive);
500490
}
501491

502492
CAircraftModelList newModelList;
@@ -520,25 +510,16 @@ namespace swift::simplugin::msfs2024common
520510
bool sortByDistributor = true;
521511
bool consolidateWithDb = false;
522512
bool ShowAllInstalledModells = true;
523-
// const CAircraftModelList models = this->getMappingComponent()->getOwnModels();
524-
// const CDistributorList distributors = ui->form_OwnModelSet->getDistributorsBasedOnOptions();
525-
// const QStringList distributorNames = { "ASOBO", "FSLTL", "CARENADO", "FS9", "PMDG", "FBW", "AIG" };
526-
// const QStringList distributorNames = { "ASOBO" };
527513

528514
if (gui_application)
529515
{
530516
givenDistributorsOnly = m_generic.getPropertyDistributorFiltered();
531517
dbDataOnly = m_generic.getPropertyWithDbEntry();
532-
// optionDbIcaoCodesOnly
533518
dbIcaoOnly = false;
534-
// optionIncrementalBuild
535519
incremnental = false;
536-
// optionSortByDistributorPreferences
537520
sortByDistributor = true;
538-
// optionConsolidateModelSetWithDbData
539521
consolidateWithDb = true;
540-
541-
ShowAllInstalledModells = true;
522+
ShowAllInstalledModells = true; // msfs20424 always show all installed models
542523
}
543524

544525
// CDistributorList distributorList;
@@ -555,16 +536,12 @@ namespace swift::simplugin::msfs2024common
555536
if (consolidateWithDb) { options |= CModelSetBuilder::ConsolidateWithDb; }
556537
if (ShowAllInstalledModells) { options |= CModelSetBuilder::ShowAllInstalledModells; }
557538
const CSimulatorInfo &simulator = this->getSimulatorInfo();
558-
// return
559539

560540
CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().synchronizeCache(simulator);
561-
// for swiftgui it is enough to set the cache here
562-
563541
currentSet = CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().getCachedModels(simulator);
564542

565543
NewSet = builder.buildModelSet(simulator, newModelList, currentSet, options, distributorList);
566544

567-
// TODO TZ cache the new model set for further usage
568545
CAircraftMatcher matcher;
569546
swift::misc::simulation::CAircraftMatcherSetup mSetup = matcher.getSetup();
570547

@@ -576,21 +553,13 @@ namespace swift::simplugin::msfs2024common
576553
NewSet.latestTimestamp();
577554
if (!latestDbModelsTs.isValid()) { return; }
578555

556+
// for swiftgui it is enough to set the cache here
579557
if (gui_application)
580-
{
581-
// for swiftgui it is enough to set the cache here
582558
CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().setCachedModels(NewSet, simulator);
583-
CCentralMultiSimulatorModelCachesProvider::modelCachesInstance().setModelsForSimulator(NewSet,
584-
simulator);
585-
}
586-
else
587-
{
588-
// for swiftdata we set the installed model here
589-
CCentralMultiSimulatorModelCachesProvider::modelCachesInstance().setModelsForSimulator(NewSet,
590-
simulator);
591-
}
559+
592560
CCentralMultiSimulatorModelCachesProvider::modelCachesInstance().updateModelsForSimulator(NewSet,
593561
simulator);
562+
594563
// CCentralMultiSimulatorModelCachesProvider::modelCachesInstance().getSynchronizedCachedModels(simulator);
595564

596565
const CStatusMessage m = CStatusMessage(this, CStatusMessage::SeverityInfo,
@@ -600,7 +569,6 @@ namespace swift::simplugin::msfs2024common
600569

601570
// TODO TZ only for debugging
602571
// int cstoremodels = writeSimObjectsAndLiveriesToFile(NewSet);
603-
// CLogMessage(this).info(u"%1 SimObjects and Liveries stored to aircraftlist.txt") << cstoremodels;
604572
}
605573
}
606574

@@ -613,28 +581,12 @@ namespace swift::simplugin::msfs2024common
613581
if (!datei) return 0;
614582
for (int i = 0; i < static_cast<int>(Modelset.size()); ++i)
615583
{
616-
datei << Modelset[i].getModelString().toStdString() << "::" << Modelset[i].getModelLivery().toStdString()
617-
<< "::" << Modelset[i].getDbKey() << std::endl;
584+
datei << Modelset[i].getShortModelString().toStdString()
585+
<< "::" << Modelset[i].getModelLivery().toStdString() << "::" << Modelset[i].getDbKey() << std::endl;
618586
++counter;
619587
}
620588
datei.close();
621589
return counter;
622-
623-
//// datei << element.AircraftTitle // PMDG DC-6A PMDG House (N6PA | 2021)
624-
//// << "::" << element.LiveryName // ''
625-
//// << "::" << model.getName().toStdString() // DC-6A_v1
626-
//// << "::" << model.getAircraftIcaoCode().getDbKeyAsString().toStdString() // 3198
627-
//// << "::" << model.getDbKey() // 53714
628-
//// << "::"
629-
//// << model.getAirlineIcaoCode().getDbKeyAsString().toStdString() // 6809
630-
//// //<< "::" << model.getAirlineIcaoCode().toStdString()
631-
//// << "::" << model.getDescription().toStdString() // Douglas DC-6A PMDG House (N6PA | 2021)
632-
//// << "::" << model.getDistributor().getDbKeyAsJsonValue().toString().toStdString() // PMDG
633-
//// << "::" << model.getSimulator().toStdString() // FSX P3D MSFS MSFS2024
634-
//// << "::" << model.getAircraftIcaoCode().toStdString() // DC6 (3198) L4P M
635-
//// << "::" << model.getModelStringAndDbKey().toStdString() // PMDG DC-6A PMDG HOUSE (N6PA | 2021)
636-
//// (53714)
637-
//// << std::endl;
638590
}
639591

640592
bool CSimulatorMsfs2024::isTracingSendId() const
@@ -2043,23 +1995,9 @@ namespace swift::simplugin::msfs2024common
20431995
const SIMCONNECT_DATA_INITPOSITION initialPosition =
20441996
CSimulatorMsfs2024::aircraftSituationToFsxPosition(initialSituation, sendGround, true, &underflowStatus);
20451997

2046-
QString modelString(newRemoteAircraft.getModelString());
1998+
QString modelString(newRemoteAircraft.getShortModelString());
20471999
const QString modelLiveryString(newRemoteAircraft.getLiveryString());
20482000

2049-
// For msfs2024, the model and livery must be passed separately. The livery string is already linked to the
2050-
// model string in the database to maintain compatibility with other simulators.. Therefore, we need to separate
2051-
// it here.
2052-
if (modelString.contains(modelLiveryString))
2053-
{
2054-
int lastIndex = modelString.lastIndexOf(modelLiveryString);
2055-
2056-
if (lastIndex != -1)
2057-
{
2058-
const QString newModelString = modelString.left(lastIndex);
2059-
modelString = newModelString;
2060-
}
2061-
}
2062-
20632001
if (this->showDebugLogMessage())
20642002
{
20652003
this->debugLogMessage(Q_FUNC_INFO,
@@ -2076,20 +2014,12 @@ namespace swift::simplugin::msfs2024common
20762014
CSimConnectObject::SimObjectType type = CSimConnectObject::AircraftNonAtc;
20772015
HRESULT hr = S_OK;
20782016

2079-
// TODO TZ DEBUG the index 10 is just for testing liveries
2080-
// sSimObjectLivery &simObjectToSpawn = vSimObjectsAndLiveries[1];
2081-
// simObjectToSpawn.szSimObjectTitle = "A320neo V2";
2082-
// simObjectToSpawn.szLiveryName = "";
2083-
20842017
if (probe)
20852018
{
2086-
hr = SimConnect_AICreateNonATCAircraft_EX1(
2087-
m_hSimConnect, modelStringBa.constData(), // simObjectToSpawn.szSimObjectTitle.c_str(),
2088-
modelLiveryBa.constData(), csBa.constData(), initialPosition, requestId);
2019+
hr = SimConnect_AICreateNonATCAircraft_EX1(m_hSimConnect, modelStringBa.constData(),
2020+
modelLiveryBa.constData(), csBa.constData(), initialPosition,
2021+
requestId);
20892022

2090-
// TODO TZ remove later
2091-
// hr = SimConnect_AICreateSimulatedObject(m_hSimConnect, modelStringBa.constData(), initialPosition,
2092-
// requestId);
20932023
type = CSimConnectObject::TerrainProbe;
20942024
}
20952025
else
@@ -2102,14 +2032,9 @@ namespace swift::simplugin::msfs2024common
21022032
u"Model '%1' for '%2' failed %1 time(s) before, using AICreateSimulatedObject now")
21032033
<< newRemoteAircraft.getModelString() << callsign.toQString();
21042034

2105-
hr = SimConnect_AICreateNonATCAircraft_EX1(
2106-
m_hSimConnect,
2107-
modelStringBa.constData(), // simObjectToSpawn.szSimObjectTitle.c_str(),
2108-
modelLiveryBa.constData(), csBa.constData(), initialPosition, requestId);
2109-
2110-
// TODO TZ remove later
2111-
// hr = SimConnect_AICreateSimulatedObject(m_hSimConnect, modelStringBa.constData(), initialPosition,
2112-
// requestId);
2035+
hr = SimConnect_AICreateNonATCAircraft_EX1(m_hSimConnect, modelStringBa.constData(),
2036+
modelLiveryBa.constData(), csBa.constData(), initialPosition,
2037+
requestId);
21132038

21142039
type = CSimConnectObject::AircraftSimulatedObject;
21152040
}
@@ -2118,9 +2043,7 @@ namespace swift::simplugin::msfs2024common
21182043
hr = SimConnect_AICreateNonATCAircraft_EX1(m_hSimConnect, modelStringBa.constData(),
21192044
modelLiveryBa.constData(), csBa.constData(), initialPosition,
21202045
requestId);
2121-
// TODO TZ remove later
2122-
// hr = SimConnect_AICreateNonATCAircraft(m_hSimConnect, modelStringBa.constData(), csBa.constData(),
2123-
// initialPosition, requestId);
2046+
21242047
type = CSimConnectObject::AircraftNonAtc;
21252048
}
21262049
}
@@ -2522,7 +2445,7 @@ namespace swift::simplugin::msfs2024common
25222445
return ok;
25232446
}
25242447

2525-
// TODO TZ DEBUG only
2448+
// TODO TZ under investigation, flaps retracting to 0 again and other issues
25262449
bool CSimulatorMsfs2024::sendRemoteAircraftPartsToSimulator(const CSimConnectObject &simObject,
25272450
const CAircraftParts &parts)
25282451
{

src/swiftdata/swiftdata.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
#include <QObject>
1111
#include <QScopedPointer>
1212

13-
// TODO TZ
14-
// #include "core/pluginmanagersimulator.h"
15-
// #include "misc/simulation/simulatorplugininfo.h"
16-
// #include "misc/simulation/simulatorplugininfolist.h"
17-
1813
#include "core/db/backgrounddataupdater.h"
1914
#include "gui/mainwindowaccess.h"
2015
#include "gui/managedstatusbar.h"
@@ -87,13 +82,6 @@ class CSwiftData : public QMainWindow, public swift::misc::CIdentifiable, public
8782
void displayLog();
8883
void checkMinimumVersion();
8984

90-
// TODO TZ
91-
// swift::core::CPluginManagerSimulator *m_plugins = nullptr;
92-
93-
//! Available plugins, auto pseudo plugin added
94-
// static swift::misc::simulation::CSimulatorPluginInfoList getAvailablePlugins();
95-
// END TODO TZ
96-
9785
QScopedPointer<Ui::CSwiftData> ui;
9886
swift::gui::CManagedStatusBar m_statusBar;
9987
swift::core::db::CBackgroundDataUpdater *m_updater = nullptr; //!< consolidate with DB data

0 commit comments

Comments
 (0)