mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Use double in xbus DBus API instead of float
float is not supported by DBus and all slots fail to be registered if they have float arguments.
This commit is contained in:
@@ -32,7 +32,7 @@ namespace BlackSimPlugin
|
||||
m_dbusInterface->callDBus(QLatin1String("setUseRealWeather"), enable);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setVisibility(float visibilityM)
|
||||
void CXBusWeatherProxy::setVisibility(double visibilityM)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setVisibility"), visibilityM);
|
||||
}
|
||||
@@ -47,22 +47,22 @@ namespace BlackSimPlugin
|
||||
m_dbusInterface->callDBus(QLatin1String("setDewPoint"), degreesC);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setQNH(float inHg)
|
||||
void CXBusWeatherProxy::setQNH(double inHg)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setQNH"), inHg);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setPrecipitationRatio(float precipRatio)
|
||||
void CXBusWeatherProxy::setPrecipitationRatio(double precipRatio)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setPrecipitationRatio"), precipRatio);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setThunderstormRatio(float cbRatio)
|
||||
void CXBusWeatherProxy::setThunderstormRatio(double cbRatio)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setThunderstormRatio"), cbRatio);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setTurbulenceRatio(float turbulenceRatio)
|
||||
void CXBusWeatherProxy::setTurbulenceRatio(double turbulenceRatio)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setTurbulenceRatio"), turbulenceRatio);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace BlackSimPlugin
|
||||
m_dbusInterface->callDBus(QLatin1String("setCloudLayer"), layer, base, tops, type, coverage);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setWindLayer(int layer, int altitude, float direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
void CXBusWeatherProxy::setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setWindLayer"), layer, altitude, direction, speed, shearDirection, shearSpeed, turbulence);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace BlackSimPlugin
|
||||
void setUseRealWeather(bool enable);
|
||||
|
||||
//! \copydoc XBus::CWeather::setVisibility
|
||||
void setVisibility(float visibilityM);
|
||||
void setVisibility(double visibilityM);
|
||||
|
||||
//! \copydoc XBus::CWeather::setTemperature
|
||||
void setTemperature(int degreesC);
|
||||
@@ -72,16 +72,16 @@ namespace BlackSimPlugin
|
||||
void setDewPoint(int degreesC);
|
||||
|
||||
//! \copydoc XBus::CWeather::setQNH
|
||||
void setQNH(float inHg);
|
||||
void setQNH(double inHg);
|
||||
|
||||
//! \copydoc XBus::CWeather::setPrecipitationRatio
|
||||
void setPrecipitationRatio(float precipRatio);
|
||||
void setPrecipitationRatio(double precipRatio);
|
||||
|
||||
//! \copydoc XBus::CWeather::setThunderstormRatio
|
||||
void setThunderstormRatio(float cbRatio);
|
||||
void setThunderstormRatio(double cbRatio);
|
||||
|
||||
//! \copydoc XBus::CWeather::setTurbulenceRatio
|
||||
void setTurbulenceRatio(float turbulenceRatio);
|
||||
void setTurbulenceRatio(double turbulenceRatio);
|
||||
|
||||
//! \copydoc XBus::CWeather::setRunwayFriction
|
||||
void setRunwayFriction(int friction);
|
||||
@@ -90,7 +90,7 @@ namespace BlackSimPlugin
|
||||
void setCloudLayer(int layer, int base, int tops, int type, int coverage);
|
||||
|
||||
//! \copydoc XBus::CWeather::setWindLayer
|
||||
void setWindLayer(int layer, int altitude, float direction, int speed, int shearDirection, int shearSpeed, int turbulence);
|
||||
void setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -194,9 +194,9 @@ namespace XBus
|
||||
g_maxPlanes = planes;
|
||||
}
|
||||
|
||||
void CTraffic::setMaxDrawDistance(float nauticalMiles)
|
||||
void CTraffic::setMaxDrawDistance(double nauticalMiles)
|
||||
{
|
||||
g_drawDistance = nauticalMiles;
|
||||
g_drawDistance = static_cast<float>(nauticalMiles);
|
||||
}
|
||||
|
||||
void CTraffic::addPlane(const QString &callsign, const QString &modelName, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace XBus
|
||||
void setMaxPlanes(int planes);
|
||||
|
||||
//! Set the maximum distance at which to draw aircraft (nautical miles).
|
||||
void setMaxDrawDistance(float nauticalMiles);
|
||||
void setMaxDrawDistance(double nauticalMiles);
|
||||
|
||||
//! Introduce a new traffic aircraft
|
||||
void addPlane(const QString &callsign, const QString &modelName, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery);
|
||||
|
||||
@@ -38,17 +38,17 @@ namespace XBus
|
||||
|
||||
//! Set wind layer
|
||||
template <class T>
|
||||
void setWindLayerImpl(T &layer, int altitude, float direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
void setWindLayerImpl(T &layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
{
|
||||
layer.altitude.set(altitude);
|
||||
layer.direction.set(direction);
|
||||
layer.direction.set(static_cast<float>(direction));
|
||||
layer.speed.set(speed);
|
||||
layer.shearDirection.set(shearDirection);
|
||||
layer.shearSpeed.set(shearSpeed);
|
||||
layer.turbulence.set(turbulence);
|
||||
}
|
||||
|
||||
void CWeather::setWindLayer(int layer, int altitude, float direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
void CWeather::setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
{
|
||||
switch (layer)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace XBus
|
||||
void setUseRealWeather(bool enable) { m_useRealWeather.set(enable ? 1 : 0); }
|
||||
|
||||
//! Set reported visibility in meters.
|
||||
void setVisibility(float visibilityM) { m_visibilityM.set(visibilityM); }
|
||||
void setVisibility(double visibilityM) { m_visibilityM.set(static_cast<float>(visibilityM)); }
|
||||
|
||||
//! Set temperature at sea level in degrees C.
|
||||
void setTemperature(int degreesC) { m_temperatureC.set(degreesC); }
|
||||
@@ -69,16 +69,16 @@ namespace XBus
|
||||
void setDewPoint(int degreesC) { m_dewPointC.set(degreesC); }
|
||||
|
||||
//! Set barometric pressure at sea level in inches of mercury.
|
||||
void setQNH(float inHg) { m_qnhInhg.set(inHg); }
|
||||
void setQNH(double inHg) { m_qnhInhg.set(static_cast<float>(inHg)); }
|
||||
|
||||
//! Set amount of precipitation between 0 and 1.
|
||||
void setPrecipitationRatio(float precipRatio) { m_precipRatio.set(precipRatio); }
|
||||
void setPrecipitationRatio(double precipRatio) { m_precipRatio.set(static_cast<float>(precipRatio)); }
|
||||
|
||||
//! Set amount of thunderstorms between 0 and 1.
|
||||
void setThunderstormRatio(float cbRatio) { m_cbRatio.set(cbRatio); }
|
||||
void setThunderstormRatio(double cbRatio) { m_cbRatio.set(static_cast<float>(cbRatio)); }
|
||||
|
||||
//! Set amount of turbulence between 0 and 1.
|
||||
void setTurbulenceRatio(float turbulenceRatio) { m_turbulenceRatio.set(turbulenceRatio); }
|
||||
void setTurbulenceRatio(double turbulenceRatio) { m_turbulenceRatio.set(static_cast<float>(turbulenceRatio)); }
|
||||
|
||||
//! Set runway friction, 0=dry, 1=damp, 2=wet.
|
||||
void setRunwayFriction(int friction) { m_runwayFriction.set(friction); }
|
||||
@@ -99,7 +99,7 @@ namespace XBus
|
||||
//! \param shearDirection Direction from which wind shears blow in degrees true.
|
||||
//! \param shearSpeed Wind speed gain in knots (e.g. speed=10 and shearSpeed=5 means speed varies between 10 and 15).
|
||||
//! \param turbulence Amount of turbulence [0,10].
|
||||
void setWindLayer(int layer, int altitude, float direction, int speed, int shearDirection, int shearSpeed, int turbulence);
|
||||
void setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence);
|
||||
|
||||
private:
|
||||
DataRef<xplane::data::sim::weather::use_real_weather_bool> m_useRealWeather;
|
||||
|
||||
Reference in New Issue
Block a user