Skip to content

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

Draft
PacketFiend wants to merge 1 commit into
GPSBabel:masterfrom
PacketFiend:autoigc
Draft

Remove per-ext IGC specific logic from KML writer#1183
PacketFiend wants to merge 1 commit into
GPSBabel:masterfrom
PacketFiend:autoigc

Conversation

@PacketFiend

@PacketFiend PacketFiend commented Sep 19, 2023

Copy link
Copy Markdown
Contributor

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