Remove per-ext IGC specific logic from KML writer - #1183
Draft
PacketFiend wants to merge 1 commit into
Draft
Conversation
PacketFiend
marked this pull request as draft
September 19, 2023 21:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_tstruct, which is populated in igc.h. The thinking there is thatigc_mt_field_tis 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
kIncludeIGCSIUandkIncludeIGCTRThave 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.