Compare commits

..

808 Commits

Author SHA1 Message Date
Jeff Young 68f7a820b5 Flip symbol editor's Y axis to match other editors. 2024-04-22 13:47:48 +01:00
Jeff Young e8be782687 Mostly clean-up, but also bug fixes with bounding boxes. 2024-04-22 11:16:14 +01:00
Alex Shvartzkop bbab5a979a STEP export: Remove autosave prefix from label names.
The autosave file is used if the board was modified.
2024-04-22 04:06:04 +03:00
Alex Shvartzkop 2babd574be Refactor autosave prefix into FILEEXT. 2024-04-22 04:06:04 +03:00
Alex Shvartzkop c68e3ceb44 ADDED: Export inner PCB copper layers to STEP / BREP / GLTF.
Also adds options to exclude board body and components.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16855
2024-04-22 03:39:46 +03:00
Seth Hillbrand 6a73c7ffb3 Remove cover type in link holder 2024-04-21 11:11:48 -07:00
Seth Hillbrand 7dc7268146 output helpful net information in PNS debug 2024-04-21 11:11:21 -07:00
jean-pierre charras 1dc8585d04 Footprint Editor: Fix crash when no footprint loaded and try to select something 2024-04-21 17:51:14 +02:00
Wayne Stambaugh ca18dc8ec8 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
2024-04-21 10:54:52 -04:00
Jeff Young 7d8215401a Fix message panel for pins, take 2. 2024-04-21 15:14:10 +01:00
Jeff Young b4239b3ee4 Fix message panel for pins. 2024-04-21 14:51:07 +01:00
Jeff Young 320f531110 Improve inheritance processing; simplify hidden flag. 2024-04-21 12:19:22 +01:00
Jeff Young c0f480eea8 Lint reduction. 2024-04-21 12:19:22 +01:00
jean-pierre charras 2d614898a8 pad.cpp: fix possible incorrect layer mask in PAD::ImportSettingsFrom() after import
ImportSettingsFrom() calls SetAttribute() that can change the layer set.
2024-04-21 13:01:21 +02:00
jean-pierre charras 3fb521755b Revert "pad.cpp: fix incorrect layer mask in PAD::SetAttribute() for aperture pad"
This reverts commit 03e2b3c42e.
2024-04-21 11:58:56 +02:00
jean-pierre charras 03e2b3c42e pad.cpp: fix incorrect layer mask in PAD::SetAttribute() for aperture pad
A aperture pad is not on copper layer, so do not force a copper layer for this pad
2024-04-21 11:48:01 +02:00
Seth Hillbrand 6540c3ec9f 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
2024-04-20 13:39:35 -07:00
Jeff Young 9f691d063c Fix default pen width for pin text. 2024-04-20 18:25:17 +01:00
Alex Shvartzkop 7215613b13 Fix warning in PCBNEW_JOBS_HANDLER. 2024-04-20 20:11:18 +03:00
Alex Shvartzkop 1e1aecfd28 Fix warning in SYMBOL_LIBS. 2024-04-20 20:10:23 +03:00
Alex Shvartzkop 41c4bd58ba Fix warnings. 2024-04-20 20:09:17 +03:00
jean-pierre charras c2e9b687c1 simulation: DIALOG_SIM_COMMAND_BASE: avoid text truncation in checkboxes. 2024-04-20 16:53:11 +02:00
jean-pierre charras 65c3fe03fb Re-add a line deleted by mistake in my commit c04cd812
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17814
2024-04-20 15:35:57 +02:00
Wayne Stambaugh a86a258f66 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
2024-04-20 08:57:00 -04:00
Jeff Young 95136494b3 RIP LIB_PIN. 2024-04-20 12:10:31 +01:00
Jeff Young 6d11c85cad Initialize all member variables. 2024-04-20 12:10:31 +01:00
Seth Hillbrand 586fddeec1 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
2024-04-19 17:54:29 -07:00
Seth Hillbrand 3435c6ebee Prevent double-entry into footprint load
Avoids double-clicking on the footprint library symbol crashing due to
overwriting the global footprint table by multiple instances

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17040
2024-04-19 17:21:18 -07:00
Seth Hillbrand b346cde30b 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
2024-04-19 16:31:05 -07:00
Seth Hillbrand 4e6a3a50fc Flip labels to match orientation
When changing from local to hierarchical or global, the label style is
typically flipped so that global/hierarchical labels hang off the line
while local labels are set on top.  To make this more intuitive we flip
the initial orientation when changing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17739
2024-04-19 16:09:30 -07:00
Maciej Suminski 5da3dd1788 Restore parsing order in the legacy symbol library plugin 2024-04-19 22:33:28 +00:00
Wayne Stambaugh 5d99aaf0a4 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.
2024-04-19 14:33:22 -04:00
Seth Hillbrand b1dcd7ecf8 Remove Shift as a force-finish modifier
This was originally added to facilitate
https://bugs.launchpad.net/kicad/+bug/1777688 but the concern there was
that the layer kept changing when stopping on a via.  We currently have
double-click as the force-finish option and the layer reverts to the
original layer on which you were routing.  This should handle the
operation concern while still preserving shift as the modifier for grid
options

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15828
2024-04-19 08:53:27 -07:00
Alex Shvartzkop 909d43492b Fix warning. 2024-04-19 18:26:20 +03:00
jean-pierre charras c04cd81231 Eeschema: fix color issues in symbol body graphic items drawings.
- fix incorrect colors (outlines and filled shapes)
- fix issues in DIALOG_SHAPE_PROPERTIES (incorrect colors)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17799
2024-04-19 15:26:15 +02:00
Seth Hillbrand 5f16c5892c 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
2024-04-18 21:18:27 -07:00
Seth Hillbrand 1bc34f7bd7 Always refresh the navigator when changing units
Units are displayed even if the net is not selected
2024-04-18 18:21:13 -07:00
Seth Hillbrand abd0388794 Remove trailing zeros from all values
If we are showing a value to the end user, we should avoid unneeded
precision
2024-04-18 18:21:13 -07:00
Seth Hillbrand d8b6e28890 Excise the remaining unused ifdef EESCHEMA
Common units are now shared between programs, so we need a different way
other than compile definitions to choose how many digits to display.
2024-04-18 18:21:13 -07:00
Seth Hillbrand 00538548f5 Handle net directive in navigator 2024-04-18 18:21:13 -07:00
Alex Shvartzkop cd2925d3d7 ADDED: Fuse Shapes option for STEP/BREP/GLTF export.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17777
2024-04-19 03:43:26 +03:00
JamesJ f8434b1c07 Fix deletion of items in pcbnew
Ensures the fallthrough generic deletion code path increments
the deleted items counter.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17798
2024-04-18 23:37:37 +01:00
Wayne Stambaugh 17bcc27ff6 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.
2024-04-18 15:47:47 -04:00
Seth Hillbrand 2ca8abd7f1 Add locale information to the Version Info 2024-04-18 12:41:31 -07:00
aris-kimi d00cda3b2f Fix build with OCC 7.5.x 2024-04-18 18:09:42 +00:00
Seth Hillbrand f8a25d20f8 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
2024-04-18 10:47:49 -07:00
Seth Hillbrand 8d1b1598db Add missing file mod 2024-04-18 09:48:30 -07:00
Seth Hillbrand 0ea02fa2ff Be a little more careful about courtyard caches
Rather than utilizing the board timestamp, we check cached hash of the
courtyard results before rebuilding
2024-04-18 09:32:00 -07:00
Seth Hillbrand df5dd15c6f 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
2024-04-18 08:41:18 -07:00
Jeff Young b394d7eb96 Fix build breakage. 2024-04-18 15:20:58 +01:00
jean-pierre charras 3da5616939 step/step_pcb_model.cpp: add missing includes. 2024-04-18 13:55:49 +02:00
jean-pierre charras af8d80d91f Plot pads: Do not use pad offset twice when plotting chamfered rect pads
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17793
2024-04-18 12:53:38 +02:00
Alex Shvartzkop 55fb70ae65 STEP export: use fused shapes for pads instead of polygon approximations. 2024-04-18 13:44:14 +03:00
Alex Shvartzkop b50a1c967f Report errors and warnings when using BRep cutting algorithm. 2024-04-18 13:44:14 +03:00
Jeff Young d2c512f422 Don't double-save transform for plotting DNP. 2024-04-18 11:03:37 +01:00
Jeff Young cc78196f81 Remove shadowed member variables. 2024-04-18 10:58:39 +01:00
Jeff Young e5cdf3785b Make SCH_SHAPE::Normalize() upside-down-coords-aware.
Also fixes some typos in EE_POINT_EDITOR.
2024-04-18 10:27:36 +01:00
Seth Hillbrand 79166510e9 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
2024-04-18 02:58:21 +02:00
Seth Hillbrand f088b0d18a Calculate and show pad area in footprint editor
When selecting an SMD pad, show the area of the pad in the msg panel

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17788
2024-04-17 15:31:56 -07:00
Seth Hillbrand 2f7cc5fa2b Be sure that we are getting the SCH_SYMBOL values
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17782
2024-04-17 13:53:01 -07:00
Seth Hillbrand d2701323a8 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
2024-04-17 11:35:50 -07:00
Wayne Stambaugh d79619edd1 Minor net navigator improvements.
Ignore bus member connection subgraphs.  They do not have a valid net
name nor do they contain schematic items.  This prevents empty nodes
from being added to the tree.  They can be reintroduced in the future
if someone wants to pursue it.

Freeze the wxTreeCtrl while populating it and thaw when done to prevent
any unnecessary repainting.

Add profiling to test how long it takes to rebuild the net navigator.
The recently added populate the navigator with all nets when no net
is highlighted has exposed some potential performances issues with some
versions of wxWidgets on certain platforms.  Namely wxWidgets 3.2.4 on
Linux GTK.

Fix an issue where a sheet name change would not update the highlighted
net navigator resulting in a stale human readable sheet path.

Prevent the highlighted net navigator from being rebuilt twice when
loading a schematic.  SCH_EDIT_FRAME::RefreshNetNavigator() was being
called from both SCH_EDIT_FRAME::UpdateHierarchyNavigator() and
SCH_EDIT_FRAME::RecalculateConnectivity().

Add a new trace helper "KICAD_UI_PROFILE" to show trace output when
profiling user interface performance.  It's used in the net navigator
profiling mentioned above.

Reuse PROF_TIMER::Show() to generate string for PROF_TIMER::to_string().
2024-04-17 14:31:50 -04:00
Jeff Young a4073c2ace Provide some user hints on editing fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17781
2024-04-17 18:30:37 +01:00
Seth Hillbrand 0e0ada8e4e 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
2024-04-17 10:00:00 -07:00
Alex Shvartzkop 01fedb86e2 Fix shadowed variable. 2024-04-17 18:22:22 +03:00
Alex Shvartzkop d97ac47509 Try to use parallel processing in BRep cutting algorithm. 2024-04-17 18:15:17 +03:00
Alex Shvartzkop d98d7f9017 ADDED: Support 3D shape export in BREP format.
BREP doesn't support colors or label names,
but is much faster to write/read compared to STEP.
2024-04-17 17:31:10 +03:00
Alex Shvartzkop bf16f757ed STEP export: disable history to speed up hole cutting. 2024-04-17 16:09:03 +03:00
Jeff Young dee45a491e Readability. 2024-04-17 11:03:07 +01:00
Jeff Young c842de24b9 HitTesting is the wrong place to do visibility checks. 2024-04-17 10:53:49 +01:00
Seth Hillbrand caa18568e0 Handle DRC rules that limit PTH/NPTH in courtyards
Allows custom rules that explicitly allow holes from one footprint to
overlap the courtyard from another
2024-04-16 22:46:38 +00:00
Jeff Young 657fe6e091 Fix background colour bug. 2024-04-16 23:41:48 +01:00
dsa-t 822409225a 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


(cherry picked from commit 481c1592ae)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-04-16 22:36:34 +00:00
Seth Hillbrand 374fb0f5f2 IPC2581 fixes
- Component name ref comes before pin ref
- OtherSideView is at the end of the package
- BOM defines the dictionary so we need all items in the BOM even if
  marked "Exlude from BOM"
- Fix unique REFDES indicator to increment number rather than appending
  additional numbers
2024-04-16 13:25:09 -07:00
Jeff Young 3958d1bf14 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
2024-04-16 18:12:47 +01:00
Jeff Young d761b4f22f RIP LIB_TEXTBOX and LIB_SHAPE. 2024-04-16 16:31:16 +01:00
Jeff Young 3efe504dcc Collapse LIB_TEXT into SCH_TEXT. 2024-04-16 16:31:16 +01:00
Mark Roszko 5d7e96841b Close bom file earlier
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17779
2024-04-16 12:39:03 +00:00
aris-kimi 66bb49e2da Silence some GCC warnings 2024-04-16 11:11:50 +00:00
jean-pierre charras 6b7852c2bb BOARD::DeleteMARKERs fix bug: missing m_itemByIdCache handling.
When deleting markers, the m_itemByIdCache corresponding entry must be
also removed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11750
2024-04-16 12:00:40 +02:00
Seth Hillbrand f61d400d88 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.
2024-04-15 17:54:44 -07:00
Mike Williams ea904c9fb1 Symbol Fields Table: configurable excluded from BOM filtering
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17747
2024-04-15 13:08:04 -04:00
jean-pierre charras b7f035964f Fields in symbols: Ensure visibility is correctly set when reading a file
Also ensure default fields visibility is correctly set when creating a symbol
Change default field visibility to true in SCH_FIELD Ctor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17767
2024-04-15 18:19:19 +02:00
jean-pierre charras ac36feda41 EEschema: fix incorrect (missing) init of main layer of SCH_SHEET fields
These fields were not drawn when drawing a hierarchical sheet.
2024-04-15 09:56:19 +02:00
Seth Hillbrand d13100e7f2 Update translations 2024-04-14 14:22:59 -07:00
Henrik Kauhanen 82d125f0af Translated using Weblate (Swedish)
Currently translated at 99.9% (9261 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2024-04-14 23:19:45 +02:00
pominglee a2d5033654 Translated using Weblate (Chinese (Traditional))
Currently translated at 92.2% (8549 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-04-14 23:19:45 +02:00
pominglee 660f983592 Translated using Weblate (Chinese (Traditional))
Currently translated at 92.2% (8547 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-04-14 23:19:45 +02:00
pominglee fdb129b976 Translated using Weblate (Chinese (Traditional))
Currently translated at 92.0% (8532 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-04-14 23:19:45 +02:00
Ulices 568b7b7884 Translated using Weblate (Spanish (Mexico))
Currently translated at 98.2% (9110 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es_MX/
2024-04-14 23:19:45 +02:00
Marek d3e3e74dae Translated using Weblate (Polish)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2024-04-14 23:19:45 +02:00
Ulices d55a0b7afb Translated using Weblate (Spanish)
Currently translated at 97.3% (9026 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2024-04-14 23:19:45 +02:00
Tokita, Hiroshi 338d5bd253 Translated using Weblate (Japanese)
Currently translated at 97.9% (9080 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2024-04-14 23:19:45 +02:00
Alex Gellen f452591548 Translated using Weblate (Romanian)
Currently translated at 26.6% (2473 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ro/
2024-04-14 23:19:44 +02:00
Henrik Kauhanen 97e97e9ff9 Translated using Weblate (Swedish)
Currently translated at 99.9% (9261 of 9268 strings)

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

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-04-14 23:19:44 +02:00
j.Kolod 2521493e28 Translated using Weblate (Polish)
Currently translated at 100.0% (9268 of 9268 strings)

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

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-04-14 23:19:44 +02:00
CloverGit 2269240130 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9267 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-04-14 23:19:44 +02:00
ssantos fd2cb7794d Translated using Weblate (Portuguese)
Currently translated at 99.9% (9267 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt/
2024-04-14 23:19:44 +02:00
co8 j 5f1e78d408 Translated using Weblate (Japanese)
Currently translated at 97.8% (9068 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2024-04-14 23:19:44 +02:00
Jan Straka 41e1596680 Translated using Weblate (Czech)
Currently translated at 79.2% (7347 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2024-04-14 23:19:44 +02:00
Laurens Holst 296439f2ea Translated using Weblate (Dutch)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-04-14 23:19:44 +02:00
aris-kimi 28a07045a0 Translated using Weblate (Greek)
Currently translated at 99.7% (9248 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/el/
2024-04-14 23:19:44 +02:00
Ulices 833ce36118 Translated using Weblate (Spanish (Mexico))
Currently translated at 98.0% (9088 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es_MX/
2024-04-14 23:19:44 +02:00
pondahai b5e816faa1 Translated using Weblate (Chinese (Traditional))
Currently translated at 91.8% (8515 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-04-14 23:19:43 +02:00
김랑기 09387ccb66 Translated using Weblate (Korean)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-04-14 23:19:43 +02:00
Ulices 5c6c17ece7 Translated using Weblate (Spanish (Mexico))
Currently translated at 98.0% (9085 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es_MX/
2024-04-14 23:19:43 +02:00
Pferd O 416884351c Translated using Weblate (German)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2024-04-14 23:19:43 +02:00
aris-kimi 2e1e258086 Translated using Weblate (Greek)
Currently translated at 99.6% (9239 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/el/
2024-04-14 23:19:43 +02:00
Jan Straka e86eaba8f2 Translated using Weblate (Czech)
Currently translated at 78.8% (7306 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2024-04-14 23:19:43 +02:00
Dmitry Mikhirev 4416faf1fd Translated using Weblate (Russian)
Currently translated at 98.1% (9096 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2024-04-14 23:19:43 +02:00
simmon 91f32051c6 Translated using Weblate (Korean)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-04-14 23:19:43 +02:00
CloverGit 3cdb60d4a8 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9267 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-04-14 23:19:43 +02:00
CloverGit ef12f043aa Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9267 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-04-14 23:19:43 +02:00
Laurens Holst f55955d326 Translated using Weblate (Dutch)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-04-14 23:19:43 +02:00
CloverGit 6b59d7c8ee Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9267 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-04-14 23:19:43 +02:00
dsa-t 8155386cf3 Translated using Weblate (Russian)
Currently translated at 98.1% (9096 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2024-04-14 23:19:43 +02:00
Laurens Holst c21eba9be2 Translated using Weblate (Dutch)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-04-14 23:19:42 +02:00
Ulices 027771e39b Translated using Weblate (Spanish (Mexico))
Currently translated at 97.8% (9072 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es_MX/
2024-04-14 23:19:42 +02:00
pominglee 05009392c7 Translated using Weblate (Chinese (Traditional))
Currently translated at 91.8% (8515 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-04-14 23:19:42 +02:00
Andrej Valek 7cb69a48f0 Translated using Weblate (Slovak)
Currently translated at 64.1% (5945 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-04-14 23:19:42 +02:00
Laurens Holst ed575571a6 Translated using Weblate (Dutch)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-04-14 23:19:42 +02:00
Wellington Terumi Uemura f418722081 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2024-04-14 23:19:42 +02:00
pominglee 7dbbfdf3a7 Translated using Weblate (Chinese (Traditional))
Currently translated at 91.8% (8510 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-04-14 23:19:42 +02:00
CloverGit 2b2a48bbf5 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9267 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-04-14 23:19:42 +02:00
Laurens Holst 4819e53ba6 Translated using Weblate (Dutch)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-04-14 23:19:42 +02:00
Ulices 7e488de78e Translated using Weblate (Spanish (Mexico))
Currently translated at 97.6% (9054 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es_MX/
2024-04-14 23:19:42 +02:00
CloverGit 196c10f481 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9267 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-04-14 23:19:42 +02:00
dsa-t 09ffdd7029 Translated using Weblate (Russian)
Currently translated at 98.1% (9096 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2024-04-14 23:19:42 +02:00
ZbeeGin b43c1a0319 Translated using Weblate (Polish)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2024-04-14 23:19:42 +02:00
Toni Laiho 62b9c56733 Translated using Weblate (Finnish)
Currently translated at 99.9% (9263 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fi/
2024-04-14 23:19:42 +02:00
aris-kimi 5767589d17 Translated using Weblate (Greek)
Currently translated at 99.1% (9189 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/el/
2024-04-14 23:19:41 +02:00
Pedro Moreira a39cdac704 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.8% (9255 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2024-04-14 23:19:41 +02:00
CloverGit fa8b90ff7e Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9267 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-04-14 23:19:41 +02:00
Henrik Kauhanen 665c322029 Translated using Weblate (Swedish)
Currently translated at 99.9% (9261 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2024-04-14 23:19:41 +02:00
Marcel Hecko 3582f4e60f Translated using Weblate (Slovak)
Currently translated at 63.7% (5911 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-04-14 23:19:41 +02:00
dsa-t 351dbad80f Translated using Weblate (Russian)
Currently translated at 98.1% (9094 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2024-04-14 23:19:41 +02:00
Laurens Holst a451518dce Translated using Weblate (Dutch)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-04-14 23:19:41 +02:00
김랑기 7c7a1b6ca6 Translated using Weblate (Korean)
Currently translated at 100.0% (9268 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-04-14 23:19:41 +02:00
Pferd O d604e5bdf6 Translated using Weblate (German)
Currently translated at 99.8% (9256 of 9268 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2024-04-14 23:19:40 +02:00
Seth Hillbrand 8760519a87 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
2024-04-14 13:50:01 -07:00
Marek Roszko 2a3b597ab9 Strip out no longer needed links on the top executables
Not needed due to kicommon
2024-04-14 07:52:02 -04:00
jean-pierre charras c6f4157689 msys2: fix a link issue in Eeschema after changes from 89dd8e1. 2024-04-14 09:18:32 +02:00
Alex Shvartzkop ab531a33d9 Tweak GRID_CELL_STC_EDITOR offset on GTK. 2024-04-14 01:19:55 +03:00
Alex Shvartzkop affcfed677 Fix some warnings. 2024-04-14 01:19:39 +03:00
Alex Shvartzkop c1dc4e1d47 Fix build error on Linux/clang. 2024-04-14 00:37:44 +03:00
Alex Shvartzkop 76b7cdd128 Improve grid cell editors appearance. 2024-04-13 23:26:01 +03:00
Marek Roszko 94847e89c3 Static cast some more enum usage 2024-04-13 15:15:39 -04:00
Marek Roszko 7d68e19afa enum * double is deprecated 2024-04-13 15:14:39 -04:00
Marek Roszko d7685a40ee More lambda updates to explicit capture 2024-04-13 15:09:34 -04:00
Marek Roszko c1afade6f9 Silence the assert in NUMERIC_EVALUATOR on windows due to unicode
The reality is we parsing potentially unicode strings, char by char with the ascii functions like isdigit.
It's kind of broken already but at least I can make the assert go away lol
2024-04-13 15:05:09 -04:00
Jon Evans 02ec894b83 Remove LIB types from API for now
All with the possible exception of LIB_SYMBOL are going away
2024-04-13 15:03:34 -04:00
Jeff Young 14762e3d54 Handle layers for label fields. 2024-04-13 19:53:58 +01:00
Jeff Young d77eae3e7e Collapse LIB_FIELD into SCH_FIELD. 2024-04-13 15:42:13 +01:00
Jeff Young c241796968 Minor improvements to readability. 2024-04-13 15:40:08 +01:00
Marek Roszko aa8f449d48 Remove extraneous struct keyword 2024-04-13 09:56:25 -04:00
Marek Roszko 0ce227fa92 Can't use forward declare with std::vector
Not allowed per C++ standard

See https://github.com/llvm/llvm-project/issues/57700
2024-04-13 08:22:20 -04:00
Marek Roszko 89dd8e1166 Move the PARAM_LIST<> specializations for BOM to bom_settings 2024-04-13 07:59:25 -04:00
Marek Roszko eb38932d26 Fix capture lambda
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17757
2024-04-13 07:47:02 -04:00
Marek Roszko c05ae0b32e Fix another lambda capture 2024-04-12 23:37:38 -04:00
Marek Roszko 262d94964f Lets try C++20 2024-04-12 23:32:18 -04:00
Marek Roszko af2c52cf0a Remove wxT() that gets fed to ostream in boost and causes compile error 2024-04-12 23:06:23 -04:00
Marek Roszko 96cdfc7fa7 Update equality overloads for C++20
C++20 added new reverse and rewritten candidates. This can confuse the compiler because it'll test both A==B and B==A for overloads.
Because we were defining parent class equality overloads, A==B and B==A was considered ambigious due to both being compatible in casting.

So we needed to add explicit child class equality operator overloads
2024-04-12 23:05:58 -04:00
Marek Roszko 7a67151a22 Update lamba capture 2024-04-12 23:03:29 -04:00
Marek Roszko 1607729cf7 Silence deprecation warning about enum * fp type 2024-04-12 22:55:43 -04:00
Marek Roszko dbd98f1ce0 Explicit lambda capture 2024-04-12 22:54:59 -04:00
Marek Roszko e3777758d9 Silence enum operation warning 2024-04-12 22:54:42 -04:00
Marek Roszko 8fb4901d4b Fix more utf8 comparisons 2024-04-12 22:53:25 -04:00
Marek Roszko c042b51be9 Fix another deprecated lambda capture 2024-04-12 22:49:50 -04:00
Marek Roszko 161cfbacd4 constexpr the let user{} format string 2024-04-12 22:48:34 -04:00
Marek Roszko 0675c62a24 Update two more lambda capture 2024-04-12 22:42:31 -04:00
Marek Roszko e6be29daa0 Fix another UTF8 to wxString comparison 2024-04-12 22:38:38 -04:00
Marek Roszko 5e3396561d Fix some layer id enum colliding warnings
C++20 under MSVC does not like seeing enum values between two enums getting operated on.
static cast to int fixes it for what we are trying to do anyway
2024-04-12 21:55:19 -04:00
Marek Roszko b2115445cc Make screenCenter a VECTOR2D for now to silence c++ 20 build error 2024-04-12 21:55:19 -04:00
Alex Shvartzkop 1516aaf163 Improve custom grid cell editors' margins on MSW. 2024-04-13 03:54:04 +03:00
Alex Shvartzkop aa51cc5167 Remove macOS size tweak in custom grid cell editors.
Since the text field now has the no-border flag, it shouldn't be needed.
2024-04-13 03:54:04 +03:00
Marek Roszko 953c285ff0 fmt::format wants an actual constexpr format string under c++20 2024-04-12 20:04:52 -04:00
Marek Roszko 41fc1411eb Use explicit this capture in COLLECTOR m_inspector lambda 2024-04-12 20:03:07 -04:00
Marek Roszko 9e3865ed01 Remove wchar mixed into ostream output 2024-04-12 20:00:38 -04:00
Marek Roszko cd886a19d3 Partially update the json validator 2024-04-12 20:00:12 -04:00
Marek Roszko d8343a97dd explicit wx_str comparison 2024-04-12 19:59:43 -04:00
Marek Roszko 4a3018615b Be explicit with lazy_ctor captures 2024-04-12 19:56:02 -04:00
Marek Roszko 24a790a7dc Don't compare against the wrong type
Technically this is still wrong because of doubles..
2024-04-12 19:53:26 -04:00
Marek Roszko 5087c076c1 Lambda capture this for a callafter 2024-04-12 19:52:42 -04:00
Seth Hillbrand 6c17e275fb Revert "Re-enforce ordering"
This reverts commit b22fcf70cd.
2024-04-12 14:14:06 -07:00
Seth Hillbrand 531a8b9db9 Revert "Compare function should return int"
This reverts commit 7727982478.
2024-04-12 14:13:55 -07:00
Seth Hillbrand b22fcf70cd Re-enforce ordering
Instances, pins and graphics have started to wander around the files.
Sorts instances before writing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17737
2024-04-12 11:58:30 -07:00
Seth Hillbrand 7727982478 Compare function should return int
Returning boolean is promoted to int and confuses false with '0'
indicating that the elements are identical
2024-04-12 11:30:16 -07:00
Seth Hillbrand f08cacb30f Revert "Re-enforce ordering"
Unexpected element loss after save.  Reverting to fix

This reverts commit f2f4890342.
2024-04-12 10:34:11 -07:00
Seth Hillbrand f2f4890342 Re-enforce ordering
Instances, pins and graphics have started to wander around the files.
Sorts instances before writing.  Uses compare with std::set (not
std::multiset) to enfore lib item ordering

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17737
2024-04-12 10:08:46 -07:00
Seth Hillbrand e14e956c1d Fully order schematic saves 2024-04-11 16:54:30 -07:00
Seth Hillbrand e538b98286 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
2024-04-11 15:57:49 -07:00
Seth Hillbrand ac5fab190e 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

(cherry picked from commit 4481fcc75e)
2024-04-11 14:43:27 -07:00
Mike Williams cbef6d1cbf BOM Export: default to ${PROJECTNAME}.csv for convenience
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17049
2024-04-11 15:46:50 -04:00
Mike Williams 9c058503d9 BOM Export: remember filename per project
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17704
2024-04-11 15:05:59 -04:00
Seth Hillbrand d0fe2e06aa 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
2024-04-11 09:43:12 -07:00
Alex Shvartzkop e7ac68d409 Support alternating table row colors in SCH_PIN_TABLE_DATA_MODEL.
See https://gitlab.com/kicad/code/kicad/-/issues/17482
2024-04-11 19:37:31 +03:00
Mike Williams 067ef9657e net navigator: handle no-connects 2024-04-11 10:21:18 -04:00
Mike Williams faca7ee05b net navigator: show all nets when none are highlighted 2024-04-11 10:21:17 -04:00
Wayne Stambaugh ec310ac3ed 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
2024-04-11 10:11:02 -04:00
Alex Shvartzkop 9c1ece71a3 Show actual IO_ERROR message at VRML import.
https://gitlab.com/kicad/code/kicad/-/issues/17727


(cherry picked from commit 97b15a1708)
2024-04-11 11:38:40 +00:00
Seth Hillbrand a9f35ba42e 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
2024-04-10 17:25:58 -07:00
Seth Hillbrand 59f99d9a6a 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
2024-04-10 17:25:58 -07:00
Alex Shvartzkop 49dcd5f4fc Fix default cell alignment and FBP file for Configure Paths dialog. 2024-04-11 00:48:48 +03:00
Alex Shvartzkop 5d22c1adee Make grid cell editors with extra button consistent with normal text cell editors. 2024-04-11 00:47:27 +03:00
Alex Shvartzkop cae631d7b7 Fix build error in API handler.
(cherry picked from commit 46e183920385f5a040df948e35ecc8dcf80cd2ee)
2024-04-10 19:09:12 +00:00
Jeff Young 3b66f64c19 Cleanup. 2024-04-10 10:26:59 +01:00
Jeff Young 0d6822be0d Remove shadowed member variables. 2024-04-10 10:26:59 +01:00
Alex Shvartzkop 7b935f7673 EasyEDA Pro: import Colorful Image as Reference Image. 2024-04-10 03:21:46 +03:00
afkiwers d45911f54b add support to update an already existing field 2024-04-09 23:37:20 +00:00
Mike Williams e2f1da60d9 PCB Fields: fix v7 imported board hidden description field pos
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17684
2024-04-09 15:23:44 -04:00
Jeff Young 1aa59b806c 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
2024-04-09 13:40:18 +01:00
Jeff Young 56f6f44b3d Formatting, type-cast and auto cleanup. 2024-04-09 12:55:44 +01:00
Jeff Young e7493c7851 Fix SCH_SYMBOL's operator=.
Also cleans up a few loose ends from LIB_ITEM collapse.
2024-04-08 21:24:32 +01:00
Jeff Young 6c7946012c Turn off hidden pins/fields for plot jobs handler.
(We only have CLI settings for them when plotting symbols.)
2024-04-08 16:56:36 +01:00
Jeff Young 3ade857c7b Honour parent symbol's transform when over-plotting pins. 2024-04-08 14:26:48 +01:00
Jeff Young 1d753e0850 Respect showHiddenPins and showHiddenFields flags when plotting. 2024-04-08 13:32:11 +01:00
Jeff Young 9c94967b52 Tidy renderSettings / jobsHandler APIs. 2024-04-08 12:26:56 +01:00
Jeff Young 5abc7145da Fold LIB_ITEM into SCH_ITEM. 2024-04-08 10:24:50 +01:00
Jeff Young 494001ed4c Harmonize more APIs. 2024-04-08 10:10:24 +01:00
Jeff Young 968ca7c5c3 SNR 2024-04-08 10:10:24 +01:00
Huang Rui 1cbf6a1872 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>
2024-04-07 15:43:52 +00:00
JamesJ 13038038d9 Remove unused method declaration in SCH_LINE
This is a tidy-up following on from b01796cb
2024-04-07 15:41:54 +00:00
Jon Evans ce846f5c22 Check for bus no-connects in ERC
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13285
2024-04-07 08:50:28 -04:00
Jon Evans b36312ff24 Disable lazy-loading of 3D models on macOS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17198
2024-04-07 08:20:34 -04:00
Mark Roszko fba868295c Use newer docker image for doxygen 2024-04-07 00:52:34 +00:00
Seth Hillbrand a12bc3a410 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
2024-04-06 14:28:49 -07:00
JamesJ 9853b300d7 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 18:45:39 +01:00
Jon Evans d77d31b663 Fix running pytest tests in macOS 2024-04-06 12:15:35 -04:00
Jon Evans c9b6be2243 Load 3D plugins when running from build dir on macOS 2024-04-06 08:52:17 -04:00
Jeff Young 1028a76e4a Harmonize print/plot APIs. 2024-04-06 09:34:56 +01:00
Jeff Young 5dd8747ecb Harmonize mirroring APIs. 2024-04-06 09:34:56 +01:00
Jeff Young c5ed80af52 Harmonize rotate APIs. 2024-04-06 09:34:56 +01:00
qu1ck 441b2686d3 IPC_API: fix crash in PLUGIN_AVAILABILITY_CHANGED event handler 2024-04-05 18:11:52 -07:00
Jon Evans c6e784dae3 Fix order of install targets for macOS 2024-04-05 11:39:52 -04:00
Jon Evans 7baccba01c Coverity fixes 2024-04-05 08:16:29 -04:00
Jon Evans c1e7668d80 Fix SWIG wrapper for AddPrimitive
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17676
2024-04-04 23:09:05 -04:00
Jon Evans aff2d5c0d3 Factor out SHAPE_LINE_CHAIN utilities 2024-04-04 18:55:58 -04:00
JamesJ a321a86f38 Update net inspector after connectivity update when loading board
Fixes issue where if the net inspector was open when a board was
loaded, the track data would not be updated until a board edit
action triggered an update.
2024-04-04 22:29:47 +00:00
JamesJ 951065390e Add composite update callback to BOARD_LISTENER
Required for net inspector otherwise composite operations (such
as undo / redo, and length tuning) can result in multiple add /
remove events firing which results in inconsistent length state.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17527
(for 9.0)
2024-04-04 22:29:47 +00:00
Jon Evans ca5ca2858c Fix installation packaging of kiapi on macOS 2024-04-04 17:55:32 -04:00
Mike Williams e83a82594e net navigator: check for removal from net as well 2024-04-04 15:25:54 -04:00
Mike Williams e1548c0f9a schematic: update highlighting when net changed 2024-04-04 14:10:18 -04:00
Jeff Young 92910d5d0f Factor common parts of SCH_ & LIB_SYMBOL into SYMBOL. 2024-04-04 13:18:55 +01:00
Jeff Young bf2b3b0b0f Deconflict some LIB_TREE_ITEM APIs so they can remain non-const.
(The non-const is required by FOOTPRINT_INFO, which must load
footrpints to get some of the data.)
2024-04-04 13:18:55 +01:00
jean-pierre charras 59142a10d7 DIALOG_CREATE_ARRAY: better messages and better comments
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17642
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17656
2024-04-04 09:54:47 +02:00
jean-pierre charras 3f24e0eb09 minor compil warning (unused var) 2024-04-04 09:52:28 +02:00
Jon Evans 9c113b25a4 Allow turning the API server on/off at runtime 2024-04-03 22:04:11 -04:00
Marek Roszko e0b913cc65 Get rid of code path that has been unreachable for many years 2024-04-03 19:54:07 -04:00
Jon Evans 6a203fb289 Set SOVERSION for kiapi 2024-04-03 18:13:41 -04:00
Jon Evans 2b1f56ebc8 Disable a MSVC warning seen in protobuf generated code
This warning is not very useful and is disabled
by default when not using /Wall
2024-04-03 18:10:21 -04:00
Seth Hillbrand c9b1134417 Move FindProtobuf to default on for Linux 2024-04-03 10:41:14 -07:00
Seth Hillbrand 6c73e70dad Force installation of protobuf-compiler at configure step 2024-04-03 10:30:09 -07:00
Mike Williams 2acf928723 PCB: fix net inspector assert on column show/hide menu
Also handle 0-width columns coming in from settings. GTK seems to have
an issue where these columns are impossible to resize even if they are
made visible.
2024-04-03 13:15:47 -04:00
Jon Evans bab6913e14 Add api to the CI tests 2024-04-03 07:56:43 -04:00
Jon Evans 499b24e025 Add kiapi to Fedora CI artifacts 2024-04-02 23:33:55 -04:00
Jon Evans 220cf1287f Turn on CMake FindProtobuf for CI 2024-04-02 23:02:14 -04:00
Marek Roszko 279732e89e Add boost bimap to vcpkg 2024-04-02 21:18:58 -04:00
Marek Roszko 58913a0616 Add missing gltf find in occ 7.8 2024-04-02 21:06:48 -04:00
Marek Roszko 02325169d0 Bump vcpkg for occt 7.8.1 2024-04-02 21:06:47 -04:00
Jon Evans 493ca7a0f5 Fix unhandled case warnings 2024-04-02 20:56:48 -04:00
Jon Evans 75b61956e9 Fix Windows name collision 2024-04-02 20:06:36 -04:00
Jon Evans 1dbe78c68b Add QA tests and expand serialization for API 2024-04-02 19:51:18 -04:00
Jon Evans 6bd02cae6d Refactor; add user control over API server 2024-04-02 19:51:18 -04:00
Jon Evans a3b6ab48a4 Add a new plugin system for the new API 2024-04-02 19:51:16 -04:00
Jon Evans f613cd1cb4 ADDED: A new IPC API based on protobuf and nng
Details, documentation, and language bindings are works in
progress and will be evolving over the course of KiCad 9
development.
2024-04-02 19:34:36 -04:00
Jon Evans 77eaa75db1 Show all library children if library name matches search
(cherry picked from commit a042d1aab4)
2024-04-02 22:51:41 +00:00
Jon Evans e5d4f58d65 Fix parsing of legacy text hide token
(cherry picked from commit 53c2543474)
2024-04-02 22:26:57 +00:00
Marek Roszko 6ac1f39e62 Use kicad-vcpkg fork of liblzma to fix builds 2024-04-02 18:04:51 -04:00
Alex Shvartzkop b905b4eac8 Improve moving, rendering and plotting of very small angle arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17110
2024-04-03 00:40:18 +03:00
Seth Hillbrand 8260c174e9 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
2024-04-02 11:22:59 -07:00
Seth Hillbrand 2123e2ca9c Add some corrections to IPC2581 export syntax
Outline fonts need lineDesc
Padstack def need the location for the pad relative to the padstack
2024-04-01 22:57:25 -07:00
Marek Roszko 303bc19ce8 Use macro not function for the occ lib find 2024-04-01 21:54:43 -04:00
Marek Roszko c8e41dcfe8 Fix cmake find of opencascade libraries for occt 7.8
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17654
2024-04-01 20:49:33 -04:00
Seth Hillbrand d82e8ee41a Map nets in pasted data
Add missing nets to the existing board and use any existing nets of the
same name.

Adds option to clear all nets in Paste Special

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17626
2024-04-01 16:56:44 -07:00
Ian McInerney c7d280dfa1 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
2024-04-01 22:00:10 +01:00
Ian McInerney 90ace0fcaf Ensure model file output stream is valid before writing to it
Fixes KICAD-74V
2024-04-01 22:00:05 +01:00
Ian McInerney e67eae90e9 Check for read permissions before trying to import schematic file
This will display a better error message to the user, instead of saying
that no plugins to load the file are found (because the plugin tests
will also fail due to being unable to read the file).
2024-04-01 22:00:00 +01:00
Ian McInerney 87a8235831 Remove group from dummy track before deletion
The dummy track in the merge colinear segments is used to overwrite the
original segment with the changes at the end, so the group must be
removed before leaving the function, and can't be removed at creation.

Fixes KICAD-74M
2024-04-01 21:59:55 +01:00
Ian McInerney 9456f35491 Properly cleanup git repos and memory on project/frame deletion
* Ensure the git backend is deleted when the project tree is deleted.
* Unload the git repo for a project when the project is unloaded from
  the tree.
2024-04-01 21:59:50 +01:00
Ian McInerney 921358b096 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.
2024-04-01 21:59:46 +01:00
Ian McInerney 9e597ea754 Add the option to use alternating row colors in tables/grids
ADDED: Option to use alternating row colors in tables/grids

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16739
2024-04-01 21:59:37 +01:00
Seth Hillbrand 553e4a25bf Tidy up some remaining triangulation cases
Found and fixed a few corner cases where triangulation point removal
could reset expected points
2024-04-01 11:48:12 -07:00
Jeff Young 1b22c92177 Fix extra space. 2024-04-01 17:45:02 +01:00
Jeff Young 78bec3f1ba Fix fishy logic in SHAPE_LINE_CHAIN::Collide(). 2024-04-01 17:03:15 +01:00
Seth Hillbrand 06b199fd41 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
2024-03-31 15:00:46 -07:00
Jeff Young dfa16eda95 Fix copy/pasta in SHAPE_LINE_CHAIN::Collide().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17636
2024-03-31 18:12:33 +01:00
Roberto Fernandez Bautista 6078bc52eb PNS: Fix a few memory leaks 2024-03-31 18:21:02 +02:00
Jeff Young 43edc2eaf8 Don't start immediate mode when there's no event position.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17332
2024-03-31 12:59:52 +01:00
Jeff Young 02f6d38fe3 Fix merge error. 2024-03-31 12:59:52 +01:00
Thomas Pointhuber 7d1881b58a altium: use std::unique_ptr instead of raw pointers where feasible 2024-03-31 00:03:03 +01:00
jean-pierre charras bf84536863 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-03-30 19:12:15 +01:00
Seth Hillbrand c841d0df6d 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
2024-03-30 07:58:34 -07:00
JamesJ b01796cb84 Auto-fill new net global / local label names from connectivity
Currently, new global or local net labels are auto-filled with the
net name if the wire is driven by a global or local label. This
currently happens recursively within SCH_LINE. This fix moves this
to determining the driver from the connectivity graph, and removes
the determination from the SCH_LINE code where it does not belong.
2024-03-30 14:33:51 +00:00
Roberto Fernandez Bautista 9957c58c14 Remove unused function RunPythonMethodWithReturnedString
pcbnewRunPythonMethodWithReturnedString already exists
2024-03-30 15:23:14 +01:00
JamesJ 79a3dd71e4 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.
2024-03-30 14:20:06 +00:00
Marek Roszko fd501b4bc8 Fix DRC slowdown due to UI yields
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17434
2024-03-29 23:34:01 -04:00
Seth Hillbrand 37a3f52d81 Remove unused variable 2024-03-29 16:48:08 -07:00
Seth Hillbrand 6c05f2c67c Move logging message after vertex check
When creating the list, we may have fewer than needed vertices, which
prevents calculating the area
2024-03-29 16:47:07 -07:00
Seth Hillbrand e4756c811e 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
2024-03-29 15:39:57 -07:00
Seth Hillbrand 10c1072479 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
2024-03-29 15:39:57 -07:00
Seth Hillbrand 5e850911c5 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
2024-03-29 15:39:57 -07:00
Marek Roszko fcc9b8456f Add extra comment in vcpkg 2024-03-29 18:27:11 -04:00
Marek Roszko 57d029f087 Ensure liblzma stays pinned to 5.4.4 2024-03-29 18:27:11 -04:00
Roberto Fernandez Bautista 8afeea4ce9 Fix "pns_debug_tool replay" hidden controls 2024-03-29 23:15:44 +01:00
Jeff Young 491adc6c6c Formatting. 2024-03-29 16:04:32 +00:00
Jeff Young 2c21ef1ed0 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
2024-03-29 16:04:32 +00:00
Ethan Chien 42552d2e78 CMakePresets.json.sample: Prefer RelWithDebInfo for x64-Release 2024-03-29 09:59:46 +08:00
Seth Hillbrand c3a5b92ed0 Sort netnames in properties panel
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15590
2024-03-28 13:03:16 -07:00
Ethan Chien 075cbfc24f fix: Add architecture setting in the CMakePresets.json.sample 2024-03-29 02:47:26 +08:00
Seth Hillbrand c3f6a84d66 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
2024-03-28 10:16:24 -07:00
Ethan Chien 79174f8223 fix: Add x64-Debug and win64-Release presets in the CMakePresets sample 2024-03-29 00:54:20 +08:00
Jeff Young 3a430357bc Cut/copy/paste for SCH tables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17335
2024-03-28 14:34:11 +00:00
Jeff Young 57b224d3f0 Cut/copy/paste for PCB tables. 2024-03-28 14:31:31 +00:00
Jeff Young f9c5e48c57 Add missing PCB_TABLE_T, and a comment. 2024-03-28 14:31:31 +00:00
jean-pierre charras 8754f6867f 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)
2024-03-28 14:52:31 +01:00
Ethan Chien 226356a2a4 Add initial CMakePresets sample for Windows 2024-03-28 20:38:05 +08:00
Jon Evans e347300593 Work around SWIG problems 2024-03-27 18:42:46 -04:00
Céleste Wouters e98c9f283f 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
2024-03-27 21:19:02 +00:00
Mike Williams 48b3b4697a PCB: update footprint field when changing footprints
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17598
2024-03-27 15:20:12 -04:00
Jon Evans 1acb1afa98 Fix build errors; warnings
(somehow, the previous version compiles on my machine...)
2024-03-26 19:38:28 -04:00
Jon Evans 5aa8af1abf Add a cache for looking up board items by ID 2024-03-26 18:36:23 -04:00
Jon Evans 7b6afd290a Remove non-const access to board-owned items
(with a few things const-casted for now)
2024-03-26 18:36:23 -04:00
JamesJ 7cc7f238d7 SCH_SHAPE destructor marked virtual 2024-03-26 22:20:09 +00:00
Ethan Chien 0a89236f19 CLI: Add allegro and pads netlist output format options 2024-03-26 19:58:22 +08:00
JamesJ 54919e6854 Performance update for pcbnew net inspector
Forces full rebuild of nets list for bulk updates over a certain
size. This is more performant than iterating over all items in
a bulk update.
2024-03-24 20:29:15 +00:00
JamesJ f51e775f26 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
2024-03-24 19:25:26 +00:00
Jeff Young 50567764b5 Allow no-net teardrops on no-net pads with no-net tracks.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17566
2024-03-24 19:22:25 +00:00
Jeff Young 2f2c42a06b More defensive coding for KICAD-YP.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17560
2024-03-24 19:22:05 +00:00
Jeff Young a53bc9e026 Attempt to prevent KICAD-YP.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17560
2024-03-24 18:12:58 +00:00
Jeff Young 5d37a00759 Table plotting for PCBNew.
Also fixes some bugs with property exposure that (along with
other things) allowed you to put table cells on a different
layer than their parent table.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17438
2024-03-24 16:49:33 +00:00
JamesJ 67d6e6afdf Only update net inspector when panel is shown.
Pcbnew can hang for a long time when undoing operations involving
large numbers of board items. This provides an interim workaround
(and replicated the behaviour of the search panel) by only
computing track statistics updates incrementally if the inspector
is displayed.

Partially fixes https://gitlab.com/kicad/code/kicad/-/issues/17561
(if net inspector is not shown)
2024-03-24 12:11:36 +00:00
Jeff Young f3ce3bc758 Close active cell editor when showing/hiding columns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17425
2024-03-24 10:09:27 +00:00
Alex Shvartzkop bd59fb7768 Fix spelling mistake. 2024-03-23 21:43:30 +03:00
Alex Shvartzkop 93581607a8 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
2024-03-23 21:19:04 +03:00
Jeff Young a6e2746a08 Rewrite intersheet refs resolution to be sheet-path aware.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17533
2024-03-23 16:50:21 +00:00
Jeff Young fc572bfbc6 Make sure users don't run into min text size.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17543
2024-03-23 15:50:45 +00:00
Alex Shvartzkop 1c7e3871b5 Fix warning due to unused angle in EasyEDA Pro schematic parser. 2024-03-23 17:51:19 +03:00
Jon Evans af18e06ea4 Remove the "insert chevron" function of the via placer
This behavior is generally undesirable and was only needed
because of past limitations.  Now we only split a track
when the user places a via directly on top of it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16456
2024-03-23 14:28:21 +00:00
wh201906 806daecf85 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.
2024-03-23 21:24:13 +08:00
Jeff Young 88c1fa3e26 Ignore graphic shapes that implement netties.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17223
2024-03-23 13:18:46 +00:00
Marek Roszko ab759d21f2 Fix more build warnings 2024-03-23 08:53:11 -04:00
Jeff Young 1e6eb652aa Don't show hidden text in symbol previews.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17526
2024-03-23 12:48:52 +00:00
Jeff Young 7218d501d4 Better locality-of-reference for footprint chooser filters. 2024-03-23 12:48:52 +00:00
Marek Roszko 490dbfdf83 Fix build warnings 2024-03-23 08:34:59 -04:00
aris-kimi d7abed2d60 Footprint Chooser dialog: Allow toggle buttons to work simultaneously 2024-03-23 09:48:15 +00:00
Seth Hillbrand 2a6a29830d Fix windows icons. Need 256 not 128px 2024-03-22 11:09:06 -07:00
Seth Hillbrand a793fa8b17 Fix typo in triangulation return 2024-03-22 11:08:38 -07:00
Seth Hillbrand 00d108498f 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
2024-03-22 10:55:48 -07:00
Seth Hillbrand 6b915049d1 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
2024-03-22 10:41:42 -07:00
Seth Hillbrand e11cc322fd Add colored tab to fileicons
Allows differentiation when Windows badges the bottom left

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17525
2024-03-22 10:05:02 -07:00
Jeff Young 90566eb735 Setup default colors in the COLOR_SWATCHes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17517
2024-03-22 12:41:03 +00:00
Jeff Young a3f3da5a7d Implement STROKE_PARAMS::Stroke() for SH_RECT.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17516
2024-03-22 12:22:30 +00:00
Marek Roszko d134d7cc2a Add missing include to force correct linkage 2024-03-22 06:48:47 -04:00
jean-pierre charras cb8ed07858 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 09:50:32 +01:00
Marek Roszko f0912b6128 Fix msys2 build 2024-03-21 19:52:18 -04:00
JamesJ de85b2217b Re-centralise handling of sort column in net inspector list.
- Includes GTK crash fix from a5ef4f1b
- Additionally removes an unneccesary re-sort when rebuilding columns
- Correctly saves column state when using pcbnew standalone
2024-03-21 21:07:08 +00:00
Seth Hillbrand a58e7b37ff 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
2024-03-21 13:57:57 -07:00
Seth Hillbrand 7e7fec69f6 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.
2024-03-21 13:57:57 -07:00
Seth Hillbrand 4f03bb2fb6 Update triangulation 2024-03-21 13:57:57 -07:00
dsa-t db12f2af49 Disallow cross-probing when not on Symbol Fields Table Edit tab.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17531
2024-03-21 19:08:23 +00:00
Jeff Young b285545aee 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.)
2024-03-21 18:14:29 +00:00
Jeff Young 58df9c96f4 ADDED: Expose units and DeMorgan to properties system.
(Also fixes inheritance bug in LIB_PIN's properties.)
2024-03-21 16:19:55 +00:00
jean-pierre charras 4f4ca9f383 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:19:48 +01:00
Jeff Young c5c65f23a4 Internationalise pin info when language changes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17224
2024-03-21 12:31:04 +00:00
Jeff Young 913e6b47d7 Fix copy/pasta in tooltips.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17515
2024-03-21 12:31:04 +00:00
Marek Roszko 46e301cd7f Add missing header include that only fails on msys2 ucrt
Weird
2024-03-21 07:41:51 -04:00
Marek Roszko 83ef5fd7d6 Move PGM_BASE to kicommon 2024-03-20 23:29:42 -04:00
Marek Roszko e32b26ebeb Move JSON_SETTINGS and PARAMS to kicommon 2024-03-20 23:29:42 -04:00
Mark Roszko 8e31759191 Fix hopefully the last build breakage 2024-03-21 03:28:44 +00:00
Mark Roszko 7b904545e9 Fix explicit wxstring build breakage 2024-03-21 03:25:15 +00:00
Mark Roszko 9947cc0359 Fix another build breakage 2024-03-21 03:23:29 +00:00
Mark Roszko de6c0fcf25 Fix build breakage due to missing header 2024-03-21 03:15:14 +00:00
Jon Evans a5ef4f1bef Net inspector: fix crash when switching boards on GTK
Can't invalidate columns while they are the sorting key
2024-03-20 23:04:28 -04:00
Jon Evans f00f47df13 wxWidgets 3.3 compatibility: explicit wxString conversion 2024-03-20 22:02:41 -04:00
Jon Evans e7b6573717 wxWidgets 3.3 compatibility: properties API 2024-03-20 22:02:40 -04:00
Jon Evans 773d241863 wxWidgets 3.3 compatibility: update enum name 2024-03-20 21:50:44 -04:00
Jeff Young d0df8df7c7 Use a lighter touch keeping internal data structures in sync.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17493
2024-03-20 21:35:43 +00:00
Jeff Young 82c851a4a7 Expose groups to property manager.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17496
2024-03-20 20:19:21 +00:00
Jeff Young 859f553c91 Keep internal data consistent when changing pad type.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17493
2024-03-20 18:35:56 +00:00
Jeff Young 7bdf1c7e0f Clear flags before depending on them.
(While at first it may look like any item with the flag set
is going to get deleted anyway, if an undo happens then we
end up with table cells with the STRUCT_DELETED flag already
set.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17487
2024-03-20 17:55:58 +00:00
jean-pierre charras 90eed8b4b6 Avoid using a nullptr. 2024-03-20 18:34:18 +01:00
Jan Wichmann 66d8f5cae4 pcb_calculator: Feature Calculation of voltage regulator with tolerances 2024-03-20 12:59:36 +00:00
Alex Shvartzkop 800ff9ffb1 STEP export: add location info to edge add failures. 2024-03-19 23:10:37 +03:00
Alex Shvartzkop 75037dd1d1 STEP export: handle small segments connecting two arcs better.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17499
2024-03-19 22:53:30 +03:00
Roberto Fernandez Bautista 69107816f1 nanodbc: Fix use after free
Cherry picked from upstream commit e24383436703c9151af1e22652e7d4dbbb52fc15

https://github.com/nanodbc/nanodbc/commit/e24383436703c9151af1e22652e7d4dbbb52fc15
2024-03-19 18:50:20 +01:00
jean-pierre charras 3303c17c9b fix minor compil warning (inused var) 2024-03-19 17:40:04 +01:00
jean-pierre charras f3966371be Simulation: add export current plot to clipboard and current schematic
These exports are in file menu.
2024-03-19 17:05:55 +01:00
jean-pierre charras 63dd4aed93 Step exporter: workaround to fix issue for boards with main round outline
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17446
2024-03-19 11:19:37 +01:00
JamesJ a763d613e5 Move Net Inspector dialog to a widget panel in pcbnew
Introduces some updates to the inspector, and a number of bug fixes:

- Correctly handles changes in board stackup
- Correctly handles unit change events
- Correctly handles language change events
- All layout / panel settings are stored to the project settings
- Retains ability to create net report
- Simple filter searches on net name and net class name (stored in settings)
- Allows hide / show of columns (stored in settings)
- Grouping by netclass (stored in settings)
- Optional filtering by net name (stored in settings)
- Optional filtering by net class (stored in settings)
- Custom grouping by net name match
2024-03-19 01:02:01 +00:00
Seth Hillbrand 4e6cd0d293 Forward and reverse test for point in poly collisions 2024-03-18 15:51:14 -07:00
Jeff Young 05cdd44404 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:21:01 +00:00
Jeff Young 4ed2a0674a Minor cleanup. 2024-03-18 22:21:01 +00:00
Mike Williams 543343b7d1 prettifier: add newlines to golden samples 2024-03-18 16:03:09 -04:00
Mike Williams 5318001726 prettifier: add newline to end of file
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17480
2024-03-18 15:29:43 -04:00
jean-pierre charras 0fab12f367 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:16:37 +01:00
jean-pierre charras 3b47fd1503 FOOTPRINT_CHOOSER_FRAME: add option to show the 3D in a separate viewer.
If a separate viewer frame is selected, the footprint chooser always shows
the footprint and the 3D shape is shown in a 3D viewer frame if the 3D view
is enabled.
2024-03-18 08:42:43 +01:00
Mark Roszko 72d83cd5de Revert "Move JSON_SETTINGS and PARAMS to kicommon"
This reverts commit 81855aaaa6
2024-03-18 00:08:46 +00:00
JamesJ 2311eed08a Add new ERC rule to check for global labels with only one entry in the schematic
By default this rule is set to ignore to provide continuity for those using
single global labels to name nets (e.g. in simulation)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13212
2024-03-17 23:24:43 +00:00
wh201906 3f2e3d89e2 Fix selected item count in the properties panel
The code for updating selected item count is skipped if the properties
items don't change.
2024-03-17 22:26:31 +00:00
Marek Roszko 81855aaaa6 Move JSON_SETTINGS and PARAMS to kicommon 2024-03-17 18:11:49 -04:00
Jeff Young 37b19c4df7 Handle table layer in undo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17437
2024-03-17 20:39:46 +00:00
Jeff Young 0598ca0f90 Keep BOARD_DESIGN_SETTINGS DRC marker exclusions up-to-date.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17429
2024-03-17 16:29:24 +00:00
Wayne Stambaugh 797ab998cc 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
2024-03-17 09:02:26 -04:00
Jeff Young d317b8da74 Pull modifications to cherry pick forward from 6.0. 2024-03-17 12:42:45 +00:00
Jeff Young 44c14b1935 Fix layer swapping for multi-layer items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17371
2024-03-17 12:14:21 +00:00
Jeff Young 383dbd983a Don't skip transitions from netclass to empty. 2024-03-16 19:46:48 +00:00
Jeff Young a6e8370ddd Pin names drive netnames. 2024-03-16 19:26:26 +00:00
Jeff Young 17a93adb30 Netclasses also must be computed in connectivity updates. 2024-03-16 19:24:25 +00:00
Jeff Young 116908c088 Formatting. 2024-03-16 12:00:15 +00:00
Jeff Young a4062ade3d Report location of FUTURE_FORMAT_ERRORs when reading footprints. 2024-03-16 11:06:12 +00:00
Jeff Young d17151ac1b Correctly handle locked token for PCB_TEXTBOX and PCB_TABLECELL.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17439
2024-03-15 21:42:47 +00:00
Mark Roszko fc11862580 Try out the medium runner for public linux builds 2024-03-15 18:37:34 +00:00
Jeff Young da2610b93b Add autocomplete accept & cancel to the hotkeys list. 2024-03-15 00:40:17 +00:00
StefanBruens e07b4ce8e4 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
2024-03-14 22:26:23 +00:00
Jan Wichmann 91b850d8df pcbnew: The checkbox 'Center on footprint' was not disabled when the actionButton was changed. 2024-03-14 22:24:30 +00:00
Wayne Stambaugh cf97432833 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.
2024-03-14 17:00:27 -04:00
Jeff Young f22f5f47cb Reset penWidth before stroking.
(PlotPoly will have set it to "1".)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17218
2024-03-14 17:40:04 +00:00
Jeff Young e30b6398b7 ADDED: optional PDF metadata from AUTHOR and SUBJECT variables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17289
2024-03-14 17:40:04 +00:00
Wayne Stambaugh 34ec57958d 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
2024-03-14 09:45:05 -04:00
jean-pierre charras c27eade01e 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.
2024-03-14 10:01:58 +01:00
Seth Hillbrand 81cb6d0c3f 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
2024-03-13 10:35:40 -07:00
jean-pierre charras 4f4d9be8d1 Symbol Editor do not display bounding box of invisible pins and fields 2024-03-13 17:46:14 +01:00
Wayne Stambaugh eddf4883b6 Minor dialog layout improvements. 2024-03-13 11:45:33 -04:00
Jeff Young dac16a02cc Default is a valid netclass, even if it's not in m_NetClasses.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17388
2024-03-13 15:30:07 +00:00
Jeff Young a091767551 Don't test non-overlapping non-through-hole vias.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17426
2024-03-13 15:19:28 +00:00
Jeff Young 91d949f59e Splitter for 3D model page of Footprint Properties.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15606
2024-03-13 15:03:55 +00:00
Wayne Stambaugh 33566f88a9 Clean up debugging output accidentally left in previous commit. 2024-03-13 10:48:44 -04:00
Wayne Stambaugh 0ff8d21459 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
2024-03-13 09:39:41 -04:00
Jeff Young 7341d4bf37 Update m_LastLegendPosition after setting dirty bit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17411
2024-03-13 10:39:03 +00:00
Alex Shvartzkop b56ee20e22 Fix a crash in PNS zone sync when there's more outlines than triangulated polygons.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17351
2024-03-13 03:09:21 +03:00
Jon Evans b190f21b6c Remove close buttons from schematic AUI
Harmonizes with PCB editor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17415
2024-03-12 19:51:27 -04:00
Jon Evans ece8521e68 Add some safety to layer swapping
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17371
2024-03-12 19:32:40 -04:00
Jeff Young 4b6a1f4dbd 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
2024-03-12 22:29:03 +00:00
Jeff Young 1844bf1708 Make Edit Track & Via Sizes "specified sizes" dropdowns clearer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17216
2024-03-12 22:27:10 +00:00
Jeff Young 25e181db5c Don't allow selection of footprint text in board editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17271
2024-03-12 21:30:12 +00:00
Jeff Young 628ec858a6 Label netlist exporters.
(Particularly useful for those that have no other settings and
otherwise look blank.)

Also replaces "Generator" terminology as it's a bit confusing
(and will only get more confusing with PCBNew Generators).
2024-03-12 17:47:24 +00:00
Jeff Young 7ec2a1f09c Allow Scintilla-created clipboard to be accessed after quit. 2024-03-12 17:09:07 +00:00
Jeff Young 2a0ce409e3 Attempt to fix non-MacOS build error. 2024-03-12 15:17:30 +00:00
Jeff Young 87121af3c9 Simplify about dialog impl and make it real-time performant.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17213
2024-03-12 14:50:10 +00:00
Alex Shvartzkop 463b609993 Disable infinite panning when using XWayland.
Cursor warping doesn't work properly in this scenario.

https://gitlab.com/kicad/code/kicad/-/issues/14109
2024-03-12 10:31:23 +03:00
Alex Shvartzkop 44b970c8f2 Fix warning. 2024-03-12 08:54:21 +03:00
Alex Shvartzkop e4218effbd Disable search ctrl cursor management on non-OSX.
Buggy at least on GTK and MSW.

(cherry picked from commit 764de7257f)
2024-03-12 08:28:11 +03:00
Alex Shvartzkop bf6ff5b805 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
2024-03-12 08:04:56 +03:00
Seth Hillbrand 0f57d76ecd 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
2024-03-11 17:50:44 -07:00
Seth Hillbrand 347c50b26d 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
2024-03-11 17:21:09 -07:00
Seth Hillbrand 6e591f5f91 Don't count removed zone layers
This does 3 things:
1) Removes unused zone layers on load
2) Does not save unused zone layers
3) Removes unused zone layers from connectivity calculation

(1) Prevents existing boards from using unused zone layers for any
connectivity or rendering.  (2) Updates the contents of boards with
removed zone layers to prevent them from propagating.  (3) updates the
connectivity while running pcbnew and removing a zone layer

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17288
2024-03-11 23:38:10 +00:00
SubaruArai d7173dd6d1 qr footprint wizard: add option for error correction level
QR codes allow 4 different levels of error correction.  By increasing the level, larger numbers of data bytes can be corrupted without invalidating the code
2024-03-11 23:37:29 +00:00
Seth Hillbrand 3cc1617f5a 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
2024-03-11 16:32:24 -07:00
Seth Hillbrand 9648fafe11 Handle memberOfSheet for full footprints
Previously, we handled clearance for just components in the eval
function.  We also checked the incorrect root sheetname.
2024-03-11 16:32:24 -07:00
Jeff Young d083593177 Table bug fixes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17399

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17398
2024-03-11 22:58:12 +00:00
Wayne Stambaugh 865225fcca Use correct value field text when importing Eagle schematic symbols.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17130
2024-03-11 15:19:32 -04:00
Jeff Young ed61c5593f 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
2024-03-11 18:14:38 +00:00
Jeff Young 5ccd11d426 Run disambiguation if there are multiple preferred items.
This didn't really come up before tables, but any cell selection
will also include its parent table.
2024-03-11 17:46:09 +00:00
Jeff Young ccfefc3971 Table support for footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17333
2024-03-11 17:46:09 +00:00
Jeff Young 85d0126187 Auto-start text entry for Scintilla grid cells. 2024-03-11 17:46:09 +00:00
Jeff Young 73f94175de Formatting. 2024-03-11 17:46:09 +00:00
Mojca Miklavec 01cb1543bb Change the platform detection order
Make sure that windows-specific getWindowsKiCadRoot() is only called on Windows
2024-03-11 15:43:33 +00:00
Mark Roszko d904535a15 Add missing text var override to cli gerbers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17283
2024-03-11 12:33:52 +00:00
Jeff Young 9281561938 Fix include paths and merge conflicts. 2024-03-11 12:11:00 +00:00
Michal Grzegorzek 25abba7432 Add XSPICE node/port modifiers: %d [ ~ ] etc. 2024-03-11 12:03:37 +00:00
jean-pierre charras 64812d3fe6 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 10:17:11 +01:00
Jeff Young fbc433deaa Make sure to initialize cell start location.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17379
2024-03-10 21:49:54 +00:00
Jeff Young c8d897ed0f Fix copy/pasta in GetLayerColors().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17374
2024-03-10 21:10:18 +00:00
Jeff Young 9602151d6c Fix typo in SelectRows().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17378
2024-03-10 21:06:43 +00:00
James J bf7896a0e1 Add option to preserve custom power flag values in Update Symbols from Library dialog 2024-03-10 18:32:00 +00:00
Jeff Young 1152b0462c Grid properties for GerbView.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17372
2024-03-10 18:21:50 +00:00
ecorm 4dcd1fb8e2 Fix formatting from simulator X/Y zoom changes 2024-03-10 12:43:18 +00:00
ecorm 16de0a666c Horizontal/vertical zoom for Simulator plots
ADDED: Horizontal/vertical zoom for simulator plots, via mouse wheel,
toolbar buttons, menu commands, and hotkeys.

ADDED: Simulator preferences panel, populated with mouse wheel
and trackpad settings that control pan and zoom of simulator plots.

ADDED: Zoom In/Out Horizontally/Vertically commands that can be bound
to hotkeys.

CHANGED: Simulator plot scroll wheel gestures are no longer hard-coded
and can now be configured via the new Simulator preferences panel.

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

Other unreported bugs that were fixed:

- Fixed wierd, jumpy simulator plot view limiting behavior.

- Fixed Zoom In Center and Zoom Out Center commands not preserving
  the simulator plot center point.

- Fixed simulator plot nudging when exported as PNGs.

- Fixed rectangular selection zoom being able to exceed simulator plot
  view limits.

Notes:

- Provided new SIM_PREFERENCES struct to be used for future
  simulator preferences set via the simulator preferences dialog.

- Bundled pre-existing EESCHEMA_SETTINGS::SIMULATOR settings into
  EESCHEMA_SETTINGS::SIMULATOR::VIEW.

- Replaced mpWindow::EnableMouseWheelPan with more general
  SetMouseWheelActions.

- Refactored and tidied up wxMathPlot's mpWindow code involved with
  fitting, zooming, and panning.

- Consolidated long lists of duplicated member variable initializers to
  a new mpWindow private delegated constructor.

- Provided provisional Zoom In/Out Horizontally/Vertically toolbar
  icons that need improvement by a graphics designer.

- Provided gitignore entries for the Qt Creator IDE
2024-03-10 12:43:18 +00:00
Jeff Young 1bf24da385 Schematic editor Table Properties and commenting for QuasiModal usage. 2024-03-10 12:18:50 +00:00
Jeff Young a12d79cd13 Performance improvements for multi-page dialogs. 2024-03-10 12:18:50 +00:00
jean-pierre charras 821063e5b1 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:04:39 +01:00
Jeff Young f341ab9b00 Bug fixes for flipping tables.
Also adds support for tabbing between table cells in the
table editor dialog.

Also adds support for calling the table editor dialog from
edit properties on a table selection.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17337
2024-03-09 22:18:19 +00:00
Jeff Young 63b06095e6 Table selections for PCBNew. 2024-03-09 22:18:19 +00:00
jean-pierre charras 36b9ef0dc9 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:13:24 +01:00
Yon Uriarte e824e5a267 Compiler warning: C4555 result of expression not used 2024-03-09 17:11:38 +00:00
Jeff Young 72ba31ba27 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
2024-03-09 15:01:59 +00:00
Marek Roszko cb01bca1f4 Add PADS netlist format export 2024-03-09 10:00:46 -05:00
Wayne Stambaugh c5a02fc266 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.
2024-03-09 08:50:26 -05:00
jean-pierre charras b8b52f35f8 French translation update 2024-03-09 10:39:00 +01:00
Alex Shvartzkop 4d66a8ebdb Fix rendering/plotting of arcs with tiny angle and huge radius.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17343
2024-03-09 02:07:24 +03:00
Jeff Young d1d9636598 Run Edge.Cuts & Margin clearance tests on zone layer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17292
2024-03-08 20:51:05 +00:00
Seth Hillbrand 686a62cbe6 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
2024-03-08 10:31:59 -08:00
Alex Shvartzkop aa68a3817a Fix zone cross-probing from DRC dialog. 2024-03-08 21:23:14 +03:00
jean-pierre charras 7944803f8c 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-08 17:03:11 +01:00
Alex Shvartzkop f6f0b9a661 ADDED: PCB 3D image raytracing rendering from CLI.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/3691
2024-03-08 14:38:18 +00:00
Seth Hillbrand 7721bdc441 Update Translations 2024-03-08 00:00:25 +01:00
Pedro Moreira f941cc50fb Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.9% (9257 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2024-03-07 23:56:04 +01:00
pominglee e840384da1 Translated using Weblate (Chinese (Traditional))
Currently translated at 91.9% (8514 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-03-07 23:56:04 +01:00
Pedro Moreira 200b6d9b66 Translated using Weblate (Korean)
Currently translated at 100.0% (9258 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-03-07 23:56:04 +01:00
김랑기 8655d00da5 Translated using Weblate (Korean)
Currently translated at 100.0% (9258 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-03-07 23:56:04 +01:00
pominglee ade8d909a1 Translated using Weblate (Chinese (Traditional))
Currently translated at 91.8% (8502 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-03-07 23:56:04 +01:00
CloverGit 537d155216 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.5% (9218 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-03-07 23:56:04 +01:00
김랑기 bb640001bc Translated using Weblate (Korean)
Currently translated at 100.0% (9258 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-03-07 23:56:04 +01:00
Tokita, Hiroshi 394ffb350c Translated using Weblate (Japanese)
Currently translated at 97.9% (9067 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2024-03-07 23:56:04 +01:00
109247019824 626f88f595 Translated using Weblate (Bulgarian)
Currently translated at 7.5% (700 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/bg/
2024-03-07 23:56:04 +01:00
Pedro Moreira 710a636a97 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.9% (9256 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2024-03-07 23:56:03 +01:00
Wellington Terumi Uemura 46ef628b11 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.9% (9256 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2024-03-07 23:56:03 +01:00
YÜKSEL AÇIKGÖZ 391d7d06f1 Translated using Weblate (Turkish)
Currently translated at 57.0% (5282 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2024-03-07 23:56:03 +01:00
pominglee ca2ec19531 Translated using Weblate (Chinese (Traditional))
Currently translated at 91.8% (8500 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-03-07 23:56:03 +01:00
Laurens Holst 9aea3f6db8 Translated using Weblate (Dutch)
Currently translated at 100.0% (9258 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-03-07 23:56:03 +01:00
Wellington Terumi Uemura 67ab165a51 Translated using Weblate (Portuguese (Brazil))
Currently translated at 98.2% (9096 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2024-03-07 23:56:03 +01:00
YÜKSEL AÇIKGÖZ bc083122f5 Translated using Weblate (Turkish)
Currently translated at 55.7% (5161 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2024-03-07 23:56:03 +01:00
Laurens Holst 48fad4403f Translated using Weblate (Dutch)
Currently translated at 99.2% (9192 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-03-07 23:56:03 +01:00
Ranforingus 4720d90b72 Translated using Weblate (Dutch)
Currently translated at 99.2% (9192 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-03-07 23:56:03 +01:00
Wellington Terumi Uemura 8ea1f53133 Translated using Weblate (Portuguese (Brazil))
Currently translated at 98.2% (9092 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2024-03-07 23:56:03 +01:00
Nguyễn Ngọc Khánh e34d430e65 Translated using Weblate (Vietnamese)
Currently translated at 20.6% (1911 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/vi/
2024-03-07 23:56:03 +01:00
YÜKSEL AÇIKGÖZ f478710be8 Translated using Weblate (Turkish)
Currently translated at 55.6% (5156 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2024-03-07 23:56:03 +01:00
Ranforingus e20988bafd Translated using Weblate (Dutch)
Currently translated at 99.2% (9187 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-03-07 23:56:03 +01:00
Laurens Holst 04559d7dd3 Translated using Weblate (Dutch)
Currently translated at 99.2% (9187 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-03-07 23:56:03 +01:00
CloverGit b7259ffd19 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.5% (9218 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-03-07 23:56:03 +01:00
ZbeeGin d28d3198b6 Translated using Weblate (Polish)
Currently translated at 100.0% (9258 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2024-03-07 23:56:03 +01:00
Ranforingus 1d5ed415ce Translated using Weblate (Dutch)
Currently translated at 98.4% (9115 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-03-07 23:56:03 +01:00
김랑기 793411aaeb Translated using Weblate (Korean)
Currently translated at 100.0% (9258 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-03-07 23:56:03 +01:00
aris-kimi d7f4607cc1 Translated using Weblate (Greek)
Currently translated at 99.2% (9188 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/el/
2024-03-07 23:56:03 +01:00
Jan Straka 814a03de56 Translated using Weblate (Czech)
Currently translated at 78.4% (7261 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2024-03-07 23:56:02 +01:00
pedrolinharesmoreira bdccb5e6b6 Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.8% (9059 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2024-03-07 23:56:02 +01:00
CloverGit f5d27906f3 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.5% (9218 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-03-07 23:56:02 +01:00
Andrej Valek 689669313a Translated using Weblate (Slovak)
Currently translated at 63.5% (5882 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-03-07 23:56:02 +01:00
aris-kimi 5c6c0aa313 Translated using Weblate (Greek)
Currently translated at 98.5% (9122 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/el/
2024-03-07 23:56:02 +01:00
CloverGit ea9d10b8bc Translated using Weblate (Chinese (Simplified))
Currently translated at 99.4% (9208 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-03-07 23:56:02 +01:00
Andrej Valek 72f7d4ad99 Translated using Weblate (Slovak)
Currently translated at 62.5% (5795 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-03-07 23:56:02 +01:00
ZbeeGin a8b5edf46c Translated using Weblate (Polish)
Currently translated at 99.7% (9239 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2024-03-07 23:56:02 +01:00
김랑기 2d59989871 Translated using Weblate (Korean)
Currently translated at 99.9% (9256 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-03-07 23:56:02 +01:00
Pferd O 429d4b9706 Translated using Weblate (German)
Currently translated at 100.0% (9258 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2024-03-07 23:56:02 +01:00
김랑기 e446fceb4d Translated using Weblate (Korean)
Currently translated at 97.5% (9028 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-03-07 23:56:02 +01:00
Henrik Kauhanen d9cf4f822d Translated using Weblate (Swedish)
Currently translated at 99.9% (9249 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2024-03-07 23:56:02 +01:00
Andrej Valek 04adc637e8 Translated using Weblate (Slovak)
Currently translated at 56.0% (5191 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-03-07 23:56:02 +01:00
김랑기 e130cd651d Translated using Weblate (Korean)
Currently translated at 96.7% (8959 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-03-07 23:56:02 +01:00
Henrik Kauhanen d0d74597c7 Translated using Weblate (Finnish)
Currently translated at 98.8% (9151 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fi/
2024-03-07 23:56:02 +01:00
Andrej Valek 31b7c22a94 Translated using Weblate (Czech)
Currently translated at 78.1% (7234 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2024-03-07 23:56:02 +01:00
Henrik Kauhanen f252078b4e Translated using Weblate (Swedish)
Currently translated at 98.9% (9163 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2024-03-07 23:56:02 +01:00
Andrej Valek d588947064 Translated using Weblate (Slovak)
Currently translated at 54.4% (5037 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-03-07 23:56:01 +01:00
dsa-t 9a1ecfb606 Translated using Weblate (Russian)
Currently translated at 98.2% (9098 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2024-03-07 23:56:01 +01:00
ZbeeGin 92cfce4045 Translated using Weblate (Polish)
Currently translated at 98.4% (9111 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2024-03-07 23:56:01 +01:00
김랑기 7efc9cbd1e Translated using Weblate (Korean)
Currently translated at 95.2% (8817 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-03-07 23:56:01 +01:00
Toni Laiho 5e50976bd4 Translated using Weblate (Finnish)
Currently translated at 98.8% (9151 of 9258 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fi/
2024-03-07 23:56:01 +01:00
Jeff Young 06a8517818 Further improvements to cache locking.
In particular, don't hold cache lock while doing computations.
2024-03-07 13:20:20 +00:00
Armin Schoisswohl 4dcec60bf4 add include <mutex> to fix compilation under linux 2024-03-07 13:20:16 +00:00
Armin Schoisswohl bb9448edcb change m_CachesMutex to shared_mutex and do shared locking for read access in zone BBox calculations 2024-03-07 13:20:13 +00:00
Armin Schoisswohl 991ff71f33 fix deadlock in DRC "Checking keeopouts & disallow constraints" 2024-03-07 13:20:10 +00:00
Armin Schoisswohl 4590455ab2 protect cache lookups in pcbnew/zone by locking the mutex before calling find, fix #17237 2024-03-07 13:20:06 +00:00
Yon Uriarte 7520a8b316 Avoid updating max clearance while in dtor
Max clearance is updated by IncrementTimeStamp(), which is called when in the FOOTPRINT dtor and ZONE dtor.  This can cause issues when iterating over all footprints as the footprints may be delete-ed

Fixes https://gitlab.com/kicad/code/kicad/issues/17269
2024-03-06 18:48:49 +00:00
SubaruArai 8b3fc41ee5 Update QR footprint wizard
- Allows more than 62 bytes
- Adjusts size of code based on data or parameters
- Allows selection of ECC
2024-03-06 18:39:40 +00:00
Jeff Young 20efeef5ae Apply anti-walk algorithm only to textboxes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16481
2024-03-06 13:51:27 +00:00
jean-pierre charras 9de9f921bc PROPERTIES_FRAME: fixes a focus issue (perhaps Windows specific). 2024-03-06 13:06:22 +01:00
jean-pierre charras 5ac8449e1f Minor compil and Coverity fixes 2024-03-06 13:05:21 +01:00
Jon Evans 9b54537e38 Add environment variable for configuring stock data home
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15687
2024-03-05 23:18:06 -05:00
Jon Evans 4ffbef5e42 Fix mismatched new[] vs free() in Altium parser 2024-03-05 23:09:38 -05:00
Jon Evans 4bc69183ab Set description on Altium imported symbols
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16943
2024-03-05 23:08:11 -05:00
Jon Evans 1600d8bead Prevent use-after-free of symbol screens
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17204
2024-03-05 22:53:51 -05:00
Jon Evans 0c2a084a47 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
2024-03-05 18:54:04 -05:00
Jon Evans c1ba07e6bc SelectAll should use the filter
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17157
2024-03-05 18:27:51 -05:00
Yon Uriarte 4e8e14ae3a 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
2024-03-05 14:32:12 +00:00
Yon Uriarte 77576e1a80 Responsive: OPENGL_GAL::DrawArc reserve linequads to reduce drawing time 2024-03-05 14:15:33 +00:00
Jeff Young da634a618f 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
2024-03-05 13:43:41 +00:00
Jon Evans 1988aac2b3 Update a few more list/tree views for macOS 2024-03-05 08:38:46 -05:00
Jon Evans 34a6e605de 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
2024-03-04 22:15:23 -05:00
Marek Roszko 7933dee274 Fix update notification to use majorminorpatch 2024-03-04 20:13:15 -05:00
Ethan Chien 8cda72f8d5 Fix defects reported by Coverity scan introduced in !1765
Corrects lifetime performance issue where extra copies of SCH_SHEET_PATH objects were being passed on the stack.
2024-03-04 19:45:05 +00:00
Yon Uriarte 62c961b8ba Performance Mitigate "Edit all symbol fields" dialog slow closing.
GetSymbols will return all symbols. Call it once and cache it.
2024-03-04 19:41:01 +00:00
Alex Shvartzkop a4da829ccc Fabmaster (CADENCE ASCII): import dimensions graphics.
See https://gitlab.com/kicad/code/kicad/-/issues/17239
2024-03-04 19:51:28 +03:00
Alex Shvartzkop cb4ace5561 Fabmaster (CADENCE ASCII) import: fix position and orientation of footprint graphics.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17239
2024-03-04 19:51:27 +03:00
Mike Williams 36331e259a VRML: add options to exclude DNP/unspecified types like STEP exporter 2024-03-04 10:10:34 -05:00
Jeff Young ff8ddae9bd 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
2024-03-04 14:25:29 +00:00
Alex Shvartzkop 30573beb48 EasyEDA Std: fix importing footprints from footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17264
2024-03-04 16:34:51 +03:00
Alex Shvartzkop c056ef407a EasyEDA Std: support multiple schematic sheets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17219
2024-03-04 15:09:31 +03:00
Alex Shvartzkop cc181df916 EasyEDA Std: support Dot and Clock symbol pin styles. 2024-03-04 15:09:31 +03:00
Alex Shvartzkop 69b15e83c5 EasyEDA Std: hide invisible text in symbols. 2024-03-04 15:09:31 +03:00
Alex Shvartzkop 563278d0f6 EasyEDA Pro schematic: place items on root sheet when it's the only sheet. 2024-03-04 15:09:31 +03:00
Alex Shvartzkop 951c550c1e EasyEDA Std PCB: fix crash when Name/Prefix type text is not in a footprint. 2024-03-04 15:09:31 +03:00
Alex Shvartzkop f9ad0a434d Fix assert in BOARD_ADAPTER::createLayers. 2024-03-04 15:09:31 +03:00
Alex Shvartzkop fb089a182b 3D viewer: support transparent background in Raytracing mode. 2024-03-04 15:09:31 +03:00
jean-pierre charras 4a945172db 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 #16282
https://gitlab.com/kicad/code/kicad/-/issues/16282
2024-03-04 11:46:45 +01:00
Seth Hillbrand 02cdb0c6b9 Mask aperture pads can have multiple layers
But as long as they don't have copper, we should treat them as mask
apertures
2024-03-03 20:56:39 +00:00
Alex Shvartzkop fa6dc95553 Define __cplusplus according to C++ standard version on MSVC.
Otherwise, macros like KI_FALLTHROUGH are not defined properly.
2024-03-03 23:28:55 +03:00
Marek Roszko 16953edf6d Move APPEARANCE_CONTROLS_3D to the lang change event 2024-03-03 14:16:48 -05:00
Alex Shvartzkop 85b1978408 Use 64-bit type to represent microseconds.
int and long are 32-bit on Windows, causing overflows.
2024-03-03 21:40:26 +03:00
Alex Shvartzkop 337489c77d Do not reload window sizes when changing 3D viewer settings. 2024-03-03 21:21:51 +03:00
Alex Shvartzkop 1126227206 Add add_choices accepting std::vector to argparse for convenience. 2024-03-03 21:21:45 +03:00
Alex Shvartzkop 991b4299d6 Update argparse.
Otherwise .choices doesn't work properly.
See https://github.com/p-ranav/argparse/issues/307
2024-03-03 21:21:41 +03:00
Alex Shvartzkop 219d0c399d 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
2024-03-03 21:20:47 +03:00
Wayne Stambaugh 3eb5c52073 Improve zone manager dialog layout. 2024-03-03 12:09:01 -05:00
Jan Wichmann 5cdf9fe8a0 Don't show hidden directories and files in the project tree browser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16207
2024-03-03 16:43:43 +00:00
Tomasz Wlostowski 9e0cd7e6ee qa/tools: add PCB_TEST_SELECTION_TOOL to CmakeLists 2024-03-03 17:42:21 +01:00
Tomasz Wlostowski 2280c696d0 wip on resizeable view & adding tabs to pns_debug_tool 2024-03-03 17:42:21 +01:00
Lucas Dumont 13c647ef6f Fix resources leak reported by coverity
For unique_ptr, release only set the ownership to null, but don't free the resource behind. On the other hand, reset do. 

Closes Coverity ID 483269
Closes Coverity ID 471974
Closes Coverity ID 471973
2024-03-03 16:23:49 +00:00
Petri Hodju c76c4ba304 schematic: do not skip item repaint if item's parent type != SCHEMATIC_T
the item repaint was skipped when unhighlightning symbols after dragging
and unselecting.

Fixes https://gitlab.com/kicad/code/kicad/issues/17193
Fixes https://gitlab.com/kicad/code/kicad/issues/17206
2024-03-03 16:21:29 +00:00
Roberto Fernandez Bautista 4851b0f1ac Database library cache: fix memory leak 2024-03-03 16:20:32 +00:00
JamesJ 66b378087a Remove close button from pcbnew search panel
For consistency with the other panels, removes the circular 'x' close
button from the search panel. Toggling visibility remains possible
through the View menu
2024-03-03 16:18:23 +00:00
Marek Roszko 0c8e08ed58 Move some language changes to a event on the frame 2024-03-03 11:02:26 -05:00
jean-pierre charras 0bde79bd6c 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:00:17 +01:00
Wayne Stambaugh 66925ec2a2 Update net navigator when cross probing from board editor net highlight.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16838
2024-03-03 08:56:48 -05:00
Yon Uriarte fe1c73ed7c Performance: Cache BOARD::GetMaxClearanceValue 2024-03-03 13:54:46 +00:00
jean-pierre charras f6cf78fd7c 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:56:41 +01:00
Jon Evans 612c7015a7 REMOVED: Clicking on pin selects symbol setting
This is now redundant with the selection filter

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17114
2024-03-02 22:18:51 -05:00
Jon Evans c51e9917ba Fix ordering of selection filter and net navigator 2024-03-02 20:21:16 -05:00
Marek Roszko 585cf841e5 Create a singular point for events like EDA_EVT_UNITS_CHANGED to be exported out of kicommon 2024-03-02 16:29:08 -05:00
Jon Evans ed18a9bcc2 Correctly handle footprint graphic knockouts for no-net case
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17223
2024-03-02 15:39:07 -05:00
Jon Evans 3a3ceb8ffc Allow specifying a minimum for a via_count constraint
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17234
2024-03-02 15:26:28 -05:00
Jon Evans b8f4bef3f8 Set schematic as default screenshot 2024-03-02 15:06:46 -05:00
Jon Evans fdc16fe60d 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.
2024-03-02 15:05:38 -05:00
Marek Roszko 46f9a9a005 Make the update check cmake option default for all platforms 2024-03-02 14:15:52 -05:00
Jeff Young 9c371e2ef5 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:57:39 +00:00
Roberto Fernandez Bautista a4929f9c27 Step exporter: handle circles correctly
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17137
2024-03-02 19:09:33 +01:00
Roberto Fernandez Bautista d458bcad16 kicad_cli fp ugrade: create directory with extension 2024-03-02 18:21:13 +01:00
jean-pierre charras d81605f4ea DIALOG_PAD_PROPERTIES: fix a incorrect test to show a warning. 2024-03-02 17:16:27 +01:00
Jeff Young 1082930c34 Don't steal command-keys from a wxGrid.
It's unlikely to win you friends.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17229
2024-03-02 15:28:22 +00:00
jean-pierre charras 428f2087bd 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)
Fixes #17232
https://gitlab.com/kicad/code/kicad/-/issues/17232
2024-03-02 15:23:23 +01:00
Jeff Young c97c69a2f0 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:17:22 +00:00
Roberto Fernandez Bautista 43e1b36d4d 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 12:09:09 +00:00
Roberto Fernandez Bautista 0d340d0610 SHAPE_LINE_CHAIN: Move .h definitions to .cpp
No functional changes, just allow faster rebuilds
2024-03-02 12:09:09 +00:00
Roberto Fernandez Bautista 8c22f8df31 SHAPE_LINE_CHAIN: Fix/unify constructors 2024-03-02 12:09:09 +00:00
Roberto Fernandez Bautista 5920ee4598 SHAPE_LINE_CHAIN: Add test case of seg+large angle arc 2024-03-02 12:09:09 +00:00
Roberto Fernandez Bautista 4508512343 Sanitise filename before saving footprint library 2024-03-02 13:06:23 +01:00
Roberto Fernandez Bautista a4a99e3aff kicad_cli: Allow upgrade of legacy and non-kicad footprint libraries 2024-03-02 13:06:23 +01:00
Roberto Fernandez Bautista 70fe2a8f1e kicad_cli: Allow upgrade of legacy and non-kicad symbol libraries 2024-03-02 13:06:23 +01:00
Jeff Young bd1d449cd3 Check for NETINFO_ITEM before dereferencing it.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17230
2024-03-02 11:37:22 +00:00
jean-pierre charras 1ee49cca5e 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 11:24:54 +01:00
Jan Wichmann 1297ddc88d pcbnew: Added default master pad properties
CHANGED: Automatically selects the right pad type for the footprint type. Resets the pad properties if the master pad properties do not match the pad type.

https://gitlab.com/kicad/code/kicad/-/issues/16563
2024-03-02 00:13:39 +00:00
Yon Uriarte 464f185387 Performance
Cache VIEW_ITEM's bbox in VIEW_TREE for faster removals.

Fixes https://gitlab.com/kicad/code/kicad/issues/16841
2024-03-02 00:03:46 +00:00
Seth Hillbrand 0129191ec0 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
2024-03-01 15:57:24 -08:00
Jeff Young 8dddd9cc2c Separate "use board stackup colors" into separate checkbox.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17085
2024-03-01 23:45:06 +00:00
Seth Hillbrand 14667e2033 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
2024-03-01 15:21:42 -08:00
Seth Hillbrand e7d4127f99 Update contributors 2024-03-01 13:45:46 -08:00
Seth Hillbrand d3334ed9f0 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
2024-03-01 13:04:19 -08:00
jean-pierre charras 005affd473 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 19:56:22 +01:00
Seth Hillbrand 0d03f2febc When failing to import, ensure extant screen
We need at least the root screen in order to handle any action in
Eeschema.  Because this is destroyed by starting to load the new
schematic, when failing, we need to reset to null.

This is not as good as resetting to the previous state but that will
take refactoring our file load routines in schematic editor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16993
2024-03-01 18:48:14 +00:00
Ethan Chien 8d19d27483 Fix zone manager crash when no board is loaded
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17187
2024-03-01 15:58:01 +00:00
Mike Williams a902898522 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-01 10:40:03 -05:00
Alex Shvartzkop defcb49ac8 Support Altium Schematic ASCII import 2024-02-29 20:49:20 +00:00
Alex Shvartzkop 656821b282 Improve 3D appearance manager preset compare. 2024-02-29 22:04:57 +03:00
arturo182 41147dc3b3 kicad_advanced: Make OCE tesselation deflection configurable
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17168
2024-02-29 19:04:39 +00:00
aris-kimi 24529e5242 ADDED: library tree context menu option to open sym/fp library files from the defined text editor.
Short description:

Works for Symbol and Footprint Editor behind an advanced config option.
For Symbol Editor it is shown for a single item selection (library or symbol).
For Footprint Editor it is shown for a footprint selection.
(fp editor allows a single tree item selection only).
Option stays hidden if current frame has been modified.

Also small fix(?) for similar action to the project manager.
(Call for the Execution has moved inside the file loop.)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15736
2024-02-29 19:01:59 +00:00
Johannes Maibaum 15e963bb32 Don't leak blank_cursor on warp (X11)
Also, for completeness, unref cur_cursor which we ref'd before hiding
it.
2024-02-29 18:55:28 +00:00
Jeff Young 48130c6982 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:57:38 +00:00
Jeff Young c23550dc0b Unflip when going to viewport which isn't flipped.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13773
2024-02-29 17:37:48 +00:00
jean-pierre charras 8ffd4f636a SHAPE_ARC::update_bbox(): use double instead of int to calculate radius, and
if the radius is too large (> INT_MAX/2), consider arc as a segment to avoid overflows.
Nor perfect, but it avoid some issues when calculating bbox.
2024-02-29 18:01:13 +01:00
Alex Shvartzkop cd27f801f6 Allow .kicad_sym in Import Symbol filters. 2024-02-29 17:36:32 +03:00
Alex Shvartzkop 80457d5871 Support transparent background in 3D viewer PNG/clipboard export.
Only really works with realtime renderer currently.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12060
2024-02-29 17:11:53 +03:00
Marek Roszko 4602a27eb8 Revert "Update vcpkg baseline to newer"
This reverts commit d23a740ce3.
2024-02-28 21:58:15 -05:00
Alex Shvartzkop e71cbea7f8 Use a version string without the extra packaging info in drawing sheets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17176


(cherry picked from commit c59fac4089)
2024-02-29 01:24:39 +00:00
Alex Shvartzkop 39a0a81832 EasyEDA Std import: support multiline text on PCB.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17171


(cherry picked from commit 0dab086f0c)
2024-02-29 00:54:46 +00:00
JamesJ 5f4c7a52e4 Add netclass color management / import functionality to PCB setup dialog
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16908

ADDED Netclass color column in board setup dialog
ADDED Import netlist colors from schematic button in board setup dialog
2024-02-28 23:13:21 +00:00
JamesJ b8748c4ef8 Add import netclass color menu items to PCB appearance widget
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16908

ADDED: Context menu item in PCB appearances widget to import netclass
color from schematic.
ADDED: Context menu item to reset PCB netclass color (replicating
same menu item from Nets inspector)
2024-02-28 23:13:15 +00:00
Jeff Young 141de7ac11 Even up spacing in dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16391
2024-02-28 22:18:27 +00:00
Jeff Young 20ea299742 Cleanup. 2024-02-28 22:18:26 +00:00
Seth Hillbrand 6a8d2a7eb3 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

(cherry picked from commit 7d1adff071)
2024-02-28 13:27:38 -08:00
Seth Hillbrand b8cd337826 Update translations 2024-02-28 09:55:29 -08:00
Andrej Valek 853cd260a5 Translated using Weblate (Slovak)
Currently translated at 55.3% (5077 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-02-28 18:54:11 +01:00
Andrej Valek 578b250e92 Translated using Weblate (Slovak)
Currently translated at 55.1% (5059 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-02-28 18:54:11 +01:00
Andrej Valek c72721cc4a Translated using Weblate (Czech)
Currently translated at 79.8% (7326 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2024-02-28 18:54:11 +01:00
Mahsum Aslan a4a07d362b Translated using Weblate (Turkish)
Currently translated at 51.2% (4705 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2024-02-28 18:54:11 +01:00
Andrej Valek 0cf34ab07b Translated using Weblate (Slovak)
Currently translated at 53.6% (4920 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sk/
2024-02-28 18:54:10 +01:00
Ivan Chuba a12a4d8351 Translated using Weblate (Ukrainian)
Currently translated at 88.1% (8088 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/uk/
2024-02-28 18:54:10 +01:00
CloverGit 24711972cb Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (9143 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-02-28 18:54:10 +01:00
김랑기 2344fd11c5 Translated using Weblate (Korean)
Currently translated at 96.3% (8839 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-02-28 18:54:10 +01:00
CloverGit 21bb5f0b97 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (9142 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-02-28 18:54:10 +01:00
Jan Straka ed33806409 Translated using Weblate (Czech)
Currently translated at 79.8% (7325 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2024-02-28 18:54:10 +01:00
Ulices 5ae84f19a6 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9176 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es_MX/
2024-02-28 18:54:10 +01:00
Laurens Holst 910bbb6205 Translated using Weblate (Dutch)
Currently translated at 100.0% (9176 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-02-28 18:54:10 +01:00
Hanna Breisand 737679b8c1 Translated using Weblate (Swedish)
Currently translated at 100.0% (9176 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2024-02-28 18:54:10 +01:00
Laurens Holst 585cbd2742 Translated using Weblate (Dutch)
Currently translated at 100.0% (9176 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-02-28 18:54:10 +01:00
CloverGit ae68d3bd72 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (9142 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2024-02-28 18:54:10 +01:00
김랑기 06ab280087 Translated using Weblate (Korean)
Currently translated at 96.3% (8839 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-02-28 18:54:10 +01:00
HADJAISSA c575ab68e9 Translated using Weblate (Arabic)
Currently translated at 1.2% (114 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ar/
2024-02-28 18:54:10 +01:00
HADJAISSA 5ff3c78ae2 Translated using Weblate (Arabic)
Currently translated at 1.2% (113 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ar/
2024-02-28 18:54:10 +01:00
pominglee 7ad877716d Translated using Weblate (Chinese (Traditional))
Currently translated at 93.8% (8611 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-02-28 18:54:10 +01:00
HADJAISSA cfaffc681f Translated using Weblate (Arabic)
Currently translated at 1.1% (105 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ar/
2024-02-28 18:54:10 +01:00
Stefan De Raedemaeker e37f0559a1 Translated using Weblate (Dutch)
Currently translated at 100.0% (9176 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2024-02-28 18:54:10 +01:00
pominglee 8245562181 Translated using Weblate (Chinese (Traditional))
Currently translated at 93.8% (8611 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2024-02-28 18:54:10 +01:00
김랑기 01e218a9ca Translated using Weblate (Korean)
Currently translated at 96.3% (8839 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2024-02-28 18:54:10 +01:00
Henrik Kauhanen d41bf6c540 Translated using Weblate (Finnish)
Currently translated at 99.7% (9152 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fi/
2024-02-28 18:54:10 +01:00
gallegonovato 9d9eb82dd9 Translated using Weblate (Spanish)
Currently translated at 99.7% (9149 of 9176 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2024-02-28 18:54:09 +01:00
Jeff Young d08e0e9eaa _() -> _HKI() for group names. 2024-02-28 17:50:51 +00:00
Jeff Young 27031dd2c5 Check env vars when testing for unresolved variables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17174
2024-02-28 17:16:58 +00:00
Wayne Stambaugh 141d03c266 Fix sheet pin align to grid issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16920
2024-02-28 11:57:49 -05:00
jean-pierre charras f086038684 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-28 17:31:10 +01:00
Alex Shvartzkop 0314540fdb Keep schematic text upright (especially when opening v6 schematic).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17082


(cherry picked from commit bec068324e)
2024-02-28 15:25:39 +00:00
Wayne Stambaugh 9a9d6f2afb Sheet synchronization dialog layout improvements. 2024-02-28 08:08:03 -05:00
jean-pierre charras fe349be48b 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:21:17 +01:00
Alex Shvartzkop 97e3139505 Cairo GAL: fix endianness check.
(cherry picked from commit c4a7af8a47)
2024-02-28 01:11:27 +00:00
Alex Shvartzkop 3582edb185 Cairo GAL: reduce buffer allocation sizes.
cairo_format_stride_for_width() result is in bytes.
Also removes unneeded extra width.


(cherry picked from commit d359fb8ab9)
2024-02-28 00:53:56 +00:00
Alex Shvartzkop 4fed2e849f Cairo GAL: improve empty canvas performance (-80% CPU)
(cherry picked from commit 5618a6925d)
2024-02-28 00:53:51 +00:00
Jon Evans 9e7b4b7f89 Avoid nullptr dereference when loading group info
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17154
2024-02-27 19:43:21 -05:00
Jon Evans 299b548a41 Trivial change to avoid crash on tool re-entry
See https://gitlab.com/kicad/code/kicad/-/issues/17164
2024-02-27 19:31:09 -05:00
Jon Evans c3af434741 Force lib tree row height on GTK
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16403
2024-02-27 19:24:53 -05:00
Jon Evans 31fab831ad Remove unnecessary assert
GetModifyHash can be called before a row is loaded
2024-02-27 19:03:06 -05:00
Jon Evans 0df5cf7f75 Expose grid origin action in more places
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17007
2024-02-27 18:50:44 -05:00
Seth Hillbrand a8880fb63e Fix memory leak in net inspector dialog 2024-02-27 19:49:13 +00:00
Seth Hillbrand b2a25cb59e 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
2024-02-27 19:49:13 +00:00
Jeff Young f754410c7e Add wxGrids to list of things that get arrow keys.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17144
2024-02-27 18:11:16 +00:00
Jeff Young 2dce618f9f Expose text size for SCH_FIELDs. 2024-02-27 17:48:09 +00:00
Jeff Young a5fda819eb Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16991
2024-02-27 17:16:14 +00:00
Jeff Young e6a2f3b87a Eagle text anchor points and alignment aren't linked.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17135
2024-02-27 15:00:30 +00:00
Jeff Young 6e478f52f4 Fix wrong rotation centre.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17135
2024-02-27 15:00:27 +00:00
Marek Roszko 77a87101ef Bump vcpkg baseline 2024-02-27 07:48:21 -05:00
Marek Roszko d23a740ce3 Update vcpkg baseline to newer 2024-02-27 07:48:20 -05:00
jean-pierre charras ed4a4ec8ec 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-27 10:17:00 +01:00
Jon Evans e9456201a7 Don't rely on dynamic_cast across DLLs
See https://gitlab.com/kicad/code/kicad/-/issues/16998
2024-02-26 22:10:28 -05:00
Jeff Young 539bd62a7b Cancel autocomplete when STC loses focus.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17124
2024-02-26 22:29:29 +00:00
Jeff Young 3079f7c742 Fix copy pasta. 2024-02-26 22:29:29 +00:00
Jeff Young d23ee7db3d Improve SNR. 2024-02-26 22:29:29 +00:00
Alex Shvartzkop b3df08c7b1 Initialize git_remote_callbacks structure.
(cherry picked from commit 35192f5bd4)
2024-02-26 21:36:08 +00:00
Alex Shvartzkop 755bfe3492 Initialize git_repository_init_options structure.
(cherry picked from commit d84a5e6f03)
2024-02-26 21:25:30 +00:00
Jeff Young ac0758eca0 Only change pin assignments from user interaction.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16349
2024-02-26 19:02:00 +00:00
Jeff Young d16b5fb810 Handle single-source DC analyses correctly.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17119
2024-02-26 19:02:00 +00:00
Wayne Stambaugh 23169ca1a7 Post merge request clean up. 2024-02-26 07:54:22 -05:00
Jeff Young 43c45f3ee8 Fix copy pasta. 2024-02-26 12:39:01 +00:00
Jon Evans 2f6c9d1f3a ADDED: Selection filter for schematic editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14988
2024-02-25 17:44:10 -05:00
Jeff Young 11774cc9fe Fix some dialog layout issues.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16391
2024-02-25 22:10:51 +00:00
Jeff Young 9066e4b9d0 Reconcile solder_paste_ratio and solder_paste_margin_ratio. 2024-02-25 21:25:44 +00:00
Jeff Young 532645c9b0 Add tables to eeItem test. 2024-02-25 21:08:38 +00:00
Jon Evans 96ea1f6f89 Revert change to prettifier QA data
The file format should not be bumped in these test cases, they are not a test of the file format writer.
2024-02-25 12:50:44 -05:00
Jeff Young aef87b9796 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
2024-02-25 17:28:52 +00:00
Jeff Young 6ec51f6a69 Revert IsAttached() fix as it doesn't handle hotkeys from the main menubar.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17101
2024-02-25 15:46:12 +00:00
Jeff Young be83f276c4 Add a couple more tooltips.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16391
2024-02-25 15:30:47 +00:00
jean-pierre charras 7789dfcfdc fix a compil issue (missing include and nullptr_t -> std::nullptr_t) 2024-02-25 16:26:05 +01:00
jean-pierre charras f7721f385a Symbol editor: add option (view menu+toolbar) to show/hide invisible pins and fields
Fixes #8020
https://gitlab.com/kicad/code/kicad/-/issues/8020
2024-02-25 16:09:50 +01:00
Ethan Chien be81bce637 Add Feature: synchronize hierarchical labels and sheet pins 2024-02-25 14:23:59 +00:00
Jon Evans d939004bbd 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.
2024-02-25 08:47:07 -05:00
Jeff Young 3b560cef50 Fix some test errors. 2024-02-25 13:43:45 +00:00
Jeff Young 99948de45a Support pin count and footprint filters in symbol editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17105
2024-02-25 13:14:31 +00:00
Jeff Young dba2fdb6d3 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
2024-02-25 12:28:19 +00:00
Jeff Young 4056428a08 Sigh. We use different tokens for FP and pad solder paste margin ratios.
Seriously?  Afraid so: solder_paste_margin_ratio and solder_paste_ratio.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17108
2024-02-25 11:31:04 +00:00
Jeff Young 986dbfd235 Don't double-add pads to commit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17087
2024-02-25 11:31:04 +00:00
Alex Shvartzkop 38953bf35f Fix update notice dialog padding.
(cherry picked from commit 1c639714f3)
2024-02-25 10:42:20 +00:00
Jeff Young caa83ec9bd Fix missing unit initialization.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17076
2024-02-24 22:34:41 +00:00
Jeff Young 0078ccea09 Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17086
2024-02-24 20:06:22 +00:00
Jeff Young 6bbac26fd3 Fix merge conflict. 2024-02-24 20:05:51 +00:00
Jeff Young 9a02712c4f Update VDMOS models to ngspice-41 (and later) defaults.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17073
2024-02-24 20:05:51 +00:00
Jeff Young e27f859c11 Apply Pad Properties teardrop terminology to Via Properties.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17050
2024-02-24 20:05:51 +00:00
Jeff Young f77de66f4e Generalize ERCItem inspections.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10539
2024-02-24 20:05:51 +00:00
Jeff Young e7abeb3c38 Cleanup. 2024-02-24 20:05:51 +00:00
Jeff Young fa0ead98d8 Split out table editing and table cell editing. 2024-02-24 20:05:51 +00:00
Jeff Young 3282e4bb66 Formatting. 2024-02-24 20:05:51 +00:00
Jeff Young c3496e4af6 Implement min skew checking. 2024-02-24 20:05:51 +00:00
Jeff Young 782af3a918 Clear text before replacing in ImportSettingsFrom. 2024-02-24 20:05:51 +00:00
Jeff Young e760317af6 ADDED: Implement footprint link checking in ERC.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16842
2024-02-24 20:05:51 +00:00
Jeff Young 6dc60598da Cleanup array dialog. 2024-02-24 20:05:51 +00:00
Jeff Young d7e4a8cebd ADDED: ERC/DRC exclusion comments.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16020
2024-02-24 20:05:51 +00:00
Jeff Young c8d2a9340b ADDED: ExpandAll/CollapseAll for hierarchy pane. 2024-02-24 20:05:51 +00:00
Jeff Young 833ec402a0 Generalize DRCItem inspections.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10539
2024-02-24 20:05:51 +00:00
Jeff Young 6856e59374 ADDED: ExpandAll/CollapseAll for lib trees.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8243
2024-02-24 20:05:51 +00:00
Jeff Young 4eefbc7815 ADDED: textbox and tablecell margins.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10672

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6806
2024-02-24 20:05:51 +00:00
Jeff Young e445249720 ADDED: PCB tables. 2024-02-24 20:05:51 +00:00
Jeff Young 48f983826d Tooltip for "Prefer zone connections".
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16587
2024-02-24 20:05:51 +00:00
Jeff Young 67cd446e6d Add textbox text to description.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16573
2024-02-24 20:05:51 +00:00
Jeff Young ee3be0802c Move PCBNew overrides to nullable properties.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5562
2024-02-24 20:05:51 +00:00
Jeff Young 7c77266f12 Move name ellipisizing from middle to end.
Our names tend to have more boiler-plate stuff at the
end (excluding things like "Position X" and "Position Y",
but they're usually pretty short when compared to
"Solderpaste Margin Ratio Override" or
"Exempt from Courtyard Requirement").
2024-02-24 20:05:50 +00:00
Jeff Young 4c5dbcd7f4 ADDED override locks checkbox for update from schematic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16471
2024-02-24 20:05:50 +00:00
Jeff Young 91df43c97a ADDED: schematic tables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6806
2024-02-24 20:05:50 +00:00
Jeff Young 4a9df1e18e ADDED: actions for left-, center-, and right-justifying text items.
(For both PCBNew and EESchema.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12375
2024-02-24 20:05:50 +00:00
Jon Evans 536e7b252d Use deb_system Python sysconfig scheme on Debian
(cherry picked from commit 99f9941067)
2024-02-24 19:34:28 +00:00
Stefan ed6f900b70 adding No Layers to apprearance manger presets, fix #15625 2024-02-24 15:44:26 +00:00
Alex Shvartzkop 7cb754ddbb Remove 50ms delay seen in some actions, like duplicating schematic items.
(cherry picked from commit 339646a267)
2024-02-24 18:20:16 +03:00
Alex Shvartzkop 6347cb043e Add bottom panel to have correct background in fp/sym chooser frames.
See https://gitlab.com/kicad/code/kicad/-/issues/15810

(cherry picked from commit 97ff48b426)
2024-02-24 18:20:16 +03:00
Alex Shvartzkop 5578b2c954 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

(cherry picked from commit badc4e7411)
2024-02-24 18:20:16 +03:00
Ethan Chien d72491a4a5 ADDED: zone manager
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9636
2024-02-24 15:10:50 +00:00
Yon Uriarte b7b64d959f 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.
2024-02-23 19:21:44 +00:00
Yon Uriarte f3c2083018 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.
2024-02-23 19:21:44 +00:00
Alex Shvartzkop 5900f6baa4 Do not call MakeShapes in AddCopperPolygonShapes when polyset is empty.
Ease of debugging.

(cherry picked from commit 0184dfb625)
2024-02-23 22:15:17 +03:00
Andrej Krpic 006f93773c Fix collecting of signals for S-Parameters analysis 2024-02-23 18:34:21 +00:00
Alex Shvartzkop d04d74c511 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.

(cherry picked from commit 711c6141a8)
2024-02-23 20:29:18 +03:00
Alex Shvartzkop 8f428c04b0 Fix floating point rounding issues with scaled parameteres in settings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17070

(cherry picked from commit fdf38256e8)
2024-02-23 20:29:18 +03:00
Alex Shvartzkop 3edfcb039c Fix net selector filter field focus on GTK.
(cherry picked from commit 7eeb1a19cf)
2024-02-23 20:29:18 +03:00
Alex Shvartzkop cb25c8620e Performance optimizations for database libraries.
(cherry picked from commit e68df8e1d1)
2024-02-23 20:29:18 +03:00
Alex Shvartzkop e5896374e3 Normalize SCH_PIN BBox to fix assert.
(cherry picked from commit 3e26e7b646)
2024-02-23 20:29:18 +03:00
Alex Shvartzkop 72354ac033 Eeschema: select graphical shapes based on effective shapes.
(cherry picked from commit a13e4e7d9f)
2024-02-23 20:29:18 +03:00
Alex Shvartzkop 41ffadc987 Use correct text color in LIB_TREE selected items on non-OSX.
(cherry picked from commit 6feafedfbe)
2024-02-23 20:29:18 +03:00
Jeff Young 12c21abdff Don't use EQUALITY flag when doing a symbol diff with library.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16944

(cherry picked from commit adae4de438)
2024-02-23 16:53:36 +01:00
Jeff Young c3bcbb6238 Update Edit Teardrops dialog to match other teardrop terminology.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17050

(cherry picked from commit c8b06d54cb)
2024-02-23 16:53:36 +01:00
Jeff Young 4a561b04bc Code cleanup and compiler warnings.
(cherry picked from commit 51848a0b43)
2024-02-23 16:53:35 +01:00
Jeff Young 98cd040952 Set up default netclass wire & bus widths.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17024

(cherry picked from commit 2d7f4faf72)
2024-02-23 16:53:35 +01:00
Jeff Young 2c49ba4252 Formatting.
(cherry picked from commit c75bb5d01a)
2024-02-23 16:53:35 +01:00
Jeff Young 19dedccd98 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

(cherry picked from commit df8f043c16)
2024-02-23 16:53:35 +01:00
Jeff Young dfd97003ac 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

(cherry picked from commit 01d668c09d)
2024-02-23 16:53:34 +01:00
Jeff Young 7b17646b71 Make sure nets get reassigned when name is changed.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17025

(cherry picked from commit f4a3613561)
2024-02-23 16:53:34 +01:00
Jeff Young 5c026db27a Report fp library loading errors with libName & fpName.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16975

(cherry picked from commit 12922d9434)
2024-02-23 16:53:34 +01:00
Jeff Young 17a37a55f0 When updating RefDes only update the prefix.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16991

(cherry picked from commit b6036f368e)
2024-02-23 16:53:34 +01:00
Jeff Young 2cd9fbab9d Check known m_Desc field before m_Fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16971

(cherry picked from commit 25291d6e3a)
2024-02-23 16:53:34 +01:00
Jeff Young ca3cd706e5 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

(cherry picked from commit f4a085575a)
2024-02-23 16:53:33 +01:00
Jeff Young 800bbd8841 Delete empty Netclass fields only if there are others.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16997

(cherry picked from commit a34b242f4e)
2024-02-23 16:53:33 +01:00
Jeff Young a156b49e2c Comments.
(cherry picked from commit 8a3cbce8f8)
2024-02-23 16:53:33 +01:00
Jeff Young 3938c35f17 Repair copy/paste of footprint fields.
Some of the code got lost in the move to PCB_FIELDs.

(cherry picked from commit a9c4a17c38)
2024-02-23 16:53:33 +01:00
Jeff Young e7f18e7eab Warp after context menu only if actively drawing.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11080

(cherry picked from commit 1a7152d3eb)
2024-02-23 16:53:32 +01:00
Jeff Young e68cd04d48 Don't modify reference point if already moving.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16524

(cherry picked from commit 08da9a4494)
2024-02-23 16:53:32 +01:00
Jeff Young ef23d6776d Formatting.
(cherry picked from commit baaed8ed84)
2024-02-23 16:53:32 +01:00
Jeff Young 73b6b19a4e Keep Mac debugger from crashing with breakpoints in .h files.
(cherry picked from commit 7446fba70a)
2024-02-23 16:53:32 +01:00
Jeff Young 898f60ea2f Add help text for DRC assertion clauses.
(cherry picked from commit d36f189192)
2024-02-23 16:53:31 +01:00
Jeff Young 345645bd8c Help documentation for "assertion" constraints.
(cherry picked from commit 152c458b9c)
2024-02-23 16:53:31 +01:00
Jeff Young 900962f9f1 Update syntax help for memberOfFootprint.
(cherry picked from commit 7ae14f9630)
2024-02-23 16:53:31 +01:00
Jeff Young 57dcf285c5 Various string issues held over from 8.0 string freeze.
(cherry picked from commit a610542a19)
2024-02-23 16:53:31 +01:00
Jeff Young 23c2104ffa Improve alignment tooltips.
(cherry picked from commit 2ab492474e)
2024-02-23 16:53:31 +01:00
Jeff Young f161a1eaac Ignore duplicate/repeat when drawing an existing item.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16885

(cherry picked from commit 3caede3799)
2024-02-23 16:53:30 +01:00
Jeff Young 9ff66d0e71 Don't capture references to local variables for CallAfter.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16934

(cherry picked from commit 9d40374baf)
2024-02-23 16:53:30 +01:00
Jeff Young 276171b85e Handle holes in shapes when creating bounding hulls.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16347

(cherry picked from commit 0ead8a14a1)
2024-02-23 16:53:30 +01:00
Jeff Young 3c6d725f93 Kick PROPERTIES_PANEL a bit harder on language change.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16589

(cherry picked from commit e8b16fc64f)
2024-02-23 16:53:30 +01:00
Jeff Young ffa6adec96 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
(cherry picked from commit 162e8962f7)
2024-02-23 16:53:29 +01:00
Roberto Fernandez Bautista d464d7995b Thread safety: replace ++m_modHash by IncrementModifyHash() 2024-02-23 14:59:10 +00:00
Roberto Fernandez Bautista 991ddfe6be Add cache to SCH_IO_DATABASE to improve loading performance
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17031
2024-02-23 14:59:10 +00:00
Roberto Fernandez Bautista 07ab18a1e6 Legacy libraries: De-duplicate field names on load
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16902
2024-02-23 14:57:57 +00:00
Roberto Fernandez Bautista 420413969e Altium: Don't create duplicate fields 2024-02-23 14:57:57 +00:00
Roberto Fernandez Bautista 1a6e6a06eb 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
2024-02-23 14:57:57 +00:00
Jon Evans 589e21cd3b 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
2024-02-23 14:36:32 +00:00
jean-pierre charras ef6a5b6252 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.
2024-02-23 11:36:14 +01:00
Wayne Stambaugh 2194f99341 Begin version 9 development. 2024-02-22 18:11:04 -05:00
1998 changed files with 470152 additions and 455782 deletions
+6
View File
@@ -103,7 +103,9 @@ __pycache__
.editorconfig
CMakeSettings.json
.vscode/
compile_commands.json
/vcpkg_installed
CMakePresets.json
# Sublime Text
*.sublime-*
@@ -112,6 +114,10 @@ CMakeSettings.json
.kdev4/
*.kdev4
# Qt Creator
CMakeLists.txt.user
*.autosave
# Translations
*.mo
i18n_status.svg
+5 -1
View File
@@ -28,6 +28,7 @@
-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 ../../
@@ -39,6 +40,7 @@
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
@@ -63,6 +65,8 @@ 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"
@@ -150,7 +154,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]
- TEST: [python, cli, common, gerbview, pcbnew, pns_regressions, eeschema, kimath, sexpr, kicad2step, spice, api]
fedora_qa_kicad:
extends: .fedora_qa
+3 -3
View File
@@ -4,16 +4,16 @@
win64_build:
stage: build
tags:
- kicad-windows-ltsc2022
- kicad-windows-1809
interruptible: false
image: registry.gitlab.com/kicad/kicad-ci/windows-build-image/ltsc2022-msvc:latest
image: registry.gitlab.com/kicad/kicad-ci/windows-build-image/win1809-msvc:latest
variables:
VCPKG_BINARY_SOURCES: 'nuget,kicad,readwrite'
# Switch the compressor to fastzip and reduce the compression level
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: "fast"
cache:
key: win64-vcpkg-$CI_COMMIT_REF_SLUG
key: win64-vcpkg-"$CI_COMMIT_REF_SLUG"
paths:
- build\windows\vcpkg_installed
- .vcpkgCache
+1 -1
View File
@@ -6,7 +6,7 @@ build_doxygen_docker:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_JOB_NAME == "doxygen"
tags:
- gitlab-org-docker
- docker
before_script:
- docker info
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
+19 -1
View File
@@ -15,7 +15,25 @@ macos_build:
- cd build/macos
- cmake
-G Ninja
-DCMAKE_TOOLCHAIN_FILE=/Users/$USER/kicad-mac-builder/toolchain/kicad-mac-builder.cmake
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DDEFAULT_INSTALL_PATH=/Library/Application\ Support /kicad
-DOCC_INCLUDE_DIR=/opt/homebrew/Cellar/opencascade/7.7.2_2/include/opencascade
-DOCC_LIBRARY_DIR=/opt/homebrew/Cellar/opencascade/7.7.2_2/Lib
-DCMAKE_INSTALL_PREFIX=/Users/ci/kicad-mac-builder/build/kicad-dest
-DCMAKE_C_COMPILER=/usr/bin/clang
-DCMAKE_CXX_COMPILER=/usr/bin/clang++
-DwxWidgets_CONFIG_EXECUTABLE=/Users/ci/kicad-mac-builder/build/wxwidgets-dest/bin/wx-config
-DKICAD_BUILD_I18N=ON
-DKICAD_SCRIPTING_WXPYTHON=ON
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON
-DPYTHON_EXECUTABLE=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/bin/python3
-DPYTHON_INCLUDE_DIR=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/include/python3.9/
-DPYTHON_LIBRARY=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/lib/libpython3.9.dylib
-DPYTHON_SITE_PACKAGE_PATH=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/lib/python3.9/site-packages
-DPYTHON_FRAMEWORK=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework
-DNGSPICE_INCLUDE_DIR=/Users/ci/kicad-mac-builder/build/ngspice-dest/include
-DNGSPICE_LIBRARY=/Users/ci/kicad-mac-builder/build/ngspice-dest/lib/libngspice.dylib
-DKICAD_USE_3DCONNEXION=ON
../../
- cmake --build . 2>&1 | tee compilation_log.txt
- cd ../../
+1 -7
View File
@@ -381,13 +381,7 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
fclose( fp );
unsigned int digest[5];
// 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 ) );
dblock.get_digest( digest );
// ensure MSB order
for( int i = 0; i < 5; ++i )
+40 -6
View File
@@ -155,13 +155,47 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
checkPluginPath( std::string( fn.GetPathWithSep().ToUTF8() ), searchpaths );
#else
// Search path on OS X is
// (1) Machine /Library/Application Support/kicad/PlugIns/3d
checkPluginPath( PATHS::GetOSXKicadMachineDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
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() );
// (2) Bundle kicad.app/Contents/PlugIns/3d
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
checkPluginPath( fn.GetPathWithSep(), 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 );
}
#endif
std::list< wxString >::iterator sPL = searchpaths.begin();
+1 -3
View File
@@ -229,7 +229,7 @@ void BOARD_ADAPTER::ReloadColorSettings() noexcept
try
{
cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
}
catch( const std::runtime_error& e )
{
@@ -708,8 +708,6 @@ void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
for( const auto& [ layer, color ] : aColors )
settings->SetColor( layer, color );
Pgm().GetSettingsManager().SaveColorSettings( settings, "3d_viewer" );
}
+7 -2
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2023 CERN
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-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
@@ -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,6 +42,8 @@
#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>
@@ -377,6 +379,9 @@ 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 );
@@ -38,6 +38,7 @@
#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>
@@ -98,7 +99,6 @@ void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContaine
TEXT_ATTRIBUTES attrs = aText->GetAttributes();
float penWidth_3DU = TO_3DU( aText->GetEffectiveTextPenWidth() );
KIFONT::FONT* font = aText->GetFont();
wxString shownText = aText->GetShownText( true );
if( !font )
font = KIFONT::FONT::GetFont( wxEmptyString, aText->IsBold(), aText->IsItalic() );
@@ -133,15 +133,8 @@ void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContaine
attrs.m_Angle = aText->GetDrawRotation();
if( auto* cache = aText->GetRenderCache( font, shownText ) )
{
callback_gal.DrawGlyphs( *cache );
}
else
{
font->Draw( &callback_gal, shownText, aText->GetDrawPos(), attrs,
aOwner->GetFontMetrics() );
}
font->Draw( &callback_gal, aText->GetShownText( true ), aText->GetDrawPos(), attrs,
aOwner->GetFontMetrics() );
}
}
@@ -233,12 +226,17 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
PCB_TEXTBOX* textbox = static_cast<PCB_TEXTBOX*>( item );
if( textbox->GetLayer() == aLayerId )
{
if( textbox->IsBorderEnabled() )
addShape( textbox, aContainer, aFootprint );
addShape( textbox, aContainer, aFootprint );
addText( textbox, aContainer, aFootprint );
}
break;
}
case PCB_TABLE_T:
{
PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
if( table->GetLayer() == aLayerId )
addTable( table, aContainer, aFootprint );
break;
}
@@ -382,13 +380,6 @@ 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() );
@@ -437,7 +428,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
break;
case SH_POLY_SET:
poly.Append( *static_cast<const SHAPE_POLY_SET*>( shape ) );
poly = *(SHAPE_POLY_SET*) shape;
break;
case SH_ARC:
@@ -741,7 +732,9 @@ 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;
@@ -754,6 +747,17 @@ 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 )
{
+24 -32
View File
@@ -40,6 +40,7 @@
#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>
@@ -185,12 +186,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
for( PCB_TRACK* track : m_board->Tracks() )
{
// Skip tracks (not vias that are on more than one layer ) on disabled layers
if( track->Type() != PCB_VIA_T
&& !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
{
if( !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) ) // Skip non enabled layers
continue;
}
// Note: a PCB_TRACK holds normal segment tracks and also vias circles (that have also
// drill values)
@@ -626,6 +623,10 @@ 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:
@@ -643,33 +644,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// add also this shape to the plated copper polygon list if required
if( cfg.differentiate_plated_copper )
{
// Note: for TEXT and TEXTBOX, TransformShapeToPolygon returns the bounding
// box shape, not the exact text shape. So it is not used for these items
if( layer == F_Cu || layer == B_Cu )
{
SHAPE_POLY_SET* platedCopperPolys = layer == F_Cu
? m_frontPlatedCopperPolys
: m_backPlatedCopperPolys;
if( item->Type() == PCB_TEXTBOX_T )
{
PCB_TEXTBOX* text_box = static_cast<PCB_TEXTBOX*>( item );
text_box->TransformTextToPolySet( *platedCopperPolys,
0, maxError, ERROR_INSIDE );
// Add box outlines
text_box->PCB_SHAPE::TransformShapeToPolygon( *platedCopperPolys, layer,
0, maxError, ERROR_INSIDE );
}
else if( item->Type() == PCB_TEXT_T )
{
static_cast<PCB_TEXT*>( item )->TransformTextToPolySet(
*platedCopperPolys,
0, maxError, ERROR_INSIDE );
}
else
item->TransformShapeToPolygon( *platedCopperPolys, layer,
0, maxError, ERROR_INSIDE );
}
if( layer == F_Cu )
item->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu,
0, maxError, ERROR_INSIDE );
else if( layer == B_Cu )
item->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu,
0, maxError, ERROR_INSIDE );
}
}
}
@@ -711,6 +691,10 @@ 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() );
@@ -872,6 +856,10 @@ 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:
@@ -967,6 +955,10 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
break;
}
case PCB_TABLE_T:
// JEY TODO: tables
break;
default:
break;
}
+8 -59
View File
@@ -29,11 +29,10 @@
#include "../common_ogl/ogl_utils.h"
#include "eda_3d_canvas.h"
#include <eda_3d_viewer_frame.h>
#include <3d_rendering/raytracing/render_3d_raytrace.h>
#include <3d_rendering/raytracing/render_3d_raytrace_gl.h>
#include <3d_rendering/opengl/render_3d_opengl.h>
#include <3d_viewer_id.h>
#include <advanced_config.h>
#include <build_version.h>
#include <board.h>
#include <reporter.h>
#include <gal/opengl/gl_context_mgr.h>
@@ -82,11 +81,11 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, HIDPI_GL_3D_CANVAS )
END_EVENT_TABLE()
EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList,
EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttribs,
BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera,
S3D_CACHE* a3DCachePointer ) :
HIDPI_GL_3D_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aCamera, aParent, wxID_ANY,
aAttribList, wxDefaultPosition,
HIDPI_GL_3D_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aCamera, aParent, aGLAttribs,
wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxFULL_REPAINT_ON_RESIZE ),
m_eventDispatcher( nullptr ),
m_parentStatusBar( nullptr ),
@@ -120,7 +119,7 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList,
m_is_currently_painting.clear();
m_3d_render_raytracing = new RENDER_3D_RAYTRACE( this, m_boardAdapter, m_camera );
m_3d_render_raytracing = new RENDER_3D_RAYTRACE_GL( this, m_boardAdapter, m_camera );
m_3d_render_opengl = new RENDER_3D_OPENGL( this, m_boardAdapter, m_camera );
wxASSERT( m_3d_render_raytracing != nullptr );
@@ -230,9 +229,6 @@ bool EDA_3D_CANVAS::initializeOpenGL()
From_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
}
SetOpenGLInfo( (const char*) glGetString( GL_VENDOR ), (const char*) glGetString( GL_RENDERER ),
(const char*) glGetString( GL_VERSION ) );
wxString version = From_UTF8( (char *) glGetString( GL_VERSION ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::%s OpenGL version string %s." ),
@@ -752,11 +748,6 @@ 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();
@@ -988,66 +979,24 @@ bool EDA_3D_CANVAS::SetView3D( VIEW3D_TYPE aRequestedView )
return true;
case VIEW3D_TYPE::VIEW3D_RIGHT:
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_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:
case VIEW3D_TYPE::VIEW3D_FLIP:
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 ) );
m_camera.ViewCommand_T1( aRequestedView );
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.Reset_T1();
m_camera.RotateY_T1( glm::radians( 179.999f ) ); // Rotation = 180 - epsilon
m_camera.ViewCommand_T1( aRequestedView );
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;
}
+9 -10
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-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-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
@@ -38,7 +38,7 @@
class WX_INFOBAR;
class wxStatusBar;
class BOARD;
class RENDER_3D_RAYTRACE;
class RENDER_3D_RAYTRACE_GL;
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 aAttribList a list of openGL options created by GetOpenGL_AttributesList.
* @param aGLAttribs openGL attributes created by #OGL_ATT_LIST::GetAttributesList.
* @param aBoard The board.
* @param aSettings the settings options to be used by this canvas.
*/
EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList,
BOARD_ADAPTER& aSettings, CAMERA& aCamera, S3D_CACHE* a3DCachePointer );
EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttribs, BOARD_ADAPTER& aSettings,
CAMERA& aCamera, S3D_CACHE* a3DCachePointer );
~EDA_3D_CANVAS();
@@ -97,7 +97,7 @@ public:
}
/**
* @return the current render ( a RENDER_3D_RAYTRACE* or a RENDER_3D_OPENGL* render )
* @return the current render ( a RENDER_3D_RAYTRACE_GL* or a RENDER_3D_OPENGL* render )
*/
RENDER_3D_BASE* GetCurrentRender() const { return m_3d_render; }
@@ -216,8 +216,6 @@ public:
*/
void DoRePaint();
void OnCloseWindow( wxCloseEvent& event );
private:
// The wxPaintEvent event. mainly calls DoRePaint()
void OnPaint( wxPaintEvent& aEvent );
@@ -228,13 +226,14 @@ private:
void OnMouseWheel( wxMouseEvent& event );
void OnMagnify( wxMouseEvent& event );
void OnMagnify( wxMouseEvent& event );
void OnMouseMove( wxMouseEvent& event );
void OnLeftDown( wxMouseEvent& event );
void OnLeftUp( wxMouseEvent& event );
void OnMiddleUp( wxMouseEvent& event );
void OnMiddleDown( wxMouseEvent& event );
void OnTimerTimeout_Editing( wxTimerEvent& event );
void OnCloseWindow( wxCloseEvent& event );
void OnResize( wxSizeEvent& event );
void OnTimerTimeout_Redraw( wxTimerEvent& event );
@@ -312,7 +311,7 @@ private:
BOARD_ADAPTER& m_boardAdapter; // Pre-computed 3D info and settings
RENDER_3D_BASE* m_3d_render;
RENDER_3D_RAYTRACE* m_3d_render_raytracing;
RENDER_3D_RAYTRACE_GL* m_3d_render_raytracing;
RENDER_3D_OPENGL* m_3d_render_opengl;
bool m_opengl_supports_raytracing;
@@ -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
@@ -35,7 +35,6 @@
#include "../3d_cache/3d_cache.h"
#include <wx/dcclient.h>
#include <base_units.h>
#include <build_version.h>
#include <gal/opengl/gl_context_mgr.h>
#include <settings/common_settings.h>
#include <pgm_base.h>
@@ -86,9 +85,9 @@ END_EVENT_TABLE()
#define RANGE_SCALE_3D 8.0f
EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList,
EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const wxGLAttributes& aGLAttribs,
S3D_CACHE* aCacheManager ) :
HIDPI_GL_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aParent, wxID_ANY, aAttribList,
HIDPI_GL_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aParent, aGLAttribs, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxFULL_REPAINT_ON_RESIZE ),
m_trackBallCamera( RANGE_SCALE_3D * 4.0f ),
@@ -103,6 +102,11 @@ EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribL
m_BiuTo3dUnits = 1.0;
m_glRC = nullptr;
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
SetScaleFactor( dpi.GetScaleFactor() );
}
@@ -196,9 +200,6 @@ void EDA_3D_MODEL_VIEWER::ogl_initialize()
From_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
}
SetOpenGLInfo( (const char*) glGetString( GL_VENDOR ), (const char*) glGetString( GL_RENDERER ),
(const char*) glGetString( GL_VERSION ) );
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
@@ -301,7 +302,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, 1.0f );
glClearColor( 0.0f, 0.0f, 0.0f, 0.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 aAttribList a list of openGL options created by #OGL_ATT_LIST::GetAttributesList.
* @param aGLAttribs openGL attributes created by #OGL_ATT_LIST::GetAttributesList.
*/
EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList = nullptr,
EDA_3D_MODEL_VIEWER( wxWindow* aParent, const wxGLAttributes& aGLAttribs,
S3D_CACHE* aCacheManager = nullptr );
~EDA_3D_MODEL_VIEWER();
-2
View File
@@ -1,8 +1,6 @@
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
+6 -3
View File
@@ -25,17 +25,20 @@
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 = std::make_unique<NL_3D_VIEWER_PLUGIN_IMPL>( aViewport, "KiCAD 3D" );
m_impl->Connect();
m_impl = new NL_3D_VIEWER_PLUGIN_IMPL( aViewport );
}
}
NL_3D_VIEWER_PLUGIN::~NL_3D_VIEWER_PLUGIN() = default;
NL_3D_VIEWER_PLUGIN::~NL_3D_VIEWER_PLUGIN()
{
delete m_impl;
}
void NL_3D_VIEWER_PLUGIN::SetFocus( bool focus )
+1 -3
View File
@@ -26,8 +26,6 @@
#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;
@@ -56,7 +54,7 @@ public:
void SetFocus( bool aFocus = true );
private:
std::unique_ptr<NL_3D_VIEWER_PLUGIN_IMPL> m_impl;
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) 2024 3Dconnexion
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021 3Dconnexion
* Copyright (C) 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 as published by the
@@ -27,7 +27,6 @@
// KiCAD includes
#include <tool/action_manager.h>
#include <tool/tool_manager.h>
#include <tool/tools_holder.h>
// stdlib
#include <map>
@@ -73,7 +72,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, const std::string& aProfileHint ) :
NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas ) :
NAV_3D( false, false ),
m_canvas( aCanvas ),
m_capIsMoving( false ),
@@ -81,7 +80,12 @@ NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas, cons
{
m_camera = dynamic_cast<TRACK_BALL*>( m_canvas->GetCamera() );
PutProfileHint( aProfileHint );
PutProfileHint( "KiCAD 3D" );
EnableNavigation( true );
PutFrameTimingSource( TimingSource::SpaceMouse );
exportCommandsAndImages();
}
@@ -97,19 +101,8 @@ void NL_3D_VIEWER_PLUGIN_IMPL::SetFocus( bool aFocus )
NAV_3D::Write( navlib::focus_k, aFocus );
}
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();
}
// temporary store for the categories
typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
/**
* Add a category to the store.
@@ -578,7 +571,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
if( parent->IsEnabled() )
{
TOOL_MANAGER* tool_manager = dynamic_cast<TOOLS_HOLDER*>( parent )->GetToolManager();
TOOL_MANAGER* tool_manager = static_cast<PCB_BASE_FRAME*>( parent )->GetToolManager();
if( tool_manager == nullptr )
{
+4 -21
View File
@@ -1,8 +1,8 @@
/*
* 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.
* Copyright (C) 2021 3Dconnexion
* Copyright (C) 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 as published by the
@@ -42,11 +42,6 @@
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;
@@ -61,9 +56,8 @@ 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, const std::string& aProfileHint );
NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas );
virtual ~NL_3D_VIEWER_PLUGIN_IMPL();
@@ -75,21 +69,11 @@ 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.
*/
virtual void exportCommandsAndImages();
void exportCommandsAndImages();
long GetCameraMatrix( navlib::matrix_t& aMatrix ) const override;
long GetPointerPosition( navlib::point_t& aPosition ) const override;
@@ -127,7 +111,6 @@ 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,62 +0,0 @@
/*
* 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_
@@ -1,162 +0,0 @@
/*
* 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 );
}
@@ -1,68 +0,0 @@
/*
* 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_
+39 -1
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-2020 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
@@ -46,6 +46,19 @@ 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 )
{
@@ -110,6 +123,31 @@ 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 )
{
+4 -1
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-2020 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
@@ -42,6 +42,9 @@ 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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -23,53 +23,60 @@
*/
/**
* @file color_rgb.cpp
* @file color_rgba.cpp
*/
#include "color_rgb.h"
#include "color_rgba.h"
COLOR_RGB::COLOR_RGB( const SFVEC3F& aColor )
COLOR_RGBA::COLOR_RGBA( 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_RGB::operator SFVEC3F() const
COLOR_RGBA::COLOR_RGBA( const SFVEC4F& aColor )
{
return SFVEC3F( r / 255.0f, g / 255.0f, b / 255.0f );
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_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2 )
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& 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_RGB( ( r >> 1 ), ( g >> 1 ), ( b >> 1 ) );
return COLOR_RGBA( ( r >> 1 ), ( g >> 1 ), ( b >> 1 ), ( a >> 1 ) );
}
COLOR_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2, const COLOR_RGB& aC3 )
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2, const COLOR_RGBA& 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_RGB( ( r / 3 ), ( g / 3 ), ( b / 3 ) );
return COLOR_RGBA( ( r / 3 ), ( g / 3 ), ( b / 3 ), ( a / 3 ) );
}
COLOR_RGB BlendColor( const COLOR_RGB& aC1, const COLOR_RGB& aC2, const COLOR_RGB& aC3,
const COLOR_RGB& aC4 )
COLOR_RGBA BlendColor( const COLOR_RGBA& aC1, const COLOR_RGBA& aC2, const COLOR_RGBA& aC3,
const COLOR_RGBA& 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_RGB( ( r >> 2 ), ( g >> 2 ), ( b >> 2 ) );
return COLOR_RGBA( ( r >> 2 ), ( g >> 2 ), ( b >> 2 ), ( a >> 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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -23,41 +23,49 @@
*/
/**
* @file color_rgb.h
* @file color_rgba.h
*/
#ifndef COLOR_RGB_H
#define COLOR_RGB_H
#ifndef COLOR_RGBA_H
#define COLOR_RGBA_H
#include <plugins/3dapi/xv3d_types.h>
union COLOR_RGB
union COLOR_RGBA
{
unsigned char c[3];
unsigned char c[4];
struct
{
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
};
COLOR_RGB( const SFVEC3F& aColor );
COLOR_RGB() { r = 0; g = 0; b = 0; }
COLOR_RGB( unsigned char aR, unsigned char aG, unsigned char aB )
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 )
{
r = aR;
g = aG;
b = aB;
}
operator SFVEC3F() const;
COLOR_RGBA( unsigned char aR, unsigned char aG, unsigned char aB, unsigned char aA )
{
r = aR;
g = aG;
b = aB;
a = aA;
}
};
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 );
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 );
#endif // COLOR_RGB_H
#endif // COLOR_RGBA_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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -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-2023 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -47,7 +47,8 @@
RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter,
CAMERA& aCamera ) :
RENDER_3D_BASE( aCanvas, aAdapter, aCamera )
RENDER_3D_BASE( aAdapter, aCamera ),
m_canvas( aCanvas )
{
wxLogTrace( m_logTrace, wxT( "RENDER_3D_OPENGL::RENDER_3D_OPENGL" ) );
@@ -444,11 +445,17 @@ 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_is_opengl_initialized )
if( !m_canvasInitialized )
{
if( !initializeOpenGL() )
return false;
@@ -495,7 +502,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, 1.0f );
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
glClearDepth( 1.0f );
glClearStencil( 0x00 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
@@ -503,8 +510,8 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
OglResetTextureState();
// Draw the background ( rectangle with color gradient)
OglDrawBackground( SFVEC3F( m_boardAdapter.m_BgColorTop ),
SFVEC3F( m_boardAdapter.m_BgColorBot ) );
OglDrawBackground( premultiplyAlpha( m_boardAdapter.m_BgColorTop ),
premultiplyAlpha( m_boardAdapter.m_BgColorBot ) );
glEnable( GL_DEPTH_TEST );
@@ -817,7 +824,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_is_opengl_initialized = true;
m_canvasInitialized = true;
return true;
}
@@ -1015,7 +1022,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 };
@@ -1128,7 +1135,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 );
}
@@ -1218,7 +1225,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-2021 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -208,6 +208,8 @@ 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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -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 SFVEC3F[n_elements];
m_color = new SFVEC4F[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 SFVEC3F& aColor, const SFVEC3F& aHitPosition,
const SFVEC4F& 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 SFVEC3F& POST_SHADER::GetColorAt( const SFVEC2F& aPos ) const
const SFVEC4F& 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 SFVEC3F& POST_SHADER::GetColorAt( const SFVEC2I& aPos ) const
const SFVEC4F& POST_SHADER::GetColorAt( const SFVEC2I& aPos ) const
{
return m_color[GetIndex( aPos )];
}
const SFVEC3F& POST_SHADER::GetColorAtNotProtected( const SFVEC2I& aPos ) const
const SFVEC4F& 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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -46,7 +46,7 @@ public:
* @param aShadeColor The result of the shader.
* @return the result of the shade process
*/
virtual SFVEC3F ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC3F& aInputColor,
virtual SFVEC4F ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC4F& 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 SFVEC3F& aColor, const SFVEC3F& aHitPosition,
const SFVEC4F& aColor, const SFVEC3F& aHitPosition,
float aDepth, float aShadowAttFactor );
const SFVEC3F& GetColorAtNotProtected( const SFVEC2I& aPos ) const;
const SFVEC4F& GetColorAtNotProtected( const SFVEC2I& aPos ) const;
void DebugBuffersOutputAsImages() const;
@@ -88,12 +88,12 @@ public:
protected:
const SFVEC3F& GetNormalAt( const SFVEC2F& aPos ) const;
const SFVEC3F& GetColorAt( const SFVEC2F& aPos ) const;
const SFVEC4F& 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 SFVEC3F& GetColorAt( const SFVEC2I& aPos ) const;
const SFVEC4F& 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;
SFVEC3F* m_color;
SFVEC4F* m_color;
SFVEC3F* m_wc_hitposition;
float* m_depth;
float* m_shadow_att_factor;
+27 -13
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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -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) *
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( npw, nph ) ) );
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( npw, nph ) ) );
gi += giFF( aShaderPos, ddiff2, n, shadowAt2, npw, -nph) *
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( npw,-nph ) ) );
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( npw,-nph ) ) );
gi += giFF( aShaderPos, ddiff3, n, shadowAt3, -npw, nph) *
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( -npw, nph ) ) );
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( -npw, nph ) ) );
gi += giFF( aShaderPos, ddiff4, n, shadowAt4, -npw, -nph) *
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( -npw,-nph ) ) );
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( -npw,-nph ) ) );
gi += giFF( aShaderPos, ddiff5, n, shadowAt5 , pw, nph) *
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( pw, nph ) ) );
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( pw, nph ) ) );
gi += giFF( aShaderPos, ddiff6, n, shadowAt6, pw,-nph) *
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( pw,-nph ) ) );
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( pw,-nph ) ) );
gi += giFF( aShaderPos, ddiff7, n, shadowAt7, npw, ph) *
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( npw, ph ) ) );
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( npw, ph ) ) );
gi += giFF( aShaderPos, ddiff8, n, shadowAt8, -npw, ph) *
giColorCurve( GetColorAt( aShaderPos + SFVEC2I( -npw, ph ) ) );
giColorCurveShade( GetColorAt( aShaderPos + SFVEC2I( -npw, ph ) ) );
}
// If it received direct light, it shouldn't consider much AO
@@ -227,18 +227,20 @@ SFVEC3F POST_SHADER_SSAO::Shade( const SFVEC2I& aShaderPos ) const
}
SFVEC3F POST_SHADER_SSAO::ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC3F& aInputColor,
SFVEC4F POST_SHADER_SSAO::ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC4F& aInputColor,
const SFVEC3F& aShadeColor ) const
{
SFVEC3F outColor;
SFVEC4F outColor;
SFVEC3F inColor( aInputColor );
const SFVEC3F subtracted = aInputColor - aShadeColor;
const SFVEC3F mixed = glm::mix( aInputColor, aInputColor * 0.50f - aShadeColor * 0.05f,
const SFVEC3F subtracted = inColor - aShadeColor;
const SFVEC3F mixed = glm::mix( inColor, inColor * 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;
}
@@ -256,6 +258,18 @@ 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 );
+4 -2
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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -40,7 +40,7 @@ public:
explicit POST_SHADER_SSAO( const CAMERA& aCamera );
SFVEC3F Shade(const SFVEC2I& aShaderPos ) const override;
SFVEC3F ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC3F& aInputColor,
SFVEC4F ApplyShadeColor( const SFVEC2I& aShaderPos, const SFVEC4F& aInputColor,
const SFVEC3F& aShadeColor ) const override;
SFVEC3F Blur( const SFVEC2I& aShaderPos ) const;
@@ -77,6 +77,8 @@ 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-2023 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -23,7 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "render_3d_raytrace.h"
#include "render_3d_raytrace_base.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::setupMaterials()
void RENDER_3D_RAYTRACE_BASE::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::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, 0.0f, 0.50f );
0.10f * 128.0f, 1.0f, 0.50f );
m_materials.m_Floor.SetCastShadows( false );
m_materials.m_Floor.SetReflectionRecursionCount( 1 );
}
void RENDER_3D_RAYTRACE::createObject( CONTAINER_3D& aDstContainer, const OBJECT_2D* aObject2D,
void RENDER_3D_RAYTRACE_BASE::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::createObject( CONTAINER_3D& aDstContainer, const OBJECT
}
void RENDER_3D_RAYTRACE::createItemsFromContainer( const BVH_CONTAINER_2D* aContainer2d,
void RENDER_3D_RAYTRACE_BASE::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::createItemsFromContainer( const BVH_CONTAINER_2D* aCont
extern void buildBoardBoundingBoxPoly( const BOARD* aBoard, SHAPE_POLY_SET& aOutline );
void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningReporter,
void RENDER_3D_RAYTRACE_BASE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningReporter,
bool aOnlyLoadCopperAndShapes )
{
m_reloadRequested = false;
@@ -429,7 +429,7 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe
boardPolyCopy.Fracture( SHAPE_POLY_SET::PM_FAST );
for( int ii = 0; ii < boardPolyCopy.OutlineCount(); ii++ )
for( int ii = 0; ii < outlineCount; ii++ )
{
ConvertPolygonToBlocks( boardPolyCopy, *m_outlineBoard2dObjects,
m_boardAdapter.BiuTo3dUnits(), divFactor,
@@ -817,7 +817,7 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe
const SFVEC3F v2 = SFVEC3F( v1.x, v3.y, v1.z );
const SFVEC3F v4 = SFVEC3F( v3.x, v1.y, v1.z );
SFVEC3F backgroundColor = ConvertSRGBToLinear( m_boardAdapter.m_BgColorTop );
SFVEC3F floorColor = 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::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe
newTriangle1->SetMaterial( &m_materials.m_Floor );
newTriangle2->SetMaterial( &m_materials.m_Floor );
newTriangle1->SetColor( backgroundColor );
newTriangle2->SetColor( backgroundColor );
newTriangle1->SetColor( floorColor );
newTriangle2->SetColor( floorColor );
// Ceiling triangles
const float maxZ = glm::max( containerBBox.Max().z, boardBBox.Max().z );
@@ -848,8 +848,8 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe
newTriangle3->SetMaterial( &m_materials.m_Floor );
newTriangle4->SetMaterial( &m_materials.m_Floor );
newTriangle3->SetColor( backgroundColor );
newTriangle4->SetColor( backgroundColor );
newTriangle3->SetColor( floorColor );
newTriangle4->SetColor( floorColor );
}
}
}
@@ -962,7 +962,7 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe
}
void RENDER_3D_RAYTRACE::insertHole( const PCB_VIA* aVia )
void RENDER_3D_RAYTRACE_BASE::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::insertHole( const PCB_VIA* aVia )
}
void RENDER_3D_RAYTRACE::insertHole( const PAD* aPad )
void RENDER_3D_RAYTRACE_BASE::insertHole( const PAD* aPad )
{
const OBJECT_2D* object2d_A = nullptr;
@@ -1164,7 +1164,7 @@ void RENDER_3D_RAYTRACE::insertHole( const PAD* aPad )
}
void RENDER_3D_RAYTRACE::addPadsAndVias()
void RENDER_3D_RAYTRACE_BASE::addPadsAndVias()
{
if( !m_boardAdapter.GetBoard() )
return;
@@ -1193,7 +1193,7 @@ void RENDER_3D_RAYTRACE::addPadsAndVias()
}
void RENDER_3D_RAYTRACE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMaterialInformation )
void RENDER_3D_RAYTRACE_BASE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMaterialInformation )
{
if( !m_boardAdapter.GetBoard() )
return;
@@ -1243,6 +1243,8 @@ void RENDER_3D_RAYTRACE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMa
fpMatrix, SFVEC3F( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor,
modelunit_to_3d_units_factor ) );
BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( fp );
// Get the list of model files for this model
S3D_CACHE* cacheMgr = m_boardAdapter.Get3dCacheManager();
auto sM = fp->Models().begin();
@@ -1302,7 +1304,7 @@ void RENDER_3D_RAYTRACE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMa
SFVEC3F( sM->m_Scale.x, sM->m_Scale.y, sM->m_Scale.z ) );
addModels( aDstContainer, modelPtr, modelMatrix, (float) sM->m_Opacity,
aSkipMaterialInformation, fp );
aSkipMaterialInformation, boardItem );
}
}
@@ -1313,7 +1315,7 @@ void RENDER_3D_RAYTRACE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMa
}
MODEL_MATERIALS* RENDER_3D_RAYTRACE::getModelMaterial( const S3DMODEL* a3DModel )
MODEL_MATERIALS* RENDER_3D_RAYTRACE_BASE::getModelMaterial( const S3DMODEL* a3DModel )
{
MODEL_MATERIALS* materialVector;
@@ -1416,7 +1418,7 @@ MODEL_MATERIALS* RENDER_3D_RAYTRACE::getModelMaterial( const S3DMODEL* a3DModel
}
void RENDER_3D_RAYTRACE::addModels( CONTAINER_3D& aDstContainer, const S3DMODEL* a3DModel,
void RENDER_3D_RAYTRACE_BASE::addModels( CONTAINER_3D& aDstContainer, const S3DMODEL* a3DModel,
const glm::mat4& aModelMatrix, float aFPOpacity,
bool aSkipMaterialInformation, BOARD_ITEM* aBoardItem )
{
@@ -42,15 +42,10 @@ void FRUSTUM::GenerateFrustum( const RAY& topLeft, const RAY& topRight, const RA
m_point[2] = bottomLeft.m_Origin;
m_point[3] = topLeft.m_Origin;
SFVEC3F tl_tr = topRight.m_Origin - topLeft.m_Origin;
SFVEC3F tr_br = bottomRight.m_Origin - topRight.m_Origin;
SFVEC3F br_bl = bottomLeft.m_Origin - bottomRight.m_Origin;
SFVEC3F bl_tl = topLeft.m_Origin - bottomLeft.m_Origin;
m_normals[0] = glm::cross( tl_tr, topLeft.m_Dir ); // TOP
m_normals[1] = glm::cross( tr_br, topRight.m_Dir ); // RIGHT
m_normals[2] = glm::cross( br_bl, bottomRight.m_Dir ); // BOTTOM
m_normals[3] = glm::cross( bl_tl, bottomLeft.m_Dir ); // LEFT
m_normals[0] = glm::cross( topRight.m_Dir, topLeft.m_Dir ); // TOP
m_normals[1] = glm::cross( bottomRight.m_Dir, topRight.m_Dir ); // RIGHT
m_normals[2] = glm::cross( bottomLeft.m_Dir, bottomRight.m_Dir ); // BOTTOM
m_normals[3] = glm::cross( topLeft.m_Dir, bottomLeft.m_Dir ); // LEFT
}
@@ -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-2021 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -22,10 +22,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef RENDER_3D_RAYTRACE_H
#define RENDER_3D_RAYTRACE_H
#ifndef RENDER_3D_RAYTRACE_BASE_H
#define RENDER_3D_RAYTRACE_BASE_H
#include "../../common_ogl/openGL_includes.h"
#include "accelerators/container_3d.h"
#include "accelerators/accelerator_3d.h"
#include "../render_3d_base.h"
@@ -52,19 +51,16 @@ typedef enum
} RT_RENDER_STATE;
class RENDER_3D_RAYTRACE : public RENDER_3D_BASE
class RENDER_3D_RAYTRACE_BASE : 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( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera );
explicit RENDER_3D_RAYTRACE_BASE( BOARD_ADAPTER& aAdapter, CAMERA& aCamera );
~RENDER_3D_RAYTRACE();
void SetCurWindowSize( const wxSize& aSize ) override;
bool Redraw( bool aIsMoving, REPORTER* aStatusReporter, REPORTER* aWarningReporter ) override;
~RENDER_3D_RAYTRACE_BASE();
int GetWaitForEditingTimeOut() override;
@@ -73,11 +69,9 @@ public:
BOARD_ITEM *IntersectBoardItem( const RAY& aRay );
private:
bool initializeOpenGL();
void initializeNewWindowSize();
void initPbo();
void deletePbo();
protected:
virtual void initPbo() = 0;
virtual void deletePbo() = 0;
void createItemsFromContainer( const BVH_CONTAINER_2D* aContainer2d, PCB_LAYER_ID aLayer_id,
const MATERIAL* aMaterialLayer, const SFVEC3F& aLayerColor,
float aLayerZOffset );
@@ -87,20 +81,20 @@ private:
void postProcessShading( GLubyte* ptrPBO, REPORTER* aStatusReporter );
void postProcessBlurFinish( GLubyte* ptrPBO, REPORTER* aStatusReporter );
void renderBlockTracing( GLubyte* ptrPBO , signed int iBlock );
void renderFinalColor( GLubyte* ptrPBO, const SFVEC3F& rgbColor,
void renderFinalColor( GLubyte* ptrPBO, const SFVEC4F& rgbColor,
bool applyColorSpaceConversion );
void renderRayPackets( const SFVEC3F* bgColorY, const RAY* aRayPkt, HITINFO_PACKET* aHitPacket,
bool is_testShadow, SFVEC3F* aOutHitColor );
void renderRayPackets( const SFVEC4F* bgColorY, const RAY* aRayPkt, HITINFO_PACKET* aHitPacket,
bool is_testShadow, SFVEC4F* aOutHitColor );
void renderAntiAliasPackets( const SFVEC3F* aBgColorY, const HITINFO_PACKET* aHitPck_X0Y0,
void renderAntiAliasPackets( const SFVEC4F* aBgColorY, const HITINFO_PACKET* aHitPck_X0Y0,
const HITINFO_PACKET* aHitPck_AA_X1Y1, const RAY* aRayPck,
SFVEC3F* aOutHitColor );
SFVEC4F* aOutHitColor );
// Materials
void setupMaterials();
SFVEC3F shadeHit( const SFVEC3F& aBgColor, const RAY& aRay, HITINFO& aHitInfo,
SFVEC4F shadeHit( const SFVEC4F& aBgColor, const RAY& aRay, HITINFO& aHitInfo,
bool aIsInsideObject, unsigned int aRecursiveLevel,
bool is_testShadow ) const;
@@ -128,6 +122,8 @@ private:
void render( GLubyte* ptrPBO, REPORTER* aStatusReporter );
void renderPreview( GLubyte* ptrPBO );
static SFVEC4F premultiplyAlpha( const SFVEC4F& aInput );
struct
{
BLINN_PHONG_MATERIAL m_Paste;
@@ -148,6 +144,7 @@ private:
BRUSHED_METAL_NORMAL m_brushedMetalMaterial;
SILK_SCREEN_NORMAL m_silkScreenMaterial;
bool m_is_canvas_initialized;
bool m_isPreview;
/// State used on quality render
@@ -165,10 +162,8 @@ private:
DIRECTIONAL_LIGHT* m_cameraLight;
bool m_openglSupportsVertexBufferObjects;
GLuint m_pboId;
GLuint m_pboDataSize;
/*GLuint m_pboId;
GLuint m_pboDataSize;*/
CONTAINER_3D m_objectContainer;
@@ -180,8 +175,8 @@ private:
ACCELERATOR_3D* m_accelerator;
SFVEC3F m_backgroundColorTop;
SFVEC3F m_backgroundColorBottom;
SFVEC4F m_backgroundColorTop;
SFVEC4F m_backgroundColorBottom;
///< Used to see if the windows size changed.
wxSize m_oldWindowsSize;
@@ -218,8 +213,10 @@ private:
#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_H
#endif // RENDER_3D_RAYTRACE_BASE_H
@@ -0,0 +1,243 @@
/*
* 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" ) );
}
}
@@ -0,0 +1,54 @@
/*
* 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
@@ -0,0 +1,159 @@
/*
* 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]();
}
@@ -0,0 +1,58 @@
/*
* 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
+3 -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-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-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
@@ -44,13 +44,12 @@
const wxChar* RENDER_3D_BASE::m_logTrace = wxT( "KI_TRACE_3D_RENDER" );
RENDER_3D_BASE::RENDER_3D_BASE( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera ) :
RENDER_3D_BASE::RENDER_3D_BASE( BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera ) :
m_boardAdapter( aBoardAdapter ),
m_camera( aCamera )
{
wxLogTrace( m_logTrace, wxT( "RENDER_3D_BASE::RENDER_3D_BASE" ) );
m_canvas = aCanvas;
m_is_opengl_initialized = false;
m_canvasInitialized = false;
m_windowSize = wxSize( -1, -1 );
m_reloadRequested = true;
}
+4 -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) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-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
@@ -42,7 +42,7 @@
class RENDER_3D_BASE
{
public:
explicit RENDER_3D_BASE( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera );
explicit RENDER_3D_BASE( BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera );
virtual ~RENDER_3D_BASE() = 0;
@@ -98,16 +98,13 @@ 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 opengl specific for this render was already initialized.
bool m_is_opengl_initialized;
///< Flag if the canvas specific for this render was already initialized.
bool m_canvasInitialized;
///< @todo This must be reviewed in order to flag change types.
bool m_reloadRequested;
+17 -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) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -38,11 +38,24 @@
// 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 ) );
@@ -50,6 +63,7 @@ TRACK_BALL::TRACK_BALL( float aInitialDistance ) :
trackball( m_quat_t1, 0.0, 0.0, 0.0, 0.0 );
}
void TRACK_BALL::Drag( const wxPoint& aNewMousePosition )
{
m_parametersChanged = true;
+4 -1
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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -37,6 +37,7 @@ class TRACK_BALL : public CAMERA
{
public:
explicit TRACK_BALL( float aInitialDistance );
explicit TRACK_BALL( SFVEC3F aInitPos, SFVEC3F aLookat, PROJECTION_TYPE aProjectionType );
virtual ~TRACK_BALL()
{
@@ -57,6 +58,8 @@ public:
void Interpolate( float t ) override;
private:
void initQuat();
/**
* interpolate quaternions of the trackball
*/
+12 -14
View File
@@ -113,11 +113,11 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
SetStatusWidths( arrayDim( status_dims ), status_dims );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
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 ), m_boardAdapter,
m_currentCamera,
m_canvas = new EDA_3D_CANVAS( this, OGL_ATT_LIST::GetAttributesList( aaMode, true ),
m_boardAdapter, m_currentCamera,
PROJECT_PCB::Get3DCacheManager( &Prj() ) );
m_appearancePanel = new APPEARANCE_CONTROLS_3D( this, GetCanvas() );
@@ -479,7 +479,7 @@ void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
case ID_MENU3D_RESET_DEFAULTS:
{
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
cfg->ResetToDefaults();
LoadSettings( cfg );
@@ -561,8 +561,8 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
{
EDA_BASE_FRAME::LoadSettings( aCfg );
// Dynamic_cast here will fail on Mac when called from CvPCB.
EDA_3D_VIEWER_SETTINGS* cfg = static_cast<EDA_3D_VIEWER_SETTINGS*>( aCfg );
EDA_3D_VIEWER_SETTINGS* cfg = dynamic_cast<EDA_3D_VIEWER_SETTINGS*>( aCfg );
wxASSERT( cfg );
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::LoadSettings" ) );
@@ -570,9 +570,6 @@ 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
@@ -606,7 +603,7 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
void EDA_3D_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE *aCfg )
{
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
EDA_BASE_FRAME::SaveSettings( cfg );
@@ -642,7 +639,7 @@ void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTex
ReCreateMainToolbar();
loadCommonSettings();
applySettings( Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
applySettings( Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>() );
m_appearancePanel->CommonSettingsChanged();
@@ -661,8 +658,6 @@ 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 );
@@ -673,7 +668,7 @@ void EDA_3D_VIEWER_FRAME::ShowChangedLanguage()
void EDA_3D_VIEWER_FRAME::ToggleAppearanceManager()
{
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
// show auxiliary Vertical layers and visibility manager toolbar
@@ -815,6 +810,9 @@ void EDA_3D_VIEWER_FRAME::loadCommonSettings()
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
m_canvas->SetScaleFactor( dpi.GetScaleFactor() );
// TODO(JE) use all control options
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
}
+3 -2
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2023 CERN
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-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
@@ -23,7 +23,6 @@
#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>
@@ -34,6 +33,8 @@
#define FOLLOW_PLOT_SETTINGS wxT( "follow_plot_settings" )
#define LEGACY_PRESET_FLAG wxT( "legacy_preset_flag" )
enum class ANTIALIASING_MODE;
struct LAYER_PRESET_3D
{
+4 -2
View File
@@ -45,7 +45,9 @@ set(3D-VIEWER_SRCS
${DIR_RAY_ACC}/container_2d.cpp
${DIR_RAY}/PerlinNoise.cpp
${DIR_RAY}/create_scene.cpp
${DIR_RAY}/render_3d_raytrace.cpp
${DIR_RAY}/render_3d_raytrace_base.cpp
${DIR_RAY}/render_3d_raytrace_gl.cpp
${DIR_RAY}/render_3d_raytrace_ram.cpp
${DIR_RAY}/frustum.cpp
${DIR_RAY}/material.cpp
${DIR_RAY}/mortoncodes.cpp
@@ -71,7 +73,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_rgb.cpp
3d_rendering/color_rgba.cpp
3d_rendering/image.cpp
3d_rendering/post_shader.cpp
3d_rendering/post_shader_ssao.cpp
+26 -75
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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-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
@@ -33,94 +33,45 @@
#include <core/arraydim.h>
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 )
const wxGLAttributes OGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode,
bool aAlpha )
{
wxASSERT( aAntiAliasingMode <= ANTIALIASING_MODE::AA_8X );
memcpy( m_openGL_attributes_list_to_use, m_openGL_attributes_list,
sizeof( m_openGL_attributes_list_to_use ) );
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;
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( m_openGL_attributes_list_to_use ) )
if( wxGLCanvas::IsDisplaySupported( makeAttribs( 0 ) ) )
{
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.
int maxSamples = aaSamples[static_cast<int>( aAntiAliasingMode )];
maxSamples = aaSamples[static_cast<int>( aAntiAliasingMode )];
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 )
while( maxSamples > 0 && !wxGLCanvas::IsDisplaySupported( makeAttribs( maxSamples ) ) )
{
m_openGL_attributes_list_to_use[ATT_WX_GL_SAMPLES_OFFSET_DATA] = maxSamples;
maxSamples = maxSamples >> 1;
}
}
else
{
aAntiAliasingMode = ANTIALIASING_MODE::AA_NONE;
}
}
// 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;
return makeAttribs( maxSamples );
}
+8 -23
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-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-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
@@ -30,6 +30,8 @@
#ifndef _OGL_ATT_LIST_H
#define _OGL_ATT_LIST_H
#include <wx/glcanvas.h>
/// Anti-aliasing options
enum class ANTIALIASING_MODE
{
@@ -51,29 +53,12 @@ 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
* @return a list of options to be passed in the creation of a EDA_3D_CANVAS class
* 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
*/
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[];
static const wxGLAttributes GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode,
bool aAlpha = false );
};
#endif // _OGL_ATT_LIST_H
+32 -7
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 * 3 );
unsigned char* pixelbuffer = (unsigned char*) malloc( viewport.x * viewport.y * 4 );
// Call glFinish before screenshot to ensure everything is fully drawn.
glFinish();
@@ -54,15 +54,40 @@ void OglGetScreenshot( wxImage& aDstImage )
glPixelStorei( GL_PACK_ALIGNMENT, 1 );
glReadBuffer( GL_BACK_LEFT );
glReadPixels( viewport.originX, viewport.originY, viewport.x, viewport.y, GL_RGB,
glReadPixels( viewport.originX, viewport.originY, viewport.x, viewport.y, GL_RGBA,
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( pixelbuffer, viewport.x, viewport.y, false );
aDstImage.SetData( rgbBuffer, viewport.x, viewport.y, false );
aDstImage.SetAlpha( alphaBuffer, false );
free( pixelbuffer );
aDstImage = aDstImage.Mirror( false );
}
@@ -157,7 +182,7 @@ void OglSetDiffuseMaterial( const SFVEC3F &aMaterialDiffuse, float aOpacity,
}
void OglDrawBackground( const SFVEC3F& aTopColor, const SFVEC3F& aBotColor )
void OglDrawBackground( const SFVEC4F& aTopColor, const SFVEC4F& aBotColor )
{
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
@@ -173,14 +198,14 @@ void OglDrawBackground( const SFVEC3F& aTopColor, const SFVEC3F& aBotColor )
glDisable( GL_ALPHA_TEST );
glBegin( GL_QUADS );
glColor4f( aTopColor.x, aTopColor.y, aTopColor.z, 1.0f );
glColor4f( aTopColor.r, aTopColor.g, aTopColor.b, aTopColor.a );
glVertex2f( -1.0, 1.0 ); // Top left corner
glColor4f( aBotColor.x, aBotColor.y, aBotColor.z, 1.0f );
glColor4f( aBotColor.r, aBotColor.g, aBotColor.b, aBotColor.a );
glVertex2f( -1.0,-1.0 ); // bottom left corner
glVertex2f( 1.0,-1.0 ); // bottom right corner
glColor4f( aTopColor.x, aTopColor.y, aTopColor.z, 1.0f );
glColor4f( aTopColor.r, aTopColor.g, aTopColor.b, aTopColor.a);
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 SFVEC3F& aTopColor, const SFVEC3F& aBotColor );
void OglDrawBackground( const SFVEC4F& aTopColor, const SFVEC4F& aBotColor );
/**
* Reset to default state the texture settings.
+13 -2
View File
@@ -160,11 +160,14 @@ APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent,
m_toggleGridRenderer = new GRID_BITMAP_TOGGLE_RENDERER( KiBitmap( BITMAPS::visibility ),
KiBitmap( BITMAPS::visibility_off ) );
m_frame->Bind( EDA_LANG_CHANGED, &APPEARANCE_CONTROLS_3D::OnLanguageChanged, this );
}
APPEARANCE_CONTROLS_3D::~APPEARANCE_CONTROLS_3D()
{
m_frame->Unbind( EDA_LANG_CHANGED, &APPEARANCE_CONTROLS_3D::OnLanguageChanged, this );
}
@@ -199,7 +202,7 @@ void APPEARANCE_CONTROLS_3D::OnSize( wxSizeEvent& aEvent )
}
void APPEARANCE_CONTROLS_3D::OnLanguageChanged()
void APPEARANCE_CONTROLS_3D::rebuildControls()
{
Freeze();
@@ -213,6 +216,14 @@ void APPEARANCE_CONTROLS_3D::OnLanguageChanged()
}
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
@@ -236,7 +247,7 @@ void APPEARANCE_CONTROLS_3D::OnDarkModeToggle()
void APPEARANCE_CONTROLS_3D::CommonSettingsChanged()
{
OnLanguageChanged();
rebuildControls();
UpdateLayerCtls();
syncLayerPresetSelection();
+3 -2
View File
@@ -114,8 +114,6 @@ public:
~APPEARANCE_CONTROLS_3D();
wxSize GetBestSize() const;
void OnLanguageChanged();
void OnDarkModeToggle();
void OnLayerVisibilityChanged( int aLayer, bool isVisible );
@@ -140,8 +138,11 @@ public:
protected:
void OnSetFocus( wxFocusEvent& aEvent ) override;
void OnSize( wxSizeEvent& aEvent ) override;
void OnLanguageChanged( wxCommandEvent& aEvent );
private:
void rebuildControls();
void rebuildLayers();
void rebuildLayerPresetsWidget();
+15 -65
View File
@@ -41,11 +41,10 @@
#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 ) :
@@ -125,10 +124,8 @@ 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_spaceMouse = new NL_FOOTPRINT_PROPERTIES_PLUGIN( m_previewPane );
m_spaceMouse->SetFocus( true );
m_boardAdapter, m_currentCamera,
PROJECT_PCB::Get3DCacheManager( &aFrame->Prj() ) );
m_boardAdapter.SetBoard( m_dummyBoard );
m_boardAdapter.m_IsBoardView = false;
@@ -166,28 +163,6 @@ 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
}
@@ -197,7 +172,6 @@ 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;
}
@@ -218,10 +192,13 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings()
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
// TODO(JE) use all control options
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
auto* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
if( cfg )
{
@@ -449,15 +426,10 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementScale( wxSpinEvent& event, double aSign
else if( spinCtrl == m_spinZscale )
textCtrl = zscale;
double step = SCALE_INCREMENT;
if( wxGetMouseState().ShiftDown( ) )
step = SCALE_INCREMENT_FINE;
double curr_value = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::UNSCALED,
textCtrl->GetValue() );
curr_value += ( step * aSign );
curr_value += ( SCALE_INCREMENT * aSign );
curr_value = std::max( 1/MAX_SCALE, curr_value );
curr_value = std::min( curr_value, MAX_SCALE );
@@ -475,15 +447,10 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementRotation( wxSpinEvent& aEvent, double aS
else if( spinCtrl == m_spinZrot )
textCtrl = zrot;
double step = ROTATION_INCREMENT;
if( wxGetMouseState().ShiftDown( ) )
step = ROTATION_INCREMENT_FINE;
double curr_value = EDA_UNIT_UTILS::UI::DoubleValueFromString( unityScale, EDA_UNITS::DEGREES,
textCtrl->GetValue() );
curr_value += ( step * aSign );
curr_value += ( ROTATION_INCREMENT * aSign );
curr_value = std::max( -MAX_ROTATION, curr_value );
curr_value = std::min( curr_value, MAX_ROTATION );
@@ -503,22 +470,16 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign
textCtrl = zoff;
double step_mm = OFFSET_INCREMENT_MM;
if( wxGetMouseState().ShiftDown( ) )
step_mm = OFFSET_INCREMENT_MM_FINE;
double curr_value_mm =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, m_userUnits,
textCtrl->GetValue() )
/ pcbIUScale.IU_PER_MM;
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
{
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
if( wxGetMouseState().ShiftDown( ) )
step_mm = 25.4*OFFSET_INCREMENT_MIL_FINE/1000;;
}
double curr_value_mm = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, m_userUnits,
textCtrl->GetValue() )
/ pcbIUScale.IU_PER_MM;
curr_value_mm += ( step_mm * aSign );
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
@@ -554,10 +515,10 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelRot( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
double step = ROTATION_INCREMENT;
double step = ROTATION_INCREMENT_WHEEL;
if( event.ShiftDown( ) )
step = ROTATION_INCREMENT_FINE;
step = ROTATION_INCREMENT_WHEEL_FINE;
if( event.GetWheelRotation() >= 0 )
step = -step;
@@ -628,17 +589,6 @@ 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();
+3 -8
View File
@@ -34,7 +34,6 @@
#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
@@ -44,8 +43,9 @@
#define SCALE_INCREMENT_FINE 0.02
#define SCALE_INCREMENT 0.1
#define ROTATION_INCREMENT 90 // in degrees
#define ROTATION_INCREMENT_FINE 1 // in degrees
#define ROTATION_INCREMENT 90 // in degrees, for spin button command
#define ROTATION_INCREMENT_WHEEL 90 // in degrees, for mouse wheel command
#define ROTATION_INCREMENT_WHEEL_FINE 1 // in degrees, for mouse wheel command
#define OFFSET_INCREMENT_MM 0.5
#define OFFSET_INCREMENT_MM_FINE 0.1
@@ -53,7 +53,6 @@
#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;
@@ -62,7 +61,6 @@ 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
{
@@ -142,7 +140,6 @@ private:
void doIncrementOffset( wxSpinEvent& aEvent, double aSign );
void onUnitsChanged( wxCommandEvent& aEvent );
void onPanelShownEvent( wxCommandEvent& aEvent );
wxString formatScaleValue( double aValue );
wxString formatRotationValue( double aValue );
@@ -215,8 +212,6 @@ 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,10 +1,12 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006)
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/std_bitmap_button.h"
#include "panel_preview_3d_model_base.h"
///////////////////////////////////////////////////////////////////////////
@@ -21,7 +23,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, 2, 3 );
fgSizerScale = new wxFlexGridSizer( 0, 3, 1, 3 );
fgSizerScale->AddGrowableCol( 1 );
fgSizerScale->SetFlexibleDirection( wxBOTH );
fgSizerScale->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@@ -57,16 +59,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, 5 );
sbSizerScale->Add( fgSizerScale, 0, wxBOTTOM|wxEXPAND|wxRIGHT, 2 );
bSizerLeft->Add( sbSizerScale, 0, wxLEFT|wxRIGHT|wxEXPAND, 5 );
bSizerLeft->Add( sbSizerScale, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbSizerRotation;
sbSizerRotation = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Rotation") ), wxVERTICAL );
wxFlexGridSizer* fgSizerRotate;
fgSizerRotate = new wxFlexGridSizer( 0, 3, 2, 3 );
fgSizerRotate = new wxFlexGridSizer( 0, 3, 1, 3 );
fgSizerRotate->AddGrowableCol( 1 );
fgSizerRotate->SetFlexibleDirection( wxBOTH );
fgSizerRotate->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@@ -102,7 +104,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, 5 );
sbSizerRotation->Add( fgSizerRotate, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 2 );
bSizerLeft->Add( sbSizerRotation, 0, wxLEFT|wxRIGHT|wxEXPAND, 5 );
@@ -111,7 +113,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, 2, 3 );
fgSizerOffset = new wxFlexGridSizer( 0, 3, 1, 3 );
fgSizerOffset->AddGrowableCol( 1 );
fgSizerOffset->SetFlexibleDirection( wxBOTH );
fgSizerOffset->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@@ -147,7 +149,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, 5 );
sbSizerOffset->Add( fgSizerOffset, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 2 );
bSizerLeft->Add( sbSizerOffset, 0, wxLEFT|wxRIGHT|wxEXPAND, 5 );
@@ -155,8 +157,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|wxSL_LABELS );
sbSizer4->Add( m_opacity, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_opacity = new wxSlider( sbSizer4->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
sbSizer4->Add( m_opacity, 0, wxRIGHT|wxLEFT, 2 );
bSizerLeft->Add( sbSizer4, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@@ -174,7 +176,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|wxLEFT|wxRIGHT, 10 );
bSizer6->Add( m_previewLabel, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizerRight->Add( bSizer6, 0, wxEXPAND, 5 );
@@ -193,53 +195,53 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
bSizer3DButtons->Add( 0, 10, 0, 0, 5 );
m_bpvISO = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvISO = new STD_BITMAP_BUTTON( 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 wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvBodyStyle = new STD_BITMAP_BUTTON( 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|wxBOTTOM, 5 );
bSizer3DButtons->Add( m_bpvBodyStyle, 0, wxTOP, 5 );
bSizer3DButtons->Add( 0, 0, 1, wxEXPAND, 5 );
m_bpvLeft = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvLeft = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvLeft, 0, wxBOTTOM, 5 );
m_bpvRight = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvRight = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvRight, 0, wxBOTTOM, 5 );
m_bpvFront = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvFront = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvFront, 0, wxBOTTOM, 5 );
m_bpvBack = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvBack = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvBack, 0, wxBOTTOM, 5 );
m_bpvTop = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvTop = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpvTop, 0, wxBOTTOM, 5 );
m_bpvBottom = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpvBottom = new STD_BITMAP_BUTTON( 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 wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpUpdate = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
m_bpUpdate->SetToolTip( _("Reload board and 3D models") );
bSizer3DButtons->Add( m_bpUpdate, 0, wxBOTTOM, 5 );
bSizer3DButtons->Add( m_bpUpdate, 0, wxTOP, 5 );
m_bpSettings = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
bSizer3DButtons->Add( m_bpSettings, 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 );
bSizer3DButtons->Add( 0, 10, 0, 0, 5 );
bSizermain->Add( bSizer3DButtons, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
bSizermain->Add( bSizer3DButtons, 0, wxEXPAND|wxTOP, 5 );
this->SetSizer( bSizermain );
File diff suppressed because it is too large Load Diff
+13 -11
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006)
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -10,6 +10,8 @@
#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>
@@ -68,16 +70,16 @@ class PANEL_PREVIEW_3D_MODEL_BASE : public wxPanel
wxSlider* m_opacity;
wxStaticText* m_previewLabel;
wxBoxSizer* m_SizerPanelView;
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;
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;
// Virtual event handlers, override them in your derived class
virtual void onMouseWheelScale( wxMouseEvent& event ) { event.Skip(); }
+1
View File
@@ -51,6 +51,7 @@ 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
+48 -6
View File
@@ -160,6 +160,17 @@ 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
####################################
@@ -247,6 +258,10 @@ option( KICAD_GAL_PROFILE
"Enable profiling info for GAL"
OFF )
option( KICAD_IPC_API
"Enable experimental IPC API"
OFF )
# Global setting: exports are explicit
set( CMAKE_CXX_VISIBILITY_PRESET "hidden" )
set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
@@ -254,8 +269,8 @@ set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
# Global setting: build everything position independent
set( CMAKE_POSITION_INDEPENDENT_CODE ON )
# Global setting: Use C++17
set(CMAKE_CXX_STANDARD 17)
# Global setting: Use C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -278,6 +293,10 @@ 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> )
@@ -573,9 +592,6 @@ if( MSVC )
if( KICAD_WIN32_BUILD_PARALLEL_CL_MP )
string( APPEND CMAKE_CXX_FLAGS " /MP" )
endif()
set( CMAKE_INSTALL_UCRT_LIBRARIES TRUE )
include( InstallRequiredSystemLibraries )
endif()
# KIFACE_SUFFIX is the file extension used for top level program modules which
@@ -845,6 +861,27 @@ 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.
@@ -1054,6 +1091,10 @@ if( KICAD_USE_SENTRY )
add_compile_definitions( KICAD_USE_SENTRY )
endif()
if( KICAD_IPC_API )
find_package( nng REQUIRED )
endif()
#================================================
# Add the doxygen target
#================================================
@@ -1092,6 +1133,7 @@ list( APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure" )
#================================================
# Binaries ( CMake targets )
add_subdirectory( api )
add_subdirectory( resources )
add_subdirectory( thirdparty )
add_subdirectory( libs )
@@ -1106,7 +1148,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
add_subdirectory( kicad ) # should follow pcbnew, eeschema, api
add_subdirectory( tools )
add_subdirectory( utils )
+56
View File
@@ -0,0 +1,56 @@
{
"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
@@ -0,0 +1,133 @@
# 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
@@ -0,0 +1,116 @@
/*
* 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
@@ -0,0 +1,151 @@
/*
* 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;
}
+487
View File
@@ -0,0 +1,487 @@
/*
* 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;
}
enum PadStackType
{
PST_UNKNOWN = 0;
PST_THROUGH = 1; // Through all layers; same shape on all layers
PST_BLIND_BURIED = 2; // From a start layer to end layer (inclusive); same shape on all included layers
}
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
float 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
float chamfer_ratio = 5;
ChamferedRectCorners chamfered_corners = 6;
repeated GraphicShape custom_shapes = 7;
}
// 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;
}
// 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. The via's VIATYPE (blind/buried/normal) is inferred from this.
PadStack pad_stack = 3;
kiapi.common.types.LockedState locked = 4;
Net net = 5;
}
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,7 +1,6 @@
/*
* 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
@@ -18,28 +17,22 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nl_footprint_properties_plugin.h"
#include "nl_footprint_properties_plugin_impl.h"
#include <advanced_config.h>
#include <kiplatform/drivers.h>
syntax = "proto3";
package kiapi.common.commands;
NL_FOOTPRINT_PROPERTIES_PLUGIN::NL_FOOTPRINT_PROPERTIES_PLUGIN( EDA_3D_CANVAS* aViewport )
import "common/types/base_types.proto";
message GetVersion
{
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
{
m_impl = std::make_unique<NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL>( aViewport );
m_impl->Connect();
}
}
NL_FOOTPRINT_PROPERTIES_PLUGIN::~NL_FOOTPRINT_PROPERTIES_PLUGIN() = default;
void NL_FOOTPRINT_PROPERTIES_PLUGIN::SetFocus( bool focus )
message GetVersionResponse
{
kiapi.common.types.KiCadVersion version = 1;
}
// A command to check if the connection to KiCad is OK
message Ping
{
if( m_impl )
m_impl->SetFocus( focus );
}
@@ -0,0 +1,299 @@
/*
* 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;
}
@@ -1,8 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 3Dconnexion
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
* 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
@@ -18,35 +17,18 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nl_gerbview_plugin.h"
#include "nl_gerbview_plugin_impl.h"
syntax = "proto3";
#include <advanced_config.h>
#include <kiplatform/drivers.h>
package kiapi.common.commands;
import "common/types/project_settings.proto";
NL_GERBVIEW_PLUGIN::NL_GERBVIEW_PLUGIN()
message GetNetClasses
{
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
{
m_impl = std::make_unique<NL_GERBVIEW_PLUGIN_IMPL>();
}
}
NL_GERBVIEW_PLUGIN::~NL_GERBVIEW_PLUGIN() = default;
void NL_GERBVIEW_PLUGIN::SetFocus( bool focus )
message NetClassesResponse
{
if( m_impl )
m_impl->SetFocus( focus );
}
void NL_GERBVIEW_PLUGIN::SetCanvas( EDA_DRAW_PANEL_GAL* aViewport )
{
if( m_impl )
m_impl->SetCanvas( aViewport );
repeated kiapi.common.project.NetClass net_classes = 1;
}
+92
View File
@@ -0,0 +1,92 @@
/*
* 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
@@ -0,0 +1,334 @@
/*
* 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
@@ -0,0 +1,119 @@
/*
* 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;
}
@@ -0,0 +1,35 @@
/*
* 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;
}
@@ -0,0 +1,24 @@
/*
* 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
@@ -0,0 +1,75 @@
/*
* 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,6 +52,7 @@ add_executable( bitmap2component WIN32 MACOSX_BUNDLE
target_link_libraries( bitmap2component
common
kicommon
${wxWidgets_LIBRARIES}
potrace
)
+1 -2
View File
@@ -138,7 +138,7 @@ void IMAGE_SIZE::SetUnit( EDA_UNITS aUnit )
}
BEGIN_EVENT_TABLE( BITMAP2CMP_FRAME, KIWAY_PLAYER )
BEGIN_EVENT_TABLE( BITMAP2CMP_FRAME, EDA_BASE_FRAME )
EVT_MENU( wxID_CLOSE, BITMAP2CMP_FRAME::OnExit )
EVT_MENU( wxID_EXIT, BITMAP2CMP_FRAME::OnExit )
@@ -193,7 +193,6 @@ BITMAP2CMP_FRAME::BITMAP2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_toolManager->InitTools();
ReCreateMenuBar();
setupUIConditions();
GetSizer()->SetSizeHints( this );
-19
View File
@@ -69,8 +69,6 @@ static struct IFACE : public KIFACE_BASE
using namespace BMP2CMP;
static PGM_BASE* process;
KIFACE_BASE& Kiface()
{
@@ -82,27 +80,10 @@ 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 -1
View File
@@ -37,7 +37,7 @@ unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
set(_PYTHON3_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
# Disabling the "search every possible place" code for now
# see https://gitlab.com/kicad/code/kicad/-/issues/8553
+1 -1
View File
@@ -44,7 +44,7 @@ cmake_find_frameworks(Python)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
set(_PYTHON3_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
if(PythonLibs_FIND_VERSION)
if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+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.2 swig4.1 swig4.0 swig3.0 swig2.0 swig)
find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
if(SWIG_EXECUTABLE)
execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
+26
View File
@@ -0,0 +1,26 @@
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)
+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-2024 KiCad Developers, see AUTHORS.txt for contributors.
# Copyright (C) 2016-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
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "8.0.9-unknown" )
set( KICAD_SEMANTIC_VERSION "8.99.0-unknown" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+2
View File
@@ -272,4 +272,6 @@ 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()
+115 -69
View File
@@ -41,24 +41,11 @@ 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.
@@ -88,6 +75,7 @@ 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
@@ -96,45 +84,110 @@ 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
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
@@ -150,8 +203,25 @@ 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})
@@ -191,7 +261,10 @@ 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 )
@@ -239,8 +312,6 @@ 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
@@ -275,6 +346,8 @@ 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
@@ -290,7 +363,6 @@ 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
@@ -311,7 +383,6 @@ 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
@@ -325,7 +396,6 @@ 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
@@ -444,17 +514,12 @@ 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
@@ -468,7 +533,6 @@ set( COMMON_SRCS
eda_text.cpp
eda_tools.cpp
env_paths.cpp
env_vars.cpp
executable_names.cpp
filename_resolver.cpp
file_history.cpp
@@ -476,38 +540,27 @@ 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
@@ -518,16 +571,6 @@ 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}
@@ -561,24 +604,7 @@ 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
@@ -589,13 +615,21 @@ 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}
)
@@ -635,28 +669,32 @@ 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
@@ -682,6 +720,8 @@ set( PCB_COMMON_SRCS
${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
@@ -742,6 +782,12 @@ 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"
+11 -14
View File
@@ -100,6 +100,7 @@ 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" );
@@ -109,10 +110,10 @@ 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 MinParallelAngle[] = wxT( "MinParallelAngle" );
static const wxChar ResolveTextRecursionDepth[] = wxT( "ResolveTextRecursionDepth" );
static const wxChar EnableAPILogging[] = wxT( "EnableAPILogging" );
} // namespace KEYS
/**
* List of known groups for advanced configuration options.
*
@@ -236,6 +237,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_ShowRepairSchematic = false;
m_EnableGenerators = false;
m_EnableGit = false;
m_EnableLibWithText = false;
m_EnableEeschemaPrintCairo = true;
@@ -243,6 +245,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_3DRT_BevelExtentFactor = 1.0 / 16.0;
m_UseClipper2 = true;
m_EnableAPILogging = false;
m_Use3DConnexionDriver = true;
@@ -262,10 +265,6 @@ ADVANCED_CFG::ADVANCED_CFG()
m_EnableCacheFriendlyFracture = true;
m_MinParallelAngle = 0.001;
m_ResolveTextRecursionDepth = 3;
loadFromConfigFile();
}
@@ -447,9 +446,15 @@ 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 ) );
@@ -482,14 +487,6 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_EnableCacheFriendlyFracture,
m_EnableCacheFriendlyFracture ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinParallelAngle,
&m_MinParallelAngle, m_MinParallelAngle,
0.0, 45.0 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::ResolveTextRecursionDepth,
&m_ResolveTextRecursionDepth,
m_ResolveTextRecursionDepth, 0, 10 ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
wxString traceMasks;
+426
View File
@@ -0,0 +1,426 @@
/*
* 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
@@ -0,0 +1,61 @@
/*
* 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
@@ -0,0 +1,82 @@
/*
* 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
@@ -0,0 +1,353 @@
/*
* 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
@@ -0,0 +1,332 @@
/*
* 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
@@ -0,0 +1,420 @@
/*
* 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
@@ -0,0 +1,274 @@
/*
* 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
@@ -0,0 +1,135 @@
/*
* 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 -6
View File
@@ -182,7 +182,7 @@ BACKGROUND_JOB_REPORTER::BACKGROUND_JOB_REPORTER( BACKGROUND_JOBS_MONITOR* aMoni
bool BACKGROUND_JOB_REPORTER::updateUI()
{
return !m_cancelled;
return true;
}
@@ -265,11 +265,7 @@ void BACKGROUND_JOBS_MONITOR::Remove( std::shared_ptr<BACKGROUND_JOB> aJob )
return job == aJob;
} ) );
if( m_jobs.size() > 0 )
{
jobUpdated( m_jobs.front() );
}
else
if( m_jobs.size() == 0 )
{
for( KISTATUSBAR* statusBar : m_statusBars )
{
+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() << wxS( ">\n" );
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";
}
#endif
+58 -80
View File
@@ -524,17 +524,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_24.png" ), 24, wxT( "light" ) );
@@ -763,6 +755,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_dark_24.png" ), 24, wxT( "dark" ) );
@@ -934,17 +930,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_24.png" ), 24, wxT( "dark" ) );
@@ -1173,6 +1161,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_16.png" ), 16, wxT( "light" ) );
@@ -1344,17 +1336,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_16.png" ), 16, wxT( "light" ) );
@@ -1583,6 +1567,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_dark_16.png" ), 16, wxT( "dark" ) );
@@ -1754,17 +1742,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_16.png" ), 16, wxT( "dark" ) );
@@ -1993,6 +1973,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_32.png" ), 32, wxT( "light" ) );
@@ -2164,17 +2148,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_32.png" ), 32, wxT( "light" ) );
@@ -2403,6 +2379,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_dark_32.png" ), 32, wxT( "dark" ) );
@@ -2574,17 +2554,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_32.png" ), 32, wxT( "dark" ) );
@@ -2813,6 +2785,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_48.png" ), 48, wxT( "light" ) );
@@ -2984,17 +2960,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_48.png" ), 48, wxT( "light" ) );
@@ -3223,6 +3191,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_dark_48.png" ), 48, wxT( "dark" ) );
@@ -3394,17 +3366,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_48.png" ), 48, wxT( "dark" ) );
@@ -3633,6 +3597,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_64.png" ), 64, wxT( "light" ) );
@@ -3804,17 +3772,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_64.png" ), 64, wxT( "light" ) );
@@ -4043,6 +4003,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::about].emplace_back( BITMAPS::about, wxT( "about_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_aligned_dimension].emplace_back( BITMAPS::add_aligned_dimension, wxT( "add_aligned_dimension_dark_64.png" ), 64, wxT( "dark" ) );
@@ -4214,17 +4178,9 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_64.png" ), 64, wxT( "dark" ) );
@@ -4453,6 +4409,10 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::zoom_center_on_screen].emplace_back( BITMAPS::zoom_center_on_screen, wxT( "zoom_center_on_screen_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in].emplace_back( BITMAPS::zoom_in, wxT( "zoom_in_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out].emplace_back( BITMAPS::zoom_out, wxT( "zoom_out_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_horizontally].emplace_back( BITMAPS::zoom_in_horizontally, wxT( "zoom_in_horizontally_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_horizontally].emplace_back( BITMAPS::zoom_out_horizontally, wxT( "zoom_out_horizontally_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_in_vertically].emplace_back( BITMAPS::zoom_in_vertically, wxT( "zoom_in_vertically_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_out_vertically].emplace_back( BITMAPS::zoom_out_vertically, wxT( "zoom_out_vertically_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::zoom_selection].emplace_back( BITMAPS::zoom_selection, wxT( "zoom_selection_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_32].emplace_back( BITMAPS::icon_bitmap2component_32, wxT( "icon_bitmap2component_32_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_32].emplace_back( BITMAPS::icon_eeschema_32, wxT( "icon_eeschema_32_32.png" ), 32, wxT( "light" ) );
@@ -4474,6 +4434,24 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_32].emplace_back( BITMAPS::icon_pagelayout_editor_32, wxT( "icon_pagelayout_editor_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_32].emplace_back( BITMAPS::icon_pcbcalculator_32, wxT( "icon_pcbcalculator_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_32].emplace_back( BITMAPS::icon_pcbnew_32, wxT( "icon_pcbnew_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb].emplace_back( BITMAPS::icon_cvpcb, wxT( "icon_cvpcb_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema].emplace_back( BITMAPS::icon_eeschema, wxT( "icon_eeschema_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview].emplace_back( BITMAPS::icon_gerbview, wxT( "icon_gerbview_64.png" ), 64, wxT( "light" ) );
+17 -21
View File
@@ -51,19 +51,6 @@ extern std::string GetCurlLibVersion();
#include <kicad_build_version.h>
#undef INCLUDE_KICAD_VERSION
// Remember OpenGL info
static wxString s_glVendor;
static wxString s_glRenderer;
static wxString s_glVersion;
void SetOpenGLInfo( const char* aVendor, const char* aRenderer, const char* aVersion )
{
s_glVendor = wxString::FromUTF8( aVendor );
s_glRenderer = wxString::FromUTF8( aRenderer );
s_glVersion = wxString::FromUTF8( aVersion );
}
wxString GetPlatformGetBitnessName()
{
wxPlatformInfo platform;
@@ -213,12 +200,6 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
<< ", " << wxGetenv( "XDG_SESSION_TYPE" );
#endif
if( !s_glVendor.empty() || !s_glRenderer.empty() || !s_glVersion.empty() )
{
aMsg << eol;
aMsg << "OpenGL: " << s_glVendor << ", " << s_glRenderer << ", " << s_glVersion;
}
aMsg << eol << eol;
if( !aBrief )
@@ -286,10 +267,11 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
aMsg << " without C++ ABI" << eol;
#endif
aMsg << eol;
// Add build settings config (build options):
#if defined( KICAD_USE_EGL ) || ! defined( NDEBUG )
aMsg << eol;
aMsg << "Build settings:" << eol;
#endif
#ifdef KICAD_USE_EGL
aMsg << indent4 << "KICAD_USE_EGL=" << ON;
@@ -324,5 +306,19 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
#endif
#endif
wxLocale* locale = wxGetLocale();
if( locale )
{
aMsg << eol;
aMsg << "Locale: " << eol;
aMsg << indent4 << "Lang: " << locale->GetCanonicalName() << eol;
aMsg << indent4 << "Enc: " << locale->GetSystemEncodingName() << eol;
aMsg << indent4 << "Num: "
<< wxString::Format( "%d%s%.1f", 1,
locale->GetInfo( wxLocaleInfo::wxLOCALE_THOUSANDS_SEP ), 234.5 )
<< eol;
}
return aMsg;
}
-3
View File
@@ -162,9 +162,6 @@ void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BAS
ent.m_copy = aCopy;
ent.m_screen = aScreen;
// N.B. Do not throw an assertion for multiple changed items. An item can be changed multiple times
// in a single commit such as when importing graphics and grouping them.
m_changedItems.insert( aItem );
m_changes.push_back( ent );
}

Some files were not shown because too many files have changed in this diff Show More