Commit Graph

11144 Commits

Author SHA1 Message Date
Seth Hillbrand 9f9fa0dd8d Avoid referencing parents after deletion
We look at the parent when deleting EDA_ITEMs but when clearing the test
sheet, we delete the sheet before the pin, causing a use-after-free.
Avoid this by setting parents to null in this case

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17961

(cherry picked from commit b2e0c2606f)
2024-06-09 13:27:34 +01:00
Seth Hillbrand 6ecfa65c4c 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

(cherry picked from commit 9fbda137cb)
2024-06-08 22:16:41 +01:00
Petri Hodju 831d438852 remove item from schematic's connection graph on destruction
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17961

(cherry picked from commit 4920c6b00b)
2024-06-08 22:14:39 +01:00
Jeff Young d304a30155 Performance for large hierarchies: sorting
Cache page numbers during sort.
Don't construct SCH_SHEET_PATH when reference will do.
Don't construct SCH_SHEET_PATH when KIID_PATH will do.

(cherry picked from commit 758974f5aa)
2024-06-07 18:03:45 +01:00
Jeff Young 02ca96df48 No need to mapCoords when everything is in same coord system.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18172
2024-06-07 18:00:41 +01:00
Jeff Young 5ca3414707 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.

(cherry picked from commit e543ff0578)
2024-06-07 18:00:41 +01:00
Seth Hillbrand 76a68b1f8d Add missing IsMandatory() fn 2024-06-07 09:58:54 -07:00
Seth Hillbrand 41ebd3c560 Do not allow trailing/leading whitespace in mandatory fields
Reference, Value, Footprint and Datasheet all reference elements that
should not use trailing/leading whitespace or similar hidden charaters.
Other fields may utilize leading/trailing whitespace for obscure
purposes but won't break functionality as they are display only

(cherry picked from commit 6dcb9bb664)
2024-06-07 08:13:34 -07:00
JamesJCode b882defb28 Update connectivity for SCH_LABELs if netclass field changed
Required for https://gitlab.com/kicad/code/kicad/-/issues/17797 fix
in 8.0. This was fixed in the rule area work in 8.99 but not
cherry-picked as it was wrapped up in the wider changes / bugfixes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17797
2024-06-06 08:16:15 +01:00
Seth Hillbrand 7d7decafd4 Handle hierarchical sheets in incremental change
The drivers need to get passed up and down the hierarchical sheets.  In
order to do this, both the sheet pin and the hierarchical pin need to
be in the changed items.  However, we only get sheets in the screen
items list while the pins are the elements that get set dirty

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17797

Cherry-picked from 5f16c5892c
2024-06-06 07:59:30 +01:00
Mike Williams 8705bea9ab Symbol Fields Table: better handle variable fields with attributes
Attributes need to be checked first since we do some internally hackery
to make the checkboxes work.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18005
2024-06-05 13:02:40 -04:00
Jeff Young dc24d13fef Import child sheets relative to project, not parent.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17785

(cherry picked from commit 8e855156c8)
2024-06-05 12:03:39 +01:00
JamesJCode 89dff6411b Clear all dirty connectivity flags on symbols
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17984

When moving / deleting a power symbol, in some instances the
symbol is marked dirty, and sometimes the pin (depending on
whether the symbol is the primary edited item, or whether
the pin is identified through an edited item subgraph). If
the pin and the symbol are marked dirty, the pin dirty flag
was not being cleared.

Additionally, not all extracted items were being deleted
from subgraphs correctly.

Both resulted in dirty state and duplicated items in the
subgraphs during incremental connectivity, which resulted
in essentially corrupted subgraph states.
2024-06-04 21:01:50 +01:00
Mike Williams 2215e8906f SCH_REFERENCE: drop separate pointer to LIB_SYMBOL
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18115
2024-06-04 12:10:46 +00:00
jean-pierre charras 3e59c40283 symbol editor: allows rotation of fields in derived symbols.
Fields in derived symbols are editable, so the context menu must allow rotations.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18003
2024-06-03 20:35:36 +02:00
Jeff Young 412da66cf6 Make sure ERC pin-to-pin checks are always in same order.
Comparing U1.pin1 : U2.pin1 will return the same
results as U2.pin1 : U1.pin1, but will result in a
different serialization of any exclusions.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17004

(cherry picked from commit 11193d2cda)
2024-06-03 18:49:39 +01:00
Jeff Young 9721559005 Push multi-sweep traces down into MathPlot.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17215

(cherry picked from commit edae328ca6)
2024-06-03 18:29:37 +01:00
John Beard dc08cf3252 Eeschema: Also make 'note' backgrounds translucent on selection
For the same reason as device backgrounds - it obscures everything
else while moving a filled shape.

(cherry pick of commit 0bcd5e5795)
2024-05-23 16:52:30 +08:00
John Beard e20a11cbb3 Eeschema: Fix selection of items inside filled shapes
The selection heuristic broke down when one item was a filled
shape. Because all hit tests would succeed with distance 0 for
these shapes, they would always be considered the closest item
to the exclusion of all else, which made it very hard to
click on a graphic inside a filled shape.

Now, recognise when an item would be "dominating" and
decline to promote it to the "closet" spot. It will still
be selectable if there are no other items nearby, or if
there are multiple shapes.

