437 Commits

Author SHA1 Message Date
Jeff Young
5996cffabc EE -> SCH (no functional changes) 2025-03-13 13:15:47 +00: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
Jeff Young
c5bb59468d Get rid of assumptions about field order. 2025-02-24 11:08:29 +00:00
Seth Hillbrand
0144352132 Remove unused captures 2025-02-11 09:50:23 -08:00
Seth Hillbrand
7717c1e7d9 Fix menu display of symbol attributes
Menu should display the current attribute of the selection and allow
changes, rather than three different options on set/unset/toggle.
2025-02-11 09:24:49 -08:00
Ian McInerney
7bf40b82d0 Use correct bitmap for body style menu
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19416
2025-02-09 00:58:16 +00:00
Jeff Young
25379b3094 Honour hover selections. 2025-01-27 20:30:45 +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
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
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
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
Jeff Young
5b03426e28 Update attributes across units.
It's possible you might want Exclude from Sim to be unit-specific,
but it's pretty hard to imagine how Exclude from Board, BOM,
or DNP could be unit-specific.  (Maybe use a pill cutter on the chip?)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19029
2024-12-21 12:17:00 +00:00
Wayne Stambaugh
424438ace1 Convert remaining schematic undo/redo calls to commit system.
The schematic commit system currently does not handle renaming symbols
in the symbol library editor or page settings in the schematic editor.
The schematic commit system will have to be modified to support the two
remaining direct calls to the undo/redo code.
2024-12-20 09:54:24 -05:00
Jeff Young
2926db778c Bug fixes for rotated tables. 2024-12-16 13:26:48 +00:00
Jeff Young
753d385473 Reduce dependency on dynamic_cast.
Also switches to checking __clang__ instead of __WXMAC__.
2024-12-08 21:46:54 +00:00
Wayne Stambaugh
8498889da2 Show save modified dialog on schematic sheet file rename.
Renaming a schematic sheet file can not be undone so it doesn't go
through the commit system.  This meant that the schematic modified
flag was not getting set.  If the only edit performed was renaming
a sheet file, the save modified flag would not get displayed when
closing the schematic editor.
2024-12-02 08:39:08 -05:00
Wayne Stambaugh
302dfb4623 Fix crash when changing sheet file name and search panel is visible.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19232
2024-12-01 13:09:59 -05:00
John Beard
e9014bc27b Eeschema: show which units are already placed in the context menu
Otherwise it's annoying to fingure out 1) i you're missing any
and 2) if you change one, are you going to stomp on something?
2024-10-27 05:13:32 +08: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
John Beard
2c2ff64911 Allow incrementing different parts of strings with modifiers
Primary increment is the right most bit, secondary is the next
rightmost. So you can increment 'A1' to 'A2' or 'B1' with
Shift-Alt-Scroll and Ctrl-Alt-Scroll respectively.
2024-10-26 16:01:07 +08:00
John Beard
3f602f8177 Add 'Increment' actions
These are context sensitive actions that increment "something"
about the selected item.

A generic 'increment' action can be produced, e.g. by other tools
or UI events, which has in increment step (positive or negative)
and an 'index' which determines what about the item should be
incremented - it's up to the increment action handler to decide
what that means.

And then add a primary and secondary inc/decrement action,
which allows to bind hotkeys to each.

Bind these to:

* Sym edit: increment pin names/number
            increment text items
* Sch edit: increment lables and text
* FP/PCB:   increment pin numbers
            increment text items
2024-10-26 15:46:16 +08:00
John Beard
b0043587c2 Add 'Copy as Text' action
This is useful when you want to copy text content out to some
external program (or put it in a text item/box).

