Commit Graph

265 Commits

Author SHA1 Message Date
Mark Roszko 314735e2fc Move message dialogs to KICAD_MESSAGE_DIALOG define
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22830
2026-01-25 12:42:13 -05:00
Seth Hillbrand 4a1d989707 Move TimestampDir to kiplatform with platform-specific implementations
Windows uses NtQueryDirectoryFile with a 64KB buffer to reduce kernel
transitions. This approach comes from git-for-windows and retrieves
multiple directory entries per syscall. The implementation handles
both local paths and UNC paths by converting them to the appropriate
\\?\ prefix format.

Unix and Apple use the same opendir with fnmatch as before.
2026-01-23 16:02:30 -08:00
Seth Hillbrand f649c2bf43 Speed up TimestampDir on Windows
Use FindFirstFileEx with FindExInfoBasic to skip 8.3 filename queries.
FIND_FIRST_EX_LARGE_FETCH uses a 64KB buffer instead of 4KB, reducing
kernel transitions when enumerating directories.

Use FILETIME directly with a bit shift instead of converting through
wxDateTime, which required construction, division, and method calls
per file.
2026-01-23 15:20:52 -08:00
Seth Hillbrand 83a27d261a Fully handle escaping text var controls
Things like ${#} \@{${#} ${#}} should get expanded to 1 @{1 1}

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22497
2026-01-02 11:22:22 -08:00
Magnus Lundmark fc74604534 do not segfault on identical UUIDs 2025-12-04 13:12:24 +00:00
Magnus Lundmark 8ebf7367bf simplify escape handling 2025-12-04 13:12:24 +00:00
Magnus Lundmark 09ca9d4728 meta cells still not 100% working 2025-12-04 13:12:24 +00:00
Magnus Lundmark fd260e2268 remove debug, tests pass 2025-12-04 13:12:24 +00:00
Magnus Lundmark 2bf3cfb1ed almost working, just need to not evaluate to uuid in escaped expressions 2025-12-04 13:12:24 +00:00
Magnus Lundmark a0ec1a667d WIP: Multi-unit text variable expansion (not working - parsing issues) 2025-12-04 13:12:24 +00:00
Magnus Lundmark cdc1c417ff added table export, try to fix escaped expression uuid bug 2025-12-04 13:12:24 +00:00
Magnus Lundmark 26531bb25d Add text variable functions and recursive expansion for tables 2025-12-04 13:12:24 +00:00
Jeff Young 1e3e21dc48 More code sharing for library tables. 2025-11-07 18:26:43 +00:00
Jeff Young 2d0c70a6b9 Add parent footprint description to auto-generated keepout area rule names.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22159
2025-10-31 13:22:50 +00:00
Jeff Young 1b21b880e6 Thread safety. 2025-07-14 13:17:53 +01:00
Jeff Young 82d4ab5094 Don't assume a string (KICAD-8QP). 2025-07-04 13:20:41 -06:00
Michal Suchanek ca54db2db4 windows: Fix build on case sensitive filesystem 2025-05-11 15:50:10 +00:00
Jeff Young 8113824f7c Don't conflate generated fields (${DNP}) and fields with variable references.
They're not quite the same thing as the later
can have un-applied values which require expanding.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20417
2025-04-18 13:41:18 -07:00
Wayne Stambaugh 5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -05: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
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
Troy Denton 0ed48b43f8 common: fix KICADn_3RD_PARTY version expansion
Adding logic to handle KICADn_3RD_PARTY expansion, preventing
backwards-compatible libraries from incorrectly report missing
files

Fixes https://gitlab.com/kicad/code/kicad/issues/17600
2024-10-27 23:37:29 +00: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
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
Jeff Young 7f6ab7043b Clean up more exception processing in simulation GUI.
This allows us to more correctly report errors without
dialog issues, logs popping up, etc.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18259
2024-07-03 13:32:44 +01:00
Jeff Young 9e6884f656 ADDED: support for ERC & DRC errors and warnings in text variables.
Also fixes some bugs in storing exclusions in
symbol fields and children.

Also fixes some bugs in checking for resolved text
variables in symbol children.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18279
2024-06-28 22:10:22 +01:00
Jon Evans 944a3d7962 Transparently support old versioned env vars for symbol and footprint libs 2024-02-15 15:31:08 +00:00
Mike Williams 25e391719e Fields Table: convert special strings like Quantity to named variables
Before, we did not actually prevent users from adding a field also named
Quantity to their symbols. This of course does not play nicely with the
assumptions that Quantity is a special column in the fields editor.

By making it a named variable, the user can safely add it to a symbol
and it will not be editable, and will also work in the fields table
editor as expected.
2023-08-01 10:55:32 -04:00
Mike Williams e2f47ecabb Common: add GetTextVars for unexpanded variable names 2023-07-12 12:16:14 -04:00
Jeff Young c4ef08bead Exercise more caution with user filenames.
In particular, don't assume "1" is an extension in "Schematic_1.1".

Fixes https://gitlab.com/kicad/code/kicad/issues/14263
2023-03-12 15:52:45 +00:00
Seth Hillbrand 3465fe3e50 Allow variable recursion
Simple recursion of variable expansion allows for multiple use cases in
portability of designs.  This also includes basic prevention of
recursion loops

Fixes https://gitlab.com/kicad/code/kicad/issues/10398
2023-01-20 16:44:48 -08:00
Seth Hillbrand d8ac53d7b4 Fix 3D model resolution for older boards
Older boards use older 3d model environmental variables.  We need to
support both older environmental variables (if the user has them) as
well as updated environmental variables (if the user only has a single
3d model path)

This updated the environmental resolver to look first in the named
location and then substitute the new location if the old location is not
defined in the environment

Fixes https://gitlab.com/kicad/code/kicad/issues/10674
2023-01-20 15:59:23 -08:00
Jeff Young 26c821962f Simplify and regularize text variable substitution architecture.
EDA_ITEMs are responsible for giving their parent a crack at it if
they failed to resolve it.  This recurses all the way up to the schematic/
board, and then to the project.

Cross-reference handling is also move to the EDA_ITEMs.  It must be done
before bubbling up so that we don't end up in loops.  (The aDepth parameter
will break the loop, but without having done anything useful.)

