Commit Graph

554 Commits

Author SHA1 Message Date
Seth Hillbrand e7c07501c5 Minor compile warning cleanup 2019-09-05 09:47:52 -07:00
Seth Hillbrand c8a6878eb8 pcbnew: Allow tuning length to be longer than INT_MAX
The INT_MAX limit for most elements makes sense only for single-segment,
straight line elements.  For elements that accumulate lengths, we should
utilize the long long int (64 bits) to allow for greater lengths.

Fixes: lp:1842367
* https://bugs.launchpad.net/kicad/+bug/1842367
2019-09-03 16:41:09 -07:00
Seth Hillbrand 03d5bf0df5 PNS: Check that we are optimizing a pad
Vias are also sent to breakout optimizer, so we need to check for the
solid cast before dereference.

Fixes: lp:1841057
* https://bugs.launchpad.net/kicad/+bug/1841057
2019-08-22 08:57:19 -07:00
Seth Hillbrand 06cb21cc47 pcbnew: Optimize pad connection revision
This modifies that logic for optimizing pad connections.

1) Custom pads now prefer the connections to their longer side.  This is
particularly important to match the behavior in a rectangular pad
2) Costs for straight lines are non-zero.  This favors fewer connections
3) Custom pad breakouts are at the polygon boundary rather than offset
by 0.1mm.  This also matches the circular and rectangular paradigm.
4) Line Heads contained in the pad itself are not optimized.  This
prevents escaping the pad unnecessarily

Fixes: lp:1824182
* https://bugs.launchpad.net/kicad/+bug/1824182
2019-08-20 19:35:26 -07:00
Seth Hillbrand aa875e5830 PNS: Don't allow routing on hidden layers
If the layer is not shown, we should not be allowing it's items to be
selected and chosen as the start/end items in the router.

(cherry picked from commit fc1fb7a590)
2019-08-15 12:40:05 -07:00
Seth Hillbrand 619c78622e pcbnew: Initialize drag and clear links
Drag is used for multiple modes so should be initialized when starting.
The line that we generate however needs to be pristine in drag, so we
clear the links in the duplicate.

Fixes: lp:1839612
* https://bugs.launchpad.net/kicad/+bug/1839612
2019-08-12 15:32:16 -07:00
Tomasz Włostowski 726bceecfd router: springback now works for dragging vias in shove mode
Fixes: lp:1837766
* https://bugs.launchpad.net/kicad/+bug/1837766
2019-08-07 23:49:57 +02:00
Tomasz Włostowski 88f2318c9c router: add VIA_HANDLE to refer to VIAs going in/out the SHOVE algorithm without raw pointers 2019-08-07 23:48:28 +02:00
Tomasz Włostowski 45e4387ed1 router: remove unnecessary include 2019-08-07 23:46:32 +02:00
Tomasz Włostowski 5666af4d1d router: copy m_owner when copying PNS::ITEMs 2019-08-07 23:45:38 +02:00
Tomasz Włostowski 75fcdb3b08 router: disable hole to hole mechanical constraint in P&S until a suitable solution is found (as it is now it breaks springback) 2019-08-07 23:44:43 +02:00
Jeff Young 77334628c4 Change default tool behaviour to skip unhandled events.
The problem is that wxEVT_CHAR_HOOK doesn’t do the key translation
properly.  wxEVT_CHAR does, but we only get to that if we skip the
event at the end of the tool’s event processing loop, which most tools
don’t do.  (Selection tools, point editors, pickers, and a couple of
others do skip, which is probably why this didn’t get reported earlier.)

I played around with a couple of ways to fix wxEVT_CHAR_HOOK.  Most of
them don’t work, and the few egregious hacks I tried weren't cross-
platform.

So I’m changing it so that most tools now skip at the end of their
event loops.  I left out a couple that I felt were high risk (length
tuning, for instance).  But there’s still enough risk that I’m 100%
sure it will break something, I just haven’t a clue what.

Fixes: lp:1836903
* https://bugs.launchpad.net/kicad/+bug/1836903
2019-07-26 12:21:24 -06:00
Jeff Young 79934a327e Implement shoving of free vias.
Also contains a little bit of cleanup and a lot of commenting.

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

Fixes: lp:1833214
* https://bugs.launchpad.net/kicad/+bug/1833214
2019-07-24 09:33:47 -06:00
Jeff Young a7c41f0c34 Renaming for clarity. Unqualified "push" could mean push-n-shove, or it could mean push/pop. 2019-07-24 09:33:47 -06:00
Jeff Young c1fcb1d895 Allow shoving and springback when dragging vias (either connected or free).
Fixes: lp:1833216
* https://bugs.launchpad.net/kicad/+bug/1833216
2019-07-24 09:33:47 -06:00
Jeff Young 8c77d31d4d Simplification in prep for fixing some via dragging issues.
There should be no change in logic with this commit.
2019-07-24 09:33:47 -06:00
Jeff Young aa4d7682ca Don't shove stitching vias.
Whether or not it's a good idea, the current algorithm doesn't support
it and leaves them on top of each other.

Fixes: lp:1833214
* https://bugs.launchpad.net/kicad/+bug/1833214
2019-07-21 16:38:06 -06:00
Jeff Young 6f44b00b2c Add support for hole collisions to PNS. 2019-07-21 16:38:06 -06:00
Jeff Young b79d2d9258 Cleanup. 2019-07-21 16:38:06 -06:00
Seth Hillbrand bacbe86756 pcbnew: Make clearance translucent
This sets the clearance outline to a slightly better opacity to allow
viewing of items behind the routed track clearance.  Future work should
include making this a configuration option.

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

(cherry picked from commit e0589d2908)
2019-07-18 10:47:27 -07:00
Jeff Young e816a0c29d Push Eeschema & PLEditor PICKER_TOOLs down into common.
Also implements a more robust push/pop tool strategy for pickers.
2019-07-16 00:44:01 +01:00
Jeff Young 58ca5b71a9 A more robust fix for 36f1d023f0.
This one also handles when the events get out-of-order due to them
starting out in the Simulation window and not getting dispatched until
the mouse goes over the Schematic window.

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

Fixes: lp:1836544
* https://bugs.launchpad.net/kicad/+bug/1836544
2019-07-15 14:15:24 +01:00
Jeff Young 928d6c5dff Implement preserved-corners to prevent divots when filling adjacent zones.
Fixes: lp:1460787
* https://bugs.launchpad.net/kicad/+bug/1460787
2019-07-14 18:18:48 +01:00
Jeff Young 13d61e4b2b Cleanup. 2019-07-10 01:14:21 +01:00
Jeff Young 867585c1f2 Don't allow keepout zones to match no-net tracks.
Fixes: lp:1819250
* https://bugs.launchpad.net/kicad/+bug/1819250
2019-07-05 14:45:15 +01:00
Jeff Young 9effd24f3a Allow move tool to run on top of other tools.
Fixes: lp:1784480
* https://bugs.launchpad.net/kicad/+bug/1784480
2019-07-01 22:15:25 +01:00
Jeff Young 981072598b Overhaul cursor code for new tool/action framework.
Includes the addition of an onSetCursor() handler which must be called
from both the GAL canvas AND the GAL backend (at least on OSX) to prevent
cursor flickering between (for instance) pencil and arrow.

Also includes new architecture for point editors which allows them to
coordiate cursors with the editing tools (so we can switch to an arrow
when over a point).
2019-06-27 22:37:11 +01:00
Jeff Young 2f23aa9556 Implement a more robust tool stacking architecture.
We were running into various corner conditions where a tool's event
loop would exit while the tool was still active, or the tool would
get popped while we were still in the event loop.  (A lot of these
had to do with the POINT_EDITOR's, but not all of them.)

The new architecture:
1) tools always do a Push()/Pop()
2) everyone is responsible for their own pops; no more stack-clearing
on a cancel
3) CancelInteractive events go to all tools to facilitate (2)
2019-06-27 17:01:31 +01:00
Jeff Young e175eb25b8 Fix bug with accidental modification of legacy hotkey name. 2019-06-27 11:29:05 +01:00
Jeff Young e785c140b9 Eradicate globals for PCB_GENERAL_SETTINGS.
Fixes: lp:1832896
* https://bugs.launchpad.net/kicad/+bug/1832896
2019-06-26 21:54:03 +01:00
Jeff Young f9702aab87 Immediate actions for PlEditor, PcbNew, etc. 2019-06-25 11:34:28 +01:00
Jeff Young dcbd897a95 Push/pop tools even when selected from the toolbar. 2019-06-18 20:24:15 +01:00
Jeff Young 1f35ec5521 Beware of copying events and losing the m_passEvent flag.
Fixes: lp:1833031
* https://bugs.launchpad.net/kicad/+bug/1833031
2019-06-17 14:44:39 +01:00
Jeff Young e6d5110ccf Implement I18N for ACTIONs.
It's a bit of a hack because they're statically initialized and
so we can't make use of the _() macro.  We do still want it in the
code, however, because the string harvesting is based off of it.

