9 using namespace swift::misc::physical_quantities;
10 using namespace swift::misc::aviation;
14 namespace swift::misc::weather
19 : m_level(level), m_directionMain(direction), m_speed(speed), m_gustSpeed(gustSpeed)
24 if (index.
isMyself()) {
return QVariant::fromValue(*
this); }
28 case IndexLevel:
return QVariant::fromValue(m_level);
29 case IndexDirection:
return QVariant::fromValue(m_directionMain);
30 case IndexDirectionVariable:
return QVariant::fromValue(m_directionVariable);
31 case IndexSpeed:
return QVariant::fromValue(m_speed);
32 case IndexGustSpeed:
return QVariant::fromValue(m_gustSpeed);
58 QString windAsString = QString(
"Wind: ");
59 if (m_directionVariable)
60 windAsString +=
"variable ";
62 windAsString += QStringLiteral(
"%1 ").arg(m_directionMain.
toQString());
64 if (m_directionFrom !=
CAngle() && m_directionTo !=
CAngle())
66 windAsString += QStringLiteral(
"variable between %1 and %2 ")
70 windAsString += QStringLiteral(
"at %2").arg(m_speed.
toQString());
71 if (m_gustSpeed.
value() > 0.5) windAsString += QStringLiteral(
" and gusts at %1").arg(m_gustSpeed.
toQString());
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.
Physical unit angle (radians, degrees)
double value(MU unit) const
Value in given unit.
Value object for a wind layer.
void setDirection(const physical_quantities::CAngle &main)
Set direction.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
void setGustSpeed(const physical_quantities::CSpeed &gustSpeed)
Set gust speed.
QString convertToQString(bool i18n=false) const
Cast as QString.
void setDirectionVariable(bool variable=true)
Set direction to variable.
void setLevel(const swift::misc::aviation::CAltitude &level)
Set level.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
void setSpeed(const physical_quantities::CSpeed &speed)
Set speed.
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.