7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 14:45:31 +00:00
Commit Graph

7008 Commits

Author SHA1 Message Date
Jon Evans
2c56e9826a API: Add serialization for netclasses
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18609
2024-12-30 23:29:29 -05:00
Ian McInerney
c0622eaa45 Avoid copies when using auto 2024-12-31 00:18:10 +00:00
Ian McInerney
7677cf831d Cleanup FILTER_COMBOBOX API
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.
2024-12-31 00:18:10 +00:00
Seth Hillbrand
fbbb642c0c Move all nlnav to unique_ptrs
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
2024-12-30 15:43:15 -08:00
Jeff Young
40115a298b Support double-click for editing job settings. 2024-12-30 21:12:59 +00:00
Jeff Young
b36f67853c Moved jobs to a more direct-editing paradigm.
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.
2024-12-30 18:23:47 +00:00
John Beard
f7aded00c7 Pcbnew: draw clearance lines on their own GAL layers
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
2024-12-31 00:53:10 +08:00
jean-pierre charras
2cd28009ef Define MAX_LAYERS_FOR_VIEW to init GAL::Mxx_DEPTH and VIEW_MAX_LAYERS
These values MIN_DEPTH, MAX_DEPTH and VIEW_MAX_LAYERS are coupled, so to
avoid mismatch, it is better to derive these values from an unique value
2024-12-30 16:59:32 +01:00
Alex Shvartzkop
b2acddc483 Fix opening zip archives from project manager tree on Win11.
Also removes unused OpenFile function.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19399
2024-12-30 20:51:19 +05:00
Jon Evans
1a3e18104a API: Add access to project text variables
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16426
2024-12-30 09:32:11 -05:00
jean-pierre charras
cb70079f86 GAL_API::VIEW::VIEW_MAX_LAYERS: increase value from 512 to 1024.
It was needed by the commit 78f83b5a that added GAL layers to the list.
2024-12-30 08:40:45 +01:00
Marek Roszko
659228de2d Add some closebuttons to pcbnew panes 2024-12-29 08:02:08 -05:00
JamesJCode
dfe0d6345b Another go at supressing FOOTPRINT field on FOOTPRINT objects 2024-12-28 21:57:35 +00:00
Jon Evans
2c94684f9f API: Add a preferred plugin settings path
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9054
2024-12-28 16:21:05 -05:00
Jon Evans
c77426cc12 Fix a few issues with via and pad rendering
The refactor of VIEW::SortLayers broke it, but this
was hard to notice until my recent changes.
2024-12-28 12:42:52 -05:00
Alex Shvartzkop
88a2a41d21 Add rtti_dump.h to make it easier to debug cast issues across library boundaries.
Usage example:

#include <rtti_dump.h>

NESTED_SETTINGS* settings = ...;
rtti_dump::dump_class_hierarchy(rtti_dump::runtime_typeid(settings));

From a110575fd3/samples/solib_rtti_dump/include/rtti_dump.h
2024-12-28 19:50:49 +03:00
Jon Evans
4eb68c2840 Fix pad and via opacity handling
With new rendering style, these need unique VIEW layers per copper layer
2024-12-28 10:50:58 -05:00
Jon Evans
78f83b5a39 Update PTH/Via rendering
- Add separate hole wall and net name color for vias
- Overemphasize hole wall thickness to make objects more visible
2024-12-28 10:02:11 -05:00
Jeff Young
80885ec774 Abandon the fontTextMap.
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
2024-12-27 18:59:22 +00:00
JamesJCode
5ff21f9c2d Add ki::any and ki::any_cast for any_casts across translation units
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.
2024-12-27 17:28:27 +00:00
Jeff Young
f1cbcc83fe Fixup fill versions.
Older versions saved some non-symbol shapes with wrong fill mode.

The property inspector also sets the wrong fill mode.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19254
2024-12-25 15:14:54 +00:00
Jeff Young
6eba855fd1 Formatting.
In particular, put setter and getter arguments on their own
lines as their syntax is otherwise very hard to visually parse.
2024-12-25 15:14:54 +00:00
Jeff Young
61dac76224 Don't discard render cache when substituting font.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18672
2024-12-24 20:07:06 +00:00
John Beard
9d7d6eae10 FP-edit: split fields and graphics default settings
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.
2024-12-24 20:38:34 +08:00
Marek Roszko
62ec7e2d6d Add the ability to capture job reporting and display it in the result window 2024-12-23 23:05:37 -05:00
Seth Hillbrand
e9bc8cfe9d Give Clipper1 a Viking funeral
Clears out the last spot where we were only using Clipper1 (how'd I
miss that?) and remove all calls to the Clipper1 structures
2024-12-23 17:12:09 -08:00
Alex Shvartzkop
9b40e6b2e3 Fix assert in hotkey list when double-clicking on a section header.
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
2024-12-23 21:12:07 +03:00
jean-pierre charras
59f6ffc05d pagelayout_editor: Avoid multiple or useless calls to OnAcceptPrms()
These useless calls, have a cost in calculation time.
2024-12-23 11:08:02 +01:00
Jon Evans
2f6a4214ed Revert "Rename design block file extension constant"
This reverts merge request 
2024-12-22 19:49:42 +00:00
Graham Keeth
ebfbedf7a7 Rename design block file extension constant
Also add design blocks to the project archiver include list.
2024-12-22 19:30:19 +00:00
Marek Roszko
4771e573ef Unhide jobsets 2024-12-20 18:49:41 -05:00
Jon Evans
3ebe124ae7 API: Add a mechanism to recreate Python environments 2024-12-20 17:07:09 -05:00
Seth Hillbrand
c2bfdaa6ae Allow SWIG access to lset
SWIG doesn't like initializer lists because they are compile-time
objects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19326
2024-12-19 12:13:11 -08:00
Wayne Stambaugh
2e7d819b5d Fix thread deadlock when closing the footprint chooser dialog.
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
2024-12-18 08:13:15 -05:00
Jon Evans
9eda526871 API: Show API actions alongside SWIG action plugins in preferences 2024-12-14 18:00:07 -05:00
Jon Evans
c24103e259 API: logging and logic improvements to Python dep management 2024-12-10 19:02:50 -05:00
Jan Wichmann
8d015b2967 pcbnew: Respect options when STEP exporting graphical and text items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19116
2024-12-10 13:54:47 +00:00
jean-pierre charras
929b2c06fe Eeschema, export to clipboard: allow using the Cairo printing system.
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.
2024-12-10 11:40:43 +01:00
Jon Evans
96536f380d API: refactor handlers to be slightly less verbose 2024-12-08 20:23:11 -05:00
Jeff Young
753d385473 Reduce dependency on dynamic_cast.
Also switches to checking __clang__ instead of __WXMAC__.
2024-12-08 21:46:54 +00:00
JamesJCode
29798a6400 Allow DRC markers to be selected with area selection
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19258
2024-12-08 14:10:07 +00:00
Seth Hillbrand
bf6a255a3e Move more elements from fixed size arrays
Refactor layer data storage from compile-time array sizes to run-time
map storage
2024-12-03 13:25:11 -08:00
Jon Evans
ecdc7ee08f Add a null type for libeval / std::optional support
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19158
2024-12-02 21:21:18 -05:00
Jon Evans
38c00c5d58 Fix off-by-one in IsCopperLayer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19211
2024-12-02 15:40:45 -05:00
Jeff Young
4883c27972 Handle ERC/DRC assertions in drawing sheet.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19132
2024-12-02 20:13:43 +00:00
Alex Shvartzkop
55ca13e7cf Revert "Support hidpi in Cairo GAL canvas; performance improvements."
This reverts commit 8e90063258.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19150
2024-12-02 22:44:20 +03:00
Jon Evans
8ff3ef5fd5 API: Add ExpandTextVariables 2024-11-28 19:21:18 -05:00
Jon Evans
523fcc039f API: Move trace macro to utils 2024-11-28 11:28:06 -05:00
Jon Evans
3129e072c4 API: Move graphics and text handling to common
Required moving API_HANDLER_COMMON out of kicommon
2024-11-28 11:28:06 -05:00
Jeff Young
6686ade45b Remove (somewhat atrophied) manual pretty printing.
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.
2024-11-28 11:08:16 +00:00
John Beard
ed9e66399e Pcbnew: negative layers are not copper layers, even or not
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.
2024-11-28 04:36:12 +08:00
Jeff Young
fa52d68268 Fix pretty-printing of UUIDs and bools. 2024-11-25 19:10:13 +00:00
Jon Evans
c0d43c0c0c API: Add serialization of FP_3DMODEL 2024-11-24 15:53:10 -05:00
aris-kimi
e917e03a10 Fix some typos 2024-11-24 16:44:01 +00:00
Jon Evans
62df972c2d API: implement serialization for ZONE 2024-11-23 11:04:34 -05:00
Seth Hillbrand
d7137c4a05 Cleanup VIEW class
Ununsed m_dynamic class variable
2024-11-21 18:59:48 -08:00
Seth Hillbrand
76176274cf Improve function naming
Having sortLayers and SortLayers in the same class was confusing.  Also
removed the asserting calls in view updates
2024-11-21 18:04:23 -08:00
Seth Hillbrand
9e72d426db Remove C macro in favor of class template 2024-11-21 18:04:23 -08:00
Seth Hillbrand
9c08354485 More VIEW refactoring
Move m_layers into map, add layer existence checks.  Skip layer sorting
overhead for OpenGL display b/c we use z-level for it anyway
2024-11-21 15:41:56 -08:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
Jon Evans
387a544da3 Promote ODB++ export out of advanced config
At this point it is more useful to get wider testing
2024-11-20 18:51:24 -05:00
Jon Evans
033fb4fc8f API: Add GetBoundingBox and Box2 2024-11-19 22:09:00 -05:00
Jon Evans
bc45f1b352 REMOVED: separate color for via net names
Vias can now use track net name color
2024-11-16 11:27:20 -05:00
Jon Evans
71a0a638a0 Remove unused pad layers and simplify pad colors 2024-11-16 11:27:20 -05:00
Jon Evans
4dbe295e80 Migrate legacy layer presets to V9
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18718
2024-11-16 09:27:31 -05:00
Dhineshkumar S
43b1bc52db Fix switching bold option on and off alters text thickness
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
2024-11-13 02:14:19 +00:00
Jon Evans
0a20482359 Remove flag from via stack GUI 2024-11-09 14:48:40 -05:00
jean-pierre charras
a1cf21f100 Fix compil issues 2024-11-07 19:54:45 +01:00
Dhineshkumar S
07f96b83b7 Fix copy-paste issue for grids with checkboxes
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
2024-11-07 18:26:08 +00:00
Jon Evans
420ea9da9d Add some logging to KINNG 2024-11-05 18:38:27 -05:00
John Beard
28c600edb7 Jobset: correct AC name comment 2024-11-05 20:57:06 +08:00
Wayne Stambaugh
930407fac8 Fix PDF plotter URI issues.
Add 'file:' URI JavaScript handlers.

