Commit Graph

871 Commits

Author SHA1 Message Date
Ian McInerney 31e626f279 Cleanup creation of all our smart pointers 2020-10-26 23:52:44 +00:00
Marek Roszko a785f70ea1 msgpanel is a widget, shove it to the right folder. 2020-10-25 20:01:12 -04:00
jean-pierre charras d6f91c810f Fix a few compil and Coverity warnings. 2020-10-25 10:02:07 +01:00
Marek Roszko 81a7afc76e Use kicad_algo directly rather than common.h 2020-10-24 08:53:11 -04:00
Marek Roszko 8d7feb3d72 Nip some common.h from headers 2020-10-24 08:28:03 -04:00
Seth Hillbrand 4085757aeb Remove beginning/ending spaces in translations
Adding space padding makes translations more difficult by increasing
string counts
2020-10-20 12:08:04 -07:00
Jeff Young 3045dbd6e8 Minor code clean-up. 2020-10-20 13:38:09 +01:00
Jeff Young d7ea70ba02 Don't assume a valid constraint.
Fixes https://gitlab.com/kicad/code/kicad/issues/6059
2020-10-18 20:58:53 +01:00
Jeff Young 02cbcb99df Fix broken logic in ImportSizes().
Fixes https://gitlab.com/kicad/code/kicad/issues/6049
2020-10-18 12:08:16 +01:00
Jeff Young 827699bed2 Just because we have a startItem doesn't mean it can find a width.
For instance, a pad with no other tracks attached will return 0.

Fixes https://gitlab.com/kicad/code/kicad/issues/6019
2020-10-17 13:57:07 +01:00
Jeff Young 23d9e2e74a New rules engine needs non-connected items as well. 2020-10-17 13:52:18 +01:00
Jeff Young 1ee3df61c9 Improve robustness of infobar button handling. 2020-10-16 17:07:59 +01:00
Jeff Young eea7957e16 Inform user of bad DRC rules when filling zones.
ADDED: facility for hypertext links in infobar.

Also made use of this for via constraint errors when routing.

Fixes https://gitlab.com/kicad/code/kicad/issues/5800
2020-10-16 12:44:20 +01:00
Marek Roszko 9656bd310b Remove eda_item and gr_basic from eda_text.h 2020-10-13 22:46:39 -04:00
Jon Evans cea73fe510 Restore net highlighting to router tool
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5962
2020-10-13 20:30:38 -04:00
Jon Evans fd4b9f0efa PNS: ratlines need to not be debug graphics
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5995
2020-10-13 20:04:47 -04:00
Tomasz Wlostowski ac8b072284 router: fix assertion failure when starting a route on an empty board 2020-10-13 19:36:36 +02:00
Jeff Young 44dbe3577b Create proxy items for PNS when needing to query clearances.
Fixes https://gitlab.com/kicad/code/kicad/issues/5929
2020-10-12 20:59:19 +01:00
Michael Kavanagh c40483d18a Cleanup: Move KiCad files into plugins folder 2020-10-12 16:36:08 +00:00
Jeff Young b92cb5c930 Hook up PNS via command to new rule system.
Fixes https://gitlab.com/kicad/code/kicad/issues/5951
2020-10-12 00:14:32 +01:00
Jeff Young bcebb19665 Add implied diffpair netclass rules. 2020-10-11 13:19:23 +01:00
Jeff Young 79f91481f3 Fix missing break stmt. 2020-10-11 01:11:55 +01:00
Jeff Young f680ff17d6 Need an item to pick a netclass value. 2020-10-11 00:14:42 +01:00
Jeff Young 22cde88ba9 Allow chamfering/filleting of zone/board edge intersections.
Fixes https://gitlab.com/kicad/code/kicad/issues/5947
2020-10-10 23:09:43 +01:00
Jeff Young 04c4012ee6 Make track/via sizes UI more predictable and compatible with DRC.
Two main changes: netclass values need to go through the DRC engine
so they can interact with other rules.  They're also now dependent
on the layer being routed as well as the start object.

Also make the controls adjust to each other better.  For instance,
copy-track-width needs to turn off when you select a particular
track width, and a particular track width needs to zero out when
you choose copy-track-width.

Fixes https://gitlab.com/kicad/code/kicad/issues/5951
2020-10-10 19:32:30 +01:00
jean-pierre charras c5f01501c1 PnS, router/router_preview_item: fix incorrect size of SH_RECT shape when drawing it.
The width of the rectangle was used instead of the width of outline (usualy 0) to
draw the shape (when dragging the pad for instance)

Fixes #5944
https://gitlab.com/kicad/code/kicad/issues/5944
2020-10-10 10:03:23 +02:00
Jeff Young b31470012a Previous check didn't account for router dragging. 2020-10-09 14:30:55 +01:00
Jeff Young 2ca819a627 Don't assume a DRC_CONSTRAINT has a parent rule.
It will still have a name, though.
2020-10-09 14:26:09 +01:00
Jeff Young 1cb0cbff2e Fix crash when router gets notifed but has no current m_placer.
Fixes https://gitlab.com/kicad/code/kicad/issues/5935
2020-10-09 14:26:04 +01:00
Jon Evans 966730710e Partial fix for routing with no start item 2020-10-08 20:38:08 -04:00
Tomasz Wlostowski 38cef95da9 router: initial support for V6 Design Rules (width/clearance/diff pair width/diff pair gap). Still a lot of work to do! 2020-10-09 00:01:26 +02:00
Tomasz Wlostowski 9bef95418e router: wip on less intrusive dragged trace optimization 2020-10-09 00:01:26 +02:00
Tomasz Wlostowski 5e4fb46aef MINOPTMAX: added OptThenMin() method as syntax sugar 2020-10-09 00:01:26 +02:00
Marek Roszko f5e0754f65 Use the setCursor lambda pattern and fix up the initial cursor states 2020-10-07 23:26:14 -04:00
Mark Roszko d9485129c8 Implement more context specific cursors using both stock and custom cursors. 2020-10-08 00:50:28 +00:00
Tomasz Wlostowski eb8287ded8 router: bring back legacy GetEffectivePolygon() for complex pad shapes (more info in comments) 2020-10-07 16:36:37 +02:00
Jeff Young d23d5510e7 Restore a side-effect that the router appears to depend on. 2020-10-06 00:07:34 +01:00
Jeff Young 35fa857fd8 Make sure router tool passes events it doesn't handle.
Fixes undo/redo when router tool is active but not routing.
2020-10-05 23:16:37 +01:00
Jeff Young 18a3c4c1db Fix some fairly catastrophic bugs in shape collision optimization.
I did a little too much copy & paste last time around....
2020-10-05 22:32:07 +01:00
Jeff Young 6d50c9749c Mark the colliding shape so we know which one to highlight.
Also checks the nets when checking for a pad being flashed on a particular
layer (so we don't end up thinking the currently-routing-collided track
is a connection).
2020-10-05 22:32:07 +01:00
Jeff Young d063c56971 Move PNS pad solids to COMPOUND_SHAPE.
Also fixes plated holes solids to include plating thickness.
2020-10-05 22:32:07 +01:00
Jeff Young 37906511f5 Class renaming.
DRAWSEGMENT  -> PCB_SHAPE
EDGE_MODULE  -> FP_SHAPE
TEXTE_PCB    -> PCB_TEXT
TEXTE_MODULE -> FP_TEXT
2020-10-05 11:55:33 +01:00
Mark Roszko a28a0e14ba Fix conversion warnings 2020-10-05 10:41:14 +00:00
Jeff Young 7a4900b8dc PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T
Also updated footprint text and zone types for consistencey.
2020-10-04 16:49:04 +01:00
Jeff Young bb753aaadf Clean up terminology around active & high contrast layers. 2020-10-03 22:55:34 +01:00
Mikolaj Wielgus 400c15b8eb Add mils to units, remove useMils variables 2020-10-03 20:06:56 +00:00
Jon Evans 6f54a9982c Remove PCB_LAYER_WIDGET 2020-09-30 19:12:26 -04:00
Seth Hillbrand bf3cb0b1d0 Standardize pad type enums 2020-09-30 08:38:35 -07:00
Jeff Young d3f8f2b81e Remove confusion between pad->IsOnLayer and pad->IsPadOnLayer 2020-09-30 11:50:51 +01:00
PJM 258d1a1971 Pcb: Get proper "Break Track" location when invoked from RMB context menu
When invoking "Break Track" from the RMB context menu, Pcbnew
gets and uses the current position of the mouse to figure out where to
break the track.  The problem is that the mouse has to be moved to select
the "Break Track" menu item, and the mouse position used is wrong.  This
can result in the break in the wrong location or not happening at all.

CHANGED: This commit determines if the "Break Track" was invoked from a
context menu or a hotkey.  If a hotkey, it uses the current mosue position.
If a context menu, it uses the original postion of the mouse when the menu
was opened.
2020-09-28 16:56:02 +00:00
Jeff Young f8875bc5a6 Move std::contains to alg::contains. 2020-09-26 14:42:40 +01:00
Jeff Young d7e80f8008 Add std::contains() to simplify a lot of code. 2020-09-26 12:40:32 +01:00
Ian McInerney bba29a1036 Always show the track and via menu in the router context menu 2020-09-25 00:17:54 +01:00
Ian McInerney 672756a018 Move the router tools to a TOOL_MENU context menu
The previous way of displaying a context menu was being
usurped by the selection tool because it was displaying its
menu before DispatchContextMenu was called, and all other tools
explictly use the TOOL_MENU system.

Fixes https://gitlab.com/kicad/code/kicad/issues/5762
2020-09-24 23:51:34 +01:00
Jon Evans 18e17abd6a Rename "Keepout" to "Rule Area"
These objects can now be used in advanced DRC rules and
not just for keeping things out.  Also remove the restriction
that at least one of the "basic" keepout rules must be set,
so that these areas can be used for more advanced rules.
2020-09-21 23:55:02 -04:00
Jeff Young ece2ae9805 Don't capture commands in the router eventloop that it doesn't process.
Fixes https://gitlab.com/kicad/code/kicad/issues/5692
2020-09-19 12:08:18 +01:00
Seth Hillbrand f493e270ea ADDED: Menu option to enable/disable snap to grid
You can now enable and disable snap to grid when drawing/editing across
all apps.  You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
2020-09-10 20:09:30 -07:00
Seth Hillbrand 173b4ff588 Add snapping to eeschema
This generalizes both the SetPosition() function and ORIGIN_VIEWITEM
class away from the pcbnew-centric.
2020-09-09 10:18:15 -07:00
Tomasz Wlostowski 54ca66be72 router: NODE::AllItemsInNet() can now filter by item type 2020-09-08 01:31:42 +02:00
Tomasz Wlostowski f2338d9faa router: fix segfault with NPTH holes in COMPONENT_DRAGGER 2020-09-08 01:31:42 +02:00
Jeff Young 88635ee5b6 Clean up error messages.
Convert a lot of nags to InfoBar errors/warnings/messages, and some
that never should have been exposed to wxFAIL_MSGs.
2020-08-31 14:19:57 +01:00
Jon Evans 7a5c99ee0f Tweak the mouse-based posture solver
Add an epsilon to reduce flutter
Add a lock after a certain distance
Forget the old trail when unlocking

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5381
2020-08-30 19:54:09 -04:00
Jeff Young 8b7c0cbe04 Adjust footprint zones while dragging footprint. 2020-08-28 11:05:58 +01:00
Seth Hillbrand f4e8c194be Revise restriction on No Copper setting
This allows the user to specify a NPTH with "No Copper", allowing a pad
to retain the mask layer without a copper landing.

Fixes https://gitlab.com/kicad/code/kicad/issues/3407

Fixes https://gitlab.com/kicad/code/kicad/issues/5237
2020-08-26 18:09:06 +00:00
Seth Hillbrand adff7f749b PNS: Addition layer smarts
Edge.Cuts have no parent but cross all layers, so we need to handle the
"all layers" case.  Also renames "IsPadOnLayer" to "IsOnLayer".

Fixes https://gitlab.com/kicad/code/kicad/issues/5351
2020-08-25 09:42:50 -07:00
Seth Hillbrand 686af65a9b Fix issue generating alternate shape
Boolean ops need boolean inputs.
2020-08-22 08:04:03 -07:00
Jeff Young 842641308f Solids don't always have nets (even a defualt one).
Fixes https://gitlab.com/kicad/code/kicad/issues/5290
2020-08-21 20:08:12 +01:00
Seth Hillbrand 9a4f92dfd9 Ensure that all pads with holes have alts
Alternate shapes for holes that are fallback clearance are needed in
case we have missing copper on any layer

Fixes https://gitlab.com/kicad/code/kicad/issues/5233
2020-08-20 21:50:37 -07:00
Seth Hillbrand dd9f7c8c25 PNS: Add defensive coding to AlternateShape()
Adds additional check/warnings about missing alternate shapes when they
are expected.

Fixes https://gitlab.com/kicad/code/kicad/issues/5233
2020-08-19 09:02:06 -07:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.

There is still some debugging output in test code that really needs to
be moved into a unit test.

Add debugging output section to the coding policy regarding debugging
output.
2020-08-18 10:17:36 -04:00
Seth Hillbrand 4cc820f550 PNS: skip hulls for layers where the solid isn't
If we don't have an object on the required layer and there isn't a
through-hole (m_alternateShape), then we shouldn't return a hull

Fixes https://gitlab.com/kicad/code/kicad/issues/5233
2020-08-18 06:53:03 -07:00
Seth Hillbrand 5c3a1d059e Fix memory mgmt issue with SOLID shapes
We don't delete items from the CTOR but we do need to check if they
exist in the incoming SOLID before cloning

Fixes https://gitlab.com/kicad/code/kicad/issues/5214
2020-08-17 06:16:11 -07:00
Seth Hillbrand afc94fdec3 PNS: Be better about handling multiple layers
Rather than adding pads/vias multiple times for each layer, we introduce
the "alternate shape" idiom to PNS that allows us to optionally place
the collision constraint on the hole instead of the pad for those
vias/pads that have inner layers removed.

Fixes https://gitlab.com/kicad/code/kicad/issues/5158

Fixes https://gitlab.com/kicad/code/kicad/issues/5198

Fixes https://gitlab.com/kicad/code/kicad/issues/5195
2020-08-16 12:39:15 -07:00
Jeff Young 57c3d8e8d8 Make sure preview group gets added to view after a clear. 2020-08-15 21:13:44 +01:00
Jon Evans bd14f8a82a ADDED: New appearance control widget for PcbNew
Featuring:
- Layer view presets
- Per-type opacity for tracks, vias, pads, zones
- Net and netclass color and visibility controls

CHANGED: Simplified object visibilty controls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1951
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1981
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2003
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2254
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4325
2020-08-15 15:24:28 -04:00
Jeff Young 463100d67f Remove a long-standing hack to keep divots out of adjacent zones.
The new algorithm unions any adjacent zones before doing the
chamfer/fillet and then subtracts the other zones back out afterwards.

Fixes https://gitlab.com/kicad/code/kicad/issues/3812
2020-08-12 22:20:08 +01:00
Seth Hillbrand 9a66a5acad Cleanup code line endings 2020-08-10 03:27:27 +00:00
Seth Hillbrand 5fc6b74c89 ADDED: Remove unused pads
This option removes copper layers from pads and vias where they are not
connected to other board elements.  This allows the inner layers to be
more closely routed if the via landing pad is not needed.

Fixes https://gitlab.com/kicad/code/kicad/issues/1835
2020-08-10 03:27:26 +00:00
Ian McInerney 90a17427ee Give the length tuning tool an inital end point that isn't the start point
Using the starting point as the end point means that the tool
initializes with 0 length traces and so nothing is visible.

Fixes https://gitlab.com/kicad/code/kicad/issues/1912
2020-08-08 23:41:48 +01:00
Jeff Young 7cd8f710b6 Clean up unused includes. 2020-08-08 16:25:30 +01:00
Seth Hillbrand c57c168753 PNS: Remove items from all layers
subIndices control which layers the items are inserted onto and removed
from.  The iterator to remove items needs to be inclusive of the
first/last layers

Fixes https://gitlab.com/kicad/code/kicad/issues/5090

Fixes https://gitlab.com/kicad/code/kicad/issues/5075

Fixes https://gitlab.com/kicad/code/kicad/issues/5034
2020-08-05 19:39:55 -07:00
Jeff Young 73832a9708 Work around an event processing failure.
Fixes https://gitlab.com/kicad/code/kicad/issues/4273
2020-08-05 19:36:58 +01:00
Jeff Young e2ec9d9f00 A more fail-safe way to disallow editing while routing.
Fixes https://gitlab.com/kicad/code/kicad/issues/4413

Fixes https://gitlab.com/kicad/code/kicad/issues/5067
2020-08-05 16:51:58 +01:00
Jeff Young 59ba793096 Disable various combinations of router and editing commands.
They just confuse each other.

Fixes https://gitlab.com/kicad/code/kicad/issues/5067
2020-08-04 14:32:02 +01:00
Jeff Young 74b9cce682 Try again at dragging module edges.
Fixes https://gitlab.com/kicad/code/kicad/issues/5037
2020-08-03 23:53:45 +01:00
Jeff Young ef2388b5bb Fix issue with dragging flipped MODULE. 2020-08-02 17:05:13 +01:00
Jeff Young d586495c0a Preview fp edges & text while dragging in router.
Fixes https://gitlab.com/kicad/code/kicad/issues/5037
2020-08-01 15:40:34 +01:00
Tomasz Wlostowski 89a953e039 Migrated GetEffectiveShape(s) to SHAPE_COMPOUND 2020-07-29 23:14:03 +02:00
Tomasz Wlostowski 85aecc15ee router: fix mistake in 45/free-angle mode selection when dragging corners 2020-07-29 23:14:03 +02:00
Tomasz Wlostowski c2b9db293f router: prevent heap crash when initial walkaround line is empty 2020-07-29 23:14:03 +02:00
Seth Hillbrand 1f5fb979b9 Keep PNS item RTree on layer-by-layer
Rather than extra splitting of the RTree that we use for collision
detection on types and direction, we limit this to checks on
layer-by-layer basis.  This also allows for layer expansion by using
deque of RTrees rather than fixed index

This fixes the missing layernumbers and keeps the layers in a deque to
prevent re-allocation on expansion.

Replaces ad94b6205
2020-07-29 11:21:00 -07:00
jean-pierre charras f00c59c446 Fix a few Coverity warnings. 2020-07-29 09:26:57 +02:00
Seth Hillbrand ad94b6205a Revert "Keep PNS item RTree on layer-by-layer"
This reverts commit a34d33c460.

The commit did not work properly for shove routing.  Will revist in
later commit
2020-07-28 21:20:19 -07:00
Seth Hillbrand a34d33c460 Keep PNS item RTree on layer-by-layer
Rather than extra splitting of the RTree that we use for collision
detection on types and direction, we limit this to checks on
layer-by-layer basis.  This also allows for layer expansion by using
vector of RTrees rather than fixed index
2020-07-28 10:17:56 -07:00
Jeff Young 46602148dc Fix overly aggressive assert. 2020-07-28 13:35:37 +01:00
Jeff Young 4153309fba Add defensive code.
Fixes https://gitlab.com/kicad/code/kicad/issues/4941
2020-07-25 23:54:04 +01:00
Jeff Young bf445c1a95 Performance enhancements.
1) cache pad polygon outlines
   huge improvement in connectivity performance and a decent
   improvement in DRC performance
2) don't pre-allocate CONTEXT stack
   significant improvement in DRC rule performance
2) don't keep re-encoding strings
   decent improvement in DRC rule performance
2020-07-25 13:03:33 +01:00
Tomasz Wlostowski 70b98c3b49 router: dump entire event log + annotated PCB upon user request 2020-07-22 18:05:54 +02:00
Tomasz Wlostowski 379aa8f3b5 router: clearer distinction between LOGGER and DEBUG_DECORATOR classes.
The first one keeps a log of events (start routing, mouse motion, etc).
The second allows for adding temporary debug drawings and messages which are stored synchronously with the events in LOGGER.

The event stream together with the PCB design (now with UUIDs) can be used to deterministically replay routing bugs as the user sees them.
2020-07-22 18:05:54 +02:00
Tomasz Wlostowski 2a2e389a94 router: auto-guess track posture from mouse movements, experimental! 2020-07-22 18:05:50 +02:00
Tomasz Wlostowski fd07e94760 router: abstract segment links into a LINK_HOLDER interface. DIFF_PAIRS are now also linkable 2020-07-22 17:04:42 +02:00
Ian McInerney 450107e453 Remove if statement with duplicated branches in router 2020-07-22 00:18:30 +01:00
Jon Evans 2f31bf278b Fix layer hotkey dispatch
Hotkeys received by more than one tool need AF_NOTIFY
2020-07-11 21:59:16 -04:00
Jon Evans 5d118b0700 More visibility settings infrastructure
ADDED: Three-state high contrast mode action
ADDED: Save contrast mode in local settings

Also some initial infrastructure for layer presets
2020-07-11 21:59:07 -04:00
Jon Evans 0148c1db84 Support layer switch hotkeys while routing
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4699
2020-07-03 19:49:19 -04:00
Jon Evans 3d7610d6b9 Hide PNS debug graphics behind an AC key
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4061
2020-07-03 19:33:36 -04:00
Jon Evans c0aa6965de Migrate PcbNew project settings to new framework
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.

ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
2020-07-02 22:08:54 -04:00
Jeff Young 2cfd6ba978 Fix a couple of integer overflows. 2020-07-02 22:52:37 +01:00
Jeff Young eb1ff80d57 SHAPE collision fixes.
1) An actual distance of 0 is still a collision, even if the allowed
distance is 0.
2) Be consitent about edges and interiors.  Everyone expect the edge
of a RECT to be part of the RECT; same with a CIRCLE.  SHAPE_POLY_SET
shouldn't be any different.  (And SHAPE_LINE_CHAIN was a split-
personality with the edge considered part of it for Collide() but not
for PointInside()).
2020-07-02 21:38:37 +01:00
Jeff Young 441dfa30f0 Return individual custom pad shapes instead of a SHAPE_POLY_SET.
Also implements an optional pointer to return the actual distance
from all the SHAPE collision routines.

Fixes https://gitlab.com/kicad/code/kicad/issues/4774
2020-07-02 17:09:15 +01:00
Ian McInerney 17adb6c3c6 Add context menu to route and zone toolbar items
ADDED: Context menu for route and zone toolbar items
2020-06-26 21:29:03 +00:00
Jeff Young d01b29ab37 Cleanup pad geometry handling.
There were a lot of plotters, exporters, etc. that were rolling their
own implementations.

This also introduces a lazily-built set of SHAPE objects for doing
collision detection and some forms of rendering (and later DRC).
2020-06-22 22:28:37 +01:00
Jeff Young aeed8e6e2c Finish implementation of DRAWSEGMENT::C_RECT.
It's currently only supported in the Footprint Editor.  It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
2020-06-15 20:51:31 +01:00
Jeff Young 47ab7c78a6 Divorce GRID_HELPER from the parent frame.
This moves GRID_HELPER fully into the tool framework.
2020-06-13 22:44:16 +01:00
Seth Hillbrand a8ab668122 Move SHAPE_ARC to start->mid->end format
The arc shapes need to connect with their adjacent points.  By storing
the relevant points, we allow exact point matching on both ends of the
arc as well as localize point storage.
2020-06-13 11:23:14 -07:00
Seth Hillbrand 1c46bf1955 PNS: Use segment shape for all oval pads
Instead of calculating a simple polygon for the oval pads that are
rotated, we use a rotated segment.

Fixes https://gitlab.com/kicad/code/kicad/issues/4604

(cherry picked from commit 25b8da8e3b)
2020-06-04 20:29:25 -07:00
Seth Hillbrand 674226f99f pcbnew: Set flag when cancelling during routing
Fixes https://gitlab.com/kicad/code/kicad/issues/4475
2020-06-04 15:48:01 -07:00
Jon Evans c7daf8a8f3 ADDED: Cross-probe highlighting of bus members
Note: this is a basic implementation but it could be
improved once we include bus information in the netlist
and pcbnew can natively keep track of buses and nets
instead of just nets.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4158
2020-05-24 13:30:23 -04:00
Ian McInerney 6692935808 Consolidate common viewer actions across cvpcb and pcbnew frames
* Consolidate the measure tool into one tool (this gives cvpcb
  unit changing and snapping capabilities in its measure tool)
* Transition cvpcb to use actions for the sketch modes
* Replumb how magnetic items settings are stored and used
2020-05-24 11:58:33 +01:00
Jeff Young 05855a5a1c Performance enhancements for DRC. 2020-05-18 13:38:17 +01:00
Jeff Young 3c3984a6fc Generalize default footprint fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/2289
2020-05-08 23:30:33 +01:00
Jon Evans 51eac3e3e6 Split pcbnew and footprint editor settings getters for clarity 2020-05-05 21:46:00 -04:00
jean-pierre charras 83cb9c0d14 Fix a few Coverity and compil minor warnings. Remove dead code 2020-04-21 12:47:48 +02:00
Michael Kavanagh 7db355e34a ADDED: TOOL_ACTION for switching PNS router mode.
Fixes https://gitlab.com/kicad/code/kicad/issues/2249
2020-04-19 22:44:05 +00:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
Tomasz Wlostowski 4a3cd77416 router: smarter way to check the shove direction without using silly heuristics 2020-04-15 13:00:48 +02:00
Jeff Young 6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01:00
jean-pierre charras bdada70ee7 Cosmetic enhancements: add bitmaps to a few context menus.
Fix also a minor compil warning.
2020-04-12 10:29:28 +02:00
jean-pierre charras ffe0b4aba1 Fix a few Coverity warnings. 2020-04-02 14:21:09 +02:00
jean-pierre charras ddb7b2b2b7 pns router: fix possible hang when using "end" key to finish the current track.
Add also left double click (same as "end" key) to finish the track.

Fixes #4116
https://gitlab.com/kicad/code/kicad/issues/4116
2020-04-02 14:21:09 +02:00
jean-pierre charras e811101567 fix a few Coverity warnings. 2020-04-01 09:34:44 +02:00
jean-pierre charras 6e47f147aa A few Coverity fixes. 2020-03-30 09:50:26 +02:00
jean-pierre charras 9d2712a824 Fix a few Coverity warnings.
It also fix:

Fixes #4082
https://gitlab.com/kicad/code/kicad/issues/4082
2020-03-29 18:42:24 +02:00
Seth Hillbrand 4dfe630b28 PNS: Moving the rest of the placer to Fix/Commit
Springback introduced a new PNS structure to check for valid placement
as well as separating the Fix/Commit routines.  This updates the
remaining placers to utilize the new structure.

Fixes https://gitlab.com/kicad/code/kicad/issues/4008
2020-03-06 09:56:44 -08:00
Seth Hillbrand f6317fba82 PNS: Protect drag from null deref
Items that do not have nets will not be in the index, so we need to
avoid the null pointer when adding drag tagets

Fixes https://gitlab.com/kicad/code/kicad/issues/4009
2020-03-06 09:32:04 -08:00
Seth Hillbrand 0417a6b409 PNS: Fix missing via on zero-length
The current node needs to be kept for zero-length lines when placing a
via.

Fixes https://gitlab.com/kicad/code/kicad/issues/4005
2020-03-05 15:02:40 -08:00
Seth Hillbrand b0d9838fb4 PNS: Correct assertion when dragging
Dragging using highlight caused an assertion as the duplicated lines
were being re-added with their old links still inplace.  While this was
probably fine as the link references shouldn't be stale, we clear them
to allow for the possibibility that the dragger will adjust the links in
the future.
2020-03-05 08:47:06 -08:00
Seth Hillbrand 4c2626f6b0 PNS: Don't use PNS margin to calc bump direction
The bump direction should only be concerned with physical points to
calculate the heuristic for loop-back otherwise we get too many false
positives.

Fixes https://gitlab.com/kicad/code/kicad/issues/3971
2020-03-04 19:22:57 -06:00
Seth Hillbrand fe8524b9bb Update DIFF_PAIR_PLACER to new callbacks
Needs to handle changes to PNS_ROUTER.  This does not implement
springback or backspace in DIFF_PAIR_PLACER, only allows committing
lines as before

Fixes https://gitlab.com/kicad/code/kicad/issues/3988
2020-03-04 17:23:04 -06:00
Seth Hillbrand d4cbc348de PNS: avoid committing route with nothing
The node is not neccesarily populated when committing, so we need to
check for validity first.

Fixes #3984 | https://gitlab.com/kicad/code/kicad/issues/3984
2020-03-03 14:02:32 -08:00
Seth Hillbrand 9769e1020b PNS: Don't link unroutable items
The joint map only works for items that are routable, so don't bother
adding unroutable items as this only takes additional time to process

Fixes #3976 | https://gitlab.com/kicad/code/kicad/issues/3976
2020-03-03 12:42:56 -08:00
Seth Hillbrand d6706c257c PNS: clear via when fixing route
When fixing the route, we need to clear the via to avoid re-placing it
on each future click.

Fixes #3966 | https://gitlab.com/kicad/code/kicad/issues/3966
2020-03-02 16:22:34 -08:00
Seth Hillbrand 386147628e PNS: Initialize placement test 2020-03-02 16:22:34 -08:00
Seth Hillbrand 3c19704349 PNS: Don't add null items to drag
Not all footprint pad items are connected to elements in the PNS, so if
we don't find the parent element, we avoid later crashes/assertions by
skipping their addition

Fixes #3972 | https://gitlab.com/kicad/code/kicad/issues/3972
2020-03-02 11:28:14 -08:00
Seth Hillbrand 18db471967 PNS: Line placer returns false when nothing committed
The true/false return should be triggered on whether any elements have
been commited to the line

Fixes #3969 | https://gitlab.com/kicad/code/kicad/issues/3969
2020-03-02 11:11:13 -08:00
Tomasz Wlostowski a28f58d14d router: fix regression in PNS_KICAD_IFACE treating newly created items as invisible (side effect = non-45 degree angles due to incorrect snapping) 2020-02-29 20:41:31 +01:00
Tomasz Wlostowski 6850067182 router: commit traces made in single stroke/click (fixes regression introduced with Backspace support) 2020-02-29 20:40:19 +01:00
Tomasz Wlostowski e5fff302a3 router: fix arc drawing in ROUTER_PREVIEW_ITEM 2020-02-28 23:52:33 +01:00
Tomasz Wlostowski e0bad936bf router: enable inline dragging of components 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 44905e1b0a router: initial support for dragging components with traces attached 2020-02-28 23:17:15 +01:00