Standard instrument selection: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (added a note about separate fil)
(+- Minor cleanup; + related: Aircraft-set.xml, Source code; cat: Aircraft enhancement)
 
Line 1: Line 1:
By default an aircraft gets access to a number of standard instruments via instrument properties. These instruments are [https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Instrumentation/instrument_mgr.cxx C++ coded]. Some of them depends on [[System dependent instruments|different aircraft systems]].
By default an aircraft gets access to a number of standard instruments via instrument properties. These instruments are coded in C++. Some of them depends on [[System dependent instruments|different aircraft systems]].


It is possible to override the default selection by adding your own instrument property file listing the standard instruments that you want to use in the aircraft. Eg:
It is possible to override the default selection by adding your own instrument property file listing the standard instruments that you want to use in the aircraft. For example like below:


<pre>
<pre>
Line 31: Line 31:
</pre>
</pre>


Then edit the -set.xml file and add a path to your own instrument file in the sim property-tree:
Then edit the <code>-set.xml</code> file and add a path to your own instrument file in the sim property-tree:


<pre>
<pre>
Line 42: Line 42:
</pre>
</pre>


'''Note:''' Due to how the instrumentation handling is coded you must create a separate file for your instrument list and use the sim/instrumentation/path node.
{{note|Due to how the instrumentation handling is coded you must create a separate file for your instrument list and use the <code>sim/instrumentation/path</code> node.}}


You can also change the properties that some of the instruments depend on to function. Eg. Changing the attitude indicator to use battery voltage property instead of vacuum suction to drive the gyro:
You can also change the properties that some of the instruments depend on to function, for example changing the attitude indicator to use battery voltage property instead of vacuum suction to drive the gyro:
<pre>
<pre>
   <attitude-indicator>
   <attitude-indicator>
Line 52: Line 52:
   </attitude-indicator>
   </attitude-indicator>
</pre>
</pre>
== Related content ==
=== Wiki articles ===
* [[Aircraft-set.xml]]
=== Source code ===
* {{flightgear source|path=src/Instrumentation/instrument_mgr.hxx}}
* {{flightgear source|path=src/Instrumentation/instrument_mgr.cxx}}
[[Category:Aircraft enhancement]]

Latest revision as of 13:51, 22 August 2019

By default an aircraft gets access to a number of standard instruments via instrument properties. These instruments are coded in C++. Some of them depends on different aircraft systems.

It is possible to override the default selection by adding your own instrument property file listing the standard instruments that you want to use in the aircraft. For example like below:

<?xml version="1.0"?>
 
<PropertyList>
 
   <airspeed-indicator>
     <name>airspeed-indicator</name>
     <number>0</number>
     <total-pressure>/systems/pitot/total-pressure-inhg</total-pressure>
     <static-pressure>/systems/static/pressure-inhg</static-pressure>
   </airspeed-indicator>
 
   <altimeter>
     <name>altimeter</name>
     <number>0</number>
     <static-pressure>/systems/static/pressure-inhg</static-pressure>
     <quantum>0</quantum>
     <tau>0</tau>
   </altimeter>

   <magnetic-compass>
    <name>magnetic-compass</name>
    <number>0</number>
  </magnetic-compass>

</PropertyList>

Then edit the -set.xml file and add a path to your own instrument file in the sim property-tree:

<sim>
   (...)
   <instrumentation>
    <path>Aircraft/MyAircraft/Instrumentation/my-instruments.xml</path>
   </instrumentation>
</sim>
Note  Due to how the instrumentation handling is coded you must create a separate file for your instrument list and use the sim/instrumentation/path node.

You can also change the properties that some of the instruments depend on to function, for example changing the attitude indicator to use battery voltage property instead of vacuum suction to drive the gyro:

  <attitude-indicator>
    <name>attitude-indicator</name>
    <number>0</number>
    <suction>systems/electrical/outputs/battery_voltage</suction>
  </attitude-indicator>

Related content

Wiki articles

Source code