Properly convert Windows file paths to valid URI syntax.

Use expanded variables for URI menu names.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250
2024-11-04 20:05:42 -05:00
John Beard
1a86982a2a Avoid enum name conflict on MacOS. 2024-11-05 08:20:37 +08:00
Alex Shvartzkop
3b987776c7 ADDED: STL and PLY (since OCCT 7.7.0) 3D model export. 2024-11-04 16:15:02 +03:00
John Beard
dbf68a80b8 GAL: also scope layer depth push/pops
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.
2024-11-04 20:41:44 +08:00
John Beard
3549b77530 Ruler: fix colours when not the same as the cursor strings
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!
2024-11-04 20:41:20 +08:00
John Beard
11ac6ea976 Position interactive: use the forward vector value
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.
2024-11-04 20:41:20 +08:00
John Beard
87cd0a74f2 Point editor: unify segment, circle, bezier and tablecells (partial)
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.
2024-11-04 20:41:15 +08:00
John Beard
e6e1253fea Pcbnew: allow to copy the ruler co-ordinates 2024-11-04 20:37:14 +08:00
John Beard
970d9b3615 Eeschema: point editor: edit polygons as on PCB
This includes edge dragging which is useful for rule areas.
2024-11-03 17:15:18 +08:00
John Beard
fe57c531e2 Eeschema: point editor: as a behavior class for SCH_LINEs
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.
2024-11-03 06:00:39 +08:00
John Beard
97e59b773f Pcbnew: point editor: move polygons to a behaviour class
There's a slight flicker when a polygon is edited, but
that was there before.
2024-11-03 06:00:39 +08:00
John Beard
5071541f4b Pcbnew: rework point editor behavior handling
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.
2024-11-03 06:00:39 +08:00
Tomasz Wlostowski
2daabbf6e2 MULTICHANNEL_TOOL: enable the tool by default and remove ADVANCED_CFG option 2024-11-02 19:59:09 +01:00
Jon Evans
09652efec5 Clear unknown keys from environment variable maps on save
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
2024-11-02 14:53:39 -04:00
Jon Evans
59f7615fbd Expose padstack settings in via properties dialog
Behind a flag because this feature may not
stabilize before V9
2024-11-02 10:02:29 -04:00
Seth Hillbrand
e54cf6c834 Remember the size/pos of the new proj from template
Stores the new project window position and size in the KiCad prefrences
for use between sessions

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12920
2024-11-01 15:49:52 -07:00
John Beard
277b963fac Search pane: add zoom to fit option in a settings menu button
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
2024-11-02 03:11:17 +08:00
John Beard
c6f7fa9b6e Add a zoom/pan-to-selection actions
This is useful is some process ends up doing sometihng
offcreen and wants to show you.
2024-11-02 03:09:52 +08:00
John Beard
c39573ace3 Pcbnew: get footprint by name doesn't have to be a member on PCB_BASE_FRAME
This function doesn't access anything private to PCB_BASE_FRAME. So
split it into a static and slim the PCB_BASE_FRAME API just a
smidgen.
2024-11-01 20:35:50 +08:00
John Beard
e53281a71b Sym/Fp diff panels: add a quick switch hotkey
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.
2024-11-01 18:33:48 +08:00
Fabien Corona
8a6910d96f Enable Creepage check by default 2024-11-01 10:01:19 +01:00
Jon Evans
eb6d85bacf Use a persistent flag to track JSON modifications 2024-10-31 17:39:03 -04:00
John Beard
c956e6761b Pcbnew: add interative relative offset tool 2024-10-30 09:00:14 +08:00
Jeff Young
905eaa79a9 Centralize ref-des error checking. 2024-10-28 18:40:11 +00:00
IkomaSo
f5765bac7f Added a button to open output directory in plot dialog
Shows a bitmap button next to the output location string, allowing the user to quickly view the generated file location

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17659
2024-10-27 23:33:24 +00:00
John Beard
b931dc5299 Array: add option to centre grid on the original location
Especially for SMD footprint array, it's awkward to have to
offset the pad to the corner first before making the array.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/16882
2024-10-28 00:47:01 +08:00
Andrej Valek
3ad92bc8db ShowModal: override method in DIALOG_SHIM
All DIALOG_SHIM dialogues which should be modal, has a problem on OSX
that parent could be lost. So call ReparentModal to fix this before
calling the base ShowModal method. This should fix the problem when
modal window has been hidden when windows were switched.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/3765

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17460
2024-10-27 16:37:47 +00:00
John Beard
4846d07e47 Construction geometry: lighter on the stack
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
2024-10-27 07:07:25 +08:00
John Beard
3bb0373808 Eeschema: use filterable comboxbox for parent symbols
This list can be very long and quite painful to find
the right item.
2024-10-27 05:13:32 +08:00
John Beard
a090b86b87 Separate generic aspects of NET_SELECTOR_COMBOPOPUP
Lots of this class is reusable, and it's a fiddly one
that can be useful elsewhere.
2024-10-27 05:13:32 +08:00
John Beard
2c2ff64911 Allow incrementing different parts of strings with modifiers
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.
2024-10-26 16:01:07 +08:00
John Beard
3f602f8177 Add 'Increment' actions
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
2024-10-26 15:46:16 +08:00
John Beard
f77d830d79 Break out increment function 2024-10-26 15:31:12 +08:00
jean-pierre charras
82ff2c0e0f eeschema, DIALOG_SHEET_PROPERTIES: add test for valid sheet filename
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18981
2024-10-25 11:44:29 +02:00
JamesJCode
db072a524c Consolidation of Component Class implementation
- 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')
2024-10-24 20:11:35 +01:00
Wayne Stambaugh
43c3cd57eb Substitute variables in PDF plotter URI links and add file:// URI handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250
2024-10-24 08:06:28 -04:00
Fabien Corona
28dd61babb Restore GAL layer order 2024-10-23 18:41:20 +02:00
Troy Denton
0f33aebe48 Fix URI environment variable expansion issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18918
2024-10-22 14:47:25 +00:00
Fabien Corona
6d85853365 Creepage : add minimum slot width 2024-10-22 08:42:42 +02:00
Seth Hillbrand
6be6680d8c Fix DRC error with arcs
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
2024-10-21 13:37:28 -07:00
Fabien Corona
07a0c980f3 DRC : Show paths for clearance and creepage 2024-10-21 15:56:12 +00:00
Marek Roszko
4c9dccaeb8 Fix exports 2024-10-19 07:12:07 -04:00
Seth Hillbrand
112242bb3b Remove unneeded forward declaration 2024-10-17 12:23:54 -07:00
Denis Latyshev
260014710a Pcbnew: Add differential and single line length/skew mirroring
ADDED: Added functionality for mirroring differential and single line length, as well as skew adjustment elements.

Fixes https://gitlab.com/kicad/code/kicad/issues/18469
2024-10-16 19:21:03 +00:00
Fabien Corona
f258cc5164 DRC creepage 2024-10-15 18:04:51 +00:00
John Beard
b092675171 FP edit: add 'show datasheet' action that acts on the documentation link
This is already shown in the footprint browser window as a special
item, so allow the 'D' hotkey to access it as well.
2024-10-14 23:20:19 +08:00
John Beard
1baaf9afd0 Add height get/set to reference image properties
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18567
2024-10-14 20:36:26 +08:00
Jeff Young
f7f86174a0 Make sure symbol editor prefs go in symbol_editor file.
(And same for footprint editor.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18905
2024-10-13 20:14:14 +01:00
John Beard
c799966774 Handle pasting of image data from the clipboard
Also move some clipboard functions out of TOOL_MANAGER,
as they had no dependency on that class, and are just free
functions around wxTheClipboard.
2024-10-13 20:47:45 +08:00
John Beard
b0043587c2 Add 'Copy as Text' action
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!
2024-10-13 20:47:45 +08:00
John Beard
8abbae9dc2 Sym edit: add copy/paste/cut/etc actions to fp filter table
Implemented as a "TRICKS" class that could wrap any wxListBox
with similar effects.
2024-10-13 08:34:51 +08:00
Andrzej.W
b49ebaeb16 ADDED: Soldermask layer option for graphic shapes
Allows adding a soldermask opening for shapes on a copper layer.
Soldermask expansion can also be specified.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2125
2024-10-10 12:46:06 +00:00
John Beard
a56da89bb8 JSON_SETTINGS constness
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.
2024-10-10 12:33:52 +08:00
John Beard
4bad76825c Standardise clamp function
std::clamp and alg:clamp had different argument orders.
Since std::clamp is constexpr, we might as well just use
that now we have it.
2024-10-09 21:27:58 -06:00
John Beard
7214a108e4 Text alignment: add a flip function
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).
2024-10-08 23:30:50 +08:00
Andrzej Wolski
537d3ac81a ADDED: Soldermask layer option for tracks
Allows adding a soldermask opening for individual tracks.
Soldermask expansion can also be specified.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2125
2024-10-08 02:48:33 +00:00
John Beard
8f95211bbe Construction mgr: protect batch containers
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
2024-10-05 23:53:08 +01:00
John Beard
095e414f12 Pcbnew: add way to re-enable locking prompts
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).
2024-10-05 22:26:18 +01:00
John Beard
3d6d8b9946 Strip richio.h from headers that don't need them
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.
2024-10-04 18:06:18 +01:00
John Beard
4582bf85b5 STROKE_PARAMS: Separate parser into own header
Again, the main object doesn't need to drag the lexer
into the header and expose it to all users. It's used only
in the sch/pcb parser files.
2024-10-04 15:01:00 +01:00
John Beard
c14e8aea89 TEMPLATE_FIELDNAMES: don't drag in the lexer header
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.
2024-10-04 15:01:00 +01:00
John Beard
436671edc3 Embedded files parser in own header
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.
2024-10-04 15:00:58 +01:00
Wayne Stambaugh
a871311b6f Fix schematic hierarchy navigator refresh issues.
The hierarchy navigator was failing to update properly on undo/redo and
when the referenced schematic file of a sheet was changed.
2024-10-02 11:05:54 -04:00
Jon Evans
468ebc3174 CHANGED: Render vias using copper layer colors
Update microvia and blind/buried via rendering to remove
dedicated layer colors and only use copper layer colors
2024-10-01 19:55:05 -04:00
Jon Evans
56e0811516 Phase 2 of padstack support
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
2024-10-01 19:55:03 -04:00
JamesJCode
d64a112971 Implement Component Classes
- 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
2024-10-01 22:36:18 +01:00
Seth Hillbrand
ea6c53ba5d Re-enable low-translation testing languages
Languages lower on the translation level need to be enabled in the
master branch for testing
2024-10-01 10:59:47 -07:00
John Beard
e65221a479 Snapping: extension snaps on by default 2024-10-01 18:06:27 +01:00
John Beard
e23b83505e Snapping: delayed activation of snap points.
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.
2024-10-01 18:06:27 +01:00
Marek Roszko
d74caace0a Initial jobset creation and running within the CLI and GUI.
Incomplete, just pushing this before feature freeze, much fixing left
2024-09-30 20:04:53 -04:00
John Beard
460e575457 Use REFERENCE_IMAGE for SCH_BITMAP
Also wire in the transform origin handling to the point editor
and the properties panel in eeschema.
2024-09-30 10:20:20 +01:00
John Beard
3f131e2011 Abstract REFERENCE_IMAGE to a separate class
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.
2024-09-30 10:20:20 +01:00
jean-pierre charras
4a0f111fd6 Eeschema: add bitmap to tool Increment Annotations From... 2024-09-30 11:00:43 +02:00
jean-pierre charras
9979b4849e Pcbnew: Fix issue when flipping a graphic segment (SHAPE_T::SEGMENT).
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.
2024-09-28 17:40:08 +02:00
John Beard
215533f31a Unify flip direction handling
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.
2024-09-27 17:13:13 +01:00
Astropeak
3066ad2088 Pcbnew: make 'Flip board items' option more clear
CHANGED: The 'Filp board items' checkbox in the 'PCB Editing Options'
was changed to a radio box.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16652
2024-09-27 17:13:13 +01:00
jean-pierre charras
e2282a4af8 Minor cosmetic enhancement: add icon to Revert and Generate Legacy BOM tools 2024-09-27 13:34:20 +02:00
jean-pierre charras
51d615d30d Minor cosmetic enhancement: add icon to "Create Outsets from Selection" tool 2024-09-26 20:13:43 +02:00
John Beard
b3248095e8 Pcbnew: add bezier editing tool
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
2024-09-25 21:41:32 +01:00
John Beard
30e51f7d1a Pcbnew: Show some helper lines in point editor
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.
2024-09-26 10:17:23 +01:00
Mike Williams
53022ab347 mouse settings: add reverse zoom option
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18583
2024-09-23 17:09:44 +00:00
John Beard
95beedb612 Dogbones: add slots for acute angles
It's actually not as hard as I thought, though
surely has wierd edge cases which users might need to
handle manually.
2024-09-22 13:45:19 +01:00
Mike Williams
867cb58175 feature removal: remove Show Hidden Text
Does not work properly since 8.0 introduction of footprint fields.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18656
2024-09-19 15:41:44 -04:00
John Beard
46e7228945 UNIT_BINDER: Handle binding of combo-box option lists
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.
2024-09-19 06:35:43 +01:00
John Beard
653d85f9fc Abstract LIB_TABLE IO to allow non-file-based tables
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.
2024-09-19 06:35:43 +01:00
Alex Shvartzkop
05b4aace38 Fix an issue causing "zbot < ztop" assert in 3D viewer on multilayer boards. 2024-09-19 10:07:32 +05:00
Jon Evans
4e7fcb3b67 Temporary patches around LSET and negative layers
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
2024-09-18 18:36:17 -04:00
jean-pierre charras
b2e4e9be9c Update outdated comments. No code change 2024-09-18 17:25:30 +02:00
Mike Williams
87a66d4df1 grids: make settings panel correctly implement cancel
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.
2024-09-18 10:49:12 -04:00
John Beard
99e1869987 Fix build: use same signature for alg::lexicographical_compare_three_way as std::
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.
2024-09-18 06:56:03 +01:00
Seth Hillbrand
f978fd4436 Fix build for MacOS
Accidentally removed our patch to allow three-way compare on MacOS
2024-09-17 22:25:44 -05:00
Eric
1506beecbc Implement ODB++ export
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
2024-09-14 15:34:51 +00:00
jean-pierre charras
d2cb868829 Pcb editor and 3d viewer: fix some issues:
- 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.
2024-09-14 15:57:56 +02:00
Mike Williams
337211adea grids: allow editing existing grids
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16870
2024-09-12 15:19:34 -04:00
John Beard
ebef24b6b0 Debug: graphical snap anchor debug mode
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.
2024-09-11 22:35:35 +01:00
John Beard
6bad4bb1a2 Put extension snaps behind an advanced config
This can be backed out when the snapping bevaviour is
considered good enough to be on by default.
2024-09-11 22:35:35 +01:00
John Beard
b2be0d39bd Snapping: Add construction geometry snapping
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.
2024-09-11 22:35:35 +01:00
John Beard
a3a3f7648e Break ERROR_LOC out to its own header
Having this in geometry_utils.h means that touching
that header affects nearly every file, as this type is used
in EDA_SHAPE, BOARD_ITEM and SHAPE.
2024-09-11 22:08:36 +01:00
Mike Williams
2eec2489ea design blocks: move globals behind accessor functions
Prepare for lazy loading
2024-09-10 15:50:03 -04:00
Marek Roszko
aceca713d8 Fix kicommon exports 2024-09-08 08:00:47 -04:00
Marek Roszko
00f2e56e51 IO_BASE must be dllexport/dllimport specified as a base class 2024-09-07 22:37:05 -04:00
Seth Hillbrand
5e0abadb23 Reorganize layer numbering
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
2024-09-06 23:07:58 +00:00
Seth Hillbrand
be2a52dd2b Avoid GL ctx deadlock
Allow non-drawing routines to access error messages without dealocking
the load
2024-09-06 16:00:49 -07:00
Seth Hillbrand
5ba50c26a9 Update embedded files hash to use Murmur3
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.
2024-09-06 09:57:23 -07:00
Jeff Young
ca5fb08f62 Ensure thread safety with EDA_PATTERN_MATCH_RELATIONAL. 2024-09-05 17:37:49 +01:00
Mike Williams
2c99bc6c6d new feature: Schematic Design Blocks
Added to advanced config, default to off.
EnableDesignBlocks=1 in kicad_advanced to test

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2263
2024-09-05 08:35:49 -04:00
Alex Shvartzkop
c1e255c4fe Fix unreachable code warnings on non-OSX. 2024-09-05 06:17:16 +03:00
Alex Shvartzkop
36019314e9 Make simulation reporter warnings non-fatal.
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
2024-09-05 05:59:35 +03:00
Jeff Young
94f995c49e Reduce dependency on dynamic_cast.
(Especially where it is no-worky on MacOS.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17245
2024-09-04 17:24:49 +01:00
Marek Roszko
89a3b7baa5 Move some things starting from reporter to kicommon 2024-09-02 21:15:14 -04:00
Alex Shvartzkop
88272a59b7 Fix MSVC build. 2024-08-29 04:57:13 +03:00
Jeff Young
3441861988 Make arrow keys respect grid overrides. 2024-08-28 19:54:23 +01:00
Seth Hillbrand
86c0aec468 Move zone connection filler out of AC
New algorithm to prevent zone fills that are smaller than the minimum
copper width.
2024-08-28 09:04:51 -07:00
John Beard
b043f334de Update font when needed on italic/bold change
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
2024-08-28 13:49:36 +01:00
John Beard
0818ee1770 Pcbnew/FPedit: Add snap anchor type indicators
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.
2024-08-28 13:49:36 +01:00
Mark Roszko
c19aa8170b Revert "Move some things starting from reporter to kicommon"
This reverts commit 3d893254e9
2024-08-28 01:21:40 +00:00
Marek Roszko
3d893254e9 Move some things starting from reporter to kicommon 2024-08-27 20:33:08 -04:00
Jeff Young
b549c4feec Drawing sheet can't share glyph cache entries with editors.
(They use different internal units.)

Also fixes a fialure of CAIRO_GAL to reset the fill
and stroke after drawing outline glyphs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18579
2024-08-22 12:23:21 -06:00
Seth Hillbrand
7214ef1f14 Remove basic masking class map_string_utf8
This is just std::map<std::string, UTF8>, using the class just masks
what it is and adds unclear functions.
2024-08-19 11:51:13 -07:00
Marek Roszko
9eae3330ca Use std::array for rstring and elems 2024-08-18 22:04:00 -04:00
Marek Roszko
b101c1a0c3 Enum class ELEM. 2024-08-18 21:09:37 -04:00
Marek Roszko
58e3c5bb6b Rename Type() to ProjectElementType() for _ELEM children 2024-08-18 20:30:45 -04:00
Seth Hillbrand
b6c1a3ba63 Move SetLayerSet to const reference
Avoids potential performance inefficiencies
2024-08-17 07:56:30 -07:00
Mark Roszko
869a3ee21f Unbind events in KISTATUSBAR destructor 2024-08-16 02:21:37 +00:00
Jeff Young
79ec93da4c Ensure that EDA_PATTERN_MATCH_RELATIONAL is thread-safe.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18548
2024-08-14 15:46:25 -06:00
Seth Hillbrand
a724b3d8b1 Handle DXF files with out of bounds values
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
2024-08-14 13:06:18 -07:00
Kacper Słomiński
e6bcc6d0a6 Fix build issue with experimental GCC version 15.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18539
2024-08-14 07:34:18 -04:00
Tomasz Wlostowski
54e5632a42 multichannel: put MC tool behind an ADVANCED_CFG flag 2024-08-13 22:50:26 +02:00
Tomasz Wlostowski
9963b9dd9f TOOL_INTERACTIVE: only create the context menu when we are running in GUI mode
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().
2024-08-13 22:50:26 +02:00
John Beard
f2d2e953f7 Fix clang warning (need virtual dtor) 2024-08-13 08:36:10 +01:00
JamesJCode
19d5d21f23 Move netclass highlighting style to application-level setting
Also includes bugfix whereby wires, junctions, and bus entries
were not subject to override of local colors.
2024-08-12 23:52:01 +01:00
JamesJCode
ea482e8d15 Revert NET_SETTING schema increment 2024-08-12 22:40:12 +01:00
JamesJCode
6371b15aa4 Implement highlighting style for netclass colors 2024-08-12 21:39:07 +01:00
Jon Evans
4332618e68 Fix uninitialized member 2024-08-12 08:27:24 -04:00
Jeff Young
f89ba38b66 ADDED: importing text vars from Schematic Setup.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18465
2024-08-11 19:33:15 -06:00
Jon Evans
bd946313dc ADDED: Position items relative to arbitrary reference point
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4756
2024-08-11 18:59:26 -04:00
Jeff Young
5ad8f0e387 Better OnModify() handling for Symbol Fields Table. 2024-08-11 12:45:36 -06:00
Seth Hillbrand
094d265313 Re-enable grid snap line
This was accidentally disabled by 4039b7da6b
2024-08-08 14:29:27 -07:00
John Beard
d933ed964e Move LAYER_PRESENTATION to widgets/
Since this is code used by widgets for UI presentation purposes.

Also saves some unnexessary includes in headers.
2024-08-07 06:49:53 +08:00
John Beard
0c3ac40bb6 LAYER_PAIR doesn't need a comparison
This upsets the Windows build and isn't needed as there's no
container used that needs the operator.
2024-08-07 06:13:24 +08:00
John Beard
c989a7ba83 Don't use layer pair in common code 2024-08-07 05:42:18 +08:00
Wayne Stambaugh
d75c3d5791 Fix a build error on Linux.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18503
2024-08-06 16:20:40 -04:00
John Beard
edf13bdfd0 Add a layer pair preset list
This will later be used for a quick switcher UI. This commit
adds the data structures, set-up UI and project file persistance.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/15227
2024-08-06 23:45:55 +08:00
John Beard
db457f52fa Move layer presentation logic to a separate class
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
2024-08-06 23:45:55 +08:00
John Beard
15924958d9 Add wxGrid autosizer helper
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).
2024-08-06 23:45:55 +08:00
Alex Shvartzkop
377b9aa859 Fix warning: 'const' qualifier on return type has no effect. 2024-07-28 03:34:17 +03:00
James J
7ce00e511b Multi-netclass support 2024-07-26 20:49:29 +00:00
Seth Hillbrand
433677fc21 Replace std::lexicographical_compare_three_way
On platforms that don't yet support the std:: version, we implement our
own, possibly slower, version of the 3-way compare
2024-07-24 18:03:29 +02:00
Jeff Young
431087fc7c Don't deadlock when adding rows. 2024-07-23 17:49:34 +01:00
Jeff Young
0f099ac65e Use lock when clearing and loading libTables.
Also make sure it's re-indexed after loading.
2024-07-23 09:53:01 +00:00
Alex Shvartzkop
e2bd76bdce Fix OOB access in LSET when opening a PCB file or updating from schematic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18422
2024-07-23 01:41:01 +03:00
Jon Evans
5120a3bd82 Fix incorrect lambda capture 2024-07-21 17:29:24 -04:00
Seth Hillbrand
a13df1ec28 Fix broken rebase 2024-07-17 15:20:29 -07:00
Seth Hillbrand
6182069c0c Fix shadowing 2024-07-17 15:19:32 -07:00
Jon Evans
c66f862a39 Quiet a warning 2024-07-17 18:17:17 -04:00
Alex Shvartzkop
17f44c0dc1 Fix some warnings and improve memory layout. 2024-07-17 23:20:32 +03:00
Seth Hillbrand
d0292c39fc Fixes for MSVC 2024-07-17 11:41:13 -07:00
Seth Hillbrand
7ecde84a94 Move LSET to new BASE_SET class
Next step in large layer refactoring.  Added multiple unit tests as well
to check behavior
2024-07-17 10:32:09 -07:00
Mark Roszko
5f63e1dec5 Fix build error on windows 2024-07-17 11:50:41 +00:00
Seth Hillbrand
535ed165a6 Add BASE_SET class 2024-07-16 17:52:32 -07:00
Seth Hillbrand
c093fe1355 Simplify LSEQ
Remove unneeded operators and index
2024-07-16 14:48:33 -07:00
Marek Roszko
c16d078b8c Fix conflict with windows header define thats leaking in
GetTempFileName is a windows header define unforunately and the big boi header is leaking in somehow
2024-07-15 20:22:33 -04:00
Seth Hillbrand
77797103f7 Add ability to embed files in various elements
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
2024-07-15 16:06:55 -07:00
Alex Shvartzkop
77eb197a21 Fix build on GCC 14.1.1. 2024-07-15 13:38:34 +03:00
jean-pierre charras
3bacfacf95 Ensure non handled text properties are never written in .kicad_pcb files
ctl_flags.h: fix two duplicate flag values.
2024-07-14 20:45:40 +02:00
jean-pierre charras
a075a80b3c Move all CTL_OMIT_xxx flags definitions into a new file ctl_flags.h
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.
2024-07-14 18:10:37 +02:00
Seth Hillbrand
ffe496abf3 Cleanup for Project Backup
Do conservative check for time offset before making the expensive
backup.  Don't clear and re-check the file list for a single file change
2024-07-11 10:48:13 -07:00
Harry Best
cc5fb60d93 CHANGED: Backup project only when different
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
2024-07-11 10:48:13 -07:00
Seth Hillbrand
845130ba9e ADDED: pcbnew fill avoids kissing fills
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
2024-07-10 18:34:41 -07:00
Seth Hillbrand
e8f3545423 Update max recursiondepth default per @jeffyoung 2024-07-10 08:29:15 -07:00
aris-kimi
6969b9d64f Open library file preselected in the file explorer for both symbol and footprint editors. 2024-07-10 06:14:04 +00:00
Seth Hillbrand
e0453d9bcc Further cleanup of LSET
Remove duplicative functions.  Standardize on C++ stdlib formatting
2024-07-08 22:00:53 -07:00
Seth Hillbrand
cc850d0da0 Split out LSEQ/LSET from LAYER_ID
Separate the layer grouping classes for easier modification
2024-07-08 20:59:46 -07:00
Seth Hillbrand
293075426b Clean up some LSEQ functions
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
2024-07-08 20:59:46 -07:00
Jeff Young
02a08bf9b1 ADDED: RMB > Copy item for HTML_WINDOW.
(Used at least in Footprint and Symbol Chooser details
panes.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17904
2024-07-08 20:55:08 +01:00
Seth Hillbrand
c0bf866c58 Speed up shutdown
When shutting down, we shouldn't need to do a lot of things like
resyncing the PNS world multiple times that can really slow down the
process
2024-07-05 11:16:20 -07:00
Alex Shvartzkop
0a53fc41a7 Shut down curl operations before global cleanup.
Fixes KICAD-7DP
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17103
2024-07-04 22:33:59 +03:00
Jeff Young
9d03a92738 Get rid of C++20 compiler warnings. 2024-07-03 13:32:44 +01:00
Jeff Young
aa5a370b3a ADDED: user layer types.
This allows a user to define user layers to be front
or back (and therefore to flip with the board view).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8455
2024-07-03 13:32:44 +01:00