Commit Graph

66 Commits

Author SHA1 Message Date
Ian McInerney f2702b223c Introduce base IO_MGR class and unify RELEASER objects
The IO_RELEASER is a thin-wrapper around a std::unique_ptr, but done
this way to allow easier addition of a custom deleter in the future if
something needs to call back into the IO_MGR.
2023-12-29 00:37:38 +00:00
Ian McInerney 743e9d669a Push library management into IO_BASE 2023-12-27 01:21:53 +00:00
Ian McInerney 85f62c1fde Rename all schematic IO plugins 2023-12-24 01:22:21 +00:00
Ian McInerney d8b47d18d3 Initial rename of file plugin infrastructure components to IO 2023-12-24 01:22:21 +00:00
Marek Roszko 121ea99824 Move the settings path to PATHS to allow shifting other classes into kicommon 2023-09-23 20:06:58 -04:00
Alex Shvartzkop e128896ba6 Schematic plugins refactoring, fixes for PCB plugins.
- Move PLUGIN_FILE_DESC to common.
- SCH_PLUGIN: rename Load -> LoadSchematicFile, Save -> SaveSchematicFile.
- Use PLUGIN_FILE_DESC and CanRead* in schematic plugins.
- Return none/unknown types from Find/GuessPluginType functions.
- Iterate over file types for file wildcards.
- Clean-up header checking in IO plugins.
- Use PCB plugin list in IO_MGR::GuessPluginTypeFromLibPath.
2023-08-31 05:08:03 +03:00
Jon Evans 4c4bbdc8f3 Stricter API for LIB_TABLE
Prevent nickname map or row parent getting out of sync

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15315
2023-08-06 00:56:51 -04:00
Wayne Stambaugh bdee545841 Coverity warning fixes. 2023-06-03 07:28:17 -04:00
Jon Evans dc847db19d Add initial support for database library settings UI
For now, just for diagnostic purposes (settings changes are not preserved)
2023-04-29 18:15:00 -04:00
jean-pierre charras ae7456e055 SYMBOL_LIB_TABLE and PANEL_SYM_LIB_TABLE: fix some issues:
- Ensure a change in plugin type is detected
- do not force automatic plugin type selection for *.lib files that need
an access to these libraries: they can be not always available.
2023-04-27 12:54:18 +02:00
qu1ck 2975f53647 PCM: auto reload global libs after dialog is run
This adds Reset() method to KIFACE to reload global libs stored in
global static vars.
Also refactors some lib reload code in various frames to have
common MAIL_RELOAD_LIB handler.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12500
2023-02-17 17:24:32 +00:00
Jeff Young 51293858b3 Allow empty lib tables.
Fixes https://gitlab.com/kicad/code/kicad/issues/13653
2023-01-24 23:45:55 +00:00
Seth Hillbrand 442ee52905 Add versioning to lib tables
Sets lib table version to allow easier migration between versions
2023-01-23 22:21:12 +00:00
Seth Hillbrand efe12f2da5 Cleanup variable naming
Also remove ancient/unused code for lazy resolving
2023-01-23 22:21:12 +00:00
Seth Hillbrand a9ed47f06c Update KICAD6->KICAD7 2023-01-23 22:21:12 +00:00
Jeff Young 50ccc4e6da Fix issue converting legacy SPICE models.
1) if a legacy model references a library then we need to see if said
   libraray exists and read model from it if so
2) legacy node ordering is by index, not pin name
3) we can't auto-generate a pin map when we don't know the pin names,
   so don't try
2022-12-14 13:36:28 +00:00
Jon Evans 39a8ab8738 Make sure to set the lib table for a plugin before it gets used
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12847
2022-12-10 16:04:54 -05:00
Jeff Young 8931e55dd2 Templatize MigrateSimModel() so it can be used on LIB_SYMBOLs as well.
Fixes https://gitlab.com/kicad/code/kicad/issues/13080
2022-12-08 23:57:43 +00:00
jean-pierre charras bd28bd7a00 fix a few compil warnings 2022-09-23 18:30:42 +02:00
qu1ck 6ebb3baa3b PCM: autoload libs from installed packages to global lib tables
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9713
2022-09-23 16:16:13 +00:00
Jon Evans 9a8ee2ca50 Fix loading of symbols from libs through non-chooser paths
Allow calling PLUGIN::LoadSymbol directly when outside the threaded loader
2022-08-27 18:47:39 -04:00
Jon Evans 49354e52a8 Add support for sub-libraries concept
Sub-libraries allow a single-level hierarchy inside a symbol library.

This is useful for database libraries and for supporting other EDA library types where a
single file can contain multiple logical groupings of symbols.
2022-08-27 18:47:39 -04:00
Jon Evans 300d92438c Allow hiding symbol library tables from symbol chooser
Hidden but loaded libraries are useful when using database libraries
2022-08-26 20:18:40 -04:00
Jon Evans ae6a2a6443 ADDED: Database libraries MVP
Allows placing parts from an external database that reference symbols from another loaded library.

Includes:
- nanodbc wrapper
- database schematic library plugin
- basic tests

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7436
2022-08-26 10:51:13 -04:00
Jeff Young 574bef2237 Normalize drawing sheet path to env vars & prj, not just prj.
Also cleans up the dialog a bit.

Also changes the workings of NormalizePath to return the input if
it couldn't be shortened which saves open coding that behaviour in
all its callers.

Fixes https://gitlab.com/kicad/code/kicad/issues/9036
2021-10-02 23:39:45 +01:00
Jeff Young 062c4fda62 More error message regularization (and translatability improvements). 2021-06-28 00:45:24 +01:00
Wayne Stambaugh 71c183d7bb Rename LIB_PART to LIB_SYMBOL. 2021-06-14 07:11:17 -04:00
Wayne Stambaugh 1786ae8773 Eeschema: use symbol nomenclature for object file naming. 2021-02-24 08:48:02 -05:00
Marek Roszko 907e282347 Silence some msvc warnings
- exception variables that were unused
- RAYSEG2D improperly foward declared with class instead of struct
- unused vars
2021-02-20 11:58:55 -05:00
Seth Hillbrand 2edcf42115 Symbol Editor IO_ERROR catching
Tests for read-only in table save routines and catches other IO_ERRORS.

Still returns a non-specific error message but prevents crashing when
erroring during save.

Fixes https://gitlab.com/kicad/code/kicad/issues/7352
2021-01-31 11:31:07 -08:00
Jeff Young ff7742c6b8 File naming and include cleanup. 2021-01-28 11:35:18 +00:00
Wayne Stambaugh 1eee72ec65 Fix library tree behavior when duplicate project table entry is disabled.
Fixes https://gitlab.com/kicad/code/kicad/issues/5438
2021-01-11 07:46:07 -05:00
Seth Hillbrand 8de9cff4e0 Change environmental variables to human-readable
Versions specific variables that may point to objects that change
through versions, allowing multiple KiCad versions to operate correctly
(even on MSW) on the same machine.
2021-01-01 16:20:35 +00:00
Jeff Young 1c0d4ac02d Simplify some error messages. 2020-12-18 00:30:26 +00:00
Ian McInerney 31e626f279 Cleanup creation of all our smart pointers 2020-10-26 23:52:44 +00:00
Marek Roszko a1c75748a0 Remove GetChars(), a wxWidgets 2.9 compatibility hack 2020-10-15 20:53:25 -04:00
jean-pierre charras 7865d8de43 more cleanup about removing useless include 2020-10-02 15:50:46 +02:00
Ian McInerney 1b4ec6ccb5 Display symbol libraries that couldn't be loaded as disabled text
Fixes https://gitlab.com/kicad/code/kicad/issues/5092
2020-09-02 00:10:25 +01:00
Jeff Young 33480ecad1 Show all symbol libraries by default.
Also fixes an issue where the plugin wasn't getting reset if the
library type was changed.
2020-07-17 18:33:14 +01:00
Seth Hillbrand 66f38dfc10 Remove assert that fires in normal operation
The missing symbol happens normally when the user does not have their
cache file available.  This should not be an assert
2020-07-06 14:37:03 -07:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Jeff Young 677fcee0d2 Remove exception which is not caught in most code paths. 2020-01-11 21:29:25 +00:00
Wayne Stambaugh 54f066fed7 Implement simple inheritance for library symbols.
This change completely removes the LIB_ALIAS design pattern an replaces
it by allowing LIB_PART objects to inherit from other LIB_PART objects.
The initial implementation only allows for single inheritance and only
supports the mandatory fields in the derived part because that is all
that the current symbol library file format will support.  Once the new
file format is implemented and saving to the old file format is deprecated,
more complex inheritance will be added.  The LIB_ALIAS information saved
in the document files was move into the LIB_PART object.  This change
impacts virtually every part of the schematic and symbol library editor
code so this commit message is woefully incomplete.

REMOVE: Removed the symbol aliases concept from the schematic and symbol
editors and the symbol viewer.

NEW: Replace the symbol alias concept with simple inheritance that allows
a library symbol to be derived from another library symbol.
2019-12-06 11:33:52 -05:00
Jeff Young 5c43924338 Display all "File couldn't be found" messages at the end.
Fixes: lp:1810161
* https://bugs.launchpad.net/kicad/+bug/1810161
2019-07-10 23:17:50 +01:00
Wayne Stambaugh a55d9819bc Do not use project path when searching for default library tables.
When no default library tables are found, set the default wxFilePickerCtrl
to the users configuration path instead of the current project path to
prevent any project library tables from being used as the default.

Fixes lp:1809769

https://bugs.launchpad.net/kicad/+bug/1809769
2019-01-26 16:19:02 -05:00
Jeff Young eb7ecf1dfd Load each symbol library atomically for better performance. 2018-01-24 19:21:56 -05:00
Camille f5f7ba4746 Fix loop variable copy in for-range loop, use const reference instead 2018-01-09 19:18:44 -05:00
Simon Richter a9ccf1161b Fix quotes in UI messages
This replaces all single and angle bracket quotes in UI messages with
double quotes, for consistency.

Sorry to all translators.
2017-12-15 07:33:07 -05:00
Oliver 7cdb78e852 Added "enabled" parameter for LIB_TABLE_ROW
- Read and write from lib-table working
2017-11-21 08:18:06 -05:00
Wayne Stambaugh 8b2b1381c4 Fix symbol library table editor plugin type selection bug.
Remove the placeholders for the upcoming s-expression schematic and
symbol library file format plugin type.  The lack of a valid plugin
implementation was causing an undefined plugin type string in the
plugin type selection cell when new rows were added to the table.

Fixes lp:1733116

https://bugs.launchpad.net/kicad/+bug/1733116
2017-11-19 16:53:31 -05:00