147 Commits

Author SHA1 Message Date
Seth Hillbrand
f66cbaf43a ADDED: Stacked pin notation support
Implement bracket notation for stacked pins ([1,2,3], [1-4], [1,3,5-7]).
Automatic net naming proceeds based on the smallest logical pin number
in stacked groups.

Provide explode/reform commands in symbol editor for conversion.
Supports arbitrary ranges including BGA alphanum ranges like
[AA1-AA3,CD14-CD22]

Adds some additional QA and trace logging

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2004
2025-09-07 14:59:51 -07:00
Adrián García
fb558eee3c Fix crash in LIB_SYMBOL::SetUnitCount when reducing unit count
When decreasing the number of units in a symbol, the previous code erased
items directly from m_drawings using a single iterator. Because m_drawings
is a MULTIVECTOR, this could invalidate iterators and attempt to erase
from the wrong bucket, leading to segmentation faults.

This patch iterates bucket by bucket and erases items belonging to units
greater than the requested count. This ensures iterator safety and avoids
accessing invalid memory.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21631
2025-09-05 12:35:54 -07:00
John Beard
0ede830f54 LIB_SYMBOL: When assigning, clear the parent if needed
This allows assigning a symbol with no parent to a symbol with
a parent to work more as expected.
2025-09-02 23:50:17 +08:00
Jeff Young
6dd4e01f16 ADDED: custom body styles.
(Also moves editing of unit display names to the
Symbol Properties dialog and retires the Set Unit
Display Name dialog.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16069

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14843
2025-08-27 18:11:56 +01:00
jean-pierre charras
637902f43f DIALOG_PIN_PROPERTIES: fix display issue of invisible pins
After changes in Eeschema code, in DIALOG_PIN_PROPERTIES invisible Pin
were not displayed, making pin edition not easy. This is now fixed.
2025-08-21 18:22:41 +02:00
Jeff Young
34e075e112 Rework libtree SearchTerms to honour shownColumns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21419
2025-08-03 20:32:19 +01:00
jean-pierre charras
4248f26bae Try to fix an ambiguous cast for MSVC 2025-07-23 18:03:37 +02:00
Jeff Young
ec155c00f3 Comboboxes for units and body styles.
Also for pin-types in pad properties.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19904

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19905
2025-07-23 14:35:37 +01:00
Jeff Young
f58fc0b952 Rewrite GROUP undo based on uuids.
This also removes the GROUP/UNGROUP-specific undo actions.

This also fixes a bunch of undo bugs when duplicating
group members, creating pins, etc.

This also fixes some undo bugs when dividing wires etc.

This also fixes some bugs with new sch items not
being created within an entered group.
2025-05-21 14:24:59 +01:00
Jeff Young
a24f7121d8 Don't show mandatory fields in chooser.
Those we want are already accounted for in the
scoring algorithm.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20541
2025-04-11 12:23:47 +01:00
Jeff Young
598d446a38 Simplify libTree scoring algorithm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20610
2025-04-11 12:23:47 +01:00
Mike Williams
c67924ccac schematic: convert RunOnChildren to also take recursion mode argument
Prepping for SCH_GROUPS, making consistent with the PCB code.
2025-03-27 13:16:09 -04:00
Jon Evans
805ca0c791 ADDED: Jumpers for symbols
Support explicit jumper symbols, defined either by a
flag that all pins with the same number are connected,
or by explicit groups of jumpered pins

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2558
2025-03-24 22:08:46 -04:00
Jeff Young
0fae6a0db0 Initialize field ordinals for LIB_SYMBOLs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20263
2025-03-07 15:52:31 +00:00
Seth Hillbrand
49a4699d5a ADDED: Local power symbol option
Local power symbols work like regular power symbols except that they are
scoped only the the sheet in which they are instantiated

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2075
2025-03-04 17:07:46 -08:00
Jeff Young
f951497a4f Code brevity. 2025-03-01 21:58:31 +00:00
Jeff Young
c5bb59468d Get rid of assumptions about field order. 2025-02-24 11:08:29 +00:00
Jeff Young
f2da0c791f Retire non-cairo printing.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19323
2025-02-24 11:08:29 +00:00
Jeff Young
7eb75720b5 Start to retire "alias" in favour of "symbol" and "derived symbol".
Note: terminology changes only.  No (intentional)
functional changes.
2025-02-24 11:08:29 +00:00
Jon Evans
0ca9791577 Fix some GCC build warnings 2025-02-14 22:20:20 -05:00
Wayne Stambaugh
f45915ba93 Eeschema folder housekeeping. 2025-02-06 09:47:00 -05:00
Seth Hillbrand
919931f0f0 Get embedded files panel working for lib_symbol
The symbol library embedded files were implicit, which made them hard to
work with.  Adding the panel makes it clearer and setting the panel
correctly to the callback ensures that the structure is updated on
close.

Adds some copy/move semantics for EMBEDDED_FILES to take advantage of
how the multiple copies are handled in the library editor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18935
2025-01-28 12:22:39 -08:00
Jeff Young
e19bce2f93 Reduce reliance on MANDATORY_FIELDS and their implied order. 2025-01-22 17:51:57 +00:00
Jeff Young
a0dd0485e9 Pull a little harder on the MANDATORY_FIELDs string.
We still conflate the fieldID, the position in the
array of fields, and whether or not that means the
field is mandatory.  But this attempts to clean up
*some* of that, without introducing too much risk.
2025-01-21 16:48:13 +00:00
Jeff Young
d50b69f1ae Reconcile divergence of MANDATORY_FIELDS between symbols and footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19697
2025-01-21 13:28:28 +00:00
Seth Hillbrand
3a5eeef9df Auto update list of fonts when embedding files
Get the list of currently used fonts to populate the list of embedded
files when the user checks the "embed fonts" checkbox
2025-01-16 18:07:07 -08:00
JamesJCode
35172fe402 Guard against null m_part in erc TextVar checks
Also removes duplication of LIB_SYMBOL dummy() construction methods

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19575
2025-01-10 00:13:53 +00:00
Jeff Young
76d4ef3971 Implement AutoplaceFields() for LIB_SYMBOL.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19247
2025-01-02 11:03:45 +00:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Jeff Young
7da8b42206 Push more functionality to SYMBOL.
(This will allow us to run the fields autoplacer on SYMBOLs,
including LIB_SYMBOLs.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19247
2024-12-22 20:21:24 +00:00
jean-pierre charras
49fffd94d4 EEschema, export to clipboard: fix in correct drawings:
Fix incorrect symbol body color
fix broken arcs.
2024-11-22 12:52:24 +01:00
Jeff Young
b8819b4636 Another reduction in asserts. 2024-07-19 22:11:56 +01:00
Seth Hillbrand
77797103f7 Add ability to embed files in various elements
Schematics, symbols, boards and footprints all get the ability to store
files inside their file structures.  File lookups now have a
kicad-embed:// URI to allow various parts of KiCad to refer to files
stored in this manner.

kicad-embed://datasheet.pdf references the file named "datasheet.pdf"
embedded in the document.  Embeds are allowed in schematics, boards,
symbols and footprints.  Currently supported embeddings are Datasheets,
3D Models and drawingsheets

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6918

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2376

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17827
2024-07-15 16:06:55 -07:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00
Mike Williams
a5e2615251 Revert "SCH/LIB SYMBOL: never allow null LIB_SYMBOLs in SCH_SYMBOL"
This reverts commit 0b187e71227d2129d271f24fb92ae0b99b6f93bd.
2024-06-12 13:30:29 -04:00
Wayne Stambaugh
74070afbc6 Fix a bunch of GCC build warnings compiling the schematic editor.
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.
2024-06-11 08:07:32 -04:00
Mike Williams
0b187e7122 SCH/LIB SYMBOL: never allow null LIB_SYMBOLs in SCH_SYMBOL
Also always always flatten incoming lib symbols.
2024-06-10 08:36:42 -04:00
Wayne Stambaugh
360d185e3b Clear parent symbol references when flattening derived library symbols.
Broken parent symbols could lead to invalid return values and flattened
library symbols cannot be derived from a parent symbol.
2024-06-06 18:53:27 -04:00
Seth Hillbrand
79a354bf0e Unify SCH_PIN ambiguity in equality operator
Remove != operator that is not used for C++20 and reworked
SCH_PIN==SCH_ITEM operator that was not reciprocal
2024-05-31 13:42:36 -07:00
Jeff Young
ac59a65d8d Resolve variables in LIB_SYMBOLs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18099
2024-05-29 22:52:55 +01:00
Jeff Young
95136494b3 RIP LIB_PIN. 2024-04-20 12:10:31 +01:00
Jeff Young
d761b4f22f RIP LIB_TEXTBOX and LIB_SHAPE. 2024-04-16 16:31:16 +01:00
Jeff Young
3efe504dcc Collapse LIB_TEXT into SCH_TEXT. 2024-04-16 16:31:16 +01:00
jean-pierre charras
b7f035964f Fields in symbols: Ensure visibility is correctly set when reading a file
Also ensure default fields visibility is correctly set when creating a symbol
Change default field visibility to true in SCH_FIELD Ctor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17767
2024-04-15 18:19:19 +02:00
Jeff Young
d77eae3e7e Collapse LIB_FIELD into SCH_FIELD. 2024-04-13 15:42:13 +01:00
Seth Hillbrand
ac5fab190e Check for valid shared pointer before locking
We don't neccesarily have a valid pointer to the parent lib symbol when
checking if it is a power symbol, so fall back to the local flag if this
is the case

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17182

(cherry picked from commit 4481fcc75eb152ac9c05f4be50cc593cfcb0e03e)
2024-04-11 14:43:27 -07:00
Jeff Young
e7493c7851 Fix SCH_SYMBOL's operator=.
Also cleans up a few loose ends from LIB_ITEM collapse.
2024-04-08 21:24:32 +01:00
Jeff Young
9c94967b52 Tidy renderSettings / jobsHandler APIs. 2024-04-08 12:26:56 +01:00
Jeff Young
5abc7145da Fold LIB_ITEM into SCH_ITEM. 2024-04-08 10:24:50 +01:00
Jeff Young
968ca7c5c3 SNR 2024-04-08 10:10:24 +01:00