With ProSim release 1.29, it is now possible to extend CDU pages to retrieve data from the Internet.
I'll show an example on How to create a CDU page that retrieves METAR information from NOAA.
Before start, we need to understand that we cannot retrieve formated or html data. The returned page must PLAIN TEXT.
This can be used-> http:\\weather.noaa.gov/pub/data/observations/metar/stations/EHAM.TXT
This CANNOT be used-> http://aviationweather.gov/adds/metars/ ... n_ids=eham" onclick="window.open(this.href);return false;
In version 1.29 a new type "http" of message was added.
This new type allows data retrieval from a web page in plain text.ProSim737/ACARS/readme.txt wrote: A <message> element defines an ACARS message. Attributes:
- id : The ID of the message used to refer to it.
- code : The ACARS code that is used in the ACARS message to identify this message.
- description : The description of this message, used in ACARS programs.
- title : The link displayed in the CDU on LSK6R when an uplink is received.
- type : Optional, default is "acars". Can be "acars" for regular ACARS server processing or "http" for a http request.
To use the new property, we must add a new message like this:
Code: Select all
<message id="Metar" type="http" response="MetResponse">
<url>http://weather.noaa.gov/pub/data/observations/metar/stations/${ICAO}.TXT</url>
</message>
To customize your CDU you first need to create a new ACARS file. Do not change any of the files included with ProSim. Every time you update ProSim, they are overwritten.
Instead, create your own ACARS file like this:
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<acars name="myCustom" id="myCustom">
<include id="default"/>
<include id="menu"/>
<include id="weather"/>
</acars>
This will include all required files.
<include id="default"/>is the default ACARS file from ProSim
<include id="menu"/>is an extention to the default ACARS main page. We cannot append items to already existing CDU pages, so this file will extend the main ACARS menu adding a second page with our customizations.
<include id="weather"/> is our custom pages.
This is how the file menu.xml looks like:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<acars id="menu">
<page title="DLNK -APPLICATION MENU" id="menu">
<subpage>
<lsk2l link="cpdlc">CPDLC</lsk2l>
<lsk3l link="message">MESSAGING</lsk3l>
<lsk2r link="aocstd">AOC STD</lsk2r>
<lsk3r link="ats">ATS</lsk3r>
<lsk4r link="technical">TECHNICAL</lsk4r>
</subpage>
<subpage>
<lsk1r link="weather">WEATHER</lsk1r>
</subpage>
</page>
</acars>
The second subpage group adds the second page with our items.
And finally our weather.xml looks like this:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<acars id="weather">
<page title="WEATHER" id="weather">
<lsk1l send="Metar">REQ METAR</lsk1l>
<lsk3l input="ICAO" size="4">ICAO</lsk3l>
<lsk6l link="menu">EXIT</lsk6l>
</page>
<page title="WEATHER" id="_genericUplink" uplink="MetResponse">
<lsk1l output="_rawMessage" lines="2"/>
<lsk2l output="_rawMessage" lines="2"/>
<lsk3l output="_rawMessage" lines="2"/>
<lsk4l output="_rawMessage" lines="2"/>
<lsk5l output="_rawMessage" lines="2"/>
<lsk6l link="menu">RETURN</lsk6l>
<lsk6r action="print">PRINT</lsk6r>
</page>
<!--MESSAGE SECTION-->
<message id="MetResponse" title="weather">
</message>
<message id="Metar" type="http" response="MetResponse">
<url>http://weather.noaa.gov/pub/data/observations/metar/stations/${ICAO}.TXT</url>
</message>
</acars>
One is our custom page and the other is a customized uplink page where results will be shown.
Here is the result:

Select DLNK

A second page is available. press PAGE DOWN

Select WEATHER.

Our custom page is shown.

Enter AD ICAO. And select REQ. METAR.

New message available. Select new option WEATHER in LSK6R

METAR is shown in the CDU
Don't forget to select your new acars file in ProSim confirguration.
Attached are all three files for this example. Just unzip all files to your ACARS folder and select myCustom from ProSim config.
Enjoy