492 Commits

Author SHA1 Message Date
jean-pierre charras
6c26497213 PNS router: fix a crash when switching to next/previous copper layer.
When (key + and - ) switching to next/previous layer before any usage of
the PNS router, Pcbnew crashed, likely due to incorrect value (perhaps
missing init) of the PNS_KICAD_IFACE (m_iface) m_board member.
So ensure this member is up to date before using it in ROUTER TOOL events.
2024-10-04 10:12:10 +02:00
jean-pierre charras
dba16fc168 PNS router: switch to next or previous copper layer: fix order.
the layer id order is not the UI order. So ensure UI order is used when
switching (keys + and -) to next and previous copper layer.
2024-10-04 09:54:06 +02:00
jean-pierre charras
6cfff7156a PNS router: rename IsCopperLayer( int aLayer ) to avoid a collision.
IsCopperLayer( int aLayer ) can be ::IsCopperLayer( int aLayer ) or
PNS_KICAD_IFACE_BASE::IsCopperLayer( int aLayer ) in pns_kicad_iface.cpp
This is error prone.
So, to avoid mistakes,  PNS_KICAD_IFACE_BASE uses now 2 functions:
- IsPNSCopperLayer( int aPNSLayer )
- IsKicadCopperLayer( PCB_LAYER_ID aPcbnewLayer )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18800
2024-09-29 09:35:02 +02:00
John Beard
7ba772bc4c Pad.h doesn't need geometry_utils.h
Saves 200+ files from a rebuild if you touch it.
2024-09-28 13:24:26 +01:00
Seth Hillbrand
1a6b309ad6 Some extra cleanup for layer interface
PNS<->Board layer interface needs clear boundaries about where we are
using board layers (with the alternating numbers) and PNS layers which
are sequential and all copper
2024-09-13 15:50:12 -07:00
Seth Hillbrand
caa63b11da Fix missing conversion from board layer to PNS layer 2024-09-12 09:13:16 -07:00
Mike Williams
04ff715945 pcb: fix crash on routing many traces
Further improvements could be made to the behavior of the autoroute
functionality in this case, but not crashing is a good start.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18328
2024-09-12 10:20:48 -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
Jeff Young
cbfd6ec9ea CHANGED: remove single layer restriction for uvias.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18501
2024-08-15 16:42:57 -06:00
JamesJCode
3f2b6f7ae0 PNS: Update track widths during routing
This allows routing through, for example, neck downs defined
based on courtyard DRC rules
2024-08-15 21:59:22 +01:00
JamesJCode
c39551b032 PNS: Check for nearest segment anchor for initial track constraints 2024-08-15 21:45:34 +01:00
JamesJCode
013fa4824b Report track clearance constraint from DRC rule if >= board minimum 2024-08-14 22:10:39 +01:00
JamesJCode
72a0c41e3d Correctly handle track clearance constraints in router 2024-08-14 21:21:19 +01:00
JamesJCode
41ff744f1e Update message panel when placing a via with interactive router 2024-08-14 17:37:11 +01:00
Tomasz Wlostowski
9963b9dd9f TOOL_INTERACTIVE: only create the context menu when we are running in GUI mode
TOOL_MENU::m_menu was unconditionally created by the TOOL_INTERACTIVE constructor, resulting in crashes if
we wanted to run the TOOLs in headless  mode, e.g. in unit tests. This commits makes
the creation of the menu object dependent on Pgm::IsGui().
2024-08-13 22:50:26 +02:00
James J
7ce00e511b Multi-netclass support 2024-07-26 20:49:29 +00:00
Jeff Young
fcb104694b Avoid cover types. 2024-07-22 13:21:29 +01: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
Seth Hillbrand
64e3e17143 Reserve shift for grid modification
(cherry picked from commit f75e6dae8484c041f6a3b37a19a95bcb7cf26929)
2024-05-21 09:34:45 -07:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
Alex Shvartzkop
865e3a9f3c Improvements when working closer to 32-bit integer limits.
- Changes BOX2 size to extended coordinates.
- Adds BOX2ISafe to construct a BOX2I that will fit in int32.
- Adds more checks.
- Safer computations.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17670
2024-04-23 16:34:07 +00:00
Seth Hillbrand
b1dcd7ecf8 Remove Shift as a force-finish modifier
This was originally added to facilitate
https://bugs.launchpad.net/kicad/+bug/1777688 but the concern there was
that the layer kept changing when stopping on a via.  We currently have
double-click as the force-finish option and the layer reverts to the
original layer on which you were routing.  This should handle the
operation concern while still preserving shift as the modifier for grid
options

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15828
2024-04-19 08:53:27 -07:00
Roberto Fernandez Bautista
3a6d74a3b3 Allow user to select location to save router event log
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16904