(cherry picked from commit fd4c15517f)
2024-05-23 15:41:28 +08:00
Roberto Fernandez Bautista 3e5ceaa319 kicad-cli sym export svg: Ensure bounding box is correctly calculated
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18062
2024-05-21 21:59:38 +02:00
Alex Shvartzkop 6dfd417767 Make IBIS errors visible / more obvious.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18041
2024-05-19 01:44:16 +03:00
Jeff Young 882ff06e24 More PEGTL tomfoolery.
(cherry picked from commit 8aaca0509c)
2024-05-17 11:25:26 +01:00
Jeff Young f52a51dce3 Reimplement bracedExpr and token lists for CPL models only.
This prevents the incompatibility between token lists
and single-token param-value pairs.

(cherry picked from commit 086e609c3d)
2024-05-17 11:25:22 +01:00
Jeff Young a96e16b766 Tighter control over braced-expression list separators.
(cherry picked from commit 2921d47fb3)
2024-05-17 11:25:19 +01:00
Jeff Young 81e51b00ca Remove support for multiple token values for CPL models.
It breaks param lists which contain single-token params
(ie: those without the "=<value>" part).

(cherry picked from commit 8bb807f170)
2024-05-17 11:25:15 +01:00
Jeff Young c01681a32e Repair variable resolution recursion guard.
(cherry picked from commit c8d1c1f1a4)
2024-05-17 11:24:37 +01:00
Jeff Young eeb9133588 Support multiple brace-expressions for CPL model lines.
(Nested brace-expressions, on the other hand, are *not*
an ngspice thing.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17824

(cherry picked from commit 0008991f02)
2024-05-17 11:24:21 +01:00
Jeff Young d45769e508 Allow .ends to be preceeded by whitespace.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16560

(cherry picked from commit b934914c59)
2024-05-17 11:21:47 +01:00
Jeff Young 341f102d79 Fix PEGTL flagParam grammar.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16393

(cherry picked from commit c5162f5483)
2024-05-17 11:20:26 +01:00
Jon Evans 1defa3872e Clear field listener when quitting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18016


(cherry picked from commit 2836025402)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-17 00:50:48 +00:00
jean-pierre charras e66d25b6e8 Eeschema, Pin helpers: fix wrong label orientation if the symbol is rotated
From Master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18012
2024-05-16 19:53:23 +02:00
John Beard c3e7509823 Allow to set LIB_FIELD size through property manager
This can be useful when managing auxiliary fields.

This is only for the 8.0 branch, as LIB_FIELD is merged
with SCH_FIELD in 8.99, so this is already handled.
2024-05-16 20:45:26 +08:00
Jeff Young 9000cfb9cd Use display titles for axes in CSV output.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17324

(cherry picked from commit d9a6b2aec2)
2024-05-15 11:23:52 +01:00
Jeff Young 79443b7e59 Update signals & measurements when netlist might have changed.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17616

(cherry picked from commit 55b2c4dbf4)
2024-05-15 11:22:08 +01:00
Jeff Young 9c7fb0697c Don't double up ac and ph params.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17970
2024-05-09 23:36:32 +01:00
Jeff Young c92b11900b Don't add duplicate SIM fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17970
2024-05-09 23:36:32 +01:00
Jeff Young cde18d7ae7 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

(cherry picked from commit a99377c1ec)
2024-05-09 23:36:32 +01:00
Alex Shvartzkop eb7e781bec Send project path to ngspice for code model input files.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16527
2024-05-08 23:39:34 +03:00
Seth Hillbrand 6482a322da Optionally use electrical type when shown.
We also need to consider electrical type as an exact hit when we are
showing it.  Otherwise, we get the pin added to our consideration list
but not selected without hitting close neighbors

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16183

(cherry picked from commit 3620887a22)
2024-05-06 10:38:28 -07:00
Mike Williams 7b19fb0c8d Legacy Libraries: fix Description field clobbering user field
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17943
2024-05-06 12:15:14 -04:00
Mike Williams 1f88d33c81 BOM Export: remember filename per project
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17704
(cherry picked from commit 9c058503d9)
2024-05-06 11:38:15 +01:00
Jeff Young 7e5dd02ef1 Don't abort on failure to backup file if it was never saved.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17810

(cherry picked from commit 0e0432d194)
2024-05-05 14:59:07 +01:00
Jon Evans b8fa10ab2b Add optional reporting of non-KiCad design issues
Also add HTML reporter to PCB side to match schematic
2024-05-04 11:27:22 -04:00
Seth Hillbrand 76c98859bf Fix renaming sheet check
If we are renaming a sheet that exists only once in the schematic, then
we don't need to warn about case sensitivity.  If the sheet exists
multiple times, we do.  We can't check this using SCREENS because the
screens don't maintain full state information about where they are used.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17901

(cherry picked from commit ba4974749c)
2024-05-03 13:23:51 -07:00
Jon Evans 2ef18ad4ca Fix deduplication of already-placed symbols
The comparison function was failing to properly
de-duplicate by LIB_ID, especially for parts
from database libraries, causing the list to grow
with the size of the design.
2024-05-03 11:39:01 -04:00
Jon Evans 1a76fce255 Make sure database library has updated pointer to library table
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17903
2024-05-03 11:39:01 -04:00
Alex Shvartzkop 451cb7a194 Fix warnings. 2024-05-03 00:09:24 +03:00
Alex Shvartzkop 17175fe71e EasyEDA Std/Pro: import (some) component metadata for symbols.
Also fixes Reference numbering.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17806
2024-05-03 00:05:39 +03:00
Jon Evans cb7e0e4383 Altium: apply power filter to symbol libraries
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17922
2024-05-01 22:47:19 -04:00
Jon Evans 90b62762d3 Support ortho dragging labels off sheet pins 2024-05-01 22:10:18 -04:00