FGPanel: Difference between revisions

Jump to navigation Jump to search
414 bytes added ,  17 February 2021
Cleanup; + Repository link templates
(Cleanup; + Repository link templates)
Line 12: Line 12:
FGPanel was available as a ''OpenSUSE Live System'', a complete, stand-alone software setup, including OpenSUSE Linux operating system and all necessary start-up scripts. Unfortunately the SuseStudio service was shut down in 2018, so the ISO images are no longer available for download.
FGPanel was available as a ''OpenSUSE Live System'', a complete, stand-alone software setup, including OpenSUSE Linux operating system and all necessary start-up scripts. Unfortunately the SuseStudio service was shut down in 2018, so the ISO images are no longer available for download.


FGPanel is still part of OpenSUSE's standard FlightGear packages though. So, to run fgpanel on a separate PC, you can simply install openSUSE and download the FlightGear package from the OpenSUSE repository. See the {{flightgear source|utils/fgpanel/README|text=README}} for more.
FGPanel is still part of OpenSUSE's standard FlightGear packages though. So, to run FGPanel on a separate PC, you can simply install openSUSE and download the FlightGear package from the OpenSUSE repository. See the {{flightgear source|utils/fgpanel/README|text=README}} for more.


== FGPanel on Raspberry Pi ==
== FGPanel on Raspberry Pi ==
FGPanel has been ported to run on a Raspberry Pi. All what you need is:
FGPanel has been ported to run on a Raspberry Pi. All what you need is:
* a Raspberry Pi;
* A Raspberry Pi;
* a network to connect the Raspberry Pi with an instance of FlightGear Simulator;
* A network to connect the Raspberry Pi with an instance of FlightGear Simulator;
* Raspbian installed on the Raspberry Pi;
* Raspbian installed on the Raspberry Pi;
* follow the procedure described in <tt>utils/fgpanel/README.RPi</tt> to build FGPanel.
* Follow the procedure described in {{flightgear source|utils/fgpanel/README.RPi|text=README.RPi}} to build FGPanel.


This FGPanel on Raspberry Pi makes it easy and cheap to build a panel for your own procedure trainer.
This FGPanel on Raspberry Pi makes it easy and cheap to build a panel for your own procedure trainer.


== Configuring FGPanel ==
==Configuring FGPanel==
Once FGPanel is installed, several configuration files need to be created on both the master FlightGear system and the remote system running FGPanel
Once FGPanel is installed, several configuration files need to be created on both the master FlightGear system and the remote system running FGPanel


=== 2D Panel Configuration File ===
===2D Panel Configuration File===
This is an XML file (for example 2dpanel.xml) that defines the layout of the 2D panel that FGPanel displays. This uses the same syntax as the 2D panel description as described in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Docs/README.xmlpanel README.xmlpanel] . An example is below for a basic Cessna 172 XML panel running on a Raspberry Pi Zero connected to a 1024x600 screen.<syntaxhighlight lang="xml">
This is an XML file (for example <code>2dpanel.xml</code>) that defines the layout of the 2D panel that FGPanel displays. This uses the same syntax as the 2D panel description as described in {{fgdata source|Docs/README.xmlpanel|text=README.xmlpanel}} . An example is below for a basic Cessna 172 XML panel running on a Raspberry Pi Zero connected to a 1024x600 screen.<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<?xml version="1.0"?>


Line 226: Line 226:


</PropertyList>
</PropertyList>
</syntaxhighlight>Each <instrument>...</instrument> block describes an instrument, referencing the instrument descriptions in $FGDATA/Aircraft/Instruments.
</syntaxhighlight>Each <code><instrument>...</instrument></code> block describes an instrument, referencing the instrument descriptions in <code>$FGDATA/Aircraft/Instruments</code>.


The key parameters for each instrument are as follows:
The key parameters for each instrument are as follows:


* the <instrument>...</instrument> line is the instrument to display with path to the instrument description relative to $FGDATA
*The <code><instrument>...</instrument></code> line is the instrument to display with path to the instrument description relative to <code>$FGDATA</code>
* the <name>...</name> is a description of the instrument - this can be anything as it's not used for display
*The <code><name>...</name></code> is a description of the instrument - this can be anything as it's not used for display
* the <x> and <y> are the position of the centre of the instrument on screen in pixels, referenced to the top left of the screen.
*The <code><x></code> and <code><y></code> are the position of the centre of the instrument on screen in pixels, referenced to the top left of the screen.
* the <w> and <h> are the width and height of the instrument in pixels. Refer to the <instrument>.xml in $FGDATA/Aircraft/Instruments for the default shape and size of each instrument
* The <code><w></code> and <code><h></code> are the width and height of the instrument in pixels. Refer to the <code><instrument>.xml</code> in <code>$FGDATA/Aircraft/Instruments</code> for the default shape and size of each instrument


If you look at the individual xml files that define the instrument, these have the properties in the property tree that need to be sent. Some instruments have a <params> block - this allows you to alias parameters being sent from the property tree (as described below) to the properties displayed by the instruments - this is particularly useful for duplicated instruments such as navigation displays. Refer to [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Docs/README.xmlpanel README.xmlpanel] for more details. Make a note of which values from the property tree each instrument requires, and any aliases as you will need it in the next step.
If you look at the individual XML files that define the instrument, these have the properties in the property tree that need to be sent. Some instruments have a <code><params></code> block - this allows you to alias parameters being sent from the property tree (as described below) to the properties displayed by the instruments - this is particularly useful for duplicated instruments such as navigation displays. Refer to [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Docs/README.xmlpanel README.xmlpanel] for more details. Make a note of which values from the property tree each instrument requires, and any aliases as you will need it in the next step.


=== Parameter File ===
===Parameter File===
The next file you need is an xml file (panel_send.xml) that tells FlightGear which values from the property tree to send to the panel. This needs to be present on both the computer running FightGear and the panel computer. Both versions need to be identical. An example for the above 2dpanel.xml is below:<syntaxhighlight lang="xml">
The next file you need is an XML file (<code>panel_send.xml</code>) that tells FlightGear which values from the property tree to send to the panel. This needs to be present on both the computer running FlightGear and the panel computer. Both versions need to be identical. An example for the above <code>2dpanel.xml</code> is below:<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<?xml version="1.0"?>


Line 501: Line 501:
  </generic>
  </generic>
</PropertyList>
</PropertyList>
</syntaxhighlight>Each <chunk> section defines which property is sent. These need to be the same as defined in the instrument definition in $FGDATA/Aircraft/Instruments/<instrument>.xml, or as referred to by the assigned alias to the parameter. A tip here - make sure that any value that needs decimals (for example radio frequencies) are sent as a floating point numbers with sufficient decimal places defined.
</syntaxhighlight>Each <code><chunk></code> section defines which property is sent. These need to be the same as defined in the instrument definition in <code>$FGDATA/Aircraft/Instruments/<instrument>.xml</code>, or as referred to by the assigned alias to the parameter. A tip here - make sure that any value that needs decimals (for example radio frequencies) are sent as a floating point numbers with sufficient decimal places defined.


=== FGpanel launch file ===
===FGpanel launch file ===
The next file you need is an XML on the receiving (panel) computer (panel_launch.xml) that configures FGpanel. An example for the above files is below:<syntaxhighlight lang="xml" line="1">
The next file you need is an XML on the receiving (panel) computer (<code>panel_launch.xml</code>) that configures FGpanel. An example for the above files is below:<syntaxhighlight lang="xml" line="1">
<PropertyList>
<PropertyList>


Line 542: Line 542:
</syntaxhighlight>The key lines in this are:
</syntaxhighlight>The key lines in this are:


* <panel include="/path/to/2dpanel.xml"/>  - (line 7). This is the path to and name of the panel layout definition file (2dpanel.xml in this example) on the panel computer.
*<code><panel include="/path/to/2dpanel.xml"/></code>  - (line 7). This is the path to and name of the panel layout definition file (<code>2dpanel.xml</code> in this example) on the panel computer.
* <host> - (line 24 and 25) the IP address of the computer running FlightGear that the panel computer listens for. if you leave this blank it will listen for data from all hosts on the subnet.
*<code><host></code> - (line 24 and 25) the IP address of the computer running FlightGear that the panel computer listens for. if you leave this blank it will listen for data from all hosts on the subnet.
* <port>  - (line 26) the port that the panel computer listens for data on - this has to be specified. 5432 is the default.
*<code><port></code>  - (line 26) the port that the panel computer listens for data on - this has to be specified. <code>5432</code> is the default.
* <style> - (line 27) the protocol to listen. this should be set to UDP
*<code><style></code> - (line 27) the protocol to listen. this should be set to UDP
* <protocol-include="/path/to/panel_send.xml"/> - (line 33) this is path to and name of the file that defines the parameters being sent from the main computer. This needs to be the path to and name of the copy of the file on the panel computer
* <code><protocol-include="/path/to/panel_send.xml"/></code> - (line 33) this is path to and name of the file that defines the parameters being sent from the main computer. This needs to be the path to and name of the copy of the file on the panel computer


=== One further requirement: $FGDATA on the panel computer ===
===One further requirement: $FGDATA on the panel computer===
Additionally, the panel computer needs a copy of the $FGDATA directory, including all instrument definitions. A full FlightGear install is recommended as fgpanel has some dependencies to the full FlightGear installation.
Additionally, the panel computer needs a copy of the <code>$FGDATA</code> directory, including all instrument definitions. A full FlightGear install is recommended as FGPanel has some dependencies to the full FlightGear installation.


== Launching FGpanel ==
==Launching FGpanel==
Once configuration is complete, FGpanel can be launched on the panel computer:<syntaxhighlight>
Once configuration is complete, FGpanel can be launched on the panel computer:<syntaxhighlight>
/path/to/fgpanel --fg-root=/path/to/fg/data --panel=/path/to/2dpanel.xml
/path/to/fgpanel --fg-root=/path/to/fg/data --panel=/path/to/2dpanel.xml
</syntaxhighlight>Where --fg-root is the location of the FlightGear data directory on the panel computer, and --panel is the path to and name of the 2dpanel.xml definition
</syntaxhighlight>Where <code>--fg-root</code> is the location of the FlightGear data directory on the panel computer, and <code>--panel</code> is the path to and name of the <code>2dpanel.xml</code> definition


== Launching FlightGear ==
==Launching FlightGear==
FlightGear can now be launched on the main computer as usual. However one option needs to be added to the launcher (either in the GUI or the command line) so that the required properties are sent to the panel computer:<syntaxhighlight>
FlightGear can now be launched on the main computer as usual. However one option needs to be added to the launcher (either in the GUI or the command line) so that the required properties are sent to the panel computer:<syntaxhighlight>
--generic=socket,out,refresh_rate,panel_computer_ip,port,udp,"/path/to/panel_send.xml"
--generic=socket,out,refresh_rate,panel_computer_ip,port,udp,"/path/to/panel_send.xml"
</syntaxhighlight>In the above:
</syntaxhighlight>In the above:


* refresh_rate - this is the refresh rate (in Hz) to send the property tree values. 25 should be sufficient
*<code>refresh_rate</code> - this is the refresh rate (in Hz) to send the property tree values. 25 should be sufficient
* panel_computer_ip - the IP address of the computer running FGpanel
*<code>panel_computer_ip</code> - the IP address of the computer running FGpanel
* port - the port to send data on, must be the same as defined in panel_launch.xml (5432 in the above examples)
* <code>port</code> - the port to send data on, must be the same as defined in <code>panel_launch.xml</code> (5432 in the above examples)
* /path/to/panel_send.xml - the path to and name of the panel_send.xml file on the FlightGear computer
*<code>/path/to/panel_send.xml</code> - the path to and name of the <code>panel_send.xml</code> file on the FlightGear computer


The panel should now replicate the instruments displayed on the main FlightGear computer.
The panel should now replicate the instruments displayed on the main FlightGear computer.


== Related content ==
==Related content==
* [[ Howto: Build your own procedure trainer]], describes how you can create a "cheap" procedure trainer, making use of FGPanel to draw the instruments.
*[[ Howto: Build your own procedure trainer]], describes how you can create a "cheap" procedure trainer, making use of FGPanel to draw the instruments.


=== Readme files ===
===Readme files===
* {{flightgear source|utils/fgpanel/README|text=README}}
*{{flightgear source|utils/fgpanel/README|text=README}}
* {{flightgear source|utils/fgpanel/README.RPi|text=README.RPi}}
*{{flightgear source|utils/fgpanel/README.RPi|text=README.RPi}}


As FGPanel use stripped down for the 2D panels these readme files can also be useful
As FGPanel use stripped down for the 2D panels these readme files can also be useful
* {{readme file|xmlpanel}}
*{{readme file|xmlpanel}}
* {{readme file|xmlpanel.html}}
*{{readme file|xmlpanel.html}}


=== Source code ===
===Source code===
* {{flightgear source|utils/fgpanel}}
*{{flightgear source|utils/fgpanel}}


[[Category: Software]]
[[Category: Software]]
[[Category:Cockpit building]]
[[Category:Cockpit building]]

Navigation menu