Items that are located at the edge of or outside of integer limits will
not be shown on screen as they don't fit in the VIEW RTree. This
prevents them from being edited and can corrupt data output. Instead,
we place them at the largest value that is representable on the RTree
(INT_MAX/SQRT(2)). This allows the user to correctly utilize DRC as
well as interact with and remove the offending items.
Fixes: lp:1815642
* https://bugs.launchpad.net/kicad/+bug/1815642
The parent window was always the board edit frame,
but this is incorrect when this dialog is called from the Plot dialog.
Fixes: lp:1815530
https://bugs.launchpad.net/kicad/+bug/1815530
When adding colors to length tuner, we depend on the window background
color, which can be set by the user, resulting in an unreadable text.
This uses the HSL conversion to detect which shade it should use for the
coloring.
Also adds test cases for round-trip HSL and HSV conversion
Fixes: lp:1814530
* https://bugs.launchpad.net/kicad/+bug/1814530
Update 3D model panel on initial dialog load to reflect the current
visibility state of the 3D model.
Fix a few minor footprint properties dialog spacing issues.
Fixes lp:1815184
https://bugs.launchpad.net/kicad/+bug/1815184
Fix wxGrid column minimal widths on Windows in dialogs (just fixing the size is not enough).
WX_GRID::GetVisibleWidth(): make width bigger for labels, because they usually use a bold font.
(However, the fix is just a workaround: a better code is welcome)
Using the normal command, oval holes are "drilled" by a route command.
Some board houses do not accept this normal command.
In this case, the drill dialog allows using an other Excellon drill command (a slotted hole).
Note also some board houses do not understand this alternate command!
GTK does not handle enlarged text layouts automatically, so we need to
get the screen size before choosing the correct grid width for the
dialog
Fixes: lp:1788495
* https://bugs.launchpad.net/kicad/+bug/1788495
When doing a global edit of the tracks and vias, we need to allow for
the possibility that the track size doesn't change and that this is
explicitly allowed without DRC error.
The using the "first available" numbering option, force an
artifical linear numbering scheme starting at '1'.
Start the pad name provider at the 0'th pad index.
Also adds a few related tests and adjusts tests affected by
this change to reflect that the offset still applies.
This can be expanded in future to be more general by skipping
pad (which would allow a custom start and numbering scheme
while still avoiding duplication), but for now,
this does what the UI says and avoids string changes in 5.1rc.
Fixes: lp:1814918
* https://bugs.launchpad.net/kicad/+bug/1814918
Fixes: lp:1814917
* https://bugs.launchpad.net/kicad/+bug/1814917
* Make LIB_TABLE_BASE::GetCount() return unsigned. This is more
consistent with the behaviour of STL containers (especially the
boost::ptr_vector this is really accessing). Sadly
wxGridTableBase() forces an int, so a cast is still required
at the WX interface.
* Make LIB_TABLE_BASE::At() return a reference. First, this is more
consistent with normal STL indexing operator[]'s, and secondly, it
allows an idiomatic const index method (so you can access const
LIB_TABLE_ROWs from a const LIB_TABLE_BASE).
The motivation is to allow use of this class and LIB_TABLE_ROW
in a test program, where the LIB_TABLE_BASE is const.
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.
As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.
This resolves a circular dependency previously detected and also
simplifies CMakeLists.
The bitmap definitions (BITMAP_DEF and so on) do not
have any dependencies on other libs, including WX. This
means the bitmaps library can be isolated from the other
dependencies.
Common now depends on bitmaps, and libraries that depend
on common can pick it up from the common target_link_libraries,
as it is PUBLIC. This means a lot of targets no longer
need manual bitmap linkage.
This avoids a circular dependency that was previously reported
by static analysis.
Avoiding pulling in WX and other headers into the include
tree of each bitmap .cpp is a huge speed up (around 10x) in
compilation, and the generated static library is also 10x
smaller (20MB vs 200MB)
Add common as a link library to pnsrouter,connectivity.
THese library do still use common code (including bitmaps,
via base_screen.h) and this allows them to pick up the libcommon
includes correctly.
In countries using a comma as floating point separator, the --min-distance="0.0100 mm" was passed as --min-distance="0,0100 mm"
This is incorrect and broke the command line.
Fixes: lp:1814559
https://bugs.launchpad.net/kicad/+bug/1814559
Circles and Squares are handled correctly. Octagons are converted to
circles. Pad 1 is identified by the "1" string in the Eagle name.
Fixes: lp:1784126
* https://bugs.launchpad.net/kicad/+bug/1784126
Fixes and issue where forces were calculated using the current track
width even in differential placer mode where the tracks are specified by
the differential pair width.
Fixes: lp:1814480
* https://bugs.launchpad.net/kicad/+bug/1814480
When creating new lib table rows, the pointer becomes managed by the new
table through the boost::ptr_vector. The row is non-copyable, however,
so we lose the reference as soon as it goes out of scope. Creating a
clone provides a new pointer that is moved into the table on creation.
Fixes: lp:1792456
* https://bugs.launchpad.net/kicad/+bug/1792456
Choosing the drag origin should not be dependent on the snap settings in
pcbnew. Snap settings are sensible when you are designating a target
only. Additionally, when dragging a module, we do not want the
footprint's pads to be used as targets for snapping.
Fixes: lp:1814402
* https://bugs.launchpad.net/kicad/+bug/1814402
When the user cancels the footprint load, we should assume they are
canceling the placement of a new footprint. This also adds sanity check
when populating the list
Fixes: lp:1814181
* https://bugs.launchpad.net/kicad/+bug/1814181
It was a regression from 5.02 version.
The block of new footprints to place has now its reference point (the point that is on the graphic cursor) fixed.
This is the first footprint loaded from the list.
This breaks the following functions out to a general-purposed refdes utils
header:
* MODULE::GetReferencePrefix()
* kicad_string.h RefDesStringCompare()
This acheives:
* Slimming of MODULE interface
* Placement of refdes code in common rather than pcbnew
** Testing of this code in qa_common
* Tighter and smaller includes for code that only needed refdes functions
Note: there are failing tests commited (as expected failures). These
are the cause of lp:1813669 and will be fixed as a follow-up commit.
This is not logic specific to MODULE. Breaking it out to
kicad_string.h acheives:
* Slimming of the MODULE interface
* Enables reuse of the function
* Enables testing of the function
Also add a test under qa_common for this function.
The CONFIG_SAVE_RESTORE_WINDOW class does not need to be tied
to the array dialog, put it in common/widgets.
Also do a refactor and tidy-up of the the class, use a union for (slightly)
better type-safety and syntax (a variant would be better but that's C++17).
Also enable integral field save/restore from text boxes.
Fully initialise the CREATE_ARRAY_DIALOG_ENTRIES object,
and use these values for the dialog on first open. Currently,
the initial values aren't all initialised, and none are used, as the
valid flag is not set. This means there are poor defaults in some
fields.
Also more declarations and defintions of CREATE_ARRAY_DIALOG_ENTRIES
to the .cpp, as these do not need to be exposed in the header,
even privately.
The original item is part of the array, so give it a number
and put it in the right place (all current array tools have
a null transform for the first item, but it's not part of the
contract. For example, a circular array with an angle offset
might want to move the first point).
The numbering axis priority (h then v or v then h), and alternate
reversing are not actually numbering parameters, they are part of
the geometry of the array (the items are physically in different
orders).
So enable these options, even when numbering is disabled.
Also fix broken logic about when numbering scheme is enabled
(it still applies even if the numbering offset is fixed.)
The current module cannot be queried for existing pads as we
add them (because we never commit, until we finish the whole array).
Instead, pre-gather the names and check as we add, skipping any existing
names.
Note: this will not prevent arrays becoming "mis-ordered", but there
is not a lot we can do to prevent all possible errors.
Fixes: 1808706
* https://bugs.launchpad.net/kicad/+bug/1808706
The same principle could be used to skip existing ref-des'es on PCBs.
The geometry and numbering logic is separate to the dialog, and
can be separated for clearer logic and better testability.
Moreover, refactor it to avoid any dependency on pcbnew
classes, so it can be move to common for potential re-use in
eeschema and friends in future.
Also convert all wxPoint logic in these classes to VECTOR2I and
fix some function visibilities.
Add some unit tests of the ARRAY_OPTIONS geometry and numbering.
Snap/Grid modifier follow preferences from 05483a06c6. Brings Shift/Alt
modifiers into alignment with drawing tools. Shift modifier still
conflicts when choosing end item with the complete track click-modifier.
This will be addressed in v6 with a larger preference setting.
Snapping to item options were partially disconnected when unifying
framework. This re-attaches the options and adds the additional option
for graphical items.
Fixes: lp:1801377
* https://bugs.launchpad.net/kicad/+bug/1801377
kicad2step has a tolerance level that sets whether two points are at the
same location or not. This allows KiCad to access these levels to some
degree, permitting a looser interpretation of a closed board outline.
The selection for interactive drag uses cursor position off grid to
choose the element for dragging. We pass the same value into the start
dragging routine to choose the correct end of the element.
Fixes: lp:1813665
* https://bugs.launchpad.net/kicad/+bug/1813665
Rather than selecting an arbitrary track to snap, we select the closest
track to our point, allowing the via to be placed along the full track
length.
Fixes: lp:1813324
* https://bugs.launchpad.net/kicad/+bug/1813324
Some microwave inductor lengths cause invalid outputs
for the calculations, which causes jagged outputs.
* If the request length is such that four arcs and no straight
segments is too long
* If the length is such that an N-turn coil is too short, but
an N+1-turn coil is too long. This can happen when the coil
count is small.
This patch doesn't fix the underlying geometric issue here - fixing
the first requires a numerical method, and fixing the second probably
needs an iterative approach. Both of these could benefit from
a refactor.
However, this patch does prevent the tools producing invalid outputs,
which can sometimes be quite subtle mistakes if the "jags" are small.
Fixes: lp:1792119
* https://bugs.launchpad.net/kicad/+bug/1792119
Phoenix doesn't have the same initialization as wxpython3 and so the
namespace doesn't get the wxApp() initialized to the existing instance.
In python, this is worked around by starting a new wxApp.
Unfortunately, this appears to overwrite the existing global instance
variable. The issue _appears_ to be in Phoenix but for now we work
around it by saving and resetting the instance pointer in the main app.
The downside is that Python likely won't be able to respond to events
from C++
Fixes: lp:1809913
* https://bugs.launchpad.net/kicad/+bug/1809913
In the past, the ZONE_CONTAINER::GetPosition() member
returned a reference to a wxPoint, in accordance with the
BOARD_ITEM interface. This meant that ZONE_CONTAINER had
to reinterpret_cast a VECTOR2I (its internal position data) to wxPoint,
which was possible only due to fortunate memory layout.
This interface was changed to return wxPoints by value in
commit a4528988ca, and the normal (wxPoint) cast was used instead.
Thus, we can now also remove the dire warnings and static_asserts
used to ensure the now-unused old method was correct.
Introduce the concept of a DRC_PROVIDER which allows
to separate the various DRC functions to their own
areas. This allows, amongst other things, a slimmer core
DRC class, and allows DRC functions to be separately testable.
The courtyard DRCs (overlap, missing and malformed)
are the first victims, so instrumentation can be added to this function.
Add some unit tests on this DRC function, as well a few re-usable PCB-based
utility functions in a library (qa_pcbnew_utils) that could be shared between
unit tests and other utilities.
This separates the "newMarker" functions from the DRC class. These
are moved to a new class, DRC_MARKER_FACTORY, which is now responsible for
constructing suitable markers from BOARD_ITEMS.
The reasons for this are:
1) Allow DRC related functions to access theese functions without having
to bake these functions into the main DRC class.
2) Thereby simplify the DRC class interface
3) As DRC_MARKER is now a small class with public interfaces, it's
possible to put unit tests on these functions.
The motivation here is to allow to start to split out pieces of DRC
into separate classes.
Prior to placing the via, we check if the resulting via will pass too
close to different nets on different layers.
Fixes: lp:1718827
* https://bugs.launchpad.net/kicad/+bug/1718827
Previously, when the 3D viewer is opened, each board edition creates a 3D view refresh, that usually takes a bit of time.
Now the refresh is postponed until the 3D viewer has the focus.
When creating the zone cutout, we delete the old zone and add a new one
with each cutout. This requires resetting the source zone and clearing
our previous selection if we would like to continue using the cutout
tool on the new zone.
Fixes: lp:1812339
* https://bugs.launchpad.net/kicad/+bug/1812339
Plotting mask layers, we expand by a minimum width before performing a
boolean add of the separate regions. The boolean add has a separation
condition that includes equality. Since we are looking for the
complement of the mask, we would like the equality applied to the other
side. Removing a unit value provides the separation.
Fixes: lp:1698457
* https://bugs.launchpad.net/kicad/+bug/1698457
When loading an existing file, a missing value in the soldermask min
width value should not be interpreted as a default value but rather as a
0 value. This corrects an issue introduced by 4d709d2392
When prompting for a new footprint library, we need to treat the input
as a file for creation rather than a directory for selection.
Otherwise, users cannot specify the name of their new footprint library
independently of the existing directory names.
Fixes: lp:1812135
* https://bugs.launchpad.net/kicad/+bug/1812135
There is some odd interaction in the default copy constructor for
TOOL_EVENT using boost::optional under gcc. Avoid this by explicitly
constructing the event needed for cut
Fixes: lp:1812848
* https://bugs.launchpad.net/kicad/+bug/1812848
the stroke mode was always activated, even in fill mode. creating incorrect size shape for null length track segments.
Fixes: lp:1812532
https://bugs.launchpad.net/kicad/+bug/1812532
This issue created memory leak and not working wxComboboxes (for instance after modifying the language selection).
Now, these wxComboboxes are created only once, never recreated.
Also: minor cosmetic enhancement in footprint editor main toolbar
(the save footprint icon is modified if the footprint is saved to the board or to the library)
- Added ignore netcode option to CONNECTIVITY_DATA::GetConnectedItems()
- PlaceModule() now ensures the module added to the board (and thus to the connectivity database) has correct bounding box necessary for R-trees to work
- Use recursive connected pad search so that the new net is propagated to all pads
Fixes: lp:1787961
* https://bugs.launchpad.net/kicad/+bug/1787961
When renumbering pads, you can click on a pad the second time to restore
the pad to its original value. This did not allow a user to then place
the removed number on the correct pad (assuming a mistake). This commit
ensures that removed pad numbers are remembered and allow the user to
place in the correct pad.
When adding an element to a module, we don't need to update the relative
coordinates. Doing so can cause changes when writing to file depending
on rotation and position.
Fixes: lp:1810870
* https://bugs.launchpad.net/kicad/+bug/1810870
If the user does not build the GITHUB plugin (deprecated), we cannot use
it in our footprint load and should remove the define to ensure
accidental use is caught at compile time.
The config was saving a canvas type EDA_DRAW_FRAME member not always accurately initialized.
And the last canvas opened frame setup was saved, not necessary a frame having a canvas type that can be set by user.
This is a broken feature especially because the footprint viewer has a fixed canvas setting.
No net zones, by definition, do not connect to any other element.
Therefore, the entire net is an island and should not be removed by the
knockout section
Fixes: lp:1811239
* https://bugs.launchpad.net/kicad/+bug/1811239
Use the AddFileExtListToFilter() to also generate the
wildcard for "all files". This is because:
* Users can use AddFileExtListToFilter for the all files WC
with the same interface as for any other extensions.
* Users do not need to worry about wxGetTranslation, as the
_() is applied in the same way as the other *Wildcard() helpers,
and it is a function just like the others, so it is consistent
* There is a testable interface to document the expected result.
The test is added.
The local/dynamic ratsnest needs to calculate on a per-pad basis as the
module is always listed as having a visible ratsnest. This fixes the
finalized ratsnest viewed when routing as well as the show local
ratsnest regression.
Fixes: lp:1811010
* https://bugs.launchpad.net/kicad/+bug/1811010
Non-connected zones are, by definition, not connected, therefore, we
should not knock out thermal reliefs under any case
Fixes: lp:1810989
* https://bugs.launchpad.net/kicad/+bug/1810989
Frame refresh in wxWidgets sets the focus back to indeterminate state
and prevents hotkey action until the focus is captured again. Using
canvas update is the correct method to update the canvas display after
modifying zones/similar
Fixes: lp:1810993
* https://bugs.launchpad.net/kicad/+bug/1810993
When routing in high-contrast mode, the user may wish to place items
that are primarily on a different layer while remaining in high contrast
mode. This fixes a regression from 4.0.7
Fixes: lp:1804309
* https://bugs.launchpad.net/kicad/+bug/1804309
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.