508 Commits

Author SHA1 Message Date
John Beard 6c5b1bbc8b Pcbnew: Allow to skip layer mapping using advanced config
Clicking Automap/OK was fun for a bit.
2026-03-04 23:28:31 +08:00
Seth Hillbrand 4aca084ab0 Remove heavy includes from board.h and footprint.h PCH chain
Remove component_class_manager.h and pcb_selection.h from board.h

Remove collectors.h and component_class_manager.h from footprint.h
2026-02-13 19:54:46 -08:00
Seth Hillbrand b03f1cf4a5 Allegro import: use mmap for file I/O
Add a MAPPED_FILE class to kiplatform that wraps mmap on POSIX
and MapViewOfFile on Windows, with a heap-buffer fallback. The
shared readIntoBuffer implementation lives in os/common/io.cpp
to avoid duplication across the three platform files.

Replace the istream-based FILE_STREAM in the Allegro importer
with a buffer-cursor reader over the mapped data. This removes
per-read virtual dispatch and buffering overhead.

Add overflow-safe bounds checking to Seek, Skip, ReadBytes,
ReadString, and ReadStringFixed. Guard against zero-length
files before mmap calls to avoid POSIX undefined behavior.
Wrap the MAPPED_FILE construction in try/catch so that
std::runtime_error is converted to IO_ERROR for callers.

Add a segment chain cache to BOARD_BUILDER matching the
existing outline cache pattern, returning const references
to avoid copies on repeated lookups.

Remove inner-loop PROF_TIMERs that added measurable overhead
on large boards and keep only the outer timing for zone fill
processing stages.
2026-02-13 10:39:55 -08:00
Seth Hillbrand e12751da40 Eeschema: Add gEDA/Lepton EDA importer
Add a schematic importer for gEDA and Lepton EDA .sch files.
The importer parses the full gEDA file format including
components, nets, buses, attributes, text, graphical
primitives, and paths with bezier curves.

A builtin symbol library ships 39 standard gEDA symbols so
import works without a gEDA installation. Symbol resolution
follows an 11-step search chain matching native gEDA/Lepton
conventions across environment variables, system paths, XDG
directories, RC files, config files, and project directories.
Last-found-wins priority matches native gEDA behavior.

RC file parsing handles gafrc and gschemrc component-library
directives. Lepton-EDA INI configs (lepton.conf, geda.conf)
are also parsed.

Project import reads gEDA .prj files and discovers schematics
and PCBs automatically.

File format knowledge and embedded symbol definitions derived
from gEDA/gaf (C) 1998-2010 Ales Hvezda, 1998-2016 gEDA
Contributors, and Lepton EDA (C) 2017-2024 Lepton EDA
Contributors. Both licensed under GNU GPL v2 or later.
2026-02-11 11:20:41 -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 8eb3f3c618 Enable GVFS/network filesystem visibility in file dialogs
On GTK, wxFileDialog defaults to local_only mode which hides GVFS-mounted
filesystems like Google Drive, SMB shares, and external drives mounted
through GVFS. This adds a platform-specific function that disables
local_only mode to show these network/virtual filesystems.

Apply AllowNetworkFileSystems to all file dialogs across KiCad
to ensure directories on network filesystems are visible when
browsing for files.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14372
2026-01-29 12:43:20 -08:00
Seth Hillbrand 764cfdd3ba Remove fp-info-cache and simplify footprint library loading
Tree adapters now call GetFootprints() directly instead of going through
GFootprintList and its cache file. FOOTPRINT implements LIB_TREE_ITEM so
footprint objects work directly in library tree displays similar to
LIB_SYMBOL.

Removed cache read/write calls from files.cpp, footprint_edit_frame.cpp,
and pcb_base_edit_frame.cpp. The footprint chooser uses AsyncLoad() and
BlockUntilLoaded() to ensure libraries are ready before building trees.

GFootprintList still exists for cvpcb and eeschema cross-module access
via KIWAY, but no longer reads or writes cache files.
2026-01-23 08:44:31 -08:00
Seth Hillbrand beaeefc445 Fix file lock dialog behavior when opening projects
Previously, clicking Cancel on the "File is already open" dialog did
not prevent the project from opening because the lock check happened
in ProjectChanged() after the project was already loaded.

This change moves the lock check to LoadProject() before any loading
occurs, so Cancel actually aborts the operation.

