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

Remove per-ext IGC specific logic from KML writer #1183

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PacketFiend
Copy link
Contributor

@PacketFiend PacketFiend commented Sep 19, 2023

This removes quite a bit of IGC specific code from kml.h and kml.cc, including most data structure definitions and most loops/if ladders/switch blocks that iterate over IGC data structures by name, and replaces those with much more generic logic. It places all this in igc.h and igc.cc. There's two edge cases (overriding wpt->temperature and wpt->sat) that kml.cc still has logic for.

kml.h defines a igc_mt_field_t struct, which is populated in igc.h. The thinking there is that igc_mt_field_t is useful only to the KML writer, however the IGC parts should be defining the metadata. igc_wp_field, for example, may be useful to CSV or GeoJSON writers, so should be defined in igc.h rather than kml.h.

Note that this will currently fail tests. That's because the tests for kIncludeIGCSIU and kIncludeIGCTRT have been removed. #1180 resolves this by replacing those with default options. #1180 should be merged before this PR. After rebasing, this should pass tests.

Of course, there may be far better ways to achieve this, but this works, and I think y'all get the idea of what I'm trying to do here.

Marking as draft is it can't be merged before #1180 and is failing tests.

@PacketFiend PacketFiend marked this pull request as draft September 19, 2023 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant