PlayeRom / flightgear-addon-logbook

FlightGear add-on for logbook all your flights to CSV file
GNU General Public License v3.0
7 stars 3 forks source link

Modified getStartAirport() for multi-legs flights #6

Closed ppizzo closed 6 months ago

ppizzo commented 6 months ago

If you're travelling to multiple destinations in the same FlightGear session the current implementation uses as starting airport always the one available when FlightGear started.

For example, for the following flight plan:

instead of having the following codes in the log file:

PHNL,KSFO
KSFO,KONT
KONT,KLAS

the current implementation reports the following:

PHNL,KSFO
PHNL,KONT
PHNL,KLAS

With the proposed pull request the getStartAirport() function grabs the airport from current location first, falling back to the first airport if it does not succeed. In this way if you land to an airport and depart in a few minutes without exiting FlightGear, the from field t is set with the airport you just departed from.

ppizzo commented 6 months ago

Many thanks for the merge and many thanks for this wonderful add-on, very much appreciated and well developed!