Commit Graph

13112 Commits

Author SHA1 Message Date
John Beard 896ad3774d "Select Connection" menus enablement
Previously, the "Select Connection" sub-items were greyed out when the
selection contained both tracks and vias. This meant that you couldn't
access "Select Copper Connection" when the selection contained both
tracks and vias (though the keyboard shortcuts did work).

Change to use SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::Tracks
) to allow any combination of track elements to be selected.

Fixes: lp:1772249
* https://bugs.launchpad.net/kicad/+bug/1772249
2018-06-11 10:58:26 -07:00
John Beard 0555bbc656 Pass PCB display settings to PNS router tool
This allows the tool to set display options like the clearance.

Fixes: lp:1766836
* https://bugs.launchpad.net/kicad/+bug/1766836
2018-06-11 10:48:05 -07:00
Jeff Young 8a2639325d Update footprint value when doing a Save As to library.
Fixes: lp:1570120
* https://bugs.launchpad.net/kicad/+bug/1570120
2018-06-11 14:43:32 +01:00
Jeff Young 5c65881fde Allow Global Fields Editor to Cancel with no changes. 2018-06-11 12:10:19 +01:00
Ben Gamari da61285a29 field editor: Save checkbox states
This refactors the symbol field editor's checkbox state-saving code to
deal with multiple projects with disjoint field sets more consistently.

For instance, imagine I have a two projects

 * Proj1 has fields A, B, C
 * Proj2 has fields A, B, D

Under the old scheme, when I switch from one project to the other the
state of fields C and D will be forgotten. With the new approach,
however, they are retained.

Not to mention, the implementation is considerably simpler.  Fixes
2018-06-11 12:08:59 +01:00
Jeff Young de7791cc8b Add context menu to footprint viewer for zoom & grid.
Fixes: lp:1776126
* https://bugs.launchpad.net/kicad/+bug/1776126
2018-06-11 11:37:48 +01:00
Maciej Suminski 813c1a2ba2 Dealing with inconsistent wxGLCanvas::IsDisplaySupported()
wxGLCanvas::IsDisplaySupported() handles wxGL_{MINOR,MAJOR}_VERSION
attributes only in 3.0.4. Since 3.1.0 the attributes are apparently not
supported, so instead wxGLContext::IsOK() is used (introduced in 3.1.0).

Fixes: lp:1775995
* https://bugs.launchpad.net/kicad/+bug/1775995
2018-06-11 12:26:59 +02:00
Ben Gamari 3f783d2318 field editor: Find components when reference field is clicked
This makes it significantly easier to find a particular component when
using the field editor, as I often do for part selection.

Fixes: lp:1772169
* https://bugs.launchpad.net/kicad/+bug/1772169
2018-06-11 10:27:49 +02:00
Maciej Suminski 850aac5ec5 Set OpenGL_GL_PREFERENCE for CMake 3.11+ 2018-06-11 10:27:49 +02:00
Jeff Young 9edfd25b95 Select best-matching component when filtering.
This also fixes the old bug of scrolling to the selected best
match.

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

Fixes: lp:1744703
* https://bugs.launchpad.net/kicad/+bug/1744703
2018-06-10 23:21:05 +01:00
Damien Espitallier 0e3be5776c Add library name pseudo-hash in fp_list_table GenerateTimestamp output 2018-06-09 16:18:40 +01:00
Simon Richter 8444b1b617 Add missing header 2018-06-08 17:15:17 -07:00
Jeff Young b9874da3a6 Remove background fp loading from Choose Symbol dlg.
There are a bunch of problems with event processing and closing
documents, etc., when enabled.  See the bug report for more
info.

Fixes: lp:1774777
* https://bugs.launchpad.net/kicad/+bug/1774777
2018-06-09 00:51:39 +01:00
Jeff Young 5098c5796a Prevent another case of "fall behind" dialogs. 2018-06-09 00:51:39 +01:00
Seth Hillbrand c5c52c3dfd pcbnew Check for valid nodes before drawing ratsnest
We can invalidate a node by rotating.  Make sure that our endpoints for
the ratsnest are valid before attempting to draw.

Fixes: lp:1775727
* https://bugs.launchpad.net/kicad/+bug/1775727
2018-06-08 16:34:37 -07:00
Seth Hillbrand fb9ccd855d eeschema: Check for dangling ends when switching sheets
When you search for an item that exists on a separate sheet in the
schematic, the newly loaded schematic sheet needs to have the dangling
flags set so that we don't have a mess of non-connected "o" markers.
2018-06-08 12:51:54 -07:00
Seth Hillbrand 72238e260a Fix overload compile warning 2018-06-08 11:25:27 -07:00
Seth Hillbrand 7558c71aca When clearing annotations, keep units
Clearing annotations should only clear the settings that can be set by
the matching annotate function.  Even in components where the units are
functionally the same, the unit choice should be retained as there are
often other considerations when chosing the unit.

Fixes: lp:1769457
* https://bugs.launchpad.net/kicad/+bug/1769457
2018-06-08 10:51:56 -07:00
Seth Hillbrand 68f6e3ad44 pcbnew: Differential pairs obey netclass settings
PNS routing options allow trace width to be chosen by the assigned
netclass.  This extends that to differential pair width/gap settings as
well.

Fixes: lp:1672126
* https://bugs.launchpad.net/kicad/+bug/1672126
2018-06-07 08:58:12 -07:00
jean-pierre charras 6d77e594b5 Python binding: fix pcbnew.Refresh() to make a better re-initialization.
Minor fixes in comments.

Fixes: lp:1775003
https://bugs.launchpad.net/kicad/+bug/1775003
2018-06-07 10:04:29 +02:00
Seth Hillbrand a5b92a1fe4 Constrain dimension tool while creating
The dimension tool is optionally constrained (MD_CTRL) while editing the
dimension.  This ensures same behavior for the creation step.
2018-06-06 17:04:28 -07:00
Seth Hillbrand 40d2535625 Recalculate ratsnest when moving footprint in legacy
Legacy shows the local ratsnest when moving a footprint.  Therefore we
need to recalculate it when the move ends.

Fixes: lp:1775473
* https://bugs.launchpad.net/kicad/+bug/1775473
2018-06-06 15:40:58 -07:00
Seth Hillbrand abd8927d71 Dimension Edit window passes default action
Processing enter from within the dimension editor window is only set to
the default action for top-level items.  Within the sizer, enter is
handled by the first registered button (Cancel) unless explicitly set.

Fixes: lp:1774035
* https://bugs.launchpad.net/kicad/+bug/1774035
2018-06-06 12:31:48 -07:00
Seth Hillbrand a5c213c23d Set footprint splitter window canvas to transient
The splitter window can not be the parent to any additional windows.
If it acquires a child that persists past the lifetime of the splitter
window, we get a segfault.
2018-06-06 10:03:00 -07:00
Maciej Suminski 64e98c8e54 Fixed Symbol Library editor crash on start
Added a null pointer check missing in 51c7381f

Fixes: lp:1775414
* https://bugs.launchpad.net/kicad/+bug/1775414
2018-06-06 17:01:06 +02:00
Maciej Suminski 228881f552 Eagle SCH import: validate package (footprint) names 2018-06-06 10:12:04 +02:00
Maciej Suminski 51c7381fd5 Fix Choose Symbol dialog freezes in eeschema
Scrollbars are always enabled to prevent an infinite event loop caused
by alternating CreateLayout() and OnSize event handler.
More details: http://trac.wxwidgets.org/ticket/18141

Fixes: lp:1767848
* https://bugs.launchpad.net/kicad/+bug/1767848
2018-06-06 09:11:15 +02:00
Jeff Young 9552e02727 Handle description when reading netlist. 2018-06-06 01:59:56 +01:00
Jeff Young 271826f8f3 Fix crash when deleting from library with nothing selected.
Fixes: lp:1775289
* https://bugs.launchpad.net/kicad/+bug/1775289
2018-06-06 00:01:47 +01:00
Damien Espitallier 5263558eaa Fix crash when delete button of footprint filter is clicked and no footprint is selected
Fixes: lp:1775296
* https://bugs.launchpad.net/kicad/+bug/1775296
2018-06-06 00:01:47 +01:00
Jeff Young a300006956 Fix dialog layout of Add 3D Shape.
Fixes: lp:1747652
* https://bugs.launchpad.net/kicad/+bug/1747652
2018-06-06 00:01:47 +01:00
Jeff Young e0c881b639 Output descriptions to components in generic netlist.
Also hooks up the Python netlist reader to the descriptions so
that they appear correctly in BOMs.  (The BOM generators used
to always get the root component's description rather than the
alias's description.)

Fixes: lp:1774358
* https://bugs.launchpad.net/kicad/+bug/1774358
2018-06-06 00:01:47 +01:00
Jeff Young aaf47bbe71 Replace "unsaved changes" dialog to Global Fields Editor. 2018-06-06 00:01:47 +01:00
Seth Hillbrand 7d62f14dd0 Set ViewBBox to viewitem size
Limit the bbox size of origin view item to item size.  This prevents
excessive redraw.

This also side-steps a degeneracy in the RTree calculation under certain
conditions in i386 where multiple, maximum-sized items are degenerate.

Fixes: lp:1774316
* https://bugs.launchpad.net/kicad/+bug/1774316
2018-06-05 15:35:58 -07:00
Seth Hillbrand 9e4511eb11 Update netclasses when loading footprint
When clearing the pcb in footprint editor, we need to transfer the
netclass settings to ensure we have the correct defaults for the new
footprint.

Fixes: lp:1751583
* https://bugs.launchpad.net/kicad/+bug/1751583
2018-06-05 12:44:43 -07:00
jean-pierre charras 9354372a0c Fix bug: Pcbnew crash on invoking footprint browser when already open (happens only in some distros)
Fixes: lp:1775178
https://bugs.launchpad.net/kicad/+bug/1775178
2018-06-05 20:05:56 +02:00
jean-pierre charras da392728d4 spice_value.cpp: replace std::invalid_argument by KI_PARAM_ERROR (replacement forgotten in commit a288d6199)
see commit a288d6199 for the reasons of this replacement.
2018-06-05 16:07:47 +02:00
jean-pierre charras a288d6199e Add KI_PARAM_ERROR, similar to std::invalid_argument but using wxString instead of std::string to throw errors.
std::invalid_argument does not work fine with translated strings as argument for message.
(the translated message is incorrectly or not displayed if it contains non ascii8 chars, at least on Windows).
KI_PARAM_ERROR can be throw-ed with a translatable/translated string (a wxString)
2018-06-05 13:29:51 +02:00
John Beard 58814e838d Common: Fix -Wcatch-value warnings (catching exceptions by value)
This fixes some warnings on GCC 8.1:

warning: catching polymorphic type ‘class std::out_of_range’ by value [-Wcatch-value=]
         catch( std::out_of_range )
                     ^~~~~~~~~~~~

This fix is along the same lines as:

* ff1802d7a "Fix Coverity "Big parameter passed by value" warnings"
2018-06-05 11:46:17 +02:00
Seth Hillbrand f95b77b61a Fix overflow on 32-bit machine
Bitmap hash incorrectly shifted by 60 bits on 32 bit machines while only
shifting 28 bits on 64 bit machines.
2018-06-04 16:41:16 -07:00
Seth Hillbrand ee34aab07a Async hardening
There are three related changes here to harden our handling of threads
in the footprint async loader.

1) Footprint async loader explicitly aborts any remaining loader threads
on exit.

2) We protect the thread join by a mutex

3) We do not pause during no-wait routines
2018-06-04 15:08:40 -07:00
Seth Hillbrand 39ac5e0af8 Pcbnew: List nets fix calculation speed
Similar to 6e5726613, we need to find net node count quickly without
iterating over all items in the board.
2018-06-04 11:08:54 -07:00
Wayne Stambaugh 7343e78347 Fix some Coverity uninitialized field warnings.
Fixes Coverity CIDs:

- 175824
- 169337
- 163191
- 175827
- 175440
- 175438
- 157136
2018-06-04 13:48:57 -04:00
Seth Hillbrand 5dbfa6a9c1 Correct node/pad count in pcbnew
Pads count all pads/pins on the board including unconnected and NPTH.
Nodes count only the pads that can connect to a net and are therefore
routable.  These were being calculated as the same number (displayed in
the info bar at the bottom of the screen)
2018-06-04 10:26:40 -07:00
Wayne Stambaugh ff1802d7a1 Fix Coverity "Big parameter passed by value" warnings.
Fixes Coverity CIDs:

- 175846
- 175841
- 175840
- 175837
- 175836
- 175834
- 102524
2018-06-04 12:30:00 -04:00
Seth Hillbrand 63a952d239 Adjust connectivity to use RTree
Connectivity searches were slow for large, complex boards.  This was
partly due to the need to search all lists for possible connections
between anchors.

We remove this requirement by creating an RTree based on items' bounding
boxes similar to the PNS router.  Then we get both the colliding items
and search forward/backward to see if there are connections between the
anchors and the other item.

Because we use RTree, we no longer need the maintenance overhead of multiple
item lists and an anchor list in the connectivity class.

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

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

Fixes: lp:1761989
* https://bugs.launchpad.net/kicad/+bug/1761989
2018-06-04 08:30:07 -07:00
Wayne Stambaugh 6f65f835f4 Fix assert in CvPcb when opening footprint equate file dialog.
Fixes lp:1774726

https://bugs.launchpad.net/kicad/+bug/1774726
2018-06-04 10:09:06 -04:00
Maciej Suminski e4a6f2e523 Switch canvas to Cairo if OpenGL is not supported on the first run 2018-06-04 12:17:58 +02:00
Maciej Suminski 6bd708621b Early check of supported OpenGL version 2018-06-04 12:17:58 +02:00
jean-pierre charras 0b8cf93888 Pcbnew, On line DRC in legacy canvas: Fix broken Drc test during track and zone creation or edition.
It was broken by commit c78171d01f.
During creation, the Drc must only display a error message, and do not create markers.
Markers are created only during a full board DRC test.
commit c78171d01f replaced this behavior by a incorrect one (create markers and do not show error messages)
2018-06-04 11:20:11 +02:00