Compare commits

..

1281 Commits

Author SHA1 Message Date
Wayne Stambaugh ad43570ec0 Tag stable version 8.0.7. 2024-12-02 16:04:30 -05:00
Seth Hillbrand 5dd4718db0 Update translations 2024-12-01 17:25:35 -08:00
dsa-t ea70d8cf4c Translated using Weblate (Russian)
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-12-02 02:25:06 +01:00
ZbeeGin cd2879880a Translated using Weblate (Polish)
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-12-02 02:25:06 +01:00
Pferd O b51c8c1b3d Translated using Weblate (German)
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-12-02 02:25:06 +01:00
Wellington Terumi Uemura 5db1ee930f Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-12-02 02:25:06 +01:00
2tama3 695dd57477 Translated using Weblate (Japanese)
Currently translated at 100.0% (9198 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-12-02 02:25:06 +01:00
Ettore Atalan 224c989072 Translated using Weblate (German)
Currently translated at 99.9% (9192 of 9198 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-12-02 02:25:05 +01:00
John Beard 80db7ff8cf Pcbnew: update DRC exclusions from DRC dialog
When excluding/re-including DRC violations, update the
BDS list immediately rather than waiting for the
BOARD::RecordDRCExclusions() to be called.

This was implemented in 8.99 in 0598ca0f90
(along with DRC exclusion comments).

Follow that commit's updates of the m_DrcExclusions
structures in an analogous way.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19113
2024-11-29 03:04:43 +08:00
jean-pierre charras 6e6d3e9b03 Revert "Try to fix a link issue in Gerbview" and try another fix 2024-11-25 16:55:28 +01:00
jean-pierre charras c08dd172d6 Try to fix a link issue in Gerbview 2024-11-25 16:38:55 +01:00
Wayne Stambaugh 7972805d07 Tag stable version 8.0.7 release candidate 1. 2024-11-24 19:06:04 -05:00
Alex Shvartzkop a86147b4b1 Optimize ConvertImageToLibShapes for EasyEDA/LCEDA schematic import.
Don't sort all symbol draw items after adding each draw item.

-75% CPU usage on typical schematic imports.

(cherry picked from commit 5323c8587a)
2024-11-24 20:54:24 +03:00
Dhineshkumar S 335bb8792f Fix switching bold option on and off alters text thickness
Currently, unselecting the bold option resets the thickness to the
standard size instead of reverting to the original thickness.
To address this, the original thickness should be preserved so it
can be restored when bold is turned off.

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

(cherry picked from commit 43b1bc52db)
2024-11-24 07:46:40 -05:00
jean-pierre charras c8f7887cf8 Simulator: fix crash when deselecting the Probe Tool in some cases.
If a schematic item was selected, when activating the probe tool from the
simulator, and deactivating from the Select Item sch editor tool, a crash
happened.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18547
2024-11-24 10:34:22 +01:00
John Beard 2fe5c28787 Fabmaster: catch illegal parses up front
Parsing an empty string as double/int produces uninitialised data.
That is likely to cause an undefined amout of chaos later on,
so catch it explicitly with a wxCHECK.

It's still something that shouldn't happen, and could still cause
chaos, but it's at least deterministic. It also avoids putting
gigantic numbers into things that don't expect them. For example
normalising an angle of 1e303 is functionally an infinite loop.

This happens at least in files with missing fields in rows,
like in #19174's file, line 4:

S!U2306!IC!!!!!!SOT_23_5!!!!!SGM2576/TT9107!!!

The file is still broken, but now it loads.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/19174
(cherry picked from commit 4d2d70ce22)
2024-11-24 14:04:57 +08:00
John Beard 64365de9de Update font when needed on italic/bold change
When the italic or bold nature is changed, text using outline fonts may
need to change its font. Add this to the SetItalic/SetBold functions.

Also add a counterpart SetItalicFlag function (following SetBoldFlag)
when you only need to set the flag (e.g. when importing or changing
everything in the text properties dialog).

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18592
(cherry picked from commit b043f334de)
2024-11-24 09:51:54 +08:00
Alex Shvartzkop a950d55cb2 Show empty field for unconstrained length in length tuning properties.
Because it's confusing when the dialog shows last target value, but it
doesn't apply when you start tuning.

Also the last values are remembered in DRAWING_TOOL::PlaceTuningPattern
now, instead of global variables.

Related: https://gitlab.com/kicad/code/kicad/-/issues/18979
2024-11-23 18:11:25 +03:00
Alex Shvartzkop 3748a10ed5 Length tuning workflow improvements:
-Allow changing length tuning settings before tuning has been started
-Do not exit out of the length tuning tool after each placement
-Keep specified settings between pattern placements

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

(cherry picked from commit 78b2e53777)
2024-11-23 17:27:27 +03:00
Alex Shvartzkop 227bb76909 Don't modify m_selection while iterating over it in PCB editor.
This caused a fatal assert when selecting connected tracks with tuning patterns.

(cherry picked from commit fee8560079)
2024-11-23 17:27:16 +03:00
jean-pierre charras a20a6bb2a3 French translation update 2024-11-23 10:16:03 +01:00
jean-pierre charras 7c17aa5974 EEschema: fix crash when repeat an item (ins key), due to a null parent
A recent change set the parent member of a item put in the repeat list to
nullptr (this is OK) but the code to copy an item from this list did not
update this parent member.
From master branch, commit 8f348820
2024-11-23 10:07:38 +01:00
Dhineshkumar S 59795c81c5 Fix copy-paste issue for grids with checkboxes
Handle boolean value parsing during paste operation. The boolean value
was not being handled correctly in grid_tricks, which prevented the
boolean value from being pasted into the target row

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

(cherry picked from commit 07f96b83b7)
2024-11-21 11:37:47 -08:00
Mike Williams 84d00a7887 cli: accept multiple gerber layers for single layer plotting
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19089
(cherry picked from commit 325d6ff064)
2024-11-21 12:55:13 -05:00
John Beard 3774e31db8 Pcbnew: convert to lines should take the width of polygons if it can
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18713
(cherry picked from commit 81c1cd9af1)
2024-11-21 12:32:56 -05:00
Seth Hillbrand 69ac570658 Update translations 2024-11-21 09:29:00 -08:00
Pablo Bianchi 46ecb22ef5 Translated using Weblate (Spanish)
Currently translated at 98.5% (9055 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es/
2024-11-21 18:27:21 +01:00
Jan Straka ff7ea6eae0 Translated using Weblate (Czech)
Currently translated at 84.1% (7735 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-11-21 18:27:21 +01:00
Marco Ciampa 2f70ac171f Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
Marco Ciampa 360011e563 Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
CloverGit 2a0785d188 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-11-21 18:27:20 +01:00
Toni Laiho a480b1a5ba Translated using Weblate (Finnish)
Currently translated at 99.7% (9172 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-11-21 18:27:20 +01:00
Marco Ciampa 6f31e306a1 Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
Pferd O 5983815415 Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-21 18:27:20 +01:00
Marco Ciampa 288050b6ec Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
co8 j 6d36363403 Translated using Weblate (Japanese)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-11-21 18:27:20 +01:00
Marco Ciampa 720c7d9fc4 Translated using Weblate (Italian)
Currently translated at 99.5% (9152 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-11-21 18:27:20 +01:00
Wellington Terumi Uemura e009afd4a1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-11-21 18:27:20 +01:00
ZbeeGin 9e13ff25d0 Translated using Weblate (Polish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-11-21 18:27:20 +01:00
Pferd O af1899ddc3 Translated using Weblate (German)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-21 18:27:20 +01:00
Ian McInerney beb30dd881 Use appropriate tunning pattern icon in menus for tunning pattern generators
(cherry picked from commit 2190c37cd6)
2024-11-21 12:22:38 -05:00
Alex Shvartzkop 6d09293b11 DXF import: scale text size too inside scaled blocks.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18525

(cherry picked from commit 37fb792411)
2024-11-21 12:19:31 -05:00
Alex Shvartzkop ca7378924c Make color picker dialog usable on hidpi monitors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17860

(cherry picked from commit 894bf45480)
2024-11-21 11:55:54 -05:00
Ian McInerney 74316a62d3 Always use black text in PCB calculator E-series table
The white text in dark mode is too washed out on the cell colors to be
visible. Since we already purposely subdue the colors in dark mode, the
easiest fix is to just always use black text.

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

(cherry picked from commit c7d280dfa1)
2024-11-21 11:34:06 -05:00
Dhineshkumar S 3150f467bb Fix Courtyard layers disappeared
Currently, the used layers passed from parseLayers() do not include
mandatory layers if they are missing in the loaded board file.
To fix this, we can manually add the mandatory layers to ensure they
are always enabled.

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

(cherry picked from commit 6e2ed5666d)
2024-11-21 11:28:37 -05:00
Dhineshkumar S c033c364d4 Fixing Paste Issue in Library Table
Previously, when attempting to paste an entire row copied from the global
table into a project table, the value would be pasted from the cell where
the cursor was focused, rather than from the first cell. This issue
occurred because the first cell, a checkbox column, was not selectable.
To resolve this, the checkbox column should be enabled for selection
when the Left Mouse Button event is triggered

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

(cherry picked from commit 1fc8e65f7a)
2024-11-21 11:15:17 -05:00
Mike Williams 37c14a65ed net navigator: add sheet changes to navigation history
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18616
(cherry picked from commit 284c52845d)
2024-11-21 11:07:22 -05:00
Mathieu Pilato dbf64ac0cf Fix missing current scale in AC simulation
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18313

(cherry picked from commit 10d23ada48)
2024-11-21 09:40:12 -05:00
jean-pierre charras 0eda576189 Gerbview: fix a link issue on msys2: round 2
Reverts commit 6ee9fb4027
Make fix only for mingw/msys2
2024-11-20 18:29:32 +01:00
jean-pierre charras 6ee9fb4027 Gerbview: fix a link issue on msys2
mingw/msys2 is picky about order of files to link.
2024-11-20 18:06:21 +01:00
Kamil Galik 64134cee92 ADDED: 3D Mouse support in places
Gerber Viewer, Drawing Sheet Editor and Footprint Properties 3D Model tab

Fixed https://gitlab.com/kicad/code/kicad/-/issues/14002
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13306
2024-11-20 15:56:19 +00:00
Jeff Young fead0eb33b Manual cherry-pick of ee8d86390e. 2024-11-18 22:44:41 +00:00
jean-pierre charras ff71b324a1 EEschema: fix an issue in sheet cross-references of global labels.
Commit 5ca34147 (a cherry pick from master branch) broke these cross-references.
If was fixed later in master branch, but these changes cannot be cherry picked.
So the old code is reused in 2 functions to fix the issue.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18534
2024-11-17 13:11:23 +01:00
Seth Hillbrand b10ab478bd Fix 3D viewer omission of STEP models with relative path assignment
The project was not assigned to the board in the 3D viewer frame,
resulting in a failure to locate the relative path for STEP models.
To fix this, the current project should be assigned to the board in
the 3D viewer frame.

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


(cherry picked from commit d2e51fdb5f)

c824484c Fix 3D viewer omission of STEP models with relative path assignment

Co-authored-by: Dhineshkumar S <dhineshkumar@cgvakindia.com>
2024-11-17 07:21:14 +00:00
Wayne Stambaugh 710b6adb8c Warn user when template field names contain trailing/leading white space.
When loading a schematic that contains fields with trailing/leading white
space, show an infobar message.  When editing the template field names,
prompt the user to keep or remove any trailing or leading white space
characters from field names.

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

(cherry picked from commit d9d984d2c8)
2024-11-16 20:51:03 -06:00
Mark Roszko 6a01bdbabd Drop the first point of an arc when building an outline when there's a previous point that's being changed
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18125


(cherry picked from commit 8b4253cda4)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-11-16 08:53:01 +00:00
Jeff Young 76e19c6dcf Import PCB into existing project.
Or, to be more direct: don't pull the project rug
out from under EESchema when importing in non-
stand-alone mode.

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

(cherry picked from commit a2f7edde2e)
2024-11-16 02:43:13 -06:00
Seth Hillbrand 8af289c33e Fix error in PointInside
If we are checking a point that is inline with multiple segments, we
were counting both the entry and exit as crossings, leading to points
inside a polygon being registered as outside.  Changing the conditional
to only catch one crossing as required.

Adds a QA check to ensure that this remains fixed

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

(cherry picked from commit 7916b1ddb8)
2024-11-16 02:38:49 -06:00
JamesJCode 35fa7db5c7 Don't reset sheet / screen file names if cancelling repeat insert
in recursive state

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

(cherry picked from commit c05dd18613)
2024-11-16 02:36:23 -06:00
Seth Hillbrand 67739ee3d1 Convert courtyards with error allowance
We convert arcs/circles to polygons with an allowable error.  This means
that the segments might end up being closer than we expect and we should
allow for this deviation when checking courtyards

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

(cherry picked from commit 3a8a5bb378)
2024-11-16 02:34:53 -06:00
Seth Hillbrand d8ba7284a8 Correct pad connections for 45° circular
When calculating the pad bbox, we need to only account for deflation of
zone min width.  Additionally, when calculating spokes for roughly
circular elements, we don't need to go to the bbox corners, so special
case it to rotate after the fact

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18329
2024-11-16 02:34:25 -06:00
Seth Hillbrand fdc0309592 Simplify spoke generation
Sin/Cos are pre-caclulated for all multiples of 45° so we don't need to
short circuit them here.  Calculating the bbox intersection point allows
us to pick spoke sizes that are not overly large so as to miss the hit
point testing in the associated fill areas.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18329
2024-11-16 02:34:25 -06:00
Mike Williams 55d77f0dbb pcb: fix crash on routing many traces
Further improvements could be made to the behavior of the autoroute
functionality in this case, but not crashing is a good start.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18328
(cherry picked from commit 04ff715945)
2024-11-16 02:32:33 -06:00
Seth Hillbrand 14fafebbc7 Handled unconnected nets
These nets may have only a single element in them (no connections), so
be sure to leave the node even without Features

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

(cherry picked from commit 14ccadd2a9)
2024-11-16 02:31:06 -06:00
Seth Hillbrand 7ca472deb8 Handle error when we don't have Eagle Board
This can also occur in libraries, so ensure we're not dereferencing a
null board pointer

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

(cherry picked from commit 89b9b13e21)
2024-11-16 02:30:36 -06:00
Seth Hillbrand fdb3612565 Some fixes for DXF import
In order to find elements, we need to have bbox correctly set.  ::min()
for doubles, just gives the smallest positive value.  So negative placed
graphics don't trigger the right bbox and they get nopped out of
existence.

Similarly, following the advice from @msteinbeck, we elevate the degree
of the spline before converting it to beziers in order to properly
represent in KiCad

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

(cherry picked from commit e0fc7b2b88)
2024-11-16 02:30:03 -06:00
Seth Hillbrand bf59a6305a Handle DXF files with out of bounds values
First, ensure that we calculate the bbox of the imported elements.

If the total BBOX is outside our allowed value, refused to import.  This
needs to be scaled or addressed in an external editor

If the bbox fits, then make sure that we clamp it such that the largest
element is still within our bounds

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

(cherry picked from commit a724b3d8b1)
2024-11-16 02:29:19 -06:00
Dhineshkumar S 17db770d92 Fix copy and paste issue in bus alias definition
Previously, creating a new member row by pasting text from the clipboard
did not trigger a cell value change which prevented the correct
association of the member value with the alias. To ensure this, we force
the member to be updated with the current alias before closing the dialog,
as well as with the previous alias when adding a new one

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

(cherry picked from commit cd40c6bbbf)
2024-11-16 02:27:26 -06:00
Dhineshkumar S b3004c9d96 Disable custom color selection when Fill Mode is Body Background Color
Currently, the system allows custom color selection for the Fill Color
property in the Properties toolbar even when Fill Mode is set to Body
Background Color via the Properties window. However, this does not update
the color to match the Body Background color. To fix this, custom color
selection for Fill Color will be disabled when Body Background Color is
chosen.

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

(cherry picked from commit cb41f39045)
2024-11-16 02:09:46 -06:00
Dhinesh c54ebdecd2 Fix missing text and graphics in PDFs generated by "Plot to PDF"
The "Plot to PDF" function was producing PDF files that lacked text and
graphic items in viewers like Adobe and Foxit. This issue was caused by
the use of the %g format specifier for floating-point numbers defined in
the PDF specification when writing text and drawing shapes in the PDF.
This incorrect format led to a "Too Few Operands" error during rendering.
To resolve this issue, all floating-point numbers must be specified in
fixed-point format according to the PDF specification wherever the issue
was generated.

Fixes #16465

(cherry picked from commit 8851cd77ab)
2024-11-16 02:08:50 -06:00
Ian McInerney 6fc15ed8df Make instance checker path globally writable
On Linux, this directory is shared between users, so a multi-user
machine needs to let the other users have access to the directory to
create their own lockfiles.

(cherry picked from commit 921358b096)
2024-11-16 01:43:18 -06:00
John Beard e7779d9b91 Exclude letter hotkeys from Shift fallback
From master branch

There is a fallback mechanism here designed to catch cases
where a hotkey is bound to a key that needs Shift to be
input (e.g. ? requires Shift on many non-US keyboards,
but the hotkey for that should be '?', not 'Shift+/'). For any key
where the two options are equally-valid "main" key (e.g. '6' and '^'
or '?' and '/' or ':' amd ';'), this is correct, as it allows
the hotkey to be simply the character in question.

Letters don't require this treatment - using this fallback
in the letter case means that a hotkey bound to 'B' will
also fire when 'Shift+B' is pressed, even when Shift+B is
bound to something else. In fact, it could even preempt the
real Shift+B hotkey.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19093
2024-11-13 19:50:48 +01:00
jean-pierre charras 06a91637a7 3D viewer: Ensure the 3D display view is not modified after left clicking.
After opening a context menu and left clicking on the 3D canvas, the view
was modified because a drag event was generated, probably a wxWidgets bug.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17422
2024-11-11 17:11:07 +01:00
Alex Shvartzkop 08e9ce2828 Fix an "unreferenced local variable" warning, 2024-11-11 00:03:34 +03:00
Wayne Stambaugh 24f82ab87d Another attempt to fix Windows file URLs for PDF links.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250

(cherry picked from commit 6cc5d89838)
2024-11-10 10:17:27 -05:00
Wayne Stambaugh bcf069699d Fix PDF plotter URI issues.
Add 'file:' URI JavaScript handlers.

Properly convert Windows file paths to valid URI syntax.

Use expanded variables for URI menu names.

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

(cherry picked from commit 930407fac8)
2024-11-08 14:55:40 -05:00
Wayne Stambaugh f8d694e4d0 Substitute variables in PDF plotter URI links and add file:// URI handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250

(cherry picked from commit 43c3cd57eb)
2024-11-08 14:55:19 -05:00
John Beard b80334baa1 Libgit2: the const git_commit* saga continues
The change wasn't re-reverted in 1.8.3, it was just not
included. It was than _also_ reverted in 1.8.4, as it was for
1.8.2 (those two tags are on different branches - main and maint/v1.8).

Hopefully, this means that we're done here, and v1.8.5 will also be
const-y, whether it is based on main or maint/v1.8.

The current state of play:

* 1.7.0 and older: const
* 1.8.0, 1.8.1:    no const
* 1.8.2:           const
* 1.8.3:           no const
* 1.8.4:           const
Future:
* 1.8.5/1.9.0:     presumably/hopefully, const

This is currently breaking at least Arch and Fedora Rawhide

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19062
(cherry picked from commit 9f579f787b)
2024-11-08 08:24:59 +08:00
Jan Wichmann 6c359e2f06 Fix: Clear drill holes table before loading board file
From master branch
2024-11-07 16:56:18 +01:00
Jeff Young a3eff548b7 Even the orphaned net must obey the min board clearance.
(And other Default netclass constraints.)

(cherry picked from commit 5d656e3c8d)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19051
2024-11-05 21:02:23 +08:00
Mark Roszko e33a732371 Bump vcpkg and wxwidgets for aui patch 2024-11-02 19:23:47 +00:00
Jon Evans 95d3200a3a Clear unknown keys from environment variable maps on save
Also fix the previous code for clearing unknown keys to use
a JSON pointer so that it functions correctly when the JSON path
is more than one level deep.

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


(cherry picked from commit 09652efec5)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-11-02 18:54:12 +00:00
Jon Evans 5ee7ae4a45 Make sure to set modified bit when releasing nested settings
(cherry picked from commit 826794469d)
2024-11-02 10:26:03 -04:00
Jon Evans b13a9e231b Use a persistent flag to track JSON modifications
(cherry picked from commit eb6d85bacf)
2024-11-02 10:25:59 -04:00
Seth Hillbrand 1011f361fd Update translations 2024-11-01 16:27:28 -07:00
David Chorváth 288a08b9c2 Translated using Weblate (Slovak)
Currently translated at 65.0% (5974 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-11-02 00:26:56 +01:00
ZbeeGin cac1979f61 Translated using Weblate (Polish)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-11-02 00:26:56 +01:00
Pferd O 38a9477423 Translated using Weblate (German)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:56 +01:00
David Chorváth 072446e79d Translated using Weblate (Slovak)
Currently translated at 64.8% (5961 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-11-02 00:26:56 +01:00
Pferd O 4fc528819d Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:56 +01:00
CloverGit d5f52000ce Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-11-02 00:26:56 +01:00
Henrik Kauhanen 8e4d7da4ea Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-11-02 00:26:55 +01:00
Henrik Kauhanen ea3f0bada4 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-11-02 00:26:55 +01:00
co8 j 3b33ce8bcc Translated using Weblate (Japanese)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-11-02 00:26:55 +01:00
Pferd O 74b42f1bb2 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:55 +01:00
Pferd O b455a4cd54 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:55 +01:00
co8 j 5021f6ee26 Translated using Weblate (Japanese)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-11-02 00:26:55 +01:00
sergio 0be2b88f5a Translated using Weblate (Russian)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-11-02 00:26:55 +01:00
Wellington Terumi Uemura f3a57cf763 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-11-02 00:26:55 +01:00
Pferd O ddd69019bc Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-11-02 00:26:55 +01:00
109247019824 94e34cb1eb Translated using Weblate (Bulgarian)
Currently translated at 7.6% (706 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/bg/
2024-11-02 00:26:55 +01:00
JamesJCode 6470212edd Fix missed rows when pasting to WX_GRID on macOS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18916

(cherry picked from commit 816af9562b)
2024-11-01 23:10:26 +00:00
Mike Williams 8c3bcade1c schematic: fix missing actions strings and hotkey conflict
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17694
(cherry picked from commit 5ed80a08b8)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18748
2024-11-01 13:37:53 -07:00
jean-pierre charras 70e99acce6 FP editor: fix possible crash when saving a footprint due to a null pointer
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19018
2024-11-01 20:56:42 +01:00
jean-pierre charras 25be138ac1 eeschema, DIALOG_SHEET_PROPERTIES: add test for valid sheet filename
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18981
2024-11-01 20:24:50 +01:00
Alex Shvartzkop 9f196d2e64 EasyEDA/LCEDA: import bezier curves in symbols.
See https://gitlab.com/kicad/code/kicad/-/issues/19034
2024-11-01 16:36:45 +03:00
Alex Shvartzkop b51fed4118 EasyEDA/LCEDA Pro: don't import empty but visible netlabels.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19034
2024-11-01 16:10:15 +03:00
JamesJCode a914f361d3 Fix libgit integration for version >= 1.8.3
The API continues to change...

(cherry picked from commit 75c2f17b42)
2024-10-31 18:48:10 +00:00
Alex Shvartzkop 846b634e0e EasyEDA/LCEDA import: take symbol/netport Name from device entry if empty in schematic.
Also fixes netport orientation if it's symbol is non-default.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19021
2024-10-30 18:33:42 +03:00
Alex Shvartzkop 08b54e205d Show failing strings in HTMLEscape test.
(cherry picked from commit 0581423d50)
2024-10-30 10:37:01 +03:00
Alex Shvartzkop 7cba1e1a55 Update field order in PCB_TUNING_PATTERN.
(cherry picked from commit d2c33e186e)
2024-10-30 10:36:53 +03:00
Alex Shvartzkop 6ae334a751 Fix/improve HTML unescape function.
Also adds some tests.
2024-10-30 08:22:38 +03:00
Alex Shvartzkop 61687e8499 QA: do not pass negative char values to isdigit in NUMERIC_EVALUATOR.
This causes an assert failure on MSVC when running qa_common.
2024-10-30 08:22:38 +03:00
Seth Hillbrand e014f2274f Fix display of broken fonts
TTF fonts are supposed to obey a specific winding.  But sometimes they
don't, especially with garbage windows font editing programs.  If the
outline with hole winding doesn't have an outline, it is probably an
outline itself

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

(cherry picked from commit a6b25d1ee1)
2024-10-29 11:02:26 -07:00
Jeff Young 7e0f05f991 Must check for implicit min separately from opt/max.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19012

(cherry picked from commit 7074c31374)
2024-10-29 17:01:45 +00:00
Jeff Young 1e21b41be5 Centralize ref-des error checking.
(cherry picked from commit 905eaa79a9)
2024-10-28 19:03:50 +00:00
Mark Roszko 4a7dcfdd1f Update vcpkg.json 2024-10-27 23:43:15 +00:00
Alex Shvartzkop d1684b8a72 Fix compatibility with LCEDA/EasyEDA v2.2.32
Now device attributes can contain numbers.

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

(cherry picked from commit 840b9aebba)
2024-10-27 04:30:59 +03:00
Troy Denton 8da026baff Fix URI environment variable expansion issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18918

(cherry picked from commit 0f33aebe48)
2024-10-24 11:53:41 -04:00
jean-pierre charras 89a3ead51e Pcbnew: fix text position when drawing PCB_TEXTs on non paired layers
For these texts, and when the view was "flip board view" option, these text
positions were incorrectly calculated for texts having a text rotation not 0.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18980
2024-10-24 15:20:33 +02:00
jean-pierre charras 5064834716 French translation update 2024-10-24 14:09:49 +02:00
Seth Hillbrand 51a3859d7e Preserve pin numbering when duplicating
We renumber duplicated pins but the previous order was essentially
random.  This keeps the numeric order of the pins on the screen, falling
back to position if they are not numbered

(cherry picked from commit f4bec843d4)
2024-10-21 14:00:18 -07:00
Seth Hillbrand bf37bd8ed5 Fix DRC error with arcs
When two arcs only barely overlapped, we cannot predict the actual point
ends as they exist in the error margins.  Since arc tracks have
different radii by definition, rounding errors in calculating the
overlap angle led to some mistaken identification of parallel segments.

This adds an advanced config flag to set the preferred cutoff point
(currently 0.001°) for whether two arcs actually overlap in shared angle
space

(cherry picked from commit 6be6680d8c)
2024-10-21 13:41:25 -07:00
Dhineshkumar S 283fed83c3 Fix Focus Issue in Parent Window After Hiding the Search Panel
Previously, when the search panel was hidden, the focused search control
did not lose focus, causing an inability to focus on any items in the
parent window when using shortcut keys. This forces correct focus back to the edit window

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

(cherry picked from commit 2bee6f2549)
2024-10-21 13:36:29 -07:00
jean-pierre charras 48983dd31d Python script: Ensure image handlers are loaded before loading a board,.
because a board can include bitmap images using various formats, all
available image handlers must be loaded.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18959
2024-10-21 17:33:14 +02:00
jean-pierre charras ccd4b0cf05 pagelayout_editor: lock panel update during widgets rebuild.
The rebuild is much faster.
From master branch
2024-10-21 17:21:04 +02:00
aris-kimi 154c755a1b Fix non working Esc when init Polyline Properties dialog.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18850
(cherry picked from commit 36bac3f467)
2024-10-20 12:53:34 +01:00
Jeff Young 4157d3350e Limit fix to MacOS.
GTK definitely doesn't need it.  It's unlikely that
MSW needs it either.
2024-10-19 16:49:21 +01:00
Jeff Young 08ba185003 Make sure Paste can't leak through modal dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18912

(cherry picked from commit f1ff75f969)
2024-10-19 16:49:21 +01:00
Jeff Young 7b0e5cd080 DRCEpsilon will appear on *both* sides of a zone neck.
Also don't hide modification of minWidth as a side-effect
of an if-statement.

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

(cherry picked from commit b342126ff3)
2024-10-19 16:49:21 +01:00
Jeff Young 66f50d0c0b A neck in a zone fill will be DRCEpsilon smaller on each side.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18921

(cherry picked from commit 4089735c28)
2024-10-19 16:49:21 +01:00
Jeff Young 973d2d6c03 Even the orphaned net must obey the min board clearance.
(And other Default netclass constraints.)

(cherry picked from commit 4601503660)
2024-10-19 16:49:21 +01:00
Jeff Young fa854b80da Don't ask about locking twice.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18679

(cherry picked from commit a9f79093be)
2024-10-19 16:49:21 +01:00
Jeff Young 05f8bc05ec Fix broken logic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18580

(cherry picked from commit e5321f7401)
2024-10-19 16:49:21 +01:00
Jeff Young d9af68b910 Report implicit rule minimums as being from the board setup.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18642

(cherry picked from commit ed268c5701)
2024-10-19 16:49:21 +01:00
Seth Hillbrand 0c8172880f Prevent soldermask bridge DRC error with mask pad
We checked logical pad matching when looking at pad-based mask but we
should also do the same for aperture masks
2024-10-18 15:24:21 -07:00
Seth Hillbrand 45559cb809 Update translations 2024-10-16 15:32:27 -07:00
Ivan Chuba d3e1d94046 Translated using Weblate (Ukrainian)
Currently translated at 87.0% (7998 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/uk/
2024-10-17 00:31:56 +02:00
Jan Straka 2c75396b80 Translated using Weblate (Czech)
Currently translated at 84.1% (7735 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-10-17 00:31:56 +02:00
Arnau Llovet Vidal 7aae0a9f65 Translated using Weblate (Catalan)
Currently translated at 47.4% (4365 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ca/
2024-10-17 00:31:56 +02:00
Flórián Fuszkó bfd6d96ffc Translated using Weblate (Hungarian)
Currently translated at 3.4% (320 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/hu/
2024-10-17 00:31:56 +02:00
Pferd O f4efa47fe7 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-10-17 00:31:56 +02:00
co8 j d1fd8b18ad Translated using Weblate (Japanese)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-10-17 00:31:56 +02:00
Karl SCHUH 5ee1c0ab42 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-10-17 00:31:56 +02:00
co8 j 8d53326021 Translated using Weblate (Japanese)
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-10-17 00:31:55 +02:00
CloverGit 246afee56e Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-10-17 00:31:55 +02:00
taotieren 352faf526f Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-10-17 00:31:55 +02:00
Wellington Terumi Uemura c183a63c50 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9190 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-10-17 00:31:55 +02:00
Pferd O 9c34432b99 Translated using Weblate (German)
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-10-17 00:31:55 +02:00
CloverGit 76bc0e27fc Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (9187 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-10-17 00:31:55 +02:00
Petr Pazourek b2f6d341dd Translated using Weblate (Czech)
Currently translated at 84.1% (7735 of 9190 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-10-17 00:31:55 +02:00
JamesJCode 7b5afe805e Drag NC markers attached to SCH_SHEET pins when SCH_SHEET is dragged
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18854

(Cherry-picked from commit d726097a3f)
2024-10-14 00:02:05 +01:00
Wayne Stambaugh b77a591c45 Begin version 8.0.7 development. 2024-10-13 18:20:51 -04:00
Wayne Stambaugh 3adec39b0c Tag stable version 8.0.6. 2024-10-13 15:12:40 -04:00
jean-pierre charras a0ad6add34 DIALOG_BOARD_STATISTICS: do not take in account edge.Cuts items thickness
To define the physical board size, graphic items thickness has no matter.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18470
2024-10-12 19:06:45 +00:00
jean-pierre charras 80079c16e8 Pcbnew: ensure all local settings are saved on close the board editor.
From master branch.
2024-10-12 14:05:58 +02:00
jean-pierre charras 632ae136d8 Gerbview: make buffer to read a line of Gerber file bigger.
Currently, the Gerber file is parsed line by line, This is most of time OK.
But warning: in rare cases some files can have *very long* lines (in fact
have only one line),  so the buffer must be very large.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18890
2024-10-10 18:36:20 +02:00
jean-pierre charras 88b11ef065 PCB_DRAW_PANEL_GAL: Ensure LAYER_CONFLICTS_SHADOW is on top of displayed layers.
The visibility of conflicts is better.
2024-10-10 14:27:30 +02:00
Alex Shvartzkop 63b89688df Support libgit2 v1.8.2+
In v1.8.2-rc1, the type change introduced in v1.8.0 was reverted.

See https://github.com/libgit2/libgit2/commit/49d3fadfca4ce8e7a643525eb301a2d45956641e

(cherry picked from commits 74e15a3fc2 and 4c196e1486)
2024-10-07 17:25:58 +03:00
Wayne Stambaugh ab9a4295a0 Tag stable version 8.0.6 release candidate 1. 2024-10-06 15:39:47 -04:00
Alex Shvartzkop e6ce4eb73e Altium PCB: convert small arcs in line chain to segments to avoid overflow issues.
Can be seen on "mb1932-bdp", for example.
2024-10-06 13:43:16 +03:00
Alex Shvartzkop 86f122416b Altium PCB: improve default textbox alignment when isJustificationValid flag is not set.
While there is an example where the default text frame justification is center-center,
in other cases it should be left-bottom, but we don't know what controls this yet.

An example where text frames should be imported with center-center justification:
https://github.com/FpgaDigital/RK3328/blob/830d51b80c77aba6c7570d273521770dfeeee0f9/RK3328.PcbDoc

But in "mb1897-bdp.zip" from https://gitlab.com/kicad/code/kicad/-/issues/18784
text frames should use left-bottom justification.
2024-10-06 13:31:22 +03:00
Alex Shvartzkop be91576758 Altium PCB: support having 103 remaining bytes in ATEXT6 subrecord.
This improves text justification. For example, in:
https://github.com/peng-zhihui/Project-Quantum/blob/71654ca4e4d309e45997a75821f18d0186a08c00/1.Hardware/Electron-Aduino/Electron.PcbDoc
2024-10-06 12:58:26 +03:00
Alex Shvartzkop 784c2cda5a Decode UTF-8 for component field values in backannotation parser.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18406
2024-10-06 12:03:33 +03:00
Mark Roszko 836de8d233 Bump kicad-vcpkg for wx
(cherry picked from commit 04cc05645f)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-10-05 11:39:24 +00:00
Wayne Stambaugh ac01d1986f Remove debugging output from last commit.
(cherry picked from commit 90ed4bae99)
2024-10-04 12:24:17 -04:00
Wayne Stambaugh 8a0693d328 Show schematic parity tab in DRC dialog when parity marker is selected.
(cherry picked from commit 7228321b5d)
2024-10-04 12:23:14 -04:00
Wayne Stambaugh 2a62ffe32d Update hierarchy navigator when sheet schematic file is changed. 2024-10-03 12:29:00 -04:00
Wayne Stambaugh cb895c9710 Fix schematic hierarchy navigator refresh issues.
The hierarchy navigator was failing to update properly on undo/redo and
when the referenced schematic file of a sheet was changed.

(cherry picked from commit a871311b6f)
2024-10-03 10:14:58 -04:00
John Beard 52a73986bc Pcbnew: Fix aligned dimension flipping
https://gitlab.com/kicad/code/kicad/-/issues/16317
(cherry picked from commit 304d9e0006)
2024-10-03 14:31:21 +01:00
Mark Roszko 15582773bd Update our vcpkg ports 2024-10-02 22:03:28 +00:00
Wayne Stambaugh fc3435113d Fix annotation issue loading legacy schematics.
Commit 83de056de9 broke loading legacy schematics that are not shared.
Legacy schematics do not contain instance data "AR Path=" entries when
the schematic file was not shared.  The reference and unit information
was only stored in the symbol reference field and unit entries in the
symbol definition.

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

(cherry picked from commit 21dd41eeb2)
2024-10-02 11:16:09 -04:00
jean-pierre charras 801492b708 Add forgotten fix in commit 8c25e5b6 2024-09-30 20:45:31 +02:00
jean-pierre charras 8c25e5b68e kicad-cli: ensure plotted layers in gerber export are restricted to enabled layers
From branch
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18811
2024-09-30 19:37:28 +02:00
Seth Hillbrand 1525da154f Update translations 2024-09-30 08:42:37 -07:00
Pferd O f2199eebf5 Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-30 17:42:06 +02:00
boonchai k 1a761bf6ce Translated using Weblate (Thai)
Currently translated at 71.7% (6593 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/th/
2024-09-30 17:42:06 +02:00
CloverGit 21f8b23ade Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-30 17:42:06 +02:00
Pferd O 4fc82b97cf Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-30 17:42:06 +02:00
ssantos 721e7359b3 Translated using Weblate (Portuguese)
Currently translated at 99.9% (9182 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt/
2024-09-30 17:42:06 +02:00
co8 j 7e0c822451 Translated using Weblate (Japanese)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:06 +02:00
co8 j 6d9160ea31 Translated using Weblate (Japanese)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:06 +02:00
co8 j 31cc51fe42 Translated using Weblate (Japanese)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:06 +02:00
Pferd O c85ef81e6b Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-30 17:42:06 +02:00
CloverGit ddb29d6ab8 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-30 17:42:06 +02:00
Toni Laiho d666021572 Translated using Weblate (Finnish)
Currently translated at 99.8% (9175 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-09-30 17:42:05 +02:00
Frank Sonnenberg 360d6d87a4 Translated using Weblate (German)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-30 17:42:05 +02:00
CloverGit 97d3b369d5 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-30 17:42:05 +02:00
Trần Phi Hải 7936df3e1e Translated using Weblate (Vietnamese)
Currently translated at 26.1% (2408 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-09-30 17:42:05 +02:00
Trần Phi Hải eca370792a Translated using Weblate (Vietnamese)
Currently translated at 25.4% (2339 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-09-30 17:42:05 +02:00
Henrik Kauhanen af68514acd Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-30 17:42:05 +02:00
ZbeeGin a0e0f05977 Translated using Weblate (Polish)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-30 17:42:05 +02:00
co8 j 78c09b1e2f Translated using Weblate (Japanese)
Currently translated at 99.9% (9188 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:05 +02:00
Trần Phi Hải a2051132b5 Translated using Weblate (Vietnamese)
Currently translated at 23.7% (2187 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-09-30 17:42:05 +02:00
CloverGit a67bf40def Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-30 17:42:05 +02:00
Wellington Terumi Uemura 9b47650b4a Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-09-30 17:42:05 +02:00
Tokita, Hiroshi 748dd4f02c Translated using Weblate (Japanese)
Currently translated at 99.5% (9153 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-30 17:42:05 +02:00
Henrik Kauhanen 530167cf69 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-30 17:42:04 +02:00
jeong-sangwon 7d6e8853db Translated using Weblate (Korean)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-09-30 17:42:04 +02:00
Jon Evans 9f3631f0e9 Revert "Add ERROR_LOC to exports"
This reverts commit c8253a5018
2024-09-29 14:31:26 +00:00
Jon Evans c8253a5018 Add ERROR_LOC to exports
(cherry picked from commit 330150a6a6)

Co-authored-by: i404788 <404788@student.fontys.nl>
2024-09-29 13:36:26 +00:00
jean-pierre charras 3aaae7405d Pcbnew, Flip rectangle shape: Keep its anchor position after flipping.
Previously, it was flipped using the shape anchor position. But for this
shape, the anchor (top left corner)) is reinitialized after flipping, so
flipping twice moves the shape.
Now the rectangle center is used as reference position to flip the shape
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18797
2024-09-28 18:17:00 +02:00
jean-pierre charras f2e012119a Pcbnew: Fix issue when flipping a graphic segment (SHAPE_T::SEGMENT).
PCB_SHAPE::Normalize() normalized a graphic segment by (sometimes) swapping
start and end points. But it creates an issue when flipping a segment: the
reference point can be changed.
This normalization was made for DRC purpose when comparing 2 footprints.
Now, PCB_SHAPE::Normalize() does not change end points of a segment, and a
specific PCB_SHAPE::NormalizeForCompare() normalize fct is used for DRC compare.
2024-09-28 17:55:00 +02:00
JamesJCode 48b9027842 Fix deep cloning and RunOnDescendants for groups containing generators
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17710

(Cherry-picked from 903c743a60)
2024-09-26 19:03:32 +01:00
John Beard 0511926a4c Pcbnew: handle connected copper circle points
V8 inline implementation of aea42a5cdf,
since no KIGEOM helper functions.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18774
2024-09-25 18:43:29 +01:00
jean-pierre charras 1ac1a5bb3b Symbol Editor, align items on grid: do not modify shape of arcs and circles.
Previously, start and end points were moved, and therefore the shape itself was
modified. It was probably unexpected.
Now just align the arc start point or the circle center point on grid.
2024-09-21 18:09:48 +02:00
jean-pierre charras 6cfe4482f7 Simulator, TUNER_SLIDER: fix (minor) issues
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18746
2024-09-21 18:09:48 +02:00
jean-pierre charras 61680eacd4 PANEL_SETUP_LAYERS: fix issues for VIAs when reducing the copper layer count.
From master branch.
2024-09-21 18:09:48 +02:00
Wayne Stambaugh 3aef3818cd Fix broken library symbol links when importing CADSTAR schematics.
Under certain circumstances, the library symbol links were missing
the library nickname causing the schematic symbols to appear as if
the library symbol was missing.

Added a helper function to create the symbol library name to avoid
code duplication.

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

(cherry picked from commit 7acd057c86)
2024-09-21 11:51:03 -04:00
JamesJCode 355805756e Enable 'exclude_from_sim' property for DB libraries
(Cherry-picked from commit df869036e5)
2024-09-17 21:07:55 +01:00
jean-pierre charras 96acf00e81 fix incorrect code committed in commit 1dcd65ec 2024-09-17 15:27:31 +02:00
jean-pierre charras 1ad4fb2eea Convert graphic to polygon or zone: fix some issues:
- fix gap added twice
- add missing gap setting in DIALOG_COPPER_ZONE and DIALOG_NON_COPPER_ZONES_EDITOR

From master branch
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18724
2024-09-17 14:21:16 +02:00
jean-pierre charras 1dcd65ec71 3D viewer, minor fix: vias not fully displayed when the top layer was not shown.
From master branch.
2024-09-14 17:04:22 +02:00
jean-pierre charras 1109878da0 Pcbnew: Preferences/Fp editor/Default values: allow to remove defaut text items.
These texts/fields are not mandatory, so allow remove them from default texts list.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18663
2024-09-14 16:31:03 +02:00
jean-pierre charras 7a0803f384 PCB_DRAW_PANEL_GAL: Use TARGET_OVERLAY for LAYER_CONFLICTS_SHADOW.
This is a better option than TARGET_NON_CACHED, and giving better look.
2024-09-14 16:31:03 +02:00
jean-pierre charras 8f56d0b38e DRC and flipped Fp: the sorting function used by DRC now normalize segments.
From master branch
2024-09-14 16:31:02 +02:00
Wayne Stambaugh 9309f612ef Fix incorrect warning coordinates when updating board from schematic.
Use the X and Y axis inversion preference settings in the "PCB Editor"
"Origin & Axes" panel to invert the internal coordinates to display to
the user.

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

(cherry picked from commit 64d4dbb2e8)
2024-09-11 12:06:08 -04:00
Alex Shvartzkop d2b13060fe Fix build error due to SIM_MODEL_IBIS.
SIM_MODEL_KIBIS was renamed to SIM_MODEL_IBIS in master in commit 4e133ae83b,
but not in 8.0.
2024-09-11 15:04:31 +03:00
Seth Hillbrand 393a72216e Limit where type overrides can happen
IBIS requires the ability to override types but this is explicitly
forbidden to SPICE subcircuits.

(cherry picked from commit e01246a9d3)
2024-09-10 15:56:19 -07:00
Seth Hillbrand 76e50881fb Handle field types missing
If we do not have both a device and type for the sim model, return none
because we cannot parse it.  This is handled by the calling routines.
Otherwise, we would return raw spice type erroneously.
2024-09-10 12:25:31 -07:00
John Beard 9779ee0fd3 Fix Boost 1.86 SHA1 one last time
There's a change in Boost 1.86 that breaks the SHA1 hashing
in 3D cache.

The master KiCad branch ditches SHA1 entirely here, but it's quite
an invasive change to backport. So apply a sticking plaster for
the remainder of v8.

Relates-To: https://gitlab.archlinux.org/archlinux/packaging/packages/kicad/-/issues/1
2024-09-10 12:10:33 +01:00
John Beard 9fdd825681 KIID: Use Boost uuids own hash function (fix Boost 1.86)
Not only is this simpler, but it should be compatible
with all Boost versions (the cast is a problem in 1.86)
and it was also 'improved' in 1.86 for better mixing.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18651
(cherry picked from commit 9a3ebfba40)
2024-09-08 22:49:53 +01:00
Ian McInerney f4f9513f80 Fix compilation with Boost 1.86
Boost 1.86 removed the boost::random dependency from boost::uuid, so
we need to include those headers on our own now to use the random
mersenne twister implementation.

(cherry picked from commit a9e115925a)
2024-09-07 20:05:00 +01:00
Jeff Young d35431c888 Drawing sheet can't share glyph cache entries with editors.
(They use different internal units.)

Also fixes a fialure of CAIRO_GAL to reset the fill
and stroke after drawing outline glyphs.

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

(cherry picked from commit b549c4feec)
2024-09-07 17:59:24 +01:00
Jeff Young bcb7acf5c2 Use ORIGIN_TRANSFORMS in Mover Corner To... dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18479

(cherry picked from commit e6a5669d02)
2024-09-07 17:01:42 +01:00
Jeff Young 1e82ed302d Fix some contrast and update issues with sim cursors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18390

(cherry picked from commit e3d4137521)
2024-09-07 17:01:11 +01:00
Jeff Young 1fde8ea6f5 Improve PIN_TRICKS to handle pins with no names.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18535

(cherry picked from commit 528b74db7f)
2024-09-07 17:00:14 +01:00
John Beard dab3a38815 Satisfy Boost version polyfils in 8.0 2024-09-07 14:06:45 +01:00
John Beard c9db8f6bfc LSET doesn't have list ctor in 8.0 2024-09-07 13:08:29 +01:00
John Beard 3c655836df SEG: Correct sign in LineDistance
(cherry picked from commit 78cb6c1189)
2024-09-07 11:59:42 +01:00
Jon Evans 544b235910 Fix PNS log viewer after 03079a4f
(cherry picked from commit 0a816ce079)
2024-09-07 12:52:11 +03:00
Alex Shvartzkop bf34bf24ab Make simulation reporter warnings non-fatal.
Adds REPORTER::HasMessageOfSeverity for WX_STRING_REPORTER,
which allows us to show simulation warnings and fail only if there's errors.

Also fixes a crash when SPICE_GENERATOR_KIBIS throws an IO_ERROR.

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

(cherry picked from commit 36019314e9)
2024-09-07 12:38:27 +03:00
Alex Shvartzkop 6b199c52a1 Import POURED items as zone fills from EasyEDA/LCEDA Pro v2.2+ PCBs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18664
2024-09-07 12:23:05 +03:00
John Beard 94f667d87f Pcbnew: set mirrored when creating on back layer
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18643
(cherry picked from commit 9fac24fa0f)
2024-09-06 23:01:38 +01:00
John Beard 464c3815b9 Pcbnew: Ensure items are rescued to an enabled layer
(cherry picked from commit f78329e2af)

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18553
2024-09-06 21:59:12 +01:00
John Beard 53732e2276 Pcbnew: handle all zone layers when rescuing items
(cherry picked from commit 2befd31fd6)

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18553
2024-09-06 21:59:11 +01:00
John Beard bd554a5808 Pcbnew: don't assume zones are in the UiOrder list
This can be false, for example when zones are being rescued,
even if the LSET is non-zero-sized.

(cherry picked from commit 1662d7f546)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18553
2024-09-06 21:59:11 +01:00
JamesJCode b48051d52f PNS: Update track widths during routing
(Cherry-picked from commit 3f2b6f7ae0)
This allows routing through, for example, neck downs defined
based on courtyard DRC rules
2024-09-06 19:18:20 +01:00
JamesJCode 03079a4f4f PNS: Check for nearest segment anchor for initial track constraints
(Based on cherry-pick from commit c39551b032)
2024-09-06 19:18:20 +01:00
JamesJCode 6daa857c2d Mask PCB_TEXTBOX properties that are not supported
Masks EDA_SHAPE "Filled" property for PCB_TEXTBOX objects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18640
2024-09-06 19:18:20 +01:00
Wayne Stambaugh 5a1f60a7c6 Begin version 8.0.6 development. 2024-09-06 12:30:24 -04:00
Wayne Stambaugh e8553dcdf7 Tag stable version 8.0.5. 2024-09-06 12:28:40 -04:00
Alex Shvartzkop dc3012933a Restore a string in Altium parser. 2024-09-06 19:13:28 +03:00
Seth Hillbrand 291ff615bc Update translations 2024-09-06 09:03:13 -07:00
Hanna Breisand 26d1080e52 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Oliver0804 c1452a24d2 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.3% (9127 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-09-06 18:02:20 +02:00
Hanna Breisand 34c833966f Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Julio Dias f0e1bc3562 Translated using Weblate (Portuguese)
Currently translated at 99.1% (9111 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt/
2024-09-06 18:02:20 +02:00
Allan Nordhøy 6da9034322 Translated using Weblate (Norwegian Bokmål)
Currently translated at 48.6% (4467 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nb_NO/
2024-09-06 18:02:20 +02:00
김랑기 6887e8cbe3 Translated using Weblate (Korean)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-09-06 18:02:20 +02:00
Hanna Breisand 89ef5986e7 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
김랑기 5572a72bb3 Translated using Weblate (Korean)
Currently translated at 99.5% (9152 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-09-06 18:02:20 +02:00
Tokita, Hiroshi b40e446149 Translated using Weblate (Japanese)
Currently translated at 99.5% (9150 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-06 18:02:20 +02:00
Toni Laiho 757bfd7b32 Translated using Weblate (Finnish)
Currently translated at 99.7% (9165 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-09-06 18:02:20 +02:00
Henrik Kauhanen c5e1c3db62 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
dsa-t b25ff44ff7 Translated using Weblate (Russian)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-09-06 18:02:20 +02:00
Jan Straka cad7a18fa0 Translated using Weblate (Czech)
Currently translated at 84.1% (7731 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-09-06 18:02:20 +02:00
CloverGit 1c3637cb33 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:20 +02:00
Hanna Breisand 3a5f84d1ec Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Henrik Kauhanen 44f8df592b Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
CloverGit 17e19f8652 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9188 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:19 +02:00
Hanna Breisand 34fe104431 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Henrik Kauhanen 2bdb155838 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Andrej Valek 22ebade907 Translated using Weblate (Slovak)
Currently translated at 64.7% (5955 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-09-06 18:02:19 +02:00
Dmitry Mikhirev 9d594214fe Translated using Weblate (Russian)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-09-06 18:02:19 +02:00
Peter B 2c89717c0a Translated using Weblate (Romanian)
Currently translated at 27.1% (2491 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ro/
2024-09-06 18:02:19 +02:00
Grzegorz Szymaszek 7574a46a19 Translated using Weblate (Polish)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:19 +02:00
ZbeeGin e5c4d75ce1 Translated using Weblate (Polish)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:19 +02:00
CJ van der Hoeven f038ee3083 Translated using Weblate (Dutch)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-09-06 18:02:19 +02:00
Pferd O e1ab2a0836 Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-06 18:02:19 +02:00
CloverGit 9070d9ff22 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.8% (9181 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:19 +02:00
Henrik Kauhanen 606c19780d Translated using Weblate (Swedish)
Currently translated at 99.7% (9172 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Hanna Breisand 8fecebb209 Translated using Weblate (Swedish)
Currently translated at 99.7% (9172 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Peter B da8e1be1c8 Translated using Weblate (Romanian)
Currently translated at 27.0% (2490 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ro/
2024-09-06 18:02:18 +02:00
Wellington Terumi Uemura e14a3caf18 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-09-06 18:02:18 +02:00
Marek 5afb3ad5cc Translated using Weblate (Polish)
Currently translated at 99.9% (9188 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:18 +02:00
Ulices b29ca47f25 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-09-06 18:02:18 +02:00
Alex Shvartzkop 5d1737d654 Fix compatibility with EasyEDA/LCEDA Pro v2.2.26
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18620

(cherry picked from commit 16d9fa7f25)
2024-09-06 16:04:24 +03:00
Alex Shvartzkop bdc371f057 Altium PCB import: fix textbox and text placement.
Especially when rotated and/or mirrored.

It's not perfect but it's close enough to being correct.

See https://gitlab.com/kicad/code/kicad/-/issues/18417
2024-09-05 03:52:22 +03:00
Alex Shvartzkop dc2dd20ec7 Altium PCB import: don't add stroke width to text height.
For stroke fonts, KiCad's metrics are very similar to Altium's,
so there's no need to add more height.
2024-09-05 03:52:18 +03:00
Alex Shvartzkop 057174caa0 Altium PCB import: don't override text alignment in ConvertTexts6ToEdaTextSettings.
It is set already at callsite, no need to override.
2024-09-05 03:52:12 +03:00
Alex Shvartzkop 4b035d5b5c Altium PCB import: convert arcs with very small angle to segments.
See mb1791_bdp.zip for example.
2024-09-05 03:52:08 +03:00
jean-pierre charras b22948988f Fix a side effect of commit 513d659c (master) or 55fafe34 (8.0 branch)
This commit modify the order of end points of flipped graphic lines, and
create a DRC issue for flipped footprints (if flipped before this commit).
For segments inside a footprint, the "old" way to flip a segment is now
reused. Expecting this ugly fix is only temporary.
2024-09-03 16:17:31 +02:00
Seth Hillbrand 7a05d58b3e Fix some textbox imports
We still don't know why some Altiums seem to save 0s for the textbox
size when dealing with text strings and some still save values.  There
must be another flag to differentiate between text strings and text
boxes but we haven't found it yet.  But until then, we still need to
link the correct string with the textbox that we generate and suppress
the border

(cherry picked from commit 5332d44bad)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18502
2024-09-02 16:23:28 -07:00
Jon Evans 695ab290e6 Add swig4.2 for linux platforms find
(cherry picked from commit 723fa57b84)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-08-30 15:28:00 +00:00
Jeff Young 54a373a7e2 Push thickness handling down into EDA_TEXT::SetBold().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17077

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

(cherry picked from commit aef87b9796)
2024-08-28 13:47:29 +01:00
jean-pierre charras 637f331724 French translation update 2024-08-28 14:17:35 +02:00
Wayne Stambaugh 931a9697ca Tag stable version 8.0.5 release candidate 1. 2024-08-26 17:15:42 -04:00
Seth Hillbrand 5ffc58844f Update translations 2024-08-26 14:05:46 -07:00
Hanna Breisand 3ea2c6f1ff Translated using Weblate (Swedish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-08-26 23:03:53 +02:00
Balázs Meskó 2cba724659 Translated using Weblate (Hungarian)
Currently translated at 3.3% (312 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/hu/
2024-08-26 23:03:52 +02:00
Ulices 254260a616 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-08-26 23:03:52 +02:00
Pferd O 45b13d513b Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:52 +02:00
CloverGit ba86c3ac75 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
YÜKSEL AÇIKGÖZ 19d4c31fcc Translated using Weblate (Turkish)
Currently translated at 59.4% (5470 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:52 +02:00
CloverGit 160f69d720 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 4fa42960e9 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 9c4ca6da14 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
Jan Straka c113385016 Translated using Weblate (Czech)
Currently translated at 83.8% (7710 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-08-26 23:03:52 +02:00
Henrik Kauhanen 68e37a93ec Translated using Weblate (Swedish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-08-26 23:03:52 +02:00
109247019824 9b158e70f5 Translated using Weblate (Bulgarian)
Currently translated at 7.6% (704 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/bg/
2024-08-26 23:03:52 +02:00
Free_squire ab536192c3 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:52 +02:00
Tokita, Hiroshi bc87b0db60 Translated using Weblate (Japanese)
Currently translated at 99.4% (9140 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-08-26 23:03:52 +02:00
ivit VT 981f82db93 Translated using Weblate (Czech)
Currently translated at 82.9% (7624 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-08-26 23:03:52 +02:00
CloverGit b6f5aeba1e Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 4fa34677ea Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:51 +02:00
Ulices c67346991f Translated using Weblate (Spanish (Mexico))
Currently translated at 99.6% (9165 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-08-26 23:03:51 +02:00
Laurens Holst 811de6a462 Translated using Weblate (Dutch)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-08-26 23:03:51 +02:00
YÜKSEL AÇIKGÖZ cfe7992723 Translated using Weblate (Turkish)
Currently translated at 59.3% (5456 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:51 +02:00
Pferd O 8c84f2ac23 Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
YÜKSEL AÇIKGÖZ fb23d62b6b Translated using Weblate (Turkish)
Currently translated at 58.5% (5383 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:51 +02:00
dsa-t 84f182ef03 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:51 +02:00
Ignas Brašiškis 987d151977 Translated using Weblate (Lithuanian)
Currently translated at 50.7% (4670 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/lt/
2024-08-26 23:03:51 +02:00
Toni Laiho c622da5fbf Translated using Weblate (Finnish)
Currently translated at 99.8% (9182 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-08-26 23:03:51 +02:00
Pferd O 19f163b724 Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
ZbeeGin 3fcf207443 Translated using Weblate (Polish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-08-26 23:03:51 +02:00
Pferd O 4814f29fbd Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
Alex Life 39f4ea5ffa Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:51 +02:00
tct123 5d08531ecb Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
Pferd O 4a0fdfd2ab Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
CloverGit c88aab3a4f Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:51 +02:00
Seth Hillbrand bf4aebff4d Update Altium importer to use textbox flag
Textboxes in Altium might have intrinsic borders that don't count in
their text width, so we need to buffer this in KiCad

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

(cherry picked from commit ecd27883b6)
2024-08-26 14:02:35 -07:00
Alex Shvartzkop 39627bfcfa Parse more Altium data related to Text6.
(cherry picked from commit 881d0184bb)
2024-08-26 13:22:23 -07:00
jean-pierre charras 55fafe3401 Fix incorrect flip for graphic segments.
For some obscure reason, the end points of segments were swapped.
Note graphic RECTANGLE shapes have still an issue when flipped, but this
is a very different issue.
From master branch
2024-08-26 19:50:39 +02:00
jean-pierre charras dd870deec5 RENDER_SETTINGS: try a slightly modified dot calculation. 2024-08-25 17:18:30 +02:00
jean-pierre charras 7ecf18ba80 EEschema, print: fix incorrect sheet order and uninitialized sheet number
The displayed sheet number was not updated.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18594
2024-08-25 16:14:43 +02:00
jean-pierre charras 68e4ccf196 RENDER_SETTINGS: fix issue when using dotted lines.
At some levels, these lines (drawn as dots) were not visible.
They are now drawn as short lines.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16757
2024-08-24 20:48:02 +02:00
jean-pierre charras 0a28398944 Gerbview: fix arc to segment approximation when drawing Regions (polygons)
The approx was 36 segments per 360 deg. But this is not good for arcs having
a small arc angle and a large radius.
The fix uses a max error (currently 5 microns) to calculate the approximation.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18587
2024-08-23 10:47:55 +02:00
jean-pierre charras 27002f568b BOARD::GetBoardPolygonOutlines(): Protect against malformed NPTH pads
In some cases, when modifying a pad (SMD -> NPTH from properties panel, one
can generate a NPTH pad with a zero sized hole. Pcbnew can crash with such a pad,
especially if the 3D viewer is shown during modification.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18585
2024-08-22 11:12:47 +02:00
Maciej Suminski 9b5840b7ee Text variable resolving in footprint text boxes
Mostly a code copy from PCB_TEXT::GetShownText() to
PCB_TEXTBOX::GetShownText().

Cherry-picked 5ad5be09 (sans m_ResolveTextRecursionDepth advanced
config, not present in 8.0).
2024-08-17 00:08:14 +00:00
Mark Roszko 5a3f8b4235 Disconnect events in ~ACTION_TOOLBAR 2024-08-16 07:13:39 -04:00
Mark Roszko 7be78d50a4 Unbind events in KISTATUSBAR destructor 2024-08-16 07:04:40 -04:00
Mark Roszko b1f861137e Add missing unbinds to STD_BITMAP_BUTTON 2024-08-16 07:04:35 -04:00
Mark Roszko 3e3a958d4f Add missing unbind to PANEL_KICAD_LAUNCHER 2024-08-16 07:04:30 -04:00
Mark Roszko cc5a3eb61f Disconnect events used in EDA_BASE_FRAME 2024-08-16 07:03:16 -04:00
Mark Roszko eabf2f57aa Don't see horizontal layout on the vertical toolbar
Wild glitching on arm64 Windows revealed this was set, lol.
2024-08-16 07:02:53 -04:00
Mark Roszko 1667b1312e Unbind the char events in KICAD_MANAGER_FRAME destructor 2024-08-16 07:02:15 -04:00
Mark Roszko 1123a25f04 unbind/disconnect in PROJECT_TREE_PANE destructor 2024-08-15 22:26:28 -04:00
Mark Roszko ef757ffd28 Unbind BITMAP_BUTTON events during destruct 2024-08-15 22:26:02 -04:00
JamesJCode f63d018f1c PNS: Use correct diff pair width / gap settings when starting route
(cherry picked from commit 364f6d4213)
2024-08-15 19:52:03 +01:00
Wayne Stambaugh 83de056de9 Fix missing schematic symbol instance data.
This fix adds missing symbol instance data that defaults the instance
data to no annotation which will will trigger a annotation request on
any operations that require a fully annotated schematic.

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

(cherry picked from commit 0cf1110367)
2024-08-15 07:31:25 -04:00
JamesJCode 015906d862 PNS: Include net when querying DRC for initial track width
(cherry picked from commit 67b9170146)
2024-08-15 09:09:06 +01:00
Jan Wichmann c288c469fb pcbnew: The checkbox 'Center on footprint' was not disabled when the actionButton was changed. 2024-08-14 21:40:18 +00:00
JamesJCode 7a8efc1d27 Report track clearance constraint from DRC rule if >= board minimum
(cherry picked from 013fa4824b)
2024-08-14 22:11:35 +01:00
JamesJCode aaaa8a8835 Use correct track width constraint when starting PNS from footprint
(cherry picked from a6a62b1be5)
2024-08-14 22:07:09 +01:00
JamesJCode 2891c580b1 Correctly handle track clearance constraints in router
(cherry picked from 72a0c41e3d)
2024-08-14 21:48:46 +01:00
Seth Hillbrand 97d75ae844 Remove last cherry-pick
Already existed in 8 branch.
2024-08-14 13:41:03 -07:00
Seth Hillbrand 7ccc89196b Avoid losing the last point when simplifying
line chains that are not closed should avoid simplifying between
beginning and end points.  Make sure that we keep the finishing point
for these chains

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

(cherry picked from commit b71eb1186f)
(cherry picked from commit 6ed537753c)
2024-08-14 13:05:40 -07:00
JamesJCode 7774145a8f Update message panel when placing a via with interactive router
(cherry picked from commit 41ff744f1e)
2024-08-14 17:40:19 +01:00
Kacper Słomiński 0bf2d2ca32 Fix build issue with experimental GCC version 15.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18539

(cherry picked from commit e6bcc6d0a6)
2024-08-14 07:48:02 -04:00
jean-pierre charras 6338a69f17 Pcbnew: fix 2 issues after removing a track, especially ending on a teardrop
- Message panel display not always correctly updated (shows an old data)
- Incorrect updated ratsnest is some cases when removing a track ending on
a teardrop.

From master branch.
2024-08-14 08:27:22 +02:00
Jeff Young 5f8ba6f9a1 Revert commit not meant for 8.0. 2024-08-13 21:30:20 -06:00
Jeff Young a53bbd92f5 Don't presume CreatePin/RepeatPin() return something.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18540

(cherry picked from commit 7c4fe35589)
2024-08-13 21:13:07 -06:00
Jeff Young aa71423d5f Fix missing parameter.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18530

(cherry picked from commit 8a487c2c86)
2024-08-13 21:11:23 -06:00
Jeff Young f3ae7afec2 Set sheetpath for ERCE_MISSING_UNIT errors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18445

(cherry picked from commit 22d37f6c34)
2024-08-13 21:11:15 -06:00
Mark Roszko 29194761e5 Update vcpkg-configuration.json 2024-08-13 23:49:44 +00:00
Jon Evans f56c05ac3e Fix broken cherry-pick 2024-08-12 23:06:56 -04:00
Jon Evans 15256b379c Ensure constraints when changing pad hole properties
Also expose hole shape to properties system

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

(cherry picked from commit c9af2f318f)
2024-08-12 23:06:09 -04:00
Jon Evans b4113decc5 Fixes for snapping in free via placer
Support snapping to graphics at all
Don't skip snapping to pads with no net
Treat placing vias as placing tracks for magnetic settings

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


(cherry picked from commit 960a9ef7d5)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-08-13 02:49:34 +00:00
aris-kimi b249932888 Fixes cherry-pick for 2 previous commits 2024-08-11 21:54:18 +00:00
Jeff Young 6b6057b194 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/18472

7f6ab7043b from master
2024-08-11 21:54:18 +00:00
aris-kimi b9623e9359 Fixes a crash when ctrl+x a kicad var from the field
and leave as a starting char '/'

Also fixes a typo and updates the wxFormBuilder file

e59417aff3 from master
2024-08-11 21:54:18 +00:00
Wayne Stambaugh 735b05ba30 Add '?' to list of forbidden file name characters.
(cherry picked from commit aace2271df)
2024-08-11 07:19:35 -04:00
jean-pierre charras 62724f9cb6 pcbnew, PCB_IO_ALTIUM_DESIGNER: fix issues when converting a lib to kicad format.
- add the patch from RigoLigoRLC
- fix issue with illegal chars in filename the char * was missing in list.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18452
2024-08-11 09:30:22 +02:00
Wayne Stambaugh 2e4dd4bc3f Fix CLI PCB drill export when output path does not end with path separator.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14438

(cherry picked from commit b6734c42f0)
2024-08-07 16:18:25 -04:00
jean-pierre charras 87139ce571 3E viewer: fix incorrect custom pad shape in some cases.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18495
2024-08-06 13:50:25 +02:00
jean-pierre charras 582d2e7bdb PCB_IO_GEDA: fix broken function GetEnumeratedFootprint().
The code was old and not updated to actual io code.
Just removed to use the generic code.
From master branch
2024-08-05 20:21:11 +02:00
Jeff Young 5c89937870 Make target length sticky within a session.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18109

(cherry picked from commit 937854c577)
2024-08-01 14:38:43 +01:00
Jeff Young 412e244d48 Text is a single-click-place.
Also, don't run normal undo code when in the middle of
placing an item.

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

(cherry picked from commit f6c723ba37)
2024-08-01 14:38:38 +01:00
jean-pierre charras 0940565025 DIALOG_SIM_MODEL: fix a focus issue (missing aEvent.Skip()).
From master branch.
2024-07-31 16:45:02 +02:00
jean-pierre charras c5b2e859c1 DRC test: Fix missing filter of DRCE_OVERLAPPING_FOOTPRINTS test.
When the DRCE_OVERLAPPING_FOOTPRINTS tests were disabled, the markers were
still created, because the code that created them did not test if the
DRCE_OVERLAPPING_FOOTPRINTS drc test is enabled or not.
From master branch
2024-07-30 14:21:36 +02:00
jean-pierre charras e06a8131c5 pcbnew: fix a bug when pasting a footprint (after a copy command)
The paste code removed items managed by the footprint when they are not on
an enabled layer.
This is a bug: all items must be kept in the parent footprint.
This is the only one command that tried to remove such items.
Other commands (Ctrl+D, load Footprint and read netlist) do not delete any item

Frm master branch
2024-07-28 20:08:18 +02:00
jean-pierre charras 16dee8608b DIALOG_FOOTPRINT_CHOOSER: fix some min sizes to avoid not visible widgets.
From master branch
2024-07-28 12:31:49 +02:00
Jeff Young 396e531e7c Cleanup. 2024-07-23 11:36:56 +01:00
Jeff Young 24c234fd93 Don't attempt to rename field more than once.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18330

(cherry picked from commit e9d376c912)
2024-07-23 11:36:56 +01:00
Jeff Young fdbe35e20c Give padstack warning violation a name.
Also regularises capitalisation & parens in some error
messages.

Also de-duplicates hole testing for PTH pads, and SMD
rationality testing.

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

(cherry picked from commit 8b948e7b9c)
2024-07-23 11:36:56 +01:00
Jeff Young cc3e3ee34c Clear fields when flag is set.
Also make sure we set aUpdated when deleting extra
text items or fields, and when updating fabrication
attributes or 3D models.

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

(cherry picked from commit dab3972165)
2024-07-23 11:36:56 +01:00
Jeff Young d0da1725ca Allow deleting text item out of parent footprint in PCB editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18425

(cherry picked from commit 87ee56b582)
2024-07-23 11:36:56 +01:00
Alex Shvartzkop 7e115249af Hide notification panel on focus loss.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17295
2024-07-22 13:33:08 +03:00
Jeff Young 07e8edfcdf Remove asserts for valid states.
(A pin won't have a connection until after the connection
graph has been rebuilt.)

KICAD-6S1

(cherry picked from commit c378e6f690)
2024-07-21 21:01:14 +01:00
Jeff Young cbb2c187bd Fix scoping of lock.
(cherry picked from commit d5c7ac5065)
2024-07-21 21:01:14 +01:00
Alex Shvartzkop 011018b002 Improve alignment of KiCad 16/24/32 px icons.
(cherry picked from commit 5b2ea411f8)
2024-07-21 21:29:42 +03:00
Alex Shvartzkop d3a44607e6 Generate hidpi variants for mid size (_24) application icons.
(cherry picked from commit 0e66adbca1)
2024-07-21 21:29:42 +03:00
Jeff Young 1ad3532740 Ooops. That commit wasn't for 8.0 (as the var doesn't exist there). 2024-07-21 13:40:14 +01:00
Jeff Young 26caad8b35 Tidy up string find API usages.
(cherry picked from commit bab97f91cc)
2024-07-21 13:40:14 +01:00
Alex Shvartzkop f1da2e90d7 Fix EasyEDA/JLCEDA Pro 2.2 footprint/symbol library import.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18250

(cherry picked from commit 1613816e77)
2024-07-21 15:38:57 +03:00
Alex Shvartzkop 59492bd947 Add mutex include.
(cherry picked from commit cc96de29e6)
2024-07-21 15:26:58 +03:00
Jeff Young 7b96cc3d0c Hand-cherry-pick some fixes from master. 2024-07-21 13:22:01 +01:00
Jeff Young df873158bc Slight increase to round-off error tolerance.
(It's now 2nm, which is still significantly below the
clearance DRC epsilon of 500nm.  It's also what we
already use in EDA_SHAPE.)

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

(cherry picked from commit c8e8545e47)
2024-07-21 13:22:01 +01:00
Jeff Young f88e1aa279 Fix uninitialized variable.
(cherry picked from commit 1833330e5c)
2024-07-21 13:22:01 +01:00
Alex Shvartzkop a02f12c68a std::set::contains is C++20-only, use find instead. 2024-07-21 15:18:44 +03:00
Alex Shvartzkop cc141e346d Tweak GRID_CELL_STC_EDITOR offset on GTK.
(cherry picked from commit ab531a33d9)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop f5954b0d7d Fix some warnings.
(cherry picked from commit affcfed677)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop 6bb1e59e10 Improve grid cell editors appearance.
(cherry picked from commit 76b7cdd128)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop ced6b1cbb7 Improve custom grid cell editors' margins on MSW.
(cherry picked from commit 1516aaf163)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop d1d7d0eb05 Remove macOS size tweak in custom grid cell editors.
Since the text field now has the no-border flag, it shouldn't be needed.

(cherry picked from commit aa51cc5167)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop e1e196f1b1 Fix default cell alignment and FBP file for Configure Paths dialog.
(cherry picked from commit 49dcd5f4fc)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop b55d760cd5 Make grid cell editors with extra button consistent with normal text cell editors.
(cherry picked from commit 5d22c1adee)
2024-07-21 13:40:21 +03:00
Alex Shvartzkop b0a0408528 Create STATUS_TEXT_POPUP on demand when moving PCB items.
So we don't have to spend 115 ms destroying it.

(cherry picked from commit 8d7c60eb3e)
2024-07-21 13:31:45 +03:00
Alex Shvartzkop d238a149a6 Send data to correct sch port when changing selection in PCB editor.
Not that cross-probing works like this though.
But this prevents the UpdateAllLayersColor call.
(-356 ms in https://gitlab.com/kicad/code/kicad/-/issues/18148)

(cherry picked from commit e2b5f4559e)
2024-07-21 13:31:03 +03:00
Alex Shvartzkop 57d2f7209a Use std::set::contains instead of alg::contains in UpdateTeardrops.
(-356 ms on https://gitlab.com/kicad/code/kicad/-/issues/18148 when placing)

(cherry picked from commit 70296107b4)
2024-07-21 13:30:39 +03:00
Alex Shvartzkop 8d08992c24 Shut down curl operations before global cleanup.
Fixes KICAD-7DP
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17103

(cherry picked from commit 0a53fc41a7)
2024-07-21 13:28:31 +03:00
Alex Shvartzkop 9938e7f723 Don't limit ngspice netlist lines to 1024 bytes.
Otherwise the loop just makes infinite 1-byte allocations
and keeps appending \n.

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

(cherry picked from commit a1b4e09cec)
2024-07-21 13:27:53 +03:00
Alex Shvartzkop 17ad578675 QA: add another test case for SHAPE_LINE_CHAIN::Slice.
This causes it to break on MSVC Release as well.

See https://gitlab.com/kicad/code/kicad/-/issues/18391

(cherry picked from commit 0e4ed5a032)
2024-07-21 13:25:57 +03:00
Alex Shvartzkop 044dd59c5c QA: add two more tests for SHAPE_LINE_CHAIN::Slice.
"Case 9: Start at middle of a 2nd arc, finish at end" should throw a fatal assert in Debug.

See https://gitlab.com/kicad/code/kicad/-/issues/18391

(cherry picked from commit 0b06ed987e)
2024-07-21 13:25:57 +03:00
Alex Shvartzkop 6ef90cfa18 Add bounds checking when slicing SHAPE_LINE_CHAIN from the middle of the last arc.
(and said arc is the last shape in the chain)

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

(cherry picked from commit 63eac0382c)
2024-07-21 13:24:17 +03:00
Jeff Young 7abf4c2d91 Save visible columns to correct settings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18352

(cherry picked from commit 22321c93f0)
2024-07-21 11:16:57 +01:00
Jeff Young 896ff72019 Formatting.
(cherry picked from commit 8ae111bd82)
2024-07-21 11:16:57 +01:00
jean-pierre charras 9c2eeb54fc Ensure non handled text properties are never written in .kicad_pcb files
ctl_flags.h: fix two duplicate flag values.
From master branch
2024-07-21 08:46:44 +02:00
jean-pierre charras 69f583660f Move all CTL_OMIT_xxx flags definitions into a new file ctl_flags.h
Previously, they were defined in different files, and sometimes redefined.
This change should not create an actual code change.
However, this move shows there are the same value used for different flags,
so another fix should be made later.

From master branch
2024-07-21 08:46:44 +02:00
Mark Roszko 6334c733e1 Update 2 files
- /vcpkg-configuration.json
- /vcpkg.json
2024-07-21 01:19:06 +00:00
Mathieu Pilato a50144f889 Fix measurement format not saved when modified
Always update stored measurements name / format when updating measurement

(cherry picked from commit c8aa3f21aa)
2024-07-20 21:52:05 +01:00
Mathieu Pilato 1ed85d521d Move default format inside SPICE_VALUE_FORMAT
This ensures that the default format is the same, however the measurements are added

(cherry picked from commit 75141da53a)
2024-07-20 21:52:01 +01:00
Mathieu Pilato 793790b359 Fix spice errors when rerunning a simulation with measurements
Mark the simulation as not finished before starting it, preventing measurements from being requested
from spice right before simulation starts

(cherry picked from commit a5b7c65d7a)
2024-07-20 21:51:58 +01:00
Mathieu Pilato 154112d4cc Clear measurement grid while changing tab
Prevent a tab change while editing measurement from impacting measurements of target tab

(cherry picked from commit 98b4a58059)
2024-07-20 21:51:54 +01:00
Mathieu Pilato 97d8ddeb4f Fix measurements not being loaded with workbook
onPlotChanging() was overwriting loaded measurements. Do not read grid from onPlotChanging().

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

(cherry picked from commit c6e8838178)
2024-07-20 21:51:51 +01:00
Mathieu Pilato 4809b00206 Increase default measurement precision to 3 digits
(cherry picked from commit 414ac2b83c)
2024-07-20 21:51:47 +01:00
Jeff Young 5bc1040a8b Fix missing From_UTF8().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18406

(cherry picked from commit 756445dd19)
2024-07-20 21:26:52 +01:00
Jeff Young f6c8dbe81e Fix RecombinePad when pad is rotated.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18348

(cherry picked from commit 556efd836b)
2024-07-20 21:26:52 +01:00
Jeff Young 0280989920 Undo for Repeat Pin.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18261

(cherry picked from commit 0b4d0bcb6c)
2024-07-20 21:26:52 +01:00
Jeff Young 0b762fb804 Show footprint change/update immediately.
Also, don't deselect selected footprints.

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

(cherry picked from commit e450258c0f)
2024-07-20 21:26:52 +01:00
Seth Hillbrand b71eb1186f Avoid losing the last point when simplifying
line chains that are not closed should avoid simplifying between
beginning and end points.  Make sure that we keep the finishing point
for these chains

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18409
2024-07-20 13:02:01 -07:00
Seth Hillbrand c78273cb99 Avoid throwing spurious substitution warnings
If the original font is a bold singleton (not a mod on a face), then we
need to avoid the mismatch between the bold marker and the asked-for
boldness.

At the end, if the font name is the same within case differences, then
it is the same font and we should not warn

(cherry picked from commit 0f84ddaf39)
2024-07-20 11:41:44 -07:00
Seth Hillbrand 26b8978b3e Fix potentially incorrect libid when using save as
If you use save as into a different library and change the symbol name
while overwriting an existing symbol, the libid didn't get updated,
leading to an error message when trying to load the newly saved symbol.

(cherry picked from commit b38357a5ea)
2024-07-20 11:41:44 -07:00
Jon Evans 618bbfda8d Support SWIG 4.1
(cherry picked from commit 58a2159fa9)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-07-19 22:49:52 +00:00
JamesJCode ee573a1480 Remove unnecessary erase of netclasses from netclass map
We start from an empty map now, so no need to delete entries
individually

(Cherry-picked from 90304e0639)
2024-07-16 20:37:22 +01:00
JamesJCode 20efc3b6e6 Resolve netclasses on vector buses embedded in buses
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16545

(Cherry-picked from 924b027503)
2024-07-16 19:57:54 +01:00
JamesJCode 8632e74c5c Update BOARD_LISTENERs after calculating connectivity
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18277
(For v8)
2024-07-16 19:57:54 +01:00
Wayne Stambaugh 6f35fd7058 Begin version 8.0.5 development. 2024-07-16 14:42:07 -04:00
Wayne Stambaugh 761bfcd291 Tag stable version 8.0.4. 2024-07-16 14:39:53 -04:00
Seth Hillbrand 7663928a66 Update translations 2024-07-16 11:00:39 -07:00
boromyr dd3c846f4a Translated using Weblate (Italian)
Currently translated at 99.9% (9191 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-07-16 20:00:06 +02:00
CloverGit 6877bc32bc Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-16 20:00:06 +02:00
Jan Straka 64564825c7 Translated using Weblate (Czech)
Currently translated at 82.8% (7616 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-07-16 20:00:06 +02:00
CloverGit b1ec1011b6 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-16 20:00:06 +02:00
Toni Laiho 80539790c3 Translated using Weblate (Finnish)
Currently translated at 99.8% (9181 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-07-16 20:00:06 +02:00
CloverGit 981772887a Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-16 20:00:06 +02:00
dsa-t 896b80652f Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-16 20:00:06 +02:00
Wellington Terumi Uemura 968cf4267a Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-07-16 20:00:06 +02:00
jean-pierre charras f3567cda99 Pcbnew, Properties panel: mask 2 properties irrelevant for pcb fields.
Color and Hyperlink properties have no meaning for pcb fields, but if set
created unreadable .kicad_pcb files.

From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18368
2024-07-14 14:06:29 +02:00
Seth Hillbrand df372baff8 Update translations 2024-07-11 09:41:19 -07:00
dsa-t dec96e6a77 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-10 23:46:07 +02:00
alevtina-karashokova 8a1de8c6f8 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-10 23:46:07 +02:00
dsa-t 255975f5fd Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-10 23:46:07 +02:00
Toni Laiho aa608ca147 Translated using Weblate (Finnish)
Currently translated at 99.8% (9181 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-07-10 23:46:07 +02:00
Seth Hillbrand 682b74f7d2 Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-07-10 23:46:06 +02:00
JamesJCode d662b2c34b Fix tuning pattern moves and undo / redo
(Cherry-picked from 230c297691)
2024-07-09 15:23:02 +01:00
Seth Hillbrand 7740c66479 Update translations 2024-07-08 09:55:01 -07:00
Seth Hillbrand 4d4f6a810c Properly count multiple Altium version settings
There is a fair amount of gradation in different Altium products

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

(cherry picked from commit 6aaaaad37f)
2024-07-08 09:54:46 -07:00
alevtina-karashokova d74dca3a7a Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-08 18:53:38 +02:00
Wellington Terumi Uemura 6513ca9168 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-07-08 18:53:37 +02:00
aris-kimi 6782bb73bd Translated using Weblate (Greek)
Currently translated at 99.8% (9177 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/el/
2024-07-08 18:53:37 +02:00
CloverGit 9c35689b04 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-08 18:53:37 +02:00
Ulices 8aff7cad17 Translated using Weblate (Spanish (Mexico))
Currently translated at 99.5% (9154 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-07-08 18:53:37 +02:00
Henrik Kauhanen c2c6cad525 Translated using Weblate (Swedish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-07-08 18:53:37 +02:00
alevtina-karashokova 9b17ec5d2d Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-08 18:53:37 +02:00
CloverGit e971f90adc Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (9158 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-07-08 18:53:37 +02:00
ZbeeGin 06c61a4831 Translated using Weblate (Polish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-07-08 18:53:37 +02:00
Laurens Holst 7977f0f745 Translated using Weblate (Dutch)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-07-08 18:53:37 +02:00
Seth Hillbrand 38a2b8eba7 Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-07-08 18:53:37 +02:00
Marco Ciampa 951f0065ed Translated using Weblate (Italian)
Currently translated at 99.9% (9191 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-07-08 18:53:37 +02:00
Bahtiyar Bayram 22c06c7ed8 Translated using Weblate (Turkish)
Currently translated at 57.3% (5269 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-07-08 18:53:37 +02:00
dsa-t 4f086271aa Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-08 18:53:37 +02:00
ZbeeGin 297999cb43 Translated using Weblate (Polish)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-07-08 18:53:37 +02:00
Arnau Llovet Vidal 91aec9ac7f Translated using Weblate (Catalan)
Currently translated at 47.3% (4354 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ca/
2024-07-08 18:53:37 +02:00
jean-pierre charras 9105b380c3 Fix compil issue created by my commit b2f8a43c (Windows only) 2024-07-07 15:39:42 +02:00
jean-pierre charras a285f86240 French translation update 2024-07-07 13:23:25 +02:00
jean-pierre charras b2f8a43c24 DIALOG_USER_DEFINED_SIGNALS: workaround to solve an issue on Windows.
See: https://gitlab.com/kicad/code/kicad/-/issues/15837
This is not a fix, but a workaround to make this dialog usable on Windows.
Without this workaround, it is barely possible to edit a user signal name.
The root cause needs to be fixed.
From master branch
2024-07-07 13:22:33 +02:00
Wayne Stambaugh 8383165269 Tag stable version 8.0.4 release candidate 2. 2024-07-01 16:20:03 -04:00
Seth Hillbrand bc8af77aba Fix docs redirect for v8 2024-07-01 12:57:57 -07:00
Seth Hillbrand 7d0e1670ee Update translations 2024-07-01 10:55:23 -07:00
jean-pierre charras 877f7daa2b do not flag an empty string as translatable.
(cherry picked from commit 1c9e96c89a)
2024-07-01 10:55:09 -07:00
Seth Hillbrand 4c563e5ef3 Update translations 2024-07-01 10:53:10 -07:00
Seth Hillbrand d6d6075a60 Translated using Weblate (Italian)
Currently translated at 99.9% (9190 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/it/
2024-07-01 19:21:15 +02:00
Pferd O 49c528f3ef Translated using Weblate (German)
Currently translated at 99.6% (9158 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-07-01 19:21:15 +02:00
Henrik Kauhanen ae1bccfb85 Translated using Weblate (Swedish)
Currently translated at 99.9% (9191 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-07-01 19:21:15 +02:00
dsa-t c2c13a5226 Translated using Weblate (Russian)
Currently translated at 100.0% (9193 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-07-01 19:21:15 +02:00
Toni Laiho 5b2e0d113a Translated using Weblate (Finnish)
Currently translated at 99.8% (9177 of 9193 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-07-01 19:21:15 +02:00
dsa-t 7ee8f786f2 Don't try to clear empty bitmap cache.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18310


(cherry picked from commit e5a5b59ac1)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-07-01 15:23:55 +00:00
Alex Shvartzkop bd14224b42 QA: remove 8.99 files for issue17967. 2024-07-01 14:47:38 +03:00
Seth Hillbrand ccfec170b0 Modify some int32 ops to avoid potential overflow
(cherry picked from commit f48a105357)
2024-07-01 14:30:43 +03:00
Seth Hillbrand 9852b535e7 Fix nl.po from bad merge 2024-06-30 11:16:44 -07:00
jean-pierre charras 758ac90069 SIMULATOR_FRAME_UI: catch all nlohmann::json::xxx errors.
Previously, only nlohmann::json::type_error was captured, and other errors
were not handled, creating unhandled exception issue when reading broken
*.wks files.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18309
2024-06-30 18:51:31 +02:00
Alex Shvartzkop 697ff382f8 Fix edit point ordering for arcs in symbol editor.
Was fixed for SCH_SHAPE in f6994702aa
but 8.0 uses LIB_SHAPE for symbols.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18307
2024-06-30 18:07:53 +03:00
jean-pierre charras 6b6aa84158 French translation update 2024-06-30 09:06:42 +02:00
Marco Ciampa a0d219c2d1 Updated Italian translation 2024-06-30 01:11:36 +02:00
Seth Hillbrand 8af1af7f76 Update translations 2024-06-29 12:41:36 -07:00
Jan Straka 991d5812e2 Translated using Weblate (Czech)
Currently translated at 82.8% (7605 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:37:14 -07:00
김랑기 b019ce4515 Translated using Weblate (Korean)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-06-29 12:37:14 -07:00
김랑기 168a1b3e75 Translated using Weblate (Korean)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-06-29 12:37:13 -07:00
김랑기 e8a6e579e4 Translated using Weblate (Korean)
Currently translated at 99.9% (9174 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-06-29 12:37:12 -07:00
aris-kimi f2b1422ed5 Translated using Weblate (Greek)
Currently translated at 99.9% (9176 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/el/
2024-06-29 12:37:00 -07:00
Jan Straka 63f4d45665 Translated using Weblate (Czech)
Currently translated at 82.1% (7543 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:36:51 -07:00
ivit VT 96ab1e47c9 Translated using Weblate (Czech)
Currently translated at 81.5% (7490 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:36:51 -07:00
ivit VT 4d69d966ee Translated using Weblate (Czech)
Currently translated at 81.4% (7481 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:36:51 -07:00
pominglee e9294bee9e Translated using Weblate (Chinese (Traditional))
Currently translated at 99.7% (9162 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-06-29 12:36:49 -07:00
CloverGit d2b052b12c Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-06-29 12:36:37 -07:00
Pferd O 34f0a97cca Translated using Weblate (German)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-06-29 12:35:33 -07:00
Laurens Holst ad5ca38cc2 Translated using Weblate (Dutch)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-06-29 12:35:06 -07:00
Nguyễn Ngọc Khánh 58bd7f3b24 Translated using Weblate (Vietnamese)
Currently translated at 21.7% (2000 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-06-29 12:34:38 -07:00
Jan Straka 5b2b4832d4 Translated using Weblate (Czech)
Currently translated at 81.1% (7452 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-29 12:34:36 -07:00
Nguyen Van Dien a3618cbfeb Translated using Weblate (Vietnamese)
Currently translated at 21.7% (1994 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-06-29 12:34:10 -07:00
Seth Hillbrand 8c6edc0414 Fix via layer test for DXF plotting
Vias might have their primary layer set to a single layer but cross
multiple layers that should be included when plotting

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

(cherry picked from commit 64c36e8bda)
2024-06-29 12:25:15 -07:00
Seth Hillbrand 1308fd7c4a Altium import
- Handle intermediate Altium version with some fields but not others
- Ensure that we are properly moving text that is not a box and not a
  field

(cherry picked from commit 9aba808366)
2024-06-29 12:19:25 -07:00
Seth Hillbrand b241e09914 Don't knock out anti-text box
Knockout text should only prevent filling directly around the text
itself, not the larger anti-text fill around it.  This prevents minimum
width provisions from kicking in unneccesarily

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

(cherry picked from commit a12bc3a410)
2024-06-29 12:18:54 -07:00
Seth Hillbrand 0a29c0dea3 Fixup Altium import rectangle handling
Ensure we have positive sizes
Keep rectangles when rotating by multiples of 90

(cherry picked from commit d033f93d89)
2024-06-29 12:17:53 -07:00
Seth Hillbrand 8832b22952 Fixup for Altium pad/fill importer
The previous commit merged pads with copper areas.  This was appealing
but broke when the pad and the area were meant to have different
size/shape technical layers.  Small pads = Small paste.  Instead, we do
not merge the pads but we assign them to have the appropriate nets in
KiCad, allowing the same effective result but keeping the technical
layers correct

(cherry picked from commit 51eb7aa5b5)
2024-06-29 12:17:53 -07:00
Seth Hillbrand 33b93a3824 Altium import: handle polygons on copper
In Altium, copper polys will be connected automatically to their
associated pads.  In KiCad, we need to do the equivalent when parsing,
which is to combine the joining copper into the underlying pad.  We also
don't want to treat copper polys as proxy pads without the original
anymore.

(cherry picked from commit 7102d9f72a)
2024-06-29 12:17:53 -07:00
Seth Hillbrand b589da63d8 Cleanup Altium text import
Handle inverted text
Correct location for flags
Add mechanics to detect inverted_rect (like text boxes)

(cherry picked from commit b11e030f8f)
2024-06-29 12:17:53 -07:00
Seth Hillbrand 48077d77c4 Altium: Handle textboxes
Also, corrects a minor issue with the text width calculation where
Altium calculates centerline to centerline but KiCad text heights are to
the edge of the stroke font.  Need to still do better adjustments for
the various altium stroke fonts

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

(cherry picked from commit 7e561acf53)
2024-06-29 12:17:53 -07:00
Alex Shvartzkop a605c4b6ff Disable hidpi cursors on GTK and OSX.
wxCursor scale factors won't be supported before wx 3.3.
MSW doesn't scale cursors, so it works as expected there.

(cherry picked from commit e3e63fb1b8)
2024-06-29 21:43:47 +03:00
Seth Hillbrand 092ce30b40 Altium: Handle footprint vias
These are treated as pads in KiCad

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

(cherry picked from commit 7ea013b96c)
2024-06-29 11:38:36 -07:00
Seth Hillbrand 28eb6dab97 Handle hierarchical sheets in incremental change
The drivers need to get passed up and down the hierarchical sheets.  In
order to do this, both the sheet pin and the hierarchical pin need to
be in the changed items.  However, we only get sheets in the screen
items list while the pins are the elements that get set dirty

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

(cherry picked from commit 5f16c5892c)
2024-06-29 11:26:03 -07:00
Seth Hillbrand fb82130530 Fixup cherry-picks for v8 2024-06-29 11:22:11 -07:00
Seth Hillbrand a3d218ffbc Fixup arc check in dp coupled
Handle arcs starting at candidate end point.
Fix total arc size

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

(cherry picked from commit 015b93b474)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 471f72a340 Handle arcs dp coupling
Calculate coupled arcs and spacing

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

(cherry picked from commit 75ab3d9e8b)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 2abbc601a0 Detect if HiDPI cursors are needed
HiDPI cursors are twice as large as regular cursors, allowing them to be
more easily seen on a HiDPI system

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

(cherry picked from commit ab0426d620)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 522f1c7bea Ensure nets are referenced to main board
We set new elements to the temporary board's netlist.  These need to be
updated when moving the fooprint to the main board

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

(cherry picked from commit 54efd32f7a)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 828f32649f Hookup footprint reload to redraw icon
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7195

(cherry picked from commit 6537f9fa15)
2024-06-29 11:22:11 -07:00
Seth Hillbrand b39b54a92e Fallback to scientific notation when fixed-point is long
Fixed point output can create arbitrarily long string representations of
floating points.  When this happens, we would like to just represent the
scientific notation to a limited precision

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

(cherry picked from commit 24f02e72d0)
2024-06-29 11:22:11 -07:00
Seth Hillbrand 6a55a47276 Subtract all holes in board area calc
When we say "Subtract holes from board area", we should also subtract
those holes in pads and vias

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

(cherry picked from commit 91f6c534b9)
2024-06-29 11:22:11 -07:00
Wayne Stambaugh 648d463b32 Tag stable version 8.0.4 release candidate 1. 2024-06-29 11:58:56 -04:00
Seth Hillbrand 489f345fb2 ADDED: Handle PIECHART in Altium import
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16895

(cherry picked from commit 5bd94f118d)
2024-06-29 08:05:04 -07:00
Seth Hillbrand e308d65108 Ignore hidden text fields when cross-probing
Zoom-to-selection should only show the elements that we can see, so
avoiding hidden fields in footprints keeps the zoom window appropriately
sized

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

(cherry picked from commit 416033e8e5)
2024-06-29 08:02:57 -07:00
Seth Hillbrand ee0be76fb4 Don't list IPC-2581 import
We don't currently support importing 2581 files.  We need to clear
IO_FILE_DESC to prevent this from accidentally showing

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

(cherry picked from commit eeee63186d)
2024-06-29 08:02:27 -07:00
Seth Hillbrand 813fce2d2d Fully expand all text variables in 3d output
We were doing half of the job but we need to get the board variables as
well

Fixes https://gitlab.com/kicad/code/kicad/issues/17768

(cherry picked from commit 79166510e9)
2024-06-29 08:01:33 -07:00
Frank Muenstermann e0a27b430a kicad-cli: The --precision parameter was not recognized, if unit was inch, the export crashed
(Cherry-picked from 63d828d5ff)
2024-06-29 03:43:06 +01:00
Ian McInerney 73b2180c06 Take footprint edge cuts into account in the board statistics
Reported in https://gitlab.com/kicad/code/kicad/-/issues/18245

(Cherry-picked from 10988478da)
2024-06-29 03:27:42 +01:00
Ian McInerney b3f53ac862 Always include footprint edgecuts in board edge bounding box
The footprint edgecuts should always be part of the board edge bounding
box, even if the layer the footprint is on is hidden from view.

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

(Cherry-picked from 672d2c6af8)
2024-06-29 03:27:14 +01:00
Ian McInerney 9b49fc5a0d Display unit name in symbol context menu
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18285

(Cherry-picked from cc81ccf79a)
2024-06-29 02:16:26 +01:00
Jeff Young 03c71b22d5 Improve consistency of clearance line painting.
Showing the clearance area is not obvious as the clearance
extends from the pad on flashed copper layers and from the
hole on non-flashed copper layers.  Because of this, we
choose to not display clearance lines at all on non-copper
active layers as it's not clear which we'd be displaying.

We follow the same rule for tracks for consistency (even
though they don't have the same issue).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18287
2024-06-28 21:46:49 +01:00
Jeff Young 7d79bebcc6 Don't overload error dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18195

(cherry picked from commit 441da8dfb6)
2024-06-28 20:59:29 +01:00
Jeff Young 5c2300022b Don't flip alignment of non-side-specific text.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18235

(cherry picked from commit 0040c290ed)
2024-06-28 20:58:47 +01:00
jean-pierre charras 91b042990f footprint selector in symbol properties: fix footprint selection issue.
When using the button to select a footprint using the footprint chooser
dialog, the new footprint was not always taken in account (perhaps MSW specific).
It was due to the code to update the footprint name was between Disable() and
Enable, thus creating a loss of some events in the complex grid edition stuff.
This is now replaced by a lock flag to protect this code to be executed when
it should not.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18270
2024-06-27 20:07:38 +02:00
Jeff Young 265e2d61be Clear timestamp when clearing cache.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17913

(cherry picked from commit 5a9b681009)
2024-06-25 13:56:33 +01:00
Jeff Young df3924421d enclosedByArea test for zone needs to be outline-based.
(Otherwise it's order-specific when filling, which
is pretty unpredictable.)

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

(cherry picked from commit 5ba2896968)
2024-06-25 13:55:51 +01:00
Jeff Young 4ee2a007eb Hidden footprint libraries are not yet supported.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18183

(cherry picked from commit b7161181e8)
2024-06-25 13:54:56 +01:00
Jeff Young b19a47fa2a Performance for large hierarchies: ERC
Share constructs between ERC tests.

Large SCH_SHEET_LISTs, in particular, can be very
expensive to construct.

(cherry picked from commit 68fbe98b1d)
2024-06-25 13:34:49 +01:00
jean-pierre charras 7f3ca3b889 Gerber plots: Ensure reserved chars are not used in Gerber field strings.
In gerber fields, reserved chars (,*%) must be replaced, because they are separators.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18275
2024-06-25 11:26:03 +02:00
Seth Hillbrand a3d64d604c Silence font replace warnings for libs
When loading schematics/pcbs, notification of font replacements might be
warranted but in libraries, this warning is not helpful and intrusive

(cherry picked from commit 11c6164934)
2024-06-24 12:01:30 -07:00
Alex Shvartzkop 006f0a95c1 Optimize testCourtyardClearances when moving footprints (33%->0.69%)
Check bounding boxes without hidden text first before trying to check courtyards.

See https://gitlab.com/kicad/code/kicad/-/issues/18148

(cherry picked from commit 4bf8ed32cd)
2024-06-24 06:44:28 +03:00
Alex Shvartzkop 6afd865259 Optimize testCourtyardClearances when moving a board.
CPU usage: 86% -> 33%

See https://gitlab.com/kicad/code/kicad/-/issues/18148

(cherry picked from commit dc56364cf2)
2024-06-24 02:03:33 +03:00
Alex Shvartzkop d319cd4b89 Improve error message when trying to Open non-KiCad schematic files.
See https://gitlab.com/kicad/code/kicad/-/issues/18241
2024-06-22 20:35:23 +03:00
Wayne Stambaugh 566fefafc5 Fix Eagle schematic importer incorrect symbol value field and visibility.
Also fix a crash if an XML_PARSER_ERROR exception is thrown when importing
Eagle symbol libraries.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18232
2024-06-22 12:22:03 -04:00
Seth Hillbrand 66bd0f850a Allow NIC pins to be stacked
Previously, we only allowed pins of the same time as well as passive
pins to be stacked.  This change allows NIC pins as well since they are
not internally connected, there is no reason that they cannot be tied to
another pin electrically

(cherry picked from commit 0e0ada8e4e)
2024-06-22 08:12:51 -07:00
Alex Shvartzkop 491bb6e57a Altium schematic import: fix power port styles.
Need to use the symbol name with style, like "VCC_CIRCLE", not "VCC".

Issue was introduced in d939004bbd

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18209
2024-06-22 06:58:41 +03:00
dsa-t 4fe74a9870 Fix arc edit points ordering in schematic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18254


(cherry picked from commit f6994702aa)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-06-22 03:20:02 +00:00
Seth Hillbrand 8f03f7c367 Allow non-identical schematic/pcb nets
The schematic net names are fully unique but if we have multiple pads
that are mapped to a NC pin, they need to have unique net names so that
they do not get connected to each other in the ratsnest.  This breaks
the schematic parity check as we have modified the netname for some
pads.  To work around this, we first maintain the zero-th net without
suffix and then add an additional check in DRC to ensure that we allow
unconnected nets as long as the share a common prefix with the schematic
netname.

(cherry picked from commit f61d400d88)
2024-06-21 12:26:23 -07:00
Seth Hillbrand 7f690d596b Resolve worksheet variables in SCH_FIELD
Sheet fields should also resolve the worksheet of that sheet and not the
parent sheet

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

(cherry picked from commit 6540c3ec9f)
2024-06-21 10:31:11 -07:00
Mark Roszko be4c2715ab Don't use message as part of the assert dedup
kimath overflow can generate thousands of unique messages in one run lolol


(cherry picked from commit acec5552c0)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-06-21 11:20:17 +00:00
Seth Hillbrand 02f8260e18 Clean git conflict markers 2024-06-20 09:25:04 -07:00
Seth Hillbrand a8871fdda4 Fix cherry-pick for v8 2024-06-20 09:13:12 -07:00
Alex Shvartzkop d552ce00aa Optimize redrawNetnames.
Using RTree is slower in this case.

RTree: 25 ms when moving cursor
This method: 5 ms when panning/zooming

(cherry picked from commit 62fb5697b4)
2024-06-20 18:49:32 +03:00
Alex Shvartzkop 37dd7c6df9 Backport BOX2I_MINMAX. 2024-06-20 18:49:32 +03:00
Alex Shvartzkop a5cbcd4abe Don't call GetSide in FOOTPRINT::GetBoundingBox when not needed.
CPU usage: -13% when moving a board.

(cherry picked from commit f5be388acd)
2024-06-20 18:49:32 +03:00
Alex Shvartzkop 4ede6f61b2 Fix build errors introduced in 994c1c971a 2024-06-20 18:37:39 +03:00
Seth Hillbrand 994c1c971a Respect schematic settings for hidden pins
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17941

(cherry picked from commit b8ccaae403)
2024-06-19 18:07:52 -07:00
Alex Shvartzkop ebdfeb4c0a Fix crash in wxSocketBase when the event handler has been destroyed.
Fixes KICAD-37B
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18234
2024-06-19 00:49:53 +03:00
Jon Evans e1ffd956e6 Try harder to keep searchable text hidden in SVG exports 2024-06-18 11:59:46 -04:00
Jeff Young 3f4dc01d97 Don't report reasonable solder mask bridges in a net-tie footprint.
(cherry picked from commit eae85742cc)
2024-06-15 16:56:12 +01:00
Jeff Young be192d5df0 Check mask apertures on the mask layer.
(Otherwise testing A:B and B:A will add items to the
m_maskApertureNetMap cache on different layers.)

(cherry picked from commit 8cddd40fc9)
2024-06-15 16:47:41 +01:00
Jeff Young efc35dec74 Footprint Editor doesn't have nets.
(Copper shapes, on the other hand, can.  Since we use
GetItemDescription() to report DRC errors and the like,
it's better to have it report the net even when it's
<no net>.)

(cherry picked from commit b2588e0bbf)
2024-06-15 16:47:35 +01:00
jean-pierre charras 096566e857 Schematic editor: fix some issues that can crash the editor on closing.
- Add a test to be sure a SCHEMATIC exists before trying to use it
- Delete items in Repeat list and undo/redo list before deleting the schematic
- Delete also these items when loading a new schematic (the repeat list was
not cleaned previously)
( include qa compatibility from master )
Before these fixes I saw a use after delete issue due to dangling pointers
stored in Repeat list.
From master branch
2024-06-15 09:22:02 +02:00
Jeff Young 944ee4af7d Normalize phase angles. 2024-06-14 19:01:37 +01:00
Jeff Young 245894e8eb Pull netname bug fixes and performance improvements back from master. 2024-06-14 19:01:37 +01:00
Jeff Young 74abb40e84 Don't lose value of cursor checkboxes when running sim.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit c633ac26eb)
2024-06-14 19:01:37 +01:00
Jeff Young 1eb2983efe Don't assume AC gains will always be voltages.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit 4eb048bba2)
2024-06-14 19:01:37 +01:00
Jeff Young 63b3e0cc4f Correctly write phase/gain signals to workbook.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit 300313ce73)
2024-06-14 19:01:37 +01:00
Jeff Young a8b127019c Don't use SI prefixes with degrees when auto-ranging.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit 5a3bad51d0)
2024-06-14 19:01:37 +01:00
Jeff Young 4d0ca33b47 Current gain is the first Y axis, not the second.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205

(cherry picked from commit 7b63429fe1)
2024-06-14 19:01:37 +01:00
JamesJCode e2c53df13b Fix shadowed variable warning 2024-06-12 08:13:40 +01:00
Wayne Stambaugh 03dd6c7a8e Clear parent symbol references when flattening derived library symbols.
Broken parent symbols could lead to invalid return values and flattened
library symbols cannot be derived from a parent symbol.

(cherry picked from commit 360d185e3b)
2024-06-10 16:14:54 -04:00
JamesJCode bdd5a752dc Don't re-add deleted netclass assignments in incremental connectivity
Ensures that if moving or deleting a netclass directive label, the
netclass on the previously-assigned net doesn't have the stale
netclass re-applied.

Cherry-picked from 0826c10a20

(Along with prior connectivity cherry-pick...)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18173
2024-06-10 20:40:20 +01:00
JamesJCode 8dbdc3717c Eeschema: Only assign nets with resolved netclasses to the label map
Also fixes a bug where the pattern assignment cache was not cleared
if all pattern assignments were deleted in the setup netclasses
panel.

Cherry-picked from 9e1a5eb1bd
2024-06-10 20:31:35 +01:00
Alex Shvartzkop f60b76696a Cairo GAL: improve alignment between arcs and segments and of odd-width lines. 2024-06-10 21:21:13 +03:00
dsa-t 695505fc71 Fix build error caused by commit 82c2bda52b.
(cherry picked from commit 012d3f098f)

Co-authored-by: Wayne Stambaugh <stambaughw@gmail.com>
2024-06-10 15:02:21 +00:00
Alex Shvartzkop b34dbf58c5 Altium PCB import: don't add thickness to Solid style fills. 2024-06-10 17:32:52 +03:00
Alex Shvartzkop 1fb19c0d81 Altium PCB import: make sure Polygon fill is contained within the outline. 2024-06-10 17:19:43 +03:00
Jeff Young d6162196ec Fix KeepUpright settings in Eagle gold files.
(cherry picked from commit aa1fb0604a)
2024-06-09 23:47:00 +01:00
Alex Shvartzkop 3ea314cb9f Altium PCB import: avoid integer overflows when rotating rectangular fills.
Fixes artifacts seen in https://gitlab.com/kicad/code/kicad/-/issues/18156
2024-06-10 01:00:57 +03:00
Jeff Young 9d51fabe9b Don't default KeepUpright to true in Eagle importer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18175
2024-06-09 22:17:39 +01:00
Alex Shvartzkop c6b483acb9 QA: update golden data for Altium "Tracks" PcbLib. 2024-06-09 23:01:26 +03:00
Alex Shvartzkop 96370f6665 Make sure to add start points to arcs in TransformOvalToPolygon.
Otherwise the long line segments can be non-parallel to the centerline.

This was the root cause of the slowdown in https://gitlab.com/kicad/code/kicad/-/issues/18156

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

(cherry picked from commit 76b2741a92)
2024-06-09 22:49:58 +03:00
Alex Shvartzkop ad7bd9b5f8 Revert "Pcbnew, Altium import: Fix issues with hatched zones."
This removed the hatch fill import functionality,
and is no longer needed now that the root cause was found.

This reverts commit 616510aca2.

(cherry picked from commit 80b7f5fcbf)
2024-06-09 22:49:58 +03:00
jean-pierre charras 2a1ef2d09d Pcbnew, Altium import: Fix issues with hatched zones.
- Filled zones using the hatch pattern cannot use the primitives from Altium.
the filled shapes must be rebuilt.
_ Filled zones using the hatch pattern with a very small gap are now converted
to a polygon pattern. Otherwise the calculation time can be very big.

From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18156
2024-06-09 15:56:57 +02:00
Seth Hillbrand 9f9fa0dd8d Avoid referencing parents after deletion
We look at the parent when deleting EDA_ITEMs but when clearing the test
sheet, we delete the sheet before the pin, causing a use-after-free.
Avoid this by setting parents to null in this case

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

(cherry picked from commit b2e0c2606f)
2024-06-09 13:27:34 +01:00
Seth Hillbrand 6ecfa65c4c Free item memory when closing schematic window
This fires the dtor for each item on the screen, allowing us to properly
close and remove them from the connection graph

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

(cherry picked from commit 9fbda137cb)
2024-06-08 22:16:41 +01:00
Petri Hodju 831d438852 remove item from schematic's connection graph on destruction
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17961

(cherry picked from commit 4920c6b00b)
2024-06-08 22:14:39 +01:00
Jeff Young a9b5b1728a Don't generate thermal reliefs for pads that don't intersect zone.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18174
2024-06-07 23:06:19 +01:00
Jeff Young d304a30155 Performance for large hierarchies: sorting
Cache page numbers during sort.
Don't construct SCH_SHEET_PATH when reference will do.
Don't construct SCH_SHEET_PATH when KIID_PATH will do.

(cherry picked from commit 758974f5aa)
2024-06-07 18:03:45 +01:00
Jeff Young 02ca96df48 No need to mapCoords when everything is in same coord system.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18172
2024-06-07 18:00:41 +01:00
Jeff Young 5ca3414707 Performance for large hierarchies: lookups
Don't bother to sort sheet lists when we're just looking
up a UUID, sheet count, other symbol units, etc.

(cherry picked from commit e543ff0578)
2024-06-07 18:00:41 +01:00
Seth Hillbrand 76a68b1f8d Add missing IsMandatory() fn 2024-06-07 09:58:54 -07:00
Seth Hillbrand 41ebd3c560 Do not allow trailing/leading whitespace in mandatory fields
Reference, Value, Footprint and Datasheet all reference elements that
should not use trailing/leading whitespace or similar hidden charaters.
Other fields may utilize leading/trailing whitespace for obscure
purposes but won't break functionality as they are display only

(cherry picked from commit 6dcb9bb664)
2024-06-07 08:13:34 -07:00
Mark Roszko fbc75656f4 Move vcpkg to wx 3.2.5
(cherry picked from commit ba65231f6b)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-06-07 00:34:00 +00:00
JamesJCode b882defb28 Update connectivity for SCH_LABELs if netclass field changed
Required for https://gitlab.com/kicad/code/kicad/-/issues/17797 fix
in 8.0. This was fixed in the rule area work in 8.99 but not
cherry-picked as it was wrapped up in the wider changes / bugfixes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17797
2024-06-06 08:16:15 +01:00
Seth Hillbrand 7d7decafd4 Handle hierarchical sheets in incremental change
The drivers need to get passed up and down the hierarchical sheets.  In
order to do this, both the sheet pin and the hierarchical pin need to
be in the changed items.  However, we only get sheets in the screen
items list while the pins are the elements that get set dirty

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

Cherry-picked from 5f16c5892c
2024-06-06 07:59:30 +01:00
Mike Williams 8705bea9ab Symbol Fields Table: better handle variable fields with attributes
Attributes need to be checked first since we do some internally hackery
to make the checkboxes work.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18005
2024-06-05 13:02:40 -04:00
Jon Evans 64da49f22e Remove extraneous cache fill per row
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18159
2024-06-05 12:08:08 -04:00
Jeff Young 0c9554a325 Hand cherry-pick fixes for #18042. 2024-06-05 13:00:36 +01:00
Jeff Young dc24d13fef Import child sheets relative to project, not parent.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17785

(cherry picked from commit 8e855156c8)
2024-06-05 12:03:39 +01:00
Jeff Young 78cbb8e994 PCB_GENERATOR_Ts are PCB_GROUP_Ts too.
Also, an item must already be in a commit to add it to a group.

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

(cherry picked from commit 9fb07d886e)
2024-06-05 12:03:39 +01:00
Sven Pauli ddd0ccbefd Implemented flip for tuning patterns.
(cherry picked from commit c7ad5efbed)
2024-06-05 12:03:39 +01:00
Marco Ciampa f5797d367f Updated Italian translation 2024-06-05 12:09:49 +02:00
JamesJCode 89dff6411b Clear all dirty connectivity flags on symbols
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17984

When moving / deleting a power symbol, in some instances the
symbol is marked dirty, and sometimes the pin (depending on
whether the symbol is the primary edited item, or whether
the pin is identified through an edited item subgraph). If
the pin and the symbol are marked dirty, the pin dirty flag
was not being cleared.

Additionally, not all extracted items were being deleted
from subgraphs correctly.

Both resulted in dirty state and duplicated items in the
subgraphs during incremental connectivity, which resulted
in essentially corrupted subgraph states.
2024-06-04 21:01:50 +01:00
jean-pierre charras 093da7f73a Pcbnew, plot drill marks: fix incorrect plot drill mark in some cases.
If a non copper layers is added to a copper layer for plot with drill marks,
the drill mark was not visible (covered by shapes plotted from non copper layer).

Now copper layers are plotted after the non copper layers.
2024-06-04 18:28:15 +02:00
Mike Williams 2215e8906f SCH_REFERENCE: drop separate pointer to LIB_SYMBOL
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18115
2024-06-04 12:10:46 +00:00
Alex Shvartzkop d34df3e951 Don't construct an arc if we won't need it in pcbnew gfx importer. 2024-06-04 07:19:00 +03:00
Alex Shvartzkop 044a2305e3 Fix ellipse angles when importing DXF.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18121
2024-06-04 07:16:42 +03:00
Jeff Young 05264424b3 Improve hole-to-hole error message. 2024-06-03 21:55:36 +01:00
jean-pierre charras 3e59c40283 symbol editor: allows rotation of fields in derived symbols.
Fields in derived symbols are editable, so the context menu must allow rotations.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18003
2024-06-03 20:35:36 +02:00
Jeff Young 2a99464fc1 Don't attempt to plot rule areas.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18133

(cherry picked from commit dc8fd0996d)
2024-06-03 18:50:37 +01:00
Jeff Young 412da66cf6 Make sure ERC pin-to-pin checks are always in same order.
Comparing U1.pin1 : U2.pin1 will return the same
results as U2.pin1 : U1.pin1, but will result in a
different serialization of any exclusions.

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

(cherry picked from commit 11193d2cda)
2024-06-03 18:49:39 +01:00
Jeff Young c6215b08ed Use wxWidgets to track DPI.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17981

(cherry picked from commit 931de12072)
2024-06-03 18:47:43 +01:00
Jeff Young 769060c584 Setup 3D canvas for Footprint Chooser previews.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17910

(cherry picked from commit 3be6d5c5de)
2024-06-03 18:43:36 +01:00
Jeff Young 0b48a66cb0 Don't add things to the selection that aren't in the commit.
Don't process line-pairs when one has already been deleted.

Clean up created line segments when operation is cancelled.

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

(cherry picked from commit 6f0a1ade01)
2024-06-03 18:43:07 +01:00
Jeff Young 836b3219c1 Apply ExportPdf fix to remaining jobs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17863

(cherry picked from commit c0635f222d)
2024-06-03 18:36:46 +01:00
Jeff Young 2c0010fbcb Make sure var overrides get synced to board properties.
Also allow the board properties to override title-block properties.

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

(cherry picked from commit 3cf424d929)
2024-06-03 18:36:06 +01:00
Jeff Young c1ed2506f9 Sorting is not implemented on LIB_TREE columns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18101

(cherry picked from commit c828deee35)
2024-06-03 18:31:34 +01:00
Jeff Young 299495a0aa Repair merge errors. 2024-06-03 18:29:37 +01:00
Jeff Young 6f3b6e3ad8 Move pad checking to Footprint Checker.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18102

(cherry picked from commit 15d4e114e0)
2024-06-03 18:29:37 +01:00
jean-pierre charras cb9d78b46c FOOTPRINT::CheckPads(): better check for hole in PHT pad.
Hole not fully inside the pad copper area is now tested.

(cherry picked from commit 8165ec66e9)
2024-06-03 18:29:37 +01:00
Jeff Young 46b3dcba4f Trim punctuation from end of URLs.
(cherry picked from commit 513e68a04a)
2024-06-03 18:29:37 +01:00
Jeff Young 06150388d8 Trim trailing punctionation from doc URLs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18089

(cherry picked from commit f3b57c20af)
2024-06-03 18:29:37 +01:00
Jeff Young b07de4f6af Trim covered region to bounding hull.
Otherwise a long track crossing a footprint will look
like it covers most of it.

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

(cherry picked from commit e400d49af6)
2024-06-03 18:29:37 +01:00
Jeff Young 6dd5422137 CmpNoCase() returns 0 for a match (which evals to false as a bool).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18087

(cherry picked from commit 26fe4c05e1)
2024-06-03 18:29:37 +01:00
Jeff Young 546ca18662 Delete tuning patterns in Unroute Selected.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18065

(cherry picked from commit a678d0d710)
2024-06-03 18:29:37 +01:00
Jeff Young de0f6ecf68 Fetch board finish before exporting stackup to clipboard.
Also fixes some backward logic in setting modified flag.

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

(cherry picked from commit 032b5a6d65)
2024-06-03 18:29:37 +01:00
Jeff Young 995c1a179e Honour shift-key for spin buttons in 3D preview.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17541

(cherry picked from commit f7c7791b6c)
2024-06-03 18:29:37 +01:00
Jeff Young bee4856a7f Process clearance rules for plated holes in router.
Also makes sure the clearance is shown for a collision,
even if the preference for showing clearances is off.

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

(cherry picked from commit d5c3a4036c)
2024-06-03 18:29:37 +01:00
Jeff Young 9721559005 Push multi-sweep traces down into MathPlot.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17215

(cherry picked from commit edae328ca6)
2024-06-03 18:29:37 +01:00
Jeff Young 7a1ab44207 Rewrite Eagle rotated text algorithm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18019

(cherry picked from commit debc94ff49)
2024-06-03 18:29:37 +01:00
Jeff Young d269513857 Improve Eagle rotated text importing.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18019

(cherry picked from commit f4f3f52fd4)
2024-06-03 18:29:37 +01:00
Jeff Young b4928f20a6 We can only knockout a pad if we're plotting the pad shape.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17166

(cherry picked from commit 0ff59bc60e)
2024-06-03 18:29:37 +01:00
Jeff Young 05d2893ac1 Don't suppress hole plotting for utility layers.
Also simplifies the handling of DXF outline plotting.

Also removes some comments which were no longer accurate.

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

(cherry picked from commit 826b72c499)
2024-06-03 18:29:37 +01:00
Mike Williams 7ea205222d pcb: grab unconnected needs to ignore same-footprint ratsnets items 2024-06-03 12:46:13 -04:00
Wayne Stambaugh e853b593b1 Begin version 8.0.4 development. 2024-06-03 07:40:36 -04:00
Wayne Stambaugh c2a41bad09 Tag stable version 8.0.3. 2024-06-03 07:37:50 -04:00
charrasjp 1a13bed1c1 French translation update 2024-06-02 17:32:18 +02:00
Seth Hillbrand 7b9c775cbd Update translations 2024-05-31 17:41:24 -07:00
Mark Hämmerling e9bf1daa5f Translated using Weblate (German)
Currently translated at 99.8% (9169 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-06-01 02:40:50 +02:00
Nguyễn Ngọc Khánh d6727934a5 Translated using Weblate (Vietnamese)
Currently translated at 21.6% (1987 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-06-01 02:40:50 +02:00
Wellington Terumi Uemura a8df90762d Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-06-01 02:40:50 +02:00
Nguyễn Ngọc Khánh 7b4bb28307 Translated using Weblate (Vietnamese)
Currently translated at 21.4% (1972 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-06-01 02:40:50 +02:00
CloverGit ee8744770f Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9182 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-06-01 02:40:50 +02:00
Henrik Kauhanen ace480d3f6 Translated using Weblate (Swedish)
Currently translated at 99.9% (9181 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-06-01 02:40:50 +02:00
Henrik Kauhanen 154795d32a Translated using Weblate (Finnish)
Currently translated at 99.9% (9180 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-06-01 02:40:50 +02:00
Henrik Kauhanen ce20c6ec77 Translated using Weblate (Swedish)
Currently translated at 99.9% (9180 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-06-01 02:40:50 +02:00
dsa-t 6380f29214 Translated using Weblate (Russian)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-06-01 02:40:50 +02:00
Jan Straka 1aaf767c5d Translated using Weblate (Czech)
Currently translated at 81.0% (7441 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-06-01 02:40:50 +02:00
Henrik Kauhanen bd4ffa493f Translated using Weblate (Swedish)
Currently translated at 99.9% (9178 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-06-01 02:40:50 +02:00
Wellington Terumi Uemura cf26b12478 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-06-01 02:40:49 +02:00
ZbeeGin cdb26a9c97 Translated using Weblate (Polish)
Currently translated at 99.9% (9181 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-06-01 02:40:49 +02:00
Laurens Holst b5687b87bd Translated using Weblate (Dutch)
Currently translated at 100.0% (9183 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-06-01 02:40:49 +02:00
Henrik Kauhanen e581ba4c7b Translated using Weblate (Swedish)
Currently translated at 99.9% (9177 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-06-01 02:40:49 +02:00
Toni Laiho a2064f85b1 Translated using Weblate (Finnish)
Currently translated at 99.9% (9180 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-06-01 02:40:49 +02:00
Pferd O 2dbe4485cc Translated using Weblate (German)
Currently translated at 99.8% (9167 of 9183 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-06-01 02:40:49 +02:00
Mark Roszko 6b7b6fa3e3 Revert "Don't reset the view controls state just because we are setting the already active tool state again"
This reverts commit e914c0c1a0
2024-05-30 12:30:40 +00:00
Wayne Stambaugh be71f776ce Tag stable version 8.0.3 release candidate 1. 2024-05-25 07:26:08 -04:00
Mark Roszko 51ba4763f0 Don't let CaptureCursor fight modal dialog
(cherry picked from commit e9fde0051f)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-25 01:17:17 +00:00
Alex Shvartzkop f9a9db6503 Fix very tall Plot dialog on GTK.
Some scrollable controls need wxFIXED_MINSIZE, on some platforms, apparently.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16926
2024-05-24 23:35:21 +03:00
Alex Shvartzkop 8d001a8031 Switch length tuner settings action scope to global to make the hotkey work. 2024-05-24 17:46:15 +03:00
jean-pierre charras 88115e1dd2 Gerbview: fix a minor issue.
When the option "always hide all layers but active" is set, the active layer
changed using hotkeys or Toolbar layer selector did not update the visible
selection.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18059
2024-05-24 08:29:49 +02:00
Mark Roszko e914c0c1a0 Don't reset the view controls state just because we are setting the already active tool state again
(cherry picked from commit 132ecee665)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-24 02:49:27 +00:00
Jon Evans a1cd73e730 Fix bad clearance logic in cecc1a2f 2024-05-23 11:21:18 -04:00
Jon Evans cecc1a2ff1 Use true arc collision for segment<>arc
Using an approximation here results in different collision
results for segment<>arc than point<>arc, which
can cause odd behavior in the router.


(cherry picked from commit 5b3b0ff836)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-23 12:58:01 +00:00
John Beard dc08cf3252 Eeschema: Also make 'note' backgrounds translucent on selection
For the same reason as device backgrounds - it obscures everything
else while moving a filled shape.

(cherry pick of commit 0bcd5e5795)
2024-05-23 16:52:30 +08:00
John Beard e20a11cbb3 Eeschema: Fix selection of items inside filled shapes
The selection heuristic broke down when one item was a filled
shape. Because all hit tests would succeed with distance 0 for
these shapes, they would always be considered the closest item
to the exclusion of all else, which made it very hard to
click on a graphic inside a filled shape.

Now, recognise when an item would be "dominating" and
decline to promote it to the "closet" spot. It will still
be selectable if there are no other items nearby, or if
there are multiple shapes.

(cherry picked from commit fd4c15517f)
2024-05-23 15:41:28 +08:00
Seth Hillbrand c27ca33a2e Ensure that the copper conn check re-adds epsilon
When checking if the particular rule is what is being checked, we rely
on the value of the minimum width.  Since we modified that to allow
width checking, this re-adds it for the comparison

(cherry picked from commit f74d1060d4)
2024-05-22 16:31:52 -07:00
Seth Hillbrand 1073ca0760 Include DRC Epsilon in connection width checker
Avoids rounding errors flagging connections too small by nanometers

(cherry picked from commit bce560d05f)
2024-05-22 16:31:52 -07:00
Jeff Young 4440fe0935 Fix keep-upright algo for footprint text.
Also removes PCB_FIELDs from rotation centre calc in
footprint editor if there is other stuff selected.

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

(cherry picked from commit 25bb3f77fa)
2024-05-22 14:47:26 -07:00
Seth Hillbrand d1cd859765 Re-enable moving of all footprint text in board
Seems like a lot of people really like to be able to modify the text
positions/content of their footprints

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

(cherry picked from commit 47e4ebb32a)
2024-05-22 10:36:42 -07:00
John Beard 36119b869c Pcbnew: Fix context menu when moving
The EDIT_TOOL is actually 'co-operating' with the SELECTION_TOOL
by putting its tools into the SELECTION_TOOL's menu. This means
the EDIT_TOOL::m_menu is sad and empty inside, and if you show it,
it either doesn't show at all, or a tiny stub is shown.

(cherry picked from commit af74d2a746)
2024-05-22 11:24:47 +08:00
Roberto Fernandez Bautista 3e5ceaa319 kicad-cli sym export svg: Ensure bounding box is correctly calculated
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18062
2024-05-21 21:59:38 +02:00
Seth Hillbrand 78cd01038f Update translations 2024-05-21 09:38:08 -07:00
Ivan Chuba 7b4952df11 Translated using Weblate (Ukrainian)
Currently translated at 87.5% (8031 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/uk/
2024-05-21 18:35:36 +02:00
CloverGit 73acc80c1d Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9171 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-05-21 18:35:36 +02:00
pominglee 8b41207351 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9165 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-05-21 18:35:36 +02:00
pominglee 5dbc1c7b18 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9165 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-05-21 18:35:36 +02:00
Toni Laiho 5780a15468 Translated using Weblate (Finnish)
Currently translated at 99.9% (9168 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-05-21 18:35:36 +02:00
Ulices 15f6d5ad73 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9171 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-05-21 18:35:36 +02:00
Nguyễn Ngọc Khánh 421bc27181 Translated using Weblate (Vietnamese)
Currently translated at 21.1% (1937 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-05-21 18:35:36 +02:00
Tokita, Hiroshi afe41498c4 Translated using Weblate (Japanese)
Currently translated at 99.9% (9167 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-05-21 18:35:36 +02:00
Tokita, Hiroshi 92c40f2761 Translated using Weblate (Japanese)
Currently translated at 99.9% (9167 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-05-21 18:35:36 +02:00
Toni Laiho bb82d99a76 Translated using Weblate (Finnish)
Currently translated at 99.9% (9168 of 9171 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-05-21 18:35:36 +02:00
Andrew 1d0e118294 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9165 of 9171 strings)

Co-authored-by: Andrew <yenchang.lin@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
Translation: KiCad EDA/v8
2024-05-21 18:35:36 +02:00
pominglee d40b12301d Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9165 of 9171 strings)

Co-authored-by: pominglee <pominglee@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
Translation: KiCad EDA/v8
2024-05-21 18:35:36 +02:00
Toni Laiho 138d22b26f Translated using Weblate (Finnish)
Currently translated at 99.9% (9165 of 9171 strings)

Co-authored-by: Toni Laiho <apelegeos@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
Translation: KiCad EDA/v8
2024-05-21 18:35:36 +02:00
zly20129 9c69ea9df3 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9171 of 9171 strings)

Co-authored-by: zly20129 <zly20129@icloud.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
Laurens Holst 3395738e55 Translated using Weblate (Dutch)
Currently translated at 100.0% (9171 of 9171 strings)

Co-authored-by: Laurens Holst <laurens@grauw.nl>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
Henrik Kauhanen 6afc2e727b Translated using Weblate (Finnish)
Currently translated at 99.7% (9148 of 9171 strings)

Translated using Weblate (Finnish)

Currently translated at 99.7% (9148 of 9171 strings)

Translated using Weblate (Swedish)

Currently translated at 99.9% (9168 of 9171 strings)

Co-authored-by: Henrik Kauhanen <henrik@kauhanen.se>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
Wellington Terumi Uemura f10864b3a7 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9171 of 9171 strings)

Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
ZbeeGin 892602c070 Translated using Weblate (Polish)
Currently translated at 99.9% (9169 of 9171 strings)

Co-authored-by: ZbeeGin <zbeegin@op.pl>
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
Translation: KiCad EDA/v8
2024-05-21 18:35:35 +02:00
Jeff Young d8f2a455e0 Reset zone offsets when exporting footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17794

(cherry picked from commit af5ed5a118)
2024-05-21 11:41:07 +01:00
Jeff Young 561b2d490d Handle font when reading render cache.
(Also fixes a bug where the cache's triangulation wasn't
cached.)

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

(cherry picked from commit e332320108)
2024-05-21 11:36:36 +01:00
jean-pierre charras 1869da0e7d Dialog Export step: fix an issue when exporting a modified board file.
the DIALOG_EXPORT_STEP uses a auto saved copy of the current board to
create the step file (using kicad_cli).
But this file is not associated to a corresponding .kicad_pro file, and
this can create some issues (like the KIPRJMOD not defined)
So create a copy of the current board prj to export associated prj file
to the auto saved board file.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16973
2024-05-21 11:06:02 +02:00
dsa-t be2f317f6d Vertically center the color swatch in grid layer selector.
(cherry picked from commit 5f153eef7f)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-05-21 02:35:49 +00:00
Seth Hillbrand c248993a84 Avoid snapping to edge cuts when routing
Snapping happens to elements on copper layers but edge cuts is only
_virtually_ on copper layers.  We need to set its routable flag off to
ensure we don't force-snap to the snap points
2024-05-20 15:08:12 -07:00
Seth Hillbrand 0a227ea916 Avoid int overflow in collisions
When calculating arc collisions, avoid overflowing the integer distance,
which gives a false nearest point
2024-05-20 15:08:12 -07:00
Seth Hillbrand f75e6dae84 Reserve shift for grid modification 2024-05-20 15:08:12 -07:00
Seth Hillbrand 160a493885 Ensure that arc closest positions are matched
We switch from squared to absolute calcualtion when calling into the arc
collision so be sure to catch the new positions and distances
2024-05-20 15:08:12 -07:00
Seth Hillbrand 625d241adf Avoid case where whole line is new head
If the whole line shifts, we may have no points of the old tail in the
new line.  In this case, we may not only not find the split point but we
may also have fewer points in the new line than were in the old head.
Clamping to the maximum potential point count prevents creating invalid
lines

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

(cherry picked from commit 586fddeec1)
2024-05-20 15:08:12 -07:00
Alex Shvartzkop 1264230973 STEP export: reverse Wire when adding it to Face as a hole.
Better fix for https://gitlab.com/kicad/code/kicad/-/issues/17446
2024-05-19 03:51:53 +03:00
Alex Shvartzkop 6dfd417767 Make IBIS errors visible / more obvious.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18041
2024-05-19 01:44:16 +03:00
Jon Evans 585f11a01d Clear undo/redo lists when removing board layers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17613


(cherry picked from commit 90ee5e097a)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-18 22:16:28 +00:00
Jon Evans d6a121d617 Don't drag multiple coincident vias
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17915


(cherry picked from commit 7a3db2d176)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-18 21:51:09 +00:00
Alex Shvartzkop dfd8aa402d Fix an assert in isCopperOutside. 2024-05-18 22:50:13 +03:00
Alex Shvartzkop 5b1c84b5dd STEP export: allow closing (and constructing) the wire with 1nm edges.
This is ok (and required) because we don't mess with BRepBuilderAPI::Precision nowadays.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18030
2024-05-18 22:50:13 +03:00
Jon Evans 11586863cf Fix broken hit test for arcs in via placer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17844


(cherry picked from commit aaf3142e9a)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-18 17:12:34 +00:00
Jon Evans d52e50a97a Altium: avoid crash when imported zone has no fill
Fix https://gitlab.com/kicad/code/kicad/-/issues/18025


(cherry picked from commit 4f3117aea0)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-18 00:16:22 +00:00
Jon Evans fee0028ee9 Support LIB_ID queries in searchFootprints too
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18039
2024-05-17 13:57:17 -04:00
Jon Evans a762311733 The upcoming Fedora 41 will use python 3.13
The Fedora folks are currently working on updating python to version
3.13 in Fedora 41.


(cherry picked from commit f8c8dcde13)

Co-authored-by: Steven A. Falco <stevenfalco@gmail.com>
2024-05-17 14:50:03 +00:00
Jon Evans e0581370e1 Fix bogus value field in spice test source.
(cherry picked from commit a0a368f47b)

Co-authored-by: Jeff Young <jeff@rokeby.ie>
2024-05-17 14:30:23 +00:00
Jon Evans 2cd0139cbf Remove extra NeedRIGHT in textbox parser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18033
2024-05-17 09:01:59 -04:00
Jeff Young 28cd2a203e Fix compiler version issues. 2024-05-17 12:59:30 +01:00
Jeff Young 33715143e3 Honour LAYER, SHEETNAME and SHEETPATH variable overrides on CLI.
Also allows the LAYER variable to work automatically
if you're plotting/exporting a single layer.

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

(cherry picked from commit 3e0c598500)
2024-05-17 11:38:56 +01:00
Jeff Young ba6fd2716e Lazily re-evaluate worst-clearance cache.
This prevents crashes when trying to re-evaluate
during destruction, etc. and is a cleaner solution
than trying to keep a flag updated.

It should also be a performance win for very large
documents.

Also implements proper threadlocking for the cache.

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

(cherry picked from commit 498d2c9db1)
2024-05-17 11:37:04 +01:00
Jeff Young 882ff06e24 More PEGTL tomfoolery.
(cherry picked from commit 8aaca0509c)
2024-05-17 11:25:26 +01:00
Jeff Young f52a51dce3 Reimplement bracedExpr and token lists for CPL models only.
This prevents the incompatibility between token lists
and single-token param-value pairs.

(cherry picked from commit 086e609c3d)
2024-05-17 11:25:22 +01:00
Jeff Young a96e16b766 Tighter control over braced-expression list separators.
(cherry picked from commit 2921d47fb3)
2024-05-17 11:25:19 +01:00
Jeff Young 81e51b00ca Remove support for multiple token values for CPL models.
It breaks param lists which contain single-token params
(ie: those without the "=<value>" part).

(cherry picked from commit 8bb807f170)
2024-05-17 11:25:15 +01:00
Jeff Young c01681a32e Repair variable resolution recursion guard.
(cherry picked from commit c8d1c1f1a4)
2024-05-17 11:24:37 +01:00
Jeff Young eeb9133588 Support multiple brace-expressions for CPL model lines.
(Nested brace-expressions, on the other hand, are *not*
an ngspice thing.)

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

(cherry picked from commit 0008991f02)
2024-05-17 11:24:21 +01:00
Jeff Young d45769e508 Allow .ends to be preceeded by whitespace.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16560

(cherry picked from commit b934914c59)
2024-05-17 11:21:47 +01:00
Jeff Young a499bc9f66 Contour cache must be sensitive to size.
(While we scale the contours afterwards, font hint
data is size-sensitive so the contours are already
size-specific.)

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

(cherry picked from commit 98f4e60b90)
2024-05-17 11:20:38 +01:00
Jeff Young 341f102d79 Fix PEGTL flagParam grammar.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16393

(cherry picked from commit c5162f5483)
2024-05-17 11:20:26 +01:00
Jeff Young 3e50a03ce7 Expose violation severity for co-located holes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18028

(cherry picked from commit 26906f383c)
2024-05-17 11:20:21 +01:00
Jon Evans 1defa3872e Clear field listener when quitting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18016


(cherry picked from commit 2836025402)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-05-17 00:50:48 +00:00
jean-pierre charras e66d25b6e8 Eeschema, Pin helpers: fix wrong label orientation if the symbol is rotated
From Master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18012
2024-05-16 19:53:23 +02:00
jean-pierre charras 76f38600af Fix a 100% CPU core usage is some editing cases.
In commit 7cb754dd a call to wxMilliSleep(50) was removed (because it created
lag in editing) but this removal created a 100% CPU core usage.
Using a much small sleep time (1ms) fixes these issues.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17979
2024-05-16 17:40:06 +02:00
John Beard 44b0ef64e8 No longer auto-set the Footprint field when setting the FPID
This avoids forcing the field to the footprint name in the
library editor, which gets in the way. This doesn't specifically
inhibit the use of the field, and doesn't interfere with fields
users may have set manually (it can be cleared manually if
wished).

Removing the footprint field entirely either from all footprints
or from footprints in fpedit is quite a bit more invasive to
existing designs.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/17998
2024-05-16 21:42:18 +08:00
John Beard c3e7509823 Allow to set LIB_FIELD size through property manager
This can be useful when managing auxiliary fields.

This is only for the 8.0 branch, as LIB_FIELD is merged
with SCH_FIELD in 8.99, so this is already handled.
2024-05-16 20:45:26 +08:00
Jeff Young 3622a296be Use consistent sorting for footprint libs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17731

(cherry picked from commit 02bc093b55)
2024-05-15 11:25:41 +01:00
Jeff Young 0b48913876 Add mirrored column to fields grid table.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17956

(cherry picked from commit 0f3d14df38)
2024-05-15 11:25:02 +01:00
Jeff Young 9000cfb9cd Use display titles for axes in CSV output.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17324

(cherry picked from commit d9a6b2aec2)
2024-05-15 11:23:52 +01:00
Jeff Young c748645334 Fix typo.
(cherry picked from commit 5ba4900170)
2024-05-15 11:23:07 +01:00
Jeff Young 79443b7e59 Update signals & measurements when netlist might have changed.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17616

(cherry picked from commit 55b2c4dbf4)
2024-05-15 11:22:08 +01:00
Mark Roszko 02925fdecc Update file doxygen.yml
(cherry picked from commit 3a2b960f62)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-05-12 02:53:57 +00:00
Mark Roszko ef1e054bb6 Use our docker runner for doxygen
docker tag for shared gitlab runners was removed by gitlab

(cherry picked from commit 03459723b3)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-05-12 01:09:42 +00:00
Mark Roszko bb13ab2963 Remove the kicad-vcpkg xz override
(cherry picked from commit 695493fc3d)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-05-10 01:44:39 +00:00
Jeff Young 9c7fb0697c Don't double up ac and ph params.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17970
2024-05-09 23:36:32 +01:00
Jeff Young c92b11900b Don't add duplicate SIM fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17970
2024-05-09 23:36:32 +01:00
Jeff Young cde18d7ae7 The user can cancel the opening of many editors.
Don't play dice with the devil.

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

(cherry picked from commit a99377c1ec)
2024-05-09 23:36:32 +01:00
Jeff Young 1a932cb13b Don't modify radius when editing center.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17192

(cherry picked from commit 1290228fbf)
2024-05-09 23:36:32 +01:00
Jeff Young cc75d8c0af Exercise more care when comparing doubles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17249

(cherry picked from commit 62d4bd7c1d)
2024-05-09 23:36:32 +01:00
Wayne Stambaugh cb93d2940c Fix QA DRC regression test issue.
(cherry picked from commit f1e8495dc9)
2024-05-09 10:38:47 -04:00
Wayne Stambaugh 88e0d373d1 Do not test for effective annular width when it's already within limits.
(cherry picked from commit 0402c03468)
2024-05-09 10:38:32 -04:00
Wayne Stambaugh c2d59c6103 Fix false annular ring width DRC test failure.
The DRC annular ring width test failed to take into account that a pad
could be contained inside another pad having the same number (thermal
vias for example) which changes the effective annular width of the pad
contained within another pad.  A test was added to calculate the effective
annular ring width in this case.

Added some PNS log viewer helper and test code to the PNS playground QA
utility for testing the effective pad annular width code.

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

(cherry picked from commit a508f2e716)
2024-05-09 10:38:17 -04:00
Seth Hillbrand f8f48f922e Show disambiguated netname when needed
When using subsheets with nets that end in the same netname, it can be
confusing in pcbnew to know which net you are dealing with.  In these
cases, we show the full netname including path to assist when routing

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

(cherry picked from commit b346cde30b)
2024-05-09 02:57:48 +02:00
Alex Shvartzkop eb7e781bec Send project path to ngspice for code model input files.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16527
2024-05-08 23:39:34 +03:00
Alex Shvartzkop 378300c733 Don't hide symbol/footprint preview widgets on scroll.
(cherry picked from commit dc8822b421)
2024-05-08 19:44:59 +03:00
Jon Evans ddd7c35586 DbLib: Prevent uncaught exception creating statement
Defer telling the statement about the connection until the
try block, because otherwise it can connect immediately and
potentially throw an exception if the connection fails.
2024-05-06 16:59:49 -04:00
Seth Hillbrand 6482a322da Optionally use electrical type when shown.
We also need to consider electrical type as an exact hit when we are
showing it.  Otherwise, we get the pin added to our consideration list
but not selected without hitting close neighbors

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

(cherry picked from commit 3620887a22)
2024-05-06 10:38:28 -07:00
Seth Hillbrand dc6d421fa2 Avoid arbitrary string limits
Placing a limit on the number of values that a field is allowed to hold
makes it blank when we set more than this number.  There's not a good
reason to limit the number of digits we allow at the field level (we
round to 4 decimal points in the backend)

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

(cherry picked from commit cb71f2f207)
2024-05-06 10:00:51 -07:00
Mike Williams 7b19fb0c8d Legacy Libraries: fix Description field clobbering user field
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17943
2024-05-06 12:15:14 -04:00
Mark Roszko f6480d67eb Fix help for kicad-cli pcb export pos --side
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15815


(cherry picked from commit 030a251090)

0b94c436 fix https://gitlab.com/kicad/code/kicad/-/issues/15815
8e6bb91b Update file command_pcb_export_pos.cpp

Co-authored-by: Stefan <2252537-stefan_test@users.noreply.gitlab.com>
2024-05-06 13:37:03 +00:00
Alex Shvartzkop 35c788a332 Fix polygon fill flag in pcbnew graphics (SVG) importer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17957
2024-05-06 14:16:49 +03:00
Seth Hillbrand a0cba3a9af Re-initialize conversion settings on failure
When the conversion fails, it may be the result of the settings values,
so reset them to their original values afterward

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

(cherry picked from commit 4c0fd6e791)
2024-05-06 11:42:54 +01:00
Jeff Young af6835e766 Improve bounding hull error message.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17886

(cherry picked from commit 651cc5c838)
2024-05-06 11:42:34 +01:00
Mike Williams 1f88d33c81 BOM Export: remember filename per project
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17704
(cherry picked from commit 9c058503d9)
2024-05-06 11:38:15 +01:00
Jeff Young 6aee6f857e Don't leak output file path between projects.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17846

(cherry picked from commit 0e9b547f94)
2024-05-06 11:37:52 +01:00
jean-pierre charras 6d69fee097 PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(): ensure texts are not mirrored
When not specified as mirrored, texts must be not mirrored.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17955
2024-05-06 11:17:17 +02:00
Alex Shvartzkop c7dd993439 Add OpenGL info to About.
(cherry picked from commit 5e14ae9698)
2024-05-05 21:58:10 +03:00
Jeff Young 7e5dd02ef1 Don't abort on failure to backup file if it was never saved.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17810

(cherry picked from commit 0e0432d194)
2024-05-05 14:59:07 +01:00
Jon Evans ca16ff05df Altium pcbimport: handle various dimension items, fix dimension_kind enum
(cherry picked from commit ce32dfd077)

e627d587 handle various dimension items, fix dimension_kind enum, this doesn't parse...
e89d1826 fix formating
07686833 change to Reporter for logging
a535d13d remove old comments
554c9565 Update file altium_pcb.cpp

Co-authored-by: Stefan <2252537-stefan_test@users.noreply.gitlab.com>
2024-05-04 16:38:32 +00:00
Jon Evans b8fa10ab2b Add optional reporting of non-KiCad design issues
Also add HTML reporter to PCB side to match schematic
2024-05-04 11:27:22 -04:00
Jon Evans 09736ebf2c Get rid of relative position in pad properties dialog
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17246
2024-05-03 23:31:36 -04:00
Jeff Young 897b9fe6a1 Restore accidentally deleted text size constraint algo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17284

(cherry picked from commit c998234dec)
2024-05-03 22:16:16 +01:00
Jeff Young 48f14d6dea Handle orientation when pasting footprint items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17518

(cherry picked from commit 94223ca794)
2024-05-03 22:15:53 +01:00
Jeff Young 1ef916086d pruneItemLayers() is not the right place to filter refdes & value.
(And we already filter all mandatory fields in
pasteFootprintItemsToFootprintEditor() anyway.)

Also, don't nuke a footprint which contains only fields
during a paste.

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

(cherry picked from commit eb13dec265)
2024-05-03 22:15:05 +01:00
Jeff Young 0b44ba61d8 Improve consistency in free-via ambiguity tests.
Also removes a magic number.

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

(cherry picked from commit 58ddffe3dd)
2024-05-03 22:15:05 +01:00
Jon Evans 3c99a3797e DbLib: Fill entire table if cache is empty when loading one part
The "already placed parts" feature causes a situation where many
single-part queries are placed before the cache is even filled.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17940
2024-05-03 17:03:55 -04:00
Seth Hillbrand 76c98859bf Fix renaming sheet check
If we are renaming a sheet that exists only once in the schematic, then
we don't need to warn about case sensitivity.  If the sheet exists
multiple times, we do.  We can't check this using SCREENS because the
screens don't maintain full state information about where they are used.

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

(cherry picked from commit ba4974749c)
2024-05-03 13:23:51 -07:00
Seth Hillbrand 57c8fbc9fe Special-case copy/paste of footprint fields on board
When editing the board, footprint fields _look_ like text items, so copy
and paste of these items should logically result in a text item, not a
footprint copy.

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

(cherry picked from commit 71b020eb14)
2024-05-03 11:00:19 -07:00
Seth Hillbrand bbac5430cf DRC: special case circles for annular width check
Circles only use one dimension and we tend to ignore the other in our UI
but it is kept and reflects the previous second dimensional value.  When
checking DRC, we should only be concerned with the single value used
unless the pad has two dimensions

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

(cherry picked from commit e3d2f338de)
2024-05-03 10:07:29 -07:00
Seth Hillbrand 279ef4210d Use StandardPrimitive library for vias
Some 2581 parsers don't like to consider UserPrimitive even though they
are essentially the same thing and required by the standard.  ¯\_(ツ)_/¯

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

(cherry picked from commit 13735050da)
2024-05-03 09:12:43 -07:00
Jon Evans 2ef18ad4ca Fix deduplication of already-placed symbols
The comparison function was failing to properly
de-duplicate by LIB_ID, especially for parts
from database libraries, causing the list to grow
with the size of the design.
2024-05-03 11:39:01 -04:00
Jon Evans 1a76fce255 Make sure database library has updated pointer to library table
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17903
2024-05-03 11:39:01 -04:00
Mark Roszko ee75a50d84 Update vcpkg wxpython
(cherry picked from commit 1a1be2d542)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-03 02:17:30 +00:00
Mark Roszko 99d8d0bc63 Use the new kmb toolchain file for vars
(cherry picked from commit f00a1ab517)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-05-03 02:15:52 +00:00
Mark Roszko f859fe37ca Add updated tooltips on update dialog
(cherry picked from commit cb81de5a74)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-03 01:39:50 +00:00
Alex Shvartzkop 451cb7a194 Fix warnings. 2024-05-03 00:09:24 +03:00
Alex Shvartzkop 17175fe71e 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:05:39 +03:00
Seth Hillbrand f8b02f99dd Keep FP chooser on top of KiCad but not system
We don't need to float the window over other programs, so setting to
parental floating keeps it focused just the right amount

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

(cherry picked from commit 60f59ae851)
2024-05-02 13:12:21 -07:00
Seth Hillbrand 69fb86322c Re-allow moving footprint text
This is a temporary solution until we modify loading to convert existing
text to fields

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

(cherry picked from commit b649932dbf)
2024-05-02 13:00:37 -07:00
Seth Hillbrand 4d683232b7 Remove faulty tooltip
Copy-pasta error

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

(cherry picked from commit b211625e53)
2024-05-02 12:46:26 -07:00
Jon Evans cb7e0e4383 Altium: apply power filter to symbol libraries
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17922
2024-05-01 22:47:19 -04:00
Jon Evans 90b62762d3 Support ortho dragging labels off sheet pins 2024-05-01 22:10:18 -04:00
Jon Evans 787a9ae4e4 Pin helpers can help sheet pins also
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17923
2024-05-01 22:10:02 -04:00
Jon Evans 83be5ba63d Move ALTIUM_PCB to use REPORTER for logging
Change not-yet-supported messages to debug level

(cherry picked from commit e973c15087)
2024-05-01 19:17:09 -04:00
Jeff Young e1cad6189e Don't assume that a SMD pad has copper layers.
(cherry picked from commit 9a6efd43e1)
2024-05-01 18:29:36 +01:00
Mike Williams f29fc2a025 PCB Fields: fix v7 imported board hidden description field pos
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17684
2024-05-01 09:24:54 -04:00
Mark Roszko 43d4c8d801 Point BEGIN_EVENT_TABLE at the correct base class, fix current lang indication
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17825


(cherry picked from commit aaf776db9e)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-01 02:48:19 +00:00
Wayne Stambaugh c179f4d4f1 Use correct value field text when importing Eagle schematic symbols.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17130

(cherry picked from commit 865225fcca)
2024-04-30 13:02:29 -04:00
jean-pierre charras ac8b3989be DIALOG_EXPORT_2581:fix incorrect size of widgets when a very long field name exists
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17911
2024-04-30 18:22:22 +02:00
Mark Roszko 9a7b1a20dc Update sentry-native to 0.7.2
(cherry picked from commit 2f0ff4e557)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-04-30 11:39:47 +00:00
Alex Shvartzkop cff58bae7f Fix internal simulation errors when using some IBIS models.
Usage of GC_PWR0 looked like a copy/paste.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17701
2024-04-29 23:24:46 +03:00
Jeff Young 2ee2d7d5d9 Separate Compare Footprints from DRC.
(We want to ignore some of the flags for DRC.)

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

(cherry picked from commit 43e6006306)
2024-04-29 16:27:24 +01:00
Jeff Young 743759578d Use a lighter touch keeping internal data structures in sync.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17493

(cherry picked from commit d0df8df7c7)
2024-04-29 13:45:17 +01:00
Mark Roszko 9f1d1fc45e Delete m_locale in the pgm_base destructor instead of manual destroy method
We need the object in m_locale for a bit more things during program cleanup,
especially on macOS

The destructor of PGM_BASE is sufficient allowance of lifetime.

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


(cherry picked from commit 9ffa5db667)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-04-29 11:48:22 +00:00
Mark Roszko b4ea25dccb Bump kicad-vcpkg baseline 2024-04-29 11:10:29 +00:00
Alex Shvartzkop f15551a6b5 3D viewer: apply OCC colors in order: XCAFDoc_ColorSurf > XCAFDoc_ColorCurv > XCAFDoc_ColorGen
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14906
2024-04-29 01:25:31 +03:00
Jeff Young 5c0a654e1e Save project settings after Schematic Setup.
This prevents data from getting lost if we later crash.

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

(cherry picked from commit d8d816236c)
2024-04-28 21:54:16 +01:00
Jeff Young edace908fb Make sure color settings are saved when modified.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17864

(cherry picked from commit 3b3de58e5e)
2024-04-28 21:54:16 +01:00
Jeff Young ff966eaf62 Gracefully handle DNP & Excl-from-brd components in nets list.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17146

(cherry picked from commit 9be60cb45d)
2024-04-28 21:54:16 +01:00
Jeff Young a39b9b8890 Support legacy Length Tuning Settings workflow.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17748

(cherry picked from commit 978ef352d0)
2024-04-28 21:54:16 +01:00
Jeff Young 9f39420808 Layer column should be shown by default, not italic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17758

(cherry picked from commit 9dab855f8d)
2024-04-28 21:54:16 +01:00
Jeff Young 67b5e86cc4 Default to target lib when no lib tree sel exists.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17808

(cherry picked from commit f51d227dc7)
2024-04-28 21:54:16 +01:00
Jeff Young baaa8b6537 Fix merge error. 2024-04-28 21:54:16 +01:00
Jeff Young 4f776050e6 Clean up selection logic.
Don't try to do too many things at once.  Separate
out fooptrint-children handling, visibility-handling,
and footprintEditor vs boardEditor differences.

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

(cherry picked from commit 3958d1bf14)
2024-04-28 21:54:16 +01:00
Jeff Young fa490644dd Allow selection promotion when editing wrong field type.
Also fixes a bug where a CHT_MODIFY on a parent symbol with a
selected child doesn't trigger a selection modified event.

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

(cherry picked from commit 1aa59b806c)
2024-04-28 21:54:16 +01:00
Jeff Young 0363806e7e Allow no-net teardrops on no-net pads with no-net tracks.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17566

(cherry picked from commit 50567764b5)
2024-04-28 21:54:16 +01:00
Jeff Young c0a608bfdd Keep internal data consistent when changing pad type.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17493

(cherry picked from commit 859f553c91)
2024-04-28 21:54:16 +01:00
Jeff Young fe26628113 Internationalise pin info when language changes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17224

(cherry picked from commit c5c65f23a4)
2024-04-28 21:54:16 +01:00
Alex Shvartzkop c7ead70e0f Fix orientations of some footprint STEP models.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17631

(cherry picked from commit 7d37cebfdf)
2024-04-28 23:19:34 +03:00
Wayne Stambaugh 31177be88f Property grid navigation improvements.
* Do not handle tab key event when committing property changes so the
  property grid tab navigation works correctly.
* Do not call commit property changes on tab key when no changes are
  pending.
* Skip event handling in the base object value change and changing event
  handlers in case they do not get overloaded in derived objects.
* Do not force focus to canvas on property change so arrow and tab key
  grid navigation work properly.  Forcing the user to click the property
  grid control to edit a single property doesn't make sense.
* Pass properties panel show event up the event stack.
* Do not set focus to canvas in tool dispatcher if it already has the
  focus.

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

manully cherry picked from commit 8a1347d2c8
2024-04-28 08:25:24 -04:00
Wayne Stambaugh 48fd6bab7b Symbol chooser dialog layout improvements.
(cherry picked from commit 33869dbb61)
2024-04-28 07:43:43 -04:00
Wayne Stambaugh 9fd2b32665 Do not show click to start wire cursor for hidden pins.
Selecting show hidden pins will allow users to connect to hidden pins.

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

(cherry picked from commit ca18dc8ec8)
2024-04-28 07:39:34 -04:00
Wayne Stambaugh 1ba05d4c9c Improve symbol instance data file save ordering.
Use the root schematic UUID to order projects and sort symbol instance
data by KIID_PATH.  This will ensure file changes to instance data are
more consistent by using a fixed ordering.

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

(cherry picked from commit a86a258f66)
2024-04-28 07:15:22 -04:00
Wayne Stambaugh bae3ccdfb5 Use correct project name when adding new symbol instances.
When adding a sheet using a schematic from another project, set the
project name for the new symbol instance data to the current project
rather than the project name from the copied instance data.

(cherry picked from commit 5d99aaf0a4)
2024-04-28 07:06:03 -04:00
Alex Shvartzkop dd2f15c96d QA: update Altium footprint library golden file. 2024-04-27 23:34:39 +03:00
Marek Roszko 7e04a1b8d3 Hackfix macOS to keep erc/drc on top
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14356
2024-04-27 13:38:41 -04:00
Mark Roszko aea70a14ff Fix win32 proxy parsing when the old IE options for scheme based configuration was set
If you uncheck in the old IE options "Use the same proxy server for all protocols", then it returns an annoying string
like http=blah:1232;https=blah:1232;ftp=blah:2321 which we have to parse.


(cherry picked from commit 60d5780c1c)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-04-27 17:30:03 +00:00
dsa-t 8edfc23679 Altium PCB import: pad thermal spoke angle is 90 deg by default.
(cherry picked from commit 11ba59b690)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-04-27 17:27:07 +00:00
dsa-t 87f3d45109 Require Wayland 1.20 libraries.
KiCad doesn't build with older versions due to missing definitions.


(cherry picked from commit e26778c599)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-04-27 17:26:57 +00:00
Wayne Stambaugh 2ca07b47af Begin version 8.0.3 development. 2024-04-27 13:10:22 -04:00
Wayne Stambaugh 61a17e4c8b Tag stable version 8.0.2. 2024-04-27 13:08:12 -04:00
Mark Roszko 67dda92437 Hackfix crash in configure paths using non-ascii chars in column headers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17743


(cherry picked from commit a565db58c5)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-04-27 14:17:22 +00:00
Seth Hillbrand 4dfe564243 Update translations 2024-04-26 19:52:18 -07:00
CloverGit 5b3c0028ea Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9170 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-27 04:50:46 +02:00
Tokita, Hiroshi 53d219e9d5 Translated using Weblate (Japanese)
Currently translated at 99.9% (9168 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-04-27 04:50:46 +02:00
2tama3 a4da356ac7 Translated using Weblate (Japanese)
Currently translated at 99.9% (9167 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-04-27 04:50:46 +02:00
Ulices 2915a9d1a2 Translated using Weblate (Spanish (Mexico))
Currently translated at 99.8% (9156 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-04-27 04:50:46 +02:00
Tokita, Hiroshi 6778eb8352 Translated using Weblate (Japanese)
Currently translated at 99.9% (9168 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-04-27 04:50:46 +02:00
CloverGit bdf8c04daf Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9170 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-27 04:50:46 +02:00
Henrik Kauhanen a32ca5d0c4 Translated using Weblate (Swedish)
Currently translated at 99.9% (9168 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-04-27 04:50:46 +02:00
Tokita, Hiroshi 992bee7ec9 Translated using Weblate (Japanese)
Currently translated at 99.9% (9167 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-04-27 04:50:46 +02:00
Henrik Kauhanen 7216527224 Translated using Weblate (Finnish)
Currently translated at 99.7% (9148 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-04-27 04:50:46 +02:00
Jan Straka 09bbabeef3 Translated using Weblate (Czech)
Currently translated at 80.9% (7422 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-04-27 04:50:46 +02:00
CloverGit 3ee74e2966 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9170 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-27 04:50:46 +02:00
dsa-t 312356c284 Translated using Weblate (Russian)
Currently translated at 100.0% (9170 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-04-27 04:50:46 +02:00
Nicoara Alex 6b9dba3d45 Translated using Weblate (Romanian)
Currently translated at 27.0% (2479 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ro/
2024-04-27 04:50:46 +02:00
ZbeeGin 02c03ba2b6 Translated using Weblate (Polish)
Currently translated at 99.9% (9169 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-04-27 04:50:45 +02:00
Laurens Holst c35ba8f4cd Translated using Weblate (Dutch)
Currently translated at 100.0% (9170 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-04-27 04:50:45 +02:00
taotieren c344e170b9 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.9% (9166 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-04-27 04:50:45 +02:00
taotieren 5b5253b6e2 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9170 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-27 04:50:45 +02:00
ZbeeGin 2954378f58 Translated using Weblate (Polish)
Currently translated at 99.9% (9165 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-04-27 04:50:45 +02:00
Pferd O eea71b9209 Translated using Weblate (German)
Currently translated at 100.0% (9170 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-04-27 04:50:45 +02:00
Hubert Hu 8eb98a2094 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9168 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-27 04:50:45 +02:00
CloverGit 85d9feefff Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9168 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-27 04:50:45 +02:00
Henrik Kauhanen c059cbce12 Translated using Weblate (Swedish)
Currently translated at 99.9% (9168 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-04-27 04:50:45 +02:00
dsa-t a84aa449b2 Translated using Weblate (Russian)
Currently translated at 99.9% (9169 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-04-27 04:50:45 +02:00
Tokita, Hiroshi a4a2ec07c4 Translated using Weblate (Japanese)
Currently translated at 99.8% (9154 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-04-27 04:50:45 +02:00
Pferd O d5557caa33 Translated using Weblate (German)
Currently translated at 99.9% (9164 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-04-27 04:50:45 +02:00
Wellington Terumi Uemura 47717ca779 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9170 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-04-27 04:50:45 +02:00
Tokita, Hiroshi d7f742f911 Translated using Weblate (Japanese)
Currently translated at 99.6% (9135 of 9170 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-04-27 04:50:44 +02:00
Seth Hillbrand 86ebc85404 Avoid assert on unhandled properties call 2024-04-26 19:50:00 -07:00
jean-pierre charras 5d4ed4b21a French translation: fix a typo 2024-04-26 09:58:07 +02:00
Seth Hillbrand 1ca0737c34 Replace stale pin references with UNDO copy
When we replace a symbol with one that has fewer pins, the old pins
are released, which leaves points to them in the connection graph
dangling.  This updates the pointer to use the cloned copy in the undo
stack until the connection graph is rebuilt with the new data

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

(cherry picked from commit 315ad0e071)
2024-04-24 12:55:30 -07:00
Seth Hillbrand 3a29fa44e3 Ensure that missing pins are added to extraction
When changing from a larger part to a smaller part, the previously
existing pins may be removed from the screen but still linked to
elements in the connection graph because we don't set them dirty unless
the changed element overlaps

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

(cherry picked from commit 0cd3e17db7)
2024-04-23 19:37:59 -07:00
Wayne Stambaugh 3517d25aec Tag stable version 8.0.2 release candidate 2. 2024-04-18 16:21:19 -04:00
Wayne Stambaugh 8d62a5fd3f Fix missing instance data when reusing an already loaded schematic.
Remove duplicate sheet instance page numbering.  It's already done when
the sheet is loaded from an exiting file or an already loaded schematic.
Remove the unnecessary page update code from the drawing tool.

(cherry picked from commit 17bcc27ff6)
2024-04-18 16:07:36 -04:00
Seth Hillbrand 9e5876df5c Remember to set the root sheet before loading
This is done in the frame for GUI loading so we need to explicitly set
this when loading files in the cli

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

(cherry picked from commit f8a25d20f8)
2024-04-18 10:48:15 -07:00
Seth Hillbrand fdc3806ed1 Protect courtyard cache regen
The courtyards are referenced by multiple calls and will be rebuilt on
command.  If this happens during zone fill (because the board timestamp
has incremented since the start) multiple threads may generate the cache
at the same time, leaving one with an invalid pointer

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

(cherry picked from commit df5dd15c6f)
2024-04-18 08:41:43 -07:00
jean-pierre charras 798b827a12 Plot pads: Do not use pad offset twice when plotting chamfered rect pads
from Master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17793
2024-04-18 14:03:11 +02:00
Seth Hillbrand 4ade0ac73d Don't sort on lost references
The arraystring reference is lost when we don't keep the wxFileName
variable in scope.

This also adds removing invalid paths and checking for correct version
before sorting

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

(cherry picked from commit d2701323a8)
2024-04-17 12:24:17 -07:00
Seth Hillbrand 65fd8d22ed Mask aperture pads can have multiple layers
But as long as they don't have copper, we should treat them as mask
apertures

(cherry picked from commit 02cdb0c6b9)
2024-04-16 15:54:36 -07:00
Alex Shvartzkop 481c1592ae STEP export: don't fail when can't construct a wire.
This can happen with very small shapes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17774
2024-04-17 01:35:00 +03:00
Mark Roszko 9af12e60d2 Close bom file earlier
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17779

(cherry picked from commit 5d7e96841b)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-04-16 14:30:13 +00:00
Marco Ciampa 048448296d Updated Italian translation 2024-04-15 23:38:28 +02:00
Wayne Stambaugh e03308e5ca Tag stable version 8.0.2 release candidate 1. 2024-04-15 06:20:59 -04:00
Wayne Stambaugh 16691c8d03 Fix string so it gets translated properly. 2024-04-15 06:18:20 -04:00
jean-pierre charras dac0296e3a French translation update 2024-04-15 10:41:22 +02:00
Seth Hillbrand 52ce4c0313 Update translations 2024-04-14 14:22:32 -07:00
Henrik Kauhanen 1956204635 Translated using Weblate (Swedish)
Currently translated at 99.9% (9161 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-04-14 23:19:57 +02:00
pominglee b4bd14ba10 Translated using Weblate (Chinese (Traditional))
Currently translated at 93.6% (8583 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-04-14 23:19:57 +02:00
pominglee 8f7f6739c3 Translated using Weblate (Chinese (Traditional))
Currently translated at 93.6% (8583 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-04-14 23:19:57 +02:00
pominglee 4eebd8ad6c Translated using Weblate (Chinese (Traditional))
Currently translated at 93.5% (8573 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-04-14 23:19:57 +02:00
Marek 4b3d67ffda Translated using Weblate (Polish)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-04-14 23:19:57 +02:00
Ulices f3e3236a43 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-04-14 23:19:57 +02:00
Ulices 82ee4a81ed Translated using Weblate (Spanish)
Currently translated at 99.1% (9082 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es/
2024-04-14 23:19:57 +02:00
Alex Gellen 55fbdddbb7 Translated using Weblate (Romanian)
Currently translated at 27.0% (2477 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ro/
2024-04-14 23:19:57 +02:00
Henrik Kauhanen 7cce1901b2 Translated using Weblate (Swedish)
Currently translated at 99.9% (9161 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-04-14 23:19:57 +02:00
김랑기 0f4f1c0d3b Translated using Weblate (Korean)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-04-14 23:19:57 +02:00
j.Kolod 78849ba5c0 Translated using Weblate (Polish)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-04-14 23:19:56 +02:00
김랑기 a066c57fcc Translated using Weblate (Korean)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-04-14 23:19:56 +02:00
CloverGit 8684c0f9be Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-14 23:19:56 +02:00
ssantos db94f8c8ef Translated using Weblate (Portuguese)
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt/
2024-04-14 23:19:56 +02:00
co8 j db0f7ec457 Translated using Weblate (Japanese)
Currently translated at 99.6% (9128 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-04-14 23:19:56 +02:00
Jan Straka 2bf4cca58a Translated using Weblate (Czech)
Currently translated at 80.6% (7390 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-04-14 23:19:56 +02:00
Laurens Holst 4470f4e6d8 Translated using Weblate (Dutch)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-04-14 23:19:56 +02:00
pondahai e516ab5114 Translated using Weblate (Chinese (Traditional))
Currently translated at 93.5% (8572 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-04-14 23:19:56 +02:00
김랑기 0282b142b8 Translated using Weblate (Korean)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-04-14 23:19:56 +02:00
Ulices 676108952e Translated using Weblate (Spanish (Mexico))
Currently translated at 99.7% (9141 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-04-14 23:19:56 +02:00
aris-kimi 8470091a4b Translated using Weblate (Greek)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/el/
2024-04-14 23:19:56 +02:00
Jan Straka 3302ef537f Translated using Weblate (Czech)
Currently translated at 80.1% (7348 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-04-14 23:19:56 +02:00
CloverGit 366f7aea6b Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-14 23:19:56 +02:00
Dmitry Mikhirev eed2221651 Translated using Weblate (Russian)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-04-14 23:19:56 +02:00
Laurens Holst 90093c0fdd Translated using Weblate (Dutch)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-04-14 23:19:55 +02:00
simmon 2adccce3b8 Translated using Weblate (Korean)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-04-14 23:19:55 +02:00
CloverGit 6bf9653bef Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-14 23:19:55 +02:00
dsa-t 04c083ac48 Translated using Weblate (Russian)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-04-14 23:19:55 +02:00
Laurens Holst 9a236e5972 Translated using Weblate (Dutch)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-04-14 23:19:55 +02:00
pominglee 521e773f2c Translated using Weblate (Chinese (Traditional))
Currently translated at 93.5% (8572 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-04-14 23:19:55 +02:00
Andrej Valek e28aa6d16c Translated using Weblate (Slovak)
Currently translated at 65.0% (5956 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-04-14 23:19:55 +02:00
Andrej Valek 001c90c69f Translated using Weblate (Slovak)
Currently translated at 64.8% (5944 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-04-14 23:19:55 +02:00
Laurens Holst cba73e6cea Translated using Weblate (Dutch)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-04-14 23:19:55 +02:00
Ulices 5af4f3f9df Translated using Weblate (Spanish (Mexico))
Currently translated at 99.5% (9125 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-04-14 23:19:55 +02:00
pominglee e1b922ae19 Translated using Weblate (Chinese (Traditional))
Currently translated at 93.5% (8568 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-04-14 23:19:55 +02:00
CloverGit f1d988788a Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-14 23:19:55 +02:00
dsa-t 8e6cb7b350 Translated using Weblate (Russian)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-04-14 23:19:55 +02:00
Toni Laiho 6685eefc8e Translated using Weblate (Finnish)
Currently translated at 99.9% (9159 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-04-14 23:19:55 +02:00
aris-kimi 8d231b8c96 Translated using Weblate (Greek)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/el/
2024-04-14 23:19:54 +02:00
ZbeeGin 313e09cfd3 Translated using Weblate (Polish)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-04-14 23:19:54 +02:00
Laurens Holst 5a05a1337e Translated using Weblate (Dutch)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-04-14 23:19:54 +02:00
Ulices a40929fa71 Translated using Weblate (Spanish (Mexico))
Currently translated at 99.5% (9120 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-04-14 23:19:54 +02:00
CloverGit 37eb5f4a8d Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-04-14 23:19:54 +02:00
Henrik Kauhanen b7d1fb944c Translated using Weblate (Swedish)
Currently translated at 99.9% (9161 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-04-14 23:19:54 +02:00
Marcel Hecko 9797d2d133 Translated using Weblate (Slovak)
Currently translated at 64.6% (5923 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-04-14 23:19:54 +02:00
dsa-t e34bb98ba1 Translated using Weblate (Russian)
Currently translated at 99.9% (9161 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-04-14 23:19:54 +02:00
Pedro Moreira 60440094ba Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-04-14 23:19:54 +02:00
Laurens Holst c198e5ee15 Translated using Weblate (Dutch)
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-04-14 23:19:54 +02:00
김랑기 ceedfd9b7e Translated using Weblate (Korean)
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-04-14 23:19:54 +02:00
Pedro Moreira a4fbbaaa0b Translated using Weblate (Korean)
Currently translated at 99.9% (9162 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-04-14 23:19:54 +02:00
Pferd O 6cbdac5bf1 Translated using Weblate (German)
Currently translated at 100.0% (9163 of 9163 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-04-14 23:19:54 +02:00
Seth Hillbrand 26629928c3 Incremental updates should not clear globals
Netclass assignments are stored in the project level but
CONNECTION_GRAPH updates would clear the assignments.  This keeps
existing netname->netclass assignments but updates any netnames that
were changed by the incremental updates.  Absolute updates are not
affected and fully recreate the net name to netclass map

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

(cherry picked from commit e538b98286)
2024-04-14 14:14:38 -07:00
Seth Hillbrand 55c864ec45 Fix incremental connectivity
The connectivity routine would consider symbols, overwriting unused
subgraphs for pins that were not in the change list.  This is resolved
by updating the full connectivity to only use pins in the graph since
symbols are not connected independently.

In the process of adding QA tests for this change, additional issues
with the schematic QA were discovered.  Specifically, we were not
properly setting the root sheet UUID.  This was partially masked by a
const_cast setting of the RefDes in sch_symbol when called the RefDes
getter.  This exposed the fact that our QA ERC numbers did not match the
schematic editor stand alone ERC numbers.  So the test value for one
check needed to be updated

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

(cherry picked from commit a9f35ba42e)
2024-04-14 14:14:38 -07:00
Seth Hillbrand 07b5fd342a Ensure that we are not calculating self-collision
Ratsnest may have connections from a zone to two different items.  This
should be avoided as we never want to draw the ratsnest line with the
same element as start and finish

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

(cherry picked from commit 8760519a87)
2024-04-14 13:50:44 -07:00
Seth Hillbrand 4481fcc75e Check for valid shared pointer before locking
We don't neccesarily have a valid pointer to the parent lib symbol when
checking if it is a power symbol, so fall back to the local flag if this
is the case

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17182
2024-04-11 14:42:53 -07:00
Seth Hillbrand a155dd32e8 Do not set optional defaults
In the file format, the 'mirror' tag is optional (not written unless on)
so we cannot default the new text to 'mirror' on just because the
footprint is on the back layer as it won't be turned off by the
footprint loader.

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

(cherry picked from commit d0fe2e06aa)
2024-04-11 09:43:55 -07:00
Wayne Stambaugh c4c804edf7 Update hierarchy navigator when undoing or redoing sheet name changes.
Use new schematic commit object in the edit sheet properties dialog.

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

(cherry picked from commit ec310ac3ed)
2024-04-11 10:51:04 -04:00
Wayne Stambaugh b26ca0e21a Maintain hierarchy navigator expansion state between edits.
Prevent the hierarchy navigator from being rebuilt unless there are actual
sheet changes that would cause a change to the tree.

Save the tree expansion state before rebuilding the tree and then restore
the expansion state to the previous state sans edits.

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

(cherry picked from commit 797ab998cc)
2024-04-11 10:32:40 -04:00
Alex Shvartzkop 97b15a1708 Show actual IO_ERROR message at VRML import.
https://gitlab.com/kicad/code/kicad/-/issues/17727
2024-04-11 14:36:44 +03:00
Seth Hillbrand e808ab7409 Re-add routine to remove duplicate points
The router needs to elimitate duplicate points but keep colinear
segments.  This re-creates the partial routine from the old Simplify()
function

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

(cherry picked from commit 59f99d9a6a)
2024-04-11 14:20:50 +03:00
Huang Rui 7dc8527022 libgit2-1.8.0 compatibility: adjusted parent pointer type
- Adjusted parent pointer type in git_commit_create call for compatibility
  with libgit2 1.8.0 and above.
- Included preprocessor checks to maintain support for versions older than
  1.8.0.
- Ensures consistent function behavior across different libgit2 versions.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17536
Signed-off-by: Huang Rui <vowstar@gmail.com>


(cherry picked from commit 1cbf6a1872)
2024-04-11 08:45:19 +00:00
afkiwers f7765ea5b9 add support to update an already existing field
(cherry picked from commit d45911f54b)
2024-04-09 23:37:52 +00:00
Marco Ciampa f1d687cfdb Updated Italian translation 2024-04-08 23:17:23 +02:00
Marek Roszko 57468c29f9 Use kicad-vcpkg fork of liblzma to fix builds
(cherry picked from commit 6ac1f39e62)
2024-04-07 14:55:55 +00:00
Jon Evans 30df673ffa Check for bus no-connects in ERC
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13285


(cherry picked from commit ce846f5c22)
2024-04-07 12:50:45 +00:00
Jon Evans 55b7852a65 Disable lazy-loading of 3D models on macOS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17198


(cherry picked from commit b36312ff24)
2024-04-07 12:21:11 +00:00
JamesJ 026685ee48 Check a SHAPE_POLY_SET outline exists before attempting to get it by index
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17687
2024-04-06 20:17:39 +02:00
Jon Evans 8b5c292397 Fix SWIG wrapper for AddPrimitive
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17676


(cherry picked from commit c1e7668d80)
2024-04-05 03:09:35 +00:00
Marek Roszko 941420abed Add missing gltf find in occ 7.8
(cherry picked from commit 58913a0616)
2024-04-03 01:07:18 +00:00
Jon Evans a042d1aab4 Show all library children if library name matches search 2024-04-02 18:51:19 -04:00
Jon Evans 53c2543474 Fix parsing of legacy text hide token 2024-04-02 18:26:30 -04:00
Alex Shvartzkop bac0820864 Improve moving, rendering and plotting of very small angle arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17110


(cherry picked from commit b905b4eac8)
2024-04-02 21:41:09 +00:00
Seth Hillbrand e0381f25f7 Prevent OOB access in polygon split
Check for vertex placement against original size.  Since we are
potentially adding vertices that are out of order with the original
polygon, we only want to check against the first set of vertices when
checking for polygon collision

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

(cherry picked from commit 8260c174e9)
2024-04-02 11:23:30 -07:00
Mike Williams ce2ea3f3ae PCB: update footprint field when changing footprints
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17598
2024-04-02 08:18:23 -04:00
Seth Hillbrand c0d38de280 Add some corrections to IPC2581 export syntax
Outline fonts need lineDesc
Padstack def need the location for the pad relative to the padstack

(cherry picked from commit 2123e2ca9c)
2024-04-01 22:59:40 -07:00
Marek Roszko 9a728c37df Use macro not function for the occ lib find
(cherry picked from commit 303bc19ce8)
2024-04-02 01:55:08 +00:00
Seth Hillbrand 6be6210b67 Recreate teardrop QA board for v8 2024-04-01 17:55:29 -07:00
Seth Hillbrand b21165722b Forward and reverse test for point in poly collisions
(cherry picked from commit 4e6cd0d293)
2024-04-01 17:55:29 -07:00
Seth Hillbrand fd5d68ca9b Remove duplicated clearanceEpsilon
We already get clearance epsilon in the clearance resolver.  Don't
subtract it twice or we end up getting DRC errors

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

(cherry picked from commit 10c1072479)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 9f26cbb89a Add colored tab to fileicons
Allows differentiation when Windows badges the bottom left

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

(cherry picked from commit e11cc322fd)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 0dc894356b Check singular arcs connection
Even if there are no other segments in the line chain, we still should
check for arc connections in cases of individual arcs on a line chain

(cherry picked from commit 6b915049d1)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 6b5acdea1f When dragging a via, we need to get all obstacles
The clearance epsilon should not be used to limit which force elements
we return in the query.  Otherwise, we can drag elements into a
DRC-violating space

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

(cherry picked from commit 5e850911c5)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 892c5726f5 Move logging message after vertex check
When creating the list, we may have fewer than needed vertices, which
prevents calculating the area

(cherry picked from commit 6c05f2c67c)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 6c7261a223 Utilize hash_combine to avoid hash collision
Most of our pointers will share the top 32 or more bits of their pointer
addresses, making cache collisions highly likely.  This uses a hash
combiner to mix the bits more effectively

(cherry picked from commit e4756c811e)
2024-04-01 17:55:29 -07:00
Seth Hillbrand ae11213622 Handle small holes in DRC Connection width test
If there is a small hole (smaller than the conn width), we can loop
around in a circle checking all points and not move past the mimimum
distance.

To avoid this, if we detect a loop, we exit the substantial checker.
This should return with true because a large hole will return true and
we are only checking to see if there is a minimum amount of copper
between two open areas

(cherry picked from commit c841d0df6d)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 4bf35cbed8 Remove duplicated clearanceEpsilon
We already get clearance epsilon in the clearance resolver.  Don't
subtract it twice or we end up getting DRC errors

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

(cherry picked from commit 10c1072479)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 7916e56963 Avoid crashing on missing tracks in CADSTAR
We can't assume that the ignored connection exists when trying to set
the junction size.  We use int_max for the default instead of 0 so that
later, we don't try to create a minor track with 0 width in loadNets()

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

(cherry picked from commit 00d108498f)
2024-04-01 17:55:29 -07:00
StefanBruens b9b4ff6f5e Fix triangulationValid check race for zone fill
The m_triangulationValid flag is used in several places without holding
the mutex, thus it should only ever be set when the triangulation is
guaranteed to be valid.

This can either be done by protecting both data and flag by the same
mutex, or updating the flag only after the triangulation has finished.

Also fix the case when the triangulation actually fails, the flag should
not be set in this case.

While at it, simplify the recalculation check. Only if both the
triangulation is valid, and the data hash is unchanged the recalculation
can be skipped - this is typically the case when two threads try to
update the cache concurrently, the second one will block at the mutex,
and will see the valid data after the first thread has finished.

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

(cherry picked from commit e07b4ce8e4)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 734222bd88 Fix race condition in zone fill
When checking collisions, the SHAPE_POLY_SET::Collide() routine is not
const because it will regenerate the triangulation cache if it is out of
date (using a const_cast, grrr).  This sidesteps the issue by assigning
a mutex to the triangulation caching

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

(cherry picked from commit 81cb6d0c3f)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 01590385c7 Handle issue with alternate SHAPE_LINE_CHAIN
SHAPE_LINE_CHAIN_BASE can include things that are not SHAPE_LINE_CHAIN
like the triangle SHAPE_LINE primitive.  To check arcs, we need to avoid
these elements as they do not have the full SHAPE_LINE_CHAIN class
available.

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

(cherry picked from commit 347c50b26d)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 9be4bf0d14 Fix slow selection time when calculating clearance
The clearance between two zones could be rather slow.  This was in part
to trying to do triangle-triangle collisions between zones when we only
need outline collision and in part to the shape_line_chain collision
routine.  The shape_line_chain collisions don't need to recreate
segments on each iteration and should instead create them once and using
this to check all collisions

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

(cherry picked from commit 3cc1617f5a)
2024-04-01 17:55:29 -07:00
Seth Hillbrand b1677d5f47 Clean and standardize cross-probing action
Between schematic and pcb editors, we want the following actions:

- Single click on ERC/DRC item should show the item in the ERC/DRC
  window.  But if the window is not visible, it should only update the
  status bar
- Double click on ERC/DRC item should show and raid the ERC/DRC window
  as well as select the line item

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

(cherry picked from commit 0f57d76ecd)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 1e13a7640e Tidy up some remaining triangulation cases
Found and fixed a few corner cases where triangulation point removal
could reset expected points

(cherry picked from commit 553e4a25bf)
2024-04-01 17:55:29 -07:00
Marek Roszko 804283877c Fix cmake find of opencascade libraries for occt 7.8
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17654


(cherry picked from commit c8e41dcfe8)
2024-04-02 00:50:12 +00:00
jean-pierre charras 65ace8d03d 3D viewer: Allow setting colors not in board stackup, when use board stackup option is set.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17632
2024-04-01 09:38:24 +02:00
Seth Hillbrand 890376d04f Do not use cache when we modify vertices
When we add vertices to the tesselation routines, we cannot reuse these
without the original vertex points.

It may be possible to copy and modify the vertices from the hint data so
that they are properly positioned but naive attempts (moving based on
first point) did not work, so for now, we disable the hint cache when
the vertex sizes do not match as this prevents OOB access

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

(cherry picked from commit 06b199fd41)
2024-03-31 15:01:16 -07:00
JamesJ 18990587b9 Only delete grouped / generated BOARD_ITEMS from the root item
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17527

This is required as during an undo / redo operation, rebuilding
the previous selection can result in a group / generator being
selected as well as all of their contained items. This prunes
the contained items to remove the possibility of a double-delete.

(cherry picked from commit 6c73f1feef28925bf26fcc3669cb6333aad5f1d3)
2024-03-30 14:20:58 +00:00
James J 75ef003747 Add option to preserve custom power flag values in Update Symbols from Library dialog
(cherry picked from commit bf7896a0e1)
2024-03-30 14:15:29 +00:00
Marek Roszko b9a6f47929 Fix DRC slowdown due to UI yields
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17434


(cherry picked from commit fd501b4bc8)
2024-03-30 03:34:27 +00:00
Jeff Young 857219d70d Fix merge error. 2024-03-29 18:26:14 +00:00
Jeff Young 92275c41cc ADDED: Expose units and DeMorgan to properties system.
(Also fixes inheritance bug in LIB_PIN's properties.)

(cherry picked from commit 58df9c96f4)
2024-03-29 17:49:48 +00:00
Jeff Young 09985988e7 Fix footprint undo for new UUID caches.
The footprint's children get swapped by the parent's std::swap
call, so they need to get removed/added to their parent around
the swap.

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

(cherry picked from commit 2c21ef1ed0)
2024-03-29 17:48:12 +00:00
Jeff Young 524d431438 More defensive coding for KICAD-YP.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17560

(cherry picked from commit 2f2c42a06b)
2024-03-29 17:46:07 +00:00
Jeff Young ccd052cc99 Attempt to prevent KICAD-YP.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17560

(cherry picked from commit a53bc9e026)
2024-03-29 17:46:04 +00:00
Jeff Young 1f461c7508 Close active cell editor when showing/hiding columns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17425

(cherry picked from commit f3ce3bc758)
2024-03-29 17:45:35 +00:00
Jeff Young 4bea619855 Make sure users don't run into min text size.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17543

(cherry picked from commit fc572bfbc6)
2024-03-29 17:45:13 +00:00
Jeff Young f3621496fb Don't show hidden text in symbol previews.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17526

(cherry picked from commit 1e6eb652aa)
2024-03-29 17:44:47 +00:00
Jeff Young 1238c081c6 Expose groups to property manager.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17496

(cherry picked from commit 82c851a4a7)
2024-03-29 17:44:14 +00:00
jean-pierre charras 663e857df6 3D viewer: fix some graphic issues:
Avoid issue when a copper layers thickness is 0 (min value is now 1 micrometer)
Fix incorrect rendering of plated graphic items and vias (vertical walls not drawn)
From master branch
2024-03-29 07:39:49 +01:00
Seth Hillbrand 92ffd898f5 Update triangulation to handle poly-intersection
Polygon intersections happen against the original outline, not against
the currently remaining polygon.  This avoids pathalogical cases

Adds new simplification system to avoid duplicated points
Adds new edge-splitting algorithm to provide additional fall-back
Verifies that polygon cuts do not swap holes for outlines (negative
area)

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

(cherry picked from commit c3f6a84d66)
2024-03-28 13:55:06 -07:00
Céleste Wouters 76e0f94532 Improve SHAPE_POLY_SET fracture performance
Refactors `SHAPE_POLY_SET::fractureSingle()` to be more efficient, while
not changing the actual algorithm:

* increase cache locality by using contiguous arrays instead of what was
effectively a linked list
* reduce latency and jitter by replacing per-edge allocator calls with
ahead-of-time std::vector reserves
* increase cache efficiency by making the vertex struct smaller
* replace O(n^2) leftmost edge search with O(n log n) std::sort
* sort the polygons instead of the edges
* cut iteration count in half in the remaining O(polygons * edges) part

(cherry picked from commit e98c9f283f)
2024-03-28 13:10:43 -07:00
Seth Hillbrand ff2d0cfb10 Fix typo in triangulation return
(cherry picked from commit a793fa8b17)
2024-03-28 13:10:43 -07:00
Seth Hillbrand 1cc10be443 Skip small triangles
The minor triangles cost the same amount of compute time as larger ones
but do not have a material effect on the zone display.  This skips these
minor triangles when earcutting

(cherry picked from commit a58e7b37ff)
2024-03-28 13:10:43 -07:00
Seth Hillbrand d2db96886d Add logging and area check to tesselation
Logging is useful when we find an area that cannot be triangulated.
This will be used to generated test cases.

Skipping minor untesselated areas means that the polygon will still be
considered fully tesselated (and not sent back again and again) even if
the tesselation misses an area less than the configured limit.
Currently, this is 31^2nm.

(cherry picked from commit 7e7fec69f6)
2024-03-28 13:10:43 -07:00
Seth Hillbrand 3d4a7c7c3f Update triangulation
(cherry picked from commit 4f03bb2fb6)
2024-03-28 13:10:43 -07:00
arturo182 d46139d5e3 kicad_advanced: Make OCE tesselation deflection configurable
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17168

(cherry picked from commit 41147dc3b3)
2024-03-28 13:10:43 -07:00
Seth Hillbrand 40f938dc75 Sort netnames in properties panel
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15590

(cherry picked from commit c3a5b92ed0)
2024-03-28 13:06:18 -07:00
JamesJ 30dbafaf7c Use bulk BOARD_LISTENER calls following undo or redo operations
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17561
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17420

(cherry picked from commit f51e775f26)
2024-03-24 19:39:25 +00:00
Alex Shvartzkop 05dedbd892 Fix spelling mistake.
(cherry picked from commit bd59fb7768)
2024-03-23 18:43:47 +00:00
Alex Shvartzkop c0dba1e00d Don't print unnecessary digits after decimal point for imperial units.
1 nm = 0.00003937 mils = 0.00000003937 inches,
So there's no reason to print more decimal places than 5 for mils and 8 for inches.

Related: https://gitlab.com/kicad/code/kicad/-/issues/15539


(cherry picked from commit 93581607a8)
2024-03-23 18:40:11 +00:00
JamesJ cc3e57b52f Don't re-highlight nets on every bulk segment change in net inspector
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17068
2024-03-23 15:35:21 +00:00
Alex Shvartzkop 70a6697c16 Fix warning due to unused angle in EasyEDA Pro schematic parser.
(cherry picked from commit 1c7e3871b5)
2024-03-23 14:52:05 +00:00
wh201906 869f30e291 Add toggleHV45Mode item to the measure tool's context menu
The behavior of the measure tool is influenced by the
horizontal/vertical/45-degree mode, but the context menu of the measure
tool lacks an option to toggle this mode. In contrast, the drawing
tools are also affected by this mode, and their context menu has the
item to toggle this mode.


(cherry picked from commit 806daecf85)
2024-03-23 13:33:32 +00:00
Jeff Young 4c78652690 Ignore graphic shapes that implement netties.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17223


(cherry picked from commit 88c1fa3e26)
2024-03-23 13:19:37 +00:00
jean-pierre charras afcda88ee3 GERBER_JOBFILE_WRITER: use UTF8 encoding according to current specif.
Since 2020, non ASCII7 chars are encoded using UTF8 encoding.
A old but incorrect encoding was previously used.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17534
2024-03-22 10:09:47 +01:00
dsa-t 605fe4ce99 Disallow cross-probing when not on Symbol Fields Table Edit tab.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17531


(cherry picked from commit db12f2af49)

ce625541 Disallow cross-probing when not on Symbol Fields Table Edit tab.
2024-03-21 19:09:34 +00:00
Jeff Young a3ee317277 Fix copy/pasta in tooltips.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17515

(cherry picked from commit 913e6b47d7)
2024-03-21 18:19:48 +00:00
Jeff Young f7bce264bb Don't take too long worrying about very small exposed areas.
(And in particular, don't take forever if the min / 10 results
in step being 0.)

(cherry picked from commit b285545aee)
2024-03-21 18:19:48 +00:00
jean-pierre charras dfe6cb7afa Do not run DRAWING_TOOL::PlaceTuningPattern() inside the footprint editor
The footprint editor cannot run the router.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17522
2024-03-21 15:22:13 +01:00
jean-pierre charras 8bdc62c111 Avoid using a nullptr. 2024-03-20 18:35:26 +01:00
Alex Shvartzkop 350687f355 STEP export: add location info to edge add failures.
(cherry picked from commit 800ff9ffb1)
2024-03-19 23:11:20 +03:00
Alex Shvartzkop 3a5a911012 STEP export: handle small segments connecting two arcs better.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17499

(cherry picked from commit 75037dd1d1)
2024-03-19 22:55:17 +03:00
Roberto Fernandez Bautista b40d19eb79 nanodbc: Fix use after free
Cherry picked from upstream commit e24383436703c9151af1e22652e7d4dbbb52fc15

https://github.com/nanodbc/nanodbc/commit/e24383436703c9151af1e22652e7d4dbbb52fc15
(cherry picked from commit 69107816f1)
2024-03-19 18:56:43 +01:00
jean-pierre charras 3e4ca3a1c7 Step exporter: workaround to fix issue for boards with main round outline
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17446
2024-03-19 16:13:13 +01:00
Mark Roszko 663918107e Add missing text var override to cli gerbers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17283

(cherry picked from commit d904535a15)
2024-03-19 14:35:30 +00:00
Mike Williams 1ac1f0445f prettifier: add newlines to golden samples 2024-03-19 09:46:42 -04:00
Mike Williams bce982877c prettifier: add newline to end of file
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17480
2024-03-19 09:46:42 -04:00
Jeff Young 9704543b7a Don't assume all glyphs are outline with an outline font.
Underline and overbar may be stroke glyphs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17478
2024-03-18 22:20:44 +00:00
jean-pierre charras f90c3ef075 hotkey selector dialog: accept hotkey using Alt key modifier on Windows.
On Windows, Alt key is specific, and the dialog did not accept the modifier

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17453
2024-03-18 18:19:39 +01:00
wh201906 11177bf658 Fix selected item count in the properties panel
The code for updating selected item count is skipped if the properties
items don't change.


(cherry picked from commit 3f2e3d89e2)
2024-03-17 22:27:05 +00:00
Jeff Young 81f55dfc9c Fix layer swapping for multi-layer items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17371

(cherry picked from commit 44c14b1935)
2024-03-17 12:40:58 +00:00
Roberto Fernandez Bautista c935ef890a Database library cache: fix memory leak
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17435

(cherry picked from commit 4851b0f1ac)
2024-03-17 11:41:46 +01:00
jean-pierre charras 71af5b106a Demos update 2024-03-16 14:55:47 +01:00
jean-pierre charras d24012bef5 Revert "Demos update."
This reverts commit b4131f2575.
Files from 8.99 were committed by mistake
2024-03-16 14:55:47 +01:00
Wayne Stambaugh e904731e28 Do not update schematic connectivity for irrelevant property changes.
Prior to this change, the schematic connectivity was updated any time a
change was made to a connectable object.  Now the connectivity is only
updated when an object change actually affects the connectivity.  Other
properties like line width, fill type, custom fonts, etc. will not cause
the connectivity graph to be rebuilt.

The SCH_COMMIT flag SKIP_CONNECTIVITY has been removed.  All schematic
objects can test if they are connectable and if there have been changes
to any connection properties that require a connectivity rebuild.

Remove duplicate rebuild connectivity calls from editor control tool.
This was causing the tangling end test to get called four times on every
undo and redo action because the dangling end test is already called in
the connectivity graph calculation code.

Update connectivity when changing label names which fixes an unreported
connectivity bug.

(cherry picked from commit c5a02fc266)
2024-03-16 09:36:56 -04:00
Mojca Miklavec dcd304c5d8 Change the platform detection order
Make sure that windows-specific getWindowsKiCadRoot() is only called on Windows


(cherry picked from commit 01cb1543bb)
2024-03-16 12:23:04 +00:00
Jeff Young 8275176792 Report location of FUTURE_FORMAT_ERRORs when reading footprints. 2024-03-15 22:47:00 +00:00
Jeff Young 8589bd3773 Correctly handle locked token for PCB_TEXTBOX and PCB_TABLECELL.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17439

(cherry picked from commit d17151ac1b)
2024-03-15 22:24:53 +00:00
Jeff Young c07604bb03 Add autocomplete accept & cancel to the hotkeys list.
(cherry picked from commit da2610b93b)
2024-03-15 22:24:53 +00:00
jean-pierre charras b4131f2575 Demos update. 2024-03-15 15:41:16 +01:00
jean-pierre charras b718c228fe Symbol Editor: do not allow to select fully invisible pins and fields
Of course, invisible pins or fields shown by using option Show invisible
pins or Show invisible fields can be selected.
From master branch
2024-03-15 15:03:38 +01:00
jean-pierre charras 3d04d78f76 Symbol Editor do not display bounding box of invisible pins and fields 2024-03-15 15:03:38 +01:00
Yon Uriarte 6ebccdecc6 Responsive: Avoid excessive repaints when toggling a netclass' rastnest visibility.
Toggling netclasses visibility toggles the member nets' visibility one by one. Defer redrawing until all toggling is done.

Fixes https://gitlab.com/kicad/code/kicad/issues/17115

(cherry picked from commit 4e8e14ae3a)
2024-03-15 09:45:09 -04:00
Yon Uriarte 4e8d6de1de Responsive: OPENGL_GAL::DrawArc reserve linequads to reduce drawing time
(cherry picked from commit 77576e1a80)
2024-03-15 09:45:09 -04:00
Yon Uriarte 8b281b4d1c Performance: Cache BOARD::GetMaxClearanceValue
(cherry picked from commit fe1c73ed7c)

1b35a512  Performance
2024-03-15 13:34:19 +00:00
Wayne Stambaugh 8ce12fb1af Fix Eagle footprint library QA test failure.
Unfortunately the KiCad library I/O does not unescape file names so do not
escape them in the Eagle board plugin.

(cherry picked from commit cf97432833)
2024-03-15 07:59:20 -04:00
Wayne Stambaugh 9e4efe5d72 Fix Eagle board import when footprint library versions exist.
This was a crude hack that appends the library URN ordinal to the name of
the footprint so that it can be correctly looked up by the "element" node.
The Eagle XML DTD does not make it clear how the URN "ASSET_ID" and
"VERSION" are used to look up the appropriate "ASSET_TYPE" so this is a
best guess and seems to work correctly.

The inferred edge clearance dialog had to be disabled when importing third
party boards because on GTK (and possibly other platforms) the dialog would
completely hang KiCad preventing the imported board and possible schematic
from being saved.

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

(cherry picked from commit 34ec57958d)
2024-03-15 07:59:20 -04:00
Wayne Stambaugh ab6c64b49a Clean up debugging output accidentally left in previous commit.
(cherry picked from commit 33566f88a9)
2024-03-15 07:59:20 -04:00
Wayne Stambaugh dd71173263 Fix broken paste special keep existing symbol annotations.
This was only broken for symbols on the sheet where the symbols were
copied from.  The symbol annotation for all sub-sheets was preserved.

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

(cherry picked from commit 0ff8d21459)
2024-03-15 07:59:20 -04:00
Alex Shvartzkop 89ed09744b Fix a crash in PNS zone sync when there's more outlines than triangulated polygons.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17351

(cherry picked from commit b56ee20e22)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop ddec1d5317 Disable infinite panning when using XWayland.
Cursor warping doesn't work properly in this scenario.

https://gitlab.com/kicad/code/kicad/-/issues/14109
(cherry picked from commit 463b609993)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop 50dd6185bb Do not write alpha to the main framebuffer when performing antialiasing.
This allows correct background display when the main framebuffer has alpha.
Noticeable on Wayland with Mesa 24.0.2 Iris driver.

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

(cherry picked from commit bf6ff5b805)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop 6df17bba99 Fix rendering/plotting of arcs with tiny angle and huge radius.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17343

(cherry picked from commit 4d66a8ebdb)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop ed89827908 Fix zone cross-probing from DRC dialog.
(cherry picked from commit aa68a3817a)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop b61f6c35c7 Fabmaster (CADENCE ASCII): import dimensions graphics.
See https://gitlab.com/kicad/code/kicad/-/issues/17239

(cherry picked from commit a4da829ccc)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop f9253485da Fabmaster (CADENCE ASCII) import: fix position and orientation of footprint graphics.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17239

(cherry picked from commit cb4ace5561)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop 7dc554ec34 EasyEDA Std: fix importing footprints from footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17264

(cherry picked from commit 30573beb48)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop c7608c4bad EasyEDA Std: support multiple schematic sheets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17219

(cherry picked from commit c056ef407a)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop 10ca34e2a7 EasyEDA Std: support Dot and Clock symbol pin styles.
(cherry picked from commit cc181df916)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop e4fc918b11 EasyEDA Std: hide invisible text in symbols.
(cherry picked from commit 69b15e83c5)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop c1a21c9ab1 EasyEDA Pro schematic: place items on root sheet when it's the only sheet.
(cherry picked from commit 563278d0f6)
2024-03-15 01:17:50 +03:00
Alex Shvartzkop 4ac848f18a EasyEDA Std PCB: fix crash when Name/Prefix type text is not in a footprint.
(cherry picked from commit 951c550c1e)
2024-03-15 01:17:49 +03:00
Alex Shvartzkop 46faa0f678 Fix assert in BOARD_ADAPTER::createLayers.
(cherry picked from commit f9ad0a434d)
2024-03-15 01:17:49 +03:00
Alex Shvartzkop 4072bc05af Define __cplusplus according to C++ standard version on MSVC.
Otherwise, macros like KI_FALLTHROUGH are not defined properly.

(cherry picked from commit fa6dc95553)
2024-03-15 01:17:49 +03:00
Alex Shvartzkop e196f71d58 Support Altium Schematic ASCII import
(cherry picked from commit defcb49ac8)
2024-03-15 01:17:49 +03:00
Jon Evans b9d3b571bc Allow specifying a minimum for a via_count constraint
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17234


(cherry picked from commit 3a3ceb8ffc)
2024-03-14 21:01:30 +00:00
Jon Evans 816e3efbd5 Fix a few LIB_TREE search issues
Don't apply pruning to libraries that don't have
any children, since the point of the pruning is to
hide libraries that don't directly match a search
term if they don't have any children that match.

Fix searching for full LIB_IDs that got broken by
the implementation of "AND"

Fix searching for library names alone

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


(cherry picked from commit 0c2a084a47)
2024-03-14 21:01:13 +00:00
Jon Evans 8afbe544a3 Set description on Altium imported symbols
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16943


(cherry picked from commit 4bc69183ab)
2024-03-14 21:00:58 +00:00
Jon Evans c7b7830495 Add environment variable for configuring stock data home
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15687


(cherry picked from commit 9b54537e38)
2024-03-14 21:00:40 +00:00
Jeff Young af3654d389 Reset penWidth before stroking.
(PlotPoly will have set it to "1".)

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

(cherry picked from commit f22f5f47cb)
2024-03-14 18:07:53 +00:00
Jeff Young 838cefaf48 Default is a valid netclass, even if it's not in m_NetClasses.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17388

(cherry picked from commit dac16a02cc)
2024-03-14 18:07:48 +00:00
Jeff Young 4dca966c5d Don't test non-overlapping non-through-hole vias.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17426

(cherry picked from commit a091767551)
2024-03-14 18:07:28 +00:00
Jeff Young 2609882346 Update m_LastLegendPosition after setting dirty bit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17411

(cherry picked from commit 7341d4bf37)
2024-03-14 18:07:07 +00:00
Jeff Young 36fc9191b9 Remove netclass/custom rule handling from Track & Via Properties.
(These should be done in Edit > Edit Track & Via Properties.)

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

(cherry picked from commit 4b6a1f4dbd)
2024-03-14 18:06:44 +00:00
Jeff Young 4583522ea2 Make Edit Track & Via Sizes "specified sizes" dropdowns clearer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17216

(cherry picked from commit 1844bf1708)
2024-03-14 18:06:41 +00:00
Jeff Young f0e2adc3df Don't allow selection of footprint text in board editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17271

(cherry picked from commit 25e181db5c)
2024-03-14 18:06:11 +00:00
Jeff Young 091b34c05f Don't show normal cut/copy/paste items in Signals grid.
(Do allow a copy of signal names though.)

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

(cherry picked from commit ed61c5593f)
2024-03-14 18:05:47 +00:00
Jeff Young 09bc9cd77a Grid properties for GerbView.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17372

(cherry picked from commit 1152b0462c)
2024-03-14 18:05:18 +00:00
Jeff Young e893ed4590 Pass symbol's netlist to footprint preview widget.
This allows us to show the pin functions on the corresponding
pads.

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

(cherry picked from commit 72ba31ba27)
2024-03-14 18:04:52 +00:00
Jeff Young c0ad519e53 Run Edge.Cuts & Margin clearance tests on zone layer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17292

(cherry picked from commit d1d9636598)
2024-03-14 18:04:06 +00:00
Jeff Young 03af8dcc88 Convert OP text variables pin names/numbers to SPICE vectors.
Also fixes a wrap-around bug in SPICE_VALUE::Normalize() where
it would lose the run of itself if the value was already
normalized to either the largest or smallest UNIT_PREFIX.

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

(cherry picked from commit ff8ddae9bd)
2024-03-14 18:03:42 +00:00
Jeff Young 45e17307a1 Resolve double-indirection CURRENT_DATE in title blocks.
If ${COMMENT1} resolves to ${CURRENT_DATE} then we need to resolve again.

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

(cherry picked from commit da634a618f)
2024-03-14 18:02:50 +00:00
Wayne Stambaugh 357226eb71 Begin version 8.0.2 development. 2024-03-13 11:58:22 -04:00
Wayne Stambaugh ac408046cf Tag release version 8.0.1. 2024-03-13 11:55:00 -04:00
Jeff Young 1b3cf70eef Fix copy/pasta in GetLayerColors().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17374

(cherry picked from commit c8d897ed0f)
2024-03-11 17:48:32 +00:00
jean-pierre charras d295014a8c DIALOG_ERC: fix crash when set to ignore a an ERC violation.
If a ERC violation is set to ignore, all corresponding markers are deleted.
But if one of these markers is selected, a crash happens.
Now all selected objects are deselected before deleting markers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17375
2024-03-11 14:30:08 +01:00
jean-pierre charras c0fd138706 Pcbnew, pdf plotter: fixes and enhancements.
* To select a footprint info, Use the bbox with not text as selectable area
* Fix also incorrect position of footprint bbox when plotting with offset

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17355
2024-03-10 13:09:41 +01:00
jean-pierre charras 2af35ac4f1 Gerbview: update view items after reordering/modifying view layers.
Previously, after updating the gerber layer order, displayed D_codes where
not always those corresponding to the active layer.
2024-03-09 18:15:17 +01:00
Wayne Stambaugh b7a193dc3a Tag stable version 8.0.1 release candidate 2. 2024-03-09 07:26:46 -05:00
jean-pierre charras 79e264249c GERBVIEW_FRAME::RemapLayers(), fix incorrect handling of layers visibility
When modifying the gerber layers visibility, other (non gerber) layers must
be not modified.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17282
2024-03-09 08:59:56 +01:00
Seth Hillbrand 51d335c0e8 Temporary fix to disable zone-zone clearance display
When selecting two objects, we display the measured clearance between
them.  This can be problematic with large zones as they have thousands
of triangles.

This is a temporary fix for 8.0.1 to disable the check until we have a
performant version

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

(cherry picked from commit 686a62cbe6)
2024-03-08 10:32:37 -08:00
Seth Hillbrand 2f010e77ea Update Translations 2024-03-07 23:59:22 +01:00
pominglee 848dbb4d43 Translated using Weblate (Chinese (Traditional))
Currently translated at 93.5% (8568 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-03-07 23:56:16 +01:00
Pedro Moreira 6384e7aea5 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9161 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-03-07 23:56:16 +01:00
김랑기 519e7bbfd4 Translated using Weblate (Korean)
Currently translated at 99.9% (9160 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-03-07 23:56:16 +01:00
Pedro Moreira 1ad15075f8 Translated using Weblate (Korean)
Currently translated at 99.9% (9160 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-03-07 23:56:16 +01:00
pominglee e21b4517d6 Translated using Weblate (Chinese (Traditional))
Currently translated at 93.4% (8561 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-03-07 23:56:15 +01:00
CloverGit 31c756addb Translated using Weblate (Chinese (Simplified))
Currently translated at 99.5% (9123 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-03-07 23:56:15 +01:00
김랑기 4ea53e045b Translated using Weblate (Korean)
Currently translated at 99.9% (9160 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-03-07 23:56:15 +01:00
Tokita, Hiroshi 4ceb03a9ce Translated using Weblate (Japanese)
Currently translated at 99.6% (9125 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-03-07 23:56:15 +01:00
109247019824 d0b840697b Translated using Weblate (Bulgarian)
Currently translated at 7.6% (700 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/bg/
2024-03-07 23:56:15 +01:00
pominglee 57b6e5cb85 Translated using Weblate (Chinese (Traditional))
Currently translated at 93.4% (8559 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-03-07 23:56:15 +01:00
Nguyễn Ngọc Khánh fb3790398d Translated using Weblate (Vietnamese)
Currently translated at 20.9% (1915 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/vi/
2024-03-07 23:56:15 +01:00
YÜKSEL AÇIKGÖZ 2a3e2d8f9f Translated using Weblate (Turkish)
Currently translated at 57.4% (5267 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-03-07 23:56:15 +01:00
Wellington Terumi Uemura 0f260d51c5 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9161 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-03-07 23:56:15 +01:00
Laurens Holst 28afbe37ec Translated using Weblate (Dutch)
Currently translated at 100.0% (9161 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-03-07 23:56:15 +01:00
CloverGit 13aafe828f Translated using Weblate (Chinese (Simplified))
Currently translated at 99.5% (9123 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-03-07 23:56:15 +01:00
ZbeeGin 1769b565f7 Translated using Weblate (Polish)
Currently translated at 100.0% (9161 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-03-07 23:56:15 +01:00
Ranforingus a4ecb998aa Translated using Weblate (Dutch)
Currently translated at 99.5% (9118 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-03-07 23:56:15 +01:00
김랑기 a54af04f4e Translated using Weblate (Korean)
Currently translated at 99.9% (9160 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-03-07 23:56:15 +01:00
aris-kimi 4a260f74fa Translated using Weblate (Greek)
Currently translated at 100.0% (9161 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/el/
2024-03-07 23:56:15 +01:00
Jan Straka 984c777286 Translated using Weblate (Czech)
Currently translated at 79.6% (7301 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-03-07 23:56:15 +01:00
CloverGit 33ced12295 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.5% (9123 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-03-07 23:56:14 +01:00
Andrej Valek be6d07e962 Translated using Weblate (Slovak)
Currently translated at 64.3% (5895 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-03-07 23:56:14 +01:00
pedrolinharesmoreira d0de1723ed Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.5% (9122 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-03-07 23:56:14 +01:00
aris-kimi 39378fec87 Translated using Weblate (Greek)
Currently translated at 99.8% (9145 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/el/
2024-03-07 23:56:14 +01:00
CloverGit e8bf38fb24 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.5% (9120 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-03-07 23:56:14 +01:00
Andrej Valek d27f17cef8 Translated using Weblate (Slovak)
Currently translated at 63.3% (5808 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-03-07 23:56:14 +01:00
ZbeeGin c43892814e Translated using Weblate (Polish)
Currently translated at 99.9% (9152 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-03-07 23:56:14 +01:00
김랑기 41b8e704b7 Translated using Weblate (Korean)
Currently translated at 99.9% (9157 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-03-07 23:56:14 +01:00
Pferd O b55c04ddfa Translated using Weblate (German)
Currently translated at 100.0% (9161 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-03-07 23:56:14 +01:00
김랑기 587c9f8a27 Translated using Weblate (Korean)
Currently translated at 97.6% (8948 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-03-07 23:56:14 +01:00
Henrik Kauhanen a8768b7a20 Translated using Weblate (Swedish)
Currently translated at 99.9% (9159 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-03-07 23:56:14 +01:00
Andrej Valek 10e8dfaca5 Translated using Weblate (Slovak)
Currently translated at 56.9% (5221 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-03-07 23:56:14 +01:00
dsa-t f2d9df65ff Translated using Weblate (Russian)
Currently translated at 100.0% (9161 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-03-07 23:56:14 +01:00
ZbeeGin 749ada552e Translated using Weblate (Polish)
Currently translated at 99.7% (9142 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-03-07 23:56:14 +01:00
김랑기 044e7090be Translated using Weblate (Korean)
Currently translated at 96.9% (8886 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-03-07 23:56:14 +01:00
Toni Laiho 3a2b633e28 Translated using Weblate (Finnish)
Currently translated at 99.4% (9107 of 9161 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-03-07 23:56:14 +01:00
Jeff Young 6ced4f72d0 Further improvements to cache locking.
In particular, don't hold cache lock while doing computations.
2024-03-07 13:02:16 +00:00
Armin Schoisswohl 0f8dac81cb add include <mutex> to fix compilation under linux 2024-03-07 12:13:42 +00:00
Armin Schoisswohl 1f1b97212b change m_CachesMutex to shared_mutex and do shared locking for read access in zone BBox calculations 2024-03-07 12:13:42 +00:00
Armin Schoisswohl aff3064187 fix deadlock in DRC "Checking keeopouts & disallow constraints" 2024-03-07 12:13:42 +00:00
Armin Schoisswohl d1867bd728 protect cache lookups in pcbnew/zone by locking the mutex before calling find, fix #17237 2024-03-07 12:13:42 +00:00
Mike Williams 1b5e18d95f schematic: legacy kicad schematic files don't have a default description field
Without this, we would parse a legacy schematic symbol field at the same
index as the new description field's index into description, instead of into
a user field.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17202
2024-03-06 11:03:00 -05:00
Jeff Young b57184efe0 Apply anti-walk algorithm only to textboxes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16481

(cherry picked from commit 20efeef5ae)
2024-03-06 13:53:09 +00:00
jean-pierre charras 8a66a7eab0 PROPERTIES_FRAME: fixes a focus issue (perhaps Windows specific).
From master branch
2024-03-06 13:09:28 +01:00
jean-pierre charras e769fdfab0 Pcbnew: do not select a PCB_REFERENCE_IMAGE if the LAYER_DRAW_BITMAPS is not visible.
LAYER_DRAW_BITMAPS layer controls transparency and visibility of images on the board.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16283
2024-03-06 13:08:07 +01:00
Jon Evans 31ae825b9d Prevent use-after-free of symbol screens
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17204


(cherry picked from commit 1600d8bead)
2024-03-06 03:54:14 +00:00
Jon Evans 98d26e77c9 Update a few more list/tree views for macOS
(cherry picked from commit 1988aac2b3)
2024-03-05 13:39:39 +00:00
Jon Evans 03120161d3 Fix macOS tree icons
Now that we have backported HiDPI support,
we need to actually use it because the old
imagelist functions are explicitly not going
to work on HiDPI systems anymore

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


(cherry picked from commit 34a6e605de)
2024-03-05 13:03:42 +00:00
Marek Roszko ec7abb7bff Fix update notification to use majorminorpatch
(cherry picked from commit 7933dee274)
2024-03-05 01:13:41 +00:00
Wayne Stambaugh fa2ccdd083 Tag stable version 8.0.1 release candidate 1. 2024-03-03 17:08:06 -05:00
Alex Shvartzkop 4096c073b7 EasyEDA Pro import: make sure to use UTF-8 for project.json and device.json.
Also catch exceptions.

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

(cherry picked from commit 219d0c399d)
2024-03-03 21:51:32 +03:00
Alex Shvartzkop 2ad3ccc4d8 Use 64-bit type to represent microseconds.
int and long are 32-bit on Windows, causing overflows.

(cherry picked from commit 85b1978408)
2024-03-03 21:47:23 +03:00
Alex Shvartzkop 3bab589405 Do not reload window sizes when changing 3D viewer settings.
(cherry picked from commit 337489c77d)
2024-03-03 21:47:23 +03:00
Alex Shvartzkop fab52bd95a Add add_choices accepting std::vector to argparse for convenience.
(cherry picked from commit 1126227206)
2024-03-03 21:47:23 +03:00
Alex Shvartzkop 27e4b2276b Update argparse.
Otherwise .choices doesn't work properly.
See https://github.com/p-ranav/argparse/issues/307

(cherry picked from commit 991b4299d6)
2024-03-03 21:47:23 +03:00
Jan Wichmann 64f8310a94 Don't show hidden directories and files in the project tree browser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16207


(cherry picked from commit 5cdf9fe8a0)

4b9fffa3 Don't show hidden directories and hidden files in the Project tree browser
c433874c Changed file name conversation to utf16
aeba54ba Moved os-specific function to lib KIPLATFORM::IO
561709ac Implemented KIPLATFORM::IO::IsFileHidden for all plattforms
2024-03-03 16:47:38 +00:00
jean-pierre charras e765de6b3d PCB_PAINTER: do not draw PCB_SHAPEs on netname layer in FP editor.
Fixes #17250
https://gitlab.com/kicad/code/kicad/-/issues/17250
2024-03-03 17:02:19 +01:00
Wayne Stambaugh 742529da26 Update net navigator when cross probing from board editor net highlight.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16838

(cherry picked from commit 66925ec2a2)
2024-03-03 08:57:54 -05:00
jean-pierre charras b728eae651 plot_board_layers.cpp: when plotting pads, Save/restore corner radius ratio
instead of corner radius.
The corner radius comes from corner radius ratio, so saving/restoring the corner
radius can create rounding errors when trying to recalculate the ratio from the radius.
2024-03-03 11:58:11 +01:00
jean-pierre charras 676e70ec18 French translation update 2024-03-03 08:32:51 +01:00
Jon Evans 13fabb0564 Correctly handle footprint graphic knockouts for no-net case
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17223


(cherry picked from commit ed18a9bcc2)
2024-03-02 20:39:56 +00:00
Jon Evans 4dc4b2bd51 Set schematic as default screenshot
(cherry picked from commit b8f4bef3f8)
2024-03-02 20:07:26 +00:00
Jon Evans 32e6f424ec Remove project manager from screenshots
It's not very important or visually appealing,
let's just use the editors as the way to represent
KiCad in software centers that show screenshots.


(cherry picked from commit fdc16fe60d)
2024-03-02 20:07:15 +00:00
Marek Roszko 3890278505 Make the update check cmake option default for all platforms
(cherry picked from commit 46f9a9a005)
2024-03-02 19:18:07 +00:00
Jeff Young 1664e02fa6 Don't draw the selection if it's not from the current screen.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17132
2024-03-02 18:56:57 +00:00
Roberto Fernandez Bautista 63ffca0173 Step exporter: handle circles correctly
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17137
2024-03-02 19:11:14 +01:00
Roberto Fernandez Bautista ff4b59afeb kicad_cli fp ugrade: create directory with extension 2024-03-02 18:22:18 +01:00
Roberto Fernandez Bautista 64382a85fa SHAPE_LINE_CHAIN: Fix indices rotation after clipper
Also fix IsArcStart and IsArcEnd functions to work with chains that only
have arcs.
2024-03-02 18:22:18 +01:00
Roberto Fernandez Bautista 4c51391cf6 SHAPE_LINE_CHAIN: Move .h definitions to .cpp
No functional changes, just allow faster rebuilds
2024-03-02 18:22:18 +01:00
Roberto Fernandez Bautista 5add7a0ca0 SHAPE_LINE_CHAIN: Fix/unify constructors 2024-03-02 18:22:18 +01:00
Roberto Fernandez Bautista 8340779f5b SHAPE_LINE_CHAIN: Add test case of seg+large angle arc 2024-03-02 18:22:18 +01:00
Roberto Fernandez Bautista 01cc91850c Sanitise filename before saving footprint library 2024-03-02 18:22:18 +01:00
Roberto Fernandez Bautista 091f9c82e1 kicad_cli: Allow upgrade of legacy and non-kicad footprint libraries 2024-03-02 18:22:18 +01:00
Roberto Fernandez Bautista f7ddd211d9 kicad_cli: Allow upgrade of legacy and non-kicad symbol libraries 2024-03-02 18:22:18 +01:00
Jeff Young 8dce6c0b67 Don't steal command-keys from a wxGrid.
It's unlikely to win you friends.

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

(cherry picked from commit 1082930c34)
2024-03-02 15:29:00 +00:00
jean-pierre charras 655cee523b Eeschema: fix crash when editing a old legacy schematic with missing libs,
and trying to edit a dummy symbol. (crash due to a null pointer due to missing lib)
From master branch
Fixes #17232
https://gitlab.com/kicad/code/kicad/-/issues/17232
2024-03-02 15:32:37 +01:00
Jeff Young fa4d759fcb First alt-pin menu item must be fetched from the LIB_PIN.
(The SCH_PIN will return any alt function already assigned.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17221
2024-03-02 12:16:33 +00:00
jean-pierre charras 25b033df2a FOOTPRINT_CHOOSER_FRAME: rework on bottom panel to allow a long string in
the check box for filter by FP names to be displayed without overlapping other
widgets.
2024-03-02 12:51:16 +01:00
Jeff Young a0905ac87d Check for NETINFO_ITEM before dereferencing it.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17230

(cherry picked from commit bd1d449cd3)
2024-03-02 11:37:58 +00:00
Yon Uriarte 3d67ab72c6 Performance
Cache VIEW_ITEM's bbox in VIEW_TREE for faster removals.

Fixes https://gitlab.com/kicad/code/kicad/issues/16841

(cherry picked from commit 464f185387)
2024-03-02 00:06:24 +00:00
Seth Hillbrand ecb0c9b5d4 Limit where the intersection of two lines can be
This avoids generating lines where we are unable to select them because
they get too close to the border

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

(cherry picked from commit 0129191ec0)
2024-03-01 15:57:45 -08:00
Jeff Young 53d8e2c8c3 Separate "use board stackup colors" into separate checkbox.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17085

(cherry picked from commit 8dddd9cc2c)
2024-03-01 23:45:37 +00:00
Seth Hillbrand 22f66fdf2f Don't wait for unused events
We only need the UI update and mouse/keyboard while updating our DRC
window.  Waiting for other events gets into a race condition with the
schematic editor that can cause a hang

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

(cherry picked from commit 14667e2033)
2024-03-01 15:22:48 -08:00
Seth Hillbrand a7c09964ba Update contributors
(cherry picked from commit e7d4127f99)
2024-03-01 13:46:14 -08:00
Seth Hillbrand 1e03266dfe Do not re-number aperture pads
Aperture pads do not have numbers, so reserving space for them will
cause the actual numbered pads to become out of order

(cherry picked from commit d3334ed9f0)
2024-03-01 13:04:47 -08:00
jean-pierre charras 09f32d8c86 FOOTPRINT_CHOOSER_FRAME: Fix a UI problem specific to Linux
On the bottom on the frame, some widgets were not correctly placed.
Fixes #17217
https://gitlab.com/kicad/code/kicad/-/issues/17217
2024-03-01 20:08:49 +01:00
Alex Shvartzkop 67208df602 Improve 3D appearance manager preset compare.
(cherry picked from commit 656821b282)
2024-02-29 19:13:12 +00:00
Jeff Young 8047eed6f8 The ruler tool is not part of InteractiveEdit.
(In particular, it should not return true to IsEditorTool().)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17164
2024-02-29 17:56:25 +00:00
Jeff Young dafd62ddba Unflip when going to viewport which isn't flipped.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13773

(cherry picked from commit c23550dc0b)
2024-02-29 17:38:32 +00:00
Jeff Young 41f9baf9dc Cleanup. 2024-02-29 17:38:18 +00:00
Jeff Young 1cd5827078 _() -> _HKI() for group names.
(cherry picked from commit d08e0e9eaa)
2024-02-29 17:38:18 +00:00
Jeff Young b07d43a24a Expose text size for SCH_FIELDs.
(cherry picked from commit 2dce618f9f)
2024-02-29 17:38:18 +00:00
jean-pierre charras 985c3ad92a GERBER_PLOTTER, round-rect aperture: ensure primitives have non null size.
for round-rect pads with a radius = 50% of the smaller dim, one of primitives
used to create the shape can have a 0 size.
Ensure a min size >= 10 nm (It should not create a actual change)
2024-02-29 18:07:02 +01:00
Alex Shvartzkop 978fa63490 Allow .kicad_sym in Import Symbol filters.
(cherry picked from commit cd27f801f6)
2024-02-29 14:36:57 +00:00
Alex Shvartzkop c59fac4089 Use a version string without the extra packaging info in drawing sheets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17176
2024-02-29 04:24:16 +03:00
Alex Shvartzkop 0dab086f0c EasyEDA Std import: support multiline text on PCB.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17171
2024-02-29 03:54:01 +03:00
Seth Hillbrand 7d1adff071 Store group id rather than group
We only need the group storage id for lookup.  Storing the KIID instead
of a copy of the group avoids unneeded overhead

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17175
2024-02-28 13:27:08 -08:00
Seth Hillbrand 38df918993 Correct usage signature for PNS_NODE::Add()
When moving a unique_ptr, you are actually passing the object, not a
reference to the object.  So we either std::move with the bare
unique_ptr parameter or we pass a reference.  But we should never pass
an rvalue reference for this or we'll make a copy without holding the
tracking (because it was moved)

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

(cherry picked from commit b2a25cb59e)
2024-02-28 10:11:20 -08:00
Seth Hillbrand f45df48498 Fix memory leak in net inspector dialog
(cherry picked from commit a8880fb63e)
2024-02-28 10:11:13 -08:00
Seth Hillbrand 898b5bd992 Update translations 2024-02-28 09:53:46 -08:00
Andrej Valek 100023e36f Translated using Weblate (Slovak)
Currently translated at 55.3% (5078 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-02-28 18:50:56 +01:00
Andrej Valek d8ca6eda7e Translated using Weblate (Slovak)
Currently translated at 55.1% (5060 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-02-28 18:50:56 +01:00
Andrej Valek 4d02817415 Translated using Weblate (Czech)
Currently translated at 79.8% (7326 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-02-28 18:50:56 +01:00
CloverGit ef281317ee Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (9143 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-02-28 18:50:56 +01:00
Ivan Chuba 16ea51fe5c Translated using Weblate (Ukrainian)
Currently translated at 88.1% (8088 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/uk/
2024-02-28 18:50:56 +01:00
Mahsum Aslan b70ff8a120 Translated using Weblate (Turkish)
Currently translated at 51.2% (4705 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-02-28 18:50:56 +01:00
Andrej Valek b3572c4ba2 Translated using Weblate (Slovak)
Currently translated at 53.6% (4921 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-02-28 18:50:56 +01:00
김랑기 b8859df610 Translated using Weblate (Korean)
Currently translated at 96.3% (8838 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-02-28 18:50:56 +01:00
CloverGit a26ed45b55 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (9142 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-02-28 18:50:56 +01:00
Jan Straka cd3c2899d8 Translated using Weblate (Czech)
Currently translated at 79.8% (7325 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-02-28 18:50:56 +01:00
Laurens Holst 74f1fadcf2 Translated using Weblate (Dutch)
Currently translated at 100.0% (9176 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-02-28 18:50:56 +01:00
Ulices 6de3859d2c Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9176 of 9176 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-02-28 18:50:55 +01:00
Jeff Young 04440d8506 Check env vars when testing for unresolved variables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17174
2024-02-28 17:16:20 +00:00
Wayne Stambaugh 9508b79cc3 Fix sheet pin align to grid issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16920

(cherry picked from commit 141d03c266)
2024-02-28 12:00:01 -05:00
Alex Shvartzkop bec068324e Keep schematic text upright (especially when opening v6 schematic).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17082
2024-02-28 18:25:08 +03:00
jean-pierre charras b4e993e6e8 French translation update 2024-02-28 15:03:17 +01:00
jean-pierre charras 57b9b1b6b6 Add option to Footprint Chooser to switch between the selected fp or its 3D view
Fixes #16173
https://gitlab.com/kicad/code/kicad/-/issues/16173
2024-02-28 14:42:17 +01:00
jean-pierre charras fce4ec6a9b Eeschema, DIALOG_CHANGE_SYMBOLS: fix incorrect initial lib link name when
changing symbols: the "old" displayed link was in fact the new link because
the link was updated before the report is created.
Fixes #17162
https://gitlab.com/kicad/code/kicad/-/issues/17162
2024-02-28 11:23:35 +01:00
Alex Shvartzkop c4a7af8a47 Cairo GAL: fix endianness check. 2024-02-28 04:11:02 +03:00
Alex Shvartzkop d359fb8ab9 Cairo GAL: reduce buffer allocation sizes.
cairo_format_stride_for_width() result is in bytes.
Also removes unneeded extra width.
2024-02-28 03:50:17 +03:00
Alex Shvartzkop 5618a6925d Cairo GAL: improve empty canvas performance (-80% CPU) 2024-02-28 03:50:17 +03:00
Jon Evans e383c67e7f Avoid nullptr dereference when loading group info
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17154


(cherry picked from commit 9e7b4b7f89)
2024-02-28 00:43:49 +00:00
Jon Evans 12dcdc8bbe Trivial change to avoid crash on tool re-entry
See https://gitlab.com/kicad/code/kicad/-/issues/17164


(cherry picked from commit 299b548a41)
2024-02-28 00:31:37 +00:00
Jon Evans bbd4cfd3d4 Force lib tree row height on GTK
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16403


(cherry picked from commit c3af434741)
2024-02-28 00:25:28 +00:00
Jon Evans a9e6031ae6 Remove unnecessary assert
GetModifyHash can be called before a row is loaded


(cherry picked from commit 31fab831ad)
2024-02-28 00:03:37 +00:00
Jon Evans 0b5c0ef639 Expose grid origin action in more places
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17007


(cherry picked from commit 0df5cf7f75)
2024-02-27 23:52:17 +00:00
Jeff Young 60dbd0ce0d Add wxGrids to list of things that get arrow keys.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17144

(cherry picked from commit f754410c7e)
2024-02-27 18:12:40 +00:00
Jeff Young 1fc79b9a46 Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16991

(cherry picked from commit a5fda819eb)
2024-02-27 17:16:53 +00:00
Jeff Young aba24ec781 Eagle text anchor points and alignment aren't linked.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17135
2024-02-27 14:59:18 +00:00
Jeff Young 952c154422 Fix wrong rotation centre.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17135
2024-02-27 12:46:22 +00:00
Jon Evans ffa1d19216 Don't rely on dynamic_cast across DLLs
See https://gitlab.com/kicad/code/kicad/-/issues/16998


(cherry picked from commit e9456201a7)
2024-02-27 03:11:17 +00:00
Jeff Young 5b303b268f Cancel autocomplete when STC loses focus.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17124

(cherry picked from commit 539bd62a7b)
2024-02-26 22:31:29 +00:00
Jeff Young 50c5b56781 Improve SNR.
(cherry picked from commit d23ee7db3d)
2024-02-26 22:31:29 +00:00
Alex Shvartzkop 35192f5bd4 Initialize git_remote_callbacks structure. 2024-02-27 00:35:52 +03:00
Alex Shvartzkop d84a5e6f03 Initialize git_repository_init_options structure. 2024-02-27 00:25:04 +03:00
Jeff Young d94b0771ca Only change pin assignments from user interaction.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16349
2024-02-26 19:01:07 +00:00
Jeff Young 2f8f7c11f1 Handle single-source DC analyses correctly.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17119
2024-02-26 18:10:10 +00:00
Jeff Young 81c22542e4 Fix copy pasta.
(cherry picked from commit 43c45f3ee8)
2024-02-26 12:39:35 +00:00
jean-pierre charras c1755835eb Symbol editor: add option (view menu+toolbar) to show/hide invisible pins and fields
From master branch
Fixes #8020
https://gitlab.com/kicad/code/kicad/-/issues/8020
2024-02-25 17:40:40 +01:00
Jeff Young 11593a7c04 Revert IsAttached() fix as it doesn't handle hotkeys from the main menubar.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17101

(cherry picked from commit 6ec51f6a69)
2024-02-25 15:48:19 +00:00
Jon Evans 46555ab975 Fix use-after-free in Altium importer
If the library already contains a symbol with the same name,
SaveSymbol will replace the existing symbol,
which will invalidate a cached pointer.


(cherry picked from commit d939004bbd)
2024-02-25 13:47:30 +00:00
Jeff Young 74339e9a9f Support pin count and footprint filters in symbol editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17105
2024-02-25 13:13:54 +00:00
Jeff Young 2b09653abb Don't import invalid polygons.
If we *do* get a 2-point polygon in SVG, import it as a segment.

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

(cherry picked from commit dba2fdb6d3)
2024-02-25 12:29:02 +00:00
Alex Shvartzkop 1c639714f3 Fix update notice dialog padding. 2024-02-25 13:41:39 +03:00
Jeff Young 45910bc7c1 Don't double-add pads to commit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17087
2024-02-24 23:25:23 +00:00
Jeff Young 87944e06ac Fix missing unit initialization.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17076
2024-02-24 22:35:05 +00:00
Jeff Young b37c7afa8a Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17086
2024-02-24 20:05:11 +00:00
Stefan 5713384f35 adding No Layers to apprearance manger presets, fix #15625
(cherry picked from commit ed6f900b70)

b650e80a adding No Layers to apprearance manger presets, fix #15625
6f8de6e3 fix codestyle
2024-02-24 15:44:53 +00:00
Jon Evans 99f9941067 Use deb_system Python sysconfig scheme on Debian 2024-02-24 10:38:55 -05:00
Alex Shvartzkop 339646a267 Remove 50ms delay seen in some actions, like duplicating schematic items. 2024-02-24 18:19:10 +03:00
Alex Shvartzkop 97ff48b426 Add bottom panel to have correct background in fp/sym chooser frames.
See https://gitlab.com/kicad/code/kicad/-/issues/15810
2024-02-24 15:17:28 +00:00
Alex Shvartzkop badc4e7411 Hide unused message panel in footprint/symbol chooser frames.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15810
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15889
2024-02-24 15:17:28 +00:00
Alex Shvartzkop 764de7257f Disable search ctrl cursor management on non-OSX.
Buggy at least on GTK and MSW.
2024-02-24 15:17:28 +00:00
Andrej Krpic 14d71c8ca6 Fix collecting of signals for S-Parameters analysis
(cherry picked from commit 006f93773c)
2024-02-23 20:35:36 +00:00
Yon Uriarte 7d5583f687 Performance UpdateDanglingState
Avoid O(N^2) by spatial sorting, don't run checks if the bounding boxes
don't overlap.
A second copy is ordered by type to help classes that only want to check
a few types having to walk the whole list.

(cherry picked from commit b7b64d959f)
2024-02-23 14:36:50 -05:00
Yon Uriarte ffd470d94d Performance SCH_EDIT_FRAME::SchematicCleanUp
Avoid O(N^2) comparisonis by spatial presorting. If bounding boxes don't
overlap there's no need to run expensive checks.

(cherry picked from commit f3c2083018)
2024-02-23 14:36:36 -05:00
Alex Shvartzkop 0184dfb625 Do not call MakeShapes in AddCopperPolygonShapes when polyset is empty.
Ease of debugging.
2024-02-23 22:14:03 +03:00
Alex Shvartzkop 711c6141a8 Highlight nets and show length tuning status when adding tuning patterns.
Also fixes length preview when hovering over joints.
Also prevents asserts when hovering over arcs.
Also prevents adding a tuning pattern on other tuning pattern.
2024-02-23 17:22:20 +00:00
Alex Shvartzkop fdf38256e8 Fix floating point rounding issues with scaled parameteres in settings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17070
2024-02-23 17:22:20 +00:00
Alex Shvartzkop 7eeb1a19cf Fix net selector filter field focus on GTK. 2024-02-23 17:22:20 +00:00
Alex Shvartzkop e68df8e1d1 Performance optimizations for database libraries. 2024-02-23 17:22:20 +00:00
Alex Shvartzkop 3e26e7b646 Normalize SCH_PIN BBox to fix assert. 2024-02-23 17:22:20 +00:00
Alex Shvartzkop a13e4e7d9f Eeschema: select graphical shapes based on effective shapes. 2024-02-23 17:22:20 +00:00
Alex Shvartzkop 6feafedfbe Use correct text color in LIB_TREE selected items on non-OSX. 2024-02-23 17:22:20 +00:00
Alex Shvartzkop ed115075ce Add size range check to BOX2::Inflate. 2024-02-23 17:22:20 +00:00
jean-pierre charras be51c2ba73 teardrops: calculate better points on track for track arc.
Previously, a reference point to calculate teardrop length was calculated
using a track segment. It can create significant position error with track arcs.
Now a arc is used to find this reference point.
From master branch
2024-02-23 17:52:08 +01:00
Jeff Young 78b38cc75f Fix merge conflict. 2024-02-23 16:21:28 +00:00
Jeff Young c8495d81bb Update VDMOS models to ngspice-41 (and later) defaults.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17073
2024-02-23 16:06:55 +00:00
Jeff Young 6aaf2411f6 Apply Pad Properties teardrop terminology to Via Properties.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17050
2024-02-23 15:52:47 +00:00
Roberto Fernandez Bautista 3f47e03317 Thread safety: replace ++m_modHash by IncrementModifyHash()
(cherry picked from commit d464d7995b)
2024-02-23 16:49:35 +01:00
Roberto Fernandez Bautista 9004f92689 Add cache to SCH_IO_DATABASE to improve loading performance
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17031

(cherry picked from commit 991ddfe6be)
2024-02-23 16:49:35 +01:00
Roberto Fernandez Bautista a928299ae0 Legacy libraries: De-duplicate field names on load
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16902

(cherry picked from commit 07ab18a1e6)
2024-02-23 16:49:35 +01:00
Roberto Fernandez Bautista 1a7237f38b Altium: Don't create duplicate fields
(cherry picked from commit 420413969e)
2024-02-23 16:49:35 +01:00
Roberto Fernandez Bautista b3b6637b44 Altium: Don't load library parameters with an owner for now
In Altium many objects can have parameters (including pins). For now
we will drop library parameters belonging to any sub-components of a
symbol.

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

(cherry picked from commit 1a6e6a06eb)
2024-02-23 16:49:35 +01:00
Jon Evans ad311c33c6 Attempt to fix lib search again
The new bits will drop search results that
don't match all tokens in the search string,
which seems desirable.

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


(cherry picked from commit 589e21cd3b)
2024-02-23 14:37:20 +00:00
Jeff Young adae4de438 Don't use EQUALITY flag when doing a symbol diff with library.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16944
2024-02-22 23:37:50 +00:00
Jeff Young c8b06d54cb Update Edit Teardrops dialog to match other teardrop terminology.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17050
2024-02-22 23:37:48 +00:00
Jeff Young 51848a0b43 Code cleanup and compiler warnings. 2024-02-22 23:37:45 +00:00
Jeff Young 2d7f4faf72 Set up default netclass wire & bus widths.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17024
2024-02-22 23:37:42 +00:00
Jeff Young c75bb5d01a Formatting. 2024-02-22 23:37:39 +00:00
Jeff Young df8f043c16 Improve layout of schematic colors preview.
Also, set pin name/number sizes.  Don't use defaults (which
will get plucked out of the Symbol Editor's settings).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17043
2024-02-22 23:37:30 +00:00
Jeff Young 01d668c09d Rule areas should be allowed on user layers.
Non-board tech layers too.  We don't know how people will
write their custom DRC rules.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17034
2024-02-22 23:37:26 +00:00
Jeff Young f4a3613561 Make sure nets get reassigned when name is changed.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17025
2024-02-22 23:37:23 +00:00
Jeff Young 12922d9434 Report fp library loading errors with libName & fpName.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16975
2024-02-22 23:37:20 +00:00
Jeff Young b6036f368e When updating RefDes only update the prefix.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16991
2024-02-22 23:37:18 +00:00
Jeff Young 25291d6e3a Check known m_Desc field before m_Fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16971
2024-02-22 23:37:15 +00:00
Jeff Young f4a085575a Show friendly name in toolbar button tooltips.
(Don't require the same text to be put into the tooltip.
It's error-prone and also disallows us from having a separate
tooltip for toolbar buttons.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17009
2024-02-22 23:37:13 +00:00
Jeff Young a34b242f4e Delete empty Netclass fields only if there are others.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16997
2024-02-22 23:37:08 +00:00
Jeff Young 8a3cbce8f8 Comments. 2024-02-22 23:37:05 +00:00
Jeff Young a9c4a17c38 Repair copy/paste of footprint fields.
Some of the code got lost in the move to PCB_FIELDs.
2024-02-22 23:37:02 +00:00
Jeff Young 1a7152d3eb Warp after context menu only if actively drawing.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11080
2024-02-22 23:36:59 +00:00
Jeff Young 08da9a4494 Don't modify reference point if already moving.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16524
2024-02-22 23:36:56 +00:00
Jeff Young baaed8ed84 Formatting. 2024-02-22 23:36:54 +00:00
Jeff Young 7446fba70a Keep Mac debugger from crashing with breakpoints in .h files. 2024-02-22 23:36:50 +00:00
Jeff Young d36f189192 Add help text for DRC assertion clauses. 2024-02-22 23:36:47 +00:00
Jeff Young 152c458b9c Help documentation for "assertion" constraints. 2024-02-22 23:36:44 +00:00
Jeff Young 7ae14f9630 Update syntax help for memberOfFootprint. 2024-02-22 23:36:41 +00:00
Jeff Young a610542a19 Various string issues held over from 8.0 string freeze. 2024-02-22 23:36:37 +00:00
Jeff Young 2ab492474e Improve alignment tooltips. 2024-02-22 23:36:34 +00:00
Jeff Young 3caede3799 Ignore duplicate/repeat when drawing an existing item.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16885
2024-02-22 23:36:30 +00:00
Jeff Young 9d40374baf Don't capture references to local variables for CallAfter.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16934
2024-02-22 23:36:27 +00:00
Jeff Young 0ead8a14a1 Handle holes in shapes when creating bounding hulls.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16347
2024-02-22 23:36:24 +00:00
Jeff Young e8b16fc64f Kick PROPERTIES_PANEL a bit harder on language change.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16589
2024-02-22 23:36:20 +00:00
Jeff Young 162e8962f7 Add a cache for TrueType contours and triangulation data.
Also returns minimumSegmentLength to its former value as
it doesn't appear to be required to fix
https://gitlab.com/kicad/code/kicad/-/issues/11463.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16568
2024-02-22 23:36:16 +00:00
Wayne Stambaugh fc66cb6805 Begin 8.0.1 development. 2024-02-22 18:13:58 -05:00
1894 changed files with 444423 additions and 563100 deletions
+2 -6
View File
@@ -17,6 +17,8 @@ include/fp_lib_table_lexer.h
include/lib_table_lexer.h
include/netlist_lexer.h
include/page_layout_reader_lexer.h
eeschema/cmp_library_lexer.h
eeschema/cmp_library_keywords.*
eeschema/dialogs/dialog_bom_cfg_keywords.cpp
eeschema/dialogs/dialog_bom_cfg_lexer.h
common/template_fieldnames_keywords.cpp
@@ -101,9 +103,7 @@ __pycache__
.editorconfig
CMakeSettings.json
.vscode/
compile_commands.json
/vcpkg_installed
CMakePresets.json
# Sublime Text
*.sublime-*
@@ -112,10 +112,6 @@ CMakePresets.json
.kdev4/
*.kdev4
# Qt Creator
CMakeLists.txt.user
*.autosave
# Translations
*.mo
i18n_status.svg
+1 -5
View File
@@ -28,7 +28,6 @@
-DKICAD_BUILD_I18N=ON
-DKICAD_TEST_XML_OUTPUT=ON
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON
-DKICAD_USE_CMAKE_FINDPROTOBUF=ON
../../
- ninja 2>&1 | tee compilation_log.txt
- cd ../../
@@ -40,7 +39,6 @@
when: always
paths:
- build/linux/3d-viewer/
- build/linux/api/libkiapi.so*
- build/linux/common/libkicommon.so*
- build/linux/common/gal/libkigal.so*
- build/linux/eeschema/_eeschema.kiface
@@ -65,8 +63,6 @@ fedora_build_linux_kicad:
fedora_build_linux_public:
extends: .fedora_build_linux_base
tags:
- saas-linux-medium-amd64
except:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
@@ -154,7 +150,7 @@ fedora_report_metrics_public:
parallel:
matrix:
# The name of the test without the qa_ prefix
- TEST: [python, cli, common, gerbview, pcbnew, pns_regressions, eeschema, kimath, sexpr, kicad2step, spice, api]
- TEST: [python, cli, common, gerbview, pcbnew, pns_regressions, eeschema, kimath, sexpr, kicad2step, spice]
fedora_qa_kicad:
extends: .fedora_qa
+1 -1
View File
@@ -18,7 +18,7 @@
stage: test
when: on_success
variables:
BOOST_TEST_LOGGER: 'JUNIT,warning,test_results.${TEST}.xml:HRF,message'
BOOST_TEST_LOGGER: 'JUNIT,warning,test_results.${TEST}.xml:HRF,warning'
CTEST_OUTPUT_ON_FAILURE: 1
script:
- cd build/linux/qa
+7 -1
View File
@@ -381,7 +381,13 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
fclose( fp );
unsigned int digest[5];
dblock.get_digest( digest );
// V8 only
// Boost 1.86 and later changed digest_type from uchar[20] from int[5]
// But KiCad 8.99 and later use MurmurHash3 here, so just do a fairly ugly cast to keep
// this going for another few months.
static_assert( sizeof( digest ) == sizeof( boost::uuids::detail::sha1::digest_type& ),
"SHA1 digest size mismatch" );
dblock.get_digest( reinterpret_cast<boost::uuids::detail::sha1::digest_type&>( digest ) );
// ensure MSB order
for( int i = 0; i < 5; ++i )
+9 -43
View File
@@ -155,47 +155,13 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
checkPluginPath( std::string( fn.GetPathWithSep().ToUTF8() ), searchpaths );
#else
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
// Exe will be at <build_dir>/pcbnew/pcbnew.app/Contents/MacOS/pcbnew for standalone
// Plugin will be at <build_dir>/kicad/KiCad.app/Contents/PlugIns/3d
fn.Assign( wxStandardPaths::Get().GetExecutablePath() );
// Search path on OS X is
// (1) Machine /Library/Application Support/kicad/PlugIns/3d
checkPluginPath( PATHS::GetOSXKicadMachineDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
if( fn.GetName() == wxT( "kicad" ) )
{
fn.AppendDir( wxT( ".." ) ); // Contents
}
else
{
fn.AppendDir( wxT( ".." ) ); // Contents
fn.AppendDir( wxT( ".." ) ); // pcbnew.app
fn.AppendDir( wxT( ".." ) ); // pcbnew
fn.AppendDir( wxT( ".." ) ); // Build root
fn.AppendDir( wxT( "kicad" ) );
fn.AppendDir( wxT( "KiCad.app" ) );
fn.AppendDir( wxT( "Contents" ) );
}
fn.AppendDir( wxT( "PlugIns" ) );
fn.AppendDir( wxT( "3d" ) );
fn.MakeAbsolute();
std::string testpath = std::string( fn.GetPathWithSep().ToUTF8() );
checkPluginPath( testpath, searchpaths );
// Also check when running KiCad manager from build dir
}
else
{
// Search path on OS X is
// (1) Machine /Library/Application Support/kicad/PlugIns/3d
checkPluginPath( PATHS::GetOSXKicadMachineDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
// (2) Bundle kicad.app/Contents/PlugIns/3d
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
checkPluginPath( fn.GetPathWithSep(), searchpaths );
}
// (2) Bundle kicad.app/Contents/PlugIns/3d
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
checkPluginPath( fn.GetPathWithSep(), searchpaths );
#endif
std::list< wxString >::iterator sPL = searchpaths.begin();
@@ -236,7 +202,7 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
char const* cp = pp->GetFileFilter( i );
if( cp )
addFilterString( cp );
addFilterString( wxString::FromUTF8Unchecked( cp ) );
}
addExtensionMap( pp );
@@ -328,7 +294,7 @@ void S3D_PLUGIN_MANAGER::checkPluginName( const wxString& aPath,
++bl;
}
// prevent loading non-plugin dlls
// prevent loading non-plugin dlls
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
if( !path.GetName().StartsWith( "s3d_plugin" )
@@ -416,7 +382,7 @@ void S3D_PLUGIN_MANAGER::addExtensionMap( KICAD_PLUGIN_LDR_3D* aPlugin )
wxString ws;
if( cp )
ws = wxString( cp );
ws = wxString::FromUTF8Unchecked( cp );
if( !ws.empty() )
{
+1 -1
View File
@@ -476,7 +476,7 @@ SGVECTOR S3D::CalcTriNorm( const SGPOINT& p1, const SGPOINT& p2, const SGPOINT&
// normal
tri = glm::cross( pts[1] - pts[0], pts[2] - pts[0] );
(void)glm::normalize( tri );
glm::normalize( tri );
return SGVECTOR( tri.x, tri.y, tri.z );
}
+1 -5
View File
@@ -344,7 +344,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
BOX2I bbbox;
if( m_board )
bbbox = m_board->ComputeBoundingBox( !m_board->IsFootprintHolder() && haveOutline, false );
bbbox = m_board->ComputeBoundingBox( !m_board->IsFootprintHolder() && haveOutline );
// Gives a non null size to avoid issues in zoom / scale calculations
if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
@@ -698,10 +698,6 @@ std::map<int, COLOR4D> BOARD_ADAPTER::GetLayerColors() const
}
colors[ LAYER_3D_COPPER_BOTTOM ] = colors[ LAYER_3D_COPPER_TOP ];
for( const auto& [layer, val] : m_ColorOverrides )
colors[layer] = val;
return colors;
}
+2 -9
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2023 CERN
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -32,7 +32,7 @@
#include "../3d_rendering/raytracing/accelerators/container_3d.h"
#include "../3d_rendering/raytracing/shapes3D/bbox_3d.h"
#include <gal/3d/camera.h>
#include <3d_enums.h>
#include "../3d_enums.h"
#include "../3d_cache/3d_cache.h"
#include "../common_ogl/ogl_attr_list.h"
#include "../3d_viewer/eda_3d_viewer_settings.h"
@@ -42,8 +42,6 @@
#include <pcb_track.h>
#include <pcb_base_frame.h>
#include <pcb_text.h>
#include <pcb_textbox.h>
#include <pcb_table.h>
#include <pcb_shape.h>
#include <pcb_dimension.h>
#include <zone.h>
@@ -379,9 +377,6 @@ private:
void addShape( const PCB_TEXTBOX* aTextBox, CONTAINER_2D_BASE* aContainer,
const BOARD_ITEM* aOwner );
void addTable( const PCB_TABLE* aTable, CONTAINER_2D_BASE* aContainer,
const BOARD_ITEM* aOwner );
void addSolidAreasShapes( const ZONE* aZone, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayerId );
@@ -430,8 +425,6 @@ public:
SFVEC4F m_ECO1Color;
SFVEC4F m_ECO2Color;
std::map<int, COLOR4D> m_ColorOverrides; ///< allows to override color scheme colors
private:
BOARD* m_board;
S3D_CACHE* m_3dModelManager;
@@ -34,12 +34,10 @@
#include "../3d_rendering/raytracing/shapes2D/round_segment_2d.h"
#include "../3d_rendering/raytracing/shapes2D/triangle_2d.h"
#include <board_adapter.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_text.h>
#include <pcb_textbox.h>
#include <pcb_table.h>
#include <board_design_settings.h>
#include <pcb_painter.h> // for PCB_RENDER_SETTINGS
#include <zone.h>
@@ -227,17 +225,12 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
PCB_TEXTBOX* textbox = static_cast<PCB_TEXTBOX*>( item );
if( textbox->GetLayer() == aLayerId )
addShape( textbox, aContainer, aFootprint );
{
if( textbox->IsBorderEnabled() )
addShape( textbox, aContainer, aFootprint );
break;
}
case PCB_TABLE_T:
{
PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
if( table->GetLayer() == aLayerId )
addTable( table, aContainer, aFootprint );
addText( textbox, aContainer, aFootprint );
}
break;
}
@@ -381,6 +374,13 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
// Remove group membership from dummy item before deleting
dummy.SetParentGroup( nullptr );
}
else if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
{
// A custom pad can have many complex subshape items. To avoid issues, use its
// final polygon shape, not its basic shape set. One cannot apply the clearance
// to each subshape: it does no work
aPad->TransformShapeToPolygon( poly, aLayer, 0, maxError );
}
else
{
auto padShapes = std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
@@ -429,7 +429,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
break;
case SH_POLY_SET:
poly = *(SHAPE_POLY_SET*) shape;
poly.Append( *static_cast<const SHAPE_POLY_SET*>( shape ) );
break;
case SH_ARC:
@@ -733,9 +733,7 @@ void BOARD_ADAPTER::addShape( const PCB_TEXTBOX* aTextBox, CONTAINER_2D_BASE* aC
// So for polygon, we use PCB_SHAPE::TransformShapeToPolygon
if( aTextBox->GetShape() == SHAPE_T::RECTANGLE )
{
addShape( static_cast<const PCB_SHAPE*>( aTextBox ), aContainer, aOwner );
}
else
{
SHAPE_POLY_SET polyList;
@@ -748,17 +746,6 @@ void BOARD_ADAPTER::addShape( const PCB_TEXTBOX* aTextBox, CONTAINER_2D_BASE* aC
}
void BOARD_ADAPTER::addTable( const PCB_TABLE* aTable, CONTAINER_2D_BASE* aContainer,
const BOARD_ITEM* aOwner )
{
// JEY TODO: tables
// add borders
for( PCB_TABLECELL* cell : aTable->GetCells() )
addText( cell, aContainer, aOwner );
}
void BOARD_ADAPTER::addSolidAreasShapes( const ZONE* aZone, CONTAINER_2D_BASE* aContainer,
PCB_LAYER_ID aLayerId )
{
+9 -25
View File
@@ -36,12 +36,10 @@
#include "../3d_rendering/raytracing/shapes2D/filled_circle_2d.h"
#include "raytracing/shapes2D/triangle_2d.h"
#include <board_design_settings.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_text.h>
#include <pcb_textbox.h>
#include <pcb_table.h>
#include <pcb_shape.h>
#include <zone.h>
#include <convert_basic_shapes_to_polygon.h>
@@ -187,8 +185,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
for( PCB_TRACK* track : m_board->Tracks() )
{
if( !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) ) // Skip non enabled layers
// Skip tracks (not vias that are on more than one layer ) on disabled layers
if( track->Type() != PCB_VIA_T
&& !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
{
continue;
}
// Note: a PCB_TRACK holds normal segment tracks and also vias circles (that have also
// drill values)
@@ -624,10 +626,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
addShape( static_cast<PCB_TEXTBOX*>( item ), layerContainer, item );
break;
case PCB_TABLE_T:
addTable( static_cast<PCB_TABLE*>( item ), layerContainer, item );
break;
case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T:
case PCB_DIM_RADIAL_T:
@@ -692,10 +690,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
break;
}
case PCB_TABLE_T:
// JEY TODO: tables
break;
default:
wxLogTrace( m_logTrace, wxT( "createLayers: item type: %d not implemented" ),
item->Type() );
@@ -857,10 +851,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
addShape( static_cast<PCB_TEXTBOX*>( item ), layerContainer, item );
break;
case PCB_TABLE_T:
// JEY TODO: tables
break;
case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T:
case PCB_DIM_RADIAL_T:
@@ -875,15 +865,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
}
// Add via tech layers
if( ( layer == F_Mask || layer == B_Mask ) )
if( ( layer == F_Mask || layer == B_Mask ) && !m_board->GetTentVias() )
{
int maskExpansion = GetBoard()->GetDesignSettings().m_SolderMaskExpansion;
for( PCB_TRACK* track : m_board->Tracks() )
{
if( track->Type() == PCB_VIA_T
&& static_cast<const PCB_VIA*>( track )->FlashLayer( layer )
&& !static_cast<const PCB_VIA*>( track )->IsTented( layer ) )
&& static_cast<const PCB_VIA*>( track )->FlashLayer( layer ) )
{
createViaWithMargin( track, layerContainer, maskExpansion );
}
@@ -957,25 +946,20 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
break;
}
case PCB_TABLE_T:
// JEY TODO: tables
break;
default:
break;
}
}
// NON-TENTED VIAS
if( ( layer == F_Mask || layer == B_Mask ) )
if( ( layer == F_Mask || layer == B_Mask ) && !m_board->GetTentVias() )
{
int maskExpansion = GetBoard()->GetDesignSettings().m_SolderMaskExpansion;
for( PCB_TRACK* track : m_board->Tracks() )
{
if( track->Type() == PCB_VIA_T
&& static_cast<const PCB_VIA*>( track )->FlashLayer( layer )
&& !static_cast<const PCB_VIA*>( track )->IsTented( layer ) )
&& static_cast<const PCB_VIA*>( track )->FlashLayer( layer ) )
{
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, maxError,
ERROR_INSIDE );
+58 -89
View File
@@ -29,7 +29,7 @@
#include "../common_ogl/ogl_utils.h"
#include "eda_3d_canvas.h"
#include <eda_3d_viewer_frame.h>
#include <3d_rendering/raytracing/render_3d_raytrace_gl.h>
#include <3d_rendering/raytracing/render_3d_raytrace.h>
#include <3d_rendering/opengl/render_3d_opengl.h>
#include <3d_viewer_id.h>
#include <advanced_config.h>
@@ -73,11 +73,6 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, HIDPI_GL_3D_CANVAS )
EVT_MOTION( EDA_3D_CANVAS::OnMouseMove )
EVT_MAGNIFY( EDA_3D_CANVAS::OnMagnify )
// touch gesture events
EVT_GESTURE_ZOOM( wxID_ANY, EDA_3D_CANVAS::OnZoomGesture )
EVT_GESTURE_PAN( wxID_ANY, EDA_3D_CANVAS::OnPanGesture )
EVT_GESTURE_ROTATE( wxID_ANY, EDA_3D_CANVAS::OnRotateGesture )
// other events
EVT_ERASE_BACKGROUND( EDA_3D_CANVAS::OnEraseBackground )
EVT_CUSTOM(wxEVT_REFRESH_CUSTOM_COMMAND, ID_CUSTOM_EVENT_1, EDA_3D_CANVAS::OnRefreshRequest )
@@ -87,11 +82,11 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, HIDPI_GL_3D_CANVAS )
END_EVENT_TABLE()
EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttribs,
EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList,
BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera,
S3D_CACHE* a3DCachePointer ) :
HIDPI_GL_3D_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aCamera, aParent, aGLAttribs,
wxID_ANY, wxDefaultPosition,
HIDPI_GL_3D_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aCamera, aParent, wxID_ANY,
aAttribList, wxDefaultPosition,
wxDefaultSize, wxFULL_REPAINT_ON_RESIZE ),
m_eventDispatcher( nullptr ),
m_parentStatusBar( nullptr ),
@@ -125,7 +120,7 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttrib
m_is_currently_painting.clear();
m_3d_render_raytracing = new RENDER_3D_RAYTRACE_GL( this, m_boardAdapter, m_camera );
m_3d_render_raytracing = new RENDER_3D_RAYTRACE( this, m_boardAdapter, m_camera );
m_3d_render_opengl = new RENDER_3D_OPENGL( this, m_boardAdapter, m_camera );
wxASSERT( m_3d_render_raytracing != nullptr );
@@ -149,10 +144,6 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttrib
wxASSERT( a3DCachePointer != nullptr );
m_boardAdapter.Set3dCacheManager( a3DCachePointer );
#ifdef __WXMSW__
EnableTouchEvents( wxTOUCH_ZOOM_GESTURE | wxTOUCH_PAN_GESTURES | wxTOUCH_ROTATE_GESTURE );
#endif
const wxEventType events[] =
{
// Binding both EVT_CHAR and EVT_CHAR_HOOK ensures that all key events,
@@ -640,75 +631,6 @@ void EDA_3D_CANVAS::OnMagnify( wxMouseEvent& event )
}
void EDA_3D_CANVAS::OnZoomGesture( wxZoomGestureEvent& aEvent )
{
SetFocus();
if( aEvent.IsGestureStart() )
{
m_gestureLastZoomFactor = 1.0;
m_camera.SetCurMousePosition( aEvent.GetPosition() );
}
if( m_camera_is_moving )
return;
restart_editingTimeOut_Timer();
m_camera.Pan( aEvent.GetPosition() );
m_camera.SetCurMousePosition( aEvent.GetPosition() );
m_camera.Zoom( aEvent.GetZoomFactor() / m_gestureLastZoomFactor );
m_gestureLastZoomFactor = aEvent.GetZoomFactor();
DisplayStatus();
Request_refresh();
}
void EDA_3D_CANVAS::OnPanGesture( wxPanGestureEvent& aEvent )
{
SetFocus();
if( aEvent.IsGestureStart() )
m_camera.SetCurMousePosition( aEvent.GetPosition() );
if( m_camera_is_moving )
return;
m_camera.Pan( aEvent.GetPosition() );
m_camera.SetCurMousePosition( aEvent.GetPosition() );
DisplayStatus();
Request_refresh();
}
void EDA_3D_CANVAS::OnRotateGesture( wxRotateGestureEvent& aEvent )
{
SetFocus();
if( aEvent.IsGestureStart() )
{
m_gestureLastAngle = 0;
m_camera.SetCurMousePosition( aEvent.GetPosition() );
// We don't want to process the first angle
return;
}
if( m_camera_is_moving )
return;
m_camera.RotateScreen( m_gestureLastAngle - aEvent.GetRotationAngle() );
m_gestureLastAngle = aEvent.GetRotationAngle();
DisplayStatus();
Request_refresh();
}
void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
{
if( m_3d_render && m_3d_render->IsReloadRequestPending() )
@@ -830,6 +752,11 @@ void EDA_3D_CANVAS::OnLeftDown( wxMouseEvent& event )
SetFocus();
stop_editingTimeOut_Timer();
// Ensure m_camera.m_lastPosition (current mouse position) is up to date for
// future drag events (can be not the case when left clicking after
// opening a context menu)
OnMouseMoveCamera( event );
if( !event.Dragging() && ( m_3d_render_raytracing != nullptr ) )
{
RAY mouseRay = getRayAtCurrentMousePosition();
@@ -1061,24 +988,66 @@ bool EDA_3D_CANVAS::SetView3D( VIEW3D_TYPE aRequestedView )
return true;
case VIEW3D_TYPE::VIEW3D_RIGHT:
case VIEW3D_TYPE::VIEW3D_LEFT:
case VIEW3D_TYPE::VIEW3D_FRONT:
case VIEW3D_TYPE::VIEW3D_BACK:
case VIEW3D_TYPE::VIEW3D_FLIP:
m_camera.SetInterpolateMode( CAMERA_INTERPOLATION::BEZIER );
m_camera.SetT0_and_T1_current_T();
m_camera.ViewCommand_T1( aRequestedView );
m_camera.Reset_T1();
m_camera.RotateZ_T1( glm::radians( -90.0f ) );
m_camera.RotateX_T1( glm::radians( -90.0f ) );
request_start_moving_camera();
return true;
case VIEW3D_TYPE::VIEW3D_LEFT:
m_camera.SetInterpolateMode( CAMERA_INTERPOLATION::BEZIER );
m_camera.SetT0_and_T1_current_T();
m_camera.Reset_T1();
m_camera.RotateZ_T1( glm::radians( 90.0f ) );
m_camera.RotateX_T1( glm::radians( -90.0f ) );
request_start_moving_camera();
return true;
case VIEW3D_TYPE::VIEW3D_FRONT:
m_camera.SetInterpolateMode( CAMERA_INTERPOLATION::BEZIER );
m_camera.SetT0_and_T1_current_T();
m_camera.Reset_T1();
m_camera.RotateX_T1( glm::radians( -90.0f ) );
request_start_moving_camera();
return true;
case VIEW3D_TYPE::VIEW3D_BACK:
m_camera.SetInterpolateMode( CAMERA_INTERPOLATION::BEZIER );
m_camera.SetT0_and_T1_current_T();
m_camera.Reset_T1();
m_camera.RotateX_T1( glm::radians( -90.0f ) );
// The rotation angle should be 180.
// We use 179.999 (180 - epsilon) to avoid a full 360 deg rotation when
// using 180 deg if the previous rotated position was already 180 deg
m_camera.RotateZ_T1( glm::radians( 179.999f ) );
request_start_moving_camera();
return true;
case VIEW3D_TYPE::VIEW3D_TOP:
m_camera.SetInterpolateMode( CAMERA_INTERPOLATION::BEZIER );
m_camera.SetT0_and_T1_current_T();
m_camera.Reset_T1();
request_start_moving_camera( glm::min( glm::max( m_camera.GetZoom(), 0.5f ), 1.125f ) );
return true;
case VIEW3D_TYPE::VIEW3D_BOTTOM:
m_camera.SetInterpolateMode( CAMERA_INTERPOLATION::BEZIER );
m_camera.SetT0_and_T1_current_T();
m_camera.ViewCommand_T1( aRequestedView );
m_camera.Reset_T1();
m_camera.RotateY_T1( glm::radians( 179.999f ) ); // Rotation = 180 - epsilon
request_start_moving_camera( glm::min( glm::max( m_camera.GetZoom(), 0.5f ), 1.125f ) );
return true;
case VIEW3D_TYPE::VIEW3D_FLIP:
m_camera.SetInterpolateMode( CAMERA_INTERPOLATION::BEZIER );
m_camera.SetT0_and_T1_current_T();
m_camera.RotateY_T1( glm::radians( 179.999f ) );
request_start_moving_camera();
return true;
default:
return false;
}
+7 -15
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -38,7 +38,7 @@
class WX_INFOBAR;
class wxStatusBar;
class BOARD;
class RENDER_3D_RAYTRACE_GL;
class RENDER_3D_RAYTRACE;
class RENDER_3D_OPENGL;
@@ -52,12 +52,12 @@ public:
* Create a new 3D Canvas with an attribute list.
*
* @param aParent the parent creator of this canvas.
* @param aGLAttribs openGL attributes created by #OGL_ATT_LIST::GetAttributesList.
* @param aAttribList a list of openGL options created by GetOpenGL_AttributesList.
* @param aBoard The board.
* @param aSettings the settings options to be used by this canvas.
*/
EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttribs, BOARD_ADAPTER& aSettings,
CAMERA& aCamera, S3D_CACHE* a3DCachePointer );
EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList,
BOARD_ADAPTER& aSettings, CAMERA& aCamera, S3D_CACHE* a3DCachePointer );
~EDA_3D_CANVAS();
@@ -97,7 +97,7 @@ public:
}
/**
* @return the current render ( a RENDER_3D_RAYTRACE_GL* or a RENDER_3D_OPENGL* render )
* @return the current render ( a RENDER_3D_RAYTRACE* or a RENDER_3D_OPENGL* render )
*/
RENDER_3D_BASE* GetCurrentRender() const { return m_3d_render; }
@@ -237,10 +237,6 @@ private:
void OnResize( wxSizeEvent& event );
void OnTimerTimeout_Redraw( wxTimerEvent& event );
void OnZoomGesture( wxZoomGestureEvent& event );
void OnPanGesture( wxPanGestureEvent& event );
void OnRotateGesture( wxRotateGestureEvent& event );
DECLARE_EVENT_TABLE()
/**
@@ -315,7 +311,7 @@ private:
BOARD_ADAPTER& m_boardAdapter; // Pre-computed 3D info and settings
RENDER_3D_BASE* m_3d_render;
RENDER_3D_RAYTRACE_GL* m_3d_render_raytracing;
RENDER_3D_RAYTRACE* m_3d_render_raytracing;
RENDER_3D_OPENGL* m_3d_render_opengl;
bool m_opengl_supports_raytracing;
@@ -328,10 +324,6 @@ private:
bool m_render3dmousePivot = false; // Render the 3dmouse pivot
SFVEC3F m_3dmousePivotPos; // The position of the 3dmouse pivot
///< Used to track gesture events.
double m_gestureLastZoomFactor = 1.0;
double m_gestureLastAngle = 0.0;
/**
* Trace mask used to enable or disable the trace output of this class.
* The debug output can be turned on by setting the WXTRACE environment variable to
@@ -86,9 +86,9 @@ END_EVENT_TABLE()
#define RANGE_SCALE_3D 8.0f
EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const wxGLAttributes& aGLAttribs,
EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList,
S3D_CACHE* aCacheManager ) :
HIDPI_GL_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aParent, aGLAttribs, wxID_ANY,
HIDPI_GL_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aParent, wxID_ANY, aAttribList,
wxDefaultPosition, wxDefaultSize,
wxFULL_REPAINT_ON_RESIZE ),
m_trackBallCamera( RANGE_SCALE_3D * 4.0f ),
@@ -301,7 +301,7 @@ void EDA_3D_MODEL_VIEWER::OnPaint( wxPaintEvent& event )
// clear color and depth buffers
glEnable( GL_DEPTH_TEST );
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
glClearDepth( 1.0f );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
@@ -49,9 +49,9 @@ public:
* Create a new 3D Canvas with a attribute list.
*
* @param aParent the parent creator of this canvas.
* @param aGLAttribs openGL attributes created by #OGL_ATT_LIST::GetAttributesList.
* @param aAttribList a list of openGL options created by #OGL_ATT_LIST::GetAttributesList.
*/
EDA_3D_MODEL_VIEWER( wxWindow* aParent, const wxGLAttributes& aGLAttribs,
EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList = nullptr,
S3D_CACHE* aCacheManager = nullptr );
~EDA_3D_MODEL_VIEWER();
+2
View File
@@ -1,6 +1,8 @@
add_library(3d-viewer_navlib STATIC
"nl_3d_viewer_plugin.cpp"
"nl_3d_viewer_plugin_impl.cpp"
"nl_footprint_properties_plugin.cpp"
"nl_footprint_properties_plugin_impl.cpp"
)
# 3d-viewer_navlib depends on make_lexer outputs in common
+3 -6
View File
@@ -25,20 +25,17 @@
NL_3D_VIEWER_PLUGIN::NL_3D_VIEWER_PLUGIN( EDA_3D_CANVAS* aViewport )
: m_impl( nullptr )
{
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
{
m_impl = new NL_3D_VIEWER_PLUGIN_IMPL( aViewport );
m_impl = std::make_unique<NL_3D_VIEWER_PLUGIN_IMPL>( aViewport, "KiCAD 3D" );
m_impl->Connect();
}
}
NL_3D_VIEWER_PLUGIN::~NL_3D_VIEWER_PLUGIN()
{
delete m_impl;
}
NL_3D_VIEWER_PLUGIN::~NL_3D_VIEWER_PLUGIN() = default;
void NL_3D_VIEWER_PLUGIN::SetFocus( bool focus )
+3 -1
View File
@@ -26,6 +26,8 @@
#ifndef NL_3D_VIEWER_PLUGIN_H_
#define NL_3D_VIEWER_PLUGIN_H_
#include <memory>
// Forward declarations.
class EDA_3D_CANVAS;
class NL_3D_VIEWER_PLUGIN_IMPL;
@@ -54,7 +56,7 @@ public:
void SetFocus( bool aFocus = true );
private:
NL_3D_VIEWER_PLUGIN_IMPL* m_impl;
std::unique_ptr<NL_3D_VIEWER_PLUGIN_IMPL> m_impl;
};
#endif // NL_3D_VIEWER_PLUGIN_H_
@@ -1,8 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 3Dconnexion
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -27,6 +27,7 @@
// KiCAD includes
#include <tool/action_manager.h>
#include <tool/tool_manager.h>
#include <tool/tools_holder.h>
// stdlib
#include <map>
@@ -72,7 +73,7 @@ bool equals( glm::mat<L, C, T, Q> const& aFirst, glm::mat<L, C, T, Q> const& aSe
}
NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas ) :
NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas, const std::string& aProfileHint ) :
NAV_3D( false, false ),
m_canvas( aCanvas ),
m_capIsMoving( false ),
@@ -80,12 +81,7 @@ NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas ) :
{
m_camera = dynamic_cast<TRACK_BALL*>( m_canvas->GetCamera() );
PutProfileHint( "KiCAD 3D" );
EnableNavigation( true );
PutFrameTimingSource( TimingSource::SpaceMouse );
exportCommandsAndImages();
PutProfileHint( aProfileHint );
}
@@ -101,8 +97,19 @@ void NL_3D_VIEWER_PLUGIN_IMPL::SetFocus( bool aFocus )
NAV_3D::Write( navlib::focus_k, aFocus );
}
// temporary store for the categories
typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
EDA_3D_CANVAS* NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas() const
{
return m_canvas;
}
void NL_3D_VIEWER_PLUGIN_IMPL::Connect()
{
EnableNavigation(true);
PutFrameTimingSource(TimingSource::SpaceMouse);
exportCommandsAndImages();
}
/**
* Add a category to the store.
@@ -571,7 +578,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
if( parent->IsEnabled() )
{
TOOL_MANAGER* tool_manager = static_cast<PCB_BASE_FRAME*>( parent )->GetToolManager();
TOOL_MANAGER* tool_manager = dynamic_cast<TOOLS_HOLDER*>( parent )->GetToolManager();
if( tool_manager == nullptr )
{
+21 -4
View File
@@ -1,8 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 3Dconnexion
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -42,6 +42,11 @@
class EDA_3D_CANVAS;
class TRACK_BALL;
// temporary store for the categories
typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
CATEGORY_STORE::iterator add_category( std::string aCategoryPath, CATEGORY_STORE& aCategoryStore );
// Convenience typedef.
typedef TDx::SpaceMouse::Navigation3D::CNavigation3D NAV_3D;
@@ -56,8 +61,9 @@ public:
* Initializes a new instance of the NL_3DVIEWER_PLUGIN.
*
* @param aCanvas is the viewport to be navigated.
* @param aProfileHint tells the 3DConnexion UI which profile to use.
*/
NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas );
NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas, const std::string& aProfileHint );
virtual ~NL_3D_VIEWER_PLUGIN_IMPL();
@@ -69,11 +75,21 @@ public:
*/
void SetFocus( bool aFocus = true );
/**
* Get the m_canvas pointer.
*/
EDA_3D_CANVAS* GetCanvas() const;
/**
* Connect plugin implementation to the driver.
*/
void Connect();
private:
/**
* Export the invocable actions and images to the 3Dconnexion UI.
*/
void exportCommandsAndImages();
virtual void exportCommandsAndImages();
long GetCameraMatrix( navlib::matrix_t& aMatrix ) const override;
long GetPointerPosition( navlib::point_t& aPosition ) const override;
@@ -111,6 +127,7 @@ private:
long GetCoordinateSystem( navlib::matrix_t& aMatrix ) const override;
long GetIsViewRotatable( navlib::bool_t& isRotatable ) const override;
private:
EDA_3D_CANVAS* m_canvas;
TRACK_BALL* m_camera;
@@ -1,6 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
@@ -17,22 +18,28 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
#include "nl_footprint_properties_plugin.h"
#include "nl_footprint_properties_plugin_impl.h"
#include <advanced_config.h>
#include <kiplatform/drivers.h>
package kiapi.common.commands;
import "common/types/base_types.proto";
message GetVersion
NL_FOOTPRINT_PROPERTIES_PLUGIN::NL_FOOTPRINT_PROPERTIES_PLUGIN( EDA_3D_CANVAS* aViewport )
{
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
{
m_impl = std::make_unique<NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL>( aViewport );
m_impl->Connect();
}
}
message GetVersionResponse
{
kiapi.common.types.KiCadVersion version = 1;
}
// A command to check if the connection to KiCad is OK
message Ping
NL_FOOTPRINT_PROPERTIES_PLUGIN::~NL_FOOTPRINT_PROPERTIES_PLUGIN() = default;
void NL_FOOTPRINT_PROPERTIES_PLUGIN::SetFocus( bool focus )
{
if( m_impl )
m_impl->SetFocus( focus );
}
@@ -0,0 +1,62 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file nl_footprint_properties_plugin.h
* @brief declaration of the nl_footprint_properties_plugin class
*/
#ifndef NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
#define NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
#include <memory>
// Forward declarations.
class EDA_3D_CANVAS;
class NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL;
/**
* The class that implements the public interface to the SpaceMouse plug-in.
*/
class NL_FOOTPRINT_PROPERTIES_PLUGIN
{
public:
/**
* Initializes a new instance of the NL_FOOTPRINT_PROPERTIES_PLUGIN.
*
* @param aViewport is the viewport to be navigated.
*/
NL_FOOTPRINT_PROPERTIES_PLUGIN( EDA_3D_CANVAS* aViewport );
virtual ~NL_FOOTPRINT_PROPERTIES_PLUGIN();
/**
* Set the connection to the 3Dconnexion driver to the focus state so that
* 3DMouse data is routed here.
*
* @param aFocus is true to set the connection active.
*/
void SetFocus( bool aFocus = true );
private:
std::unique_ptr<NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL> m_impl;
};
#endif // NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
@@ -0,0 +1,162 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nl_footprint_properties_plugin_impl.h"
#include <3d-viewer/3d_canvas/eda_3d_canvas.h>
// KiCAD includes
#include <tool/action_manager.h>
#include <tool/tool_manager.h>
#include <tool/tools_holder.h>
#include <wx/mstream.h>
#define BOUNDING_BOX_SCALE_FACTOR 1.3f
/**
* Flag to enable the NL_FOOTPRINT_PROPERTIES_PLUGIN debug tracing.
*
* Use "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN" to enable.
*
* @ingroup trace_env_vars
*/
const wxChar* NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::m_logTrace =
wxT( "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN" );
NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL(EDA_3D_CANVAS* aCanvas) :
NL_3D_VIEWER_PLUGIN_IMPL(aCanvas, "KiCAD Footprint Properties")
{}
long NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::GetModelExtents( navlib::box_t& extents ) const
{
SFVEC3F min = NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas()->GetBoardAdapter().GetBBox().Min();
SFVEC3F max = NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas()->GetBoardAdapter().GetBBox().Max();
SFVEC3F diff = ( BOUNDING_BOX_SCALE_FACTOR - 1.f ) / 2.f * ( max - min );
min -= diff;
max += diff;
extents = { min.x, min.y, min.z, max.x, max.y, max.z };
return 0;
}
void NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::exportCommandsAndImages()
{
std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
if( actions.size() == 0 )
{
return;
}
using TDx::SpaceMouse::CCommand;
using TDx::SpaceMouse::CCommandSet;
// The root action set node
CCommandSet commandSet( "EDA_3D_CANVAS", "3D Viewer" );
// Activate the command set
NAV_3D::PutActiveCommands( commandSet.GetId() );
// temporary store for the categories
CATEGORY_STORE categoryStore;
std::vector<TDx::CImage> vImages;
// add the action set to the category_store
categoryStore.insert( categoryStore.end(), CATEGORY_STORE::value_type( ".", &commandSet ) );
std::list<TOOL_ACTION*>::const_iterator it;
for( it = actions.begin(); it != actions.end(); ++it )
{
const TOOL_ACTION* action = *it;
std::string label = action->GetMenuLabel().ToStdString();
if( label.empty() )
{
continue;
}
std::string name = action->GetName();
// Do no export commands for the pcbnew app.
if( name.rfind( "pcbnew.", 0 ) == 0 )
{
continue;
}
// Exclude commands which can't be used in the footprint properties.
if( name.rfind( "3DViewer.Control.pivotCenter", 0 ) == 0
|| name.rfind( "3DViewer.Control.material", 0 ) == 0
|| name.rfind( "3DViewer.Control.attribute", 0 ) == 0
|| name.rfind( "3DViewer.Control.show", 0 ) == 0 )
{
continue;
}
std::string strCategory = action->GetToolName();
CATEGORY_STORE::iterator iter = categoryStore.find( strCategory );
if( iter == categoryStore.end() )
{
iter = add_category( std::move( strCategory ), categoryStore );
}
std::string description = action->GetDescription().ToStdString();
// Arbitrary 8-bit data stream
wxMemoryOutputStream imageStream;
if( action->GetIcon() != BITMAPS::INVALID_BITMAP )
{
wxImage image = KiBitmap( action->GetIcon() ).ConvertToImage();
image.SaveFile( imageStream, wxBitmapType::wxBITMAP_TYPE_PNG );
image.Destroy();
if( imageStream.GetSize() )
{
wxStreamBuffer* streamBuffer = imageStream.GetOutputStreamBuffer();
TDx::CImage tdxImage = TDx::CImage::FromData( "", 0, name.c_str() );
tdxImage.AssignImage( std::string( reinterpret_cast<const char*>(
streamBuffer->GetBufferStart() ),
streamBuffer->GetBufferSize() ),
0 );
wxLogTrace( m_logTrace, wxT( "Adding image for : %s" ), name );
vImages.push_back( std::move( tdxImage ) );
}
}
wxLogTrace( m_logTrace, wxT( "Inserting command: %s, description: %s, in category: %s" ),
name, description, iter->first );
iter->second->push_back(
CCommand( std::move( name ), std::move( label ), std::move( description ) ) );
}
NAV_3D::AddCommandSet( commandSet );
NAV_3D::AddImages( vImages );
}
@@ -0,0 +1,68 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file nl_footprint_properties_plugin_impl.h
* @brief declaration of the nl_footprint_properties_plugin_impl class
*/
#ifndef NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
#define NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
#include "nl_3d_viewer_plugin_impl.h"
// TDxWare SDK.
#include <SpaceMouse/CNavigation3D.hpp>
/**
* The class that adjusts NL_3D_VIEWER_PLUGIN_IMPL implementation for 3D Model preview in footprint properties dialog.
*/
class NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL : public NL_3D_VIEWER_PLUGIN_IMPL
{
public:
/**
* Initializes a new instance of the NL_FOOTPRINT_PROPERTIES_PLUGIN.
*
* @param aCanvas is the viewport to be navigated.
*/
NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas );
private:
/**
* Get Footprint 3D Model extents.
*
* @param extents is the box around the 3D model.
*/
long GetModelExtents( navlib::box_t& extents ) const override;
/**
* Export the invocable actions and images to the 3Dconnexion UI.
*/
void exportCommandsAndImages() override;
private:
/**
* Trace mask used to enable or disable the trace output of this class.
* The debug output can be turned on by setting the WXTRACE environment variable to
* "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN". See the wxWidgets documentation on wxLogTrace for
* more information.
*/
static const wxChar* m_logTrace;
};
#endif // NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
+1 -39
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2016-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -46,19 +46,6 @@ static void dbg_save_rgb_buffer( const wxString& aFileName, unsigned char *aRGBp
}
static void dbg_save_rgb_a_buffer( const wxString& aFileName, unsigned char* aRGBpixelBuffer,
unsigned char* aAlphaBuffer, unsigned int aXSize,
unsigned int aYSize )
{
wxImage image( aXSize, aYSize );
image.SetData( aRGBpixelBuffer );
image.SetAlpha( aAlphaBuffer );
image = image.Mirror( false );
image.SaveFile( aFileName + wxT( ".png" ), wxBITMAP_TYPE_PNG );
image.Destroy();
}
void DBG_SaveBuffer( const wxString& aFileName, const unsigned char *aInBuffer,
unsigned int aXSize, unsigned int aYSize )
{
@@ -123,31 +110,6 @@ void DBG_SaveBuffer( const wxString& aFileName, const SFVEC3F *aInBuffer,
}
void DBG_SaveBuffer( const wxString& aFileName, const SFVEC4F *aInBuffer,
unsigned int aXSize, unsigned int aYSize )
{
const unsigned int wxh = aXSize * aYSize;
unsigned char *pixelbuffer = (unsigned char*) malloc( wxh * 4 );
unsigned char *alphabuffer = (unsigned char*) malloc( wxh );
for( unsigned int i = 0; i < wxh; ++i )
{
const SFVEC4F &v = aInBuffer[i];
const unsigned int ix3 = i * 3;
// Set RGB value with all same values intensities
pixelbuffer[ix3 + 0] = (unsigned char) glm::min( (int) ( v.r * 255.0f ), 255 );
pixelbuffer[ix3 + 1] = (unsigned char) glm::min( (int) ( v.g * 255.0f ), 255 );
pixelbuffer[ix3 + 2] = (unsigned char) glm::min( (int) ( v.b * 255.0f ), 255 );
alphabuffer[i] = (unsigned char) glm::min( (int) ( v.a * 255.0f ), 255 );
}
dbg_save_rgb_a_buffer( aFileName, pixelbuffer, alphabuffer, aXSize, aYSize );
}
void DBG_SaveNormalsBuffer( const wxString& aFileName, const SFVEC3F *aInNormalsBuffer,
unsigned int aXSize, unsigned int aYSize )
{
+1 -4
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2016-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -42,9 +42,6 @@ void DBG_SaveBuffer( const wxString& aFileName, const float *aInBuffer,
void DBG_SaveBuffer( const wxString& aFileName, const SFVEC3F *aInBuffer,
unsigned int aXSize, unsigned int aYSize );
void DBG_SaveBuffer( const wxString& aFileName, const SFVEC4F *aInBuffer,
unsigned int aXSize, unsigned int aYSize );
void DBG_SaveNormalsBuffer( const wxString& aFileName, const SFVEC3F *aInNormalsBuffer,
unsigned int aXSize, unsigned int aYSize );
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -23,60 +23,47 @@
*/
/**
* @file color_rgba.cpp
* @file color_rgb.cpp
*/
#include "color_rgba.h"
#include "color_rgb.h"
COLOR_RGBA::COLOR_RGBA( const SFVEC3F& aColor )
COLOR_RGB::COLOR_RGB( const SFVEC3F& aColor )
{
r = (unsigned int) glm::clamp( (int) ( aColor.r * 255 ), 0, 255 );
g = (unsigned int) glm::clamp( (int) ( aColor.g * 255 ), 0, 255 );
b = (unsigned int) glm::clamp( (int) ( aColor.b * 255 ), 0, 255 );
a = 255;
}
COLOR_RGBA::COLOR_RGBA( const SFVEC4F& aColor )
{
r = (unsigned int) glm::clamp( (int) ( aColor.r * 255 ), 0, 255 );
g = (unsigned int) glm::clamp( (int) ( aColor.g * 255 ), 0, 255 );
b = (unsigned int) glm::clamp( (int) ( aColor.b * 255 ), 0, 255 );
a = (unsigned int) glm::clamp( (int) ( aColor.a * 255 ), 0, 255 );
}
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2 )
COLOR_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2 )
{
const unsigned int r = aC1.r + aC2.r;
const unsigned int g = aC1.g + aC2.g;
const unsigned int b = aC1.b + aC2.b;
const unsigned int a = aC1.a + aC2.a;
return COLOR_RGBA( ( r >> 1 ), ( g >> 1 ), ( b >> 1 ), ( a >> 1 ) );
return COLOR_RGB( ( r >> 1 ), ( g >> 1 ), ( b >> 1 ) );
}
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2, const COLOR_RGBA& aC3 )
COLOR_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2, const COLOR_RGB& aC3 )
{
const unsigned int r = aC1.r + aC2.r + aC3.r;
const unsigned int g = aC1.g + aC2.g + aC3.g;
const unsigned int b = aC1.b + aC2.b + aC3.b;
const unsigned int a = aC1.a + aC2.a + aC3.a;
return COLOR_RGBA( ( r / 3 ), ( g / 3 ), ( b / 3 ), ( a / 3 ) );
return COLOR_RGB( ( r / 3 ), ( g / 3 ), ( b / 3 ) );
}
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2, const COLOR_RGBA& aC3,
const COLOR_RGBA& aC4 )
COLOR_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2, const COLOR_RGB& aC3,
const COLOR_RGB& aC4 )
{
const unsigned int r = aC1.r + aC2.r + aC3.r + aC4.r;
const unsigned int g = aC1.g + aC2.g + aC3.g + aC4.g;
const unsigned int b = aC1.b + aC2.b + aC3.b + aC4.b;
const unsigned int a = aC1.a + aC2.a + aC3.a + aC4.a;
return COLOR_RGBA( ( r >> 2 ), ( g >> 2 ), ( b >> 2 ), ( a >> 2 ) );
return COLOR_RGB( ( r >> 2 ), ( g >> 2 ), ( b >> 2 ) );
}
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -23,49 +23,39 @@
*/
/**
* @file color_rgba.h
* @file color_rgb.h
*/
#ifndef COLOR_RGBA_H
#define COLOR_RGBA_H
#ifndef COLOR_RGB_H
#define COLOR_RGB_H
#include <plugins/3dapi/xv3d_types.h>
union COLOR_RGBA
union COLOR_RGB
{
unsigned char c[4];
unsigned char c[3];
struct
{
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
};
COLOR_RGBA( const SFVEC3F& aColor );
COLOR_RGBA( const SFVEC4F& aColor );
COLOR_RGBA() { r = 0; g = 0; b = 0; a = 0; }
COLOR_RGBA( unsigned char aR, unsigned char aG, unsigned char aB )
COLOR_RGB( const SFVEC3F& aColor );
COLOR_RGB() { r = 0; g = 0; b = 0; }
COLOR_RGB( unsigned char aR, unsigned char aG, unsigned char aB )
{
r = aR;
g = aG;
b = aB;
}
COLOR_RGBA( unsigned char aR, unsigned char aG, unsigned char aB, unsigned char aA )
{
r = aR;
g = aG;
b = aB;
a = aA;
}
};
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2 );
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2, const COLOR_RGBA& aC3 );
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2, const COLOR_RGBA& aC3,
const COLOR_RGBA& aC4 );
COLOR_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2 );
COLOR_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2, const COLOR_RGB& aC3 );
COLOR_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2, const COLOR_RGB& aC3,
const COLOR_RGB& aC4 );
#endif // COLOR_RGBA_H
#endif // COLOR_RGB_H
+2 -2
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2020 Oleg Endo <olegendo@gcc.gnu.org>
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -30,7 +30,7 @@
#include <plugins/3dapi/c3dmodel.h>
#include "../../common_ogl/openGL_includes.h"
#include "../raytracing/shapes3D/bbox_3d.h"
#include <3d_enums.h>
#include "../../3d_enums.h"
#include <wx/chartype.h>
@@ -3,7 +3,7 @@
*
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2023 CERN
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -30,7 +30,6 @@
#include "render_3d_opengl.h"
#include "opengl_utils.h"
#include "common_ogl/ogl_utils.h"
#include <board.h>
#include <footprint.h>
#include <3d_math.h>
#include <glm/geometric.hpp>
@@ -48,8 +47,7 @@
RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter,
CAMERA& aCamera ) :
RENDER_3D_BASE( aAdapter, aCamera ),
m_canvas( aCanvas )
RENDER_3D_BASE( aCanvas, aAdapter, aCamera )
{
wxLogTrace( m_logTrace, wxT( "RENDER_3D_OPENGL::RENDER_3D_OPENGL" ) );
@@ -446,17 +444,11 @@ void RENDER_3D_OPENGL::renderBoardBody( bool aSkipRenderHoles )
}
static inline SFVEC4F premultiplyAlpha( const SFVEC4F& aInput )
{
return SFVEC4F( aInput.r * aInput.a, aInput.g * aInput.a, aInput.b * aInput.a, aInput.a );
}
bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
REPORTER* aWarningReporter )
{
// Initialize OpenGL
if( !m_canvasInitialized )
if( !m_is_opengl_initialized )
{
if( !initializeOpenGL() )
return false;
@@ -503,7 +495,7 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
glEnable( GL_MULTISAMPLE );
// clear color and depth buffers
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
glClearDepth( 1.0f );
glClearStencil( 0x00 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
@@ -511,8 +503,8 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
OglResetTextureState();
// Draw the background ( rectangle with color gradient)
OglDrawBackground( premultiplyAlpha( m_boardAdapter.m_BgColorTop ),
premultiplyAlpha( m_boardAdapter.m_BgColorBot ) );
OglDrawBackground( SFVEC3F( m_boardAdapter.m_BgColorTop ),
SFVEC3F( m_boardAdapter.m_BgColorBot ) );
glEnable( GL_DEPTH_TEST );
@@ -825,7 +817,7 @@ bool RENDER_3D_OPENGL::initializeOpenGL()
// Use this mode if you want see the triangle lines (debug proposes)
//glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
m_canvasInitialized = true;
m_is_opengl_initialized = true;
return true;
}
@@ -1023,7 +1015,7 @@ void RENDER_3D_OPENGL::get3dModelsFromFootprint( std::list<MODELTORENDER> &aDstR
const SFVEC3F offset = SFVEC3F( sM.m_Offset.x, sM.m_Offset.y, sM.m_Offset.z );
const SFVEC3F rotation = SFVEC3F( sM.m_Rotation.x, sM.m_Rotation.y, sM.m_Rotation.z );
const SFVEC3F scale = SFVEC3F( sM.m_Scale.x, sM.m_Scale.y, sM.m_Scale.z );
std::vector<float> key = { offset.x, offset.y, offset.z,
rotation.x, rotation.y, rotation.z,
scale.x, scale.y, scale.z };
@@ -1136,7 +1128,7 @@ void RENDER_3D_OPENGL::renderTransparentModels( const glm::mat4 &aCameraViewMatr
const SFVEC3F bBoxWorld = mtr.m_modelWorldMat * glm::vec4( bBoxCenter, 1.0f );
const float distanceToCamera = glm::length( cameraPos - bBoxWorld );
transparentModelList.emplace_back( &mtr, distanceToCamera );
}
@@ -1226,7 +1218,7 @@ void RENDER_3D_OPENGL::renderModel( const glm::mat4 &aCameraViewMatrix,
aModelToRender.m_model->DrawBbox();
glEnable( GL_LIGHTING );
if( !wasBlendEnabled )
glDisable( GL_BLEND );
}
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -208,8 +208,6 @@ private:
SMATERIAL m_GrayMaterial;
} m_materials;
EDA_3D_CANVAS* m_canvas;
MAP_OGL_DISP_LISTS m_layers;
OPENGL_RENDER_LIST* m_platedPadsFront;
OPENGL_RENDER_LIST* m_platedPadsBack;
+6 -6
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -63,7 +63,7 @@ void POST_SHADER::UpdateSize( unsigned int xSize, unsigned int ySize )
const unsigned int n_elements = xSize * ySize;
m_normals = new SFVEC3F[n_elements];
m_color = new SFVEC4F[n_elements];
m_color = new SFVEC3F[n_elements];
m_depth = new float[n_elements];
m_wc_hitposition = new SFVEC3F[n_elements];
m_shadow_att_factor = new float[n_elements];
@@ -77,7 +77,7 @@ void POST_SHADER::UpdateSize( const SFVEC2UI& aSize )
void POST_SHADER::SetPixelData( unsigned int x, unsigned int y, const SFVEC3F& aNormal,
const SFVEC4F& aColor, const SFVEC3F& aHitPosition,
const SFVEC3F& aColor, const SFVEC3F& aHitPosition,
float aDepth, float aShadowAttFactor )
{
wxASSERT( x < m_size.x );
@@ -125,7 +125,7 @@ const SFVEC3F& POST_SHADER::GetNormalAt( const SFVEC2F& aPos ) const
}
const SFVEC4F& POST_SHADER::GetColorAt( const SFVEC2F& aPos ) const
const SFVEC3F& POST_SHADER::GetColorAt( const SFVEC2F& aPos ) const
{
return m_color[GetIndex( aPos )];
}
@@ -149,13 +149,13 @@ const SFVEC3F& POST_SHADER::GetNormalAt( const SFVEC2I& aPos ) const
}
const SFVEC4F& POST_SHADER::GetColorAt( const SFVEC2I& aPos ) const
const SFVEC3F& POST_SHADER::GetColorAt( const SFVEC2I& aPos ) const
{
return m_color[GetIndex( aPos )];
}
const SFVEC4F& POST_SHADER::GetColorAtNotProtected( const SFVEC2I& aPos ) const
const SFVEC3F& POST_SHADER::GetColorAtNotProtected( const SFVEC2I& aPos ) const
{
return m_color[ aPos.x + m_size.x * aPos.y ];
}
+7 -7
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -46,7 +46,7 @@ public:
* @param aShadeColor The result of the shader.
* @return the result of the shade process
*/
virtual SFVEC4F ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC4F& aInputColor,
virtual SFVEC3F ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC3F& aInputColor,
const SFVEC3F& aShadeColor ) const = 0;
void UpdateSize( const SFVEC2UI& aSize );
@@ -56,10 +56,10 @@ public:
void InitFrame() { m_tmin = FLT_MAX; m_tmax = 0.0f; }
void SetPixelData( unsigned int x, unsigned int y, const SFVEC3F& aNormal,
const SFVEC4F& aColor, const SFVEC3F& aHitPosition,
const SFVEC3F& aColor, const SFVEC3F& aHitPosition,
float aDepth, float aShadowAttFactor );
const SFVEC4F& GetColorAtNotProtected( const SFVEC2I& aPos ) const;
const SFVEC3F& GetColorAtNotProtected( const SFVEC2I& aPos ) const;
void DebugBuffersOutputAsImages() const;
@@ -88,12 +88,12 @@ public:
protected:
const SFVEC3F& GetNormalAt( const SFVEC2F& aPos ) const;
const SFVEC4F& GetColorAt( const SFVEC2F& aPos ) const;
const SFVEC3F& GetColorAt( const SFVEC2F& aPos ) const;
const SFVEC3F& GetPositionAt( const SFVEC2F& aPos ) const;
float GetDepthAt( const SFVEC2F& aPos ) const;
const SFVEC3F& GetNormalAt( const SFVEC2I& aPos ) const;
const SFVEC4F& GetColorAt( const SFVEC2I& aPos ) const;
const SFVEC3F& GetColorAt( const SFVEC2I& aPos ) const;
const SFVEC3F& GetPositionAt( const SFVEC2I& aPos ) const;
const float& GetShadowFactorAt( const SFVEC2I& aPos ) const;
@@ -109,7 +109,7 @@ protected:
SFVEC2UI m_size;
SFVEC3F* m_normals;
SFVEC4F* m_color;
SFVEC3F* m_color;
SFVEC3F* m_wc_hitposition;
float* m_depth;
float* m_shadow_att_factor;
+13 -27
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -187,21 +187,21 @@ SFVEC3F POST_SHADER_SSAO::Shade( const SFVEC2I& aShaderPos ) const
ao += aoFF( aShaderPos, ddiff8, n, shadowAt8, shadowAt0, -npw, ph );
gi += giFF( aShaderPos, ddiff , n, shadowAt1, npw, nph) *
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( npw, nph ) ) );
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( npw, nph ) ) );
gi += giFF( aShaderPos, ddiff2, n, shadowAt2, npw, -nph) *
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( npw,-nph ) ) );
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( npw,-nph ) ) );
gi += giFF( aShaderPos, ddiff3, n, shadowAt3, -npw, nph) *
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( -npw, nph ) ) );
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( -npw, nph ) ) );
gi += giFF( aShaderPos, ddiff4, n, shadowAt4, -npw, -nph) *
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( -npw,-nph ) ) );
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( -npw,-nph ) ) );
gi += giFF( aShaderPos, ddiff5, n, shadowAt5 , pw, nph) *
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( pw, nph ) ) );
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( pw, nph ) ) );
gi += giFF( aShaderPos, ddiff6, n, shadowAt6, pw,-nph) *
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( pw,-nph ) ) );
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( pw,-nph ) ) );
gi += giFF( aShaderPos, ddiff7, n, shadowAt7, npw, ph) *
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( npw, ph ) ) );
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( npw, ph ) ) );
gi += giFF( aShaderPos, ddiff8, n, shadowAt8, -npw, ph) *
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( -npw, ph ) ) );
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( -npw, ph ) ) );
}
// If it received direct light, it shouldn't consider much AO
@@ -227,20 +227,18 @@ SFVEC3F POST_SHADER_SSAO::Shade( const SFVEC2I& aShaderPos ) const
}
SFVEC4F POST_SHADER_SSAO::ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC4F& aInputColor,
SFVEC3F POST_SHADER_SSAO::ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC3F& aInputColor,
const SFVEC3F& aShadeColor ) const
{
SFVEC4F outColor;
SFVEC3F inColor( aInputColor );
SFVEC3F outColor;
const SFVEC3F subtracted = inColor - aShadeColor;
const SFVEC3F mixed = glm::mix( inColor, inColor * 0.50f - aShadeColor * 0.05f,
const SFVEC3F subtracted = aInputColor - aShadeColor;
const SFVEC3F mixed = glm::mix( aInputColor, aInputColor * 0.50f - aShadeColor * 0.05f,
glm::min( aShadeColor, 1.0f ) );
outColor.r = ( aShadeColor.r < 0.0f ) ? subtracted.r : mixed.r;
outColor.g = ( aShadeColor.g < 0.0f ) ? subtracted.g : mixed.g;
outColor.b = ( aShadeColor.b < 0.0f ) ? subtracted.b : mixed.b;
outColor.a = std::max( aInputColor.a, ( aShadeColor.r + aShadeColor.g + aShadeColor.b ) / 3 );
return outColor;
}
@@ -258,18 +256,6 @@ SFVEC3F POST_SHADER_SSAO::giColorCurve( const SFVEC3F& aColor ) const
}
SFVEC4F POST_SHADER_SSAO::giColorCurve( const SFVEC4F& aColor ) const
{
return SFVEC4F( giColorCurve( SFVEC3F( aColor ) ), aColor.a );
}
SFVEC3F POST_SHADER_SSAO::giColorCurveShade( const SFVEC4F& aColor ) const
{
return giColorCurve( SFVEC3F( aColor ) );
}
SFVEC3F POST_SHADER_SSAO::Blur( const SFVEC2I& aShaderPos ) const
{
const float dCenter = GetDepthAt( aShaderPos );
+2 -4
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -40,7 +40,7 @@ public:
explicit POST_SHADER_SSAO( const CAMERA& aCamera );
SFVEC3F Shade(const SFVEC2I& aShaderPos ) const override;
SFVEC4F ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC4F& aInputColor,
SFVEC3F ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC3F& aInputColor,
const SFVEC3F& aShadeColor ) const override;
SFVEC3F Blur( const SFVEC2I& aShaderPos ) const;
@@ -77,8 +77,6 @@ private:
* @return transformed color.
*/
SFVEC3F giColorCurve( const SFVEC3F& aColor ) const;
SFVEC4F giColorCurve( const SFVEC4F& aColor ) const;
SFVEC3F giColorCurveShade( const SFVEC4F& aColor ) const;
SFVEC3F* m_shadedBuffer;
@@ -3,7 +3,7 @@
*
* Copyright (C) 2015-2022 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2023 CERN
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "render_3d_raytrace_base.h"
#include "render_3d_raytrace.h"
#include "shapes3D/plane_3d.h"
#include "shapes3D/round_segment_3d.h"
#include "shapes3D/layer_item_3d.h"
@@ -72,7 +72,7 @@ static float TransparencyControl( float aGrayColorValue, float aTransparency )
#define UNITS3D_TO_UNITSPCB ( pcbIUScale.IU_PER_MM )
void RENDER_3D_RAYTRACE_BASE::setupMaterials()
void RENDER_3D_RAYTRACE::setupMaterials()
{
MATERIAL::SetDefaultRefractionRayCount( m_boardAdapter.m_Cfg->m_Render.raytrace_nrsamples_refractions );
MATERIAL::SetDefaultReflectionRayCount( m_boardAdapter.m_Cfg->m_Render.raytrace_nrsamples_reflections );
@@ -170,13 +170,13 @@ void RENDER_3D_RAYTRACE_BASE::setupMaterials()
m_materials.m_Floor = BLINN_PHONG_MATERIAL( bgTop * 0.125f, SFVEC3F( 0.0f, 0.0f, 0.0f ),
( SFVEC3F( 1.0f ) - bgTop ) / 3.0f,
0.10f * 128.0f, 1.0f, 0.50f );
0.10f * 128.0f, 0.0f, 0.50f );
m_materials.m_Floor.SetCastShadows( false );
m_materials.m_Floor.SetReflectionRecursionCount( 1 );
}
void RENDER_3D_RAYTRACE_BASE::createObject( CONTAINER_3D& aDstContainer, const OBJECT_2D* aObject2D,
void RENDER_3D_RAYTRACE::createObject( CONTAINER_3D& aDstContainer, const OBJECT_2D* aObject2D,
float aZMin, float aZMax, const MATERIAL* aMaterial,
const SFVEC3F& aObjColor )
{
@@ -227,7 +227,7 @@ void RENDER_3D_RAYTRACE_BASE::createObject( CONTAINER_3D& aDstContainer, const O
}
void RENDER_3D_RAYTRACE_BASE::createItemsFromContainer( const BVH_CONTAINER_2D* aContainer2d,
void RENDER_3D_RAYTRACE::createItemsFromContainer( const BVH_CONTAINER_2D* aContainer2d,
PCB_LAYER_ID aLayer_id,
const MATERIAL* aMaterialLayer,
const SFVEC3F& aLayerColor,
@@ -358,7 +358,7 @@ void RENDER_3D_RAYTRACE_BASE::createItemsFromContainer( const BVH_CONTAINER_2D*
extern void buildBoardBoundingBoxPoly( const BOARD* aBoard, SHAPE_POLY_SET& aOutline );
void RENDER_3D_RAYTRACE_BASE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningReporter,
void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningReporter,
bool aOnlyLoadCopperAndShapes )
{
m_reloadRequested = false;
@@ -817,7 +817,7 @@ void RENDER_3D_RAYTRACE_BASE::Reload( REPORTER* aStatusReporter, REPORTER* aWarn
const SFVEC3F v2 = SFVEC3F( v1.x, v3.y, v1.z );
const SFVEC3F v4 = SFVEC3F( v3.x, v1.y, v1.z );
SFVEC3F floorColor = ConvertSRGBToLinear( m_boardAdapter.m_BgColorTop );
SFVEC3F backgroundColor = ConvertSRGBToLinear( m_boardAdapter.m_BgColorTop );
TRIANGLE* newTriangle1 = new TRIANGLE( v1, v2, v3 );
TRIANGLE* newTriangle2 = new TRIANGLE( v3, v4, v1 );
@@ -828,8 +828,8 @@ void RENDER_3D_RAYTRACE_BASE::Reload( REPORTER* aStatusReporter, REPORTER* aWarn
newTriangle1->SetMaterial( &m_materials.m_Floor );
newTriangle2->SetMaterial( &m_materials.m_Floor );
newTriangle1->SetColor( floorColor );
newTriangle2->SetColor( floorColor );
newTriangle1->SetColor( backgroundColor );
newTriangle2->SetColor( backgroundColor );
// Ceiling triangles
const float maxZ = glm::max( containerBBox.Max().z, boardBBox.Max().z );
@@ -848,8 +848,8 @@ void RENDER_3D_RAYTRACE_BASE::Reload( REPORTER* aStatusReporter, REPORTER* aWarn
newTriangle3->SetMaterial( &m_materials.m_Floor );
newTriangle4->SetMaterial( &m_materials.m_Floor );
newTriangle3->SetColor( floorColor );
newTriangle4->SetColor( floorColor );
newTriangle3->SetColor( backgroundColor );
newTriangle4->SetColor( backgroundColor );
}
}
}
@@ -962,7 +962,7 @@ void RENDER_3D_RAYTRACE_BASE::Reload( REPORTER* aStatusReporter, REPORTER* aWarn
}
void RENDER_3D_RAYTRACE_BASE::insertHole( const PCB_VIA* aVia )
void RENDER_3D_RAYTRACE::insertHole( const PCB_VIA* aVia )
{
PCB_LAYER_ID top_layer, bottom_layer;
int radiusBUI = ( aVia->GetDrillValue() / 2 );
@@ -993,7 +993,7 @@ void RENDER_3D_RAYTRACE_BASE::insertHole( const PCB_VIA* aVia )
}
void RENDER_3D_RAYTRACE_BASE::insertHole( const PAD* aPad )
void RENDER_3D_RAYTRACE::insertHole( const PAD* aPad )
{
const OBJECT_2D* object2d_A = nullptr;
@@ -1164,7 +1164,7 @@ void RENDER_3D_RAYTRACE_BASE::insertHole( const PAD* aPad )
}
void RENDER_3D_RAYTRACE_BASE::addPadsAndVias()
void RENDER_3D_RAYTRACE::addPadsAndVias()
{
if( !m_boardAdapter.GetBoard() )
return;
@@ -1193,7 +1193,7 @@ void RENDER_3D_RAYTRACE_BASE::addPadsAndVias()
}
void RENDER_3D_RAYTRACE_BASE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMaterialInformation )
void RENDER_3D_RAYTRACE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMaterialInformation )
{
if( !m_boardAdapter.GetBoard() )
return;
@@ -1315,7 +1315,7 @@ void RENDER_3D_RAYTRACE_BASE::load3DModels( CONTAINER_3D& aDstContainer, bool aS
}
MODEL_MATERIALS* RENDER_3D_RAYTRACE_BASE::getModelMaterial( const S3DMODEL* a3DModel )
MODEL_MATERIALS* RENDER_3D_RAYTRACE::getModelMaterial( const S3DMODEL* a3DModel )
{
MODEL_MATERIALS* materialVector;
@@ -1418,7 +1418,7 @@ MODEL_MATERIALS* RENDER_3D_RAYTRACE_BASE::getModelMaterial( const S3DMODEL* a3DM
}
void RENDER_3D_RAYTRACE_BASE::addModels( CONTAINER_3D& aDstContainer, const S3DMODEL* a3DModel,
void RENDER_3D_RAYTRACE::addModels( CONTAINER_3D& aDstContainer, const S3DMODEL* a3DModel,
const glm::mat4& aModelMatrix, float aFPOpacity,
bool aSkipMaterialInformation, BOARD_ITEM* aBoardItem )
{
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -22,28 +22,32 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <gal/opengl/kiglew.h> // Must be included first
#include <algorithm>
#include <atomic>
#include <chrono>
#include <thread>
#include "render_3d_raytrace_base.h"
#include "render_3d_raytrace.h"
#include "mortoncodes.h"
#include "../color_rgba.h"
#include "../color_rgb.h"
#include "3d_fastmath.h"
#include "3d_math.h"
#include "../common_ogl/ogl_utils.h"
#include <core/profile.h> // To use GetRunningMicroSecs or another profiling utility
#include <wx/log.h>
RENDER_3D_RAYTRACE_BASE::RENDER_3D_RAYTRACE_BASE( BOARD_ADAPTER& aAdapter, CAMERA& aCamera ) :
RENDER_3D_BASE( aAdapter, aCamera ),
m_postShaderSsao( aCamera )
RENDER_3D_RAYTRACE::RENDER_3D_RAYTRACE( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera ) :
RENDER_3D_BASE( aCanvas, aAdapter, aCamera ),
m_postShaderSsao( aCamera )
{
wxLogTrace( m_logTrace, wxT( "RENDER_3D_RAYTRACE_BASE::RENDER_3D_RAYTRACE_BASE" ) );
wxLogTrace( m_logTrace, wxT( "RENDER_3D_RAYTRACE::RENDER_3D_RAYTRACE" ) );
//m_pboId = GL_NONE;
//m_pboDataSize = 0;
m_openglSupportsVertexBufferObjects = false;
m_pboId = GL_NONE;
m_pboDataSize = 0;
m_accelerator = nullptr;
m_convertedDummyBlockCount = 0;
m_converted2dRoundSegmentCount = 0;
@@ -58,7 +62,6 @@ RENDER_3D_RAYTRACE_BASE::RENDER_3D_RAYTRACE_BASE( BOARD_ADAPTER& aAdapter, CAMER
m_xoffset = 0;
m_yoffset = 0;
m_is_canvas_initialized = false;
m_isPreview = false;
m_renderState = RT_RENDER_STATE_MAX; // Set to an initial invalid state
m_renderStartTime = 0;
@@ -66,9 +69,9 @@ RENDER_3D_RAYTRACE_BASE::RENDER_3D_RAYTRACE_BASE( BOARD_ADAPTER& aAdapter, CAMER
}
RENDER_3D_RAYTRACE_BASE::~RENDER_3D_RAYTRACE_BASE()
RENDER_3D_RAYTRACE::~RENDER_3D_RAYTRACE()
{
wxLogTrace( m_logTrace, wxT( "RENDER_3D_RAYTRACE_BASE::~RENDER_3D_RAYTRACE_BASE" ) );
wxLogTrace( m_logTrace, wxT( "RENDER_3D_RAYTRACE::~RENDER_3D_RAYTRACE" ) );
delete m_accelerator;
m_accelerator = nullptr;
@@ -81,16 +84,43 @@ RENDER_3D_RAYTRACE_BASE::~RENDER_3D_RAYTRACE_BASE()
delete[] m_shaderBuffer;
m_shaderBuffer = nullptr;
deletePbo();
}
int RENDER_3D_RAYTRACE_BASE::GetWaitForEditingTimeOut()
int RENDER_3D_RAYTRACE::GetWaitForEditingTimeOut()
{
return 200; // ms
}
void RENDER_3D_RAYTRACE_BASE::restartRenderState()
void RENDER_3D_RAYTRACE::deletePbo()
{
// Delete PBO if it was created
if( m_openglSupportsVertexBufferObjects )
{
if( glIsBufferARB( m_pboId ) )
glDeleteBuffers( 1, &m_pboId );
m_pboId = GL_NONE;
}
}
void RENDER_3D_RAYTRACE::SetCurWindowSize( const wxSize& aSize )
{
if( m_windowSize != aSize )
{
m_windowSize = aSize;
glViewport( 0, 0, m_windowSize.x, m_windowSize.y );
initializeNewWindowSize();
}
}
void RENDER_3D_RAYTRACE::restartRenderState()
{
m_renderStartTime = GetRunningMicroSecs();
@@ -106,22 +136,154 @@ void RENDER_3D_RAYTRACE_BASE::restartRenderState()
}
static inline void SetPixel( GLubyte* p, const COLOR_RGBA& v )
static inline void SetPixel( GLubyte* p, const COLOR_RGB& v )
{
p[0] = v.c[0];
p[1] = v.c[1];
p[2] = v.c[2];
p[3] = v.c[3];
p[3] = 255;
}
SFVEC4F RENDER_3D_RAYTRACE_BASE::premultiplyAlpha( const SFVEC4F& aInput )
bool RENDER_3D_RAYTRACE::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
REPORTER* aWarningReporter )
{
return SFVEC4F( aInput.r * aInput.a, aInput.g * aInput.a, aInput.b * aInput.a, aInput.a );
bool requestRedraw = false;
// Initialize openGL if need
if( !m_is_opengl_initialized )
{
if( !initializeOpenGL() )
return false;
//aIsMoving = true;
requestRedraw = true;
// It will assign the first time the windows size, so it will now
// revert to preview mode the first time the Redraw is called
m_oldWindowsSize = m_windowSize;
initializeBlockPositions();
}
std::unique_ptr<BUSY_INDICATOR> busy = CreateBusyIndicator();
// Reload board if it was requested
if( m_reloadRequested )
{
if( aStatusReporter )
aStatusReporter->Report( _( "Loading..." ) );
//aIsMoving = true;
requestRedraw = true;
Reload( aStatusReporter, aWarningReporter, false );
}
// Recalculate constants if windows size was changed
if( m_windowSize != m_oldWindowsSize )
{
m_oldWindowsSize = m_windowSize;
aIsMoving = true;
requestRedraw = true;
initializeBlockPositions();
}
// Clear buffers
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
glClearDepth( 1.0f );
glClearStencil( 0x00 );
glClear( GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
// 4-byte pixel alignment
glPixelStorei( GL_UNPACK_ALIGNMENT, 4 );
glDisable( GL_STENCIL_TEST );
glDisable( GL_LIGHTING );
glDisable( GL_COLOR_MATERIAL );
glDisable( GL_DEPTH_TEST );
glDisable( GL_TEXTURE_2D );
glDisable( GL_BLEND );
glDisable( GL_MULTISAMPLE );
const bool was_camera_changed = m_camera.ParametersChanged();
if( requestRedraw || aIsMoving || was_camera_changed )
m_renderState = RT_RENDER_STATE_MAX; // Set to an invalid state,
// so it will restart again latter
// This will only render if need, otherwise it will redraw the PBO on the screen again
if( aIsMoving || was_camera_changed )
{
// Set head light (camera view light) with the opposite direction of the camera
if( m_cameraLight )
m_cameraLight->SetDirection( -m_camera.GetDir() );
OglDrawBackground( SFVEC3F( m_boardAdapter.m_BgColorTop),
SFVEC3F( m_boardAdapter.m_BgColorBot) );
// Bind PBO
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_pboId );
// Get the PBO pixel pointer to write the data
GLubyte* ptrPBO = (GLubyte *)glMapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB,
GL_WRITE_ONLY_ARB );
if( ptrPBO )
{
renderPreview( ptrPBO );
// release pointer to mapping buffer, this initialize the coping to PBO
glUnmapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB );
}
glWindowPos2i( m_xoffset, m_yoffset );
}
else
{
// Bind PBO
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_pboId );
if( m_renderState != RT_RENDER_STATE_FINISH )
{
// Get the PBO pixel pointer to write the data
GLubyte* ptrPBO = (GLubyte *)glMapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB,
GL_WRITE_ONLY_ARB );
if( ptrPBO )
{
render( ptrPBO, aStatusReporter );
if( m_renderState != RT_RENDER_STATE_FINISH )
requestRedraw = true;
// release pointer to mapping buffer, this initialize the coping to PBO
glUnmapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB );
}
}
if( m_renderState == RT_RENDER_STATE_FINISH )
{
glClear( GL_COLOR_BUFFER_BIT );
}
glWindowPos2i( m_xoffset, m_yoffset );
}
// This way it will blend the progress rendering with the last buffer. eg:
// if it was called after a openGL.
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glEnable( GL_ALPHA_TEST );
glDrawPixels( m_realBufferSize.x, m_realBufferSize.y, GL_RGBA, GL_UNSIGNED_BYTE, 0 );
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, 0 );
return requestRedraw;
}
void RENDER_3D_RAYTRACE_BASE::render( GLubyte* ptrPBO, REPORTER* aStatusReporter )
void RENDER_3D_RAYTRACE::render( GLubyte* ptrPBO, REPORTER* aStatusReporter )
{
if( ( m_renderState == RT_RENDER_STATE_FINISH ) || ( m_renderState >= RT_RENDER_STATE_MAX ) )
{
@@ -145,10 +307,8 @@ void RENDER_3D_RAYTRACE_BASE::render( GLubyte* ptrPBO, REPORTER* aStatusReporter
}
}
m_backgroundColorTop =
ConvertSRGBAToLinear( premultiplyAlpha( m_boardAdapter.m_BgColorTop ) );
m_backgroundColorBottom =
ConvertSRGBAToLinear( premultiplyAlpha( m_boardAdapter.m_BgColorBot ) );
m_backgroundColorTop = ConvertSRGBToLinear( (SFVEC3F)m_boardAdapter.m_BgColorTop );
m_backgroundColorBottom = ConvertSRGBToLinear( (SFVEC3F)m_boardAdapter.m_BgColorBot );
}
switch( m_renderState )
@@ -174,14 +334,14 @@ void RENDER_3D_RAYTRACE_BASE::render( GLubyte* ptrPBO, REPORTER* aStatusReporter
if( aStatusReporter && ( m_renderState == RT_RENDER_STATE_FINISH ) )
{
// Calculation time in seconds
const double elapsed_time = (double) ( GetRunningMicroSecs() - m_renderStartTime ) / 1e6;
const double elapsed_time = (double)( GetRunningMicroSecs() - m_renderStartTime ) / 1e6;
aStatusReporter->Report( wxString::Format( _( "Rendering time %.3f s" ), elapsed_time ) );
}
}
void RENDER_3D_RAYTRACE_BASE::renderTracing( GLubyte* ptrPBO, REPORTER* aStatusReporter )
void RENDER_3D_RAYTRACE::renderTracing( GLubyte* ptrPBO, REPORTER* aStatusReporter )
{
m_isPreview = false;
@@ -196,8 +356,6 @@ void RENDER_3D_RAYTRACE_BASE::renderTracing( GLubyte* ptrPBO, REPORTER* aStatusR
std::max<size_t>( std::thread::hardware_concurrency(), 2 ),
m_blockPositions.size() );
const int timeLimit = m_blockPositions.size() > 40000 ? 500 : 200;
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
{
std::thread t = std::thread( [&]()
@@ -214,10 +372,8 @@ void RENDER_3D_RAYTRACE_BASE::renderTracing( GLubyte* ptrPBO, REPORTER* aStatusR
// Check if it spend already some time render and request to exit
// to display the progress
auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now() - startTime );
if( diff.count() > timeLimit )
if( std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now() - startTime ).count() > 150 )
breakLoop = true;
}
}
@@ -268,11 +424,6 @@ static SFVEC3F convertLinearToSRGB( const SFVEC3F& aRGBcolor )
glm::lessThan( clampedColor, SFVEC3F(0.0031308f) ) );
}
static SFVEC4F convertLinearToSRGBA( const SFVEC4F& aRGBAcolor )
{
return SFVEC4F( convertLinearToSRGB( SFVEC3F( aRGBAcolor ) ), aRGBAcolor.a );
}
// This function implements the conversion from sRGB to linear RGB
// https://github.com/g-truc/glm/blob/master/glm/gtc/color_space.inl#L35
@@ -287,18 +438,13 @@ SFVEC3F ConvertSRGBToLinear( const SFVEC3F& aSRGBcolor )
glm::lessThanEqual( aSRGBcolor, SFVEC3F( 0.04045f ) ) );
}
SFVEC4F ConvertSRGBAToLinear( const SFVEC4F& aSRGBAcolor )
{
return SFVEC4F( ConvertSRGBToLinear( SFVEC3F( aSRGBAcolor ) ), aSRGBAcolor.a );
}
#endif
void RENDER_3D_RAYTRACE_BASE::renderFinalColor( GLubyte* ptrPBO, const SFVEC4F& rgbColor,
void RENDER_3D_RAYTRACE::renderFinalColor( GLubyte* ptrPBO, const SFVEC3F& rgbColor,
bool applyColorSpaceConversion )
{
SFVEC4F color = rgbColor;
SFVEC3F color = rgbColor;
#ifdef USE_SRGB_SPACE
/// @note This should be used in future when the KiCad support a greater version of glm lib.
@@ -312,7 +458,7 @@ void RENDER_3D_RAYTRACE_BASE::renderFinalColor( GLubyte* ptrPBO, const SFVEC4F&
ptrPBO[0] = (unsigned int) glm::clamp( (int) ( color.r * 255 ), 0, 255 );
ptrPBO[1] = (unsigned int) glm::clamp( (int) ( color.g * 255 ), 0, 255 );
ptrPBO[2] = (unsigned int) glm::clamp( (int) ( color.b * 255 ), 0, 255 );
ptrPBO[3] = (unsigned int) glm::clamp( (int) ( color.a * 255 ), 0, 255 );
ptrPBO[3] = 255;
}
@@ -330,9 +476,9 @@ static void HITINFO_PACKET_init( HITINFO_PACKET* aHitPacket )
}
void RENDER_3D_RAYTRACE_BASE::renderRayPackets( const SFVEC4F* bgColorY, const RAY* aRayPkt,
void RENDER_3D_RAYTRACE::renderRayPackets( const SFVEC3F* bgColorY, const RAY* aRayPkt,
HITINFO_PACKET* aHitPacket, bool is_testShadow,
SFVEC4F* aOutHitColor )
SFVEC3F* aOutHitColor )
{
for( unsigned int y = 0, i = 0; y < RAYPACKET_DIM; ++y )
{
@@ -352,10 +498,10 @@ void RENDER_3D_RAYTRACE_BASE::renderRayPackets( const SFVEC4F* bgColorY, const R
}
void RENDER_3D_RAYTRACE_BASE::renderAntiAliasPackets( const SFVEC4F* aBgColorY,
void RENDER_3D_RAYTRACE::renderAntiAliasPackets( const SFVEC3F* aBgColorY,
const HITINFO_PACKET* aHitPck_X0Y0,
const HITINFO_PACKET* aHitPck_AA_X1Y1,
const RAY* aRayPck, SFVEC4F* aOutHitColor )
const RAY* aRayPck, SFVEC3F* aOutHitColor )
{
const bool is_testShadow = m_boardAdapter.m_Cfg->m_Render.raytrace_shadows;
@@ -476,7 +622,7 @@ void RENDER_3D_RAYTRACE_BASE::renderAntiAliasPackets( const SFVEC4F* aBgColorY,
#define DISP_FACTOR 0.075f
void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iBlock )
void RENDER_3D_RAYTRACE::renderBlockTracing( GLubyte* ptrPBO, signed int iBlock )
{
// Initialize ray packets
const SFVEC2UI& blockPos = m_blockPositions[iBlock];
@@ -491,14 +637,14 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
HITINFO_PACKET_init( hitPacket_X0Y0 );
// Calculate background gradient color
SFVEC4F bgColor[RAYPACKET_DIM];// Store a vertical gradient color
SFVEC3F bgColor[RAYPACKET_DIM];// Store a vertical gradient color
for( unsigned int y = 0; y < RAYPACKET_DIM; ++y )
{
const float posYfactor = (float) ( blockPosI.y + y ) / (float) m_windowSize.y;
bgColor[y] = m_backgroundColorTop * SFVEC4F(posYfactor) +
m_backgroundColorBottom * ( SFVEC4F(1.0f) - SFVEC4F(posYfactor) );
bgColor[y] = m_backgroundColorTop * SFVEC3F(posYfactor) +
m_backgroundColorBottom * ( SFVEC3F(1.0f) - SFVEC3F(posYfactor) );
}
// Intersect ray packets (calculate the intersection with rays and objects)
@@ -509,7 +655,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
{
for( unsigned int y = 0; y < RAYPACKET_DIM; ++y )
{
const SFVEC4F& outColor = bgColor[y];
const SFVEC3F& outColor = bgColor[y];
const unsigned int yBlockPos = blockPos.y + y;
@@ -529,7 +675,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
for( unsigned int y = 0; y < RAYPACKET_DIM; ++y )
{
const SFVEC4F& outColor = bgColor[y];
const SFVEC3F& outColor = bgColor[y];
const unsigned int yConst = blockPos.x + ( ( y + blockPos.y ) * m_realBufferSize.x );
@@ -546,7 +692,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
return;
}
SFVEC4F hitColor_X0Y0[RAYPACKET_RAYS_PER_PACKET];
SFVEC3F hitColor_X0Y0[RAYPACKET_RAYS_PER_PACKET];
// Shade original (0, 0) hits ("paint" the intersected objects)
renderRayPackets( bgColor, blockPacket.m_ray, hitPacket_X0Y0,
@@ -554,7 +700,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
if( m_boardAdapter.m_Cfg->m_Render.raytrace_anti_aliasing )
{
SFVEC4F hitColor_AA_X1Y1[RAYPACKET_RAYS_PER_PACKET];
SFVEC3F hitColor_AA_X1Y1[RAYPACKET_RAYS_PER_PACKET];
// Intersect one blockPosI + (0.5, 0.5) used for anti aliasing calculation
HITINFO_PACKET hitPacket_AA_X1Y1[RAYPACKET_RAYS_PER_PACKET];
@@ -568,7 +714,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
// Missed all the package
for( unsigned int y = 0, i = 0; y < RAYPACKET_DIM; ++y )
{
const SFVEC4F& outColor = bgColor[y];
const SFVEC3F& outColor = bgColor[y];
for( unsigned int x = 0; x < RAYPACKET_DIM; ++x, ++i )
hitColor_AA_X1Y1[i] = outColor;
@@ -580,13 +726,13 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
m_boardAdapter.m_Cfg->m_Render.raytrace_shadows, hitColor_AA_X1Y1 );
}
SFVEC4F hitColor_AA_X1Y0[RAYPACKET_RAYS_PER_PACKET];
SFVEC4F hitColor_AA_X0Y1[RAYPACKET_RAYS_PER_PACKET];
SFVEC4F hitColor_AA_X0Y1_half[RAYPACKET_RAYS_PER_PACKET];
SFVEC3F hitColor_AA_X1Y0[RAYPACKET_RAYS_PER_PACKET];
SFVEC3F hitColor_AA_X0Y1[RAYPACKET_RAYS_PER_PACKET];
SFVEC3F hitColor_AA_X0Y1_half[RAYPACKET_RAYS_PER_PACKET];
for( unsigned int i = 0; i < RAYPACKET_RAYS_PER_PACKET; ++i )
{
SFVEC4F color_average = ( hitColor_X0Y0[i] + hitColor_AA_X1Y1[i] ) * SFVEC4F( 0.5f );
SFVEC3F color_average = ( hitColor_X0Y0[i] + hitColor_AA_X1Y1[i] ) * SFVEC3F( 0.5f );
hitColor_AA_X1Y0[i] = color_average;
hitColor_AA_X0Y1[i] = color_average;
@@ -623,7 +769,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
{
hitColor_X0Y0[i] = ( hitColor_X0Y0[i] + hitColor_AA_X1Y1[i] + hitColor_AA_X1Y0[i] +
hitColor_AA_X0Y1[i] + hitColor_AA_X0Y1_half[i] ) *
SFVEC4F( 1.0f / 5.0f );
SFVEC3F( 1.0f / 5.0f );
}
}
@@ -643,7 +789,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
for( unsigned int x = 0; x < RAYPACKET_DIM; ++x, ++i )
{
const SFVEC4F& hColor = hitColor_X0Y0[i];
const SFVEC3F& hColor = hitColor_X0Y0[i];
if( hitPacket_X0Y0[i].m_hitresult == true )
{
@@ -687,7 +833,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( GLubyte* ptrPBO, signed int iB
}
void RENDER_3D_RAYTRACE_BASE::postProcessShading( GLubyte* /* ptrPBO */, REPORTER* aStatusReporter )
void RENDER_3D_RAYTRACE::postProcessShading( GLubyte* /* ptrPBO */, REPORTER* aStatusReporter )
{
if( m_boardAdapter.m_Cfg->m_Render.raytrace_post_processing )
{
@@ -739,7 +885,7 @@ void RENDER_3D_RAYTRACE_BASE::postProcessShading( GLubyte* /* ptrPBO */, REPORTE
}
void RENDER_3D_RAYTRACE_BASE::postProcessBlurFinish( GLubyte* ptrPBO, REPORTER* /* aStatusReporter */ )
void RENDER_3D_RAYTRACE::postProcessBlurFinish( GLubyte* ptrPBO, REPORTER* /* aStatusReporter */ )
{
if( m_boardAdapter.m_Cfg->m_Render.raytrace_post_processing )
{
@@ -763,13 +909,13 @@ void RENDER_3D_RAYTRACE_BASE::postProcessBlurFinish( GLubyte* ptrPBO, REPORTER*
const SFVEC3F bluredShadeColor = m_postShaderSsao.Blur( SFVEC2I( x, y ) );
#ifdef USE_SRGB_SPACE
const SFVEC4F originColor = convertLinearToSRGBA(
const SFVEC3F originColor = convertLinearToSRGB(
m_postShaderSsao.GetColorAtNotProtected( SFVEC2I( x, y ) ) );
#else
const SFVEC4F originColor =
const SFVEC3F originColor =
m_postShaderSsao.GetColorAtNotProtected( SFVEC2I( x, y ) );
#endif
const SFVEC4F shadedColor = m_postShaderSsao.ApplyShadeColor(
const SFVEC3F shadedColor = m_postShaderSsao.ApplyShadeColor(
SFVEC2I( x, y ), originColor, bluredShadeColor );
renderFinalColor( ptr, shadedColor, false );
@@ -796,7 +942,7 @@ void RENDER_3D_RAYTRACE_BASE::postProcessBlurFinish( GLubyte* ptrPBO, REPORTER*
}
void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
void RENDER_3D_RAYTRACE::renderPreview( GLubyte* ptrPBO )
{
m_isPreview = true;
@@ -834,47 +980,45 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
m_accelerator->Intersect( blockPacket, hitPacket );
// Calculate background gradient color
SFVEC4F bgColor[RAYPACKET_DIM];
SFVEC4F bgTopColor = premultiplyAlpha( m_boardAdapter.m_BgColorTop );
SFVEC4F bgBotColor = premultiplyAlpha( m_boardAdapter.m_BgColorBot );
SFVEC3F bgColor[RAYPACKET_DIM];
for( unsigned int y = 0; y < RAYPACKET_DIM; ++y )
{
const float posYfactor =
(float) ( windowsPos.y + y * 4.0f ) / (float) m_windowSize.y;
bgColor[y] = bgTopColor * SFVEC4F( posYfactor )
+ bgBotColor * ( SFVEC4F( 1.0f ) - SFVEC4F( posYfactor ) );
bgColor[y] = (SFVEC3F) m_boardAdapter.m_BgColorTop * SFVEC3F( posYfactor )
+ (SFVEC3F) m_boardAdapter.m_BgColorBot
* ( SFVEC3F( 1.0f ) - SFVEC3F( posYfactor ) );
}
COLOR_RGBA hitColorShading[RAYPACKET_RAYS_PER_PACKET];
COLOR_RGB hitColorShading[RAYPACKET_RAYS_PER_PACKET];
for( unsigned int i = 0; i < RAYPACKET_RAYS_PER_PACKET; ++i )
{
const SFVEC4F bhColorY = bgColor[i / RAYPACKET_DIM];
const SFVEC3F bhColorY = bgColor[i / RAYPACKET_DIM];
if( hitPacket[i].m_hitresult == true )
{
const SFVEC4F hitColor = shadeHit( bhColorY, blockPacket.m_ray[i],
const SFVEC3F hitColor = shadeHit( bhColorY, blockPacket.m_ray[i],
hitPacket[i].m_HitInfo, false,
0, false );
hitColorShading[i] = COLOR_RGBA( hitColor );
hitColorShading[i] = COLOR_RGB( hitColor );
}
else
hitColorShading[i] = bhColorY;
}
COLOR_RGBA cLRB_old[(RAYPACKET_DIM - 1)];
COLOR_RGB cLRB_old[(RAYPACKET_DIM - 1)];
for( unsigned int y = 0; y < (RAYPACKET_DIM - 1); ++y )
{
const SFVEC4F bgColorY = bgColor[y];
const COLOR_RGBA bgColorYRGB = COLOR_RGBA( bgColorY );
const SFVEC3F bgColorY = bgColor[y];
const COLOR_RGB bgColorYRGB = COLOR_RGB( bgColorY );
// This stores cRTB from the last block to be reused next time in a cLTB pixel
COLOR_RGBA cRTB_old;
COLOR_RGB cRTB_old;
//RAY cRTB_ray;
//HITINFO cRTB_hitInfo;
@@ -897,13 +1041,13 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
const unsigned int iRB = ( ( x + 1 ) + RAYPACKET_DIM * ( y + 1 ) );
// !TODO: skip when there are no hits
const COLOR_RGBA& cLT = hitColorShading[ iLT ];
const COLOR_RGBA& cRT = hitColorShading[ iRT ];
const COLOR_RGBA& cLB = hitColorShading[ iLB ];
const COLOR_RGBA& cRB = hitColorShading[ iRB ];
const COLOR_RGB& cLT = hitColorShading[ iLT ];
const COLOR_RGB& cRT = hitColorShading[ iRT ];
const COLOR_RGB& cLB = hitColorShading[ iLB ];
const COLOR_RGB& cRB = hitColorShading[ iRB ];
// Trace and shade cC
COLOR_RGBA cC = bgColorYRGB;
COLOR_RGB cC = bgColorYRGB;
const SFVEC3F& oriLT = blockPacket.m_ray[ iLT ].m_Origin;
const SFVEC3F& oriRB = blockPacket.m_ray[ iRB ].m_Origin;
@@ -955,7 +1099,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
if( hittedC )
{
cC = COLOR_RGBA( shadeHit( bgColorY, centerRay, centerHitInfo,
cC = COLOR_RGB( shadeHit( bgColorY, centerRay, centerHitInfo,
false, 0, false ) );
}
else
@@ -964,13 +1108,13 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
hittedC = m_accelerator->Intersect( centerRay, centerHitInfo );
if( hittedC )
cC = COLOR_RGBA( shadeHit( bgColorY, centerRay, centerHitInfo,
cC = COLOR_RGB( shadeHit( bgColorY, centerRay, centerHitInfo,
false, 0, false ) );
}
}
// Trace and shade cLRT
COLOR_RGBA cLRT = bgColorYRGB;
COLOR_RGB cLRT = bgColorYRGB;
const SFVEC3F& oriRT = blockPacket.m_ray[ iRT ].m_Origin;
const SFVEC3F& dirRT = blockPacket.m_ray[ iRT ].m_Dir;
@@ -996,7 +1140,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
glm::normalize( ( hitPacket[ iLT ].m_HitInfo.m_HitNormal +
hitPacket[ iRT ].m_HitInfo.m_HitNormal ) * 0.5f );
cLRT = COLOR_RGBA( shadeHit( bgColorY, rayLRT, hitInfoLRT, false,
cLRT = COLOR_RGB( shadeHit( bgColorY, rayLRT, hitInfoLRT, false,
0, false ) );
cLRT = BlendColor( cLRT, BlendColor( cLT, cRT ) );
}
@@ -1021,14 +1165,14 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
nodeRT );
if( hittedLRT )
cLRT = COLOR_RGBA( shadeHit( bgColorY, rayLRT, hitInfoLRT,
cLRT = COLOR_RGB( shadeHit( bgColorY, rayLRT, hitInfoLRT,
false, 0, false ) );
else
{
hitInfoLRT.m_tHit = std::numeric_limits<float>::infinity();
if( m_accelerator->Intersect( rayLRT,hitInfoLRT ) )
cLRT = COLOR_RGBA( shadeHit( bgColorY, rayLRT,
cLRT = COLOR_RGB( shadeHit( bgColorY, rayLRT,
hitInfoLRT, false,
0, false ) );
}
@@ -1041,7 +1185,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
}
// Trace and shade cLTB
COLOR_RGBA cLTB = bgColorYRGB;
COLOR_RGB cLTB = bgColorYRGB;
if( x == 0 )
{
@@ -1066,7 +1210,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
hitInfoLTB.m_HitNormal =
glm::normalize( ( hitPacket[ iLT ].m_HitInfo.m_HitNormal +
hitPacket[ iLB ].m_HitInfo.m_HitNormal ) * 0.5f );
cLTB = COLOR_RGBA( shadeHit( bgColorY, rayLTB, hitInfoLTB, false,
cLTB = COLOR_RGB( shadeHit( bgColorY, rayLTB, hitInfoLTB, false,
0, false ) );
cLTB = BlendColor( cLTB, BlendColor( cLT, cLB) );
}
@@ -1091,14 +1235,14 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
nodeLB );
if( hittedLTB )
cLTB = COLOR_RGBA( shadeHit( bgColorY, rayLTB, hitInfoLTB,
cLTB = COLOR_RGB( shadeHit( bgColorY, rayLTB, hitInfoLTB,
false, 0, false ) );
else
{
hitInfoLTB.m_tHit = std::numeric_limits<float>::infinity();
if( m_accelerator->Intersect( rayLTB, hitInfoLTB ) )
cLTB = COLOR_RGBA( shadeHit( bgColorY, rayLTB,
cLTB = COLOR_RGB( shadeHit( bgColorY, rayLTB,
hitInfoLTB, false,
0, false ) );
}
@@ -1111,7 +1255,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
}
// Trace and shade cRTB
COLOR_RGBA cRTB = bgColorYRGB;
COLOR_RGB cRTB = bgColorYRGB;
// Trace the center ray
RAY rayRTB;
@@ -1134,7 +1278,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
glm::normalize( ( hitPacket[ iRT ].m_HitInfo.m_HitNormal +
hitPacket[ iRB ].m_HitInfo.m_HitNormal ) * 0.5f );
cRTB = COLOR_RGBA( shadeHit( bgColorY, rayRTB, hitInfoRTB, false, 0,
cRTB = COLOR_RGB( shadeHit( bgColorY, rayRTB, hitInfoRTB, false, 0,
false ) );
cRTB = BlendColor( cRTB, BlendColor( cRT, cRB ) );
}
@@ -1160,7 +1304,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
if( hittedRTB )
{
cRTB = COLOR_RGBA( shadeHit( bgColorY, rayRTB, hitInfoRTB,
cRTB = COLOR_RGB( shadeHit( bgColorY, rayRTB, hitInfoRTB,
false, 0, false) );
}
else
@@ -1168,7 +1312,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
hitInfoRTB.m_tHit = std::numeric_limits<float>::infinity();
if( m_accelerator->Intersect( rayRTB, hitInfoRTB ) )
cRTB = COLOR_RGBA( shadeHit( bgColorY, rayRTB, hitInfoRTB,
cRTB = COLOR_RGB( shadeHit( bgColorY, rayRTB, hitInfoRTB,
false, 0, false ) );
}
}
@@ -1177,7 +1321,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
cRTB_old = cRTB;
// Trace and shade cLRB
COLOR_RGBA cLRB = bgColorYRGB;
COLOR_RGB cLRB = bgColorYRGB;
const SFVEC3F& oriLB = blockPacket.m_ray[ iLB ].m_Origin;
const SFVEC3F& dirLB = blockPacket.m_ray[ iLB ].m_Dir;
@@ -1203,7 +1347,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
glm::normalize( ( hitPacket[ iLB ].m_HitInfo.m_HitNormal +
hitPacket[ iRB ].m_HitInfo.m_HitNormal ) * 0.5f );
cLRB = COLOR_RGBA( shadeHit( bgColorY, rayLRB, hitInfoLRB, false, 0,
cLRB = COLOR_RGB( shadeHit( bgColorY, rayLRB, hitInfoLRB, false, 0,
false ) );
cLRB = BlendColor( cLRB, BlendColor( cLB, cRB ) );
}
@@ -1229,7 +1373,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
if( hittedLRB )
{
cLRB = COLOR_RGBA( shadeHit( bgColorY, rayLRB, hitInfoLRB,
cLRB = COLOR_RGB( shadeHit( bgColorY, rayLRB, hitInfoLRB,
false, 0, false ) );
}
else
@@ -1237,7 +1381,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
hitInfoLRB.m_tHit = std::numeric_limits<float>::infinity();
if( m_accelerator->Intersect( rayLRB, hitInfoLRB ) )
cLRB = COLOR_RGBA( shadeHit( bgColorY, rayLRB, hitInfoLRB,
cLRB = COLOR_RGB( shadeHit( bgColorY, rayLRB, hitInfoLRB,
false, 0, false ) );
}
}
@@ -1246,7 +1390,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
cLRB_old[x] = cLRB;
// Trace and shade cLTC
COLOR_RGBA cLTC = BlendColor( cLT , cC );
COLOR_RGB cLTC = BlendColor( cLT , cC );
if( hitPacket[ iLT ].m_hitresult || hittedC )
{
@@ -1268,12 +1412,12 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
hitInfoLTC );
if( hitted )
cLTC = COLOR_RGBA( shadeHit( bgColorY, rayLTC, hitInfoLTC, false,
cLTC = COLOR_RGB( shadeHit( bgColorY, rayLTC, hitInfoLTC, false,
0, false ) );
}
// Trace and shade cRTC
COLOR_RGBA cRTC = BlendColor( cRT , cC );
COLOR_RGB cRTC = BlendColor( cRT , cC );
if( hitPacket[ iRT ].m_hitresult || hittedC )
{
@@ -1294,12 +1438,12 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
hitInfoRTC );
if( hitted )
cRTC = COLOR_RGBA( shadeHit( bgColorY, rayRTC, hitInfoRTC, false,
cRTC = COLOR_RGB( shadeHit( bgColorY, rayRTC, hitInfoRTC, false,
0, false ) );
}
// Trace and shade cLBC
COLOR_RGBA cLBC = BlendColor( cLB , cC );
COLOR_RGB cLBC = BlendColor( cLB , cC );
if( hitPacket[ iLB ].m_hitresult || hittedC )
{
@@ -1320,12 +1464,12 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
hitInfoLBC );
if( hitted )
cLBC = COLOR_RGBA( shadeHit( bgColorY, rayLBC, hitInfoLBC, false,
cLBC = COLOR_RGB( shadeHit( bgColorY, rayLBC, hitInfoLBC, false,
0, false ) );
}
// Trace and shade cRBC
COLOR_RGBA cRBC = BlendColor( cRB , cC );
COLOR_RGB cRBC = BlendColor( cRB , cC );
if( hitPacket[ iRB ].m_hitresult || hittedC )
{
@@ -1346,7 +1490,7 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
hitInfoRBC );
if( hitted )
cRBC = COLOR_RGBA( shadeHit( bgColorY, rayRBC, hitInfoRBC, false,
cRBC = COLOR_RGB( shadeHit( bgColorY, rayRBC, hitInfoRBC, false,
0, false ) );
}
@@ -1394,15 +1538,14 @@ void RENDER_3D_RAYTRACE_BASE::renderPreview( GLubyte* ptrPBO )
#define USE_EXPERIMENTAL_SOFT_SHADOWS 1
SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& aRay, HITINFO& aHitInfo,
SFVEC3F RENDER_3D_RAYTRACE::shadeHit( const SFVEC3F& aBgColor, const RAY& aRay, HITINFO& aHitInfo,
bool aIsInsideObject, unsigned int aRecursiveLevel,
bool is_testShadow ) const
{
const MATERIAL* objMaterial = aHitInfo.pHitObject->GetMaterial();
wxASSERT( objMaterial != nullptr );
SFVEC4F outColor =
SFVEC4F( objMaterial->GetEmissiveColor() + objMaterial->GetAmbientColor(), 1.0f );
SFVEC3F outColor = objMaterial->GetEmissiveColor() + objMaterial->GetAmbientColor();
if( aRecursiveLevel > 7 )
return outColor;
@@ -1411,8 +1554,7 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
hitPoint += aHitInfo.m_HitNormal * m_boardAdapter.GetNonCopperLayerThickness() * 0.6f;
const SFVEC4F diffuseColorObj =
SFVEC4F( aHitInfo.pHitObject->GetDiffuseColor( aHitInfo ), 1.0f );
const SFVEC3F diffuseColorObj = aHitInfo.pHitObject->GetDiffuseColor( aHitInfo );
#if USE_EXPERIMENTAL_SOFT_SHADOWS
bool is_aa_enabled = m_boardAdapter.m_Cfg->m_Render.raytrace_anti_aliasing && !m_isPreview;
@@ -1496,10 +1638,8 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
shadow_att_factor_sum += shadow_att_factor_light;
}
outColor += SFVEC4F( objMaterial->Shade( aRay, aHitInfo, NdotL, diffuseColorObj,
vectorToLight, colorOfLight,
shadow_att_factor_light ),
1.0 );
outColor += objMaterial->Shade( aRay, aHitInfo, NdotL, diffuseColorObj, vectorToLight,
colorOfLight, shadow_att_factor_light );
}
// Only use the headlight for preview
@@ -1519,7 +1659,7 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
}
// Clamp color to not be brighter than 1.0f
outColor = glm::min( outColor, SFVEC4F( 1.0f ) );
outColor = glm::min( outColor, SFVEC3F( 1.0f ) );
if( !m_isPreview )
{
@@ -1531,7 +1671,7 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
const unsigned int reflection_number_of_samples =
objMaterial->GetReflectionRayCount();
SFVEC4F sum_color = SFVEC4F( 0.0f );
SFVEC3F sum_color = SFVEC3F( 0.0f );
const SFVEC3F reflectVector = aRay.m_Dir - 2.0f *
glm::dot( aRay.m_Dir, aHitInfo.m_HitNormal ) * aHitInfo.m_HitNormal;
@@ -1560,19 +1700,17 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
if( m_accelerator->Intersect( reflectedRay, reflectedHit ) )
{
SFVEC4F add = ( diffuseColorObj + SFVEC4F( objMaterial->GetSpecularColor(), 1.0f ) ) *
sum_color += ( diffuseColorObj + objMaterial->GetSpecularColor() ) *
shadeHit( aBgColor, reflectedRay, reflectedHit, false,
aRecursiveLevel + 1, is_testShadow ) *
SFVEC4F( objMaterial->GetReflection() *
SFVEC3F( objMaterial->GetReflection() *
// Falloff factor
(1.0f / ( 1.0f + 0.75f * reflectedHit.m_tHit *
reflectedHit.m_tHit) ) );
sum_color += add;
}
}
outColor += (sum_color / SFVEC4F( (float)reflection_number_of_samples) );
outColor += (sum_color / SFVEC3F( (float)reflection_number_of_samples) );
}
// Refraction
@@ -1601,7 +1739,7 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
const unsigned int refractions_number_of_samples =
objMaterial->GetRefractionRayCount();
SFVEC4F sum_color = SFVEC4F( 0.0f );
SFVEC3F sum_color = SFVEC3F(0.0f);
for( unsigned int i = 0; i < refractions_number_of_samples; ++i )
{
@@ -1625,19 +1763,19 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
HITINFO refractedHit;
refractedHit.m_tHit = std::numeric_limits<float>::infinity();
SFVEC4F refractedColor = aBgColor;
SFVEC3F refractedColor = aBgColor;
if( m_accelerator->Intersect( refractedRay, refractedHit ) )
{
refractedColor = shadeHit( aBgColor, refractedRay, refractedHit,
!aIsInsideObject, aRecursiveLevel + 1, false );
const SFVEC4F absorbance = ( SFVEC4F(1.0f) - diffuseColorObj ) *
const SFVEC3F absorbance = ( SFVEC3F(1.0f) - diffuseColorObj ) *
(1.0f - objTransparency ) *
objMaterial->GetAbsorvance() *
refractedHit.m_tHit;
const SFVEC4F transparency = 1.0f / ( absorbance + 1.0f );
const SFVEC3F transparency = 1.0f / ( absorbance + 1.0f );
sum_color += refractedColor * transparency;
}
@@ -1648,7 +1786,7 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
}
outColor = outColor * ( 1.0f - objTransparency ) + objTransparency * sum_color
/ SFVEC4F( (float) refractions_number_of_samples );
/ SFVEC3F( (float) refractions_number_of_samples );
}
else
{
@@ -1661,6 +1799,49 @@ SFVEC4F RENDER_3D_RAYTRACE_BASE::shadeHit( const SFVEC4F& aBgColor, const RAY& a
}
void RENDER_3D_RAYTRACE::initializeNewWindowSize()
{
initPbo();
}
void RENDER_3D_RAYTRACE::initPbo()
{
if( GLEW_ARB_pixel_buffer_object )
{
m_openglSupportsVertexBufferObjects = true;
// Try to delete vbo if it was already initialized
deletePbo();
// Learn about Pixel buffer objects at:
// http://www.songho.ca/opengl/gl_pbo.html
// http://web.eecs.umich.edu/~sugih/courses/eecs487/lectures/25-PBO+Mipmapping.pdf
// "create 2 pixel buffer objects, you need to delete them when program exits.
// glBufferDataARB with NULL pointer reserves only memory space."
// This sets the number of RGBA pixels
m_pboDataSize = m_realBufferSize.x * m_realBufferSize.y * 4;
glGenBuffersARB( 1, &m_pboId );
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_pboId );
glBufferDataARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_pboDataSize, 0, GL_STREAM_DRAW_ARB );
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, 0 );
wxLogTrace( m_logTrace,
wxT( "RENDER_3D_RAYTRACE:: GLEW_ARB_pixel_buffer_object is supported" ) );
}
}
bool RENDER_3D_RAYTRACE::initializeOpenGL()
{
m_is_opengl_initialized = true;
return true;
}
static float distance( const SFVEC2UI& a, const SFVEC2UI& b )
{
const float dx = (float) a.x - (float) b.x;
@@ -1669,7 +1850,7 @@ static float distance( const SFVEC2UI& a, const SFVEC2UI& b )
}
void RENDER_3D_RAYTRACE_BASE::initializeBlockPositions()
void RENDER_3D_RAYTRACE::initializeBlockPositions()
{
m_realBufferSize = SFVEC2UI( 0 );
@@ -1752,7 +1933,7 @@ void RENDER_3D_RAYTRACE_BASE::initializeBlockPositions()
}
BOARD_ITEM* RENDER_3D_RAYTRACE_BASE::IntersectBoardItem( const RAY& aRay )
BOARD_ITEM* RENDER_3D_RAYTRACE::IntersectBoardItem( const RAY& aRay )
{
HITINFO hitInfo;
hitInfo.m_tHit = std::numeric_limits<float>::infinity();
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -22,9 +22,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef RENDER_3D_RAYTRACE_BASE_H
#define RENDER_3D_RAYTRACE_BASE_H
#ifndef RENDER_3D_RAYTRACE_H
#define RENDER_3D_RAYTRACE_H
#include "../../common_ogl/openGL_includes.h"
#include "accelerators/container_3d.h"
#include "accelerators/accelerator_3d.h"
#include "../render_3d_base.h"
@@ -51,16 +52,19 @@ typedef enum
} RT_RENDER_STATE;
class RENDER_3D_RAYTRACE_BASE : public RENDER_3D_BASE
class RENDER_3D_RAYTRACE : public RENDER_3D_BASE
{
public:
// TODO: Take into account board thickness so that the camera won't move inside of the board
// when facing it perpendicularly.
static constexpr float MIN_DISTANCE_IU = 4 * PCB_IU_PER_MM;
explicit RENDER_3D_RAYTRACE_BASE( BOARD_ADAPTER& aAdapter, CAMERA& aCamera );
explicit RENDER_3D_RAYTRACE( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera );
~RENDER_3D_RAYTRACE_BASE();
~RENDER_3D_RAYTRACE();
void SetCurWindowSize( const wxSize& aSize ) override;
bool Redraw( bool aIsMoving, REPORTER* aStatusReporter, REPORTER* aWarningReporter ) override;
int GetWaitForEditingTimeOut() override;
@@ -69,9 +73,11 @@ public:
BOARD_ITEM *IntersectBoardItem( const RAY& aRay );
protected:
virtual void initPbo() = 0;
virtual void deletePbo() = 0;
private:
bool initializeOpenGL();
void initializeNewWindowSize();
void initPbo();
void deletePbo();
void createItemsFromContainer( const BVH_CONTAINER_2D* aContainer2d, PCB_LAYER_ID aLayer_id,
const MATERIAL* aMaterialLayer, const SFVEC3F& aLayerColor,
float aLayerZOffset );
@@ -81,20 +87,20 @@ protected:
void postProcessShading( GLubyte* ptrPBO, REPORTER* aStatusReporter );
void postProcessBlurFinish( GLubyte* ptrPBO, REPORTER* aStatusReporter );
void renderBlockTracing( GLubyte* ptrPBO , signed int iBlock );
void renderFinalColor( GLubyte* ptrPBO, const SFVEC4F& rgbColor,
void renderFinalColor( GLubyte* ptrPBO, const SFVEC3F& rgbColor,
bool applyColorSpaceConversion );
void renderRayPackets( const SFVEC4F* bgColorY, const RAY* aRayPkt, HITINFO_PACKET* aHitPacket,
bool is_testShadow, SFVEC4F* aOutHitColor );
void renderRayPackets( const SFVEC3F* bgColorY, const RAY* aRayPkt, HITINFO_PACKET* aHitPacket,
bool is_testShadow, SFVEC3F* aOutHitColor );
void renderAntiAliasPackets( const SFVEC4F* aBgColorY, const HITINFO_PACKET* aHitPck_X0Y0,
void renderAntiAliasPackets( const SFVEC3F* aBgColorY, const HITINFO_PACKET* aHitPck_X0Y0,
const HITINFO_PACKET* aHitPck_AA_X1Y1, const RAY* aRayPck,
SFVEC4F* aOutHitColor );
SFVEC3F* aOutHitColor );
// Materials
void setupMaterials();
SFVEC4F shadeHit( const SFVEC4F& aBgColor, const RAY& aRay, HITINFO& aHitInfo,
SFVEC3F shadeHit( const SFVEC3F& aBgColor, const RAY& aRay, HITINFO& aHitInfo,
bool aIsInsideObject, unsigned int aRecursiveLevel,
bool is_testShadow ) const;
@@ -122,8 +128,6 @@ protected:
void render( GLubyte* ptrPBO, REPORTER* aStatusReporter );
void renderPreview( GLubyte* ptrPBO );
static SFVEC4F premultiplyAlpha( const SFVEC4F& aInput );
struct
{
BLINN_PHONG_MATERIAL m_Paste;
@@ -144,7 +148,6 @@ protected:
BRUSHED_METAL_NORMAL m_brushedMetalMaterial;
SILK_SCREEN_NORMAL m_silkScreenMaterial;
bool m_is_canvas_initialized;
bool m_isPreview;
/// State used on quality render
@@ -162,8 +165,10 @@ protected:
DIRECTIONAL_LIGHT* m_cameraLight;
/*GLuint m_pboId;
GLuint m_pboDataSize;*/
bool m_openglSupportsVertexBufferObjects;
GLuint m_pboId;
GLuint m_pboDataSize;
CONTAINER_3D m_objectContainer;
@@ -175,8 +180,8 @@ protected:
ACCELERATOR_3D* m_accelerator;
SFVEC4F m_backgroundColorTop;
SFVEC4F m_backgroundColorBottom;
SFVEC3F m_backgroundColorTop;
SFVEC3F m_backgroundColorBottom;
///< Used to see if the windows size changed.
wxSize m_oldWindowsSize;
@@ -213,10 +218,8 @@ protected:
#ifdef USE_SRGB_SPACE
extern SFVEC3F ConvertSRGBToLinear( const SFVEC3F& aSRGBcolor );
extern SFVEC4F ConvertSRGBAToLinear( const SFVEC4F& aSRGBAcolor );
#else
#define ConvertSRGBToLinear( v ) ( v )
#define ConvertSRGBAToLinear( v ) ( v )
#endif
#endif // RENDER_3D_RAYTRACE_BASE_H
#endif // RENDER_3D_RAYTRACE_H
@@ -1,243 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2024 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <gal/opengl/kiglew.h> // Must be included first
#include <algorithm>
#include <atomic>
#include <chrono>
#include <thread>
#include "render_3d_raytrace_gl.h"
#include "../common_ogl/ogl_utils.h"
#include <core/profile.h> // To use GetRunningMicroSecs or another profiling utility
#include <wx/log.h>
RENDER_3D_RAYTRACE_GL::RENDER_3D_RAYTRACE_GL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera ) :
RENDER_3D_RAYTRACE_BASE( aAdapter, aCamera )
{
wxLogTrace( m_logTrace, wxT( "RENDER_3D_RAYTRACE_GL::RENDER_3D_RAYTRACE_GL" ) );
m_openglSupportsVertexBufferObjects = false;
m_pboId = GL_NONE;
m_pboDataSize = 0;
}
RENDER_3D_RAYTRACE_GL::~RENDER_3D_RAYTRACE_GL()
{
deletePbo();
}
void RENDER_3D_RAYTRACE_GL::deletePbo()
{
// Delete PBO if it was created
if( m_openglSupportsVertexBufferObjects )
{
if( glIsBufferARB( m_pboId ) )
glDeleteBuffers( 1, &m_pboId );
m_pboId = GL_NONE;
}
}
void RENDER_3D_RAYTRACE_GL::SetCurWindowSize( const wxSize& aSize )
{
if( m_windowSize != aSize )
{
m_windowSize = aSize;
glViewport( 0, 0, m_windowSize.x, m_windowSize.y );
initPbo();
}
}
bool RENDER_3D_RAYTRACE_GL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
REPORTER* aWarningReporter )
{
bool requestRedraw = false;
// Initialize openGL if need
if( !m_canvasInitialized )
{
m_canvasInitialized = true;
//aIsMoving = true;
requestRedraw = true;
// It will assign the first time the windows size, so it will now
// revert to preview mode the first time the Redraw is called
m_oldWindowsSize = m_windowSize;
initializeBlockPositions();
}
std::unique_ptr<BUSY_INDICATOR> busy = CreateBusyIndicator();
// Reload board if it was requested
if( m_reloadRequested )
{
if( aStatusReporter )
aStatusReporter->Report( _( "Loading..." ) );
//aIsMoving = true;
requestRedraw = true;
Reload( aStatusReporter, aWarningReporter, false );
}
// Recalculate constants if windows size was changed
if( m_windowSize != m_oldWindowsSize )
{
m_oldWindowsSize = m_windowSize;
aIsMoving = true;
requestRedraw = true;
initializeBlockPositions();
}
// Clear buffers
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
glClearDepth( 1.0f );
glClearStencil( 0x00 );
glClear( GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
// 4-byte pixel alignment
glPixelStorei( GL_UNPACK_ALIGNMENT, 4 );
glDisable( GL_STENCIL_TEST );
glDisable( GL_LIGHTING );
glDisable( GL_COLOR_MATERIAL );
glDisable( GL_DEPTH_TEST );
glDisable( GL_TEXTURE_2D );
glDisable( GL_BLEND );
glDisable( GL_MULTISAMPLE );
const bool was_camera_changed = m_camera.ParametersChanged();
if( requestRedraw || aIsMoving || was_camera_changed )
m_renderState = RT_RENDER_STATE_MAX; // Set to an invalid state,
// so it will restart again latter
// This will only render if need, otherwise it will redraw the PBO on the screen again
if( aIsMoving || was_camera_changed )
{
// Set head light (camera view light) with the opposite direction of the camera
if( m_cameraLight )
m_cameraLight->SetDirection( -m_camera.GetDir() );
OglDrawBackground( premultiplyAlpha( m_boardAdapter.m_BgColorTop ),
premultiplyAlpha( m_boardAdapter.m_BgColorBot ) );
// Bind PBO
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_pboId );
// Get the PBO pixel pointer to write the data
GLubyte* ptrPBO = (GLubyte *)glMapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB,
GL_WRITE_ONLY_ARB );
if( ptrPBO )
{
renderPreview( ptrPBO );
// release pointer to mapping buffer, this initialize the coping to PBO
glUnmapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB );
}
glWindowPos2i( m_xoffset, m_yoffset );
}
else
{
// Bind PBO
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_pboId );
if( m_renderState != RT_RENDER_STATE_FINISH )
{
// Get the PBO pixel pointer to write the data
GLubyte* ptrPBO = (GLubyte *)glMapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB,
GL_WRITE_ONLY_ARB );
if( ptrPBO )
{
render( ptrPBO, aStatusReporter );
if( m_renderState != RT_RENDER_STATE_FINISH )
requestRedraw = true;
// release pointer to mapping buffer, this initialize the coping to PBO
glUnmapBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB );
}
}
if( m_renderState == RT_RENDER_STATE_FINISH )
{
glClear( GL_COLOR_BUFFER_BIT );
}
glWindowPos2i( m_xoffset, m_yoffset );
}
// This way it will blend the progress rendering with the last buffer. eg:
// if it was called after a openGL.
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glEnable( GL_ALPHA_TEST );
glDrawPixels( m_realBufferSize.x, m_realBufferSize.y, GL_RGBA, GL_UNSIGNED_BYTE, 0 );
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, 0 );
return requestRedraw;
}
void RENDER_3D_RAYTRACE_GL::initPbo()
{
if( GLEW_ARB_pixel_buffer_object )
{
m_openglSupportsVertexBufferObjects = true;
// Try to delete vbo if it was already initialized
deletePbo();
// Learn about Pixel buffer objects at:
// http://www.songho.ca/opengl/gl_pbo.html
// http://web.eecs.umich.edu/~sugih/courses/eecs487/lectures/25-PBO+Mipmapping.pdf
// "create 2 pixel buffer objects, you need to delete them when program exits.
// glBufferDataARB with NULL pointer reserves only memory space."
// This sets the number of RGBA pixels
m_pboDataSize = m_realBufferSize.x * m_realBufferSize.y * 4;
glGenBuffersARB( 1, &m_pboId );
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_pboId );
glBufferDataARB( GL_PIXEL_UNPACK_BUFFER_ARB, m_pboDataSize, 0, GL_STREAM_DRAW_ARB );
glBindBufferARB( GL_PIXEL_UNPACK_BUFFER_ARB, 0 );
wxLogTrace( m_logTrace,
wxT( "RENDER_3D_RAYTRACE_GL:: GLEW_ARB_pixel_buffer_object is supported" ) );
}
}
@@ -1,54 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2024 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef RENDER_3D_RAYTRACE_GL_H
#define RENDER_3D_RAYTRACE_GL_H
#include "../../common_ogl/openGL_includes.h"
#include "render_3d_raytrace_base.h"
class RENDER_3D_RAYTRACE_GL : public RENDER_3D_RAYTRACE_BASE
{
public:
explicit RENDER_3D_RAYTRACE_GL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter,
CAMERA& aCamera );
~RENDER_3D_RAYTRACE_GL();
void SetCurWindowSize( const wxSize& aSize ) override;
bool Redraw( bool aIsMoving, REPORTER* aStatusReporter, REPORTER* aWarningReporter ) override;
protected:
void initPbo() override;
void deletePbo() override;
bool m_openglSupportsVertexBufferObjects;
GLuint m_pboId;
GLuint m_pboDataSize;
};
#endif // RENDER_3D_RAYTRACE_GL_H
@@ -1,159 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2024 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "render_3d_raytrace_ram.h"
#include <wx/log.h>
RENDER_3D_RAYTRACE_RAM::RENDER_3D_RAYTRACE_RAM( BOARD_ADAPTER& aAdapter, CAMERA& aCamera ) :
RENDER_3D_RAYTRACE_BASE( aAdapter, aCamera ),
m_outputBuffer( nullptr ),
m_pboDataSize( 0 )
{
}
RENDER_3D_RAYTRACE_RAM::~RENDER_3D_RAYTRACE_RAM()
{
deletePbo();
}
GLubyte* RENDER_3D_RAYTRACE_RAM::GetBuffer()
{
return m_outputBuffer;
}
wxSize RENDER_3D_RAYTRACE_RAM::GetRealBufferSize()
{
return wxSize( m_realBufferSize.x, m_realBufferSize.y );
}
void RENDER_3D_RAYTRACE_RAM::deletePbo()
{
delete[] m_outputBuffer;
m_outputBuffer = nullptr;
}
void RENDER_3D_RAYTRACE_RAM::SetCurWindowSize( const wxSize& aSize )
{
if( m_windowSize != aSize )
{
m_windowSize = aSize;
initPbo();
}
}
bool RENDER_3D_RAYTRACE_RAM::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
REPORTER* aWarningReporter )
{
bool requestRedraw = false;
// Initialize openGL if need
if( !m_canvasInitialized )
{
m_canvasInitialized = true;
//aIsMoving = true;
requestRedraw = true;
// It will assign the first time the windows size, so it will now
// revert to preview mode the first time the Redraw is called
m_oldWindowsSize = m_windowSize;
initializeBlockPositions();
}
std::unique_ptr<BUSY_INDICATOR> busy = CreateBusyIndicator();
// Reload board if it was requested
if( m_reloadRequested )
{
if( aStatusReporter )
aStatusReporter->Report( _( "Loading..." ) );
//aIsMoving = true;
requestRedraw = true;
Reload( aStatusReporter, aWarningReporter, false );
}
// Recalculate constants if windows size was changed
if( m_windowSize != m_oldWindowsSize )
{
m_oldWindowsSize = m_windowSize;
aIsMoving = true;
requestRedraw = true;
initializeBlockPositions();
}
const bool was_camera_changed = m_camera.ParametersChanged();
if( requestRedraw || aIsMoving || was_camera_changed )
m_renderState = RT_RENDER_STATE_MAX; // Set to an invalid state,
// so it will restart again latter
// This will only render if need, otherwise it will redraw the PBO on the screen again
if( aIsMoving || was_camera_changed )
{
// Set head light (camera view light) with the opposite direction of the camera
if( m_cameraLight )
m_cameraLight->SetDirection( -m_camera.GetDir() );
if( m_outputBuffer )
{
renderPreview( m_outputBuffer );
}
}
else
{
if( m_renderState != RT_RENDER_STATE_FINISH )
{
if( m_outputBuffer )
{
render( m_outputBuffer, aStatusReporter );
if( m_renderState != RT_RENDER_STATE_FINISH )
requestRedraw = true;
}
}
}
return requestRedraw;
}
void RENDER_3D_RAYTRACE_RAM::initPbo()
{
deletePbo();
m_pboDataSize = m_realBufferSize.x * m_realBufferSize.y * 4;
m_outputBuffer = new GLubyte[m_pboDataSize]();
}
@@ -1,58 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2024 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef RENDER_3D_RAYTRACE_RAM_H
#define RENDER_3D_RAYTRACE_RAM_H
#include "render_3d_raytrace_base.h"
class RENDER_3D_RAYTRACE_RAM : public RENDER_3D_RAYTRACE_BASE
{
public:
// TODO: Take into account board thickness so that the camera won't move inside of the board
// when facing it perpendicularly.
static constexpr float MIN_DISTANCE_IU = 4 * PCB_IU_PER_MM;
explicit RENDER_3D_RAYTRACE_RAM( BOARD_ADAPTER& aAdapter, CAMERA& aCamera );
~RENDER_3D_RAYTRACE_RAM();
GLubyte* GetBuffer();
wxSize GetRealBufferSize();
void SetCurWindowSize( const wxSize& aSize ) override;
bool Redraw( bool aIsMoving, REPORTER* aStatusReporter, REPORTER* aWarningReporter ) override;
private:
void initPbo() override;
void deletePbo() override;
GLubyte* m_outputBuffer;
GLuint m_pboDataSize;
};
#endif // RENDER_3D_RAYTRACE_RAM_H
@@ -31,7 +31,6 @@
#define _BBOX_3D_H_
#include <plugins/3dapi/xv3d_types.h> // SFVEC2F
#include <glm/mat4x4.hpp>
struct RAY;
+4 -3
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -44,12 +44,13 @@
const wxChar* RENDER_3D_BASE::m_logTrace = wxT( "KI_TRACE_3D_RENDER" );
RENDER_3D_BASE::RENDER_3D_BASE( BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera ) :
RENDER_3D_BASE::RENDER_3D_BASE( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera ) :
m_boardAdapter( aBoardAdapter ),
m_camera( aCamera )
{
wxLogTrace( m_logTrace, wxT( "RENDER_3D_BASE::RENDER_3D_BASE" ) );
m_canvasInitialized = false;
m_canvas = aCanvas;
m_is_opengl_initialized = false;
m_windowSize = wxSize( -1, -1 );
m_reloadRequested = true;
}
+7 -4
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -42,7 +42,7 @@
class RENDER_3D_BASE
{
public:
explicit RENDER_3D_BASE( BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera );
explicit RENDER_3D_BASE( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera );
virtual ~RENDER_3D_BASE() = 0;
@@ -98,13 +98,16 @@ protected:
*/
std::unique_ptr<BUSY_INDICATOR> CreateBusyIndicator() const;
///< the canvas to display the scene
EDA_3D_CANVAS* m_canvas;
///< Settings reference in use for this render.
BOARD_ADAPTER& m_boardAdapter;
CAMERA& m_camera;
///< Flag if the canvas specific for this render was already initialized.
bool m_canvasInitialized;
///< Flag if the opengl specific for this render was already initialized.
bool m_is_opengl_initialized;
///< @todo This must be reviewed in order to flag change types.
bool m_reloadRequested;
+3 -17
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -38,24 +38,11 @@
// stdlib
#include <algorithm>
TRACK_BALL::TRACK_BALL( float aInitialDistance ) : CAMERA( aInitialDistance )
TRACK_BALL::TRACK_BALL( float aInitialDistance ) :
CAMERA( aInitialDistance )
{
wxLogTrace( m_logTrace, wxT( "TRACK_BALL::TRACK_BALL" ) );
initQuat();
}
TRACK_BALL::TRACK_BALL( SFVEC3F aInitPos, SFVEC3F aLookat, PROJECTION_TYPE aProjectionType ) :
CAMERA( aInitPos, aLookat, aProjectionType )
{
wxLogTrace( m_logTrace, wxT( "TRACK_BALL::TRACK_BALL" ) );
initQuat();
}
void TRACK_BALL::initQuat()
{
memset( m_quat_t0, 0, sizeof( m_quat_t0 ) );
memset( m_quat_t1, 0, sizeof( m_quat_t1 ) );
@@ -63,7 +50,6 @@ void TRACK_BALL::initQuat()
trackball( m_quat_t1, 0.0, 0.0, 0.0, 0.0 );
}
void TRACK_BALL::Drag( const wxPoint& aNewMousePosition )
{
m_parametersChanged = true;
+1 -4
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -37,7 +37,6 @@ class TRACK_BALL : public CAMERA
{
public:
explicit TRACK_BALL( float aInitialDistance );
explicit TRACK_BALL( SFVEC3F aInitPos, SFVEC3F aLookat, PROJECTION_TYPE aProjectionType );
virtual ~TRACK_BALL()
{
@@ -58,8 +57,6 @@ public:
void Interpolate( float t ) override;
private:
void initQuat();
/**
* interpolate quaternions of the trackball
*/
+4 -5
View File
@@ -5,7 +5,7 @@
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2023 CERN
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -54,17 +54,16 @@ void EDA_3D_VIEWER_FRAME::ReCreateMainToolbar()
// Set up toolbar
m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
KiBitmapBundle( BITMAPS::import3d ),
_( "Reload board" ) );
KiScaledBitmap( BITMAPS::import3d, this ), _( "Reload board" ) );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
KiBitmapBundle( BITMAPS::copy ),
KiScaledBitmap( BITMAPS::copy, this ),
_( "Copy 3D image to clipboard" ) );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
KiBitmapBundle( BITMAPS::render_mode ),
KiScaledBitmap( BITMAPS::render_mode, this ),
_( "Render current view using Raytracing" ), wxITEM_CHECK );
m_mainToolBar->AddScaledSeparator( this );
+7 -3
View File
@@ -38,7 +38,6 @@
#include <3d_viewer/tools/eda_3d_actions.h>
#include <3d_viewer/tools/eda_3d_controller.h>
#include <3d_viewer/tools/eda_3d_conditions.h>
#include <board.h>
#include <advanced_config.h>
#include <bitmaps.h>
#include <board_design_settings.h>
@@ -117,8 +116,8 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
ANTIALIASING_MODE aaMode = static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode );
m_canvas = new EDA_3D_CANVAS( this, OGL_ATT_LIST::GetAttributesList( aaMode, true ),
m_boardAdapter, m_currentCamera,
m_canvas = new EDA_3D_CANVAS( this, OGL_ATT_LIST::GetAttributesList( aaMode ), m_boardAdapter,
m_currentCamera,
PROJECT_PCB::Get3DCacheManager( &Prj() ) );
m_appearancePanel = new APPEARANCE_CONTROLS_3D( this, GetCanvas() );
@@ -571,6 +570,9 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
{
applySettings( cfg );
if( !GetBoard()->GetProject() )
GetBoard()->SetProject( &Prj() );
m_boardAdapter.SetBoard( GetBoard() );
// When opening the 3D viewer, we use the OpenGL mode, never the ray tracing engine
@@ -659,6 +661,8 @@ void EDA_3D_VIEWER_FRAME::ShowChangedLanguage()
{
wxAuiPaneInfo& lm_pane_info = m_auimgr.GetPane( m_appearancePanel );
lm_pane_info.Caption( _( "Appearance" ) );
m_appearancePanel->OnLanguageChanged();
}
SetStatusText( wxEmptyString, ACTIVITY );
@@ -382,7 +382,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
m_params.emplace_back( new PARAM_LAYER_PRESET_3D( "layer_presets",
&m_LayerPresets ) );
m_params.emplace_back( new PARAM<wxString>( "current_layer_preset",
&m_CurrentPreset, FOLLOW_PLOT_SETTINGS ) );
&m_CurrentPreset, LEGACY_PRESET_FLAG ) );
registerMigration( 0, 1, std::bind( &EDA_3D_VIEWER_SETTINGS::migrateSchema0to1, this ) );
+2 -3
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2023 CERN
* Copyright (C) 2020-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -23,6 +23,7 @@
#define EDA_3D_VIEWER_SETTINGS_H_
#include <3d_enums.h>
#include <common_ogl/ogl_attr_list.h>
#include <plugins/3dapi/xv3d_types.h>
#include <settings/app_settings.h>
#include <settings/parameters.h>
@@ -33,8 +34,6 @@
#define FOLLOW_PLOT_SETTINGS wxT( "follow_plot_settings" )
#define LEGACY_PRESET_FLAG wxT( "legacy_preset_flag" )
enum class ANTIALIASING_MODE;
struct LAYER_PRESET_3D
{
+2 -4
View File
@@ -45,9 +45,7 @@ set(3D-VIEWER_SRCS
${DIR_RAY_ACC}/container_2d.cpp
${DIR_RAY}/PerlinNoise.cpp
${DIR_RAY}/create_scene.cpp
${DIR_RAY}/render_3d_raytrace_base.cpp
${DIR_RAY}/render_3d_raytrace_gl.cpp
${DIR_RAY}/render_3d_raytrace_ram.cpp
${DIR_RAY}/render_3d_raytrace.cpp
${DIR_RAY}/frustum.cpp
${DIR_RAY}/material.cpp
${DIR_RAY}/mortoncodes.cpp
@@ -73,7 +71,7 @@ set(3D-VIEWER_SRCS
${DIR_RAY_3D}/triangle_3d.cpp
3d_rendering/buffers_debug.cpp
3d_rendering/render_3d_base.cpp
3d_rendering/color_rgba.cpp
3d_rendering/color_rgb.cpp
3d_rendering/image.cpp
3d_rendering/post_shader.cpp
3d_rendering/post_shader_ssao.cpp
+75 -26
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -33,45 +33,94 @@
#include <core/arraydim.h>
const wxGLAttributes OGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode,
bool aAlpha )
const int OGL_ATT_LIST::m_openGL_attributes_list[] = {
// Boolean attributes (using itself at padding):
// 0 1
WX_GL_RGBA, WX_GL_RGBA,
// 2 3
WX_GL_DOUBLEBUFFER, WX_GL_DOUBLEBUFFER,
// Normal attributes with values:
// 4 5
WX_GL_DEPTH_SIZE, 16,
// 6 7
WX_GL_STENCIL_SIZE, 8,
// This ones need to be the last in the list (as the tags will set to 0 if AA fails)
// 8 9
WX_GL_SAMPLES, 0, // Disable AA for the start.
//10 11
WX_GL_SAMPLE_BUFFERS, 1, // Enable multisampling support (antialiasing).
0, 0 // NULL termination
};
#define ATT_WX_GL_SAMPLES_OFFSET 8
#define ATT_WX_GL_SAMPLES_OFFSET_DATA 9
#define ATT_WX_GL_SAMPLE_BUFFERS_OFFSET 10
#define ATT_WX_GL_SAMPLE_BUFFERS_DATA 11
int OGL_ATT_LIST::m_openGL_attributes_list_to_use[
arrayDim( OGL_ATT_LIST::m_openGL_attributes_list ) ] = { 0 };
const int* OGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode )
{
wxASSERT( aAntiAliasingMode <= ANTIALIASING_MODE::AA_8X );
auto makeAttribs = [aAlpha]( int aSamplers )
{
wxGLAttributes dispAttrs;
dispAttrs.RGBA()
.DoubleBuffer()
.Depth( 16 )
.Stencil( 8 )
.Samplers( aSamplers )
.SampleBuffers( aSamplers >= 0 ? 1 : -1 )
.MinRGBA( 8, 8, 8, aAlpha ? 8 : -1 )
.EndList();
return dispAttrs;
};
int maxSamples = -1;
memcpy( m_openGL_attributes_list_to_use, m_openGL_attributes_list,
sizeof( m_openGL_attributes_list_to_use ) );
if( aAntiAliasingMode > ANTIALIASING_MODE::AA_NONE )
{
// There is a bug on wxGLCanvas that makes IsDisplaySupported fail
// while testing for antialiasing.
// http://trac.wxwidgets.org/ticket/16909
// this next code will only work after this bug is fixed
//
// On my experience (Mario) it was only working on Linux but failing on
// Windows, so there was no AA.
// Check if the canvas supports multisampling.
if( wxGLCanvas::IsDisplaySupported( makeAttribs( 0 ) ) )
if( wxGLCanvas::IsDisplaySupported( m_openGL_attributes_list_to_use ) )
{
static const int aaSamples[4] = { 0, 2, 4, 8 };
static const int aaSamples[4] = {0, 2, 4, 8};
// Check for possible sample sizes, start form the requested.
maxSamples = aaSamples[static_cast<int>( aAntiAliasingMode )];
int maxSamples = aaSamples[static_cast<int>( aAntiAliasingMode )];
while( maxSamples > 0 && !wxGLCanvas::IsDisplaySupported( makeAttribs( maxSamples ) ) )
m_openGL_attributes_list_to_use[ATT_WX_GL_SAMPLES_OFFSET_DATA] = maxSamples;
for( ; (maxSamples > 0) &&
( !wxGLCanvas::IsDisplaySupported( m_openGL_attributes_list_to_use ) );
maxSamples = maxSamples >> 1 )
{
maxSamples = maxSamples >> 1;
m_openGL_attributes_list_to_use[ATT_WX_GL_SAMPLES_OFFSET_DATA] = maxSamples;
}
}
else
{
aAntiAliasingMode = ANTIALIASING_MODE::AA_NONE;
}
}
return makeAttribs( maxSamples );
// Disable antialiasing if it failed or was not requested
if( aAntiAliasingMode == ANTIALIASING_MODE::AA_NONE )
{
// Remove multisampling information
// (hoping that the GPU driver will decide what is best)
m_openGL_attributes_list_to_use[ATT_WX_GL_SAMPLES_OFFSET] = 0;
m_openGL_attributes_list_to_use[ATT_WX_GL_SAMPLES_OFFSET_DATA] = 0;
m_openGL_attributes_list_to_use[ATT_WX_GL_SAMPLE_BUFFERS_OFFSET] = 0;
m_openGL_attributes_list_to_use[ATT_WX_GL_SAMPLE_BUFFERS_DATA] = 0;
}
return m_openGL_attributes_list_to_use;
}
+23 -8
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -30,8 +30,6 @@
#ifndef _OGL_ATT_LIST_H
#define _OGL_ATT_LIST_H
#include <wx/glcanvas.h>
/// Anti-aliasing options
enum class ANTIALIASING_MODE
{
@@ -53,12 +51,29 @@ public:
* Get a list of attributes to pass to wxGLCanvas.
*
* @param aAntiAliasingMode = 0 - disabled; try to initialize (if is supported) the
* list with anti aliasing capabilities.
* @param aAlpha set to enable alpha channel.
* @return wxGLAttributes to be passed in the creation of a EDA_3D_CANVAS class
* list with anti aliasing capabilities
* @return a list of options to be passed in the creation of a EDA_3D_CANVAS class
*/
static const wxGLAttributes GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode,
bool aAlpha = false );
static const int* GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode );
private:
/**
* Attributes list to be passed to a wxGLCanvas creation.
*
* This array should be 2*n+1
* Sadly wxwidgets / glx < 13 allowed
* a thing named "boolean attributes" that don't take a value.
* (See src/unix/glx11.cpp -> wxGLCanvasX11::ConvertWXAttrsToGL() ).
* To avoid problems due to this, just specify those attributes twice.
* Only WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_STEREO are such boolean
* attributes.
*/
static const int m_openGL_attributes_list[];
/**
* Attributes list that was (eventually) changed and are passed to creation.
*/
static int m_openGL_attributes_list_to_use[];
};
#endif // _OGL_ATT_LIST_H
+7 -32
View File
@@ -46,7 +46,7 @@ void OglGetScreenshot( wxImage& aDstImage )
glGetIntegerv( GL_VIEWPORT, (GLint*) &viewport );
unsigned char* pixelbuffer = (unsigned char*) malloc( viewport.x * viewport.y * 4 );
unsigned char* pixelbuffer = (unsigned char*) malloc( viewport.x * viewport.y * 3 );
// Call glFinish before screenshot to ensure everything is fully drawn.
glFinish();
@@ -54,40 +54,15 @@ void OglGetScreenshot( wxImage& aDstImage )
glPixelStorei( GL_PACK_ALIGNMENT, 1 );
glReadBuffer( GL_BACK_LEFT );
glReadPixels( viewport.originX, viewport.originY, viewport.x, viewport.y, GL_RGBA,
glReadPixels( viewport.originX, viewport.originY, viewport.x, viewport.y, GL_RGB,
GL_UNSIGNED_BYTE, pixelbuffer );
unsigned char* rgbBuffer = (unsigned char*) malloc( viewport.x * viewport.y * 3 );
unsigned char* alphaBuffer = (unsigned char*) malloc( viewport.x * viewport.y );
unsigned char* rgbaPtr = pixelbuffer;
unsigned char* rgbPtr = rgbBuffer;
unsigned char* alphaPtr = alphaBuffer;
for( int y = 0; y < viewport.y; y++ )
{
for( int x = 0; x < viewport.x; x++ )
{
rgbPtr[0] = rgbaPtr[0];
rgbPtr[1] = rgbaPtr[1];
rgbPtr[2] = rgbaPtr[2];
alphaPtr[0] = rgbaPtr[3];
rgbaPtr += 4;
rgbPtr += 3;
alphaPtr += 1;
}
}
// "Sets the image data without performing checks.
// The data given must have the size (width*height*3)
// The data must have been allocated with malloc()
// If static_data is false, after this call the pointer to the data is owned
// by the wxImage object, that will be responsible for deleting it."
aDstImage.SetData( rgbBuffer, viewport.x, viewport.y, false );
aDstImage.SetAlpha( alphaBuffer, false );
free( pixelbuffer );
aDstImage.SetData( pixelbuffer, viewport.x, viewport.y, false );
aDstImage = aDstImage.Mirror( false );
}
@@ -182,7 +157,7 @@ void OglSetDiffuseMaterial( const SFVEC3F &aMaterialDiffuse, float aOpacity,
}
void OglDrawBackground( const SFVEC4F& aTopColor, const SFVEC4F& aBotColor )
void OglDrawBackground( const SFVEC3F& aTopColor, const SFVEC3F& aBotColor )
{
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
@@ -198,14 +173,14 @@ void OglDrawBackground( const SFVEC4F& aTopColor, const SFVEC4F& aBotColor )
glDisable( GL_ALPHA_TEST );
glBegin( GL_QUADS );
glColor4f( aTopColor.r, aTopColor.g, aTopColor.b, aTopColor.a );
glColor4f( aTopColor.x, aTopColor.y, aTopColor.z, 1.0f );
glVertex2f( -1.0, 1.0 ); // Top left corner
glColor4f( aBotColor.r, aBotColor.g, aBotColor.b, aBotColor.a );
glColor4f( aBotColor.x, aBotColor.y, aBotColor.z, 1.0f );
glVertex2f( -1.0,-1.0 ); // bottom left corner
glVertex2f( 1.0,-1.0 ); // bottom right corner
glColor4f( aTopColor.r, aTopColor.g, aTopColor.b, aTopColor.a);
glColor4f( aTopColor.x, aTopColor.y, aTopColor.z, 1.0f );
glVertex2f( 1.0, 1.0 ); // top right corner
glEnd();
}
+1 -1
View File
@@ -71,7 +71,7 @@ GLuint OglLoadTexture( const IMAGE& aImage );
*/
void OglGetScreenshot( wxImage& aDstImage );
void OglDrawBackground( const SFVEC4F& aTopColor, const SFVEC4F& aBotColor );
void OglDrawBackground( const SFVEC3F& aTopColor, const SFVEC3F& aBotColor );
/**
* Reset to default state the texture settings.
+10 -19
View File
@@ -100,6 +100,7 @@ APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent,
{
DPI_SCALING_COMMON dpi( nullptr, m_frame );
int indicatorSize = ConvertDialogToPixels( wxSize( 6, 6 ) ).x / dpi.GetContentScaleFactor();
int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
m_pointSize = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ).GetPointSize();
@@ -152,21 +153,18 @@ APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent,
KeyNameFromKeyCode( VIEWPORT_SWITCH_KEY ),
KeyNameFromKeyCode( VIEWPORT_SWITCH_KEY ) ) );
if( screenHeight <= 900 && m_pointSize >= FromDIP( KIUI::c_IndicatorSizeDIP ) )
if( screenHeight <= 900 && m_pointSize >= indicatorSize )
m_pointSize = m_pointSize * 8 / 10;
m_cbLayerPresets->Bind( wxEVT_CHOICE, &APPEARANCE_CONTROLS_3D::onLayerPresetChanged, this );
m_toggleGridRenderer = new GRID_BITMAP_TOGGLE_RENDERER(
KiBitmapBundle( BITMAPS::visibility ), KiBitmapBundle( BITMAPS::visibility_off ) );
m_frame->Bind( EDA_LANG_CHANGED, &APPEARANCE_CONTROLS_3D::OnLanguageChanged, this );
m_toggleGridRenderer = new GRID_BITMAP_TOGGLE_RENDERER( KiBitmap( BITMAPS::visibility ),
KiBitmap( BITMAPS::visibility_off ) );
}
APPEARANCE_CONTROLS_3D::~APPEARANCE_CONTROLS_3D()
{
m_frame->Unbind( EDA_LANG_CHANGED, &APPEARANCE_CONTROLS_3D::OnLanguageChanged, this );
}
@@ -201,7 +199,7 @@ void APPEARANCE_CONTROLS_3D::OnSize( wxSizeEvent& aEvent )
}
void APPEARANCE_CONTROLS_3D::rebuildControls()
void APPEARANCE_CONTROLS_3D::OnLanguageChanged()
{
Freeze();
@@ -215,14 +213,6 @@ void APPEARANCE_CONTROLS_3D::rebuildControls()
}
void APPEARANCE_CONTROLS_3D::OnLanguageChanged( wxCommandEvent& aEvent )
{
rebuildControls();
aEvent.Skip();
}
void APPEARANCE_CONTROLS_3D::OnDarkModeToggle()
{
// This is essentially a list of hacks because DarkMode isn't yet implemented inside
@@ -246,7 +236,7 @@ void APPEARANCE_CONTROLS_3D::OnDarkModeToggle()
void APPEARANCE_CONTROLS_3D::CommonSettingsChanged()
{
rebuildControls();
OnLanguageChanged();
UpdateLayerCtls();
syncLayerPresetSelection();
@@ -520,9 +510,10 @@ void APPEARANCE_CONTROLS_3D::rebuildLayers()
}
else
{
BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE(
m_windowLayers, layer, KiBitmapBundle( BITMAPS::visibility ),
KiBitmapBundle( BITMAPS::visibility_off ), aSetting->m_Visible );
BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE( m_windowLayers, layer,
KiBitmap( BITMAPS::visibility ),
KiBitmap( BITMAPS::visibility_off ),
aSetting->m_Visible );
btn_visible->Bind( TOGGLE_CHANGED,
[this]( wxCommandEvent& aEvent )
+2 -3
View File
@@ -114,6 +114,8 @@ public:
~APPEARANCE_CONTROLS_3D();
wxSize GetBestSize() const;
void OnLanguageChanged();
void OnDarkModeToggle();
void OnLayerVisibilityChanged( int aLayer, bool isVisible );
@@ -138,11 +140,8 @@ public:
protected:
void OnSetFocus( wxFocusEvent& aEvent ) override;
void OnSize( wxSizeEvent& aEvent ) override;
void OnLanguageChanged( wxCommandEvent& aEvent );
private:
void rebuildControls();
void rebuildLayers();
void rebuildLayerPresetsWidget();
+46 -17
View File
@@ -41,10 +41,11 @@
#include <settings/common_settings.h>
#include <settings/settings_manager.h>
#include <widgets/wx_infobar.h>
#include <widgets/std_bitmap_button.h>
#include <eda_3d_viewer_settings.h>
#include <board_design_settings.h>
#include <3d_navlib/nl_footprint_properties_plugin.h>
PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
FOOTPRINT* aFootprint,
std::vector<FP_3DMODEL>* aParentModelList ) :
@@ -124,8 +125,10 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
// Create the 3D canvas
m_previewPane = new EDA_3D_CANVAS( this,
OGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ),
m_boardAdapter, m_currentCamera,
PROJECT_PCB::Get3DCacheManager( &aFrame->Prj() ) );
m_boardAdapter, m_currentCamera, PROJECT_PCB::Get3DCacheManager( &aFrame->Prj() ) );
m_spaceMouse = new NL_FOOTPRINT_PROPERTIES_PLUGIN( m_previewPane );
m_spaceMouse->SetFocus( true );
m_boardAdapter.SetBoard( m_dummyBoard );
m_boardAdapter.m_IsBoardView = false;
@@ -163,6 +166,28 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
aFrame->Connect( EDA_EVT_UNITS_CHANGED,
wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL::onUnitsChanged ),
nullptr, this );
Bind( wxCUSTOM_PANEL_SHOWN_EVENT, &PANEL_PREVIEW_3D_MODEL::onPanelShownEvent, this );
#ifdef __WXOSX__
// Call layout once to get the proper button sizes after the bitmaps have been set
Layout();
// The rounded-button style used has a small border on the left/right sides.
// This is automatically fixed in wx for buttons with a bitmap < 20, but not
// when the bitmap is set to be 26x26.
wxSize borderFix = wxSize( 4, 4 );
m_bpvTop->SetMinSize( m_bpvTop->GetSize() + borderFix );
m_bpvFront->SetMinSize( m_bpvFront->GetSize() + borderFix );
m_bpvBack->SetMinSize( m_bpvBack->GetSize() + borderFix );
m_bpvLeft->SetMinSize( m_bpvLeft->GetSize() + borderFix );
m_bpvRight->SetMinSize( m_bpvRight->GetSize() + borderFix );
m_bpvBottom->SetMinSize( m_bpvBottom->GetSize() + borderFix );
m_bpvISO->SetMinSize( m_bpvISO->GetSize() + borderFix );
m_bpUpdate->SetMinSize( m_bpUpdate->GetSize() + borderFix );
m_bpSettings->SetMinSize( m_bpSettings->GetSize() + borderFix );
#endif
}
@@ -172,6 +197,7 @@ PANEL_PREVIEW_3D_MODEL::~PANEL_PREVIEW_3D_MODEL()
if( m_boardAdapter.m_Cfg )
m_boardAdapter.m_Cfg->m_Render = m_initialRender;
delete m_spaceMouse;
delete m_dummyBoard;
delete m_previewPane;
}
@@ -253,10 +279,6 @@ wxString PANEL_PREVIEW_3D_MODEL::formatScaleValue( double aValue )
wxString PANEL_PREVIEW_3D_MODEL::formatRotationValue( double aValue )
{
// Sigh. Did we really need differentiated +/- 0.0?
if( aValue == -0.0 )
aValue = 0.0;
return wxString::Format( wxT( "%.2f%s" ),
aValue,
EDA_UNIT_UTILS::GetText( EDA_UNITS::DEGREES ) );
@@ -290,11 +312,9 @@ void PANEL_PREVIEW_3D_MODEL::SetSelectedModel( int idx )
yscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.y ) );
zscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.z ) );
// Rotation is stored in the file as postive-is-CW, but we use postive-is-CCW in the GUI
// to match the rest of KiCad
xrot->ChangeValue( formatRotationValue( -modelInfo.m_Rotation.x ) );
yrot->ChangeValue( formatRotationValue( -modelInfo.m_Rotation.y ) );
zrot->ChangeValue( formatRotationValue( -modelInfo.m_Rotation.z ) );
xrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.x ) );
yrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.y ) );
zrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.z ) );
xoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.x ) );
yoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.y ) );
@@ -337,11 +357,9 @@ void PANEL_PREVIEW_3D_MODEL::updateOrientation( wxCommandEvent &event )
modelInfo->m_Scale.z = EDA_UNIT_UTILS::UI::DoubleValueFromString(
pcbIUScale, EDA_UNITS::UNSCALED, zscale->GetValue() );
// Rotation is stored in the file as postive-is-CW, but we use postive-is-CCW in the GUI
// to match the rest of KiCad
modelInfo->m_Rotation.x = -rotationFromString( xrot->GetValue() );
modelInfo->m_Rotation.y = -rotationFromString( yrot->GetValue() );
modelInfo->m_Rotation.z = -rotationFromString( zrot->GetValue() );
modelInfo->m_Rotation.x = rotationFromString( xrot->GetValue() );
modelInfo->m_Rotation.y = rotationFromString( yrot->GetValue() );
modelInfo->m_Rotation.z = rotationFromString( zrot->GetValue() );
modelInfo->m_Offset.x = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, m_userUnits,
xoff->GetValue() )
@@ -610,6 +628,17 @@ void PANEL_PREVIEW_3D_MODEL::onUnitsChanged( wxCommandEvent& aEvent )
}
void PANEL_PREVIEW_3D_MODEL::onPanelShownEvent( wxCommandEvent& aEvent )
{
if( m_spaceMouse != nullptr )
{
m_spaceMouse->SetFocus( static_cast<bool>( aEvent.GetInt() ) );
}
aEvent.Skip();
}
void PANEL_PREVIEW_3D_MODEL::UpdateDummyFootprint( bool aReloadRequired )
{
m_dummyFootprint->Models().clear();
@@ -34,6 +34,7 @@
#include <3d_canvas/eda_3d_canvas.h>
#include <3d_viewer_id.h>
#include <3d_rendering/track_ball.h>
#include <wx/event.h>
// Define min and max parameter values
#define MAX_SCALE 10000.0
@@ -52,6 +53,7 @@
#define OFFSET_INCREMENT_MIL 25.0
#define OFFSET_INCREMENT_MIL_FINE 5.0
wxDECLARE_EVENT( wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent );
// Declared classes to create pointers
class WX_INFOBAR;
@@ -60,6 +62,7 @@ class FILENAME_RESOLVER;
class BOARD;
class BOARD_ADAPTER;
class FOOTPRINT;
class NL_FOOTPRINT_PROPERTIES_PLUGIN;
class PANEL_PREVIEW_3D_MODEL: public EDA_3D_BOARD_HOLDER, public TOOLS_HOLDER, public PANEL_PREVIEW_3D_MODEL_BASE
{
@@ -139,6 +142,7 @@ private:
void doIncrementOffset( wxSpinEvent& aEvent, double aSign );
void onUnitsChanged( wxCommandEvent& aEvent );
void onPanelShownEvent( wxCommandEvent& aEvent );
wxString formatScaleValue( double aValue );
wxString formatRotationValue( double aValue );
@@ -211,6 +215,8 @@ private:
bool m_bodyStyleShowAll; /// true if the board body is show
/// The 3d viewer Render initial settings (must be saved and restored)
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS m_initialRender;
NL_FOOTPRINT_PROPERTIES_PLUGIN* m_spaceMouse;
};
#endif // PANEL_PREVIEW_3D_MODEL_H
@@ -1,12 +1,10 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/std_bitmap_button.h"
#include "panel_preview_3d_model_base.h"
///////////////////////////////////////////////////////////////////////////
@@ -23,7 +21,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
sbSizerScale = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Scale") ), wxVERTICAL );
wxFlexGridSizer* fgSizerScale;
fgSizerScale = new wxFlexGridSizer( 0, 3, 1, 3 );
fgSizerScale = new wxFlexGridSizer( 0, 3, 2, 3 );
fgSizerScale->AddGrowableCol( 1 );
fgSizerScale->SetFlexibleDirection( wxBOTH );
fgSizerScale->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@@ -59,16 +57,16 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
fgSizerScale->Add( m_spinZscale, 0, wxALIGN_CENTER_VERTICAL, 5 );
sbSizerScale->Add( fgSizerScale, 0, wxBOTTOM|wxEXPAND|wxRIGHT, 2 );
sbSizerScale->Add( fgSizerScale, 0, wxBOTTOM|wxEXPAND|wxRIGHT, 5 );
bSizerLeft->Add( sbSizerScale, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizerLeft->Add( sbSizerScale, 0, wxLEFT|wxRIGHT|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerRotation;
sbSizerRotation = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Rotation") ), wxVERTICAL );
wxFlexGridSizer* fgSizerRotate;
fgSizerRotate = new wxFlexGridSizer( 0, 3, 1, 3 );
fgSizerRotate = new wxFlexGridSizer( 0, 3, 2, 3 );
fgSizerRotate->AddGrowableCol( 1 );
fgSizerRotate->SetFlexibleDirection( wxBOTH );
fgSizerRotate->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@@ -104,7 +102,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
fgSizerRotate->Add( m_spinZrot, 0, wxALIGN_CENTER_VERTICAL, 5 );
sbSizerRotation->Add( fgSizerRotate, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 2 );
sbSizerRotation->Add( fgSizerRotate, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 5 );
bSizerLeft->Add( sbSizerRotation, 0, wxLEFT|wxRIGHT|wxEXPAND, 5 );
@@ -113,7 +111,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
sbSizerOffset = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Offset") ), wxVERTICAL );
wxFlexGridSizer* fgSizerOffset;
fgSizerOffset = new wxFlexGridSizer( 0, 3, 1, 3 );
fgSizerOffset = new wxFlexGridSizer( 0, 3, 2, 3 );
fgSizerOffset->AddGrowableCol( 1 );
fgSizerOffset->SetFlexibleDirection( wxBOTH );
fgSizerOffset->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@@ -149,7 +147,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
fgSizerOffset->Add( m_spinZoffset, 0, wxALIGN_CENTER_VERTICAL, 5 );
sbSizerOffset->Add( fgSizerOffset, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 2 );
sbSizerOffset->Add( fgSizerOffset, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 5 );
bSizerLeft->Add( sbSizerOffset, 0, wxLEFT|wxRIGHT|wxEXPAND, 5 );
@@ -157,8 +155,8 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Opacity") ), wxVERTICAL );
m_opacity = new wxSlider( sbSizer4->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
sbSizer4->Add( m_opacity, 0, wxRIGHT|wxLEFT, 2 );
m_opacity = new wxSlider( sbSizer4->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
sbSizer4->Add( m_opacity, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
bSizerLeft->Add( sbSizer4, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@@ -176,7 +174,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
m_previewLabel->Wrap( -1 );
m_previewLabel->SetFont( wxFont( 11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
bSizer6->Add( m_previewLabel, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer6->Add( m_previewLabel, 1, wxEXPAND|wxLEFT|wxRIGHT, 10 );
bSizerRight->Add( bSizer6, 0, wxEXPAND, 5 );
@@ -195,53 +193,53 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
bSizer3DButtons->Add( 0, 10, 0, 0, 5 );
m_bpvISO = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvISO = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvISO->SetToolTip( _("Enable/disable orthographic projection") );
bSizer3DButtons->Add( m_bpvISO, 0, wxTOP, 5 );
m_bpvBodyStyle = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvBodyStyle = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvBodyStyle->SetToolTip( _("Show or hide the board body\nIf hidden, show only copper and silkscreen layers.") );
bSizer3DButtons->Add( m_bpvBodyStyle, 0, wxTOP, 5 );
bSizer3DButtons->Add( m_bpvBodyStyle, 0, wxTOP|wxBOTTOM, 5 );
bSizer3DButtons->Add( 0, 0, 1, wxEXPAND, 5 );
m_bpvLeft = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvLeft = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvLeft, 0, wxBOTTOM, 5 );
m_bpvRight = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvRight = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvRight, 0, wxBOTTOM, 5 );
m_bpvFront = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvFront = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvFront, 0, wxBOTTOM, 5 );
m_bpvBack = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvBack = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvBack, 0, wxBOTTOM, 5 );
m_bpvTop = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvTop = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvTop, 0, wxBOTTOM, 5 );
m_bpvBottom = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvBottom = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvBottom, 0, 0, 5 );
bSizer3DButtons->Add( 0, 0, 1, wxEXPAND, 5 );
m_bpUpdate = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpUpdate = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpUpdate->SetToolTip( _("Reload board and 3D models") );
bSizer3DButtons->Add( m_bpUpdate, 0, wxTOP, 5 );
bSizer3DButtons->Add( m_bpUpdate, 0, wxBOTTOM, 5 );
m_bpSettings = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpSettings, 0, wxTOP, 5 );
m_bpSettings = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpSettings, 0, wxBOTTOM, 5 );
bSizer3DButtons->Add( 0, 10, 0, 0, 5 );
bSizermain->Add( bSizer3DButtons, 0, wxEXPAND|wxTOP, 5 );
bSizermain->Add( bSizer3DButtons, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
this->SetSizer( bSizermain );
File diff suppressed because it is too large Load Diff
+11 -13
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -10,8 +10,6 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class STD_BITMAP_BUTTON;
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
@@ -70,16 +68,16 @@ class PANEL_PREVIEW_3D_MODEL_BASE : public wxPanel
wxSlider* m_opacity;
wxStaticText* m_previewLabel;
wxBoxSizer* m_SizerPanelView;
STD_BITMAP_BUTTON* m_bpvISO;
STD_BITMAP_BUTTON* m_bpvBodyStyle;
STD_BITMAP_BUTTON* m_bpvLeft;
STD_BITMAP_BUTTON* m_bpvRight;
STD_BITMAP_BUTTON* m_bpvFront;
STD_BITMAP_BUTTON* m_bpvBack;
STD_BITMAP_BUTTON* m_bpvTop;
STD_BITMAP_BUTTON* m_bpvBottom;
STD_BITMAP_BUTTON* m_bpUpdate;
STD_BITMAP_BUTTON* m_bpSettings;
wxBitmapButton* m_bpvISO;
wxBitmapButton* m_bpvBodyStyle;
wxBitmapButton* m_bpvLeft;
wxBitmapButton* m_bpvRight;
wxBitmapButton* m_bpvFront;
wxBitmapButton* m_bpvBack;
wxBitmapButton* m_bpvTop;
wxBitmapButton* m_bpvBottom;
wxBitmapButton* m_bpUpdate;
wxBitmapButton* m_bpSettings;
// Virtual event handlers, override them in your derived class
virtual void onMouseWheelScale( wxMouseEvent& event ) { event.Skip(); }
-1
View File
@@ -51,7 +51,6 @@ Thomas Pointhuber <thomas.pointhuber[at]gmx-dot-at>
Roberto Fernandez Bautista <roberto.fer.bau[at]gmail-dot-com>
Mikołaj Wielgus <wielgusmikolaj[at]gmail-dot-com>
Mike Williams <mike[at]mikebwilliams-dot-com>
Emile Cormier <emile.cormier.jr[at]gmail-dot-com>
See git repo on GitLab for contributors at
https://gitlab.com/kicad/code/kicad/-/graphs/master
+15 -94
View File
@@ -31,11 +31,6 @@ cmake_policy( SET CMP0116 OLD )
# The current structure requires the add_custom_command to get called twice, the NEW behavior deduplicates it
cmake_policy( SET CMP0113 OLD )
# Enable CMAKE_MSVC_DEBUG_INFORMATION_FORMAT to override the cmake pdb flags easily
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif (POLICY CMP0141)
# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html
if( DEFINED CMAKE_BUILD_TYPE )
@@ -165,17 +160,6 @@ cmake_dependent_option( KICAD_APPLE_MAKE_RELOCATEABLE_BUNDLE
"On macOS, post-process the build to make it relocateable (default ON)"
ON "APPLE" OFF )
# CMake's FindProtobuf module doesn't work correctly on MacOS or Windows but is
# required for Linux
if( UNIX_NOT_APPLE )
set( KICAD_CMAKE_PROTOBUF_DEFAULT ON )
else()
set( KICAD_CMAKE_PROTOBUF_DEFAULT OFF )
endif()
option( KICAD_USE_CMAKE_FINDPROTOBUF "Use FindProtobuf provided by CMake" ${KICAD_CMAKE_PROTOBUF_DEFAULT} )
mark_as_advanced( KICAD_USE_CMAKE_FINDPROTOBUF )
####################################
# Installation options
####################################
@@ -263,14 +247,6 @@ option( KICAD_GAL_PROFILE
"Enable profiling info for GAL"
OFF )
option( KICAD_IPC_API
"Enable experimental IPC API"
OFF )
option( KICAD_IDF_TOOLS
"Build additional idf tools"
ON )
# Global setting: exports are explicit
set( CMAKE_CXX_VISIBILITY_PRESET "hidden" )
set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
@@ -278,8 +254,8 @@ set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
# Global setting: build everything position independent
set( CMAKE_POSITION_INDEPENDENT_CODE ON )
# Global setting: Use C++20
set(CMAKE_CXX_STANDARD 20)
# Global setting: Use C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -302,10 +278,6 @@ if( KICAD_WAYLAND )
add_compile_definitions( KICAD_WAYLAND )
endif()
if( KICAD_IPC_API )
add_definitions( -DKICAD_IPC_API )
endif()
# Ensure DEBUG is defined for all platforms in Debug builds
add_compile_definitions( $<$<CONFIG:Debug>:DEBUG> )
@@ -359,9 +331,13 @@ add_compile_definitions( $<$<BOOL:${KICAD_BUILD_ARCH_ARM64}>:KICAD_BUILD_ARCH_AR
if (USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
# Set ccache on the actual lang
list(PREPEND CMAKE_C_COMPILER_LAUNCHER ${CCACHE_FOUND})
list(PREPEND CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_FOUND})
get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
set(RULE_LAUNCH_COMPILE "${RULE_LAUNCH_COMPILE} ${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${RULE_LAUNCH_COMPILE})
get_property(RULE_LAUNCH_LINK GLOBAL PROPERTY RULE_LAUNCH_LINK)
set(RULE_LAUNCH_LINK "${RULE_LAUNCH_LINK} ${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${RULE_LAUNCH_LINK})
message(STATUS "Used ${CCACHE_FOUND} for compilation.")
else(CCACHE_FOUND)
@@ -376,9 +352,9 @@ endif(USE_CCACHE)
if (USE_DISTCC)
find_program(DISTCC_FOUND distcc)
if(DISTCC_FOUND)
list(APPEND CMAKE_C_COMPILER_LAUNCHER ${DISTCC_FOUND})
list(APPEND CMAKE_CXX_COMPILER_LAUNCHER ${DISTCC_FOUND})
get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
set(RULE_LAUNCH_COMPILE "${RULE_LAUNCH_COMPILE} ${DISTCC_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${RULE_LAUNCH_COMPILE})
message(STATUS "Using ${DISTCC_FOUND} for distributed build.")
else(DISTCC_FOUND)
message(INFO "Distcc was requested but not found.")
@@ -536,18 +512,8 @@ if( MSVC )
string( APPEND CMAKE_CXX_FLAGS " /wd4290" )
# C4800: non-bool is explicitly cast to bool, forcing value of 0 or 1
string( APPEND CMAKE_CXX_FLAGS " /wd4800" )
# cmake 3.25 or higher requried for MSVC, should be fine
if( USE_CCACHE AND CCACHE_FOUND )
# Equivalent to /Z7, ensures cmake doesn't fight over the default
# ccache may encounter external PDB file write errors due to paralleism
# Using the embedded PDB mode is ok for development use of ccache
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "Embedded")
else()
# Equivalent to /Zi, ensures cmake doesn't fight over the default
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase")
endif()
# /Zi: create PDB
string( APPEND CMAKE_CXX_FLAGS " /Zi" )
# /Zc:__cplusplus: define this macro according to C++ standard version
string( APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus" )
# /GF: enable string pooling
@@ -876,27 +842,6 @@ if( OCC_VERSION_STRING VERSION_LESS 7.5.0 )
endif()
include_directories( SYSTEM ${OCC_INCLUDE_DIR} )
if( KICAD_USE_CMAKE_FINDPROTOBUF )
include( FindProtobuf )
find_package( Protobuf REQUIRED )
else()
find_package( Protobuf REQUIRED CONFIG )
set( Protobuf_LIBRARY "protobuf::libprotobuf" )
endif()
if( NOT Protobuf_PROTOC_EXECUTABLE )
if( NOT KICAD_USE_CMAKE_FINDPROTOBUF)
set( Protobuf_PROTOC_EXECUTABLE "protobuf::protoc" )
else()
MESSAGE( FATAL_ERROR "Protobuf compiler not found. Please install protobuf-compiler." )
endif()
endif()
if( NOT Protobuf_INCLUDE_DIR )
get_target_property( Protobuf_INCLUDE_DIR protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES )
endif()
# Assist with header file searching optimization:
# INC_BEFORE and INC_AFTER are two lists which go at the front and back of the
# header file search lists, respectively.
@@ -1058,25 +1003,6 @@ find_package( wxWidgets ${wxWidgets_REQ_VERSION} COMPONENTS gl aui adv html core
# Include wxWidgets macros.
include( ${wxWidgets_USE_FILE} )
# Detect wxWidgets port being used
if( wxWidgets_FIND_STYLE STREQUAL "win32" )
string(REGEX MATCH "^[msw|qt|gtk]*" KICAD_WX_PORT "${WX_CONFIGURATION}")
if( KICAD_WX_PORT STREQUAL "qt" )
add_compile_definitions( __WXQT__ )
elseif( KICAD_WX_PORT STREQUAL "gtk" )
add_compile_definitions( __WXGTK__ )
endif()
elseif( _wx_selected_config )
string(REGEX MATCH "^[msw|qt|gtk|osx]*" KICAD_WX_PORT "${_wx_selected_config}")
endif()
if( KICAD_WX_PORT )
message( STATUS "Detected wxWidgets port: ${KICAD_WX_PORT}")
else()
message( FATAL_ERROR "Unable to detect wxWidgets port")
endif()
if( NOT MSVC )
if( ${wxWidgets_VERSION_STRING} VERSION_LESS 3.2 )
message( FATAL_ERROR "wxWidgets 3.2.0 or greater is required" )
@@ -1125,10 +1051,6 @@ if( KICAD_USE_SENTRY )
add_compile_definitions( KICAD_USE_SENTRY )
endif()
if( KICAD_IPC_API )
find_package( nng REQUIRED )
endif()
#================================================
# Add the doxygen target
#================================================
@@ -1167,7 +1089,6 @@ list( APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure" )
#================================================
# Binaries ( CMake targets )
add_subdirectory( api )
add_subdirectory( resources )
add_subdirectory( thirdparty )
add_subdirectory( libs )
@@ -1182,7 +1103,7 @@ add_subdirectory( bitmap2component )
add_subdirectory( pcb_calculator )
add_subdirectory( plugins ) # 3D plugins must be built before kicad
add_subdirectory( cvpcb ) # must be after pcbnew
add_subdirectory( kicad ) # should follow pcbnew, eeschema, api
add_subdirectory( kicad ) # should follow pcbnew, eeschema
add_subdirectory( tools )
add_subdirectory( utils )
-56
View File
@@ -1,56 +0,0 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"cacheVariables": {
"KICAD_BUILD_QA_TESTS": "OFF",
"KICAD_BUILD_I18N": "ON",
"KICAD_SCRIPTING_WXPYTHON": "ON"
}
},
{
"name": "win64",
"hidden": true,
"cacheVariables": {
"KICAD_WIN32_DPI_AWARE": "ON",
"CMAKE_INSTALL_PREFIX": "out",
"CMAKE_PDB_OUTPUT_DIRECTORY": "out/pdb"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"inherits": [
"base"
]
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"description": "Sets debug build type and x64 arch",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
"description": "Sets release build type",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
}
]
}
-133
View File
@@ -1,133 +0,0 @@
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2023 KiCad Developers, see AUTHORS.TXT for contributors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# Search paths for protoc when generating code
set( Protobuf_IMPORT_DIRS ${Protobuf_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proto )
set( KIAPI_PROTO_SRCS
common/envelope.proto
common/types/base_types.proto
common/types/enums.proto
common/types/project_settings.proto
common/commands/base_commands.proto
common/commands/editor_commands.proto
common/commands/project_commands.proto
board/board.proto
board/board_commands.proto
board/board_types.proto
schematic/schematic_types.proto
schematic/schematic_commands.proto
)
# Generated C++ code must be in the build dir; it is dependent on the version of protoc installed
set( KIAPI_CPP_BASEPATH ${CMAKE_CURRENT_BINARY_DIR}/cpp/api )
foreach( PROTO_SRC ${KIAPI_PROTO_SRCS} )
string( REGEX REPLACE "\.proto$" ".pb.cc" CPP_SRC ${PROTO_SRC} )
string( REGEX REPLACE "\.proto$" ".pb.h" CPP_HEADER ${PROTO_SRC} )
set( KIAPI_CPP_SRCS ${KIAPI_CPP_SRCS} ${KIAPI_CPP_BASEPATH}/${CPP_SRC} )
set( KIAPI_CPP_HEADERS ${KIAPI_CPP_HEADERS} ${KIAPI_CPP_BASEPATH}/${CPP_HEADER} )
set( KIAPI_PROTO_SRC_FULLPATHS ${KIAPI_PROTO_SRC_FULLPATHS} ${CMAKE_CURRENT_SOURCE_DIR}/proto/${PROTO_SRC} )
endforeach ()
add_custom_command( COMMAND ${CMAKE_COMMAND} -E make_directory ${KIAPI_CPP_BASEPATH}
COMMAND ${Protobuf_PROTOC_EXECUTABLE}
--cpp_out=dllexport_decl=KIAPI_IMPORTEXPORT:${KIAPI_CPP_BASEPATH}
--proto_path=${CMAKE_CURRENT_SOURCE_DIR}/proto
${KIAPI_PROTO_SRCS}
COMMENT "Generating API protobuf source files from proto definitions..."
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${KIAPI_PROTO_SRC_FULLPATHS}
OUTPUT ${KIAPI_CPP_SRCS} ${KIAPI_CPP_HEADERS}
)
# kiapi must be a shared DLL because the protobuf messages can only be initialized once
add_library( kiapi SHARED
${CMAKE_CURRENT_SOURCE_DIR}/../include/import_export.h
${KIAPI_CPP_SRCS}
${KIAPI_CPP_HEADERS}
)
target_compile_definitions( kiapi PRIVATE KIAPI_IMPORTEXPORT=APIEXPORT )
target_compile_definitions( kiapi INTERFACE KIAPI_IMPORTEXPORT=APIIMPORT )
# https://groups.google.com/g/protobuf/c/PDR1bqRazts
if(MSVC)
target_compile_options( kiapi PRIVATE /FI${CMAKE_CURRENT_SOURCE_DIR}/../include/import_export.h )
else()
add_definitions( -include ${CMAKE_CURRENT_SOURCE_DIR}/../include/import_export.h )
endif()
if( APPLE )
# puts library into the main kicad.app bundle in build tree
set_target_properties( kiapi PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${OSX_BUNDLE_BUILD_LIB_DIR}"
INSTALL_NAME_DIR "${OSX_BUNDLE_BUILD_LIB_DIR}"
)
endif()
install( TARGETS
kiapi
RUNTIME DESTINATION ${KICAD_LIB}
LIBRARY DESTINATION ${KICAD_LIB}
COMPONENT binary
)
if( KICAD_WIN32_INSTALL_PDBS )
# Get the PDBs to copy over for MSVC
install(FILES $<TARGET_PDB_FILE:kiapi> DESTINATION ${KICAD_BIN})
endif()
# Because CMake doesn't guess this from the .cc extension generated by protoc
set_target_properties( kiapi PROPERTIES LINKER_LANGUAGE CXX )
include( ${KICAD_CMAKE_MODULE_PATH}/KiCadVersion.cmake )
# Extract the major and minor build version as a string
string( REGEX MATCH
"([0-9]+)\\.([0-9]+)\\.([0-9]+)"
KICAD_MAJOR_MINOR_PATCH_VERSION
"${KICAD_VERSION}"
)
set_target_properties( kiapi PROPERTIES SOVERSION ${KICAD_MAJOR_MINOR_PATCH_VERSION} )
target_include_directories( kiapi SYSTEM PUBLIC ${Protobuf_INCLUDE_DIRS} )
target_link_libraries( kiapi protobuf::libprotobuf )
target_include_directories( kiapi INTERFACE
${CMAKE_CURRENT_BINARY_DIR}/cpp # Leaving off the /api/ to make #include statments less ambiguous
)
# Because when building internally, the generated files do not include the "api" base path
target_include_directories( kiapi PUBLIC ${KIAPI_CPP_BASEPATH} )
if( APPLE )
# puts library into the main kicad.app bundle in build tree
set_target_properties( kiapi PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${OSX_BUNDLE_BUILD_LIB_DIR}"
INSTALL_NAME_DIR "${OSX_BUNDLE_BUILD_LIB_DIR}"
)
set_target_properties( kiapi PROPERTIES INSTALL_RPATH
"@executable_path/../Frameworks" )
set_target_properties( kiapi PROPERTIES BUILD_WITH_INSTALL_RPATH 1 )
endif()
-116
View File
@@ -1,116 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
package kiapi.board;
import "common/types/base_types.proto";
import "board/board_types.proto";
message BoardFinish
{
string type_name = 1;
}
message BoardImpedanceControl
{
bool is_controlled = 1;
}
message BoardEdgeConnector
{
}
message Castellation
{
bool has_castellated_pads = 1;
}
message EdgePlating
{
bool has_edge_plating = 1;
}
message BoardEdgeSettings
{
BoardEdgeConnector connector = 1;
Castellation castellation = 2;
EdgePlating plating = 3;
}
message BoardStackupCopperLayer
{
}
message BoardStackupLayer
{
kiapi.common.types.Distance thickness = 1;
kiapi.board.types.BoardLayer layer = 2;
bool enabled = 3;
oneof item {
BoardStackupCopperLayer copper = 4;
}
}
message BoardStackup
{
BoardFinish finish = 1;
BoardImpedanceControl impedance = 2;
// NOTE: m_HasThicknessConstrains appears to be unused
BoardEdgeSettings edge = 3;
repeated BoardStackupLayer layers = 4;
}
// LAYER_CLASS_* in BOARD_DESIGN_SETTINGS -- needs to become an enum class
enum BoardLayerClass
{
BLC_UNKNOWN = 0;
BLC_SILKSCREEN = 1;
BLC_COPPER = 2;
BLC_EDGES = 3;
BLC_COURTYARD = 4;
BLC_FABRICATION = 5;
BLC_OTHER = 6;
}
message BoardLayerGraphicsDefaults
{
BoardLayerClass layer = 1;
kiapi.common.types.TextAttributes text = 2;
kiapi.common.types.Distance line_thickness = 3;
}
message GraphicsDefaults
{
repeated BoardLayerGraphicsDefaults layers = 1;
}
// Anything that isn't stackup or design rules
message BoardSettings
{
GraphicsDefaults graphics_defaults = 1;
// Dimension default settings
}
message BoardDesignRules
{
}
-151
View File
@@ -1,151 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
package kiapi.board.commands;
import "common/types/base_types.proto";
import "common/types/enums.proto";
import "board/board.proto";
import "board/board_types.proto";
/*
* Board stackup and properties
*/
message GetBoardStackup
{
kiapi.common.types.DocumentSpecifier board = 1;
}
message BoardStackupResponse
{
kiapi.board.BoardStackup stackup = 1;
}
message UpdateBoardStackup
{
kiapi.common.types.DocumentSpecifier board = 1;
kiapi.board.BoardStackup stackup = 2;
}
message GetGraphicsDefaults
{
kiapi.common.types.DocumentSpecifier board = 1;
}
message GraphicsDefaultsResponse
{
kiapi.board.GraphicsDefaults defaults = 1;
}
/*
* Net management
*/
message GetNets
{
kiapi.common.types.DocumentSpecifier board = 1;
// If provided, will only return nets that belong to the given netclass.
// If more than one netclass_filter is given, nets belonging to any of the given classes will
// be returned.
repeated string netclass_filter = 2;
}
message NetsResponse
{
repeated kiapi.board.types.Net nets = 1;
}
// Retrieve all the copper items belonging to a certain net or set of nets
// returns kiapi.common.commands.GetItemsResponse
message GetItemsByNet
{
// Specifies which document to query, which fields to return, etc.
kiapi.common.types.ItemHeader header = 1;
// List of one or more types of items to retreive
repeated kiapi.common.types.KiCadObjectType types = 2;
// A list of net codes to filter items by
repeated kiapi.board.types.NetCode net_codes = 3;
}
// Retrieve all the copper items belonging to a certain net class or set of net classes
// returns kiapi.common.commands.GetItemsResponse
message GetItemsByNetClass
{
// Specifies which document to query, which fields to return, etc.
kiapi.common.types.ItemHeader header = 1;
// List of one or more types of items to retreive
repeated kiapi.common.types.KiCadObjectType types = 2;
// A list of net class names to filter items by
repeated string net_classes = 3;
}
/*
* Blocking operations
*/
// Refills some or all zones on the board.
// This is a blocking operation; it will return Empty immediately, but KiCad will return
// ApiStatusCode.AS_BUSY to all future API requests until the zone fill has completed.
message RefillZones
{
kiapi.common.types.DocumentSpecifier board = 1;
// A list of zones to refill. If empty, all zones are refilled.
repeated kiapi.common.types.KIID zones = 2;
}
/*
* Utilities
*/
// returns kiapi.common.commands.BoundingBoxResponse
message GetTextExtents
{
// A temporary text item to calculate the bounding box for
kiapi.board.types.Text text = 1;
}
//// Interactive commands ////
// These commands begin an interactive operation in the editor.
// They return a response immediately, but the editor will become busy
// and will not reply to further API commands until the user has finished
// the operation.
// These commands will return an error if received in a non-interactive context.
// Selects and begins an interactive move of the given item(s).
// NOTE: Takes ownership of the active commit, if one exists:
// the move tool will push the commit when the user confirms the move,
// or roll back the commit if the user cancels the move. Keep this in
// mind if using this command in combination with commands that create
// or modify items using an explicit commit.
message InteractiveMoveItems
{
kiapi.common.types.DocumentSpecifier board = 1;
repeated kiapi.common.types.KIID items = 2;
}
-515
View File
@@ -1,515 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
package kiapi.board.types;
import "google/protobuf/any.proto";
import "common/types/base_types.proto";
enum BoardLayer
{
BL_UNKNOWN = 0;
BL_UNDEFINED = 1;
BL_UNSELECTED = 2;
BL_F_Cu = 3;
BL_In1_Cu = 4;
BL_In2_Cu = 5;
BL_In3_Cu = 6;
BL_In4_Cu = 7;
BL_In5_Cu = 8;
BL_In6_Cu = 9;
BL_In7_Cu = 10;
BL_In8_Cu = 11;
BL_In9_Cu = 12;
BL_In10_Cu = 13;
BL_In11_Cu = 14;
BL_In12_Cu = 15;
BL_In13_Cu = 16;
BL_In14_Cu = 17;
BL_In15_Cu = 18;
BL_In16_Cu = 19;
BL_In17_Cu = 20;
BL_In18_Cu = 21;
BL_In19_Cu = 22;
BL_In20_Cu = 23;
BL_In21_Cu = 24;
BL_In22_Cu = 25;
BL_In23_Cu = 26;
BL_In24_Cu = 27;
BL_In25_Cu = 28;
BL_In26_Cu = 29;
BL_In27_Cu = 30;
BL_In28_Cu = 31;
BL_In29_Cu = 32;
BL_In30_Cu = 33;
BL_B_Cu = 34;
BL_B_Adhes = 35;
BL_F_Adhes = 36;
BL_B_Paste = 37;
BL_F_Paste = 38;
BL_B_SilkS = 39;
BL_F_SilkS = 40;
BL_B_Mask = 41;
BL_F_Mask = 42;
BL_Dwgs_User = 43;
BL_Cmts_User = 44;
BL_Eco1_User = 45;
BL_Eco2_User = 46;
BL_Edge_Cuts = 47;
BL_Margin = 48;
BL_B_CrtYd = 49;
BL_F_CrtYd = 50;
BL_B_Fab = 51;
BL_F_Fab = 52;
BL_User_1 = 53;
BL_User_2 = 54;
BL_User_3 = 55;
BL_User_4 = 56;
BL_User_5 = 57;
BL_User_6 = 58;
BL_User_7 = 59;
BL_User_8 = 60;
BL_User_9 = 61;
}
message NetCode
{
int32 value = 1;
}
// Describes a copper item's net
message Net
{
// A unique code representing this net
NetCode code = 1;
// Human-readable net name
string name = 2;
}
// Represents a track segment on a board
message Track
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 start = 2;
kiapi.common.types.Vector2 end = 3;
kiapi.common.types.Distance width = 4;
kiapi.common.types.LockedState locked = 5;
BoardLayer layer = 6;
Net net = 7;
}
// Represents an arc track (not a PCB_SHAPE in arc shape)
// Arc tracks in KiCad store start, midpoint, and end.
// All other values (center point, angles, etc) are inferred.
message Arc
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 start = 2;
kiapi.common.types.Vector2 mid = 3; // Arc midpoint
kiapi.common.types.Vector2 end = 4;
kiapi.common.types.Distance width = 5;
kiapi.common.types.LockedState locked = 6;
BoardLayer layer = 7;
Net net = 8;
}
// What copper layer shape mode the padstack uses
enum PadStackType
{
PST_UNKNOWN = 0;
// The same shape is used on all copper layers
PST_NORMAL = 1;
// The padstack uses up to three different shapes (F_Cu, inner layers, B_Cu)
PST_TOP_INNER_BOTTOM = 2;
// The padstack's shape may differ on arbitrary copper layers
PST_CUSTOM = 3;
}
enum UnconnectedLayerRemoval
{
ULR_UNKNOWN = 0;
// Keep annular rings on all layers
ULR_KEEP = 1;
// Remove annular rings on unconnected layers, including start and end layers.
ULR_REMOVE = 2;
// Remove annular rings on unconnected layers, but preserve start and end layers even if unconnected.
ULR_REMOVE_EXCEPT_START_AND_END = 3;
}
// The shape of a pad on a given layer
enum PadStackShape
{
PSS_UNKNOWN = 0;
PSS_CIRCLE = 1;
PSS_RECTANGLE = 2;
PSS_OVAL = 3;
PSS_TRAPEZOID = 4;
PSS_ROUNDRECT = 5;
PSS_CHAMFEREDRECT = 6;
PSS_CUSTOM = 7;
}
// Which corners are chamfered in a PSS_CHAMFEREDRECT
message ChamferedRectCorners
{
bool top_left = 1;
bool top_right = 2;
bool bottom_left = 3;
bool bottom_right = 4;
}
// The defintion of a padstack on a single layer
message PadStackLayer
{
// The board layers of this padstack entry
repeated BoardLayer layers = 1;
// The shape of the pad on this layer
PadStackShape shape = 2;
// The size (x and y) of the shape on this layer
kiapi.common.types.Vector2 size = 3;
// How much to round the corners of the shape by, as a fraction of min(size.x, size.y)
// Only used for PSS_ROUNDRECT or PSS_CHAMFEREDRECT
double corner_rounding_ratio = 4;
// How much to round the corners of the shape by, as a fraction of min(size.x, size.y)
// Only used for PSS_CHAMFEREDRECT
double chamfer_ratio = 5;
ChamferedRectCorners chamfered_corners = 6;
repeated GraphicShape custom_shapes = 7;
// If shape == PSS_CUSTOM, defines the shape of the anchor (only PSS_CIRCLE and PSS_RECTANGLE supported at present)
PadStackShape custom_anchor_shape = 8;
}
// A pad stack definition for a multilayer pad or via.
message PadStack
{
// What type of pad stack this represents.
PadStackType type = 1;
// Lowest (closest to F_Cu) layer this stack exists on. Ignored if type == PST_THROUGH.
BoardLayer start_layer = 2;
// Highest (closest to B_Cu) layer this stack exists on. Ignored if type == PST_THROUGH.
BoardLayer end_layer = 3;
// How to treat pad shapes on unconnected layers.
UnconnectedLayerRemoval unconnected_layer_removal = 4;
// The diameter, in x and y, of the pad's drilled hole, if this pad has a hole.
// x and y will be the same value if the hole is round.
kiapi.common.types.Vector2 drill_diameter = 5;
repeated PadStackLayer layers = 6;
// The overall rotation of this padstack (affects all layers)
kiapi.common.types.Angle angle = 7;
}
enum ViaType
{
VT_UNKNOWN = 0;
// Through vias always start on F_Cu and end on B_Cu
VT_THROUGH = 1;
// Blind/buried vias can have arbitrary start and end layers
VT_BLIND_BURIED = 2;
// Microvias, blind/buried vias, can have arbitrary start and end layers, but also have different
// size defaults and design rules
VT_MICRO = 3;
}
// Represents a via
message Via
{
// The unique identifier of the via
kiapi.common.types.KIID id = 1;
// The location of the via's center point
kiapi.common.types.Vector2 position = 2;
// The pad stack definition for this via.
PadStack pad_stack = 3;
kiapi.common.types.LockedState locked = 4;
Net net = 5;
ViaType type = 6;
}
message GraphicSegmentAttributes
{
kiapi.common.types.Vector2 start = 1;
kiapi.common.types.Vector2 end = 2;
}
message GraphicRectangleAttributes
{
kiapi.common.types.Vector2 top_left = 1;
kiapi.common.types.Vector2 bottom_right = 2;
}
message GraphicArcAttributes
{
kiapi.common.types.Vector2 start = 1;
kiapi.common.types.Vector2 mid = 2;
kiapi.common.types.Vector2 end = 3;
}
message GraphicCircleAttributes
{
kiapi.common.types.Vector2 center = 1;
// A point on the radius of the circle. This is stored instead of just a radius so that the point
// by which the user can adjust the circle radius is persisted.
kiapi.common.types.Vector2 radius_point = 2;
}
message GraphicBezierAttributes
{
kiapi.common.types.Vector2 start = 1;
kiapi.common.types.Vector2 control1 = 2;
kiapi.common.types.Vector2 control2 = 3;
kiapi.common.types.Vector2 end = 4;
}
message GraphicShape
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.LockedState locked = 2;
BoardLayer layer = 3;
Net net = 4;
kiapi.common.types.GraphicAttributes attributes = 5;
oneof geometry {
GraphicSegmentAttributes segment = 6;
GraphicRectangleAttributes rectangle = 7;
GraphicArcAttributes arc = 8;
GraphicCircleAttributes circle = 9;
kiapi.common.types.PolySet polygon = 10;
GraphicBezierAttributes bezier = 11;
}
}
// A board-specific text object, existing on a board layer
message Text
{
kiapi.common.types.Text text = 1;
BoardLayer layer = 2;
}
// A board-specific textbox, existing on a board layer
message TextBox
{
kiapi.common.types.TextBox textbox = 1;
BoardLayer layer = 2;
}
// NOTE: There has been some discussion about what to do with pad attributes and properties.
// This may be considered somewhat unstable until we decide what to do with the KiCad side.
// It is not clear what the set of mutually-exclusive pad types will be at the end of the day,
// versus what will be non-exclusive attributes/properties.
// For now, this maps to PAD_ATTRIB in KiCad.
enum PadType
{
PT_UNKNOWN = 0;
PT_PTH = 1;
PT_SMD = 2;
PT_EDGE_CONNECTOR = 3;
PT_NPTH = 4;
}
enum CustomPadShapeZoneFillStrategy
{
CPSZ_UNKNOWN = 0;
CPSZ_OUTLINE = 1;
CPSZ_CONVEXHULL = 2;
}
message ThermalSpokeSettings
{
int64 width = 1;
kiapi.common.types.Angle angle = 2;
int64 gap = 3;
}
message Pad
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.LockedState locked = 2;
string number = 3;
Net net = 4;
PadType type = 5;
PadStack pad_stack = 6;
// A pad's position is always relative to the parent footprint's origin
kiapi.common.types.Vector2 position = 7;
DesignRuleOverrides overrides = 8;
ThermalSpokeSettings thermal_spokes = 9;
}
// Copper zone, non-copper zone, or rule area
message Zone
{
// TODO
}
message Dimension
{
// TODO
}
message ReferenceImage
{
// TODO
}
message Group
{
// TODO
}
message FieldId
{
int32 id = 1;
}
message Field
{
FieldId id = 1;
string name = 2;
Text text = 3;
}
message Model3D
{
// TODO
}
enum FootprintMountingStyle
{
FMS_UNKNOWN = 0;
FMS_THROUGH_HOLE = 1;
FMS_SMD = 2;
FMS_UNSPECIFIED = 3;
}
message FootprintAttributes
{
string description = 1;
string keywords = 2;
bool not_in_schematic = 3;
bool exclude_from_position_files = 4;
bool exclude_from_bill_of_materials = 5;
bool exempt_from_courtyard_requirement = 6;
bool do_not_populate = 7;
FootprintMountingStyle mounting_style = 8;
}
// enum class ZONE_CONNECTION
enum ZoneConnectionStyle
{
ZCS_UNKNOWN = 0;
ZCS_INHERITED = 1;
ZCS_NONE = 2;
ZCS_THERMAL = 3;
ZCS_FULL = 4;
ZCS_PTH_THERMAL = 5; // Thermal reliefs for plated through holes, solid for SMD pads
}
message DesignRuleOverrides
{
// Copper-to-copper clearance override
kiapi.common.types.Distance clearance = 1;
// Solder mask expansion/contraction
kiapi.common.types.Distance solder_mask_margin = 2;
// Solder paste expansion/contraction
kiapi.common.types.Distance solder_paste_margin = 3;
// Solder paste expansion/contraction ratio
kiapi.common.types.Ratio solder_paste_margin_ratio = 4;
ZoneConnectionStyle zone_connection = 5;
}
message NetTieDefinition
{
repeated string pad_number = 1;
}
// A footprint definition (i.e. what would be in a library)
message Footprint
{
kiapi.common.types.LibraryIdentifier id = 1;
kiapi.common.types.Vector2 anchor = 2;
FootprintAttributes attributes = 3;
DesignRuleOverrides overrides = 4;
repeated NetTieDefinition net_ties = 5;
repeated BoardLayer private_layers = 6;
Field reference_field = 7;
Field value_field = 8;
Field datasheet_field = 9;
Field description_field = 10;
// All footprint items except for mandatory fields
repeated google.protobuf.Any items = 11;
}
// An instance of a footprint on a board
message FootprintInstance
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 position = 2;
kiapi.common.types.Angle orientation = 3;
BoardLayer layer = 4;
kiapi.common.types.LockedState locked = 5;
Footprint definition = 6;
Field reference_field = 7;
Field value_field = 8;
Field datasheet_field = 9;
Field description_field = 10;
FootprintAttributes attributes = 11;
DesignRuleOverrides overrides = 12;
}
@@ -1,299 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Commands and responses related to manipulating editor windows
*/
syntax = "proto3";
package kiapi.common.commands;
import "google/protobuf/any.proto";
import "common/types/base_types.proto";
import "common/types/enums.proto";
// Refreshes the given frame, if that frame is open
message RefreshEditor
{
kiapi.common.types.FrameType frame = 1;
}
// Retrieves a list of open documents of the given type
message GetOpenDocuments
{
// Which type of documents to query
kiapi.common.types.DocumentType type = 1;
}
message GetOpenDocumentsResponse
{
repeated kiapi.common.types.DocumentSpecifier documents = 1;
}
/*
* Runs a TOOL_ACTION using the TOOL_MANAGER of a given frame.
* WARNING: The TOOL_ACTIONs are specifically *not* an API.
* Command names may change as code is refactored, and commands may disappear.
* This API method is provided for low-level prototyping purposes only.
*/
message RunAction
{
string action = 1; // Action name, like "eeschema.InteractiveSelection.ClearSelection"
}
enum RunActionStatus
{
RAS_UNKNOWN = 0;
RAS_OK = 1; // The action was submitted successfully.
RAS_INVALID = 2; // The action was unknown for the targeted frame.
RAS_FRAME_NOT_OPEN = 3; // The targeted frame was not open when the call was submitted.
}
/*
* NOTE: At the moment, RAS_FRAME_NOT_OPEN won't be returned as the handler is inside the frame.
*/
message RunActionResponse
{
RunActionStatus status = 1;
}
/*
* Begins a staged set of changes. Any modifications made to a document through the API after this
* call will be saved to a pending commit, and will not appear in KiCad until a matching call to
* END_COMMIT.
*/
message BeginCommit
{
}
message BeginCommitResponse
{
// Opaque identifier tracking a commit
kiapi.common.types.KIID id = 1;
}
enum CommitAction
{
CMA_UNKNOWN = 0;
CMA_COMMIT = 1; // Commit the changes to the design
CMA_DROP = 2; // Cancel this commit
}
message EndCommit
{
// The ID that was given by BeginCommit
kiapi.common.types.KIID id = 1;
// What to do with this commit
CommitAction action = 2;
// Optional message describing this changeset
string message = 3;
}
message EndCommitResponse
{
}
// Creates new items on a given document
message CreateItems
{
// Specifies which document to create on, which fields are included, etc.
kiapi.common.types.ItemHeader header = 1;
// List of items to create
repeated google.protobuf.Any items = 2;
// Items may be created on a top-level document (sheet, board, etc) or inside a container
// (symbol, footprint). If this field is not empty, it holds the ID of a symbol or footprint
// that the items should be added to. This ID must be an existing symbol (for schematic
// documents) or footprint (for board documents). If the given container does not exist or is
// not the correct item type, the CreateItems call will fail.
kiapi.common.types.KIID container = 3;
}
enum ItemStatusCode
{
ISC_UNKNOWN = 0;
ISC_OK = 1; // The item was created or updated
ISC_INVALID_TYPE = 2; // The item's type is not valid for the given document
ISC_EXISTING = 3; // The item to be created had a specified KIID and that KIID was already in use
ISC_NONEXISTENT = 4; // The item to be updated did not exist in the given document
ISC_IMMUTABLE = 5; // The item to be updated is not allowed to be modified by the API
ISC_INVALID_DATA = 7; // The item to be created does not have valid data for the given document
}
// Per-item status feedback for creation and update calls
message ItemStatus
{
ItemStatusCode code = 1;
string error_message = 2;
}
message ItemCreationResult
{
ItemStatus status = 1;
// The created version of the item, including an updated KIID as applicable
google.protobuf.Any item = 2;
}
message CreateItemsResponse
{
// Specifies which document was modified, which fields are included in created_items, etc.
kiapi.common.types.ItemHeader header = 1;
// Status of the overall request; may return IRS_OK even if no items were created
kiapi.common.types.ItemRequestStatus status = 2;
// Status of each item to be created
repeated ItemCreationResult created_items = 3;
}
message GetItems
{
// Specifies which document to query, which fields to return, etc.
kiapi.common.types.ItemHeader header = 1;
// List of one or more types of items to retreive
repeated kiapi.common.types.KiCadObjectType types = 2;
}
message GetItemsResponse
{
// Specifies which document was modified, which fields are included in items, etc.
kiapi.common.types.ItemHeader header = 1;
// Status of the overall request; may return IRS_OK even if no items were retrieved
kiapi.common.types.ItemRequestStatus status = 2;
repeated google.protobuf.Any items = 3;
}
// Updates items in a given document
message UpdateItems
{
// Specifies which document to modify, which fields are included, etc.
kiapi.common.types.ItemHeader header = 1;
// List of items to modify
repeated google.protobuf.Any items = 2;
}
message ItemUpdateResult
{
ItemStatus status = 1;
// The update version of the item
google.protobuf.Any item = 2;
}
message UpdateItemsResponse
{
// Specifies which document was modified, which fields are included in updated_items, etc.
kiapi.common.types.ItemHeader header = 1;
// Status of the overall request; may return IRS_OK even if no items were modified
kiapi.common.types.ItemRequestStatus status = 2;
// Status of each item to be created
repeated ItemUpdateResult updated_items = 3;
}
// Deletes items in a given document
message DeleteItems
{
// Specifies which document to modify
kiapi.common.types.ItemHeader header = 1;
// List of item KIIDs to delete
repeated kiapi.common.types.KIID item_ids = 2;
}
enum ItemDeletionStatus
{
IDS_UNKNOWN = 0;
IDS_OK = 1;
IDS_NONEXISTENT = 2; // The item did not exist in the given document
IDS_IMMUTABLE = 3; // The item is not allowed to be modified by the API
}
message ItemDeletionResult
{
kiapi.common.types.KIID id = 1;
ItemDeletionStatus status = 2;
}
message DeleteItemsResponse
{
// Specifies which document was modified, etc.
kiapi.common.types.ItemHeader header = 1;
// Status of the overall request; may return IRS_OK even if no items were deleted
kiapi.common.types.ItemRequestStatus status = 2;
// Status of each item requested to be deleted
repeated ItemDeletionResult deleted_items = 3;
}
message GetItemBoundingBox
{
kiapi.common.types.ItemHeader header = 1;
kiapi.common.types.KIID id = 2;
}
message BoundingBoxResponse
{
kiapi.common.types.Vector2 position = 1;
kiapi.common.types.Vector2 size = 2;
}
// Tests if a certain point falls within tolerance of an item's geometry
message HitTest
{
kiapi.common.types.ItemHeader header = 1;
kiapi.common.types.KIID id = 2;
kiapi.common.types.Vector2 position = 3;
int32 tolerance = 4;
}
enum HitTestResult
{
HTR_UNKNOWN = 0;
HTR_NO_HIT = 1;
HTR_HIT = 2;
}
message HitTestResponse
{
HitTestResult result = 1;
}
-92
View File
@@ -1,92 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
package kiapi.common;
import "google/protobuf/any.proto";
enum ApiStatusCode
{
AS_UNKNOWN = 0;
AS_OK = 1; // Request succeeded
AS_TIMEOUT = 2; // Request timed out
AS_BAD_REQUEST = 3; // The request had invalid parameters or otherwise was illegal
AS_NOT_READY = 4; // KiCad has recently started and cannot handle API requests yet
AS_UNHANDLED = 5; // The request was not handled by KiCad
AS_TOKEN_MISMATCH = 6; // The kicad_token in the request didn't match this KiCad's token
AS_BUSY = 7; // KiCad is busy performing an operation and can't accept API commands
AS_UNIMPLEMENTED = 8; // The requested API call has not yet been implemented
}
/*
* For future expansion: any header fields that should be sent with a request
*/
message ApiRequestHeader
{
// An opaque string identifying a running instance of KiCad. If this is set to a non-empty
// string in an API request, KiCad will reject the request if the value doesn't match its own
// token. This can be used to let API clients make sure they are still talking to the same
// instance of KiCad if they are long-running.
string kicad_token = 1;
// A string identifying an API client. Should be set by the client to a value that is unique
// to a specific instance of a client, for example the package name of the client plus its
// process ID or a random string, e.g. "com.github.me.my_awesome_plugin-73951". The main purpose
// of this name is to identify the client in debug logs.
string client_name = 2;
}
/*
* The top-level envelope container for an API request (message from a client to the KiCad API server)
*/
message ApiRequest
{
ApiRequestHeader header = 1;
google.protobuf.Any message = 2;
}
/*
* For future expansion: any header fields that should be sent with a response
*/
message ApiResponseHeader
{
/// An opaque string identifying a running instance of KiCad.
string kicad_token = 1;
}
message ApiResponse
{
ApiResponseHeader header = 1;
ApiResponseStatus status = 2;
google.protobuf.Any message = 3;
}
message ApiResponseStatus
{
/// A code describing the category of error (or AS_OK if no error)
ApiStatusCode status = 1;
/// A human-readable description of the error, if any
string error_message = 2;
}
-334
View File
@@ -1,334 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* base_types.proto
* Includes types used in many parts of the API
*/
syntax = "proto3";
package kiapi.common.types;
import "google/protobuf/field_mask.proto";
import "common/types/enums.proto";
enum CommandStatus
{
CS_UNKNOWN = 0;
CS_OK = 1; // Command succeeded
CS_FAILED = 2; // Command failed
}
message CommandStatusResponse
{
CommandStatus status = 1;
}
/**
* Describes a particular version of KiCad
*/
message KiCadVersion
{
uint32 major = 1;
uint32 minor = 2;
uint32 patch = 3;
// Full identifier string, potentially containing git hashes, packager-added info, etc.
string full_version = 4;
}
/**
* Some commands are specific to a KiCad window (frame). This list contains all addressable frames.
*/
enum FrameType
{
FT_UNKNOWN = 0;
FT_PROJECT_MANAGER = 1;
FT_SCHEMATIC_EDITOR = 2;
FT_PCB_EDITOR = 3;
FT_SPICE_SIMULATOR = 4;
FT_SYMBOL_EDITOR = 5;
FT_FOOTPRINT_EDITOR = 6;
FT_DRAWING_SHEET_EDITOR = 7;
}
/**
* Describes a KIID, or UUID of an object in a KiCad editor model.
*/
message KIID
{
// The KIID's value in standard UUID format, stored as a string for easy portability
string value = 1;
}
/**
* Identifier for the type of document being targeted by a request
*/
enum DocumentType
{
DOCTYPE_UNKNOWN = 0;
DOCTYPE_SCHEMATIC = 1;
DOCTYPE_SYMBOL = 2;
DOCTYPE_PCB = 3;
DOCTYPE_FOOTPRINT = 4;
DOCTYPE_DRAWING_SHEET = 5;
}
/**
* Describes a KiCad LIB_ID; a unique identifier for a loaded symbol or footprint
*/
message LibraryIdentifier
{
// The library portion of the LIB_ID
string library_nickname = 1;
// The symbol or footprint name
string entry_name = 2;
}
/**
* Describes a unique sheet in a schematic
*/
message SheetPath
{
// The canonical path to the sheet. The first KIID will be the root sheet, etc.
repeated KIID path = 1;
// The path converted to a human readable form such as "/", "/child", or "/child/grandchild"
string path_human_readable = 2;
}
/**
* Describes a KiCad project
*/
message ProjectSpecifier
{
// The name of the project (without the kicad_pro extension)
string name = 1;
// The path to the project directory
string path = 2;
}
/**
* Describes a document that will be the target of a request
*/
message DocumentSpecifier
{
DocumentType type = 1;
oneof identifier
{
// If type == DT_SYMBOL or DT_FOOTPRINT, identifies a certain library entry
LibraryIdentifier lib_id = 2;
// If type == DT_SCHEMATIC, identifies a sheet with a given path
SheetPath sheet_path = 3;
// If type == DT_PCB, identifies a PCB with a given filename, e.g. "board.kicad_pcb"
string board_filename = 4;
}
ProjectSpecifier project = 5;
}
/**
* This header is included in requests and responses about item(s) in a document
*/
message ItemHeader
{
// Which document is this request targeting?
DocumentSpecifier document = 1;
// Which container within the document is this request targeting?
// If container is omitted or empty, the document is used as the container.
KIID container = 2;
// Which fields on the item(s) are included with this request or response
google.protobuf.FieldMask field_mask = 3;
}
/**
* Status of a request that included an ItemHeader
*/
enum ItemRequestStatus
{
IRS_UNKNOWN = 0;
IRS_OK = 1;
IRS_DOCUMENT_NOT_FOUND = 2; // The given document is not open in KiCad
IRS_FIELD_MASK_INVALID = 3; // The given field_mask contains invalid specifiers
}
// Describes a point or distance in 2D space. All coordinates are in nanometers.
message Vector2
{
int64 x_nm = 1;
int64 y_nm = 2;
}
// Describes a point or distance in 3D space. All coordinates are in nanometers.
message Vector3
{
int64 x_nm = 1;
int64 y_nm = 2;
int64 z_nm = 3;
}
// Describes a quantity of distance (size, length, etc). All coordinates are in nanometers.
message Distance
{
int64 value_nm = 1;
}
// Corresponds to EDA_ANGLE, where the underlying storage is degrees
message Angle
{
double value_degrees = 1;
}
// Represents a value from 0.0 to 1.0
message Ratio
{
double value = 1;
}
// Corresponds to COLOR4D. Each color channel is a double from 0.0 to 1.0.
message Color
{
double r = 1;
double g = 2;
double b = 3;
double a = 4;
}
// The formulation of arc that is used in KiCad core geometry code.
// Start, midpoint (on the arc) and end are stored. Angle, center point, etc are calculated.
message ArcStartMidEnd
{
Vector2 start = 1;
Vector2 mid = 2;
Vector2 end = 3;
}
message PolyLineNode
{
oneof geometry {
Vector2 point = 1;
ArcStartMidEnd arc = 2;
}
}
// Corresponds to class SHAPE_LINE_CHAIN: A closed or open polyline that can include arcs.
// For non-arc cases, each node is a point along the line. An implicit line segment exists
// between the last and first node if closed is true. When arcs are present, the arc start and
// end points are not duplicated by point nodes (meaning, for example, a rectangle with rounded
// corners could be represented with four arc nodes and no point nodes).
message PolyLine
{
repeated PolyLineNode nodes = 1;
bool closed = 2;
}
message PolygonWithHoles
{
PolyLine outline = 1;
repeated PolyLine holes = 2;
}
// Corresponds to SHAPE_POLY_SET: a set of polygons or polylines
message PolySet
{
repeated PolygonWithHoles polygons = 1;
}
// Describes whether or not an item is locked for editing or movement
enum LockedState
{
LS_UNKNOWN = 0;
LS_UNLOCKED = 1;
LS_LOCKED = 2;
}
message TextAttributes
{
string font_name = 1;
HorizontalAlignment horizontal_alignment = 2;
VerticalAlignment vertical_alignment = 3;
kiapi.common.types.Angle angle = 4;
double line_spacing = 5;
kiapi.common.types.Distance stroke_width = 6;
bool italic = 7;
bool bold = 8;
bool underlined = 9;
bool visible = 10;
bool mirrored = 11;
bool multiline = 12;
bool keep_upright = 13;
kiapi.common.types.Vector2 size = 14;
}
message Text
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 position = 2;
kiapi.common.types.TextAttributes attributes = 3;
kiapi.common.types.LockedState locked = 4;
string text = 5;
string hyperlink = 6;
bool knockout = 7;
}
message TextBox
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 top_left = 2;
kiapi.common.types.Vector2 bottom_right = 3;
kiapi.common.types.TextAttributes attributes = 4;
kiapi.common.types.LockedState locked = 5;
string text = 6;
}
message StrokeAttributes
{
Distance width = 1;
StrokeLineStyle style = 2;
Color color = 3;
}
enum GraphicFillType
{
GFT_UNKNOWN = 0;
GFT_UNFILLED = 1;
GFT_FILLED = 2;
}
message GraphicFillAttributes
{
GraphicFillType fill_type = 1;
// Color of the fill (not used in board and footprints)
Color color = 2;
}
message GraphicAttributes
{
StrokeAttributes stroke = 1;
GraphicFillAttributes fill = 2;
}
-119
View File
@@ -1,119 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* enums.proto
* Includes protobuf versions of common KiCad enums
*/
syntax = "proto3";
package kiapi.common.types;
// The set of object types (from KICAD_T) that are exposed to the API.
enum KiCadObjectType
{
KOT_UNKNOWN = 0;
KOT_PCB_FOOTPRINT = 1;
KOT_PCB_PAD = 2;
KOT_PCB_SHAPE = 3;
KOT_PCB_REFERENCE_IMAGE = 4;
KOT_PCB_FIELD = 5;
KOT_PCB_GENERATOR = 6;
KOT_PCB_TEXT = 7;
KOT_PCB_TEXTBOX = 8;
KOT_PCB_TABLE = 9;
KOT_PCB_TABLECELL = 10;
KOT_PCB_TRACE = 11;
KOT_PCB_VIA = 12;
KOT_PCB_ARC = 13;
KOT_PCB_MARKER = 14;
KOT_PCB_DIMENSION = 15;
KOT_PCB_ZONE = 16;
KOT_PCB_GROUP = 17;
KOT_SCH_MARKER = 18;
KOT_SCH_JUNCTION = 19;
KOT_SCH_NO_CONNECT = 20;
KOT_SCH_BUS_WIRE_ENTRY = 21;
KOT_SCH_BUS_BUS_ENTRY = 22;
KOT_SCH_LINE = 23;
KOT_SCH_SHAPE = 24;
KOT_SCH_BITMAP = 25;
KOT_SCH_TEXTBOX = 26;
KOT_SCH_TEXT = 27;
KOT_SCH_TABLE = 28;
KOT_SCH_TABLECELL = 29;
KOT_SCH_LABEL = 30;
KOT_SCH_GLOBAL_LABEL = 31;
KOT_SCH_HIER_LABEL = 32;
KOT_SCH_DIRECTIVE_LABEL = 33;
KOT_SCH_FIELD = 34;
KOT_SCH_SYMBOL = 35;
KOT_SCH_SHEET_PIN = 36;
KOT_SCH_SHEET = 37;
KOT_SCH_PIN = 38;
KOT_LIB_SYMBOL = 39;
// KOT_LIB_SHAPE = 40;
// KOT_LIB_TEXT = 41;
// KOT_LIB_TEXTBOX = 42;
// KOT_LIB_PIN = 43;
// KOT_LIB_FIELD = 44;
KOT_WSG_LINE = 45;
KOT_WSG_RECT = 46;
KOT_WSG_POLY = 47;
KOT_WSG_TEXT = 48;
KOT_WSG_BITMAP = 49;
KOT_WSG_PAGE = 50;
}
// Mapped to GR_TEXT_H_ALIGN_T
enum HorizontalAlignment
{
HA_UNKNOWN = 0;
HA_LEFT = 1;
HA_CENTER = 2;
HA_RIGHT = 3;
HA_INDETERMINATE = 4;
}
// Mapped to GR_TEXT_V_ALIGN_T
enum VerticalAlignment
{
VA_UNKNOWN = 0;
VA_TOP = 1;
VA_CENTER = 2;
VA_BOTTOM = 3;
VA_INDETERMINATE = 4;
}
// Mapped to LINE_STYLE
enum StrokeLineStyle
{
SLS_UNKNOWN = 0;
SLS_DEFAULT = 1;
SLS_SOLID = 2;
SLS_DASH = 3;
SLS_DOT = 4;
SLS_DASHDOT = 5;
SLS_DASHDOTDOT = 6;
}
@@ -1,35 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* project_settings.proto
* Messages that describes project settings shared between schematics and boards
*/
syntax = "proto3";
package kiapi.common.project;
message NetClass
{
// The name of the netclass (the literal string "Default" for the default netclass)
string name = 1;
}
@@ -1,24 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
package kiapi.schematic.types;
-75
View File
@@ -1,75 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
package kiapi.schematic.types;
import "common/types/base_types.proto";
enum SchematicLayer
{
SL_UNKNOWN = 0;
}
/// Represents a schematic line segment, which may be a wire, bus, or graphical line
message Line
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 start = 2;
kiapi.common.types.Vector2 end = 3;
/**
* One of: LAYER_BUS, LAYER_WIRE, LAYER_NOTES
*/
SchematicLayer layer = 4;
}
message Text
{
kiapi.common.types.Text text = 1;
}
message LocalLabel
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 position = 2;
Text text = 3;
}
message GlobalLabel
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 position = 2;
Text text = 3;
}
message HierarchicalLabel
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 position = 2;
Text text = 3;
}
message DirectiveLabel
{
kiapi.common.types.KIID id = 1;
kiapi.common.types.Vector2 position = 2;
Text text = 3;
}
-1
View File
@@ -52,7 +52,6 @@ add_executable( bitmap2component WIN32 MACOSX_BUNDLE
target_link_libraries( bitmap2component
common
kicommon
${wxWidgets_LIBRARIES}
potrace
)
+19
View File
@@ -69,6 +69,8 @@ static struct IFACE : public KIFACE_BASE
using namespace BMP2CMP;
static PGM_BASE* process;
KIFACE_BASE& Kiface()
{
@@ -80,10 +82,27 @@ KIFACE_BASE& Kiface()
// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKIWAYversion, PGM_BASE* aProgram )
{
process = (PGM_BASE*) aProgram;
return &kiface;
}
#if defined(BUILD_KIWAY_DLLS)
PGM_BASE& Pgm()
{
wxASSERT( process ); // KIFACE_GETTER has already been called.
return *process;
}
// Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face is run from a python script.
PGM_BASE* PgmOrNull()
{
return process;
}
#endif
bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
{
return start_common( aCtlBits );
+1 -3
View File
@@ -36,9 +36,7 @@ endfunction()
get_kicad_doc_version(KICAD_DOC_VERSION)
# copy and modify the "normal" Doxyfile
cmake_path(GET DOCSET_DOXYFILE PARENT_PATH OUTPUT_DIR)
file(MAKE_DIRECTORY ${OUTPUT_DIR})
file(COPY_FILE ${SRC_DOXYFILE} ${DOCSET_DOXYFILE})
file(COPY ${SRC_DOXYFILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(APPEND ${DOCSET_DOXYFILE} "
# Added for DocSet generation
-3
View File
@@ -53,9 +53,6 @@ if( MSVC )
# This is a workaround borrowed from https://github.com/dotnet/runtime/blob/main/eng/native/configurecompiler.cmake
# CMake currently cannot handle the fact that "armasm" is used in combination with standard MSVC "cl" for ARM targets
# So this is basically a hack (incombination with the MSVCAssemblyHelper.cmake) to make this all work
# This workaround can be removed when https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9326 is finally part of a
# cmake release AND when MSVC ships said cmake release
if(KICAD_BUILD_ARCH_ARM)
message( "Configuring ARM assembler" )
# Explicitly specify the assembler to be used for Arm32 compile
-1
View File
@@ -86,7 +86,6 @@ set( OCC_LIBS_POST_78
TKDEGLTF
TKDESTEP
TKDESTL
TKDEVRML
)
set(OCC_TYPE "OpenCASCADE Standard Edition")
+1 -1
View File
@@ -55,7 +55,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
find_program(SWIG_EXECUTABLE NAMES swig4.2 swig4.1 swig4.0 swig3.0 swig2.0 swig)
if(SWIG_EXECUTABLE)
execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
-26
View File
@@ -1,26 +0,0 @@
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_NNG nng)
endif (PKG_CONFIG_FOUND)
FIND_PATH(NNG_INCLUDE_DIR
NAMES
nng/nng.h
PATH_SUFFIXES
include
)
FIND_LIBRARY(NNG_LIBRARY
NAMES
nng
PATH_SUFFIXES
"lib"
"local/lib"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(nng
REQUIRED_VARS NNG_INCLUDE_DIR NNG_LIBRARY)
MARK_AS_ADVANCED(NNG_INCLUDE_DIR NNG_LIBRARY)
+1 -5
View File
@@ -523,8 +523,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
if(BUILD_SHARED_LIBS)
find_path(wxWidgets_LIB_DIR
NAMES
qtu/wx/setup.h
qtud/wx/setup.h
msw/wx/setup.h
mswd/wx/setup.h
mswu/wx/setup.h
@@ -542,8 +540,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
else()
find_path(wxWidgets_LIB_DIR
NAMES
qtu/wx/setup.h
qtud/wx/setup.h
msw/wx/setup.h
mswd/wx/setup.h
mswu/wx/setup.h
@@ -575,7 +571,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
endif()
# Search for available configuration types.
foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw qt qtd qtu qtud)
foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw)
set(WX_${CFG}_FOUND FALSE)
if(EXISTS ${WX_LIB_DIR}/${CFG})
list(APPEND WX_CONFIGURATION_LIST ${CFG})
+1 -1
View File
@@ -62,7 +62,7 @@ if( KICAD_TEST_XML_OUTPUT )
# Due to Boost issue in 1.62, have to use the --logger parameter, rather than
# separate --log_format, --log_sink, etc parameter
# https://svn.boost.org/trac10/ticket/12507
set(BOOST_TEST_PARAMS --logger=JUNIT,warning,${TEST_NAME}.boost-results.xml:HRF,message)
set(BOOST_TEST_PARAMS --logger=JUNIT,warning,${TEST_NAME}.boost-results.xml:HRF,warning)
endif()
# Add the test to the CTest registry
+2 -2
View File
@@ -2,7 +2,7 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2016 Wayne Stambaugh <stambaughw@gmail.com>
# Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
# Copyright (C) 2016-2024 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "8.99.0-unknown" )
set( KICAD_SEMANTIC_VERSION "8.0.7" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
-2
View File
@@ -272,6 +272,4 @@ if( MSVC )
string( APPEND WARN_FLAGS_CXX " /wd4668" )
# disable "definition of implicit copy constructor for 'X' is deprecated because it has a user-provided destructor"
string( APPEND WARN_FLAGS_CXX " /wd5267" )
# disable "reinterpret_cast used between related classes"
string( APPEND WARN_FLAGS_CXX " /wd4946" )
endif()
+71 -120
View File
@@ -41,11 +41,24 @@ add_custom_target(
-DSRC_PATH=${PROJECT_SOURCE_DIR}
-DKICAD_CMAKE_MODULE_PATH=${KICAD_CMAKE_MODULE_PATH}
-P ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/WriteVersionHeader.cmake
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} BYPRODUCTS ${CMAKE_BINARY_DIR}/kicad_build_version.h
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
BYPRODUCTS ${CMAKE_BINARY_DIR}/kicad_build_version.h
DEPENDS ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/WriteVersionHeader.cmake
COMMENT "Generating version string header"
)
# A shared library subsetted from common which restricts what can go into
# a single_top link image. By not linking to common, we control what does
# statically go into single_top link images. My current thinking is that only
# wxWidgets should be a shared link from single top, everything else should be
# statically bound into it. Otherwise you will have DSO loading probs. After it
# sets the LIB PATHS however, we want the *.kiface modules to use shared linking.
add_library( singletop STATIC EXCLUDE_FROM_ALL
eda_doc.cpp
kiway.cpp
kiway_holder.cpp )
# A shared library used by multiple *.kiface files and one or two program
# launchers. Object files can migrate into here over time, but only if they are
# surely needed and certainly used from more than one place without recompilation.
@@ -75,7 +88,6 @@ set( KICOMMON_SRCS
jobs/job_export_sch_pythonbom.cpp
jobs/job_fp_export_svg.cpp
jobs/job_fp_upgrade.cpp
jobs/job_pcb_render.cpp
jobs/job_pcb_drc.cpp
jobs/job_sch_erc.cpp
jobs/job_sym_export_svg.cpp
@@ -84,111 +96,45 @@ set( KICOMMON_SRCS
kicad_curl/kicad_curl.cpp
kicad_curl/kicad_curl_easy.cpp
settings/app_settings.cpp
settings/aui_settings.cpp
settings/bom_settings.cpp
settings/color_settings.cpp
settings/common_settings.cpp
settings/grid_settings.cpp
settings/json_settings.cpp
settings/kicad_settings.cpp
settings/nested_settings.cpp
settings/parameters.cpp
settings/settings_manager.cpp
project/board_project_settings.cpp
project/net_settings.cpp
project/project_archiver.cpp
project/project_file.cpp
project/project_local_settings.cpp
dialogs/dialog_migrate_settings.cpp
dialogs/dialog_migrate_settings_base.cpp
widgets/bitmap_button.cpp
widgets/kistatusbar.cpp
widgets/progress_reporter_base.cpp
widgets/std_bitmap_button.cpp
widgets/ui_common.cpp
database/database_lib_settings.cpp
advanced_config.cpp
asset_archive.cpp
array_axis.cpp
array_options.cpp
background_jobs_monitor.cpp
bitmap.cpp
bitmap_info.cpp
bitmap_store.cpp
build_version.cpp
common.cpp
config_params.cpp
confirm.cpp
dialog_shim.cpp
dsnlexer.cpp
eda_pattern_match.cpp
eda_units.cpp
env_vars.cpp
exceptions.cpp
gestfich.cpp
json_conversions.cpp
kidialog.cpp
kiid.cpp
kiway.cpp
kiway_express.cpp
kiway_holder.cpp
launch_ext.cpp
lib_table_base.cpp
layer_id.cpp
lib_id.cpp
locale_io.cpp
lset.cpp
markup_parser.cpp
netclass.cpp
notifications_manager.cpp
page_info.cpp
paths.cpp
project.cpp
richio.cpp
search_stack.cpp
searchhelpfilefullpath.cpp
string_utils.cpp
systemdirsappend.cpp
ui_events.cpp
trace_helpers.cpp
wildcards_and_files_ext.cpp
wx_filename.cpp
pgm_base.cpp
../scripting/python_scripting.cpp
io/kicad/kicad_io_utils.cpp # needed by richio
)
if( KICAD_IPC_API )
set( KICOMMON_SRCS
${KICOMMON_SRCS}
api/api_handler.cpp
api/api_handler_common.cpp
api/api_plugin.cpp
api/api_plugin_manager.cpp
api/api_server.cpp
../scripting/python_manager.cpp
)
endif()
add_library( kicommon SHARED
${KICOMMON_SRCS}
)
set_target_properties(kicommon PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries( kicommon
core
kiapi
kimath
kiplatform
nlohmann_json
@@ -204,25 +150,8 @@ target_link_libraries( kicommon
${FREETYPE_LIBRARIES}
${HarfBuzz_LIBRARIES}
${Fontconfig_LIBRARIES}
# needed because of python_scripting.cpp
${PYTHON_LIBRARIES}
)
if( KICAD_USE_SENTRY )
target_link_libraries( kicommon
sentry )
set_property(SOURCE pgm_base.cpp APPEND PROPERTY COMPILE_DEFINITIONS KICAD_SENTRY_DSN="${KICAD_SENTRY_DSN}")
endif()
if( KICAD_IPC_API )
target_link_libraries( kicommon
kinng
)
endif()
include( ${KICAD_CMAKE_MODULE_PATH}/KiCadVersion.cmake )
include( ${KICAD_CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
create_git_version_header(${CMAKE_SOURCE_DIR})
@@ -262,10 +191,7 @@ target_include_directories( kicommon
PUBLIC
.
${CMAKE_BINARY_DIR}
$<TARGET_PROPERTY:magic_enum,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:pegtl,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:expected,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:kiapi,INTERFACE_INCLUDE_DIRECTORIES>
)
add_dependencies( kicommon pegtl version_header )
@@ -313,6 +239,8 @@ set( COMMON_DLG_SRCS
dialogs/dialog_import_choose_project_base.cpp
dialogs/dialog_locked_items_query.cpp
dialogs/dialog_locked_items_query_base.cpp
dialogs/dialog_migrate_settings.cpp
dialogs/dialog_migrate_settings_base.cpp
dialogs/dialog_page_settings_base.cpp
dialogs/dialog_paste_special.cpp
dialogs/dialog_paste_special_base.cpp
@@ -347,8 +275,6 @@ set( COMMON_DLG_SRCS
dialogs/panel_mouse_settings_base.cpp
dialogs/panel_packages_and_updates.cpp
dialogs/panel_packages_and_updates_base.cpp
dialogs/panel_plugin_settings.cpp
dialogs/panel_plugin_settings_base.cpp
dialogs/panel_setup_netclasses.cpp
dialogs/panel_setup_netclasses_base.cpp
dialogs/panel_setup_severities.cpp
@@ -364,6 +290,7 @@ endif()
set( COMMON_WIDGET_SRCS
widgets/app_progress_dialog.cpp
widgets/bitmap_button.cpp
widgets/bitmap_toggle.cpp
widgets/button_row_panel.cpp
widgets/color_swatch.cpp
@@ -384,6 +311,7 @@ set( COMMON_WIDGET_SRCS
widgets/html_window.cpp
widgets/indicator_icon.cpp
widgets/wx_infobar.cpp
widgets/kistatusbar.cpp
widgets/layer_box_selector.cpp
widgets/lib_tree.cpp
widgets/mathplot.cpp
@@ -397,6 +325,7 @@ set( COMMON_WIDGET_SRCS
widgets/split_button.cpp
widgets/stepped_slider.cpp
widgets/text_ctrl_eval.cpp
widgets/ui_common.cpp
widgets/unit_binder.cpp
widgets/widget_save_restore.cpp
widgets/widget_hotkey_list.cpp
@@ -515,12 +444,17 @@ set( COMMON_SRCS
${COMMON_IMPORT_GFX_SRCS}
${COMMON_GIT_SRCS}
jobs/job_dispatcher.cpp
background_jobs_monitor.cpp
base_screen.cpp
bin_mod.cpp
bitmap.cpp
bitmap_base.cpp
bitmap_store.cpp
board_printout.cpp
cli_progress_reporter.cpp
commit.cpp
common.cpp
dialog_shim.cpp
dpi_scaling_common.cpp
draw_panel_gal.cpp
gal_display_options_common.cpp
@@ -534,6 +468,7 @@ set( COMMON_SRCS
eda_text.cpp
eda_tools.cpp
env_paths.cpp
env_vars.cpp
executable_names.cpp
filename_resolver.cpp
file_history.cpp
@@ -541,27 +476,38 @@ set( COMMON_SRCS
footprint_filter.cpp
footprint_info.cpp
gbr_metadata.cpp
gestfich.cpp
gr_basic.cpp
grid_tricks.cpp
hotkey_store.cpp
hotkeys_basic.cpp
kiface_base.cpp
kiway.cpp
kiway_express.cpp
kiway_holder.cpp
kiway_player.cpp
launch_ext.cpp
lib_table_base.cpp
lib_table_grid_tricks.cpp
lib_tree_model.cpp
lib_tree_model_adapter.cpp
marker_base.cpp
notifications_manager.cpp
origin_transforms.cpp
printout.cpp
project.cpp
ptree.cpp
rc_item.cpp
refdes_utils.cpp
render_settings.cpp
reporter.cpp
scintilla_tricks.cpp
search_stack.cpp
searchhelpfilefullpath.cpp
status_popup.cpp
string_utf8_map.cpp
stroke_params.cpp
systemdirsappend.cpp
template_fieldnames.cpp
textentry_tricks.cpp
title_block.cpp
@@ -572,6 +518,16 @@ set( COMMON_SRCS
view/wx_view_controls.cpp
)
if( TRUE OR NOT USE_KIWAY_DLLS )
#if( NOT USE_KIWAY_DLLS )
# We DO NOT want pgm_base.cpp linked into the KIFACE, only into the KIWAY.
# Check the map files to verify eda_pgm.o not being linked in.
list( APPEND COMMON_SRCS pgm_base.cpp )
if( KICAD_USE_SENTRY )
set_property(SOURCE pgm_base.cpp APPEND PROPERTY COMPILE_DEFINITIONS KICAD_SENTRY_DSN="${KICAD_SENTRY_DSN}")
endif()
endif()
set( COMMON_SRCS
${COMMON_SRCS}
@@ -582,7 +538,6 @@ set( COMMON_SRCS
tool/action_toolbar.cpp
tool/actions.cpp
tool/common_control.cpp
tool/library_editor_control.cpp
tool/common_tools.cpp
tool/conditional_menu.cpp
tool/edit_constraints.cpp
@@ -606,7 +561,24 @@ set( COMMON_SRCS
tool/zoom_menu.cpp
tool/zoom_tool.cpp
settings/app_settings.cpp
settings/aui_settings.cpp
settings/bom_settings.cpp
settings/color_settings.cpp
settings/cvpcb_settings.cpp
settings/common_settings.cpp
settings/grid_settings.cpp
settings/json_settings.cpp
settings/nested_settings.cpp
settings/parameters.cpp
settings/settings_manager.cpp
settings/kicad_settings.cpp
project/board_project_settings.cpp
project/net_settings.cpp
project/project_archiver.cpp
project/project_file.cpp
project/project_local_settings.cpp
properties/color4d_variant.cpp
properties/eda_angle_variant.cpp
@@ -617,21 +589,13 @@ set( COMMON_SRCS
properties/std_optional_variants.cpp
database/database_connection.cpp
database/database_lib_settings.cpp
http_lib/http_lib_connection.cpp
http_lib/http_lib_settings.cpp
api/api_enums.cpp
api/api_utils.cpp
)
if( KICAD_IPC_API )
set( COMMON_SRCS
${COMMON_SRCS}
api/api_handler_editor.cpp
)
endif()
add_library( common STATIC
${COMMON_SRCS}
)
@@ -671,32 +635,28 @@ if( KICAD_USE_SENTRY )
sentry )
endif()
if( KICAD_IPC_API )
target_link_libraries( common
kinng
)
endif()
target_include_directories( common
PUBLIC
.
${CMAKE_BINARY_DIR}
$<TARGET_PROPERTY:argparse::argparse,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:kiapi,INTERFACE_INCLUDE_DIRECTORIES>
)
# text markup support
add_dependencies( common pegtl )
target_include_directories( common PUBLIC
$<TARGET_PROPERTY:pegtl,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:magic_enum,INTERFACE_INCLUDE_DIRECTORIES>
)
target_include_directories( common SYSTEM PUBLIC
$<TARGET_PROPERTY:nanodbc,INTERFACE_INCLUDE_DIRECTORIES>
)
target_include_directories( common PUBLIC
$<TARGET_PROPERTY:magic_enum,INTERFACE_INCLUDE_DIRECTORIES>
)
set( PCB_COMMON_SRCS
fp_lib_table.cpp
hash_eda.cpp
@@ -719,12 +679,9 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pad.cpp
${CMAKE_SOURCE_DIR}/pcbnew/padstack.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_reference_image.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_field.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_table.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_tablecell.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_text.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_textbox.cpp
${CMAKE_SOURCE_DIR}/pcbnew/project_pcb.cpp
@@ -785,12 +742,6 @@ set( PCB_COMMON_SRCS
widgets/net_selector.cpp
)
set( PCB_COMMON_SRCS
${PCB_COMMON_SRCS}
${CMAKE_SOURCE_DIR}/pcbnew/api/api_pcb_enums.cpp
${CMAKE_SOURCE_DIR}/pcbnew/api/api_pcb_utils.cpp
)
# add -DPCBNEW to compilation of these PCBNEW sources
set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
COMPILE_DEFINITIONS "PCBNEW"
@@ -817,7 +768,7 @@ add_dependencies( pcbcommon delaunator )
# The lemon grammar for the numeric evaluator
generate_lemon_grammar(
kicommon
common
libeval
libeval/numeric_evaluator.cpp
libeval/grammar.lemon
@@ -825,7 +776,7 @@ generate_lemon_grammar(
# The lemon grammar for the expression compiler
generate_lemon_grammar(
kicommon
common
libeval_compiler
libeval_compiler/libeval_compiler.cpp
libeval_compiler/grammar.lemon
+5 -22
View File
@@ -100,7 +100,6 @@ static const wxChar V3DRT_BevelExtentFactor[] = wxT( "V3DRT_BevelExtentFactor" )
static const wxChar UseClipper2[] = wxT( "UseClipper2" );
static const wxChar EnableGenerators[] = wxT( "EnableGenerators" );
static const wxChar EnableGit[] = wxT( "EnableGit" );
static const wxChar EnableLibWithText[] = wxT( "EnableLibWithText" );
static const wxChar EnableEeschemaPrintCairo[] = wxT( "EnableEeschemaPrintCairo" );
static const wxChar DisambiguationTime[] = wxT( "DisambiguationTime" );
static const wxChar PcbSelectionVisibilityRatio[] = wxT( "PcbSelectionVisibilityRatio" );
@@ -110,9 +109,7 @@ static const wxChar OcePluginAngularDeflection[] = wxT( "OcePluginAngularDeflect
static const wxChar TriangulateSimplificationLevel[] = wxT( "TriangulateSimplificationLevel" );
static const wxChar TriangulateMinimumArea[] = wxT( "TriangulateMinimumArea" );
static const wxChar EnableCacheFriendlyFracture[] = wxT( "EnableCacheFriendlyFracture" );
static const wxChar EnableAPILogging[] = wxT( "EnableAPILogging" );
static const wxChar MaxFileSystemWatchers[] = wxT( "MaxFileSystemWatchers" );
static const wxChar MinorSchematicGraphSize[] = wxT( "MinorSchematicGraphSize" );
static const wxChar MinParallelAngle[] = wxT( "MinParallelAngle" );
} // namespace KEYS
@@ -239,7 +236,6 @@ ADVANCED_CFG::ADVANCED_CFG()
m_ShowRepairSchematic = false;
m_EnableGenerators = false;
m_EnableGit = false;
m_EnableLibWithText = false;
m_EnableEeschemaPrintCairo = true;
@@ -247,7 +243,6 @@ ADVANCED_CFG::ADVANCED_CFG()
m_3DRT_BevelExtentFactor = 1.0 / 16.0;
m_UseClipper2 = true;
m_EnableAPILogging = false;
m_Use3DConnexionDriver = true;
@@ -267,9 +262,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_EnableCacheFriendlyFracture = true;
m_MaxFilesystemWatchers = 16384;
m_MinorSchematicGraphSize = 10000;
m_MinParallelAngle = 0.001;
loadFromConfigFile();
}
@@ -452,15 +445,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGenerators,
&m_EnableGenerators, m_EnableGenerators ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableAPILogging,
&m_EnableAPILogging, m_EnableAPILogging ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGit,
&m_EnableGit, m_EnableGit ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibWithText,
&m_EnableLibWithText, m_EnableLibWithText ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaPrintCairo,
&m_EnableEeschemaPrintCairo,
m_EnableEeschemaPrintCairo ) );
@@ -493,13 +480,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_EnableCacheFriendlyFracture,
m_EnableCacheFriendlyFracture ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaxFileSystemWatchers,
&m_MaxFilesystemWatchers, m_MaxFilesystemWatchers,
0, 2147483647 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MinorSchematicGraphSize,
&m_MinorSchematicGraphSize, m_MinorSchematicGraphSize,
0, 2147483647 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinParallelAngle,
&m_MinParallelAngle, m_MinParallelAngle,
0.0, 45.0 ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
-426
View File
@@ -1,426 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <api/api_enums.h>
#include <import_export.h>
#include <api/common/types/enums.pb.h>
#include <api/board/board_types.pb.h>
#include <api/schematic/schematic_types.pb.h>
#include <core/typeinfo.h>
#include <font/text_attributes.h>
#include <layer_ids.h>
#include <stroke_params.h>
using namespace kiapi;
using namespace kiapi::common;
template<>
KICAD_T FromProtoEnum( types::KiCadObjectType aValue )
{
switch( aValue )
{
case types::KiCadObjectType::KOT_PCB_FOOTPRINT: return PCB_FOOTPRINT_T;
case types::KiCadObjectType::KOT_PCB_PAD: return PCB_PAD_T;
case types::KiCadObjectType::KOT_PCB_SHAPE: return PCB_SHAPE_T;
case types::KiCadObjectType::KOT_PCB_REFERENCE_IMAGE: return PCB_REFERENCE_IMAGE_T;
case types::KiCadObjectType::KOT_PCB_FIELD: return PCB_FIELD_T;
case types::KiCadObjectType::KOT_PCB_GENERATOR: return PCB_GENERATOR_T;
case types::KiCadObjectType::KOT_PCB_TEXT: return PCB_TEXT_T;
case types::KiCadObjectType::KOT_PCB_TEXTBOX: return PCB_TEXTBOX_T;
case types::KiCadObjectType::KOT_PCB_TABLE: return PCB_TABLE_T;
case types::KiCadObjectType::KOT_PCB_TABLECELL: return PCB_TABLECELL_T;
case types::KiCadObjectType::KOT_PCB_TRACE: return PCB_TRACE_T;
case types::KiCadObjectType::KOT_PCB_VIA: return PCB_VIA_T;
case types::KiCadObjectType::KOT_PCB_ARC: return PCB_ARC_T;
case types::KiCadObjectType::KOT_PCB_MARKER: return PCB_MARKER_T;
case types::KiCadObjectType::KOT_PCB_DIMENSION: return PCB_DIMENSION_T;
case types::KiCadObjectType::KOT_PCB_ZONE: return PCB_ZONE_T;
case types::KiCadObjectType::KOT_PCB_GROUP: return PCB_GROUP_T;
case types::KiCadObjectType::KOT_SCH_MARKER: return SCH_MARKER_T;
case types::KiCadObjectType::KOT_SCH_JUNCTION: return SCH_JUNCTION_T;
case types::KiCadObjectType::KOT_SCH_NO_CONNECT: return SCH_NO_CONNECT_T;
case types::KiCadObjectType::KOT_SCH_BUS_WIRE_ENTRY: return SCH_BUS_WIRE_ENTRY_T;
case types::KiCadObjectType::KOT_SCH_BUS_BUS_ENTRY: return SCH_BUS_BUS_ENTRY_T;
case types::KiCadObjectType::KOT_SCH_LINE: return SCH_LINE_T;
case types::KiCadObjectType::KOT_SCH_SHAPE: return SCH_SHAPE_T;
case types::KiCadObjectType::KOT_SCH_BITMAP: return SCH_BITMAP_T;
case types::KiCadObjectType::KOT_SCH_TEXTBOX: return SCH_TEXTBOX_T;
case types::KiCadObjectType::KOT_SCH_TEXT: return SCH_TEXT_T;
case types::KiCadObjectType::KOT_SCH_TABLE: return SCH_TABLE_T;
case types::KiCadObjectType::KOT_SCH_TABLECELL: return SCH_TABLECELL_T;
case types::KiCadObjectType::KOT_SCH_LABEL: return SCH_LABEL_T;
case types::KiCadObjectType::KOT_SCH_GLOBAL_LABEL: return SCH_GLOBAL_LABEL_T;
case types::KiCadObjectType::KOT_SCH_HIER_LABEL: return SCH_HIER_LABEL_T;
case types::KiCadObjectType::KOT_SCH_DIRECTIVE_LABEL: return SCH_DIRECTIVE_LABEL_T;
case types::KiCadObjectType::KOT_SCH_FIELD: return SCH_FIELD_T;
case types::KiCadObjectType::KOT_SCH_SYMBOL: return SCH_SYMBOL_T;
case types::KiCadObjectType::KOT_SCH_SHEET_PIN: return SCH_SHEET_PIN_T;
case types::KiCadObjectType::KOT_SCH_SHEET: return SCH_SHEET_T;
case types::KiCadObjectType::KOT_SCH_PIN: return SCH_PIN_T;
case types::KiCadObjectType::KOT_LIB_SYMBOL: return LIB_SYMBOL_T;
case types::KiCadObjectType::KOT_WSG_LINE: return WSG_LINE_T;
case types::KiCadObjectType::KOT_WSG_RECT: return WSG_RECT_T;
case types::KiCadObjectType::KOT_WSG_POLY: return WSG_POLY_T;
case types::KiCadObjectType::KOT_WSG_TEXT: return WSG_TEXT_T;
case types::KiCadObjectType::KOT_WSG_BITMAP: return WSG_BITMAP_T;
case types::KiCadObjectType::KOT_WSG_PAGE: return WSG_PAGE_T;
case types::KiCadObjectType::KOT_UNKNOWN: return TYPE_NOT_INIT;
default:
wxCHECK_MSG( false, TYPE_NOT_INIT,
"Unhandled case in FromProtoEnum<types::KiCadObjectType>" );
}
}
template<>
types::KiCadObjectType ToProtoEnum( KICAD_T aValue )
{
switch( aValue )
{
case PCB_FOOTPRINT_T: return types::KiCadObjectType::KOT_PCB_FOOTPRINT;
case PCB_PAD_T: return types::KiCadObjectType::KOT_PCB_PAD;
case PCB_SHAPE_T: return types::KiCadObjectType::KOT_PCB_SHAPE;
case PCB_REFERENCE_IMAGE_T: return types::KiCadObjectType::KOT_PCB_REFERENCE_IMAGE;
case PCB_FIELD_T: return types::KiCadObjectType::KOT_PCB_FIELD;
case PCB_GENERATOR_T: return types::KiCadObjectType::KOT_PCB_GENERATOR;
case PCB_TEXT_T: return types::KiCadObjectType::KOT_PCB_TEXT;
case PCB_TEXTBOX_T: return types::KiCadObjectType::KOT_PCB_TEXTBOX;
case PCB_TABLE_T: return types::KiCadObjectType::KOT_PCB_TABLE;
case PCB_TABLECELL_T: return types::KiCadObjectType::KOT_PCB_TABLECELL;
case PCB_TRACE_T: return types::KiCadObjectType::KOT_PCB_TRACE;
case PCB_VIA_T: return types::KiCadObjectType::KOT_PCB_VIA;
case PCB_ARC_T: return types::KiCadObjectType::KOT_PCB_ARC;
case PCB_MARKER_T: return types::KiCadObjectType::KOT_PCB_MARKER;
case PCB_DIMENSION_T: return types::KiCadObjectType::KOT_PCB_DIMENSION;
case PCB_ZONE_T: return types::KiCadObjectType::KOT_PCB_ZONE;
case PCB_GROUP_T: return types::KiCadObjectType::KOT_PCB_GROUP;
case SCH_MARKER_T: return types::KiCadObjectType::KOT_SCH_MARKER;
case SCH_JUNCTION_T: return types::KiCadObjectType::KOT_SCH_JUNCTION;
case SCH_NO_CONNECT_T: return types::KiCadObjectType::KOT_SCH_NO_CONNECT;
case SCH_BUS_WIRE_ENTRY_T: return types::KiCadObjectType::KOT_SCH_BUS_WIRE_ENTRY;
case SCH_BUS_BUS_ENTRY_T: return types::KiCadObjectType::KOT_SCH_BUS_BUS_ENTRY;
case SCH_LINE_T: return types::KiCadObjectType::KOT_SCH_LINE;
case SCH_SHAPE_T: return types::KiCadObjectType::KOT_SCH_SHAPE;
case SCH_BITMAP_T: return types::KiCadObjectType::KOT_SCH_BITMAP;
case SCH_TEXTBOX_T: return types::KiCadObjectType::KOT_SCH_TEXTBOX;
case SCH_TEXT_T: return types::KiCadObjectType::KOT_SCH_TEXT;
case SCH_TABLE_T: return types::KiCadObjectType::KOT_SCH_TABLE;
case SCH_TABLECELL_T: return types::KiCadObjectType::KOT_SCH_TABLECELL;
case SCH_LABEL_T: return types::KiCadObjectType::KOT_SCH_LABEL;
case SCH_GLOBAL_LABEL_T: return types::KiCadObjectType::KOT_SCH_GLOBAL_LABEL;
case SCH_HIER_LABEL_T: return types::KiCadObjectType::KOT_SCH_HIER_LABEL;
case SCH_DIRECTIVE_LABEL_T: return types::KiCadObjectType::KOT_SCH_DIRECTIVE_LABEL;
case SCH_FIELD_T: return types::KiCadObjectType::KOT_SCH_FIELD;
case SCH_SYMBOL_T: return types::KiCadObjectType::KOT_SCH_SYMBOL;
case SCH_SHEET_PIN_T: return types::KiCadObjectType::KOT_SCH_SHEET_PIN;
case SCH_SHEET_T: return types::KiCadObjectType::KOT_SCH_SHEET;
case SCH_PIN_T: return types::KiCadObjectType::KOT_SCH_PIN;
case LIB_SYMBOL_T: return types::KiCadObjectType::KOT_LIB_SYMBOL;
case WSG_LINE_T: return types::KiCadObjectType::KOT_WSG_LINE;
case WSG_RECT_T: return types::KiCadObjectType::KOT_WSG_RECT;
case WSG_POLY_T: return types::KiCadObjectType::KOT_WSG_POLY;
case WSG_TEXT_T: return types::KiCadObjectType::KOT_WSG_TEXT;
case WSG_BITMAP_T: return types::KiCadObjectType::KOT_WSG_BITMAP;
case WSG_PAGE_T: return types::KiCadObjectType::KOT_WSG_PAGE;
default:
wxCHECK_MSG( false, types::KiCadObjectType::KOT_UNKNOWN,
"Unhandled case in ToProtoEnum<KICAD_T>");
}
}
template<>
PCB_LAYER_ID FromProtoEnum( board::types::BoardLayer aValue )
{
switch( aValue )
{
case board::types::BoardLayer::BL_UNDEFINED: return UNDEFINED_LAYER;
case board::types::BoardLayer::BL_UNSELECTED: return UNSELECTED_LAYER;
case board::types::BoardLayer::BL_F_Cu: return F_Cu;
case board::types::BoardLayer::BL_In1_Cu: return In1_Cu;
case board::types::BoardLayer::BL_In2_Cu: return In2_Cu;
case board::types::BoardLayer::BL_In3_Cu: return In3_Cu;
case board::types::BoardLayer::BL_In4_Cu: return In4_Cu;
case board::types::BoardLayer::BL_In5_Cu: return In5_Cu;
case board::types::BoardLayer::BL_In6_Cu: return In6_Cu;
case board::types::BoardLayer::BL_In7_Cu: return In7_Cu;
case board::types::BoardLayer::BL_In8_Cu: return In8_Cu;
case board::types::BoardLayer::BL_In9_Cu: return In9_Cu;
case board::types::BoardLayer::BL_In10_Cu: return In10_Cu;
case board::types::BoardLayer::BL_In11_Cu: return In11_Cu;
case board::types::BoardLayer::BL_In12_Cu: return In12_Cu;
case board::types::BoardLayer::BL_In13_Cu: return In13_Cu;
case board::types::BoardLayer::BL_In14_Cu: return In14_Cu;
case board::types::BoardLayer::BL_In15_Cu: return In15_Cu;
case board::types::BoardLayer::BL_In16_Cu: return In16_Cu;
case board::types::BoardLayer::BL_In17_Cu: return In17_Cu;
case board::types::BoardLayer::BL_In18_Cu: return In18_Cu;
case board::types::BoardLayer::BL_In19_Cu: return In19_Cu;
case board::types::BoardLayer::BL_In20_Cu: return In20_Cu;
case board::types::BoardLayer::BL_In21_Cu: return In21_Cu;
case board::types::BoardLayer::BL_In22_Cu: return In22_Cu;
case board::types::BoardLayer::BL_In23_Cu: return In23_Cu;
case board::types::BoardLayer::BL_In24_Cu: return In24_Cu;
case board::types::BoardLayer::BL_In25_Cu: return In25_Cu;
case board::types::BoardLayer::BL_In26_Cu: return In26_Cu;
case board::types::BoardLayer::BL_In27_Cu: return In27_Cu;
case board::types::BoardLayer::BL_In28_Cu: return In28_Cu;
case board::types::BoardLayer::BL_In29_Cu: return In29_Cu;
case board::types::BoardLayer::BL_In30_Cu: return In30_Cu;
case board::types::BoardLayer::BL_B_Cu: return B_Cu;
case board::types::BoardLayer::BL_B_Adhes: return B_Adhes;
case board::types::BoardLayer::BL_F_Adhes: return F_Adhes;
case board::types::BoardLayer::BL_B_Paste: return B_Paste;
case board::types::BoardLayer::BL_F_Paste: return F_Paste;
case board::types::BoardLayer::BL_B_SilkS: return B_SilkS;
case board::types::BoardLayer::BL_F_SilkS: return F_SilkS;
case board::types::BoardLayer::BL_B_Mask: return B_Mask;
case board::types::BoardLayer::BL_F_Mask: return F_Mask;
case board::types::BoardLayer::BL_Dwgs_User: return Dwgs_User;
case board::types::BoardLayer::BL_Cmts_User: return Cmts_User;
case board::types::BoardLayer::BL_Eco1_User: return Eco1_User;
case board::types::BoardLayer::BL_Eco2_User: return Eco2_User;
case board::types::BoardLayer::BL_Edge_Cuts: return Edge_Cuts;
case board::types::BoardLayer::BL_Margin: return Margin;
case board::types::BoardLayer::BL_B_CrtYd: return B_CrtYd;
case board::types::BoardLayer::BL_F_CrtYd: return F_CrtYd;
case board::types::BoardLayer::BL_B_Fab: return B_Fab;
case board::types::BoardLayer::BL_F_Fab: return F_Fab;
case board::types::BoardLayer::BL_User_1: return User_1;
case board::types::BoardLayer::BL_User_2: return User_2;
case board::types::BoardLayer::BL_User_3: return User_3;
case board::types::BoardLayer::BL_User_4: return User_4;
case board::types::BoardLayer::BL_User_5: return User_5;
case board::types::BoardLayer::BL_User_6: return User_6;
case board::types::BoardLayer::BL_User_7: return User_7;
case board::types::BoardLayer::BL_User_8: return User_8;
case board::types::BoardLayer::BL_User_9: return User_9;
case board::types::BoardLayer::BL_UNKNOWN: return UNDEFINED_LAYER;
default:
wxCHECK_MSG( false, UNDEFINED_LAYER,
"Unhandled case in FromProtoEnum<board::types::BoardLayer>" );
}
}
template<>
board::types::BoardLayer ToProtoEnum( PCB_LAYER_ID aValue )
{
switch( aValue )
{
case UNDEFINED_LAYER: return board::types::BoardLayer::BL_UNDEFINED;
case UNSELECTED_LAYER: return board::types::BoardLayer::BL_UNSELECTED;
case F_Cu: return board::types::BoardLayer::BL_F_Cu;
case In1_Cu: return board::types::BoardLayer::BL_In1_Cu;
case In2_Cu: return board::types::BoardLayer::BL_In2_Cu;
case In3_Cu: return board::types::BoardLayer::BL_In3_Cu;
case In4_Cu: return board::types::BoardLayer::BL_In4_Cu;
case In5_Cu: return board::types::BoardLayer::BL_In5_Cu;
case In6_Cu: return board::types::BoardLayer::BL_In6_Cu;
case In7_Cu: return board::types::BoardLayer::BL_In7_Cu;
case In8_Cu: return board::types::BoardLayer::BL_In8_Cu;
case In9_Cu: return board::types::BoardLayer::BL_In9_Cu;
case In10_Cu: return board::types::BoardLayer::BL_In10_Cu;
case In11_Cu: return board::types::BoardLayer::BL_In11_Cu;
case In12_Cu: return board::types::BoardLayer::BL_In12_Cu;
case In13_Cu: return board::types::BoardLayer::BL_In13_Cu;
case In14_Cu: return board::types::BoardLayer::BL_In14_Cu;
case In15_Cu: return board::types::BoardLayer::BL_In15_Cu;
case In16_Cu: return board::types::BoardLayer::BL_In16_Cu;
case In17_Cu: return board::types::BoardLayer::BL_In17_Cu;
case In18_Cu: return board::types::BoardLayer::BL_In18_Cu;
case In19_Cu: return board::types::BoardLayer::BL_In19_Cu;
case In20_Cu: return board::types::BoardLayer::BL_In20_Cu;
case In21_Cu: return board::types::BoardLayer::BL_In21_Cu;
case In22_Cu: return board::types::BoardLayer::BL_In22_Cu;
case In23_Cu: return board::types::BoardLayer::BL_In23_Cu;
case In24_Cu: return board::types::BoardLayer::BL_In24_Cu;
case In25_Cu: return board::types::BoardLayer::BL_In25_Cu;
case In26_Cu: return board::types::BoardLayer::BL_In26_Cu;
case In27_Cu: return board::types::BoardLayer::BL_In27_Cu;
case In28_Cu: return board::types::BoardLayer::BL_In28_Cu;
case In29_Cu: return board::types::BoardLayer::BL_In29_Cu;
case In30_Cu: return board::types::BoardLayer::BL_In30_Cu;
case B_Cu: return board::types::BoardLayer::BL_B_Cu;
case B_Adhes: return board::types::BoardLayer::BL_B_Adhes;
case F_Adhes: return board::types::BoardLayer::BL_F_Adhes;
case B_Paste: return board::types::BoardLayer::BL_B_Paste;
case F_Paste: return board::types::BoardLayer::BL_F_Paste;
case B_SilkS: return board::types::BoardLayer::BL_B_SilkS;
case F_SilkS: return board::types::BoardLayer::BL_F_SilkS;
case B_Mask: return board::types::BoardLayer::BL_B_Mask;
case F_Mask: return board::types::BoardLayer::BL_F_Mask;
case Dwgs_User: return board::types::BoardLayer::BL_Dwgs_User;
case Cmts_User: return board::types::BoardLayer::BL_Cmts_User;
case Eco1_User: return board::types::BoardLayer::BL_Eco1_User;
case Eco2_User: return board::types::BoardLayer::BL_Eco2_User;
case Edge_Cuts: return board::types::BoardLayer::BL_Edge_Cuts;
case Margin: return board::types::BoardLayer::BL_Margin;
case B_CrtYd: return board::types::BoardLayer::BL_B_CrtYd;
case F_CrtYd: return board::types::BoardLayer::BL_F_CrtYd;
case B_Fab: return board::types::BoardLayer::BL_B_Fab;
case F_Fab: return board::types::BoardLayer::BL_F_Fab;
case User_1: return board::types::BoardLayer::BL_User_1;
case User_2: return board::types::BoardLayer::BL_User_2;
case User_3: return board::types::BoardLayer::BL_User_3;
case User_4: return board::types::BoardLayer::BL_User_4;
case User_5: return board::types::BoardLayer::BL_User_5;
case User_6: return board::types::BoardLayer::BL_User_6;
case User_7: return board::types::BoardLayer::BL_User_7;
case User_8: return board::types::BoardLayer::BL_User_8;
case User_9: return board::types::BoardLayer::BL_User_9;
default:
wxCHECK_MSG( false, board::types::BoardLayer::BL_UNKNOWN,
"Unhandled case in ToProtoEnum<PCB_LAYER_ID>");
}
}
template<>
SCH_LAYER_ID FromProtoEnum( schematic::types::SchematicLayer aValue )
{
switch( aValue )
{
default:
wxCHECK_MSG( false, SCH_LAYER_ID_START,
"Unhandled case in FromProtoEnum<schematic::types::SchematicLayer>" );
}
}
template<>
schematic::types::SchematicLayer ToProtoEnum( SCH_LAYER_ID aValue )
{
switch( aValue )
{
default:
wxCHECK_MSG( false, schematic::types::SchematicLayer::SL_UNKNOWN,
"Unhandled case in ToProtoEnum<SCH_LAYER_ID>");
}
}
template<>
GR_TEXT_H_ALIGN_T FromProtoEnum( types::HorizontalAlignment aValue )
{
switch( aValue )
{
case types::HorizontalAlignment::HA_LEFT: return GR_TEXT_H_ALIGN_LEFT;
case types::HorizontalAlignment::HA_CENTER: return GR_TEXT_H_ALIGN_CENTER;
case types::HorizontalAlignment::HA_RIGHT: return GR_TEXT_H_ALIGN_RIGHT;
case types::HorizontalAlignment::HA_INDETERMINATE: return GR_TEXT_H_ALIGN_INDETERMINATE;
case types::HorizontalAlignment::HA_UNKNOWN: return GR_TEXT_H_ALIGN_CENTER;
default:
wxCHECK_MSG( false, GR_TEXT_H_ALIGN_CENTER,
"Unhandled case in FromProtoEnum<types::HorizontalAlignment>" );
}
}
template<>
types::HorizontalAlignment ToProtoEnum( GR_TEXT_H_ALIGN_T aValue )
{
switch( aValue )
{
case GR_TEXT_H_ALIGN_LEFT: return types::HorizontalAlignment::HA_LEFT;
case GR_TEXT_H_ALIGN_CENTER: return types::HorizontalAlignment::HA_CENTER;
case GR_TEXT_H_ALIGN_RIGHT: return types::HorizontalAlignment::HA_RIGHT;
case GR_TEXT_H_ALIGN_INDETERMINATE: return types::HorizontalAlignment::HA_INDETERMINATE;
default:
wxCHECK_MSG( false, types::HorizontalAlignment::HA_UNKNOWN,
"Unhandled case in ToProtoEnum<GR_TEXT_H_ALIGN_T>");
}
}
template<>
GR_TEXT_V_ALIGN_T FromProtoEnum( types::VerticalAlignment aValue )
{
switch( aValue )
{
case types::VerticalAlignment::VA_TOP: return GR_TEXT_V_ALIGN_TOP;
case types::VerticalAlignment::VA_CENTER: return GR_TEXT_V_ALIGN_CENTER;
case types::VerticalAlignment::VA_BOTTOM: return GR_TEXT_V_ALIGN_BOTTOM;
case types::VerticalAlignment::VA_INDETERMINATE: return GR_TEXT_V_ALIGN_INDETERMINATE;
case types::VerticalAlignment::VA_UNKNOWN: return GR_TEXT_V_ALIGN_CENTER;
default:
wxCHECK_MSG( false, GR_TEXT_V_ALIGN_CENTER,
"Unhandled case in FromProtoEnum<types::VerticalAlignment>" );
}
}
template<>
types::VerticalAlignment ToProtoEnum( GR_TEXT_V_ALIGN_T aValue )
{
switch( aValue )
{
case GR_TEXT_V_ALIGN_TOP: return types::VerticalAlignment::VA_TOP;
case GR_TEXT_V_ALIGN_CENTER: return types::VerticalAlignment::VA_CENTER;
case GR_TEXT_V_ALIGN_BOTTOM: return types::VerticalAlignment::VA_BOTTOM;
case GR_TEXT_V_ALIGN_INDETERMINATE: return types::VerticalAlignment::VA_INDETERMINATE;
default:
wxCHECK_MSG( false, types::VerticalAlignment::VA_UNKNOWN,
"Unhandled case in ToProtoEnum<GR_TEXT_V_ALIGN_T>");
}
}
template<>
LINE_STYLE FromProtoEnum( types::StrokeLineStyle aValue )
{
switch( aValue )
{
case types::StrokeLineStyle::SLS_DEFAULT: return LINE_STYLE::DEFAULT;
case types::StrokeLineStyle::SLS_SOLID: return LINE_STYLE::SOLID;
case types::StrokeLineStyle::SLS_DASH: return LINE_STYLE::DASH;
case types::StrokeLineStyle::SLS_DOT: return LINE_STYLE::DOT;
case types::StrokeLineStyle::SLS_DASHDOT: return LINE_STYLE::DASHDOT;
case types::StrokeLineStyle::SLS_DASHDOTDOT: return LINE_STYLE::DASHDOTDOT;
case types::StrokeLineStyle::SLS_UNKNOWN:
default:
wxCHECK_MSG( false, LINE_STYLE::DEFAULT,
"Unhandled case in FromProtoEnum<types::StrokeLineStyle>" );
}
}
template<>
types::StrokeLineStyle ToProtoEnum( LINE_STYLE aValue )
{
switch( aValue )
{
case LINE_STYLE::DEFAULT: return types::StrokeLineStyle::SLS_DEFAULT;
case LINE_STYLE::SOLID: return types::StrokeLineStyle::SLS_SOLID;
case LINE_STYLE::DASH: return types::StrokeLineStyle::SLS_DASH;
case LINE_STYLE::DOT: return types::StrokeLineStyle::SLS_DOT;
case LINE_STYLE::DASHDOT: return types::StrokeLineStyle::SLS_DASHDOT;
case LINE_STYLE::DASHDOTDOT: return types::StrokeLineStyle::SLS_DASHDOTDOT;
default:
wxCHECK_MSG( false, types::StrokeLineStyle::SLS_UNKNOWN,
"Unhandled case in ToProtoEnum<LINE_STYLE>");
}
}
-61
View File
@@ -1,61 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <api/api_handler.h>
#include <wx/wx.h>
using kiapi::common::ApiRequest, kiapi::common::ApiResponse, kiapi::common::ApiResponseStatus;
const wxString API_HANDLER::m_defaultCommitMessage = _( "Modification from API" );
API_RESULT API_HANDLER::Handle( ApiRequest& aMsg )
{
ApiResponseStatus status;
if( !aMsg.has_message() )
{
status.set_status( ApiStatusCode::AS_BAD_REQUEST );
status.set_error_message( "request has no inner message" );
return tl::unexpected( status );
}
std::string typeName;
if( !google::protobuf::Any::ParseAnyTypeUrl( aMsg.message().type_url(), &typeName ) )
{
status.set_status( ApiStatusCode::AS_BAD_REQUEST );
status.set_error_message( "could not parse inner message type" );
return tl::unexpected( status );
}
auto it = m_handlers.find( typeName );
if( it != m_handlers.end() )
{
REQUEST_HANDLER& handler = it->second;
return handler( aMsg );
}
status.set_status( ApiStatusCode::AS_UNHANDLED );
// This response is used internally; no need for an error message
return tl::unexpected( status );
}
-82
View File
@@ -1,82 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <tuple>
#include <api/api_handler_common.h>
#include <build_version.h>
#include <google/protobuf/empty.pb.h>
#include <pgm_base.h>
#include <project/net_settings.h>
#include <project/project_file.h>
#include <settings/settings_manager.h>
#include <wx/string.h>
using namespace kiapi::common::commands;
using namespace kiapi::common::types;
using google::protobuf::Empty;
API_HANDLER_COMMON::API_HANDLER_COMMON() :
API_HANDLER()
{
registerHandler<commands::GetVersion, GetVersionResponse>( &API_HANDLER_COMMON::handleGetVersion );
registerHandler<GetNetClasses, NetClassesResponse>( &API_HANDLER_COMMON::handleGetNetClasses );
registerHandler<Ping, Empty>( &API_HANDLER_COMMON::handlePing );
}
HANDLER_RESULT<GetVersionResponse> API_HANDLER_COMMON::handleGetVersion( commands::GetVersion&,
const HANDLER_CONTEXT& )
{
GetVersionResponse reply;
reply.mutable_version()->set_full_version( GetBuildVersion().ToStdString() );
std::tuple<int, int, int> version = GetMajorMinorPatchTuple();
reply.mutable_version()->set_major( std::get<0>( version ) );
reply.mutable_version()->set_minor( std::get<1>( version ) );
reply.mutable_version()->set_patch( std::get<2>( version ) );
return reply;
}
HANDLER_RESULT<NetClassesResponse> API_HANDLER_COMMON::handleGetNetClasses( GetNetClasses& aMsg,
const HANDLER_CONTEXT& aCtx )
{
NetClassesResponse reply;
std::shared_ptr<NET_SETTINGS>& netSettings =
Pgm().GetSettingsManager().Prj().GetProjectFile().m_NetSettings;
for( const auto& [name, netClass] : netSettings->m_NetClasses )
{
reply.add_net_classes()->set_name( name.ToStdString() );
}
return reply;
}
HANDLER_RESULT<Empty> API_HANDLER_COMMON::handlePing( Ping& aMsg, const HANDLER_CONTEXT& aCtx )
{
return Empty();
}
-353
View File
@@ -1,353 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <api/api_handler_editor.h>
#include <api/api_utils.h>
#include <eda_base_frame.h>
#include <eda_item.h>
#include <wx/wx.h>
using namespace kiapi::common::commands;
API_HANDLER_EDITOR::API_HANDLER_EDITOR( EDA_BASE_FRAME* aFrame ) :
API_HANDLER(),
m_frame( aFrame )
{
registerHandler<BeginCommit, BeginCommitResponse>( &API_HANDLER_EDITOR::handleBeginCommit );
registerHandler<EndCommit, EndCommitResponse>( &API_HANDLER_EDITOR::handleEndCommit );
registerHandler<CreateItems, CreateItemsResponse>( &API_HANDLER_EDITOR::handleCreateItems );
registerHandler<UpdateItems, UpdateItemsResponse>( &API_HANDLER_EDITOR::handleUpdateItems );
registerHandler<DeleteItems, DeleteItemsResponse>( &API_HANDLER_EDITOR::handleDeleteItems );
registerHandler<HitTest, HitTestResponse>( &API_HANDLER_EDITOR::handleHitTest );
}
HANDLER_RESULT<BeginCommitResponse> API_HANDLER_EDITOR::handleBeginCommit( BeginCommit& aMsg,
const HANDLER_CONTEXT& aCtx )
{
if( std::optional<ApiResponseStatus> busy = checkForBusy() )
return tl::unexpected( *busy );
if( m_commits.count( aCtx.ClientName ) )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BAD_REQUEST );
e.set_error_message( fmt::format( "the client {} already has a commit in progress",
aCtx.ClientName ) );
return tl::unexpected( e );
}
wxASSERT( !m_activeClients.count( aCtx.ClientName ) );
BeginCommitResponse response;
KIID id;
m_commits[aCtx.ClientName] = std::make_pair( id, createCommit() );
response.mutable_id()->set_value( id.AsStdString() );
m_activeClients.insert( aCtx.ClientName );
return response;
}
HANDLER_RESULT<EndCommitResponse> API_HANDLER_EDITOR::handleEndCommit( EndCommit& aMsg,
const HANDLER_CONTEXT& aCtx )
{
if( std::optional<ApiResponseStatus> busy = checkForBusy() )
return tl::unexpected( *busy );
if( !m_commits.count( aCtx.ClientName ) )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BAD_REQUEST );
e.set_error_message( fmt::format( "the client {} does not has a commit in progress",
aCtx.ClientName ) );
return tl::unexpected( e );
}
wxASSERT( m_activeClients.count( aCtx.ClientName ) );
const std::pair<KIID, std::unique_ptr<COMMIT>>& pair = m_commits.at( aCtx.ClientName );
const KIID& id = pair.first;
const std::unique_ptr<COMMIT>& commit = pair.second;
EndCommitResponse response;
// Do not check IDs with drop; it is a safety net in case the id was lost on the client side
switch( aMsg.action() )
{
case kiapi::common::commands::CMA_DROP:
{
commit->Revert();
m_commits.erase( aCtx.ClientName );
m_activeClients.erase( aCtx.ClientName );
break;
}
case kiapi::common::commands::CMA_COMMIT:
{
if( aMsg.id().value().compare( id.AsStdString() ) != 0 )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BAD_REQUEST );
e.set_error_message( fmt::format( "the id {} does not match the commit in progress",
aMsg.id().value() ) );
return tl::unexpected( e );
}
pushCurrentCommit( aCtx, wxString( aMsg.message().c_str(), wxConvUTF8 ) );
break;
}
default:
break;
}
return response;
}
COMMIT* API_HANDLER_EDITOR::getCurrentCommit( const HANDLER_CONTEXT& aCtx )
{
if( !m_commits.count( aCtx.ClientName ) )
{
KIID id;
m_commits[aCtx.ClientName] = std::make_pair( id, createCommit() );
}
return m_commits.at( aCtx.ClientName ).second.get();
}
void API_HANDLER_EDITOR::pushCurrentCommit( const HANDLER_CONTEXT& aCtx, const wxString& aMessage )
{
auto it = m_commits.find( aCtx.ClientName );
if( it == m_commits.end() )
return;
it->second.second->Push( aMessage.IsEmpty() ? m_defaultCommitMessage : aMessage );
m_commits.erase( it );
m_activeClients.erase( aCtx.ClientName );
}
HANDLER_RESULT<bool> API_HANDLER_EDITOR::validateDocument(
const kiapi::common::types::DocumentSpecifier& aDocument )
{
if( !validateDocumentInternal( aDocument ) )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BAD_REQUEST );
e.set_error_message( fmt::format( "the requested document {} is not open",
aDocument.board_filename() ) );
return tl::unexpected( e );
}
return true;
}
HANDLER_RESULT<std::optional<KIID>> API_HANDLER_EDITOR::validateItemHeaderDocument(
const kiapi::common::types::ItemHeader& aHeader )
{
if( !aHeader.has_document() || aHeader.document().type() != thisDocumentType() )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_UNHANDLED );
// No error message, this is a flag that the server should try a different handler
return tl::unexpected( e );
}
HANDLER_RESULT<bool> documentValidation = validateDocument( aHeader.document() );
if( !documentValidation )
return tl::unexpected( documentValidation.error() );
if( !validateDocumentInternal( aHeader.document() ) )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BAD_REQUEST );
e.set_error_message( fmt::format( "the requested document {} is not open",
aHeader.document().board_filename() ) );
return tl::unexpected( e );
}
if( aHeader.has_container() )
{
return KIID( aHeader.container().value() );
}
// Valid header, but no container provided
return std::nullopt;
}
std::optional<ApiResponseStatus> API_HANDLER_EDITOR::checkForBusy()
{
if( !m_frame->CanAcceptApiCommands() )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BUSY );
e.set_error_message( "KiCad is busy and cannot respond to API requests right now" );
return e;
}
return std::nullopt;
}
HANDLER_RESULT<CreateItemsResponse> API_HANDLER_EDITOR::handleCreateItems( CreateItems& aMsg,
const HANDLER_CONTEXT& aCtx )
{
if( std::optional<ApiResponseStatus> busy = checkForBusy() )
return tl::unexpected( *busy );
CreateItemsResponse response;
HANDLER_RESULT<ItemRequestStatus> result = handleCreateUpdateItemsInternal( true, aCtx,
aMsg.header(), aMsg.items(),
[&]( const ItemStatus& aStatus, const google::protobuf::Any& aItem )
{
ItemCreationResult itemResult;
itemResult.mutable_status()->CopyFrom( aStatus );
itemResult.mutable_item()->CopyFrom( aItem );
response.mutable_created_items()->Add( std::move( itemResult ) );
} );
if( !result.has_value() )
return tl::unexpected( result.error() );
response.set_status( *result );
return response;
}
HANDLER_RESULT<UpdateItemsResponse> API_HANDLER_EDITOR::handleUpdateItems( UpdateItems& aMsg,
const HANDLER_CONTEXT& aCtx )
{
if( std::optional<ApiResponseStatus> busy = checkForBusy() )
return tl::unexpected( *busy );
UpdateItemsResponse response;
HANDLER_RESULT<ItemRequestStatus> result = handleCreateUpdateItemsInternal( false, aCtx,
aMsg.header(), aMsg.items(),
[&]( const ItemStatus& aStatus, const google::protobuf::Any& aItem )
{
ItemUpdateResult itemResult;
itemResult.mutable_status()->CopyFrom( aStatus );
itemResult.mutable_item()->CopyFrom( aItem );
response.mutable_updated_items()->Add( std::move( itemResult ) );
} );
if( !result.has_value() )
return tl::unexpected( result.error() );
response.set_status( *result );
return response;
}
HANDLER_RESULT<DeleteItemsResponse> API_HANDLER_EDITOR::handleDeleteItems( DeleteItems& aMsg,
const HANDLER_CONTEXT& aCtx )
{
if( std::optional<ApiResponseStatus> busy = checkForBusy() )
return tl::unexpected( *busy );
if( !validateItemHeaderDocument( aMsg.header() ) )
{
ApiResponseStatus e;
// No message needed for AS_UNHANDLED; this is an internal flag for the API server
e.set_status( ApiStatusCode::AS_UNHANDLED );
return tl::unexpected( e );
}
std::map<KIID, ItemDeletionStatus> itemsToDelete;
for( const kiapi::common::types::KIID& kiidBuf : aMsg.item_ids() )
{
if( !kiidBuf.value().empty() )
{
KIID kiid( kiidBuf.value() );
itemsToDelete[kiid] = ItemDeletionStatus::IDS_NONEXISTENT;
}
}
if( itemsToDelete.empty() )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BAD_REQUEST );
e.set_error_message( "no valid items to delete were given" );
return tl::unexpected( e );
}
deleteItemsInternal( itemsToDelete, aCtx );
DeleteItemsResponse response;
for( const auto& [id, status] : itemsToDelete )
{
ItemDeletionResult result;
result.mutable_id()->set_value( id.AsStdString() );
result.set_status( status );
}
response.set_status( kiapi::common::types::ItemRequestStatus::IRS_OK );
return response;
}
HANDLER_RESULT<HitTestResponse> API_HANDLER_EDITOR::handleHitTest( HitTest& aMsg,
const HANDLER_CONTEXT& aCtx )
{
if( std::optional<ApiResponseStatus> busy = checkForBusy() )
return tl::unexpected( *busy );
if( !validateItemHeaderDocument( aMsg.header() ) )
{
ApiResponseStatus e;
// No message needed for AS_UNHANDLED; this is an internal flag for the API server
e.set_status( ApiStatusCode::AS_UNHANDLED );
return tl::unexpected( e );
}
HitTestResponse response;
std::optional<EDA_ITEM*> item = getItemFromDocument( aMsg.header().document(),
KIID( aMsg.id().value() ) );
if( !item )
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BAD_REQUEST );
e.set_error_message( "the requested item ID is not present in the given document" );
return tl::unexpected( e );
}
if( ( *item )->HitTest( kiapi::common::UnpackVector2( aMsg.position() ), aMsg.tolerance() ) )
response.set_result( HitTestResult::HTR_HIT );
else
response.set_result( HitTestResult::HTR_NO_HIT );
return response;
}
-332
View File
@@ -1,332 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <magic_enum.hpp>
#include <nlohmann/json.hpp>
#include <wx/log.h>
#include <wx/regex.h>
#include <wx/stdstream.h>
#include <wx/wfstream.h>
#include <api/api_plugin.h>
#include <api/api_plugin_manager.h>
#include <json_conversions.h>
bool PLUGIN_RUNTIME::FromJson( const nlohmann::json& aJson )
{
// TODO move to tl::expected and give user feedback about parse errors
try
{
type = magic_enum::enum_cast<PLUGIN_RUNTIME_TYPE>( aJson.at( "type" ).get<std::string>(),
magic_enum::case_insensitive )
.value_or( PLUGIN_RUNTIME_TYPE::INVALID );
}
catch( ... )
{
return false;
}
return type != PLUGIN_RUNTIME_TYPE::INVALID;
}
struct API_PLUGIN_CONFIG
{
API_PLUGIN_CONFIG( API_PLUGIN& aParent, const wxFileName& aConfigFile );
bool valid;
wxString identifier;
wxString name;
wxString description;
PLUGIN_RUNTIME runtime;
std::vector<PLUGIN_ACTION> actions;
API_PLUGIN& parent;
};
API_PLUGIN_CONFIG::API_PLUGIN_CONFIG( API_PLUGIN& aParent, const wxFileName& aConfigFile ) :
parent( aParent )
{
valid = false;
if( !aConfigFile.IsFileReadable() )
return;
wxLogTrace( traceApi, "Plugin: parsing config file" );
wxFFileInputStream fp( aConfigFile.GetFullPath(), wxT( "rt" ) );
wxStdInputStream fstream( fp );
nlohmann::json js;
try
{
js = nlohmann::json::parse( fstream, nullptr,
/* allow_exceptions = */ true,
/* ignore_comments = */ true );
}
catch( ... )
{
wxLogTrace( traceApi, "Plugin: exception during parse" );
return;
}
// TODO add schema and validate
// All of these are required; any exceptions here leave us with valid == false
try
{
identifier = js.at( "identifier" ).get<wxString>();
name = js.at( "name" ).get<wxString>();
description = js.at( "description" ).get<wxString>();
if( !runtime.FromJson( js.at( "runtime" ) ) )
{
wxLogTrace( traceApi, "Plugin: error parsing runtime section" );
return;
}
}
catch( ... )
{
wxLogTrace( traceApi, "Plugin: exception while parsing required keys" );
return;
}
// At minimum, we need a reverse-DNS style identifier with two dots and a 2+ character TLD
wxRegEx identifierRegex( wxS( "[\\w\\d]{2,}\\.[\\w\\d]+\\.[\\w\\d]+" ) );
if( !identifierRegex.Matches( identifier ) )
{
wxLogTrace( traceApi, wxString::Format( "Plugin: identifier %s does not meet requirements",
identifier ) );
return;
}
wxLogTrace( traceApi, wxString::Format( "Plugin: %s (%s)", identifier, name ) );
try
{
const nlohmann::json& actionsJs = js.at( "actions" );
if( actionsJs.is_array() )
{
for( const nlohmann::json& actionJs : actionsJs )
{
if( std::optional<PLUGIN_ACTION> a = parent.createActionFromJson( actionJs ) )
{
a->identifier = wxString::Format( "%s.%s", identifier, a->identifier );
wxLogTrace( traceApi, wxString::Format( "Plugin: loaded action %s",
a->identifier ) );
actions.emplace_back( *a );
}
}
}
}
catch( ... )
{
wxLogTrace( traceApi, "Plugin: exception while parsing actions" );
}
valid = true;
}
API_PLUGIN::API_PLUGIN( const wxFileName& aConfigFile ) :
m_configFile( aConfigFile ),
m_config( std::make_unique<API_PLUGIN_CONFIG>( *this, aConfigFile ) )
{
}
API_PLUGIN::~API_PLUGIN()
{
}
bool API_PLUGIN::IsOk() const
{
return m_config->valid;
}
const wxString& API_PLUGIN::Identifier() const
{
return m_config->identifier;
}
const wxString& API_PLUGIN::Name() const
{
return m_config->name;
}
const wxString& API_PLUGIN::Description() const
{
return m_config->description;
}
const PLUGIN_RUNTIME& API_PLUGIN::Runtime() const
{
return m_config->runtime;
}
const std::vector<PLUGIN_ACTION>& API_PLUGIN::Actions() const
{
return m_config->actions;
}
wxString API_PLUGIN::BasePath() const
{
return m_configFile.GetPath();
}
std::optional<PLUGIN_ACTION> API_PLUGIN::createActionFromJson( const nlohmann::json& aJson )
{
// TODO move to tl::expected and give user feedback about parse errors
PLUGIN_ACTION action( *this );
try
{
action.identifier = aJson.at( "identifier" ).get<wxString>();
wxLogTrace( traceApi, wxString::Format( "Plugin: load action %s", action.identifier ) );
action.name = aJson.at( "name" ).get<wxString>();
action.description = aJson.at( "description" ).get<wxString>();
action.entrypoint = aJson.at( "entrypoint" ).get<wxString>();
action.show_button = aJson.contains( "show-button" ) && aJson.at( "show-button" ).get<bool>();
}
catch( ... )
{
wxLogTrace( traceApi, "Plugin: exception while parsing action required keys" );
return std::nullopt;
}
wxFileName f( action.entrypoint );
if( !f.IsRelative() )
{
wxLogTrace( traceApi, wxString::Format( "Plugin: action contains abs path %s; skipping",
action.entrypoint ) );
return std::nullopt;
}
f.Normalize( wxPATH_NORM_ABSOLUTE, m_configFile.GetPath() );
if( !f.IsFileReadable() )
{
wxLogTrace( traceApi, wxString::Format( "WARNING: action entrypoint %s is not readable",
f.GetFullPath() ) );
}
if( aJson.contains( "args" ) && aJson.at( "args" ).is_array() )
{
for( const nlohmann::json& argJs : aJson.at( "args" ) )
{
try
{
action.args.emplace_back( argJs.get<wxString>() );
}
catch( ... )
{
wxLogTrace( traceApi, "Plugin: exception while parsing action args" );
continue;
}
}
}
if( aJson.contains( "scopes" ) && aJson.at( "scopes" ).is_array() )
{
for( const nlohmann::json& scopeJs : aJson.at( "scopes" ) )
{
try
{
action.scopes.insert( magic_enum::enum_cast<PLUGIN_ACTION_SCOPE>(
scopeJs.get<std::string>(), magic_enum::case_insensitive )
.value_or( PLUGIN_ACTION_SCOPE::INVALID ) );
}
catch( ... )
{
wxLogTrace( traceApi, "Plugin: exception while parsing action scopes" );
continue;
}
}
}
auto handleBitmap =
[&]( const std::string& aKey, wxBitmapBundle& aDest )
{
if( aJson.contains( aKey ) && aJson.at( aKey ).is_array() )
{
wxVector<wxBitmap> bitmaps;
for( const nlohmann::json& iconJs : aJson.at( aKey ) )
{
wxFileName iconFile;
try
{
iconFile = iconJs.get<wxString>();
}
catch( ... )
{
continue;
}
iconFile.Normalize( wxPATH_NORM_ABSOLUTE, m_configFile.GetPath() );
wxLogTrace( traceApi,
wxString::Format( "Plugin: action %s: loading icon %s",
action.identifier, iconFile.GetFullPath() ) );
if( !iconFile.IsFileReadable() )
{
wxLogTrace( traceApi, "Plugin: icon file could not be read" );
continue;
}
wxBitmap bmp;
// TODO: If necessary; support types other than PNG
bmp.LoadFile( iconFile.GetFullPath(), wxBITMAP_TYPE_PNG );
if( bmp.IsOk() )
bitmaps.push_back( bmp );
else
wxLogTrace( traceApi, "Plugin: icon file not a valid bitmap" );
}
aDest = wxBitmapBundle::FromBitmaps( bitmaps );
}
};
handleBitmap( "icons-light", action.icon_light );
handleBitmap( "icons-dark", action.icon_dark );
return action;
}
-420
View File
@@ -1,420 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <fmt/format.h>
#include <wx/dir.h>
#include <wx/log.h>
#include <wx/utils.h>
#include <api/api_plugin_manager.h>
#include <api/api_server.h>
#include <paths.h>
#include <pgm_base.h>
#include <python_manager.h>
#include <settings/settings_manager.h>
#include <settings/common_settings.h>
const wxChar* const traceApi = wxT( "KICAD_API" );
wxDEFINE_EVENT( EDA_EVT_PLUGIN_MANAGER_JOB_FINISHED, wxCommandEvent );
wxDEFINE_EVENT( EDA_EVT_PLUGIN_AVAILABILITY_CHANGED, wxCommandEvent );
API_PLUGIN_MANAGER::API_PLUGIN_MANAGER( wxEvtHandler* aEvtHandler ) :
wxEvtHandler(),
m_parent( aEvtHandler )
{
Bind( EDA_EVT_PLUGIN_MANAGER_JOB_FINISHED, &API_PLUGIN_MANAGER::processNextJob, this );
}
class PLUGIN_TRAVERSER : public wxDirTraverser
{
private:
std::function<void( const wxFileName& )> m_action;
public:
explicit PLUGIN_TRAVERSER( std::function<void( const wxFileName& )> aAction )
: m_action( std::move( aAction ) )
{
}
wxDirTraverseResult OnFile( const wxString& aFilePath ) override
{
wxFileName file( aFilePath );
if( file.GetFullName() == wxS( "plugin.json" ) )
m_action( file );
return wxDIR_CONTINUE;
}
wxDirTraverseResult OnDir( const wxString& dirPath ) override
{
return wxDIR_CONTINUE;
}
};
void API_PLUGIN_MANAGER::ReloadPlugins()
{
m_plugins.clear();
m_pluginsCache.clear();
m_actionsCache.clear();
m_environmentCache.clear();
m_buttonBindings.clear();
m_menuBindings.clear();
m_readyPlugins.clear();
// TODO support system-provided plugins
wxDir userPluginsDir( PATHS::GetUserPluginsPath() );
PLUGIN_TRAVERSER loader(
[&]( const wxFileName& aFile )
{
wxLogTrace( traceApi, wxString::Format( "Manager: loading plugin from %s",
aFile.GetFullPath() ) );
auto plugin = std::make_unique<API_PLUGIN>( aFile );
if( plugin->IsOk() )
{
if( m_pluginsCache.count( plugin->Identifier() ) )
{
wxLogTrace( traceApi,
wxString::Format( "Manager: identifier %s already present!",
plugin->Identifier() ) );
return;
}
else
{
m_pluginsCache[plugin->Identifier()] = plugin.get();
}
for( const PLUGIN_ACTION& action : plugin->Actions() )
m_actionsCache[action.identifier] = &action;
m_plugins.insert( std::move( plugin ) );
}
else
{
wxLogTrace( traceApi, "Manager: loading failed" );
}
} );
if( userPluginsDir.IsOpened() )
{
wxLogTrace( traceApi, wxString::Format( "Manager: scanning user path (%s) for plugins...",
userPluginsDir.GetName() ) );
userPluginsDir.Traverse( loader );
processPluginDependencies();
}
wxCommandEvent* evt = new wxCommandEvent( EDA_EVT_PLUGIN_AVAILABILITY_CHANGED, wxID_ANY );
m_parent->QueueEvent( evt );
}
void API_PLUGIN_MANAGER::InvokeAction( const wxString& aIdentifier )
{
if( !m_actionsCache.count( aIdentifier ) )
return;
const PLUGIN_ACTION* action = m_actionsCache.at( aIdentifier );
const API_PLUGIN& plugin = action->plugin;
if( !m_readyPlugins.count( plugin.Identifier() ) )
{
wxLogTrace( traceApi, wxString::Format( "Manager: Plugin %s is not ready",
plugin.Identifier() ) );
return;
}
wxFileName pluginFile( plugin.BasePath(), action->entrypoint );
pluginFile.Normalize( wxPATH_NORM_ABSOLUTE | wxPATH_NORM_SHORTCUT | wxPATH_NORM_DOTS
| wxPATH_NORM_TILDE, plugin.BasePath() );
wxString pluginPath = pluginFile.GetFullPath();
std::vector<const wchar_t*> args;
std::optional<wxString> py;
switch( plugin.Runtime().type )
{
case PLUGIN_RUNTIME_TYPE::PYTHON:
{
py = PYTHON_MANAGER::GetVirtualPython( plugin.Identifier() );
if( !py )
{
wxLogTrace( traceApi, wxString::Format( "Manager: Python interpreter for %s not found",
plugin.Identifier() ) );
return;
}
args.push_back( py->wc_str() );
if( !pluginFile.IsFileReadable() )
{
wxLogTrace( traceApi, wxString::Format( "Manager: Python entrypoint %s is not readable",
pluginFile.GetFullPath() ) );
return;
}
break;
}
case PLUGIN_RUNTIME_TYPE::EXEC:
{
if( !pluginFile.IsFileExecutable() )
{
wxLogTrace( traceApi, wxString::Format( "Manager: Exec entrypoint %s is not executable",
pluginFile.GetFullPath() ) );
return;
}
break;
};
default:
wxLogTrace( traceApi, wxString::Format( "Manager: unhandled runtime for action %s",
action->identifier ) );
return;
}
args.emplace_back( pluginPath.wc_str() );
for( const wxString& arg : action->args )
args.emplace_back( arg.wc_str() );
args.emplace_back( nullptr );
wxExecuteEnv env;
wxGetEnvMap( &env.env );
env.env[ wxS( "KICAD_API_SOCKET" ) ] = Pgm().GetApiServer().SocketPath();
env.env[ wxS( "KICAD_API_TOKEN" ) ] = Pgm().GetApiServer().Token();
env.cwd = pluginFile.GetPath();
long p = wxExecute( const_cast<wchar_t**>( args.data() ), wxEXEC_ASYNC, nullptr, &env );
if( !p )
{
wxLogTrace( traceApi, wxString::Format( "Manager: launching action %s failed",
action->identifier ) );
}
else
{
wxLogTrace( traceApi, wxString::Format( "Manager: launching action %s -> pid %ld",
action->identifier, p ) );
}
}
std::vector<const PLUGIN_ACTION*> API_PLUGIN_MANAGER::GetActionsForScope( PLUGIN_ACTION_SCOPE aScope )
{
std::vector<const PLUGIN_ACTION*> actions;
for( auto& [identifier, action] : m_actionsCache )
{
if( !m_readyPlugins.count( action->plugin.Identifier() ) )
continue;
if( action->scopes.count( aScope ) )
actions.emplace_back( action );
}
return actions;
}
void API_PLUGIN_MANAGER::processPluginDependencies()
{
for( const std::unique_ptr<API_PLUGIN>& plugin : m_plugins )
{
m_environmentCache[plugin->Identifier()] = wxEmptyString;
if( plugin->Runtime().type != PLUGIN_RUNTIME_TYPE::PYTHON )
{
m_readyPlugins.insert( plugin->Identifier() );
continue;
}
std::optional<wxString> env = PYTHON_MANAGER::GetPythonEnvironment( plugin->Identifier() );
if( !env )
{
wxLogTrace( traceApi, wxString::Format( "Manager: could not create env for %s",
plugin->Identifier() ) );
continue;
}
wxFileName envConfigPath( *env, wxS( "pyvenv.cfg" ) );
if( envConfigPath.IsFileReadable() )
{
wxLogTrace( traceApi, wxString::Format( "Manager: Python env for %s exists at %s",
plugin->Identifier(), *env ) );
JOB job;
job.type = JOB_TYPE::INSTALL_REQUIREMENTS;
job.identifier = plugin->Identifier();
job.plugin_path = plugin->BasePath();
job.env_path = *env;
m_jobs.emplace_back( job );
continue;
}
wxLogTrace( traceApi, wxString::Format( "Manager: will create Python env for %s at %s",
plugin->Identifier(), *env ) );
JOB job;
job.type = JOB_TYPE::CREATE_ENV;
job.identifier = plugin->Identifier();
job.plugin_path = plugin->BasePath();
job.env_path = *env;
m_jobs.emplace_back( job );
}
wxCommandEvent evt;
processNextJob( evt );
}
void API_PLUGIN_MANAGER::processNextJob( wxCommandEvent& aEvent )
{
if( m_jobs.empty() )
{
wxLogTrace( traceApi, "Manager: cleared job queue" );
return;
}
wxLogTrace( traceApi, wxString::Format( "Manager: begin processing; %zu jobs left in queue",
m_jobs.size() ) );
JOB& job = m_jobs.front();
if( job.type == JOB_TYPE::CREATE_ENV )
{
wxLogTrace( traceApi, "Manager: Python exe '%s'",
Pgm().GetCommonSettings()->m_Api.python_interpreter );
wxLogTrace( traceApi, wxString::Format( "Manager: creating Python env at %s",
job.env_path ) );
PYTHON_MANAGER manager( Pgm().GetCommonSettings()->m_Api.python_interpreter );
manager.Execute(
wxString::Format( wxS( "-m venv %s" ), job.env_path ),
[this]( int aRetVal, const wxString& aOutput, const wxString& aError )
{
wxLogTrace( traceApi,
wxString::Format( "Manager: venv (%d): %s", aRetVal, aOutput ) );
if( !aError.IsEmpty() )
wxLogTrace( traceApi, wxString::Format( "Manager: venv err: %s", aError ) );
wxCommandEvent* evt =
new wxCommandEvent( EDA_EVT_PLUGIN_MANAGER_JOB_FINISHED, wxID_ANY );
QueueEvent( evt );
} );
}
else if( job.type == JOB_TYPE::INSTALL_REQUIREMENTS )
{
wxLogTrace( traceApi, wxString::Format( "Manager: installing dependencies for %s",
job.plugin_path ) );
std::optional<wxString> pythonHome = PYTHON_MANAGER::GetPythonEnvironment( job.identifier );
std::optional<wxString> python = PYTHON_MANAGER::GetVirtualPython( job.identifier );
wxFileName reqs = wxFileName( job.plugin_path, "requirements.txt" );
if( !python )
{
wxLogTrace( traceApi, wxString::Format( "Manager: error: python not found at %s",
job.env_path ) );
}
else if( !reqs.IsFileReadable() )
{
wxLogTrace( traceApi,
wxString::Format( "Manager: error: requirements.txt not found at %s",
job.plugin_path ) );
}
else
{
wxLogTrace( traceApi, "Manager: Python exe '%s'", *python );
PYTHON_MANAGER manager( *python );
wxExecuteEnv env;
if( pythonHome )
env.env[wxS( "VIRTUAL_ENV" )] = *pythonHome;
wxString cmd = wxS( "-m ensurepip" );
wxLogTrace( traceApi, "Manager: calling python `%s`", cmd );
manager.Execute( cmd,
[=]( int aRetVal, const wxString& aOutput, const wxString& aError )
{
wxLogTrace( traceApi, wxString::Format( "Manager: ensurepip (%d): %s",
aRetVal, aOutput ) );
if( !aError.IsEmpty() )
{
wxLogTrace( traceApi,
wxString::Format( "Manager: ensurepip err: %s", aError ) );
}
}, &env );
cmd = wxString::Format(
wxS( "-m pip install --no-input --isolated --require-virtualenv "
"--exists-action i -r '%s'" ),
reqs.GetFullPath() );
wxLogTrace( traceApi, "Manager: calling python `%s`", cmd );
manager.Execute( cmd,
[this, job]( int aRetVal, const wxString& aOutput, const wxString& aError )
{
wxLogTrace( traceApi, wxString::Format( "Manager: pip (%d): %s",
aRetVal, aOutput ) );
if( !aError.IsEmpty() )
wxLogTrace( traceApi, wxString::Format( "Manager: pip err: %s", aError ) );
if( aRetVal == 0 )
{
wxLogTrace( traceApi, wxString::Format( "Manager: marking %s as ready",
job.identifier ) );
m_readyPlugins.insert( job.identifier );
wxCommandEvent* availabilityEvt =
new wxCommandEvent( EDA_EVT_PLUGIN_AVAILABILITY_CHANGED, wxID_ANY );
wxTheApp->QueueEvent( availabilityEvt );
}
wxCommandEvent* evt = new wxCommandEvent( EDA_EVT_PLUGIN_MANAGER_JOB_FINISHED,
wxID_ANY );
QueueEvent( evt );
}, &env );
}
wxCommandEvent* evt = new wxCommandEvent( EDA_EVT_PLUGIN_MANAGER_JOB_FINISHED, wxID_ANY );
QueueEvent( evt );
}
m_jobs.pop_front();
wxLogTrace( traceApi, wxString::Format( "Manager: done processing; %zu jobs left in queue",
m_jobs.size() ) );
}
-274
View File
@@ -1,274 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wx/app.h>
#include <wx/datetime.h>
#include <wx/event.h>
#include <wx/stdpaths.h>
#include <advanced_config.h>
#include <api/api_plugin_manager.h> // traceApi
#include <api/api_server.h>
#include <api/api_handler_common.h>
#include <kiid.h>
#include <kinng.h>
#include <paths.h>
#include <pgm_base.h>
#include <settings/common_settings.h>
#include <string_utils.h>
#include <api/common/envelope.pb.h>
using kiapi::common::ApiRequest, kiapi::common::ApiResponse, kiapi::common::ApiStatusCode;
wxString KICAD_API_SERVER::s_logFileName = "api.log";
wxDEFINE_EVENT( API_REQUEST_EVENT, wxCommandEvent );
KICAD_API_SERVER::KICAD_API_SERVER() :
wxEvtHandler(),
m_token( KIID().AsStdString() ),
m_readyToReply( false )
{
m_commonHandler = std::make_unique<API_HANDLER_COMMON>();
RegisterHandler( m_commonHandler.get() );
if( !Pgm().GetCommonSettings()->m_Api.enable_server )
{
wxLogTrace( traceApi, "Server: disabled by user preferences." );
return;
}
Start();
}
KICAD_API_SERVER::~KICAD_API_SERVER()
{
}
void KICAD_API_SERVER::Start()
{
if( Running() )
return;
wxFileName socket;
#ifdef __WXMAC__
socket.AssignDir( wxS( "/tmp" ) );
#else
socket.AssignDir( wxStandardPaths::Get().GetTempDir() );
#endif
socket.AppendDir( wxS( "kicad" ) );
socket.SetFullName( wxS( "api.sock" ) );
if( !PATHS::EnsurePathExists( socket.GetPath() ) )
{
wxLogTrace( traceApi, wxString::Format( "Server: socket path %s could not be created",
socket.GetPath() ) );
return;
}
if( socket.FileExists() )
{
socket.SetFullName( wxString::Format( wxS( "api-%ul.sock" ), ::wxGetProcessId() ) );
if( socket.FileExists() )
{
wxLogTrace( traceApi, wxString::Format( "Server: PID socket path %s already exists!",
socket.GetFullPath() ) );
return;
}
}
m_server = std::make_unique<KINNG_REQUEST_SERVER>(
fmt::format( "ipc://{}", socket.GetFullPath().ToStdString() ) );
m_server->SetCallback( [&]( std::string* aRequest ) { onApiRequest( aRequest ); } );
m_logFilePath.AssignDir( PATHS::GetLogsPath() );
m_logFilePath.SetName( s_logFileName );
if( ADVANCED_CFG::GetCfg().m_EnableAPILogging )
{
PATHS::EnsurePathExists( PATHS::GetLogsPath() );
log( fmt::format( "--- KiCad API server started at {} ---\n", SocketPath() ) );
}
wxLogTrace( traceApi, wxString::Format( "Server: listening at %s", SocketPath() ) );
Bind( API_REQUEST_EVENT, &KICAD_API_SERVER::handleApiEvent, this );
}
void KICAD_API_SERVER::Stop()
{
if( !Running() )
return;
wxLogTrace( traceApi, "Stopping server" );
Unbind( API_REQUEST_EVENT, &KICAD_API_SERVER::handleApiEvent, this );
m_server->Stop();
m_server.reset( nullptr );
}
bool KICAD_API_SERVER::Running() const
{
return m_server && m_server->Running();
}
void KICAD_API_SERVER::RegisterHandler( API_HANDLER* aHandler )
{
wxCHECK( aHandler, /* void */ );
m_handlers.insert( aHandler );
}
void KICAD_API_SERVER::DeregisterHandler( API_HANDLER* aHandler )
{
m_handlers.erase( aHandler );
}
std::string KICAD_API_SERVER::SocketPath() const
{
return m_server ? m_server->SocketPath() : "";
}
void KICAD_API_SERVER::onApiRequest( std::string* aRequest )
{
if( !m_readyToReply )
{
ApiResponse notHandled;
notHandled.mutable_status()->set_status( ApiStatusCode::AS_NOT_READY );
notHandled.mutable_status()->set_error_message( "KiCad is not ready to reply" );
m_server->Reply( notHandled.SerializeAsString() );
log( "Got incoming request but was not yet ready to reply." );
return;
}
wxCommandEvent* evt = new wxCommandEvent( API_REQUEST_EVENT );
// We don't actually need write access to this string, but client data is non-const
evt->SetClientData( static_cast<void*>( aRequest ) );
// Takes ownership and frees the wxCommandEvent
QueueEvent( evt );
}
void KICAD_API_SERVER::handleApiEvent( wxCommandEvent& aEvent )
{
std::string& requestString = *static_cast<std::string*>( aEvent.GetClientData() );
ApiRequest request;
if( !request.ParseFromString( requestString ) )
{
ApiResponse error;
error.mutable_header()->set_kicad_token( m_token );
error.mutable_status()->set_status( ApiStatusCode::AS_BAD_REQUEST );
error.mutable_status()->set_error_message( "request could not be parsed" );
m_server->Reply( error.SerializeAsString() );
if( ADVANCED_CFG::GetCfg().m_EnableAPILogging )
log( "Response (ERROR): " + error.Utf8DebugString() );
}
if( ADVANCED_CFG::GetCfg().m_EnableAPILogging )
log( "Request: " + request.Utf8DebugString() );
if( !request.header().kicad_token().empty() &&
request.header().kicad_token().compare( m_token ) != 0 )
{
ApiResponse error;
error.mutable_header()->set_kicad_token( m_token );
error.mutable_status()->set_status( ApiStatusCode::AS_TOKEN_MISMATCH );
error.mutable_status()->set_error_message(
"the provided kicad_token did not match this KiCad instance's token" );
m_server->Reply( error.SerializeAsString() );
if( ADVANCED_CFG::GetCfg().m_EnableAPILogging )
log( "Response (ERROR): " + error.Utf8DebugString() );
}
API_RESULT result;
for( API_HANDLER* handler : m_handlers )
{
result = handler->Handle( request );
if( result.has_value() )
break;
else if( result.error().status() != ApiStatusCode::AS_UNHANDLED )
break;
}
// Note: at the point we call Reply(), we no longer own requestString.
if( result.has_value() )
{
result->mutable_header()->set_kicad_token( m_token );
m_server->Reply( result->SerializeAsString() );
if( ADVANCED_CFG::GetCfg().m_EnableAPILogging )
log( "Response: " + result->Utf8DebugString() );
}
else
{
ApiResponse error;
error.mutable_status()->CopyFrom( result.error() );
error.mutable_header()->set_kicad_token( m_token );
if( result.error().status() == ApiStatusCode::AS_UNHANDLED )
{
std::string type = "<unparseable Any>";
google::protobuf::Any::ParseAnyTypeUrl( request.message().type_url(), &type );
std::string msg = fmt::format( "no handler available for request of type {}", type );
error.mutable_status()->set_error_message( msg );
}
m_server->Reply( error.SerializeAsString() );
if( ADVANCED_CFG::GetCfg().m_EnableAPILogging )
log( "Response (ERROR): " + error.Utf8DebugString() );
}
}
void KICAD_API_SERVER::log( const std::string& aOutput )
{
FILE* fp = wxFopen( m_logFilePath.GetFullPath(), wxT( "a" ) );
if( !fp )
return;
wxString out;
wxDateTime now = wxDateTime::Now();
fprintf( fp, "%s", TO_UTF8( out.Format( wxS( "%s: %s" ),
now.FormatISOCombined(), aOutput ) ) );
fclose( fp );
}
-135
View File
@@ -1,135 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <magic_enum.hpp>
#include <api/api_utils.h>
namespace kiapi::common
{
std::optional<KICAD_T> TypeNameFromAny( const google::protobuf::Any& aMessage )
{
static const std::map<std::string, KICAD_T> s_types = {
{ "type.googleapis.com/kiapi.board.types.Track", PCB_TRACE_T },
{ "type.googleapis.com/kiapi.board.types.Arc", PCB_ARC_T },
{ "type.googleapis.com/kiapi.board.types.Via", PCB_VIA_T },
{ "type.googleapis.com/kiapi.board.types.Text", PCB_TEXT_T },
{ "type.googleapis.com/kiapi.board.types.TextBox", PCB_TEXTBOX_T },
{ "type.googleapis.com/kiapi.board.types.GraphicShape", PCB_SHAPE_T },
{ "type.googleapis.com/kiapi.board.types.Pad", PCB_PAD_T },
{ "type.googleapis.com/kiapi.board.types.Zone", PCB_ZONE_T },
{ "type.googleapis.com/kiapi.board.types.Dimension", PCB_DIMENSION_T },
{ "type.googleapis.com/kiapi.board.types.ReferenceImage", PCB_REFERENCE_IMAGE_T },
{ "type.googleapis.com/kiapi.board.types.Group", PCB_GROUP_T },
{ "type.googleapis.com/kiapi.board.types.Field", PCB_FIELD_T },
{ "type.googleapis.com/kiapi.board.types.FootprintInstance", PCB_FOOTPRINT_T },
};
auto it = s_types.find( aMessage.type_url() );
if( it != s_types.end() )
return it->second;
return std::nullopt;
}
LIB_ID LibIdFromProto( const types::LibraryIdentifier& aId )
{
return LIB_ID( aId.library_nickname(), aId.entry_name() );
}
types::LibraryIdentifier LibIdToProto( const LIB_ID& aId )
{
types::LibraryIdentifier msg;
msg.set_library_nickname( aId.GetLibNickname() );
msg.set_entry_name( aId.GetLibItemName() );
return msg;
}
void PackVector2( kiapi::common::types::Vector2& aOutput, const VECTOR2I aInput )
{
aOutput.set_x_nm( aInput.x );
aOutput.set_y_nm( aInput.y );
}
VECTOR2I UnpackVector2( const types::Vector2& aInput )
{
return VECTOR2I( aInput.x_nm(), aInput.y_nm() );
}
void PackPolyLine( kiapi::common::types::PolyLine& aOutput, const SHAPE_LINE_CHAIN& aSlc )
{
for( int vertex = 0; vertex < aSlc.PointCount(); vertex = aSlc.NextShape( vertex ) )
{
if( vertex < 0 )
break;
kiapi::common::types::PolyLineNode* node = aOutput.mutable_nodes()->Add();
if( aSlc.IsPtOnArc( vertex ) )
{
const SHAPE_ARC& arc = aSlc.Arc( aSlc.ArcIndex( vertex ) );
node->mutable_arc()->mutable_start()->set_x_nm( arc.GetP0().x );
node->mutable_arc()->mutable_start()->set_y_nm( arc.GetP0().y );
node->mutable_arc()->mutable_mid()->set_x_nm( arc.GetArcMid().x );
node->mutable_arc()->mutable_mid()->set_y_nm( arc.GetArcMid().y );
node->mutable_arc()->mutable_end()->set_x_nm( arc.GetP1().x );
node->mutable_arc()->mutable_end()->set_y_nm( arc.GetP1().y );
}
else
{
node->mutable_point()->set_x_nm( aSlc.CPoint( vertex ).x );
node->mutable_point()->set_y_nm( aSlc.CPoint( vertex ).y );
}
}
aOutput.set_closed( aSlc.IsClosed() );
}
SHAPE_LINE_CHAIN UnpackPolyLine( const kiapi::common::types::PolyLine& aInput )
{
SHAPE_LINE_CHAIN slc;
for( const kiapi::common::types::PolyLineNode& node : aInput.nodes() )
{
if( node.has_point() )
{
slc.Append( VECTOR2I( node.point().x_nm(), node.point().y_nm() ) );
}
else if( node.has_arc() )
{
slc.Append( SHAPE_ARC( VECTOR2I( node.arc().start().x_nm(), node.arc().start().y_nm() ),
VECTOR2I( node.arc().mid().x_nm(), node.arc().mid().y_nm() ),
VECTOR2I( node.arc().end().x_nm(), node.arc().end().y_nm() ),
0 /* don't care about width here */ ) );
}
}
slc.SetClosed( aInput.closed() );
return slc;
}
} // namespace kiapi::common
+2 -2
View File
@@ -86,9 +86,9 @@ const wxString& BASE_SCREEN::GetPageNumber() const
void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) const
{
// for now, make it look like XML, expand on this later.
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << wxS( ">\n" );
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << wxS( ">\n" );
}
#endif
+1 -1
View File
@@ -455,7 +455,7 @@ void BITMAP_BASE::Rotate( bool aRotateCCW )
m_image->SetOption( wxIMAGE_OPTION_RESOLUTIONX, resX);
m_image->SetOption( wxIMAGE_OPTION_RESOLUTIONY, resY);
m_rotation += ( aRotateCCW ? ANGLE_90 : -ANGLE_90 );
m_rotation += ( aRotateCCW ? -ANGLE_90 : ANGLE_90 );
rebuildBitmap( false );
UpdateImageDataBuffer();
}

Some files were not shown because too many files have changed in this diff Show More