Commit Graph

7494 Commits

Author SHA1 Message Date
jean-pierre charras 1d230bbee9 very minor fixes to help I18n translations (remove trailing spaces) 2018-12-20 20:19:45 +01:00
Seth Hillbrand 55f2a79957 pcbnew: locking connectivity using RAII
Rather than depend on proper unlocking for each exit, we move the
connectivity lock mutex into an RAII-type configuration that
automatically unlocks on exit.
2018-12-20 11:04:08 -08:00
jean-pierre charras 22d8ddb207 Pcbnew, legacy canvas, context menu for zones: better name for move and delete corner commands. 2018-12-20 08:47:45 +01:00
Seth Hillbrand 135ff314ca pcbnew: Correct layer naming
Layer bit sets get chosen for the layer name, starting with the copper
layers and then the technicals.  Additionally, multi-layer pads are
appended with an indicator that additional layer bits are set.

Fixes: lp:
* https://bugs.launchpad.net/kicad/+bug/
2018-12-19 20:58:36 -08:00
Seth Hillbrand 8f7c073514 pcbnew: Check for valid pointer before deref
In legacy toolkit, we do not keep the corner pointers, so dereferencing
causes crashes.

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

(cherry picked from commit 4aeef1e09e)
2018-12-19 16:54:34 -08:00
jean-pierre charras 83d851956c classes MARKER rework: remove duplicate code. Better HitTest code (HitTest takes in account the actual shape) 2018-12-19 19:53:27 +01:00
jean-pierre charras 15843ae01a class MARKER rework: fix a few minor issues, remove duplicate code and add comments. 2018-12-19 15:13:31 +01:00
Seth Hillbrand e5f5443762 modedit: Allow wildcard footprint import
When importing footprints, some are generated with non-standard (e.g.
"mod") extensions.  As a last option, we allow the * wildcard to select
these files for import.
2018-12-18 11:45:39 -08:00
jean-pierre charras 388397f97d Protect TesselatePolygon() against degenerated polygons (less than 3 corners) to avoid crashes.
Use TesselatePolygon() to draw polygons in Gerbview instead of GLU tesselation, much slower.
Add helper methods in GAL to know if the current GAL engine is Cairo, OpenGL or something else,
useful to optimize drawing code.
2018-12-18 12:49:14 +01:00
Seth Hillbrand e49242bc54 tesselation: Check winding order
Although copper layers are always tesselated CCW, polygons in footprints
will be CW if flipped to the back layer, resulting in a bad render.
2018-12-17 12:45:28 -08:00
Wayne Stambaugh fc69e6532c Unify "Read netlist" and "Load netlist" UI strings. 2018-12-17 10:18:44 -05:00
Jeff Young 95dcc30ffb Load footprint browser with last-selected footprint. 2018-12-16 21:59:42 +00:00
jean-pierre charras 6a0319f6b7 autoplacer: minor fixes. 2018-12-16 10:43:47 +01:00
Jeff Young 2e907bfaa3 Don't throw DRC errors for hidden copper text.
Fixes: lp:1808651
* https://bugs.launchpad.net/kicad/+bug/1808651
2018-12-15 22:30:11 +00:00
Jeff Young f69ea8b4a2 Don't cut invisible module text out of zones.
Fixes: lp:1808651
* https://bugs.launchpad.net/kicad/+bug/1808651
2018-12-15 20:15:19 +00:00
jean-pierre charras ed28b7e29b Autorouter rework: remove outdated or dead code, add comments and display the footprints as soon as a footprint is placed 2018-12-15 17:50:42 +01:00
Seth Hillbrand 7e9fee285f pcbnew: Align/Distribute handle locking
This fixes the handling of align/distribute tool when called on locked
items.  Locked items cannot be moved but they may be used for the target
of an align/distribute operation.

Fixes: lp:1808238
* https://bugs.launchpad.net/kicad/+bug/1808238
2018-12-14 16:04:07 -08:00
Seth Hillbrand 0a26388901 pcbnew: Break track in edit mode
Enables the ability to break a track into two segments when operating in
the edit mode rather than in router.

Fixes: lp:1779788
* https://bugs.launchpad.net/kicad/+bug/1779788
2018-12-14 09:59:25 -08:00
Seth Hillbrand 77163e27f0 suppress boost optional compiler warning 2018-12-13 12:43:29 -08:00
Seth Hillbrand 1c99784e92 pcbnew: Locked deletion prompting
Instead of a nag screen for locked items, we allow first the unlocked
items to be deleted and then, with a repeated request, the locked items.

This adds a popup cursor window informing the user of the option for
repeating the delete

Fixes: lp:1806507
* https://bugs.launchpad.net/kicad/+bug/1806507
2018-12-13 12:32:58 -08:00
jean-pierre charras 5f4530493a Make DRC markers always selectable.
Fixes: lp:1808181
https://bugs.launchpad.net/kicad/+bug/1808181
2018-12-13 09:06:38 +01:00
Seth Hillbrand 5c5979dfc6 pcbnew: Fix polygon hittest
Previous version had minimum width to account for it being difficult to
click on small lines.  This should not be used for filled polygons

Fixes: lp:1808141
* https://bugs.launchpad.net/kicad/+bug/1808141
2018-12-12 17:23:40 -08:00
Seth Hillbrand 4ff9d2f5e4 pcbnew: Update Alt Delete Name/hint
Simply calling it Alternative Delete was hiding its behavior. This gives
a descriptive tooltip and command name allowing users to more easily
find the equivalent to the "Ripup" command
2018-12-12 17:23:27 -08:00
jean-pierre charras 04aeec1223 Remove useless includes 2018-12-12 15:28:59 +01:00
Seth Hillbrand b4910658b5 Footprint wiz: Fix FPC courtyard 2018-12-11 13:11:56 -08:00
Seth Hillbrand 48aad33314 Activate the footprint wizard correctly
Starting the footprint wizard should cause the actual wizard to activate
2018-12-11 13:11:56 -08:00
Seth Hillbrand 4b3bfb0115 footprint wiz: Update default values
This updates some of the footprint wizard values to use the default KLC
values for silkscreen, fab, courtyard and text.

Also updates the default QFN settings to create a valid footprint
2018-12-11 13:11:56 -08:00
jean-pierre charras 372a09f299 Eagle(.lbr) footprints not listed in Library Browser
Fixes: lp:1807629
https://bugs.launchpad.net/kicad/+bug/1807629
2018-12-11 16:06:11 +01:00
jean-pierre charras 85775d522c Fix incorrect include paths
Especially, pcbnew/import_dxf is no longer in use.
2018-12-11 11:32:58 +01:00
Jeff Young f0c0f04348 Fix ReadNetList and UpdatePCB issues with new footprints.
Make sure the view is rebuilt before selecting the new footprints
so that they're shown only in the selection overlay.

Don't start the drag until the dialog is closed so we don't have
a bunch of extraneous mouse warping.

Fixes: lp:1775265
* https://bugs.launchpad.net/kicad/+bug/1775265
2018-12-10 19:48:58 +00:00
Seth Hillbrand d3a67e255d pcbnew: Polygon tool on EdgeCuts adds polylines
Edge cuts are more easily edited when they are polylines not polygons
and this keeps the files backwards compatible with v5.0.x.
2018-12-10 06:10:57 -08:00
Jeff Young 40dac0ecbb Default sizes for edit frames in case prefs get deleted.
Fixes: lp:1807676
* https://bugs.launchpad.net/kicad/+bug/1807676
2018-12-10 12:23:16 +00:00
jean-pierre charras 4013f6424d Pcbnew, autoplacer: display more activity during footprint placement 2018-12-10 10:33:56 +01:00
Seth Hillbrand 7ed1968f60 pcbnew: Remove corners from graphical polygons
Cherry-picked item from 5.0 allowed this action for modedit but missed
pcbnew.  This allows the same action in pcbnew as well.
2018-12-09 08:14:45 -08:00
jean-pierre charras f6aed7c99a Gerber plotter: rename UseX2Attributes() to UseX2format, and fix incorrect/outdated comments. 2018-12-09 10:23:07 +01:00
jean-pierre charras a18c7496bb Ensure compatibility with "old" pythons scripts after renaming SetUseGerberAttributes() to SetUseGerberX2format() 2018-12-09 08:38:23 +01:00
jean-pierre charras 7f20c55ed6 Pcbnew, Plot dialog, Gerber format: Enable or disable adding net metadata both in X1 and X2 format. Previously, this option was existing only in X2 format. Should be existing in both formats.
A bit of cleaning code related to this option.
2018-12-09 08:38:23 +01:00
Jeff Young dd9a001077 Turn off bugfix for lp:1797787 for 5.1.
This allows people to continue to use the edge-width as a proxy
for board edge clearance until we implement board edge clearance
as a real feature.

Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2018-12-08 17:09:41 +00:00
Seth Hillbrand 4fc81bb923 pcbnew: Graphic lines snap as single segments
Graphic lines and polygons are drawn to fit specific areas for which it
is helpful to have the endpoint controlled by the cursor even when
constraining the angle.

Fixes: lp:1805502
* https://bugs.launchpad.net/kicad/+bug/1805502
2018-12-08 07:26:58 -08:00
jean-pierre charras 5b3202d8f3 dxf and svg import: accept unicode filenames
Fixes: lp:1805613
https://bugs.launchpad.net/kicad/+bug/1805613
2018-12-07 10:07:43 +01:00
Maciej Suminski 766156ed87 Fix for dark mode on macOS Mojave
Thanks to Scott Rapson and Justace Clutter for the solution.

Fixes: lp:1797989
* https://bugs.launchpad.net/kicad/+bug/1797989
2018-12-07 09:03:56 +01:00
Jeff Young 78daaa8825 Allow cancel, delete or rescue when opening pcbs with undefined layers.
Fixes: lp:1796596
* https://bugs.launchpad.net/kicad/+bug/1796596
2018-12-07 00:26:10 +00:00
D4p0up e94752a6cf Added help string to select buttons.
Also moved highlight text string to help_common_strings.h

Fixes: lp:1497737
* https://bugs.launchpad.net/kicad/+bug/1497737
2018-12-05 20:13:03 -08:00
Seth Hillbrand 3d98c82217 pcbnew: Disable capture cursor in measure tool
When starting the measure tool, the cursor should not be captured until
we begin the measurement.

Fixes: lp:1806486
* https://bugs.launchpad.net/kicad/+bug/1806486
2018-12-05 19:59:01 -08:00
Seth Hillbrand f9dfbe6f4d Code formatting 2018-12-05 19:39:05 -08:00
Jeff Young 6a7ee5b107 Add locale handling for orientation combobox.
Fixes: lp:1806851
* https://bugs.launchpad.net/kicad/+bug/1806851
2018-12-05 18:08:50 +00:00
Seth Hillbrand 0614f59973 pcbnew: Add edge polygons to pns keepout
Fixes: lp:1806846
* https://bugs.launchpad.net/kicad/+bug/1806846
2018-12-05 08:58:55 -08:00
Seth Hillbrand 02039be2d9 Modify transform shape to use filled/unfilled poly 2018-12-05 08:44:49 -08:00
jean-pierre charras 5c54b9c46f Fix a compil issue due to a mistake in commit b8309e2 2018-12-05 10:14:46 +01:00
jean-pierre charras 754837f947 Pcbnew: DRAWSEGMENT polygonal shape: fix drawings in Legacy mode. Add IsPolygonFilled() to know if the polygon is filled or not.
IsPolygonFilled() replaces the hard coded comparisob with Edge_Cut in code.
For now the polygon is not filled only on Edge_Cut layer.

But in the future, it could be an option for other layers.
2018-12-05 09:57:59 +01:00
Seth Hillbrand b8309e2a70 pcbnew: Edgecuts polygons only hit edges
Only allow hittest for edgecuts polygons on their edges as we do not
display the fill for this layer.

Fixes: lp:1806782
* https://bugs.launchpad.net/kicad/+bug/1806782
2018-12-04 17:19:40 -08:00
Jeff Young 4f5771f79f Don't nag user about changes they made in a text editor.
Fixes: lp:1806748
* https://bugs.launchpad.net/kicad/+bug/1806748
2018-12-04 23:32:55 +00:00
Jeff Young da40def69d Standardize on "local coordinates" terminology. 2018-12-04 23:32:55 +00:00
Seth Hillbrand 2e0887d49f pcbnew: correctly display edgecut polygons in modules
Commit 1858b7dca corrected the handling of polygons on the edge cut
layer for board items.  This adjusts for the possibility of polygons
in modules on the edge cut layer by applying the module offset/rotation
to the polygon elements.
2018-12-04 15:08:04 -08:00
Seth Hillbrand 1858b7dca7 pcbnew: Allow closed polygons as board edges
Like circles, polygons are self-closed elements that define an outline.
This allows them to be used as such for board outlines and cutouts.

Fixes: lp:1795563
* https://bugs.launchpad.net/kicad/+bug/1795563
2018-12-04 12:32:47 -08:00
jean-pierre charras 4f4f03a98a Try to fix compil issue on OSX (commit 8757fcf6 breaks the import gfx dialog) 2018-12-04 20:03:23 +01:00
jean-pierre charras 3623980611 DXF importer: fix incorrect line thickness of imported texts. 2018-12-04 20:01:47 +01:00
John Beard bb18c9201b Make SVG import a CMake option (experimental)
This allows too turn it on for work without an additional patch.

Also fix a bug in the disable code - when the SVG is enabled,
allow to select SVG files.
2018-12-04 18:53:28 +01:00
Seth Hillbrand 8757fcf676 Add array hint to wxArrayString contructors
This may be required for some compilers to prevent premature casting to
a single element.
2018-12-04 09:47:43 -08:00
jean-pierre charras 2ec957a226 polygon_triangulation.h: fix a missing call to updateList() in TesselatePolygon. 2018-12-04 15:47:54 +01:00
Maciej Suminski ecff2ed384 SVG import dialog: make placement options mutually exclusive 2018-12-04 08:39:58 +01:00
Seth Hillbrand 2a574c4f65 pcbnew: Synchonize net info when loading via python
When loading the load using the UI, netclasses and net info are
synchronized to the board object after parsing the file.  This needs to
happen automatically when loading the board via the Python interface as
well.

Fixes: lp:1806506
* https://bugs.launchpad.net/kicad/+bug/1806506
2018-12-03 17:05:18 -08:00
jean-pierre charras af65c48979 Pcbnew: Partial revert of commit 0bceb69fe9
In DRAWSEGMENT polygonal shape: the commit tried to use triangulation (CacheTriangulation) to draw the shape (similar to zones).
It was much faster than using GLU tesselator (one order of magnitude).
Unfortunately, CacheTriangulation() works only with simple polygons, not with any polygon.
And simplifying a polygon with a lot of vertexes is very time consuming.
So using CacheTriangulation() is now removed and GLU tesselator is used as previously.

Fixes: lp:1806411
https://bugs.launchpad.net/kicad/+bug/1806411
2018-12-03 20:12:57 +01:00
Seth Hillbrand 2a865ef4b6 pcbnew: Remember highlighted net while routing
If the user has specifically requested a net to be highlighted before
routing, we keep the net highlighted after the route is completed.
2018-12-03 08:42:45 -08:00
jean-pierre charras a762c4d86e Import GFX: temporary disable SVG import until V6.0.
SVG import need some refinements to be efficient, so it is disable for v 5.x.
Will be re-enabled later.
Enabling SVG import is *only* for developers, not for users.
2018-12-03 15:31:40 +01:00
jean-pierre charras fb5b5ff7c3 nanosvg: Update nanosvg. Move the code to compile from nanosvg.h to nanosvg.cpp
Uncrustify this code.
2018-12-03 15:25:46 +01:00
jean-pierre charras cc0aa8b928 Gfx import: fix many issues, and add many enhancements.
* Do not compile dxf old files.
* import gfx, gal mode: make absolute placement working.
* Import gfx in legacy canvas: use it and make interactive placement working
* Take imported line width in account. Ensure DXF line thickness is OK.
* handling empty files in legacy mode.
2018-12-03 15:25:44 +01:00
jean-pierre charras 430c61822d Import svg import code from experimental trunk: convert dxf importer 2018-12-03 13:42:23 +01:00
jean-pierre charras 74a9d5401a Import svg import code from experimental trunk: start point 2018-12-03 13:42:22 +01:00
jean-pierre charras 0bceb69fe9 Pcbnew: DRAWSEGMENT polygonal shape: use triangulation (CacheTriangulation) to draw the shape (similar to zones).
On opengl, creating triangles by CacheTriangulation instead of GLU tesselator is much faster (one order of magnitude)
2018-12-02 18:05:25 +01:00
Seth Hillbrand 26765161c1 drc: Add board outline and edge crossing
This adds a check for contiguous board outlines to the DRC.  It also
uses the calculated outline to ensure that traces are not crossing the
outlines.

Fixes: lp:1648055
* https://bugs.launchpad.net/kicad/+bug/1648055
2018-12-02 07:54:52 -08:00
jean-pierre charras 5eb5b5ce58 DIALOG_TEXT_PROPERTIES: hide visibility option, because this option exists only for footprint texts, and do nothing for other texts.
Texts on board (not on footprints) cannot be invisible, at least in 5.0 and previous versions.
2018-12-02 10:30:48 +01:00
jean-pierre charras d607c4853d fix a minor compil warning. 2018-12-01 20:07:59 +01:00
Jeff Young 45ee95f5e2 Apply CharHook uniformly as other platforms appear to have issues.
Fixes: lp:1806124
* https://bugs.launchpad.net/kicad/+bug/1806124
2018-12-01 11:57:16 +00:00
Jeff Young ff6a3482ec Remove on-kill-focus-validation.
Fixes: lp:1805361
* https://bugs.launchpad.net/kicad/+bug/1805361
2018-11-29 19:00:21 +00:00
Wayne Stambaugh 59b0f553e0 Code cleaning. 2018-11-28 09:58:41 -05:00
Jeff Young 8ca0fe6722 When copying modified footprint make sure we get the latest.
Fixes: lp:1805413
* https://bugs.launchpad.net/kicad/+bug/1805413
2018-11-27 19:20:36 +00:00
Seth Hillbrand 7b2f245283 pcbnew: Tracks cleanup use connectivity database
Rather than duplicating the connectivity calculations in determining
whether a track is dangling, we utilize the current database to find the
number of connected items for an anchor item when feasible.

Multiple anchors such as tracks still need additional logic.

Fixes: lp:1805479
* https://bugs.launchpad.net/kicad/+bug/1805479
2018-11-27 11:17:59 -08:00
Jeff Young db07b43674 Fix copy/paste errors with wrong icons.
Fixes: lp:1805123
* https://bugs.launchpad.net/kicad/+bug/1805123
2018-11-26 23:57:08 +00:00
Maciej Suminski 4d73cfb8a1 PNS: validate SHAPE_LINE_CHAIN before accessing its segments 2018-11-26 00:01:02 +01:00
Seth Hillbrand 4a0467bbd0 Selection: allow optional locked item edit
When looping main, we should not exclude locked items without prompting
the user first.

Fixes: lp:1804979
* https://bugs.launchpad.net/kicad/+bug/1804979
2018-11-25 11:54:29 -08:00
Seth Hillbrand 2cfcb2b9fb SELECTION: Allow RequestSelection() to add items
The client filter might add items in the case where locked pads are
filtered.  We need to handle this case when requesting selection by
adding new items to the m_selection

Fixes: lp:1802686
* https://bugs.launchpad.net/kicad/+bug/1802686
2018-11-25 08:33:49 -08:00
Jeff Young d2756bedf1 Keep state except when the filter changed.
(Used to be "except when filtering".)

Fixes: lp:1804293
* https://bugs.launchpad.net/kicad/+bug/1804293
2018-11-25 01:51:45 +00:00
Seth Hillbrand ff668968f3 pcbnew: Changing the track width while routing
When changing the track width, we need to allow that the track's route
will change based on DRC, so force a move without changing position.

Fixes: lp:1785057
* https://bugs.launchpad.net/kicad/+bug/1785057
2018-11-24 11:52:26 -08:00
jean-pierre charras 558c38b5c5 Very minor enhancement in plot dialog.
Inside the layers listbox, the context menu can select all fabrication layers.
The courtyard layers (only used for DRC) are now not selected.
2018-11-24 17:48:05 +01:00
Seth Hillbrand 908c2a37e5 GRID_HELPER: Finish drawing closed path
When we draw a path, we usually want to close the path when clicking on
the end of another line.  This uses grid helper to ensure this
progression happens as expected.
2018-11-24 08:00:11 -08:00
Jeff Young 2e1920abad Add tooltips to library manager dialogs.
Fixes: lp:1804930
* https://bugs.launchpad.net/kicad/+bug/1804930
2018-11-24 15:06:21 +00:00
Jeff Young b2db49f4ac Add browse buttons to Library Manager dialogs.
Fixes: lp:1804924
* https://bugs.launchpad.net/kicad/+bug/1804924
2018-11-24 15:06:21 +00:00
jean-pierre charras 0b890b4d1d Drill files generation: add 3 structured comments in NC (Excellon) drill files and remove duplicate code. 2018-11-24 08:51:58 +01:00
Jeff Young 647fa6547d Update grid drop-down when changing user grid. 2018-11-23 23:33:02 +00:00
Jeff Young f05b756ccf Fix copy/paste typo. 2018-11-23 19:46:41 +00:00
Seth Hillbrand 9955d0beb2 MSW Ratsnest: Force marking ratsnest dirty
When updating the status of the ratsnest, we mark its target layer as
dirty to ensure the revised data are used to draw/clear the ratsnest

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

(cherry picked from commit 50eedcf0b3)
2018-11-23 11:45:29 -08:00
jean-pierre charras 149c4b55a6 DIALOG_TRACK_VIA_PROPERTIES_BASE: fix a minor wxWidgets alert. 2018-11-23 15:46:54 +01:00
Seth Hillbrand 36a69a7d5d clipboard: re-add limited LOCALE_IO to SaveSelection
JP notes that there is an issue with comma-based decimal locales and the
SaveSelection that is addressed by having a LOCALE_IO call in a limited
block.

This changed the copy timing of the clipboard and the interaction with
KDE Klipper again.  To address this, we isolate the clipboard open call
to the end of the routine and force a round-trip of the clipboard data
before exiting.
2018-11-22 08:17:09 -08:00
jean-pierre charras d03e82602e PANEL_COMMON_SETTINGS: minor fixes, mainly cosmetic. 2018-11-22 17:11:49 +01:00
Seth Hillbrand 964d6ebc06 pcbnew: Set clipboard locale to avoid Klipper crash
Klipper seems to poll at odd times.  When we copy to wxTheClipboard
in one locale and Klipper extracts data in a different locale, it throws
an XError.  We don't need the extra LOCALE_IO calls as Format() uses its
own LOCALE_IO setting.

Fixes: lp:1800648
* https://bugs.launchpad.net/kicad/+bug/1800648
2018-11-21 12:01:21 -08:00
nats 6e77176d76 Adding fillet option for the QFN Wizard
Fixes lp:1775961

https://bugs.launchpad.net/kicad/+bug/1775961
2018-11-21 15:00:39 -05:00
Jeff Young 5a74b55074 Reset delayedFocusPage even if it's already the right page.
Fixes: lp:1804315
* https://bugs.launchpad.net/kicad/+bug/1804315
2018-11-21 19:51:04 +00:00
Seth Hillbrand ad9916a93d ratsnest: Fix state issue switching in local tool
The ratsnest layer needs to be always enabled in GAL rather than taken
from the board settings.  This also adds a finalize handler to the
picker tool that allows a picker-caller to perform a specific action
when the picker tool exits.  In this case, we use it to clear the local
ratsnest selections back to the default.

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

(cherry picked from commit c0d9b9ab81)
2018-11-20 20:49:18 -08:00
Jeff Young ed27027ab1 Escape/unescape footprint descriptions and keywords when writing/reading cache file.
Fixes: lp:1803989
* https://bugs.launchpad.net/kicad/+bug/1803989
2018-11-20 21:44:04 +00:00
Jeff Young c016861962 Run some sanity checks on fp-info-cache files.
Fixes: lp:1803989
* https://bugs.launchpad.net/kicad/+bug/1803989
2018-11-19 21:06:25 +00:00
Jeff Young 5bb5aea936 Don't leave a selection with a deleted item in it.
Fixes: lp:1803730
* https://bugs.launchpad.net/kicad/+bug/1803730
2018-11-19 16:03:30 +00:00
Jeff Young f71998b34e Remove repetitive calls to other cancel operations. 2018-11-19 16:03:30 +00:00
Jeff Young 5b9458f4c2 Don't delegate context menu to Selection Tool.
Our superclass can handle it more correctly (including the Cancel
item at the top).
2018-11-19 16:03:30 +00:00
jean-pierre charras 240051fb26 Worksheet display in GAL mode: fix missing filename and (in Eeschema) sheet full name. 2018-11-19 10:21:28 +01:00
Seth Hillbrand eb689a5221 Ratsnest: Improve show heuristics
When the local ratsnest tool is used, it should toggle the state based
on the global ratsnest visibility.  After changing state, the layer
cache is marked as well.