Note: no new strings added
"Unable to write '%s'." is from pagelayout_editor/files.cpp(182)
2024-02-11 13:43:55 +01:00
Jeff Young
b3f94ad46a Cleanup before exit.
Possibly KICAD-5TE.
2024-01-25 15:30:25 +00:00
Alex
ed00cb3304 Support arcs in Break Track.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16712
2024-01-24 05:47:50 +03:00
Jeff Young
a523c58530 Add a m_forceMarkObstaclesMode warning when violating DRC.
Also adds a modifier combination to commit anyway.
2024-01-02 17:02:50 +00:00
Ian McInerney
9db1dd5ec5 Refresh message panel when router mode changes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16497
2024-01-01 19:25:54 +00:00
Andrea Greco
55429aea6b pcbnew: Show current router mode in status bar 2023-12-31 02:54:59 +00:00
Ian McInerney
e6632bb983 Rename PCB IO classes/files 2023-12-24 01:22:21 +00:00
Ian McInerney
d8b47d18d3 Initial rename of file plugin infrastructure components to IO 2023-12-24 01:22:21 +00:00
Mike Williams
2795fa9ca3 EE/PCB_Actions: convert to generic Finish
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16079
2023-12-06 10:33:17 -05:00
Jeff Young
a1b514bcba Update message panel after switching layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16247
2023-12-03 17:07:08 +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
d93bb464bf When garbage collecting locally we also need to clear global references. 2023-11-01 12:47:54 +00:00
Ian McInerney
171458a27b Introduce action friendly names
Friendly names can be used to display action information that is clearer
in non-hierarchical contexts (e.g. not in menus).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8075
2023-10-27 23:58:29 +01:00
Mike Williams
70917a14e7 Route from end: fix crash and snapping bug
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13992
2023-10-18 12:32:32 -04:00
Jeff Young
d51e058e24 Move diff-pair netname resolution to BOARD.
Also adds reporting of dp gap constaints and max uncoupled to track
selections, and max uncoupled during routing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13748
2023-10-15 22:46:23 +01:00
Jeff Young
0a111e9fbb Hook up layer-toggle command to router.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15812
2023-10-13 21:33:27 +01:00
Ian McInerney
0876fb0985 Re-implement direct layer switching in the router tool
Also add a new framework to allow grouping actions that are similar into
a single context that can then be used for mass comparisons.
2023-10-05 13:34:25 +01:00
Mike Williams
c2d7b26ebd PCBNew: don't grab the wrong parameter type when placing vias 2023-10-04 12:17:15 -04:00
Jeff Young
9214e47367 Only allow switching to enabled layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15779
2023-10-01 15:27:55 +01:00
Jon Evans
d781d70a09 PNS fix dragging a single footprint
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15693
2023-09-20 11:53:43 -04:00
Jon Evans
5a9c028e85 PNS: Allow dragging more than one footprint
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11312
2023-09-18 22:37:11 -04:00
Marek Roszko
22b733209d Fail GAL on its header leaking audit
Maybe we should rethink directly accessing GAL so much, but at least 600 files didn't need GAL leaked into them due to view_overlay.h
2023-09-18 19:52:27 -04:00
Marek Roszko
67b031adab Painter base class should just live in gal instead of being in denial 2023-09-06 20:23:19 -04:00
Jeff Young
891583f616 Fix nullptr error. 2023-09-02 12:08:37 +01:00
Mike Williams
9079df85fd PCB: check ratsnest for nullptr (segfaults) 2023-08-24 10:51:34 -04:00
Jeff Young
76cd637895 Make the net identifier opaque to PNS router.
This also improves performance as we don't have to look up the
netcodes in a map.
2023-08-22 15:17:02 +00:00
Jeff Young
fa060c7c58 Make sure dummy tracks have ROUTER_TRANSIENT flags.
Also give them more info that might be queried by custom DRC rules.
This currently just includes positioning info (it already included
nets and principal layer).  We *could* also try to figure out all
layers for dummy vias, and/or widths for dummy tracks / arcs....
2023-08-19 20:51:04 +00:00
Alex Shvartzkop
a0d96cea9f Rename Save -> SaveBoard, Load -> LoadBoard in PLUGIN. 2023-08-15 05:26:12 +03:00