4d4fef591b
These patches add a clock instrument, which allows to model failure ("serviceable") and to adjust the time independently of the system time (defaults to GMT). The main incentive is to make the p51d clock work and adjustable via the knob. o Offers a time string ("12:03:15") for the LCD or for LED clocks, or an empty string in case of failure/power off. The instrument assumes that digital clocks are battery buffered, so they will be updated even if there's nothing on the display. o Offers the number of seconds since midnight for analog clocks, like in the p51d. This number is not increased if !serviceable. So the clock will stand still and continue where it stopped when it's serviceable again. I did not consider voltage yet, because the Mustang's clock will need a lot more current than the LCD clock. The instrument is updated 4 times per second but returns immediately if neither time nor offset changed. The function getGMTString() in fg_props.cxx could be removed after applying these patches.
126 lines
2.9 KiB
XML
126 lines
2.9 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<!--
|
|
Default digital clock instrument.
|
|
|
|
Started summer 2000 by David Megginson, david@megginson.com.
|
|
|
|
This is an instrument configuration file for the open-source flight
|
|
simulator FlightGear (www.flightgear.org). The file is an XML-encoded
|
|
FlightGear property list defining the instrument's layers and actions.
|
|
|
|
Each instrument is composed of layers stacked on top of each other.
|
|
A layer may be a texture (with transparent parts to show the layers
|
|
underneath), text, or a special layer that switches between two
|
|
others (say, to turn an indicator light on or off). Each layer can
|
|
move independently in proportion to a property value, and text
|
|
can be generated from property values as well: all of the layer's
|
|
movements are defined as transformations.
|
|
|
|
Actions are hotspots on the instrument that will respond to a mouse
|
|
click. Actions always modify the values of properties, either by
|
|
adjusting them, toggling them, or swaping them with other
|
|
properties' values.
|
|
-->
|
|
|
|
<PropertyList>
|
|
<name>Digital Clock</name>
|
|
<w-base>120</w-base>
|
|
<h-base>120</h-base>
|
|
|
|
<layers>
|
|
<layer>
|
|
<name>bezel</name>
|
|
<condition>
|
|
<equals>
|
|
<property>/sim/aero</property>
|
|
<value>c172</value>
|
|
</equals>
|
|
</condition>
|
|
<texture>
|
|
<path>Aircraft/Instruments/Textures/bezel.rgb</path>
|
|
<x1>0.0</x1>
|
|
<y1>0.0</y1>
|
|
<x2>1.0</x2>
|
|
<y2>1.0</y2>
|
|
</texture>
|
|
<transformations>
|
|
<transformation>
|
|
<type>y-shift</type>
|
|
<offset>0</offset>
|
|
</transformation>
|
|
<transformation>
|
|
<type>x-shift</type>
|
|
<offset>-0</offset>
|
|
</transformation>
|
|
</transformations>
|
|
<w>120</w>
|
|
<h>120</h>
|
|
</layer>
|
|
|
|
<layer>
|
|
<name>clock background</name>
|
|
<texture>
|
|
<path>Aircraft/Instruments/Textures/faces-3.rgb</path>
|
|
<x1>0.5</x1>
|
|
<y1>0.0</y1>
|
|
<x2>1.0</x2>
|
|
<y2>0.5</y2>
|
|
</texture>
|
|
<w>115</w>
|
|
<h>115</h>
|
|
</layer>
|
|
|
|
<layer>
|
|
<name>display</name>
|
|
<type>text</type>
|
|
<font>led</font>
|
|
<point-size>6.5</point-size>
|
|
<color>
|
|
<red>0.0</red>
|
|
<green>0.0</green>
|
|
<blue>0.0</blue>
|
|
</color>
|
|
<chunks>
|
|
<chunk>
|
|
<type>text-value</type>
|
|
<property>/instrumentation/clock/indicated-string</property>
|
|
</chunk>
|
|
</chunks>
|
|
<transformations>
|
|
<transformation>
|
|
<type>x-shift</type>
|
|
<offset>-31</offset>
|
|
</transformation>
|
|
<transformation>
|
|
<type>y-shift</type>
|
|
<offset>-9</offset>
|
|
</transformation>
|
|
</transformations>
|
|
</layer>
|
|
<layer>
|
|
<name>glare shield</name>
|
|
<texture>
|
|
<path>Aircraft/Instruments/Textures/bezel1.rgb</path>
|
|
<x1>0.5</x1>
|
|
<y1>0.0</y1>
|
|
<x2>1.0</x2>
|
|
<y2>0.5</y2>
|
|
</texture>
|
|
<w>115</w>
|
|
<h>115</h>
|
|
<transformations>
|
|
<transformation>
|
|
<type>x-shift</type>
|
|
<offset>2</offset>
|
|
</transformation>
|
|
<transformation>
|
|
<type>y-shift</type>
|
|
<offset>-2</offset>
|
|
</transformation>
|
|
</transformations>
|
|
</layer>
|
|
|
|
</layers>
|
|
|
|
</PropertyList>
|