Commit Graph

150 Commits

Author SHA1 Message Date
Marek Roszko 4df3cb912d Remove another leaky wx/log.h header 2021-06-03 08:11:15 -04:00
Jon Evans 1e52f0a180 Make sure pasted symbols get new pin UUIDs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8218
2021-04-18 21:53:38 -04:00
Ian McInerney ae91042544 Implement thread safety for symbol loading routines
These functions can be called from any thread of the library
loader, so we need to ensure we have some thread safety with them.
2021-04-18 18:39:46 +01:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04: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
Marek Roszko ad191fda52 Unwrap eda_base_frame from base_screen 2020-10-13 21:52:57 -04:00
Michael Kavanagh c40483d18a Cleanup: Move KiCad files into plugins folder 2020-10-12 16:36:08 +00:00
jean-pierre charras 7865d8de43 more cleanup about removing useless include 2020-10-02 15:50:46 +02:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.

There is still some debugging output in test code that really needs to
be moved into a unit test.

Add debugging output section to the coding policy regarding debugging
output.
2020-08-18 10:17:36 -04:00
Mark Roszko c6e388db14 Implement an app progress indicator in the taskbar
ADDED: Progress indicator in the taskbar

This adds a progress indicator to the Windows and macOS taskbar
icons to display the progress of some operations.

Note, this requires wxWidgets 3.1+
2020-08-09 10:55:00 +00:00
Jon Evans 12b4a55ae8 Port Eeschema to new project settings
DRC/ERC error serialization changed to use explicit tokens
Old stored severities and ignored errors are discarded
2020-07-02 22:08:54 -04:00
Wayne Stambaugh b624c7090a Deprecate saving legacy schematic and symbol library file formats.
REMOVED: The ability to save schematics in the legacy file format.
2020-05-29 12:43:00 +00:00
Jeff Young ac096fdf99 Catch exceptions from a failed library load. 2020-01-13 15:27:16 +00:00
Jeff Young 836c1ea56e Fix a bunch of un-caught boost::bad_pointer exceptions.
This also removes vector cover types which do nothing except obfuscate
the underlying implementation.

Mainly changes SCH_SHEET_PINS and CONFIG_PARAM_ARRAY (which will soon
be replaced by Jon's new stuff).
2020-01-12 19:55:00 +00:00
Jeff Young 7bb9551801 Handle boost exceptions. (From Coverity scan.) 2020-01-11 00:04:01 +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
Jeff Young 99e659ff54 Coverity fixes. 2018-03-21 23:11:55 +00:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
Maciej Suminski 8721f7ed70 Changed remaining occurences of 'part' to 'symbol' in the symbol editor 2018-01-18 11:24:02 +01: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
Wayne Stambaugh 7ca7d9078e Eeschema: fix potential symbol cache library name collisions.
If a schematic contains two symbols with the same name from different
libraries, the cache will contain the last symbol saved with that name.
Prepend the library nickname with the original schematic symbol library
nickname when saving the cache library to prevent name collisions.
2017-12-08 08:32:23 -05:00
Maciej Suminski 42220579df Const modifiers 2017-11-21 23:18:55 +01:00
Wayne Stambaugh 8fd89c881d Final symbol library table changes before merge.
Remove all symbol libraries from the project file after remapping to
prevent symbols that should be loaded from the cache being loaded from
a library further up the search order.  Save the project file to clear
all of the libraries so they never get reloaded again.

Remove the symbol library management dialog and menu entries.

Rename the symbol library table dialog menu entry.

Remove all symbol libraries from default project file to prevent clashes
with the cache library.

Fix illegal symbol naming in Eagle plugin.
2017-11-09 18:50:21 -05:00
Wayne Stambaugh c1f7c1778a Revise symbol rescuer to support symbol library table.
Refactor rescue objects so that they can support derivation.

Factor out legacy rescuer code to perform legacy project rescues.

Create new symbol library table rescuer for rescuing symbol library table
based projects.

Perform the correct rescue type on project load.

Add symbol library table remapping support to the tools menu for run on
demand as applicable.

Add flag to SCH_SCREENS::UpdateSymbolLinks() to allow forcing the symbol
link updates when the library modification hash has not changed.
2017-11-09 18:50:20 -05:00
Wayne Stambaugh 0cf2df51c6 Convert symbol library viewer over to symbol library table.
Remove all instances of PART_LIBS and replace them with SYMBOL_LIB_TABLE
except for the CMP_TREE_MODEL_ADAPTER which requires updating as well.

Return the selected symbol using the LIB_NICKNAME:SYMBOL_NAME format when
viewer is launched as modal.

Add code to SYMBOL_LIB_TABLE object to allow enumerating symbol library
power symbols only.

Add a non-const version of LIB_TABLE::findRow().

Remove redundant information from Doxygen comments.
2017-11-09 18:50:17 -05:00
Wayne Stambaugh 96c3d5ff21 Enable symbol library table remapping.
Check the if the schematic being loaded has been remapped (no symbol
library table nicknames defined) and remap accordingly.

Fix issues when resolving the library symbol links in the schematic
symbols.

Add cache library fallback when resolving symbols that cannot be
remapped.

Add remap complete message to remap dialog.

Add HasLibrary() helper to LIB_TABLE_BASE.

Fix issues when loading library symbols using symbol library table.

Add hashing function to symbol library table.

Improve the symbol panel message to warn user when cache library is
used to resolve symbol.
2017-11-09 18:50:17 -05:00
Wayne Stambaugh 83cf726cd6 Fix crash when no symbol libraries are found.
Remove adding the power symbol library when no libraries are specified
in the project file to prevent unexpected missing library dialog.

Only show progress dialog if there are actually libraries to load.

Do not call wxWindow::Destroy().  The dialog is created on the stack and
will be destroyed properly in the wxWindow dtor.

Fixes lp:1728648

https://bugs.launchpad.net/kicad/+bug/1728648
2017-10-31 18:37:44 -04:00
Dick Hollenbeck 19e6bde09a Rewrite class UTF8 to contain rather than extend std::string storage.
This forces the compiler class specific features rather than borrowing
from the base class's std::string.  In some cases prior to this,
wxString( std::string ) was being called rather than UTF8::operator
wxString() leading to garbled wxStrings.

Added function UTF8::wx_str() which is of great convenience also.

Implicit conversions still work as before, and hopefully more reliably.
2017-07-26 08:30:12 -04:00
Dick Hollenbeck 4e7de8a761 Reverse commit 4011ed4e31.
This commit was too broad and not cognizant of the purpose of the class
UTF8.

Add MAYBE_VERIFY_UTF8() macro, which can trap non-UTF8 encoded strings in
debug builds.

Use that macro conditionally in class UTF8 to trap non-UTF8 encoded strings
being put into UTF8 instances.
2017-07-26 08:26:56 -04:00
jean-pierre charras 459fd9e584 Better fix for bugs 1703258 and 1702707: better detection of cache lib modifications, not always detected previously.
The component to symbol links were previously not always updated after a library change,
if the change is made outside the library editor.
2017-07-12 16:07:08 +02:00
jean-pierre charras 9a2322cfcd New fix for bug 1700331 (Filenames with Double Period Invalid).
The previous fix was building the full name incorrectly, when this name contains a path not relative to the project.

Fixes: lp:1700331
https://bugs.launchpad.net/kicad/+bug/1700331
2017-07-02 10:30:21 +02:00
Tomasz Włostowski 0f5ab1bc87 Reverted commit 4130083445. 2017-07-02 00:34:41 +02:00
Wayne Stambaugh 4130083445 Eeschema: fix loading symbol libraries with dot in file name.
Initializing wxFileName objects by using string assignment or the single
string argument ctor will cause wxFileName to parse everything to the
right of the first dot as the file extension.  Therefore, file names such
as foo.1.lib and bar.baz.lib will fail.  This is probably not the only
place in the KiCad source where this can occur.

Fixes lp:1700331

https://bugs.launchpad.net/kicad/+bug/1700331
2017-06-29 10:36:12 -04:00
Kristoffer Ödmark 19d5cc7548 Removed all exception specifiers since deprecated.
Exception specifiers are deprecated in cpp11, so went through them all
and removed them from the code.
2017-06-12 13:54:55 -04:00
Wayne Stambaugh 36606ceeb7 Add symbol library table remapping dialog.
Create dialog and code to allow legacy schematic symbols to be remapped
from the old library path look up method to the new symbol library table
method by using the following steps:

  1) Create a project symbol library table containing all of the symbol
     libraries defined in the old library look up list not found in the
     global symbol library table.

  2) Map each symbol to the correct symbol in the symbol library table
     if possible.

Recreate library link to symbols so look up method can be converted to
symbol library table properly.

Add function to SCH_COMPONENT to link library symbols using the symbol
library table.
2017-04-04 18:31:28 -04:00
Chris Pavlina 4011ed4e31 Convert UTF8 to/from wxString correctly around LIB_ID
Fixes: lp:1675942
* https://bugs.launchpad.net/kicad/+bug/1675942
2017-03-24 21:38:00 -04:00
jean-pierre charras 8f3fc7b858 Optimization in class_library.cpp: speed up power component list creation. 2017-03-13 12:49:24 +01:00
jean-pierre charras de30dc9f5d Speed up schematic libraries loading. 2017-03-10 21:17:56 +01:00
Maciej Suminski 7034ea0c95 Added missing PROPERTIES parameter to function calls in PART_LIB 2017-02-28 15:19:03 +01:00
Maciej Suminski 8b8de76aa5 Store information about buffering & caching in properties
PROPERTIES object has been recreated every time it was needed, using
two fields in PART_LIB class. Now the buffering & caching settings are
stored directly in a PROPERTIES object.
2017-02-28 15:18:58 +01:00
Chris Pavlina 9effcb80e7 Optimize SCH_PLUGIN enumeration for populating the component chooser 2017-02-24 11:47:27 -05:00
Wayne Stambaugh 0898b6c94d Prevent symbol libraries from being unnecessarily reloaded.
When Eeschema is relaunched from KiCad, the symbol libraries were always
reloaded which isn't necessary as they are maintained by the kiface project
object until the project is changed.

Fix minor title capitalization in symbol library progress dialog.
2017-02-17 19:31:47 -05:00
Wayne Stambaugh 9375e18fb6 Fix broken symbol library alias root symbol links.
Check to see if the root symbol alias already exists before adding it to
the symbol library alias list in the legacy schematic I/O plugin.  There
currently about six different ways that the root alias can be changed in
the root symbol which causes issues.  This really needs to be cleaned up.

Use buffering when updating a symbol in a library to prevent the library
file from being written before it is backed up.

Update the alias and unit selection menubar drop down lists.

Delete the output formatter so the file is closed so that reading the
file time stamp can be performed to prevent unnecessary cache reloads.

Fixes lp:1664834

https://bugs.launchpad.net/kicad/+bug/1664834
2017-02-15 20:28:36 -05:00
Wayne Stambaugh 175d68fbb1 Fix schematic cache library broken by schematic I/O plugin changes.
Check for existence of cache library when before attempting to rebuild
the cache.  Create a new cache library object if no cache library was
loaded.

Add missing buffering and cache properties to LIB_PART::FindAlias() to
prevent the plugin from reloading the cache library that may not exist.

Add method to find library by full path and file name.

Revert the check for a symbol in the cache library remove from last
patch.

Add checks for plugin cache file name validity and existence of a the
file before attempting to verify the file modification time to prevent
wxWidgets from raising an assertion in debug builds.

Clear modified flag when saving buffered and/or cached library.
2017-02-13 13:47:46 -05:00
Wayne Stambaugh e8cf4f0724 Fix bug in legacy schematic I/O plugin.
Move adding LIB_PART to library until the part is fully parse.  The problem
was unique_ptr was cleaning up the part when an exception was thrown during
parsing causing a double free when the cache was deleted.

Add missing try/catch block when loading the cache library during an append
schematic operation.

Fixes lp:1663869

https://bugs.launchpad.net/kicad/+bug/1663869
2017-02-11 20:19:52 -05:00
Wayne Stambaugh 7ccdca5ced Use library ID to store library symbol information in the schematic symbol.
Use LIB_ID instead of wxString for storing the library symbol information
in the schematic symbol in preparation for the upcoming symbol library table
implementation.

Change the FindLibAlias and FindLibPart functions in the PART_LIBS object
instead of wxString.  Please note that only the library ID name is used to
search the list of libraries.  The library nickname is ignored.  Once the
symbol library table is implemented and full LIB_IDs are defined, the
library search code will no longer be used and will only be kept to load
older schematics that have not been converted.

Move SCH_LEGACY_PLUGIN_CACHE definition so that the legacy plugin knows
how to properly delete the cache object.
2017-02-10 08:36:59 -05:00
Wayne Stambaugh ebfbbcc1f5 Fix missing part library broken by schematic I/O plugin changes.
The LIB_PART object stores a pointer to the PART_LIB that it belongs to.
Now that the PART_LIB is no long responsible for loading the library, add
the PART_LIB pointer after the library is loaded by the plugin.
2017-02-10 08:36:58 -05:00
Wayne Stambaugh 73bbc35c3e Make the schematic I/O plugin the only option.
Add SCH_PLUGIN object to PART_LIB object.

Convert all PART_LIB I/O to use SCH_PLUGIN.

Remove library caching from PART_LIB and use caching provided by SCH_PLUGIN.

Add support to use PROPERTIES for buffering and document file write control
instead of adding code the SCH_PLUGIN object in the SCH_LEGACY_PLUGIN that
will not be required when the new file formats are implemented.

Add buffering to SCH_LEGACY_PLUGIN to prevent cache from writing file on
every change to library.  This is to prevent the cache library from being
written every time a new symbol is added.

Add option to not save library document file when saving library.  This is
primarily used by the cache library write code.

Move symbol library write code out of LIB_PART and into SCH_LEGACY_PLUGIN.

Add exception handling where LIB_PART caught the exception and returned
an error status.

Remove KICAD_SCH_IO_MANAGER build option as it is no longer optional.
2017-02-10 08:36:57 -05:00