Skip to content

System Command Component#1606

Merged
ra3xdh merged 8 commits intocurrentfrom
PostSimScript
Mar 23, 2026
Merged

System Command Component#1606
ra3xdh merged 8 commits intocurrentfrom
PostSimScript

Conversation

@andresmmera
Copy link
Copy Markdown
Collaborator

This pull request (PR) introduces a new component that executes system commands once the simulation has finished. This enables the user to run post-processing in their preferred language (or any other external commands). As far as I know, Qucs-S can only run Octave scripts after the simulation has finished.

I placed the new component under the Equations tab.

image

The properties of the component are:

  1. The code to execute on the shell
  2. Checkbox to open a terminal emulator window
  3. Checkbox to keep the emulator open
image

IMPORTANT I tested this on Linux (Tuxedo OS). I'll check how it works on Windows once the CI has created the corresponding binaries.

Example

In the example attached, a LPF with finite Q components (qucsator) is simulated and a system-command block is added to compare the results with a simulation in scitkit-rf (ideal components)

SystemCommandFeatureTest_prj.zip

image

Python output
image

A schematic block was created to run system commands once simulation is complete.
The initial idea was to let the user to run a python script for postprocessing, but any command can be run with this approach
@ra3xdh ra3xdh added this to the 26.1.0 milestone Mar 21, 2026
@andresmmera
Copy link
Copy Markdown
Collaborator Author

I've checked this works on Windows

@ra3xdh
Copy link
Copy Markdown
Owner

ra3xdh commented Mar 22, 2026

I have just tested a new component. Everything works as expected. This may serve as modern replacement for existing Octave integration. See also #1247 and #887.

I have found two minor issues:

  • The syntax highlighting for shell scripts could be added in script editor window.
  • The bounding box for new component is wrong:
image

As reported in the PR discussion, the dimensions of the selection box were wrong
@andresmmera
Copy link
Copy Markdown
Collaborator Author

Thanks for your review.
I'm currently working on the highlight feature. I have resolved the issue with the selection box.
I'll push the fix soon.

As suggested in the PR discussion, this commit adds shell highlighting in the command property editor.
…cessing

[System Backend] Add examples on how to use the external postprocessing

Python example (with virtual environment)
Octave example
@andresmmera
Copy link
Copy Markdown
Collaborator Author

Added shell highlighting in the editor and fixed the selection box size issue.

image

I also added an example on how to use the new block for Python and Octave postprocessing

@ra3xdh
Copy link
Copy Markdown
Owner

ra3xdh commented Mar 23, 2026

This is ready for merge now. Merging.

@ra3xdh ra3xdh merged commit 587267a into current Mar 23, 2026
8 checks passed
@andresmmera andresmmera deleted the PostSimScript branch March 23, 2026 18:57
@andresmmera
Copy link
Copy Markdown
Collaborator Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants