Commit Graph

15221 Commits

Author SHA1 Message Date
Jeff Young aa8a903940 Cleanup. 2023-06-12 11:14:27 +01:00
Jeff Young a3754785df BoardDesignSettings are owned by FOOTPRINT_EDITOR_SETTINGS in the FP Editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14925
2023-06-12 10:08:41 +01:00
CraftedNightmare aa667bea0f eeschema: Fix Search pane not remembering docking sizes and positions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14120 for eeschema
Fixes that Show Search Panel Checkbox can get out of sync when restarting
eeschema while the search pane is active
2023-06-11 20:23:24 +00:00
CraftedNightmare d94e9b31b1 Fix Search pane not remembering docking sizes and positions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14120
2023-06-11 20:23:24 +00:00
Jeff Young 93789e75b9 Re-create missing exclusion markers if DRC was cancelled.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14919
2023-06-11 12:14:27 +01:00
Jeff Young 3159391e28 Make sure infobar gets created earlier.
(restoreLastFootprint() might want it.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14922
2023-06-11 11:40:51 +01:00
Jeff Young 4fc6047f91 Make sure infobar gets created earlier.
restoreLastFootprint() might want it.
2023-06-11 11:02:56 +01:00
Roberto Fernandez Bautista 3d1b96d6ca Cleanup jobs handlers (+Fix build) 2023-06-11 00:12:53 +02:00
Roberto Fernandez Bautista 3f758711fd Use external REPORTER for EESCHEMA_JOBS_HANDLER / PCB_JOBS_HANDLER 2023-06-10 23:35:32 +02:00
Jeff Young fcb156c323 Make sure opposite-corner rects test the same.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14907
2023-06-10 22:30:04 +01:00
Jeff Young 96a221ceba Refresh delete immediately; don't wait for next mouse motion. 2023-06-10 21:11:05 +01:00
Jeff Young 111d0a2c14 Check for proxy references and values in Selectable().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14911
2023-06-10 17:47:29 +01:00
Jeff Young f66b9f75a3 Allow EDA_COMBINED_MATCHER use in KiCad find architecture.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12532
2023-06-10 14:50:06 +01:00
Jeff Young d18b0c62f6 Make FOOTPRINT_PREVIEW_PANEL a FPHOLDER.
Also makes sure it get its user_units set up.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14913
2023-06-10 13:36:17 +01:00
Roberto Fernandez Bautista 0159be8ddd Fix build (broken in 90ff331c) 2023-06-10 14:21:10 +02:00
Roberto Fernandez Bautista 90ff331c58 Refactor: Move static to be inside ZONE_SETTINGS 2023-06-10 12:03:41 +02:00
Alex 2450435131 Support --mirror option in "kicad-cli pcb export pdf" 2023-06-10 04:54:11 +03:00
Jeff Young e698156975 Upgrade many editing actions to SCHEMATIC_COMMIT. 2023-06-09 22:41:47 +01:00
Jon Evans 3a2cc8f56f Net Inspector: clear sort ordering during rebuild
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14697
2023-06-09 09:06:11 -04:00
jean-pierre charras 639da0eb5a Fix a wxWidgets alert when deleting the last entry in a lib table. 2023-06-09 08:09:22 +02:00
jean-pierre charras 14c10d2a37 PANEL_FP_PROPERTIES_3D_MODEL: fix a wxWidgets alert.
Happens when there is no 3D model in 3D grid list, and when trying to add
a new 3D model, but canceling the 3D dialog file selector.
2023-06-08 17:46:38 +02:00
Tomasz Wlostowski 3667e4f6b2 router: correctly assign owner via/pad to its hole when committing the world state
fixes #14852
2023-06-08 11:57:23 +02:00
Jeff Young d5b5a3eaf4 Add action info to Undo/Redo menus.
Note that this only works where a BOARD_COMMIT or SCHEMATIC_COMMIT is used.
(BOARD_COMMIT is used almost universally in PCBNew, but SCHEMATIC_COMMIT
has very little adoption in EEschema so far.)
2023-06-07 14:37:34 +01:00
Nils VAN ZUIJLEN 518741c52a cli: add an option to the pcb exports for plotting negative svg and pdf
ADDED: The -n or --negative option for exporting negative svg or pdf plots
from kicad-cli. Example usage: kicad-cli pcb export svg -n -l B.Cu board.kicad_pcb
2023-06-07 13:28:52 +00:00
jean-pierre charras f92271af2c DIALOG_GEN_FOOTPRINT_POSITION: replace "Gerber (experimental)" by "Gerber X3"
Gerber position file is now not experimental, and is accepted by some board houses.
2023-06-07 11:43:30 +02:00
Jeff Young 9a757e8e44 Restore over-aggressive CLion cleanup. 2023-06-06 15:49:41 +01:00
Jeff Young 9fe00bb808 Cleanup. No (intentional) functional changes. 2023-06-06 12:30:35 +01:00
Jeff Young c5e7d800a4 Back out earlier diamond-to-rectangle fix for one that's more targeted.
(And doesn't fail qa_pcbnew.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14828
2023-06-05 21:26:37 +01:00
Jeff Young 4ea41174c3 Variable names and minor performance fixes. 2023-06-05 21:26:37 +01:00
jean-pierre charras 6eda60e503 Pcbnew: UI change: move layer selector from main toolbar to auxiliary toolbar 2023-06-05 20:31:18 +02:00
Jeff Young aafbbb4c63 Clean up includes. 2023-06-05 11:01:10 +01:00
Jeff Young 7a3a8b67c1 Exclude redraws during closing (particularly of RATSNEST_VIEW_ITEM). 2023-06-05 11:01:10 +01:00
Jeff Young 29aabcf77e Naming clarity. No functional changes. 2023-06-05 11:01:10 +01:00
Jeff Young f3d3ade1dc Increased mutex safety.
Don't even query the size() without having at least a shared_lock.

*May* prevent KICAD-4S, but seems unlikely.
2023-06-05 11:01:10 +01:00
Marek Roszko b41606ecf7 Use the correct printf format for the move individually status text
Fixes sentry KICAD-1ZT
2023-06-04 21:08:13 -04:00
Jeff Young 0091b9f897 Prevent Sentry KICAD-MM crash.
It'd be nicer to know what happens, but we don't have a reproducible
case, so this "fix" will at least prevent that particular crash.
2023-06-04 23:00:44 +01:00
Jeff Young 1528f4700c Treat canvas item as current when tree view contains no selection.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12702
2023-06-04 20:52:12 +01:00
Seth Hillbrand e4fe27993e Fix wxCHECK_MSG in DRC
The layers check needs to look for testing against technical layers for
those vias that pass the outer layers
2023-06-03 20:25:35 -07:00
Jeff Young 5875f89531 Centralize text size clamping.
Also introduces alg::clamp to improve readability of
std::max( min, std::max( value, max ) )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14876
2023-06-03 20:29:51 +01:00
Wayne Stambaugh bdee545841 Coverity warning fixes. 2023-06-03 07:28:17 -04:00
Seth Hillbrand 7f5d790610 Ensure we aren't trying to access a closed board 2023-06-02 15:47:46 -07:00
Jeff Young 97cf7c874e Handle Altium dimension angles and non-unit suffixes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13751
2023-06-02 18:30:16 +01:00
Jeff Young 3c8d2bfca5 Assertion checking for hole/parent ownership mismatch.
(This mismatch is the root of the problem in issue #14852.)
2023-06-02 18:30:16 +01:00
jean-pierre charras 9a47b34499 Replace PAD_SHAPE::RECT by PAD_SHAPE::RECTANGLE to avoid a collision NAME with a windows header on MSYS2, creating many compil warnings. No actual code change. 2023-06-02 12:18:24 +02:00
Tomasz Włostowski 3c3517cc36 router: can't add a clone of a VIA's hole when adding the via to INDEX - this will result in bogus colliding objects
This commit partially reverts deb3cbf8. VIA and SOLID operator='s introduced in it do a good job but the cloning of holes in addHole() causes bogus collisions.
2023-06-01 22:47:02 +02:00
jean-pierre charras db3cf4274b Modify the order of an include to avoid a collision name with a windows
header that prevent Kicad build (msys2 specific)
2023-06-01 16:26:19 +02:00
Jeff Young deb3cbf89b Prevent use-after-free crashes by not fighting over who owns a HOLE.
The diff-pair placer creates DIFF_PAIRs on the stack, which have
VIAs in them, which have HOLEs in them.  The HOLEs get put in the
NODE's index, and we then crash later when doing a collision after
the stack variable has gone out of scope.

The stack variable is also copied while doing a search for "best",
and without the operator= definitions the "best" and the "original"
both think they own the HOLE.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14852
2023-06-01 15:07:29 +01:00
Seth Hillbrand c7758999af Handle LOCKFILE logistics for ro
We need to check if a lockfile is valid to determine if we should
override the lock. Valid() is true if the lockfile couldn't be created
b/c of permissions or if the lockfile could be created and acquired.
2023-05-31 17:04:32 -07:00
Seth Hillbrand aacf8f50bf Remove unneeded headers from pcbnew_scripting_helpers.h 2023-05-31 15:54:46 -07:00
Jeff Young ddd2cb005b Don't allow setting a pad width or height of 0.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14278
2023-05-31 23:41:43 +01:00
Tomasz Wlostowski 7966126040 router: invalidate items freed by PNS::NODE in the clearance cache
This was causing intermittent shove hiccups/freezes as RULE_RESOLVER::GetClearance() could return a bogus clearance value, taking
a cached value for an item that does not exist anymore. If the allocator/stack accidentally reclaimed such item's address - we were getting
very nasty and difficult to reproduce misbehaviours of the shove algorithm. Hopefully this patch fixes this. More info in the comments.

Note to self - I'm still not fully convinced I want PNS::ITEM pointers as the cache key, probably a unique counter would be better here.
2023-06-01 00:01:15 +02:00
Seth Hillbrand 14f6e32c74 ADDED: Change watcher for libraries
When editing or viewing library symbols, the files are watched for
underlying changes.  If any occur, the user is either prompted to reload
(if reloading would overwrite their current edits) or the file is
silently updated to the current version on disk.

This also sets a custom assertion handler to avoid unneeded crashes when
recieving invalid SAMBA packets and turns off assertions entirely when
running in release (non-debug) mode
2023-05-31 13:46:00 -07:00
Tomasz Wlostowski 15db42d9c8 router: fix use-after-free crash in drag walkaround mode 2023-05-31 22:20:28 +02:00
Tomasz Wlostowski 5100345c6e router: prevent pushout/bogus collision of via with is own hole (or copper) when dragging
The root cause was not removing the original (pre-dragging) via from the world, comparing the ITEM::Parent() pointers of the items was only hiding the main issue.
This also fixes the PNSViaCollisions test in the qa/ suite.
2023-05-31 17:06:24 +02:00
Jeff Young 8baf2a832f Make pad flipping work both from parent footprint *and* individually.
The last fix was for individual pads, but it broke when the whole
footprint was flipped for rotated footprints.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14829
2023-05-31 11:13:35 +01:00
Jon Evans 3783fc8f5a Remove unused line 2023-05-30 20:06:18 -04:00
Jeff Young 4874537c40 Push/pop router tool for inline drag.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14832
2023-05-30 18:02:12 +01:00
Jeff Young c36b0fcda7 Make sure 3D file browser is treated as modal by quit.
(Otherwise we crash when freeing it during the quit.)
2023-05-30 14:58:46 +01:00
jean-pierre charras 6b845b9054 Fix compil warnings and a wxWidgets alert. 2023-05-30 09:00:46 +02:00
Jon Evans 141cc85ff3 PNS: Work around collision checking issues in shove mode
Need to special-case shove mode since 942ee13c introduced
collision checking in all modes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14836
2023-05-29 18:19:47 -04:00
Roberto Fernandez Bautista bb90aa24b7 Add basic QA test to CADSTAR PCB footprint import 2023-05-29 23:29:28 +02:00
Roberto Fernandez Bautista 3b56b7bf68 Fix assert in PROPERTY_ENUM (ENUM_MAP<PCB_LAYER_ID> was not initialised) 2023-05-29 23:29:28 +02:00
Jeff Young f5791f5dc6 Left some fixes out of previous commit. 2023-05-29 16:22:24 +01:00
Roberto Fernandez Bautista 9633c8af22 CADSTAR PCB: Fix regression in loading of thermal pads
Due to removal of SetPos0 in 28028c94, we now don't need to compensate
for the position of the footprint while importing.
2023-05-29 16:41:47 +02:00
Jeff Young 65e53b8ecd Move SHAPE_POLY_SET::Inflate's error spec from a seg-count to a max-deviation.
1) Also reorders parameters to make sure the compiler helps out.

2) This also makes it harder to mess up the discrepency between
   BOX2I/wxRECT/etc::Inflate() and SHAPE_POLY_SET::Inflate.

3) Also fixes a couple of bugs where the corner strategy was passed
   in as a segCount.

