FFGo: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Add section “Installation tips” with Windows-specific instructions, plus stub sections for Linux and OS X)
(→‎Linux: Document installation from Florent's Debian packages (i.e., mine, for those who didn't follow ;-))
Line 181: Line 181:
==== Linux ====
==== Linux ====


This section will be completed later. In the meantime, you can consult the [https://github.com/frougon/FFGo/blob/master/docs/INSTALL/INSTALL_en Git version of the installation guide] for instance, or even better, then one coming with the particular FFGo version you want to install. Practical instructions, especially for [https://www.debian.org/ Debian] users, have also been given in [http://forum.flightgear.org/viewtopic.php?f=18&t=27054&start=90#p273972 this message on the FlightGear forum] and the following ones. This is basically what you'll find here when the section you are reading is completed.
This section will be completed later. In the meantime—except for installation instructions using Debian packages, which should already be complete—you can consult the [https://github.com/frougon/FFGo/blob/master/docs/INSTALL/INSTALL_en Git version of the installation guide] for instance, or even better, then one coming with the particular FFGo version you want to install. Practical instructions, especially for [https://www.debian.org/ Debian] users, have also been given in [http://forum.flightgear.org/viewtopic.php?f=18&t=27054&start=90#p273972 this message on the FlightGear forum] and the following ones. This is basically what you'll find here when the section you are reading is completed.
 
===== Using distribution packages =====
 
====== Debian ======
 
Debian packages for FFGo have been prepared by the FFGo upstream maintainer,
Florent Rougon. They can be downloaded and installed normally using
''apt-get'', ''aptitude'', etc. provided you have installed
[https://people.via.ecp.fr/~flo/OpenPGP-key.asc Florent's OpenPGP key].
 
<ul>
<li>'''First step: install Florent Rougon's OpenPGP key into the <tt>apt</tt> keyring'''
 
<p>There are two main ways to get the key:</p>
 
<ol style="list-style-type: lower-alpha"><li>The [https://www.gnupg.org/ GnuPG] way is:
 
<ol style="list-style-type: decimal"><li>Get the key from a key server (as
defined in your GnuPG configuration):
<syntaxhighlight lang="" enclose="div">
gpg2 --recv-keys C785B90B5053A3A2
gpg2 --list-keys --fingerprint C785B90B5053A3A2
</syntaxhighlight>
 
the output of which should show the [https://people.via.ecp.fr/~flo/keys.html correct fingerprint]:
 
<syntaxhighlight lang="" enclose="div">
pub  rsa4096/0xC785B90B5053A3A2 2010-03-17 [expires: 2016-10-19]
      Key fingerprint = 125B 5A0F DB78 8FDD 0EF4  1A9D C785 B90B 5053 A3A2
</syntaxhighlight>
 
Normally, in the OpenPGP model, you would get the fingerprint by a really secure
channel (e.g., meeting Florent in person) or you would rely on the <i>web of
trust</i> (trusting someone who trusts someone who... who trusts this key
actually belongs to Florent. The chain verification is automated by
<tt>gpg</tt>/<tt>gpg2</tt>—name of the main [https://www.gnupg.org/ GnuPG]
command—using digital signatures, done with each participant's key).
</li>
<li>Then, in order to have they key in a separate file, say <tt>~/tmp/flo-key</tt>, you can run:
 
<syntaxhighlight lang="" enclose="div">
gpg2 --export -o ~/tmp/flo-key C785B90B5053A3A2
</syntaxhighlight> (using <tt>~/tmp/flo-key</tt> to avoid symlink
attacks—using <tt>/tmp</tt> instead of <tt>~/tmp</tt> wouldn't be a great idea).</li></ol>
</li>
<li>The other way is getting [https://people.via.ecp.fr/~flo/OpenPGP-key.asc the key] via HTTPS from [https://people.via.ecp.fr/~flo/ Florent's home page] (it is linked from [https://people.via.ecp.fr/~flo/keys.html that page] on Florent's site). HTTPS uses TLS which is kind of
crap, but it is not worse than when you check your bank accounts online or
purchase something online, or download most programs without <tt>apt</tt>
(which relies on GnuPG, not HTTPS). In short, assuming you have the <tt>wget</tt> package installed, you can get the key with:
 
<syntaxhighlight lang="" enclose="div">
wget -O ~/tmp/flo-key https://people.via.ecp.fr/~flo/OpenPGP-key.asc
</syntaxhighlight></li>
Once you have that key in the file <tt>flo-key</tt>, you can install it for <tt>apt</tt> by running, <i>as root</i>:
 
<syntaxhighlight lang="" enclose="div">
apt-key add flo-key
</syntaxhighlight>
 
One could even combine the two operations into a single command (getting the key and installing it into <tt>apt</tt>'s keyring):
 
<syntaxhighlight lang="" enclose="div">
wget -O- https://people.via.ecp.fr/~flo/OpenPGP-key.asc | apt-key add -
</syntaxhighlight>
 
but this would have to be done as root, which I don't like much for <tt>wget</tt> (this can
be overcome by using <tt>ssh</tt>, maybe also with <tt>sudo</tt>, but it is
a bit out of scope here).
</ol>
</li>
<li>
'''Second step: add the relevant lines to your <tt>/etc/apt/sources.list</tt> file'''
 
<p>Add the following lines to your <tt>/etc/apt/sources.list</tt>:</p>
 
<pre>deb http://people.via.ecp.fr/~flo/debian-ffgo unstable main
deb-src http://people.via.ecp.fr/~flo/debian-ffgo unstable main</pre>
 
<p>(replace <tt>unstable</tt> with <tt>jessie</tt> if you are using <i>jessie</i>)</p>
</li>
<li>'''Third step: update the <tt>apt</tt> package list'''
 
<p>This is typically done with:</p>
 
<pre>apt-get update</pre>
 
or
 
<pre>aptitude update</pre>
 
etc., depending on the Debian package manager you are using.
</li>
<li>'''Final step: install the packages'''
 
<p>Install the ffgo package, at least. It is also recommended to install:</p>
<ul>
<li><tt>python3-pil.imagetk</tt>, otherwise you won’t be able to see the aircraft thumbnails;</li>
<li><tt>geographiclib-tools</tt> for the <tt>MagneticField</tt> program, in order to be able to see the magnetic variation at a given airport, magnetic headings, etc.;</li>
<li><tt>python3-geographiclib</tt> if available for your distribution (i.e., after <i>jessie</i>), for better geodesic calculations.</li></ul>
 
<p>In other words, if you are using ''unstable'', you can run:</p>
 
<pre>apt-get install ffgo python3-pil.imagetk geographiclib-tools python3-geographiclib</pre>
 
If you are using ''jessie'' without any backport of <tt>python3-geographiclib</tt>, run this instead:
 
<pre>apt-get install ffgo python3-pil.imagetk geographiclib-tools</pre>
 
'''Note:''' installing the <tt>geographiclib-tools</tt> package is not enough to have the <tt>MagneticField</tt> program working. This program needs one or more datasets which are not part of the <tt>geographiclib-tools</tt> package. One easy way to install the minimal dataset on Debian is to run the following command with root privileges:
 
<pre>/usr/sbin/geographiclib-get-magnetic minimal</pre>
 
This will automatically download and install a minimal dataset under <tt>/usr/share/GeographicLib/magnetic</tt>, where it can be found by <tt>MagneticField</tt> (not registering the added files with <tt>dpkg</tt> though, which is a bit ugly, cf. [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687253 Debian bug #687253]).
 
Once the <tt>ffgo</tt> package is installed, FFGo can be run from the [http://freedesktop.org/ freedesktop] menu and, obviously, from the command line (the command name is <tt>ffgo</tt>).
</li>
</ul>


==== MacOS X ====
==== MacOS X ====

Revision as of 01:12, 24 February 2016

This article is a stub. You can help the wiki by expanding it.


FFGo
Screenshot of FFGo 1.10.1
Screenshot of FFGo 1.10.1
Developed by Florent Rougon
Initial release 1.0.0 (Aug 21, 2015)
Latest release 1.10.1 (Feb 16, 2016)
Written in Python 3
OS Unix-like (incl. Linux), Windows, MacOS X
Development status Active (as of Feb 2016)
Type Graphical launcher for FlightGear
License WTFPL version 2
Website

FFGo is a graphical launcher for FlightGear, and a fork of FGo!. It vastly improves on FGo! by fixing bugs and adding a host of new features.

Features

One thing that distinguishes FFGo from other FlightGear launchers is the text window allowing one to write any (possibly advanced) command line options that will be passed to FlightGear. This is similar, but more convenient and powerful, to editing the .fgfsrc configuration file. The main difference in power compared to editing .fgfsrc or using FGo! comes from FFGo's use of CondConfigParser to process the user's configuration. See FFGo conditional config documentation for more information on this aspect of FFGo.

In addition to this, FFGo offers:

  • an easy setup (Preferences dialog);
  • convenient selection of aircraft and startup airport or AI carrier;
  • possibility to choose between identically-named aircrafts based on which directory they are stored in (using tooltips in the aircraft list);
  • easy selection of startup runway or parking position, offering startup locations from apt.dat if there is no groundnet-defined parking position for the selected airport;
  • detailed airport, runway, helipad and parking tooltips. Airport tooltips show things such as airport type (land airport, seaplane base or heliport), latitude, longitude, elevation, number of land runways, water runways, helipads, magnetic variation... Runway/helipad tooltips show runway type, length and width, surface type, magnetic as well as true heading, etc. Parking tooltips show similar information as runway tooltips, plus maximum aircraft radius, reserved airline codes... (note: The MagneticField program from GeographicLib is needed for magnetic data)
  • easy consulting of METAR data for the nearest station relatively to the selected airport (if any);
  • a powerful Airport Finder dialog allowing one to easily find airports using various criteria: distance to a chosen, reference airport; number of land runways, water runways, or helipads; length of the longest or shortest runway in the airport, etc. The table of results displays, among others, the distance and bearings between the reference airport and each “result airport”. It can be sorted according to any column with a simple click on the column header.
  • a GPS Tool dialog allowing one to find the distance, initial and final bearings for the shortest path between two given airports. The dialog also computes the flight duration for a given ground speed, and vice versa.
  • easy selection of one or more scenarios, allowing one to browse the description of each available scenario;
  • realtime preview of the arguments that would be passed to fgfs (the FlightGear executable) if the Run FG button were to be pressed;
  • the possibility to copy to the clipboard a shell command that is equivalent to what FFGo would do if the Run FG button were to be pressed;
  • the option to translate fgfs' --parkpos option into the corresponding combination of --lat, --lon and --heading options. This behavior can be enabled using the Fake the --parkpos option checkbox found in the Miscellaneous tab of the Preferences dialog. It is useful when the --parkpos option is broken in FlightGear (which is unfortunately the case in January 2016, for the next branch of FlightGear's Git repository);
  • easy viewing and saving of FlightGear output (log);
  • automatic FFGo + FlightGear log saving and rotating.

Screenshots

Main window and Command Window

Airport tooltip and preview of the FlightGear command at Madeira (LPMA)

Starting from version 1.10.0, FFGo remembers how many days you used each aircraft, or visited each airport, during a user-defined period (see the Statistics tab in the Preferences dialog). This data is subject to expiration via configurable periods too. These simple statistics allow FFGo to know which aircrafts (resp. airports) you used (resp. visited) most during the selected period, and present them first in the aircrafts (resp. airports) list. You can still sort the lists based on other criteria if you wish (aircraft or airport name, airport ICAO code...) by simply clicking on the corresponding column headers. Click a second time on a given column header to reverse the sort order.

The FlightGear Command window shows exactly which arguments are going to be passed to the FlightGear executable (fgfs) when the Run FG button is clicked. It can be resized, hidden, detached (as in the screenshot) or attached to FFGo's main window.

Note  If you want to copy these arguments to the clipboard for use in a shell (“command line”), use the corresponding function from the Tools menu (Copy FG shell-equivalent command). This will prepend the configured path to the FlightGear executable, properly quote all arguments for a POSIX shell (which might contain spaces or other special characters), and separate them with spaces.

The Preferences dialog

The Tools menu

Selecting AI scenarios

You may select one or more AI scenarios to load from the Scenarios popup menu. Selecting a scenario does nothing particular for FFGo, but each selected scenario will be passed as part of a --ai-scenario=... option to FlightGear when it is started. Left-clicking on a scenario name toggles selection of this scenario. Right-clicking displays its description.

Selecting an AI carrier

Instead of starting at an airport, you can select an AI carrier in the Carrier popup menu and FFGo will make you start there, automatically adding the corresponding AI scenario. In order to make the Carrier popup menu appear, just click on the airport ICAO code below the aircraft image.

If you choose a different carrier or quit “carrier mode” (by choosing None in the Carrier popup menu, or simply selecting an airport in the airport list), the scenario for the selected carrier will be automatically removed from the list of scenarios to load.

Weather info — the METAR widget

The METAR widget allows one to check the latest weather information for the selected airport. It is available from the Tools menu.

Airport metadata

Airport tooltips

Runway tooltips

Parking tooltips

The Airport Finder dialog

The Airport Finder dialog, accessible under the Tools menu, allows one to easily find airports using various criteria: distance to a chosen, “reference airport”; number of land runways, water runways, or helipads; length of the longest or shortest runway in the airport, etc. Results are listed in a table giving these criteria for each airport as well as the initial and final bearings for the shortest path from or to the reference airport. The table of results can be sorted according to airport ICAO code, name or any of the aforementioned criteria (click on a column header to sort according to the corresponding field; click a second time on the same column header to reverse the sort order).

This dialog is fairly versatile, but one of the uses it is particularly well-suited for is to find a start airport in the desired range with respect to a given airport. For instance, let's say you saw on the multiplayer map that someone is offering Air Traffic Control (ATC) services at MHTG (just an example), and you are looking for an airport that is neither too close, nor too far from MHTG in order to take off there and land at MHTG, following instructions from the air traffic controller. Since it is possible, in the Airport Finder dialog, to sort found airports based on bearings from, or to the reference airport, you can also easily find airports that are, for instance, located more or less north-east of the reference airport. Many, many other things are possible. cf. this forum message for more details.

The GPS Tool dialog

The GPS Tool dialog allows one to find the distance, initial and final bearings for the shortest path between two given airports. The dialog also computes the flight duration for a given ground speed, and vice versa.

This dialog should be more convenient than the Airport Finder dialog for the cases where you already know the start and destination airports you are interested in, and you just want to get the results for these airports. Or you want to check several pairs of airports, and you know precisely which ones you want the calculations to be done for.

Installation tips

Instructions — Read this first!

Since installation instructions may in general depend on the particular FFGo version you want to install, they are always included in release tarballs and zip files, precisely in the docs/INSTALL folder. Such tarballs and zip files can be downloaded from FFGo's home page as well as from FFGo's page on PyPI (PyPI being the Python Package Index). However, apart from the addition of a small number of optional dependencies, the installation method hasn't changed since FFGo 1.0.0, therefore there is little risk for now using the online Git version of the installation guide.

The guide mentioned in the previous paragraph is rather detailed, because it explains a few concepts that may be new to users who are not Python developers, and tries to give general instructions covering all common cases, which is not very easy given that Python may or may not be shipped depending on the particular operation system in use (Windows, Linux, MacOS X, etc.). To the contrary, the following sections give specific instructions applicable in the most common cases on each OS where I know a working procedure. They are more practical, probably easier to follow than the installation guide, at the expense of being less generic.

Sample installations

Windows

Typical FFGo installation on Windows is easy, because there is no system Python shipped with Windows, therefore there is no risk of messing up your Windows installation by just installing or upgrading Python packages. The instructions below assume you have no existing Python installation on your Windows system.[1] There we go:

  1. Install Python 3.4 or later:
    1. Download Python from the Python home page.
    2. Make sure to enable the Tcl/tk and pip components in the installer.
    3. Don't change the default value for the Python installation folder, otherwise you are likely to run into permission problems: except for old versions of Windows, writing to Program Files, at least, is subject to special restrictions that may cause the pip install step to fail.
    4. If you are not comfortable with the command line (“Command Prompt”), it is suggested you choose Add python.exe to Path. This way, you will be able to run the pip and ffgo programs directly at the Command Prompt without having to specify their full paths.
  2. Open a terminal, aka “Command Prompt”:

    There are various ways to do this, depending on the version of Windows in use. One way that should work is using the Windows+R keyboard shortcut, then entering cmd.exe in the text input box. Apparently (according to Google, see for yourself), on Windows 10, this can (also?) be done with the Windows+X keyboard shortcut, then choosing Command Prompt in the menu that should appear.

  3. In this terminal, type:
    pip install FFGo Pillow geographiclib
    FFGo can work without Pillow and geographiclib, but it will offer more features if you install them. The previous command should automatically download and install FFGo from FFGo's page on PyPI.

    Note: pip install ffgo has the same effect as pip install FFGo.

Note:

Messages such as

warning: no previously-included files found matching 'docs\README.conditional-config\_static\README.txt'

when running the pip install ... command are completely normal and harmless, just ignore them. This command should print something like:

Successfully installed CondConfigParser FFGo Pillow geographiclib

towards the end if all went well.

After these steps, you should have a working FFGo. You can run it by double-clicking on either ffgo.exe or ffgo-noconsole.exe in a directory such as C:\PythonXY\Scripts, where XY corresponds to the Python version that was used in the pip install FFGo ... command. These two executables do the same, except ffgo.exe opens a Windows terminal (“console”) containing all FFGo messages, while ffgo-noconsole.exe doesn't. You can safely use the latter most of the time. Should FFGo refuse to start for some reason, running ffgo.exe and examining/reporting the printed messages would certainly be helpful. You may create a shortcut on your desktop for these files by right-clicking on the .exe file of your choice.

Another way to run FFGo is to open a Command Prompt and type:

  • ffgo if you chose Add python.exe to Path in the Python installer as hinted above;
  • or a full path to one of the FFGo executables, such as C:\PythonXY\Scripts\ffgo.exe in case you didn't.

The instructions given here install all dependencies of FFGo, except one optional dependency: the MagneticField executable from GeographicLib. To have a complete installation, that is able to show the magnetic variation at each airport and magnetic headings for runways, routes, etc., you need to do this in addition:

  1. Follow GeographicLib's Download link, download and install it.
  2. If this installation added the folder containing GeographicLib's executables to the PATH environment variable, then you don't have anything more to do, FFGo will automatically find MagneticField and use it.
  3. Otherwise, run FFGo as explained above, open the Settings → Preferences dialog, go to the Miscellaneous tab, and enter the precise path where MagneticField[2] is installed in the corresponding field. Click Save settings and you should be done.

The FFGo dialog reachable via Help → About displays the versions of the main dependencies used by FFGo. In case you entered an invalid path, or some other error, a hint is generally given there. In any case, troubleshooting information is always printed to the terminal (if you ran ffgo.exe as opposed to ffgo-noconsole.exe) and to the FFGo log file located in the %APPDATA%\FFGo\config folder (do a Google search with keywords “Windows” and “APPDATA” if you don't know what this means).

Linux

This section will be completed later. In the meantime—except for installation instructions using Debian packages, which should already be complete—you can consult the Git version of the installation guide for instance, or even better, then one coming with the particular FFGo version you want to install. Practical instructions, especially for Debian users, have also been given in this message on the FlightGear forum and the following ones. This is basically what you'll find here when the section you are reading is completed.

Using distribution packages
Debian

Debian packages for FFGo have been prepared by the FFGo upstream maintainer, Florent Rougon. They can be downloaded and installed normally using apt-get, aptitude, etc. provided you have installed Florent's OpenPGP key.

  • First step: install Florent Rougon's OpenPGP key into the apt keyring

    There are two main ways to get the key:

    1. The GnuPG way is:
      1. Get the key from a key server (as defined in your GnuPG configuration):
        gpg2 --recv-keys C785B90B5053A3A2
        gpg2 --list-keys --fingerprint C785B90B5053A3A2

        the output of which should show the correct fingerprint:

        pub   rsa4096/0xC785B90B5053A3A2 2010-03-17 [expires: 2016-10-19]
              Key fingerprint = 125B 5A0F DB78 8FDD 0EF4  1A9D C785 B90B 5053 A3A2

        Normally, in the OpenPGP model, you would get the fingerprint by a really secure channel (e.g., meeting Florent in person) or you would rely on the web of trust (trusting someone who trusts someone who... who trusts this key actually belongs to Florent. The chain verification is automated by gpg/gpg2—name of the main GnuPG command—using digital signatures, done with each participant's key).

      2. Then, in order to have they key in a separate file, say ~/tmp/flo-key, you can run:
        gpg2 --export -o ~/tmp/flo-key C785B90B5053A3A2
        (using ~/tmp/flo-key to avoid symlink attacks—using /tmp instead of ~/tmp wouldn't be a great idea).
    2. The other way is getting the key via HTTPS from Florent's home page (it is linked from that page on Florent's site). HTTPS uses TLS which is kind of crap, but it is not worse than when you check your bank accounts online or purchase something online, or download most programs without apt (which relies on GnuPG, not HTTPS). In short, assuming you have the wget package installed, you can get the key with:
      wget -O ~/tmp/flo-key https://people.via.ecp.fr/~flo/OpenPGP-key.asc
    3. Once you have that key in the file flo-key, you can install it for apt by running, as root:

      apt-key add flo-key

      One could even combine the two operations into a single command (getting the key and installing it into apt's keyring):

      wget -O- https://people.via.ecp.fr/~flo/OpenPGP-key.asc | apt-key add -

      but this would have to be done as root, which I don't like much for wget (this can be overcome by using ssh, maybe also with sudo, but it is a bit out of scope here).

  • Second step: add the relevant lines to your /etc/apt/sources.list file

    Add the following lines to your /etc/apt/sources.list:

    deb http://people.via.ecp.fr/~flo/debian-ffgo unstable main
    deb-src http://people.via.ecp.fr/~flo/debian-ffgo unstable main

    (replace unstable with jessie if you are using jessie)

  • Third step: update the apt package list

    This is typically done with:

    apt-get update

    or

    aptitude update

    etc., depending on the Debian package manager you are using.

  • Final step: install the packages

    Install the ffgo package, at least. It is also recommended to install:

    • python3-pil.imagetk, otherwise you won’t be able to see the aircraft thumbnails;
    • geographiclib-tools for the MagneticField program, in order to be able to see the magnetic variation at a given airport, magnetic headings, etc.;
    • python3-geographiclib if available for your distribution (i.e., after jessie), for better geodesic calculations.

    In other words, if you are using unstable, you can run:

    apt-get install ffgo python3-pil.imagetk geographiclib-tools python3-geographiclib

    If you are using jessie without any backport of python3-geographiclib, run this instead:

    apt-get install ffgo python3-pil.imagetk geographiclib-tools

    Note: installing the geographiclib-tools package is not enough to have the MagneticField program working. This program needs one or more datasets which are not part of the geographiclib-tools package. One easy way to install the minimal dataset on Debian is to run the following command with root privileges:

    /usr/sbin/geographiclib-get-magnetic minimal

    This will automatically download and install a minimal dataset under /usr/share/GeographicLib/magnetic, where it can be found by MagneticField (not registering the added files with dpkg though, which is a bit ugly, cf. Debian bug #687253).

    Once the ffgo package is installed, FFGo can be run from the freedesktop menu and, obviously, from the command line (the command name is ffgo).

MacOS X

Installation should be similar to how it is done on Linux with pip in most ways, once you have installed a suitable Python version. OS X expert needed for the little OS X-specific details (how to install Python in a non-intrusive way for the system, how to run pip in this particular installation, and how to create a shortcut to the resulting ffgo executable for convenience).

Related content

Footnotes

  1. If you do, the general principle is the same, but you'll have to make sure to invoke pip for the right Python installation, for instance with:
    py -3.5 -m pip install FFGo Pillow geographiclib
    to run pip with a Python 3.5 installation (not having Windows, I haven't been able to test this myself; please remove this parenthesis if this works, otherwise report on the FFGo thread on the FlightGear forum with enough details to allow me to help you).
  2. Presumably MagneticField.exe, please correct this if you can do the actual check.