1 This document describes the *new* HUD system that will be first released
2 with fgfs >0.9.10. For the old system see $FG_ROOT/Docs/README.xmlhud.
3 Note that the old system is scheduled for removal, and that the new system
4 is work in progress. So it's up to you to choose the lower risk. :-)
11 ###############################################################################
14 A HUD configuration file may contain 3 types of information:
17 (2) HUD instrument definitions
18 (3) imports of further HUD config files
24 (1) global settings ===========================================================
26 These can be used to override settings in the global property tree. Currently
27 only bool <enbale-3d> is supported. It allows a HUD to define itself if it is
28 a 2D HUD (false) or a 3D HUD (true). 2D HUDs always remain in the screen plane,
29 while 3D HUDs always remain in a position relative to the aircraft.
33 <enable-3d>true</enable-3d>
39 (2) HUD instrument definitions ================================================
41 These define one single HUD "item" (instrument or label), and consist of several
42 properties. Some of those are standardized property groups that can be used
43 in many places. These shall be explained first.
47 (2.1) standardized property groups --------------------------------------------
50 2. input channel group
55 (2.1.1) <condition> ...........................................................
57 These define conditions that are either "true" or "false". They are used to
58 hide/unhide whole items, or to set other item states (blinking on/off) etc.
59 You find detailed documentation about them in $FG_ROOT/Docs/README.conditions.
63 (2.1.2) input channel groups .................................................
65 These define an input channel to the HUD instrument and serve as interface
66 between property system and the instrument. A complete channel definition
67 looks like this (defaults in comments):
70 <property>/position/altitude-agl-ft</property> <!-- no default -->
71 <factor>0.3048</factor> <!-- 1.0 -->
72 <offset>2.0</offset> <!-- 0.0 -->
73 <damp>1.5</damp> <!-- 0.0 (no damping) -->
74 <min>0.0</min> <!-- -infinity -->
75 <max>10000</max> <!-- +infinity -->
78 Input channels are only called <input> for instruments that only have one
79 channel. Other instruments may have two or more channels, called <bank-input>,
80 <pitch-input> etc. All of them will have the same member properties and behave
83 An input channel will preprocess the raw property value for the HUD instrument.
84 The property may be of any type (bool, int, long, float, double, string), but
85 not all types will make sense in every situation. The HUD instrument will only
86 see the final value, which is calculated as:
89 v = <property> * <factor> + <offset>
90 if (<damp>) v = EWMA_lowpass(v, <damp>)
91 if (v < <min>) v = <min>
92 if (v > <max>) v = <max>
95 The EWMA_lowpass filter (Exponentially Weighted Moving Average) is calculated
99 coeff = 1.0 - 1.0 / 10^<damp>
100 v = average = (average * coeff) + (v * (1.0 - coeff))
103 That is, a <damp> value of 0 will cause no damping. A damping value of 1 will
104 make a coefficient of 0.9, which means that the resulting value will be 9/10
105 of the average plus 1/10 of the new value. A damping value of 2 will make
106 a coefficient of 0.99 and hence result in a value of 99/100 the average plus
107 1/100 the new value etc. The higher the <damp> value, the more damped will
113 2.1.3 <option> ................................................................
115 Most HUD instruments accept one or more options from a common set. It will be
116 explaind in the respective intrument descriptions which options are actually
117 used by that instrument. Possible values are:
119 <option> autoticks </option>
120 <option> vertical </option> \___orientation of <tape>
121 <option> horizontal </option> /
122 <option> top </option> \
123 <option> left </option> |___place of numbers in <tape>, <gauge>
124 <option> bottom </option> | top/bottom for turn-bank-indicator, etc.
125 <option> right </option> /
126 <option> both </option> _left/right for vert. and top/bottom for hor.
127 <option> noticks </option>
128 <option> arithtic </option>
129 <option> decitics </option>
130 <option> notext </option> ___no numbers on <tape>
136 <option>left</option>
137 <option>vertical</option>
146 (2.1) properties common to all instruments ------------------------------------
148 All HUD instruments will accept the following common properties (shown on
149 a <tape> instrument):
153 <name>foo tape</name>
154 <x>-100</x> <!-- 0 == center -->
155 <y>-60</y> <!-- 0 == center -->
156 <width>20</width> <!-- 0 -->
157 <height>120</height> <!-- 0 -->
158 <condition>...</condition> <!-- see section 2.1.1; default: true -->
162 The <name> is only a description for the instrument to make reading the config
163 easier. It's output in --log-level=info, but not otherwise used. The coordinates
164 define the place and size of the instrument. They are relative to the origin of
165 their parent, which is the middle of the HUD/screen by default. Positive <x> are
166 on the right, positive <y> in the upper half. The <condition> hides/reveals the
174 (2.2) HUD instruments ---------------------------------------------------------
179 (2.2.1) <label> ...............................................................
181 Draws a formatted string or number.
184 <format> ... printf-style format with only one % item. Example: "%2.3lf ft"
185 <prefix> ... prefix text \___ in addition to the <format>
186 <postfix> ... postfix text /
187 <halign> ... one of "left", "center" (default), "right".
190 <box> ... draw box around label (default: false)
191 <option> ... one of (left|right|top|bottom) ... draw arrow on this side
192 <pointer-width> ... size of pointer base
193 <pointer-lenfth> ... distance of base--peak
196 <interval> ... on/off-time in seconds (default: -1 == off)
197 <condition>...</condition> ... see secion 2.1.1 (default: true)
201 <digit> ... number of insignificant digits (those will be printed smaller)
215 <property>/accelerations/pilot/z-accel-fps_sec</property>
216 <factor>-0.03108095</factor>
220 <format>%2.1f</format>
221 <halign>right</halign>
223 <option>bottom</option> <!-- pointer on the lower edge -->
226 <interval>0.25</interval>
229 <less-than> <!-- G load > 2.0 -->
230 <property>/accelerations/pilot/z-accel-fps_sec</property>
231 <value>-64.3481</value>
234 <greater-than> <!-- G load < -1.0 -->
235 <property>/accelerations/pilot/z-accel-fps_sec</property>
236 <value>31.17405</value>
251 (2.2.2) <tape> ................................................................
272 pointer-type (moving|fixed)
273 tick-type (circle|line)
274 tick-length (constant|variable)
284 (2.2.3) <dial> ................................................................
303 (2.2.4) <gauge> ...............................................................
316 (2.2.5) <turn-bank-indicator> .................................................
329 (2.2.6) <ladder> ..............................................................
336 enable-fuselage-ref-line
338 enable-velocity-vector
342 enable-climb-dive-marker
343 enable-glide-slope-marker
346 enable-waypoint-marker
350 type (pitch|climb-dive)
360 (2.2.7) <runway> ..............................................................
370 /position/altitude-agl-ft,
371 /sim/view[0]/config/pitch-pitch-deg
372 /sim/view[0]/config/pitch-heading-deg
378 (2.2.8) <aiming-reticle> ......................................................
380 Draws MIL-STD-1787B aiming reticle. Size of bullet and inner circle are
381 determined from <width>. The outer circle radius is changeable at runtime.
383 <active-condition> ... true: stadiametric (4.2.4.4) (default)
384 false: standby (4.2.4.5)
385 <diameter-input> ... input channel: diameter of outer circle relative to
386 inner circle; default: 2.0 (= twice as big)
394 (3) <import> ==================================================================
396 Imports another HUD config into the current one. This can be a file defining
397 a single instrument ($FG_ROOT/Huds/Instruments/*.xml), a set of instruments
398 ($FG_ROOT/Huds/Sets/*.xml) or a mixture of both (for example a complete HUD
399 on its own). The x/y offets moves the reference point for the included items
400 relative to the current reference point.
403 <path>Huds/Sets/controls.xml</path>
404 <x-offset>-100</x-offset>
405 <y-offset>70</y-offset>
408 Imported files can import further files. This is allowed for up to 10 levels.
409 This is an arbitrary number and can easily be changed in the code if necessary.
411 When fgfs is called with --log-level=info, then it outputs a graphical trees
412 of all loaded/imported files, with the instruments shown as leafs.