663 Commits

Author SHA1 Message Date
Jeff Young
234e4a2ae3 Rehash sheetpaths when changing sheet uuids.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19583
2025-01-10 16:01:12 +00:00
Jon Evans
7ce0f55305 Don't auto-save local settings when migrating
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19540
2025-01-08 08:43:28 -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
Marek Roszko
85413e2c9b Enable the close button on aui panes in eeschema
Works fine

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19372
2024-12-29 07:37:25 -05:00
Jon Evans
fb8d16439b Tie handler de-registration to window close
The handlers can't accept commands when the window
is closed, which can be (far) earlier than the actual
dtor of the frame

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19375
2024-12-26 18:26:06 -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
Wayne Stambaugh
425958d754 Add simple timer profiling to DRC engine.
Remove the PROFILE definitions from the incremental connectivity
profiling so a special build isn't required.  If the starting and
stopping the profile timer is excessive, we can add this back.

(cherry picked from commit 8a09e5f3c3ab185671a5944625e5f8b3ef4fb5c5)
2024-12-20 15:57:41 -05:00
Seth Hillbrand
6d99f62c96 Prevent events from firing in the main window during load
Closing the source window while another wx loop is running can lead to
async events being processed, leaving the current stack out of scope

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19341
2024-12-20 11:32:26 -08: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
Jon Evans
523fcc039f API: Move trace macro to utils 2024-11-28 11:28:06 -05: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
91dca89116 Eeschema: Add indicator icons for pins with alt modes
This makes it easier to see which pins have alt modes
available. There is an option to turn them off.

The icon positions are chosen so they they shouldn't
interfere as far as possible:

* If the text is inside, the icon goes more inside
  the body
* If the text is above/below the pin, it goes away from
  the body

This means it won't collide with a symbol wall in
most cases, but some symbols with alt pins on opposing
sides may need to be widened if the icons are show.

Includes a rather fiddly refactor of the SCH_PIN painter
function, which needs quite a lot of massaging to allow
it to figure out where an icon would go. Quite a bit
of logic is broken out into smaller encapsulations with
less visible state to each chunk.

Icon modes for base-name-selected and alt-selected are
included, but only the former works due to information
being thrown away during the SCH_PAINTER tempPin
process.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11069
2024-10-08 23:30:50 +08:00
Mike Williams
bfae4a99a4 editors: block paste while in tool in schematic/sym/page layout
PCB and footprint editors were already blocking this. Otherwise we would
get weird issues when pasting while drawing things like sheets or
textboxes that aren't selected while drawing.
2024-10-07 10:50:49 -04:00
JamesJCode
64c24fc04b UI consistency improvements 2024-10-02 19:44:48 +01:00
Mike Williams
953bc2d4bd design blocks: implement properties window
Also adds support for default fields when placing design blocks as a
sheet.
2024-09-26 15:48:39 -04:00
John Beard
109675f39e Eeschema: add bezier tool
This is a little more primitive than the pcbnew tool,
in the same way that the arc tool is also more primitive
(no interactive manager).

It works just about well enough to get the curves drawn,
but all these tools could do with some interactivity
in esschema and symbol editor.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/8828
2024-09-25 22:09:32 +01:00
Dhinesh
3f4257139e Prevent continuous panel resizing
When resizing the panel, it retrieves the last defined pane size
instead of the current one.  To fix this, we need to trigger the event a
second time after the pane size has been defined. This avoid calling
m_AuiPanels.Update() that crashes windows if called directly

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17835
2024-09-13 17:17:41 -07: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
Jeff Young
3441861988 Make arrow keys respect grid overrides. 2024-08-28 19:54:23 +01:00
Jeff Young
cfb93920ed ADDED: increment annotation.
Pushes the ref des numbers for matching prefixes starting
at a particular annotation.
2024-08-28 19:54:23 +01:00
Jeff Young
4601503660 Even the orphaned net must obey the min board clearance.
(And other Default netclass constraints.)
2024-08-28 19:54:23 +01:00
Jeff Young
6b22f86a54 Set current screen's sheet number before rendering.
Any first-page-only items in the drawing sheet will need
the number to be correct.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18317
2024-08-15 21:09:54 -06:00
James J
7ce00e511b Multi-netclass support 2024-07-26 20:49:29 +00: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
Seth Hillbrand
dab9580acd Fix a crash when adding wires in Schematic Editor
Not all UNDO_REDO items have screens associated with them.  We only care
about items that are added, changed or removed.  The others are
modifications to libedit, origins, page settings, groupings or the
repeat flag
2024-07-09 09:30:50 -07:00
Alex Shvartzkop
cabf7d4878 IPC_API: fix crash in PLUGIN_AVAILABILITY_CHANGED event handler (schematic)
Re-opening SCH while the PCB is open leads to crash.

Same as 441b2686d3150b1c3e0629c3d49857f1c47e3871, but for schematic editor.
2024-07-05 02:26:57 +03:00
Jeff Young
26b86b3922 Don't use wxLogMessage/wxLogError for messages not meant for user.
They are particularly damaging when our event loop
gets tied up in knots with the log message window
behind a modal window -- thereby locking up KiCad.
2024-06-24 20:22:29 +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
jean-pierre charras
d778cb6647 Schematic editor: fix some issues that can crash the editor on closing.
- Add a test to be sure a SCHEMATIC exists before trying to use it
- Delete items in Repeat list and undo/redo list before deleting the schematic
- Delete also these items when loading a new schematic (the repeat list was
not cleaned previously)
Before these fixes I see a use after delete issue due to dangling pointers
stored in Repeat list.
2024-06-14 16:57:57 +02: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
Jeff Young
e543ff0578 Performance for large hierarchies: lookups
Don't bother to sort sheet lists when we're just looking
up a UUID, sheet count, other symbol units, etc.
2024-06-06 11:52:57 +01:00
Seth Hillbrand
74998790e8 Turn off incremental connectivity for small schematics
The benefit of incremental connectivity is only for larger
schematics.  For smaller schematics, the downside of larger bug surface
outweighs the current benefits
2024-06-03 11:33:29 -07:00
Jeff Young
ec0fdfffff ADDED: markers for excluded-from-sim items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15382
2024-06-03 17:12:15 +01:00
Jeff Young
40854cec0e Remove cover types. 2024-06-03 11:44:10 +01:00
Jeff Young
aee7680a6c ADDED: support for DNP & friends at the sheet level.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14387
2024-06-02 22:41:22 +01:00
Seth Hillbrand
9fbda137cb Free item memory when closing schematic window
This fires the dtor for each item on the screen, allowing us to properly
close and remove them from the connection graph

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17961
2024-05-16 09:59:10 -07:00
Jeff Young
29360b1aef Raw spice models don't have pin names. 2024-05-10 20:58:13 +01:00
Alex Shvartzkop
01ce6111ff Fix warning. 2024-04-26 15:25:48 +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
Seth Hillbrand
315ad0e071 Replace stale pin references with UNDO copy
When we replace a symbol with one that has fewer pins, the old pins
are released, which leaves points to them in the connection graph
dangling.  This updates the pointer to use the cloned copy in the undo
stack until the connection graph is rebuilt with the new data

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17851
2024-04-24 12:55:02 -07:00
Seth Hillbrand
0cd3e17db7 Ensure that missing pins are added to extraction
When changing from a larger part to a smaller part, the previously
existing pins may be removed from the screen but still linked to
elements in the connection graph because we don't set them dirty unless
the changed element overlaps

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17851
2024-04-23 19:37:27 -07:00
Alex Shvartzkop
2babd574be Refactor autosave prefix into FILEEXT. 2024-04-22 04:06:04 +03:00
Seth Hillbrand
1bc34f7bd7 Always refresh the navigator when changing units
Units are displayed even if the net is not selected
2024-04-18 18:21:13 -07:00
Wayne Stambaugh
d79619edd1 Minor net navigator improvements.
Ignore bus member connection subgraphs.  They do not have a valid net
name nor do they contain schematic items.  This prevents empty nodes
from being added to the tree.  They can be reintroduced in the future
if someone wants to pursue it.

Freeze the wxTreeCtrl while populating it and thaw when done to prevent
any unnecessary repainting.

Add profiling to test how long it takes to rebuild the net navigator.
The recently added populate the navigator with all nets when no net
is highlighted has exposed some potential performances issues with some
versions of wxWidgets on certain platforms.  Namely wxWidgets 3.2.4 on
Linux GTK.

Fix an issue where a sheet name change would not update the highlighted
net navigator resulting in a stale human readable sheet path.

Prevent the highlighted net navigator from being rebuilt twice when
loading a schematic.  SCH_EDIT_FRAME::RefreshNetNavigator() was being
called from both SCH_EDIT_FRAME::UpdateHierarchyNavigator() and
SCH_EDIT_FRAME::RecalculateConnectivity().

Add a new trace helper "KICAD_UI_PROFILE" to show trace output when
profiling user interface performance.  It's used in the net navigator
profiling mentioned above.

Reuse PROF_TIMER::Show() to generate string for PROF_TIMER::to_string().
2024-04-17 14:31:50 -04:00
Mike Williams
faca7ee05b net navigator: show all nets when none are highlighted 2024-04-11 10:21:17 -04:00
Seth Hillbrand
a9f35ba42e Fix incremental connectivity
The connectivity routine would consider symbols, overwriting unused
subgraphs for pins that were not in the change list.  This is resolved
by updating the full connectivity to only use pins in the graph since
symbols are not connected independently.

In the process of adding QA tests for this change, additional issues
with the schematic QA were discovered.  Specifically, we were not
properly setting the root sheet UUID.  This was partially masked by a
const_cast setting of the RefDes in sch_symbol when called the RefDes
getter.  This exposed the fact that our QA ERC numbers did not match the
schematic editor stand alone ERC numbers.  So the test value for one
check needed to be updated

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17528
2024-04-10 17:25:58 -07:00