Commit Graph

15234 Commits

Author SHA1 Message Date
John Beard 4e2d900775 Pcbnew: FOOTPRINT_PREVIEW_PANEL passes reference to local
Previously, the GAL_DISPLAY_OPTIONS object in FOOTPRINT_PREVIEW_PANEL::New
was passed by reference in the ctor, down to EDA_DRAW_PANEL_GAL, which stored
it as a reference. The object in New() then goes out of scope, so the
referencing panel outlives the options.

Fix this by making a copy in a std::unique_ptr of the options, and giving
ownership to the panel.

There is another issue here: when the Pcbnew options are copies, the
OBSERVABLE subscriber list is copied too. This means if the panel called
NotifyChanged() on the options, Pcbnew would get updates, even though a copy
of the options changed. However, the panel doesn't change the options or
notify, so it's OK for now.

(cherry picked from commit 17e88d0944)
2019-04-11 17:14:07 +01:00
Jeff Young 4dae82054e Increase GervView layers to 51.
This also makes its use of LSET consistent with PCBNew.

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

(cherry picked from commit b7c12b238f)
2019-04-10 21:23:29 +01:00
Jeff Young cb5948d3a5 When checking for duplicate aliases look in the dialog not the symbol.
Fixes: lp:1821543
* https://bugs.launchpad.net/kicad/+bug/1821543

(cherry picked from commit e90452d0e2)
2019-04-10 21:23:14 +01:00
jean-pierre charras 9fc7281fab Zone filler: fix missing calculation of filled polygons when fill mode is ZFM::SEGMENTS 2019-04-10 18:13:15 +02:00
Seth Hillbrand bb779b237a 3d-viewer: Refresh raytracing on rotate
(cherry picked from commit 89d2e67e45)
2019-04-09 15:18:48 -07:00
Seth Hillbrand 1294b4fec8 3d-viewer: Force canvas refresh before screenshot
In some linux configurations, the canvas refresh must be posted before
being handled.  Simply requesting the refresh can queue the event,
preventing an up to date GL canvas from being saved.

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

(cherry picked from commit 707e7b4b65)
2019-04-09 14:47:54 -07:00
Seth Hillbrand 0b754562f6 pcbnew: Handle missing footprint wizards
When we do not have any footprint wizards to display, we cannot select
the grid rows.

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

(cherry picked from commit 7cf394e34f)
2019-04-09 12:07:08 -07:00
Jeff Young 15cb032ab7 Readjust Edit Symbol Properties when symbol references changes.
The new reference may contain different numbers of units and/or
different deMorgan conversion settings.

Fixes: lp:1822316
* https://bugs.launchpad.net/kicad/+bug/1822316
2019-04-09 17:02:29 +01:00
jean-pierre charras c85d2fd3bf Pcbnew: fix a serious issue in ZONE_FILLER. 2019-04-09 16:34:38 +02:00
Wayne Stambaugh bc821ff47d Eeschema: fix schematic text object plotting issue.
Save and restore text thickness in SCH_TEXT::Plot() function to prevent
the plotting default thickness value from stepping on the original text
thickness and causing all of the text objects to magically change to bold.

Fixes lp:1823165

https://bugs.launchpad.net/kicad/+bug/1823165
(cherry picked from commit 3d33cba574)
2019-04-09 10:18:08 -04:00
Jeff Young 42d9f42807 Allow no-connects to be dragged.
Fixes: lp:1821342
* https://bugs.launchpad.net/kicad/+bug/1821342

(cherry picked from commit c78c3c8198)
2019-04-09 11:20:03 +01:00
Jeff Young 7ceff4cf5d Trim zone fills to board outline.
Fixes: lp:1820306
* https://bugs.launchpad.net/kicad/+bug/1820306

(cherry picked from commit 52e3a1d7c4)
2019-04-09 11:20:03 +01:00
Jeff Young 4147da312b Adjust justified text for rotation.
Fixes: lp:1823090
* https://bugs.launchpad.net/kicad/+bug/1823090

(cherry picked from commit a81512ca96)
2019-04-09 00:36:17 +01:00
Jeff Young 439891c31f Adjust left- or right-justified text for mirroring.
(cherry picked from commit 97063440bb)
2019-04-09 00:36:06 +01:00
John Beard 322524101d Libeval: consistent formatting for NaN
On some platforms like MSVC, NaN prints as "-nan(ind)". This
is a bit needlessly ugly, so print "NaN" on all platforms
consistently.

This fixes a test failure on MSVC.

(cherry picked from commit dd17f24c04)
2019-04-08 16:29:24 +01:00
John Beard fd698653d9 QA: numeric evaluator: add a context to tests
This allows a failing test to report which case failed more clearly.

Add a quick helper to make an "in -> out" context string.

(cherry picked from commit 3f32dc9a64)
2019-04-08 15:58:59 +01:00
John Beard 8b503a06fa 3D viewer: update icons from common settings
Use the icon scaling logic and call a toolbar rebuild when the
common settings change (echos the handling in Pcbnew and friends).

Remove an unused function.

(cherry picked from commit 8548e69382)
2019-04-08 14:30:26 +01:00
John Beard 4a201df556 3D viewer: use hi-DPI settings for canvases
The 3D viewer also uses OpenGL, so it also needs to
adjust based on DPI scale factors.

This patch moves the 3D viewer common config code solely
within the 3D viewer, and adds handling of the DPI scale. This
also avoids duplicated logic in PCB_BASE_FRAME::CommonSettingsChanged.

For now, as EDA_3D_VIEWER is not included in the Kiway settings
dispatch, still manually invoke the settings update from
PCB_BASE_FRAME.

The PANEL_3D_PREV gets a similar function to read the config, but
it doesn't have a listener for the update, so it's set just once
at dialog init, just like the existing pan settings.

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

(cherry picked from commit 124dd5e59a)
2019-04-08 14:30:26 +01:00
Seth Hillbrand 577b9f478b pcbnew: Show clearance when editing tracks
When requested by display options, we should show the track clearance
when dragging tracks.

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

(cherry picked from commit cf63ae7ae2)
2019-04-07 21:26:06 -07:00
Seth Hillbrand f5a2eb1ab0 pcbnew: Allow click+drag of tracks
This behavior existed in 5.0.x but did not properly exit the edit tool
in 5.1.  This removes stops the edit tool when we begin dragging a track
using the interactive router.

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

(cherry picked from commit c8118e3ce4)
2019-04-07 20:59:38 -07:00
Michael Kavanagh 4379480d4b Change "Switch track width to previous" default hotkey from Ctrl+W to Shift+W
Tiny improvement in consistency.

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

(cherry picked from commit 27e6f5b9e8)
2019-04-07 10:52:15 -07:00
Seth Hillbrand dfa4afa826 pcbnew: Freeze the netclasses dialog on init
Prevents the size events from firing on Mac when we set up the netclass
panel

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

(cherry picked from commit a300ae105d)
2019-04-07 07:08:35 -07:00
Wayne Stambaugh a533514763 Minor symbol library rescue dialog fixes.
Adjust the sizer proportions slightly to eliminate the reported bug.
This may not be the ideal way to do this and there could be some issues
on other platforms but it does resolve the issue on gtk3.

Fixes lp:1820084

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

(cherry picked from commit 615c49315f)
2019-04-06 08:19:06 -04:00
Wayne Stambaugh 952aaef52a Minor drill file dialog improvements.
(cherry picked from commit b6a0bf1142)
2019-04-05 16:49:51 -04:00
Wayne Stambaugh a54016a6f7 Minor footprint position dialog improvements.
(cherry picked from commit dfee7bddd3)
2019-04-05 16:17:00 -04:00
Michael Kavanagh 0c8a95c44b Invert maximum and minimum endpoints on color picker sliders
Put the maximum values at the "top" of the sliders.

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

(cherry picked from commit 1ccef6dc80)
2019-04-05 14:38:48 +01:00
John Beard 403633d21f Regenerate DIALOG_COLOR_PICKER_BASE wxFB files
This avoids the wxFB automatic changes hiding substantive changes
to be made in later commits.

(cherry picked from commit 0f39d4907f)
2019-04-05 14:38:48 +01:00
jean-pierre charras cc6f1d784d DIALOG_COPPER_ZONE: fix bug that prevent to convert a zone filled by segments to a zone filled by solid polygons 2019-04-05 10:21:16 +02:00
Wayne Stambaugh e07ef3be9c Minor schematic formatter fix.
Apparently at some point in KiCad's development, a '~' character was
prefixed to the symbol name to indicate that it was not visible.  The
visibility state is now saved in the name field so remove the prefix.
The parser was kept unchanged.

Fixes lp:1632048

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

(cherry picked from commit ee14da3093)
2019-04-04 10:50:23 -04:00
jean-pierre charras f35f534ff4 DIALOG_PAD_PROPERTIES: Fix incorrect calculation of Round Rect Radius Ratio, when inches are selected.
Fix from master branch.
2019-04-04 15:56:06 +02:00
Jeff Young 3899ec136b Use a bigger hammer when refreshing fields in table.
Fixes: lp:1823050
* https://bugs.launchpad.net/kicad/+bug/1823050
2019-04-04 12:27:29 +01:00
Seth Hillbrand 91ee809558 pcbnew: Prevent aux axis after-image
Grid helper in the router tool is persistent, so remember to turn off
the aux axes after setting.

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

(cherry picked from commit 428e7a900b)
2019-04-03 16:27:37 -07:00
jean-pierre charras 4c94e2729f geometry/geometry_utils.cpp: Fix a minimal value (6) to calculate the segments by circle count to approximate a circle.
Use also this minimal value to calculate  the circle to poly correction factor
Also, remove a useless code.

(cherry picked from commit 0d2dd48cad)
2019-04-03 16:25:52 -07:00
Seth Hillbrand 2a5a207148 pcbnew: Update points before refresh
When removing a point from the polygon, the vertex is removed before it
is tested for validity.  If it fails validation, the edit is reverted
and the point count doesn't change, so the view update only modifies the
existing points.  But the revert may also have changed the shared
pointer to the point array, invalidating the view's copy.

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

(cherry picked from commit 940aef77af)
2019-04-03 16:13:20 -07:00
Seth Hillbrand c75bd89d63 GAL: Deal with thick circles
Both Cairo and OpenGL had issues (different, though) with circles that are
thicker in line width than they have radius.  This corrects the OpenGL
implementation (radius is calculated to the outer edge) as well as Cairo
(line width needs to be clamped to twice the radius)

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

(cherry picked from commit db0523626c)
2019-04-03 16:03:49 -07:00
Seth Hillbrand f58844bf8b pcbnew: Allow Missing legacy option
LEGACY is disabled for GTK3, so we may not find the menu item

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

(cherry picked from commit ce254d1061)
2019-04-03 16:03:21 -07:00
Wayne Stambaugh 07ac3499f3 Remove debugging code added in commit d2cb0ca7.
(cherry picked from commit 75366bce74)
2019-04-03 12:20:37 -04:00
Wayne Stambaugh 050b64b822 Pcbnew: fix DXF import line width bug.
There is a circular dependency between the GRAPHICS_IMPORTER object and
the GRAPHICS_IMPORT_PLUGIN object which makes sharing the settings in
the GRAPHICS_IMPORTER unwieldy.  This fix is a ugly hack that resolves
the issue.  The underlying issue will require some major refactoring.

Fixes lp:1821234

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

(cherry picked from commit 120ab06db4)
2019-04-03 11:32:30 -04:00
Wayne Stambaugh 43aa94dcfc Pcbnew: fix import graphics dialog issues.
Improve padding, spacing and alignment of dialog layout.

Fix title capitalization.

Make file dialog wildcard string translatable.

Remove fixed initial dialog size to allow sizers to work their magic.

Replace OK button event handler with TransferDataFromWindow.

Remember last line width units between dialog instances and sessions.

Save configuration file settings in a separate group and remove GfxImport
prefix from the entry names.

Add fencing to dialog header file to prevent nested includes.

Fixes lp:1822568

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

(cherry picked from commit d2cb0ca75f)
2019-04-03 11:32:09 -04:00
John Beard b2e54a432b QA: Use own unit test headers for eagle test
These include the appropriate "polyfills" for things like
Boost versions.

(cherry picked from commit 20d36c18350fcccb1bee835553a68da8a0c96b0b)
2019-04-02 23:31:33 +01:00
John Beard e766732020 QA: Eagle test: look up test data in the source tree
Also provide a utility function to get this path, and
a way to override at run time to quickly sub in alternative
data.

The test itself is still broken, as this plugin won't accept
a call to Load() without a KiWay.

(cherry picked from commit 88faac309f)
2019-04-02 19:08:26 +01:00
John Beard 3a5e01c44a QA: Enable eeschema tests
Redesignate the eagle test as eeschema tests and build
more like the other unit tests.

Enable as a test in Ctest now that the test executes without
crashing.

The loading of the file with the hardocded part is still
not enabled, as this needs more infrastructure to support it.

(cherry picked from commit 4eb30f6b85)
2019-04-02 19:08:26 +01:00
John Beard d4883da98b Eeschema: construct simulator cursors on demand
Statically constructing wxCursors as used for the probe
and tune cursors crashes the qa_eagle_plugin test
instantly.

Fix this by introducing a new class CURSOR_STORE,
which allows to abstract the platform wierdness of wxCursors
and allow the simulator to laziliy init its own cursors
at runtime.

This code isn't properly tested, as these cursors are never
actually used. However, it does allow the eeschema unit test
to run.

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

(cherry picked from commit 6f1c3f5ef8)
2019-04-02 19:08:26 +01:00
Michael Kavanagh 7cc3e9a16d Add Ctrl+, hotkey to preferences dialog
Also change interactive router settings from Ctrl+, to Ctrl+Shift+,

(cherry picked from commit b0674b8802)
2019-04-02 13:17:37 -04:00
Michael Kavanagh 9ad352d4bd Fix 'hokey' -> 'hotkey' typo
(cherry picked from commit fe6bc411dd)
2019-04-02 13:17:18 -04:00
Seth Hillbrand 031173bc47 pcbnew: Handle old stable translated layers
This inserts a translation map in the layer names so that the old stable
files with Italian/French layer names get updated to the standard
English layer names (instead of not opening).

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

(cherry picked from commit 6f4d1345f3)
2019-04-01 14:25:27 -07:00
Seth Hillbrand 658820a25e pcbnew: Ensure DRC circles have at least 4 points
This prevents invalid outline errors for small circles.

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

(cherry picked from commit 5eb2a33498)
2019-04-01 14:25:27 -07:00
Wayne Stambaugh 17fdce01a9 GerbView: remember last open gerber file dialog wildcard.
This is only for the current GerbView session.  When GerbView is closed,
the last open gerber file dialog wildcard setting is lost.

(cherry picked from commit f20a1314ff)
2019-04-01 12:47:45 -04:00
Jeff Young bc4cc00332 Update description when tree item is in editor.
Fixes: lp:1820298
* https://bugs.launchpad.net/kicad/+bug/1820298
2019-04-01 13:47:40 +01:00
Jeff Young b57e9492b1 Disable alias controls when no alias is selected.
Fixes: lp:1821698
* https://bugs.launchpad.net/kicad/+bug/1821698
2019-04-01 13:47:31 +01:00