pythonModule.py
script is responsible for the Services subscription in the Python environmentpythonUtils.py
script is an utility script usable by the user Python scriptpythonModule.py
scriptpythonUtils.py
scriptpythonHttpModule.py
script is responsible for the Services subscription in the Python environmentpythonHttpUtils.py
script is an utility script usable by the user Python scripthttp.client
and json
modules, so this Python implementation require Python 3.
pythonHttpModule.py
scriptpythonHttpUtils.py
scriptdebugScripts
property is turned on, the framework will additionnally show a Popup window allowing to navigate in the source for the Stack trace for the first encountered exception. For example:FlightManagementSystem
module:position
publish servicedirectTo
event servicecomputeFlightPlan
request-response service<pythonModule name="FlightManagementSystem" > <pythonImplementation path="pythonAppli"/> <interfaces> <subscribe service="position" /> <eventReceived service="directTo"/> <requestReceived service="computeFlightPlan"/> </interfaces> </pythonModule>Another way to specify the Python module is to explictly specify the ports and port sizes for the Java / Python communication:
<pythonModule name="FlightManagementSystem" > <pythonImplementation path="pythonAppli" inputPort="6000" outputPort="6005" inputSize="1024" outputSize="1024"/> <interfaces> <subscribe service="position" /> <eventReceived service="directTo"/> <requestReceived service="computeFlightPlan"/> </interfaces> </pythonModule>
from pythonUtils import PythonUtils class PythonAppli: def subscribe(self, pythonUtils, serviceName): service = pythonUtils.getService(serviceName) if serviceName == "position": // get position ... elif serviceName == "directTo": // compute directTo ... elif serviceName == "computeFlightPlan": // compute FlightPlan and sends the response ...
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence