FGPanel: Difference between revisions

Jump to navigation Jump to search
239 bytes added ,  17 February 2021
m
no edit summary
(Significant additions to article. Added documentation on required configuration files and how to configure FlightGear and FGpanel)
mNo edit summary
Line 229: Line 229:


The key parameters for each instrument are as follows:
The key parameters for each instrument are as follows:
The format of this is as follows:


* the <instrument>...</instrument> line is the instrument to display with path to the instrument description relative to $FGDATA
* the <instrument>...</instrument> line is the instrument to display with path to the instrument description relative to $FGDATA
* the <name>...</name> is a description of the instrument - this can be anything as it's not used for display
* the <name>...</name> 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 <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 <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 <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


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.
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.


=== 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 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 (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">
<?xml version="1.0"?>
<?xml version="1.0"?>


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


* <panel include="xxxxxxx.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.
* <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.
* <host> - (line 24 and 25) the IP address of the computer running FlightGear that the pane computer listens for. if you leave this blank it will listen for data for all hosts on the subnet.
* <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.
* <port>  - (line 26) the port that the panel computer listens for data on - this has to be specified. 5432 is the default.
* <port>  - (line 26) the port that the panel computer listens for data on - this has to be specified. 5432 is the default.
* <style> - (line 27) the protocol to listen. this should be set to UDP
* <style> - (line 27) the protocol to listen. this should be set to UDP
* <protocol-include="xxxx"/> - (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 name and location of the copy of the file on the panel computer
* <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


=== One further requirement: $FGDATA on the panel computer ===
=== One further requirement: $FGDATA on the panel computer ===
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 $FGDATA 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 ==
Line 559: Line 557:


== 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):<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:
Line 565: Line 563:
* refresh_rate - this is the refresh rate (in Hz) to send the property tree values. 25 should be sufficient
* refresh_rate - 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
* panel_computer_ip - 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
* port - the port to send data on, must be the same as defined in panel_launch.xml (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
* /path/to/panel_send.xml - the path to and name of the panel_send.xml file on the FlightGear computer


4

edits

Navigation menu