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.
Since Eagle does not connect stacked NC pins but KiCad will if the pins
are coincident, we choose to only import the first of the stacked NC
pins. While this creates symbols that are slightly different in pin
count from the Eagle version, it keeps the schematic and netlist
functionally correct relative to the Eagle version.
Fixes: lp:1821319
* https://bugs.launchpad.net/kicad/+bug/1821319
(cherry picked from commit 370109b868)
This fixes multiple issues when importing Eagle V6 files.
Crashes occured when arcs of 0-length were found and when parts were
referenced in the schematic that were not found in the library. This
could happen if the library and schematic were different cases.
Fixes: lp:1830564
* https://bugs.launchpad.net/kicad/+bug/1830564
The '/' and ':' are reserved and cannot be used in symbol or footprint
names. They will cause the LIB_ID parser and formatter to fail. While
it seems like they should be legal in symbol alias names, they will
trigger a symbol rescue the next time the schematic is loaded.
Use ID_SCH as in the Eagle schematic plugin rather than ID_ALIAS to
ensure symbol names do not need rescued the next time the schematic is
opened.
Remove ID_ALIAS since the rules for alias names are the same as the
rules for symbol names. Otherwise, allowing '/' and ':' in alias names
will force a symbol rescue on the next schematic load.
Fixes lp:1795600
https://bugs.launchpad.net/kicad/+bug/1795600
Even though slash is a valid character in symbol names, it is a revision
separator, but is not the case with Eagle symbol names.
Fixes: lp:1791653
* https://bugs.launchpad.net/kicad/+bug/1791653
Eagle files that are edited may be missing required data. While we do
not need to handle these files, we do need to prevent segfaults in KiCad
when reading them.
Eagle allows for variants of components to be listed in the schematic.
This patch copies the variant data into the imported schematic item,
prefixing the alternate variant names with "VARIANT_" and keeping the
alternate values.
When parsing component names, we need to account for the possibility of
illegal characters (e.g. "/", ":") in the names from v4 libraries. They
are fixed internally by the cache parser but if we don't fix them
in the rescue routine, the symbol won't match it's cache name.
This standardizes all schematic illegal character routines into LIB_ID
Fixes: lp:1774774
* https://bugs.launchpad.net/kicad/+bug/1774774
Symbol/footprint library and entry have the same set of forbidden
characters with a single exception, space character. To accommodate for
this difference, LIB_ID validation and fix methods have been extended to
specify the LIB_ID type that is checked (schematic/board).
LIB_ID::HasIllegalChars() and LIB_ID::FixIllegalChars() had two different
sets of characters treated as invalid in LIB_IDs. The set has been
factored out to another function to avoid duplication.
Nets assigned by power pins are weak, meaning they are valid
as long as there is nothing else attached to such pins. This patch
checks whether there are other wires or pins attached to a power pin
before placing a global net label.
Fixes: lp:1755191
* https://bugs.launchpad.net/kicad/+bug/1755191
Each named power input pin in Eagle creates an implicit connection to a
net with the name of the pin (e.g. GND, VCC). It is also done for the
units (gates in Eagle nomenclature) that have not been instantiated in
the schematics.
To emulate this behaviour in KiCad:
- Placed components are checked for power input pins, so they will have
global net labels attached to create the described implicit connections.
- As the components are placed, the remaining units of the symbol are
checked for power inputs to see if they need to be instantiated together
with global net labels.
Fixes: lp:1755191
* https://bugs.launchpad.net/kicad/+bug/1755191
Eagle support net labels that are naming wires not directly connected to
the labels. In KiCad it is not possible, therefore such detached net
labels need to be moved, so they touch the corresponding wire.
The initial algorithm did not take into account that a moved net label
might be placed on a wire crossing, effectively shorting two nets. This
commit improves the placement algorithm by avoiding the wire crossing
points when placing a label.
Fixes: lp:1748502
* https://bugs.launchpad.net/kicad/+bug/1748502
With hash character starting the reference value, schematic components
are considered as virtual and therefore netlist updater do not warn about
an unsigned footprint anymore. This approach is useful to handle logos,
frames or other virtual Eagle components.
Fixes: lp:1756281
* https://bugs.launchpad.net/kicad/+bug/1756281
Local net labels are preceded with sheetpath (even for single sheet
schematics it is '/') causing net name conflicts between schematics and
layout. It can be easily avoided by using exclusively global net
labels, at the cost having uglier schematics.
Extra labels to preserve eagle named nets feature are now placed at the
end of a wire segment instead of the middle of a wire. Prevents a label
being placed on crossing wires that are not connected by a junction
resulting in an incorrent netlist.
The previous implementation relied only on the project name. When it is
set, the imported library was named '-eagle-import'. Now it tries
the project name and then the file name, using 'noname-eagle-import'
as fallback.
The library name is stored in the plugin to avoid changing the library
name after the project name has been set.
Change the legacy schematic plugin to preserve illegal LIB_ID characters
when load schematics prior to version 4.
Check for illegal LIB_ID symbol names during project rescue. Rename and
rescue any symbols with illegal LIB_ID names.
Add static methods to LIB_ID object for testing for and fixing names
with illegal characters so there is uniform code for doing so.
Update the Eagle plugin symbol loader to fix symbol names using the new
LIB_ID fix illegal names method.
Fixes lp:1732236
https://bugs.launchpad.net/kicad/+bug/1732236