Align the position and surface variable names to plural

This commit is contained in:
Roland Winklmeier
2018-05-15 09:57:09 +02:00
committed by Klaus Basan
parent c437c2eabd
commit 654cc1621e
4 changed files with 103 additions and 95 deletions

View File

@@ -156,7 +156,7 @@ namespace BlackSimPlugin
//! \copydoc XSwiftBus::CTraffic::setPlanesPositions
void setPlanesPositions(const PlanesPositions &planesPositions);
//! \copydoc XSwiftBus::CTraffic::setPlaneSurfaces
//! \copydoc XSwiftBus::CTraffic::setPlanesSurfaces
void setPlanesSurfaces(const PlanesSurfaces &planesSurfaces);
//! \copydoc XSwiftBus::CTraffic::setPlaneTransponder

View File

@@ -36,33 +36,39 @@ R"(<node>
</method>
<method name="removeAllPlanes">
</method>
<method name="setPlanePosition">
<arg name="callsign" type="s" direction="in"/>
<arg name="latitude" type="d" direction="in"/>
<arg name="longitude" type="d" direction="in"/>
<arg name="altitude" type="d" direction="in"/>
<arg name="pitch" type="d" direction="in"/>
<arg name="roll" type="d" direction="in"/>
<arg name="heading" type="d" direction="in"/>
<method name="setPlanesPositions">
<arg name="callsigns" type="as" direction="in"/>
<arg name="latitudes" type="ad" direction="in"/>
<arg name="longitudes" type="ad" direction="in"/>
<arg name="altitudes" type="ad" direction="in"/>
<arg name="pitches" type="ad" direction="in"/>
<arg name="rolls" type="ad" direction="in"/>
<arg name="headings" type="ad" direction="in"/>
</method>
<method name="setPlaneSurfaces">
<arg name="callsign" type="as" direction="in"/>
<arg name="gear" type="ad" direction="in"/>
<arg name="flap" type="ad" direction="in"/>
<arg name="spoiler" type="ad" direction="in"/>
<arg name="speedBrake" type="ad" direction="in"/>
<arg name="slat" type="ad" direction="in"/>
<arg name="wingSweep" type="ad" direction="in"/>
<arg name="thrust" type="ad" direction="in"/>
<arg name="elevator" type="ad" direction="in"/>
<arg name="rudder" type="ad" direction="in"/>
<arg name="aileron" type="ad" direction="in"/>
<arg name="landLight" type="ab" direction="in"/>
<arg name="beaconLight" type="ab" direction="in"/>
<arg name="strobeLight" type="ab" direction="in"/>
<arg name="navLight" type="ab" direction="in"/>
<arg name="lightPattern" type="ai" direction="in"/>
<arg name="onGround" type="ab" direction="in"/>
<method name="setPlanesSurfaces">
<arg name="callsigns" type="as" direction="in"/>
<arg name="gears" type="ad" direction="in"/>
<arg name="flaps" type="ad" direction="in"/>
<arg name="spoilers" type="ad" direction="in"/>
<arg name="speedBrakes" type="ad" direction="in"/>
<arg name="slats" type="ad" direction="in"/>
<arg name="wingSweeps" type="ad" direction="in"/>
<arg name="thrusts" type="ad" direction="in"/>
<arg name="elevators" type="ad" direction="in"/>
<arg name="rudders" type="ad" direction="in"/>
<arg name="ailerons" type="ad" direction="in"/>
<arg name="landLights" type="ab" direction="in"/>
<arg name="beaconLights" type="ab" direction="in"/>
<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"/>
<arg name="code" type="i" direction="in"/>
<arg name="modeC" type="b" direction="in"/>
<arg name="ident" type="b" direction="in"/>
</method>
<method name="setPlaneTransponder">
<arg name="callsign" type="s" direction="in"/>

View File

