mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Define precipitation rate default unit to mm/h
There was a misalignment in precipitation rate units across the code. GFS values are in kg m-2 s-1 which is equal to mm/s, but the default unit seems to be mm/h in many weather documents.
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f75a9ac476
commit
2616f94f2d
@@ -35,7 +35,7 @@ namespace BlackGui
|
||||
if (dataCVariant.canConvert<double>())
|
||||
{
|
||||
double rate = dataCVariant.value<double>();
|
||||
QString formattedString = QString::number(rate) + " mm/s";
|
||||
QString formattedString = QString::number(rate) + " mm/h";
|
||||
return formattedString;
|
||||
}
|
||||
Q_ASSERT_X(false, "CPrecipitationRateFormatter", "no double value");
|
||||
|
||||
@@ -102,10 +102,10 @@ namespace BlackMisc
|
||||
//! Get layer top
|
||||
BlackMisc::Aviation::CAltitude getTop() const { return m_top; }
|
||||
|
||||
//! Set precipitation rate
|
||||
//! Set precipitation rate in mm/h
|
||||
void setPrecipitationRate(double rate) { m_precipitationRate = rate; }
|
||||
|
||||
//! Get precipitation rate
|
||||
//! Get precipitation rate in mm/h
|
||||
double getPrecipitationRate() const { return m_precipitationRate; }
|
||||
|
||||
//! Set precipitation
|
||||
@@ -144,7 +144,7 @@ namespace BlackMisc
|
||||
private:
|
||||
BlackMisc::Aviation::CAltitude m_base;
|
||||
BlackMisc::Aviation::CAltitude m_top;
|
||||
double m_precipitationRate = 0;
|
||||
double m_precipitationRate = 0; //!< Unit mm/h
|
||||
Precipitation m_precipitation = NoPrecipitation;
|
||||
Clouds m_clouds = NoClouds;
|
||||
int m_coveragePercent;
|
||||
|
||||
@@ -297,7 +297,10 @@ namespace BlackWxPlugin
|
||||
cloudLayer.setCoveragePercent(cloudLayerIt.value().totalCoverage);
|
||||
if (gfsGridPoint.surfaceSnow > 0.0) { cloudLayer.setPrecipitation(CCloudLayer::Snow); }
|
||||
if (gfsGridPoint.surfaceRain > 0.0) { cloudLayer.setPrecipitation(CCloudLayer::Rain); }
|
||||
cloudLayer.setPrecipitationRate(gfsGridPoint.surfacePrecipitationRate);
|
||||
|
||||
// Precipitation rate is in kg m-2 s-1, which is equal to mm/s
|
||||
// Multiply with 3600 to convert to mm/h
|
||||
cloudLayer.setPrecipitationRate(gfsGridPoint.surfacePrecipitationRate * 3600.0);
|
||||
cloudLayer.setClouds(CCloudLayer::CloudsUnknown);
|
||||
cloudLayers.insert(cloudLayer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user