248 Commits

Author SHA1 Message Date
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
RigoLigoRLC
ef75ce9035 Fix: refusal of creation of non-existent directory tree on plotting
Fixed https://gitlab.com/kicad/code/kicad/-/issues/6394
wxWidgets uses wxFileName::Mkdir to create a directory tree like `mkdir
-p`.
2020-11-27 07:24:14 +00:00
Marek Roszko
1167862c86 Split wx_filename out of common 2020-10-25 20:01:13 -04:00
Marek Roszko
14c18b7e64 Move ui functions out of common and into ui_common 2020-10-25 20:01:12 -04:00
Marek Roszko
e928b2d8fd Split EDA_UNITS out from common. 2020-10-25 00:02:52 -04:00
Marek Roszko
64484f5fc4 Split KIID out of common.h 2020-10-24 00:17:08 -04:00
Marek Roszko
304e5faf36 Move wxStringSplit to kicad_string 2020-10-24 00:17:07 -04:00
Marek Roszko
1d559108c8 Move LOCALE_IO out of common.h 2020-10-23 21:49:42 -04:00
Jeff Young
41fd8293e8 Don't apply clearance to keepout zones.
Also improves the clearance and keepout reporting.

Fixes https://gitlab.com/kicad/code/kicad/issues/6118
2020-10-22 21:29:04 +01:00
jean-pierre charras
f6b4b66a86 Avoid include wx/wx.h in many files that do not actually use this include.
Including wx.h includes the full set of wxWidgets include files, that is not good,
and can create some conflicts with some Windows headers on msys2.
2020-10-18 18:21:34 +02:00
Ian McInerney
b1bd1f2a97 Introduce new action to switch to mils as a unit 2020-10-04 17:53:55 +01:00
jean-pierre charras
f702da95c7 Minor code cleanup, step2: remove more useless include.
fix also a minor compil warning
2020-10-01 15:39:47 +02:00
jean-pierre charras
3f8c9d49f8 Revert "Code cleanup: remove useless wx/wx.h include inside a few files."
due to compil issue on Linux

This reverts commit cffccc3970d49ee9d6596f4e70ac78616e58f5a1.
2020-09-30 20:47:20 +02:00
jean-pierre charras
cffccc3970 Code cleanup: remove useless wx/wx.h include inside a few files.
in most of files, including wx.h is not necessary, when only 2 or 3 wx files must be included.
Moreover, on windows, including wx.h sometimes create compil warnings about
shadowed vars defined in some specific windows headers.
2020-09-30 20:03:27 +02:00
Jeff Young
40d7940d52 Don't trim both back and front if there's only one char.
Fixes https://gitlab.com/kicad/code/kicad/issues/5357
2020-08-26 00:02:37 +01:00
Jeff Young
27b047ab3f Cache project text vars as properties in the PCB board file.
Fixes https://gitlab.com/kicad/code/kicad/issues/5255

Fixes https://gitlab.com/kicad/code/kicad/issues/5005
2020-08-19 19:32:20 +01:00
Jeff Young
e86fc64e7d Check envvars as well before flagging as un-resolved.
Fixes https://gitlab.com/kicad/code/kicad/issues/4644
2020-08-01 00:24:26 +01:00
Jon Evans
4dbbe1cf68 Project settings fixes from review
- Fix file extension for new project
- Fixes for exceptions on MSW
- Fix some ASAN issues
- Allow SETTINGS_MANAGER to run headless
- Don't flag schematic as modified after schematic setup is closed
- Don't automatically unload projects when LoadProject is called
- Don't unload project if it's the same as the current one
- Make sure to properly init/de-init template field names
2020-07-02 22:08:54 -04:00