<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">

  <style>
<!--
/* Style Definitions */
p,div
{mso-style-name:Text;
margin-top:0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
li
{mso-style-name:Text;
margin-top:2pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.Link, div.link
{mso-style-name:Link;
margin-top:0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:#3366FF;}
li.Link
{mso-style-name:Link;
margin-top:0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:#3366FF;}
h1
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0pt;
margin-bottom:12.0pt;
margin-left:0pt;
text-align:left;
line-height:150%;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:2;
font-size:20.0pt;
font-family:Arial;
color:black;
mso-bidi-font-style:italic;}
h2
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0pt;
margin-bottom:12.0pt;
margin-left:0pt;
text-align:left;
line-height:150%;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:2;
font-size:18.0pt;
font-family:Arial;
color:#000033;
mso-bidi-font-style:italic;}
h3
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0pt;
margin-bottom:9.0pt;
margin-left:0pt;
text-align:left;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:16.0pt;
mso-bidi-font-size:13.0pt;
font-family:Arial;
color:#0000cc;}
h4
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0pt;
margin-bottom:5.0pt;
margin-left:0pt;
text-align:left;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:13.0pt;
mso-bidi-font-size:13.0pt;
font-family:Arial;
color:#00aa00;}
h5
{mso-style-next:Normal;
margin-top:3.0pt;
margin-right:0pt;
margin-bottom:3.0pt;
margin-left:0pt;
text-align:left;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:Arial;
color:#000000;}
h6
{mso-style-next:Normal;
margin-top:3.0pt;
margin-right:0pt;
margin-bottom:3.0pt;
margin-left:0pt;
text-align:left;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:12.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
color:#aa0000;}
CODE
{mso-style-name:Code;
margin:0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
mso-bidi-font-size:12.0pt;
font-family:"Courier New";
mso-fareast-font-family:"Courier New";
color:#000000;}
A:Hover
{color:#00aa00;}
BODY
{margin-left:30pt;
background:#f5f5f5;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
table
{class:T1;
style:border:medium none;
border-collapse:collapse;
border:5;
background-color:#FFFF99;
border-color:#CC0000;
border-style:inset;
width:670;
text-align:left;}
tr {vertical-align:top;}
-->
  </style>
  <title>ACES Resource Tool</title>


</head>


<body>

<h1><img src="Images/fsx-bannercontrol.jpg" width="800" height="200"></h1>
<h1>XML Gauges</h1>
<h2><a class="mozTocH2" name="mozTocId967127"></a>Overview</h2>

The ACE resource tool can be used to build a number of components for
Microsoft&reg; <span style="font-style: italic;">Flight
Simulator</span>, this document explains how to use the tool to
help build gauges. The term <span style="font-style: italic;">gauge</span>
is used to describe all the instruments in an aircraft's cockpit.<br>

<br>

The document is divided into two sections, a tutorial for new users of
the gauge system, and a reference containing information on all the
options available.<br>

<br>

<h2><a class="mozTocH2" name="mozTocId63536"></a>Table
of Contents</h2>

<ul id="mozToc">

<!--mozToc h2 2 h3 3 h4 4--><li><a href="#mozTocId967127">Overview</a>
    <ul>

      <li><a href="#mozTocId63536">Table of Contents</a></li>

      <li><a href="#mozTocId295060">XML Gauge
Tutorial</a>
        <ul>

          <li><a href="#mozTocId981905">Step 1: Setup</a></li>

          <li><a href="#mozTocId843209">Step 2:
Specify the Gauges</a></li>

          <li><a href="#mozTocId621773">Step 3: Add
the new Panel</a></li>

          <li><a href="#mozTocId922281">Step 4:
Create a simple Fuel Pressure Gauge</a>
            <ul>

              <li><a href="#mozTocId203194">Add
Background Art to the Fuel Pressure Gauge</a></li>

              <li><a href="#mozTocId107867">Add
Elements to the Fuel Pressure Gauge</a></li>

              <li><a href="#mozTocId175396">Previewing
the Fuel Pressure Gauge</a></li>

            </ul>

          </li>

          <li><a href="#mozTocId217119">Step 5:
Create a Stopwatch Gauge</a>
            <ul>

              <li><a href="#mozTocId84182">The
Stopwatch Elements</a></li>

              <li><a href="#mozTocId6163">The
Stopwatch Expression Logic</a></li>

              <li><a href="#mozTocId186949">Previewing
the Stopwatch</a></li>

            </ul>

          </li>

          <li><a href="#mozTocId981025">Step 6:
Create a Cabinet file</a></li>

          <li><a href="#mozTocId27172">Step 7:
Testing the new Gauges</a></li>

          <li><a href="#mozTocId418633">Step 8:
Adding Artwork to the Stopwatch</a></li>

        </ul>

      </li>

      <li><a href="#mozTocId848419">XML
Gauge Reference</a>
        <ul>

          <li><a href="#mozTocId451341">Expression
Evaluation</a>
            <ul>

              <li><a href="#mozTocId746560">Expression
Parameters</a></li>

              <li><a href="#mozTocId648798">Reverse
Polish Notation</a></li>

              <li><a href="#mozTocId231151">Expression
Operators</a></li>

              <li><a href="#mozTocId783591">Expression
Evaluation Examples</a></li>

            </ul>

          </li>

          <li><a href="#mozTocId999490">Gauge Objects</a></li>

          <li><a href="#mozTocId568591">Comment
Objects</a></li>

          <li><a href="#mozTocId279049">Element
Objects</a>
            <ul>

              <li><a href="#mozTocId859288">Arc
Objects</a></li>

              <li><a href="#mozTocId828691">Gauge
Colors</a></li>

              <li><a href="#mozTocId706563">Circle
Objects</a></li>

              <li><a href="#mozTocId321959">CustomDraw
Objects</a></li>

              <li><a href="#mozTocId385474">Ellipse
Objects</a></li>

              <li><a href="#mozTocId285897">GaugeText
Objects</a></li>

              <li><a href="#mozTocId103000">HorizontalLine
Objects</a></li>

              <li><a href="#mozTocId408211">MaskImage
Objects</a></li>

              <li><a href="#mozTocId69607">Pie
Objects</a></li>

              <li><a href="#mozTocId929466">Polygon
Objects</a></li>

              <li><a href="#mozTocId401599">Polyline
Objects</a></li>

              <li><a href="#mozTocId33639">Rectangle
Objects</a></li>

              <li><a href="#mozTocId377007">Rotation
Objects</a></li>

              <li><a href="#mozTocId871249">Select
Objects</a></li>

              <li><a href="#mozTocId699062">Shift
Objects</a></li>

              <li><a href="#mozTocId778924">VerticalLine
Objects</a></li>

            </ul>

          </li>

          <li><a href="#mozTocId8002">Include
Objects</a></li>

          <li><a href="#mozTocId785469">Image Objects</a></li>

          <li><a href="#mozTocId132051">Macro Objects</a></li>

          <li><a href="#mozTocId957980">MouseArea
Objects</a>
            <ul>

              <li><a href="#mozTocId767989">Tooltip
Objects</a></li>

              <li><a href="#mozTocId86289">MouseClick
Objects</a></li>

            </ul>

          </li>

          <li><a href="#mozTocId45130">Update Objects</a></li>

        </ul>

      </li>

    </ul>

  </li>

</ul>

<hr>
<h2><a class="mozTocH2" name="mozTocId295060"></a><a name="XML_Gauge_Tutorial"></a>XML Gauge
Tutorial</h2>

This tutorial goes through all the steps required to add a panel to an
aircraft, and add existing and new gauges to that panel. The tutorial
also covers creating a cabinet file for the gauges, and testing them in
<span style="font-style: italic;">Flight Simulator</span>.<br>

<br>

<ul>

  <li><a href="#Step_1:_Setup">Step 1: Setup</a></li>

  <li><a href="#Step_2:_Specify_the_Gauges">Step 2:
Specify the Gauges</a></li>

  <li><a href="#Step_3:_Add_the_new_Panel">Step 3:
Add the new Panel</a></li>

  <li><a href="#Step_4:_Create_a_simple_Fuel_Pressure">Step
4: Create a simple Fuel Pressure Gauge</a></li>

  <li><a href="#Step_5:_Create_a_Stopwatch_Gauge">Step
5: Create a Stopwatch Gauge</a></li>

  <li><a href="#Step_6:_Create_a_Cabinet_file">Step
6: Creating a Cabinet File</a></li>

  <li><a href="#Step_7:_Testing_the_new_Gauges">Step
7: Testing the new Gauges</a></li>

  <li><a href="#Step_8:_Adding_Artwork_to_the_Stopwatch">Step
8: Adding Artwork to the Stopwatch</a></li>

</ul>

<br>

<h3><a class="mozTocH3" name="mozTocId981905"></a><a name="Step_1:_Setup"></a>Step 1: Setup</h3>

The building and testing of gauges requires a lot of trial and error,
so it is a good idea to set up the tools required to be very convenient
for frequent. use. You will find that you will be building gauges,
running <span style="font-style: italic;">Flight Simulator</span>,
finding many errors, then repeating this process for some time. The
following set up makes this process reasonably quick.<br>

<ol>

  <li>Place the ACE.exe tool in the rool directory of Flight
Simulator (the same directory as FSX.exe). Check the simpropace.dll is in that directory too. </li>

  <li>Create a directory outside of the <i>Flight Simulator</i> installation
(perhaps under My Documents), called something appropriate like New
Gauges.</li>

  <li>Create a sub-directory of New Gauges, with the name of
&nbsp;the
cabinet file you will eventually create containing the gauges and their
artwork, for this tutorial call this sub-directory Test Gauges. Place
the cabbing tools handy (see the <a href="../Cabdir SDK/Cabdir.html">Cabdir</a> documentation), perhaps under New Gauges, but not under Test
Gauges.</li>

  <li>Have your artwork creation tools handy, though for this
tutorial Microsoft &reg; Paint will suffice.</li>
</ol>

<h3><a class="mozTocH3" name="mozTocId843209"></a><a name="Step_2:_Specify_the_Gauges"></a>Step 2: Specify
the Gauges</h3>

For this tutorial we are going to implement the following, for the
basic Cessna 172 aircraft:<br>

<ul>

  <li>A new panel that is to appear on the Instrument Panel menu,
called Test Panel, that can be selected to be visible or not.</li>

  <li>The panel will contain one existing gauge, the airspeed
indicatior.</li>

  <li>The panel will contain two new gauges, a fuel pressure
indicator, and a stopwatch.</li>

  <li>The fuel pressure indicatior will do no more than display
the current fuel pressure.</li>

  <li>The stopwatch will show a rotary dial of seconds, and have
an active start/stop toggle button, and an active reset button.</li>

</ul>

The artwork for these gauges is not going to look great. One method of
approaching gauge development is to complete the gauge mechanics first,
using simple rectangles and circles as artwork, and then when the gauge
works correctly, replace the simple art with carefully drawn images.<br>

<br>

<h3><a class="mozTocH3" name="mozTocId621773"></a><a name="Step_3:_Add_the_new_Panel"></a>Step 3: Add the
new Panel</h3>

Unlike gauges, panels are particular to an aircraft. Go into the
SimObjects folder of Flight Simulator, then Aircraft, then find the
Cessna 172, then in the panel directory, open up the panel
configuration file (panel.cfg) in a text editor (Notepad is quite
sufficient for this).&nbsp;For full details of the panel
configuration
file refer to the Aircraft
Panels document (though you will not need to for this tutorial).<br>

<br>

In order to add a new panel we must first make a single entry under
Window Titles, so add the line shown in bold below, <span style="font-weight: bold;"></span>so that the first
lines of the configuration file now look like this:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined">//
Panel Configuration file<br>

// Cessna 172sp<br>

// Copyright (c) 2001-2003 Microsoft Corporation.&nbsp; All rights
reserved.<br>

      <br>

[Window Titles]<br>

Window00=Main Panel<br>

Window01=Radio Stack<br>

Window02=GPS<br>

Window03=Annunciator<br>

Window04=Compass<br>

Window05=Mini Panel<br>

      <span style="font-weight: bold;">Window06=Test Panel</span><br>

      <br>

[Window00]<br>

file=panel_background_640.bmp<br>

file_1024=panel_background_1024.bmp<br>

size_mm=640<br>

position=7<br>

visible=1<br>

no_luminous=1<br>

ident=MAIN_PANEL<br>

      <br>

gauge00=Cessna!ADF,545,86<br>

gauge01=Cessna172!Airspeed,145,56<br>

gauge02=Cessna!Altimeter,347,57<br>

gauge03=Cessna!Attitude,246,56<br>

gauge04=Cessna!Avionics Switch,240,286<br>

gauge06=Cessna!DME,544,49<br>

gauge07=Cessna!Flaps,598,286<br>

gauge08=Cessna!Fuel_Selector, 451, 287</td>

    </tr>

  </tbody>
</table>

<br>

<span style="font-weight: bold;"></span>The name
Test Panel will now appear in <span style="font-style: italic;">Flight
Simulator</span>. To add the panel itself , find the entry for
Mini Panel, and add the lines shown in bold below:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined">[Window05]<br>

position=7<br>

size_mm=631,100<br>

child_3d=1<br>

background_color=0,0,0<br>

ident=MINIPANEL<br>

      <br>

gauge00=Cessna172!Airspeed,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0, 1<br>

gauge01=Cessna!Turn_Indicator,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
102, 0<br>

gauge02=CessnaWAlpha!Attitude_Alpha, 207, 0<br>

gauge03=Cessna!Heading_Indicator,&nbsp;&nbsp;&nbsp; 312, 0<br>

gauge04=Cessna!Altimeter,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
417, 0<br>

gauge05=Cessna!Vertical_Speed,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
531, 0<br>

      <br>

      <span style="font-weight: bold;">[Window06]</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">file=Test_Panel_Background.bmp</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">position=6</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">size_mm=240,240</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">visible=0</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">ident=10001</span><br style="font-weight: bold;">

      <br style="font-weight: bold;">

      <span style="font-weight: bold;">gauge00=Cessna172!Airspeed,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; 5, 5, 90, 90</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">gauge01=TestGauges!FuelPressure,&nbsp;&nbsp;&nbsp;
105, 5</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">gauge02=TestGauges!Stopwatch,&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; 70,100</span><br>

      <br>

[VCockpit01]<br>

size_mm=512,512<br>

pixel_size=512,512</td>

    </tr>

  </tbody>
</table>

<br>

The position simply refers to the default position where the panel will
appear on the screen (6 is bottom left). The size_mm field is a
misnomer, it does not represent millimeters, but arbitary design units.
However it is so much easier to create panels where these units are
identical to the size of the elements in pixels, that it is recommended
that this entry is the pixel size of the panel background bitmap (240
by 240 for our tutorial). With visible set to 0 the panel will not
appear until the user requests it, and the ident code can either be one
of the preset panels (such as MAIN_PANEL, or THROTTLE_PANEL) or be any
number above
10000. Lower codes are used by <span style="font-style: italic;">Flight
Simulator</span>.<br>

<br>

The three gauge entries give the gauge number, cabinet file, gauge
name, and then x and y co-ordinates relative to the top left hand
corner of the panel, and optional width and height parameters (which
will scale the gauge if they are not identical to the gauge sizes).<br>

<br>

This completes the changes to the configuration file, so save it off.<br>

<br>

Artwork needs to be created that fits the entries we have just made in
the panel configuration file, namely a file called
Test_Panel_Background.bmp, with a size of 240 by 240 pixels. For this
tutorial, create a colored square using Paint, and save it to the same
directory as the panel configuration file.<br>

<br>

This is all that is necessary to add a panel for the 2D cockpit view in
Flight Simulator.<br>

<br>

<h5>Note</h5>

<dl>

  <dd>Comment marks ("//") work in the panel configuration files.
You
could test the panel we have just created by commenting out the two
lines beginning with gauge01 and gauge02, and then run Flight
Simulator. You should be able to turn the panel on and off, and notice
that the airspeed indicator responds exactly as the one in the main
panel. If this does not happen, carefully go over this step again.</dd>

</dl>

<h3><a class="mozTocH3" name="mozTocId922281"></a><a name="Step_4:_Create_a_simple_Fuel_Pressure"></a>Step
4: Create a simple Fuel Pressure Gauge</h3>

The fuel pressure gauge is certainly the simplest of the two we plan to
build. All it is doing is displaying a single reading that is readily
available in the simulator.<br>

Start up the ACE tool, and select New Document. Right click on the new
entry in the Property Sets column, and select Insert. An Insert dialog
should appear, and select SimGauge in the Namespace box. Then scroll
down and click on Gauge in the long list of properties. A gauge icon
should now appear in the Property Sets column. Clicking on one
of these entries will bring up all the objects properties. The parent
nodes properties contain the xml file name for the gauge, so enter
FuelPressure.xml in this field. In the properties for the Gauge entry,
change the ArtDirectory to the location My Documents\New Gauges\Test
Gauges for this tutorial. This is the location of the artwork for the
tool, not Flight Simulator (which requires the art to be cabbed up with
the xml gauge). However, if you set this location to be Test Gauges,
&nbsp;then the artwork is in the right location, both for the tool
and
for creating the cabinet files (which we do as the penultimate step).<br>

<br>

<h4><a class="mozTocH4" name="mozTocId203194"></a><a name="Add_Background_Art_to_the_Fuel_Pressure"></a>Add
Background Art to the Fuel Pressure Gauge</h4>

Next, right click on the Gauge and select Image. This will be the
background image for the gauge. Open up the properties for this image,
and make an entry for Name (the filename), such as
FuelPressureBackground.bmp.<br>

We need to create artwork for this background, so open up Paint again,
and save off a solid rectangular block of color, 100 pixels wide by 80
pixels in height. Call this file, FuelPressureBackground.bmp, and save
it in the Test Gauges directory.<br>

<h4><a class="mozTocH4" name="mozTocId107867"></a><a name="Add_Elements_to_the_Fuel_Pressure_Gauge"></a>Add
Elements to the Fuel Pressure Gauge</h4>

Right click on the Gauge node again, and add an <a href="#Element_Objects">Element</a>. Do this three
times to add three elements. Click on the first element to bring up its
properties. You will notice that the id entry for each element is
simply "Element". Click on these and change the ids to <span style="font-weight: bold;">Fixed Text</span> for the
first element, <span style="font-weight: bold;">Output box</span>
for the second element, and <span style="font-weight: bold;">Display</span>
<span style="font-weight: bold;">text</span>
for the third element. This text is simply there to help in gauge
development, and does not appear anywhere in the simulator. It is good
to get into the practice of changing the ids to meaningful names, as
some gauges will contain many elements. Each element is used to
describe a small area of functionality of the gauge.<br>

<br>

<h5>Properties of &nbsp;the Fixed Text element</h5>

The location of elements is relative to their parent object in the
design of the gauge. So for the Fixed Text element, change
FloatPosition to <span style="font-weight: bold;">5,10</span>.
This will start the text 5 pixels in, 10 pixels down, on the gauge
background.<br>

This element describes no more than the words "Fuel Pressure" on the
gauge. To do this right click on the&nbsp;element, select Insert
then
<a href="#GaugeText_Objects">GaugeText</a>, and then
change just a few properties of the GaugeText
object.:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontFace</td>

      <td align="undefined" valign="undefined">Arial</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontColor</td>

      <td align="undefined" valign="undefined">gold</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontHeight</td>

      <td align="undefined" valign="undefined">13</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">GaugeString</td>

      <td align="undefined" valign="undefined">Fuel
Presure</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">90,
15</td>

    </tr>

  </tbody>
</table>

<br>

<h5>Properties of the Output box element</h5>

The output box is simply a rectangle where the display text is to
appear within. Change its FloatPosition to <span style="font-weight: bold;">5, 40</span>. Then insert a
<a href="#Rectangle_Objects">Rectangle</a> object as
a child of this element. Change the Rectangle properties to those shown
below:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">1</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Width</td>

      <td align="undefined" valign="undefined">90</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Height</td>

      <td align="undefined" valign="undefined">24</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">darkslateblue</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">black</td>

    </tr>

  </tbody>
</table>

<br>

The colors for text, lines and shapes can be entered either as names,
or as hex RGB values. The document <a href="Images/Gauge Colors.mht">Gauge Colors</a> contains the full list.<br>

<br>

<h5>Properties of the Display text element</h5>

This is the third and final element in the gauge. Set its FloatPostion
to <span style="font-weight: bold;">10, 44</span>.
Then insert another&nbsp;<a href="#GaugeText_Objects">GaugeText</a>
object as a child of this element. There
is one important difference between this text and that for the first
element, in that for this element we need to display the value of a
simulation variable, not fixed text. Make the following entries in the
new GaugeText object:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontFace</td>

      <td align="undefined" valign="undefined">Courier</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontColor</td>

      <td align="undefined" valign="undefined">red</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontHeight</td>

      <td align="undefined" valign="undefined">16</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">GaugeString</td>

      <td align="undefined" valign="undefined">%(
(A:GENERAL ENG FUEL PRESSURE:1, psi) )%!09d!</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">HorizontalAlign</td>

      <td align="undefined" valign="undefined">LEFT</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">90,
16</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">VerticalAlign</td>

      <td align="undefined" valign="undefined">CENTER</td>

    </tr>

  </tbody>
</table>

<br>

The key here is the GaugeString. The <span style="font-weight: bold;">A:GENERAL ENG FUEL PRESSURE</span>,
is a simulation variable (there are many hunderds of these, listed in
the Simulation Variables document). The index <span style="font-weight: bold;">:1</span>
is necessary as the fuel pressure is measured per engine, and psi
requests that the result be returned as pounds per square inch.
Simulation variables must be enclosed by parentheses. The<span style="font-weight: bold;"> %</span> signs indicate
that the
contents should be evaluated rather than output as a string. The <span style="font-weight: bold;">%!09d!</span>
indicate that nine digits should be output, that leading 0s should be
included (up to nine of them!), and that the result should be treated
as a decimal integer. &nbsp;The section <a href="#Expression_Evaluation">Expression Evaluation</a>
goes over
the full process for evaluating gauge scripts, which can be quite long
and complex. Be very careful to enter the text exactly as shown
(perhaps cut and paste it from this document), as a wrong space or
missing parentheses can cause the expression evaluation to fail (it is
not very flexible or foregiving in this regard).<br>

<br>

<h4><a class="mozTocH4" name="mozTocId175396"></a><a name="Previewing_the_Fuel_Pressure_Gauge"></a>Previewing
the Fuel Pressure Gauge</h4>

The fuel pressure gauge is now complete and ready for testing. The tree
structure of the gauge, when fully expanded, should look like this:<br>

<br>

<table style="text-align: left; width: 303px; height: 266px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><img style="width: 284px; height: 260px;" alt="" src="Images/Fuel%20Pressure%20Gauge.jpg"></td>

    </tr>

  </tbody>
</table>

<br>

In the View menu, select Preview, then click on one of the gauge
elements to view a preview in the right pane. It should look something
like this.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><img style="width: 158px; height: 120px;" alt="" src="Images/Fuel%20Pressure%20Preview.jpg"><br>

      </td>

    </tr>

  </tbody>
</table>

<br>

Make sure to save off the xml document reasonably frequently. Before we
test the fuel pressure gauge, we will build the stopwatch.<br>

<br>

<h3><a class="mozTocH3" name="mozTocId217119"></a><a name="Step_5:_Create_a_Stopwatch_Gauge"></a>Step 5:
Create a Stopwatch Gauge</h3>

The specification of our panel requires: "<span style="font-style: italic;">The stopwatch will show a rotary
dial of seconds, and have an active start/stop toggle button, and an
active reset button".</span>
This makes the gauge considerably more complex than the simple text
display of our fuel pressure gauge. The stopwatch will require handling
of a rotation (the seconds needle), active mouse clicks (the two
buttons), but also the task of persisting information about the gauge
from one mouse click to the next, this is necessary in the simplest
case for the toggle button - its state must be recorded in order for
it to be changed from start to stop, or vice versa.<br>

In order to keep things a little bit simpler, we are not going to use
prepared artwork, but will build the stopwatch from simple graphics
primitives, and the stopwatch will have a single second hand.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId84182"></a><a name="The_Stopwatch_Elements"></a>The Stopwatch
Elements</h4>

Create the following stopwatch <a href="#Element_Objects">elements</a>.<br>

<br>

<h5>The Stopwatch Rim</h5>

Insert an element, change the id to <span style="font-weight: bold;">Rim</span>,
and give it a FloatPosition of <span style="font-weight: bold;">50,
60</span>. Then insert a <a href="#Circle_Objects">Circle</a>
object with the following properties.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis</td>

      <td align="undefined" valign="undefined">50,
50</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Radius</td>

      <td align="undefined" valign="undefined">50</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">black</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">3</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">steelblue</td>

    </tr>

  </tbody>
</table>

<br>

<h5>The Stopwatch numerals</h5>

For our tutorial we will limit the stopwatch to 4 numerals: <span style="font-weight: bold;">60</span>, <span style="font-weight: bold;">30</span>, <span style="font-weight: bold;">45</span> and <span style="font-weight: bold;">15</span>.
If you want to develop the stopwatch fully, you would probably want to
replace these elements with background art, with the numerals appearing
on that art.<br>

Create four elements, change their ids to 60, &nbsp;30, 45 and 15,
and give them FloatPositions of :<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Numeral</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">FloatPosition</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">60</td>

      <td align="undefined" valign="undefined">40,
14</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">30</td>

      <td align="undefined" valign="undefined">40,
96</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">45</td>

      <td align="undefined" valign="undefined">4, 55</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">15</td>

      <td align="undefined" valign="undefined">84,
55</td>

    </tr>

  </tbody>
</table>

<br>

Next, insert <a href="#GaugeText_Objects">GaugeText</a>
entries for all four elements, with the following properties:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontFace</td>

      <td align="undefined" valign="undefined">Arial</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontColor</td>

      <td align="undefined" valign="undefined">gold</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontHeight</td>

      <td align="undefined" valign="undefined">12</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">GaugeString</td>

      <td align="undefined" valign="undefined">15,
30, 45 and 60 (appropriately for each gauge element)</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">HorizontalAlign</td>

      <td align="undefined" valign="undefined">CENTER</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">20,
20</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">VerticalAlign</td>

      <td align="undefined" valign="undefined">CENTER</td>

    </tr>

  </tbody>
</table>

<br>

<h5>The Start/Stop button</h5>

Add another element, change its id to <span style="font-weight: bold;">Start/Stop button</span>,
and give it a FloatPosition of &nbsp;<span style="font-weight: bold;">44, 1</span>. Then insert a
<a href="#Rectangle_Objects">Rectangle</a> object
with the following properties:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">1</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Width</td>

      <td align="undefined" valign="undefined">12</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Height</td>

      <td align="undefined" valign="undefined">10</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">silver</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">silver</td>

    </tr>

  </tbody>
</table>

<br>

<h5>The Reset button</h5>

Add another element, change its id to <span style="font-weight: bold;">Reset button</span>, and
give it a FloatPosition of &nbsp;<span style="font-weight: bold;">17,17</span>.
Then insert a <a href="#Rectangle_Objects">Rectangle</a>
object with the following properties:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis</td>

      <td align="undefined" valign="undefined">5, 5</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">1</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Width</td>

      <td align="undefined" valign="undefined">10</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Height</td>

      <td align="undefined" valign="undefined">10</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">silver</td>

    </tr>

  </tbody>
</table>

<br>

Note the entry in the Axis property, so that the rectangle will rotate
about its center. As we need the button to look as if it is attached to
the stopwatch rim, insert a <a href="#Rotation_Objects">Rotation</a>
object as a child of the Reset
button element, and delete the automatically created sub-objects,
except Expression. Do not change any of the Rotation objects
properties, and simply add the number <span style="font-weight: bold;">-0.7</span>
as the entry for the Script property of the expression (this will
rotate the rectangle minus 0.7 radians, which is about right).<br>

<br>

<h5>The Needle</h5>

Add another element, change its id to <span style="font-weight: bold;">Needle</span>, and give it
a FloatPosition of <span style="font-weight: bold;">50,60</span>.
The insert a <a href="#Polygon_Objects">Polygon</a>
object, and give it the following properties:<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis</td>

      <td align="undefined" valign="undefined">50,
60</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">red</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">1</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">red</td>

    </tr>

  </tbody>
</table>

<br>

A polygon consists of a list of <a href="#Point_Objects">Points</a>,
so insert three points with the
following FloatPosition entries (to define a simple triangle):<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Point</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">FloatPosition</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">48,
62</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">50,
12</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">3</td>

      <td align="undefined" valign="undefined">52,
62</td>

    </tr>

  </tbody>
</table>

<br>

The needle will also need a rotation object, so insert a <a href="#Rotation_Objects">Rotation</a>, and
entries for <a href="#Rotation_Objects">Rotation</a>,
<a href="#Expression_Objects">Expression</a>, <a href="#FailureTable_Objects">FailureTable</a> and <a href="#Failure_Objects">Failure</a>, will all
appear. Leave this objects for now, except change the following in the
Failure object (this indicates that if the user fails the electrical
system, the stopwatch should freeze).<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Fail_Key</td>

      <td align="undefined" valign="undefined">SYSTEM_ELETRICAL_PANELS</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Fail_Action</td>

      <td align="undefined" valign="undefined">Freeze</td>

    </tr>

  </tbody>
</table>

<br>

We will come back to the all-important expression object, after first
creating the MouseArea and MouseClick objects, as the logic of the
expressions are all connected and complicated.<br>

<br>

<h5>The Main MouseArea</h5>

There can only be one main mouse area for a gauge, so insert a
<a href="#MouseArea_Objects">MouseArea</a> object,
and give it the following properties (which simply
indicate it covers the full area of the stopwatch, with a normal
cursor).<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id<br>

      </td>

      <td align="undefined" valign="undefined">MouseArea
all<br>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FloatPosition<br>

      </td>

      <td align="undefined" valign="undefined">0, 0<br>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">100,
110</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">CursorType</td>

      <td align="undefined" valign="undefined">normal</td>

    </tr>

  </tbody>
</table>

<br>

<h5>The start/stop MouseArea</h5>

Insert another <a href="#MouseArea_Objects">MouseArea</a>
as a child of the main mouse area. This area is to be active, and
related to a mouse click.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id<br>

      </td>

      <td align="undefined" valign="undefined">start/stop<br>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FloatPosition<br>

      </td>

      <td align="undefined" valign="undefined">41, 1<br>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">12,
10</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">CursorType</td>

      <td align="undefined" valign="undefined">Hand</td>

    </tr>

  </tbody>
</table>

<h5><br>

</h5>

<h5>The reset MouseArea</h5>

Insert yet another <a href="#MouseArea_Objects">MouseArea</a>
as a child of the main mouse area, and a
peer of the start/stop area. This area is also to be active, and
related to a mouse click.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Entry</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id<br>

      </td>

      <td align="undefined" valign="undefined">reset<br>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FloatPosition<br>

      </td>

      <td align="undefined" valign="undefined">14,
14<br>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">10,
10</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">CursorType</td>

      <td align="undefined" valign="undefined">Hand</td>

    </tr>

  </tbody>
</table>

<br>

<h5>The MouseClick objects</h5>

<a href="#MouseClick_Objects">MouseClick</a> objects
should be inserted for both the start/stop and reset
mouse areas. Both should have their ClickType properties set to:<br>

<span style="font-weight: bold;">LeftSingle+LeftRelease</span>.
The only other property to change is the Script, which is complex and
explained next.<span style="font-weight: bold;"><br>

<br>

</span>
<h4><a class="mozTocH4" name="mozTocId6163"></a><span style="font-weight: bold;"><a name="The_Stopwatch_Expression_Logic"></a>The
Stopwatch Expression Logic</span></h4>

Now comes the hard part, entering expression logic for both the mouse
clicks and the needle rotation. Expression logic is entered using
reverse polish notation.<br>

<br>

Starting with the reset button, enter the following text for the mouse
click Script:<br>

<br>

<span style="font-weight: bold;">(M:Event) 'LeftSingle'
scmp 0 == if{ 1
(&gt;L:RST Pressed,bool) 0 (&gt;L:TotalRunning,seconds) 0
(&gt;L:Running,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ 0
(&gt;L:RST Pressed,bool) }<br>

</span><br>

The logic here is based around local variables, three of which have
been used here:<br>

<ul>

  <li><span style="font-weight: bold;">L:TotalRunning</span>
holds the
time the stopwatch has run, in seconds, since the last time start was
pressed. As the user has pressed the reset button, this is set back to
0. The entry <span style="font-weight: bold;">0
(&gt;L:TotalRunning, seconds)</span> does the assignment.
Greater than signs preceding variables indicate an assignment.</li>

  <li><span style="font-weight: bold;">L:Running</span>
is simply a boolean indicating whether the stopwatch is running or not.
The assignment <span style="font-weight: bold;">0
(&gt;L:Running, bool)</span> sets this to false.</li>

  <li><span style="font-weight: bold;">L:RST Pressed</span>
is a
boolean we do not use in this implementation of a stopwatch, but will
be used if you add graphical images to the stopwatch, showing the reset
button being pressed when the mouse area is clicked. This local
variable can be checked, and a different image drawn, with the use of a
    <a href="#Select_Objects">Select</a> object.</li>

</ul>

<p>Note also the use of the <span style="font-weight: bold;">M:Event</span>
mouse variable. The <span style="font-weight: bold;">(M:Event)
'LeftSingle' scmp 0 == if{ </span>entry
is processed as if the mouse event and the text string 'LeftSingle' are
compared, and are equal, then the contents of the if statement block is
processed. Similarly for the mouse button release.</p>

<p>The full range of variables and statements that can make up
expressions, and&nbsp;Reverse polish notation is explained in more
detail in the section on <a href="#Expression_Evaluation">Evaluating
Expressions</a>. </p>

<p>Next enter the Script for the mouse click of the start/stop
button.
This is a bit more complicated as the button has two functions,
starting or stopping the stopwatch depending on its current state.</p>

<p style="font-weight: bold;">(M:Event) 'LeftSingle' scmp
0 == if{ 1
(&gt;L:STSTP Pressed,bool) (L:Running,bool) !
(&gt;L:Running,bool) }
(L:Running, bool) ! if{ (P:Absolute time, seconds) (&gt;L:Offset,
seconds) } (M:Event) 'LeftRelease' scmp 0 == if{ 0 (&gt;L:STSTP
Pressed,bool) }</p>

<p>Notice how the first if statement toggles the <span style="font-weight: bold;">L:Running</span> local
variable: <span style="font-weight: bold;">(L:Running,bool)
! (&gt;L:Running,bool)</span> assigns the NOT value of the
boolean back to the variable. The second if statement then tests the
value of <span style="font-weight: bold;">L:Running</span>
and if it is false (the stopwatch is not running) the absolute time in
seconds is assigned to another local variable <span style="font-weight: bold;">L:Offset</span>. This
variable is used to calcuate the rotation of the needle. The variable <span style="font-weight: bold;">P:Absolute time</span> is
provided by <span style="font-style: italic;">Flight
Simulator</span>, and along with all the other program variables,
can be found in the Simulation Variables document.</p>

<p></p>

<p>Again there is a local variable <span style="font-weight: bold;">L:STSTP Pressed</span> to
handle different graphic images for the button, should you wish to
implement them.</p>

<br>

<p>Finally, we need to enter the Expression for the needle
element's rotation, enter:</p>

<p></p>

<span style="font-weight: bold;">(L:Running,bool) if{
(P:Absolute time,
seconds) (L:Offset,seconds) - (&gt;L:TotalRunning,seconds) } els{
(P:Absolute time, seconds) (L:TotalRunning,seconds) -
(&gt;L:Offset,seconds) } (L:TotalRunning, seconds) 0.104719 *</span>
<p></p>

<p>The logic here is that if the stopwatch is running (<span style="font-weight: bold;">L:Running</span>
is true) then the total running time is the absolute time in seconds,
minus the offset (the absolute time when the stopwatch was last
stopped). If the stopwatch is not running then the absolute time in
seconds, minus the running time in seconds, is assigned to the offset.
Finally the value of <span style="font-weight: bold;">L:TotalRunning</span>is
applied to the rotation. To do this this value (in seconds) is
converted to radians by multiplying by 0.104719 (which is 2 * pi - one
full circle - divided by 60, or the number of radians per sixtieth of a
full rotation).</p>

<p>The stopwatch is now ready for testing, but first preview it
to ensure the various elements are in the right place.</p>

<h4><a class="mozTocH4" name="mozTocId186949"></a><a name="Previewing_the_Stopwatch"></a>Previewing the
Stopwatch</h4>

When completed, the stopwatch component tree should look like this:<br>

<span style="font-family: Arial;"><span style="font-weight: bold;"></span></span><br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><img style="width: 271px; height: 655px;" alt="" src="Images/Stopwatch%20elements.jpg"></td>

    </tr>

  </tbody>
</table>

<br>

And in the Preview window the stopwatch should appear.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><img style="width: 102px; height: 110px;" alt="" src="Images/Stopwatch%20Preview.jpg"></td>

    </tr>

  </tbody>
</table>

<br>

<h5>Testing the Stopwatch in Preview mode</h5>

It is possible to do some limited testing within the tool by overriding
the complex scripts we have entered. For example, to test the rotation
of the needle select the Expression of the Rotation of the Needle
element - this expression begins with <span style="font-weight: bold;">(L:Running,bool).....</span><br>

We do not want to delete any of the text we have entered, but we can
add some text to the beginning of the script, to test the rotation, and
then delete it. Change the expression by adding the following text:<br>

<span style="font-weight: bold;"><br>

pi quit&nbsp;(L:Running,bool)....</span><br>

<br>

The <span style="font-weight: bold;">quit</span>
entry forces all evaluation to stop, so the value <span style="font-weight: bold;">pi</span>
is used for the rotation. The stopwatch in the preview screen should
show the needle hand pointing at 30 (pi radians is 180 degrees). Next
change the entry to:<br>

<br>

<span style="font-weight: bold;">1.5 pi * quit
(L:Running,bool)<br>

</span><br>

The needle should now point at 45. If you get this, all is well so
delete the testing text. If not, re-examine all the entries for the
Needle element, checking you have entered them correctly.<br>

<br>

Both the new gauges are now complete, the next steps are to cab them up
and test them in <span style="font-style: italic;">Flight
Simulator</span>.<br>

<br>

<h3><a class="mozTocH3" name="mozTocId981025"></a><a name="Step_6:_Create_a_Cabinet_file"></a>Step 6:
Create a Cabinet file</h3>

<br>

Run the cabdir tool on the New Gauges/TestGauges directory. This will
compress the three files, FuelPressure.xml, Stopwatch.xml and
FuelPressureBackground.xml into one .cab file, called TestGauges.cab.
You can run the cabdir tool in a number of ways:<br>

<ol>

  <li>Drag the TestGauges directory and drop it onto the Cabdir
icon
(in the Cabdir_SDK folder in the SDK installation). This is the
simplest way, but does not allow you to change any of cabdir's
parameters (which in most cases is fine). The cab file will be located
in the root directory of the TestGauges directory.</li>

  <li>Go to the Cabdir_SDK folder in the command line, and run
cabdir from the command line.</li>

  <li>Use the Comm4 tool from the SDK installation, it will allow
you
to select the folder to be cabbed, and also adjust the parameters if
necessary (such as not cabbing up sub-folders, which may contain
information you do not need in the final cab file).</li>

</ol>

Copy the cab file (which has a cabinet style icon) into the <span style="font-style: italic;">Flight
Simulator </span>Gauges
directory. These gauges are independent of the simulation aircraft, so
can be used in any panel of any of the aircraft. For this tutorial
though, we have simply added them to the Cessana C172.<br>

The process of creating a panel, new gauges and adding them to the
simulation is now complete. The
next stage is to test them.<br>

<br>

<h3><a class="mozTocH3" name="mozTocId27172"></a><a name="Step_7:_Testing_the_new_Gauges"></a>Step 7:
Testing the new Gauges</h3>

Run <span style="font-style: italic;">Flight Simulator</span>,
and
select the Cessna C172 (which is the default aircraft) and just click
Fly Now to load up your new gauges. You should be able to
select the panel from the Instrument Panel menu, and then watch the
fuel pressure gauge rise slowly as you increase speed, and be able to
click on the stopwatch
buttons and watch the needle rotate.<br>

If all goes perfectly, which it rarely does, you will have completed
your project. However, it is far more common for the gauges not to
appear, be positioned, or work quite as you intended, so this is simply
the start of an iterative process in getting the gauges just right.<br>

<br>

<h3><a class="mozTocH3" name="mozTocId418633"></a><a name="Step_8:_Adding_Artwork_to_the_Stopwatch"></a>Step
8: Adding Artwork to the Stopwatch</h3>

The stopwatch includes local variables that indicate the status of the
start/stop and reset buttons. This allows you to extend this gauge so
that you can see these button being depressed as you select them. This
involves a new gauge element we have not yet used, the <a href="#Select_Objects">Select</a> element,
with two child <a href="#Case_Objects">Case</a>
objects ( representing the buttons in an
up and down state).<span style="font-style: italic;"></span>
<br>

For this tutorial, we will replace the start/stop rectangle with one of
two small images, which one depending on whether the button is being
pressed or not. The first thing to do is to create these two images.
Using any appropriate image editing tool, create two bitmaps 12 pixels
wide by 10 pixels in height, that look like a button extended and
depressed. For example:<br>

<br>

<table style="text-align: left; width: 400px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Extended Image<br>

StartStopUpGraphic.jpg</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Depressed Image<br>

StartStopDownGraphic.jpg</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><img style="width: 60px; height: 50px;" alt="" src="Images/StartStopUpGraphic.jpg"></td>

      <td align="undefined" valign="undefined"><img style="width: 60px; height: 50px;" alt="" src="Images/StartStopDownGraphic.jpg"></td>

    </tr>

  </tbody>
</table>

<br>

Note that pure black is the transparent color. Make sure both these
images are saved to the TestGauges directory.<br>

<br>

Next delete the rectangle of the Start/Stop button element, and then
insert a Select element. This will automatically add an Expression and
two Case objects to the gauge. Now edit the objects as follows:<br>

<ul>

  <li>The Select object should be left unchanged.</li>

  <li>The expression object should have its script entered: <span style="font-weight: bold;">(L:STSTP Pressed, bool)</span>.
Remember we entered the local variable STSTP Pressed, that is set to
true if the button is being pressed (clicked on with the mouse), or
false otherwise.</li>

  <li>The first case object should have its id changed to <span style="font-weight: bold;">Case 0</span> and its
expression should be entered as <span style="font-weight: bold;">0</span>.
With this case object selected click on Insert, and add an image.
Insert the image name, StartStopUpGraphic.jpg.</li>

  <li>The second case object should have its id changed to <span style="font-weight: bold;">Case 1</span> and its
expression should be entered as <span style="font-weight: bold;">1</span>.
With this case object selected click on Insert, and add an image.
Insert the image name, StartStopDownGraphic.jpg.</li>

</ul>

The Select element in the tree view of the gauge should now look like
this:<br>

<br>

<table style="text-align: left; width: 400px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><img style="width: 285px; height: 144px;" alt="" src="Images/Select%20Element.jpg"></td>

    </tr>

  </tbody>
</table>

<br>

Now, go back to step 6, cab up the gauges, and test the new action in <span style="font-style: italic;">Flight Simulator</span>.
You could replace all the simple art with images, and slowly build a
great looking stopwatch!<br>

<br>

When you have the images working correctly, you have finished the
tutorial. Good work!<br>

<br>

<br>

<hr style="width: 100%; height: 2px;"><br>

<br>

<h2><a class="mozTocH2" name="mozTocId848419"></a><a name="XML_Gauge_Reference"></a>XML
Gauge Reference</h2>

This section lists all the elements and objects that can make up a
gauge, and describes all the operators that can be used in scripts and
expressions when dynamic calculations are needed.<br>

<br>

<ul>

  <li><a href="#Expression_Evaluation">Expression
Evaluation</a></li>

  <li><a href="#Gauge_Objects">Gauge Objects</a></li>

  <li><a href="#Comment_Objects">Comment Objects</a></li>

  <li><a href="#Element_Objects">Element Objects</a></li>

  <li><a href="#Image_Objects">Image Objects</a></li>

  <li><a href="#Macro_Objects">Macro Objects</a></li>

  <li><a href="#MouseArea_Objects">MouseArea Objects</a></li>

  <li><a href="#Update_Objects">Update Objects</a></li>

</ul>

<h3><a class="mozTocH3" name="mozTocId451341"></a><a name="Expression_Evaluation"></a>Expression Evaluation</h3>

Values of some elements require&nbsp;calculated expressions, or
scripts. Typically these expressions define what a needle or numeric
display shows. In their simple form, these expressions are the names of
simulation parameters and the units in which the element requires the
value, enclosed in parentheses. In the following example the expression
returns the value of the INDICATED ALTITUDE parameter, in feet:<br>

<span style="font-weight: bold;"><br>

(A:INDICATED ALTITUDE, feet)</span><br>

<br>

The &ldquo;A&rdquo; before the semicolon indicates that this
parameter
is an aircraft parameter.&nbsp;INDICATED ALTITUDE is a simulation
variable (see the  <a href="../../Core Utilities Kit/Variables/Simulation Variables.html">Simulation Variables</a> document for a full list of variables) and feet are
the units of measure in which the aircraft parameter will display.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId746560"></a><a name="Expression_Parameters"></a>Expression
Parameters</h4>

<br>

The following table describes all the types of parameters.<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Parameter</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Stands for...</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">A</td>

      <td align="undefined" valign="undefined">Aircraft,
including helicopters</td>

      <td align="undefined" valign="undefined">Gets
the specified parameter of the aircraft.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined">C</td>
      <td align="undefined" valign="undefined">Custom
        parameter</td>
      <td align="undefined" valign="undefined">Custom
        variable creatd for <span style="font-style: italic;">Flight
          Simulator</span>.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">E</td>

      <td align="undefined" valign="undefined">Environment</td>

      <td align="undefined" valign="undefined">Gets
environment variables, such as current time.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">G</td>

      <td align="undefined" valign="undefined">Gauge parameter
</td>

      <td align="undefined" valign="undefined">Gets
a variable that is local to the gauge</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined">K</td>
      <td align="undefined" valign="undefined">Key
        code</td>
      <td align="undefined" valign="undefined">Variables
        of this kind are key codes that are sent from gauges to <span style="font-style: italic;">Flight</span> <span style="font-style: italic;">Simulator</span>.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">L</td>

      <td align="undefined" valign="undefined">Local parameter
</td>

      <td align="undefined" valign="undefined">Gets
a variable that is defined by the developer</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined">M</td>
      <td align="undefined" valign="undefined">Mouse
        parameter</td>
      <td align="undefined" valign="undefined">Gets
        the state of the mouse for use in mouse click handlers.</td>
    </tr>
    <tr>
      <td align="undefined" valign="undefined">P</td>
      <td align="undefined" valign="undefined">Program
        related</td>
      <td align="undefined" valign="undefined">Gets
        program variables, such as simulation rate</td>
    </tr>


    <tr>

      <td align="undefined" valign="undefined">R</td>

      <td align="undefined" valign="undefined">Resource
strings</td>

      <td align="undefined" valign="undefined">Retrieves
a string from the resource file.</td>
    </tr>
  </tbody>
</table>

<br>

For more information on possible parameters for
&ldquo;A&rdquo;, &ldquo;E&rdquo; and
&ldquo;P&rdquo; see the <a href="../../Core Utilities Kit/Variables/Simulation Variables.html">Simulation
Variables</a>
document. A unit name (feet, meters, inHg etc.) is required after the
parameter name. For the list of recognizable unit names refer to the <a href="../../Core Utilities Kit/Variables/Simulation Variables.html">Units
of Measurement</a> section.

<br>

<p></p>
<h5>Custom Parameters (C:)</h5>
<p>&nbsp;</p>
<p>The following table lists all the defined custom parameters that can be used within XML gauges:</p>
<p>&nbsp; </p>
<table class="T1" cellspacing="2" cellpadding="4">
  <tr>
    <td><h5>Module</h5></td>
    <td><h5>Variable</h5></td>
    <td><h5>Units</h5></td>
    <td><h5>Setable</h5></td>
    <td><h5>Description</h5></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>Mission</b></td>
    <td><b>OnScreenTimerValue</b></td>
    <td>seconds</td>
    <td>No</td>
    <td>The on screen timer used in the mission system. </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>POI</b></td>
    <td><b>SelectedTargetMSLAltitude</b></td>
    <td>meters</td>
    <td>No</td>
    <td>The current Point of Interest. </td>
  </tr>
  <tr>
    <td><b>POI</b></td>
    <td><b>SelectedTargetName</b></td>
    <td>string</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>POI</b></td>
    <td><b>SelectedTargetDistance</b></td>
    <td>meters</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>POI</b></td>
    <td><b>SelectedTargetBearing</b></td>
    <td>degrees</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>POI</b></td>
    <td><b>NumberOfTargets</b></td>
    <td>number</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>Radius</b></td>
    <td>meters</td>
    <td>Yes</td>
    <td>The radius from the user aircraft (or tower) to use to collect data on nearby aircraft. </td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>Filter</b></td>
    <td>enum</td>
    <td>Yes</td>
    <td><p>One or more of the following values combined:</p>
      <p>&nbsp; </p>
      <p> TRAFFIC_FILTER_AIRCRAFT             = 1,<br>
          TRAFFIC_FILTER_GROUND_VEHICLES      = 2,<br>
          TRAFFIC_FILTER_TOWER_CONTROLLERS    = 4,<br>
          TRAFFIC_FILTER_ON_GROUND            = 8,<br>
          TRAFFIC_FILTER_IN_AIR               = 16,<br>
          TRAFFIC_FILTER_SLEEPING             = 32,<br>
          TRAFFIC_FILTER_AWAKE                = 64</p></td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>Latitude</b></td>
    <td>radians</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>Longitude</b></td>
    <td>radians</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>SortOrder</b></td>
    <td><p>enum</p></td>
    <td>n/a</td>
    <td><p>Not implemented. </p></td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>CurrentVehicle</b></td>
    <td>number</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>SelectedVehicle</b></td>
    <td>number</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>SelectedVehicleID</b></td>
    <td>number</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>CurrentPlayerName</b></td>
    <td>string</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>SelectedPlayerName</b></td>
    <td>string</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>ListSize</b></td>
    <td>number</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>MaxVehicles</b></td>
    <td>number</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>CurrentDistance</b></td>
    <td>meters</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ITrafficInfo</b></td>
    <td><b>SelectedFlightPlan</b></td>
    <td>string</td>
    <td>No</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>FS9VIEW</b></td>
    <td><b>On</b></td>
    <td>bool</td>
    <td>Yes</td>
    <td>Turn an auxillary view on or off. </td>
  </tr>
  <tr>
    <td><b>FS9VIEW</b></td>
    <td><b>Zoom</b></td>
    <td>float</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>FS9VIEW</b></td>
    <td><b>Pitch</b></td>
    <td>float</td>
    <td>Yes</td>
    <td>Ptich of the view in degrees. </td>
  </tr>
  <tr>
    <td><b>FS9VIEW</b></td>
    <td><b>Bank</b></td>
    <td>float</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>FS9VIEW</b></td>
    <td><b>Heading</b></td>
    <td>float</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>FS9VIEW</b></td>
    <td><b>OffsetRight</b></td>
    <td>float</td>
    <td>Yes</td>
    <td>Offsets in meters from the normal viewpoint. </td>
  </tr>
  <tr>
    <td><b>FS9VIEW</b></td>
    <td><b>OffsetUp</b></td>
    <td>float</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>FS9VIEW</b></td>
    <td><b>OffsetForward</b></td>
    <td>float</td>
    <td>Yes</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<p>To use a custom variable, precede it with<b> C:&lt;<i>module name</i>&gt;: </b>, for example:</p>
<p>&nbsp;</p>
<p><b>C:POI:SelectedTargetName</b></p>
<p><br />
  There is a special use of the <b>ITrafficInfo</b> module custom variables. These can be followed by any of the variables above, or any <a href="../../Core Utilities Kit/Variables/Simulation Variables.html">Simulation Variable</a>, preceded by the code <b>C </b>(for current aircraft) or <b>S</b> (for selected aircraft), for example: </p>
<p><br />
    <b>C:ITrafficInfo:S:ATC FLIGHT NUMBER, string<br />
C:ITrafficInfo:C:ATC AIRLINE, string</b></p>
<p>&nbsp;</p>
<p>To set the current or selected aircraft, use a statement such as:</p>
<p>&nbsp;</p>
<p><b>&gt;C:ITrafficInfo:CurrentVehicle <i>N</i> </b></p>
<p>where N is a value between 0 and <b>ListSize</b>-1.<br />
</p>
<p>For the units, the Simulation Variables are all treated as <b>number</b>, except the following, which are <b>string</b>:</p>
<p>ATC ID, ATC MODEL, ATC TYPE, ATC AIRLINE, ADF NAME, 
  NAV NAME, 
  ATC FLIGHT NUMBER, 
  and PAYLOAD STATION NAME.<br>
</p>
<h5>Gauge Parameters (G:)</h5>
Parameters of the &ldquo;G&rdquo; kind have names from&nbsp;<span style="font-weight: bold;">Var1</span> to<span style="font-weight: bold;">&nbsp;Var9</span>.
These are used by gauge developers to store and retrieve variables
across gauge elements. These values are unitless so do not put unit
names after them. The default value of a gauge parameter is 0.<br>

To get a gauge variable:<br>

<span style="font-weight: bold;">(G:Var1)</span><br>

To set a gauge variable (to 5 in this example):<br>

<span style="font-weight: bold;">5 (&gt;G:Var1)</span><br>

<br>

<h5>Key Parameters (K:)</h5>

Key parameters can be used to trigger key events. Key parameters must
be used if a value needs to be sent with the key event. For example, to
set the ADF card to a specific value of 200, use the following systax:<br>

<span style="font-weight: bold;">200
(&gt;K:KEY_ADF_CARD_SET)</span><br>

For more a list of events that can be used with Key Parameters see the <a href="../../Core Utilities Kit/Variables/Event IDs.htm">Event IDs</a> document. Note that&nbsp;unit names are not used with these
parameters,
however the &gt; is still required even it the key event does not
take
a numeric parameter.<br>

Key events can also be triggered by setting the KeyEvent parameter of <a href="#MouseClick_Objects">MouseClick</a> objects.<br>

<br>

<h5>Note</h5>



  <dd>The &gt; sign is not a legal character in XML, and will
appear as &amp;gt in XML documents.</dd>
  <dd>&nbsp;</dd>
  <h5>
&nbsp;Local Parameters (L:)</h5>
  When a local parameter is declared, its value is set to zero. Use your
own names for these parameters, but care should be taken that these
names are unique. Use unit names when declaring them, for example:<br>
<span style="font-weight: bold;">(L:Stopwatch Toggle
Position: bool)</span>
<h5>&nbsp;</h5>
  <h5>Mouse Parameters (M:)</h5>
  <p>Parameters of the &ldquo;M&rdquo; kind are:<br>

&bull;&nbsp;&nbsp;&nbsp; &ldquo;X&rdquo;
&mdash; the X coordinate of the mouse pointer.<br>

&bull;&nbsp;&nbsp;&nbsp; &ldquo;Y&rdquo;
&mdash; the Y coordinate of the mouse pointer.<br>

&bull;&nbsp;&nbsp;&nbsp; &ldquo;Event&rdquo;
&mdash; the string representation of the event which triggered the
mouse handler, such as &ldquo;LeftSingle&rdquo; or
&ldquo;RightDouble&rdquo;. The table below gives the full list
of mouse events.<br>

For the most part, you will not need to use mouse parameters, as the
ACE tool handles these for you with <a href="#MouseArea_Objects">MouseArea</a>
and <a href="#MouseClick_Objects">MouseClick</a>
objects.</p>

<p></p>

<table border="1" cellpadding="1" cellspacing="1">

  <tbody>

    <tr>

      <td><b>Event Name </b></td>

      <td><b>User action </b></td>

    </tr>

    <tr>

      <td>RightSingle</td>

      <td>Single-clicks right mouse button</td>

    </tr>

    <tr>

      <td>MiddleSingle</td>

      <td>Single-clicks middle mouse button</td>

    </tr>

    <tr>

      <td>LeftSingle</td>

      <td>Single-clicks left mouse button </td>

    </tr>

    <tr>

      <td>RightDouble</td>

      <td>Double-clicks right mouse button</td>

    </tr>

    <tr>

      <td>MiddleDouble</td>

      <td>Double-clicks middle mouse button</td>

    </tr>

    <tr>

      <td>LeftDouble</td>

      <td>Double-clicks left mouse button </td>

    </tr>

    <tr>

      <td>RightDrag</td>

      <td>Moves mouse while holding down right mouse button</td>

    </tr>

    <tr>

      <td>MiddleDrag</td>

      <td>Moves mouse while holding down middle mouse button</td>

    </tr>

    <tr>

      <td>LeftDrag</td>

      <td>Moves mouse while holding down left mouse button</td>

    </tr>

    <tr>

      <td>Move</td>

      <td>Moves mouse</td>

    </tr>

    <tr>

      <td>Down_Repeat </td>

      <td>Holds down mouse button</td>

    </tr>

    <tr>

      <td>RightRelease</td>

      <td>Releases right mouse button</td>

    </tr>

    <tr>

      <td>MiddleRelease</td>

      <td>Releases middle mouse button</td>

    </tr>

    <tr>

      <td>LeftRelease</td>

      <td>Releases left mouse button</td>

    </tr>

    <tr>

      <td>Wheel_Flip</td>

      <td>Changes the direction the mouse wheel is rotating</td>

    </tr>

    <tr>

      <td>Wheel_Skip</td>

      <td>&nbsp;</td>

    </tr>

    <tr>

      <td>Wheel_Up</td>

      <td>Rolls the mouse wheel &ldquo;up&rdquo;</td>

    </tr>

    <tr>

      <td>Wheel_Down</td>

      <td>Rolls the mouse wheel &ldquo;down&rdquo;</td>

    </tr>

    <tr>

      <td>Move_Repeat</td>

      <td>&nbsp;</td>

    </tr>

    <tr>

      <td>Leave</td>

      <td>&nbsp;</td>

    </tr>

    <tr>

      <td>GetAll</td>

      <td>Triggers any mouse event</td>

    </tr>

    <tr>

      <td>LeftAll</td>

      <td>Either single-clicks the left button, releases the left
button, or moves the mouse while holding down the left mouse button</td>

    </tr>

    <tr>

      <td>RightAll</td>

      <td>Either single-clicks the right button, releases the
right button, or moves the mouse while holding down the right mouse
button</td>

    </tr>

    <tr>

      <td>MiddleAll</td>

      <td>Either single-clicks the middle button, releases the
middle button, or moves the mouse while holding down the middle mouse
button</td>

    </tr>

    <tr>

      <td>Wheel</td>

      <td>Scrolls wheel up or down</td>

    </tr>

  </tbody>
</table>

<p></p>

<h5>Resource strings (R:)</h5>

The R parameter is used to retrieve strings from the resource file.
These strings will be localized into the selected language of the user.
For example, <span style="font-weight: bold;"><br>

(R: HELPID_AUTOPILOT_AUTOTHROTTLE)</span> will result in the text
"Autothrottle switch" if English is the selected language.<br>

Refer to the document, <a href="HelpIDs.html">HelpIDs</a>, for a full list of the names of
resource variables.
<h4><a class="mozTocH4" name="mozTocId648798"></a><a name="Reverse_Polish_Notation"></a>Reverse
Polish Notation</h4>

The evaluation of scripts is done using a stack and reverse polish
notation. For example, if you want a gauge to show altitude in
thousands of feet, divide the value of INDICATED ALTITUDE by 1000.<br>

<br>

<span style="font-weight: bold;">(A:INDICATD ALTITUDE,
feet) 1000 /&nbsp;</span><br>

<br>

To execute an arithmetic operation, put both operands first in the
script and then include the symbol of operation (the divide symbol in
this case). This is how some programmable calculators performed
arithmetic operations in the past. <br>

<br>

This convention works the following way: When the script parser comes
across a value, it pushes it onto the top of the stack. When the script
parser comes across an operator, it pops from the stack the number of
operands that the operator works on (usually one or two values).<br>

<br>

Whatever value is left on top of the stack at the end of the execution
is the result of the calculated expression. The <a href="#Expression_Evaluation_Examples">Expression Evaluation
Examples</a> section provides a list of simple and more complex
script examples.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId231151"></a><a name="Expression_Operators"></a>Expression
Operators</h4>

There is a long list of operators that can be done within scripts.<br>

<table border="1" cellpadding="1" cellspacing="1">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Operator</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Operation</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Arguments</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Example</span> </td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Result</span> </td>
    </tr>

    <tr>

      <td><b>Common Operator </b></td>

      <td><b><br>

      </b></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>+ </td>

      <td>addition</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">3 5 +</td>

      <td align="undefined" valign="undefined">8</td>
    </tr>

    <tr>

      <td>- </td>

      <td>subtraction. If the stack contains <span style="font-weight: bold;">A B -</span>, then the
calculation is A - B.</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Value)&nbsp;90
-</td>

      <td align="undefined" valign="undefined">The
local value minus 90.</td>
    </tr>

    <tr>

      <td>/ </td>

      <td>division. If the stack contains <span style="font-weight: bold;">A B /</span>, then the
calculation is A / B.</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 2 /</td>

      <td align="undefined" valign="undefined">2.5</td>
    </tr>

    <tr>

      <td>* </td>

      <td>multiplication</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">pi 2
*</td>

      <td align="undefined" valign="undefined">2 pi</td>
    </tr>

    <tr>

      <td>% </td>

      <td>taking modulo</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">5.3 %</td>

      <td align="undefined" valign="undefined">5</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">++</td>

      <td align="undefined" valign="undefined">increment</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">4 ++</td>

      <td align="undefined" valign="undefined">5</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">--</td>

      <td align="undefined" valign="undefined">decrement</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">4 --</td>

      <td align="undefined" valign="undefined">3</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">/-/<br>

neg</td>

      <td align="undefined" valign="undefined">negates
a number</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">4 /-/</td>

      <td align="undefined" valign="undefined">-4</td>
    </tr>

    <tr>

      <td><span style="font-weight: bold;">Comparison</span>
      <span style="font-weight: bold;">Operators</span>      </td>

      <td><br>      </td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>== </td>

      <td>true if equal</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Value)&nbsp;0
== if{ A }</td>

      <td align="undefined" valign="undefined">Operation
A is carried out if Value is 0.</td>
    </tr>

    <tr>

      <td>!= </td>

      <td>true if not equal</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Value)&nbsp;0
!= if{ A }</td>

      <td align="undefined" valign="undefined">Operation
A is carried out if Value is not 0.</td>
    </tr>

    <tr>

      <td>&gt; </td>

      <td>true if greater than</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Value1)
(L:Value2) &gt; if{ A } els{ B }</td>

      <td align="undefined" valign="undefined">If
Value1 is greater than Value2, operation A is carried out, otherwise
operation B is carried out.</td>
    </tr>

    <tr>

      <td>&lt; </td>

      <td>true if less</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Value1)
(L:Value2) &lt; if{ A } els{ B }</td>

      <td align="undefined" valign="undefined">If
Value1 is less than Value2, operation A is carried out, otherwise
operation B is carried out.</td>
    </tr>

    <tr>

      <td>&gt;= </td>

      <td>true greater than or equal</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Value1)
(L:Value2) &gt;= if{ A } els{ B }</td>

      <td align="undefined" valign="undefined">If
Value1 is greater than or equal to Value2, operation A is carried out,
otherwise operation B is carried out.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">&lt;=</td>

      <td align="undefined" valign="undefined">true
if less than or equal</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Value1)
(L:Value2) &lt;= if{ A } els{ B }</td>

      <td align="undefined" valign="undefined">If
Value1 is less than or equal to Value2, operation A is carried out,
otherwise operation B is carried out.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">?</td>

      <td align="undefined" valign="undefined">The
third operand determines whether the first (True) or second (False) is
selected.</td>

      <td align="undefined" valign="undefined">3</td>

      <td align="undefined" valign="undefined">A
B True ?</td>

      <td align="undefined" valign="undefined">This
evaluates to A.</td>
    </tr>

    <tr>

      <td><span style="font-weight: bold;">Bit
Operators</span> </td>

      <td><br>      </td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>&amp; </td>

      <td>bitwise AND</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 3
&amp;</td>

      <td align="undefined" valign="undefined">1</td>
    </tr>

    <tr>

      <td>| </td>

      <td>bitwise OR</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 3 |</td>

      <td align="undefined" valign="undefined">7</td>
    </tr>

    <tr>

      <td>^ </td>

      <td>bitwise XOR</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 3 ^</td>

      <td align="undefined" valign="undefined">6</td>
    </tr>

    <tr>

      <td>~ </td>

      <td>bitwise NOT</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">5 ~</td>

      <td align="undefined" valign="undefined">-6</td>
    </tr>

    <tr>

      <td>&gt;&gt; </td>

      <td>shift right operand number of bits</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 3
&gt;&gt;</td>

      <td align="undefined" valign="undefined">0</td>
    </tr>

    <tr>

      <td>&lt;&lt; </td>

      <td>shift left operand number of&nbsp;bits</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 3
&lt;&lt;</td>

      <td align="undefined" valign="undefined">40</td>
    </tr>

    <tr>

      <td><span style="font-weight: bold;">Logical
Operators</span> </td>

      <td><br>      </td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>!, NOT </td>

      <td>NOT</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">(L:Local)
! (&gt;L:Local)</td>

      <td align="undefined" valign="undefined">Toggles
the variable Local</td>
    </tr>

    <tr>

      <td>&amp;&amp;, AND </td>

      <td>AND</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Local)
0xFF00 &amp;&amp; (&gt;L:Local)</td>

      <td align="undefined" valign="undefined">The
variable Local is ANDed with hex 0xFF00</td>
    </tr>

    <tr>

      <td>||, OR </td>

      <td>OR</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(L:Local)
07777 OR (&gt;L:Local)</td>

      <td align="undefined" valign="undefined">The
variable Local is ORed with octal 7777.</td>
    </tr>

    <tr>

      <td><span style="font-weight: bold;">Numerical
Operators</span> </td>

      <td><br>      </td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>abs </td>

      <td>Absolute value</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">-5
abs</td>

      <td align="undefined" valign="undefined">5</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">int<br>

flr</td>

      <td align="undefined" valign="undefined">Calculates
nearest integer number which is less than
the source number</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">5.98
flr</td>

      <td align="undefined" valign="undefined">5</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">rng</td>

      <td align="undefined" valign="undefined">Range;
returns <span style="font-weight: bold;">True</span>
if the third operand lies between values one and two.</td>

      <td align="undefined" valign="undefined">3</td>

      <td align="undefined" valign="undefined">4 7
6 rng</td>

      <td align="undefined" valign="undefined">True</td>
    </tr>

    <tr>

      <td>cos </td>

      <td>Cosine (input in radians)</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">pi
cos</td>

      <td align="undefined" valign="undefined">-1</td>
    </tr>

    <tr>

      <td>lg </td>

      <td>Logarithm to base 10</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">10 lg</td>

      <td align="undefined" valign="undefined">1</td>
    </tr>

    <tr>

      <td>min </td>

      <td>Minimum</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 2
min</td>

      <td align="undefined" valign="undefined">2</td>
    </tr>

    <tr>

      <td>sin </td>

      <td>Sine (input in radians)</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">pi
sin</td>

      <td align="undefined" valign="undefined">0</td>
    </tr>

    <tr>

      <td>acos </td>

      <td>Arc cosine (returns radians)</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">pi
acos</td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>ctg </td>

      <td>cotangent (input in radians)</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">pi
ctg</td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>ln </td>

      <td>Natural logarithm</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">2.718282
ln</td>

      <td align="undefined" valign="undefined">1</td>
    </tr>

    <tr>

      <td>sqr </td>

      <td>Square</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">5 sqr</td>

      <td align="undefined" valign="undefined">25</td>
    </tr>

    <tr>

      <td>asin </td>

      <td>arc sine</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">pi
asin</td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>eps </td>

      <td>Floating-point relative accuracy</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">1 eps </td>

      <td align="undefined" valign="undefined">2^(-52) </td>
    </tr>

    <tr>

      <td>log </td>

      <td>Logarithm of operand one, to the base of operand two.</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">8 2
log</td>

      <td align="undefined" valign="undefined">3</td>
    </tr>

    <tr>

      <td>pi </td>

      <td>Pi = 3.14159; puts pi on the stack</td>

      <td align="undefined" valign="undefined">0</td>

      <td align="undefined" valign="undefined">pi</td>

      <td align="undefined" valign="undefined">3.14159</td>
    </tr>

    <tr>

      <td>sqrt </td>

      <td>Square root</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">25
sqrt</td>

      <td align="undefined" valign="undefined">5</td>
    </tr>

    <tr>

      <td>atg2 </td>

      <td>arc tangent with two inputs (input in radians)</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>exp </td>

      <td>Exponent; e to the power of the operand</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">1 exp</td>

      <td align="undefined" valign="undefined">2.718282</td>
    </tr>

    <tr>

      <td>max </td>

      <td>Maximum</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 2
max</td>

      <td align="undefined" valign="undefined">5</td>
    </tr>

    <tr>

      <td>pow </td>

      <td>Power of;&nbsp;the first value to the power of the
second</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">2 5
pow</td>

      <td align="undefined" valign="undefined">32</td>
    </tr>

    <tr>

      <td>tg </td>

      <td>Tangent (input in radians)</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">pi tg</td>

      <td align="undefined" valign="undefined">0</td>
    </tr>

    <tr>

      <td>atg </td>

      <td>arc tangent with one input </td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">pi
atg</td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td><span style="font-weight: bold;">Special
Operators</span> </td>

      <td><br>      </td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>div </td>

      <td>Divides integers; its result is always an integer</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">5 3
div</td>

      <td align="undefined" valign="undefined">1</td>
    </tr>

    <tr>

      <td>ceil </td>

      <td>Calculates nearest integer number which is bigger than
the source</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">4.3
ceil</td>

      <td align="undefined" valign="undefined">5</td>
    </tr>

    <tr>

      <td>near </td>

      <td>Calculates the nearest integer number, rounding .5 up.</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">4.5
near</td>

      <td align="undefined" valign="undefined">5</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">dnor<br>

d360<br>

rdeg</td>

      <td align="undefined" valign="undefined">Normalizes
an angle expressed in degrees. The result in an value between 0 and 360.</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">-15
dnor</td>

      <td align="undefined" valign="undefined">345</td>
    </tr>

    <tr>

      <td>rddg </td>

      <td>Converts radians to degrees</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">pi
rddg</td>

      <td align="undefined" valign="undefined">180</td>
    </tr>

    <tr>

      <td>dgrd </td>

      <td>Converts degrees to radians</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">180
dgrd</td>

      <td align="undefined" valign="undefined">pi</td>
    </tr>

    <tr>

      <td>rnor </td>

      <td>Normalizes an angle expressed in radians, the result of
this operation is between 0 and 2 pi</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">5 pi      </td>

      <td align="undefined" valign="undefined">1.8584</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">if{
.... }</td>

      <td align="undefined" valign="undefined">If
statement, note there is no space between the if and the {</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">(L:Value)&nbsp;0
== if{ A }</td>

      <td align="undefined" valign="undefined">Operation
A is carried out if Value is 0.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">els{
.... }</td>

      <td align="undefined" valign="undefined">Else
statement, note there is no space between the els and the {</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">(L:Value1)
(L:Value2) &lt;= if{ A } els{ B }</td>

      <td align="undefined" valign="undefined">If
Value1 is less than or equal to Value2, operation A is carried out,
otherwise operation B is carried out.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">quit</td>

      <td align="undefined" valign="undefined">The
quit statement allows expression evaluation to stop completely, and
avoid the use of nesting if{ statements.</td>

      <td align="undefined" valign="undefined">0</td>

      <td align="undefined" valign="undefined">pi
quit (L:Value1) (L:Value2) &lt;= if{ A } els{ B }</td>

      <td align="undefined" valign="undefined">pi.
The rest of the script is ignored.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">g0...gn</td>

      <td align="undefined" valign="undefined">Goto
label. Execution will jump to the specified label. Labels are set by
entering a colon followed by the label number.</td>

      <td align="undefined" valign="undefined">0</td>

      <td align="undefined" valign="undefined">g4</td>

      <td align="undefined" valign="undefined">Execution
jump to <span style="font-weight: bold;">:4</span></td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">case</td>

      <td align="undefined" valign="undefined">Case
statement</td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined">2
{case} { :1 }A{ :2 }B%{end}</td>

      <td align="undefined" valign="undefined">Operation
B is carried out.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">loop</td>

      <td align="undefined" valign="undefined">Loop
statement</td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined">1&nbsp;(&gt;L:Value)
{loop} (L:Value) ++ (&gt;L:Value) 10 &lt; {next}</td>

      <td align="undefined" valign="undefined">Loops
from 1 to 10</td>
    </tr>

    <tr>

      <td><span style="font-weight: bold;">String
Operators</span> </td>

      <td><br>      </td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>lc </td>

      <td>Converts a string to lowercase</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">'ABcd10'
lc</td>

      <td align="undefined" valign="undefined">'abcd10'</td>
    </tr>

    <tr>

      <td>uc<br>

cap </td>

      <td>Converts a string to uppercase</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">'ABcd10'
uc</td>

      <td align="undefined" valign="undefined">'ABCD10'</td>
    </tr>

    <tr>

      <td>chr </td>

      <td>Converts a number to a symbol</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">65
chr</td>

      <td align="undefined" valign="undefined">'A'</td>
    </tr>

    <tr>

      <td>ord </td>

      <td>Converts a symbol to an integer</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">'A'
ord</td>

      <td align="undefined" valign="undefined">65</td>
    </tr>

    <tr>

      <td>scat </td>

      <td>Concatenates strings</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">'abc'
'red' scat</td>

      <td align="undefined" valign="undefined">'abcred'</td>
    </tr>

    <tr>

      <td>schr </td>

      <td>Finds a symbol in a string</td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>scmp </td>

      <td>Compares strings, case sensitive</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(M:Event)
'LeftSingle' scmp 0 == if{ A }els{ B }</td>

      <td align="undefined" valign="undefined">Performs
A if the left mouse button has been pressed, otherwisse performs B</td>
    </tr>

    <tr>

      <td>scmi </td>

      <td>Compares strings, ignoring case</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">'left'
'Left' scmi 0 == if{ 'yes' }</td>

      <td align="undefined" valign="undefined">'yes'</td>
    </tr>

    <tr>

      <td>sstr </td>

      <td>Finds a substring</td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>ssub </td>

      <td>Extracts a substring</td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>symb </td>

      <td>Extracts a single character</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">'abc'
1 symb</td>

      <td align="undefined" valign="undefined">'b'</td>
    </tr>

    <tr>

      <td><span style="font-weight: bold;">Stack
Operators</span> </td>

      <td><br>      </td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">b</td>

      <td align="undefined" valign="undefined">Backup
the stack</td>

      <td align="undefined" valign="undefined">0</td>

      <td align="undefined" valign="undefined"></td>

      <td align="undefined" valign="undefined"></td>
    </tr>

    <tr>

      <td>c </td>

      <td>Clears the stack</td>

      <td align="undefined" valign="undefined">0</td>

      <td align="undefined" valign="undefined">stack:
1 2 3 c</td>

      <td align="undefined" valign="undefined">stack:</td>
    </tr>

    <tr>

      <td>d </td>

      <td>Duplicates the value that is on the top of the stack</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">stack:
5 d</td>

      <td align="undefined" valign="undefined">stack:
5 5</td>
    </tr>

    <tr>

      <td>p </td>

      <td>Pops and discards the top value on the stack</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">stack:
1 2 3 p</td>

      <td align="undefined" valign="undefined">stack:
1 2</td>
    </tr>

    <tr>

      <td>r </td>

      <td>Reverses the top and second values on the stack</td>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">stack:
1 2 3 r</td>

      <td align="undefined" valign="undefined">stack:
1 3 2</td>
    </tr>

    <tr>

      <td>s0, s1, &hellip; s49 </td>

      <td>Stores the top value in an internal register, but does
not pop it from the stack.</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">stack:
1 2 3 s0</td>

      <td align="undefined" valign="undefined">stack:
1 2 3<br>

s0: 3</td>
    </tr>

    <tr>

      <td>l0, l1, &hellip; l49 </td>

      <td>Loads a value from a register to the top of the stack</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">stack:
1 2 3 s0 l0</td>

      <td align="undefined" valign="undefined">stack:
1 2 3 3</td>
    </tr>

    <tr>

      <td>sp0, sp1, &hellip; sp49 </td>

      <td>Stores the top value and pops it from the stack</td>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">stack:
1 2 3 sp0</td>

      <td align="undefined" valign="undefined">stack:
1 2<br>

sp0: 3</td>
    </tr>
  </tbody>
</table>

<p><br>

</p>

<h5>
Notes</h5>

<ul>

  <li>Strings should be entered using single quotes, for example:
'abcd'.</li>

  <li>Hexadecimal numbers can be entered using the 0xf or 0xF
convention (for example, 0xff or 0xFF00FF00)</li>

  <li>Octal numbers can be entered by using a leading zero. For
example, 022 is octal 18. Be careful not to enter leading zeros on
decimal numbers.</li>

  <li>Scientific notation can be used: 5E2 represents 5 x 10
squared (500), 5E-2 is 0.005</li>

</ul>

<p></p>

<br>

<h4><a class="mozTocH4" name="mozTocId783591"></a><a name="Expression_Evaluation_Examples"></a>Expression
Evaluation Examples</h4>

<br>

The table below gives a range of script examples that can be used for
aircraft. See also the examples for the <a href="#GaugeText_Objects">GaugeText</a>
object, <a href="#Examples_of_GaugeStrings">Example of
Gauge Strings</a>, and a few examples in the <a href="#Gauge_Color_Scripts">Gauge Color Scripts</a>
section.<br>

<br>

<h5><a name="Aircraft_Script_Examples_"></a>Aircraft
Script Examples <br>

</h5>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined">#</td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Expression</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Gauge</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">1</td>

      <td align="undefined" valign="undefined">(A:LIGHT
NAV, bool)</td>

      <td align="undefined" valign="undefined">Navigation
Lights</td>

      <td align="undefined" valign="undefined">Returns
      <span style="font-weight: bold;">True</span>
(1) if the navigation light switch is on, <span style="font-weight: bold;">False</span> (0) otherwise.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">2</td>

      <td align="undefined" valign="undefined">(A:TRAILING
EDGE FLAPS LEFT ANGLE, radians) 1.1 *</td>

      <td align="undefined" valign="undefined">Flaps</td>

      <td align="undefined" valign="undefined">Returns
the left flaps
angle in radians, multiplied by 1.1. Multiplications like this can help
reduce rounding errors when making comparisons with integer settings.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">3</td>

      <td align="undefined" valign="undefined">(A:PARTIAL
PANEL ELECTRICAL,enum) !</td>

      <td align="undefined" valign="undefined">Electrical
gauges</td>

      <td align="undefined" valign="undefined">The
enum for this variable is (0 = OK, 1= fail, 2 = blank), so in this
case the result is inverted by the "!" operator to give 1 = OK and 0 =
fail.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">4</td>

      <td align="undefined" valign="undefined">(A:PLANE
HEADING DEGREES GYRO, degrees) /-/ dgrd</td>

      <td align="undefined" valign="undefined">HSI
Compass ring</td>

      <td align="undefined" valign="undefined">Returns
the aircraft heading negated and converted to radians.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">5</td>

      <td align="undefined" valign="undefined">(A:NAV
GSI:1,percent) 250 /</td>

      <td align="undefined" valign="undefined">HSI
Glideslope deflection</td>

      <td align="undefined" valign="undefined">Returns
the percentage for the GSI (Glideslope deviation indicator) for Nav1,
divided by 250. </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">6</td>

      <td align="undefined" valign="undefined">(P:Units
of measure, enum) 2 == if{ (A:RADIO HEIGHT, meters) } els{ (RADIO
HEIGHT, feet) }</td>

      <td align="undefined" valign="undefined">Radio
Height (or Radar Altitude)&nbsp; needle</td>

      <td align="undefined" valign="undefined">The
Units of measure enum is:<br>

      <p>0 = English</p>

      <p>1 = Metric (with altitude in feet)</p>

      <p>2 = Metric (with altitude in meters)</p>

So if this enum value is 2, the <span style="font-weight: bold;">If</span>
statement is evaluated, otherwise the <span style="font-weight: bold;">Els</span> statement is
evaluated.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">7</td>

      <td align="undefined" valign="undefined">(A:PARTIAL
PANEL ELECTRICAL,enum)! if{ 25 (A:GENERAL ENG FUEL PRESSURE:1, psi) - }
els{ 25.5 }</td>

      <td align="undefined" valign="undefined">Fuel
Pressure</td>

      <td align="undefined" valign="undefined">If
the Partial Panel
Electrical is OK (see Example 3 above) then 25 minus the fuel reading
for engine 1&nbsp;is returned, if not the fixed value of 25.5 is
returned.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">8</td>

      <td align="undefined" valign="undefined">(A:FUEL
TANK SELECTOR 1, enum) 0 == <br>

(A:FUEL TANK SELECTOR 1, enum) 3 == or<br>

if { pi 2 / } els{ 0 }<br>

      </td>

      <td align="undefined" valign="undefined">Right
Valve of Fuel Gauge</td>

      <td align="undefined" valign="undefined">If
all the fuel tanks
are selected (FUEL TANK SELECTOR enum value is 0) or the right fuel
tank is selected (the enum value is 3) then the fuel valve is set at
pi/2, otherwise it is set at zero.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">9</td>

      <td align="undefined" valign="undefined">(A:NAV1
OBS, degrees) d
(A:PARTIAL PANEL HEADING, bool) (A:PARTIAL PANEL ELECTRICAL, bool) or 0
== <br>

if{ (A:PLANE HEADING DEGREES GYRO, degrees) 90 - - } dgrd</td>

      <td align="undefined" valign="undefined">GPS
element of HSI</td>

      <td align="undefined" valign="undefined">If
the
PARTIAL PANEL HEADING is false and the PARTIAL PANEL ELECTIRCAL is
false, then this expression returns the NAV1 OBS reading
&nbsp;minus
the (PLANE HEADING DEGREES GYRO reading minus 90), converted to radians.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">10</td>

      <td align="undefined" valign="undefined">(P:Units
of measure, enum) 2 == <br>

if{ (A:INDICATED ALTITUDE, meters) } els{
(A:INDICATED ALTITUDE, feet) } 100000 / 360 * dgrd</td>

      <td align="undefined" valign="undefined">Altimeter
ten thousand foot needle</td>

      <td align="undefined" valign="undefined">Divides
the altitude by one hundred thousand, then multiplies by 360, and
converts the result from degrees to radians.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">11</td>

      <td align="undefined" valign="undefined">(L:Show
Volts 1,bool) <br>

&nbsp;&nbsp;&nbsp; if{&nbsp; (A:ELECTRICAL GENALT BUS
VOLTAGE:1, volts) 2 *<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } els{<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(A:ELECTRICAL GENALT BUS AMPS:1, amps) }<br>

      </td>

      <td align="undefined" valign="undefined">Amps/Volts&nbsp;</td>

      <td align="undefined" valign="undefined">If
the local
variable Show Volts 1 is true, the bus voltage for engine 1, multiplied
by 2, is returned. Otherwise the bus amps for engine 1 is returned.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">12</td>

      <td align="undefined" valign="undefined">(A:ADF
Radial:1,degrees) 360 + <br>

d360 dgrd</td>

      <td align="undefined" valign="undefined">ADF</td>

      <td align="undefined" valign="undefined">The
ADF
radial value in degrees is added to 360 and then normalised to a value
between 0 and 360. It is then converted to radians.</td>

    </tr>

  </tbody>
</table>

<br>

<h6>Notes</h6>

<ul>

  <li>Simulation variables are not case-sensitive, they can be
all upper, all lower or a mix of upper and lower case in your scripts.</li>

</ul>

<h3><a class="mozTocH3" name="mozTocId999490"></a><a name="Gauge_Objects"></a>Gauge Objects</h3>

Gauge objects are used to specify a gauge for use in <span style="font-style: italic;">Flight Simulator</span>.
The specification includes the relevant bitmaps, background, mouse
areas, tooltips, and the math to calculate the readings that the gauge
should be showing. The actual position of a gauge on the screen is
determined in the panel.cfg file.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">ArtDirectory</td>

      <td align="undefined" valign="undefined">The
absolute or relative path to the directory containing all the images
for the gauge. Note that this is for the purposes of the tool, not
Flight Simulator. The art should be cabbed up along with the xml files
when completed.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Element</td>

      <td align="undefined" valign="undefined">A
list of <a href="#Element_Objects">Elements</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FloatPosition</td>

      <td align="undefined" valign="undefined">Unused.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Image</td>

      <td align="undefined" valign="undefined">A
list of <a href="#Image_Objects">Images</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Macro</td>

      <td align="undefined" valign="undefined">A
list of <a href="#Macro_Objects">Macros</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">MouseArea</td>

      <td align="undefined" valign="undefined">A
list of <a href="#MouseArea_Objects">Mouse areas</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">Two
integers, giving the width and height of the gauge in pixels. This is
often the exact size of the background image loaded directly using an <a href="#Image_Objects">Image</a> object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Update</td>

      <td align="undefined" valign="undefined">A
list of <a href="#Update_Objects">Updates</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Update_When_Hidden</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
the gauge should be updated even if it is hidden from view.</td>

    </tr>

  </tbody>
</table>

<br>

Gauge objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects, <a href="#Element_Objects">Element</a>
objects, <a href="#Image_Objects">Image</a>
objects, <a href="#Macro_Objects">Macro</a>
objects, <a href="#MouseArea_Objects">MouseArea</a>
objects and <a href="#Update_Objects">Update</a>
objects.<br>

<br>

<hr style="width: 100%; height: 2px;"><br>

<h3><a class="mozTocH3" name="mozTocId568591"></a><a name="Comment_Objects"></a>Comment
Objects</h3>

Comment objects are used to add information to the design of the gauge,
&nbsp;to help in the design or maintainance of that gauge, the text
will not appear anywhere to a user of <span style="font-style: italic;">Flight Simulator</span>.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Value</td>

      <td align="undefined" valign="undefined">The
comment string.</td>

    </tr>

  </tbody>
</table>

<br>

Comment objects cannot be the parent of any other object.<br>

<br>

<hr style="width: 100%; height: 2px;"><br>

<h3><a class="mozTocH3" name="mozTocId279049"></a><a name="Element_Objects"></a>Element
Objects</h3>

Element objects are the most important sub-objects of gauges, and are
used to specify all the components of the gauge. <br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FloatPosition</td>

      <td align="undefined" valign="undefined">Two
floating point numbers, giving the top left hand position of the
element relative to the top left hand position (0,0) of the gauge, in
pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LeftScript</td>

      <td align="undefined" valign="undefined">An
optional&nbsp;<a href="#Expression_Evaluation">script</a>
that evaluates the top left hand X position of the element, and
overrides the FloatPosition.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">TopScript</td>

      <td align="undefined" valign="undefined">An
optional&nbsp;<a href="#Expression_Evaluation">script</a>
that evaluates the top left hand Y position of the element, and
overrides the FloatPosition.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Visibility</td>

      <td align="undefined" valign="undefined">An
optional <a href="#Expression_Evaluation">script</a>
to evaluate the visibility. For example:<br>

      <span style="font-weight: bold;">(A:PARTIAL PANEL
ELECTRICAL, enum)!</span><br>

The enum for this variable is (0 = OK, 1= fail, 2 = blank), so in this
case the result is inverted by the "!" operator to give 1 = OK and 0 =
fail. See the <a href="../../Core Utilities Kit/Variables/Simulation Variables.html">Simulation
Variables</a> document for details of all the variables. </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">SizeScale</td>

      <td align="undefined" valign="undefined">Float
value to scale the size of the element, default is 1.000.</td>

    </tr>

  </tbody>
</table>

<br>

Element objects can be the parent of &nbsp;<a href="#Comment_Objects">Comment</a> objects, <a href="#Arc_Objects">Arc</a>
objects, <a href="#Circle_Objects">Circle</a>
objects, <a href="#CustomDraw_Objects">CustomDraw</a>
objects, <a href="#Element_Objects">Element</a>
objects, <a href="#Ellipse_Objects">Ellipse</a>
objects, <a href="#Image_Objects">Image</a>
objects, <a href="#GaugeText_Objects">GaugeText</a>
objects,
<a href="#HorizontalLine_Objects">HorizontalLine</a>
objects, <a href="#MaskImage_Objects">MaskImage</a>
objects, <a href="#Pie_Objects">Pie</a> objects, <a href="#Polygon_Objects">Polygon</a>
objects, <a href="#Polyline_Objects">PolyLine</a>
objects, <a href="#Rectangle_Objects">Rectangle</a>
objects, <a href="#Rotation_Objects">Rotation</a>
objects, <a href="#Select_Objects">Select</a>
objects, <a href="#Shift_Objects">Shift</a>
objects, and <a href="#VerticalLine_Objects">VerticalLine</a>
objects.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId859288"></a><a name="Arc_Objects"></a>Arc Objects</h4>

Arc objects are used to draw arcs (curved lines) as part of the gauge.<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis<br>

      </td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the arc, in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
the graphic remains at its normal color at night, otherwise it will be
darkened.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Radius</td>

      <td align="undefined" valign="undefined">Integer
radius of the arc, in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">Integer
line width, in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">StartAngle</td>

      <td align="undefined" valign="undefined">The
integer start angle of the arc, in degrees.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">EndAngle</td>

      <td align="undefined" valign="undefined">The
integer end angle of the arc, in degrees.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">StartAngleScript</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#Expression_Evaluation">script</a>
to evaluate the start angle, overriding StartAngle.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">EndAngleScript</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#Expression_Evaluation">script</a>
to evaluate the end angle, overriding EndAngle.</td>

    </tr>

  </tbody>
</table>

<br>

<p>Arc objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects.</p>

<br>

<h4><a class="mozTocH4" name="mozTocId828691"></a><a name="Gauge_Colors"></a>Gauge Colors</h4>

Simple line, text and fill colors can be entered as RGB hex values
(such as 0xFFFFFF) or text strings. Do not use quotes. See the <a href="Images/Gauge%20Colors.mht">Gauge Colors file</a> for a
full list of colors.<br>

<br>

<h5><a name="Gauge_Color_Scripts"></a>Gauge
Color Scripts</h5>

Scripts can be used to evaluate a color. The same expression evaluation
is used as for numerical values, but in this case the script must
evaluate to a string containing either the name of the color, or the
RGB hex value of the color. In this case strings must be enclosed in
single quotes.&nbsp;<br>

<br>

For example, the following scripts evalute to red if the indicated
airspeed is greater than 300 knots, otherwise to blue.<br>

<ul>

  <li><span style="font-weight: bold;">'red' 'blue'
(A:AIRSPEED INDICATED, knots) 300 &gt; ?</span></li>

  <li><span style="font-weight: bold;">'0xff0000'
'0x0000ff' (A:AIRSPEED INDICATED, knots) 300 &gt; ?</span></li>

  <li><span style="font-weight: bold;">0xff0000&nbsp;0x0000ff
(A:AIRSPEED INDICATED, knots) 300 &gt; ?</span></li>

</ul>

<span style="font-weight: bold;"></span>
<ul>

</ul>

<p>See the <a href="Gauge%20Colors.mht">Gauge
Colors file</a> for a
full list of colors. And refer to <a href="#Expression_Evaluation">Expression
Evaluation</a> for full details on writing scripts.</p>

<p></p>

<h4><a class="mozTocH4" name="mozTocId706563"></a><a name="Circle_Objects"></a>Circle Objects</h4>

Circle objects are used to draw circles as part of the gauge.
<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis<br>

      </td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the circle, in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Radius</td>

      <td align="undefined" valign="undefined">Integer
radius of the circle, in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.
If no fill color is set, only the outline of the circle will be drawn.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides FillColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">Integer
line width, in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

  </tbody>
</table>

<br>

Circle objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId321959"></a><a name="CustomDraw_Objects"></a>CustomDraw
Objects</h4>

CustomDraw objects are used to provide input to specially written
library code (a C or C++ dll) that is to calculate the updating of the
gauge element. The GPS system provided with <span style="font-style: italic;">Flight Simulator</span> is
an example of a complex instrument that requires a CustomDraw object.
<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined"></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Name<br>

      </td>

      <td align="undefined" valign="undefined"></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">CustomDrawParam</td>

      <td align="undefined" valign="undefined">List
of <a href="#CustomDrawParam_Objects">CustomDrawParam</a>
objects.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

  </tbody>
</table>

<br>

CustomDraw objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects and <a href="#CustomDrawParam_Objects">CustomDrawParam</a>
objects.<br>

<br>

<h5><a name="CustomDrawParam_Objects"></a>CustomDrawParam
Objects</h5>

CustomDrawParam objects provide name-value pairs to be provided as
input to&nbsp;custom gauge library code.
<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Name<br>

      </td>

      <td align="undefined" valign="undefined"><br>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Value</td>

      <td align="undefined" valign="undefined"></td>

    </tr>

  </tbody>
</table>

<br>

CustomDraw objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects.<br>

<br>

<br>

<h4><a class="mozTocH4" name="mozTocId385474"></a><a name="Ellipse_Objects"></a>Ellipse
Objects</h4>

<p>Ellipse objects are used to draw ellipses as part of the gauge.
  
</p>
<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis<br>

      </td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the ellipse, &nbsp;in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Height</td>

      <td align="undefined" valign="undefined">The
height of the ellipse in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Width</td>

      <td align="undefined" valign="undefined">The
width of the ellipse in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.&nbsp;
If no fill color is set, only the outline of the ellipse will be drawn.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides FillColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">The
line width in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

  </tbody>
</table>

<br>

Ellipse objects can be the parent of <a href="#Comment_Objects">Comment
objects.</a><br>

<br>

<h4><a class="mozTocH4" name="mozTocId285897"></a><a name="GaugeText_Objects"></a>GaugeText
Objects</h4>

<p>GaugeText objects are used to write specific text to appear as a
  reading on the gauge. This is used, for example, with the selected
  frequency for Com and Nav, with the selected font being Digital.</p>
<p><br>
  
</p>
<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Alpha</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
the image should be interpreted as having an alpha channel.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis</td>

      <td align="undefined" valign="undefined">The
x
and y co-ordinates of the center of the text, in pixels. If rotation is
applied to the text, then this is the point that it will rotate around.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">BackgroundColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.
If a background color is not set, and Transparent is is set to <span style="font-weight: bold;">True</span>, then the text
will be drawn without any surrounding rectangle. The default background
color is black.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">BackgroundColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides BackgroundColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bilinear</td>

      <td align="undefined" valign="undefined"></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">BlinkCode</td>

      <td align="undefined" valign="undefined"><a href="#Expression_Evaluation">Script</a>
that evaluates how the text should blink. Note that the blinking will
not occur in the tool.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bold</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> for
bold text.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Caption</td>

      <td align="undefined" valign="undefined"></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Charset</td>

      <td align="undefined" valign="undefined"></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">DegreesPointsTo</td>

      <td align="undefined" valign="undefined">The
starting value for a rotation, in degrees.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Fixed</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
all text should be on a single line.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontFace</td>

      <td align="undefined" valign="undefined">Text
font to use, for example: ARIAL, HELVETICA, COURIER NEW, TIMES NEW
ROMAN.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides FontColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontHeight</td>

      <td align="undefined" valign="undefined">Height
of the characters in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontHeightScript</td>

      <td align="undefined" valign="undefined">If
used, overrides FontHeight. Script to evaluate the font height.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FontWeight</td>

      <td align="undefined" valign="undefined">Integer,
0 for normal text. Increase for bolder text.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">GaugeString</td>

      <td align="undefined" valign="undefined">The
text to be displayed. If the text is to be shown as-is, do not put it
in quotes, just enter the text. This can also be a <a href="#Expression_Evaluation">script</a>,
in which case precede the script with a&nbsp; % mark to indicate
that the
contained text should be evaluated as a normal script. For example,<br>

      <span style="font-weight: bold;">%(A:GENERAL ENG
RMP:1, rpm)%!d!<br>

      </span>The<span style="font-weight: bold;">
%!d!</span>
at the end specifies that the result should be interpreted as a decimal
number. There should not be a space between the % and the !.<br>

The other options are <span style="font-weight: bold;">!f!</span>
for a float and <span style="font-weight: bold;">!s!</span>
for a string. Decimal and floating point numbers can be formatted
further, see the <a href="#Examples_of_Number_Formatting">examples</a>
below.<br>

The standard escape codes, such as <span style="font-weight: bold;">\n</span>
for newline and<span style="font-weight: bold;"> \t</span>
for tab, work in gauge strings.<br>

See the table of <a href="#Examples_of_GaugeStrings">GaugeString</a>
examples below. <span style="font-weight: bold;"></span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">HilightColor</td>

      <td align="undefined" valign="undefined">The
color to use when the text is highlighted. See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">HorizontalAlign</td>

      <td align="undefined" valign="undefined">One
of:<br>

      <span style="font-weight: bold;">LEFT</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">CENTER</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">RIGHT</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Italic</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> for
italic text.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Length</td>

      <td align="undefined" valign="undefined">The
maximum number of characters in the string to display.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Luminous</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
the text illuminates at night.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Multiline</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
there can be more than one line of text.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">PointsTo</td>

      <td align="undefined" valign="undefined">One
of:<br>

      <span style="font-weight: bold;">NORTH</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">EAST</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">SOUTH</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">WEST</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">ScrollY</td>

      <td align="undefined" valign="undefined">An
optional <a href="#Expression_Evaluation">script</a>
that is used to determine by how many pixels the text should be
scrolled.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">Two
integers, the width and height of the text box in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">HeightScript</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#Expression_Evaluation">script</a>
that overrides Size, calculating the height of the&nbsp;text box.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">WidthScript</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#Expression_Evaluation">script</a>
that overrides Size, calculating the width of the&nbsp;text box.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">StrikeThrough</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> for
strikethrough text, for example <span style="text-decoration: line-through;">STRIKETHROUGH</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Tabs</td>

      <td align="undefined" valign="undefined">Describes
the location of tab stops for the string.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Transparent</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
the text is not to be displayed with a surrounding rectangle of the
background color.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Underline</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> for
underlined text.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">VerticalAlign</td>

      <td align="undefined" valign="undefined">One
of:<br>

      <span style="font-weight: bold;">TOP</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">CENTER</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">BOTTOM</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">WidthFit</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
the text should be expanded to fit the width of the text box.</td>

    </tr>

  </tbody>
</table>

<br>

GaugeText objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects and <a href="#Image_Objects">Image</a>
objects.<br>

<br>

<h5>Formatting Numbers</h5>

The format for numbers is contained within the !...! marks.<br>

The last letter is required and is case-sensitive, is the formatting of
the variable, where:<br>

<ul>

  <li>s = string.&nbsp; </li>

  <li>d = decimal number (integer).&nbsp; If the number is
not an
integer, it is rounded to the nearest integer.&nbsp; Note that
rounding, not truncation occurs. </li>

  <li>f = number (floating point)</li>

</ul>

The formatting letter can be preceded by a numer, which is the minimum
number of digits to display, and is optional. For decimal
numbers&nbsp;the following rules apply:
<ul>

  <li>If d is preceded by the digit &lsquo;0&rsquo;, then
leading zeros are added if necessary.</li>

  <li>If d is preceded by &lsquo;-&lsquo;, text is
left-aligned.</li>

  <li>If d is preceded by &lsquo;+&rsquo;,&nbsp; a
&lsquo;+&rsquo;
symbol is indicated in front of the number when the number is greater
than 0 (a &lsquo;-&lsquo; is always used to indicate numbers
less than
0).</li>

  <li>If d is preceded by &lsquo; &lsquo; (space),
leading spaces are added if necessary.</li>

</ul>

For floating point nubmers, the following rule applies:<br>

<ul>

  <li>If a decimal point is used in the formatting number, the
digit
after the decimal point specifies the number of digits to display after
the decimal point.</li>

</ul>

<h6><a name="Examples_of_Number_Formatting"></a>Examples
of Number Formatting</h6>

<p>&nbsp;</p>

<table border="1" cellpadding="1" cellspacing="1">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">String</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Result</span> </td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td style="font-weight: bold;">%( 12.34 )%!4.3f!</td>

      <td align="undefined" valign="undefined">12.340</td>

      <td>The 4 in 4.3 is ignored.</td>

    </tr>

    <tr>

      <td style="font-weight: bold;">%( 12.34 )%!04.3f!</td>

      <td align="undefined" valign="undefined">12.340</td>

      <td>Leading &lsquo;0&rsquo;s are not added to
floating point numbers.</td>

    </tr>

    <tr>

      <td style="font-weight: bold;">%( 12345.6789 )%!4.3f!</td>

      <td align="undefined" valign="undefined">12345.679</td>

      <td>The number before decimal point does not limit the
number of digits displayed before decimal point.</td>

    </tr>

    <tr>

      <td style="font-weight: bold;">%( 34.56 )%!+d!</td>

      <td align="undefined" valign="undefined">+35</td>

      <td>Rounding, not truncation, has occured.</td>

    </tr>

    <tr>

      <td style="font-weight: bold;">%(234)%!5d!</td>

      <td align="undefined" valign="undefined">&nbsp;
234</td>

      <td> Two leading&nbsp;spaces have been prefixed to the
number.</td>

    </tr>

    <tr>

      <td style="font-weight: bold;">%(
&lsquo;foo&rsquo; )%!5s!</td>

      <td align="undefined" valign="undefined">&nbsp;foo</td>

      <td> Two leading spaces have been prefixed to the string</td>

    </tr>

    <tr>

      <td style="font-weight: bold;">%( 234 )%!3s!</td>

      <td align="undefined" valign="undefined">234</td>

      <td>The number is output as a string, with a minimum of
three digits.</td>

    </tr>

  </tbody>
</table>

<p><br>

</p>

<h5><a name="Examples_of_GaugeStrings"></a>Examples
of GaugeStrings</h5>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Gauge string</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Fuel Pressure</span></td>

      <td align="undefined" valign="undefined">The
text will appear exactly as entered: <span style="font-weight: bold;">Fuel Pressure</span></td>

    </tr>

    <tr>

      <td style="font-weight: bold;" align="undefined" valign="undefined">Fuel Capacity: %(A:FUEL TOTAL
CAPACITY)%!1.2f!</td>

      <td align="undefined" valign="undefined">The
fuel
capacity of the aircraft will be given as a floating point number
acurate to two decimal places, following the initial string, such as:<br>

      <span style="font-weight: bold;">Fuel Capacity: 80.55</span></td>

    </tr>

    <tr>

      <td style="font-weight: bold;" align="undefined" valign="undefined">%(A:ENG ON FIRE:1 A:ENG ON FIRE:2 ! if{
'Warning: Engine Fire' } )</td>

      <td align="undefined" valign="undefined">The
text string "<span style="font-weight: bold;">Warning:
Engine Fire</span>" will appear if either or both of the engines
are on fire.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">%( 1 )%{if}ON%{else}OFF%{end} </span></td>

      <td align="undefined" valign="undefined">The
text <span style="font-weight: bold;">ON</span>
would be rendered. If there is no <span style="font-weight: bold;">{else}</span>
statement, then no text will be displayed if the condition evaluates to
false.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">%( 3 )%{case}%{ :0 }AIRPORT%{ :1
}INTERSECTION%{ :2 }NDB%{ :3 }VOR%{ :4 }MARKER%{end}</span></td>

      <td align="undefined" valign="undefined">A
case
statement can be used to select a text string from a group of strings.
The case numbers do not have to be sequential. The example would
produce the result:<br>

      <span style="font-weight: bold;">VOR</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">%((C:Mission:OnScreenTimerValue)
60 / 60 / flr )%!02d!:</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">%((C:Mission:OnScreenTimerValue)
60 / flr 60 %)%!02d!:</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">%((C:Mission:OnScreenTimerValue)
flr 60 %)%!02d!.</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">%((C:Mission:OnScreenTimerValue)
10 * flr 10 % )%!01d!</span></td>

      <td align="undefined" valign="undefined">Takes
the custom on-screen timer value and displayes the time in hours,
minutes,&nbsp;seconds and tenths of a second.<br>

The <span style="font-weight: bold;">!02d! </span>indicates
that the text output should be displayed with two digits (for example,
06). The <span style="font-weight: bold;">%</span>
signs inside the string refer to the modulus operator, and the colons
and period between the statments will appear on the screen as text, for
example:<br>

      <span style="font-weight: bold;">01 : 14: 08 . 2</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">85 %%</span></td>

      <td align="undefined" valign="undefined">To
output the percent character, use two percent signs in the script:<br>

      <span style="font-weight: bold;">85 %</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">%(10 s2 1 s1)%{loop}%( l1 )%!s!
%( l1 ++ s1 l2 &lt;)%{next}</span></td>

      <td align="undefined" valign="undefined">This
statement sets up two registers s1 and s2, with the numbers 1 and 10,
then loops to print out:<br>

      <span style="font-weight: bold;">1 2 3 4 5 6 7 8 9<br>

      </span>Whatever value is on top of the stack when the <span style="font-weight: bold;">%(next)</span> statement is
reached is evaluated as a boolean to determine if execution of the loop
should continue.<span style="font-weight: bold;"></span></td>

    </tr>

  </tbody>
</table>

<br>

<br>

<br>

<h4><a class="mozTocH4" name="mozTocId103000"></a><a name="HorizontalLine_Objects"></a>HorizontalLine
Objects</h4>

<br>

HorizontalLine objects are&nbsp;used to draw horizontal lines as
part of the gauge.<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis<br>      </td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the line, in pixels. If
rotation is applied to the line, then this is the point that it will
rotate around.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">Line
width in pixels.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>
    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>
    </tr>
  </tbody>
</table>

<br>

HorizontalLine objects can be the parent of <a href="#Comment_Objects">Comment objects</a>.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId408211"></a><a name="MaskImage_Objects"></a>MaskImage
Objects</h4>

<br>

MaskImage objects are used to provide see-through effects. If the pixel
within a mask image is set to 0x000000 then the background image pixel
will be displayed. If the pixel of the mask image is set to 0x010101
then the pixel from the associated image will be displayed. If the
pixel of the mask image is set to anything else, then it will be the
pixel displayed.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis</td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the mask, in pixels. If
rotation is applied to the mask, then this is the point that it will
rotate around.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Name</td>

      <td align="undefined" valign="undefined">Filename
of the image to use as the mask</td>

    </tr>

  </tbody>
</table>
<p>&nbsp;</p>
<p>MaskImage objects can be the parent of <a href="#Comment_Objects">Comment objects.</a><br>
<p>
Mask images allow a gauge designer to create a hole in a layer so that a piece of the gauge can be seen through another piece.&nbsp; As an example, the airspeed indicator for the Cessna 172 has a TAS component.&nbsp; Through the window in the gauge background the rotating airspeed card is visible. There are two ways to generate the hole:</p>

    <ol>
      <li>Specify a transparent area in a static image that also displays other things (for example, tick marks and other graphics associated with a gauge)</li>
      <li>Create a mask image that is used purely to specify which area of its associated element to display.&nbsp; This is similar to specifying a transparent area in a static image, except that no visible graphics need to be associated with        this type of mask. For example (note black is transparent in all images):<br>
        <br>
          <table width="800" border="1" cellspacing="2" cellpadding="4">
            <tr>
              <td><img src="Images/MaskImageExample.JPG" width="670" height="348"></td>
            </tr>
          </table>
    </ol>
    <p>
Note that the magenta used in the Mask Image is actually of RGB value 1,1,1 (which is very close to black). When you see these images in drawing programs, they appear completely black. The apparent advantage of using method 2 is size savings.  A monochrome bitmap can be used to generate the two color mask image.</p>
    <p>&nbsp;</p>
    <p> The following shows a simple example of the XML generated by including a mask image. The &lt;MaskImage&gt; element is used as a sub-element of a gauge &lt;Element&gt;.  In other words, the &lt;MaskImage&gt; and &lt;Image&gt; elements are siblings.<br>
    </p>
    <table width="800" border="1" cellspacing="2" cellpadding="4">
      <tr>
        <td>&lt;Element&gt;<br>
&nbsp;&nbsp;&lt;Position X=&quot;18&quot; Y=&quot;18&quot;/&gt; <br>
&nbsp;&nbsp;&lt;MaskImage Name=&quot;ap_ahi_window.bmp&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Axis X=&quot;61.5&quot; Y=&quot;61.5&quot;/&gt;<br>
&nbsp;&nbsp;&lt;/MaskImage&gt;<br>
&nbsp;&nbsp;&lt;Image Name=&quot;ap_ahi_dial.bmp&quot; PointsTo=&quot;North&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Axis X=&quot;59&quot; Y=&quot;59&quot;/&gt;<br>
&nbsp;&nbsp;&lt;/Image&gt;<br>
&nbsp;&nbsp;&lt;Rotate&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Value Minumum=&quot;-90&quot; Maximum=&quot;90&quot;&gt;(A:Attitude indicator bank degrees:1,degrees) -90 max 90 min&lt;/Value&gt; <br>
&nbsp;&nbsp;&lt;/Rotate&gt;<br>
&lt;/Element&gt;</td>
      </tr>
    </table>
    <h4><a class="mozTocH4" name="mozTocId69607"></a><a name="Pie_Objects"></a>Pie Objects</h4>

Pie objects are used to draw pies as part of the gauge.
<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis<br>

      </td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the pie, in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Radius</td>

      <td align="undefined" valign="undefined">Radius
of the pie in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">Width
of the line in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.&nbsp;If
no fill color is set, only the outline of the pie will be drawn.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides FillColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">StartAngle</td>

      <td align="undefined" valign="undefined">The
integer start angle of the arc, in degrees.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">EndAngle</td>

      <td align="undefined" valign="undefined">The
integer end angle of the arc, in degrees.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">StartAngleScript</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#Expression_Evaluation">script</a>
to evaluate the start angle, overriding StartAngle.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">EndAngleScript</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#Expression_Evaluation">script</a>
to evaluate the end angle, overriding EndAngle.</td>

    </tr>

  </tbody>
</table>

<br>

Pie objects can be the parent of <a href="#Comment_Objects">Comment
objects.</a><br>

<br>

<h4><a class="mozTocH4" name="mozTocId929466"></a><a name="Polygon_Objects"></a>Polygon
Objects</h4>

Polygon objects are used to draw polygons as part of the gauge. The
shape of the polygon is determined by any number of <a href="#Point_Objects">Points</a>.&nbsp;<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis<br>

      </td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the polygon, in pixels. If
rotation is applied to the polygon, then this is the point that it will
rotate around.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Point</td>

      <td align="undefined" valign="undefined">List
