mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T709, added support for taxi lights in XPlane, using the "bundle lights" flag
This commit is contained in:
committed by
Mat Sutcliffe
parent
6e90ec5c72
commit
0da1881003
@@ -932,6 +932,7 @@ namespace BlackSimPlugin
|
||||
planesSurfaces.rudders.push_back(0.0);
|
||||
planesSurfaces.ailerons.push_back(0.0);
|
||||
planesSurfaces.landLights.push_back(parts.getLights().isLandingOn());
|
||||
planesSurfaces.taxiLights.push_back(parts.getLights().isTaxiOn());
|
||||
planesSurfaces.beaconLights.push_back(parts.getLights().isBeaconOn());
|
||||
planesSurfaces.strobeLights.push_back(parts.getLights().isStrobeOn());
|
||||
planesSurfaces.navLights.push_back(parts.getLights().isNavOn());
|
||||
|
||||
@@ -124,7 +124,8 @@ namespace BlackSimPlugin
|
||||
planesSurfaces.spoilers, planesSurfaces.speedBrakes, planesSurfaces.slats,
|
||||
planesSurfaces.wingSweeps, planesSurfaces.thrusts, planesSurfaces.elevators,
|
||||
planesSurfaces.rudders, planesSurfaces.ailerons,
|
||||
planesSurfaces.landLights, planesSurfaces.beaconLights, planesSurfaces.strobeLights,
|
||||
planesSurfaces.landLights, planesSurfaces.taxiLights,
|
||||
planesSurfaces.beaconLights, planesSurfaces.strobeLights,
|
||||
planesSurfaces.navLights, planesSurfaces.lightPatterns);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,18 +74,19 @@ namespace BlackSimPlugin
|
||||
QList<double> gears; //!< List of gears
|
||||
QList<double> flaps; //!< List of flaps
|
||||
QList<double> spoilers; //!< List of spoilers
|
||||
QList<double> speedBrakes; //!< List of speedBrakes
|
||||
QList<double> speedBrakes; //!< List of speed brakes
|
||||
QList<double> slats; //!< List of slats
|
||||
QList<double> wingSweeps; //!< List of wingSweeps
|
||||
QList<double> wingSweeps; //!< List of wing sweeps
|
||||
QList<double> thrusts; //!< List of thrusts
|
||||
QList<double> elevators; //!< List of elevators
|
||||
QList<double> rudders; //!< List of rudders
|
||||
QList<double> ailerons; //!< List of ailerons
|
||||
QList<bool> landLights; //!< List of landLights
|
||||
QList<bool> beaconLights; //!< List of beaconLights
|
||||
QList<bool> strobeLights; //!< List of strobeLights
|
||||
QList<bool> navLights; //!< List of navLights
|
||||
QList<int> lightPatterns; //!< List of lightPatterns
|
||||
QList<bool> landLights; //!< List of landing lights
|
||||
QList<bool> taxiLights; //!< List of taxi lights
|
||||
QList<bool> beaconLights; //!< List of beacon lights
|
||||
QList<bool> strobeLights; //!< List of strobe lights
|
||||
QList<bool> navLights; //!< List of nav lights
|
||||
QList<int> lightPatterns; //!< List of light patterns
|
||||
};
|
||||
|
||||
//! Plane Transponders
|
||||
|
||||
@@ -418,9 +418,12 @@ namespace XSwiftBus
|
||||
|
||||
void CTraffic::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<double> &elevators, const std::vector<double> &rudders, const std::vector<double> &ailerons,
|
||||
const std::vector<bool> &landLights, const std::vector<bool> &taxiLights,
|
||||
const std::vector<bool> &beaconLights, const std::vector<bool> &strobeLights, const std::vector<bool> &navLights, const std::vector<int> &lightPatterns)
|
||||
{
|
||||
const bool bundleTaxiLandingLights = this->getSettings().isBundlingTaxiAndLandingLights();
|
||||
|
||||
for (size_t i = 0; i < callsigns.size(); i++)
|
||||
{
|
||||
auto planeIt = m_planesByCallsign.find(callsigns.at(i));
|
||||
@@ -440,7 +443,17 @@ namespace XSwiftBus
|
||||
plane->surfaces.yokePitch = static_cast<float>(elevators.at(i));
|
||||
plane->surfaces.yokeHeading = static_cast<float>(rudders.at(i));
|
||||
plane->surfaces.yokeRoll = static_cast<float>(ailerons.at(i));
|
||||
plane->surfaces.lights.landLights = landLights.at(i);
|
||||
if (bundleTaxiLandingLights)
|
||||
{
|
||||
const bool on = landLights.at(i) || taxiLights.at(i);
|
||||
plane->surfaces.lights.landLights = on;
|
||||
plane->surfaces.lights.taxiLights = on;
|
||||
}
|
||||
else
|
||||
{
|
||||
plane->surfaces.lights.landLights = landLights.at(i);
|
||||
plane->surfaces.lights.taxiLights = taxiLights.at(i);
|
||||
}
|
||||
plane->surfaces.lights.bcnLights = beaconLights.at(i);
|
||||
plane->surfaces.lights.strbLights = strobeLights.at(i);
|
||||
plane->surfaces.lights.navLights = navLights.at(i);
|
||||
@@ -712,6 +725,7 @@ namespace XSwiftBus
|
||||
std::vector<double> rudders;
|
||||
std::vector<double> ailerons;
|
||||
std::vector<bool> landLights;
|
||||
std::vector<bool> taxiLights;
|
||||
std::vector<bool> beaconLights;
|
||||
std::vector<bool> strobeLights;
|
||||
std::vector<bool> navLights;
|
||||
@@ -729,6 +743,7 @@ namespace XSwiftBus
|
||||
message.getArgument(rudders);
|
||||
message.getArgument(ailerons);
|
||||
message.getArgument(landLights);
|
||||
message.getArgument(taxiLights);
|
||||
message.getArgument(beaconLights);
|
||||
message.getArgument(strobeLights);
|
||||
message.getArgument(navLights);
|
||||
@@ -736,7 +751,7 @@ namespace XSwiftBus
|
||||
queueDBusCall([ = ]()
|
||||
{
|
||||
setPlanesSurfaces(callsigns, gears, flaps, spoilers, speedBrakes, slats, wingSweeps, thrusts, elevators,
|
||||
rudders, ailerons, landLights, beaconLights, strobeLights, navLights, lightPatterns);
|
||||
rudders, ailerons, landLights, taxiLights, beaconLights, strobeLights, navLights, lightPatterns);
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "setPlanesTransponders")
|
||||
|
||||
@@ -106,7 +106,8 @@ namespace XSwiftBus
|
||||
//! 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<double> &elevators, const std::vector<double> &rudders, const std::vector<double> &ailerons,
|
||||
const std::vector<bool> &landLights, const std::vector<bool> &taxiLights,
|
||||
const std::vector<bool> &beaconLights, const std::vector<bool> &strobeLights, const std::vector<bool> &navLights, const std::vector<int> &lightPatterns);
|
||||
|
||||
//! Set the transponder of multiple traffic aircraft
|
||||
|
||||
Reference in New Issue
Block a user