12using namespace swift::misc::physical_quantities;
13using namespace swift::misc::aviation;
17namespace swift::misc::weather
31 m_reportDay = reportDay;
32 m_reportTime = reportTime;
40 m_presentWeathers.clear();
41 m_cloudLayers.clear();
52 m_presentWeathers.push_back(presentWeather);
68 for (
const auto &presentWeather : m_presentWeathers)
70 if (!presentWeathers.
isEmpty()) presentWeathers +=
",";
71 presentWeathers += u
' ' % presentWeather.toQString();
75 for (
const auto &layer : m_cloudLayers)
77 if (!clouds.
isEmpty()) clouds +=
",";
78 clouds += u
' ' % layer.toQString();
81 const QString metarDescription =
82 QStringLiteral(
"Station: %1 \n").
arg(m_airport.getIcaoCode()) %
83 QStringLiteral(
"Date/Time: %1 %2 UTC\n").
arg(m_reportDay).
arg(m_reportTime.formattedHrsMin()) %
84 m_windLayer.toQString() % u
'\n' % QStringLiteral(
"Visibility: %1\n").
arg(m_visibility.toQString()) %
85 u
"Weather: " % presentWeathers.
simplified() % u
'\n' % u
"Clouds:" % clouds % u
'\n' %
86 QStringLiteral(
"Temperature: %1\n").
arg(m_temperature.toQString()) %
87 QStringLiteral(
"Dewpoint: %1\n").
arg(m_dewPoint.toQString()) %
88 QStringLiteral(
"Altimeter: %1\n").
arg(m_altimeter.toQString());
90 return metarDescription;
96 QString s(m_airport.getIcaoCode());
Value object encapsulating information of airport ICAO data.
Physical unit length (length).
static CLengthUnit km()
Kilometer km.
Physical unit temperature.
Value object for a cloud layer.
Value object for present weather flags.
Value object for a wind layer.
QString arg(Args &&... args) const const
bool isEmpty() const const
QString simplified() const const
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.