Commit Graph

6674 Commits

Author SHA1 Message Date
jean-pierre charras 9610f8f208 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 20:29:48 +01:00
Seth Hillbrand a77caa6baa pcbnew: Connectivity threads update
This is a melded cherry-pick of the following commits from 5.1

59fb6d8851
ed1c8eee9e
4a730e6c54

This implements the std::async connecitivty and locking for the 5.0
branch
2018-11-07 12:33:30 -08:00
Seth Hillbrand 0b5ca1a883 ratsnest: Move ratsnest connectivity to async
This a partial pick of 59fb6d8851 but
revised for the 5.0.x branch.
2018-11-07 12:21:26 -08:00
jean-pierre charras 839ade2c05 Gerber job file: fix incorrect GUID.
Fixes: lp:1801696
https://bugs.launchpad.net/kicad/+bug/1801696
2018-11-06 08:17:22 +01:00
Seth Hillbrand 78f7ba10ef 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

(cherry picked from commit df562b7ec0)
2018-11-04 11:03:00 -08:00
jean-pierre charras dba32717b1 DIALOG_PLOT_BASE: Fix a minor wxWidgets alert. 2018-10-29 20:46:00 +01:00
jean-pierre charras 4daaaa373c Pcbnew, Gerber output: fix incorrect UUID format in %TF.ProjectId attribute.
Fixes: lp:1800459
https://bugs.launchpad.net/kicad/+bug/1800459
2018-10-29 18:57:39 +01:00
Jeff Young f87a22fefb Add missing radio button to group.
Fixes: lp:1799654
* https://bugs.launchpad.net/kicad/+bug/1799654
2018-10-24 13:35:55 +01:00
jean-pierre charras c08d3baf8c 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 18:47:23 +02:00
Seth Hillbrand cccf4cf20b pcbnew: Fix crash when removing polygon corners
GetSelectedRows() returns -1 when no rows are selected.

Fixes: lp:1798095
* https://bugs.launchpad.net/kicad/+bug/1798095
2018-10-16 09:08:03 -07:00
Seth Hillbrand e34dc4abb1 Revert "pcbnew: Fix memory leak in Eagle importer"
This reverts commit a5bdee747a.
2018-10-14 06:47:20 -07:00
jean-pierre charras 82b37a5cbe Fix an issue (items inside FOOTPRINT_WIZARD_FRAME not displayed) when a more recent Kicad version was run.
This is due to use  of LoadPerspective() that creates many issues when a frame structure changes.
The call to this useless method is just removed.
2018-10-13 10:10:15 +02:00
jean-pierre charras 561dc052ff Update FootprintWizardBase.py according to recent changes in API 2018-10-13 09:39:49 +02:00
Seth Hillbrand a5bdee747a pcbnew: Fix memory leak in Eagle importer
unqiue_ptr release creates a memory leak unless the returned pointer is
freed.

(cherry picked from commit 45d438cd13)
2018-10-08 11:35:05 -07:00
Seth Hillbrand 9977d0d737 pcbnew: fix pad distance calc in gateways
The pad distance was fixed to 0, making the gateway priority set
artificially to 1

(cherry picked from commit 77eeda4191)
2018-10-08 11:34:46 -07:00
Seth Hillbrand 46f7011463 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

(cherry picked from commit f11cb736e5)
2018-10-08 11:34:38 -07:00
Tomasz Wlostowski a43ec3e3f0 OPENGL_GAL: optimized JP's bitmap drawing function to use textures
(cherry picked from commit 516cf47946)
2018-10-06 07:22:38 -07:00
Seth Hillbrand dd22c73666 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-06 07:22:35 -07:00
Seth Hillbrand d15b34988d 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 19:58:25 -07:00
Seth Hillbrand 5e0ef36719 pcbnew: Improve zone/polygon selection
Allows selection of polygons and zones by their visible area.  Will only
select polygons/filled areas when they are unobstructed by other
elements in the footprint/pcb.  Also adds a "skip heuristics" modifier
key for clicking (ALT) that allows the full disambiguation list to be
displayed without removing less-likely elements.  This dovetails the
zone/polygon selection as it allows selecting even when areas a fully
overlapped.

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

(cherry picked from commit 6a6d580a1c)
2018-10-03 07:22:16 -07:00
jean-pierre charras 6994291997 Re activate Zone Unfill All command, accidentally removed by a previous commit.
Fixes: lp:1795293
https://bugs.launchpad.net/kicad/+bug/1795293
2018-10-01 09:05:08 +02:00
Seth Hillbrand 9837d1624f pcbnew: Force at least one connectivity thread
We want to keep at most 1 thread per 2 connectivity updates but we need
to force that floor to be at least 1 for when there is only 1
connectivity update.

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

(cherry picked from commit 89a3d2b451)
2018-09-30 12:14:26 -07:00
Jeff Young 13a41f11eb Don't deselected items that have been deleted.
De-referencing freed memory is never a good idea.

Fixes: lp:1795195
* https://bugs.launchpad.net/kicad/+bug/1795195
2018-09-30 15:46:58 +01:00
Seth Hillbrand 59723ce3ab pcbnew: Handle SEGZONE in GAL
SEGZONEs are no longer created by pcbnew but may exist in older boards.
This allows deleting the old fills in a manner similar to the deletion
in Legacy canvas.

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

(cherry picked from commit ef6f7e96f3)
2018-09-29 15:12:24 -07:00
Seth Hillbrand 79d19d9055 pcbnew: Rename PCB_ZONE_T and remove from connectivity
SEGZONE types were confusingly named PCB_ZONE_T.  Zones in pcbnew are
now _only_ PCB_ZONE_AREA_T, so we name segzone types PCB_SEGZONE_T to be
clear.

This also removes processing of the SEGZONEs from connectivity
calculations.

(cherry picked from commit b3a5e08c2f)
2018-09-29 15:12:21 -07:00
Seth Hillbrand 115f318976 pcbnew: Avoid double-separators in context menu
(cherry picked from commit a81e3c2b13)
2018-09-29 15:10:10 -07:00
Jeff Young f56ea6bf3c Don't assume GetFlags() != 0 means it's being edited.
It could just mean it's selected, highlighted or brightened.

Fixes: lp:1794624
* https://bugs.launchpad.net/kicad/+bug/1794624
2018-09-27 22:17:32 +01:00
Seth Hillbrand e3f12ec0d9 pcbnew: Do not allow drag to violate DRC without permission
m_dragstatus is set to true when a valid route is created given the
user's constraints.  We need to check this before committing the route
to the board.

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

(cherry picked from commit 317ca8e64d)
2018-09-27 13:09:40 -07:00
Seth Hillbrand c26311918e pcbnew: Deselect all items in a delete commit at once
Deselecting each individually had the side-effect of possibly re-drawing
the view in between actions, leading to visible artifacts in the router
(where invisible items are set visible before committing a change)

(cherry-picked from commit 491098af35)
(cherry picked from commit 65678b223a)
2018-09-26 09:06:48 -07:00
Jeff Young 1f19903e7e Backport text nanny limits by hand (as other commit was mixed up).
Fixes: lp:1794345
* https://bugs.launchpad.net/kicad/+bug/1794345
2018-09-25 21:13:13 +01:00
Seth Hillbrand 036288d18f pcbnew: Fixup for edde02481 to enable aux axis
Correcting edde02481 which had side effects to
efdbc91e42 while dragging a line but not a
zone.

(cherry picked from commit ee465fb23c)
2018-09-24 14:33:28 -07:00
Seth Hillbrand 8efdcbfaf1 pcbnew: Fix alignment with off-grid drag
Commit efdbc91e42 broken the primary
alignment mechanism for maintaining the current point as an auxilliary
grid reference.  This reverts that commit and fixes both the initial
issue and the associated bug by applying the primary constraint after
the secondary.  In this way, we consider the secondary constraint as an
additive rather than alternative constraint.

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

(cherry picked from commit edde02481e)
2018-09-24 14:08:49 -07:00
Wayne Stambaugh 6c3b4e5824 Pcbnew: change step export dialog action button text.
Change "OK" to "Export" so user is not surprised by the fact that the
dialog does not close after the step file is created..

Fixes lp:1784260

https://bugs.launchpad.net/kicad/+bug/1784260
2018-09-24 14:58:24 -04:00
Seth Hillbrand f3400e03c6 pcbnew: fix temp var type 2018-09-24 06:38:52 -07:00
Seth Hillbrand 9e61ebfb0b pcbnew: Standardize zone fills threading
This is a boyscouting commit to standardize the threading of zone fills.
We do not need to join threads after their completion, instead we simply
allow them to clean up their memory without blocking the user.  This
also sets the maximum number of threads that may be created to the
number of zones being filled.  More than this will only leave un-used
threads being created and immediately killed.

We also include the connectivity search as a phase in the fill progress
reporter.  This was the case before but did not utilize the correct
maxsize, leading to stalled progress bar.

(cherry picked from commit 969e85daa3)
2018-09-24 06:38:52 -07:00
Seth Hillbrand 9e355c29f1 Removing OpenMP
This commit finishes the removal of OpenMP from the KiCad codebase.
Removed in this commit are the OpenMP calls in 3d-viewer and
qa/polygon_triangulation as well as all references in CMakeLists.txt

std::thread is used instead for multithreaded computation
(cherry picked from commit f8784f30a8)
2018-09-24 06:38:52 -07:00
Seth Hillbrand 5ce0c2065c pcbnew: Cancel highlight with ESC
When editing the pcb, Ctrl-Click will highlight a net.  This allows
de-highlight with the ESC/cancel action from the selection tool.  Inside
the highlight tool, ESC reverts to the selection tool while keeping the
net highlighted.

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

(cherry picked from commit 518b53f78c)
2018-09-24 06:38:52 -07:00
Seth Hillbrand c5c89fd216 pcbnew: Prevent redo while moving items
Fixes: lp:1793948
* https://bugs.launchpad.net/kicad/+bug/1793948
2018-09-23 06:02:50 -07:00
Seth Hillbrand e7a9643b37 kicad2step: Provide floats separated
Clang++ seems to be in left-field here as it processes a stringstream
1.0X1.0 >> double as a hexadecimal floating point ('X' character) and
throws an error rather than converting 1.0 and stopping when it reaches
a non-numeric character.  This causes errors when exporting step on Mac,
which uses clang++ by default.

Adding spaces to the string is more explicit and doesn't break gcc.  It
will be sufficient until we get rid of kicad2step as an external
utility.

Fixes: lp:1778564
* https://bugs.launchpad.net/kicad/+bug/1778564
2018-09-22 08:52:05 -07:00
Wayne Stambaugh 3e28ac9c7c Pcbnew: fix lock file bug.
The lock file code would reset the lock file every other time the same
board file was opened in Pcbnew in the stand alone mode.  This created
the perfect toggle switch causing the board to be reloaded every other
time the same board was selected.

Fixes lp:1777599

https://bugs.launchpad.net/kicad/+bug/1777599
2018-09-22 09:12:16 -04:00
Seth Hillbrand 4c37defd35 pcbnew: Remove OpenMP
OpenMP is not available for macos, so moving to a std::threads
implementation brings platforms into shared code.

This also reduces the OpenMP overhead when computing connectivity and
ratsnests.

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

(cherry picked from commit c0f067bf90)
2018-09-20 16:48:08 -07:00
Seth Hillbrand a4564db082 Removing some unused code
(cherry picked from commit 47fac8a259)
2018-09-20 16:47:59 -07:00
Martin Aberg dd3c24faf8 Generate PYTHONPATH from CMake information
The CMake scripts calculate the install path for python scripts by
  distutils.sysconfig.get_python_lib(
    plat_specific=0,
    standard_lib=0,
    prefix=''
  )
which generates a string in line with
  lib/python2.7/site-packages

This string ends up in the CMake variable PYTHON_DEST and is used by the
install step as destination directory for pcbnew.py.

There has been a hard-coded assumption on the content of that string in
PcbNew which is not compatible with FreeBSD 11.1.

This commit eliminates the hard-coded assumption in PcbNew and reuses
the install path as known by CMake.

Fixes: lp:1777921
* https://bugs.launchpad.net/kicad/+bug/1777921
2018-09-20 12:03:25 -07:00
Seth Hillbrand b4fc7575a5 pcbnew: Parallelize initial board triangulation
Triangulation of zones can be time consuming for large boards.  This
adds a std::thread implementation of parallel zone loading to speed this
process on multi-core machines.

(cherry picked from commit a04ef37d67)
2018-09-20 10:12:30 -07:00
Seth Hillbrand fca0785754 pcbnew: remove duplicate rebuild in GAL
When running GAL, the connectivity is built when the board loads, so the
extra call to rebuild connectivity is not needed.

(cherry picked from commit 13b96799ea)
2018-09-20 09:32:15 -07:00
Seth Hillbrand 30d398b108 pcbnew: Unify connected lists between items/zones
Keep the zoneitems in the same list as the rest of the items.

(cherry picked from commit 284c39acac)
2018-09-20 09:32:14 -07:00
Seth Hillbrand dd7ce9f00a pcbnew: Ensure connectivity layers are respected
This prevents non-copper layers from being included in the connectivity
search.  It also limits the layer search in the connectivity RTree to
just the copper layer range.

(cherry picked from commit f87cb64d65)
2018-09-20 09:32:14 -07:00
Seth Hillbrand c7e511c919 Remove connectivity debug statements
(cherry picked from commit 589e5b9ad7)
2018-09-20 09:32:14 -07:00
Seth Hillbrand d769d1649a pcbnew: Split Layers in connectivity
Splits the connectivity search RTree by layers to avoid large penalty on
zone searches.

(cherry picked from commit dc1736eb87)
2018-09-20 09:32:14 -07:00
Jeff Young 5c600e992a Don't allow SELECTED flag to make us think item is already edited.
Fixes: lp:1793289
* https://bugs.launchpad.net/kicad/+bug/1793289
2018-09-19 19:37:28 +01:00