This is a board file format change to account for the new properties.
Also, we now only store the critical information about the dimension's
geometry in the board, rather than storing every drawn line.
The DIMENSION object is now an abstract base, and ALIGNED_DIMENSION
is the implementation that exists today (we will add more dimension
types in the future)
1) For a while now we've been using a calculated seg count from a given
maxError, and a correction factor to push the radius out so that all
the error is outside the arc/circle. However, the second calculation
(which pre-dates the first) is pretty much just the inverse of the first
(and yields nothing more than maxError back). This is particularly
sub-optimal given the cost of trig functions.
2) There are a lot of old optimizations to reduce segcounts in certain
situations, someting that our error-based calculation compensates for
anyway. (Smaller radii need fewer segments to meet the maxError
condition.) But perhaps more importantly we now surface maxError in the
UI and we don't really want to call it "Max deviation except when it's
not".
3) We were also clamping the segCount twice: once in the calculation
routine and once in most of it's callers. Furthermore, the caller
clamping was inconsistent (both in being done and in the clamping
value). We now clamp only in the calculation routine.
4) There's no reason to use the correction factors in the 3Dviewer;
it's just a visualization and whether the polygonization error is
inside or outside the shape isn't really material.
5) The arc-correction-disabling stuff (used for solder mask layer) was
somewhat fragile in that it depended on the caller to turn it back on
afterwards. It's now only exposed as a RAII object which automatically
cleans up when it goes out of scope.
6) There were also bugs in a couple of the polygonization routines where
we'd accumulate round-off error in adding up the segments and end up with
an overly long last segment (which of course would voilate the error
max). This was the cause of the linked bug and also some issues with vias
that we had fudged in the past with extra clearance.
Fixes https://gitlab.com/kicad/code/kicad/issues/5567
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.
Loading speed fixed by changing the way CADSTAR_ARCHIVE_PARSER::InsertAttributeAtEnd works (we now have a new attribute in each node to keep track of how many attributes there are). Now loads a 30,000 line file in 10seconds instead of 25 minutes!
Better fix than a0df876d
For new users, if this folder does not exist, saving colors does not work,
because if this folder does not exist, it is not created.
There was a regression in v6 where the zoom to selection toolbar
item wasn't canceling the tool when pressed and the tool was active
(it was in v5). This implements a more generic framework for canceling
tools on button presses.
Fixes https://gitlab.com/kicad/code/kicad/issues/5103
Also moves to WX_GRID to get rid of some wxGrid bugs, and moves the
provision of attrs to the GRID_TABLE (as those applied to the grid
are ignored when a table is specified).
Fixes https://gitlab.com/kicad/code/kicad/issues/5260
For instance, we get things like high-contrast-mode from the pad
dialog when rendering a pad preview, but we want the colours from the
parent PCB_BASE_FRAME.
The stepping is in a static event handler, so it is called
after the dynamic handler and so the dynamic handler must
allow the event to continue processing.
Fixes https://gitlab.com/kicad/code/kicad/issues/5319
windowClosing() calls Destroy() when the wxCloseEvent has no veto.
This is fine for usual EDA_BASE_FRAME frames, but not for frames shown in modal mode.
In modal mode, windowClosing() should not call Destroy(), because the calling frame
expects the instance not deleted after closing.
(the caller has to call Destroy() only once the frame can be actually deleted)
LayerName() can now be called to get the default, translatable name
for any board layer. LSET::Name() is used for the untranslated
names required for parsing board files.
We use the LIBID for board files to locate the correct library for the
footprint. Once exported, the footprint should be associated with the
library that contains it, if any.
Fixes https://gitlab.com/kicad/code/kicad/issues/5400
The center point on polygons now maintains the axis of the dragged line
and, optionally with Ctrl pressed, maintains the slope of the adjacent
segments as well.
This also fixes a longstanding issue that prevented the ctrl-snapping
from using the original point rather than the last updated point when
constraining.
Fixes https://gitlab.com/kicad/code/kicad/issues/2465
For now, much of KiCad depends on Prj() working, so when we
are asked to unload a project, immediately load the null project
so that nothing breaks.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5374
This commit applies display origin transforms to all Pcbnew
dialog classes that use UNIT_BINDER for their formatting:
* DIALOG_CREATE_ARRAY
* DIALOG_FOOTPRINT_BOARD_EDITOR
* DIALOG_GRAPHIC_ITEM_PROPERTIES
* DIALOG_GRID_SETTINGS
* DIALOG_MOVE_EXACT
* DIALOG_PAD_PROPERTIES
* DIALOG_POSITION_RELATIVE
* DIALOG_TEXT_PROPERTIES
* DIALOG_TRACK_VIA_PROPERTIES
This commit adds the PCB_ORIGIN_TRANSFORMS class, which is derived
from the ORIGIN_TRANSFORMS class, and provides a set of templated
functions to convert PCB coordinates between internal representation
and display representation. It extends the ORIGIN_TRANSFORMS class
to understand the three user-selectable display origins and the
coordinate direction display options.
This commit modifies the UNIT_BINDER class to invoke the ORIGIN_TRANSFORMS
methods to support Display Origin Transforms.
The EDA_DRAW_FRAME class is modified to instantiate an ORIGIN_TRANSFORMS
object providing null transforms. A function is provided to allow the
UNIT_BINDER to find the ORIGIN_TRANSFORMS object in an overrideable manner.
This commit adds the ORIGIN_TRANSFORMS class to support Display Origin
Transforms in all KiCad applications.
Functions are provided to perform four basic types of origin coordinate
transforms:
* Transform a relative coordinate from internal to display form
* Transform a relative coordinate from display to internal form
* Transform an absolute coordinate from internal to display form
* Transform an absolute coordinate from display to internal form
These functions are supported for data types "int", "long long int",
and "double". The default implementations for all but "int" simply
return their input unchanged; the implementation for "int" invokes
the implementation for "long long int".
The expectation is that the different KiCad applications will create
derived classes from this base class and override the functions as
needed. Protected template functions are provided for the standard
translations to maintain consistency within the derived classes.
A subsheet may have more than one instance of a hier label,
but it's generally a mistake if there is no matching hier label
for a port on the parent sheet.
This is harder to do today now that we don't have manual tool
for placing hier ports, but it's still possible if you place
ports but then rename the label on the subsheet.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/3468
We probably don't need it, but some code attempts to dereference
it so safer to have one then to start checking everywhere for
dereferences.
Fixes https://gitlab.com/kicad/code/kicad/issues/5353
Display warning infobar in the board/schematic setup when no project
is loaded, since most of the settings in those dialogs are saved in
the project and not in the board/schematic file.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4868
Short net names are not unique; full names with paths must be used.
Added a grid cell renderer that does the escaping, to make it easier
to display net names in grid cells.
Once you unescape a net name, you can't go back to the escaped form
because you can't assume which `/` should be {slash} and which `/`
Because of this, we cannot use Unescape/Escape on the data model in
the netclass setup panel, and instead do the Unescape in the view.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5331
This time remove the push/pop from the picker tools as that's
responsible for the issue of trying to re-activate the move action
when its popped. Instead do the push/pop from the client code
of other actions that need it, and not at all from the move-with-
reference action.
Fixes https://gitlab.com/kicad/code/kicad/issues/5336
* Make the app progress indicator only have the indeterminate state
when the taskbar indicator is used (causes an uused variable warning
on wx<3.1)
* Remove unused dry run variable in pcb_netlist.h
* Remove unused forceDropAnnotations from the paste special dialog
since the dialog only controls keeping them.
Cairo Polyline and Polygon draw functions share a common routine. While
Polygons must have 3 points to allow triangulation, a polyline (like our
text) need only have 2
This resolves a crash when passing an empty polygon and alerts debug
users to possible generation cases when bad polygons are created.
Thanks for Frans Zellman
(https://gitlab.com/kicad/code/kicad/-/merge_requests/365) for
identifying the issue.
This freeze/thaw is different than the update locker freeze/thaw,
and is needed to prevent crashes due to accessing invalid (already
freed) data on GTK.
Fixes https://gitlab.com/kicad/code/kicad/issues/5289
The tree model adapter appears to have update issues when modifying the
scores while it _might_ get updated. This moves the lock higher and
removes the extraneous Freeze/Thaw call.
Unfortunately, this only exposes an additional issue in the tool handler
but this will hopefully be easier to debug.
Fixes https://gitlab.com/kicad/code/kicad/issues/5206
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.
Flags != language See http://www.flagsarenotlanguages.com We now use
local, untranslated language names for all languages.
Languages that have not been updated in >5 years and have less than 15%
of available strings translated have been removed from the menu options.
If a translator steps up to update the .po files, we can re-add them
This leaves the decision to check/enable menu items to the main UI
conditions, and only the menu has control over showing/hiding the menu
items. Also rip out a special case for the preferenes item that isn't
needed on OSX anymore since all the main menus have been moved to
ACTION_MENUs now.
CHANGED: Don't run the hotkey if the action's UI elements aren't enabled
This makes it so the action can't be run from either the hotkey or the
UI if its enabling conditions are not met.
* Frames moved: cvpcb, cvpcb footprints frame, gerbview, pagelayout editor
This also introduces new EDITOR_CONDITIONS that are used to set the
conditions of very common editor settings.
Also, some IDs were converted to tools in the pagelayout editor.
This allows for the tool framework to keep track of a universal
set of conditions for the UI state (enabled/checked/shown) for
controls of actions. It removes the need for the main menubar
menus to be CONDITIONAL_MENUs and be rebuilt on each open,
and instead makes the updates of the check and enabling of
items handled in the native wxWidgets way.
This commit switchs the 3d viewer and kicad project manager window
over to this system.
EDA_ITEM is a child of VIEW_ITEM, so a static_cast is not appropriate,
since in some cases it could be called with a non-EDA_ITEM argument.
This was triggering an ASAN heap-buffer-overflow in GerbView.
The variables in the common settings struct are only updated on
save, so Python must use the ones from Pgm to get its values.
This does lead to the observation that Python's changes to the
variables do affect KiCad (they can break resolvers). So apparently
it can mess with us but we can't mess with it easily.
Also, improve the environment variable tracing infrastructure to capture
more changes.
Just setting the text field is not guaranteed to fire
a text event, so we must forcefully call the regenerate
function to ensure the preselect is handled.
Fixes https://gitlab.com/kicad/code/kicad/issues/4105
The base GAL has the linewidth property already, and its
accessor will only return the base version. This was causing
problems with the Cairo printing GAL, since that setter wasn't
using the base class version. Also, this removes the print-specific
setter, since the actual setting of line width shouldn't be done
there and is instead done where the drawing happens.
Fixes https://gitlab.com/kicad/code/kicad/issues/5089
This moves the generated files out of the source tree and into
the build directory. They are now regenerated each time they are
needed, based on the timestamp of the generated file compared to
the timestamp of the lemon file.
To do this, we also bundle lemon into the thirdparty directory
and build it for ourselves since it is a very tiny program and
not all platforms seem to distribute it in a consistent manner.
Fixes https://gitlab.com/kicad/code/kicad/issues/5013
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
This ensures the colors used by the status text pane in the preview
widget are the same as the canvas, so there is a seemless transition
between the two.
Additionally, remove the scrollbars from the symbol preview widget
in the place symbol dialog - they are pointless.
Before this, the environment variables inside Python wouldn't reflect
the updates to them made after the interpreter was started in Pcbnew.
This will call into Python and set the variables when they are changed,
since Python can't synchronize itself when running in an embedded
interpreter.
Fixes https://gitlab.com/kicad/code/kicad/issues/5071
ADDED: Progress indicator in the taskbar
This adds a progress indicator to the Windows and macOS taskbar
icons to display the progress of some operations.
Note, this requires wxWidgets 3.1+
KiCad stores 3D cache files but never gets rid of any of them.
This patch adds a new function called 'CleanCacheDir()'. Any cache
files older than the passed 'number of days' parameter are deleted.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1928
Store list of previously open projects only in kicad.json
Keep all management of open projects in SETTINGS_MANAGER
Also add kicadSettings() for convenience
On platforms with limited framebuffer attachments, like GC7000L
driven by the open source etnaviv driver, we can still use
GPU acceleration by drawing directly to the main buffer.
EDA_DRAW_PANEL_GAL::onPaint checks if an overlay target is
available in the GAL, and if not, redraws the whole view if the
overlay target should be dirty.
Clearing of the overlay target is a no-op if there is no overlay
buffer.
Signed-off-by: Lukas F. Hartmann <lukas@mntre.com>