Giter VIP home page Giter VIP logo

metaf's People

Contributors

nnaumenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

metaf's Issues

Not recognised by the parser: AO2A ...

Are you interested in issues about missing parsing logic?

This METAR has a few examples of things that are not currently parsed:

Parsing report: PHHI 262356Z 29009KT 4SM -SHRA BR VCTS FEW005 BKN016 OVC020CB 25/24 A2989 RMK AO2A DZE2259RAB2259E16DZB16E22RAB37 TS 7E MOV NE CIG 016V020 SLP111 P0007 60007 T02470238 10295 20243 57016 $
Detected report type: METAR
21 groups parsed
ICAO location: PHHI
Report Release Time: 262356Z
Wind: 29009KT
Visibility: 4SM
Weather Phenomena: -SHRA
Weather Phenomena: BR
Weather Phenomena: VCTS
Cloud Data: FEW005
Cloud Data: BKN016
Cloud Data: OVC020CB
Temperature and Dew Point: 25/24
Pressure: A2989
Fixed Text: RMK
Not recognised by the parser: AO2A DZE2259RAB2259E16DZB16E22RAB37 TS 7E MOV NE CIG 016V020
Pressure: SLP111
Precipitation: P0007
Precipitation: 60007
Temperature and Dew Point: T02470238
Minimum/Maximum Temperature: 10295 20243
Pressure Tendency: 57016
Fixed Text: $

Some of those unparsed elements should be something similar to the following fragment (from mdsplib):

auto_indicator AO2A {recent_weather RA begin_seconds 2242740 end_seconds 2160960} {recent_weather DZ begin_seconds 2160960 end_seconds 2161320}} ceiling_variable_min_ft 16 ceiling_variable_max_ft 20 sea_level_pressure_hectopascals 1011.0999755859375 precip_hourly_inches 0.07000000029802322 precip_3_6_hour_inches 0.07000000029802322 temperature_max_celsius 29.5 temperature_min_celsius 24.299999237060547 char_pressure_tendency 7 pressure_tendency_hectopascals 1.600000023841858

Compilation issue on newer system -- Include missing

Dear Nico,

thanks again for this wonderful piece of software!

I have an issue with compilation, though. On newer systems (Fedora 36, or the latest flatpak sdk) the code does not compile anymore because and include is missing. The code does compile again if I add the following line (either to metaf.hpp or to my code before incluing metaf.hpp)

#include <cstring>

I would be great if you could add the line to metaf.hpp, in order to avoid these issues.

Best wishes from the Black Forest,

Stefan.

TrendGroup does not set Type::FROM when parsing "FM"

Opening as a separate issue... Here's another case I found:

YBBN 132300Z 22007KT 9999 FEW020 26/21 Q1006 FM0200 12008KT 9999 SCT030

That gets called with:

CloudGroup FEW020
TrendGroup Type::NONE, FM0200
CloudGroup SCT030

I think the TrendGroup should have been called with Type::FROM instead? Do you agree?

Perhaps this block needs to set result.t = Type::FROM;

result.tFrom = time;

Originally posted by @bovine in #1 (comment)

Here's a condensed program for the above test case:

#include <stdio.h>
#include "metaf.hpp"

using namespace std;
using namespace metaf;

int main(int argc, char *argv[])
{
	class MyVisitor : public Visitor<int> {
	public:

	private:
		virtual int visitFixedGroup(const FixedGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitLocationGroup(const LocationGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitReportTimeGroup(const ReportTimeGroup & group, ReportPart reportPart, const string & rawString) { return 0; }

		virtual int visitTrendGroup(const TrendGroup & group, ReportPart reportPart, const string & rawString) {
			string typeStr;
			switch (group.type()) {
			case TrendGroup::Type::NONE: typeStr = "Type::NONE"; break;
			case TrendGroup::Type::NOSIG: typeStr = "Type::NOSIG"; break;
			case TrendGroup::Type::BECMG: typeStr = "Type::BECMG"; break;
			case TrendGroup::Type::TEMPO: typeStr = "Type::TEMPO"; break;
			case TrendGroup::Type::INTER: typeStr = "Type::INTER"; break;
			case TrendGroup::Type::FROM: typeStr = "Type::FROM"; break;
			case TrendGroup::Type::TIME_SPAN: typeStr = "Type::TIME_SPAN"; break;
			default: typeStr = "Unknown"; break;
			}
			printf("TrendGroup %s %s\n", typeStr.c_str(), rawString.c_str());
			return 0;
		}

		virtual int visitWindGroup(const WindGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitVisibilityGroup(const VisibilityGroup & group, ReportPart reportPart, const string & rawString) { return 0; }

		virtual int visitCloudGroup(const CloudGroup & group, ReportPart reportPart, const string & rawString) {
			printf("CloudGroup %s\n", rawString.c_str());
			return 0;
		}

		virtual int visitWeatherGroup(const WeatherGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitTemperatureGroup(const TemperatureGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitTemperatureForecastGroup(const TemperatureForecastGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitPressureGroup(const PressureGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitRunwayVisualRangeGroup(const RunwayVisualRangeGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitRunwayStateGroup(const RunwayStateGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitSecondaryLocationGroup(const SecondaryLocationGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitRainfallGroup(const RainfallGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitSeaSurfaceGroup(const SeaSurfaceGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitColourCodeGroup(const ColourCodeGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitMinMaxTemperatureGroup(const MinMaxTemperatureGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitPrecipitationGroup(const PrecipitationGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitLayerForecastGroup(const LayerForecastGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitPressureTendencyGroup(const PressureTendencyGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitCloudTypesGroup(const CloudTypesGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitCloudLayersGroup(const CloudLayersGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitLightningGroup(const LightningGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitVicinityGroup(const VicinityGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitMiscGroup(const MiscGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
		virtual int visitUnknownGroup(const UnknownGroup & group, ReportPart reportPart, const string & rawString) { return 0; }
	};


	ParseResult parsed;
	parsed = Parser::parse("YBBN 132300Z 22007KT 9999 FEW020 26/21 Q1006 FM0200 12008KT 9999 SCT030");

	MyVisitor visitor;
	for (const auto groupInfo : parsed.groups) {
		visitor.visit(groupInfo);
	}

	return 0;
}

Originally posted by @bovine in #1 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.