Skip to content

Commit a3d6bb8

Browse files
committed
feat: new lights and number of engines increased to 6
1 parent dbe7bf6 commit a3d6bb8

22 files changed

+665
-328
lines changed

src/core/airspacemonitor.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ namespace swift::core
551551

552552
// TODO TZ remove when testing is done
553553
CLogMessage(this).info(u"CAirspaceMonitor::sendReadyForModelMatching "
554-
u"callsign %1 ")
555-
<< callsign;
554+
u"callsign %1 Flag %2 ")
555+
<< callsign << rf;
556556
// TODO remove
557557

558558
// set flag and init ts
@@ -1212,17 +1212,7 @@ namespace swift::core
12121212
const CSimulatedAircraft aircraft = this->getAircraftInRangeForCallsign(callsign);
12131213
if (aircraft.hasValidCallsign())
12141214
{
1215-
// TODO TZ at this point we have a poblem if the model has no DB key yet (msfs2024 liveries)
1216-
// only if we do not have a DB model yet
1217-
// int testType = aircraft.getModelType();1
1218-
CLogMessage(this).info(u"CAirspaceMonitor::addOrUpdateAircraftInRange CHECK:"
1219-
u"aircraft.getModelType %1 "
1220-
u"callsign %2 "
1221-
u"aircraftIcao %3 "
1222-
u"incomming modelType %4 ")
1223-
<< aircraft.getModelType() << callsign.toQString() << aircraftIcao << modelType;
1224-
1225-
// we do not change manually assigned models
1215+
// we do not change manually assigned models (msfs2024)
12261216
if (!aircraft.getModel().hasValidDbKey() && aircraft.getModelType() != CAircraftModel::TypeManuallySet)
12271217
{
12281218

@@ -1491,6 +1481,7 @@ namespace swift::core
14911481
this->updateAircraftInRange(callsign, vm);
14921482
}
14931483

1484+
// TODO TZ I think, we can remove this method in future, as we have now longer IVAO supported protocols
14941485
void CAirspaceMonitor::onRevBAircraftConfigReceived(const CCallsign &callsign, const QString &config,
14951486
qint64 currentOffsetMs)
14961487
{

src/core/context/contextnetworkimpl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,10 +1142,6 @@ namespace swift::core::context
11421142
if (c)
11431143
{
11441144
const CSimulatedAircraft aircraft(this->getAircraftInRangeForCallsign(callsign));
1145-
// TODO TZ
1146-
CLogMessage(this).info(u"CContextNetwork::updateAircraftModel model.getModelString %1 model.getModelLivery "
1147-
u"%2 model.getModelType %3 aircraft.getModelType '%4'")
1148-
<< model.getModelString() << model.getModelLivery() << model.getModelType() << aircraft.getModelType();
11491145

11501146
Q_ASSERT_X(!aircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "missing callsign");
11511147
emit this->changedRemoteAircraftModel(aircraft, originator); // update aircraft model

src/core/simulator.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -981,15 +981,6 @@ namespace swift::core
981981
bool ISimulator::changeRemoteAircraftEnabled(const CSimulatedAircraft &aircraft)
982982
{
983983
if (this->isShuttingDown()) { return false; }
984-
985-
// TODO TZ remove after testing
986-
CLogMessage(this).info(u"ISimulator::changeRemoteAircraftEnabled CHECK:"
987-
u"aircraft.getModelType %1 "
988-
u"aircraft.getModelString %2 "
989-
u"aircraft.getLiveryString %3 ")
990-
<< aircraft.getModelType() << aircraft.getModelString() << aircraft.getLiveryString();
991-
;
992-
993984
return aircraft.isEnabled() ? this->physicallyAddRemoteAircraft(aircraft) :
994985
this->physicallyRemoveRemoteAircraft(aircraft.getCallsign());
995986
}

src/gui/components/logincomponent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#include "misc/logmessage.h"
4242
#include "misc/network/connectionstatus.h"
4343
#include "misc/network/entityflags.h"
44-
// TODO TZ remove afte testing
44+
// TODO TZ remove after testing. it is in another branch already
4545
#include "misc/network/server.h"
4646
// TODO TZ end remove afte testing
4747
#include "misc/network/serverlist.h"
@@ -301,7 +301,7 @@ namespace swift::gui::components
301301
{
302302
if (!m_updatePilotOnServerChanges) { return; }
303303
const bool vatsim = this->isVatsimNetworkTabSelected();
304-
// TODO TZ remove after testing
304+
// TODO TZ remove after testing. it is on another branch already
305305
// const CUser user = vatsim ? this->getCurrentVatsimServer().getUser() : server.getUser();
306306
const CUser user =
307307
server.getServerType() != CServer::FSDServer ? this->getCurrentVatsimServer().getUser() : server.getUser();

src/gui/components/mappingcomponent.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,6 @@ namespace swift::gui::components
370370
{
371371
const CAircraftModelList models = sGui->getIContextSimulator()->getModelSetModelsStartingWith(modelString);
372372

373-
// TODO TZ DEBUG only for testing
374-
const CStatusMessage msg = CStatusMessage(this).validationInfo(u"Found: %1 models for %2")
375-
<< models.size() << modelString;
376-
this->showOverlayMessage(msg, OverlayMessageMs);
377-
// END testing
378-
379373
if (models.isEmpty())
380374
{
381375
const CStatusMessage msg = CStatusMessage(this).validationError(u"No model for title: '%1'")

src/gui/editors/aircraftpartsform.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ namespace swift::gui::editors
100100
ui->cb_AircraftPartsLightsBeacon->setChecked(on);
101101
ui->cb_AircraftPartsLightsNav->setChecked(on);
102102
ui->cb_AircraftPartsLightsLogo->setChecked(on);
103+
ui->cb_AircraftPartsLightsWing->setChecked(on);
104+
ui->cb_AircraftPartsLightsRecognition->setChecked(on);
105+
ui->cb_AircraftPartsLightsCabin->setChecked(on);
103106
}
104107

105108
void CAircraftPartsForm::setAllEngines()
@@ -115,10 +118,13 @@ namespace swift::gui::editors
115118

116119
aviation::CAircraftParts CAircraftPartsForm::guiToAircraftParts() const
117120
{
121+
// added new values for lights and engines here
118122
const CAircraftLights lights(
119123
ui->cb_AircraftPartsLightsStrobe->isChecked(), ui->cb_AircraftPartsLightsLanding->isChecked(),
120124
ui->cb_AircraftPartsLightsTaxi->isChecked(), ui->cb_AircraftPartsLightsBeacon->isChecked(),
121-
ui->cb_AircraftPartsLightsNav->isChecked(), ui->cb_AircraftPartsLightsLogo->isChecked());
125+
ui->cb_AircraftPartsLightsNav->isChecked(), ui->cb_AircraftPartsLightsLogo->isChecked(),
126+
ui->cb_AircraftPartsLightsRecognition->isChecked(), ui->cb_AircraftPartsLightsCabin->isChecked(),
127+
ui->cb_AircraftPartsLightsWing->isChecked());
122128
const CAircraftEngineList engines(
123129
{ ui->cb_AircraftPartsEngine1->isChecked(), ui->cb_AircraftPartsEngine2->isChecked(),
124130
ui->cb_AircraftPartsEngine3->isChecked(), ui->cb_AircraftPartsEngine4->isChecked(),
@@ -143,6 +149,7 @@ namespace swift::gui::editors
143149
ui->cb_AircraftPartsLightsNav->setChecked(lights.isNavOn());
144150
ui->cb_AircraftPartsLightsStrobe->setChecked(lights.isStrobeOn());
145151
ui->cb_AircraftPartsLightsTaxi->setChecked(lights.isTaxiOn());
152+
ui->cb_AircraftPartsLightsWing->setChecked(lights.isWingOn());
146153

147154
const CAircraftEngineList engines = parts.getEngines();
148155
ui->cb_AircraftPartsEngine1->setChecked(engines.isEngineOn(1));

src/gui/editors/aircraftpartsform.ui

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<property name="bottomMargin">
3333
<number>3</number>
3434
</property>
35-
<item row="4" column="1">
35+
<item row="3" column="4">
3636
<widget class="QCheckBox" name="cb_AircraftPartsLightsStrobe">
3737
<property name="text">
3838
<string>Strobe</string>
@@ -70,7 +70,31 @@
7070
</property>
7171
</widget>
7272
</item>
73-
<item row="3" column="1">
73+
74+
<item row="4" column="1">
75+
<widget class="QCheckBox" name="cb_AircraftPartsLightsWing">
76+
<property name="text">
77+
<string>Wing</string>
78+
</property>
79+
</widget>
80+
</item>
81+
<item row="4" column="2">
82+
<widget class="QCheckBox" name="cb_AircraftPartsLightsRecognition">
83+
<property name="text">
84+
<string>Recognition</string>
85+
</property>
86+
</widget>
87+
</item>
88+
<item row="4" column="3">
89+
<widget class="QCheckBox" name="cb_AircraftPartsLightsCabin">
90+
<property name="text">
91+
<string>Cabin</string>
92+
</property>
93+
</widget>
94+
</item>
95+
96+
97+
<item row="3" column="1">
7498
<widget class="QCheckBox" name="cb_AircraftPartsLightsNav">
7599
<property name="text">
76100
<string>Nav</string>
@@ -91,7 +115,7 @@
91115
</property>
92116
</widget>
93117
</item>
94-
<item row="4" column="0">
118+
<item row="3" column="3">
95119
<widget class="QCheckBox" name="cb_AircraftPartsLightsBeacon">
96120
<property name="text">
97121
<string>Beacon</string>
@@ -140,7 +164,7 @@
140164
</property>
141165
</widget>
142166
</item>
143-
<item row="4" column="2">
167+
<item row="4" column="0">
144168
<widget class="QCheckBox" name="cb_AircraftPartsLightsLogo">
145169
<property name="text">
146170
<string>Logo</string>

src/gui/models/aircraftmodellistmodel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ namespace swift::gui::models
3636
(void)QT_TRANSLATE_NOOP("CAircraftModelListModel", "model");
3737
}
3838

39-
// TODO TZ check if some columns can be hidden automatically for different sims
4039
void CAircraftModelListModel::setAircraftModelMode(CAircraftModelListModel::AircraftModelMode mode)
4140
{
4241
if (m_mode == mode) { return; }

src/misc/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,8 @@ add_library(misc SHARED
535535
simulation/flightgear/flightgearutil.h
536536
simulation/msfs2024/aircraftmodelloadermsfs2024.cpp
537537
simulation/msfs2024/aircraftmodelloadermsfs2024.h
538+
simulation/msfs2024/simconnectutilities.cpp
539+
simulation/msfs2024/simconnectutilities.h
538540
simulation/fscommon/aircraftcfgentries.cpp
539541
simulation/fscommon/aircraftcfgentries.h
540542
simulation/fscommon/aircraftcfgentrieslist.cpp
@@ -681,7 +683,7 @@ add_library(misc SHARED
681683
weather/windlayer.h
682684
weather/windlayerlist.cpp
683685
weather/windlayerlist.h
684-
)
686+
)
685687

686688
if(APPLE)
687689
target_sources(misc PRIVATE

src/misc/aviation/aircraftlights.cpp

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@ namespace swift::misc::aviation
2020
CAircraftLights::CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn,
2121
bool recognition, bool cabin)
2222
: m_strobeOn(strobeOn), m_landingOn(landingOn), m_taxiOn(taxiOn), m_beaconOn(beaconOn), m_navOn(navOn),
23-
m_logoOn(logoOn), m_recognition(recognition), m_cabin(cabin)
23+
m_logoOn(logoOn), m_recognitionOn(recognition), m_cabinOn(cabin)
24+
{}
25+
26+
CAircraftLights::CAircraftLights(bool strobeOn, bool landingOn, bool taxiOn, bool beaconOn, bool navOn, bool logoOn,
27+
bool recognition, bool cabin, bool wing)
28+
: m_strobeOn(strobeOn), m_landingOn(landingOn), m_taxiOn(taxiOn), m_beaconOn(beaconOn), m_navOn(navOn),
29+
m_logoOn(logoOn), m_recognitionOn(recognition), m_cabinOn(cabin), m_wingOn(wing)
2430
{}
2531

2632
CAircraftLights CAircraftLights::allLightsOn()
2733
{
28-
return CAircraftLights { true, true, true, true, true, true, true, true };
34+
return CAircraftLights { true, true, true, true, true, true, true, true, true };
2935
}
3036

3137
CAircraftLights CAircraftLights::allLightsOff()
3238
{
33-
return CAircraftLights { false, false, false, false, false, false, false, false };
39+
return CAircraftLights { false, false, false, false, false, false, false, false, false };
3440
}
3541

3642
QString CAircraftLights::convertToQString(bool i18n) const
@@ -39,7 +45,8 @@ namespace swift::misc::aviation
3945
const QString s = u"strobe: " % boolToYesNo(m_strobeOn) % u" landing: " % boolToYesNo(m_landingOn) %
4046
u" taxi: " % boolToYesNo(m_taxiOn) % u" beacon: " % boolToYesNo(m_beaconOn) % u" nav: " %
4147
boolToYesNo(m_navOn) % u" logo: " % boolToYesNo(m_logoOn) % u" recognition: " %
42-
boolToYesNo(m_recognition) % u" cabin: " % boolToYesNo(m_cabin);
48+
boolToYesNo(m_recognitionOn) % u" cabin: " % boolToYesNo(m_cabinOn) % u" cabin: " %
49+
boolToYesNo(m_wingOn);
4350
return s;
4451
}
4552

@@ -57,8 +64,9 @@ namespace swift::misc::aviation
5764
case IndexNav: return QVariant::fromValue(m_navOn);
5865
case IndexStrobe: return QVariant::fromValue(m_strobeOn);
5966
case IndexTaxi: return QVariant::fromValue(m_taxiOn);
60-
case IndexRecognition: return QVariant::fromValue(m_recognition);
61-
case IndexCabin: return QVariant::fromValue(m_cabin);
67+
case IndexRecognition: return QVariant::fromValue(m_recognitionOn);
68+
case IndexCabin: return QVariant::fromValue(m_cabinOn);
69+
case IndexWing: return QVariant::fromValue(m_wingOn);
6270
default: return CValueObject::propertyByIndex(index);
6371
}
6472
}
@@ -81,8 +89,9 @@ namespace swift::misc::aviation
8189
case IndexNav: m_navOn = variant.toBool(); break;
8290
case IndexStrobe: m_strobeOn = variant.toBool(); break;
8391
case IndexTaxi: m_taxiOn = variant.toBool(); break;
84-
case IndexCabin: m_cabin = variant.toBool(); break;
85-
case IndexRecognition: m_recognition = variant.toBool(); break;
92+
case IndexCabin: m_cabinOn = variant.toBool(); break;
93+
case IndexRecognition: m_recognitionOn = variant.toBool(); break;
94+
case IndexWing: m_wingOn = variant.toBool(); break;
8695
default: CValueObject::setPropertyByIndex(index, variant); break;
8796
}
8897
}
@@ -99,8 +108,9 @@ namespace swift::misc::aviation
99108
case IndexNav: return Compare::compare(m_navOn, compareValue.isNavOn());
100109
case IndexStrobe: return Compare::compare(m_strobeOn, compareValue.isStrobeOn());
101110
case IndexTaxi: return Compare::compare(m_taxiOn, compareValue.isTaxiOn());
102-
case IndexCabin: return Compare::compare(m_cabin, compareValue.isCabinOn());
103-
case IndexRecognition: return Compare::compare(m_recognition, compareValue.isRecognitionOn());
111+
case IndexCabin: return Compare::compare(m_cabinOn, compareValue.isCabinOn());
112+
case IndexRecognition: return Compare::compare(m_recognitionOn, compareValue.isRecognitionOn());
113+
case IndexWing: return Compare::compare(m_wingOn, compareValue.isWingOn());
104114
default: break;
105115
}
106116
return 0;
@@ -114,8 +124,9 @@ namespace swift::misc::aviation
114124
m_navOn = true;
115125
m_strobeOn = true;
116126
m_taxiOn = true;
117-
m_cabin = true;
118-
m_recognition = true;
127+
m_cabinOn = true;
128+
m_recognitionOn = true;
129+
m_wingOn = true;
119130
}
120131

121132
void CAircraftLights::setAllOff()
@@ -126,7 +137,8 @@ namespace swift::misc::aviation
126137
m_navOn = false;
127138
m_strobeOn = false;
128139
m_taxiOn = false;
129-
m_recognition = false;
130-
m_cabin = false;
140+
m_recognitionOn = false;
141+
m_cabinOn = false;
142+
m_wingOn = false;
131143
}
132144
} // namespace swift::misc::aviation

0 commit comments

Comments
 (0)