Interfacing with ProSim737

From Manuals
Jump to: navigation, search
Main Page > ProSim737 Manual > Interfacing with ProSim737

1 Interfacing with ProSim737

The ProSim737 main program has an internal web server that can be used to control some parts of the system. This can be used to develop add-ons or custom software.

The standard way to interface with ProSim737 is to call the XML gateway URL on the web server. This URL has the format: http://<host>:<port>/xml?query=<action>[&parameter=value]

As a reply to this call, an XML document in sent back in the following format:

<root>
<query>[A copy of the query]</query>
<success>[true or false depending on the outcome]</success>
<answer>
The content of the answer
</answer>
</root>

At the moment, the following queries are available:

fms Retrieve FMS data
aircraft Retrieve basic aircraft data
failures Retrieve a list of supported failures
armedFailures Interact with the failure system
load sheet Retrieve data to generate a load sheet

1.1 Query FMS

Supported parameters: None Retrieves the content of the route in the FMS. Specifications are not finalised.

1.2 Query Aircraft

Supported parameters: None Retrieves a list of basic parameters of the aircraft. Specifications are not finalised.

1.3 Query failures

Supported parameters: None

Retrieves all supported failures in the system. This list is a fixed list of what the instance of ProSim737 supports and need only be retrieved once. The answer contains a sequence of <failure> elements in this format: <failures>
<failure id="f1">
<name>TransBus1</name>
<domain>Busses</domain>
<help>The TransBus1 bus has failed</help>
</failure>

</failures>
The ID attribute is used to communicate with the system about this failure through the “armedFailures” query.

The name attribute can be used to display to the user. The domain attribute provides the means to classify failures. The help attribute is a short string that contains additional information about the failure.

1.4 Query armed failures

Supported parameters: failures, remove, ias, alt, altb, min

The armedFailures query is used to interact with the failure system. Armed failures are groups of failures that are either triggered immediately, or are triggered based on certain conditions. Each armed failures entry has an ID that can be used to remove it.

This query will always reply with the current list of armed failures. This list is a sequence of <armedFailure> elements in the following format:

<armedFailure id="0">
<failures>f106</failures>
<triggered>true</triggered>
<condition>
<ias>120</ias>
<altAbove>1000</altAbove>
<altBelow>2000</altBelow>

<condition>
</armedFailure>

The <failures> element contains a comma separated list of failure ID’s that this entry will trigger. The <triggered> element is true when the failures were triggered and false when the armedFailure is still waiting for a condition to become true. The <condition> element will typically be empty, or contain a single condition, but all possible conditions are shown for reference.

To set a new armed failure, the “failures” parameter must be present and should contain a list of failure ID’s, separated by commas. Optionally, the ias, alt, altb, or min parameters may be provided to make the armed failure a condition based failure. When no condition is provided, the failure will be triggered immediately.

  • ias is the speed in KTS above which the failures should trigger
  • alt is the altitude above which the failures should trigger
  • altb is the altitude below which the failures should trigger
  • min is the amount of minutes that should pass before the failure should trigger

To remove a failure, the parameter “remove=<id>” should be used. When an armedFailure is removed, the systems involved will be repaired.

Some example URL’s:

1.5 Query ground power

Supported parameters: active

This query is used to read or set the state of the ground power. The query always returns the current state of the ground power in the following format: <groundPower active="true|false"/> To set the ground power, the 'active' parameter can be used. The value of this parameter should be 'true' or 'false'. Note that ground power will only be provided under the condition that the aircraft is not moving and on the ground.

1.6 Query load sheet

Supported parameters: none

This query is used to retrieve information from the FMS which can be used to create a load sheet. An active PERF INIT page and an active route must be present in the FMS for the query to succeed. A block of XML is returned with all information necessary to build a load sheet.

One way to build a load sheet is to run the XML through an XSLT, which outputs the load sheet. An example XSLT “loadsheet.xslt” is provided in the web folder of ProSim737.

The instructor station url http://localhost:8080/loadsheet uses this XSLT to build a load sheet from this XML query. It uses this XML query and adds an XML processing instruction for the browser to use the XSLT for rendering the XML.

This is an example URL:

1.7 Query acars

Supported parameters: message, content, type

This query is used to uplink or downlink an ACARS message. In both uplink or downlink mode, the 'message' parameter is required and should be the ID of the message, as defined in the currently active ACARS profile.

1.7.1 ACARS uplink

In this mode, a message can be uplinked from the ground to the aircraft. In this mode, the 'content' parameter is required and contains the actual content of the uplinked message.

1.7.2 ACARS downlink

In this mode, the aircraft is told to downlink a message to the ground station. To activate the downlink mode, specify the attribute 'type=downlink'. This mode can be used to trigger the aircraft to send automated status messages. Since the message content is constructed from the definition in the active ACARS profile, no 'content' parameter is needed.

Examples: