87 Commits

Author SHA1 Message Date
Alex Shvartzkop
d2c33e186e Update field order in PCB_TUNING_PATTERN. 2024-10-30 09:12:24 +03:00
Alex Shvartzkop
bf54c86d7d Set tuning pattern initial side from cursor position while placing.
It's faster than flipping the amplitude handle after placing.
2024-10-30 09:09:51 +03:00
Denis Latyshev
260014710a Pcbnew: Add differential and single line length/skew mirroring
ADDED: Added functionality for mirroring differential and single line length, as well as skew adjustment elements.

Fixes https://gitlab.com/kicad/code/kicad/issues/18469
2024-10-16 19:21:03 +00:00
jean-pierre charras
045c1f347f PCB_TUNING_PATTERN: fix another issue due to mix PCB_LAYER_ID layer and PNS layer id
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18867
2024-10-07 19:02:43 +02:00
jean-pierre charras
807c00c70c Avoid duplicate code. 2024-10-07 18:24:12 +02:00
jean-pierre charras
4b21e54a61 PCB_TUNING_PATTERN: fix issue due to mix PCB_LAYER_ID layer and PNS layer id
The layer id sent to PNS router was incorrect for any layer but F_Cu.
Tehe result was Tuning tools not working (but for F_Cu)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18865
2024-10-07 16:44:59 +02:00
John Beard
215533f31a Unify flip direction handling
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
2024-09-27 17:13:13 +01: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
Ian McInerney
2190c37cd6 Use appropriate tunning pattern icon in menus for tunning pattern generators 2024-08-19 16:58:05 +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
Jeff Young
b8819b4636 Another reduction in asserts. 2024-07-19 22:11:56 +01:00
JamesJCode
230c297691 Fix tuning pattern moves and undo / redo 2024-07-09 12:09:31 +01:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00
Jeff Young
9fb07d886e PCB_GENERATOR_Ts are PCB_GROUP_Ts too.
Also, an item must already be in a commit to add it to a group.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17595
2024-06-05 10:51:24 +01:00
Jeff Young
86d7cf5d96 Formatting. 2024-06-02 10:52:18 +01:00
Sven Pauli
c7ad5efbed Implemented flip for tuning patterns. 2024-06-02 09:49:41 +00:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
Jeff Young
978ef352d0 Support legacy Length Tuning Settings workflow.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17748
2024-04-24 10:51:25 +01:00
Marek Roszko
ab759d21f2 Fix more build warnings 2024-03-23 08:53:11 -04:00
jean-pierre charras
4f4ca9f383 Do not run DRAWING_TOOL::PlaceTuningPattern() inside the footprint editor
The footprint editor cannot run the router.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17522
2024-03-21 15:19:48 +01:00
Alex Shvartzkop
d04d74c511 Highlight nets and show length tuning status when adding tuning patterns.
Also fixes length preview when hovering over joints.
Also prevents asserts when hovering over arcs.
Also prevents adding a tuning pattern on other tuning pattern.

(cherry picked from commit 711c6141a85c9e6a42c8025925fe27ae7660044c)
2024-02-23 20:29:18 +03:00
Alex Shvartzkop
dd6213051d Pick DP coupled segment closest to start item and baseline. 2024-02-20 22:06:00 +03:00
Alex Shvartzkop
2e97d5d7cc Add missing check in tuning pattern outline. 2024-02-20 20:32:07 +03:00
Alex Shvartzkop
cbfd757d28 Reduce amplitude snap value of tuning patterns. 2024-02-20 03:20:08 +00:00
Alex Shvartzkop
10e6ca8740 Show tuning pattern baselines when not editing them. 2024-02-20 03:20:08 +00:00
Alex Shvartzkop
5e5effaf3a Ensure minimum outline size in tuning patterns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16847
2024-02-20 03:20:08 +00:00
Alex Shvartzkop
29188bdc53 Fix some edge-cases in DP tuning pattern outline. 2024-02-20 03:20:08 +00:00
Alex Shvartzkop
4227b1add9 Improve tuning pattern robustness. 2024-02-20 03:20:08 +00:00
Alex Shvartzkop
d4e89543de Length-tuning fixes/improvements:
- Ensure correct amplitude values in tuning patterns.
- Support lower amplitudes in DP length tuning
- Ensure correct minimal inner radius in DP length tuning
2024-02-10 00:44:05 +03:00
Alex Shvartzkop
453e185613 Increase unconstrained tuning length to 1km. 2024-02-09 19:25:46 +03:00
Jeff Young
53d048921a Fix merge conflicts. 2024-02-09 00:04:43 +00:00
Jon Evans
7929d7cda2 Fix build 2024-02-08 17:33:34 -05:00
Jeff Young
ecbe1df7c1 Update target length/skew to std::optional.
Also fixes a bug in the router where the target length would
get trashed if set to maxLongLongInt.  (We'd add the default
tolerance to it sending it negative.)
2024-02-08 18:14:31 +00:00
Alex Shvartzkop
876449b83d Set DP skew meanders max length to INT32_MAX instead of 100 mm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16860
2024-02-08 19:34:17 +03:00
Alex Shvartzkop
f4cf23e5cf Length tuning: fix status popup display when unconstrained. 2024-02-08 18:55:42 +03:00
Alex Shvartzkop
f1caa262a6 Separate actions for single track and differential pair length tuning. 2024-02-08 14:58:28 +00:00
Alex Shvartzkop
1122d80388 Better support for arcs in tuning patterns. 2024-01-31 23:38:05 +03:00
Alex Shvartzkop
7d1888c756 Add parts of arcs to tuning patterns correctly. 2024-01-31 21:45:01 +03:00
Jeff Young
32d589a121 Don't rely on baselines for fetching DRC_RULE items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16816
2024-01-30 13:19:04 +00:00
Jeff Young
5b5c6f0474 Init tuning pattern settings from BOARD_DESIGN_SETTINGS.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16819
2024-01-30 13:19:04 +00:00
Marek Roszko
5c94e0287b Clean up tuning pattern if undo triggered during drag
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16718
2024-01-28 16:10:59 -05:00
Jeff Young
89850824d5 Naming & comments. 2024-01-24 13:35:37 +00:00
Jeff Young
ace4ef7b16 Implement stingy selection mode for tuning patterns. 2024-01-17 00:34:22 +00:00
Jeff Young
be6a2d018d Implement stingy selection mode for tuning patterns. 2024-01-17 00:34:22 +00:00
Jeff Young
3a781f5dbe Let router draw tuning pattern baselines.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15996
2024-01-07 13:54:40 +00: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
Jeff Young
d155870275 Sometimes use grid (instead of clearance) for slop radius.
This is particularly important both when very large grids
are in use, and when the router hasn't been initialized
with a net yet (ie: in hover mode) and the board clearance
is set to 0.

https://forum.kicad.info/t/new-track-start-position-problem-on-kicad-7-0-10-rc1/47006
2023-12-21 12:58:58 +00:00
Jeff Young
fc85112a72 Create dummyPattern at centre of pickerItem, not end.
This keeps TOPOLOGY::AssembleDiffPair() from picking an
arc the segment might be connect to.  Since it can't handle
arcs at all, that's bad.
2023-12-20 15:27:29 +00:00
Jon Evans
1c895fe18c Improve rendering of tuning status popup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16304

Add dedicated UI rendering layers

Switch to screen-space rendering to avoid blurriness

Fix a bug in OpenGL GAL that causes layer
ordering to be broken when using Scale

Fix some issues with VIEW_GROUP layer ordering
2023-12-19 22:38:21 -05:00
Jeff Young
b29a56530c Remove undo-of-ungroup hack.
The hack assumed that the parent group would be the first
deleted item of type group in the undo list.  While this
will be true when undoing a user ungroup command, it will
not be when undoing an ungroup side-effect, such as when a
member of a group is deleted during UpdateFromPCB.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16384
2023-12-17 15:35:35 +00:00