Commit Graph

37 Commits

Author SHA1 Message Date
Seth Hillbrand 856cf51fc8 Fix typo 2020-09-23 14:00:39 -07:00
Seth Hillbrand b31eafdfa8 Restore missing layer check 2020-09-23 13:33:42 -07:00
Jeff Young 4a0d469cec Back out zone layer misunderstanding and make types clearer. 2020-09-23 20:02:21 +01:00
Jeff Young 1f284111b0 Faster algorithm for zone-to-zone connectivity test. 2020-09-23 18:51:52 +01:00
Jeff Young 6dae769944 Progress reporting for connectivity tests.
Also makes via annulus terminology more consistent.
2020-09-23 16:28:00 +01:00
Jeff Young 4d8537fcfa Handle multi-layer zones in connectivity. 2020-09-23 01:14:35 +01:00
Jeff Young 9e12ea9bb6 Cleanup some dead code and make better use of iterators.
Also applies coding style around auto and lambdas.
2020-08-28 11:05:58 +01: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 027b6c8cf9 Account for via width in connectivity
Fixes https://gitlab.com/kicad/code/kicad/issues/5176
2020-08-13 20:31:17 -07:00
Seth Hillbrand f36c158696 Remove via contact minimum from connectivity check
Connectivity takes an absolute approach to whether elements are
connected.  DRC will be adjusted to check to illegal necks that are less
than the board minimum width
2020-08-10 14:47:49 -07:00
Seth Hillbrand f615b026d9 pcbnew: Account for zone expansion in conn
Connecting zone-to-zone, we need to allow for the stroke-width in
old-style polygons.

Also, speed up the calculation by skipping zone points that do not fall
inside the matching BBox

Fixes https://gitlab.com/kicad/code/kicad/issues/5043
2020-08-07 15:59:39 -07:00
Seth Hillbrand 406de56964 pcbnew: Prevent use of non-connected item in ratsnest
We need to be careful in the connectivity system to always use
dyn_cast/dynamic_cast and check the return when dealing with board
items.  Getting non-connected items will result in null nets when
propagated.

Fixes https://gitlab.com/kicad/code/kicad/issues/5082
2020-08-07 13:38:51 -07:00
Jeff Young 6a4f611e61 Special handling for connecting vias in hatched zones.
Fixes https://gitlab.com/kicad/code/kicad/issues/2568
2020-08-06 00:03:00 +01:00
Seth Hillbrand a5a56c46c3 Remove INTRUSIVE_LIST from CN_ITEM
Intrusive lists made the connectivity search not thread-safe.  Using
iterators for item deletion provides the same order performance while
keeping the container thread-localized
2020-07-28 09:29:32 -07: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
Jon Evans f8bfb2bc16 Fix several issues with multilayer zones
- Properly refill if layer set is modified
- Fix some threading issues with island removal
- Fix copy constructor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4765
2020-07-01 20:51:44 -04:00
Jon Evans 0d4ee39f75 CHANGED: Copper zones can be on more than one layer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1963
2020-06-28 08:52:37 -04:00
Oleg Endo 4c7471eb79 add more constness to connecivity algo
also make ForEachAnchor inlineable, like ForEachItem.
remove some unused function declarations.
2020-04-21 13:23:56 +00:00
Oleg Endo 3de5b98316 improve performance of CONNECTIVITY_DATA::GetNetItems
- CN_CONNECTIVITY_ALGO::ForEachItem
move implementation to header, so that a lambda can be inlined by the
compiler.  improves iteration performance x2

- CN_ITEM::Net
move implementation to header, so that it can be inlined by the
compiler.

- CONNECTIVITY_DATA::GetNetItems
don't use std::set to filter out duplicates.  use std::unique on sorted
vector.  use a bitset to perform type check.
2020-04-21 13:23:56 +00:00
Seth Hillbrand 3d151ebd71 Cleanup connectivity parts
Removes unneeded casts from the connectivity algo.
2020-03-05 12:41:54 -08:00
Seth Hillbrand 8c19b4b6ae pcbnew: Adding arcs to PNS
This is allows ARCs in tracks to be synchronized with
the PNS router.  Note this does not yet include the UI components
to route curved traces
2020-02-21 16:11:41 -08:00
Ian McInerney 43abd53b19 Clarify limits of the if statement 2020-01-11 21:28:25 +00:00
Jeff Young 0ad9ddb3a6 Use cached bounding boxes for performance.
Fixes: lp:1846438
* https://bugs.launchpad.net/kicad/+bug/1846438
2019-10-04 11:45:08 +01:00
Seth Hillbrand b7128639f8 connectivity: Check all anchors for connection
With pads, we should check available anchor points for each connection,
increasing probability of finding connection to match fill algorithm

