518 Commits

Author SHA1 Message Date
Jeff Young
3a8ea50783 More tool loop safety. 2025-07-03 21:49:11 -06:00
Jeff Young
a7319bfcd0 Tool loop safety. 2025-07-03 20:01:35 -06:00
Jeff Young
6f7023116d Static_cast safety. 2025-07-03 19:41:52 -06:00
Jeff Young
74bf678d99 Warp back from context menu before running command.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19560
2025-06-16 10:58:03 +01:00
Jeff Young
116bd924c2 Static cast safety.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20958
2025-06-08 23:21:02 +01:00
Jeff Young
30748006f7 Standardize on American English spelling of "canceled". 2025-06-01 19:38:24 +01:00
Jeff Young
327cca9de5 Coverity fixes. 2025-05-25 20:01:18 +01:00
Mike Williams
c09e9da471 router: make layer next/previous actions work consistently
UI was getting out of sync with router and they could be on different
layers. There was also some confusion about whether previous layer was
the opposite of next layer (-1/+1 to current layer), or effectively a
back button for the current layer.
2025-05-20 11:25:07 -04:00
Mike Williams
6ca8078ca4 router: add missing commit change 2025-05-19 15:23:42 -04:00
Mike Williams
2f94b241ab router: intelligently guess next layer when placing vias with ratnest
Chooses the layer of the closest ratsnest item
2025-05-19 14:55:30 -04:00
Seth Hillbrand
c06ddf966d Don't overwrite explicit sizes unless needed
We already did this for single-ended, this extends to dp routes

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20889
2025-05-09 13:31:39 -07:00
Mike Williams
40058ebe80 actions: move all basic selection operations to common actions 2025-04-02 12:02:01 -04:00
Roberto Fernandez Bautista
c5120b9090 Add fake-autoroute to context menus (router and edit) 2025-01-31 15:49:27 +01:00
jean-pierre charras
32673a0ead Pcbnew, router: fix crash when trying to create a blind via without a track
Using PnS router, when trying to create a blind/buried or micro via with layer
selection with no track in progress, the router crashed because the starting
layer was not defined.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19750
2025-01-27 18:29:54 +01:00
JamesJCode
c80a71f64a Make netclass name methods clearer, and improve doc strings
There are two netclass name methods, which previously were not
obvious in their uses. These have been renamed to now have:

GetName() : Used for internal or tooling (e.g. netlist export) usage
GetHumanReadableName() : Used for display to users (e.g. in infobars)

Fixing the previous unclear naming will result in fewer bugs
when users start using the multiple netclass functionality, as
the incorrect usage had started creeping in to new code. Also this
will help authors of new code select the correct name method.
2025-01-14 20:44:09 +00:00
Tomasz Wlostowski
4ee52a21d0 router: take overlapping segments/arcs into account when syncing board state to router state
Fixes https://gitlab.com/kicad/code/kicad/issues/19581
2025-01-11 01:36:49 +01: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
Jon Evans
801311cf9c PNS: Fix several issues dragging footprints with shapes
Edge cuts, margin, and copper shapes need to be included
in the dragged item set

Shapes on the edge cut layer need to be painted with
their original width, but this has to be done by setting
the width on the router shape, not by re-cloning the
parent shape, because the router may now be moving that
shape.

Footprint drag position calculation needs to act only
on pad SOLIDs, not on any SOLID

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19280
2024-12-17 22:56:15 -05:00
Jeff Young
8519267c24 Cleanup. 2024-12-16 21:34:24 +00:00
JamesJCode
fc23cb1ac8 Remove added-by-not-actually-helpful IDE random include 2024-12-16 21:31:06 +00:00
JamesJCode
fc932233b1 Warp cursor to origin on single footprint drags
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19100
2024-12-16 19:18:11 +00:00
jean-pierre charras
1942f2f227 PNS: Ensure Pop-up "Track violates DRC" is erased at end of drag command.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19234
2024-12-03 10:56:27 +01:00
Jeff Young
bb533f3f4a Fix multiple-footprint drag.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19101
2024-12-02 12:43:57 +00:00
Jon Evans
d0b2334ceb PNS: Support via stacks 2024-11-04 21:30:38 -05:00
Tomasz Wlostowski
d97065609d router: remove some loose printfs() 2024-11-02 19:59:09 +01:00
Tomasz Wlostowski
9f3825b003 router: integrate multidrag in ROUTER_TOOL 2024-11-02 19:59:09 +01:00
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