Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AIRMET/SIGMET level parsing #177

Open
kasarit opened this issue Sep 28, 2023 · 0 comments
Open

Fix AIRMET/SIGMET level parsing #177

kasarit opened this issue Sep 28, 2023 · 0 comments
Labels
bug sigmet/airmet SIGMET/AIRMET issues

Comments

@kasarit
Copy link
Contributor

kasarit commented Sep 28, 2023

Currently parsing the following TAC does not work correctly:

EHAA AIRMET 1 VALID 281430/281530 EHDB-
EHAA AMSTERDAM FIR FRQ TCU OBS ENTIRE FIR FL100 STNR NC=

SigmetLevel uses the following branch to set the values:

regex="^(?<sfc>SFC)?/?(?<unit2>FL)(?<level2>[0-9]{3})$";
    m = Pattern.compile(regex).matcher(toMatch);
    if (m.matches()){
        token.identify(SIGMET_LEVEL);
        token.setParsedValue(LEVEL_MODIFIER, null);
        token.setParsedValue(VALUE, m.group("sfc"));
        token.setParsedValue(UNIT, m.group("sfc"));
        token.setParsedValue(VALUE2, m.group("level2"));
        token.setParsedValue(UNIT2, m.group("unit2"));
    }

where VALUE2 and UNIT2 have the relevant values.

Then in AIRMETTACParserBase (and probably SIGMETTACParserBase) the values are fetched like this:

String upperLimit = match.getParsedValue(VALUE2, String.class);
String upperUnit = match.getParsedValue(UNIT2, String.class);

.. when the value should actually be handled as a lowerLimit. Currently the correct branch is never hit.

@kasarit kasarit added bug sigmet/airmet SIGMET/AIRMET issues labels Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sigmet/airmet SIGMET/AIRMET issues
Projects
None yet
Development

No branches or pull requests

1 participant