Fixes: lp:1844661
* https://bugs.launchpad.net/kicad/+bug/1844661
2019-09-19 12:44:40 -07:00
Jeff Young 809a4e3c0e Improve connectivity tests for pads.
We now test N, S, E and W as well as center.

Fixes: lp:1840721
* https://bugs.launchpad.net/kicad/+bug/1840721
2019-08-23 17:44:10 +01:00
jean-pierre charras dd702cd53d Remove pads not on copper layers (just on tech layers) from connectivity calculation.
Pads not on copper layers now do not have a netname, and are no longer taken in account in connectivity.
Especially it avoid creating useless rats-nests for these pads.
2019-07-25 13:08:41 +02:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Jon Evans 52a9e68093 Store items changed by connectivity algorithm in undo list
Fixes: lp:1828442
* https://bugs.launchpad.net/kicad/+bug/1828442

(cherry picked from commit fb80ee5a0e)
2019-05-24 21:56:37 -04:00
Jeff Young dae41b7460 Remove legacy segment-based zones.
Give the user the option of cancelling a file open if there are
segment zones; otherwise they're converted to polygon fills.

Fixes: lp:1823087
* https://bugs.launchpad.net/kicad/+bug/1823087
2019-04-12 20:19:23 +01:00
Seth Hillbrand a24bd9baa1 pcbnew: Adjust default update rate to 100ms
10ms was too fast to update the progress reporter and actually slowed
the process down for many machines.
2018-11-06 09:28:12 -08:00
Seth Hillbrand ed1c8eee9e async: Ensure threads are started async
It is possible for an async thread to simply be deferred if not
specifically set to async.  In which case, until the return value is
requested, the loop may simply wait.
2018-10-26 22:30:06 -07:00
Seth Hillbrand 59fb6d8851 Threading: Moving connectivity search to std::async
By decoupling from std::thread, we can avoid the wait/sleep cycle in
checking the std::atomic completion variable.  The std::future variables
are immediately returning without the additional atomic check cycle.
2018-10-26 18:00:43 -07:00
Seth Hillbrand 2d8f1df293 Threading: Minimize thread usage
This minimizes the thread usage, particularly during online actions such
as moving items and routing.

UpdateRatsnest:  Minimized the number of atomics by utilizing future
promise.  Avoided updating node-less nets.  Node-less nets are common in
the dynamic ratsnest because the net vector is created from the board
nets by value but only populated with a subset.  So the dynamic ratsnest
calculation always saw every net as dirty and spun up extra threads.

searchConnections: ParallelThreadCount is no longer lower bounded.
Small item counts are handled inline rather than with a separate thread.
2018-10-25 14:19:43 -07:00
Seth Hillbrand 4a730e6c54 pcbnew: refactor connectivity locking
Locks protect the std::set in each item.  Devolving the mutex to the
CN_ITEM allows multiple threads to make simultaneous connections to
different items where they do not conflict.
2018-10-12 17:07:31 -07:00
Seth Hillbrand 59adb109a6 Organizing connectivity
Moved large routines out of headers in into cpp.  Moved trivial routines
into headers.
2018-10-12 16:31:09 -07:00
Seth Hillbrand cfaf7c1f23 pcbnew: re-organizing connectivity
The connectivity files were unwieldy.  This separates them logically
into data, algo and items where the items classes are those that hold,
surprise, surprise, the items, lists and clusters.
2018-10-12 16:31:09 -07:00
Seth Hillbrand 4460313104 pcbnew: Separating connectivity to subdir 2018-10-12 16:31:09 -07:00
Renamed from pcbnew/connectivity_algo.cpp (Browse further)