Commit Graph

13423 Commits

Author SHA1 Message Date
jean-pierre charras e453b5b87b Page layout bitmap size wrong in modern/GAL canvases.
The image scale set by pl_editor was not taken in account when drawing the page layout.
2018-10-20 18:31:19 +02: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
Maciej Suminski 3d9e6867cf Spice netlist exporter: handle multiline directives
Fixes: lp:1797937
* https://bugs.launchpad.net/kicad/+bug/1797937

(cherry-picked from 9757107b)
2018-10-19 17:34:14 +02:00
jean-pierre charras bd1b15ded7 Eeschema, spice netlist exporter: fix an issue that converted spice string commands to lowercase.
Therefore, it can breaks some commands, especially filenames.

Partial fix of bug 1797937.

(cherry-picked from 8f9b0f02)
2018-10-19 17:00:11 +02:00
jean-pierre charras 8f87aae99e Page layout editor: fix a bug in GUI: the PPi setting was not displayed for bitmap items 2018-10-19 13:51:41 +02:00
Seth Hillbrand 43987cc50c UTF8: Fix MSVC builds
MSVC does not support variable length arrays.  Substitute a std::vector
instead.

(cherry picked from commit 6d8a759c75)
2018-10-18 11:50:04 -07:00
Seth Hillbrand 6106210c87 UTF8: Correct MSW issue with previous commit
Linux does not handle the resize command with wide-character extended
table UTF-8.  The solution did not work for W7-32bit.  This is a
compromise, attempting first the preferred, previous solution and
falling back to the secondary solution.
2018-10-17 12:12:49 -07:00
Seth Hillbrand b37bc69476 UTF8: Utilize the safe conversion from wchar
Invalid wchar characters would throw an exception.  We need a defined
output from the += operator, even for unknown character.

Fixes: lp:1798144
* https://bugs.launchpad.net/kicad/+bug/1798144
2018-10-16 16:36:42 -07: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
John Beard 99549f816f QA: Remove obsolete fillet refactor tests
These tests are fundamentally broken as they test two fillet
implementations against each other, but the two implementations
no longer have the same interface or meaning (one has a fixed
segment count, one has a fixed error).

This also allows the tests to run on Boost <1.59, which do not
provide the !-syntax for excluding tests. Ubuntu 16 uses
Boost 1.58, so this causes build failures.

Fixes: 1785377
https://bugs.launchpad.net/kicad/+bug/1785377
2018-10-16 09:40:06 -04: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
jean-pierre charras 553b529fd4 Gerbview: fix a overzealous wxASSERT
Fixes: lp:1796744
https://bugs.launchpad.net/kicad/+bug/1796744
2018-10-09 08:47:16 +02:00
Wayne Stambaugh 7573c6a4e4 Start release version 5.0.2 development 2018-10-08 17:45:02 -04:00
Wayne Stambaugh c000d70a51 Tag release version 5.0.1 2018-10-08 17:14:38 -04:00
Seth Hillbrand 234b01905d eeschema: fix mistaken wire removal bug
The wire between two points should not be trimmed if it starts or ends
on one of the component's connection points.

(cherry picked from commit d2906f7975)
2018-10-08 11:35:12 -07: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
Wayne Stambaugh 876232aa7a Fix LIB_ID illegal character tests.
The '/' and ':' are reserved and cannot be used in symbol or footprint
names.  They will cause the LIB_ID parser and formatter to fail.  While
it seems like they should be legal in symbol alias names, they will
trigger a symbol rescue the next time the schematic is loaded.

Use ID_SCH as in the Eagle schematic plugin rather than ID_ALIAS to
ensure symbol names do not need rescued the next time the schematic is
opened.

Remove ID_ALIAS since the rules for alias names are the same as the
rules for symbol names.  Otherwise, allowing '/' and ':' in alias names
will force a symbol rescue on the next schematic load.

Fixes lp:1795600

https://bugs.launchpad.net/kicad/+bug/1795600
2018-10-07 15:35:16 -04:00
jean-pierre charras 39c38fb386 Fix a side effect of our LOCALE_IO by using setlocale( LC_NUMERIC, "C" ) instead of setlocale( LC_ALL, "C" ) LC_NUMERIC is the right option to use in LOCALE_IO because only the floating point separator must be modified When using LC_ALL, the Env var expansion wxGetEnv() was not working when the env var contains non ascii7 codes after a call to LOCALE_IO. When using setlocale( LC_NUMERIC, "C" ) in LOCALE_IO, wxGetEnv() works fine.
Fixes: lp:1795990
https://bugs.launchpad.net/kicad/+bug/1795990
2018-10-07 16:27:47 +02:00
jean-pierre charras 99f25b0895 Opengl fix: bitmaps having a width not multiple of 4 were incorrectly drawn.
This fix draws a "sub bitmap" having a width multiple of 4.
(The loss of 1 to 3 pixels in horizontal size should be not really noticeable)

(cherry picked from commit 3a02e54411)
2018-10-06 07:22: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
jean-pierre charras 7b596f0365 GAL canvases: add DrawBitmap(), using a basic brute force algo for OpenGL, and a optimized code for Cairo. In this fix the brute force means draw each pixel as a rectangle. It works fine, but could be optimized.
(cherry picked from commit fefc7b8172)
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
jean-pierre charras 51a74b53cb Pcbnew: Crash after running external plugin Happens only in Opengl mode. So enforce controls in 3 group function: DrawGroup, ChangeGroupColor, ChangeGroupDepth.
Fixes: lp:1795044
https://bugs.launchpad.net/kicad/+bug/1795044
2018-09-29 14:19:07 +02:00
John Beard f591f8741a Prevent segfault when undoing or resetting non-hotkey rows
This is caused by:

* Not checking the hotkey data is not null when performing a
  hotkey action
* Allowing hotkey actions on non-hotkey rows.

This fixes both of these, and adds an assert to warn if someone
does manage to fire a hotkey action on a non-hotkey row (but it
won't crash).

This is a ported version of commit 704615721 on the master branch.

Fixes: lp:1794756
* https://bugs.launchpad.net/kicad/+bug/1794756
2018-09-28 10:20:53 -04: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
Jeff Young 1e223b9027 Don't use nullprt for a dialog's parent.
Fixes: lp:1791561
* https://bugs.launchpad.net/kicad/+bug/1791561

(cherry picked from commit 3f23e9ac46)
2018-09-25 04:41:42 -07: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 9831a14ef3 eeschema: Re-add auto-wire removal
Somewhere during v5 rc cycle, the trimming of wires laid over simple
components was removed.  The wires were still removed as soon as the
user moved the component again.  This corrects the first behavior to
intended action for simple components.

Fixes: lp:1794019
* https://bugs.launchpad.net/kicad/+bug/1794019
2018-09-24 06:38:52 -07:00
Seth Hillbrand f3400e03c6 pcbnew: fix temp var type 2018-09-24 06:38:52 -07:00
Jeff Young 04e699f789 Show pads when parent footprint is selected.
Fixes: lp:1670090
* https://bugs.launchpad.net/kicad/+bug/1670090

(cherry picked from commit 66848b9334)
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