244 Commits

Author SHA1 Message Date
Bernhard Kirchen e3f049f4d9 ADDED: expand VARIANT and VARIANT_DESC in drawing sheets
* add VARIANT and VARIANT_DESC to the list of known vars in the drawing
  sheet editor.
* cache variant and variant description in respective objects.
* expand the respective text variables when building the drawing sheet.
* keep the cached variant and its description up-to-date when selecting
  a variant in the GUI.
* pass variant and its description to the plotters.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23430
2026-03-17 15:39:34 +00:00
Jon Evans e468788aa8 Fix up kicad-cli DRC project and library handling
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23379
2026-03-09 20:42:29 -04:00
Seth Hillbrand 1cf4284930 IPC-2581: use schematic revision for BOM
The BOM revision in IPC-2581 export was hardcoded to "1.0"
instead of reflecting the actual design revision.

The project file stores two separate fields: bomRev for
explicit user overrides set in the PCBnew export dialog or
via --bom-rev on the CLI, and schRevision for the value
auto-propagated from eeschema.
2026-03-06 09:13:56 -08:00
John Beard c4c19018c3 Pcbnew: Restrict includes of pad.h/footprint.h
There are some headers which don't need to include pad.h (which brings
padstack.h) - they just need forward defines.

While pad.h is not an especially heavy include on the scale of things,
footprint is quite heavy. And both reduce inclusion load and
reduce the number of files needlessly sensitive to changes in headers.
2026-03-05 02:18:34 +08:00
Seth Hillbrand ea87a99c9e Remove partial layer map from PCB import
The --layer-map and --auto-map CLI arguments were mistakenly committed
in a rebase.  This will be a v11 feature, so remove the flags for v10.
2026-03-04 09:32:35 -08:00
John Beard 113746dc81 Pcbnew: move PCB_TRACK types to a lightweight header
This lightens the load when including forwards for PCB_TRACK and
friends as we don't need all the transitive includes. Sometimes
you just need the enums - many users just wanted VIATYPE, or
just needed a forward.

And reduces transitive code churn when something is changed in the
header - this reduces the files affected by a change in
pcb_track.h from nearly 400 to under 200.
2026-03-04 23:28:31 +08:00
Seth Hillbrand 37cbfbdaaa Fix build warnings
So. many. build warnings. :)  Ran multiple times with clang and gcc to
try to get them all
2026-03-02 13:28:48 -08:00
Jeff Young 50bd5d1a21 Don't account for non-physical layers when generating board outline.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23115
2026-02-27 19:01:11 +00:00
Seth Hillbrand a4ea1f70e4 Fix GenCAD export crash when run from jobset
JobExportGencad() called LoadBoard() directly with m_filename, which is
empty when the job is dispatched from a jobset in the GUI. All other
export job handlers use getBoard(), which knows how to obtain the board
from the PCB editor frame in GUI mode, from the project in CLI mode, or
from a direct path.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23227
2026-02-23 20:28:51 -08:00
Seth Hillbrand 93760c58f8 Add --variant support to all PCB export commands
The variant system correctly affected 3D visualization but all CLI
export paths (STEP, SVG, PDF, DXF, PS, Gerber, IPC-2581, ODB++) lost
the in-memory variant state because kicad-cli loads the board fresh
from disk.

Add m_variant field to JOB_EXPORT_PCB_3D, JOB_EXPORT_PCB_IPC2581, and
JOB_EXPORT_PCB_ODB. Add --variant CLI argument to all PCB plot, 3D,
IPC-2581, and ODB++ export commands. Each job handler now calls
SetCurrentVariant() on the board after loading, so variant-aware DNP
and BOM filtering works correctly during export.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23159
2026-02-20 16:41:50 -08:00
Wayne Stambaugh 94a40495c9 Overwrite output file when exporting ODB++ from the command line.
Remove the existing file check when exporting ODB++ from the command line.
It is still retained when exporting ODB++ using the dialog.

This also adds additional command line status information when exporting
from the command line using a CLI_REPORTER object.  If any errors occur
exporting they are written to 'stderr' and the job handler returns an
unknown error code instead of always returning a successful export.

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

