Py System Editor and API

Top  Previous  Next

The Python-System Editor is GUI designed to define python-systems.

 

PySystemEditorWindow_WithGainPY

 

The Python-System Editor contains:

Three checkboxes to define the behavior of python-system

oInput Driven

oOutput-Driven (the default)

oEvent-Driven        

 

The Table to define Input Aruments.

o'Parameter' input arguments are mapped to TimeLike System Parameters. Input Arguments of 'Parameter' type are used for Input Arguments that will not vary in time.

o'Input' input arguments are mapped into TimeLike Inputs. Input Arguments of 'Input' type are used for Input Arguments that will vary in time.

o'State' input arguments are not mapped into TimeLike objects and serve the purpose of retaining some information between multiple calls to the same python-function. This is typically used by systems like ODE solvers.

 

 

The Table to define Output Arguments.

o'Output' output arguments are mapped into TimeLike Outputs.

o'State' output arguments are not mapped into TimeLike objects and serve the purpose of retaining some information between multiple calls to the same python-function. This is typically used by systems like ODE solvers.

o'null' output arguments are to support pure-python objects that do not have standard mapping to TimeLike. Typically used if python-function returns a Python Object that is not understood by TimeLike.

 

The Text Area to enter the code for m-function.

The first four lines of the Text Editor section are locked and cannot be changed directly by editing text. They are automatically generated based on what user selects and enters in the areas of the GUI above the Text Editor. This is done to make sure that the user doesn't inadvertently change the interface of a system.  These four lines are parsed by the TimeLike framework to display python-systems properly in the GUI and to execute them during the run-time.

NOTE: when editing code for python system, be careful to maintain proper indentation (Python requirement).