Possibly related to lp:1800301

(cherry picked from commit 22fbf30f22)
2018-11-18 20:03:46 -08:00
jean-pierre charras c539d6e0be fix incorrect initialization of VIEW::m_boundary.
This parameter defines the working area (full page) size.

The fix is not perfect, because it does not take in account the page size.
However it is similar to the "old" initialization, before Eeschema GAL.
In Eeschema, a reasonable boundary size is used.
2018-11-18 20:04:17 +01:00
jean-pierre charras 65a967dca1 Fix minor I10n issues. 2018-11-18 14:40:36 +01:00
jean-pierre charras 2fdf13ab79 Fix minor compil warnings. 2018-11-18 10:12:34 +01:00
jean-pierre charras 0ef7aeb274 Fix incorrect behavior when collection footprint items in collectors.cpp.
It was a bug in commit 208622699.

Fixes: lp:1803803
https://bugs.launchpad.net/kicad/+bug/1803803
2018-11-18 10:08:12 +01:00
Jeff Young 208622699f Scale zone hit area by zoom.
Fixes: lp:1803362
* https://bugs.launchpad.net/kicad/+bug/1803362
2018-11-17 00:35:07 +00:00
Jeff Young 0de9cb345c Add shortcuts to setting dialogs for track widths, via sizes and grid sizes.
Fixes: lp:1803671
* https://bugs.launchpad.net/kicad/+bug/1803671
2018-11-17 00:35:06 +00:00
Jeff Young 3c6adbdf03 Indent layer properties for better comprehension. 2018-11-17 00:35:06 +00:00
Seth Hillbrand 940353afde GRID_HELPER: Keep edited items out of snap
Distinguish between the snap-from and snap-to items.  Previously, we
used the SELECTED or DRAGGED flags but the flagging arcitecture was
inherently fragile.  This specifies items directly that should not be
used as snap targets.

Fixes: lp:1802795
* https://bugs.launchpad.net/kicad/+bug/1802795
2018-11-16 10:05:31 -08:00
jean-pierre charras b35b1bb644 Fix a few minor I18n issues.
Especially remove trailing and leading spaces in sentences, always annoying in translations, and never useful in sources.
2018-11-16 18:12:01 +01:00
Jeff Young 4050991d28 Move ERC marker focusing to GAL architecture.
Fixes: lp:1802537
* https://bugs.launchpad.net/kicad/+bug/1802537
2018-11-16 10:38:44 +00:00
jean-pierre charras 8c8ccf83e6 Fix a few I18n minor issues. 2018-11-16 09:43:40 +01:00
jean-pierre charras 1f3d5cee0e Fix a few minor I18n issues. 2018-11-15 09:34:29 +01:00
Jeff Young bcc8c64256 Consider edge cuts items to have zero width when filling zones.
Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2018-11-14 23:45:32 +00:00
Jeff Young 02a559678a Improve terminology of track selection commands.
There was confusion that "copper" and "net" meant zones, and there
was confusion about what "trivial" meant.

Fixes: lp:1772251
* https://bugs.launchpad.net/kicad/+bug/1772251
2018-11-13 21:29:35 +00:00
Maciej Suminski 361b768aaf Fix frozen cursor on interactive DXF placement 2018-11-13 14:58:54 +01:00
Jeff Young 86273e86b9 Added user and grid origins to Position Relative dialog.
Also fixed a refresh bug when doing Position Relative.

Fixes: lp:1792699
* https://bugs.launchpad.net/kicad/+bug/1792699
2018-11-12 23:09:45 +00:00
Jeff Young 6d76097291 When running selectable() recursively, we're really only checking visibility.
Fixes: lp:1802949
* https://bugs.launchpad.net/kicad/+bug/1802949
2018-11-12 21:59:43 +00:00
Jeff Young fdff010199 Fix copy/paste errors in delayedFocusRow stuff.
Fixes: lp:1802907
* https://bugs.launchpad.net/kicad/+bug/1802907
2018-11-12 17:08:45 +00:00
Seth Hillbrand c15c64e991 GRID_HELPER: Don't snap to sub elements being moved
Fixes: lp:1802795
* https://bugs.launchpad.net/kicad/+bug/1802795
2018-11-12 06:53:33 -08:00
Jeff Young 62e2fe8bbd Recurse for more detailed selectability tests.
Fixes: lp:1801709
* https://bugs.launchpad.net/kicad/+bug/1801709
2018-11-11 20:26:19 +00:00
Jeff Young befc504734 Warp cursor back to creation point after new-text dailog.
Also fixes same issue for new zones.

Fixes: lp:1802532
* https://bugs.launchpad.net/kicad/+bug/1802532
2018-11-11 20:26:19 +00:00
Jeff Young 6789103961 Save internal values rather than textbox content.
Fixes: lp:1802442
* https://bugs.launchpad.net/kicad/+bug/1802442
2018-11-11 20:26:19 +00:00
Jeff Young 295013e4a9 Clarify fp reference filter and add fp id filter.
Fixes: lp:
* https://bugs.launchpad.net/kicad/+bug/
2018-11-11 20:26:19 +00:00
Seth Hillbrand c24f70ba1e GRID_HELPER: Filter targets based on dragging
Filtering based on selection ignores the use case where we are measuring
to a selected item.  This utilizes the dragged flag to prevent snapping
based on the current state of the item drag.

Fixes: lp:1801089
* https://bugs.launchpad.net/kicad/+bug/1801089
2018-11-11 11:30:36 -08:00
Seth Hillbrand cf20b39ddc GRID HELPER: Consider all snappable items
When snapping, we should allow any point identified as a snappable
point.  The additional consideration for corners might be used for
alignment in the future.

Fixes: lp:1802741
* https://bugs.launchpad.net/kicad/+bug/1802741
2018-11-11 11:30:36 -08:00
jean-pierre charras fcafe5362f NC drill (Excellon) exporter: remove useless M71 / M72 lines.
They are probably incorrect in V2 format, and the format is already specified.
2018-11-11 19:57:16 +01:00
jean-pierre charras 0d3637c2ee Fix a few minor I18n issues.
Avoid translation of debug messages.
2018-11-11 10:46:26 +01:00
jean-pierre charras f7cf40f2f4 Fix a few Coverity warnings.
Sometimes a dynamic_cast was used without testing the returned value.
Some are replaced by static_cast, when the dynamic_cast was useless.
2018-11-11 08:28:58 +01:00
jean-pierre charras acfa13c038 Fix typo 2018-11-09 15:46:09 +01:00
Seth Hillbrand 70e660dfe8 GRID_HELPER: Update target geometry when moving
Setting a previously visible item visible is a nop.  If the target was
visible, make sure to update the geometry

Fixes: lp:1802405
* https://bugs.launchpad.net/kicad/+bug/1802405
2018-11-09 06:12:31 -08:00
Wayne Stambaugh f1f4473d8b Footprint editor: add save view to PNG file.
Factor out save current canvas view to image file code from symbol editor
code so it can be used anywhere.

Add ability to save to any image format supported by wxBitmapType.  See
https://docs.wxwidgets.org/3.0/gdicmn_8h.html#a90a1eb6d85b5044a99b706fd979f27f5.
Currently only PNG output is implemented.

Please note that there is a minor bug that appears to be due to the
scroll bars which causes unfilled areas on the right and bottom edges
of the image.  This always existed in the save symbol editor view
image but it was not as noticeable because by default the background
color is white.  It is very noticeable in the footprint editor with
a black background.

The usual smattering of coding policy and comment fixes.

Fixes lp:1802127

https://bugs.launchpad.net/kicad/+bug/1802127
2018-11-09 08:32:36 -05:00
Jeff Young 5c726744b6 Move Zone Properties dialog to Connect() strategy.
If checkboxes don't have individual IDs FormBuilder won't assign
them and the event table ends up connecting each checkbox to all
of the checkbox handlers in the dialog.

Fixes: lp:1801746
* https://bugs.launchpad.net/kicad/+bug/1801746
2018-11-08 21:27:15 +00:00
Seth Hillbrand 4b931aeb57 pcbnew: Force cursor position when snapping
This places the crosshairs (confusingly named here) at the snap
position, either one of the snap points or the grid, depending on the
status of the hotkeys SHIFT/ALT.

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

Fixes: lp:1801369
* https://bugs.launchpad.net/kicad/+bug/1801369
2018-11-07 14:36:46 -08:00
Seth Hillbrand f2ccad39b6 pcbnew: Fix grid snapping for picker
Fixes: lp:1801373
* https://bugs.launchpad.net/kicad/+bug/1801373
2018-11-07 09:03:26 -08:00
Jeff Young 5c26b1dabd Don't use C-style cast when we don't actually know what it is. 2018-11-07 14:24:16 +00:00
Jeff Young 3439551543 Implement a work-around for net-ties.
Fixes: lp:1799318
* https://bugs.launchpad.net/kicad/+bug/1799318
2018-11-07 14:24:16 +00:00
Seth Hillbrand 1f25fcd3d6 pcbnew: Shift zone filler to std::async 2018-11-06 09:28:12 -08:00
Seth Hillbrand a24bd9baa1 pcbnew: Adjust default update rate to 100ms
10ms was too fast to update the progress reporter and actually slowed
the process down for many machines.
2018-11-06 09:28:12 -08:00
jean-pierre charras 238abad004 Gerber job file: fix incorrect GUID.
Fixes: lp:1801696
https://bugs.launchpad.net/kicad/+bug/1801696
2018-11-06 08:16:07 +01:00
Maciej Suminski 4ad37bc9ea Limit 'items on disabled layers' DRC check to copper layers
Fixes: lp:1788248
* https://bugs.launchpad.net/kicad/+bug/1788248
2018-11-05 14:00:49 +01:00
Jeff Young 6e9475694c Fix bug with zone selection when zones are shown filled. 2018-11-04 19:17:53 +00:00
Seth Hillbrand df562b7ec0 pcbnew: Prevent degenerate values in Eagle import
Importing Eagle files allowed for invalid zone values for clearance and
minimum width that triggered asserts in the 3d-viewer.

Fixes: lp:1801188
* https://bugs.launchpad.net/kicad/+bug/1801188
2018-11-04 11:01:08 -08:00
jean-pierre charras 93d3e4ccf8 dialog_footprint_wizard_list_base.cpp: fix a minor wxWidgets alert. 2018-11-04 15:50:29 +01:00
Jeff Young 589e1f6a96 MSW and GTK need a separate dialog for opening/saving directories.
Fixes: lp:1801528
* https://bugs.launchpad.net/kicad/+bug/1801528
2018-11-04 12:35:01 +00:00
Jeff Young 68b07d1aff Add show/hide search tree to modedit, and fix it in libedit.
Fixes: lp:1801531
* https://bugs.launchpad.net/kicad/+bug/1801531
2018-11-04 12:35:01 +00:00
Jeff Young 3bfd32cdc5 Inherit grid settings from PCBNew.
Fixes: lp:1801428
* https://bugs.launchpad.net/kicad/+bug/1801428
2018-11-04 12:35:01 +00:00
Nick Østergaard 8c1ebc4314 Remove shebang from footprint wizard plugin
Fedora packaging errors with ambiguous python shebang since current
rawhide (30).

