FMS module sending a flightplan service which contains an array of waypoints. Each waypoint is a structure with a latitude and longitude.WaypointsConverter module which will be notified from the waypoints service, will decode the array of waypoints, and send a waypointsObject service which will not contain an array of waypoints but a Waypoints Java object.flightplanObject service reception, and will only have to get the Waypoints object from the received data rather than having to make the decoding.
<publish name="context" > <data name="waypoint" type="waypointObj" /> </publish>And the associated type definition:
<types> <objectType name="waypointObj" class="org.da.Waypoint" /> </types>Then
waypoint will be an instance of the org.da.Waypoint class. For example, if you want to set the data value before the service invocation, you can just code:Waypoint wpt = new Waypoint(); wpt.setPosition(latitude, longitude); wpt.setName("TTO"); Data data = service.getData("waypoint"); data.setValue(wpt);And when notified, you can just perform:
public void receive(Service service) { Data data = service.getData("waypoint"); Waypoint wpt = (Waypoint)data.getValue(); }
objectType type will be instances of the Data.Obj class. This class has a Data.Obj.isInstanceChanged() method showing if the underlying instance has changed since the last notification (meaning that it is not the same instance)public class TheModule { Waypoint wpt = null; public void receive(Service service) { Data.Obj data = (Data.Obj)service.getData("waypoint"); if (data.isInstanceChanged()) { wpt = (Waypoint)data.getValue(); } } }
applications deployment libraries rather than reference it in each application deployment.
<publish name="context" > <data name="waypoint" type="waypointObj" /> </publish>And the associated type definition:
<types> <objectType name="waypointObj" class="org.da.Waypoint" /> </types>if the
waypoints.jar library contains the org.da.Waypoint definition, this applications configuration will not work:<applications> <application name="FMS"> <deployment> <lib url="FMS.jar" /> <lib url="waypoints.jar" /> </deployment> ... </application> <application name="WaypointsConverter"> <deployment> <lib url="WaypointsConverter.jar" /> <lib url="waypoints.jar" /> </deployment> ... </application> </applications>You will have the following exception when initializing the framework:
<applications> <deployment> <lib url="waypoints.jar" /> </deployment> <application name="FMS"> <deployment> <lib url="FMS.jar" /> </deployment> ... </application> <application name="WaypointsConverter"> <deployment> <lib url="WaypointsConverter.jar" /> </deployment> ... </application> </applications>
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence