7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 09:49:18 +00:00
Commit Graph

277 Commits

Author SHA1 Message Date
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 .
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 361f61a023.
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 aa2ad3b44c
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
Wayne Stambaugh
795a9eea60 Coding policy fixes.
This is primarily to change all instances of wxLogDebug with wxLogTrace
so developers do not have to sift through debugging output that is always
dumped.  The only exception is for code blocks built in debug builds and
called on demand for dumping object states.
2024-05-23 07:59:45 -04:00
JamesJCode
f88f6a053b Cleanup: Remove unused variable 2024-05-22 22:08:07 +01:00
Seth Hillbrand
6e591f5f91 Don't count removed zone layers
This does 3 things:
1) Removes unused zone layers on load
2) Does not save unused zone layers
3) Removes unused zone layers from connectivity calculation

(1) Prevents existing boards from using unused zone layers for any
connectivity or rendering.  (2) Updates the contents of boards with
removed zone layers to prevent them from propagating.  (3) updates the
connectivity while running pcbnew and removing a zone layer

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17288
2024-03-11 23:38:10 +00:00
Jeff Young
7f8e397dfb Behave (or assert) when source or target are null or dirty. 2023-11-01 17:11:42 +00:00
Jeff Young
fb59f83683 Clean up references in RN_NETs when garbage collecting CN_ITEMs. 2023-11-01 13:53:30 +00:00
Jeff Young
d93bb464bf When garbage collecting locally we also need to clear global references. 2023-11-01 12:47:54 +00:00
Jeff Young
62d959ed0e Don't assume an error location for PAD::GetEffectivePolygon().
While ERROR_INSIDE was good for plotting, 3D generation, etc., it's
not good for generating router hulls.

Also reverts part of the change to always use polygons for PNS::SOLIDs.  A single shape in a SHAPE_COMPOUND will be faster (and
more accurate).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14898
2023-10-13 13:59:26 +01:00
Marek Roszko
7505fd0f37 Profile can live in core 2023-09-07 07:47:01 -04:00
Marek Roszko
4d77fd48ef Shove thread_pool to core 2023-09-06 17:50:12 -04:00
Mike Williams
9079df85fd PCB: check ratsnest for nullptr (segfaults) 2023-08-24 10:51:34 -04:00
Jeff Young
55a7b9e6bf More consistent naming.
(Also better differentiates the PCBEXPR_ classes from PCB_
objects.)
2023-08-21 15:26:33 +01:00
Jon Evans
a77e630901 ADDED: Connectivity for graphic shapes on copper layers
Graphic shapes (excluding text) can now have nets when on
copper layers. Shapes behave like tracks in that they will
pick up nets from connected pads, and follow track opacity
settings.
2023-08-10 21:47:43 -04:00