Fixes https://gitlab.com/kicad/code/kicad/issues/13541
2023-01-17 17:05:41 +00:00
Jeff Young b15913bd53 Support env variables in spice library paths.
Also removes a bunch of std::string stuff from the file handling in the
simulator.  All our file handling, env variable expansion, project path,
etc. stuff is wxString based, and jumping through std::string in between
just makes it more complex and increases the potential bug surface.

Also fixes a bug where you'd get two error messages when a spice model
library wasn't found.

Also fixes a bug where you'd get a spice model library not found error
when the text field was empty.

Also fixes a bug where we'd try to absolutize a path starting with an
unresolved text or environment variable.  If the path starts with a
variable it's probably absolute, and tacking on the project path in the
error message just obfuscates things.

Fixes https://gitlab.com/kicad/code/kicad/issues/13082
2022-12-07 15:07:25 +00:00
Mikolaj Wielgus 1d26a29fc0 Remove tilde expansion
Fixes https://gitlab.com/kicad/code/kicad/issues/9213
2021-09-27 16:10:36 +00:00
Jeff Young bbea8afdc5 Trim some (probably) excess includes. 2021-09-26 15:28:17 +01:00
Jeff Young 5bf042fcc1 Use individual parameter version of wxExecute.
Fixes https://gitlab.com/kicad/code/kicad/issues/9236
2021-09-26 15:03:06 +01:00
Wayne Stambaugh bcd6bddfd4 Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
2021-07-15 15:44:45 -04:00
Jeff Young ea6769b702 The REPORTER interface is inherently line-based.
Also fixes a bunch of error messages that were similar but not
identical (which just increases translation burden).

Fixes https://gitlab.com/kicad/code/kicad/issues/8723
2021-07-05 13:41:06 +01:00
Jeff Young 1722bc03b0 Consistent terminology and punctuation. 2021-06-17 00:05:17 +01:00
david-beinder 053bd66650 Fix localization of OS unsupported message, disallow bug reports from W7 2021-06-09 19:01:54 +00:00
Jon Evans ad6256bdca Fix linux/wx3.0 build 2021-06-07 19:07:49 -04:00
Marek Roszko 0e16db0c25 Kick wx.h mostly out of common 2021-06-07 18:38:52 -04:00
Roberto Fernandez Bautista 35438d3533 Add more bounds checking in KIwxExpandEnvVars
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7461
2021-03-21 20:13:20 +00:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Seth Hillbrand d9d906e652 Take file size into account in cache hash
Revision control systems can play games with file timestamps.  If the
file has changed size, we should reload it as well.

Fixes https://gitlab.com/kicad/code/kicad/issues/7627
2021-02-20 06:27:12 -08:00
Marek Roszko b609c7dcd6 Kick the osx specific path helpers into PATHS 2021-02-16 23:29:26 -05:00
Jeff Young 02aca4a7d7 Don't run off the end of a string.
Fixes https://gitlab.com/kicad/code/kicad/issues/7461
2021-02-08 12:28:15 +00:00
Jeff Young f1221a9ca3 Resolve text variables in title blocks for outputing to netlist.
Fixes https://gitlab.com/kicad/code/kicad/issues/7153
2021-01-17 16:24:22 +00:00
jean-pierre charras 005c3b84ad Better fix for incorrect page preview in Page Settings when the worksheet contains a bitmap
The actual size of pixels was incorrectly set.
Fix also bad names for a few vars and methods in BITMAP_BASE.
2020-11-28 10:53:26 +01:00