pythonModule.py
script sends a "STARTED" message to the Python moduleinit
method is called. See Python module initialization for more informationinit
method is called[2]
init(self, pythonUtils)
method is specified for the Python scriptpythonModule.py
script sends a "INIT" message to the Python moduleinit
method is called. This method is called only if the init(self, pythonUtils)
method is specified for the Python script.pythonUtils
script: def hasProperty(self, name)
returns true if there is a property will the specified name def getProperty(self, name)
returns the property value will the specified name<pythonModule name="module1"> <pythonImplementation path="pythonAppli"> <initEntryPoint method="init" /> </pythonImplementation> <interfaces> <subscribe service="service1" /> <push service="service2" attach="attach"/> </interfaces> <properties> <property key="propBool" type="boolean" /> <property key="propString" type="string" /> <property key="propInt" type="int" /> </properties> </pythonModule>We can retrieve the properties values with the following code:
def init(self, pythonUtils): theIntProperty = pythonUtils.getProperty("propInt") theIntProperty = pythonUtils.getProperty("propString") theBoolProperty = pythonUtils.getProperty("propBool")
start
method is called[5]
start(self, pythonUtils)
method is specified for the Python scriptpythonUtils.py
scriptdef __init__(self)(
method, and make sure that the waitAtStart value if sufficientdef init(self, pythonUtils)(
method, and make sure that the waitAtInit value if sufficientinit(self, pythonUtils)
method is specified for the Python scriptstart(self, pythonUtils)
method is specified for the Python scriptCopyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence