The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time. Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
Devolve the logic as to whether a pad should be numbered or not
to a pad utility function. Add a very simplistic test for this
function (demonstrating how to test BOARD_ITEMs in general).
Fixes: lp:1804787
* https://bugs.launchpad.net/kicad/+bug/1804787
It is very difficult to select 0-width lines and they aren't physical on
the board. Items with this setting in Eagle should revert to the
default in KiCad.
Fixes: lp:1808584
* https://bugs.launchpad.net/kicad/+bug/1808584
Cairo supports antialiasing when rendering but can be slow when set to
sub-pixel mode. This bumps the minimum version of Cairo to 1.12
(available in 14.04 LTS as well as mingw) to support three antialias
settings (fast, good, best) that offer speed/appearance tradeoffs.
This can provide a higher-quality eeschema render as it works on a
per-element basis as opposed to the OpenGL per-screen antialias.
Currently, GAL is initialised to NONE (i.e. off). This causes
issues when Legacy canvas is broken (i.e. GTK3).
This changes the default to GAL Cairo, both in PCB_EDIT_FRAME
init, and in the config load.
Now, when the user starts with no config, they are prompted for
a choice: OpenGL or Cairo, and one of them will be set up, with
Cairo as fall back.
Users on platforms that still support legacy can go to it as normal
from the menu, but it will not be the default in any circumstance.
Fixes: lp:1809997
* https://bugs.launchpad.net/kicad/+bug/1809997
Where we can get away with lower segment counts (localizing an anchor),
we keep the low-def 16 segment count. Intermediate values and values
that are visible to the user are set to high definition. Most are
simply hints to the inflation correction but where they show, the user
show see smooth lines.
Most rounding operations have been shifted to an absolute error
calculation and the ability to adjust zone segment counts has been
removed in 5.1. The remaining elements that use fixed segment counts
are either 18 (DRC) or 32 (plotting). This aligns the punchout segment
count with the higher (32) definition value
wxChoice centers the selection on GTK. So when switching from a
mid-list item to an item at the top, the list is always cut off for
choice lists located on the top toolbar. Using a combobox provides a
drop-down that allows easier access to all elements in the box.
Fixes: lp:1808569
* https://bugs.launchpad.net/kicad/+bug/1808569
The hotkey name "Help (this window)" does not describe what the hotkey
and associated action does. It displays the current hotkey list, so the
action name should reflect that behavior
Moving pcbnew error strings that may be seen by the user to translated
strings. Strings that denote unexpected cases are moved to debug logs
as they are essentially asserts that should never be shown. The
exceptions are the messages shown when files are loaded. All unknown
items should show an error here.
Checks for ratsnest enabled prior to calculating and displaying the
local/dynamic ratsnest. Calls the ratsnest clear from selection clear
Notably, it appears that the tool actions do not chain transitions for
the same event. So only a single action (first specified) will be
executed when an event fires unless the actions are executed by separate
tools.
Fixes: lp:1809752
* https://bugs.launchpad.net/kicad/+bug/1809752
This make the use of legacy canvas on GTK3 a default-off
advanced config. Legacy is substantially broken on GTK3
and is of basically no use at all to general users on this
platform.
If the program starts with legacy canvas in the config,
it is forced into a GAL mode, as otherwise it could happen
that the user is stuck and unable to get into pcbnew to change
the setting.
Fixes: lp:1803156
* https://bugs.launchpad.net/kicad/+bug/1803156
While not technically allowed, overlapping polygons can be drawn in
pcbnew. Gerber polygons are strictly simple, however, so we need to
fracture prior to exporting to avoid invalid gerbers.
Rather than depend on proper unlocking for each exit, we move the
connectivity lock mutex into an RAII-type configuration that
automatically unlocks on exit.
Layer bit sets get chosen for the layer name, starting with the copper
layers and then the technicals. Additionally, multi-layer pads are
appended with an indicator that additional layer bits are set.
Fixes: lp:
* https://bugs.launchpad.net/kicad/+bug/
When importing footprints, some are generated with non-standard (e.g.
"mod") extensions. As a last option, we allow the * wildcard to select
these files for import.
Use TesselatePolygon() to draw polygons in Gerbview instead of GLU tesselation, much slower.
Add helper methods in GAL to know if the current GAL engine is Cairo, OpenGL or something else,
useful to optimize drawing code.
This fixes the handling of align/distribute tool when called on locked
items. Locked items cannot be moved but they may be used for the target
of an align/distribute operation.
Fixes: lp:1808238
* https://bugs.launchpad.net/kicad/+bug/1808238
Instead of a nag screen for locked items, we allow first the unlocked
items to be deleted and then, with a repeated request, the locked items.
This adds a popup cursor window informing the user of the option for
repeating the delete
Fixes: lp:1806507
* https://bugs.launchpad.net/kicad/+bug/1806507
Previous version had minimum width to account for it being difficult to
click on small lines. This should not be used for filled polygons
Fixes: lp:1808141
* https://bugs.launchpad.net/kicad/+bug/1808141
Simply calling it Alternative Delete was hiding its behavior. This gives
a descriptive tooltip and command name allowing users to more easily
find the equivalent to the "Ripup" command
This updates some of the footprint wizard values to use the default KLC
values for silkscreen, fab, courtyard and text.
Also updates the default QFN settings to create a valid footprint
Make sure the view is rebuilt before selecting the new footprints
so that they're shown only in the selection overlay.
Don't start the drag until the dialog is closed so we don't have
a bunch of extraneous mouse warping.
Fixes: lp:1775265
* https://bugs.launchpad.net/kicad/+bug/1775265
This allows people to continue to use the edge-width as a proxy
for board edge clearance until we implement board edge clearance
as a real feature.
Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
Graphic lines and polygons are drawn to fit specific areas for which it
is helpful to have the endpoint controlled by the cursor even when
constraining the angle.
Fixes: lp:1805502
* https://bugs.launchpad.net/kicad/+bug/1805502
IsPolygonFilled() replaces the hard coded comparisob with Edge_Cut in code.
For now the polygon is not filled only on Edge_Cut layer.
But in the future, it could be an option for other layers.
Commit 1858b7dca corrected the handling of polygons on the edge cut
layer for board items. This adjusts for the possibility of polygons
in modules on the edge cut layer by applying the module offset/rotation
to the polygon elements.
Like circles, polygons are self-closed elements that define an outline.
This allows them to be used as such for board outlines and cutouts.
Fixes: lp:1795563
* https://bugs.launchpad.net/kicad/+bug/1795563
This allows too turn it on for work without an additional patch.
Also fix a bug in the disable code - when the SVG is enabled,
allow to select SVG files.
When loading the load using the UI, netclasses and net info are
synchronized to the board object after parsing the file. This needs to
happen automatically when loading the board via the Python interface as
well.
Fixes: lp:1806506
* https://bugs.launchpad.net/kicad/+bug/1806506
In DRAWSEGMENT polygonal shape: the commit tried to use triangulation (CacheTriangulation) to draw the shape (similar to zones).
It was much faster than using GLU tesselator (one order of magnitude).
Unfortunately, CacheTriangulation() works only with simple polygons, not with any polygon.
And simplifying a polygon with a lot of vertexes is very time consuming.
So using CacheTriangulation() is now removed and GLU tesselator is used as previously.
Fixes: lp:1806411
https://bugs.launchpad.net/kicad/+bug/1806411
SVG import need some refinements to be efficient, so it is disable for v 5.x.
Will be re-enabled later.
Enabling SVG import is *only* for developers, not for users.
* Do not compile dxf old files.
* import gfx, gal mode: make absolute placement working.
* Import gfx in legacy canvas: use it and make interactive placement working
* Take imported line width in account. Ensure DXF line thickness is OK.
* handling empty files in legacy mode.
This adds a check for contiguous board outlines to the DRC. It also
uses the calculated outline to ensure that traces are not crossing the
outlines.
Fixes: lp:1648055
* https://bugs.launchpad.net/kicad/+bug/1648055
Rather than duplicating the connectivity calculations in determining
whether a track is dangling, we utilize the current database to find the
number of connected items for an anchor item when feasible.
Multiple anchors such as tracks still need additional logic.
Fixes: lp:1805479
* https://bugs.launchpad.net/kicad/+bug/1805479
The client filter might add items in the case where locked pads are
filtered. We need to handle this case when requesting selection by
adding new items to the m_selection
Fixes: lp:1802686
* https://bugs.launchpad.net/kicad/+bug/1802686
When changing the track width, we need to allow that the track's route
will change based on DRC, so force a move without changing position.
Fixes: lp:1785057
* https://bugs.launchpad.net/kicad/+bug/1785057
When we draw a path, we usually want to close the path when clicking on
the end of another line. This uses grid helper to ensure this
progression happens as expected.
When updating the status of the ratsnest, we mark its target layer as
dirty to ensure the revised data are used to draw/clear the ratsnest
Fixes: lp:1800301
* https://bugs.launchpad.net/kicad/+bug/1800301
(cherry picked from commit 50eedcf0b3)
JP notes that there is an issue with comma-based decimal locales and the
SaveSelection that is addressed by having a LOCALE_IO call in a limited
block.
This changed the copy timing of the clipboard and the interaction with
KDE Klipper again. To address this, we isolate the clipboard open call
to the end of the routine and force a round-trip of the clipboard data
before exiting.
Klipper seems to poll at odd times. When we copy to wxTheClipboard
in one locale and Klipper extracts data in a different locale, it throws
an XError. We don't need the extra LOCALE_IO calls as Format() uses its
own LOCALE_IO setting.
Fixes: lp:1800648
* https://bugs.launchpad.net/kicad/+bug/1800648
The ratsnest layer needs to be always enabled in GAL rather than taken
from the board settings. This also adds a finalize handler to the
picker tool that allows a picker-caller to perform a specific action
when the picker tool exits. In this case, we use it to clear the local
ratsnest selections back to the default.
Fixes: lp:1800301
* https://bugs.launchpad.net/kicad/+bug/1800301
(cherry picked from commit c0d9b9ab81)
When the local ratsnest tool is used, it should toggle the state based
on the global ratsnest visibility. After changing state, the layer
cache is marked as well.
Possibly related to lp:1800301
(cherry picked from commit 22fbf30f22)
This parameter defines the working area (full page) size.
The fix is not perfect, because it does not take in account the page size.
However it is similar to the "old" initialization, before Eeschema GAL.
In Eeschema, a reasonable boundary size is used.
Distinguish between the snap-from and snap-to items. Previously, we
used the SELECTED or DRAGGED flags but the flagging arcitecture was
inherently fragile. This specifies items directly that should not be
used as snap targets.
Fixes: lp:1802795
* https://bugs.launchpad.net/kicad/+bug/1802795
Filtering based on selection ignores the use case where we are measuring
to a selected item. This utilizes the dragged flag to prevent snapping
based on the current state of the item drag.
Fixes: lp:1801089
* https://bugs.launchpad.net/kicad/+bug/1801089
When snapping, we should allow any point identified as a snappable
point. The additional consideration for corners might be used for
alignment in the future.
Fixes: lp:1802741
* https://bugs.launchpad.net/kicad/+bug/1802741
Factor out save current canvas view to image file code from symbol editor
code so it can be used anywhere.
Add ability to save to any image format supported by wxBitmapType. See
https://docs.wxwidgets.org/3.0/gdicmn_8h.html#a90a1eb6d85b5044a99b706fd979f27f5.
Currently only PNG output is implemented.
Please note that there is a minor bug that appears to be due to the
scroll bars which causes unfilled areas on the right and bottom edges
of the image. This always existed in the save symbol editor view
image but it was not as noticeable because by default the background
color is white. It is very noticeable in the footprint editor with
a black background.
The usual smattering of coding policy and comment fixes.
Fixes lp:1802127
https://bugs.launchpad.net/kicad/+bug/1802127
If checkboxes don't have individual IDs FormBuilder won't assign
them and the event table ends up connecting each checkbox to all
of the checkbox handlers in the dialog.
Fixes: lp:1801746
* https://bugs.launchpad.net/kicad/+bug/1801746
Importing Eagle files allowed for invalid zone values for clearance and
minimum width that triggered asserts in the 3d-viewer.
Fixes: lp:1801188
* https://bugs.launchpad.net/kicad/+bug/1801188
Fedora packaging errors with ambiguous python shebang since current
rawhide (30).
So we should remove it as the footprint wizards are not to be executed
standalone.
Variable netBuffer contains all NET_INFO items, whereas max_netcode
value is determined only basing on pad nets. After a netlist update
there still might be a NETINFO_ITEM that is not assigned to any pad and
has a net code higher than calculated max_netcode. Such situation
results in a out-of-bounds access in sortNetsByNodes().
Separate out zone edges (which are quite specific, and should
win over most other things) from zone fills (which are pretty
generic and should only be considered when there's nothing else).
Also excludes zone fills when the zones aren't being shown as
filled.
Display GALs had an incorrect world unit value set. Now the world unit
value says how many internal units are in an inch, in accord with the comments
in the GAL header. Bitmap drawing code relied on the information about DPI,
so scaling worked differently for display and print GALs.
It is possible for an async thread to simply be deferred if not
specifically set to async. In which case, until the return value is
requested, the loop may simply wait.
By decoupling from std::thread, we can avoid the wait/sleep cycle in
checking the std::atomic completion variable. The std::future variables
are immediately returning without the additional atomic check cycle.
This minimizes the thread usage, particularly during online actions such
as moving items and routing.
UpdateRatsnest: Minimized the number of atomics by utilizing future
promise. Avoided updating node-less nets. Node-less nets are common in
the dynamic ratsnest because the net vector is created from the board
nets by value but only populated with a subset. So the dynamic ratsnest
calculation always saw every net as dirty and spun up extra threads.
searchConnections: ParallelThreadCount is no longer lower bounded.
Small item counts are handled inline rather than with a separate thread.
When processing the selection filter, items were deselected before being
reselected after passing through the filter. This adjusts the logic to
only deselect those items that are filtered out.
Some windows machines seem prone to sleeping for excessive times. When
called in the main thread, this may prevent the system from responding
to Windows 'Are you alive?' calls.
TF.FileFunction,Copper,L1,Top,Signal is now TF.FileFunction,Copper,L1,Top
This param is not useful, and probably never correctly set by users, because is is not used by Pcbnew.
(It is used only for dsn export)
The implementation relied on the fact that PyString_AsString is returning NULL
for invalid inputs (and causing an error condition), which is then fixed by the
call to FROM_UTF8. Now, we will simply return an empty string if Py_None is
returned by a python fuction, which resemebles the old behaviour of those methods