receive(ServiceInstance service)
method will be called each time the module is notified from the position
service:<applications> <application name="application"> <modules> <pythonModule name="FMS"> <pythonImplementation path="pythonAppli"> <initEntryPoint method="init" /> <defaultReceiveEntryPoint method="receive" /> <pythonImplementation> <interfaces> <subscribe service="position" /> </interfaces> </pythonModule> </modules> </application> </applications>Also, if a publish Service is called cyclically by the framework, the service entry point will be called each time the service is automatically invoked by the framework.
<applications> <application name="application"> <modules> <pythonModule name="Aircraft"> <pythonImplementation path="pythonAppli"> <initEntryPoint method="init" /> <defaultReceiveEntryPoint method="receive" /> <pythonImplementation> <interfaces> <cyclic service="position" frequency="200ms "/> </interfaces> </pythonModule> </modules> </application> </applications>
def subscribe(self, pythonUtils, serviceName) { if serviceName == "myService": ... }
service = pythonUtils.getService(serviceName)
Getting the value of a Data for a Service is performed with:
dataValue = service[<data_name>]
# getting the service of a specified name publishService = pythonUtils.getService("<service_name>") # set the value for a data pythonUtils.setValue(publishService, "<data_name>", value) # invoke the service pythonUtils.send("<service_name>")
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence