Commit Graph

7761 Commits

Author SHA1 Message Date
jean-pierre charras e04d82e940 Gerber plot: minor fixes in TO object attributes.
Gerbview: remove a outdated warning about RS274D format.
2019-11-05 14:25:30 +01:00
Jeff Young 37f23fa537 When copying an item it's no longer at the original location and so can't be "locked".
Fixes: lp:1851038
* https://bugs.launchpad.net/kicad/+bug/1851038
2019-11-03 17:43:36 +00:00
Seth Hillbrand 167d408b5e qrcode: Handle Python3 integer promotion
In Python3, all division operators promote integers to floats.  We need
to downcast back to integer for the polygon vertices.

There was also an unhandled overflow in the QR generation that allowed
more than 512 bits to be loaded.  This overflows the type of QR we
generate, so this truncates the input string to 62 bytes ( leaving 12
bits for the checksum )

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

(cherry picked from commit 9bccbaf497)
2019-11-01 14:57:07 -07:00
Jeff Young d4a8ff4872 Backported edit point colour fix from master.
Fixes: lp:1846372
* https://bugs.launchpad.net/kicad/+bug/1846372
2019-10-31 23:35:23 +00:00
jean-pierre charras fb9b12a982 Footprint editor: fix a crash when trying to edit the properties of a footprint not yet in tree (i.e. imported from file)
(cherry picked from commit cee1873fff)

Fixes: lp:1850497
* https://bugs.launchpad.net/kicad/+bug/1850497
2019-10-29 13:13:54 -07:00
Seth Hillbrand 57f0f88552 pcbnew: Treat circular ovals as circles
The oval clearance adds an edge on the 0-length side of a circular oval.
This is not needed and can affect the fill algorithm.  Instead, we treat
round ovals as circles for pad polygons

Fixes: lp:1849846
* https://bugs.launchpad.net/kicad/+bug/1849846
2019-10-25 09:28:09 -07:00
jean-pierre charras 42a0cf6283 PCB_BASE_FRAME::SelectFootprintFromLibTree(): fix annoying issue: the progress reporter was displayed after loading libraries, because it was destroyed too late. 2019-10-25 18:08:02 +02:00
Seth Hillbrand b67acd5ea1 pcbnew: Fix 45° snapping polygons
The constrained draw was constraining the polygon size to fit the
existing points rather than extending the existing points to fit the
user's intent.

This adds a 90° double-joint for the completion polygon that allows the
user to complete common constrained polygons visually based on the
preview with a double-click to finish.

(cherry picked from commit bae50fab9f)

Fixes: lp:1849299
* https://bugs.launchpad.net/kicad/+bug/1849299
2019-10-24 16:05:27 -07:00
jean-pierre charras fb1570d290 DIALOG_POSITION_RELATIVE_BASE: fix wxWidget alerts 2019-10-23 20:41:00 +02:00
Seth Hillbrand 79972ad4db pcbnew: Fix DXF Import with blocks
BLOCK elements in DXF are re-usable bits that are useful when editing
the file but should not be shown when importing the model.  This skips
all references except those that exist in the default "*Model_Space".
This block is required in each DXF file and cannot be renamed.

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

(cherry picked from commit df3fabfa21)
2019-10-23 11:31:43 -07:00
Ian McInerney 61934c285c pcbnew: Fix deletion of vias in global delete window
Fixes: lp:1847580
* https://bugs.launchpad.net/kicad/+bug/1847580

(cherry picked from commit 3b1817ee32)
2019-10-23 12:25:00 -04:00
jean-pierre charras fda403a079 Fix potential issue 2019-10-21 08:26:22 +02:00
Seth Hillbrand 322eb2b8a8 pcbnew: Commit polygon points to new constrained zone
Adds leader points if they are not already existing in the zone

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

(cherry picked from commit 2e1af66a2b)
2019-10-20 10:31:08 -07:00
Seth Hillbrand 5d852cf6ae pcbnew: Don't limit editing of the polygons
45 deg contraints are not saved per polygon, so don't limit per polygon.
The constraint is only enforced during creation.

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

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

(cherry picked from commit 8f1c1cf298)
2019-10-20 09:31:26 -07:00
Seth Hillbrand 17c0b3e460 pcbnew: Check all layers for routing snaps
Flipped footprint pads may report their "primary" layer as not the front
layer in high contrast.  We need to check whether the board item for
snaps is visible on the active layers.

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

(cherry picked from commit 07c8596084)
2019-10-15 09:46:39 -07:00
Seth Hillbrand d931bc72c7 pcbnew: Snap during routing needs active parent
The router items may not yet have a board item parent.  In this case,
the reference to the parent needs to be guarded before dereferencing.

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

(cherry picked from commit 0f8a1c22ad)
2019-10-11 09:16:58 -07:00
jean-pierre charras 6506f77689 Gencad export: fix an issue in hash_eda calculation,
that can generate the same hash for 2 different footprints.
Therefore, for some footprints, the right footprint was not associated to the component.
The hash calculation was using a XOR to combine 2 sub hash values.
This is not a reliable way to combine these hash values.
They are now added.
Looks better to identify similar and different footprints.

Fixes: lp:1847575
https://bugs.launchpad.net/kicad/+bug/1847575
2019-10-10 20:20:45 +02:00
Seth Hillbrand 0d64b38dbc pcbnew: Remove snapping to hidden items
Items and layers that are hidden in the view should not be used as snap
points.  This happens in multiple locations:
1) Grid Helper for normal tools
2) TOOL_BASE::snapToItem for router

Resolves KiPro Issue #116

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

(cherry picked from commit cecfeea947)
2019-10-10 09:47:34 -07:00
jean-pierre charras 0210e414d2 Fp editor, DIALOG_FOOTPRINT_FP_EDITOR: fix a very annoying issue: the value field was copuled to the fp name. Unlike schematic symbols, the value field and the footprint name are 2 different fields. So coupling these fields in the DIALOG_FOOTPRINT_FP_EDITOR dialog created serious issues.
Fixes: lp:1846533
https://bugs.launchpad.net/kicad/+bug/1846533
2019-10-09 18:58:23 +02:00
jean-pierre charras 41231e8ae2 Gerber file generation: fix incorrect aperFunction attribute for graphic items on edge cut layer.
Was NonConductor. Must be Profile.
From master branch.
2019-10-09 16:02:45 +02:00
Ian McInerney 3442cc3d1a pcbnew: Don't reset router settings when breaking a track
Calling Init() in an action routine will reset the router
settings to the state they were in when first starting pcbnew.
The Init() function is automatically called when the tool is created.

Fixes: lp:1843810
* https://bugs.launchpad.net/kicad/+bug/1843810
2019-10-07 16:10:22 -04:00
Ian McInerney e618e34c94 pcbnew: Clean up extension handling in graphics plugins
* Fix wildcard display in the file selector dialog (on GTK
  it would show the regex to the user)
* Move the file extension comparison into a common function

(cherry picked from commit b33c3a5ad8)
2019-10-04 16:01:15 -04:00
jean-pierre charras 78af1daa2e Fix an issue in DIALOG_NETLIST: if the netlist filename does not exist, one cannot always modify the entered name.
(from master branch)
2019-09-30 19:43:25 +02:00
Seth Hillbrand d862cdaa72 pcbnew: properly close tags when handling bad poly
The parenthesis depth is 2 when the polygon isn't closed.  This
shouldn't happen but we have the fall-through to handle odd cases

Fixes: lp:1844872
* https://bugs.launchpad.net/kicad/+bug/1844872
2019-09-21 09:25:16 -07:00
Seth Hillbrand 4f57de9688 connectivity: Use pad anchor for connections
The pad should use its anchor point rather than the geometrical center
of the pad for connections.
2019-09-19 13:25:26 -07:00
Seth Hillbrand 92b6e05909 connectivity: Check all anchors for connection
With pads, we should check available anchor points for each connection,
increasing probability of finding connection to match fill algorithm

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

(cherry picked from commit b7128639f8)
2019-09-19 12:46:03 -07:00
jean-pierre charras 4db8638f7e PANEL_SETUP_NETCLASSES: fix not working (immediately closed) wxChoice widgets to select a filter This happens with wxWidgets 3.0.4 on Windows and is a side effect of a call to Layout(). The fix just calls Layout() only when needed.
Fixes: lp:1843594
https://bugs.launchpad.net/kicad/+bug/1843594
2019-09-13 11:53:03 +02:00
Jeff Young cec885daf9 Partial cherry-pick of f1790c24e5.
Fixes: lp:1842199
* https://bugs.launchpad.net/kicad/+bug/1842199
2019-09-12 22:15:36 +01:00
Jeff Young f1e6f8042c Check for dup layer names in the GUI, not in the internals.
Doing so in the internals keeps users from being able to swap layer
names as the dialog does each layer name change individually.

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

(cherry picked from commit f491b7fff7)
2019-09-07 23:57:49 +01:00
Wayne Stambaugh 6d4dd3e17a Pcbnew: fix size of graphics import warning dialog.
Use the HTML_MESSAGE_BOX window to present the warning messages rather
than wxMessageBox which would overflow the display when there were a lot
of graphic items that could not be parsed.

Fixes lp:1839565

https://bugs.launchpad.net/kicad/+bug/1839565

(cherry picked from commit 24454f5105)
2019-09-06 14:59:40 -04:00
Jeff Young 0e90c719b0 Update description in footprint tree when it's edited.
Fixes: lp:1842660
* https://bugs.launchpad.net/kicad/+bug/1842660

(cherry picked from commit 6688e80131)
2019-09-04 17:24:17 +01:00
jean-pierre charras a79526cad8 Footprint viewers: force cairo canvas instead of legacy canvas when the legacy canvas is selected in the board editor.
Legacy canvas does not work in footprint preview panel and does not work fine in footprint viewer frame.

Fixes: lp:1842483
https://bugs.launchpad.net/kicad/+bug/1842483
2019-09-04 16:00:54 +02:00
jean-pierre charras d05d8b6100 Pcbnew: Fix incorrect canvas type saved in config, when the type is legacy canvas. 2019-09-04 11:22:55 +02:00
Ian McInerney 19064b680e Make the extension check for graphics import case insensitive
The regex for the file extension that matches against all case
possibilities is only built on Linux.

Fixes: lp:1842180
* https://bugs.launchpad.net/kicad/+bug/1842180
2019-09-02 10:03:39 +02:00
jean-pierre charras 95265c765b Pcbnew, DIALOG_TEXT_PROPERTIES: make lines thickness editable when editing a dimension.
From Master branch (commit 762dabd7)

Fixes: lp:1841797
https://bugs.launchpad.net/kicad/+bug/1841797
2019-09-02 10:03:39 +02:00
Jeff Young 1ed8912f57 Workaround an issue where a throw terminates (even when there's a catch for it).
You can trigger it before this fix by running Cvpcb when a .kicad_mod file is
incorrectly set as "Legacy" in your footprint table.

(cherry picked from commit e269b5d1b9)
2019-09-01 12:37:58 +01:00
Jeff Young 82a0eb4413 Use Move() instead of SetPosition() so that the second pt gets updated too.
Fixes: lp:1841989
* https://bugs.launchpad.net/kicad/+bug/1841989

(cherry picked from commit 315a99e0fe)
2019-08-30 23:32:54 +01:00
Jeff Young be7215402b Partial cherry-pick of 79d062aefc. 2019-08-30 13:47:39 +01:00
Seth Hillbrand 4500b064d8 Handle active layer overloading
Setting the active layer should be tied to the events that are triggered
by the layer change and overloaded for each frame.  This ties the hotkey
back to these events.

Note: In the 5.1 cherry-pick this also adds the missing hotkey to
footprint editor

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

(cherry picked from commit 494d0de9b8)
2019-08-28 05:57:48 -07:00
jean-pierre charras 93d191d7c9 fix compil error 2019-08-28 10:05:25 +02:00
Jeff Young 5b24ea9dd9 Clearance should be in mils, not inches.
Fixes: lp:1841360
* https://bugs.launchpad.net/kicad/+bug/1841360

(cherry picked from commit 7c85dc6cd7)
2019-08-27 21:15:54 +01:00
Jeff Young 86691dabbf Partial cherry-pick of 03da721030.
Fixes: lp:1841361
* https://bugs.launchpad.net/kicad/+bug/1841361
2019-08-27 18:16:25 +01:00
Seth Hillbrand fe71a66bb9 pcbnew: Force resize event when changing pad type
The local settings panel needs to have its children sized when shown.
Triggering a resize event on changing the pad shape accomplishes this.
This is not triggered in master due to refactor of the custom pad
connection options.

Fixes: lp:1837789
* https://bugs.launchpad.net/kicad/+bug/1837789
2019-08-27 05:55:04 -07:00
Seth Hillbrand 8b3a2984bf pcbnew: Two layer boards need both masks
Adds the missing default layer to the default board setups for two
layers with parts on single side (either top or bottom)

Fixes: lp:1841294
* https://bugs.launchpad.net/kicad/+bug/1841294
2019-08-26 17:14:13 -07:00
Seth Hillbrand fccce265aa pcbnew: Retain 45° constraint
This also finishes the polygon with 45° lines when chosen as a create
option.

Fixes: lp:1833673
* https://bugs.launchpad.net/kicad/+bug/1833673
2019-08-26 14:33:30 -07:00
Seth Hillbrand a43a228f78 eagle: Set module-relative position of ref/val
We need to set the footprint local coordinates of the footprint
reference and value fields at instantiation separately from the
TEXT_DIVERS elements.

Fixes: lp:1829727
* https://bugs.launchpad.net/kicad/+bug/1829727
2019-08-26 09:56:42 -07:00
Seth Hillbrand b991beb712 pcbnew: Fix error in connecitivty calculation
Point in polygon should test against half the stroke width as the stroke
is performed _on_ the polygon edge.

(cherry picked from commit 820c2d2722)
2019-08-23 10:52:11 -07:00
Seth Hillbrand d19ec021fe PNS: Check that we are optimizing a pad
Vias are also sent to breakout optimizer, so we need to check for the
solid cast before dereference.

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

(cherry picked from commit 03d5bf0df5)
2019-08-22 09:03:12 -07:00
Seth Hillbrand b34a307936 pcbnew: Scale line width for import
The line width in the import dialog is meant to reflect the resulting
width and not the given width of the file.

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

(cherry picked from commit 22fdc7f51f)
2019-08-21 10:35:40 -07:00
Seth Hillbrand fb565caf7b pcbnew: Optimize pad connection revision
This modifies that logic for optimizing pad connections.

1) Custom pads now prefer the connections to their longer side.  This is
particularly important to match the behavior in a rectangular pad
2) Costs for straight lines are non-zero.  This favors fewer connections
3) Custom pad breakouts are at the polygon boundary rather than offset
by 0.1mm.  This also matches the circular and rectangular paradigm.
4) Line Heads contained in the pad itself are not optimized.  This
prevents escaping the pad unnecessarily

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

(cherry picked from commit 06cb21cc47)
2019-08-20 19:37:59 -07:00
Jeff Young 73851e962b Implement undo/redo for lock/unlock/toggle lock.
Fixes: lp:1840770
* https://bugs.launchpad.net/kicad/+bug/1840770

(cherry picked from commit b219fbc3d2)
2019-08-20 16:42:20 +01:00
Jeff Young de22204514 Allow mouse drag to initiate a router drag if over a track or via.
Fixes: lp:1840694
* https://bugs.launchpad.net/kicad/+bug/1840694

(cherry picked from commit 1bfefc61ea)
2019-08-19 23:32:56 +01:00
jean-pierre charras 06bde527d5 Pcbnew, layer manager: fix flicker when loading a file, and incorrect size on start when no file is loaded
From master, commit b25ffc0
2019-08-19 10:58:45 +02:00
Erik Bosman dcd31f5701 Fix a null-pointer dereference in 5.1 branch
TRACK::GetEndNetCode() can get called using a NULL-pointer as 'this'.
The compiler assumes this won't happen and optimizes away a NULL pointer
check at the start of the function (so we might as well remove this check.)

Fixes: lp:1840562
https://bugs.launchpad.net/kicad/+bug/1840562
2019-08-18 14:59:58 +02:00
Seth Hillbrand 2dd7a8637c pcbnew: Handle edge cuts in footprints for bbox
The Board bounding box calculation has two modes: edges only and
everything.  While the everything mode works as expected, the edges only
calculation (and everything that depends on it) was seeing only the edge
cuts on the board drawings layer and not the footprint edge cuts.

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

(cherry picked from commit 99859727e8)
2019-08-16 11:14:14 -07:00
Seth Hillbrand 84db5644d6 pcbnew: Adjust drag snapping to avoid start
When dragging, you will seldom want to snap to the original item.  This
commit prevents the "size of track" snap to the original item and
replaces it with an auxilary grid origin for the snap.  This means
effectively that the snap will happen to grid for the original item
unless the cursor is closer to the original item line than it is to the
grid crossing.

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

(cherry picked from commit 0de25e557b)
2019-08-15 12:43:19 -07:00
Seth Hillbrand fc1fb7a590 PNS: Don't allow routing on hidden layers
If the layer is not shown, we should not be allowing it's items to be
selected and chosen as the start/end items in the router.
2019-08-15 12:38:16 -07:00
Jeff Young 3475bfb2aa New move tool doesn't require GetAndPlace to jump through hoops.
And at least one of those hoops leaves the cursor forced.

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

(cherry picked from commit dd938b02df)
2019-08-13 10:02:57 +01:00
jean-pierre charras f9f8fade89 Pcbnew plot: fix missing footprint texts on solder mask layers.
Fix from master branch commit 1c295d46a9
2019-08-13 09:55:11 +02:00
Jeff Young e404fb772b Invoke move by ACTION; the EDIT_TOOL does lots of other stuff too.
Fixes: lp:1839877
* https://bugs.launchpad.net/kicad/+bug/1839877

(cherry picked from commit f3f0a6899f)
2019-08-12 23:00:55 +01:00
Jeff Young 3f91db25d4 Minimal cherry-pick of c836cc9cf8.
Fixes: lp:1839534
* https://bugs.launchpad.net/kicad/+bug/1839534
2019-08-10 22:27:05 +01:00
Jeff Young 72c0267fe6 Ativate delete tool so it can display the selection clarification menu when needed.
Fixes: lp:1835371
* https://bugs.launchpad.net/kicad/+bug/1835371

(cherry picked from commit c60118b6a4)
2019-08-03 22:49:27 -06:00
Seth Hillbrand c9956def36 pcbnew: Fix copy-paste error from 161dc9ce7
create_vrml_shell() needed the idxSide check but create_vrml_plane only
had an extra variable that wasn't used and so shouldn't be checked.
2019-08-02 13:14:02 -07:00
Jeff Young d482a8805c Perform better cleanup after cancelling text placement.
Fixes: lp:1838452
* https://bugs.launchpad.net/kicad/+bug/1838452
2019-07-31 23:17:08 -06:00
Seth Hillbrand 161dc9ce7e pcbnew: Fix VRML export checking
In rare cases, the VRML triangulator may claim to work but return empty
vectors.  These cases need to be caught before we dereference the vector
elements.

Fixes: lp:1838448
* https://bugs.launchpad.net/kicad/+bug/1838448
2019-07-31 20:03:49 -07:00
jean-pierre charras 090073cc3b Pcbnew, exchange footprints: fix a bug that prevent the new footprint to be at the right place.
Fixes: lp:1838446
https://bugs.launchpad.net/kicad/+bug/1838446
2019-07-31 12:07:49 +02:00
Ian McInerney 6ae718e4d6 pcbnew: Fix DXF units in drill map plotting
Fixes: lp:1836924
* https://bugs.launchpad.net/kicad/+bug/1836924

(cherry picked from commit 6c401ecce7)
2019-07-30 17:20:38 -04:00
Thomas Pointhuber 783b1cb611 Fix handling of filled circle in eagle importer (was only partly fixed)
Partly fixed in 4fc692f04b, but missed
that there is a loadPlain where I need to handle this case as well.

(cherry picked from commit 5f438b7a85)
2019-07-30 15:33:39 -04:00
Jeff Young 4b01f80e8d Fix typo in cherry-pick.
Fixes: lp:1838006
* https://bugs.launchpad.net/kicad/+bug/1838006
2019-07-30 11:49:06 -06:00
Jeff Young c8278f377b Alternative to cherry-picking b70df18939.
Fixes: lp:1838158
* https://bugs.launchpad.net/kicad/+bug/1838158
2019-07-29 20:19:46 -06:00
jean-pierre charras c8f40e1d26 PANEL_SETUP_NETCLASSES_BASE: fix minor wxAlert. 2019-07-28 13:26:58 +02:00
jean-pierre charras 185a8d7582 Try to fix UI issues in select layer pair dialog and slect layer dialog.
Fixes: lp:1838173
https://bugs.launchpad.net/kicad/+bug/1838173
2019-07-28 12:55:47 +02:00
Jeff Young 6aeedfb70c Partial cherry-pick of 3904d7ccfc.
Fixes: lp:1838006
* https://bugs.launchpad.net/kicad/+bug/1838006
2019-07-26 20:46:12 -06:00
jean-pierre charras 7df05ade4c Pcbnew: Fix bug in MODULE::FindPadByName( const wxString& aPadName ). This method was using a case insensitive comparison to find the pad matching aPadName. But in netlist we are using case sensitive comparisons to attribute a net to a pad. So if in the netlist there is a pad name that does not match any footprint pad name using case sensitive comparison but if it matches some pads using case insensitive comparison, the net is not set, but the test to detect non existing pads fails. 2019-07-25 17:57:38 +02:00
Jeff Young ca0d4511a9 Copy ratsnest flags when exchanging modules.
Fixes: lp:1834214
* https://bugs.launchpad.net/kicad/+bug/1834214

(cherry picked from commit 2ca379b281)
2019-07-21 20:27:12 -06:00
Jeff Young b56855c542 Don't shove stitching vias.
Whether or not it's a good idea, the current algorithm doesn't support
it and leaves them on top of each other.

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

(cherry picked from commit aa4d7682ca)
2019-07-21 16:41:56 -06:00
Jeff Young 72e8eb3b94 Initialize plot with aux origin checkbox.
Fixes: lp:1836923
* https://bugs.launchpad.net/kicad/+bug/1836923

(cherry picked from commit b5e01ea163)
2019-07-20 07:58:43 -06:00
Jeff Young 281a1cdc2c Update DXF units drop-down.
Fixes: lp:1836927
* https://bugs.launchpad.net/kicad/+bug/1836927

(cherry picked from commit 4a1edf581e)
2019-07-20 07:58:38 -06:00
Seth Hillbrand e0589d2908 pcbnew: Make clearance translucent
This sets the clearance outline to a slightly better opacity to allow
viewing of items behind the routed track clearance.  Future work should
include making this a configuration option.

Fixes: lp:1826719
* https://bugs.launchpad.net/kicad/+bug/1826719
2019-07-18 10:44:44 -07:00
Jeff Young dfd53976d4 Fix double-highlighted radio buttons on GTK.
Fixes: lp:1836538
* https://bugs.launchpad.net/kicad/+bug/1836538
2019-07-17 12:57:21 +01:00
Ian McInerney 02d43be93c pcbnew: Make the netlist class panel usable with a lot of classes
Fixes: lp:1826154
* https://bugs.launchpad.net/kicad/+bug/1826154

(cherry picked from commit 39954b20fe)
2019-07-15 06:12:13 -07:00
jean-pierre charras 2e8bceb676 Fix a minor wxWidgets alert, already fixed in master branch. 2019-07-15 12:27:54 +02:00
Jeff Young 16f9e697ab Allow edits to self-intersecting polygons.
1) Intermediate states might be self-intersecting, and we shouldn't
be policing our users on what order to do things in
2) The polygon might already be self-intersecting, at which point we're
preventing the user from fixing it.

Also includes better const management for SHAPE_POLY_SET API.

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

(cherry picked from commit a3c74051c2)
2019-07-14 18:36:47 +01:00
jean-pierre charras 269f88ee28 Fix incorrect handling of unicode chars (non ASCII7) in filenames in .gbrjob files. 2019-07-14 11:19:03 +02:00
Jeff Young f11d950448 Don't let visibility bit get nuked when updating effects.
Fixes: lp:1836183
* https://bugs.launchpad.net/kicad/+bug/1836183

(cherry picked from commit 6c9e34e799)
2019-07-11 23:01:54 +01:00
Jeff Young 6ba2c44e88 Add FootprintExists() which can be more careful about FS differences.
(And in particular, MSW's case-insensitive FS.)

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

(cherry picked from commit 20036f8105)
2019-07-11 23:01:25 +01:00
Jeff Young d1ed4665de OSX compiler didn't like the other syntax.
(cherry picked from commit f14e41133b)
2019-07-11 12:35:11 -07:00
Seth Hillbrand 5b68cfa018 Fix import graphics routines and tests
The returns of KiCad file extensions on GTK contain basic regex matching
case-insensitive file extensions.  We need to match these in the
provider and tests

(cherry picked from commit 1956c074ba)
2019-07-10 10:47:13 -07:00
Seth Hillbrand 85f88b6b05 Fix case-sensitive import using KiCad std
Fixes: lp:1832853
* https://bugs.launchpad.net/kicad/+bug/1832853

(cherry picked from commit 79e2000af4)
2019-07-10 10:33:03 -07:00
Seth Hillbrand ea467441d2 import_gfx: Make file selection case-insensitive
This adds the upper-case version of files names to the selection box for
filesystems that support case-sensitive file names.

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

(cherry picked from commit 36f70704eb)
2019-07-10 10:32:48 -07:00
Ian McInerney 40ba502853 pcbnew: Clean up warnings with unit handling in the DXF export
(cherry picked from commit ff9d899ae0)
2019-07-10 12:42:54 -04:00
Jeff Young 2ba237ec12 Test for crash bug fix. 2019-07-08 15:34:01 +01:00
Jeff Young 01a343f28e Fix crash when re-entering a drag operation with a move.
Fixes: lp:1834111
* https://bugs.launchpad.net/kicad/+bug/1834111
2019-07-05 02:24:15 +01:00
Jeff Young 85220591e2 Fix bugs in keyboard cursor movement.
1) Generate refreshPreview events so the modern toolset doesn't
fall behind by one event (see LP:1818667)
2) In the legacy toolset don't call unimplemented routines and don't
snap to grid on the non-movement axis.
2019-07-05 01:32:15 +01:00
Jeff Young 26c92eaf0f Give up on KillFocus validation.
wxWidgets sends the KillFocus event before the Cancel button event,
and it sets the receiving-focus window pointer to NULL (so you can't
even check for it being the Cancel button.  Last time around (with
the UNIT_BINDER) I also tried a bunch of hacks for whether the window
pointer is NULL, etc., but they aren't discriminatory either.

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

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

(cherry picked from commit 1c30f3d9a9)
2019-07-02 18:13:27 +01:00
Jeff Young 3b98b00d6f Only warn once in KillFocus for each error value in footprint name.
More than that just gets annoying, and there is at least one edge case
which throws us into an infinite loop if we don't have something to
break us out.

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

(cherry picked from commit 29db6152b3)
2019-07-02 00:48:57 +01:00
Jeff Young ce329e13fb Set library selection when pre-loading the Footprint Viewer.
Fixes: lp:1826932
* https://bugs.launchpad.net/kicad/+bug/1826932

(cherry picked from commit 8efe8d1835)
2019-07-01 22:17:57 +01:00
Seth Hillbrand be9cd98cb1 Move zone refill to action
This unifies the zone refill across architecture into the tool-based
architecture.  Also provides ZONE_FILLER-based progress managment for
tools.
2019-07-01 09:16:32 -07:00
Seth Hillbrand 3974c6fd89 Enforcing rational limits on length tuner
The length tuning dialog needed validators on close to prevent negative
and percentages >100%

Fixes: lp:1834734
* https://bugs.launchpad.net/kicad/+bug/1834734
2019-06-29 09:37:47 -07:00
Seth Hillbrand bf1ced4184 Allow more segments for large-arc footprints
When approximating arcs for polygons, we should allow for large radius
arcs/circles without coarsening the arc beyond a limit.  This is a
5.1.x-only patch to address this issue.  It should not be picked to
master as this is already addressed separately by max_error
2019-06-28 19:25:42 -07:00
Seth Hillbrand cabfcbc73c pcbnew: Drop tracks not on copper
We do not allow non-copper routed tracks and they will break assumptions
elsewhere in the code.  We drop them in the beginning so that they are
not saved.
2019-06-28 19:25:28 -07:00
Wayne Stambaugh 574473c480 Pcbnew: fix clean up tracks and vias segfault bug.
If a track has no connected items, do not attempt to access an empty
connected item map.

Fixes lp:1823973

https://bugs.launchpad.net/kicad/+bug/1823973
2019-06-28 13:12:23 -04:00
jean-pierre charras 17143fd53f Pcbnew, connectivity: fix incorrect detection of dangling track ends when a end is inside a zone.
This end was not detected as connected by the IsDangling method
2019-06-28 15:27:01 +02:00
Jeff Young b8fff99e68 Hook up zone-connection controls in Edit Footprint dialog.
Fixes: lp:1834629
* https://bugs.launchpad.net/kicad/+bug/1834629
2019-06-28 12:26:28 +01:00
jean-pierre charras 032bda223e Gerber drill file: Modify a aperture attribute for oblong holes (slots).
Oblong holes (slots) use now a aperture attribute similar to round holes.
(The previous attribute "slot" is now deprecated)
However they have a specific aperture, and a comment is added in drill files for these apertures.
2019-06-26 17:53:09 +02:00
Wayne Stambaugh df3a57dcda Symbol and footprint library table editor fix.
Prevent the symbol and footprint library table editors from substituting
the current project path (${KIPRJMOD}) when adding libraries to the global
library table.  This will almost assuredly fail when opening a different
project.  We still allow users to manually use ${KIPRJMOD} in global table
paths under the assumption that if they are typing this in then they most
likely understand environment variable substitution.

Fixes lp:1830694

https://bugs.launchpad.net/kicad/+bug/1830694

(cherry picked from commit 288982b15d)
2019-06-25 08:46:27 -04:00
Seth Hillbrand e8ce0ba6ef pcbnew: Avoid wxassert in message
wxstring::Printf() needs size_t cast to acceptable type or it gives an
assertion in debug mode.
2019-06-24 09:42:06 -07:00
Wayne Stambaugh d8fff5c820 Footprint library nickname comparison fixes.
Footprint library nicknames are case sensitive but the comparison for
the library tree control was case insensitive.

Also make the footprint name comparisons case sensitive as well.  While
not strictly necessary, the plan is to start using the name defined in
the footprint file instead of the file name which will allow for case
sensitivity.

Fixes lp:1833701

https://bugs.launchpad.net/kicad/+bug/1833701
2019-06-24 08:00:21 -04:00
Jeff Young f214cfae12 Don't try to show sub-dialog in OnActivate(). High Sierra asserts.
Fixes: lp:1832635
* https://bugs.launchpad.net/kicad/+bug/1832635
2019-06-23 15:39:05 +01:00
Seth Hillbrand febc8cd6aa pcbnew: Ensure save dialog with zones
Fixes: lp:1833748
* https://bugs.launchpad.net/kicad/+bug/1833748
2019-06-22 08:45:00 -07:00
Seth Hillbrand 463e061740 Clear non-copper edge rounding
Non-copper zones do not have a fillet/chamfer option, so we need to
clear it before the zone tool uses the last-used option.

Fixes: lp:1833672
* https://bugs.launchpad.net/kicad/+bug/1833672
2019-06-22 08:25:38 -07:00
Seth Hillbrand f25ae373bb Fixup previous move commit
The previous commit missed a case where the number was so large that it
overflowed the integer invalidating the comparison.  This protects
against that case by using floating point comparison.
2019-06-20 06:46:41 -07:00
Seth Hillbrand 845833e8fd pcbnew: Enforce maximum movement in Move Exact
This checks the movement against a maximum value that would place the
selection outside of the valid area for the footprint or board.

Fixes: lp:1833478
* https://bugs.launchpad.net/kicad/+bug/1833478
2019-06-20 06:29:53 -07:00
Seth Hillbrand ba97494d6f Update toolbar to get new icon/tooltip
After a save-as the footprint belongs to the library, we need to refresh
the toolbar to get the correct icon.

Fixes: lp:1826889
* https://bugs.launchpad.net/kicad/+bug/1826889
2019-06-18 19:24:47 -07:00
Jeff Young 1996fba8a6 Check for a tree selection before checking it against the board item.
Fixes: lp:1833295
* https://bugs.launchpad.net/kicad/+bug/1833295
2019-06-19 00:11:23 +01:00
Seth Hillbrand 909a25c147 pcbnew: Correct polygon flipping in custom pads
Custom pads are referenced to the anchor pad 0-point, so flipping the
polygon should be about 0 and not the flip point.

Fixes: lp:1831311
* https://bugs.launchpad.net/kicad/+bug/1831311
2019-06-17 15:26:56 -07:00
Ian McInerney b377b5bbed pcbnew: Fix invalid hotkeys 2019-06-17 08:11:01 -04:00
Wayne Stambaugh 8002692f3e CvPcb: fix save changes dialog layout issue.
DIALOG_EXIT was not being laid out correctly after setting the dialog
message.  Rather than fix our custom DIALOG_EXIT, wxMessageDialog and
wxRichMessageDialog were substituted as direct replacements for all
of the variants of DIALOG_EXIT.  This make message dialogs appear more
consistent because wxMessageDialog uses the default platform message
dialog and wxRichMessageDialog uses the default platform rich message
dialog on windows.

Remove DIALOG_EXIT_BASE as it is no longer required.

Fixes lp:1832899

https://bugs.launchpad.net/kicad/+bug/1832899

(cherry picked from commit 3f665318f4ab5c02b7d3c29b5233a273fdac2e4e)
2019-06-16 12:28:35 -04:00
Ian McInerney 44f1059000 Allow DXF to be exported in either inches or millimeters
Fixes: lp:1832188
* https://bugs.launchpad.net/kicad/+bug/1832188

(cherry picked from commit d5f680ecd2)
2019-06-13 16:10:12 -07:00
Ian McInerney cf4b41f7d9 pcbnew: Update plot dialog to contain a unit selector for DXF
(cherry picked from commit b2c848579a)
2019-06-13 16:10:03 -07:00
Ian McInerney 71f5f96e64 Remove help from F1 key and move it to an action
Create a new action in pcbnew, gerbview and the footprint viewer/
editor to display the help documentation. Disconnect the wxID_HELP
event from the window so that it no longer conflicts with the zoom
action.

Fixes: lp:1822041
* https://bugs.launchpad.net/kicad/+bug/1822041
2019-06-13 14:11:24 -04:00
Steven A. Falco cfa187f477 Show the current grid setting. 2019-06-13 12:14:41 -04:00
Seppe Stas 9233ae97d0 Set KiCad version in MacOS apps
Uses CMake's configure_file function [1] to automaticaly set the
CFBundleShortVersionString [2] value in every app's Info.plist file.

Also updates the CFBundleLongVersionString and CFBundleVersion with the
extended KiCad Version

[1]: https://cmake.org/cmake/help/latest/command/configure_file.html
[2]: https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring

(cherry picked from commit 455ee4c08c)
2019-06-12 14:12:01 -07:00
Seth Hillbrand 3b3165ad51 pcbnew: Allow DRC violations when marked
We shouldn't consider any obstacles when we are routing in DRC violation
mode.

Fixes: lp:1826723
* https://bugs.launchpad.net/kicad/+bug/1826723
2019-06-09 13:00:13 -07:00
Seth Hillbrand 5ce0e7265b modedit: Clear undo when importing
Importing a footprint is creating a new board.  Undo breaks here as we
don't maintain undo/redo across boards.

Fixes: lp:1832107
* https://bugs.launchpad.net/kicad/+bug/1832107
2019-06-08 13:05:02 -07:00
Seth Hillbrand 35e87128f5 pcbnew: Ensure cursor remains set during tool activity
Mouse capture end is called by some actions such as save board.  This
resets the cursor image but doesn't change the current tool.  Resetting
the cursor image during action prevents this.
2019-06-08 10:23:38 -07:00
Seth Hillbrand dd93f89931 Import Vector Dialog formatting
This standardizes the import vector graphics file dialog to use the
sbSizer titles instead of bold+lines.  Tooltip changes will be in the
next change as we don't change strings for bugfix releases and this
commit is targeted for 5.1.3

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

(cherry picked from commit f7550940ee)
2019-06-08 09:47:29 -07:00
Seth Hillbrand 966173c129 pcbnew: Don't reset triangular points for intersection
We prevent the creation of invalid polygons by keeping the converging
lines from intersecting.  This test doesn't make sense for triangular
polygons as they always intersect and we want to allow them to move
outside of the singular point.

Fixes: lp:1831481
* https://bugs.launchpad.net/kicad/+bug/1831481
2019-06-07 21:35:03 -07:00
jean-pierre charras 55757039fa Custom pads: fix a bug when plotting the custom shape. This bug was seen only with some shapes, not all, and only for layers having a negative margin.
Fixes: lp:1831941
https://bugs.launchpad.net/kicad/+bug/
2019-06-07 10:51:43 +02:00
Seth Hillbrand 63f18f0b03 CMake: Handle custom_target indirection
Building custom targets that depend on custom commands such as our
keyword lexer requires two layers of indirection to pick up changes
properly and not overwrite the same file in parallel builds.

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

(cherry picked from commit c6af38477d)
2019-06-05 13:10:00 -07:00
Ian McInerney 006d7ddd31 pcbnew: Add context menu for measure tool
Fixes: lp:1831063
* https://bugs.launchpad.net/kicad/+bug/1831063
2019-06-02 07:57:41 -07:00
Seth Hillbrand 1e58b09d96 Don't change the board without user action
Grid and ratsnest visibility are stored in the board file and should not
be changed without the user explicitly modifying them.

In the future, we'll move these settings out of the board file but we
shouldn't cause extra file-churn for flipped bits.

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

(cherry picked from commit e7e20b85b5)
2019-05-29 11:28:28 -07:00
Jon Evans 1058ba6a0f PcbNew: ensure Bezier points are updated before plotting
(cherry picked from commit b060880aacfb5e2ff44dea0000733e835d0b8b2a)
2019-05-29 00:07:22 -04:00
Jon Evans f8c541c0d7 PcbNew: fix Bezier curves not having bounding boxes at startup
(cherry picked from commit 40621de3559ee3993d7193a0faee5d0a777be848)
2019-05-29 00:06:55 -04:00
Michael Kavanagh 18f7d0129a Stop PNS router settings from being overwritten when switching modes
Fixes: lp:1824967
* https://bugs.launchpad.net/kicad/+bug/1824967

(cherry picked from commit 27d097a78c)
2019-05-27 16:16:55 -07:00
Jon Evans eb4aded5d6 PcbNew: Fix ordering of fab and courtyard layers
Fixes: lp:1829511
* https://bugs.launchpad.net/kicad/+bug/1829511
2019-05-27 11:54:43 -04:00
Jon Evans 5230f45658 Prevent unbalanced PTH pad labels from being hidden by drills
Fixes: lp:1829067
* https://bugs.launchpad.net/kicad/+bug/1829067
2019-05-27 11:54:43 -04:00
Jon Evans cb3edf2607 PcbNew: Fix layer alpha overrides being overwritten by color changes
Fixes: lp:1827518
* https://bugs.launchpad.net/kicad/+bug/1827518
2019-05-26 20:20:31 -04:00
Jon Evans f101934909 Report actual intersection position for crossing tracks
Fixes: lp:1825588
* https://bugs.launchpad.net/kicad/+bug/1825588
2019-05-25 15:02:06 -04:00
Jon Evans ede2575018 Exclude invisible items from view bounding box for zoom-to-fit
Fixes: lp:1116457
* https://bugs.launchpad.net/kicad/+bug/1116457
2019-05-25 10:44:15 -04:00
Jon Evans fb80ee5a0e Store items changed by connectivity algorithm in undo list
Fixes: lp:1828442
* https://bugs.launchpad.net/kicad/+bug/1828442
2019-05-24 21:55:49 -04:00
Michael Kavanagh 44fc69398c Fix footprint marked as modified when layer visibility changed
Fixes: lp:1830330
* https://bugs.launchpad.net/kicad/+bug/1830330

(cherry picked from commit 741140e4a4)
2019-05-24 16:17:43 -04:00
Wayne Stambaugh c162337cab Pcbnew: Python scripting support clean up.
Always check the return value of PyRun_SimpleString() for errors when a
Python script is run and show an error message rather than fail silently.

Enable Python interpreter I/O redirection in debug builds so that script
string errors will be shown when PyRun_SimpleString() is called.

Do not call PyErr_Print() after a PyRun_SimpleString() call failure.  It
doesn't do anything useful.

Do not call Py_Finalize() after a PyRun_SimpleString() call failure.  It
seems to cause Pcbnew to crash.

(cherry picked from commit 816f6db310)
2019-05-24 08:01:57 -04:00
Ian McInerney bf85eb9b4e pcbnew: Fixed listing of 3D libraries in the github wizard
Fixes: lp:1830137
* https://bugs.launchpad.net/kicad/+bug/1830137

(cherry picked from commit 0daf14f9c3)
2019-05-23 09:51:10 -07:00
Michael Kavanagh 2a932a2176 Allow setting cursor and aux items colour in footprint editor
Fixes: lp:1829850
* https://bugs.launchpad.net/kicad/+bug/1829850
2019-05-22 15:11:20 -04:00
Seth Hillbrand b2bcde1bfc EAGLE: Correct pcb text orientation
Fixes: lp:1829711
* https://bugs.launchpad.net/kicad/+bug/1829711

(cherry picked from commit 1181b9f9b4)
2019-05-22 10:38:16 -07:00
Seth Hillbrand ec6fd23636 EAGLE: Prevent numeric-only component references
KiCad does not allow references to be numeric only.  This prefixes such
references with "UNK" to note that the reference designator type is
unknown.

(cherry picked from commit a62a89eac3)
2019-05-22 10:38:16 -07:00
Seth Hillbrand 6f34f95c52 Allow squared inflation and inflate Eagle Zones
Sometimes we want to inflate a polygon without adding rounded edges.
This add the option using the jtMiter setting.

This is used in the Eagle parser to expand the Eagle zones for KiCad.
Eagle Zones are drawn on the polygon edge, so they extend out from the
outline.  KiCad zones are drawn inside the polygon.  We need to both
increase the zone size and decrease the minimum pen width to account for
this.

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

(cherry picked from commit 490c805319)
2019-05-22 10:38:16 -07:00
Seth Hillbrand 94e5b36279 pcbnew: Allow adding SHAPE_LINE_CHAIN to zones
(cherry picked from commit bf0a466642)
2019-05-22 10:38:16 -07:00
Seth Hillbrand f0ce4d6336 eagle: Use width on imported lines if available
If not, use the current board design settings for line thickness based
on the board layer.

(cherry picked from commit c80e3e0ffc)
2019-05-22 10:33:24 -07:00