4) Also fixes a couple of bugs where the error wasn't forced to the
   outside to match the ERROR_LOCATION.

5) Also fixes a couple of bugs where the seg count was specified
   without regard to an already passed-in max deviation
2023-05-29 15:29:03 +01:00
jean-pierre charras ef4dded915 PCB_TEXT::TransformTextToPolySet(): fix incorrect param when calling Inflate()
This incorrect value created hang when clicking on a pcb text.
2023-05-29 14:21:10 +02:00
Roberto Fernandez Bautista dfebe516c5 CADSTAR PCB: Fix memory leak 2023-05-28 23:56:43 +02:00
Roberto Fernandez Bautista a119bd604d Refactor: Move DIALOG_PLUGIN_OPTIONS to common and use enum for event ID 2023-05-28 23:56:41 +02:00
Jeff Young c71cf21e2f Use rendered text to generate bounding box for knockout text.
Don't open-code knockout text shape generation in several different
places.

Make sure triangulated knockout text gets clearance added when
specified.

Collapse duplicated footprint text item plot routine (they're no
longer any different from plotting pcb text items).
2023-05-28 17:20:11 +01:00
Jeff Young 95a09f686b Revert attempt to use drawing code to generate text bounding boxes. 2023-05-27 22:11:34 +01:00
Jeff Young cb53a18ee3 Bug fixes for handling boolean flags in DRC rules. 2023-05-26 18:44:33 +01:00
Jeff Young 768fbf5af2 Give up on trying to calculate text bounding boxes.
It results in too many hacks strewn through the code.  Just draw the
text and measure it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14803
2023-05-26 18:44:33 +01:00
Jon Evans 942ee13cd1 PNS: Allow width-caused DRC violations at start of route
Also fix an issue where DRC violations introduced by the
width change action could be committed in walk/shove mode.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14805
2023-05-25 23:10:00 -04:00
Jeff Young 50da4e483e Tailor inspector text properties for dimension objects. 2023-05-25 16:18:37 +01:00
Jeff Young 05fef51d81 Push rendering portion of text cache generation down into CALLBACK_GAL. 2023-05-25 11:25:32 +01:00
Jeff Young 1518ddde74 Push much of text var autocomplete down into SCINTILLA_TRICKS.
Shared code == fewer bugs.  Well, in theory anyway....
2023-05-25 10:24:50 +01:00
Jeff Young 14f004d2a5 Hook up text variable auto-complete for PCBNew.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14777
2023-05-25 10:24:50 +01:00
Seth Hillbrand 48ecd742eb Maintain file permissions when renaming
Temporary and autosave files do not neccessarily have the correct
permissions set to replace existing project files.  This updates the
permissions to match the existing values where possible

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13574
2023-05-24 17:09:38 -07:00
Seth Hillbrand 122be418bb Upgrade file locking
wxSingleInstanceChecker is meant for running programs, not file locking.
This implements an RAII class for file locking that stores the lock
files next to the file being locked, allowing it to be easily found and
removed.  Also includes the ability to override the lock, with
information about the original owner

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14734
2023-05-24 13:51:54 -07:00
jean-pierre charras 76d66571e4 Pcbnew: fix crash when trying to save a board with a text with overbar and
using a non Kicad font
PCB_PLUGIN::formatRenderCache() was considering all shapes in cache are polygons,
but this is not true: some items can be stroke shapes.
Fixes #14804
https://gitlab.com/kicad/code/kicad/-/issues/14804
2023-05-24 18:21:50 +02:00
Jeff Young 2ac3f4cc9e Undo strategy based on being in a footprint, not footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14799
2023-05-23 17:56:12 +01:00
Jeff Young 56853a6209 Change teardrop edge shape to a checkbox. 2023-05-23 17:45:26 +01:00
Jeff Young b442d769fd Don't allow collisions with self.
The previous test didn't handle is-self-tests between a hole and
its override in a different NODE.  When calculating the pushout
force we don't remove the via (and its hole) from the current
node until after the calculation, so we end up checking for
collisions between the new (cloned) via's hole and the original
hole in the root node.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14795
2023-05-23 14:10:22 +01:00
Wayne Stambaugh 5b539958a2 Fix track and via properties dialog radio buttons on GTK. 2023-05-22 13:54:13 -04:00
Jeff Young 00986484e0 Attempt to fix teardrop radio buttons on GTK. 2023-05-22 14:48:53 +01:00
Wayne Stambaugh a13a49f45a Fix clipped combobox entry in board editor text box dialog.
The layer combobox color swatch was clipped when the combobox was
closed when the dialog was launched.  Setting the minimum width
resolved the issue.  This may have been a GTK only issue.
2023-05-22 08:54:48 -04:00
Jeff Young df763eaf88 Reconcile PNS router with DRC.
Hole-to-hole is only for drilled holes.
NPTH slots also get EDGE_CLEARANCE applied.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14771
2023-05-21 19:58:00 +01:00
Jeff Young 7e51077992 STL is your friend... until it's not.
Operator[] was creating an empty entry in the connectivity map,
fooling us into thinking the item had already been added.