of <a href="#Point_Objects">Points</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.
If no fill color is set, only the outline of the polygon will be drawn.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides FillColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">Line
width in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

  </tbody>
</table>

<br>

Polygon objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects, and <a href="#Point_Objects">Point</a>
objects.<br>

<br>

<h5><a name="Point_Objects"></a>Point Objects</h5>

<br>

Point objects are used to specify the outline of a <a href="#Polygon_Objects">Polygon</a> or <a href="#Polyline_Objects">Polyline</a> object.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FloatPosition</td>

      <td align="undefined" valign="undefined">Two
floating point numbers identifying the point relative to the top left
hand corner of the parent object.</td>

    </tr>

  </tbody>
</table>

<br>

Point objects can be the parent of <a href="#Comment_Objects">Comment
objects.</a><br>

<br>

<h4><a class="mozTocH4" name="mozTocId401599"></a><a name="Polyline_Objects"></a>Polyline
Objects</h4>

Polyline objects are used to draw polylines as part of the gauge. The
shape of the polyline is determined by any number of <a href="#Point_Objects">Points</a>.
The polyline is not filled in with the fill color. If&nbsp; filling
is required, use a <a href="#Polygon_Objects">Polygon</a>
object.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis<br>

      </td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the polyline, in pixels. If
rotation is applied to the polyline, then this is the point that it
will
rotate around.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Point</td>

      <td align="undefined" valign="undefined">List
of <a href="#Point_Objects">Points</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">Line
width in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

  </tbody>
</table>

<br>

Polyline objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects, and <a href="#Point_Objects">Point</a>
objects.<br>

<h4><a class="mozTocH4" name="mozTocId33639"></a><a name="Rectangle_Objects"></a>Rectangle
Objects</h4>

Rectangle objects are used to draw rectangles as part of the gauge.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis<br>

      </td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the rectangle, in pixels. If
rotation is applied to the rectangle, then this is the point that it
will
rotate around.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">Line
width in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Width</td>

      <td align="undefined" valign="undefined">Width
of the rectangle in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">WidthScript</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#Expression_Evaluation">script</a> to
calculate the width of the rectangle, overriding Width.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Height</td>

      <td align="undefined" valign="undefined">Height
of the rectangle in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">HeightScript</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#Expression_Evaluation">script</a>
to calculate the height of the rectangle, overriding Height.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.&nbsp;
If no fill color is set, only the outline of the rectangle will be
drawn.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FillColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides FillColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Transparency</td>

      <td align="undefined" valign="undefined"></td>

    </tr>

  </tbody>
</table>

<br>

Rectangle objects can be the parent of <a href="#Comment_Objects">Comment
</a>objects.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId377007"></a><a name="Rotation_Objects"></a>Rotation
Objects</h4>

<br>

Rotation objects are used to display readings that rotate in nature,
such as dials. If the movement of the needle of the dial is not linear,
then add a <a href="#NonLinearityTable_Objects">NonlinearityTable</a>
object as a child of this object.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Expression</td>

      <td align="undefined" valign="undefined">One <a href="#Expression_Objects">Expression</a>. This
evaluates to the number of <span style="font-style: italic;">radians</span>
to rotate the element.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FailureTable</td>

      <td align="undefined" valign="undefined">Optional
      <a href="#FailureTable_Objects">FailureTable</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">PointsTo<br>

      </td>

      <td align="undefined" valign="undefined"><p>The
        starting position, often of a needle.<br>
        
        One of:<br>
        
        <span style="font-weight: bold;">NORTH</span><br style="font-weight: bold;">
        
        <span style="font-weight: bold;">EAST</span><br style="font-weight: bold;">
        
        <span style="font-weight: bold;">SOUTH</span><br style="font-weight: bold;">
        
      <span style="font-weight: bold;">WEST</span></p>
      <p>DegreesPointsTo should not be used if this is specified. </p></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">DegreesPointsTo</td>

      <td align="undefined" valign="undefined">If PointsTo is not specified, this gives the
starting point for the rotation, in degrees.</td>

    </tr>

  </tbody>
</table>

<br>

Rotation objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects, <a href="#Delay_Objects">Delay</a>
objects,
<a href="#Expression_Objects">Expression</a>
objects, <a href="#FailureTable_Objects">FailureTable</a>
objects, and <a href="#NonLinearityTable_Objects">NonlinearityTable</a>
objects.<br>

<br>

<h5><a name="Delay_Objects"></a>Delay Objects</h5>

<br>

Delay objects are used to ensure the movement of a needle (or other
indicator) is smooth, and does not jump. The DelayValue in effect
represents the maximum speed of the movement. For example, if
DelayValue is set to <span style="font-weight: bold;">120</span>,
and DelayUnits to <span style="font-weight: bold;">DEGREES_PER_SECON</span>D,
then a needle can only move 120 degrees per second (or 4 degrees per
frame at a frame rate of 30 fps), even if the evaluated value jumps
from 0 to 180 in one calculation.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">DelayValue</td>

      <td align="undefined" valign="undefined">The
length of the delay.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">DelayUnits</td>

      <td align="undefined" valign="undefined">One
of:<br>

      <span style="font-weight: bold;">PIXELS_PER_SECOND</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">VALUE_PER_SECOND</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">DEGREES_PER_SECOND</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">RADIANS_PER_SECOND</span></td>

    </tr>

  </tbody>
</table>

<br>

Delay objects can be the parent of <a href="#Comment_Objects">Comment
</a>objects.<br>

<br>

<h5><a name="Expression_Objects"></a>Expression
Objects</h5>

<br>

Expression objects are used to evaluate expressions, often giving the
actual reading that should be displayed. Simple instruments like the
altimeter require very simple evaluation scripts, but complex
instruments like a GPS system will require complex scripts and a very
good understanding of &nbsp;the scripting syntax and semantics,
described in <a href="#Expression_Evaluation">Expression
Evaluation</a>.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Minimum</td>

      <td align="undefined" valign="undefined">A
fixed minimum value, that will be the result if the script evaluates to
a lower value than this. The default value of -9999999 indicats that
this values is not being used.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Maximum</td>

      <td align="undefined" valign="undefined">A
fixed maximum value, that will be the result if the script evaluations
to a higher value than this.&nbsp;The default value of -9999999
indicats that this values is not being used.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Script<br>

      </td>

      <td align="undefined" valign="undefined">The
evaluation script. See <a href="#Expression_Evaluation">Expression
Evaluation</a>, and <a href="#Expression_Evaluation_Examples">Expression
Evaluation Examples</a> for a full explanation of how to write
scripts. A full list of variables names
that can be used within scripts can be found in the <a href="../../Core Utilities Kit/Variables/Simulation Variables.html">Simulation
Variables</a> document.</td>

    </tr>

  </tbody>
</table>

<br>

Expression objects can be the parent of <a href="#Comment_Objects">Comment
</a>objects.<br>

<br>

<br>

<h5><a name="FailureTable_Objects"></a>FailureTable
Objects</h5>

<br>

FailureTable objects are used to contain the list of failures, with the
appriate actions, that apply to an element of the gauge.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Failure</td>

      <td align="undefined" valign="undefined">List
of <a href="#Failure_Objects">Failures</a>.</td>

    </tr>

  </tbody>
</table>

<br>

FailureTable objects can be the parent of <a href="#Failure_Objects">Failure</a>
objects.<br>

<br>

<h5><a name="Failure_Objects"></a>Failure
Objects</h5>

<br>

Failure objects are used to link failure keys with a certain action.
Failures can be initiated by the user through the Failures dialogs of <span style="font-style: italic;">Flight</span> <span style="font-style: italic;">Simulator</span>, or can
come from actions set by Missions (see the Mission creation document).<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Fail_Key<br>

      </td>

      <td align="undefined" valign="undefined">One
of:<br>

      <span style="font-weight: bold;">NONE</span><span style="font-weight: bold;"><br>

SYSTEM_ENGINE</span><span style="font-weight: bold;"><br>

SYSTEM_PITOT_STATIC</span><br>

      <span style="font-weight: bold;">SYSTEM_VACUUM</span><span style="font-weight: bold;"><br>

GAUGE_ADF</span><span style="font-weight: bold;"><br>

GAUGE_AIRSPEED</span><br>

      <span style="font-weight: bold;">GAUGE_ALTIMETER</span>,<span style="font-weight: bold;"><br>

GAUGE_COMMUNICATIONS</span><span style="font-weight: bold;"><br>

GAUGE_FUEL_INDICATORS</span><br>

      <span style="font-weight: bold;">GAUGE_GYRO_HEADING</span><br>

      <span style="font-weight: bold;">GAUGE_MAGNETIC_COMPASS</span><br>

      <span style="font-weight: bold;">GAUGE_NAVIGATION_VOR1</span><span style="font-weight: bold;"><br>

GAUGE_NAVIGATION_VOR2</span><br>

      <span style="font-weight: bold;">GAUGE_TRANSPONDER</span><br>

      <span style="font-weight: bold;">GAUGE_TURN_COORDINATOR</span><br>

      <span style="font-weight: bold;">GAUGE_VERTICAL_SPEED</span><br>

      <span style="font-weight: bold;">GAUGE_ELECTRICAL_PANEL</span><br>

      <span style="font-weight: bold;">GAUGE_ELECTRICAL_AVIONICS</span><br>

      <span style="font-weight: bold;">GAUGE_COMMUNICATIONS</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Fail_Action<br>

      </td>

      <td align="undefined" valign="undefined">One
of:<br>

      <span style="font-weight: bold;">None</span><br>

      <span style="font-weight: bold;">Freeze</span>,<br>

      <span style="font-weight: bold;">Zero</span><br>

      <span style="font-weight: bold;">Cover</span> <br>

      <span style="font-weight: bold;">NoDraw</span></td>

    </tr>

  </tbody>
</table>

<br>

Failure objects cannot be the parent of other objects.<br>

<br>

<h5><a name="NonLinearityTable_Objects"></a>NonLinearityTable
Objects</h5>

<br>

NonLinearityTable objects are used to describe the readings from
instruments where there is not a linear relatiionship between the value
and the display. For example, higher speeds on airspeed indicators are
often much closer together on the dial than lower speeds. Nonlinearity
tables can apply to both <a href="#Rotation_Objects">Rotation</a>
objects and <a href="#Shift_Objects">Shift</a>
objects.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">NonLinearityEntry<br>

      </td>

      <td align="undefined" valign="undefined">List
of <a href="#NonLinearityEntry_Objects">NoninearityEntry</a>
objects.</td>

    </tr>

  </tbody>
</table>

<br>

NonLinearityTable&nbsp;objects can be the parent of
<a href="#NonLinearityEntry_Objects">NonlinearityEntry</a>
objects.<br>

<br>

<h5><a name="NonLinearityEntry_Objects"></a>NonlinearityEntry
Objects</h5>

<br>

NonLinearityEntry objects are used to link one value of the related
expression to one position of the element (for example, the airspeed
indicator needle). If the expression result falls exactly on the
ExpressionResult, then the position from this entry object is taken. If
the expression result falls between the results for two
NonlinearityEntry objects then the position of the needle is calculated
linearly between these two positions. For this reason, to get the most
accurate needle positioning, enter a good number of NonlinearityEntry
objects.<br>

Non-linearity values should be listed as they appear on the gauge,
clockwise around the face, or left to right. If gauge values increase
when rotating clockwise (or moving left to right), values in the
non-linearity table should start at the minimum and increase. If gauge
values decrease when rotating clockwise, then values in the table
should start with the maximum and decrease.<br>

Only one of Degrees, Radians or FloatPosition should be used.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">ExpressionResult</td>

      <td align="undefined" valign="undefined">The
value of the related <a href="#Expression_Objects">Expression</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Degrees</td>

      <td align="undefined" valign="undefined">Rotation
of the element in degrees, or -99999.00 if this is not used.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Radians<br>

      </td>

      <td align="undefined" valign="undefined">Rotation
of the elment in redians, or -99999.00 if this is not used.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FloatPosition</td>

      <td align="undefined" valign="undefined">The
X and Y offset, that defines the slope for the indicator to take, or
0,0 if this is not used.</td>

    </tr>

  </tbody>
</table>

<br>

NonLinearityEntry objects can be the parent of <a href="#Comment_Objects">Comment objects</a>.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId871249"></a><a name="Select_Objects"></a>Select Objects</h4>

<br>

Select objects are used to select one from a range of cases, depending
on
the evaluation of the expression. A simple example of this are displays
that change when a setting is on or off (the image used for a light
switch, for example).<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Expression</td>

      <td align="undefined" valign="undefined">The <a href="#Expression_Objects">Expression</a> to evaluate.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Case</td>

      <td align="undefined" valign="undefined">A
list of usually two or more <a href="#Case_Objects">Case</a>
objects.</td>

    </tr>

  </tbody>
</table>

<br>

Select objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects, <a href="#Expression_Objects">Expression</a>
objects
and <a href="#Case_Objects">Case</a> objects.<br>

<br>

<h5><a name="Case_Objects"></a>Case Objects</h5>

<br>

Case objects are used to provide the individual cases to the parent <a href="#Select_Objects">Select</a> object. Each Case
object will usually have an associated <a href="#Image_Objects">Image</a>
or <a href="#GaugeText_Objects">GaugeText</a>
object, to be displayed if this particular case applies.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">ExpressionResult</td>

      <td align="undefined" valign="undefined">The
value of the related <a href="#Expression_Objects">Expression</a>.
Can be as simple as 0 or 1, for off and on.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Minimum</td>

      <td align="undefined" valign="undefined">&nbsp;</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Maximum<br>

      </td>

      <td align="undefined" valign="undefined"></td>

    </tr>

  </tbody>
