Skip to main content

G3000 panel.xml Basics

Introduction

The panel.xml file allows developers to configure their aircraft-specific G3000 installation. A basic understanding of the XML language is recommended when working with panel.xml.

File Structure

Below is an example of a simple panel.xml file:

<PlaneHTMLConfig>

<Instrument>
<Name>WTG3000_PFD_1</Name>
</Instrument>

<Instrument>
<Name>WTG3000_PFD_2</Name>
</Instrument>

<Instrument>
<Name>WTG3000_MFD</Name>
</Instrument>

<Instrument>
<Name>WTG3000_GTC_1</Name>
</Instrument>

<Instrument>
<Name>WTG3000_GTC_2</Name>
</Instrument>

</PlaneHTMLConfig>

The file contains the root tag <PlaneHTMLConfig> under which all other tags must be placed. There is one <Instrument> tag for each JS/HTML instrument in the plane. The <Name> tag identifies the specific instrument referenced by its parent <Instrument> tag. In this example, there are five declared instruments: two PFDs, one MFD, and two GTCs.

info

G3000 instrument names are standardized to the following formats:

  • PFD: WTG3000_PFD_[index], where index is either 1 or 2.
  • MFD: WTG3000_MFD
  • GTC: WTG3000_GTC_[index], where index is 1, 2, etc.

Tag Scope

Each tag parsed by the G3000 has a required scope, defined as the parent under which it must be placed. If a tag is placed in an incorrect scope, it may not be parsed at all or it may be interpreted as a different type of tag with the same name. Therefore, it is important to ensure that all tags are defined in the correct scope.

The tags documentation details the scope of each tag. When the scope is listed as "Global", this means the tag should be placed directly under the root <PlaneHTMLConfig> tag. When the scope is listed as "PFD", "MFD", or "GTC", this means the tag should be placed directly under a PFD, MFD, or GTC <Instrument> tag, respectively.

Global vs. Instrument-Specific Options

panel.xml options can either be global or specific to a particular instrument. Tags that are descendants of an <Instrument> tag define options specific to the instrument referenced by their parent <Instrument> tag. Tags that are not descendants of any <Instrument> tag define global options.

Certain instrument-specific tags can be defined globally by placing them them in the global scope (directly under the root <PlaneHTMLConfig> tag) instead of under an <Instrument> tag. When doing so, the option will apply to all instruments that support the option. If an instrument-specific tag is defined both globally and within a <Instrument> tag, then the version defined within the <Instrument> tag will override the global one.

caution

Not all instrument-specific tags can be defined globally. Please refer to the tags documentation to find which ones can be defined globally and which ones cannot.

Required vs. Optional Tags

Tags and attributes can either be required or optional. Required tags/attributes must be explicitly defined for panel.xml to be successfully parsed. If a required tag/attribute is missing, the G3000 will throw a Javascript error during initialization with a message describing what was missing. Optional tags/attributes do not have to be explicitly defined, and omitting these will have no adverse effects. When an optional tag/attribute is omitted, the option it defines will revert to a default value.

The tags documentation details which tags and attributes are required and which are optional, as well as the default values for optional tags/attributes.

caution

If the G3000 detects that an optional attribute or tag was not formatted correctly (e.g. a mis-spelled option, an out-of-bounds numeral, etc), it will emit a console warning and revert the option to its default value. Therefore, during development it is recommended that you monitor the console output of all instruments to ensure that panel.xml is being parsed cleanly.

Option Inheritance

Certain complex instrument-specific option tags support a basic form of inheritance. This allows you to define similar, but not identical, options in multiple instruments without needing to duplicate the entire tag subtree for each instrument. Here is an example:

<PfdLayout id="base-pfd-layout" use-banners="true" softkeys="true" />

<Instrument>
<Name>WTG3000_PFD_1</Name>

<PfdLayout inherit="base-pfd-layout" instrument-side="right" />
</Instrument>

<Instrument>
<Name>WTG3000_PFD_2</Name>

<PfdLayout inherit="base-pfd-layout" instrument-side="left" />
</Instrument>

Here, the two <PfdLayout> tags defined for the WTG3000_PFD_1 and WTG3000_PFD_2 instruments both inherit from the globally defined <PfdLayout> tag. Inheritance is enabled for these tags by the presence of the inherit attribute, which defines the ID of the tag from which they inherit (in this case: base-pfd-layout).

When inheriting, a tag copies all descendants and attributes that it does not explicitly define itself from the source tag. In the example, the two instrument-specific <PfdLayout> tags inherit the use-banners and softkeys attributes from #base-pfd-layout. The instrument-specific <PfdLayout> tags also define their own (different) values for the instrument-side attribute. If #base-pfd-layout had defined its own instrument-side attribute, it would not be inherited by the instrument-specific tags.

Redundant Tags

When you define multiple copies of a tag that is meant to be a singleton, only the first instance of the tag (in tree order) will apply. Take the following example:

<Instrument>
<Name>WTG3000_PFD_1</Name>

<Altimeter>
<Scale
min="-9999"
max="99999"
window="1000"
major-tick-interval="100"
minor-tick-factor="5"
/>
</Altimeter>

<Altimeter>
<Scale
min="-9999"
max="99999"
window="1000"
major-tick-interval="500"
minor-tick-factor="5"
/>
</Altimeter>
</Instrument>

Of the two <Altimeter> tags defined for WTG3000_PFD_1, only the top one will apply. As a result, the PFD will have an altimeter with major ticks at 100 feet intervals instead of 500 feet intervals.

Numeric Tags and Operators

Certain G3000-specific tags define numeric values. One such tag is the generic <Number>, which is a numeric tag that returns a constant value equal to its content (for example, <Number>0</Number> returns a value of zero). Other numeric tags may return values with more complicated logic.

Numeric tags can be used together with numeric operator tags to generate computed numeric values. Each numeric operator tag accepts one or more numeric tags as children (the operands) and outputs the result of the operation as a new numeric value. Numeric operators also are considered numeric tags, so they can be used as operands of other numeric operator tags.

The available numeric operator tags are:

OperatorOperand CountDescription
<Min>One or MoreReturns the minimum value among all operands.
<Max>One or MoreReturns the maximum value among all operands.

The following are examples of numeric operator usage:

<!-- Always returns 0 -->
<Min>
<Number>0</Number>
<Number>5</Number>
<Number>10</Number>
</Min>

<!-- Always returns 100 -->
<Max>
<Number>10</Number>
<Min>
<Number>100</Number>
<Number>1000</Number>
</Min>
</Max>