Worryingly, this bug has been in there since 2017; a recent
change in teardrops just happened to expose it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14781
2023-05-21 17:56:43 +01:00
Jeff Young ff9a5b8373 Remove change from teardrop merge that wasn't needed for final impl. 2023-05-21 16:39:18 +01:00
Jeff Young 502da2d03c Performance improvements. 2023-05-21 11:23:56 +01:00
Jeff Young 08a9d4b26f ADDED preference for ratsnest thickness.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14708
2023-05-21 00:07:08 +01:00
Jeff Young 80aef37cc4 Don't consider shorted items when opitmizing ratsnest.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14715
2023-05-20 22:54:44 +01:00
Jeff Young ea341289de Fix uninitialized variable (Coverity report). 2023-05-20 21:10:09 +01:00
Marek Roszko 8a7044c3fb Fix some more warnings 2023-05-20 08:00:16 -04:00
Alex 9d452a6097 Fix opening boards with deprecated features. 2023-05-20 07:39:01 +03:00
Jeff Young 4c59365867 Blind attempt to fix pns-debug-tool linking issue. 2023-05-19 19:26:03 +01:00
Jeff Young 8b1fd62d35 Make pad & via teardrops 1st-class citizens (props of the pad/via)
Change teardrop generation to rely more heavily on BOARD_CONNECTIVITY
for improved performance.

Add updating of teardrops on BOARD_COMMIT::Push().

Also converts m_CopperItemRTreeCache to std::shared_ptr.
We don't copy it around anyway, and having to create a new set
of std::unique_ptr's for each operation is likely to be more
expensive than std::shared_ptr's overhead.
2023-05-19 18:02:03 +01:00
jean-pierre charras 86c75cf261 Fix a compil issue. 2023-05-19 09:24:49 +02:00
Marek Roszko 3bf2fb2c0e Fix more C5266 warnings 2023-05-18 22:08:50 -04:00
Jon Evans 27afd22bbf Specctra: remove grouped tracks from group before cleaning up
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14763
2023-05-17 23:03:06 -04:00