mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Move XPlane gnd flag handling from parts to situation
ref T276
This commit is contained in:
committed by
Klaus Basan
parent
10a0575a80
commit
05e0480bb4
@@ -787,6 +787,7 @@ namespace BlackSimPlugin
|
||||
planesPositions.pitches.push_back(interpolatedSituation.getPitch().value(CAngleUnit::deg()));
|
||||
planesPositions.rolls.push_back(interpolatedSituation.getBank().value(CAngleUnit::deg()));
|
||||
planesPositions.headings.push_back(interpolatedSituation.getHeading().value(CAngleUnit::deg()));
|
||||
planesPositions.onGrounds.push_back(interpolatedSituation.getOnGround() == CAircraftSituation::OnGround);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -816,7 +817,6 @@ namespace BlackSimPlugin
|
||||
planesSurfaces.strobeLights.push_back(parts.getLights().isStrobeOn());
|
||||
planesSurfaces.navLights.push_back(parts.getLights().isNavOn());
|
||||
planesSurfaces.lightPatterns.push_back(0);
|
||||
planesSurfaces.onGrounds.push_back(parts.isOnGround());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace BlackSimPlugin
|
||||
m_dbusInterface->callDBus(QLatin1String("setPlanesPositions"),
|
||||
planesPositions.callsigns, planesPositions.latitudes, planesPositions.longitudes,
|
||||
planesPositions.altitudes, planesPositions.pitches, planesPositions.rolls,
|
||||
planesPositions.headings);
|
||||
planesPositions.headings, planesPositions.onGrounds);
|
||||
}
|
||||
|
||||
void CXSwiftBusTrafficProxy::setPlanesSurfaces(const PlanesSurfaces &planesSurfaces)
|
||||
@@ -112,8 +112,7 @@ namespace BlackSimPlugin
|
||||
planesSurfaces.wingSweeps, planesSurfaces.thrusts, planesSurfaces.elevators,
|
||||
planesSurfaces.rudders, planesSurfaces.ailerons,
|
||||
planesSurfaces.landLights, planesSurfaces.beaconLights, planesSurfaces.strobeLights,
|
||||
planesSurfaces.navLights, planesSurfaces.lightPatterns,
|
||||
planesSurfaces.onGrounds);
|
||||
planesSurfaces.navLights, planesSurfaces.lightPatterns);
|
||||
}
|
||||
|
||||
void CXSwiftBusTrafficProxy::setPlaneTransponder(const QString &callsign, int code, bool modeC, bool ident)
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace BlackSimPlugin
|
||||
QList<double> pitches; //!< List of pitches
|
||||
QList<double> rolls; //!< List of rolls
|
||||
QList<double> headings; //!< List of headings
|
||||
QList<bool> onGrounds; //!< List of onGrounds
|
||||
};
|
||||
|
||||
//! Planes surfaces
|
||||
@@ -84,7 +85,6 @@ namespace BlackSimPlugin
|
||||
QList<bool> strobeLights; //!< List of strobeLights
|
||||
QList<bool> navLights; //!< List of navLights
|
||||
QList<int> lightPatterns; //!< List of lightPatterns
|
||||
QList<bool> onGrounds; //!< List of onGrounds
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
@@ -44,6 +44,7 @@ R"(<node>
|
||||
<arg name="pitches" type="ad" direction="in"/>
|
||||
<arg name="rolls" type="ad" direction="in"/>
|
||||
<arg name="headings" type="ad" direction="in"/>
|
||||
<arg name="onGrounds" type="ab" direction="in"/>
|
||||
</method>
|
||||
<method name="setPlanesSurfaces">
|
||||
<arg name="callsigns" type="as" direction="in"/>
|
||||
@@ -62,7 +63,6 @@ R"(<node>
|
||||
<arg name="strobeLights" type="ab" direction="in"/>
|
||||
<arg name="navLights" type="ab" direction="in"/>
|
||||
<arg name="lightPatterns" type="ai" direction="in"/>
|
||||
<arg name="onGrounds" type="ab" direction="in"/>
|
||||
</method>
|
||||
<method name="setPlaneTransponder">
|
||||
<arg name="callsign" type="s" direction="in"/>
|
||||
|
||||
@@ -318,8 +318,10 @@ namespace XSwiftBus
|
||||
}
|
||||
|
||||
void CTraffic::setPlanesPositions(const std::vector<std::string> &callsigns, std::vector<double> latitudes, std::vector<double> longitudes, std::vector<double> altitudes,
|
||||
std::vector<double> pitches, std::vector<double> rolles, std::vector<double> headings)
|
||||
std::vector<double> pitches, std::vector<double> rolles, std::vector<double> headings, const std::vector<bool> &onGrounds)
|
||||
{
|
||||
(void)onGrounds;
|
||||
|
||||
for (size_t i = 0; i < callsigns.size(); i++)
|
||||
{
|
||||
auto planeIt = m_planesByCallsign.find(callsigns.at(i));
|
||||
@@ -339,11 +341,8 @@ namespace XSwiftBus
|
||||
void CTraffic::setPlanesSurfaces(const std::vector<std::string> &callsign, const std::vector<double> &gear, const std::vector<double> &flap, const std::vector<double> &spoilers,
|
||||
const std::vector<double> &speedBrakes, const std::vector<double> &slats, const std::vector<double> &wingSweeps, const std::vector<double> &thrusts,
|
||||
const std::vector<double> &elevators, const std::vector<double> &rudders, const std::vector<double> &ailerons, const std::vector<bool> &landLights,
|
||||
const std::vector<bool> &beaconLights, const std::vector<bool> &strobeLights, const std::vector<bool> &navLights, const std::vector<int> &lightPatterns,
|
||||
const std::vector<bool> &onGrounds)
|
||||
const std::vector<bool> &beaconLights, const std::vector<bool> &strobeLights, const std::vector<bool> &navLights, const std::vector<int> &lightPatterns)
|
||||
{
|
||||
(void)onGrounds;
|
||||
|
||||
for (size_t i = 0; i < callsign.size(); i++)
|
||||
{
|
||||
auto planeIt = m_planesByCallsign.find(callsign.at(i));
|
||||
@@ -586,6 +585,7 @@ namespace XSwiftBus
|
||||
std::vector<double> pitches;
|
||||
std::vector<double> rolls;
|
||||
std::vector<double> headings;
|
||||
std::vector<bool> onGrounds;
|
||||
message.beginArgumentRead();
|
||||
message.getArgument(callsigns);
|
||||
message.getArgument(latitudes);
|
||||
@@ -594,9 +594,10 @@ namespace XSwiftBus
|
||||
message.getArgument(pitches);
|
||||
message.getArgument(rolls);
|
||||
message.getArgument(headings);
|
||||
message.getArgument(onGrounds);
|
||||
queueDBusCall([ = ]()
|
||||
{
|
||||
setPlanesPositions(callsigns, latitudes, longitudes, altitudes, pitches, rolls, headings);
|
||||
setPlanesPositions(callsigns, latitudes, longitudes, altitudes, pitches, rolls, headings, onGrounds);
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "setPlanesSurfaces")
|
||||
@@ -618,7 +619,6 @@ namespace XSwiftBus
|
||||
std::vector<bool> strobeLights;
|
||||
std::vector<bool> navLights;
|
||||
std::vector<int> lightPatterns;
|
||||
std::vector<bool> onGrounds;
|
||||
message.beginArgumentRead();
|
||||
message.getArgument(callsigns);
|
||||
message.getArgument(gears);
|
||||
@@ -636,12 +636,10 @@ namespace XSwiftBus
|
||||
message.getArgument(strobeLights);
|
||||
message.getArgument(navLights);
|
||||
message.getArgument(lightPatterns);
|
||||
message.getArgument(onGrounds);
|
||||
queueDBusCall([ = ]()
|
||||
{
|
||||
setPlanesSurfaces(callsigns, gears, flaps, spoilers, speedBrakes, slats, wingSweeps, thrusts, elevators,
|
||||
rudders, ailerons, landLights, beaconLights, strobeLights, navLights, lightPatterns,
|
||||
onGrounds);
|
||||
rudders, ailerons, landLights, beaconLights, strobeLights, navLights, lightPatterns);
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "setPlaneTransponder")
|
||||
|
||||
@@ -97,14 +97,13 @@ namespace XSwiftBus
|
||||
|
||||
//! Set the position of multiple traffic aircrafts
|
||||
void setPlanesPositions(const std::vector<std::string> &callsigns, std::vector<double> latitudes, std::vector<double> longitudes, std::vector<double> altitudes,
|
||||
std::vector<double> pitches, std::vector<double> rolls, std::vector<double> headings);
|
||||
std::vector<double> pitches, std::vector<double> rolls, std::vector<double> headings, const std::vector<bool> &onGrounds);
|
||||
|
||||
//! Set the flight control surfaces and lights of multiple traffic aircrafts
|
||||
void setPlanesSurfaces(const std::vector<std::string> &callsigns, const std::vector<double> &gears, const std::vector<double> &flaps, const std::vector<double> &spoilers,
|
||||
const std::vector<double> &speedBrakes, const std::vector<double> &slats, const std::vector<double> &wingSweeps, const std::vector<double> &thrusts,
|
||||
const std::vector<double> &elevators, const std::vector<double> &rudders, const std::vector<double> &ailerons, const std::vector<bool> &landLights,
|
||||
const std::vector<bool> &beaconLights, const std::vector<bool> &strobeLights, const std::vector<bool> &navLights, const std::vector<int> &lightPatterns,
|
||||
const std::vector<bool> &onGrounds);
|
||||
const std::vector<bool> &beaconLights, const std::vector<bool> &strobeLights, const std::vector<bool> &navLights, const std::vector<int> &lightPatterns);
|
||||
|
||||
//! Set the transponder of a traffic aircraft
|
||||
void setPlaneTransponder(const std::string &callsign, int code, bool modeC, bool ident);
|
||||
|
||||
Reference in New Issue
Block a user