Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Changes to the Airport App (airport display, search options, prefer ICAO over id)#225

Open
sfrsfrsfr wants to merge 27 commits intofpw:masterfrom
sfrsfrsfr:findAirport
Open

Changes to the Airport App (airport display, search options, prefer ICAO over id)#225
sfrsfrsfr wants to merge 27 commits intofpw:masterfrom
sfrsfrsfr:findAirport

Conversation

@sfrsfrsfr
Copy link

@sfrsfrsfr sfrsfrsfr commented Jul 30, 2025

This PR includes various changes to the Airport App.
The ICAO,FAA and Local codes are added to the airport data and the apt.dat based AirportLoader.
The ICAO code will be used for loading Charts & METAR (fallback to id if ICAO is unset).
Search results will display either ICAO, FAA, Local or id (in this order, see getDisplayID).
The airport information has been reformatted, showing the field name, code, elevation, distance & course to user aircraft in the window caption.
Threshold elevation has been removed and 'Recorded Messages' shortened with ATIS instead.

AirportApp_EDDH

The airport search has been reworked. findAirport will now search ICAO, FAA, Local, id and the airport name.
Also it will return up to 50 matches (MAX_SEARCH_RESULTS) whereas the GUI will only display 10 (MAX_DISPLAY_RESULTS).
The reason is that search results are now optionally sorted (by distance to user aircraft) and in ascending/descending order. After sorting the 50 results only the most relevant 10 will be shown. The sort options have also been added to the preferences file.
By default sorting in ascending order (nearest match first) is enabled.

A new method findAirportByCode has been added that could replace findAirportByID in the future (not used currently)
Without working Charts functionality this has not been looked into.
A dummy findAirportByCode (copy of findAirportByID) method has been added to the SqlWorld.

I did not look at the SQL code at all but assume the SQL based NavWorld needs to be updated to include the ICAO, FAA and Local codes and a working implementation of findAirportByCode.

This PR should fix #208 (at least partially)

With the last changes the Helipad size is also loaded. ATC/Runway/Helipad info will be shown only if the data exists (no more lone 'ATC frequencies:' line).

All length data is displayed in ft to follow current practice (like in the Overlay too). A 'unit' setting could possibly be added in the future.

sfrsfrsfr added 19 commits July 8, 2025 09:58
this fixes fpw#208 (RPLK - Bicol Intl) and improves Charts search (id is icao)

change airports from std::map to std::multimap as id is not guaranteed
to be unique
findAirport now using airports.equal_range
findAirportByID remains unchanged
set/get FAA/ICAO/Local Code added to models/airport/Airport.cpp
keyWord <= 4 -> findAirportByCode
keyWord > 4 || res < MAX -> findAirportByName
add dummy method to SqlWorld
(findAirportByCode is needed to improve/fix NearestAirport search but requires other changes in the findAirport branch)
with a max of 10 a nearby airport may not be found
@mjh65
Copy link
Collaborator

mjh65 commented Jul 30, 2025

The SQL variant of the NAV database is not (currently) used with the Xplane version of Avitab. It is used by the experimental/prototype version used with MSFS, and the code for this is in my Avitab fork and has not yet been submitted to this repo for merge.

I will make whatever updates are required to the SQL subsystem (and the MSFS use of this) once this PR has been adopted.

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.

AviTab incorrectly uses ID instead of ICAO code

2 participants