(cherry picked from commit a88edddef3)
2026-02-18 19:12:12 -05:00
Seth Hillbrand 6c9c75eb07 Remove property.h and property_mgr.h from inspectable.h
This breaks the view_item.h -> inspectable.h -> property.h chain that
pulled wx/propgrid/property.h into 150-200 TUs. The lean inspectable.h
now includes only wx/any.h, wx/string.h, wx/variant.h.

Headers using DECLARE_ENUM_TO_WXANY (board_item.h, sch_item.h) retain
their property.h include since the macro requires it.
2026-02-13 19:54:46 -08:00
Seth Hillbrand c52ab91c84 Reduce compile times by extracting headers
Break the most expensive header include chains that contaminate the
largest number of translation units

New lightweight headers for extractdded types:
font_metrics.h, mouse_drag_action.h, board_project_settings_params.h,
common_settings_internals.h, wx_infobar_message_type.h,
zone_layer_properties_grid.h
2026-02-13 17:10:45 -08:00
Seth Hillbrand 0e7a052af0 PADS: add ASCII format importer for PCB and schematic files
Add complete import support for PADS ASCII (.asc) files, covering both
PCB layouts and schematics. The importer handles board outlines, copper
pours, routing with via inference, footprint decals, net assignment,
design rules, and component placement for PCB files. For schematics, it
supports symbol building from CAEDECAL definitions, multi-gate and
multi-variant parts, power symbols, wire routing, net labeling, arc
graphics, title blocks, and hierarchical sheet connectivity.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19944
2026-02-10 21:21:22 -08:00
Seth Hillbrand 0dc4c5d08b Fix render jobs not honoring layer presets
When executing render jobs from jobsets, the code stored the preset name
in m_CurrentPreset but never actually applied the preset's layer visibility
settings and colors. This caused renders to use whatever settings were in
the user's 3D viewer config instead of the specified preset.

Add code to look up the preset and apply its settings using SetVisibleLayers()
and SetLayerColors(), matching the behavior of the 3D viewer GUI.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21887
2026-02-05 09:13:16 -08:00
Seth Hillbrand 866ccacbe5 Apply cloud sync buffer fix to all zip archive outputs
Move CLOUD_SYNC_BUFFER_SIZE constant to kiplatform/io.h header so it
can be shared across all archive output locations. Apply the setvbuf
fix to additional locations that create zip archives.

This is a follow-up to 904b560668 which only fixed project_archiver.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21356
2026-02-01 06:55:13 -08:00
Seth Hillbrand 1e5e83876e Fix zone fills not applying during jobset Gerber generation
When running export jobs (Gerbers, SVG, DXF, PDF, PS), CheckAllZones()
was used to fill zones before plotting. However, CheckAllZones() has
an early-return check for m_ZoneFillsDirty which is not set in jobset
context, causing zones to remain unfilled.

Changed all job export handlers to use FillAllZones() with headless
mode enabled instead, following the pattern already used by the DRC
job handler. Modified the dialog text in jobset to reflect the action
rather than a check that cannot be acted on

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21937
2026-01-07 05:38:45 -08:00
Seth Hillbrand 6bad3c58e1 Added: PCB Variant support
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2131
2026-01-05 17:47:39 -08:00
Seth Hillbrand 6bb02dc9fb Enable file naming for single-page pdf
If we are only outputting a single document, the job file should allow
naming the pdf

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20903
2026-01-01 10:56:52 -08:00
Jeff Young c4b72c386a Formatting. 2025-12-15 16:38:43 +00:00
Mark Roszko 2008754ad8 Remove the loner uppercase E in the filename 2025-12-04 20:13:01 -05:00
Mark Roszko 4973bd9912 Add --generate-report for drill report 2025-12-04 00:02:10 -05:00
Jon Evans baa29c1a58 Port footprint library table to new system 2025-11-04 06:54:53 -05:00
Jon Evans 6baf5e798e Reduce use of pointers for properties maps 2025-10-15 22:18:50 -04:00
Mike Williams 8ebd1e02ae jobsets: make variables like ${REVISION} available in jobs consistently
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20242
2025-10-14 14:05:03 -04:00
Mike Williams f827982cad jobs: add pcb export stats command 2025-10-13 10:05:13 -04:00
Jeff Young 814f65934f Improvements to DRC marker clearance paths.
Reverts most of the fix for 9778. Highlighting
multiple markers creates confusion in both the
status bar and how the associated clearance paths
are shown.

Also adds more clearance path graphics to make
the need for a fix to 9778 somewhat less acute.

Also makes clearance graphics scale with marker.
2025-10-10 21:38:46 +01:00
Seth Hillbrand 83b3db4504 Added: Flag to exclude from pos files BOM exclusions
Footprints marked exclude from BOM are optionally excluded from the
footprint position file output

Fixes https://gitlab.com/kicad/code/kicad/issues/21874
2025-10-04 03:42:58 -07:00
Jeff Young ac775e716f Simplify annotation graphics for DRC markers.
Also includes some performance tweaks, mostly around
not copying large structures.
2025-09-19 20:06:39 +01:00
Marek Roszko ad7bdf5b87 ADDED: 3D PDF Export
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/4439
2025-09-17 22:45:35 -04:00
Jeff Young 425b77b34c wxString::both goes with Strip(), not Trim().
But Strip() is deprecated, so we shouldn't use it
(or wxString::leading/trailing/both) at all.
2025-09-16 17:51:11 +01:00
Jeff Young 87739c8ac7 wxStringTokenizer usage cleanup.
1) Always be explicit about what the delimiters are
2) If space is a delimiter, we probably want to skip
empty fields (wxTOKEN_STRTOK)
3) If space is not a delimiter, we often need to
trim the resultant tokens
4) Be more lenient about \t\r\n (and when they are
included, include them in the same order)
2025-09-16 13:03:02 +01:00
Adam Wysocki 814f78f2b2 ADDED: Add pcb/sch upgrade cli command 2025-08-30 20:57:41 +00:00
Mark Roszko 3e019ee4ae pcb plots dont need LOCALE_IO anymore 2025-08-27 20:44:16 -04:00
dsa-t 83427c38aa Revert "Use board stackup colors by default in 3D render job."
This reverts commit d2f852504a
2025-08-23 00:09:42 +03:00
dsa-t d2f852504a Use board stackup colors by default in 3D render job.
(cherry picked from commit f7380ae015)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-22 13:36:08 +03:00
Jeff Young 44bd29d592 More removal of open-coded dialog state saving. 2025-08-10 15:57:20 +01:00
Jeff Young b2ecaf1ddc Don't set m_IsPreviewer to force 3D models.
It has unintended side-effects (such as showing
user drawings and user comments layers).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21428
2025-08-06 11:21:55 +01:00
Jeff Young 2e629ca55c ADDED: follow-pcb and follow-plot-settings to render job settings.
Also added Follow-board-stackup-colors to both
render job settings and render CLI arguments

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21341
2025-08-05 18:01:50 +01:00
Mark Roszko 275bbf1aef Add missing copy pasta for ps jobs handler 2025-07-31 21:35:42 -04:00
Mark Roszko 4b70e20250 Add support for check zones before plot to plot jobsets 2025-07-30 20:49:07 -04:00
Mark Roszko b0b07bbc41 Add option to save the pcb during drc cli (but with refill-zones required in parallel) 2025-07-29 21:12:31 -04:00
Mark Roszko dc6e0223c7 Add cli option for zone refill before drc
Note: Does not save yet
2025-07-24 20:40:45 -04:00
Seth Hillbrand 094870e7a4 String fixes
- Clarify wording in a couple places
- Fix missing 'not' and remove non-standard dashes
- Standardize on single-quote for strings in strings
2025-07-23 17:36:51 -07:00
Jeff Young c758a2fbaf Don't sequence layers when order doesn't matter. 2025-07-14 19:12:44 +01:00
Jeff Young fa9a588683 Respect "exclude DNP" setting for Gerber X3.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21201
2025-07-02 14:18:50 -06:00
Jeff Young b8eda55b24 Search user layer names first.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20922
2025-06-30 17:41:37 -06:00
Jeff Young 0464cc18b1 Progress reporting for Run Jobs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19629
2025-06-28 16:23:34 -06:00
Andrea Greco 8eff58a6dc PCB: Add option to cli and graphics to export stpz 2025-06-27 22:41:58 +01:00
Jeff Young b6a47fb546 Nullptr safety. 2025-06-23 10:32:43 -06:00