Commit Graph

11025 Commits

Author SHA1 Message Date
Ian McInerney 44655b98de Initialize variables properly 2021-01-18 18:35:10 +00:00
Ian McInerney d030d1667b Fix improper string creation in fabmaster importer 2021-01-18 18:35:10 +00:00
Jon Evans 1e33928b96 Fix issues with zone filling connectivity locking
Two issues found with the locking system used to prevent access to
stale connectivity data during the zone fill process:

1) a std::mutex has undefined behavior if you try to use it to guard
against access from the same thread.  Because of the use of wx event
loops (and coroutines) it is entirely possible, and in some situations
inevitable, that the same thread will try to redraw the ratsnest in the
middle of zone refilling.

2) The mutex was only guarding the ZONE_FILLER::Fill method, but the callers
of that method also do connectivity updates as part of the COMMIT::Push.
Redrawing the ratsnest after the Fill but before the Push will result in
stale connectivity pointers to zone filled areas.

Fixed (1) by switching to a trivial spinlock implementation.  Spinlocks would
generally not be desirable if the contention for the connectivity data crossed
thread boundaries, but at the moment I believe it's guaranteed that the reads
and writes to connectivity that are guarded by this lock happen from the main
UI thread.  The writes are also quite rare compared to reads, and reads are
generally fast, so I'm not really worried about the UI thread spinning for any
real amount of time.

Fixed (2) by moving the locking location up to the call sites of
ZONE_FILLER::Fill.

This issue was quite difficult to reproduce, but I found a fairly reliable way:
It only happens (for me) on Windows, MSYS2 build, with wxWidgets 3.0
It also only happens if I restrict PcbNew to use 2 CPU cores.
With those conditions, I can reproduce the issue described in #6471 by
repeatedly editing a zone properties and changing its net.  The crash is
especially easy to trigger if you press some keys (such as 'e' for edit)
while the progress dialog is displayed.  It's easiest to do this in a debug
build as the slower KiCad is running, the bigger the window is to trigger this
bug.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6471
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7048
2021-01-18 13:22:12 -05:00
Jeff Young 26bc29808a Clean up Text Properties dialog.
It's no longer used for dimensions so doesn't need the line thickness
controls.

The spacing was a bit wonky.

Changed to disabling rather than hiding visibility checkbox.  The less
the GUI moves around the better.
2021-01-18 15:20:15 +00:00
Jeff Young 4f399d4304 One more attempt to fix flipping geometry.
Fixes https://gitlab.com/kicad/code/kicad/issues/4480
2021-01-18 15:20:15 +00:00
Michael Kavanagh 479487ceb1 Tidy up context menus a bit
Try and put the common actions in the same places
2021-01-17 22:42:03 +00:00
Jon Evans 6bb9aeab4b Position relative: store discarded pad for use as the selection anchor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6996
2021-01-17 14:25:52 -05:00
Jeff Young f1221a9ca3 Resolve text variables in title blocks for outputing to netlist.
Fixes https://gitlab.com/kicad/code/kicad/issues/7153
2021-01-17 16:24:22 +00:00
Jon Evans 1754504234 Fabmaster: fix MSVC build
std::map is not move-constructable on MSVC because
it is not declared noexcept (and is not required to be
by the standard)

This means that a struct containing graphic_element
cannot be inserted into a vector with move semantics without
compile errors.  However, wrapping it in a unique_ptr
works.
2021-01-17 10:23:31 -05:00
Jeff Young 68efdb2fff Push shared parts of GRID_HELPERs into common. 2021-01-16 23:18:10 +00:00
Seth Hillbrand 950db6ff9c pcbnew: Add Fabmaster import
Allows importing ASCII design output from OrCAD designs
2021-01-16 14:28:33 -08:00
Jeff Young 3b424d3868 Use less-sophisticated arc editing math.
While it doesn't do the tangent retention that the old version did,
this one I can at least make work.

Fixes https://gitlab.com/kicad/code/kicad/issues/7135
2021-01-16 20:46:14 +00:00
Roberto Fernandez Bautista 00918c68f5 Don't do clever snapping logic when drawing a circle
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7131
2021-01-16 08:39:20 +00:00
Jon Evans 38455c25ef Bring back consideration of world scale to PcbNew snapping
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7125
2021-01-15 12:29:47 -05:00
Jeff Young 08d595c9bf Move title block fields to global availability in PCBNew.
Fixes https://gitlab.com/kicad/code/kicad/issues/7118
2021-01-15 15:41:18 +00:00
Jeff Young 7dc2ca93cd Make sure we mark board-only-footprint nets as current.
Fixes https://gitlab.com/kicad/code/kicad/issues/6871
2021-01-15 12:46:48 +00:00
Jon Evans 6cc39d8011 Don't allow moving locked pads with Position Relative dialog
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6996
2021-01-14 22:14:00 -05:00
Jon Evans 0b7fc0e2d9 Update local ratsnest state when toggling appearance control
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7035
2021-01-14 22:03:23 -05:00
Jeff Young 36508807e7 Give the pad placement tool a context menu.
ADDED: allow pad properties to be edited while placing pads.