I'm not sure it's possible to intuit exactly what a user wants,
as you will often want to copy items as the real items, and sometimes
as text. While KiCad might be able to make a smart guess, external
programs will have no chance!
2024-10-13 20:47:45 +08: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
John Beard
7214a108e4 Text alignment: add a flip function
Reduces the need for client code to know it can exploit the
enum -1/+1 properties. ToHAlignment provides an explicit
contract for integral conversion, and also doesn't rely on the
int being exactly -1, 0 or 1 (failure to adhere to which would
be UB).
2024-10-08 23:30:50 +08:00
JamesJCode
daa1bc3e78 Remove unneeded static_casts 2024-10-04 00:35:14 +01:00
JamesJCode
e2e4b47310 Promote move / drag / properties events on pins to parent symbol 2024-10-03 20:18:23 +01:00
Wayne Stambaugh
90e2dc78b1 Update hierarchy navigator when sheet schematic file is changed. 2024-10-03 12:07:55 -04: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
Mike Williams
bf7742b8fb schematic: grid/movement tweaks for repeat and duplicate symbols
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18521
2024-09-12 10:03:48 -04:00
Mike Williams
2c99bc6c6d new feature: Schematic Design Blocks
Added to advanced config, default to off.
EnableDesignBlocks=1 in kicad_advanced to test

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2263
2024-09-05 08:35:49 -04:00
jean-pierre charras
8f348820f3 EEschema: fix crash when repeat an item (ins key), due to a null parent
A recent change set the parent member of a item put in the repeat list to
nullptr (this is OK) but the code to copy an item from this list did not
update this parent member.
2024-08-31 18:04:41 +02:00
JamesJCode
222d48d639 Traverse to parent symbol when editing symbol-relevant fields on a pin 2024-08-27 21:36:51 +01:00
Jeff Young
3833922c35 Support Body Style changes in context menus.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18416
2024-07-20 20:39:45 +01:00
jean-pierre charras
d933a8d6a9 Fix minor compil warnings 2024-07-12 12:43:49 +02:00
John Beard
bb100994a7 Eeschema: swap label rotations (and include fields)
This means that labels keep the position relative
to what they are connected to after the swap.

An attempt is made to map the fields of a label
into the position of a matching field (i.e. same name)
on the swapped-to label.

Move the SCH_FIELD rotation justification
handling to the SCH_FIELD class, so it's not just
SCH_LABEL that handles it.

https://gitlab.com/kicad/code/kicad/-/issues/18303
2024-07-10 21:37:27 +08:00
JamesJCode
c05dd18613 Don't reset sheet / screen file names if cancelling repeat insert
in recursive state

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18199
2024-07-09 20:27:01 +01:00
Ian McInerney
cc81ccf79a Display unit name in symbol context menu
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18285
2024-06-27 19:57:14 +01:00
Jeff Young
c549a214c9 Performance: don't alloc std::vector in critical areas.
For some history, see also aa2ad3b44c3e533cf00a5077db17fb0ee7e302eb
2024-06-21 19:07:46 +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
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
Jeff Young
edc7603d2a Make it clear that GetSheets() is heavy.
Also removes the side-effect that SCH_SHEET_LIST's
c'tor would sort the list (and write virtual page
numbers) anytime the starting sheet was the root.

Also, definitely don't build a SHEET_LIST (sorted or
otherwise) if you're not even going to use it.

Also don't build SCH_SHEET_LISTs on idle events.  Better
to just always have the Next Sheet button enabled (we
already beep if you click it and there's no next sheet).

Also, use a SCREEN_LIST when you can.  It's much cheaper
to create.
2024-06-06 18:00:59 +01:00
Mike Williams
32289ffce7 schematic: fix broken undo of sheets, new and changed
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11855
2024-06-03 13:45:52 -04:00
Jeff Young
6cc534182a Simplify rotation code. 2024-05-12 23:22:13 +01:00
Jeff Young
20cde51b43 Fix numerous bugs in schematic item rotation.
(This will probably introduce some new ones too, but
it was so broken it's hard to know where to start.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17921
2024-05-12 20:43:08 +01:00
Jeff Young
a99377c1ec The user can cancel the opening of many editors.
Don't play dice with the devil.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17989
2024-05-08 18:21:42 +01:00
Jeff Young
44717f927c Fix rotation of selection in schematic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17921
2024-05-03 21:14:26 +01:00
Jon Evans
dffb2c1994 Pin helpers can help sheet pins also
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17923
2024-05-01 21:53:14 -04:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
James J
be8744176c Add SCH_RULE_AREA shapes to eeschema
Includes:
 - Fix GAL to draw closed polygons in eeschema
 - Add functionality to eeschema to draw arbitary polygons
 - Update polygon item previews to have customisable edge colour
 - Add new SCH_RULE_AREA class, derived from a poly SCH_SHAPE
 - Add SCH_RULE_AREA to paint and plot methods
 - Add new rule area color preference to themes
2024-04-25 14:24:46 +00:00