8 using namespace swift::misc::aviation;
12 namespace swift::misc::weather
22 : m_base(base), m_top(top), m_precipitationRate(precipitationRate), m_precipitation(precipitation),
32 if (m_coveragePercent > 85) {
return Overcast; }
33 if (m_coveragePercent > 60 && m_coveragePercent <= 85) {
return Broken; }
34 if (m_coveragePercent > 30 && m_coveragePercent <= 60) {
return Scattered; }
35 if (m_coveragePercent > 10 && m_coveragePercent <= 30) {
return Few; }
41 if (index.
isMyself()) {
return QVariant::fromValue(*
this); }
44 case IndexBase:
return QVariant::fromValue(m_base);
45 case IndexTop:
return QVariant::fromValue(m_top);
46 case IndexPrecipitationRate:
return QVariant::fromValue(m_precipitationRate);
47 case IndexPrecipitation:
return QVariant::fromValue(m_precipitation);
48 case IndexClouds:
return QVariant::fromValue(m_clouds);
49 case IndexCoveragePercent:
return QVariant::fromValue(m_coveragePercent);
76 { None,
"" }, { Few,
"few" }, { Scattered,
"scattered" }, { Broken,
"broken" }, { Overcast,
"overcast" }
Non-owning reference to a CPropertyIndex with a subset of its features.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
Altitude as used in aviation, can be AGL or MSL altitude.
ColumnIndex
Base class enums.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
QString toQString(bool i18n=false) const
Cast as QString.
Value object for a cloud layer.
Precipitation
Precipitation Type.
void setBase(const misc::aviation::CAltitude &base)
Set base.
QString convertToQString(bool i18n=false) const
Cast as QString.
CCloudLayer()=default
Default constructor.
void setCoverage(Coverage coverage)
Set coverage.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
Coverage getCoverage() const
Get coverage.
void setPrecipitationRate(double rate)
Set precipitation rate in mm/h.
void setClouds(Clouds type)
Set cloud type.
void setCoveragePercent(int coverage)
Set coverage in %.
void setPrecipitation(Precipitation type)
Set precipitation.
void setTop(const misc::aviation::CAltitude &top)
Set layer top.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.