Fixes https://gitlab.com/kicad/code/kicad/issues/6953
2021-01-15 00:52:03 +00:00
Jeff Young 965482bd7f Improve some tooltips.
Fixes https://gitlab.com/kicad/code/kicad/issues/7116
2021-01-14 22:35:32 +00:00
Thomas Pointhuber 9f24ea0bb7 altium: fix non-copper pads. Roundrect pads were not filled and SetLocalCoord() does not transform polygons into the local coordinates, which is unexpected. 2021-01-14 22:21:05 +01:00
jean-pierre charras 54cf67dad2 Pcbnew, drill map: fix incorrect position of texts for small boards.
Fixes #7111
https://gitlab.com/kicad/code/kicad/issues/7111
2021-01-14 18:52:04 +01:00
Mikolaj Wielgus 0129c7ae52 Notify appearance panel when net is (un)hidden by board inspection tool
Fixes https://gitlab.com/kicad/code/kicad/issues/7039
2021-01-14 17:22:41 +00:00
Jeff Young 02ccd5fbdb Make sure properties commands don't go to other tools during routing.
Brings up the track widths (or diff pairs) context menu instead,
which seems to be the closest parallel.

Fixes https://gitlab.com/kicad/code/kicad/issues/7099
2021-01-14 15:19:09 +00:00
Jeff Young 3e920c665f Special case via area generation.
Fixes https://gitlab.com/kicad/code/kicad/issues/7105
2021-01-14 12:48:44 +00:00
Mikolaj Wielgus f0b11896da Clip the first segment in leaders
Fixes https://gitlab.com/kicad/code/kicad/issues/6548
2021-01-14 00:10:41 +00:00
Seth Hillbrand 13a4717aed Add center handles to rectangle edits
Allows changing a single dimension at a time.  Matching the polygon edit
tool.

Fixes https://gitlab.com/kicad/code/kicad/issues/7085
2021-01-13 14:04:21 -08:00
Jeff Young ffdff21f45 Use a sloppier hittest for the collector as well as the actual hittest.
Fixes https://gitlab.com/kicad/code/kicad/issues/7079
2021-01-13 21:22:24 +00:00
Seth Hillbrand e3e9bfc1b8 Fix compile error 2021-01-13 13:21:27 -08:00
Seth Hillbrand 605dcfbedf Fix Windows script location
Windows has arbitrary installation locations, so reference relative to
the executable
2021-01-13 13:11:26 -08:00
Seth Hillbrand b57ad4b2f9 Correct SWIG path
Don't offset from executable, this is an absolute path

Fixes https://gitlab.com/kicad/code/kicad/issues/7089
2021-01-13 12:34:04 -08:00
Jeff Young da4b269783 Make sure pad local clearances get in to m_worstClearance. 2021-01-13 12:37:20 +00:00
Jeff Young 0bce280424 Make sure design rules get recompiled after netclass changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/7082
2021-01-13 12:37:20 +00:00
Jon Evans d2d4ffe6d0 Dismiss infobar if it's dismissable on board save
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7071
2021-01-12 23:24:13 -05:00
Barabas Raffai 5931a39c0f Fix layer preset overwriting ratsnest settings
Fixes https://gitlab.com/kicad/code/kicad/issues/6975
2021-01-13 01:22:30 +00:00
Seth Hillbrand 6ed2a831d8 Don't override the router tool with drag actions
Before processing the select tool actions, we check if the router is
currently active and if it is, pass the event for processing in other
tools

Fixes https://gitlab.com/kicad/code/kicad/issues/7021
2021-01-12 15:44:20 -08:00
Dominik Wernberger ad97fabfd3 Add missing const to Matches 2021-01-12 20:51:32 +00:00
Dominik Wernberger dc02ec9758 Remove a few const_cast 2021-01-12 20:51:31 +00:00
Dominik Wernberger 07635d2fc7 Minor adjustments 2021-01-12 20:51:31 +00:00
Dominik Wernberger ac94d72d2d Add more const specifiers 2021-01-12 20:51:31 +00:00
Dominik Wernberger ec0af24f13 Make wxFindReplaceData argument const 2021-01-12 20:51:31 +00:00
jean-pierre charras 76cc7b98a7 Fp editor, DIALOG_PAD_PROPERTIES: do not disable posX and posY settings.
When a pad is locked,  posX and posY settings in DIALOG_PAD_PROPERTIES must
be locked only for the board editor, not in the fp editor.
2021-01-12 20:33:52 +01:00
Seth Hillbrand 2cb8dff650 Use KICAD_DATA for data path lookup in scripting
Fixes https://gitlab.com/kicad/code/kicad/issues/7036
2021-01-12 08:22:17 -08:00
Konstantin Baranovskiy cd2c46e5c9 Make "... file is read only." warnings translatable. 2021-01-12 14:33:35 +00:00
Jeff Young beab68db13 Fix bone-headed error in rules optimization. 2021-01-12 12:46:51 +00:00
jean-pierre charras d4c36230d2 Pcbnew, Graphic items: show the locked status in msg panel and dialog properties. 2021-01-12 10:00:21 +01:00
Jon Evans 01181ccb2f Make sure project is unlinked before deleting it
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7038
2021-01-11 22:17:13 -05:00
Michael Kavanagh a00b9cc821 Icons: general tweaks and pixel alignment
+ minor rename
+ fix missing bitmap in DRC panel
2021-01-11 23:31:25 +00:00
Michael Kavanagh dc83cb7a41 Icons: general tweaks and pixel alignment
+ remove some unused icons
2021-01-11 23:31:25 +00:00
Michael Kavanagh 32f7f30958 Icons: remove where they don't make sense
Also avoid icon reuse
2021-01-11 23:31:25 +00:00