So we should remove it as the footprint wizards are not to be executed
standalone.
2018-11-04 08:43:20 +01:00
Maciej Suminski 75896d767a Fix a crash in BOARD::SortedNetnamesList()
Variable netBuffer contains all NET_INFO items, whereas max_netcode
value is determined only basing on pad nets. After a netlist update
there still might be a NETINFO_ITEM that is not assigned to any pad and
has a net code higher than calculated max_netcode. Such situation
results in a out-of-bounds access in sortNetsByNodes().
2018-11-03 18:17:48 +01:00
jean-pierre charras 15fa8f8a22 Minor fixes. 2018-11-03 14:30:34 +01:00
Jeff Young 569d4a0f64 More selection logic improvements.
Separate out zone edges (which are quite specific, and should
win over most other things) from zone fills (which are pretty
generic and should only be considered when there's nothing else).

Also excludes zone fills when the zones aren't being shown as
filled.
2018-11-02 23:52:00 +00:00
Maciej Suminski dfccd8c5e4 Added level-of-details threshold for via net name layer 2018-11-03 00:48:03 +01:00
Maciej Suminski 8d73cfef2a Adjusted level-of-detail thresholds for BOARD_ITEMs visibility
Fixes: lp:1801056
* https://bugs.launchpad.net/kicad/+bug/1801056
2018-11-03 00:34:27 +01:00
Jeff Young 69952a7b9f Improve updating of symbol and footprint trees.
In particular, update highlighting when changing footprints.
2018-11-02 19:55:30 +00:00
Maciej Suminski afda69c9cc Removed default line width setting from the printing dialog 2018-10-31 19:17:30 +01:00
Maciej Suminski 64da77538f Fix bitmap scale in printouts
Display GALs had an incorrect world unit value set. Now the world unit
value says how many internal units are in an inch, in accord with the comments
in the GAL header. Bitmap drawing code relied on the information about DPI,
so scaling worked differently for display and print GALs.
2018-10-31 19:17:30 +01:00
Maciej Suminski 262a105416 Disable zone outlines and hatched lines rendering in printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 3d15092643 Fixed loading layer visibility setting for printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 90b6156448 Store line width setting for printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski d3ea63e133 Removed a redundant parameter from BOARD_PRINTOUT constructor 2018-10-31 19:17:30 +01:00
Maciej Suminski ff0909c90c Fully initialize PCB_RENDER_SETTINGS::m_sketchMode 2018-10-31 19:17:30 +01:00
Maciej Suminski dea778842b Grand printing dialogs refactor
Patch introduces a generic printing settings window that is customized by pcbnew and gerbview.
2018-10-31 19:17:30 +01:00
Maciej Suminski e81c3a59a2 Refactored and unified board editor and footprint editor print dialogs 2018-10-31 19:17:30 +01:00
Maciej Suminski 92c5cb288e Fixed scale in Gerbview printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 8cb464b725 Handle drill mark options in pcbnew printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 698a380827 Clear selection before printing
Selected objects are hidden in VIEW, that makes them disappear from
printouts.
2018-10-31 19:17:30 +01:00
Maciej Suminski 59f77e68c9 Removed unused pcbnew printing code 2018-10-31 19:17:30 +01:00
Maciej Suminski 1cce194c8a Handle layer settings in printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 5b94f20e6f Adapted printout controllers to the new printing routines 2018-10-31 19:17:30 +01:00
Jeff Young 74118a2e9d Don't display all the footprint info when an edge is selected.
Fixes: lp:1800556
* https://bugs.launchpad.net/kicad/+bug/1800556
2018-10-30 11:33:49 +00:00
jean-pierre charras 654dbbb44b Gerber UUID parameter calculation: refinements and more comments 2018-10-29 18:56:26 +01:00
jean-pierre charras c05ca469ae Pcbnew, DIALOG_PLOT_BASE: Fix a minor wxWidgets alert. 2018-10-29 17:34:14 +01:00
jean-pierre charras 03f3ff79a5 Pcbnew, Gerber output: fix incorrect UUID format in %TF.ProjectId attribute.
Fixes: lp:1800459
https://bugs.launchpad.net/kicad/+bug/1800459
2018-10-29 17:34:14 +01:00
jean-pierre charras eabae68ab8 PANEL_SETUP_LAYERS_BASE: cosmetic enhancements. 2018-10-29 15:21:03 +01:00
Seth Hillbrand ed1c8eee9e async: Ensure threads are started async
It is possible for an async thread to simply be deferred if not
specifically set to async.  In which case, until the return value is
requested, the loop may simply wait.
2018-10-26 22:30:06 -07:00
Seth Hillbrand 59fb6d8851 Threading: Moving connectivity search to std::async
By decoupling from std::thread, we can avoid the wait/sleep cycle in
checking the std::atomic completion variable.  The std::future variables
are immediately returning without the additional atomic check cycle.
2018-10-26 18:00:43 -07:00
Thomas Pointhuber 0e0b4d52a2 Add initial support for Phoenix (new wxPython binding)
Based on the work of @mmccoo:
https://kicad.mmccoo.com/2017/11/23/learnings-from-moving-kicad-to-wxpython-4-0/
and this additional patchset to remove wxpy_api.h dependency:
http://mmccoo.com/random/0001-Remove-dependence-on-pywx_api.h.patch

Please note CreatePythonShellWindow changed quite a lot. Throughful testing
should be made for the old as well as new wxPython version on all platforms
2018-10-26 13:21:11 +02:00
jean-pierre charras 633bc7f2d5 Pcbnew, DIALOG_TEXT_PROPERTIES_BASE: fix many minor wxASSERTs 2018-10-26 13:09:05 +02:00
Seth Hillbrand a3bbd32953 Fix minor compile warnings 2018-10-25 17:14:04 -07:00
Seth Hillbrand 2d8f1df293 Threading: Minimize thread usage
This minimizes the thread usage, particularly during online actions such
as moving items and routing.

UpdateRatsnest:  Minimized the number of atomics by utilizing future
promise.  Avoided updating node-less nets.  Node-less nets are common in
the dynamic ratsnest because the net vector is created from the board
nets by value but only populated with a subset.  So the dynamic ratsnest
calculation always saw every net as dirty and spun up extra threads.

searchConnections: ParallelThreadCount is no longer lower bounded.
Small item counts are handled inline rather than with a separate thread.
2018-10-25 14:19:43 -07:00
Seth Hillbrand 90233e5ec6 SELECTION: Prevent double select/deselect.
When processing the selection filter, items were deselected before being
reselected after passing through the filter.  This adjusts the logic to
only deselect those items that are filtered out.
2018-10-24 17:17:45 -07:00
Jeff Young 9624ef4f2e Don't blindly overwrite footprints when doing a Save As. 2018-10-24 22:00:50 +01:00
Jeff Young 244497f514 A board FP is no longer a board FP after a Save As. 2018-10-24 22:00:50 +01:00
Seth Hillbrand a0e4e23c14 Ratsnest: Keep connectivity data local
The dynamic ratsnest did not need to have a smart pointer to the
temporary connectivity data.
2018-10-24 13:43:09 -07:00
Seth Hillbrand ec38a5cd10 Threading: Replacing sleep with yield for active wait
Some windows machines seem prone to sleeping for excessive times.  When
called in the main thread, this may prevent the system from responding
to Windows 'Are you alive?' calls.
2018-10-24 10:37:25 -07:00
Jeff Young a96dbde738 Allow net-ties within footprints.
Fixes: lp:1799318
* https://bugs.launchpad.net/kicad/+bug/1799318
2018-10-23 20:54:42 +01:00
Jeff Young adfe2fc267 Make sure user isn't surprised by Match All setting.
If they selected the dialog with a footprint selected, they're
probably not expecting Match All.
2018-10-23 20:54:42 +01:00
Wayne Stambaugh e43e3a93c0 Revert "cmake: avoid declaring a redundant concurrent _pcbnew.so target"
This reverts commit 2e047b45b4.
2018-10-22 19:12:17 -04:00
Wayne Stambaugh c99874ca2f Revert "cmake: rearranged code in the KICAD_SCRIPTING_MODULES section in order to clarify the intent"
This reverts commit 71f17a698b.
2018-10-22 19:11:11 -04:00
Roman Beranek 71f17a698b cmake: rearranged code in the KICAD_SCRIPTING_MODULES section in order to clarify the intent 2018-10-22 13:59:08 -04:00
Roman Beranek 2e047b45b4 cmake: avoid declaring a redundant concurrent _pcbnew.so target
The "renamed _pcbnew.kiface" target should only be declared for MINGW
because for Linux it would have been already declared at line 802.
2018-10-22 13:59:08 -04:00
Seth Hillbrand 3cc87b4597 PNS: Ensure we don't miss items
Higher candidate levels could override better matches if the layers did
not overlap.
2018-10-21 14:28:33 -07:00
jean-pierre charras 0f247264f8 Pcbnew: DRC ignores first net of list of nets to test.
Fixes: lp:1798985
https://bugs.launchpad.net/kicad/+bug/1798985
2018-10-21 17:01:58 +02:00
Jeff Young f17c18bcce Remove AdvanceDepth() hacks in favour of proper layers.
Also removes the bounding-box cache since the last big merge
should have sorted out the Update(GEOMETRY) calls.

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

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

Fixes: lp:1797075
* https://bugs.launchpad.net/kicad/+bug/1797075
2018-10-21 15:55:56 +01:00
jean-pierre charras 064b8a8d60 Gerber file generation: remove a optional info in .FileFunction: the layer type.
TF.FileFunction,Copper,L1,Top,Signal is now TF.FileFunction,Copper,L1,Top

This param is not useful, and probably never correctly set by users, because is is not used by Pcbnew.
(It is used only for dsn export)
2018-10-19 15:48:18 +02:00
Thomas Pointhuber e39eeb2f92 Remove debug printf and fix indentation inside of block 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 95e55eb17a Fix coding style issue (space after if) 2018-10-19 09:59:06 +02:00
Thomas Pointhuber e09785db1d Introduce PyStringToWx helper to remove code duplication 2018-10-19 09:59:06 +02:00
Thomas Pointhuber ce471ec898 Fix braces 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 6ac444f587 Fix style issue 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 9eff4e999f Quick fix to avoid nameclash with local qrcode python package 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 8bf1954625 NoneType was incorrectly passed to PyString_AsString
The implementation relied on the fact that PyString_AsString is returning NULL
for invalid inputs (and causing an error condition), which is then fixed by the
call to FROM_UTF8. Now, we will simply return an empty string if Py_None is
returned by a python fuction, which resemebles the old behaviour of those methods
2018-10-19 09:59:06 +02:00
Thomas Pointhuber a27e547290 Fix uss39_barcode.py to work with Python3 as well 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 0812f71bd3 Fix builtins import in Python3 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 22e5e52598 Fix warning: 'HAVE_CLOCK_GETTIME' macro redefined 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 7365cb8e52 Get Exception handling working with Python 3
The old way to get the full stacktrace was incorrect, and does not work
with Python 3:
https://stackoverflow.com/questions/3702675/how-to-print-the-full-traceback-without-halting-the-program#comment84297600_33723119
2018-10-19 09:59:06 +02:00
Thomas Pointhuber 88d04f3bcb Get Action Plugins working with Python 3, fix some unicode string errors 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 8805706ccb Fix incompatibilites between Python 2 and Python 3 2018-10-19 09:59:05 +02:00
Thomas Pointhuber e9da6811a6 Fix initialisation of the pcbnew python module 2018-10-19 09:59:05 +02:00
Thomas Pointhuber 284904b72c Rewrite C extensions to also support Python 3 2018-10-19 09:59:05 +02:00
Seth Hillbrand e1f30a3b38 pcbnew: Fix single-net connectivity
Ensure that changes affecting fewer than 4 nets still get updates in the
ratsnest.
2018-10-18 17:11:58 -07:00
Jeff Young a5c892d9cd Update line width each time a new object is drawn.
Fixes: lp:1797481
* https://bugs.launchpad.net/kicad/+bug/1797481
2018-10-18 15:25:56 +01:00
Tomasz Włostowski bdc64ff0b3 router: DP_GATEWAYS::FilterByOrientation() should have exactly opposite filtering condition!
Fixes: lp:1797914
* https://bugs.launchpad.net/kicad/+bug/1797914
2018-10-18 14:29:19 +02:00
Tomasz Włostowski eea949ce0a router: don't cross DP lines when length tuning, fix swap pair polarity bug
Fixes: lp:1798500
* https://bugs.launchpad.net/kicad/+bug/1798500

Fixes: lp:1798221
* https://bugs.launchpad.net/kicad/+bug/1798221
2018-10-18 13:48:43 +02:00
Jeff Young ff992f4a64 Keep track of which nets are currently in use.
Fixes: lp:1798006
* https://bugs.launchpad.net/kicad/+bug/1798006
2018-10-18 12:14:23 +01:00
Seth Hillbrand 38c5b025c8 Ratsnest: iterate only over dirty nets
Rather than forcing each thread to iterate over the full nets list to
find the dirty items, we collect the dirty items first before asking the
threads to address them.  This prevents thread spinning.  We also
amortize the cost of calculating on an 8-net per thread basis rather
than 2.
2018-10-17 17:07:29 -07:00
Jeff Young e9a80a5d7f Some minor dialog layout fixups. 2018-10-17 11:23:02 +01:00
jean-pierre charras 9795a3572d dialog_pns_length_tuning_settings: fix incorrect dialog size.
This was due to the fact sizers recalculate the sizes before initialization of a bitmap.
2018-10-17 11:48:15 +02:00
Jeff Young 6e3f226e45 Update texts with %V and %R when values or references is chosen.
(This in addition to updating them when other fields is chosen.)
2018-10-16 17:46:01 +01:00
Jeff Young 51deb9d562 Fix issue with updating Footprint graphic items.
dyn_cast doesn't handle inheritance.
2018-10-16 17:07:59 +01:00
Jeff Young ecd893c4b1 Refresh screen after filling zones.
Previous code didn't refresh until you moved the mouse.
2018-10-16 17:07:59 +01:00
Jeff Young d62145fba9 Fix compile error when not on OSX. 2018-10-15 20:54:29 +01:00
jean-pierre charras aabff98fb6 Try to fix the Jenkins link error 2018-10-15 21:43:50 +02:00
Jeff Young 59b7762981 Back out workaround f1e2f142a6.
A proper fix is in bf164f7c4b.
2018-10-15 20:33:43 +01:00
Jeff Young 3dcd52021a Simplify exchange footprints dialog and support wildcards. 2018-10-15 19:59:47 +01:00
Jeff Young 0585382986 Allow editing of library footprint from board reference. 2018-10-15 19:59:47 +01:00
jean-pierre charras 9c398dbf90 Pcbnew, CMakeLists.txt: remove duplicate lines.
For some reason, a few files were included 3 times in the same dependency. One time is enough.
2018-10-15 20:14:27 +02:00
Seth Hillbrand a7672716f8 Revert "pcbnew: Fix memory leak in Eagle importer"
This reverts commit 45d438cd13.
2018-10-15 08:26:04 -07:00
Jeff Young 0bd0558833 Auto-select reference numbers in PcbNew like we do in Eeschema. 2018-10-14 00:06:41 +01:00
Jeff Young f1e2f142a6 Work-around for preference crash with multiple GAL docs open. 2018-10-13 19:41:45 +01:00
Jeff Young 3158273c1a Revert window-locking change which didn't fix preferences crash. 2018-10-13 15:53:54 +01:00
Jeff Young 6a5744adb1 Show compile errors and go back to GLSL V120. 2018-10-13 12:39:53 +01:00
Seth Hillbrand 4a730e6c54 pcbnew: refactor connectivity locking
Locks protect the std::set in each item.  Devolving the mutex to the
CN_ITEM allows multiple threads to make simultaneous connections to
different items where they do not conflict.
2018-10-12 17:07:31 -07:00
Seth Hillbrand 59adb109a6 Organizing connectivity
Moved large routines out of headers in into cpp.  Moved trivial routines
into headers.
2018-10-12 16:31:09 -07:00
Seth Hillbrand cfaf7c1f23 pcbnew: re-organizing connectivity
The connectivity files were unwieldy.  This separates them logically
into data, algo and items where the items classes are those that hold,
surprise, surprise, the items, lists and clusters.
2018-10-12 16:31:09 -07:00
Seth Hillbrand 4460313104 pcbnew: Separating connectivity to subdir 2018-10-12 16:31:09 -07:00
Seth Hillbrand 9e4cad666e pcbnew: Code Cleanup removing unused fns
IsDirty() is generic, so we keep the clearer m_items.isDirty() sub
function and clear out old defs.
2018-10-12 16:31:09 -07:00
Seth Hillbrand cc776f71a9 pcbnew: Code cleanup
Moving functions to std:: algorithms where feasible to reduce the code
burden.
2018-10-12 16:31:09 -07:00
Seth Hillbrand 915d2ed374 pcbnew: Zone tool follows active layer
Refactor the polygon event loop into its parent function to allow access
to the params structure.  Active layer now updates the drawing layer for
add/cutout zones.

Fixes: lp:1797483
* https://bugs.launchpad.net/kicad/+bug/1797483
2018-10-11 21:16:05 -07:00
Seth Hillbrand 4f672f0d39 Fixing a number of dynamic_casts
Dynamic casts should only be used when we explicitly check for the
resulting pointer to be NULL.  Where we know the class is castable we
can use static_cast, save on overhead and ensure our resulting pointer
is non-null.
2018-10-11 15:24:12 -07:00
Jeff Young 732e0b0bf8 Remove extra rebuild of toolbar.
It's called from CommmonSettingsChanged() anyway.
2018-10-11 18:53:00 +01:00
Jeff Young d9bf1550e4 Improve slightly confusing error message. 2018-10-11 18:53:00 +01:00
Jeff Young 609d497870 Remember settings in Global Track & Via Properties dialog. 2018-10-10 19:49:06 +01:00
Jeff Young a02e83ebdb Remove deleted footprints from selection.
Fixes: lp:1797001
* https://bugs.launchpad.net/kicad/+bug/1797001
2018-10-10 10:59:50 +01:00
Jeff Young ab67d2f81a Another go at fixing units changes for rulers.
The previous fix only worked for hot-key changes.  This should
include using the toolbar, menu, etc.
2018-10-10 10:59:50 +01:00
Jeff Young e79e2f0175 Remove properties flag from via placer so single-click mode works.
Fixes: lp:1796769
* https://bugs.launchpad.net/kicad/+bug/1796769
2018-10-10 10:59:50 +01:00
Seth Hillbrand abdb91203f pcbnew: Position relative using pad
Positioning a pad relative to an item in the board edit should move the
footprint not the pad.

Fixes: lp:1796995
* https://bugs.launchpad.net/kicad/+bug/1796995
2018-10-09 22:05:41 -07:00
Seth Hillbrand 9a86b26b82 pcbnew: Distribute footprints not pads
When using the board edit, align tool automatically moved footprints
instead of pads but distribute tool did not.  This standardizes the
behavior.

Fixes: lp:1796997
* https://bugs.launchpad.net/kicad/+bug/1796997
2018-10-09 22:01:23 -07:00
Seth Hillbrand 13997f0050 Revert "pcbnew: Adding copy constructors to PNS items"
This reverts commit 41e4bc4d9f.

This commit requires additional testing before recommitting as it causes
issues with FindJoint().
2018-10-09 14:50:20 -07:00
Jeff Young c5499a6b19 Use ChangeValue() so design rules popup doesn't get cleared.
Fixes: lp:1796780
* https://bugs.launchpad.net/kicad/+bug/1796780
2018-10-09 21:33:43 +01:00
Seth Hillbrand 808a7d9483 pcbnew: Fix crash when GAL fallback fails in some cases 2018-10-09 09:05:14 -07:00
Seth Hillbrand 246f49b8cb pcbnew: Fix Footprint selection to only footprint area
Fixes: lp:1796866
* https://bugs.launchpad.net/kicad/+bug/1796866
2018-10-09 05:53:31 -07:00
Seth Hillbrand 4e06494105 pcbnew: Fix minor bug in tracks cleaner
Allow rebuild of track connection info when modified is true.
2018-10-09 05:43:26 -07:00
Seth Hillbrand 1a6f039bb5 pcbnew: Fix minor miscalculation in dp length
The commonParallellProjection had an odd ordering of parameters that was
not followed by callers.  This corrects the ordering to standard for
each.
2018-10-09 05:37:48 -07:00
Seth Hillbrand 41e4bc4d9f pcbnew: Adding copy constructors to PNS items
Adding safe copy constructors to PNS items including assignment check
and copy operations
2018-10-09 05:37:48 -07:00
Seth Hillbrand e1fe3c7ed4 GRID_HELPER: Remove double-check condition
We only need to check nearest once.
2018-10-09 05:37:48 -07:00
Seth Hillbrand 8189fbe85c pcbnew: Fix issue suppressing Creation Date
Typo in file could lead to creation date being suppressed if timezone
could not be determined.

Also fixed a few wide chars in comments
2018-10-09 05:37:48 -07:00
Seth Hillbrand 10d348999e pcbnew: Fix minor counting issue
The evaluation of count_if resulted in a 0 or 1, leading to segment zone
fills always running on single processor and the progress bar showing
incorrect status.  Likely infrequently hit as only affected segment
fills.
2018-10-09 05:37:48 -07:00
Jeff Young 9dfcc839a4 Fix color issues with cursor and sheet pins. 2018-10-09 11:08:56 +01:00
jean-pierre charras f283667fb0 add option to switch between opengl and cairo in eeschema (step 1) 2018-10-09 11:08:56 +01:00
Jeff Young 42ee4f79e4 Fix assert in Graphic Item Properties.
Fixes: lp:1792201
* https://bugs.launchpad.net/kicad/+bug/1792201
2018-10-09 11:08:56 +01:00
Jeff Young 46426f1196 Fix segfault when routing.
Fixes: lp:1792037
* https://bugs.launchpad.net/kicad/+bug/1792037
2018-10-09 11:08:56 +01:00
jean-pierre charras 906c52deff minor compil warnings and drawings fix 2018-10-09 11:08:55 +01:00
Jeff Young 3c82ad3220 Finish up the block rotate/mirror fixes.
Block rotate and mirror now work like they do in Pcbnew (that is
they're treated as part of the block move/duplicate/whatever
rather than finishing it).

Fixes: lp:1780794
* https://bugs.launchpad.net/kicad/+bug/1780794
2018-10-09 11:08:55 +01:00
Tomasz Wlostowski e439b17fa1 eeschema-gal: make sure all other Kicad apps compile after eeschema gal hacks 2018-10-09 11:08:52 +01:00
Maciej Suminski d599a02a90 Fix unused variable warnings 2018-10-09 09:14:51 +02:00
Seth Hillbrand f11cb736e5 pcbnew: Zone selection heuristic continuity for edge
If the user is carefully selecting the zone edge, we do not filter the
zone preemptively from our disambiguation list in the same manner as we
do for selecting on zone copper.

Fixes: lp:1796719
* https://bugs.launchpad.net/kicad/+bug/1796719
2018-10-08 11:31:52 -07:00
Seth Hillbrand 3ee72031a4 pcbnew: Follow cursor when editing polygon
Fixes: lp:1796721
* https://bugs.launchpad.net/kicad/+bug/1796721
2018-10-08 10:32:30 -07:00
Seth Hillbrand 77eeda4191 pcbnew: fix pad distance calc in gateways
The pad distance was fixed to 0, making the gateway priority set
artificially to 1
2018-10-08 09:53:47 -07:00
Seth Hillbrand 1828e8cb0f pcbnew: Use Default width define instead of nums
The board design settings file keeps our default values for various
thicknesses.  We use this to replace a number of magic numbers with the
defined value to help self-document the code.
2018-10-08 09:17:40 -07:00
Seth Hillbrand ecc80c00a5 pcbnew: Initialize DRAWSEGMENT to default width
The check against S_POLYGON was always false because we set the default
type to S_SEGMENT.  This unifies the magic numbers to the board design
settings file
2018-10-08 09:07:24 -07:00
Seth Hillbrand 45d438cd13 pcbnew: Fix memory leak in Eagle importer
unqiue_ptr release creates a memory leak unless the returned pointer is
freed.
2018-10-08 08:47:58 -07:00
Seth Hillbrand af8715da80 pcbnew: Fix missing board settings class
Fixes: lp:1796541
* https://bugs.launchpad.net/kicad/+bug/1796541
2018-10-07 08:31:49 -07:00
Seth Hillbrand 9505df5997 GRID_HELPER: Fix ALT issue with snapping
Disabling the grid should leave the snapping in place.  But our disabler
returned the current point as closest, effectively always ensuring the
cursor position was the closest snap.  This only uses grid when
requested.
2018-10-07 08:23:45 -07:00
Seth Hillbrand ae7f04a20c pcbnew: snap after constraint and grid
This is temporary until we figure out a way to do multiple constraint
handling in GRID_HELPER or the EC_* class.  This will work as long as
the EC constraint helper places the endpoint on either the primary or
aux grid.

    Fixes: lp:1796540
    * https://bugs.launchpad.net/kicad/+bug/1796540
2018-10-07 08:23:45 -07:00
Seth Hillbrand ebfa7d1f7d pcbnew: Remove maximum zone corner radius
We no longer require this as we calculate the number of segments based
on the maximum deviation rather than fixed numbers.

Fixes: lp:1780518
* https://bugs.launchpad.net/kicad/+bug/1780518
2018-10-06 22:01:39 -07:00
Seth Hillbrand 1ee579c821 pcbnew: Set graphic line width based on layer
Get the board settings when changing the drawing layer.  These include
default line thickness that should be updated.

Fixes: lp:1796489
* https://bugs.launchpad.net/kicad/+bug/1796489
2018-10-06 21:42:25 -07:00
Seth Hillbrand 821b10a37e pcbnew: Drawing tool's crosshairs follow the element
When drawing the crosshair should track the element while the mouse
provides the position to calculate the next snap.

Fixes: lp:1796524
* https://bugs.launchpad.net/kicad/+bug/1796524
2018-10-06 20:27:18 -07:00
Seth Hillbrand 85194989b2 pcbnew: Ensure that dimension tool snaps to anything
The dimension tool is used to measure physical dimensions on the board
therefore it should be able to snap to any other object, not just those
on its own layer set as is the case for other items.

This also deals with a corner snap case for constraints by first
snapping, then constraining, then aligning to grid.  This ensures OoO
for alignment from least to most constraining.
2018-10-06 19:55:20 -07:00
Seth Hillbrand 3b27049f6e GRID_HELPER: filter selected items from snap target
When considering potential targets for snap points, we need to exclude
the currently selected item as this will mean that we always snap to
ourselves when editing an existing item.

Fixes: lp:1796507
* https://bugs.launchpad.net/kicad/+bug/1796507
2018-10-06 19:38:26 -07:00
Seth Hillbrand d669ae043a GRID_HELPER: Standardize grid helper logic to dim
Places dimension tool under same snapping logic as rest of draw tools

Fixes: lp:1796498
* https://bugs.launchpad.net/kicad/+bug/1796498
2018-10-06 09:53:14 -07:00
Seth Hillbrand da3afd4abd GRID_HELPER: Avoid inactive layers when snapping 2018-10-06 09:52:21 -07:00
Seth Hillbrand 776d12c529 GRID_HELPER: Measurement snapping points
Measurements should snap to the points that are used for controlling the
measurement.
2018-10-06 09:29:19 -07:00
Seth Hillbrand f2a49c6bd6 pcbnew: Get anchor from layer when drawing
When drawing segments, the segment will be NULL'd after committing, at
which point we lost our snap layer.  Choosing snap layers from the
current drawing layer is a more robust method.

Fixes: lp:1796467
* https://bugs.launchpad.net/kicad/+bug/1796467
2018-10-06 08:18:31 -07:00
Seth Hillbrand 8c56f5b035 pcbnew: Allow deselection when clicking on zone
Deselection by clicking on a zone makes working with plane zones easier
by allowing the selected item to de-selected by clicking on a zone.
Once the selection is cleared, the zone may be re-selected as normal.
Clicking on non-zone items while a separate item is selected will still
select the new non-zone item without requiring a second click.
2018-10-05 21:20:32 -07:00
Seth Hillbrand 502383b759 pcbnew: Adjust selection behavior in highlight net
Prefer non-zones in highlight net in the same way we do for the
selection tool.  Highlight net just has separate logic and was missed
previously.
2018-10-05 21:20:26 -07:00
Seth Hillbrand 4efc8dec88 pcbnew: Skip the full itemlist search when updating
Updating connectivity should not need to iterate over the full item list
in each thread.  Instead, we collect the dirty items first and then
iterate only over the dirty list.
2018-10-05 15:08:25 -07:00
Seth Hillbrand bc02044767 pcbnew: Avoid spinning up thread when routing
Our connectivity data threads the ratsnest update based on the number of
nets that have changed.  If we are only changing one net (the case when
routing) then making a full thread to update the net is pointless
because we wait for the thread to finish before continuing.  This spins
that off to an inline lambda for single updates while still making
threads for multiple ratsnest changes.
2018-10-05 15:04:29 -07:00
Seth Hillbrand 2db3f859f7 GRID_HELPER: Show snap indicator when would snap
This shows the snap indicator even when the item we are snapping to
occurs on a grid point, giving the user an indication that the point is
correctly connected.
2018-10-05 14:33:48 -07:00
Jeff Young 9e828e0d94 Don't default Use Netclass Values to on.
Fixes: lp:1795939
* https://bugs.launchpad.net/kicad/+bug/1795939
2018-10-05 15:11:18 +01:00
Jeff Young 9a213207fb Clearer titles for editing board footprints.
Also cleans up the naming on the symbol editor side.
2018-10-05 14:17:58 +01:00
Jeff Young 895e187ca0 Add a bit more space for those using larger fonts. 2018-10-05 14:17:58 +01:00
Seth Hillbrand ee676b74d5 pcbnew: Move measure tool to common GRID_HELPER
This removes the last of the Magnetize legacy code from GAL,
standardizing the key bindings and magnetic effects in the GAL canvas
2018-10-04 21:31:57 -07:00
Seth Hillbrand 4c6b84bfdb GRID_HELPER: enable/disable grid in editor with ALT
Apply optional grid while editing
2018-10-04 21:31:28 -07:00
Seth Hillbrand 28c19cb613 GRID_HELPER: Allow grid disable
Many items require precise, non-grid movement.  Adding the ability to
flag a non-grid option will permit this behavior.

This is a required precursor commit to fixing lp:1738818 and lp:1771683
2018-10-04 21:23:50 -07:00