Commit Graph

7726 Commits

Author SHA1 Message Date
Jeff Young e4bab37b62 Don't try and run drawing tools in ModEdit with no module selected.
Fixes: lp:1836673
* https://bugs.launchpad.net/kicad/+bug/1836673

(cherry picked from commit 02eb1d2c62)
2020-05-09 17:41:56 +01:00
Jeff Young 105c9c71ee Don't let point editor interrupt other operations.
Fixes: lp:1832416
* https://bugs.launchpad.net/kicad/+bug/1832416

(cherry picked from commit ae8daee83c)
2020-05-09 17:41:56 +01:00
Jon Evans e135229ca6 Don't try to draw a zone that has no outline
Fixes #4352

(cherry picked from commit 366673d995)
2020-05-07 17:54:00 -04:00
jean-pierre charras d871a92d1c library viewers: fix a focus issue that prevent using arrow keys in lib or fp lists.
Once the gal canvas hsad the focus, it was not possible to use arrow keys in library
or symbols or fp lists even after clicking on an item.

This focus issue is now fixed.

From the fix in Master
2020-05-03 20:23:41 +02:00
jean-pierre charras a152aa125b Footprint editor: fix a crash when a graphic item is selected and the
measurement tool is active and closing the frame, or selecting a new footprint.
I am guessing it was a use after delete data.

Fixes #4302
https://gitlab.com/kicad/code/kicad/issues/4302
2020-05-03 09:03:32 +02:00
Jeff Young e5da7a4606 Fix via printing.
LAYER_VIAS needs to get set for them to print at all, and GetLOD
needs too look at the view layer visibiilties, not the board layer
visibilities.

