464 Commits

Author SHA1 Message Date
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
Jeff Young
95136494b3 RIP LIB_PIN. 2024-04-20 12:10:31 +01:00
Seth Hillbrand
4e6a3a50fc Flip labels to match orientation
When changing from local to hierarchical or global, the label style is
typically flipped so that global/hierarchical labels hang off the line
while local labels are set on top.  To make this more intuitive we flip
the initial orientation when changing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17739
2024-04-19 16:09:30 -07:00
Jeff Young
d761b4f22f RIP LIB_TEXTBOX and LIB_SHAPE. 2024-04-16 16:31:16 +01:00
Jeff Young
d77eae3e7e Collapse LIB_FIELD into SCH_FIELD. 2024-04-13 15:42:13 +01:00
Jeff Young
1aa59b806c Allow selection promotion when editing wrong field type.
Also fixes a bug where a CHT_MODIFY on a parent symbol with a
selected child doesn't trigger a selection modified event.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17696
2024-04-09 13:40:18 +01:00
Jeff Young
5abc7145da Fold LIB_ITEM into SCH_ITEM. 2024-04-08 10:24:50 +01:00
Jeff Young
c5ed80af52 Harmonize rotate APIs. 2024-04-06 09:34:56 +01:00
Wayne Stambaugh
797ab998cc Maintain hierarchy navigator expansion state between edits.
Prevent the hierarchy navigator from being rebuilt unless there are actual
sheet changes that would cause a change to the tree.

Save the tree expansion state before rebuilding the tree and then restore
the expansion state to the previous state sans edits.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16635
2024-03-17 09:02:26 -04:00
Seth Hillbrand
0f57d76ecd Clean and standardize cross-probing action
Between schematic and pcb editors, we want the following actions:

- Single click on ERC/DRC item should show the item in the ERC/DRC
  window.  But if the window is not visible, it should only update the
  status bar
- Double click on ERC/DRC item should show and raid the ERC/DRC window
  as well as select the line item

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17383
2024-03-11 17:50:44 -07:00
Jeff Young
1bf24da385 Schematic editor Table Properties and commenting for QuasiModal usage. 2024-03-10 12:18:50 +00:00
Wayne Stambaugh
c5a02fc266 Do not update schematic connectivity for irrelevant property changes.
Prior to this change, the schematic connectivity was updated any time a
change was made to a connectable object.  Now the connectivity is only
updated when an object change actually affects the connectivity.  Other
properties like line width, fill type, custom fonts, etc. will not cause
the connectivity graph to be rebuilt.

The SCH_COMMIT flag SKIP_CONNECTIVITY has been removed.  All schematic
objects can test if they are connectable and if there have been changes
to any connection properties that require a connectivity rebuild.

Remove duplicate rebuild connectivity calls from editor control tool.
This was causing the tangling end test to get called four times on every
undo and redo action because the dangling end test is already called in
the connectivity graph calculation code.

Update connectivity when changing label names which fixes an unreported
connectivity bug.
2024-03-09 08:50:26 -05:00
Jeff Young
c97c69a2f0 First alt-pin menu item must be fetched from the LIB_PIN.
(The SCH_PIN will return any alt function already assigned.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17221
2024-03-02 12:17:22 +00:00
Jeff Young
aef87b9796 Push thickness handling down into EDA_TEXT::SetBold().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17077

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14875
2024-02-25 17:28:52 +00:00
Jeff Young
fa0ead98d8 Split out table editing and table cell editing. 2024-02-24 20:05:51 +00:00
Jeff Young
4eefbc7815 ADDED: textbox and tablecell margins.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10672

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6806
2024-02-24 20:05:51 +00:00
Jeff Young
e445249720 ADDED: PCB tables. 2024-02-24 20:05:51 +00:00
Jeff Young
91df43c97a ADDED: schematic tables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6806
2024-02-24 20:05:50 +00:00
Jeff Young
4a9df1e18e ADDED: actions for left-, center-, and right-justifying text items.
(For both PCBNew and EESchema.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12375
2024-02-24 20:05:50 +00:00
Jeff Young
da46a96623 Update a few strings based on new string freeze policy. 2024-02-05 15:49:57 +00:00
Jeff Young
c0cbaa4c53 Finish earlier commit that somehow escaped my notice.
(String is existing.)
2024-01-27 15:55:05 +00:00
jean-pierre charras
ad1a929404 Do not mark an empty string as translatable
It is not accepted by our tools
2024-01-27 09:06:03 +01:00
Jeff Young
ceb8beb8c4 Move ChangeBodyStyle and CleanupSheetPins to SCH_COMMIT.
Also fixes a bug where showDeMorganAlternate didn't work
at all.
2024-01-26 22:29:51 +00:00
Jeff Young
ae735d3eb4 Renaming: replace convert with body-style.
No functional changes.
2024-01-26 16:21:03 +00:00