mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 07:35:53 +08:00
@@ -22,8 +22,20 @@ namespace BlackMisc
|
|||||||
namespace Weather
|
namespace Weather
|
||||||
{
|
{
|
||||||
|
|
||||||
CCloudLayer::CCloudLayer(CAltitude ceiling, Coverage coverage) :
|
CCloudLayer::CCloudLayer(BlackMisc::Aviation::CAltitude base,
|
||||||
m_ceiling(ceiling), m_coverage(coverage)
|
BlackMisc::Aviation::CAltitude ceiling,
|
||||||
|
Coverage coverage) :
|
||||||
|
m_ceiling(ceiling), m_base(base), m_coverage(coverage)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
CCloudLayer::CCloudLayer(BlackMisc::Aviation::CAltitude base,
|
||||||
|
BlackMisc::Aviation::CAltitude ceiling,
|
||||||
|
int precipitationRate,
|
||||||
|
Precipitation precipitation,
|
||||||
|
Clouds clouds,
|
||||||
|
Coverage coverage) :
|
||||||
|
m_ceiling(ceiling), m_base(base), m_precipitationRate(precipitationRate),
|
||||||
|
m_precipitation(precipitation), m_clouds(clouds), m_coverage(coverage)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
CVariant CCloudLayer::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
CVariant CCloudLayer::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||||
|
|||||||
@@ -38,6 +38,24 @@ namespace BlackMisc
|
|||||||
Overcast
|
Overcast
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Cloud type
|
||||||
|
enum Clouds
|
||||||
|
{
|
||||||
|
NoClouds,
|
||||||
|
Cirrus,
|
||||||
|
Stratus,
|
||||||
|
Cumulus,
|
||||||
|
Thunderstorm
|
||||||
|
};
|
||||||
|
|
||||||
|
//! Precipitation Type
|
||||||
|
enum Precipitation
|
||||||
|
{
|
||||||
|
NoPrecipitation,
|
||||||
|
Rain,
|
||||||
|
Snow
|
||||||
|
};
|
||||||
|
|
||||||
//! Properties by index
|
//! Properties by index
|
||||||
enum ColumnIndex
|
enum ColumnIndex
|
||||||
{
|
{
|
||||||
@@ -50,7 +68,17 @@ namespace BlackMisc
|
|||||||
CCloudLayer() = default;
|
CCloudLayer() = default;
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CCloudLayer(BlackMisc::Aviation::CAltitude ceiling, Coverage coverage);
|
CCloudLayer(BlackMisc::Aviation::CAltitude base,
|
||||||
|
BlackMisc::Aviation::CAltitude ceiling,
|
||||||
|
Coverage coverage);
|
||||||
|
|
||||||
|
//! Constructor
|
||||||
|
CCloudLayer(BlackMisc::Aviation::CAltitude base,
|
||||||
|
BlackMisc::Aviation::CAltitude ceiling,
|
||||||
|
int precipitationRate,
|
||||||
|
Precipitation precipitation,
|
||||||
|
Clouds clouds,
|
||||||
|
Coverage coverage);
|
||||||
|
|
||||||
//! Set base
|
//! Set base
|
||||||
void setBase(const BlackMisc::Aviation::CAltitude &base) { m_base = base; }
|
void setBase(const BlackMisc::Aviation::CAltitude &base) { m_base = base; }
|
||||||
@@ -64,6 +92,24 @@ namespace BlackMisc
|
|||||||
//! Get ceiling
|
//! Get ceiling
|
||||||
BlackMisc::Aviation::CAltitude getCeiling() const { return m_ceiling; }
|
BlackMisc::Aviation::CAltitude getCeiling() const { return m_ceiling; }
|
||||||
|
|
||||||
|
//! Set precipitation rate
|
||||||
|
void setPrecipitationRate(int rate) { m_precipitationRate = rate; }
|
||||||
|
|
||||||
|
//! Get precipitation rate
|
||||||
|
int getPrecipitationRate() const { return m_precipitationRate; }
|
||||||
|
|
||||||
|
//! Set precipitation
|
||||||
|
void setPrecipitation(Precipitation type) { m_precipitation = type; }
|
||||||
|
|
||||||
|
//! Get precipitation
|
||||||
|
Precipitation getPrecipitation() const { return m_precipitation; }
|
||||||
|
|
||||||
|
//! Set cloud type
|
||||||
|
void setClouds(Clouds type) { m_clouds = type; }
|
||||||
|
|
||||||
|
//! Get cloud type
|
||||||
|
Clouds getClouds() const { return m_clouds; }
|
||||||
|
|
||||||
//! Set coverage
|
//! Set coverage
|
||||||
void setCoverage(Coverage coverage) { m_coverage = coverage; }
|
void setCoverage(Coverage coverage) { m_coverage = coverage; }
|
||||||
|
|
||||||
@@ -89,6 +135,9 @@ namespace BlackMisc
|
|||||||
BLACK_ENABLE_TUPLE_CONVERSION(CCloudLayer)
|
BLACK_ENABLE_TUPLE_CONVERSION(CCloudLayer)
|
||||||
BlackMisc::Aviation::CAltitude m_base;
|
BlackMisc::Aviation::CAltitude m_base;
|
||||||
BlackMisc::Aviation::CAltitude m_ceiling;
|
BlackMisc::Aviation::CAltitude m_ceiling;
|
||||||
|
int m_precipitationRate = 0;
|
||||||
|
Precipitation m_precipitation = NoPrecipitation;
|
||||||
|
Clouds m_clouds = NoClouds;
|
||||||
Coverage m_coverage;
|
Coverage m_coverage;
|
||||||
int m_coveragePercent;
|
int m_coveragePercent;
|
||||||
};
|
};
|
||||||
@@ -98,8 +147,13 @@ namespace BlackMisc
|
|||||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CCloudLayer)
|
Q_DECLARE_METATYPE(BlackMisc::Weather::CCloudLayer)
|
||||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CCloudLayer::Coverage)
|
Q_DECLARE_METATYPE(BlackMisc::Weather::CCloudLayer::Coverage)
|
||||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CCloudLayer, (
|
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CCloudLayer, (
|
||||||
attr(o.m_ceiling),
|
attr(o.m_base),
|
||||||
attr(o.m_coverage)
|
attr(o.m_ceiling),
|
||||||
|
attr(o.m_precipitationRate),
|
||||||
|
attr(o.m_precipitation),
|
||||||
|
attr(o.m_clouds),
|
||||||
|
attr(o.m_coverage),
|
||||||
|
attr(o.m_coveragePercent)
|
||||||
))
|
))
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -590,7 +590,7 @@ namespace BlackMisc
|
|||||||
ceiling *= 100;
|
ceiling *= 100;
|
||||||
if (!ok) return false;
|
if (!ok) return false;
|
||||||
|
|
||||||
CCloudLayer cloudLayer(CAltitude(ceiling, CAltitude::AboveGround, CLengthUnit::ft()), getCoverage().value(coverageAsString));
|
CCloudLayer cloudLayer(CAltitude(ceiling, CAltitude::AboveGround, CLengthUnit::ft()), {}, getCoverage().value(coverageAsString));
|
||||||
metar.addCloudLayer(cloudLayer);
|
metar.addCloudLayer(cloudLayer);
|
||||||
QString cb_tcu = match.captured("cb_tcu");
|
QString cb_tcu = match.captured("cb_tcu");
|
||||||
if (!cb_tcu.isEmpty()) { }
|
if (!cb_tcu.isEmpty()) { }
|
||||||
|
|||||||
Reference in New Issue
Block a user