We have now completed all the functionality needed to generate a flight plan. For ease of use, we can add a simple user interface (UI). I decided to create a command line interface (CLI) so I can run through tool through a terminal window.
If you are wondering why I made a command line interface instead of a graphic user interface: it was a purely subjective decision. I like the 1980s console vibe. Have a look at this flight deck instrumentation from the Space Shuttle:
The terminal will first print a main menu:
The first function prints out an airport report. For example, for CYOW we will get this printout:
Remember that this data is an exact match of what we will encounter in the simulator. Following this basic information we get a printout of nearby waypoints:
And finally, a map printout. Only enroute waypoints are shown on the map.
Menu option 2 runs a quick estimate between two airports; if we input EHAM to LSZA, we will get:
This option runs the full compute; we will show examples in the next sections.
The last four menu options just print out reference information. For example, here is the shutdown checklist, taken from the X-Plane 11 manual for the default 737-800 model:
All the functionality developed in the previous chapter is packaged into .py files called modules. Then, one final module is created which runs the user interface. Inside this module, there is a simple loop which runs the various user interface menus shown in the above images, and then orchestrates the various functions from the other modules based on what choices the user makes. The cli module can "access" all the functions from the other modules by using import statements.
Here is the simple structure of the tool:
Note that the term xflip in the module names is short for X-Plane Flight Planner.
In the next chapter we will show three example flight plans.