70 Commits

Author SHA1 Message Date
John Beard
c5d5a718aa Altium: handle '.var' concatenated special strings
The ST MB2046 reference board, for example, has all the
assembly-layer ref-des text in the format '.R42' even though
they're not concatenated.

Enable the existing but commented-out text.
2025-08-16 05:51:12 +08:00
jean-pierre charras
e1c56c71ef Fix compil warnings (some due to declarations colliding with a Windows header) 2025-08-03 16:11:14 +02:00
Jeff Young
e230d5164d Honour renderSettings' default font.
This still leaves a few things out in the cold,
such as hit-testing and polygon generation.
But at least it allows us to plot with a default
font.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19031
2025-07-17 09:35:21 +01:00
Seth Hillbrand
55da0e46af Remove locale-specific floating point from io
Use only C-locale functions wxString::ToCDouble and fmt::format{}
functions so that we do not need to set the locale for file io
operations

This also introduces a cmake check that looks for certain banned
functions (strtod, strtof and atof) that convert strings into doubles
by the user locale or formatting specifiers like %f/%g that convert
doubles into strings by the users locale.  It will prevent compilation
in this case.

For the limited cases where we want to show the user a string in their
locale, we have an override string "format:allow" that can be added to
lines in order to allow them with %f/%g format specifiers
2025-07-14 14:26:00 -07:00
Alex Shvartzkop
90f5cbf003 EasyEDA Std import: support multiple consecutive arc parameter sets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21238
2025-07-02 18:03:24 +03:00
Jeff Young
aaa0e74311 Eagle sheet descriptions are elements, not attributes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20957
2025-06-13 12:28:08 +01:00
Jeff Young
30748006f7 Standardize on American English spelling of "canceled". 2025-06-01 19:38:24 +01:00
John Beard
83ea3397c3 CSV: quote everything to avoid locale-dependency
Avoids having to reason about locales where the decimal separator
is a comma.

This should still work for IO purposes (checked in LibreOffice, numbers
still end up right aligned as expected).
2025-05-24 18:22:33 +08:00
Jeff Young
6757ba8165 Use consistent terminology and types. 2025-05-12 20:28:47 +01:00
jean-pierre charras
9ede0ef25b CSV_WRITER(wxOutputStream& aStream) fix issue with non ASCII7 chars.
When writing non ASCII7 chars (using UTF8 encoding), the number of bytes to
write is bigger than the number of "chars", so the written lines were
truncated.
2025-05-05 15:55:55 +02:00
John Beard
4c8b971021 Eeschema: Symbol editor: pin table CSV interchange
This adds the ability to export the pin table content to a CSV file
or the clipboard as CSV, then re-import it from CSV or TSV. This allows:

* to round-trip pin table data via a spreadsheet program, so that the pin
  data can be manipulated in a richer/more familiar editing environment
* an import method to bring in tabular pin data from other formats
  "semi-automatically", without having to write a full-blown symbol generator.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/19207
2025-05-03 23:22:35 +08:00
Jeff Young
1ec47a053b Don't save UUIDs for teardrop zones.
They're really just a geometry cache.

Also removes writing of filled_areas_thickness,
which hasn't been supported in yonks.

Also cleans up writing of island removal strategy
(the limit is only needed in limit mode).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20717
2025-04-23 10:41:36 +01:00
JamesJCode
a5be581b1b Add char_traits<T> specialisations for wxUniChar and NANODBC_SQLCHAR
when building on Apple with Clang >= 17.

These specialisations are not strictly required by the C++ standard,
and have been removed from LLVM.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20631
2025-04-15 20:57:23 +01:00
Tomasz Wlostowski
6a0efe6883 IO_BASE: don't try to modify the case of a temporary string in-place, work on a copy 2025-03-05 00:23:04 +01:00
Daniel Treffenstädt
3768221d9c ADDED: Support for IPC-4761 Via protection features
Fixes https://gitlab.com/kicad/code/kicad/-/work_items/18837
2025-03-01 18:02:54 +00:00
Jon Evans
b6aac9369e Fix creation of Altium compound files from IntLibs
A previous change introduced an invalid cast from
base to derived class.  To clean this up, changed
DecodeIntLibStream to have an out param and allow
two-step initialization of ALTIUM_COMPOUND_FILE

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20099
2025-02-25 22:34:26 -05:00
Jeff Young
34db9ed245 Better namespacing.
Also fixes a bug with calculating eagle annular
ring sizes.
2025-02-24 11:08:29 +00:00
Alex Shvartzkop
b5c6361a05 Fix build error on Windows. 2025-02-15 13:40:07 +03:00
Seth Hillbrand
b8b7c59a50 Better protect against long Eagle values
Long strings may overflow our integer receptacle, so use 64-bit instead
and don't allow negative signes in the fraction part of the number.  if
the number of fraction digits is bigger than our pre-calculated array
(this in and of itself smacks of premature optimization), don't use the
same array to trim it, instead calculate the actual denominator

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19958
2025-02-14 12:55:36 -08:00
John Beard
636c6c4efb Eeschema/pcbnew: fix pasted image saving
The m_imageData buffer in the BITMAP_BASE is an
internal implementation - the public API to persist the
data to a stream appears to be SaveImageData - so use that,
which hides the implementation (and generates the image data
"live" when needed).

Remove the public access to the m_imageData buffer as it isn't
needed for public use, and also is misleading.

Also break out the formatting of the data into KICAD_FORMAT,
as it's currently replicated in eeschema/pcb/pagelayout
formatting code.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19772
2025-01-31 23:01:07 +08:00
Jon Evans
42b9a9604b Fix several data races triggered by parallel library loading 2025-01-25 11:44:15 -05:00
Wayne Stambaugh
db877e6a00 Fix Eagle schematic import issue.
Handle duplicate symbol library names with Eagle URN notation.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19666
2025-01-20 07:28:25 -05:00
Wayne Stambaugh
f161d94521 Common folder housekeeping part 2. 2025-01-14 15:25:05 -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
Alex Shvartzkop
ceefbea34a Eagle: Make pad drill optional to support some DipTrace-exported boards. 2024-12-29 02:44:35 +03:00
Jeff Young
756f0c5027 Fix parsing of Altium overbar notation.
Use the AltiumPinNamesToKiCad() algorithm for all conversions,
but don't do any conversions on plain text (RECORD=4).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19080
2024-12-20 18:32:08 +00: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
Jeff Young
fa52d68268 Fix pretty-printing of UUIDs and bools. 2024-11-25 19:10:13 +00:00
Alex Shvartzkop
840b9aebba Fix compatibility with LCEDA/EasyEDA v2.2.32
Now device attributes can contain numbers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18994
2024-10-27 04:15:59 +03:00
Marek Roszko
aceca713d8 Fix kicommon exports 2024-09-08 08:00:47 -04:00
Alex Shvartzkop
e0291133f2 Import POURED items as zone fills from EasyEDA/LCEDA Pro v2.2+ PCBs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18664

(cherry picked from commit 6b199c52a16f2b69f6563757d2fc789771f8367d)
2024-09-07 12:24:53 +03:00
Alex Shvartzkop
16d9fa7f25 Fix compatibility with EasyEDA/LCEDA Pro v2.2.26
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18620
2024-09-05 05:59:35 +03: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
Seth Hillbrand
69849ba3ca Replace custom Clamp with std::clamp
Fixes bug in parser that had the elements in the wrong order due to our
custom version not matching the standard order
2024-07-25 19:17:17 +02:00
Seth Hillbrand
ae458d0421 Decrease error severity for Altium imports
These are not errors that end users can do anything about.  Keep them
around for developer debugging if we want to see more imformation but
don't pop up error messages on the user's screen
2024-07-17 10:32:09 -07: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
Jeff Young
14a55facf2 Clearer naming and commenting.
Also some const& hygiene and some formatting.
2024-06-25 11:07:14 +01:00
Alex Shvartzkop
1613816e77 Fix EasyEDA/JLCEDA Pro 2.2 footprint/symbol library import.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18250
2024-06-21 22:20:54 +03:00
Alex Shvartzkop
84091b163e Fix warning: moving a temporary object prevents copy elision [-Wpessimizing-move] 2024-06-21 21:31:14 +03:00
Wayne Stambaugh
b494166b10 Fix empty label names when importing Eagle schematic. 2024-06-21 12:07:06 -04:00
Wayne Stambaugh
8df28d4f5f Fix crash in symbol editor when importing Eagle symbol library.
https://gitlab.com/kicad/code/kicad/-/issues/18221
2024-06-21 01:07:01 -04:00
Wayne Stambaugh
3df2109c43 Fix issues with the new Eagle schematic parser. 2024-06-20 23:07:59 -04:00
Seth Hillbrand
bcf6b620a8 Large rework of BEZIER_POLY
Add direct handling of quadratic beziers to save compute time and number
of points.  Update cubic interpolation to reduce number of points
generated for a given smoothness

Cache data on open and used cached data to avoid multiple re-calcs

Remove minimum line length and number of segments and replace with
standard max error level.  Allows us to specify the tolerance of bezier
interpolation
2024-06-18 17:55:41 -07:00
Seth Hillbrand
439c25fca9 Altium schematic parser: Add fraction pin placement
In the schematic libaries, pin positions that are off 10mil spacing need
fractional elements stored in a different location
2024-06-10 15:02:18 -07:00
Wayne Stambaugh
5e048bc64c Fix several Eagle schematic import issues.
Fix broken arc angle polarity due to library symbol changes.

Fix broken wire and text Y axis coordinate polarity due to library symbol
changes.

Fix broken field visibility and position on library symbols with multiple
units that have fields with different visibility and positions.  Because
KiCad does not support this, when parsing the Eagle schematic file, the
last library symbol unit parsed ends up being the field visibility and
position for all units in the symbol.
2024-06-10 11:28:20 -04:00
Wayne Stambaugh
889931505b Eagle schematic importer improvements.
Change Eagle file importer to use a two pass import.  The first pass
parses the entire Eagle file into an associated E* object.  The second
pass converts the parsed E* objects into the appropriate KiCad objects.

Improve handling of Eagle versioned libraries.

Add helpers to IO_BASE to ease handling of PROGRESS_REPORTER and REPORTER
objects.

ADDED: Support for importing Eagle schematic modules.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1813
2024-06-10 11:28:20 -04:00
Alex Shvartzkop
2a889f03fc EasyEDA Std/Pro: import (some) component metadata for symbols.
Also fixes Reference numbering.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17806
2024-05-03 00:37:59 +03:00
Jeff Young
c59ed0bbb7 Flip symbol editor's Y axis to match other editors. 2024-04-27 13:47:56 +01:00
Jeff Young
d77eae3e7e Collapse LIB_FIELD into SCH_FIELD. 2024-04-13 15:42:13 +01:00
Marek Roszko
0ce227fa92 Can't use forward declare with std::vector
Not allowed per C++ standard

See https://github.com/llvm/llvm-project/issues/57700
2024-04-13 08:22:20 -04:00