Also implements a more pad-like strategy for printing blind/buried
vias when printing one layer per page (where the top/bottom arcs
don't make sense).

Fixes https://gitlab.com/kicad/code/kicad/issues/1938

(cherry picked from commit dce42612d3)
2020-04-20 20:29:05 +01:00
Jeff Young faace3090c Add specific selection updating when adding 3D models.
This keeps us from being at the receiving end of wxWidgets' vagaries.

Fixes https://gitlab.com/kicad/code/kicad/issues/3760
2020-04-19 22:43:32 +01:00
jean-pierre charras d3e2345f94 Dxf import: fix a bug that disable import of data inside blocks 2020-04-19 13:32:59 +02:00
jean-pierre charras a3e087ab51 Pcbnew: Fix crashes when delete footprint text in some cases.
Fixes #4221
https://gitlab.com/kicad/code/kicad/issues/4221
2020-04-18 20:00:26 +02:00
jean-pierre charras 3a614a8ea1 Legacy plugin: fix incorrect number of copper layers after loading a .brd file. 2020-04-18 19:58:45 +02:00
Jeff Young b31af4891d Be smarter about determining if there are modules in the selection list.
The old algorithm would delete modules if another module was in the
list, which was not the intention.

Fixes https://gitlab.com/kicad/code/kicad/issues/4175
2020-04-09 00:07:07 +01:00
Seth Hillbrand e6d49424cf PNS: Don't link unroutable items
The joint map only works for items that are routable, so don't bother
adding unroutable items as this only takes additional time to process

Fixes #3976 | https://gitlab.com/kicad/code/kicad/issues/3976

(cherry picked from commit 9769e1020b)

Fixes https://gitlab.com/kicad/code/kicad/issues/4143
2020-04-01 08:31:57 -07:00
Ian McInerney 7a913844e2 Fix discrepancy between ASCII and CSV fp pos files
(based on 570ea62b64)

Fixes https://gitlab.com/kicad/code/kicad/issues/3897
2020-03-30 10:42:15 +01:00
jean-pierre charras f8be7e1f57 Gerber X2 format: Set default values to Enable X2 format 2020-03-29 15:37:36 +02:00
jean-pierre charras 1057eceb2f Gerber plotter: plot round rectangle pads using a region with arcs.
Previously, the region was a usual polygon with arc approximated by segment.
Using a region with arcs is a better way because it allows CAM tools to
identify this region as a round-rect pad.

Similar to master branch, commit 9cb3333d05.
2020-03-22 08:31:25 +01:00
jean-pierre charras 54be07c17d Pcbnew: Set default solder mask min size to 0.
When the solder mask min size is > 0, pads are no longer flashed or regions items.
Good Gerber files need pads flashed or regions items.

Non 0 solder mask min size is reserved to special cases (home made PCBs for instance)

From master branch.
2020-03-12 20:47:21 +01:00
jean-pierre charras 3cc3c1bbd3 Zones: fix a crash when adding a zone cutout to a zone having already holes
From master branch
2020-03-12 14:49:36 +01:00
Seth Hillbrand a60c339f85 PCAD: Handle mirrored text
Mirrored text rotates clockwise in the mirror, so we need to invert the
sign for aligning mirrored PCAD text

Fixes https://gitlab.com/kicad/code/kicad/issues/3992

(cherry picked from commit 058fb3afa1)
2020-03-05 15:29:47 -08:00
Michael Kavanagh ce2c5d6528 Remove empty choice in Via type dropdown
Fixes https://gitlab.com/kicad/code/kicad/issues/3968

(cherry picked from commit 265c1663f9)
2020-03-03 14:21:21 -08:00
Seth Hillbrand fd81f70355 Drop invalid arcs on footprint load
In the case where the footprint arc has a non-normal angle, we cannot
represent this in pcbnew and it corrupts the gerber output.  Therefore
we drop the invalid arc and continue to load the footprint/board.

Fixes #3918 | https://gitlab.com/kicad/code/kicad/issues/3918

(cherry picked from commit 3e0ff72720)
2020-03-02 15:59:35 -08:00
Seth Hillbrand 100bb7c6ca Set Module Editor flag for tools
The commit takes the module edit flag when resetting the tool.  All
tools should reset this flag when we setup the Module editor.

This is slightly different in master and v5, so  this is a rework of
7bdf71abc

Fixes #3973 | https://gitlab.com/kicad/code/kicad/issues/3973
2020-03-02 12:45:47 -08:00
Ben Dooks fc1f713106 Fix issue with DRC for through hole being applied to SMD pads
Commit d7272b7f5e fixed the use of
the eagle DRC to change the library pad shapes. This was also
applied incorrectly to SMD stacks.

Remove the references to m_rules in packageSMD() and the code
that deals with them. eagle 7.7 does not have any SMD pad options
other than rectangle with rounding.

(cherry picked from commit 070c6b8ce0)
2020-02-27 09:01:42 -08:00
Seth Hillbrand 83c3a78e6d pcbnew: Avoid wx scaling error
When drawing to a scaled DC, the window doesn't reflect the expected
size if scaled after.  This causes elements drawn on the edge to reflect
back into the drawing area instead of being cut off.

We can simply scale our own values to avoid this issue.

Fixes #3849 | https://gitlab.com/kicad/code/kicad/issues/3849

(cherry picked from commit 5b6a4d794f)
2020-02-27 09:01:18 -08:00
jean-pierre charras d62fde0d79 Pcbnew, Fix issue when trying to create a drawing (line,circle,arc,polygon):
Display a error message if no free graphic layer is enabled, to switch from
a copper layer.

Fixes #3916
https://gitlab.com/kicad/code/kicad/issues/3916
2020-02-24 19:59:07 +01:00
jean-pierre charras 5c7ac1bb7e ZONE_FILLER: fix incorrect thermal clearance of pads having "not in zone" option. Pads inside a zone of the same net having the "not in zone" option have a "antipad" clearance. The value in this case is the biggest between zone clearance and thermal clearance (the net clearance is 0 betwen items of the same net)
However a bug created a incorrect value, due to the fact the minimal zone width
was incorrectly taking in account in calculations.
2020-02-17 17:12:24 +01:00
jean-pierre charras 8862752523 Remove a fix committed in 6b78fdf by mistake. 2020-02-17 13:00:56 +01:00
jean-pierre charras 6b78fdf822 LOCALE_IO: replace the call to setlocale by a call to wxLocale to switch to "C" locale.
Previously we call only setlocale( xx, "C" ), but it was not enough on Windows.
Now we call wxLocale("C")
wxLocale calls setlocale, but also make some others initialization in wxWidgets.
It fixes some issues related to comma versus point as fp separator.
Especially wxWidgets warnings are no longer thrown, and a one case of incorrect
conversion is fixed.
However, wxLocale( "C" ) also switches the current translations to English, so
loading files can have a slightly different behavior
2020-02-17 09:14:18 +01:00
jean-pierre charras be0f6a6af2 Fp editor: fix: Reference and Value default values aren't saved in Footprint Editor preferences
Fixes #3889
https://gitlab.com/kicad/code/kicad/issues/3889
2020-02-11 15:48:05 +01:00
Jeff Young 5fdc424202 Don't report Eagle errors on the Unrouted layer.
Fixes https://gitlab.com/kicad/code/kicad/issues/3398
2020-02-05 22:20:16 +00:00
Jeff Young 9b74bb5c92 Remove preferred layer disambiguation for multiple modules.
The preferred list isn't actually in use anymore at this point, so
it currently has no effect other than to mess things up since we
aren't keeping track of which modules have been rejected when we
check the module count.

Fixes https://gitlab.com/kicad/code/kicad/issues/3721

(cherry picked from commit d02c0da3ab)
2020-02-05 22:20:16 +00:00
Ian McInerney 7ba8d8b608 Revert eeschema highlighting changes
This reverts commit 366d4d7b0b.
This reverts commit 8b3c0a941c.

Fixes https://gitlab.com/kicad/code/kicad/issues/3866
2020-02-05 11:51:46 +00:00
jean-pierre charras dabd80fe4c Dxf importer: fix issue when importing some "degenerated" splines.
(From master, commit 8f3e8cf)
Sometimes a dxf curve is a "degenerated" bezier curve having only 3 points.
(a control point is at same location as a end point)
This commit fix incorrect import of these curves.

Fixes #3845
https://gitlab.com/kicad/code/kicad/issues/3845
2020-02-03 12:49:45 +01:00
easyw 8b3c0a941c Highlight eeschema symbol on left click
CHANGED: Highlight eeschema symbol on left click

Closes https://gitlab.com/kicad/code/kicad/-/merge_requests/83
2020-02-01 16:08:19 +00:00
qu1ck 798e4c288a Fix polygon shape move
Move vector should not affect start/end points as they are assumed to
always be 0,0. Polygon is defined by outline only.

(cherry-picked from 32674ef360)
2020-01-23 00:40:33 +00:00
Seth Hillbrand 52da7f931b pcbnew: Check before reading/writing cache
The open/create calls can fail so we need to account for this before
using the result that assumes success.

(cherry picked from commit 88729de685)
2020-01-17 18:34:28 -08:00
Ian McInerney fcb6f814de Fix macos plist version string generation
Generate these resource files similar to how it is done one Linux.

Fixes mac-builder issue https://gitlab.com/kicad/packaging/kicad-mac-builder/issues/275

(Cherry-picked from 25a302758e)
2020-01-18 01:44:01 +00:00
Seth Hillbrand 9e6b56d783 PNS: Detect collisions including newline width
The new line collision search uses BBox() to check for colliding
objects.  BBox in the SHAPE_LINE_CHAIN did not include width as the
chains were assumed to be zero-width.  This is not the case for
PNS::LINE elements.

We mostly don't notice this because DRC checks for SEGMENT collisions
but it becomes obvious/annoying when we cannot place a track for unknown
reasons and the snap-back doesn't take line width into account.

Fixes #3776 | https://gitlab.com/kicad/code/kicad/issues/3776

(cherry picked from commit fe15511d38)
2020-01-17 11:26:02 -08:00
Seth Hillbrand 923dad6ca8 PNS: Modify MarkObstacles logic to select shorter
When routing where we hit multiple obstacles, we choose the shortest
path to allow overlapping hits to choose the shorter path, thus giving a
better chance of returning true for the DRC-compliant path.

Fixes #3773 | https://gitlab.com/kicad/code/kicad/issues/3773

(cherry picked from commit 38f13ef481)
2020-01-16 19:58:19 -08:00
Seth Hillbrand 8a2705f81f PNS: Assume the current line is a base before optimizing
We use the cost of the current line before trying to improve the pad
breakout cost when optimizing the smart pads

Fixes #3759 | https://gitlab.com/kicad/code/kicad/issues/3759

(cherry picked from commit 52bfdb9703)
2020-01-12 11:13:19 -08:00
Jon Evans 5b97d70d57 Use existing pcb filename for Save As where possible 2020-01-06 10:33:00 -05:00
jean-pierre charras 87f6f33b37 fix a minor wxWidgets alert. 2019-12-27 20:03:02 +01:00
Jon Evans a5622c93d4 Don't try to write fp-info-cache to a read-only directory
Fixes #1890

(cherry picked from commit 80fb3bde56)
2019-12-25 18:48:21 -05:00
Ian McInerney b6f9bfe9a5 pcbnew: Fix cmake to work with no wxPython on macOS
(cherry-picked from bf5dba847c)
2019-12-25 23:23:31 +00:00
jean-pierre charras 388d74faf4 Pcbnew: graphic polygon: display the points count, instead of length,
and coordinate origin.
Previously, the meaningless length (always 0) and begin and end (@0,0)
coordinates were always displayed.

From master branch.
2019-12-18 13:21:35 +01:00
jean-pierre charras 68d644fd28 P&S router: length tuning tool: fix a crash after trying to tune a track.
It happens on Windows, and wxWidgets 3.1.3. It is created by
PNS_TUNE_STATUS_POPUP instance used in tool. I am pretty sure this crash is
created by the stack switching when managing events, due to some changes in
wxWidgets code.
The fix creates the instance on the heap, instead of on the stack.
This is not the first time I see this kind of issue.

From master, commit 21dd8db
2019-12-12 10:26:27 +01:00
jean-pierre charras f6e33450ff Gerber object attribute: avoid trying to guess if a SMD pad is a BGA pad.
Previously, if a SMD pad was round, itb was seen as BGA pad.
But this is not always true. so use always SMD PAD attribute,
until an explicit BGA pad attribute is added in Pcbnew
2019-12-11 08:55:44 +01:00
Fabien Corona 58fd6ac03e PCBnew: placing a blind/buried via sometimes incorrectly place a through via.
From master branch commit 36fba5bd7f
2019-12-08 13:31:21 +01:00
Seth Hillbrand 1e64524afb PNS: Allow snap to temp hidden
The IFACE for kicad refers to the board hidden state, not the
temporarily hidden state used by the router.  We allow snapping to items
that have been removed by the temporary router state to provide snapping
to original track location.

Fixes #1827 | https://gitlab.com/kicad/code/kicad/issues/1827
2019-12-07 09:49:59 -08:00
Seth Hillbrand 20a5d8effd pcbnew: Handle intermediate pad on route
The length calculation wanted to find start/end pads but this was
complicated for paths that had a via on the intermediate pad.  Instead
of warning, we calculate the longest path of the three possibilities

Fixes: lp:1838261
* https://bugs.launchpad.net/kicad/+bug/1838261

Fixes #2554 | https://gitlab.com/kicad/code/kicad/issues/2554
2019-12-04 13:46:09 -08:00
jean-pierre charras 8c7e0bcb0a DIALOG_DRC_CONTROL: fix a crash on wxWidgets 3.1.3
Happens when right clicking on an item in displayed lists.
The crash was due to a bug in wxWidgets, and the fix is only a workaround

From commit 5cd7f3fd in master branch.

Also remove duplicate code.
2019-12-03 09:47:42 +01:00