49class Decoder :
private metaf::Visitor<QString>
57 explicit Decoder(
const QString& rawText,
const QDate& referenceDate);
59 virtual ~Decoder() =
default;
77 if (m_currentWeather.isEmpty())
81 return m_currentWeather;
102 return (m_parseResult.reportMetadata.error == metaf::ReportError::NONE);
110 static QString explainCloudType(
const metaf::CloudType &ct);
111 static QString explainDirection(metaf::Direction direction,
bool trueCardinalDirections=
true);
112 static QString explainDirectionSector(
const std::vector<metaf::Direction>& dir);
113 QString explainDistance(metaf::Distance distance);
114 static QString explainDistance_FT(metaf::Distance distance);
115 QString explainMetafTime(metaf::MetafTime metafTime);
116 static QString explainPrecipitation(metaf::Precipitation precipitation);
117 static QString explainPressure(metaf::Pressure pressure);
118 static QString explainRunway(metaf::Runway runway);
119 QString explainSpeed(metaf::Speed speed);
120 static QString explainSurfaceFriction(metaf::SurfaceFriction surfaceFriction);
121 static QString explainTemperature(metaf::Temperature temperature);
122 static QString explainWaveHeight(metaf::WaveHeight waveHeight);
123 QString explainWeatherPhenomena(
const metaf::WeatherPhenomena& wp);
126 static QString brakingActionToString(metaf::SurfaceFriction::BrakingAction brakingAction);
127 static QString cardinalDirectionToString(metaf::Direction::Cardinal cardinal);
128 static QString cloudAmountToString(metaf::CloudGroup::Amount amount);
129 static QString cloudHighLayerToString(metaf::LowMidHighCloudGroup::HighLayer highLayer);
130 static QString cloudLowLayerToString(metaf::LowMidHighCloudGroup::LowLayer lowLayer);
131 static QString cloudMidLayerToString(metaf::LowMidHighCloudGroup::MidLayer midLayer);
132 static QString cloudTypeToString(metaf::CloudType::Type type);
133 static QString convectiveTypeToString(metaf::CloudGroup::ConvectiveType type);
134 static QString distanceMilesFractionToString(metaf::Distance::MilesFraction f);
135 static QString distanceUnitToString(metaf::Distance::Unit unit);
136 static QString layerForecastGroupTypeToString(metaf::LayerForecastGroup::Type type);
137 static QString pressureTendencyTrendToString(metaf::PressureTendencyGroup::Trend trend);
138 static QString pressureTendencyTypeToString(metaf::PressureTendencyGroup::Type type);
139 static QString probabilityToString(metaf::TrendGroup::Probability prob);
140 static QString runwayStateDepositsToString(metaf::RunwayStateGroup::Deposits deposits);
141 static QString runwayStateExtentToString(metaf::RunwayStateGroup::Extent extent);
142 static QString specialWeatherPhenomenaToString(
const metaf::WeatherPhenomena& wp);
143 static QString stateOfSeaSurfaceToString(metaf::WaveHeight::StateOfSurface stateOfSurface);
144 static QString visTrendToString(metaf::VisibilityGroup::Trend trend);
145 static QString weatherPhenomenaDescriptorToString(metaf::WeatherPhenomena::Descriptor descriptor);
146 static QString weatherPhenomenaQualifierToString(metaf::WeatherPhenomena::Qualifier qualifier);
147 static QString weatherPhenomenaWeatherToString(metaf::WeatherPhenomena::Weather weather);
150 QString visitCloudGroup(
const CloudGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
151 QString visitCloudTypesGroup(
const CloudTypesGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
152 QString visitKeywordGroup(
const KeywordGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
153 QString visitLayerForecastGroup(
const LayerForecastGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
154 QString visitLightningGroup(
const LightningGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
155 QString visitLocationGroup(
const LocationGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
156 QString visitLowMidHighCloudGroup(
const LowMidHighCloudGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
157 QString visitMinMaxTemperatureGroup(
const MinMaxTemperatureGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
158 QString visitMiscGroup(
const MiscGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
159 QString visitPressureGroup(
const PressureGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
160 QString visitPressureTendencyGroup(
const PressureTendencyGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
161 QString visitReportTimeGroup(
const ReportTimeGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
162 QString visitPrecipitationGroup(
const PrecipitationGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
163 QString visitRunwayStateGroup(
const RunwayStateGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
164 QString visitSeaSurfaceGroup(
const SeaSurfaceGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
165 QString visitTemperatureGroup(
const TemperatureGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
166 QString visitTrendGroup(
const TrendGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
167 QString visitUnknownGroup(
const UnknownGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
168 QString visitVicinityGroup(
const VicinityGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
169 QString visitVisibilityGroup(
const VisibilityGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
170 QString visitWeatherGroup(
const WeatherGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
171 QString visitWindGroup(
const WindGroup& group, ReportPart reportPart,
const std::string& rawString)
override;
178 QDateTime m_currentTime;
181 QString m_currentWeather;
184 QDate m_referenceDate;
187 ParseResult m_parseResult;