</table>

<br>

Case objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects, <a href="#Image_Objects">Image</a>
objects and
<a href="#GaugeText_Objects">GaugeText</a> objects.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId699062"></a><a name="Shift_Objects"></a>Shift Objects</h4>

<br>

Shift objects are used to display readings that are linear in nature.
They can be horizontal, vertical, or even diagonal if both floating
point numbers are used for Scale, WrapMin and WrapMax. Typically though
most shift objects will only move in one direction. Shift objects often
represent gauges that have an internal circular dial (some compasses,
for example) but where the viewer does not see the rotation, only the reading (and perhaps a few values either side of this). Wrap points need to be set in this case, when the
display of the associated image starts again from the other side of the
image. Many Shift objects will not need wrap points, the bounds being set by the Minimum and Maximum values for the Expression. <br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Expression</td>

      <td align="undefined" valign="undefined">An <a href="#Expression_Objects">Expression</a> object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FailureTable</td>

      <td align="undefined" valign="undefined">An
optional <a href="#FailureTable_Objects">FailureTable</a>
object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Scale<br>

      </td>

      <td align="undefined" valign="undefined">Two
floats, &nbsp;the first indicating the multiplier in the X direction, the
second in the Y direction. The scale value is multiplied by the result of the Expression, to give a pixel value in the X and Y directions. In many cases one of the two floats will be zero. </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">WrapMin</td>

      <td align="undefined" valign="undefined">Two
floats. Indicates the minimum value, in pixels, at which the associated image wraps
around to start displaying from the other end.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">WrapMax</td>

      <td align="undefined" valign="undefined">Two
floats. Indicates the maximum value, in pixels, at which the associated image wraps
around to start displaying from the other end. </td>

    </tr>

  </tbody>
</table>

<br>

Shift objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects, <a href="#Delay_Objects">Delay</a>
objects,
<a href="#NonLinearityTable_Objects">NonlinearityTable</a>
objects, <a href="#Expression_Objects">Expression</a>
objects, and <a href="#FailureTable_Objects">FailureTable</a>
objects.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId778924"></a><a name="VerticalLine_Objects"></a>VerticalLine
Objects</h4>

VerticleLine objects are used to draw vertical lines as part of the
gauge.<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Height<br>

      </td>

      <td align="undefined" valign="undefined">Height
of the line in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineWidth</td>

      <td align="undefined" valign="undefined">Width
of the line in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColor</td>

      <td align="undefined" valign="undefined">See <a href="#Gauge_Colors">Gauge Colors</a>.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">LineColorScript</td>

      <td align="undefined" valign="undefined">If
used, this overrides LineColor. See <a href="#Gauge_Color_Scripts">Gauge
Color Scripts</a>.</td>

    </tr>

  </tbody>
</table>

<br>

VerticalLine objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects.<br>

<br>

<hr style="width: 100%; height: 2px;">
<h3><a class="mozTocH3" name="mozTocId785469"></a><a name="Image_Objects"></a>Image Objects</h3>

Image objects are used to add graphics from image files to the gauge.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Transparent</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
the color black (0x000000) is to be treated as transparent.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Alpha</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
the image has an alpha channel.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Axis</td>

      <td align="undefined" valign="undefined">The
x and y co-ordinates of the center of the image, in pixels. If
rotation is applied to the image, then this is the point that it will
rotate around.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bright</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
this component is not to be dimmed at night time.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Luminous</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
a luminosity factor is to be applied to the image. The alpha channel of the image is  used, in this case, to determine what section of the  image is to be illuminated when panel lights are on. An alpha value of 0 gives the maximum luminosity. To clarify, lighting  effects are applied to the entire panel, but the luminous color is applied to the  section of the gauges specified by this alpha channel. The luminous colors are specified in the panel.cfg file, see the <a href="Panel Configuration Files.htm">Panel Configuration File</a> document ([color] section) for more details and an example of luminous colors. </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Bilinear</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
a bilinear algorithm is to be applied to the image (this is similar to
anti-aliasing).</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Name</td>

      <td align="undefined" valign="undefined">The
filename for the image (which should be in the ArtDirectory specified
by the <a href="#Gauge_Objects">Gauge</a> object).</td>

    </tr>

  </tbody>
</table>

<p><br>
  
  Image objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects.</p>
<p>&nbsp;</p>
<hr style="width: 100%; height: 2px;">
<h3><a class="mozTocH3" name="mozTocId132051"></a><a name="Macro_Objects"></a>Macro Objects</h3>

Macro objects are used to provide an efficient method of re-using
common scripts. They are particularly useful in complex instruments
such as a GPS system.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Name</td>

      <td align="undefined" valign="undefined">The
name of the macro to be used within scripts. This name can be used
within evaluated expressions, and should be unique.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">MacroValue</td>

      <td align="undefined" valign="undefined">The <a href="#Expression_Evaluation">script</a> of the macro.</td>

    </tr>

  </tbody>
</table>

<br>

Macro objects can be the parent of Macro objects and <a href="#Comment_Objects">Comment</a> objects.<br>

<br>

<h5>Macro Examples</h5>

<br>

<h6>Beech Baron Left Fuel Flow Indicator</h6>

In the following example the only differences between the left fuel
flow indicator shown, and the right fuel flow indicator, are the
scripts of the three macros. To change this example to the right fuel
flow indicator, change the <span style="font-weight: bold;">ENGINE_NUMBER</span>
script from <span style="font-weight: bold;">1</span>
to <span style="font-weight: bold;">2</span>, and
change <span style="font-weight: bold;">ENG1</span>
to <span style="font-weight: bold;">ENG2</span> in
the two tooltip text macros. To refer to a macro from within a script,
prefix the macro name with a @ symbol. Note that the xml listed in the
example below is not compatible with the ACE tool.<br>

<table style="text-align: left; width: 800px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined">&nbsp;
&lt;?xml version="1.0" encoding="utf-8" ?&gt; <br>

- &lt;Gauge Name="Left Fuel Flow Indicator" Version="1.0"&gt;<br>

&nbsp; &lt;Macro
Name="ENGINE_NUMBER"&gt;1&lt;/Macro&gt; <br>

&nbsp; &lt;Macro
Name="TOOLTIP_ID"&gt;TOOLTIPTEXT_ENG1_FUEL_FLOW_GALLON_HOUR&lt;/Macro&gt;
      <br>

&nbsp; &lt;Macro
Name="METRIC_TOOLTIP_ID"&gt;TOOLTIPTEXT_ENG1_FUEL_FLOW_LITER_HOUR&lt;/Macro&gt;
      <br>

&nbsp; &lt;Image Name="Fuel_Flow_Background.bmp"
ImageSizes="53,52,82,82" /&gt; <br>

- &lt;Element&gt;<br>

&nbsp; &lt;Position X="26" Y="26" /&gt; <br>

- &lt;Image Name="Engine_Gauges_Needle.bmp" PointsTo="East"
ImageSizes="13,5,20,8"&gt;<br>

&nbsp; &lt;Axis X="-9" Y="2" /&gt; <br>

&nbsp; &lt;/Image&gt;<br>

- &lt;Rotate&gt;<br>

&nbsp; &lt;Value Minimum="2" Maximum="30"&gt;(A:Eng fuel
flow GPH:@ENGINE_NUMBER,gallons per hour)&lt;/Value&gt; <br>

- &lt;Nonlinearity&gt;<br>

&nbsp; &lt;Item Value="5" X="33" Y="5" /&gt; <br>

&nbsp; &lt;Item Value="20" X="35" Y="46" /&gt; <br>

&nbsp; &lt;Item Value="30" X="6" Y="36" /&gt; <br>

&nbsp; &lt;/Nonlinearity&gt;<br>

&nbsp; &lt;Delay DegreesPerSecond="12" /&gt; <br>

&nbsp; &lt;/Rotate&gt;<br>

&nbsp; &lt;/Element&gt;<br>

- &lt;Mouse&gt;<br>

&nbsp; &lt;Tooltip ID="@TOOLTIP_ID"
MetricID="@METRIC_TOOLTIP_ID" /&gt; <br>

&nbsp; &lt;/Mouse&gt;<br>

&nbsp; &lt;/Gauge&gt;</td>

    </tr>

  </tbody>
</table>

<br>

<h6>Beech Baron GPS</h6>

The following table shows a small number of macro entries for the GPS
system. Notice how the&nbsp;macro <span style="font-weight: bold;">kOff</span> is used simply
as an identifying name for a value, the macro <span style="font-weight: bold;">c</span> refers to a custom
variable, and the macro <span style="font-weight: bold;">WaypointPagesInit</span>
reuses other macros many times, and itself is only used as a macro
within another macro, <span style="font-weight: bold;">PageInit</span>.
The GPS unit is one of the most complex instruments modelling in <span style="font-style: italic;">Flight Simulator</span>.<br>

<table style="text-align: left; width: 800px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined">
      <div style="margin-left: 1em; text-indent: -2em;"><span class="b">&nbsp;</span> <span class="m">&lt;</span><span class="t">&lt;Macro</span><span class="t">
Name</span><span class="m">="</span>kOff<span class="m">"&gt;</span><span class="tx">0</span><span class="m">&lt;/</span><span class="t">Macro</span><span class="m">&gt;</span> </div>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">
      <div style="margin-left: 1em; text-indent: -2em;"><span class="b">&nbsp;</span> <span class="m">&lt;</span><span class="t">&lt;Macro</span><span class="t">
Name</span><span class="m">="</span>c<span class="m">"</span><span class="m">&gt;</span><span class="tx">C:fs9gps</span><span class="m">&lt;/</span><span class="t">Macro</span><span class="m">&gt;</span>
      </div>

      </td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><span class="m">&lt;</span><span class="t">Macro</span><span class="t"> Name</span><span class="m">="</span><b>WaypointPagesInit</b><span class="m">"</span><span class="m">&gt;</span><span class="tx">(@g:currentPageWPT) 0 == (@g:currentPageWPT) 1 ==
(@g:currentPageWPT) 2 == (@g:currentPageWPT) 3 == || || || if{
(C:fs9gps:WaypointAirportIdent) slen 0 == if{ 0
(&gt;@c:NearestAirportCurrentLine) (@c:NearestAirportCurrentICAO)
(&gt;@c:WaypointAirportICAO) } } (@g:currentPageWPT) 4 == if{
(@c:WaypointIntersectionIdent) slen 0 == if{ 0
(&gt;@c:NearestIntersectionCurrentLine)
(@c:NearestIntersectionCurrentICAO)
(&gt;@c:WaypointIntersectionICAO) } } (@g:currentPageWPT) 5 == if{
(@c:WaypointNdbIdent) slen 0 == if{ 0
(&gt;@c:NearestNdbCurrentLine) (@c:NearestNdbCurrentICAO)
(&gt;@c:WaypointNdbICAO) } } (@g:currentPageWPT) 6 == if{
(@c:WaypointVorIdent) slen 0 == if{ 0
(&gt;@c:NearestVorCurrentLine) (@c:NearestVorCurrentICAO)
(&gt;@c:WaypointVorICAO) } } (@g:currentPageWPT) 3 == if{ @kOff
(&gt;@g:selectApproach) }</span><span class="m">&lt;/</span><span class="t">Macro</span><span class="m">&gt;</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined"><span class="m">&lt;</span><span class="t">Macro</span><span class="t"> Name</span><span class="m">="</span>PageInit<span class="m">"&gt;</span><span class="tx">(C:fs9gps:currentGroup)
4 == (C:fs9gps:group4currentPage) 0 == &amp;&amp; if{
@ProcedurePageInit } (C:fs9gps:currentGroup) 1 == if{ @<span style="font-weight: bold;">WaypointPagesInit</span> }
@RecalcSmallZoom</span><span class="m">&lt;/</span><span class="t">Macro</span><span class="m">&gt;</span></td>

    </tr>

  </tbody>
</table>

<br>

<hr style="width: 100%; height: 2px;">
<h3><a class="mozTocH3" name="mozTocId957980"></a><a name="MouseArea_Objects"></a>MouseArea
Objects</h3>

<br>

MouseArea objects are used to define a rectangular area where the mouse
button can be used to link to an event through a <a href="#MouseClick_Objects">MouseClick</a>object.
MouseArea objects can be the parent of other MouseArea objects,
so it can be useful to define a large area for the help ID text to
appear, and smaller areas that cover the use of controls of the gauge.
There should be only one high level MouseArea for a gauge.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">FloatPosition</td>

      <td align="undefined" valign="undefined">The
x any y position
of the top left hand corner of the mouse area, relative to the top left
hand corner of the mouse area's parent object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Size</td>

      <td align="undefined" valign="undefined">The
width and height of the mouse area, in pixels.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">CursorType</td>

      <td align="undefined" valign="undefined">The
cursor image to display when the user's mouse cursor is within the
area. One of:<br>

      <span style="font-weight: bold;">None</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">Normal</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">UpArrow</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">DownArrow</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">LeftArrow</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">RightArrow</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">Hand</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">Crosshair</span><br style="font-weight: bold;">

      <span style="font-weight: bold;">Grab</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">HelpId</td>

      <td align="undefined" valign="undefined">The
ID string that identifies the help text to display when the user's
mouse cursor is within the area. For example, <span style="font-weight: bold;">HELPID_GAUGE_KOHLSMAN_KNOB</span>.
See the <a href="HelpIDs.html">Help IDs</a> document
for a full list of IDs and details on the strings displayed.</td>

    </tr>

  </tbody>
</table>

<br>

MouseArea objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects, <a href="#MouseArea_Objects">MouseArea</a>
objects, <a href="#Tooltip_Objects">Tooltip</a>
objects and <a href="#MouseClick_Objects">MouseClick</a>
objects.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId767989"></a><a name="Tooltip_Objects"></a>Tooltip
Objects</h4>

<br>

Tooltip objects are used to display text to help the user when they
mouse over certain areas.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">DefaultId<br>

      </td>

      <td align="undefined" valign="undefined">The
ID of the tooltip text when the user has not selected a units of
measure preference. For example: <span style="font-weight: bold;">TOOLTIPTEXT_ALTIMETER_FEET</span>.
A full list of tooltip text IDs can be found in the <a href="Tooltips.html">Tooltips</a> document, along with
details of the strings that are displayed.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">MetricId<br>

      </td>

      <td align="undefined" valign="undefined">The
ID of the tooltip text when the user has selected a preference for
Metric measurements. For example, <span style="font-weight: bold;">TOOLTIPTEXT_ALTIMETER_METERS</span>.
If this is left blank the DefaultID applies.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">EnglishId<br>

      </td>

      <td align="undefined" valign="undefined">The
ID of the tooltip text when the user has selected a preference for
Imperical measurements. For example, <span style="font-weight: bold;">TOOLTIPTEXT_ALTIMETER_FEET</span>.
If this is left blank the DefaultID applies.</td>

    </tr>

  </tbody>
</table>

<br>

Tooltip objects can be the parent of <a href="#Comment_Objects">Comment</a>
objects.<br>

<br>

<h4><a class="mozTocH4" name="mozTocId86289"></a><a name="MouseClick_Objects"></a>MouseClick
Objects</h4>

<br>

MouseClick objects are used to link mouse clicks with <span style="font-style: italic;">Flight</span> <span style="font-style: italic;">Simulator</span> key
events, so enabling a user to control the instrument.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">KeyEvent</td>

      <td align="undefined" valign="undefined">The
key event that is to occur when the mouse is clicked. For example, <span style="font-weight: bold;">KOHLSMAN_DEC</span> or <span style="font-weight: bold;">KOHLSMAN_INC</span>. For a
full list of key events, see the String name column in the <a href="../../Core Utilities Kit/Variables/Event IDs.htm">Event IDs</a> document.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Script</td>

      <td align="undefined" valign="undefined">If
used, overrides KeyEvent. A <a href="#Expression_Evaluation">script</a>
that evaluates to a single key event.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">MouseWheelFlip</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if flipping the mouse wheel will trigger the event.
</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">ClickRepeat</td>

      <td align="undefined" valign="undefined">Set
to <span style="font-weight: bold;">True</span> if
holding the mouse button down will repeat the key event.</td>

    </tr>

  </tbody>
</table>

<br>

<p>MouseClick objects can be the parent of <a href="#Comment_Objects">Comment</a> objects.</p>

<hr style="width: 100%; height: 2px;">
<h3><a class="mozTocH3" name="mozTocId45130"></a><a name="Update_Objects"></a>Update Objects</h3>

<br>

Update objects are used to provide time based updates to a gauge. The <span style="font-style: italic;">Flight</span> <span style="font-style: italic;">Simulator</span> GPS
system is an example of a complex instrument requiring the use of
Update objects.<br>

<br>

<table style="text-align: left; width: 640px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>

    <tr>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Property</span></td>

      <td align="undefined" valign="undefined"><span style="font-weight: bold;">Description</span></td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">id</td>

      <td align="undefined" valign="undefined">A
string that can be edited to help identify the object.</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Frequency<br>

      </td>

      <td align="undefined" valign="undefined">Integer
value indicating how often the update should be run, in updates per
second. Enter 1 for the slowest frequeny of updates (one per second).</td>

    </tr>

    <tr>

      <td align="undefined" valign="undefined">Script</td>

      <td align="undefined" valign="undefined">The
expression <a href="#Expression_Evaluation">script</a>
to be evaluated at the time of the update. This
script might examine the status of various switches, for example, that
change how the instrument works.</td>

    </tr>

  </tbody>
</table>

<p><br>

Update objects can be the parent of Update objects and <a href="#Comment_Objects">Comment</a> objects.<br>

</p>

<br>

<p><br>

</p>

<div style="text-align: center;">
  <p>&nbsp;</p>
  <p>&copy; 2006 Microsoft Corporation. All rights reserved. </p>
  <p align="center">~~@~~ </p>
</div>

</body>
</html>
