Skip to content

Comments

Add Python Plant Model#96

Open
charonplutospace wants to merge 4 commits intoeeTools:masterfrom
charonplutospace:add-plant-model
Open

Add Python Plant Model#96
charonplutospace wants to merge 4 commits intoeeTools:masterfrom
charonplutospace:add-plant-model

Conversation

@charonplutospace
Copy link
Contributor

Introduces a Python Plant Model: a flexible component for Python-defined plants (e.g. control theory, mechatronics, etc).

Features:

  • Configurable I/O sizes
  • Python process() method called each step
  • Error handling without freezing UI
  • Examples included

Placed in src/components/other/plant_model/

Tested: multi-instance, reloads, exceptions, NumPy returns.
Dependencies: Python 3 dev libs.

More examples (PID plant etc.) have been sent to the forum.

Dependencies

  • Python 3 development headers/libraries (for linking -lpython3.x)
  • Tested with Python 3.12

Testing done

  • Multiple instances (shared & separate scripts)
  • Reload file content → behavior updates immediately
  • Raise exceptions / wrong return types → error dialog appears without freezing UI
  • Add/remove pins → component resizes correctly, no ghost areas
  • NumPy arrays as return values work (via PySequence interface)

Please contact t me if you have any questions.

charonplutospace and others added 4 commits January 17, 2026 17:15
* GUI component part added
* GUI component part added
* Several components can be added and deleted
* Python script reader
* Works with on input and output
…ustom dynamic systems/plants.

- Dynamic input/output pins
- Loads .py file with Processor class (process(time, inputs) -> outputs)
- Safe GIL management + global Python init/finalize
- Non-blocking error dialogs from simulation thread
- Visual filename/class display on component
- Examples in examples.py (gain, stateful, error raising, NumPy)
- Registered under "Other" category
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant