runtimeAPIHelper
field in the AbstractFunctionalUA implements.runtimeAPIHelper
instance rather then api
(the api
is called by the runtimeAPIHelper
internally). runtimeAPIHelper.setA661WidgetParameter("MyWidgetName", "A661_VISIBLE", true); runtimeAPIHelper.sendAllA661BufferContent();
<a661_df name="Default" library_version="0" supp_version="6"> <model> <prop name="ApplicationId" value="1" /> </model> <a661_layer name="TheLayer1" > <model> <prop name="LayerId" value="1" /> <prop name="ContextNumber" value="0" /> <prop name="Height" value="3000" /> <prop name="Width" value="8000" /> </model> <a661_widget name="label" type="A661_LABEL"> <model> <prop name="WidgetIdent" value="2" /> ... </model> </a661_widget> </a661_layer> <a661_layer name="TheLayer2" > <model> <prop name="LayerId" value="2" /> <prop name="ContextNumber" value="0" /> <prop name="Height" value="3000" /> <prop name="Width" value="8000" /> </model> <a661_widget name="label" type="A661_LABEL"> <model> <prop name="WidgetIdent" value="2" /> ... </model> </a661_widget> </a661_layer> </a661_df>In the following example, we have two declared Layers, and the second will be used as the default Layer:
<uas> <ua url="MyUA.jar" path="my.uaappli.UA1" defaultSubscribeService="published"> <layers> <layer appliID="1" layerID="1" /> </layers> <subscribe service="published" > <entryPoint method="subscribe" /> </subscribe> </ua> <ua url="MyUA.jar" path="my.uaappli.UA2" defaultSubscribeService="published"> <layers> <layer appliID="1" layerID="2" defaultLayer="true" /> </layers> <subscribe service="published" > <entryPoint method="subscribe" /> </subscribe> </ua> </uas>In that case the Functional UA runtime API will only be configured for:
<uas> <ua url="MyUA.jar" path="my.uaappli.UA1" defaultSubscribeService="published"> <layers> <layer appliID="1" layerID="1" /> </layers> <subscribe service="published" > <entryPoint method="subscribe" /> </subscribe> </ua> </uas>In the next example, the first Layer is explictly declared as the default Layer:
<uas> <ua url="MyUA.jar" path="my.uaappli.UA1" defaultSubscribeService="published"> <layers> <layer appliID="1" layerID="1" defaultLayer="true"/> <layer appliID="1" layerID="2" /> </layers> <subscribe service="published" > <entryPoint method="subscribe" /> </subscribe> </ua> </uas>In the last example, no default Layer is declared, so the last one will be used as the default:
<uas> <ua url="MyUA.jar" path="my.uaappli.UA1" defaultSubscribeService="published"> <layers> <layer appliID="1" layerID="1" /> <layer appliID="1" layerID="2" /> </layers> <subscribe service="published" > <entryPoint method="subscribe" /> </subscribe> </ua> </uas>
runtimeAPIHelper
instance, then the runtimeAPIHelper
calls the underlying api
to effectively perform the sets parameter valueruntimeAPIHelper
to send the content of the Bufferapi
runtimeAPIHelper.setA661WidgetParameter("MyWidgetName", "A661_VISIBLE", true); runtimeAPIHelper.sendAllA661BufferContent();
runtimeAPIHelper.setA661WidgetParameter("MyLabel", "A661_VISIBLE", true); runtimeAPIHelper.setA661WidgetParameterFromName("MyLabel", "PosX", 5000); runtimeAPIHelper.setA661WidgetParameterFromName("MyLabel", "LabelString", "CANNIBAL CORPSE"); runtimeAPIHelper.setA661WidgetParameter("MyLabel", "A661_STYLE_SET", 12); runtimeAPIHelper.sendAllA661BufferContent();For any declared Layer, you can use either:
runtimeAPIHelper.setA661WidgetParameter("TheLayer1", "MyLabel", "A661_VISIBLE", true); runtimeAPIHelper.setA661WidgetParameterFromName("TheLayer1", "MyLabel", "PosX", 5000); runtimeAPIHelper.setA661WidgetParameterFromName("TheLayer1", "MyLabel", "LabelString", "CANNIBAL CORPSE"); runtimeAPIHelper.setA661WidgetParameter("TheLayer1", "MyLabel", "A661_STYLE_SET", 12); runtimeAPIHelper.sendAllA661BufferContent();With the application ID:
runtimeAPIHelper.setA661WidgetParameter(10, "TheLayer1", "MyLabel", "A661_VISIBLE", true); runtimeAPIHelper.setA661WidgetParameterFromName(10, "TheLayer1", "MyLabel", "PosX", 5000); runtimeAPIHelper.setA661WidgetParameterFromName(10, "TheLayer1", "MyLabel", "LabelString", "CANNIBAL CORPSE"); runtimeAPIHelper.setA661WidgetParameter(10, "TheLayer1", "MyLabel", "A661_STYLE_SET", 12); runtimeAPIHelper.sendAllA661BufferContent();
runtimeAPIHelper.setA661WidgetParameterFromName("TheLayer1", "MyLabel", "ColorIndex", "Red"); runtimeAPIHelper.setA661WidgetParameterFromName("TheLayer1", "MyPicture", "PictureReference", "Ball"); runtimeAPIHelper.sendAllA661BufferContent();The API also allows to use Strings for enumerative values. For example:
runtimeAPIHelper.setA661WidgetParameterFromName("TheLayer1", "MyLabel", "Alignment", "A661_CENTER"); runtimeAPIHelper.sendAllA661BufferContent();The API also allows to use the names of widgets instead of widget IDs. For example:
runtimeAPIHelper.setA661WidgetParameterFromName("TheLayer1", "MyMutually", "VisibleChild", "TheWidget"); runtimeAPIHelper.sendAllA661BufferContent();
runtimeAPIHelper.addA661WidgetEventListener("MyPushButton", new ARINCEventListener() { public void eventReceived(ARINCEvent evt) { WidgetEvent widgetEvt = (WidgetEvent) evt; System.out.println("Button Pressed"); } });Example when listening for a A661_EVT_SELECTION event on a PushButton on a declared Layer:
runtimeAPIHelper.addA661WidgetEventListener("TheLayer1", "MyPushButton", new ARINCEventListener() { public void eventReceived(ARINCEvent evt) { WidgetEvent widgetEvt = (WidgetEvent) evt; System.out.println("Button Pressed"); } });To check the event ID, check the associated event ID. For example, to check if the cursor enters or exits the area of an A661_CURSOR_OVER widget:
runtimeAPIHelper.addA661WidgetEventListener("MyCursorOver", new ARINCEventListener() { public void eventReceived(ARINCEvent evt) { WidgetEvent widgetEvt = (WidgetEvent) evt; if (widgetEvt.getEventID() == ARINC661.A661_EVT_CURSOR_ENTER) { System.out.println("Cursor Enter"); } else if (widgetEvt.getEventID() == ARINC661.A661_EVT_CURSOR_EXIT) { System.out.println("Cursor Exit"); } }); });If the event has associated values, you can retrieve these values with the
getFirstValue()
or getValues()
methods on the WidgetEvent
class. For example, to get the PosX and PosY coordinates of the cursor relative to the A661_CURSOR_OVER widget:runtimeAPIHelper.addA661WidgetEventListener("MyCursorOver", new ARINCEventListener() { public void eventReceived(ARINCEvent evt) { WidgetEvent widgetEvt = (WidgetEvent) evt; if (widgetEvt.getEventID() == ARINC661.A661_EVT_CURSOR_ENTER) { long posX = (long)widgetEvt.getValues.get(0); long posY = (long)widgetEvt.getValues.get(1); System.out.println("Cursor Enter at " + posY + " and " + posY); } });
MapItemListRep rep = runtimeAPIHelper.addMapItemListRep("MyMapItemList"); or: MapItemListRep rep2 = runtimeAPIHelper.addMapItemListRep("TheLayer1", "MyMapItemList2");
ItemMap mapItem = rep.addItem(1, "A661_SYMBOL_GENERIC"); mapItem.addProperty("X", 0.1); mapItem.addProperty("Y", 0.1); mapItem.addProperty("SymbolType", 1);
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence