Two main changes: netclass values need to go through the DRC engine
so they can interact with other rules. They're also now dependent
on the layer being routed as well as the start object.
Also make the controls adjust to each other better. For instance,
copy-track-width needs to turn off when you select a particular
track width, and a particular track width needs to zero out when
you choose copy-track-width.
Fixes https://gitlab.com/kicad/code/kicad/issues/5951
Also checks the nets when checking for a pad being flashed on a particular
layer (so we don't end up thinking the currently-routing-collided track
is a connection).
When invoking "Break Track" from the RMB context menu, Pcbnew
gets and uses the current position of the mouse to figure out where to
break the track. The problem is that the mouse has to be moved to select
the "Break Track" menu item, and the mouse position used is wrong. This
can result in the break in the wrong location or not happening at all.
CHANGED: This commit determines if the "Break Track" was invoked from a
context menu or a hotkey. If a hotkey, it uses the current mosue position.
If a context menu, it uses the original postion of the mouse when the menu
was opened.
The previous way of displaying a context menu was being
usurped by the selection tool because it was displaying its
menu before DispatchContextMenu was called, and all other tools
explictly use the TOOL_MENU system.
Fixes https://gitlab.com/kicad/code/kicad/issues/5762
These objects can now be used in advanced DRC rules and
not just for keeping things out. Also remove the restriction
that at least one of the "basic" keepout rules must be set,
so that these areas can be used for more advanced rules.
You can now enable and disable snap to grid when drawing/editing across
all apps. You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
Edge.Cuts have no parent but cross all layers, so we need to handle the
"all layers" case. Also renames "IsPadOnLayer" to "IsOnLayer".
Fixes https://gitlab.com/kicad/code/kicad/issues/5351
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.
There is still some debugging output in test code that really needs to
be moved into a unit test.
Add debugging output section to the coding policy regarding debugging
output.
This option removes copper layers from pads and vias where they are not
connected to other board elements. This allows the inner layers to be
more closely routed if the via landing pad is not needed.
Fixes https://gitlab.com/kicad/code/kicad/issues/1835
Rather than extra splitting of the RTree that we use for collision
detection on types and direction, we limit this to checks on
layer-by-layer basis. This also allows for layer expansion by using
deque of RTrees rather than fixed index
This fixes the missing layernumbers and keeps the layers in a deque to
prevent re-allocation on expansion.
Replaces ad94b6205
Rather than extra splitting of the RTree that we use for collision
detection on types and direction, we limit this to checks on
layer-by-layer basis. This also allows for layer expansion by using
vector of RTrees rather than fixed index
The first one keeps a log of events (start routing, mouse motion, etc).
The second allows for adding temporary debug drawings and messages which are stored synchronously with the events in LOGGER.
The event stream together with the PCB design (now with UUIDs) can be used to deterministically replay routing bugs as the user sees them.
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.
ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
1) An actual distance of 0 is still a collision, even if the allowed
distance is 0.
2) Be consitent about edges and interiors. Everyone expect the edge
of a RECT to be part of the RECT; same with a CIRCLE. SHAPE_POLY_SET
shouldn't be any different. (And SHAPE_LINE_CHAIN was a split-
personality with the edge considered part of it for Collide() but not
for PointInside()).
There were a lot of plotters, exporters, etc. that were rolling their
own implementations.
This also introduces a lazily-built set of SHAPE objects for doing
collision detection and some forms of rendering (and later DRC).
It's currently only supported in the Footprint Editor. It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
The arc shapes need to connect with their adjacent points. By storing
the relevant points, we allow exact point matching on both ends of the
arc as well as localize point storage.
Note: this is a basic implementation but it could be
improved once we include bus information in the netlist
and pcbnew can natively keep track of buses and nets
instead of just nets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4158
* Consolidate the measure tool into one tool (this gives cvpcb
unit changing and snapping capabilities in its measure tool)
* Transition cvpcb to use actions for the sketch modes
* Replumb how magnetic items settings are stored and used
Springback introduced a new PNS structure to check for valid placement
as well as separating the Fix/Commit routines. This updates the
remaining placers to utilize the new structure.
Fixes https://gitlab.com/kicad/code/kicad/issues/4008
Dragging using highlight caused an assertion as the duplicated lines
were being re-added with their old links still inplace. While this was
probably fine as the link references shouldn't be stale, we clear them
to allow for the possibibility that the dragger will adjust the links in
the future.
The bump direction should only be concerned with physical points to
calculate the heuristic for loop-back otherwise we get too many false
positives.
Fixes https://gitlab.com/kicad/code/kicad/issues/3971
Needs to handle changes to PNS_ROUTER. This does not implement
springback or backspace in DIFF_PAIR_PLACER, only allows committing
lines as before
Fixes https://gitlab.com/kicad/code/kicad/issues/3988
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
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)
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.
Now that the tool framework gracefully shutdowns the tools, graphics
can be created on the stack inside a tool function.
This reverts commit f6881ce3de.
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
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
* 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.
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines. To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
It happens on Windows, and wxWidgets 3.1.3.
It is created by PNS_TUNE_STATUS_POPUP instance used in tool.
I am pretty sure this crash is created by the stack switching
when managing events, due to some changes in wxWidgets code.
the fix creates the instance on the heap, instead of on the stack.
This is not the first time I see this kind of issue.
The IFACE for kicad refers to the board hidden state, not the
temporarily hidden state used by the router. We allow snapping to items
that have been removed by the temporary router state to provide snapping
to original track location.
Fixes#1827 | https://gitlab.com/kicad/code/kicad/issues/1827
(cherry picked from commit 1e64524afb)
This update replaces the existing uses of unique pointer creation with
the C++14 std::make_unique call that provides proper memory release in
event of an exception.
The pointer passing for display options is deprecated. This removes the
excess casting as the EDA_FRAME didn't need the base call with no value.
All requests for display options are now returned const and are updated
with a Set() routine after modification.
In Gerbview, this resolves an issue where the display options were not
stored because it was receiving the NULL from EDA_FRAME.
This adds the pad to die parameter from each pad to the total line
length of the tuned line for comparison with desired.
Fixes: lp:1711541
* https://bugs.launchpad.net/kicad/+bug/1711541
The previous fix for optimizer breakout length calculation was providing
better scores to longer traces rather than longer breakouts as intended.
This limits the length scoring to breakout only.
Flipped footprint pads may report their "primary" layer as not the front
layer in high contrast. We need to check whether the board item for
snaps is visible on the active layers.
Fixes: lp:1847877
* https://bugs.launchpad.net/kicad/+bug/1847877
The router items may not yet have a board item parent. In this case,
the reference to the parent needs to be guarded before dereferencing.
Fixes: lp:1847717
* https://bugs.launchpad.net/kicad/+bug/1847717
Items and layers that are hidden in the view should not be used as snap
points. This happens in multiple locations:
1) Grid Helper for normal tools
2) TOOL_BASE::snapToItem for router
Resolves KiPro Issue #116
Fixes: lp:1833128
* https://bugs.launchpad.net/kicad/+bug/1833128
Calling Init() in an action routine will reset the router
settings to the state they were in when first starting pcbnew.
The Init() function is automatically called when the tool is created.
Fixes: lp:1843810
* https://bugs.launchpad.net/kicad/+bug/1843810
Before, if the tools were activated from the context menu,
they would start drawing where the menu item was selected
instead of where the menu was opened.
The INT_MAX limit for most elements makes sense only for single-segment,
straight line elements. For elements that accumulate lengths, we should
utilize the long long int (64 bits) to allow for greater lengths.
Fixes: lp:1842367
* https://bugs.launchpad.net/kicad/+bug/1842367
This modifies that logic for optimizing pad connections.
1) Custom pads now prefer the connections to their longer side. This is
particularly important to match the behavior in a rectangular pad
2) Costs for straight lines are non-zero. This favors fewer connections
3) Custom pad breakouts are at the polygon boundary rather than offset
by 0.1mm. This also matches the circular and rectangular paradigm.
4) Line Heads contained in the pad itself are not optimized. This
prevents escaping the pad unnecessarily
Fixes: lp:1824182
* https://bugs.launchpad.net/kicad/+bug/1824182
If the layer is not shown, we should not be allowing it's items to be
selected and chosen as the start/end items in the router.
(cherry picked from commit fc1fb7a590)
Drag is used for multiple modes so should be initialized when starting.
The line that we generate however needs to be pristine in drag, so we
clear the links in the duplicate.
Fixes: lp:1839612
* https://bugs.launchpad.net/kicad/+bug/1839612
The problem is that wxEVT_CHAR_HOOK doesn’t do the key translation
properly. wxEVT_CHAR does, but we only get to that if we skip the
event at the end of the tool’s event processing loop, which most tools
don’t do. (Selection tools, point editors, pickers, and a couple of
others do skip, which is probably why this didn’t get reported earlier.)
I played around with a couple of ways to fix wxEVT_CHAR_HOOK. Most of
them don’t work, and the few egregious hacks I tried weren't cross-
platform.
So I’m changing it so that most tools now skip at the end of their
event loops. I left out a couple that I felt were high risk (length
tuning, for instance). But there’s still enough risk that I’m 100%
sure it will break something, I just haven’t a clue what.
Fixes: lp:1836903
* https://bugs.launchpad.net/kicad/+bug/1836903
This sets the clearance outline to a slightly better opacity to allow
viewing of items behind the routed track clearance. Future work should
include making this a configuration option.
Fixes: lp:1826719
* https://bugs.launchpad.net/kicad/+bug/1826719
(cherry picked from commit e0589d2908)
Includes the addition of an onSetCursor() handler which must be called
from both the GAL canvas AND the GAL backend (at least on OSX) to prevent
cursor flickering between (for instance) pencil and arrow.
Also includes new architecture for point editors which allows them to
coordiate cursors with the editing tools (so we can switch to an arrow
when over a point).
We were running into various corner conditions where a tool's event
loop would exit while the tool was still active, or the tool would
get popped while we were still in the event loop. (A lot of these
had to do with the POINT_EDITOR's, but not all of them.)
The new architecture:
1) tools always do a Push()/Pop()
2) everyone is responsible for their own pops; no more stack-clearing
on a cancel
3) CancelInteractive events go to all tools to facilitate (2)
It's a bit of a hack because they're statically initialized and
so we can't make use of the _() macro. We do still want it in the
code, however, because the string harvesting is based off of it.
Fixes: lp:1833000
* https://bugs.launchpad.net/kicad/+bug/1833000
* Circular gal<->common dependency bites again. Add 'common'
again to the 'kicad' target's link libraries. libgal.a depends
on SHAPE_POLY_SET in common, but common depends on gal. This is
not a real fix, but it unsticks Linux compilations. Fixing the
circular dep is an existing bug: https://bugs.launchpad.net/kicad/+bug/1832229
* Missing LEGACY_HK_NAME for ACT_EndTuning: this was probably accidentally
allowed on some other platform due to different wxString constructors.
On Linux/GCC, it breaks.
* Unused include from /kicad in export_vrml.cpp. This is not findable
on Linux, as pcbnew does not include the right dirs for this to be
found. But it's not used, so just remove it.
This removes the remaining hard-coded segments counts and replaces them
with the relative error calculation where the segments per arc is
determined by the maximum error we allow (smaller arcs = fewer segments)