-
Notifications
You must be signed in to change notification settings - Fork 215
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
Fixed issue #591 #594
Fixed issue #591 #594
Conversation
it may be the same in the end, since I don't think it's safe to have user libraries with the same name as system libraries, but you could do as in
It will then be even clearer that relative library paths are for system libraries while the other libraries have absolute paths. Besides, the search is not yet working correctly: searching for "741" and selecting the |
@in3otd , I accepted your suggestion with |
There is something else going on. I did the following: If I try to select the Second issue. If one tries to use the search field. I may error out again, as it first tries to resolve symbols into the user lib path. I searched for BSS123, when selected one of them (from system NMOSFETs.lib) it went looking for it in user_lib. Somehow it should keep track of the full path of the libraries. The Qucs library dock does that and works just fine, even with system and user libs with the same name. |
yep, this I what I saw also and was hinting at above... Are you sure that the Qucs library dock works fine for user and system libs with the same name? Here if I select a component from these two libraries it points always to the user lib. |
BTW, a solution could be that every item in |
I used the same name for user libraries and system libraries only to demonstrate error messages introduced by recent addition in If it's hard to add the proper search implementation for system and user libraries with the same name, we can simply forbid to have the same system and user libraries. As alternative, we can introduce library priority. User library will override system library, and system library become invisible in the library manager. If search issues concerns only system and user libraries with the same name, we can also leave all as is. The same name of system and user libraries is rare artificial corner case. |
another library issue is that "base" components (i.e. not defined by a subcircuit) do not get a valid component model once placed in the schematic using the GUI; to see this
...I'm working on this (and other semi-related stuff)... |
Components using the library default symbol were assigned an incorrect model string, since the actual component model was not passed to the function creating the model string (only the default symbol was passed) The library default symbol is now used only if the component does not define a symbol; previously the library default symbol was used for all components of the library, ignoring any symbol definition a component may have had.
The symbol definition for standard components is now handled by SymbolWidget() and not by QucsLib(), so this latter does not need to know how to handle the standard components (which do not define a symbol). Handling of components which do not define a symbol but should use the library default symbol was moved to qucslib_common.h previously so also this case does not need to be explicitly handled by QucsLib anymore.
I have just pushed a couple of commits directly to the ra3xdh branch, seems to work 😁 I had also started to fix the local/system libraries path confusion but I feel it would take a good rewrite to do all properly. If you think that it would be better to have it fixed for the |
I also think it For the future, searching on startup for |
yep, all the component library stuff actually... e.g. note that some functions are reused in both
I started doing a similar thing but adding the path to the |
@in3otd , Your code works as expected. I have tested different combinations. I am surprised that Github allows mainline project members push to forks. I didn't know about this feature. I think we should move |
thanks for testing the code. Guitorri mentioned that pushing to team members' forks by other team members can be enabled when opening a PR, so I just tried to see if it worked on your PR. I understood this needs to be enabled explicitly, though, and is not active by default ? I agree that the |
Yes, I now understood how it works. |
The #580 (merged) is a cleanup from #556 (not merged). Reverting #580 fix this issue and reopen another one. @ra3xdh, yes the idea is to do a release ASAP. I also recently discovered these two things about PRs which are quite handy:
|
so that a separate list (LibraryComps) is not needed anymore and information about the component and its original library can be easily stored and retrieved. Also changed LibraryName variable name to LibraryPath to better reflect its usage.
so that the library header containing the actual name and the library default symbol can be read without having to parse and process also all the components in the library. Useful when only the library default symbol and/or the library name are needed.
system libraries: the path relative to the Qucs projects home directory is passed user libraries: the absolute path is passed
so that the libraries name and path can be easily stored and retrieved later to identify the library to which a component belongs.
so that local and system library are assigned the right path
@in3otd any news? No pressure, just checking otherwise I will give it a try. |
yep, about to push some commits but saw other issues, will explain later 😁 |
the latest commits fix the user vs system directory issues, now the components models are taken from the right libraries even when there are system and user libraries with the same name or file name. While testing I have noticed another issue:
this is because the name of the subcircuits are hardcoded in the libraries and simply copied in the netlist, so if the components use the same name for their subcircuits there are two conflicting definitions. I think that a solution could be to prepend |
Hum. If I try what you said, copy and paste the component:
System lib
Which seems right, I haven't tried running the simulation yet. I think the netlist cannot handle the same component name from 2 different libs... |
Yep. The name collision is another problem. The fix belongs either to the I am testing you code and it looks good so far. |
I think that problem should be handled by the netlister, as said above the subcircuits coming from the user lib could be defined as |
what do other programs do? what does python do about qucs (all parts of it) should behave in a similar non-surprising and efficient way. mangling paths with symbol names in a netlist is not one of them. replacing one implementation for another must not require a netlist edit.
if qucsator does the include (i.e. the fopen), then yes. the search for the file must be implemented in qucsator. possible solution: pass |
Shall we open another issue and keep things into context? |
yep, I saw you just did it 😁. Seems better to have a dedicated issue for that. |
The issue with symbols and wrong paths to libs seems fixed. Thank you. Merging. |
I have added quick fix for #591. Library name is checked is it relative (system libraries) or absolute (user libraries). It will allow to process user libraries in
SymbolWidget::setSymbol()
method. Otherwise we always have an error when trying to process user library which is defined by absolute path.