The smart pointer was only used to pass the pointer into the function,
and the pointer was being kept in multiple places, so it just made the
API surface a bit convoluted.
7daded7c60 moved them to bare pointers but
this was not required to allow forward declarations. We only need to
place the CTOR/DTOR fully in the cpp file where the nlnav headers are
included
Uses WX_GRID for in-place editing of job descriptions and
GRID_CELL_TEXT_BUTTON for context-menu-free editing of job
properties.
Also moves buttons down as the Save button (now renamed Save Jobset) also saves the output definitions.
This tidies up quite a performance hit on layer change
caused by repainting vias, pads and tracks for their
clearances.
Instead, on a layer change, just disable any old clearance
layer and enable the new one (if any).
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19404
It's too fragile due to the way we move things around. Instead
store the unresolved name in the EDA_TEXT item and then scan the
whole document to resolve the EDA_TEXT items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19383
ki::any is a standards-compliant implementation, based on the GCC
standard library. However, it uses type_info::hash_code() to check
the validitiy of a ki:any_cast, rather than comparing the type_info
objects directly. This comparison, used in the standard
implementations, is fragile across translation unit boundaries when
built with Clang.
This prevents the dialog growing too much and going off a
smaller screen. It's also more consistent split to match
Pcbnew, which has the same graphical items settings and
allows more granular resetting and avoids confusing settings
that only apply to new footprints with settings that apply
to items with in a footprint.
Resetting is also then more granular, so you can reset text item
defaults without, say, also resetting your default line widths.
Assert message:
Assertion failed at C:\jenkins\workspace\build-windows-kicad-msvc-8.0-stable\.build\kicad\common\widgets\widget_hotkey_list.cpp:309 in WIDGET_HOTKEY_LIST::getExpectedHkClientData: hkdata != nullptr - No hotkey data found for list item
Fixes KICAD-7NV
Fixing this required disabling the footprint/3D viewer canvas drawing
before destroying the canvas in the dialog dtor. This in turn required
adding a virtual method to DIALOG_SHIM that can be overridden by the
derived object to allow performing actions during dialog shutdown that
can be problematic when performed in the dialog dtor. Please note that
this only works for quasi-modal dialogs. Modal and modeless dialogs
should use close window events.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18107
The Cairo printing system is already used to print to printer, it can be
now used to print to clipboard and fixes the issue with opacity < 1.
However to use it in clipboard, the advanced config needs to set the new
EnableEeschemaExportClipboardCairo = 1 (for now)
The default is false.
Also fixes a bug where the pretty printer didn't insert
linebreaks for a forest (it assumed a single tree root).
Also further regularises bool and quote formatting.
UNDEFINED_LAYER is -2, so simple checking evenness isn't
enough to check if it's copper or not. Notciable when the
FABMASTER import puts things on UNDEFINED_LAYER while it's
processing items.
Currently, unselecting the bold option resets the thickness to the
standard size instead of reverting to the original thickness.
To address this, the original thickness should be preserved so it
can be restored when bold is turned off.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18975
Handle boolean value parsing during paste operation. The boolean value
was not being handled correctly in grid_tricks, which prevented the
boolean value from being pasted into the target row
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18985
This means that an early return or an exception between
a manual Push/Pop (or an omission of the Pop) cannot
corrupt the layer stack.
It also means the GAL doesn't have to maintain its own
stack (with the in-scope GAL_SCOPED_ATTRS taking that role).
Reomve the Push/PopDepth functions, as they're only ever
used in pairs, and doing it manually needs more care.
Implement a simple RAII GAL attribute save/restore
class that handles putting the GAL back the way it was found.
This makes draw methods easier to write, as they don't need
to worry if a called method will upset the attribute context
(as long as the caller saves the context, or the callee does).
Obviously not a good idea to use in tight loops, but when text
is involved, this is negligible!
On reflection, the forward vector makes more sense, because
the value in the edit box is then the same as the vector the
user just drew with the ruler.
For segment, circle, beziers, these are the same in all editors and only
need access to the EDA_SHAPE nature, so we can remove the duplication
entirely.
For TABLECELLs, while the cells are polymorphic in that PCB and SCH
cells are both EDA_SHAPEs (via the TEXTBOXes), the parent TABLES
are not polymorphic, and thus the implementation can't be trivially
de-duplicated. Rather than do something with templates, just keep
it simple for now and maybe look at unifying tables later on.
This adds the concept of editing _other_ items to the one
that informs the POINT_EDIT_BEHAVIOR - in this case connected
lines. This is one of the motivations behind this system,
as it will allow to bring similar logic to Pcbnew.
This introduces the POINT_EDITOR_BEHAVIOR class, which
allows a "behavior" to be defined, which covers the creation
of edit points, updating the points on edit, and pushing the
edited points back into the object.
This keeps the logic for a single item "type" (e.g. a SEGMENT
or TEXTBOX, etc) in one place, rather than fragmneted throughout
the POINT_EDITOR class, where the invariants like point count
are difficult to keep track of as the TOOL progresses.
For now, it's implemented as an optional class, just for SEGMENT
and other tpyes work as before. Adding new types is then a
"pin-compatible" drop-in process.
Also fix the previous code for clearing unknown keys to use
a JSON pointer so that it functions correctly when the JSON path
is more than one level deep.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18734
Includes zoom to selection, and pan to selection (which
centres the result but doesn't change the zoom).
I'm not sure this is the perfect solution to search pane
settings, but it's near to the action, but not taking up
too much space, doesn't need to open a modal to mess
with it, and has room for more options in future.
I haven't made toggling these options into full-blown
TOOL_ACTIONs, but they could be if a hotkey to toggle
these is desirable - it's an ACTION_MENU, so it should
just slot in..
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16192
Then you can just toggle back and forth with '/'.
One day, these frames should use a tool manager for this
kind of thing (also for the ruler tool, but lots of other
things on top), but for now just bind a char hook.
Pass things as unqiue_ptrs. I don't think there's that much
on the stack, but certainly addinig big enough chunks to the batches can
upset the coroutines.
Also reinstate a ClearDrawables which went AWOL.pick
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18835
Primary increment is the right most bit, secondary is the next
rightmost. So you can increment 'A1' to 'A2' or 'B1' with
Shift-Alt-Scroll and Ctrl-Alt-Scroll respectively.
These are context sensitive actions that increment "something"
about the selected item.
A generic 'increment' action can be produced, e.g. by other tools
or UI events, which has in increment step (positive or negative)
and an 'index' which determines what about the item should be
incremented - it's up to the increment action handler to decide
what that means.
And then add a primary and secondary inc/decrement action,
which allows to bind hotkeys to each.
Bind these to:
* Sym edit: increment pin names/number
increment text items
* Sch edit: increment lables and text
* FP/PCB: increment pin numbers
increment text items
- Moves functionality to FOOTPRINT class from BOARD_ITEM
- Renames DRC property from ComponentClass to Component_Class
- Adds DRC checks QA for A.Component_Class and a.hasComponentClass('x')
When two arcs only barely overlapped, we cannot predict the actual point
ends as they exist in the error margins. Since arc tracks have
different radii by definition, rounding errors in calculating the
overlap angle led to some mistaken identification of parallel segments.
This adds an advanced config flag to set the preferred cutoff point
(currently 0.001°) for whether two arcs actually overlap in shared angle
space
This is useful when you want to copy text content out to some
external program (or put it in a text item/box).
I'm not sure it's possible to intuit exactly what a user wants,
as you will often want to copy items as the real items, and sometimes
as text. While KiCad might be able to make a smart guess, external
programs will have no chance!
The Load and MatchesFile methods never change the aSettings parameter.
They also immediately dereference the pointer unchecked, so make it a
ref so that the client code (single call site) becomes formally
responsible for never passing a nullptr.
Reduces the need for client code to know it can exploit the
enum -1/+1 properties. ToHAlignment provides an explicit
contract for integral conversion, and also doesn't rely on the
int being exactly -1, 0 or 1 (failure to adhere to which would
be UB).
These are added to from the activation delay thread, but
accessed from the tool thread (e.g. via computeAnchors)
so they should be protected from concurrent access.
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18835
While it's still session-limited, this means you don't have
to restart to get your locking ability back.
Finer-grained locking enablement probably makes better long-term
sense, but this at least prevents "gun shyness" about a setting
you can't turn off again easily.
Also it gets a bool's-worth of application configuration state
out of a dialog (it was a static).
Like the DSNLEXER header, this has visibility in over 700
files, whereas well under half actually use any of it
(quite a bit, but not all, of it actually via DSNLEXER)
Many places already forward-declare the OUTPUTFORMATTER type,
by doing that for the others, it still possible to use the
non-IO methods without having to see richio.h.
TEMPLATE_FIELDNAMES_LEXER is already forward declared - including the
header too drags DSNLEXER into many files, but it is literally only used
in template_fieldnames.cpp.
This drags in dsnlexer.h to everything that uses EMBEDDED_FILES, but the
parser is actually only used in two files. It's not the only thing to
drag it in, though.
Currently, touching dsnlexer.h rebuilds nearly 800 files, when it
actually is needed by about 50 at most.
CHANGED: PCB file format now supports saving/loading complex padstacks
CHANGED: PTH pads are now rendered per copper layer in the copper color;
the PTH pad color is no longer used.
ADDED: support for importing complex pad stacks from Altium PCBs
Enforce padstack-aware access to pad properties across KiCad
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8182
- Adds Component Class field to SCH_DIRECTIVE_LABEL
- Adds SCH_SYMBOLs to SCH_RULE_AREA item lists
- SCH_SYMBOLs resolve Component Class directives
- Netlist exporter / importer handles Component Class names
- Adds DRC expressions and functions
- Adds QA check for component class netlist export
This makes it easier to control what snap points you are aiming for
without accidentally activating objects just by mousing near them
on the way to somewhere else.
Break the non-PCB-specfic parts of PCB_REFERENCE_IMAGE out
to a common REFERENCE_IMAGE class, which is then composed into
the PCB_REFERENCE_IMAGE. This will make it easier to bring the
transform origin logic to eeschema without repetition.
PCB_SHAPE::Normalize() normalized a graphic segment by (sometimes) swapping
start and end points. But it creates an issue when flipping a segment: the
reference point can be changed.
This normalization was made for DRC purpose when comparing 2 footprints.
Now, PCB_SHAPE::Normalize() does not change end points of a segment, and a
specific PCB_SHAPE::NormalizeForCompare() normalize fct is used for DRC compare.
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).
Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.
This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
Adds the initial implementation of bezier overlay
(assistant) and geometry manager. This is only
implemented in Pcbnew - the code is common, but
eeschema doesn't currently use it for any shape.
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/8828
Some shapes, like arcs and beziers have "lines" that
can be useful to see when editing, but aren't directly
editable and may not overlap the object's own lines.
So make it possible to, indepedently:
- Turn off the centre-point drag handle affordance
- Show the actual line segment on screen.
This is useful if you want to give some preset options
to a user (e.g. recently used value) but stil have them
controlled and presented using the UNIT_BINDER logic.
Mostly intended right now for allowing testing of library tables
to help with testing chained loading, but it also decouples the
idea of a library table from on-disk files in general.
All current (real) lib table implementations continue to use the
file-based IO.
This could be made more general (not just for tables) if really
needed.
Probably this should be replaced with a less error-prone
approach. Right now the LSET -> BASE_SET system is risky
because it is converting a signed enum (PCB_LAYER_ID) to
a size_t in all the underlying operations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18738
Before we edited the grid settings directly so cancel would keep your
changes.
Also includes numerous QoL improvements borrowed from Ian's patch,
and a few other small fixes.
This makes it clearer that it is a polyfill-type affair
and make it easier to swap for the std:: one when the
compiler support is guaranteed.
Also avoid double underscores in parameter names,
as well as underscore-capital latter as they are reserved.
ADDED: Add support in Pcbnew for exporting ODB++ files under Fabrication
Outputs, base on ODB++Design Format Specification (Release v8.1
Update 3 February 2021).
Note: There is still a lot of work to do if we will make the feature as
complete as the ODB++ spec. However, the current functionality's
completeness is already sufficient to cover general production
scenarios. I have compared the output results with Gerber files by
DFM tool and the accuracy at the graphic level should be able to
cover most usage scenarios. Additionally, I am very grateful to
the great open-source project Horizon EDA for giving me a lot of
inspiration in terms of ideas.
The feature can be enabled by adding "EnableODB=1" to the kicad_advanced
configuration file.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2019
- Fix incorrect values of displayed layers of blind/buried vias
- Fix possible incorrect layer order in PCB_VIA::SanitizeLayers()
- fix some display issues in 3D viewer.
- fix issue in LAYER_RANGE::Contains(): sometimes the test was incorrect.
When working near snap anchors, which come and go
rapidly, it's often useful to see what snaps have been
calculated. Add an advanced config to show these
(EnableSnapAnchorsDebug) on an overlay layer.
With more polish this could be a hotkey or something.
This is a pretty major rework of the snapping system.
The GRID_HELPERs now have a separate CONSTRUCTION_MANAGER
which handles some of the state involving "construction
geometry".
This is fed with 'extended' geometry (e.g. "infinite" lines from
segments) for use in generating things like intersection points.
It also handles adding this geoemtry to a GAL view item
(CONSTRUCTION_GEOM) for display to the user.
The process is:
* A TOOL creates a GRID_HELPER
* Optionally, it pre-loads a "persistent" batch of construction
geometry (e.g. for an item's original position)
* The grid helper finds useful snap 'anchors' as before, including
those involving the construction items.
* Other items on the board can be 'activated' by snapping to one
of their main points. Then, if it has construction geometry,
it will be added to the display. At most 2 items of this kind of
geometry are shown, plus the original item, to reduce avoid
too much clutter.
The dashed snap lines state machine is also handled in the
CONSTRUCTION_MANAGER and displayed in the CONSTRUCTION_GEOM item.
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing
Non-copper layers are odd and incrementing.
This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )
Similarly, gt/lt tests should not refer to the integer value of the
layer. We have functions such as IsCopperLayer to test whether a layer
is copper or not.
When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified. There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS
Similarly, PNS layers remain unchanged and sequential. A set of
interface functions is provided to map PNS layers to Board layers and
back. This allows the PNS_LAYER_RANGE to function as expected
SHA256 is fine for one-offs but for large libraries where we might be
running the hash on hundreds of files, the speed difference is
appreciable. We don't require crytographic hashing, just a check that
the original file hasn't been corrupted so Murmur3 satisfies our basic
requirement.
Adds REPORTER::HasMessageOfSeverity for WX_STRING_REPORTER,
which allows us to show simulation warnings and fail only if there's errors.
Also fixes a crash when SPICE_GENERATOR_KIBIS throws an IO_ERROR.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18143
When the italic or bold nature is changed, text using outline fonts may
need to change its font. Add this to the SetItalic/SetBold functions.
Also add a counterpart SetItalicFlag function (following SetBoldFlag)
when you only need to set the flag (e.g. when importing or changing
everything in the text properties dialog).
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18592
This allows to see what the current snap point is, which is useful when
zoomed in, or the point is like the corner of a rounded pad where it's
"in free space" and might not be immediately obvious.
First, ensure that we calculate the bbox of the imported elements.
If the total BBOX is outside our allowed value, refused to import. This
needs to be scaled or addressed in an external editor
If the bbox fits, then make sure that we clamp it such that the largest
element is still within our bounds
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18523
TOOL_MENU::m_menu was unconditionally created by the TOOL_INTERACTIVE constructor, resulting in crashes if
we wanted to run the TOOLs in headless mode, e.g. in unit tests. This commits makes
the creation of the menu object dependent on Pgm::IsGui().
The separates it from the LAYER_SELECTOR class - deciding
what color a layer is (say) is separate to managing the
actual selection of the layer. For example, sel_layer.cpp
only needs the presentation logic. This also makes it eaiser
to compose rather than inherit.
Additonally, break out the layer pair swatch function
to this class.
This will also be needed by the layer pair manager UI.
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/15227
This moves a fiddly little bit of logic used by a few UI
classes into a central location.
Also means that the paths dialog learns to expand the
first cell when it needs to (like the text variable
panel).
Schematics, symbols, boards and footprints all get the ability to store
files inside their file structures. File lookups now have a
kicad-embed:// URI to allow various parts of KiCad to refer to files
stored in this manner.
kicad-embed://datasheet.pdf references the file named "datasheet.pdf"
embedded in the document. Embeds are allowed in schematics, boards,
symbols and footprints. Currently supported embeddings are Datasheets,
3D Models and drawingsheets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6918
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2376
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17827
Previously, they were defined in different files, and sometimes redefined.
This change should not create an actual code change.
However, this move shows there are the same value used for different flags,
so another fix should be made later.
Makes a test backup file and compares to the existing zip file backup to
see if the files have changed since it was made. If so, the new file is
kept. If not, we discard the new file and continue
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12453
Previously, fills could end up just barely touching, leading to DRC
errors even if there was enough room to fill the remaining space. This
was due to how we shrink/expand the zones to remove small features. By
adding a zero-width line between points that should be connected, we
expand back to the correct width.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14130
We are derived from std::vector now. We don't need our own prima donna
increment and dereference overload as these just create bloat and
non-standard coding practices