-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve SpiceLibComp device #679
Comments
@ra3xdh I've made a small patch enabling Qucs-S to save only a subcircuit symbol of a schematic to a file and to load back symbols from such files. Patch reuses Workflow to create a symbol:
After that one can load this symbol back using usual "File->Open" dialog, where "Symbol only" type of file has to be selected. Unfortunately with this patch symbols from Please check out branch https://github.com/wawuwo/qucs_s/tree/feature-export-symbol in my repo if it sounds interesting, I think it's not worth of opening a PR yet. |
I forgot to mention that SpiceLibComp can use symbol files made this way, but you have to manually put them into |
Yes, this may help to resolve #147 I was thinking about the similar way. The main problem was how to add/remove ports for symbol without schematic. I will try to evaluate your patch in the next week.
It is not a big problem, because only 4 symbols are shipped with Qucs-S now. These four symbols could be easily recreated using new format. |
Maybe a solution is to show "port" tool in paintings alongside with arrow, line, ellipse, etc. when in symbol editing mode, so a user would be able to go straight to symbol editing, skipping the "add required number of ports" part. I'll look into it |
I have tested your patch. I have found this a good solution for #145 The following things should be fixed if possible:
I propose the following logic of adding symbol ports. It could be done using the Add port button on the toolbar
I am not sure if proposed workflow could be implemented. Alternative solution is also welcome. |
Normally the port number comes from subcircuit ports (Port device inserted from button on the toolbar) property like |
Oh god, it clicked, I finally see what port numbers you mean. Will look into it; I guess that's because |
I've added a commit with patch to display port numbers, but unfortunately has huge disadvantage. Symbol files store ports like this:
where numbers are: x coordinate, y coordinate, auto assigned index number, rotation angle. So for *.sym files the only port label we can obtain is its index number plus some static string, there is no more info in file. In contrast, ports in subcircuit symbols (i.e. usual schematics, not *.sym) derive their labels from names of corresponding ports on schematic, so their labels can be of any form. The only way to circumvent this I think is to change the format in which symbols are stored, to put "freeform" port numbers into files too. |
But to make "freeform" port numbers in symbol mode when there is no corresponding schematic ports it's required to allow somehow editing of port texts 🤔 |
It would be sufficient to show the automatically assigned port index number. No need to change the port format. |
@ra3xdh
"insert port" tool works in symbol edit mode for usual "subcircuit + subcircuit symbol" files too. But ports added this way are automatically removed when file is saved. In other words, if one adds ports in symbol edit mode and then saves the document as |
Yes, the recent improvements on this branch makes the new feature acceptable. I have found two minor issues:
This behavior is correct. The symbol ports and SCH ports must be synchronized. The manual ports edition should be allowed only for detached symbols (SYM). Furthermore the port add button may be disabled when SCH file enters symbol editing mode (F9). |
The merging #700 makes possible converting subcircuit symbols to symbol patterns |
The #755 contains SpiceLibComp redesign. |
SpiceLibComp device was intended for usage of the unmodified SPICE libraries with Qucs-S https://qucs-s-help.readthedocs.io/en/latest/SubLib.html#usage-of-unmodified-spice-libraries The current implementation has many issues that prevents its usage for circuit design. The following improvements must be done:
share/qucs-s/symbols
*.sym
files #147 Add symbol editor #700share/qucs-s/symbols
subdirectory using new format. See Add symbol editor #700nested subciruit
warning that appears with Ngspice and may cause simulation convergence issuesHelp is appreciated here.
The text was updated successfully, but these errors were encountered: