346 Commits

Author SHA1 Message Date
Mike Williams
2abeb5cb49 sch design blocks: add suffix to grouped and repeated placements 2025-08-20 15:20:13 -04:00
Jeff Young
6f389fd320 Tighten parent/child undo/redo architecture.
Always look for pre-existing undo/redo record.  Checking for IsNew()
is less robust and should be avoided.  Also moves the checking to a
location where it will be easier to ensure that it's uniform.

Push get-undo-level-item processing down a level so it is uniformly
called.

Make sure tables & labels are uniformly handled.

Remove incorrect usage of Get/SetGroupId() for storing lastPin
(which we don't use anyway).

Lists of deleted and changed items MUST include the screen pointer.
An item could be changed on one screen but not on another.

Also tightens handling of PCB_NETINFO_T items, which are not in the
view.

Also fixes a bug where there is no increment parameter if you assign
the base increment command to a hotkey.
(This was discovered while testing the above changes.)

Also fixes a bug where delete during a move in PCB Editor did an
undo instead of a delete.
(Again, found while testing above.)

An experiment was also run to collapse shared parts of SCH_EDIT_FRAME
and SYMBOL_EDITOR_FRAME into SCH_BASE_EDIT_FRAME.  However, sharing the
undo code actually increased complexity, and there was very little else
of value in SCH_BASE_EDIT_FRAME (other than the Increment() routines).
2025-08-18 19:20:09 +01:00
Seth Hillbrand
188ffda029 Add a 90°-only mode for polygon creation
Sometimes, you don't want those 45° corners in your nice, clean zones.
This adds an additional mode that can be selected, cycling through
free-angle, 45° angle and 90° angle constraints
2025-08-12 16:48:36 -07:00
Seth Hillbrand
87ccb2abc0 Move Annotation preferences (most) to schematic setup
The scope, recursion, reset options and message filters remain in the
user preferences.  Others including numbering, sort order and reuse are
schematic preferences.

Also, the oddball subunit display remains here but it doesn't really
belong in annotation.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17942
2025-08-12 16:15:17 -07:00
Jeff Young
833a5ee3ab Yet even more open-coded dialog state-saving cleanup. 2025-08-11 20:36:23 +01:00
Seth Hillbrand
15166a9f14 Refactor REFDES_TRACKER
Keep state for reuse in the class.  This allows us to properly pick the
value when fully reannotating

Don't annotate when placing new units.  Just step ahead in the unit
value while keeping the refdes number constant.  This eliminates the
jumping around to unplaced units when placing new multi-unit symbols

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21378
2025-07-25 16:16:09 -07:00
Seth Hillbrand
e387953490 ADDED refdes tracker
Provide an option to track ever reference designator ever used in the
project to prevent its reuse even if the component has been removed

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13052
2025-07-23 14:28:33 -07:00
Jeff Young
5fb40f152c Make auto-created labels work with new multi-create architecture.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21306
2025-07-17 18:28:33 +01:00
Jeff Young
b498ca0376 Commit messages are title caps.
(They appear in the Undo menu.)
2025-07-12 15:53:17 +01:00
Jeff Young
a7319bfcd0 Tool loop safety. 2025-07-03 20:01:35 -06:00
Jeff Young
e48d746bbb Must show a dialog for it to be useful. 2025-06-25 15:51:53 -06:00
Jeff Young
9add4a39c8 Must call SetPassEvent() for event to run in its own loop.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19805
2025-06-25 15:33:12 -06:00
Jeff Young
ac6e38fe2c Formatting. 2025-06-25 15:17:53 -06:00
Jeff Young
f76608c0da Nullptr safety. 2025-06-09 12:54:30 +01:00
Jeff Young
1968d67bf3 Prefer const& to passing by value. 2025-06-06 18:28:39 +01:00
Marek Roszko
1da8ddbadd Move CleanUp to SCHEMATIC 2025-06-04 20:33:48 -04:00
Jeff Young
96dfff2f07 Better solution to memory leaks. 2025-05-25 11:19:09 +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
Seth Hillbrand
2e357fbfa0 Protect tool against null selection 2025-05-14 16:43:17 -07:00
Mike Williams
d2f0a13515 groups/design blocks: add lib link to groups from design blocks
Also add Place Linked Design Block function.
2025-05-13 10:41:32 -04:00
Mike Williams
9ca881112b design blocks: as place as group functionality to schematic 2025-05-06 11:29:42 -04:00
Jeff Young
b01fef5ca8 Update visibility flag when adding fields.
Also removes extra c'tor which fails to set the
ordinal.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20556
2025-04-26 16:37:36 +01:00
Mike Williams
40058ebe80 actions: move all basic selection operations to common actions 2025-04-02 12:02:01 -04: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
Mike Williams
e11cf94a3e design blocks: add PCB design blocks behind advanced config
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2508
2025-03-20 15:13:52 -04:00
Jeff Young
5996cffabc EE -> SCH (no functional changes) 2025-03-13 13:15:47 +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
Seth Hillbrand
6f6ca2a35f Allow multi label input
This is a re-implementation of 39c2745f55fff72470ca1ea86ac7b1ea225908bd
that was removed by e5089d783d08f75e57b3ea90ed64a089e5b07b0b

This implementation works in the tool, containing side effects
(hopefully) better than the initial implementation.  The multiple labels
are input as multiple lines instead of labels with spaces, allowing for
copy/paste between spreadsheets of labels

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10950
2025-03-03 09:03:02 -08:00
Seth Hillbrand
b21814b973 Global labels are labels too
And without knowing that they are labels, we might accidentally think
that they are text items, crashing KiCad.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20174
2025-03-01 13:34:32 -08:00
Dhineshkumar S
20c72504c3 Eeschema: Import and auto place all sheet pins
https://gitlab.com/kicad/code/kicad/-/issues/6736
2025-02-26 21:24:02 +00:00
Jeff Young
c5bb59468d Get rid of assumptions about field order. 2025-02-24 11:08:29 +00:00
Jeff Young
d921a4e916 Switch to using unit names in property inspector. 2025-02-19 23:43:53 +00:00
Damjan
46ada43166 Eeschema: Import sheet pins: sort pin names intelligently 2025-01-29 04:16:35 +00:00
Jeff Young
fccb661487 More MANDATORY_FIELDS work.
Also fixes a crasher when Cancelling a FIELDS_GRID
dialog with one of the grid editors currently open.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19762
2025-01-27 17:02:17 +00:00
John Beard
d55877ce27 Increment tool: use parent commit when appropriate, avoid double preview
Cloning the item into the previewe means that if we later increment
it, the preview clone doesn't update. Use the non-owning preview
interface to use the item directly in the preview.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19433
2025-01-15 00:26:09 +08:00
Jon Evans
6858561731 Fixes for building against recent wxWidgets 3.3 2025-01-09 08:38:49 -05: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
John Beard
85552c7a4f SVG import: import beziers as beziers
This maintains a little bit more editability and avoid importing
thousands of tiny line segments when not required.
2025-01-01 01:14:41 +08:00
Ethan Chien
b03c591a4b Sync Sheet Pins: Synchronizes all selected rows. 2024-12-31 02:58:35 +08:00
Ethan Chien
dea53b7b60 Sync Sheet Pins: Add checks for empty sheet paths and display an info message when no sub schematic is found 2024-12-30 13:45:50 +08:00
Jeff Young
bcf810b05c Formatting. 2024-12-27 18:59:22 +00:00
Ethan Chien
bf2094dd8a Place Sheet Pins: Restore the behavior to match the original Import Sheet Pins tool. 2024-12-26 19:34:59 +08:00
Wayne Stambaugh
75365e8b71 Schematic hierarchical sheet improvements.
* Ensure hierarchy navigator history iterator is valid before removing
  history list entries.  This fix prevented a crash in the 8.0 branch.

* Purge consecutive duplicate hierarchy navigator history entries.
  Navigating to the same sheet path doesn't make sense.

* Don't rebuild hierarchy navigator tree twice when creating new sheet.

* Remove unused sheet property dialog commit code.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18778
2024-12-24 09:50:10 -05:00
Jeff Young
eee28aa06a Clean up fields autoplacement control architecture.
Also adds a mode for AUTOADDED fields.

Also fixes a couple of bugs where a manual-level autoplaced
symbol would get reset back to auto-level when autoplaced.
2024-12-23 14:30:17 +00:00
Mike Williams
018d02eb02 design blocks: copy sheet to project dir instead of linking 2024-11-06 13:39:38 -05:00
John Beard
1a2c84eb76 Eeschema: add 'place next unit' action
This makes a new symbol with the lowest unplaced
unit number and enters the PlaceSymbol action
(but only places that one unit)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18882
2024-10-27 05:13:24 +08:00
Martin Berglund
00c1f471e4 Eeschema: Reduced LoadSymbol calls in PlaceSymbol
Check early if a symbol is not unique - before calling SchGetLibSymbol
and in SchGetLibSymbol checks the cache before calling LoadSymbol.

This speeds up opening the symbol browser significantly when having lots
of symbols in the design that needs to be polled from a database

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18826
2024-10-24 22:59:49 +00:00
Wayne Stambaugh
a6923b3de3 Cache full schematic sheet list sorted by sheet page number.
The sheet list is returned as a copy of the cached list rather than a
reference to prevent external code from changing the list.  While not as
performant, it eliminates the risk of the sheet list being altered in
ways that could break the schematic.  The sheet list should only be
updated by calling SCHEMATIC::RefreshHierarchy() when any appropriate
sheet changes are made.

Note to developers: there is something inherently different about how the
QA tests are loading and handling schematics versus the schematic editor.
Using the cached sheet list for the SCHEMATIC object will cause some QA
test to fail.  This is why SCHEMATIC::Hierarchy() has not replaced
SCHEMATIC::BuildSheetListSortedByPageNumbers() everywhere.
2024-10-09 09:58:50 -04:00
JamesJCode
d64a112971 Implement Component Classes
- Adds Component Class field to SCH_DIRECTIVE_LABEL
- Adds SCH_SYMBOLs to SCH_RULE_AREA item lists
- SCH_SYMBOLs resolve Component Class directives
- Netlist exporter / importer handles Component Class names
- Adds DRC expressions and functions
- Adds QA check for component class netlist export
2024-10-01 22:36:18 +01:00
John Beard
460e575457 Use REFERENCE_IMAGE for SCH_BITMAP
Also wire in the transform origin handling to the point editor
and the properties panel in eeschema.
2024-09-30 10:20:20 +01:00