Closed hb020 closed 3 months ago
Just to trace the paths I found:
~/Local Settings/Application Data/LTspice/lib
~/AppData/Local/LTspice/lib
~/Documents/LtspiceXVII/lib
Under wine, ~
should mean the part the simulator's executable path preceding and including /drive_c/
+ /users/${USER}/
Under windows or when using the native MacOS simulator, we can just use os.path.expanduser()
The paths are not the same everywhere and there is a reason for that. In one case we are looking for symbols, another we are looking for libraries, and another for other .asc files.
Yes, /sub, /sym endings are needed of course. Didn't make that explicit. The main point is that the number of paths to search is not identical everywhere. Working on a POC to automate lib path searches, and to make it easier for the people under wine.
Proposition:
lib.zip
). The base path for the libraries under wine is known to the LTSpice simulator.AscEditor (for LTspice):
.lib
(/sub): 2 out of the 3 potential paths, + 'factory default', none compatible with wine.asy
(/sym): 2 out of the 3 potential paths, none compatible with wineAscEditor.add_library_paths(AscEditor, paths)
. In addition to the above, the custom paths will also be used for searching of:
.asc
QschEditor (for Qspice):
.lib
: 1 path (out of ??), not compatible with wine.qsch
: 1 path (out of ??), not compatible with wineQschEditor.lib_paths.extend(paths)
asc_to_qsch (for LTspice to Qspice conversion):
.asy
(/sym): 2 out of the 3 potential paths, none compatible with wineSpiceCircuit/SpiceEditor (for LTspice, but potentially others):
.lib
(/sub): 1 path out of the 3 potential paths, not compatible with wine.add_library_search_paths(paths)
and .LibSearchPaths.append(paths)
(same base functionality, although the first is a bit more versatile). See branch library-searching-69
branch library-searching-69 was merged into trunk. Thanks to @hb020
Right now, I see these search paths:
3 issues show up: 1) not all paths are used everywhere 2) this is mainly guess work, while we know the path of the spice executable. The latter could be especially helpful when we have installations with wine, where these specific search paths are guaranteed to point nowhere (requiring the user to use
SpiceCircuit.add_library_search_paths()
orSpiceEditor.LibSearchPaths.append()
), or potentially worse: point to a potentially outdated MacOS version without complaining. 3) I would suggest not using~/AppData/Local/Programs/ADI/LTspice/lib.zip
, as that points to the default installation, not the updated files that are normally in one of the paths mentioned above.I propose to tweak these searches to base the search on where the simulator really is installed. Will provide a PR.