289 Commits

Author SHA1 Message Date
Seth Hillbrand
6e2b20ed0e Update BS Threadpool to 5.0 2025-09-10 13:02:24 -07:00
Seth Hillbrand
50c7aff3ff Simplify KiROUND using std::llround/clamp
Removes the bespoke rounding in favor of std::llround and std::clamp
routines
2025-08-04 09:26:25 -07:00
Jeff Young
dc3cd81a2a Don't run connectivity on non-existant layers.
Fixes KICAD-X8V.
Fixes KICAD-VH3.
2025-08-02 22:04:53 +01:00
Jeff Young
3774d77cc7 Propagate from zone to free-via.
This must be open-coded as the CSM_PROPAGATION
algo ignores zones.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21251
2025-07-21 11:46:31 +01:00
Jeff Young
7cf028b457 Formatting. 2025-07-21 10:50:28 +01:00
Christopher Alexander
f4b1a15cd8 fix for issue 17429 - fixes DRC unconnected items exclusion instability 2025-06-25 17:03:35 +00:00
Jeff Young
9d6928043f Don't format strings if we're not going to report them. 2025-06-09 20:09:24 +01:00
Jeff Young
8235843d01 Don't pass large structures by value. 2025-06-09 20:09:24 +01:00
Jeff Young
9750f7690c Performance optimizations. 2025-06-05 18:01:44 +01:00
Tomasz Wlostowski
96cd5ea8c1 revert #07a86873c (accidental debug code) 2025-05-12 15:25:10 +02:00
Tomasz Wlostowski
07a86873ca topo match by value + prof 2025-05-11 23:46:49 +02:00
Seth Hillbrand
9d1142839a After removing items from the conn list, check valid
When cancelling, we mark elements invalid if they are removed from the
connectivity list.  Be cause when iterating through the list again.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20566
2025-04-21 11:44:30 -07:00
Seth Hillbrand
bccf365380 Isolate thread pool loops
Now that we are threading things in different frames, we need to watch
that we are not waiting for a process to complete in one frame while
working in another.  To accomplish this, we only wait for our own loop
results

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20572
2025-04-07 12:17:11 -07:00
Jeff Young
2ca09457b0 Formatting. 2025-03-26 14:50:34 +00:00
Jon Evans
1c83f0a70b Implement jumpers for footprints
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2558
2025-03-24 22:17:46 -04:00
Wayne Stambaugh
47984b6793 Coding policy house keeping. 2025-03-17 12:45:25 -04:00
Wayne Stambaugh
4131089260 Fix Coverity issue #544154.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=543084
2025-03-17 12:21:02 -04:00
Tomasz Wlostowski
b1bf5127fa connectivity: treat empty FPIDs as matching in TOPO_MATCH 2025-03-09 23:36:54 +01:00
Tomasz Wlostowski
8192ba73d9 connectivity: TOPO_MATCH now orders reference components by the lowest matching candidate count.
This heuristic seems to make the algorithm reject non-isomorphic mappings much earlier on and converges faster on a solution for typical circuits.
2025-03-09 23:36:53 +01:00
Tomasz Wlostowski
91ee987cfe connectivity: TOPO_MATCH now prioritizes component candidates by the ratio of matching pad nets.
This improves cloning of circuits with numerous of matching component mappings (e.g. LED matrices) by
taking preference for mappings with same order of net connections.
2025-03-09 23:36:27 +01:00
Jon Evans
e44eed6e6b Remove unused CN_ITEM m_visited
Visited flag should not be stored in the item itself
since these items are used in parallelized code and
the visited state should remain local to the thread
2025-03-01 10:43:04 -05:00
Jon Evans
51f56ab31c Fix inadvertent logic bug in SearchClusters
The safety changes in 3d526edc introduced a subtle
bug where aExcludeZones was not actually excluding
zones anymore because its behavior depended on the
item visited flag being set to true by a previous
call to the function.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20090
2025-03-01 10:39:35 -05:00
Jeff Young
20f40c1030 Replace GetConnectedItems() type list with an EXCLUDE_ZONES flag.
The type list kept atrophying when various new
items were added (arcs, shapes).

And god knows what the purpose of putting PCB_FOOTPRINT_T
in some of them was.  As far as I can tell a CN_ITEMs
parent can never be a footprint.

(Also moves IGNORE_NETS to a flag so that we don't
end up with two booleans and the potential to have
them out-of-order.)
2025-02-26 11:02:10 +00:00
Jeff Young
01a19bf3d0 Filled shapes can still have a border width. 2025-02-24 11:08:29 +00:00
Jeff Young
1ff0dfb052 No connections AND no-net is not an error
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19737
2025-02-19 23:43:53 +00:00
JamesJCode
d1ba3c6402 Fix compiler warning 2025-02-09 17:27:36 +00:00
Jon Evans
3d526edc8a More thread safety for TRACKS_CLEANER
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19884
2025-02-09 09:18:18 -05:00
Jon Evans
f047b66cb8 Guard against multi-threaded access to connectivity rebuild
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19884
2025-02-08 20:27:49 -05:00
Seth Hillbrand
452e69de85 Move thread pool into true singleton
Thread pool needs to be stored in a single location for all of KiCad
otherwise each kiface will spin up its own pool of persistent threads
2025-01-09 09:03:08 -08:00
Seth Hillbrand
074e6df3bc Revert "Move thread pool to singleton class"
This reverts commit 361f61a02380881efb59b1cebfdc3e73322b3d3c.
2025-01-03 21:22:44 -08:00
Seth Hillbrand
361f61a023 Move thread pool to singleton class
Having thread pool as its own singleton in the library meant that each
kiface had its own threadpool, leading to many multiples of the threads
being started.  Placing a singleton class in PGM_BASE ensures that all
kifaces use the same thread pool.

The singleton class can be extended to provide single instance
guarantee for any element across kifaces
2025-01-03 13:51:11 -08:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
JamesJCode
feeb4f3638 Remove whitespace 2024-11-03 18:02:26 +00:00
Alex Shvartzkop
20008b97f3 Fix vector out-of-bounds access in router. 2024-11-03 19:54:22 +03:00
Alex Shvartzkop
9c6a352fa3 Initialize some variables in router. 2024-11-03 19:53:42 +03:00
jean-pierre charras
dd9806a320 CONNECTIVITY_DATA::IsConnectedOnLayer() fix incorrect behavior for B_Cu layer test.
It was due to the fact B_Cu layer has different values if one comparison:
CN_ITEM StartLayer() and EndLayer() use INT_MAX to encode B_Cu layer id.
2024-10-18 13:32:48 +02:00
Jon Evans
2a605e4a4e Infrastructure and file format for via stacks 2024-10-06 18:45:25 -04:00
Jon Evans
56e0811516 Phase 2 of padstack support
CHANGED: PCB file format now supports saving/loading complex padstacks

CHANGED: PTH pads are now rendered per copper layer in the copper color;
         the PTH pad color is no longer used.

ADDED: support for importing complex pad stacks from Altium PCBs

Enforce padstack-aware access to pad properties across KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8182
2024-10-01 19:55:03 -04:00
Seth Hillbrand
5e0abadb23 Reorganize layer numbering
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing

Non-copper layers are odd and incrementing.

This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )

Similarly, gt/lt tests should not refer to the integer value of the
layer.  We have functions such as IsCopperLayer to test whether a layer
is copper or not.

When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified.  There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS

Similarly, PNS layers remain unchanged and sequential.  A set of
interface functions is provided to map PNS layers to Board layers and
back.  This allows the PNS_LAYER_RANGE to function as expected
2024-09-06 23:07:58 +00:00
Seth Hillbrand
54a34b2e7d Remove unused cruft 2024-08-17 07:56:30 -07:00
Alex Shvartzkop
7e281eebdf Fix build errors and warnings related to multichannel tool. 2024-08-14 04:44:08 +03:00
Tomasz Wlostowski
1a503a1d91 MULTICHANNEL_TOOL: post-rebase fixes 2024-08-14 00:09:32 +02:00
Tomasz Wlostowski
e8711fb06d pcbnew: fix backtracking & net cluster integrity check in the topological matching algorighm 2024-08-13 22:50:26 +02:00
Tomasz Wlostowski
0057e8b1d3 pcbnew: refactor topology matching algorithm and move it to the connectivity subsystem 2024-08-13 22:50:26 +02:00
Tomasz Wlostowski
46b54da139 pcbnew: BuildConnectivity() must remove any dangling RN_NET pointers when rebuilding connectivity data from scratch to avoid use-after-free crashes 2024-08-13 22:50:25 +02:00
JamesJCode
03e388be80 Hold weak reference to NET_SETTINGS in CONNECTIVITY_DATA 2024-08-04 09:03:03 +01:00
James J
7ce00e511b Multi-netclass support 2024-07-26 20:49:29 +00:00
Jeff Young
c549a214c9 Performance: don't alloc std::vector in critical areas.
For some history, see also aa2ad3b44c3e533cf00a5077db17fb0ee7e302eb
2024-06-21 19:07:46 +01:00
Jeff Young
694a7db457 Performance improvements.
Don't construct a wxString or a LSEQ when you don't
have to.  They're both more expensive than you might
think.
2024-06-12 11:06:10 +01:00
Seth Hillbrand
a9ae86eefd Cleanup geometry functions
Added Distance(VECTOR2) function that returns a double.  Removed
superfluous EuclideanNorm, GetLineLength, integer constructor for
EDA_ANGLE (this promotes to double in the CTOR), DistanceLinePoint and
HitTestPoints

Also extended the size for arc calculations that get distances to center
points to avoid overflow
2024-05-31 12:26:37 -07:00