Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

ARINC 661 client API for MapItems



Overview

There are several ways to manage a list of MapItems in the ARINC 661 client API:
  • By setting a list of MapItems in a ClientMapItemList, and synchronize the content of this list with the associated BufferOfItems
  • By directly setting the MapItems in the BufferOfItems
  • Also you can use the helper methods hich simplify the sending of BufferOfMapItems
In the two cases, a BufferOfItems and BufferOfItemsInfo must be created for each ClientMapItemList:
      BufferOfItems<Integer, AbstractItem> buffer = new BufferOfItems<>();
      BufferOfItemsInfo info =
      new BufferOfItemsInfo("<a name for the BufferOfItems>", <the Appli ID>, <the Layer ID>, <the MapItemList ID>, buffer);

Setting the list in the ClientMapItemList


This is the preferred way to set the cotnent of a MapItemList, by setting the properties for each MapItem.

      // getting the ClientMapItemList
      MapItemListConstructor constructor = MapItemListConstructor.getInstance();
      ClientMapItemList mapItemList = constructor.getMapItemList(api, <the Appli ID>, <the Layer ID>, <the MapItemList ID>);

      // creating the MapItems (here for each mapItem)
      ClientMapItem mapItem = constructor.createMapItem(<map type>, <MapItem ARINC ID>);
      mapItem.addProperty(<MapItem property name>, 0.1);
      ...
      constructor.addMapItem(mapItemList, <MapItem index>, mapItem);

      // resolving the content of the ClientMapItemList with the associated BufferOfItems
      constructor.resolve(mapItemList, buffer);

      // set the BufferOfItems parameter for the MapItem widget
      api.setWidgetParameter(<the Appli ID>, <the Layer ID>, <the MapItemList ID>, ARINC661.A661_BUFFER_OF_MAPITEM, buffer);

      // send the message (can be done after other parameters have been set)
      api.sendAll();

Directly setting the list of BufferOfItems

      // getting the ClientMapItemList
      MapItemListConstructor constructor = MapItemListConstructor.getInstance();

      // creating the MapItems (here for each mapItem)
      ItemMap mapItem = constructor.addMapItem(buffer, <MapItem index>, <map type>, <MapItem ARINC ID>);
      mapItem.addProperty(<MapItem property name>, 0.1);
      ...
      // set the BufferOfItems parameter for the MapItem widget
      api.setWidgetParameter(<the Appli ID>, <the Layer ID>, <the MapItemList ID>, ARINC661.A661_BUFFER_OF_MAPITEM, buffer);

      // send the message (can be done after other parameters have been set)
      api.sendAll();

Example for a HorizontalMap

Here we add a "A661_SYMBOL_GENERIC" MapItem with the index 1 in the buffer, and we set the "SymbolType", "X" and "Y" properties for this MapItem:
      ItemMap mapItem = constructor.addMapItem(buffer, 1, XMLMapItem.TYPE_HORIZ, "A661_SYMBOL_GENERIC");
      mapItem.addProperty("X", 0.1);
      mapItem.addProperty("Y", 0.1);
      mapItem.addProperty("SymbolType", 1);

Using the helper methods

The A661RuntimeAPI has helper methods which simplify the sending of BufferOfMapItems to the CDS.

Creation of a representation for a MapItemList

Main Article: mapItemList widget

The MapItemListRep is a representation of a MapItemList widget which can be used to send Buffer of MapItems to the CDS.

To create a MapItemListRep helper, you can use one of the following methods:
You must specify a MapItemList widget (by its widget name) to create the helper.


For example:
      MapItemListRep rep = runtimeAPIHelper.addMapItemListRep("MyMapItemList");
      or:
      MapItemListRep rep2 = runtimeAPIHelper.addMapItemListRep("TheLayer1", "MyMapItemList2");

You only need to do this once. After this creation, you will be able to reuse this same MapItemListRep whenever you want to send a Buffer of MapItems.

Adding a MapItem


The MapItemListRep.addItem(int, String) allows to add a MapItem for the MapItemList managed by the MapItemListRep helper.

It therefore possible to set properties for this MapItem. For example:
      ItemMap mapItem = rep.addItem(1, "A661_SYMBOL_GENERIC");
      mapItem.addProperty("X", 0.1);
      mapItem.addProperty("Y", 0.1);
      mapItem.addProperty("SymbolType", 1);

Sending the Buffer to the API

The content of the Buffer is sent to the API by MapItemListRep.setBufferContent().

This methods will call internally the setWidgetParameter(<the Appli ID>, <the Layer ID>, <the MapItemList ID>, ARINC661.A661_BUFFER_OF_MAPITEM, buffer); on the associated MapItemList.

See also


Categories: builtin-applis | uaappli

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence