323 Commits

Author SHA1 Message Date
Bernhard Kirchen b49c6e1362 resolve trivial compiler warnings
introduced in 0f343a0abc and 92bb000ce6.
2026-03-09 20:48:33 +00:00
Jeff Young 92bb000ce6 Implement variant processing for text var resolution.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23355
2026-03-08 12:26:28 +00:00
Jeff Young 04d9425116 Allow clearing of a variant field.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23155
2026-02-24 13:58:41 +00:00
Seth Hillbrand 6c9c75eb07 Remove property.h and property_mgr.h from inspectable.h
This breaks the view_item.h -> inspectable.h -> property.h chain that
pulled wx/propgrid/property.h into 150-200 TUs. The lean inspectable.h
now includes only wx/any.h, wx/string.h, wx/variant.h.

Headers using DECLARE_ENUM_TO_WXANY (board_item.h, sch_item.h) retain
their property.h include since the macro requires it.
2026-02-13 19:54:46 -08:00
Jeff Young fc1fb61734 Fill in some missing tests in SCH_SYMBOL operator==. 2026-02-09 21:10:48 +00:00
Damjan 2d9b8c16e5 Fix DNP variant handling in schematic plotting and UI display 2026-02-02 09:50:59 -08:00
Jeff Young f7b20c3c7e Reduce number of places a non-const SCH_PIN escapes a const context.
GetLibPins() and GetAllLibPins() are still serial offenders, but
this is like pulling on a piece of string....
2026-01-30 19:15:57 +00:00
Jeff Young daf13adabb Fill in some missing variant code.
In particular:

Resolving the DNP/InBOM/OnBoard/etc. flags needs to take into account
the variant.

Writing a SPICE netlist needs to take into account the variant.

Updating a simulation tuned value needs to write to the current
variant (this is only partly implemented, with a TODO for the hard
part).

Painting of fields needs to paint the current variant value.

Still missing is reading/writing fields from the simulation model
dialog to/from the current variant.
2026-01-28 21:45:20 +00:00
Seth Hillbrand aa335bee80 Add GetPinsByNumber for duplicate pin handling
Symbols with the "duplicate pin numbers are jumpers" flag can have
multiple pins sharing the same number. The existing GetPin() method
only returns the first match, causing operations like setting pin
alternates to miss subsequent pins with the same number.

This adds GetPinsByNumber() to both LIB_SYMBOL and SCH_SYMBOL that
returns all matching pins. Updated callers in dialog_symbol_properties,
sch_symbol sync, and the CADSTAR/EasyEDA Pro importers to iterate
over all matching pins instead of just the first.

Also skips the duplicate pin ERC check for symbols with the jumper
flag set, since duplicate pins are intentional in that case.
2026-01-26 08:58:08 -08:00
Seth Hillbrand fa1f2274d6 Eeschema: Fix DNP propagation to all units with non-default variants
The SyncOtherUnits() function was not passing the variant name when
propagating DNP changes to other units of a multi-unit symbol. This
caused the default DNP value to be used instead of the variant-specific
value, resulting in DNP changes not propagating when a non-default
variant is active.

Add variant parameter to SyncOtherUnits() and pass it through to
GetDNP() and SetDNP() calls. Update all callers to provide the
current variant name.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22763
2026-01-19 09:02:22 -08:00
Wayne Stambaugh d426c74b7a Minor code housekeeping. 2026-01-10 15:02:11 -05:00
Seth Hillbrand 6bad3c58e1 Added: PCB Variant support
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2131
2026-01-05 17:47:39 -08:00
Seth Hillbrand c385767cd3 Update schematic variants 2026-01-05 17:45:04 -08:00
Seth Hillbrand 465207df4a Prevent crash when updating to lower pin count
When iterating, we need to check if our index is valid for both new and
old symbols

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22566
2026-01-04 06:23:02 -08:00
Seth Hillbrand 8d37b3787d Don't clear references unconditionally
If we are clearing all references in the schematic, then we can clear
our references, otherwise, just eliminate the ones for the proper
sheets.   We don't want to clear the references on Sheet A when we copy
and paste it to Sheet B.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20173
2026-01-02 14:13:13 -08:00
jean-pierre charras 94e654c91c schematic & symbol editors: fix duplicate property attribute in properties panel
Attributes Exclude from Board was shown twice in editors.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22592
2026-01-01 15:04:31 +01:00
Wayne Stambaugh 1832d226bd Add undo/redo support when deleting variants. 2025-12-31 14:03:05 -05:00
Wayne Stambaugh ca0bfe0bba More schematic variant work.
Everything in the variant handling should be working with the exception of
the job handling and command line interface.
2025-12-30 11:11:33 -05:00
Magnus Lundmark 20800608c1 show unresolved errors 2025-12-04 13:12:24 +00:00
Magnus Lundmark a0ec1a667d WIP: Multi-unit text variable expansion (not working - parsing issues) 2025-12-04 13:12:24 +00:00
Magnus Lundmark cdc1c417ff added table export, try to fix escaped expression uuid bug 2025-12-04 13:12:24 +00:00
Magnus Lundmark 26531bb25d Add text variable functions and recursive expansion for tables 2025-12-04 13:12:24 +00:00
Magnus Lundmark f47ec5f5d4 Eeschema: Add multi-unit symbol support for text variables
Add enhancements to make working with multi-unit symbols easier,
particularly for connector pinout tables.

New features:

1. UNIT(<pin_number>) function
   Returns the full unit reference for a given pin number.
   Example: ${J601:UNIT(1)} returns "J601A" if pin 1 is in unit A.

2. Parent reference support in cross-references
   Enables using parent reference (J601) instead of full unit reference
   (J601A) in text variable expressions.
   Example: ${J601:PIN_NAME(1)} now works (previously required ${J601A:PIN_NAME(1)})

3. Auto-resolution across units
   PIN_NAME, NET_NAME, NET_CLASS, and SHORT_NET_NAME functions now
   automatically search all units if a pin is not found in the current unit.

4. NC display for unconnected pins
   SHORT_NET_NAME now displays "NC" instead of "unconnected-(Ref-Pin_X)",
   making tables cleaner. NET_NAME still shows the full technical name.

Implementation:
- Enhanced SCHEMATIC::ResolveCrossReference() to add reference-based
  lookup as a fallback after UUID resolution
- Added UNIT() function to SCH_SYMBOL::ResolveTextVar()
- Modified SHORT_NET_NAME handling to detect and format unconnected nets
2025-12-04 13:12:24 +00:00
Jeff Young 161697d81c Cleanup. 2025-11-14 15:17:35 +00:00
Wayne Stambaugh 0979f5c41d Fix saving schematic symbol DNP setting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22188
2025-11-01 15:31:04 -04:00
jean-pierre charras ed0cd4706a Eeschema: Add the plot functions needed to plot the "Local Power" icon
It was previously added, but only in one place, and there are two places
to plot field value and its associated local power icon.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22095
2025-10-30 10:28:02 +01:00
Jeff Young 5e41d63bd0 Resolve text variables in descriptions and keywords.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22146
2025-10-29 12:33:09 +00:00
jean-pierre charras 6bd1303322 Eeschema: fix minor issues when drawing the "Local Power" icon near symbol value.
Also add the plot function needed to plot this icon

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22095
2025-10-25 17:40:03 +02:00
Seth Hillbrand ac8914e46e ADDED: Ability to create flat-type schematics
Allows multiple, top-level schematic sheets.  Records of the sheets are
stored in the project file.  All top-level sheets live under a virtual
root sheet in the hierarchy.  This virtual root is suppressed for export
and general visibility

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2063
2025-10-14 16:07:44 -07:00
Jeff Young 9e86ebbeeb Remove structurally dead code. 2025-09-28 23:02:18 +01:00
Jeff Young 3f1999795c Fix latent bug in UpdatePins().
(It was failing to update the unit and bodystyle.)
2025-09-27 21:54:38 +01:00
Jeff Young 7d6d9c535d Coverity fixes.
Initialize scalar variable.
Make use of new move operators.
Don't copy std::shared_ptr when we don't have to.
2025-09-27 18:15:48 +01:00
Jeff Young 19133bc6bd Honour alternate pin definitions.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21618
2025-09-27 13:09:04 +01:00
Jeff Young d140261ab1 Formatting. 2025-09-27 13:09:04 +01:00
Wayne Stambaugh 33ead34ea5 Work in progress variant code commit.
Please do not attempt to use this yet as it is a work in progress.  Given
large number of merge conflicts, I pushed this partial commit to save time
rebasing.

All of the user interface is hidden behind the "EnableVariantUI" advanced
configuration flag until variants are ready.
2025-09-26 08:54:08 -04:00
Seth Hillbrand 3f8abe3744 Update properties to show units
The function duplicated our built-in funcitonality and did not properly
handly outputs

Fixes https://gitlab.com/kicad/code/kicad/issues/21685
2025-09-09 06:39:39 -07:00
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
Seth Hillbrand 173e02eff7 ADDED: Lasso support to Schematic Editor 2025-09-03 06:45:49 -07:00
Jeff Young c6fcf7e0b8 Allow easier code searching for property names. 2025-08-30 19:09:15 +01: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
Seth Hillbrand a77e1027d6 Fix QA error.
When updating the symbol, we clear the libpins, so remove it to avoid
getting garbage while updating
2025-08-22 12:53:43 -07:00
Seth Hillbrand 7201918383 Track alt pin changes
Make sure that we are following the lib changes when updating

Fixes https://gitlab.com/kicad/code/kicad/issues/21202
2025-08-20 19:49:13 -07:00
JamesJCode 91139fe24f Fix sausage-fingers in comment 2025-08-18 20:36:01 +01:00
JamesJCode ee9e94df04 Don't assume SCH_SYMBOLs have a LIB_SYMBOL when resolving embedded files
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21497
2025-08-18 20:30:33 +01:00
Mark Roszko 5895c27f4a Rename Prj() on schematic to avoid conflict with global function 2025-08-07 23:21:41 -04:00
jean-pierre charras 410a43a602 Try to fix an ambiguous cast for MSVC (round 3) 2025-07-23 19:33:36 +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
Alex Shvartzkop 4a5039c2cf Remove some unused variables. 2025-07-02 16:48:26 +03:00
Jeff Young 26f8f1cdd1 Allow pin autoplacer to run on symbol not yet in schematic (KICAD-JMA). 2025-06-30 21:54:22 -06:00
Jeff Young be120b4821 Nullptr safety (KICAD-6K6). 2025-06-27 22:59:12 -06:00