@@ -277,7 +277,7 @@ namespace XSwiftBus
m_planeViewMenuItems.clear();
}
void CTraffic::setPlanePositions(const std::vector<std::string> &callsigns, std::vector<double> latitudes, std::vector<double> longitudes, std::vector<double> altitudes,
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)
{
for (size_t i = 0; i < callsigns.size(); i++)
@@ -296,12 +296,13 @@ namespace XSwiftBus
}
}
void CTraffic::setPlaneSurfaces(const std::vector<std::string> &callsign, const std::vector<double> &gear, const std::vector<double> &flap, const std::vector<double> &spoiler,
const std::vector<double> &speedBrake, const std::vector<double> &slat, const std::vector<double> &wingSweep, const std::vector<double> &thrust,
const std::vector<double> &elevator, const std::vector<double> &rudder, const std::vector<double> &aileron, const std::vector<bool> &landLight,
const std::vector<bool> &beaconLight, const std::vector<bool> &strobeLight, const std::vector<bool> &navLight, const std::vector<int> &lightPattern, const std::vector<bool> &onGround)
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)
{
(void)onGround;
(void)onGrounds;
for (size_t i = 0; i < callsign.size(); i++)
{
@@ -314,19 +315,19 @@ namespace XSwiftBus
plane->hasSurfaces = true;
plane->targetGearPosition = static_cast<float>(gear.at(i));
plane->surfaces.flapRatio = static_cast<float>(flap.at(i));
plane->surfaces.spoilerRatio = static_cast<float>(spoiler.at(i));
plane->surfaces.speedBrakeRatio = static_cast<float>(speedBrake.at(i));
plane->surfaces.slatRatio = static_cast<float>(slat.at(i));
plane->surfaces.wingSweep = static_cast<float>(wingSweep.at(i));
plane->surfaces.thrust = static_cast<float>(thrust.at(i));
plane->surfaces.yokePitch = static_cast<float>(elevator.at(i));
plane->surfaces.yokeHeading = static_cast<float>(rudder.at(i));
plane->surfaces.yokeRoll = static_cast<float>(aileron.at(i));
plane->surfaces.lights.landLights = landLight.at(i);
plane->surfaces.lights.bcnLights = beaconLight.at(i);
plane->surfaces.lights.strbLights = strobeLight.at(i);
plane->surfaces.lights.navLights = navLight.at(i);
plane->surfaces.lights.flashPattern = lightPattern.at(i);
plane->surfaces.spoilerRatio = static_cast<float>(spoilers.at(i));
plane->surfaces.speedBrakeRatio = static_cast<float>(speedBrakes.at(i));
plane->surfaces.slatRatio = static_cast<float>(slats.at(i));
plane->surfaces.wingSweep = static_cast<float>(wingSweeps.at(i));
plane->surfaces.thrust = static_cast<float>(thrusts.at(i));
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);
plane->surfaces.lights.bcnLights = beaconLights.at(i);
plane->surfaces.lights.strbLights = strobeLights.at(i);
plane->surfaces.lights.navLights = navLights.at(i);
plane->surfaces.lights.flashPattern = lightPatterns.at(i);
}
}
@@ -535,7 +536,7 @@ namespace XSwiftBus
removeAllPlanes();
});
}
else if (message.getMethodName() == "setPlanePositions")
else if (message.getMethodName() == "setPlanesPositions")
{
maybeSendEmptyDBusReply(wantsReply, sender, serial);
std::vector<std::string> callsigns;
@@ -543,7 +544,7 @@ namespace XSwiftBus
std::vector<double> longitudes;
std::vector<double> altitudes;
std::vector<double> pitches;
std::vector<double> rolles;
std::vector<double> rolls;
std::vector<double> headings;
message.beginArgumentRead();
message.getArgument(callsigns);
@@ -551,56 +552,56 @@ namespace XSwiftBus
message.getArgument(longitudes);
message.getArgument(altitudes);
message.getArgument(pitches);
message.getArgument(rolles);
message.getArgument(rolls);
message.getArgument(headings);
queueDBusCall([ = ]()
{
setPlanePositions(callsigns, latitudes, longitudes, altitudes, pitches, rolles, headings);
setPlanesPositions(callsigns, latitudes, longitudes, altitudes, pitches, rolls, headings);
});
}
else if (message.getMethodName() == "setPlaneSurfaces")
else if (message.getMethodName() == "setPlanesSurfaces")
{
maybeSendEmptyDBusReply(wantsReply, sender, serial);
std::vector<std::string> callsign;
std::vector<double> gear;
std::vector<double> flap;
std::vector<double> spoiler;
std::vector<double> speedBrake;
std::vector<double> slat;
std::vector<double> wingSweep;
std::vector<double> thrust;
std::vector<double> elevator;
std::vector<double> rudder;
std::vector<double> aileron;
std::vector<bool> landLight;
std::vector<bool> beaconLight;
std::vector<bool> strobeLight;
std::vector<bool> navLight;
std::vector<int> lightPattern;
std::vector<bool> onGround;
std::vector<std::string> callsigns;
std::vector<double> gears;
std::vector<double> flaps;
std::vector<double> spoilers;
std::vector<double> speedBrakes;
std::vector<double> slats;
std::vector<double> wingSweeps;
std::vector<double> thrusts;
std::vector<double> elevators;
std::vector<double> rudders;
std::vector<double> ailerons;
std::vector<bool> landLights;
std::vector<bool> beaconLights;
std::vector<bool> strobeLights;
std::vector<bool> navLights;
std::vector<int> lightPatterns;
std::vector<bool> onGrounds;
message.beginArgumentRead();
message.getArgument(callsign);
message.getArgument(gear);
message.getArgument(flap);
message.getArgument(spoiler);
message.getArgument(speedBrake);
message.getArgument(slat);
message.getArgument(wingSweep);
message.getArgument(thrust);
message.getArgument(elevator);
message.getArgument(rudder);
message.getArgument(aileron);
message.getArgument(landLight);
message.getArgument(beaconLight);
message.getArgument(strobeLight);
message.getArgument(navLight);
message.getArgument(lightPattern);
message.getArgument(onGround);
message.getArgument(callsigns);
message.getArgument(gears);
message.getArgument(flaps);
message.getArgument(spoilers);
message.getArgument(speedBrakes);
message.getArgument(slats);
message.getArgument(wingSweeps);
message.getArgument(thrusts);
message.getArgument(elevators);
message.getArgument(rudders);
message.getArgument(ailerons);
message.getArgument(landLights);
message.getArgument(beaconLights);
message.getArgument(strobeLights);
message.getArgument(navLights);
message.getArgument(lightPatterns);
message.getArgument(onGrounds);
queueDBusCall([ = ]()
{
setPlaneSurfaces(callsign, gear, flap, spoiler, speedBrake, slat, wingSweep, thrust, elevator,
rudder, aileron, landLight, beaconLight, strobeLight, navLight, lightPattern,
onGround);
setPlanesSurfaces(callsigns, gears, flaps, spoilers, speedBrakes, slats, wingSweeps, thrusts, elevators,
rudders, ailerons, landLights, beaconLights, strobeLights, navLights, lightPatterns,
onGrounds);
});
}
else if (message.getMethodName() == "setPlaneTransponder")

View File

@@ -95,14 +95,15 @@ namespace XSwiftBus
void removeAllPlanes();
//! Set the position of multiple traffic aircrafts
void setPlanePositions(const std::vector<std::string> &callsigns, std::vector<double> latitudes, std::vector<double> longitudes, std::vector<double> altitude,
std::vector<double> pitchs, std::vector<double> rolls, std::vector<double> headings);
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);
//! Set the flight control surfaces and lights of multiple traffic aircrafts
void setPlaneSurfaces(const std::vector<std::string> &callsign, const std::vector<double> &gear, const std::vector<double> &flap, const std::vector<double> &spoiler,
const std::vector<double> &speedBrake, const std::vector<double> &slat, const std::vector<double> &wingSweep, const std::vector<double> &thrust,
const std::vector<double> &elevator, const std::vector<double> &rudder, const std::vector<double> &aileron, const std::vector<bool> &landLight,
const std::vector<bool> &beaconLight, const std::vector<bool> &strobeLight, const std::vector<bool> &navLight, const std::vector<int> &lightPattern, const std::vector<bool> &onGround);
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);
//! Set the transponder of a traffic aircraft
void setPlaneTransponder(const std::string &callsign, int code, bool modeC, bool ident);