Additionally, when user clicks "Open Anyway" at the project level, the
decision is now propagated to child editors (eeschema, pcbnew) via a
new IsLockOverrideGranted() flag on the PROJECT class. This prevents
showing redundant lock dialogs for individual schematic and PCB files
when the user has already made their decision at the project level.
2026-01-19 16:59:19 -08:00
Sven Pauli 75887af324 Ask to remove non existing file from history. 2026-01-07 10:49:52 +00:00
Seth Hillbrand d2013cba95 Clear hidden file attribute on Windows before saving
On Windows, files with the hidden attribute cannot be overwritten using
standard file I/O operations. This can cause save failures when files
have been synced via cloud services like OneDrive, which may set the
hidden attribute on files.

This commit extends KIPLATFORM::IO::MakeWriteable() to also clear the
hidden attribute on Windows, and adds calls to this function before
saving schematic and board files.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14956
2026-01-06 13:26:35 -08:00
Seth Hillbrand 9b9899979b Stop showing popup for library load errors
Errors are stored to a vector for display after clicking the warning
icon in the toolbar.
2025-12-31 13:15:06 -08:00
Seth Hillbrand 88a2864441 Move font warnings to infobar
Added a new warning icon when loads have warnings like font
substitutions.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17358
2025-12-29 16:19:11 -08:00
Seth Hillbrand 3770bc9f35 Fixup some local snapshot issues
- Added README.txt
- Cleared up destruction oop
- Clarified actions when restoring after accidental crash

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22586
2025-12-29 15:10:20 -08:00
Mark Roszko 6da131bdb0 Retire StrPrintf entirely, {fmt} is better than c-isms. 2025-12-04 23:23:38 -05:00
Seth Hillbrand 9e6ffe642a Properly clear savers when changing projects
Hook into the ProjectChanged() routine to handle all switches.  The main
routine clears the savers before re-registering new savers for the
schematic, pcb and project

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22221
2025-11-04 16:50:01 -08:00
Jon Evans baa29c1a58 Port footprint library table to new system 2025-11-04 06:54:53 -05:00
Seth Hillbrand a3acf25262 Rework local history for safer backup
- Prompt before removing any files
- Check directory for additional files
2025-10-27 18:11:17 -07:00
Seth Hillbrand 8257870ac3 ADDED: Local History
Local history combines project backup and autosave into a single place
where arbitrary history can be stored efficiently and restored to any
point in time.  Git commits are made on a debouce timer to hold
modifications, allowing the user to step backwards in time to arbitrary
points.  Restoring backups does not remove the existing files and
choosing to restore an autosave point does not remove the state of the
files prior to the restore, providing additional safety.

Keeps the maximum storage size limit but removes the additional
limitations of number of backups/backups per day, etc as these are not
relevant to a CoW-based backup as unchanged files do not take up
additional space.
2025-10-23 15:36:07 -07:00
JamesJCode b7ce289e4e ADDED: PCB Tuning Profiles
Tuning profiles build on the previous delay tuning work to allow
the definition of track geometries per-layer for a given tuning
profile. These can be calculated from a target impedance (with
all relevant geometry taken from the board stackup), or entered
manually.

Tuning profiles can be configured to enable time-domain tuning,
and to automatically generate track geometry DRC rules for net
classes which have an assigned tuning profile.

Adds a DRC check for net classes with a tuning profile assigned
which is not itself defined.
2025-10-15 18:58:12 +01:00
Seth Hillbrand d0f1920ab6 Adjust the project name when importing
Ensures that the proper project is referenced after saving imported
project

Fixes https://gitlab.com/kicad/code/kicad/issues/13986
2025-09-21 14:53:30 -07:00
Jeff Young 03c230dd64 Read legacy tokens before current tokens.
(So current can overwrite.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21525
2025-08-22 16:33:31 +01:00
Seth Hillbrand 44228bd580 Move IPC2581 output to REPORTER
Adds a wx_reporter_panel to the 2581 output window, shunt messages
through the reporter instance

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16314
2025-08-20 13:42:19 -07:00
Seth Hillbrand 9f2b04c7e2 Prevent autosave error from cluttering the screen
Once per session, per editor we can show the error.  After that, assume
that the designer has seen and knows about the issue.

Fixes https://gitlab.com/kicad/code/kicad/issues/21464
2025-08-16 13:49:32 -07:00
Jeff Young 55a36c1ce7 CHANGED: retire the select-lib-table dialogs.
We now allow the user to specify which in the
New Library dialog.

Also retires the "Export power symbols too" dialog.

Also gives a bunch of file and library dialogs
more explicit titles.

Also removes separate code-paths for Export to
Library and Export to New Library.  The regular
code path has a "New Library..." button now.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16323
2025-07-20 19:06:40 +01:00
Seth Hillbrand f6b599e155 Remove temporary file saving step
We implemented the intermediate temporary file in order to avoid issues
during save.  Unfortunately, this is heavily system-dependent and seems
to cause problems with unusual setups.  Now that we cache writing using
the prettifier, the errors during output will not affect the existing
file

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21330
2025-07-16 09:20:33 -07:00
Jeff Young caf6e23064 Fix m_importProperties not getting nulled (KICAD-6BJ). 2025-07-14 13:17:53 +01:00
Jeff Young a7e2878e6b Kicad SEXPR should no longer need LOCALE_IO. 2025-07-14 13:17:53 +01:00
Jeff Young 68d4940087 Thread-safety (potentially KICAD-VMX...)
... KICAD-6PV, KICAD-82, KICAD-R3A, and others.
2025-07-13 15:25:10 +01:00
Alex Shvartzkop 4a5039c2cf Remove some unused variables. 2025-07-02 16:48:26 +03:00
Christopher Alexander f4b1a15cd8 fix for issue 17429 - fixes DRC unconnected items exclusion instability 2025-06-25 17:03:35 +00:00
Mark Roszko 1922cab5f4 Kill the near-global spread of length_delay_calculation.h 2025-06-14 13:32:18 -04:00
Jeff Young 06dcb64ad8 Harden progress reporter API against misuse.
Also, titles are nouns, not verbs.  (Messages
*inside* reporters are verbs.)

Also implements progress reporter for Altium
schematic import.
2025-06-01 19:38:24 +01:00
Jeff Young e03cb736f2 Move board functions to BOARD_EDITOR_CONTROL. 2025-05-24 18:30:30 +01:00
Jeff Young 4bb54b3439 Move more stuff to ACTIONs framework. 2025-05-23 15:19:49 +01:00
JamesJCode 8229d2e915 Remove delay profile cache check only used on board load 2025-04-19 00:54:22 +01:00
Jeff Young 0659290417 Simplify hatch damage/rebuild and move it out of view.
There should be far fewer hatched objects than other
objects, so we're spending too much effort finding
all the possible damage when we probably should
just be auto-regenerating all the hatching.

This also moves it out of being done during redraw,
which was proving problematic.  Plus the refill
zones architecture does it during commit, and has
a lot more miles behind it.
2025-04-07 11:46:02 +01:00
Mike Williams e11cf94a3e design blocks: add PCB design blocks behind advanced config
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2508
2025-03-20 15:13:52 -04:00
JamesJCode ede5faee72 Implement dynamic assignment of component classes 2025-03-15 14:33:47 +00:00
jean-pierre charras eaa1e6d594 Fix a collision with a Windows define and our use of the same var name.
We use IN for INCH as units, but IN is defined in a Windows header
2025-03-02 11:34:30 +01:00
Jeff Young f951497a4f Code brevity. 2025-03-01 21:58:31 +00:00
Seth Hillbrand e81956f292 Import Altium Projects
Handle Altium project file format

Parse individual schematic files and layout files
Create top-level schematic file
Link imported UUIDs between schematic symbol and footprints based on
refdes
Create KiCad project
Map Altium layout layers between KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2117
2025-02-27 14:36:24 -08:00
Jeff Young 40daacbeeb IPC-2581 has a hyphen in it.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19770
2025-02-19 23:43:52 +00:00
Alex Shvartzkop 0594a43cfa Let wx auto-close streams in compressed IPC-2581 export.
Removing the temp file was not possible if it's still open.
2025-02-16 18:32:19 +00:00
jean-pierre charras ea1498b39b GenIPC2581File(): close a temporary file before trying to delete it. 2025-02-16 10:43:34 +01:00
Marek Roszko 5c3004b96e Avoid altering the configured output path during run in case of empty paths 2025-01-14 20:44:51 -05:00
Seth Hillbrand 452e69de85 Move thread pool into true singleton
Thread pool needs to be stored in a single location for all of KiCad
otherwise each kiface will spin up its own pool of persistent threads
2025-01-09 09:03:08 -08:00
Jon Evans a557c23576 API: Add board file management
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16774
2025-01-04 09:47:36 -05:00
Seth Hillbrand 074e6df3bc Revert "Move thread pool to singleton class"
This reverts commit 361f61a023.
2025-01-03 21:22:44 -08:00
Seth Hillbrand 361f61a023 Move thread pool to singleton class
Having thread pool as its own singleton in the library meant that each
kiface had its own threadpool, leading to many multiples of the threads
being started.  Placing a singleton class in PGM_BASE ensures that all
kifaces use the same thread pool.

The singleton class can be extended to provide single instance
guarantee for any element across kifaces
2025-01-03 13:51:11 -08:00
Seth Hillbrand 0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00