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
Rather than forcing each thread to iterate over the full nets list to
find the dirty items, we collect the dirty items first before asking the
threads to address them. This prevents thread spinning. We also
amortize the cost of calculating on an 8-net per thread basis rather
than 2.
Locks protect the std::set in each item. Devolving the mutex to the
CN_ITEM allows multiple threads to make simultaneous connections to
different items where they do not conflict.
The connectivity files were unwieldy. This separates them logically
into data, algo and items where the items classes are those that hold,
surprise, surprise, the items, lists and clusters.
Refactor the polygon event loop into its parent function to allow access
to the params structure. Active layer now updates the drawing layer for
add/cutout zones.
Fixes: lp:1797483
* https://bugs.launchpad.net/kicad/+bug/1797483
Dynamic casts should only be used when we explicitly check for the
resulting pointer to be NULL. Where we know the class is castable we
can use static_cast, save on overhead and ensure our resulting pointer
is non-null.
When using the board edit, align tool automatically moved footprints
instead of pads but distribute tool did not. This standardizes the
behavior.
Fixes: lp:1796997
* https://bugs.launchpad.net/kicad/+bug/1796997
The evaluation of count_if resulted in a 0 or 1, leading to segment zone
fills always running on single processor and the progress bar showing
incorrect status. Likely infrequently hit as only affected segment
fills.
Block rotate and mirror now work like they do in Pcbnew (that is
they're treated as part of the block move/duplicate/whatever
rather than finishing it).
Fixes: lp:1780794
* https://bugs.launchpad.net/kicad/+bug/1780794
If the user is carefully selecting the zone edge, we do not filter the
zone preemptively from our disambiguation list in the same manner as we
do for selecting on zone copper.
Fixes: lp:1796719
* https://bugs.launchpad.net/kicad/+bug/1796719
The board design settings file keeps our default values for various
thicknesses. We use this to replace a number of magic numbers with the
defined value to help self-document the code.
The check against S_POLYGON was always false because we set the default
type to S_SEGMENT. This unifies the magic numbers to the board design
settings file
Disabling the grid should leave the snapping in place. But our disabler
returned the current point as closest, effectively always ensuring the
cursor position was the closest snap. This only uses grid when
requested.
This is temporary until we figure out a way to do multiple constraint
handling in GRID_HELPER or the EC_* class. This will work as long as
the EC constraint helper places the endpoint on either the primary or
aux grid.
Fixes: lp:1796540
* https://bugs.launchpad.net/kicad/+bug/1796540
We no longer require this as we calculate the number of segments based
on the maximum deviation rather than fixed numbers.
Fixes: lp:1780518
* https://bugs.launchpad.net/kicad/+bug/1780518
Get the board settings when changing the drawing layer. These include
default line thickness that should be updated.
Fixes: lp:1796489
* https://bugs.launchpad.net/kicad/+bug/1796489
When drawing the crosshair should track the element while the mouse
provides the position to calculate the next snap.
Fixes: lp:1796524
* https://bugs.launchpad.net/kicad/+bug/1796524
The dimension tool is used to measure physical dimensions on the board
therefore it should be able to snap to any other object, not just those
on its own layer set as is the case for other items.
This also deals with a corner snap case for constraints by first
snapping, then constraining, then aligning to grid. This ensures OoO
for alignment from least to most constraining.
When considering potential targets for snap points, we need to exclude
the currently selected item as this will mean that we always snap to
ourselves when editing an existing item.
Fixes: lp:1796507
* https://bugs.launchpad.net/kicad/+bug/1796507
When drawing segments, the segment will be NULL'd after committing, at
which point we lost our snap layer. Choosing snap layers from the
current drawing layer is a more robust method.
Fixes: lp:1796467
* https://bugs.launchpad.net/kicad/+bug/1796467
Deselection by clicking on a zone makes working with plane zones easier
by allowing the selected item to de-selected by clicking on a zone.
Once the selection is cleared, the zone may be re-selected as normal.
Clicking on non-zone items while a separate item is selected will still
select the new non-zone item without requiring a second click.
Updating connectivity should not need to iterate over the full item list
in each thread. Instead, we collect the dirty items first and then
iterate only over the dirty list.
Our connectivity data threads the ratsnest update based on the number of
nets that have changed. If we are only changing one net (the case when
routing) then making a full thread to update the net is pointless
because we wait for the thread to finish before continuing. This spins
that off to an inline lambda for single updates while still making
threads for multiple ratsnest changes.
This shows the snap indicator even when the item we are snapping to
occurs on a grid point, giving the user an indication that the point is
correctly connected.
Many items require precise, non-grid movement. Adding the ability to
flag a non-grid option will permit this behavior.
This is a required precursor commit to fixing lp:1738818 and lp:1771683
The computeAnchors function is used to find best drag locations for
items being moved. All movable PCB items should be handled.
Fixes: lp:1794304
* https://bugs.launchpad.net/kicad/+bug/1794304
When requesting to move a footprint based on the pad, the pad layers
should determine the snapping. This extracts layers from the selected
pad before allowing the filtering for locked pads
Fixes: lp:1787627
* https://bugs.launchpad.net/kicad/+bug/1787627
Since we are handling snapping in the grid helper, we don't need to
enable it in the cursor position return. This allows the grid helper to
use the frame position while optionally snapping to segments.
Put the cursor and pan control TOOL_ACTIONs in ACTION,
and refer to them in that way.
The handlers are currently identical in Pcbnew and Cvpcb,
and Gerbview (and all canvases) can benefit from them as well
if they are in libcommon. Also saves duplicated code.
Fixes: lp:1795855
* https://bugs.launchpad.net/kicad/+bug/1795855
This ensures that when starting to draw a zone or graphic element, the
preview is drawn in the same color/on the same layer as the element that
will be created. Previously, beginning a graphic polygon while a copper
layer was active would result in the preview being drawn in the color of
the active copper layer.
Adds Cut/Copy/Paste and Revert for footprints; introduces a new
shared Revert Changes? dialog; hooks up Add Library for footprints,
standardizes the Save As terminology.
Polygon corners were enabled in the footprint editor but the logic
didn't extend to the board editor. This revises the logic to look for
DRAWSEGMENTs and only reference the PCB_MODULE_EDGE_T where needed to
create a new segment in the footprint.
Fixes: lp:1782966
* https://bugs.launchpad.net/kicad/+bug/1782966
Allows selection of polygons and zones by their visible area. Will only
select polygons/filled areas when they are unobstructed by other
elements in the footprint/pcb. Also adds a "skip heuristics" modifier
key for clicking (ALT) that allows the full disambiguation list to be
displayed without removing less-likely elements. This dovetails the
zone/polygon selection as it allows selecting even when areas a fully
overlapped.
Fixes: lp:1753153
* https://bugs.launchpad.net/kicad/+bug/1753153
This fixes the CmpNoCase() == 0 bug on one side, and the
footprint == null bug on the other side; both of which were
previously fixed on only one side.
Fixes: lp:1795561
* https://bugs.launchpad.net/kicad/+bug/1795561
We want to keep at most 1 thread per 2 connectivity updates but we need
to force that floor to be at least 1 for when there is only 1
connectivity update.
Fixes: lp:1795245
* https://bugs.launchpad.net/kicad/+bug/1795245
SEGZONEs are no longer created by pcbnew but may exist in older boards.
This allows deleting the old fills in a manner similar to the deletion
in Legacy canvas.
Fixes: lp:1794571
* https://bugs.launchpad.net/kicad/+bug/1794571
SEGZONE types were confusingly named PCB_ZONE_T. Zones in pcbnew are
now _only_ PCB_ZONE_AREA_T, so we name segzone types PCB_SEGZONE_T to be
clear.
This also removes processing of the SEGZONEs from connectivity
calculations.
m_dragstatus is set to true when a valid route is created given the
user's constraints. We need to check this before committing the route
to the board.
Fixes: lp:1794810
* https://bugs.launchpad.net/kicad/+bug/1794810
Unselecting performs two functions: unselecting and unhighlighting.
Some items may be deselected but still live in the temporary highlighted
layer (e.g. selecting a footprint and exchanging it). Since there is no
harm in unselecting an unselected item, we can allow it to proceed
without the check.
Deselecting each individually had the side-effect of possibly re-drawing
the view in between actions, leading to visible artifacts in the router
(where invisible items are set visible before committing a change)
Nets dialog (Inspect->List Nets) contains list control
that has very small width for first and last columns.
Changed algorithm for calculating optimal values for
column width.