Commit Graph

630 Commits

Author SHA1 Message Date
Seth Hillbrand d6706c257c PNS: clear via when fixing route
When fixing the route, we need to clear the via to avoid re-placing it
on each future click.

Fixes #3966 | https://gitlab.com/kicad/code/kicad/issues/3966
2020-03-02 16:22:34 -08:00
Seth Hillbrand 386147628e PNS: Initialize placement test 2020-03-02 16:22:34 -08:00
Seth Hillbrand 3c19704349 PNS: Don't add null items to drag
Not all footprint pad items are connected to elements in the PNS, so if
we don't find the parent element, we avoid later crashes/assertions by
skipping their addition

Fixes #3972 | https://gitlab.com/kicad/code/kicad/issues/3972
2020-03-02 11:28:14 -08:00
Seth Hillbrand 18db471967 PNS: Line placer returns false when nothing committed
The true/false return should be triggered on whether any elements have
been commited to the line

Fixes #3969 | https://gitlab.com/kicad/code/kicad/issues/3969
2020-03-02 11:11:13 -08:00
Tomasz Wlostowski a28f58d14d router: fix regression in PNS_KICAD_IFACE treating newly created items as invisible (side effect = non-45 degree angles due to incorrect snapping) 2020-02-29 20:41:31 +01:00
Tomasz Wlostowski 6850067182 router: commit traces made in single stroke/click (fixes regression introduced with Backspace support) 2020-02-29 20:40:19 +01:00
Tomasz Wlostowski e5fff302a3 router: fix arc drawing in ROUTER_PREVIEW_ITEM 2020-02-28 23:52:33 +01:00
Tomasz Wlostowski e0bad936bf router: enable inline dragging of components 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 44905e1b0a router: initial support for dragging components with traces attached 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski b2b1edbcd1 router: KICAD_IFACE can now commit changes to module positions 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski b6e059f018 router: use a common base class for all dragging algorithms 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 1d0ee66187 router: kill debug printf() 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 77478014d8 router: kill some warnings in OPTIMIZER 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 796aec6e6e router: SOLID::SetPos() should update the shape position too 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 5a16fda11a router: allow modification of SOLIDs in PNS::NODE 2020-02-28 23:17:15 +01:00
Seth Hillbrand 7cb3ed456e PNS: No free-angle drag at the moment.
Fixes #3954 | https://gitlab.com/kicad/code/kicad/issues/3954
2020-02-28 12:43:59 -08:00
Jon Evans 9cc5b4b3f9 Fix management of nested settings for PNS 2020-02-27 22:53:00 -05:00
Tomasz Wlostowski f77d2f8cb8 router: option to enable optimization of the track being dragged 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 4525a17076 router: backspace key to undo last fixed segment(s) 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski b5c11f21e5 router: rounding mode context menu entry 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski d1a5d8c78b router: don't forget the tail when toggling via placement 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 8ddeb966ca pns: drag wip on walkaround via mode 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski cf4945afaa router: optimizer should now handle 'keep vertex' constraint correctly... 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 53c3f95ac4 router: initial attempt at walkaround mode for dragger 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski c0314dbb29 router: dragger can now optimize also the segment being dragged 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski a6d3ae3c5b router: NODE now can also query joints 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 6b767d50c3 router: initial support for user-provided constraints for the optimizer 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski c2d95a00c1 router: improved handling of corner cases in LINE::Walkaround 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 37a754c4dd router: initial attempt at improved 'aim at mouse cursor' strategy in walkaround mode, wip... 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 43b71cd9e3 router: Clear() method for PNS::LINE 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski dbe90e163e router: use one global logger object 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 4281bd8207 router: keep board in base Kicad Iface class 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 9e605d6958 router: DEBUG_DECORATOR now allows to name each primitive 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 065d634b30 router: put non-graphical part of ROUTER_IFACE into a parent class (for unit tests) 2020-02-27 22:02:56 +01:00
Jon Evans 9f8ff236d6 Fix load and save of PNS settings 2020-02-25 19:36:36 -05:00
jean-pierre charras f206db2041 Pcbnew: fix crash on exit after using the track length tool.
This is due to the fact the PNS_TUNE_STATUS_POPUP was not hidden
before calling its destructor.
It is now fixed by setting its virtual destructor calling Hide().

TODO: see if it could be used for any class derived from STATUS_POPUP.
(We already have this issue in other places)
2020-02-22 10:34:11 +01:00
Seth Hillbrand 8c19b4b6ae pcbnew: Adding arcs to PNS
This is allows ARCs in tracks to be synchronized with
the PNS router.  Note this does not yet include the UI components
to route curved traces
2020-02-21 16:11:41 -08:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Ian McInerney 8b7d4c2a55 Put tool graphics back on the stack
Now that the tool framework gracefully shutdowns the tools, graphics
can be created on the stack inside a tool function.

This reverts commit f6881ce3de.
2020-02-05 22:23:44 +00:00
Ian McInerney 34e5b76c5f Add virtual constructors to some classes that should have them
This is more for safety from undefined deletion behavior than
anything else (it also silences the Clang -Wnon-virtual-dtor warning).
2020-02-05 22:19:14 +00:00
Seth Hillbrand c4fff95078 PNS: Detect collisions including newline width
The new line collision search uses BBox() to check for colliding
objects.  BBox in the SHAPE_LINE_CHAIN did not include width as the
chains were assumed to be zero-width.  This is not the case for
PNS::LINE elements.

We mostly don't notice this because DRC checks for SEGMENT collisions
but it becomes obvious/annoying when we cannot place a track for unknown
reasons and the snap-back doesn't take line width into account.

Fixes #3776 | https://gitlab.com/kicad/code/kicad/issues/3776
2020-01-17 11:23:08 -08:00
Seth Hillbrand f7cb970a02 PNS: Modify MarkObstacles logic to select shorter
When routing where we hit multiple obstacles, we choose the shortest
path to allow overlapping hits to choose the shorter path, thus giving a
better chance of returning true for the DRC-compliant path.

Fixes #3773 | https://gitlab.com/kicad/code/kicad/issues/3773
2020-01-16 19:57:38 -08:00
Ian McInerney 3ab9db6ff1 Update cast in PNS since we are guaranteed to have text
We are guaranteed that the BOARD_ITEM will be a TEXTE_MODULE
since we have tested its type already, so just use a static_cast
to remove the overhead.
2020-01-13 19:42:49 +00:00
Seth Hillbrand 52bfdb9703 PNS: Assume the current line is a base before optimizing
We use the cost of the current line before trying to improve the pad
breakout cost when optimizing the smart pads

Fixes #3759 | https://gitlab.com/kicad/code/kicad/issues/3759
2020-01-12 11:08:46 -08:00
Ian McInerney 00e58cd974 Fix unintialized values (from coverity scan) 2020-01-12 13:00:42 +00:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Jeff Young 88eab8134e Fix a couple of uninitialized variables (from Coverity scan). 2020-01-11 00:11:31 +00:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Ian McInerney 5d46e721e5 pcbnew: Cleanup includes of pcbnew_id.h
* Remove unused IDs from the enum
* Remove the include statements from files that no longer need it
2020-01-03 15:39:05 +00:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00