PublishModule
had no graphical interface and:EventModule
is our User Application and:<properties> <application name="uaappli" > <module name="uaappli" > <moduleProperty key="uaConfig" value="uaTutorial.xml" /> <moduleProperty key="a661Config" value="a661/tutorial.properties" /> <moduleProperty key="includeServer" value="true" /> </module> </application> </properties>For our configuration:
uaImpl
and uaPath
properties:<ua url="UATutorial2.jar" path="org.da.protoframework.tutorial2.uaappli.UATutorial2">
<layer appliID="1" layerID="1" />
published
service:<subscribe service="published" >
<uas> <ua url="UATutorial2.jar" path="org.da.protoframework.tutorial2.uaappli.UATutorial2" defaultSubscribeService="published"> <layers> <layer appliID="1" layerID="1" /> </layers> <subscribe service="published" > <entryPoint method="subscribe" /> </subscribe> </ua> </uas>
runtimeAPIHelper
rather than the api
field.public class UATutorial2 extends AbstractFunctionalUA { private SendEventServiceInstance eventService = null; public UATutorial() { } public void init() { this.eventService = (SendEventServiceInstance) module.getService("event"); // listen to widgets events runtimeAPIHelper.addA661WidgetEventListener("toggleButton", new ARINCEventListener() { public void eventReceived(ARINCEvent evt) { WidgetEvent widgetEvt = (WidgetEvent) evt; try { boolean isSelected = ((Boolean) widgetEvt.getValues().get(0)); eventService.setDataBooleanValue("event", isSelected); eventService.invoke(); } catch (ARINCRuntimeException ex) { logger.error(module, ex.getMessage()); } } }); } public void subscribe(ServiceInstance service) { if (hasChanged("value")) { String value = getStringValue("value"); runtimeAPIHelper.setA661WidgetParameterFromName("label", "LabelString", value); runtimeAPIHelper.sendAllA661BufferContent(); } }
<properties> <application name="uaappli" > <module name="uaappli" > <moduleProperty key="uaImpl" value="UATutorial.jar" /> <moduleProperty key="uaPath" value="org.da.protoframework.tutorial.uaappli.UATutorial" /> <moduleProperty key="a661Config" value="a661/tutorial.properties" /> <moduleProperty key="includeServer" value="true" /> </module> </application> </properties>
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence