Apparently GCC does not like competing definitions of the == operator.
The recent refactoring away of all LIB_ITEM objects created a conflict
with the SCH_ITEM == operator definition. This change required some
rather ugly comparison changes. There were no unit test failures but
that doesn't mean something didn't get broken.
Also removes the side-effect that SCH_SHEET_LIST's
c'tor would sort the list (and write virtual page
numbers) anytime the starting sheet was the root.
Also, definitely don't build a SHEET_LIST (sorted or
otherwise) if you're not even going to use it.
Also don't build SCH_SHEET_LISTs on idle events. Better
to just always have the Next Sheet button enabled (we
already beep if you click it and there's no next sheet).
Also, use a SCREEN_LIST when you can. It's much cheaper
to create.
If we are renaming a sheet that exists only once in the schematic, then
we don't need to warn about case sensitivity. If the sheet exists
multiple times, we do. We can't check this using SCREENS because the
screens don't maintain full state information about where they are used.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17901
Avoid O(N^2) by spatial sorting, don't run checks if the bounding boxes
don't overlap.
A second copy is ordered by type to help classes that only want to check
a few types having to walk the whole list.
Running the schematic editor in the stand alone mode can result in an
empty project name. Rather than assert when the project name is empty,
just don't run the pruning algorithm. The pruning will just have to
happen on the next load of the schematic when it has a proper project
name.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16577
Pasting from the clipboard when copying from another project can leave
sheet instance information that is not valid for the current project.
This change prunes all sheet instance information that is not relevant
to the current project. It also prunes invalid paths created by pasting
sheets from different paths in the same project.
produces a crash when the library links are updated, and a power symbol is not found
in any loaded library.
Add also an option to export all symbols or all not pwer symbols
Fixes#16229https://gitlab.com/kicad/code/kicad/-/issues/
The paste code creates invalid KIID_PATH objects with a zero length. All
paths must include the root KIID at a minimum. Code was added to prune
the invalid paths and some defensive code was adding to the formatter to
prevent the crash in case there are other paths where someone generates
a zero length path.
Pruning orphaned instance data does not work when loading schematics prior
to version 7 because the paths did not include the root sheet UUID. Once
the file is saved to V7 or later, the next load will prune any orphaned or
invalid instance data for the current project.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16245
It appears that in our zeal to prevent file changes when saving shared
schematics, we (I) clobbered saving relative symbol instance data paths
to the clipboard. This has be restored along with setting the correct
symbol unit for relative clipboard paths.
Fixed a serious issue with KIID_PATH::MakeRelativeTo() where the original
path was not restored when the incremental KIID object test fails. This
also included a minor optimization using the actual KIID object for
comparison instead of converting it to a string and then comparing the
string.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15981
Also fixes a bug where zooming doesn't get a redraw until mouse moves.
Also fixes a couple of bugs where dangling markers on SCH_SHEET_PINs
and SCH_HIERLABELs weren't getting drawn.
Also simplifies drawing algorithm by removing aesthetic offset (which
wasn't implemented when pin is drawn as part of selection VIEW_GROUP).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15129
* Add check for valid symbol library link in annotation code to prevent
crash even if the symbol was not defined correctly. This will assert
in debug builds.
* Fix broken pin comparisons when library symbols have units with alternate
body style defined.
* Remove some macros from LIB_SYMBOL comparison function which made
debugging painful.
* Exit LIB_SYMBOL comparison function as soon as non-equivalent comparison
occurs.
* Fix broken library symbol comparison due to name differences when
checking for existing variants of the library symbol.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14491
Rather than update library symbols one at a time, queue them up by
schematic symbol to prevent multiple updates to the same symbol in
complex hierarchies. This also removes all of the library symbols
first which will clear out all of the library symbol variants that
were created by modifying library symbols in place and/or changes to
the symbol in the library.
Don't add new variant library symbol if an equivalent variant already
exists in the schematic local cache. This prevents duplicate library
symbols from being added to the local cache when the first variant in
the cache does not match that of the symbol being added.
This iterated over all pins to find the pin after a given item. Because
out pattern is consistently to iterate in the outer loop, this means
that we were an O(n^2) loop for the pins just to find their names. This
affected very large parts (e.g. FPGAs) when switching sheets to display
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