106 Commits

Author SHA1 Message Date
Mark Roszko
e4aa8278c5 Make new SCHEMATIC objects instead of reusing them between loads 2025-08-18 01:08:45 -04:00
Jeff Young
ea84879b06 Allow deletion of nested embedded files.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20581
2025-08-04 19:11:59 +01:00
Seth Hillbrand
9fff1d955e Add Contains search to SCHEMATIC 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
dc0e211e1e Can't add to parent group without a commit.
We allow this only for file import, where we don't
need to handle group membership anyway.
2025-07-11 21:26:19 +01:00
Jeff Young
98dc94f8f2 Rework ruleAreas to avoid stale pointers.
1) UpdateRuleAreasInScreens() is going to reset the rule
area caches on all SCH_RULE_AREAs.  This means that every
SCH_ITEM in the screen that *had* a rule area cache is going
to get it cleared.  So we might as well just up-front clear
the caches of all SCH_ITEMs, avoiding the need to use the
(possibly stale) pointers inside SCH_RULE_AREA::m_items.

2) UpdateRuleAreasInScreens() also sets the repaint flag on
all SCH_DIRECTIVE_LABELs, so there's no need to worry about
them elsewhere.

3) SCH_RULE_AREA::m_prev_items could also contain stale
pointers.  We avoid this one by converting it to KIIDs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21120
2025-06-15 15:15:09 +01:00
Jeff Young
a52a205ca4 Performance tweak. 2025-06-09 12:54:30 +01:00
Marek Roszko
4fb89a9341 Use m_project member instead of Prj() inside SCHEMATIC 2025-06-05 21:40:30 -04:00
Marek Roszko
bf192a1a98 Remove the callback on RecomputeIntersheetRefs 2025-06-05 20:25:27 -04:00
Marek Roszko
674ffa2a3d Split part of RecalculateConnections to SCHEMATIC, fix cli loader to call RecalculateConnections which fixes rules areas
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20528
2025-06-05 20:25:27 -04:00
Marek Roszko
1da8ddbadd Move CleanUp to SCHEMATIC 2025-06-04 20:33:48 -04:00
Marek Roszko
fcc09a5ce6 Move BreakSegment(s/OnJunction) out of SCH_EDIT_FRAME 2025-06-04 20:33:47 -04:00
Marek Roszko
fa687289bf Fix qa and make SCHEMATIC::Reset safe on null projects 2025-06-01 21:04:58 -04: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
Jeff Young
2d74e54517 Formatting. 2025-04-27 23:43:35 +01:00
Jeff Young
5996cffabc EE -> SCH (no functional changes) 2025-03-13 13:15:47 +00:00
Jeff Young
c5bb59468d Get rid of assumptions about field order. 2025-02-24 11:08:29 +00:00
Jeff Young
56b8fec74b Update instance reference from property inspector.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19932
2025-02-19 23:43:53 +00:00
Wayne Stambaugh
f45915ba93 Eeschema folder housekeeping. 2025-02-06 09:47:00 -05:00
Seth Hillbrand
3a5eeef9df Auto update list of fonts when embedding files
Get the list of currently used fonts to populate the list of embedded
files when the user checks the "embed fonts" checkbox
2025-01-16 18:07:07 -08:00
Jeff Young
7bf0d36057 Store/fetch sheetpath along with symbol UUID.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19623
2025-01-14 18:32:09 +00: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
Wayne Stambaugh
c4e2c0d3ec Save schematic symbol field and unit by ordinal sheet instance.
Use the ordinal symbol reference and unit when saving schematics to
prevent file changes instead of the first instance.  The first instance
would change when sheets were moved and the hierarchy order changed.
The ordinal instance is defined as the first sheet instance when the
hierarchy sorted by page number.
2024-12-19 09:19:35 -05: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
Wayne Stambaugh
b9f11971ad Add test to determine if schematic is a complex hierarchy.
This test was added to the SCHEMATIC object along with QA tests to verify
the test works as expected.
2024-09-28 09:21:20 -04:00
Wayne Stambaugh
be72f22f54 Add check for schematic files shared by multiple projects.
This test was added to the SCHEMATIC object along with QA tests to verify
the test works as expected.
2024-09-27 13:09:50 -04: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
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
Jeff Young
2e38fa84bf Don't allow writing "//" to spice netlist.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18161
2024-06-10 15:36:20 +01: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
43a622cadf Ensure we are checking all ERC errors
Also, handle the possiblity that we return NULL when calling
DeserializeFromString in the case where we don't handle all cases or the
file is corrupted
2024-05-28 06:55:34 -07:00
Jon Evans
2836025402 Clear field listener when quitting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18016
2024-05-16 20:49:27 -04:00
Seth Hillbrand
2139789c4c Move ERC items to their own directory 2024-05-03 12:06:24 -07:00
Jon Evans
f613cd1cb4 ADDED: A new IPC API based on protobuf and nng
Details, documentation, and language bindings are works in
progress and will be evolving over the course of KiCad 9
development.
2024-04-02 19:34:36 -04:00
Jeff Young
a6e2746a08 Rewrite intersheet refs resolution to be sheet-path aware.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17533
2024-03-23 16:50:21 +00:00
Jeff Young
d7e4a8cebd ADDED: ERC/DRC exclusion comments.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16020
2024-02-24 20:05:51 +00:00
Jeff Young
ee5e2e56c0 Naming conventions; no functional changes. 2024-01-29 16:00:06 +00:00
Jon Evans
9c1a160fcd Add system for property change notifications
Use this to sync symbol field edits that are
synced by the dialog

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15697
2023-12-02 19:22:59 -05:00
Mike Williams
f993e45325 Variables: make consistent across editors
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16180
2023-11-29 09:55:17 -05:00
Jeff Young
03953e80fc Enforce SCH_SHEET_PATH processing in (yet) more places.
Also fixes a bug where ERC testing for text variables in sheet pins
would start with the wrong sheet.

Also fixes a bug where ERC testing of similar labels would use the
wrong sheet.

Also fixes a bug where ERC testing of bus-to-net conflicts would use
the wrong sheet.

Also fixes a bug where ERC didn't process variable references when
checking hierarchical labels against sheet pins.

Also fixes a bug where ERC multiple-drivers and netclass-conflicts
tests didn't set a sheetpath.
2023-11-12 14:15:04 +00:00
Jeff Young
3819b2d5e7 Enforce SCH_SHEET_PATH processing in more places.
Making assumptions about the current SCH_SHEET_PATH has caused no end
of pain.
2023-11-11 17:46:06 +00:00
Mike Williams
a9c4534a38 Schematic/Fields Table: handle sheet changes 2023-08-20 16:13:47 -04:00
Jeff Young
57d3aef4cd Correct false comments (no functional changes). 2023-08-18 22:20:09 +01:00
Marek Roszko
f341fde938 Move RecordERCExclusions and ResolveERCExclusions out of the schematic frame 2023-08-13 19:50:05 -04:00
Jeff Young
ff044cd0cf Mostly a terminology update...
... but also makes DIALOG_SIM_COMMAND and SIMULATOR_REPORTER a bit
more simulator-agnostic.
2023-07-14 17:46:06 +01:00
Marek Roszko
34ba343754 Add SCHEMATIC_LISTENER equivalent to BOARD_LISTENER 2023-05-14 21:35:51 -04:00
Mike Williams
5d116245c6 sch_symbol: always require sheet path for text variable resolution 2023-05-06 14:30:06 -04:00
Seth Hillbrand
48740dd3f8 Clean exposure of CONNECTION_SUBGRAPH
Removes internals from public consumption.
2023-03-03 14:07:17 -08:00