458 Commits

Author SHA1 Message Date
Jeff Young
6f389fd320 Tighten parent/child undo/redo architecture.
Always look for pre-existing undo/redo record.  Checking for IsNew()
is less robust and should be avoided.  Also moves the checking to a
location where it will be easier to ensure that it's uniform.

Push get-undo-level-item processing down a level so it is uniformly
called.

Make sure tables & labels are uniformly handled.

Remove incorrect usage of Get/SetGroupId() for storing lastPin
(which we don't use anyway).

Lists of deleted and changed items MUST include the screen pointer.
An item could be changed on one screen but not on another.

Also tightens handling of PCB_NETINFO_T items, which are not in the
view.

Also fixes a bug where there is no increment parameter if you assign
the base increment command to a hotkey.
(This was discovered while testing the above changes.)

Also fixes a bug where delete during a move in PCB Editor did an
undo instead of a delete.
(Again, found while testing above.)

An experiment was also run to collapse shared parts of SCH_EDIT_FRAME
and SYMBOL_EDITOR_FRAME into SCH_BASE_EDIT_FRAME.  However, sharing the
undo code actually increased complexity, and there was very little else
of value in SCH_BASE_EDIT_FRAME (other than the Increment() routines).
2025-08-18 19:20:09 +01:00
Seth Hillbrand
8faf1b4d0e Allow soldermask bridging between nettie items
Previously we only allowed graphical items but within the net-tie we
need to allow bridging for connected items as well

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19288
2025-08-18 08:47:26 -07:00
Seth Hillbrand
fcd2da354d Allow wildcard matching for Netclass naming
Fixes https://gitlab.com/kicad/code/kicad/issues/21455
2025-08-16 13:30:20 -07:00
John Beard
c5d5a718aa Altium: handle '.var' concatenated special strings
The ST MB2046 reference board, for example, has all the
assembly-layer ref-des text in the format '.R42' even though
they're not concatenated.

Enable the existing but commented-out text.
2025-08-16 05:51:12 +08:00
Seth Hillbrand
58c9893a3f Add QA for COMMMIT/SCH_COMMIT/BOARD_COMMIT 2025-08-08 21:28:54 -07:00
Seth Hillbrand
b207ec8817 Remove negative index access from CPoint
Callers should be responsible for index count and/or use iterators
2025-08-08 10:46:45 -07:00
Mark Roszko
5895c27f4a Rename Prj() on schematic to avoid conflict with global function 2025-08-07 23:21:41 -04:00
Seth Hillbrand
d8a99ea38f ADDED: New ERC test for mis-match GND pins
If you have a pin with a label containing the letters "GND" in it and it
is not connected to a net with a label also containing "GND" AND there
is another pin on your symbol that _is_ connected to a net containing
"GND", then there is a likelihood that you have accidentally mixed up
your connections to the GND pin
2025-08-07 15:42:56 -07:00
jean-pierre charras
d7cf008397 Try to fix a QA test. 2025-08-06 16:20:55 +02:00
Seth Hillbrand
29eee9f126 Refactor grid_helper to allow testing
Make view and tool manager optional so that we can implement QA on the
actual snapping
2025-08-05 16:10:17 -07:00
Seth Hillbrand
dd889ddac9 Add Tesselation QA tests 2025-08-04 22:20:42 -07:00
Seth Hillbrand
321b5793a2 Add some QA tests
Created basic tests for:
- Notification Manager
- Clipboard
- File history
- Filename Resolver
- Hotkey store
- Collector
- Reporters
2025-08-04 11:36:43 -07:00
Seth Hillbrand
43a9c760b1 Add some QA tests for FILE_HISTORY, SEARCH_PATH and FILENAME_RESOLVER 2025-08-04 09:59:30 -07:00
Seth Hillbrand
50c7aff3ff Simplify KiROUND using std::llround/clamp
Removes the bespoke rounding in favor of std::llround and std::clamp
routines
2025-08-04 09:26:25 -07:00
Seth Hillbrand
bf16dcfbe8 Make all windows remember their preferences
Hook into DIALOG_SHIM to remember stylistic preferences for windows such
as position, size, sash position, notebook selection, etc.

Dialogs and controls can opt out of this by setting a client data user
property "persist" to false.

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

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21108
2025-08-03 20:22:30 -07:00
Seth Hillbrand
11d0bb466b ADDED: PROPERTY_HOLDER class
Useful for attaching arbitrary properties to userdata
2025-08-03 20:22:30 -07:00
Seth Hillbrand
52f8bf83f6 Remove threading from connection vec update
At most, we will have 4 items.  Or maybe a few more with stacked pins.
But not enough to thread.  The overhead of starting threads and using
mutexes is greater than any savings
2025-08-03 09:18:54 -07:00
jean-pierre charras
82ea895ed9 Fix qa test compil issue due to my previous (e1c56c71) commit 2025-08-03 17:10:29 +02:00
Seth Hillbrand
b21e3e45d9 Extract generic item connectivity update and add QA 2025-08-03 08:09:01 -07:00
Seth Hillbrand
15ca4b1ba2 Extract symbol connectivity routine and add QA 2025-08-03 08:09:01 -07:00
Seth Hillbrand
7102b2d5e5 Clarify some driver sorting logic and add addl QA 2025-08-03 06:46:28 -07:00
Seth Hillbrand
1a25f07c76 Add QA for connection graph resolve drivers 2025-08-02 20:38:54 -07:00
Seth Hillbrand
15166a9f14 Refactor REFDES_TRACKER
Keep state for reuse in the class.  This allows us to properly pick the
value when fully reannotating

Don't annotate when placing new units.  Just step ahead in the unit
value while keeping the refdes number constant.  This eliminates the
jumping around to unplaced units when placing new multi-unit symbols

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21378
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
Seth Hillbrand
2aeecec9bd Remove Creepage generation from reporting
Recalculating creepeage every time we reported a new clearance error was
unneccesarily complex.  Since the clearance errors are always straight
lines, we just need to calculate the closest approach and present that
segment
2025-07-21 14:10:34 -07:00
Seth Hillbrand
4c03ab8ebb Finally remove other_math routines
Replace with standard SEG and VECTOR2 alternatives.  Add QA test for
additional SEG-line intersection routine
2025-07-21 11:03:17 -07:00
Seth Hillbrand
0459c54a92 Cleanup and clarify SEG::intersect and SEG::Collide
Fix handling of end point intersection case
Fix degenerate handling
Fix overflow cases
Simplify logic in SEG::Collide
Remove overly simplistic check for intersection

Add multiple QA regression tests
2025-07-21 11:03:17 -07:00
Seth Hillbrand
3a06de0076 Consolidate ERC label warnings
If global or local labels are floating -> error
If global or local labels are only connected to one pin -> warning

Rather than forcing two different errors depending on whether the label
is local or global
2025-07-18 16:47:25 -07:00
jean-pierre charras
67aaac48e7 Fix a compil and a Coverity warning 2025-07-12 18:27:19 +02:00
Mark Roszko
1ab8a5944b Add tiny test for IsCopperLayerLowerThan 2025-07-06 11:10:39 -04:00
Christopher Alexander
f4b1a15cd8 fix for issue 17429 - fixes DRC unconnected items exclusion instability 2025-06-25 17:03:35 +00:00
jean-pierre charras
ea12df80be make board area colored (from Ethan Chien) 2025-06-19 18:26:39 +02:00
Jon Evans
9b72e30a0b QA: Store SVGs, not PNGs
Different platforms/versions can result in very slight differences
when converting SVGs to PNGs for diffing them.

(cherry picked from commit 8b80853ad7269460a68b20ed9f2a0fd33a8cfef8)
2025-06-14 17:16:25 -04:00
John Beard
d15b2b7305 SHAPE_ARC: Fix GetCentralAngle normalization documentation
This appears to have always been [-360 .. 360], as some tests in
test_shape_arc.cpp have had negative values for a very long time.

Add tests on the start, end and central angle accessors to enforce
the documented normalizations.
2025-06-08 09:55:54 +08:00
John Beard
026eb2512d QA Arc: update 'bad midpoint' test case after fix (2124f2b846) 2025-06-08 09:55:54 +08:00
Marek Roszko
4ada004bb4 Add some checkpoints to qa_pcbnew 2025-06-07 15:02:52 -04:00
Jeff Young
d81e9e6cd1 Code cleanup.
A placement-area is a rule-area sub-type.  We don't
need to say rule-area-placement each time.

Also removes some dead code, and simplifies some
damage-propagation logic.
2025-06-07 17:44:00 +01:00
Marek Roszko
f6c305cea6 Allow QA to create new SCHEMATIC instances rather than reusing a single container
Why make cleanup complicated lol
2025-06-07 10:38:43 -04:00
Seth Hillbrand
ed67d37480 If we can't load the KiCad, don't crash
We already fail the test, so just continue instead of segfaulting the qa
2025-06-05 11:40:47 -07:00
Marek Roszko
fa687289bf Fix qa and make SCHEMATIC::Reset safe on null projects 2025-06-01 21:04:58 -04:00
John Beard
98efdaea5e QA Arc: add a test of SHAPE_ARC start/mid/end construction
Also add an expected-failure for an arc where a bad midpoint
should be corrected or rejected by the SHAPE_ARC constructor

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/21035
2025-05-31 19:30:23 +08:00
John Beard
1ad03f5717 QA: Fix angle-equality predicate
This was sometimes accepting a wrong value on the "other side" of
the correct value. Only actually affected one test, which is fixed.
2025-05-31 19:29:02 +08:00
Jeff Young
ed1b4f6e5a Better and more complete recursion guards.
(ie: ones that actually work.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20990
2025-05-24 22:39:03 +01: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
Seth Hillbrand
9bedb6eedb Fix silk board edge collision case
First, fix the error limit check in drc_test_provider_edge_clearance.
Then, we rotate the final point incorrectly in SHAPE_ARC::Collide (need
negative angle).  We were not checking this result in the QA, so add the
proper tests
2025-05-19 17:49:03 -07:00
Wayne Stambaugh
d16d2f5a5b Fix a cadre of symbol pin alternate issues.
Prevent the file formatter from writing and the file parser from loading
symbol pin alternates that have an empty name or when the alternate name
is the same as the default pin name.  Apparently at some point they were
able to be created and saved.

Do not allow SCH_PIN::SetAlt() to set an alternate name when the name
does not exist in the library symbol pin alternate list.  This required
fixing the associated QA test.

When updating or changing schematic symbols from library, reset the pin
alternate to the default when the alternate no longer exists in the
symbol.

Do not populate pin alternates context menu with duplicate default pin.

Clear orphaned pin alternates to the default when saving symbols from
symbol editor.
2025-05-17 14:20:07 -04:00
Jeff Young
4cd2e947a1 Slice() must also support aMaxError.
In some cases arcs are re-inserted.
2025-05-13 12:03:41 +01:00
Jeff Young
7f4853b8a5 Third go at fixing the kimath test. 2025-05-13 09:57:13 +01:00
Jeff Young
acf1dca1e1 Another go at fixing the kimath test. 2025-05-13 08:45:50 +01:00
Jeff Young
a95f5172c9 Formatting. 2025-05-12 21:59:37 +01:00