Fixes: lp:1833000
* https://bugs.launchpad.net/kicad/+bug/1833000
2019-06-17 10:45:23 +01:00
Jeff Young 5610261dce Immediate-action hotkeys (and context menu actions) for eeschema. 2019-06-15 20:43:51 +01:00
John Beard 1e4abac579 Fix multiple compilation issues on Linux
* Circular gal<->common dependency bites again. Add 'common'
  again to the 'kicad' target's link libraries. libgal.a depends
  on SHAPE_POLY_SET in common, but common depends on gal. This is
  not a real fix, but it unsticks Linux compilations. Fixing the
  circular dep is an existing bug: https://bugs.launchpad.net/kicad/+bug/1832229

* Missing LEGACY_HK_NAME for ACT_EndTuning: this was probably accidentally
  allowed on some other platform due to different wxString constructors.
  On Linux/GCC, it breaks.

* Unused include from /kicad in export_vrml.cpp. This is not findable
  on Linux, as pcbnew does not include the right dirs for this to be
  found. But it's not used, so just remove it.
2019-06-11 13:58:38 +01:00
Jeff Young bb96255a03 Fix dangerous static_cast-ing to wrong type. 2019-06-10 23:46:01 +01:00
Jeff Young 5e49517781 Move hotkeys to ACTION architecture. 2019-06-10 23:46:00 +01:00
Jeff Young 6025256e07 Push KIWAY_HOLDER down a level so we can move a bunch of stuff that doesn't belong there out. 2019-06-10 23:46:00 +01:00
Seth Hillbrand 0035445456 pcbnew: Allow DRC violations when marked
We shouldn't consider any obstacles when we are routing in DRC violation
mode.

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

(cherry picked from commit 3b3165ad51)
2019-06-09 13:03:08 -07:00
Jeff Young 1bf04d1722 More ACTIONs work. 2019-06-04 00:51:16 +01:00
Jeff Young 3912c7407f Move global commands to ACTIONs.
Also fixes a crash bug opening Edit Tracks and Vias dialog.
2019-06-03 21:08:30 +01:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -07:00
Jeff Young c1298570cb Remove legacy routing options. 2019-06-01 16:29:12 +01:00
Jeff Young 67cc2aac2e Rework Eeschema find/replace for modern toolset.
Fixes: lp:1827274
* https://bugs.launchpad.net/kicad/+bug/1827274

Fixes: lp:1827240
* https://bugs.launchpad.net/kicad/+bug/1827240
2019-05-22 21:48:04 +01:00
Jeff Young fbb807f3bb Move some more menu & toolbar items to modern toolset. 2019-05-16 19:57:06 +01:00
Seth Hillbrand ddc6079ceb Move remaining hard-coded segment counts
This removes the remaining hard-coded segments counts and replaces them
with the relative error calculation where the segments per arc is
determined by the maximum error we allow (smaller arcs = fewer segments)
2019-05-16 08:49:55 -07:00
Jeff Young f9e4ee1fc9 CONTEXT_MENU -> ACTION_MENU. (Now used for menu-bar menus too.) 2019-05-15 17:50:52 +01:00
Jeff Young f602ccd814 Insert EE_TOOL_BASE under SchEdit and LibEdit tools, and fix errant rename scope which clobbered PCBNew's PICKER_TOOL. 2019-05-12 13:47:08 +01:00