Abandon the previous behavior of always creating a new copy of the
buffered symbol which required a re-parenting of every derived symbol
to prevent accidentally orphaning a derived symbol parent symbol
pointers.
This change required something that should have been done a long time
ago by adding an assignment operator to LIB_PART. The assignment
operator makes it possible to create a single copy of the symbol to
buffer which gets updated rather than deleting the last copy and
replacing it with a new copy.
Add a clear method to the MULTIVECTOR class so that existing LIB_PART
object draw items can be removed before assigning the draw items from
the part being assigned.
Fixes#3672https://gitlab.com/kicad/code/kicad/issues/3672
m_connected_bus_item and m_connected_bus_items pointers were not cleared when
rebuilding connection data.
So in some cases these pointers were not updated, and created a crash
once the old data was no longer available (deleted)
Create an IsContentModified() function in each frame
that provides if the content has been modified, and
use that instead of always copying the checks.
ADDED: a config option to select (when clicking on a pin) the parent symbol
or only the pin.
Previously, when cliking on a pin, the parent symbol was selected.
Allowing the pin selection is mandatory in cross probing, and to display the pin
characteristics in some cases, for instance if a pin is flagged by the ERC tooL.
Do not check the connection graph when editing the symbol library table
from KiCad because the connection graph object is no valid when the
schematic editor is not open.
Fixes kicad/code/kicad#3682
There is no need to create a new root symbol and re-parent all derived
symbols when renaming a root symbol. Just rename the buffered root
symbol.
Test for duplicate symbol names when validating the properties dialog
information to prevent broken symbol pointers.
Fix a field drawing bug when editing derived symbols.
Fix bug to insure duplicate symbol names cannot exist in a library.
Fixes kicad/code/kicad#3654
Fixes kicad/code/kicad#3672
The library manager update part function was orphaning the root symbol
of derived symbols when the root symbol was edited. Re-parent the
inherited symbols when updating a root symbol.
Update the mandatory field attributes whenever the parent is set for
derived parts. This will show the fields with the correct attributes
in the symbol editor and viewer.
Using std::unique_ptr to hold the current symbols was deleting the
pointer on symbol selection changes causing the pointer in the library
manager buffer to be stale in some cases. Revert back to using a
simple pointer and manual clean up as required.
Prevent derived symbols from being saved to a different library to
prevent orphaned symbols.
Fixes kicad/code/kicad#3649
The schematic symbol swap function still had the old pin map swapping
code which overwrote the correct pin maps that were rebuild after the
library symbol was update. Duh!
Fixes kicad/code/kicad#3661
Apparently the schematic and symbol library editors now have common
selection filtering so checking for a valid LIB_EDIT_FRAME when
filtering for the schematic editor frame prevented all schematic
object from being selected.
The symbol editor selection criteria did not include LIB_FIELD objects
which allowed the root symbol name to be changed causing broken derived
symbol links. Disable the symbols fields from being edited when a
derived part is shown in the editor to prevent this.
Add a missing warning that deleting a root symbol used to derive other
symbols would also delete all derived symbols from a library. Give the
user a chance to cancel the delete operation in this case.
Fixes kicad/code/kicad#3654
The new symbol library changes left stale pointers in the connection
graph because the SCH_COMPONENT object pins were not always getting
updated when a new copy of the library symbol was updated.
Force a full update of the connection graph whenever the schematic
library symbol links are refreshed. This seems like overkill but it
ensures that there a no stale libraries items left in the connection
graph.
Fixes kicad/code/kicad#3658
Some windows systems will not fall back correctly on our standard
initialization step, so we need the additional std:: error fall back to
catch them.
Fixes#2620 | https://gitlab.com/kicad/code/kicad/issues/2620
Use the root symbol when comparing against the cached symbol when
checking to see if a symbol changed. When the original symbol is
a derived symbol, the test will always fail.
Force a symbol link refresh on a rescue to prevent stale links from
crashing the connection graph refresh when running the project rescue
on demand.
Force a symbol link refresh on project load to prevent stale links from
symbol link changes from crashing the connection graph when the project
rescue in invoked.
Fixes kicad/code/kicad#3645
ADDED new option to set selection highlight thickness.
Also change selection shadow width constants to
make the selection thickness change less drastically
with the zoom level.
Replace some C casts with C++ dynamic_cast.
Fix iterator bug when deleting inherited symbols from legacy file format
symbol library cache.
Remove unnecessary const when return wxString object instead of reference.
Don't clobber value file when load aliases in legacy symbol library cache
parser.
Use actual symbol library LIB_PART pointer rather than a flattened copy
of the symbol. This fixed a bug when displaying the parent field in the
message panel for derived symbols.
Simplify the flatten code by copying the parent and updating the lesser
information from the inherited symbol.
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.