Compare commits

..

745 Commits

Author SHA1 Message Date
Wayne Stambaugh 5526fba124 Tag stable version 9.0.2 release. 2025-05-06 13:42:59 -04:00
Alex Shvartzkop cceafd5e7d Update translations 2025-05-06 12:53:16 +03:00
dsa-t 4044ed65cd Translated using Weblate (Russian)
Currently translated at 100.0% (10016 of 10016 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-05-06 11:51:58 +02:00
Pferd O a13dbf8cf4 Translated using Weblate (German)
Currently translated at 99.5% (9971 of 10016 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-05-06 11:51:57 +02:00
Henrik Kauhanen 2f42a85724 Translated using Weblate (Swedish)
Currently translated at 99.9% (10006 of 10016 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-05-06 11:51:57 +02:00
ZbeeGin 154c52defd Translated using Weblate (Polish)
Currently translated at 100.0% (10016 of 10016 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-05-06 11:51:57 +02:00
2tama3 fc518c5584 Translated using Weblate (Japanese)
Currently translated at 100.0% (10016 of 10016 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-05-06 11:51:57 +02:00
Mike Williams a7a7e963c9 bom export: don't break column order on mismatched column counts
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20520
2025-05-05 13:54:15 -04:00
Alex Shvartzkop 46e6eb163b Update translations 2025-05-03 18:13:31 +03:00
Joakim Lundborg 42429aff15 Translated using Weblate (Swedish)
Currently translated at 99.9% (10008 of 10015 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-05-03 17:10:00 +02:00
dsa-t f02c62971f Translated using Weblate (Russian)
Currently translated at 100.0% (10015 of 10015 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-05-03 17:10:00 +02:00
ZbeeGin 47aba551d1 Translated using Weblate (Polish)
Currently translated at 100.0% (10015 of 10015 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-05-03 17:10:00 +02:00
Henrik Kauhanen c9295d6f60 Translated using Weblate (Swedish)
Currently translated at 99.9% (10005 of 10015 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-05-03 17:09:59 +02:00
Toni Laiho 6505b996c9 Translated using Weblate (Finnish)
Currently translated at 98.1% (9831 of 10015 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/fi/
2025-05-03 17:09:59 +02:00
dsa-t ce134a1342 Translated using Weblate (Russian)
Currently translated at 99.9% (10014 of 10015 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-05-03 17:09:59 +02:00
Stian Kristensen 1f0530734e Translated using Weblate (Norwegian Bokmål)
Currently translated at 42.4% (4251 of 10015 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/nb_NO/
2025-05-03 17:09:59 +02:00
DevAny 22df27111f Translated using Weblate (Korean)
Currently translated at 98.3% (9853 of 10015 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ko/
2025-05-03 17:09:59 +02:00
Jeff Young 68ab95ad43 Fix merge error.
(9.0 still has overlapping field IDs so the parent
type also has to be checked.  10.0 field IDs are
unique.)
2025-05-02 11:20:03 +01:00
jean-pierre charras 32048d3b1e SCH_FIELD::Plot(): better test before trying to plot inter-sheet refs
inter-sheet refs exist only for global labels. It avoid an assert in debug mode.
2025-05-02 11:13:11 +02:00
Mark Roszko 7498f1b1a6 Protect s_ModelInfoMap against multithreading init
Encountered in QA tests on windows. Probably also a issue during kicad use if you trigger a spice netlist export without previously doing any spice model editing


(cherry picked from commit e14dfdf4b0)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2025-05-01 19:58:16 +00:00
jean-pierre charras c55d2c092e PDF plotter: fix a rare pen width issue when plotting many pages in one file.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20805

(cherry picked from commit a02f1f2411)
2025-05-01 20:04:19 +02:00
jean-pierre charras e13c414052 ltspice_schematic.cpp: fix missing initialization
(cherry picked from commit 3c9d696c68)
2025-05-01 11:20:17 +02:00
Jeff Young ee49cf555a Fix bad static cast.
Hypertext fields aren't always intersheet refs anymore.

(cherry picked from commit b772960717)
2025-04-30 17:59:12 +01:00
Alex Shvartzkop 3aded5da4b Don't write unused part of the buffer into image data.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20698
2025-04-30 16:36:16 +03:00
Alex Shvartzkop cbd55bc201 LTspice import: support 2+ dir levels deep symbol names. 2025-04-30 03:41:07 +03:00
Alex Shvartzkop 26674ceec3 GenCAD export: fix arcs winding and layers. 2025-04-30 01:51:09 +03:00
Alex Shvartzkop 71a6231bb8 LTspice import: add warning when the default library is not found.
Also allow to put the library into ./lib/
2025-04-30 00:29:49 +03:00
Wayne Stambaugh c4f9710f98 Fix crash in connection graph when loading a version 8.0 schematic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20777
2025-04-29 17:15:08 -04:00
Alex Shvartzkop 4c561b3193 Update translations 2025-04-29 20:12:28 +03:00
Stian Kristensen 6193652e89 Translated using Weblate (Norwegian Bokmål)
Currently translated at 42.1% (4224 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/nb_NO/
2025-04-29 19:11:19 +02:00
Marco Ciampa 8c980facb4 Translated using Weblate (Romanian)
Currently translated at 22.9% (2295 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ro/
2025-04-29 19:11:19 +02:00
Marco Ciampa 12782a163b Translated using Weblate (Italian)
Currently translated at 99.9% (10012 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-04-29 19:11:18 +02:00
Ivan Chuba 73d43a985f Translated using Weblate (Ukrainian)
Currently translated at 76.5% (7663 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/uk/
2025-04-29 19:11:18 +02:00
Ivan Chuba a9d1c87461 Translated using Weblate (Ukrainian)
Currently translated at 75.6% (7579 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/uk/
2025-04-29 19:11:18 +02:00
dsa-t 961588ef56 Translated using Weblate (Russian)
Currently translated at 100.0% (10013 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-04-29 19:11:18 +02:00
ZbeeGin 23955965d1 Translated using Weblate (Polish)
Currently translated at 100.0% (10013 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-04-29 19:11:18 +02:00
Ivan Chuba 7882505426 Translated using Weblate (Ukrainian)
Currently translated at 75.5% (7563 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/uk/
2025-04-29 19:11:18 +02:00
Ivan Chuba 707ec69916 Translated using Weblate (Estonian)
Currently translated at 3.5% (354 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/et/
2025-04-29 19:11:18 +02:00
Ivan Chuba b788cb860a Translated using Weblate (Ukrainian)
Currently translated at 75.4% (7553 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/uk/
2025-04-29 19:11:18 +02:00
co8 j 372f6dd9d6 Translated using Weblate (Japanese)
Currently translated at 100.0% (10013 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-04-29 19:11:18 +02:00
Ivan Chuba d4454bf3d2 Translated using Weblate (Ukrainian)
Currently translated at 75.3% (7545 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/uk/
2025-04-29 19:11:18 +02:00
Henrik Kauhanen ae05479dff Translated using Weblate (Swedish)
Currently translated at 99.9% (10003 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-04-29 19:11:18 +02:00
co8 j 6727e4993c Translated using Weblate (Japanese)
Currently translated at 99.8% (9995 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-04-29 19:11:17 +02:00
Ettore Atalan 6de07ce92b Translated using Weblate (German)
Currently translated at 99.5% (9969 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-04-29 19:11:17 +02:00
Ivan Chuba 348fe1c49d Translated using Weblate (Ukrainian)
Currently translated at 75.1% (7527 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/uk/
2025-04-29 19:11:17 +02:00
dsa-t 55e0780887 Translated using Weblate (Russian)
Currently translated at 99.9% (10011 of 10013 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-04-29 19:11:17 +02:00
jean-pierre charras 6c30e4f90b Gerbview: fix a maximum number (50) of Error messages in report list.
Having a lot of errors can happen when trying to open a non gerber files
(this is easy when loading a zip archive).
With a *lot* of errors (if a large .step file is found) Gerbview can hang.

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

(cherry picked from commit d5cf541974)
2025-04-28 17:59:17 +02:00
Jeff Young fb92923f82 Honour template fieldname vis flag when adding fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20575
2025-04-28 10:50:05 +01:00
JamesJCode c25264528c Add hasExactNetclass function to DRC condition language
Following changes to the `A.NetClass == '<netclass>'` semantics to
match on exact netclass name OR any constituent netclass names, we
can have conditions where constituent netclass constraints match
before the composite netclass constraints in the DRC engine. This
adds the functionality to match on the exact full netclass name, and
modifies the implicit netclass DRC rules to use this function in
their rule condition.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20797
2025-04-27 22:38:29 +01:00
Jeff Young e5e4d9b814 Fix merge error. 2025-04-27 18:17:19 +01:00
Alex Shvartzkop a8d04d0079 LTspice import: don't crash on missing symbols. 2025-04-27 19:30:28 +03:00
Alex Shvartzkop b345dac82b Eagle SCH import: fix arcs in symbols after v9 changes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20793
2025-04-27 18:50:29 +03:00
John Beard dd2d8e1a62 Pcbnew: fix pad snaps on non-F.Cu in high constrast mode
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20674

(cherry picked from commit e604ad9a3c)
2025-04-27 21:49:48 +08:00
John Beard 227c74f2ee PCB array tool: don't count array source pad as reserving its number
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20722
2025-04-27 21:49:21 +08:00
JamesJCode 51557e5f66 Deduplicate resolved net classes
Dupliates were possible if the same net class was specified as an
explicit label, and as the result of a pattern assignment

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20794
2025-04-27 12:24:13 +01:00
jean-pierre charras e35bd84c07 FOOTPRINT_CHOOSER_FRAME: fix crash when the 3D view is opened
Commit 6bc96530 fixed an issue, but created an incompatibility with the
dummy board (used in 3D canvas) handling when updating views, especially
if 3D canvas is opened.

(cherry picked from commit ab8060fa63)
2025-04-27 08:37:05 +02:00
Jeff Young 308c632f44 Partial cherry-pick of b01fef5ca8 2025-04-26 18:01:52 +01:00
jean-pierre charras dba149447c Footprint chooser frame: fix crash in COMMON_TOOLS::ResetLocalCoords()
The crash was due to a null pointer thta can happens in Footprint chooser,
frame, when hit the space bar if the canvas showing the Fp has the focus.

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

(cherry picked from commit 34e49758d0)
2025-04-26 18:24:17 +02:00
Roberto Fernandez Bautista 753a436183 Schematic: LTSpice importer add junctions
- Fixes up all junctions at the end of import
- Fixes https://gitlab.com/kicad/code/kicad/-/issues/20727


(cherry picked from commit e626799d67)

Co-authored-by: Lucas Gerads <lucas.gerads@aixcon.de>
2025-04-26 13:02:21 +00:00
jean-pierre charras 9e9870580b Gerbview: fix a few issues when loading zip files
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20779

(cherry picked from commit c7e4875505)
2025-04-26 10:38:45 +02:00
dsa-t f8bf5d2c38 Optimize via LOD calculations.
(cherry picked from commit 7d0a001831)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-04-26 04:55:18 +03:00
Jeff Young af9cbdc4fb Chamfer corners when expanding teardrop masks.
(Otherwise the first outline-based fill is pointy.)
2025-04-25 17:02:15 +01:00
Jeff Young 32ebb1f3a2 Fix merge error. 2025-04-25 16:43:43 +01:00
Jeff Young 8650e5a063 Export textbox borders to STEP.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20763

(cherry picked from commit b2f3a2f8ba)
2025-04-25 16:28:46 +01:00
Jeff Young fe6fa68694 Account for aperture & track masks in plated copper calculations.
(cherry picked from commit c2be7fa3e6)
2025-04-25 16:18:12 +01:00
Jeff Young 6b1a415281 Solder masks for teardrops on tracks with solder masks.
Also moves teardrops away from the zone UI: they
are now always filled and their borders never
drawn.

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

(cherry picked from commit 6873a75313)
2025-04-25 16:17:27 +01:00
jean-pierre charras 328f37cc3f JOB_EXPORT_PCB_3D: store export origin option without rely to coord origin value
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20752

(cherry picked from commit 481d282607)
2025-04-25 17:05:05 +02:00
Damjan 818d650ce2 Adds dedicated anchor points for table
Allows snapping and easier alignment first tables

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

(cherry picked from commit c4ff42cb54)
2025-04-25 09:34:59 +01:00
Jeff Young 648825127d Allow embedded files to come from components
as well as parent containers, part II.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20210
2025-04-25 09:34:58 +01:00
Wayne Stambaugh ad501536e8 Tag stable version 9.0.2 release candidate 1. 2025-04-24 15:20:45 -04:00
Alexander Boehm 13331d00bb multi-channel tool: do not duplicate uuids
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20665

(cherry picked from commit 70af60c930)
2025-04-24 13:32:37 -04:00
Alex Shvartzkop 2b2b7d2232 Disconnect EDA_DRAW_PANEL_GAL::onShowEvent handler in dtor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20754
2025-04-24 19:32:22 +03:00
Andrej Valek a65fe79551 SCH_EDITOR_CONTROL(paste): fix wrong cut behaviour
There was a missing behaviour when explicit removed annotation via specialpaste was requested. Add there a variable to compare the paste options.

(cherry picked from commit 9364bcdc9e)
2025-04-24 07:47:09 -04:00
Andrej Valek 5b79ad7f6b SCH_EDITOR_CONTROL(paste): make the annotation working again
The pasteMode was enforced to UNIQUE_ANNOTATIONS and not respecting the
value in settings. Basically revert the old behavior with respecting the
KIID generation.

Fixes kicad/code/kicad#19828

(cherry picked from commit 069954fa31)
2025-04-24 07:45:20 -04:00
Dhineshkumar S 184863db1a Fix missing change that ensures text is auto-completed.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13508

(cherry picked from commit fa517a0429)
2025-04-24 07:34:07 -04:00
Dhineshkumar S 3ed4eece94 Add autocomplete for label names in label properties dialog
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13508

(cherry picked from commit 46db959074)
2025-04-24 07:24:32 -04:00
JamesJCode 38c0e50f13 Further chasing of non-standard std::char_traits implementations
(cherry picked from commit 1c8e20b61f)
2025-04-23 23:42:56 +01:00
JamesJCode 1215b0c304 Add char_traits<T> specialisations for wxUniChar and NANODBC_SQLCHAR
when building on Apple with Clang >= 17.

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

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

(cherry picked from commit a5be581b1b)
2025-04-23 23:42:05 +01:00
Mike Williams 14a05de36a schematic editor: remove 10ms OnShow timer to reduce CPU load
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20385
(cherry picked from commit a648fccbb3)
2025-04-23 17:41:45 -04:00
Damjan bb95659afb pcbnew: Drag-selecting while creating a Text breaks PCB editor tools
CHANGED: drawing_tool.cpp: DRAWING_TOOL::PlaceText method ignores events when mouse drag is detected.

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

(cherry picked from commit 230a976742)
2025-04-23 17:32:28 -04:00
Matt Kosman 5edc846122 remove text angle reset when rotating multiple fields
The fields were properly rotated by field->rotate and don't need additional setting of the text angle.

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

(cherry picked from commit 0890d3f1cb)
2025-04-23 17:24:54 -04:00
Alexander Boehm a12bcbb6ea repeat layout: fixup net names of copied vias
When replicating a layout with the multichannel tool
the net names of vias are now updated to reflect the
potentially different connections in the target area.

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

(cherry picked from commit 4bc099429c)
2025-04-23 17:10:36 -04:00
Dmitry Rezvanov aa69aa63be pcbnew: Add sorting functionality for netclass assignments
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18819
(cherry picked from commit a3fae053c4)
2025-04-23 16:48:59 -04:00
John Beard c9e35a59dc PCB_PICKER_TOOL: avoid popping a dismabiguation menu after point selection completes
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20680
(cherry picked from commit 207199fd80)
2025-04-23 16:37:02 -04:00
wh201906 785be9bd59 Exclude brackets at the end of a URL in LinkifyHTML()
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20347
(cherry picked from commit 6d2b728fb1)
2025-04-23 16:31:24 -04:00
Alex Shvartzkop 6cfd84993c Update translations 2025-04-23 21:24:20 +03:00
CloverGit 56082b5d60 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (10007 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-04-23 20:23:19 +02:00
CloverGit e404e18c3d Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (10002 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-04-23 20:23:19 +02:00
Henrik Kauhanen 90df0c2d8b Translated using Weblate (Swedish)
Currently translated at 99.4% (9952 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-04-23 20:23:19 +02:00
Pferd O ad26cec474 Translated using Weblate (German)
Currently translated at 99.6% (9968 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-04-23 20:23:19 +02:00
Oliver0804 2982409887 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.2% (9936 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-04-23 20:23:19 +02:00
Hubert Hu f357a55393 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (10002 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-04-23 20:23:19 +02:00
CloverGit 989e7c3779 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (10002 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-04-23 20:23:19 +02:00
Ivan Chuba b3b4d65982 Translated using Weblate (Ukrainian)
Currently translated at 75.1% (7519 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/uk/
2025-04-23 20:23:19 +02:00
dsa-t 215f2d8320 Translated using Weblate (Russian)
Currently translated at 100.0% (10007 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-04-23 20:23:18 +02:00
ZbeeGin 4c6bbe21c0 Translated using Weblate (Polish)
Currently translated at 100.0% (10007 of 10007 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-04-23 20:23:18 +02:00
Jeff Young 55ffa472c6 Only add row separator between rows.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20494

(cherry picked from commit 4f83674b62)
2025-04-23 18:44:21 +01:00
Jeff Young 410f3f0f7b Allow embedded files to come from components
as well as parent containers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20530
2025-04-23 15:12:03 +01:00
jean-pierre charras 01df75ed36 French translation update 2025-04-23 16:01:45 +02:00
Wayne Stambaugh be68120865 Add missing virtual file handler clean up when creating archive files.
This was due to an over zealous clean up of the PROJECT_ARCHIVER and
PROJECT_ARCHIVER_DIR_ZIP_TRAVERSER objects which seems to cause issues
on Windows builds.

(cherry picked from commit 7fb16260aa)
2025-04-23 07:58:16 -04:00
Jeff Young 1c0a6fd14f Fill in some missing 3D render code.
1) add footprint graphics and text to copper
polys when differentiating plated from non-plated
copper

2) simplify adding footprint graphics and text
for contour walls

3) add dimension text and shapes for contour walls

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

(cherry picked from commit 31100451c6)
2025-04-23 10:46:28 +01:00
jean-pierre charras 60fca542ec PCB_PAINTER, mirrored view, texts on non paired layers: keep position
Depending on their horizontal justification, the texts wee moved when
flipping the board view.

(cherry picked from commit 57102b87ce)
2025-04-22 09:34:18 +02:00
JamesJCode 072562eb1a PCB Calcs: Reset default units along with values
(cherry picked from commit bd1f6e505c)
2025-04-21 21:28:53 +01:00
JamesJCode 68b86e6817 Add calculation of unit propagation delay to PCB calculator
(cherry picked from commit 2483ab4d7a)
2025-04-21 20:16:46 +01:00
Mike Williams 491b451519 sch design blocks: block illegal characters before creation failure
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20676
2025-04-21 15:10:18 -04:00
Sean Mollet d7eea3cf7b GENCAD export: Fixes to footprint hashing
(cherry picked from commit 380b5160d6)
2025-04-21 14:24:10 -04:00
Sean Mollet 4ba7cff25e GENCAD Export only produces a single pad - Fix
(cherry picked from commit 185491f2b8)
2025-04-21 14:24:10 -04:00
JamesJCode a4a3ee31e4 Fix compiler warning
(cherry picked from commit 983d14d371)
2025-04-21 19:23:17 +01:00
Ian McInerney 56345a4158 Mark ODB++ as export-only
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20493


(cherry picked from commit fd94488289)

Co-authored-by: Ian McInerney <ian.s.mcinerney@ieee.org>
2025-04-21 16:29:18 +01:00
Ian McInerney 8c26f4f10e Fedora 43 will need python 3.14 support
(cherry picked from commit 688448f9ab)

Co-authored-by: Steven A. Falco <stevenfalco@gmail.com>
2025-04-21 16:26:10 +01:00
Damjan ff02626f75 pcbnew and eeschema: Table and textbox rotation / text justification fix
(cherry picked from commit af11746cc4)
2025-04-21 14:45:08 +01:00
Alex Shvartzkop d6a6337a96 Update translations 2025-04-21 13:43:52 +03:00
dsa-t 42461e4a69 Translated using Weblate (Russian)
Currently translated at 98.9% (9949 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-04-21 12:43:00 +02:00
ZbeeGin ab51588005 Translated using Weblate (Polish)
Currently translated at 100.0% (10056 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-04-21 12:43:00 +02:00
ZbeeGin 3a4fdcd391 Translated using Weblate (Polish)
Currently translated at 99.1% (9970 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-04-21 12:43:00 +02:00
Pferd O 6d431d1670 Translated using Weblate (German)
Currently translated at 99.6% (10019 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-04-21 12:43:00 +02:00
Pferd O 398d6b4328 Translated using Weblate (German)
Currently translated at 99.5% (10013 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-04-21 12:43:00 +02:00
Ivan Chuba f1d5093dfc Translated using Weblate (Ukrainian)
Currently translated at 74.7% (7521 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/uk/
2025-04-21 12:43:00 +02:00
Henrik Kauhanen 67eff4e495 Translated using Weblate (Swedish)
Currently translated at 99.0% (9965 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-04-21 12:42:59 +02:00
Ivan Chuba c829773a44 Translated using Weblate (Estonian)
Currently translated at 3.5% (356 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/et/
2025-04-21 12:42:59 +02:00
Ettore Atalan eec89791d8 Translated using Weblate (German)
Currently translated at 99.5% (10013 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-04-21 12:42:59 +02:00
Henrik Kauhanen a4a27f0956 Translated using Weblate (Swedish)
Currently translated at 99.0% (9962 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-04-21 12:42:59 +02:00
Henrik Kauhanen 8458066468 Translated using Weblate (Swedish)
Currently translated at 99.0% (9956 of 10056 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-04-21 12:42:59 +02:00
Alex Shvartzkop 33fad39cf4 Un-translate layer names in 3D appearance panel. 2025-04-21 13:40:19 +03:00
Alex Shvartzkop c2d3c9b292 LTspice import: don't fail if some symbols are missing. 2025-04-21 04:51:45 +03:00
Alex Shvartzkop 37103c6e15 LTspice import: adapt label spin when multiple wires connected 2025-04-21 04:51:45 +03:00
Alex Shvartzkop 3b4111d3a2 LTspice import fixes:
- Support UTF-16 LE file encoding
- Support Invisible text justification
- Make added SCH_FIELD invisible by default, like in 8.0
- Adjust label orientations based on wire placements
- Fix arc windings in symbols
2025-04-21 04:51:45 +03:00
jean-pierre charras 906ef8bca7 Pad properties dlg: Clearing thermal relief override (gap/spoke) does not work
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20709

(cherry picked from commit 1af76a9bef)
2025-04-20 11:07:39 +02:00
Alex Shvartzkop aab730abc1 OCCT 3D model export: parallelize fusing shapes and subtracting holes. 2025-04-20 01:40:18 +03:00
Lucas Gerads 91602ee7ba Schematic: Fix Ltspice import with minor version number
- Files that contained a minor version number failed
- Now both works "Version X.X" and "Version X"

(cherry picked from commit 16b4ee92bb)
2025-04-19 22:50:45 +03:00
Alex Shvartzkop ee513f7a8b OCCT 3D model export: fix missing soldermask shape when there's no polygons. 2025-04-19 21:15:13 +03:00
Alex Shvartzkop 5adc6ee2f4 OCCT 3D model export: use per-net fusing to improve performance.
It's now possible to export bigger boards without running out of memory (and time).

STEP video -components +silk +mask +all copper:
- this commit: 9 minutes (most of it is STEP transfer)
- 9.0.0: 28 minutes
2025-04-19 21:15:13 +03:00
Wayne Stambaugh a4f71ae3ee Use schematic editor default font setting for plot job.
When the user does not define a font on the CLI or when plotting from a
job set, use the current schematic editor default font setting rather than
always defaulting to the "KiCad Font".

Set the --default-font CLI setting to an empty string so the the schematic
editor default font setting will be used.  Setting the --default-font CLI
option will override the schematic editor default font setting.

(cherry picked from commit f0f6b5a09b)
2025-04-19 13:06:31 -04:00
Jeff Young cc69f8b9ae Remove duplicate handling for grid checkboxes.
Also corrects logic of otherRow loop.

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

(cherry picked from commit 544abedb0eeea86e6baab3370c6df7a9271fb93b)
2025-04-18 22:32:54 +01:00
Jeff Young ec17012c81 Update sample script.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20538
2025-04-18 17:21:58 +01:00
Jeff Young e93b05e413 Simplify libTree scoring algorithm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20610

(cherry picked from commit 598d446a38)
2025-04-18 16:47:00 +01:00
Jeff Young f82760f6e3 Reset colors on Reset to Default Settings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20624
2025-04-18 12:36:14 +01:00
Jeff Young 01a09e8a3f Don't conflate generated fields (${DNP}) and fields with variable references.
They're not quite the same thing as the later
can have un-applied values which require expanding.

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

(cherry picked from commit 5a9ac23f2cd1922b497b19484aee8f26165bcf73)
2025-04-18 11:51:12 +01:00
Alex Shvartzkop fcc170f077 Update translations 2025-04-18 03:10:35 +03:00
ZbeeGin 03d80dd8d8 Translated using Weblate (Polish)
Currently translated at 100.0% (9967 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-04-18 02:08:09 +02:00
Marco Ciampa f91afe1f49 Translated using Weblate (Italian)
Currently translated at 99.3% (9901 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-04-18 02:08:09 +02:00
2tama3 1bba0d96ad Translated using Weblate (Japanese)
Currently translated at 100.0% (9967 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-04-18 02:08:09 +02:00
Tokita, Hiroshi a107722eac Translated using Weblate (Japanese)
Currently translated at 99.9% (9958 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-04-18 02:08:09 +02:00
CloverGit d9bba779fd Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9967 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-04-18 02:08:09 +02:00
rsr.private 49dc16fcb0 Translated using Weblate (Catalan)
Currently translated at 42.3% (4220 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-04-18 02:08:09 +02:00
2tama3 fc82d8d19c Translated using Weblate (Japanese)
Currently translated at 99.8% (9954 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-04-18 02:08:09 +02:00
Adolfo Jayme Barrientos ec061ebd2e Translated using Weblate (Spanish)
Currently translated at 87.1% (8682 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-04-18 02:08:09 +02:00
Adolfo Jayme Barrientos 65b509a225 Translated using Weblate (Catalan)
Currently translated at 42.1% (4205 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-04-18 02:08:09 +02:00
Adolfo Jayme Barrientos 097cef1819 Translated using Weblate (Spanish)
Currently translated at 87.1% (8682 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-04-18 02:08:09 +02:00
Adolfo Jayme Barrientos 8bf538f529 Translated using Weblate (Catalan)
Currently translated at 42.1% (4199 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-04-18 02:08:09 +02:00
pominglee 06fdb5e86c Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.9% (9965 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-04-18 02:08:09 +02:00
ZbeeGin b4831a17a0 Translated using Weblate (Polish)
Currently translated at 100.0% (9967 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-04-18 02:08:08 +02:00
Pferd O 32cef776da Translated using Weblate (German)
Currently translated at 99.8% (9949 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-04-18 02:08:08 +02:00
co8 j ce314185fb Translated using Weblate (Japanese)
Currently translated at 99.8% (9953 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-04-18 02:08:08 +02:00
pominglee 9bd43071ae Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.9% (9965 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-04-18 02:08:08 +02:00
Henrik Kauhanen bfe895bfd5 Translated using Weblate (Swedish)
Currently translated at 99.9% (9961 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-04-18 02:08:08 +02:00
ZbeeGin dc3a3ec597 Translated using Weblate (Polish)
Currently translated at 99.9% (9959 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-04-18 02:08:08 +02:00
Pferd O 69e909dc76 Translated using Weblate (German)
Currently translated at 99.7% (9946 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-04-18 02:08:08 +02:00
pominglee 446e7f3125 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.9% (9963 of 9967 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-04-18 02:08:08 +02:00
jean-pierre charras cf66d47b74 Fix kicad-cli pcb export gerbers --output argument type in help.
It is a directory name, not a filename

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

(cherry picked from commit e6240f9fbf)
2025-04-17 11:34:33 +02:00
Jeff Young 11f3bbdbcb Move Use45Limit processing to VIEWER_TOOLS.
(We need it for the ruler in footprint preview
widgets.)

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

(cherry picked from commit 194ee9ef25)
2025-04-16 18:13:29 +01:00
Jeff Young 6028cb3ec2 Make sure footprint chooser has correct board.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20669

(cherry picked from commit 6bc9653029)
2025-04-16 18:13:05 +01:00
Jeff Young f7cdd9eaa7 Use EDA_COMBINED_MATCHER more consistently.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20678

(cherry picked from commit 5279cc8767)
2025-04-16 18:12:18 +01:00
Jeff Young 3fadd20088 Rebuild connectivity after append board.
Append board reads the BOARD_ITEMs directly onto
the board and so pushes the commit with CHT_DONE
flags.  However, this means the added items aren't
added correctly to the connectivity system.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20314
2025-04-14 20:14:37 +01:00
Jeff Young 9db8765d52 Bounds-check unit and body style from prop inspector.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20649
2025-04-14 16:27:51 +01:00
Damjan 5644e6d517 pcbnew: Multi-line text in table cell
(cherry picked from commit 2d2f443aa4)
2025-04-14 15:50:25 +01:00
Damjan 9be41e97f7 pcbnew: flipping tables makes them walk
(cherry picked from commit f4107fa4d6)
2025-04-14 15:50:19 +01:00
Jeff Young 1c835fee75 Remove Help menu hacks which appear to no longer be necessary.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10124
2025-04-14 11:11:38 +01:00
Jeff Young bae846c2cd Don't allow auto-conversion from double to EDA_ANGLE.
We have no idea if the double is in radians or
degrees.
2025-04-14 11:00:59 +01:00
Jeff Young afe3d2c43e Fix merge error. 2025-04-14 10:07:39 +01:00
Jeff Young e784b03f61 Revert part of name change that affects settings files.
(cherry picked from commit 8b19777d5d)
2025-04-14 10:07:39 +01:00
Jeff Young 9a0a4b8671 Update pads connected to any connected tracks.
(Not just those selected.)

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

(cherry picked from commit 2d69b6e8ba)
2025-04-14 10:07:39 +01:00
Alex Shvartzkop 6780cdb54c OCCT 3D model export: support different line styles for graphics.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18873
2025-04-14 07:01:55 +03:00
Alex Shvartzkop c5771d8874 Fix too small angle increment when stroking arcs.
The previous angle increment was about 0.0087 degrees.
Change it to 0.5 degrees.
2025-04-14 06:44:55 +03:00
Alex Shvartzkop 2cebea3b04 OCCT 3D model export: fix copper fusing issues on StickHub GND and #20515
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20515
2025-04-14 00:15:46 +03:00
Alex Shvartzkop dfb66e2fdb OCCT 3D model export: don't skip pads with duplicate pad numbers for pad points data. 2025-04-13 22:41:45 +03:00
jean-pierre charras 31a7048faf DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE: use a better position for the marker.
It was put at arc center. Now put on arc middle.

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

(cherry picked from commit 66a7abca09)
2025-04-13 19:55:45 +02:00
Alex Shvartzkop 58a76a2617 Remove annoying tooltips in DRC/ERC dialogs. 2025-04-13 20:32:05 +03:00
Jeff Young 4b137bbaea Handle ref & value proxies as if they were refs and values. 2025-04-13 15:06:14 +01:00
Jeff Young 4a533bfb07 "Other" refers to fields other than refdes and value.
It has nothing to do with text items.

Also fixes some breakage with the introduction of
a separate scope item for dimensions.

Also rearranges the dialog a bit to make it fit
on smaller screens.

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

(cherry picked from commit e90a3112f8)
2025-04-13 14:26:24 +01:00
Jeff Young 1e11916975 Visibility control is for *filled* shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20635

(cherry picked from commit ecb5c5e0d4)
2025-04-13 14:03:25 +01:00
Jeff Young df4435ed80 Remove redundant performance changes.
(Alex had already moved these to const char, which
avoids wxString's c'tor.)

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

(cherry picked from commit 7232a98b65)
2025-04-13 13:46:31 +01:00
Jeff Young ecf3697ad3 Performance.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20506

(cherry picked from commit 1d45de0d1d)
2025-04-13 13:46:27 +01:00
Jeff Young aab7701c17 Be explicit about table highlight colors.
(Unsurprisingly, the previous hack had side effects.)

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

(cherry picked from commit 45abc90885)
2025-04-13 13:44:43 +01:00
Alex Shvartzkop 09da370512 OCCT 3D model export: don't show fusing errors for non-copper pads. 2025-04-13 08:18:27 +03:00
Wayne Stambaugh 0fca70a0bc Fix broken label position algorithm in Eagle schematic importer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20593

(cherry picked from commit aa1dbcba34)
2025-04-12 11:06:50 -04:00
Seth Hillbrand ff6bee400e Remove schematic view size limitation
We don't need to worry about scrollbar button sizes anymore, so we don't
need to limit the viewport size based on the page

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20594
2025-04-11 17:49:53 -07:00
Seth Hillbrand 2b99d3e2e6 Don't set board layers without board
When loading footprints, we may have undefined layers, they should not
be set unless we have a board

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

(cherry picked from commit 7d195b73b2)
2025-04-11 15:13:24 -07:00
Wayne Stambaugh 30f1c400e2 Code clean up of board GenCAD exporter.
(cherry picked from commit 9228369617)
2025-04-11 14:03:13 -04:00
Wayne Stambaugh fe162b2f3c Fix GenCAD arc track export when using board offset.
(cherry picked from commit 4ae07d1122)
2025-04-11 14:03:06 -04:00
Wayne Stambaugh 37f11379c3 Actually prevent recursion when building connection sub-graph.
Propagating to neighboring connections when not a net will cause an
infinite recursion crash.  Use the wxCHECK2 instead of wxASSERT to
prevent this.

Add a bunch of question comments where the use of wxASSERT is questionable.

(cherry picked from commit c810ef716d)
2025-04-10 16:50:52 -04:00
Jeff Young 9b253fbdd7 Resolve fonts for tablecells.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20605
2025-04-10 14:10:16 +01:00
Jeff Young 3068868f65 Remove redundant performance changes.
(Alex had already moved these to const char, which
avoids wxString's c'tor.)

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

(cherry picked from commit 7232a98b65)
2025-04-10 13:12:26 +01:00
Jeff Young 87de0ac806 Performance.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20506

(cherry picked from commit 1d45de0d1d)
2025-04-10 13:12:21 +01:00
jean-pierre charras 8334a83aaa DIALOG_SIM_MODEL: fix possible crash when no lib loaded (null pointer)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20599

(cherry picked from commit e57bc3304f)
2025-04-10 13:26:40 +02:00
jean-pierre charras 5cba809a1e PANEL_FP_EDITOR_FIELD_DEFAULTS: Fix incorrect default layer when adding a field
When adding a default field, the associated defaut layer was the layer used by
the previous default field. But it does not work for the first added field.

(cherry picked from commit 065e9dbf46)
2025-04-10 09:36:36 +02:00
jean-pierre charras e23c2e30ee DIALOG_RULE_AREA_PROPERTIES: fix incorrect tool-tip
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20592

(cherry picked from commit f29c19ef02)
2025-04-10 09:35:54 +02:00
Jeff Young 6cd3a802a7 De-duplicate find results.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20569

(cherry picked from commit 43aa63c1ec)
2025-04-09 12:52:44 +01:00
Jeff Young a3fff6ea10 No requirement to UNGROUP when we're recording entire parent FP.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20589

(cherry picked from commit ec6bc85a29)
2025-04-09 12:52:44 +01:00
Dmitry Rezvanov dd468a916e Prevent overwriting alias members when adding new rows in panel setup.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20040
(cherry picked from commit 58d2b34304)
2025-04-08 13:03:30 -07:00
Wayne Stambaugh e2b976594a Use symbol line width schematic setting when printing and plotting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20574

(cherry picked from commit 1176ff4a15)
2025-04-08 09:11:07 -04:00
Seth Hillbrand d8903534b7 Remove TreeControl call from thread
On Windows, this may use SendMessageW, forcing a wait for UI in the
thread

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

(cherry picked from commit 3d29fae7a9)
2025-04-07 17:06:22 -07:00
Alex Shvartzkop de1257abdf Altium PCB: fix 3D model opacity variable type.
See https://gitlab.com/kicad/code/kicad/-/issues/20507
2025-04-07 23:22:43 +03:00
Alex Shvartzkop 3d36d41ea7 Altium PCB: support 3D models import with duplicate filenames.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20507
2025-04-07 23:22:42 +03:00
Alex Shvartzkop 2c74d46d79 Altium PCB: fix padstack shapes import on F.Cu. 2025-04-07 23:22:42 +03:00
Seth Hillbrand 7bee2cf842 Isolate thread pool loops
Now that we are threading things in different frames, we need to watch
that we are not waiting for a process to complete in one frame while
working in another.  To accomplish this, we only wait for our own loop
results

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

(cherry picked from commit bccf365380)
2025-04-07 12:18:05 -07:00
Jeff Young 6446e01483 Nullptr crash. 2025-04-07 18:18:06 +01:00
Jeff Young f5adac9369 Don't assume existence of default FP text items. 2025-04-07 18:17:37 +01:00
Jeff Young 312b75291b ADDED: menu item to control searching of hidden fields.
Applies to both PCBNew & Eeschema search panels.

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

(cherry picked from commit 3def4afaec)
2025-04-07 17:36:32 +01:00
Jeff Young c54b65fff7 Formatting.
(cherry picked from commit 7a9db0f8c1)
2025-04-07 17:36:32 +01:00
Jeff Young 766e48fb4f Restore visibility editing for fields.
(It got accidentally thrown out with visibility
for text items.)

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

(cherry picked from commit ac616b8c19)
2025-04-07 17:36:32 +01:00
Jeff Young 6ec1585c58 Performance. 2025-04-07 17:36:32 +01:00
Jeff Young c65d27dae1 Via needs a parent for formatting.
(cherry picked from commit d4cc91f17a)
2025-04-07 17:36:32 +01:00
Jeff Young 82d572df80 Fix thermal spokes for pad stacks.
(cherry picked from commit 2c9c607b95)
2025-04-07 17:36:32 +01:00
Wayne Stambaugh 32e9762230 GenCAD board exporter fixes.
Strip leading zeros from copper layer mask string so the unique pad and
pad stack names are not 128 characters long.

Try a different fix for broken arc track orientations.

(cherry picked from commit c5ff61ba9c)
2025-04-07 12:08:26 -04:00
Wayne Stambaugh f987688b6f Fix project archiving.
Use simplified file extension and name checks rather than a regular
expression to determine which files to archive.

Fix incorrect use of wxFileName which generates invalid paths when the
last folder in the path contains dots.

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

(cherry picked from commit 598850b1f0)
2025-04-07 12:08:05 -04:00
Wayne Stambaugh 5544a315bd Use arc mid point for footprint library parity DRC testing.
The arc center is a pseudo coordinate which is calculated for drawing
purposes.  This mid point is fixed unless the arc is modified which
should result in more reliable arc parity footprint library DRC testing.

Also change EDA_SHAPE::Compare() to use the arc mid point.

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

(cherry picked from commit 11edaa6e4a)
2025-04-07 12:03:02 -04:00
Wayne Stambaugh 9d1344d707 Include arc tracks when exporting to GenCAD.
(cherry picked from commit 642e4d37bc)
2025-04-07 11:59:14 -04:00
Wayne Stambaugh e0db6d013b Fix assertions when exporting board to GenCAD.
Calling PCB_VIA::Width() without a layer will raise and assertion.  Check
if track is via when looping through a list of tracks and use the correct
width call.

(cherry picked from commit cf3dae0bb9)
2025-04-07 11:50:48 -04:00
jean-pierre charras 13cbdda586 kicad-cli export gerbers: avoid incorrect behavior with a broken layer list.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20555

(cherry picked from commit 91d9863cc3)
2025-04-05 12:51:16 +02:00
Alex Shvartzkop a6d81d019f Improve GetAppSettings performance.
There's no need to construct a wxString first.
2025-04-04 23:27:18 +03:00
Alex Shvartzkop fa10961d6c Remove leftovers. 2025-04-04 22:45:59 +03:00
Alex Shvartzkop a1a710dfed Improve pan performance when showing a large amount of TH pads.
See https://gitlab.com/kicad/code/kicad/-/issues/20506
2025-04-04 22:14:13 +03:00
jean-pierre charras 6efaa64908 Pcbnew, printing vias: always print the via hole, even for small holes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20546

(cherry picked from commit 91dda80530)
2025-04-04 16:43:35 +02:00
jean-pierre charras e918f820f5 SCH_TEXTBOX: Do not plot twice the textbox shape.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20545

(cherry picked from commit 9eea670617)
2025-04-04 16:43:08 +02:00
Jeff Young 806f9ea5fd Be explicit about default anchor shape.
(Otherwise it doesn't work for padstack overrides.)

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

(cherry picked from commit 200c4a9eae)
2025-04-04 13:33:03 +01:00
Jeff Young 9c4a88a129 Performance optimisation.
Reduces board loading for #17820 from 15 seconds
to about 6.

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

(cherry picked from commit 7151d21f0b)
2025-04-04 13:32:59 +01:00
Wayne Stambaugh 956a633d4d Merge PAD::addPadPrimitivesToPolygon() into PAD::MergePrimitivesAsPolygon().
It was only used in MergePrimitivesAsPolygon() and it was only a few lines
long.

(cherry picked from commit ef5cd6bb28)
2025-04-03 15:59:38 -04:00
Wayne Stambaugh 63a03734e9 Don't clobber SCH_SCREEN paths when adding new sheet from existing file.
The screen path will always be the correct absolute path.  Otherwise it
would not be possible to load it.

Don't reset the first sheet file path to relative if the user did not
request it.

Don't use results of a failed call to wxFileName::MakeRelative() to set
sub-sheet file paths.

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

(cherry picked from commit d52d0d0aad)
2025-04-03 15:58:22 -04:00
Wayne Stambaugh 221f28eafc Move all PAD object methods to into PAD object source file.
No functional changes.  Just make it easier to find all of the PAD object
methods.

(cherry picked from commit 2b0d082df5)
2025-04-03 15:51:03 -04:00
jean-pierre charras d6406d1349 PANEL_DESIGN_BLOCK_CHOOSER: use the same draw engine type as in main frame.
This is not always the Opengl GAL_TYPE

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20386
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20544

(cherry picked from commit b7fd26e026)
2025-04-03 18:29:25 +02:00
jean-pierre charras 36b9c08793 WX_PT_ENTRY_DIALOG: enhancements: fix min size and add reset button.
It is used to enter a point position and a grid origin.
The new button (only in grid origin dialog) allows reset the position.

(cherry picked from commit f8ec23db00)
2025-04-03 13:21:20 +02:00
Jeff Young 6988e79714 Plot tables in footprints. 2025-04-03 10:55:01 +01:00
Jeff Young 147234ca68 Handle groups in footprints when filtering selection.
(cherry picked from commit 8ff0aafbb8)
2025-04-02 16:24:02 +01:00
Jeff Young 71659be29b When pulling children out of footprints don't format them wrong.
If we leave a footprint parent pointer then we'll
format as fp_line, fp_arc, etc. instead of gr_line,
gr_arc, etc.

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

(cherry picked from commit a0ec7f59c4)
2025-04-02 16:23:59 +01:00
Jeff Young b685378efa Remove assert that fires when applying preset.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20467

(cherry picked from commit 901ad3064d)
2025-04-02 16:23:56 +01:00
Jeff Young 736044cd71 Improve debugging.
(cherry picked from commit db911c0d91)
2025-04-02 16:23:53 +01:00
Jeff Young de1a04d6b4 m_root is not guaranteed to be non-null.
(cherry picked from commit 967bf1d0a1)
2025-04-02 16:23:48 +01:00
jean-pierre charras 8149107e33 PCB_TEXTBOX:: Rotate: fix size change for rotation by not 90deg
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20529

(cherry picked from commit 76929808d3)
2025-04-01 20:24:32 +02:00
Jeff Young 36eb0c75d4 Remove unsafe C-style casts. 2025-04-01 17:36:13 +01:00
Jeff Young bc4fe1e05a Fix first tab having no effect after changing grid value.
(cherry picked from commit 0573a32f36)
2025-04-01 16:29:04 +01:00
Jeff Young 0c083e560c Don't process grid-change events when we're rebuilding the grid.
The selection has already changed and it's too
late to update any values.

Also regularises the event.Skip() handling from
8a1347d2c8.

(cherry picked from commit a1fe0f7faf)
2025-04-01 16:28:59 +01:00
Jeff Young 4ff1fc2f1b Reset status popup.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20489

(cherry picked from commit 6f6ef8e626)
2025-04-01 16:28:46 +01:00
jean-pierre charras 141a6291c9 DIALOG_SYMBOL_FIELDS_TABLE: fix a ugly look issue specific to wxMSW
The recent change use a two lines title in a widget. It works fine on Linux
and MAC, but is not supported on Windows.
So, on Windows, a one line title is used.

(cherry picked from commit c8b57c50dc)
2025-04-01 15:58:05 +02:00
Jeff Young 9043279301 Nullptr safety.
KICAD-7DX
2025-04-01 12:18:55 +01:00
Jeff Young 4003fdfe98 Move HasMessageOfSeverity to base class.
KICAD-HPP
2025-04-01 12:18:55 +01:00
Jeff Young 3f060a6107 Stack objects should not have parents or groups.
KICAD-KXY
2025-04-01 12:18:55 +01:00
Jeff Young ca284ebb4e Once the selection has changed, we can't commit changes.
KICAD-6Y9, among others.
2025-04-01 12:18:55 +01:00
JamesJCode b446e794b8 Fix net inspector thaw location to not break selection on MSW 2025-03-31 21:08:00 +01:00
JamesJCode 8c162ecbca Freeze net inspector data view when rebuilding the list of nets
Attempt to fix #20521 but it is very hard to reproduce

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20521
2025-03-31 20:44:39 +01:00
Jeff Young d05fe64d41 Remove shadowed type (DRILL_MARKS).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20522

(cherry picked from commit 6e566b2819)
2025-03-31 20:00:47 +01:00
Jeff Young b2d3a602c5 Don't presume there are at least two footprint text
defaults.

Yes, we ship that way, but a user could delete one
or edit their json file.
2025-03-31 15:37:23 +01:00
Jeff Young 2546534056 Clearer column titles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20509
2025-03-31 14:28:15 +01:00
Jeff Young 303c1bef7b Wait for wxWidgets to destroy window. 2025-03-31 14:28:15 +01:00
Jeff Young 9cbc1db2a1 Retire DIALOG_FOOTPRINT_CHOOSER.
(cherry picked from commit 7583c0e69d)
2025-03-31 14:31:41 +02:00
Jon Evans 2b8083920a Adjust OBJECT_DEPENDS for MacOS
It appears that MacOS only sees the last key/value for the
source_file_property whereas Linux/Windows see all depends.  This works
around the different by getting the value first, accumulating in the
loop and setting once at the end


(cherry picked from commit 074b511fab)

Co-authored-by: Seth Hillbrand <seth@kipro-pcb.com>
2025-03-30 21:52:05 -04:00
Jon Evans 69589840df API: Brute-force fix for footprint modifications
(cherry picked from commit 12861345d3)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-30 19:01:37 -04:00
Jon Evans 558488f874 API: Clear footprint caches when making changes
(cherry picked from commit 31f3c44520)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-30 19:01:26 -04:00
Jon Evans 73f77658bb More functional fix for IPC API item modifications
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20206


(cherry picked from commit dc9fa2e2ac)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-30 19:01:16 -04:00
Jon Evans 4d6bb9317b Revert "Switch to operator= for item updates"
This reverts commit d0b22d21bb.


(cherry picked from commit 3bac9344d2)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-30 19:01:07 -04:00
Jeff Young 4aeb2c58fb Don't assume a hypertext link is a cross-sheet reference.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20511

(cherry picked from commit 582aef0220)
2025-03-30 22:50:21 +01:00
Jeff Young 0087959bf5 Report global physical_clearance issues before moving on to layers.
Also fixes a bug in reading m_LayerSource.

Also simplifies Edge_Cuts handling to better match
actual DRC checks.

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

(cherry picked from commit 9066ad3620)
2025-03-30 22:50:21 +01:00
jean-pierre charras efea324ee4 Eeschema, DIALOG_FIELD_PROPERTIES: fix a strange bug specific to wxMSW.
wxStyledTextCtrl, SetExtraAscent() + SetExtraDescent() methods, when set
to a value not 0 generate a strange bug: the text is not always shown
(when enter a char, once the text is shown, once the text is not shown)
(Perhaps a wxMSW bug) and this call is not needed on WXMSW

(cherry picked from commit d729b34986)
2025-03-30 17:32:49 +02:00
jean-pierre charras 3c6cb7b5b9 PANEL_FP_EDITOR_FIELD_DEFAULTS: fix incorrect behavior.
One could not change the default layers for new fp texts

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

(cherry picked from commit 97e1c107c9)
2025-03-30 17:31:52 +02:00
Wayne Stambaugh cae665cd76 Update default schematic when creating a new project.
Adding the missing default page number ("1") allows the CLI plotting and
printing by page number to work correctly even if the schematic hasn't been
saved in the schematic editor.

This also adds a default new schematic UUID and embedded font setting.

Use the fancy new file formatting style.

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

(cherry picked from commit 1b40ddaba5)
2025-03-30 06:48:32 -04:00
Wayne Stambaugh 547997e1a6 Fix Coverity issue #542006.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=542006
(cherry picked from commit 4cb234862c)
2025-03-30 06:46:01 -04:00
Wayne Stambaugh 6ad924ea45 Fix Coverity issue #545180.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=545180
(cherry picked from commit cf4369a2ef)
2025-03-30 06:44:54 -04:00
Wayne Stambaugh 56d9d46a0b Fix Coverity issue #514495.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=514495
(cherry picked from commit 8fa48c7be2)
2025-03-30 06:43:19 -04:00
Wayne Stambaugh b56ff24acd Fix Coverity issue #541995.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=541995
(cherry picked from commit 62cb67d854)
2025-03-30 06:42:23 -04:00
Wayne Stambaugh cbeb6735e9 Fix Coverity issue #542006.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=542006
(cherry picked from commit dd806aa902)
2025-03-30 06:39:38 -04:00
Seth Hillbrand 83b8bdf137 Ignore autogenerated files
(cherry picked from commit 36366e254d)
2025-03-30 08:23:32 +01:00
JamesJCode a21bcb4903 Add new DRC expression function isMemberOfSheetOrChildren
This allows the multichannel tool to search for footprints that are in nested
hierarchical sheets.

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

(cherry picked from commit 4a99a3060d)
2025-03-30 08:20:36 +01:00
Wayne Stambaugh 4e064d5502 Coding policy house keeping.
(cherry picked from commit 47984b6793)
2025-03-29 20:12:16 -04:00
JamesJCode 8e48445a5b Net inspector groups should be case insensitive
(cherry picked from commit 7a4325e610)
2025-03-30 00:05:49 +00:00
Wayne Stambaugh 6b1505438d Fix Coverity issue #544154.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=543084
(cherry picked from commit 4131089260)
2025-03-29 20:00:25 -04:00
Wayne Stambaugh 7f6136454a Properly prevent duplicate sheet names on paste.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20357

(cherry picked from commit b364f5dbde)
2025-03-29 19:58:50 -04:00
JamesJCode 548a33dace Ensure PNS length tuning calculation uses correct layer ID context
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20372

(cherry picked from commit 24a8c2a684)
2025-03-29 22:13:03 +00:00
JamesJCode 4ea36da4c3 Test symbol outline collisions for rule areas, not just bounding boxes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20383

(cherry picked from commit 0f1f6b23a8)
2025-03-29 22:13:03 +00:00
Jon Evans 37fe0eca73 clear itemByIdCache in IncrementTimestamp
(cherry picked from commit 78b6ca8256)

Co-authored-by: Quentin Freimanis <quentinfreimanis@gmail.com>
2025-03-29 18:05:35 -04:00
Jeff Young 3b45663866 COMMIT lifetime safety.
If we pass a COMMIT to a posted action, the COMMIT
may no longer exist when the action is run.
Equally problematic, if another COMMIT is pushed
in between we'd probably also run into trouble.

We still allow the API to do this because we don't
have a better solution at present.  But we need
one.

(cherry picked from commit 60a26308ae)
2025-03-29 21:26:55 +00:00
Jeff Young 238b5fedc8 Fix format string.
(cherry picked from commit 4f115b12a4)
2025-03-29 21:26:52 +00:00
Jeff Young 8694c70237 Remove debug assert that's clogging up Sentry.
(cherry picked from commit b62f00912e)
2025-03-29 21:26:48 +00:00
Jeff Young 84adec02a7 Code clarity.
(cherry picked from commit 408d3a0170)
2025-03-29 21:26:45 +00:00
Jeff Young d61d66505f Remove debug assert.
Yes, it does indeed fire (a lot, as Sentry can
tell us).

(cherry picked from commit baaf341d0d)
2025-03-29 21:26:36 +00:00
Jeff Young beb4bb9007 Don't respond to net navigator events while we're updating the wxTreeCtrl.
(cherry picked from commit 4783bc4cfd)
2025-03-29 21:26:28 +00:00
Jeff Young b2c59f2359 Don't obliterate user data when syncing copper layer count.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20484

(cherry picked from commit 629a12ab2e)
2025-03-29 21:25:47 +00:00
Jeff Young a417afac8e Mirror pad numbers when appropriate.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20459

(cherry picked from commit 151cb01795)
2025-03-29 21:25:21 +00:00
Jeff Young 80e2153a14 Formatting.
(cherry picked from commit 88267c4a47)
2025-03-29 21:24:32 +00:00
Jeff Young 7208e6baf6 Formatting.
(cherry picked from commit 2ca09457b0)
2025-03-29 21:24:32 +00:00
Jeff Young 8e81d9ec73 Auto-enable user layers that have custom FPEditor names.
(cherry picked from commit 3380afd9fd)
2025-03-29 21:24:32 +00:00
Jeff Young a44c2d9a5c Fix being able to delete custom layer names.
(Or anything in a PARAM_MAP, but layer names appear
to be the only current use of it.)

(cherry picked from commit da05ad93ac)
2025-03-29 21:24:32 +00:00
Jeff Young 02688ce919 Process non-copper keepouts in footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20405

(cherry picked from commit ab43c3c6b5)
2025-03-29 21:24:32 +00:00
Jeff Young 35e119c152 Don't assert (or crash) on shutdown.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20433

(cherry picked from commit 9c375581ff)
2025-03-29 21:24:32 +00:00
Jeff Young e09f4d79c9 Don't gate drill mark plotting on unenabled copper layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20460

(cherry picked from commit 79924b5dfd)
2025-03-29 21:24:31 +00:00
Jeff Young 0e8afc8243 Use std::optional to better flag presence of arguments.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20460

(cherry picked from commit 8076bfa3c7)
2025-03-29 21:24:31 +00:00
Jeff Young a2ca66d05b Job layersets come in already parsed.
Only CLI argments need parsing at the handler level.

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

(cherry picked from commit 96835cbfcf)
2025-03-29 21:24:31 +00:00
Jeff Young c32639d6b5 Add support for mixed-state checkboxes in grids.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17730

(cherry picked from commit 0d6838b803)
2025-03-29 21:24:31 +00:00
Jeff Young f7572e254d Don't use net/netclass colors for label graphic shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19589

(cherry picked from commit 59e77e977e)
2025-03-29 21:24:31 +00:00
Jeff Young 817dba3a57 Refresh search when showing pane.
(Events will have been ignored while it is
hidden.)

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

(cherry picked from commit 1b7f92f4c5)
2025-03-29 21:24:31 +00:00
Jeff Young daaee3f1b8 Handle home dir shortcut in jobset destinations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20032

(cherry picked from commit b366204824)
2025-03-29 21:24:31 +00:00
Jeff Young ebef835852 Shorten opt-in text and improve Yes/No button labels.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20027

(cherry picked from commit 86e1d4c684)
2025-03-29 21:24:31 +00:00
Jeff Young 6073a32833 Don't write out empty footprint filters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20394

(cherry picked from commit 5ec526fe4f)
2025-03-29 21:24:31 +00:00
Jeff Young 1723346524 Must assign extension to keep from stripping last '.' section.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20065

(cherry picked from commit d3f57fac5a)
2025-03-29 21:24:31 +00:00
Jeff Young 97982cd089 Fix accidental ingoring of rotation angle.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20271

(cherry picked from commit f0c81e972f)
2025-03-29 21:24:31 +00:00
Jeff Young 4e353c8366 Leave navigation controls active.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20378

(cherry picked from commit 8994f6abd7)
2025-03-29 21:24:31 +00:00
Jeff Young 772295c573 Don't leave dangling event handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20380

(cherry picked from commit 3328dc48be)
2025-03-29 21:24:31 +00:00
Jeff Young 88c4913f65 Search all fields, hidden or not.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20370

(cherry picked from commit b4640cdc55)
2025-03-29 21:24:31 +00:00
Jeff Young 1d80bd4043 Use board layer names when available.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20360

(cherry picked from commit 6307f0aee8)
2025-03-29 21:24:31 +00:00
Jeff Young 3085ec0a5d Simplify (and fix) plated copper differentiation.
Also a few fixes for 3D rendering textboxes and
tables.

(cherry picked from commit 142f8265c5)
2025-03-29 21:24:31 +00:00
Jeff Young 5622a9e295 Adjust GTK STC margins. Yes, again.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16685

(cherry picked from commit 5094f750df)
2025-03-29 21:24:31 +00:00
Jeff Young 81585f7a83 Adjust GTK STC margins.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16685

(cherry picked from commit 858f6b0fc2)
2025-03-29 21:24:31 +00:00
Jeff Young 7c953d11f7 Improve text alignment in grids and one-line Scintilla controls.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16685

(cherry picked from commit 17712ba321)
2025-03-29 21:24:31 +00:00
Jeff Young 5fa1d0eaeb Fix format string.
(cherry picked from commit 0aa4f11970)
2025-03-29 21:24:31 +00:00
Jeff Young a0baef9d12 Cleanup.
(cherry picked from commit dd921354fc)
2025-03-29 21:24:31 +00:00
Jeff Young b112ca3944 Collapse SCH_TABLE border drawing into shared code.
Also pushes GetCornersInSequence() into EDA_SHAPE
so it can be shared between SCH_TABLE and PCB_TABLE.

Also fixes bug in drawing column rulings over the
right external border.

Also fixes a bug with dialog control enabling.

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

(cherry picked from commit 413d6747c5)
2025-03-29 21:24:31 +00:00
Jeff Young d271a47375 Update layer per page.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20352

(cherry picked from commit 1848401d5b)
2025-03-29 21:24:31 +00:00
Jeff Young a9adc64f3e Move layer arg parsing up so we can handle user-defined layer names.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18773

(cherry picked from commit 1333c4c305)
2025-03-29 21:24:31 +00:00
Jeff Young 65f9264531 Fix off-by-one error when dragging to the left.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20307

(cherry picked from commit 6708f7b10c)
2025-03-29 21:24:31 +00:00
Jeff Young d45fbaca96 Don't bleed settings between 3D viewer and 3D footprint preview.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17353

(cherry picked from commit 533551f014)
2025-03-29 21:24:31 +00:00
Jeff Young b007cb143d User-defined layers for 3D viewer.
(cherry picked from commit f33f10bb38)
2025-03-29 21:24:31 +00:00
Jeff Young 96bfa17469 Resolve variables in hrefs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20340

(cherry picked from commit f4a5404e0a)
2025-03-29 21:24:31 +00:00
Jeff Young e7ea87f454 Fix is-same logic in updateFootprintParameters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19988

(cherry picked from commit f9b19bbb5b)
2025-03-29 21:24:31 +00:00
Jeff Young e1c292e600 Check silk/soldermask collisions in FP checker.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19707

(cherry picked from commit 1ee3131e4a)
2025-03-29 21:24:31 +00:00
Jeff Young 537a8cc652 Allow context menus in footprint chooser when called from Eeschema.
Also moves several RAII utility classes (some of which
were duplicated in open code) to a common header file.

(cherry picked from commit b74c2791f4)
2025-03-29 21:24:30 +00:00
Jeff Young 62fa53ca96 Add tool framework to fp preview widget.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17107

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

(cherry picked from commit 9d051d096e)
2025-03-29 21:24:30 +00:00
Wayne Stambaugh c1575392e6 Begin version 9.0.2 development. 2025-03-29 13:33:59 -04:00
Wayne Stambaugh 4a3889f1fe Tag stable version 9.0.1 release. 2025-03-29 13:26:55 -04:00
jean-pierre charras afb5487fd5 French translation update 2025-03-29 12:50:25 +01:00
Seth Hillbrand 1d443ca74c Merge remote-tracking branch 'weblate/9.0' into 9.0 2025-03-28 16:55:27 -07:00
Anonymous 4ec80ee395 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.1% (9887 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-03-29 00:29:28 +01:00
Seth Hillbrand a00726378b Update translations 2025-03-28 16:28:28 -07:00
pominglee 33d891de29 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.3% (9899 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-03-29 00:27:51 +01:00
Adolfo Jayme Barrientos f875045b6a Translated using Weblate (Spanish)
Currently translated at 87.0% (8682 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-29 00:27:51 +01:00
pominglee 9f47704f04 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 98.6% (9837 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-03-29 00:27:51 +01:00
Adolfo Jayme Barrientos 630f23c11f Translated using Weblate (Spanish)
Currently translated at 87.0% (8679 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-29 00:27:51 +01:00
CloverGit 32d29d1d1f Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9968 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-29 00:27:51 +01:00
Henrik Kauhanen d2a94de5d5 Translated using Weblate (Swedish)
Currently translated at 99.9% (9960 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-29 00:27:51 +01:00
Wellington Terumi Uemura d72c23b602 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9968 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pt_BR/
2025-03-29 00:27:51 +01:00
CloverGit 43bb8dcb2d Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (9964 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-29 00:27:51 +01:00
Adolfo Jayme Barrientos 2d365f4037 Translated using Weblate (Spanish)
Currently translated at 86.8% (8660 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-29 00:27:51 +01:00
Ettore Atalan 429eebad4b Translated using Weblate (German)
Currently translated at 99.7% (9943 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-29 00:27:51 +01:00
yanzhen zhu 4b08c4ade8 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.7% (9940 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-29 00:27:51 +01:00
Marco Ciampa a103af96d7 Translated using Weblate (Italian)
Currently translated at 99.3% (9902 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-29 00:27:50 +01:00
lylythechosenone 3e0125628e Translated using Weblate (Spanish (Mexico))
Currently translated at 86.0% (8579 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es_MX/
2025-03-29 00:27:50 +01:00
Pferd O 457db26576 Translated using Weblate (German)
Currently translated at 99.7% (9942 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-29 00:27:50 +01:00
Henrik Kauhanen 96040df625 Translated using Weblate (Swedish)
Currently translated at 99.9% (9960 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-29 00:27:50 +01:00
dsa-t 1bfeececa5 Translated using Weblate (Russian)
Currently translated at 100.0% (9968 of 9968 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-03-29 00:27:50 +01:00
Seth Hillbrand 8027348d8a Remove accident call to default SSHKey
The sshkey should not be reset when changing to https protocol.

(cherry picked from commit deb14110aa)
2025-03-28 16:26:43 -07:00
Michael712 6a834f8811 Don't use transform coordination for height/width property display of rectangles
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20468

(cherry picked from commit d59f624001)
2025-03-28 17:50:28 +01:00
Seth Hillbrand 81914c846f Remove requirement for name
Name is not needed for new git repos and is hidden, so can't be set

(cherry picked from commit 22e1f70a7e)
2025-03-26 13:11:21 -07:00
Seth Hillbrand 579c08155f Update tree based on elements not map
Rather than updating the tree with all elements in the map (some of
which may have changed), we iterate over the tree and set those elements
that we find in the map.  This ensures that all elements updated in the
tree exist there
2025-03-26 13:10:10 -07:00
jean-pierre charras cac3a140cc Pcbnew, plot F&B Fab: ensure the DNP mark is plotted only on the right layer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20458

(cherry picked from commit 99e65afa1f)
2025-03-26 16:30:22 +01:00
jean-pierre charras c7f1d0a0ff Pcbnew, performance fix: rebuild the pad view only when mandatory.
The LAYER_PAD_HOLEWALLS shape needs a rebuild only when the zoom level changes.
So keep trace of the last GAL zoom level to rebuild the shape, and only rebuild
the view when needed

(cherry picked from commit 3e51b2c647)
(and from commit 3dfd164e2b)
2025-03-26 15:14:05 +01:00
Tomasz Wlostowski 56c05869dd router: don't try to lock the first vertex of a zero-vertex line. Might crash (sometimes).
Fixes https://gitlab.com/kicad/code/kicad/issues/20440

(cherry picked from commit 5f620f0fa1)
2025-03-26 07:47:56 -04:00
Tomasz Wlostowski b9f249226a KIGIT: fix crash when the repo has no remote set
(cherry picked from commit 1638322649)
2025-03-25 14:44:31 -04:00
Wayne Stambaugh 77588e0d0f Tag stable version 9.0.1 release candidate 2. 2025-03-24 15:21:48 -04:00
Seth Hillbrand 80e45b2f1d Update translations 2025-03-24 12:07:28 -07:00
Håvard Syslak dfea0b4dd5 Translated using Weblate (Norwegian Bokmål)
Currently translated at 41.0% (4092 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/nb_NO/
2025-03-24 20:00:30 +01:00
Viktor Döme b6b3245cfc Translated using Weblate (Hungarian)
Currently translated at 6.0% (603 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/hu/
2025-03-24 20:00:30 +01:00
Adolfo Jayme Barrientos aa4d019efb Translated using Weblate (Spanish)
Currently translated at 86.8% (8646 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-24 20:00:30 +01:00
Adolfo Jayme Barrientos cbdad19566 Translated using Weblate (Catalan)
Currently translated at 41.9% (4173 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-03-24 20:00:30 +01:00
Adolfo Jayme Barrientos 299ed49de6 Translated using Weblate (Spanish)
Currently translated at 86.2% (8586 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-24 20:00:30 +01:00
co8 j 8ecbdb4f3d Translated using Weblate (Japanese)
Currently translated at 99.9% (9954 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-03-24 20:00:30 +01:00
Adolfo Jayme Barrientos f8f905025d Translated using Weblate (Spanish)
Currently translated at 86.1% (8575 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-24 20:00:30 +01:00
Adolfo Jayme Barrientos a14830b796 Translated using Weblate (Catalan)
Currently translated at 41.8% (4167 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-03-24 20:00:30 +01:00
ZbeeGin 537e3e625b Translated using Weblate (Polish)
Currently translated at 100.0% (9957 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-03-24 20:00:29 +01:00
Marco Ciampa 1d6a67d2b2 Translated using Weblate (Italian)
Currently translated at 99.3% (9890 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-24 20:00:29 +01:00
Marco Ciampa 285c549394 Translated using Weblate (Italian)
Currently translated at 98.6% (9827 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-24 20:00:29 +01:00
Marco Ciampa c2c915c98c Translated using Weblate (Italian)
Currently translated at 98.2% (9785 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-24 20:00:29 +01:00
Marco Ciampa 1c894f0e9a Translated using Weblate (Italian)
Currently translated at 98.0% (9765 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-24 20:00:29 +01:00
Marco Ciampa 4ea24a4d39 Translated using Weblate (Italian)
Currently translated at 97.5% (9709 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-24 20:00:29 +01:00
Adolfo Jayme Barrientos 817aa5670e Translated using Weblate (Spanish)
Currently translated at 85.3% (8498 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-24 20:00:29 +01:00
Pferd O eddd925269 Translated using Weblate (German)
Currently translated at 99.8% (9942 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-24 20:00:29 +01:00
Adolfo Jayme Barrientos 61bcf85fb3 Translated using Weblate (Spanish)
Currently translated at 85.3% (8497 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-24 20:00:29 +01:00
ZbeeGin 8c5e98ee03 Translated using Weblate (Polish)
Currently translated at 100.0% (9957 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-03-24 20:00:29 +01:00
Adolfo Jayme Barrientos 20138d20f9 Translated using Weblate (Spanish)
Currently translated at 85.1% (8477 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-24 20:00:29 +01:00
Tokita, Hiroshi 57fc76cb22 Translated using Weblate (Japanese)
Currently translated at 99.9% (9952 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-03-24 20:00:29 +01:00
Adolfo Jayme Barrientos de9fa7bdb1 Translated using Weblate (Spanish)
Currently translated at 84.6% (8429 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/es/
2025-03-24 20:00:28 +01:00
Marco Ciampa 6b5525f946 Translated using Weblate (Italian)
Currently translated at 97.4% (9706 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-24 20:00:28 +01:00
Tokita, Hiroshi a9e29a957a Translated using Weblate (Japanese)
Currently translated at 99.8% (9943 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-03-24 20:00:28 +01:00
Marco Ciampa ee1951cd58 Translated using Weblate (Italian)
Currently translated at 96.7% (9638 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-24 20:00:28 +01:00
Niyazi d66879cafa Translated using Weblate (Turkish)
Currently translated at 65.6% (6538 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-24 20:00:28 +01:00
Wellington Terumi Uemura 3c6631bdb2 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9957 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pt_BR/
2025-03-24 20:00:28 +01:00
Henrik Kauhanen f40be70e07 Translated using Weblate (Swedish)
Currently translated at 99.9% (9956 of 9957 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-24 20:00:28 +01:00
Seth Hillbrand 151d745922 Enable/disable git tracking in user prefs
Don't require advanced config for people who want to disable

(cherry picked from commit f83e607e6e)
2025-03-24 11:58:57 -07:00
Jon Evans bd3cc02b18 Mark pad as dirty when changing layerset
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20435


(cherry picked from commit 8921824128)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-23 20:10:07 -04:00
Seth Hillbrand 8acf694129 Trying again to fix Mac build
(cherry picked from commit ea36110980)
2025-03-23 10:53:44 -07:00
Seth Hillbrand 348700eb1d Fix builds for newer libgit2 (1.8.0 and newer)
(cherry picked from commit b65ceb60b2)
2025-03-23 10:53:44 -07:00
Seth Hillbrand c0d20fce9e Fix build on Windows
(cherry picked from commit faf6243d1a)
2025-03-23 10:53:44 -07:00
Seth Hillbrand bf0bd05c75 Fix some regressions in git handling
Set default to rebase for pull
Update error string on auth failure
Improve trace logging

(cherry picked from commit b8225ba2d6)
2025-03-23 10:53:44 -07:00
Seth Hillbrand d2550138bc Don't re-read tokens on error
If the data were empty, there is no token, so curTok will represent the
right paren, not the next token

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20301
2025-03-20 13:12:12 -07:00
Jon Evans 029f72161b Handle duplicate entries in BOM presets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20342

(cherry picked from commit 4ef0d3554e)
2025-03-17 18:45:15 -04:00
Jon Evans 87457cfdaf Code style
(cherry picked from commit 2ef123d9e1)
2025-03-17 18:45:02 -04:00
Alex Shvartzkop c258b99d2f Update translations 2025-03-17 18:43:29 +03:00
Marco Ciampa b436a4fd2a Translated using Weblate (Italian)
Currently translated at 96.4% (9606 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-17 16:42:14 +01:00
ZbeeGin 98becb9814 Translated using Weblate (Polish)
Currently translated at 99.8% (9942 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-03-17 16:42:14 +01:00
Jan Straka 49c352a95e Translated using Weblate (Czech)
Currently translated at 77.9% (7765 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/cs/
2025-03-17 16:42:14 +01:00
Marco Ciampa 96541f9ef7 Translated using Weblate (Italian)
Currently translated at 96.0% (9567 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-17 16:42:14 +01:00
Ertuğrul Reisoğlu 0dfe8ce154 Translated using Weblate (Turkish)
Currently translated at 65.6% (6537 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-17 16:42:14 +01:00
Marco Ciampa bcf992f22f Translated using Weblate (Italian)
Currently translated at 96.0% (9565 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-17 16:42:14 +01:00
Henrik Kauhanen a8d79ec4be Translated using Weblate (Swedish)
Currently translated at 99.9% (9955 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-17 16:42:14 +01:00
NAXSISFLYBY a38a76791f Translated using Weblate (Turkish)
Currently translated at 65.5% (6529 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-17 16:42:14 +01:00
dsa-t 44c66225e7 Translated using Weblate (Russian)
Currently translated at 99.9% (9954 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-03-17 16:42:13 +01:00
Jan Straka c973fa7ad0 Translated using Weblate (Czech)
Currently translated at 76.6% (7629 of 9956 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/cs/
2025-03-17 16:42:13 +01:00
Wayne Stambaugh 3993e6dcb0 Tag stable version 9.0.1 release candidate 1. 2025-03-17 08:25:45 -04:00
Seth Hillbrand e1436d3597 Fix inheritance for git_common
Avoids repo type pointer issues when casting from void

(cherry picked from commit 676dd4ceec)
2025-03-16 18:04:47 -07:00
aris-kimi 28ba36129a Fix a git2 related crash when closing KiCad
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20202
(cherry picked from commit bb62444fe9)
2025-03-16 18:03:16 -07:00
Seth Hillbrand c6abc5fdd0 Add ability for git to negotiate with agents
Updates the git connection dialog to reflect default agentic behavior,
followed by default keys and only then reverting to a custom selection
if the user desires

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

(cherry picked from commit 2c52f98da4)
2025-03-16 18:03:16 -07:00
Seth Hillbrand 6104651613 Adjust git handling
- Utilize scoped deletion for individual git_*_free() calls
- Protect against multiple usage when updating icons
- Reduce frequency of git update calls

(cherry picked from commit 26c331a837)
2025-03-16 18:03:16 -07:00
Jon Evans 5b88f2509e Use stable sort ordering in ERC reports
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20333


(cherry picked from commit fe22166d9f)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-16 11:22:06 -04:00
Jon Evans 6768e34e0e Use UI order for drill report stackup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20069


(cherry picked from commit 77747aa41e)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-16 11:13:37 -04:00
Alex Shvartzkop 372b704844 Update translations 2025-03-15 19:01:17 +03:00
Marco Ciampa 3648c8c31a Translated using Weblate (Italian)
Currently translated at 96.1% (9568 of 9955 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-15 16:58:36 +01:00
İclal Gör 2df3924ea0 Translated using Weblate (Turkish)
Currently translated at 65.5% (6529 of 9955 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-15 16:58:36 +01:00
Marco Ciampa 48d194a0fc Translated using Weblate (Italian)
Currently translated at 96.1% (9569 of 9955 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-15 16:58:36 +01:00
Shuwn Hsu 8a3d7d66a1 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 91.0% (9065 of 9955 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-03-15 16:58:36 +01:00
İclal Gör d7c9c8aeca Translated using Weblate (Turkish)
Currently translated at 65.5% (6524 of 9955 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-15 16:58:36 +01:00
Marco Ciampa 48d3b67686 Translated using Weblate (Italian)
Currently translated at 96.0% (9566 of 9955 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-15 16:58:35 +01:00
Henrik Kauhanen a4ac97d5de Translated using Weblate (Swedish)
Currently translated at 99.9% (9954 of 9955 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-15 16:58:35 +01:00
dsa-t bb525e3c68 Translated using Weblate (Russian)
Currently translated at 100.0% (9955 of 9955 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-03-15 16:58:35 +01:00
Wayne Stambaugh d4002b95d4 Revert "Tag stable version 9.0.1 release candidate 1."
This reverts commit ae4978502f.
2025-03-15 09:00:27 -04:00
Wayne Stambaugh ae4978502f Tag stable version 9.0.1 release candidate 1. 2025-03-15 07:25:25 -04:00
Seth Hillbrand c4ad3456f4 Fix mistake in arc circle collision
Need to test nearest point from the circle center to the arc.  Add QA to
prevent regression

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

(cherry picked from commit de09403b10)
2025-03-14 18:06:54 -07:00
Eli Hughes c521dabcf0 Seeding a simple python script to create a test server for http libs.
(cherry picked from commit e972fb42ee)
2025-03-14 16:55:49 -07:00
Graham Keeth b5716ef54b improve tooltips in sync sheet pins dialog
(cherry picked from commit 89a5fadcdc)
2025-03-14 16:55:24 -07:00
Graham Keeth 9515bf9038 Add ellipses for sheet/sheet pin actions
(cherry picked from commit c57088a60c)
2025-03-14 16:55:05 -07:00
Graham Keeth 38dcfdc350 capitalize Git in display strings
(cherry picked from commit 68869f6439)
2025-03-14 16:54:45 -07:00
Seth Hillbrand 55aeca477d Unify embedded file writing
For unknown reasons, one method of writing was not working on Windows.
This is an attempt to write using the common wxFFileOutputStream to see
if that results in better output for Windows clients

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

(cherry picked from commit 03af293683)
2025-03-14 16:52:12 -07:00
Seth Hillbrand 572fcdfa22 Update fp properties even when can't update fp
When updating the footprint, we may encounter a missing footprint.  We
should still modify the netlist against the existing footprint (if one
does exist) to match the netlist.  This matches the behavior of updating
the netlist when fp are not selected for update

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

(cherry picked from commit 72411af9de)
2025-03-14 16:51:26 -07:00
Eric 234994bf53 ODB++:Fix date format in misc/info file
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20103

(cherry picked from commit 92cdca69b3)
2025-03-14 16:51:18 -07:00
Seth Hillbrand 49d8fc900f Map a full hierarchy during PDF plotting
Re-create the schematic hierarchy in PDF plots to ease navigation
relative to the on screen schematic

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

(cherry picked from commit 4a3b33df4e)
2025-03-14 16:51:18 -07:00
JamesJCode 27b55eb32f Include child SCH_PINs in SCH_RULE_AREA item caches
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20332

(cherry picked from commit 078a01976f)
2025-03-14 20:58:15 +00:00
jean-pierre charras cf118f142c plot mask layers: do not skip mask on track when solder mask min web is not 0
When solder mask min web is not 0, PlotSolderMaskLayer() uses GenerateLayerPoly(),
that skipped tracks (not updated since tracks can be on a mask layer)

(cherry picked from commit 7f1b412203)
2025-03-14 16:10:31 +01:00
Jeff Young be0c8c88e5 Don't modify selection in the middle of a move/drag.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20239
2025-03-14 14:52:04 +00:00
Jeff Young de953b0fdb Refresh preview after rotate/flip/mirror during move.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19561

(cherry picked from commit 3c32f4d31d)
2025-03-14 14:52:04 +00:00
Jeff Young 3ea0191954 Init checkboxes after reading prefs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20309

(cherry picked from commit 521b411090)
2025-03-14 14:52:04 +00:00
Jon Evans f835591c8b Simulator: Fix line offset in intermediate ngspice file
- Fixes issue #20268
- Replace the hard coded line numbers
- Search for "Value:" string instead


(cherry picked from commit 313232c9f3)

Co-authored-by: Lucas Gerads <lucas.gerads@aixcon.de>
2025-03-13 18:30:24 -04:00
Jeff Young 12fcf31dc5 Fix failure to increment job number.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20034

(cherry picked from commit 2304d10879)
2025-03-13 16:55:32 +00:00
Jeff Young 31b65a241f Don't report non-meeting line-pairs.
We're called on each line pair, so a rect would otherwise
always report to failures for the two pairs of opposite
sides.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20326
2025-03-13 16:30:48 +00:00
Alex Shvartzkop 2bf369793c Fix Eagle PCB layers handling after v9 layer changes. 2025-03-13 17:48:29 +03:00
Jeff Young 12680cfecb Render tables & their borders to 3D view.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19981

(cherry picked from commit f3f9730f2c)
2025-03-13 14:04:50 +00:00
Jeff Young ff578d9866 De-duplicate table border drawing code.
Also cleans up a misconception about table header borders,
and renames the getter/setter to be clearer.

Also makes sure that table cells are updated when the table
layer changes.

And another bug where we were writing the grey color value
back to the cell for hidden cells.
2025-03-13 13:08:30 +00:00
Jeff Young 48e254fe4c EE -> SCH (no functional changes) 2025-03-13 12:28:25 +00:00
Alex Shvartzkop 222bfda5c3 Update translations 2025-03-13 15:26:42 +03:00
Marco Ciampa c93d8115cb Translated using Weblate (Italian)
Currently translated at 95.9% (9555 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-13 13:23:35 +01:00
dsa-t 5c1d7f11d7 Translated using Weblate (Russian)
Currently translated at 100.0% (9954 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-03-13 13:23:35 +01:00
İclal Gör 90d64e3eb1 Translated using Weblate (Turkish)
Currently translated at 60.3% (6010 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:35 +01:00
İclal Gör 8cbd172c3c Translated using Weblate (Turkish)
Currently translated at 60.2% (5997 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:35 +01:00
İclal Gör 69de87675a Translated using Weblate (Turkish)
Currently translated at 58.7% (5845 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:35 +01:00
Argeolog 33492efb01 Translated using Weblate (Turkish)
Currently translated at 58.1% (5785 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:35 +01:00
2tama3 e22e2c5109 Translated using Weblate (Japanese)
Currently translated at 99.9% (9950 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-03-13 13:23:35 +01:00
Marc de Miguel 8937a7cc82 Translated using Weblate (Catalan)
Currently translated at 41.7% (4159 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-03-13 13:23:35 +01:00
Ahmet Saygın ÖĞÜLMÜŞ 141eb9d1b7 Translated using Weblate (Turkish)
Currently translated at 58.1% (5786 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:35 +01:00
Marc de Miguel f291629c64 Translated using Weblate (Catalan)
Currently translated at 41.6% (4141 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-03-13 13:23:35 +01:00
İclal Gör b4dbba2f5f Translated using Weblate (Turkish)
Currently translated at 58.0% (5775 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:35 +01:00
Marc de Miguel bafa055114 Translated using Weblate (Catalan)
Currently translated at 41.5% (4133 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-03-13 13:23:35 +01:00
dsa-t 2ca4f60729 Translated using Weblate (Turkish)
Currently translated at 57.2% (5699 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:35 +01:00
İclal Gör 9451214ecf Translated using Weblate (Turkish)
Currently translated at 57.2% (5699 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:35 +01:00
Marc de Miguel 635974cfcc Translated using Weblate (Catalan)
Currently translated at 41.4% (4129 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-03-13 13:23:35 +01:00
İclal Gör a40c4c68d1 Translated using Weblate (Turkish)
Currently translated at 55.1% (5488 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:34 +01:00
CloverGit b422281eb8 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (9946 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-13 13:23:34 +01:00
Argeolog 5e3eda108f Translated using Weblate (Turkish)
Currently translated at 54.7% (5454 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:34 +01:00
İclal Gör 5bd28c9569 Translated using Weblate (Turkish)
Currently translated at 54.7% (5454 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:34 +01:00
CloverGit fc562ba229 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 91.0% (9063 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hant/
2025-03-13 13:23:34 +01:00
CloverGit e3ab4b066c Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.8% (9943 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-13 13:23:34 +01:00
Ahmet Saygın ÖĞÜLMÜŞ edfba6ce84 Translated using Weblate (Turkish)
Currently translated at 54.6% (5442 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:34 +01:00
Henrik Kauhanen 7f7b023c19 Translated using Weblate (Swedish)
Currently translated at 99.9% (9953 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-13 13:23:33 +01:00
Ettore Atalan 2e9c197f09 Translated using Weblate (German)
Currently translated at 99.9% (9949 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-13 13:23:33 +01:00
Ahmet Saygın ÖĞÜLMÜŞ f8db7a2aca Translated using Weblate (Turkish)
Currently translated at 54.4% (5423 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-13 13:23:33 +01:00
dsa-t 34138ffc42 Translated using Weblate (Russian)
Currently translated at 100.0% (9954 of 9954 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-03-13 13:23:33 +01:00
jean-pierre charras 10d34f5b9b Eeschema printing: ensure the flag "is first page" is correctly set.
It is mainly used to draw page layouts having different objects drawn on
first page and other pages.

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

(cherry picked from commit ddd27f2869)
2025-03-13 11:36:07 +01:00
Seth Hillbrand 7cb85e2dd1 Correct layerset calls
The Board layerset (because BOARD is a BOARD_ITEM) should return the
layers that the board contains instead of just the F.Cu.  This assigns
the common function to map to the board-specific functions

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

(cherry picked from commit 96794e94e3)
2025-03-12 11:49:11 -07:00
Seth Hillbrand 34906f0871 Be sure to clear hit cache
When re-running the DRC creepage check, we need to ensure that the
element-element hittest set is cleared to report the same errors again

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

(cherry picked from commit 1c245ad01e)
2025-03-12 11:49:08 -07:00
jean-pierre charras 2fa818b002 LISTBOX_TRICKS::listBoxDeleteSelected(): fix crash when trying to remove 0 entries.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20320

(cherry picked from commit dd604361d3)
2025-03-12 16:06:38 +01:00
Jeff Young 9e98bb68d7 Add textOnEdgeCuts to global DRC items list.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20308

(cherry picked from commit 6df9c90440)
2025-03-12 11:32:12 +00:00
Jeff Young 4b26e737c0 Don't wait for mouse move to draw selection shadows.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20309
2025-03-12 09:39:03 +00:00
jean-pierre charras bcb8c2097c BOARD::BulkRemoveStaleTeardrops(): fix bug that prevent removing a teardrop.
When a teardrop is the first zone (or the only one) in list (i.e. last tested)
it was ignored, and therefore not removed.

(cherry picked from commit ccc396a6c2)
2025-03-12 09:51:38 +01:00
Jon Evans 028721f3ed Don't use size events for persistence
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20060


(cherry picked from commit 95e6ca44c6)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-11 22:37:29 -04:00
Jon Evans b837dc1d3b Fix build with protobuf 30
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20300


(cherry picked from commit 5774338af2)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-11 17:33:47 -04:00
Jeff Young 3446dbbf27 Apply Damjan's rotated table fixes to PCB_TABLE::GetEffectiveShape().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20143

(cherry picked from commit b7ef57a97d)
2025-03-11 20:17:47 +00:00
Jeff Young aee836d722 Don't disable first internal layer in footprint editor.
It's used as a proxy for all internal layers.

Also fixes LAYER_RANGE_ITERATOR so that it works with an odd
number of copper layers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20246
2025-03-11 18:41:35 +00:00
Seth Hillbrand 5d9908647c Don't write empty data tags
Also avoid throwing if a data stream is empty so that you can still read
the schematic/pcb/library

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

(cherry picked from commit a6fbf4bbdb)
2025-03-11 09:45:17 -07:00
Jeff Young 631c5ec01d Tables support for router.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20295

(cherry picked from commit 567da3de91)
2025-03-11 16:39:59 +00:00
Jeff Young d92f42cdcb Check parent footprint as well for component class.
Also output more descriptive text when checking inherited
rules on parent footprint.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20281
2025-03-11 16:39:59 +00:00
Tomasz Wlostowski a4893523e4 router: simplify post-walkaround lines 2025-03-11 13:40:14 +01:00
Tomasz Wlostowski 4dc0a31071 multichannel: possible fix for ghosting footprints when using grouping
(cherry picked from commit c05cc345f3)
2025-03-11 13:40:14 +01:00
Tomasz Wlostowski c65a1139cb connectivity: treat empty FPIDs as matching in TOPO_MATCH
(cherry picked from commit b1bf5127fa)
2025-03-11 13:40:14 +01:00
Tomasz Wlostowski 71aae415a4 connectivity: TOPO_MATCH now orders reference components by the lowest matching candidate count.
This heuristic seems to make the algorithm reject non-isomorphic mappings much earlier on and converges faster on a solution for typical circuits.

(cherry picked from commit 8192ba73d9)
2025-03-11 13:40:14 +01:00
Tomasz Wlostowski 7061b64319 connectivity: TOPO_MATCH now prioritizes component candidates by the ratio of matching pad nets.
This improves cloning of circuits with numerous of matching component mappings (e.g. LED matrices) by
taking preference for mappings with same order of net connections.

(cherry picked from commit 91ee987cfe)
2025-03-11 13:40:14 +01:00
Tomasz Wlostowski 03da07767d router: refine the endpoint moving logic so that it doesn't block shoving
(cherry picked from commit b4d29a98f9)
2025-03-11 13:40:14 +01:00
Tomasz Wlostowski f3c5b21b1b router: fix regression in post-shove optimization
Note to self: we keep track of the formerly pushed vias in the line stack, but pruning one from the optimizer queue should not prune the lines attached to it.

(cherry picked from commit 78fc95fd6d)
2025-03-11 13:40:14 +01:00
Tomasz Wlostowski 69eb81196d router: prevent assertion fail in MULTI_DRAGGER
Fixes https://gitlab.com/kicad/code/kicad/issues/20075

(cherry picked from commit 9e4947ed36)
2025-03-11 13:40:14 +01:00
Tomasz Wlostowski f23b06de27 router: prevent disconencting via fanout traces when shoving
Note to self: move-endpoints fallback mode must check for vias connected at the obstacle LINE's ends - fallback is only applicable for unconnected ends.

(cherry picked from commit 29a4ec0fde)
2025-03-11 13:40:14 +01:00
Tomasz Wlostowski badaac9366 router: improved shove litter fix
Note to self: managing the shove stack is quite challenging and there were a few corner cases
where reverse via/segment collisions would cause a head segment (or a via) to have multiple clones in the stack.
As SHOVE::removeHeads() took only complete head lines, sometimes it resulted with stray vias/segments.

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

(cherry picked from commit bfbdfcf872)
2025-03-11 13:40:14 +01:00
Jon Evans 215c3fdf77 Switch to operator= for item updates
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20206


(cherry picked from commit d0b22d21bb)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-10 19:19:55 -04:00
dsa-t b658031b8c Don't translate wxFileDialog "All Files" filter.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20297


(cherry picked from commit c4655da4e6)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-03-10 16:07:01 +03:00
Jeff Young 02b756189b Formatting.
(cherry picked from commit e163c40e54)
2025-03-09 18:18:32 +00:00
Jeff Young d2af56597e DRC for tables. (And some fixes for dimensions.)
(cherry picked from commit a468c486eb)
2025-03-09 18:18:32 +00:00
Jeff Young f862eea1b9 Group members are still children of the board (not
the group).

(cherry picked from commit 4b38932129)
2025-03-09 18:18:32 +00:00
Alex Shvartzkop 73f495c67d Update translations 2025-03-09 19:05:14 +03:00
dsa-t b46780ad46 Translated using Weblate (Turkish)
Currently translated at 53.6% (5339 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-09 17:03:59 +01:00
Argeolog 9762fb855d Translated using Weblate (Turkish)
Currently translated at 53.6% (5340 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-09 17:01:51 +01:00
Argeolog 9d156891c6 Translated using Weblate (Turkish)
Currently translated at 53.4% (5324 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-09 16:37:45 +01:00
Argeolog b73b154abc Translated using Weblate (Turkish)
Currently translated at 53.4% (5315 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/tr/
2025-03-09 16:33:20 +01:00
Wellington Terumi Uemura 1d9a5c33ca Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9953 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pt_BR/
2025-03-09 16:33:20 +01:00
ZbeeGin 12dac14ba6 Translated using Weblate (Polish)
Currently translated at 99.7% (9931 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-03-09 01:47:31 +01:00
CloverGit 116aa3d344 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.8% (9942 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-09 01:47:31 +01:00
Rigo Ligo 7219a5dd77 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.8% (9942 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-09 01:47:31 +01:00
co8 j 729d14827e Translated using Weblate (Japanese)
Currently translated at 99.9% (9949 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-03-09 01:47:31 +01:00
Henrik Kauhanen e8ec50e04c Translated using Weblate (Swedish)
Currently translated at 99.9% (9952 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-09 01:47:30 +01:00
Marco Ciampa 8b2e70afb0 Translated using Weblate (Italian)
Currently translated at 96.0% (9557 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-09 01:47:30 +01:00
Henrik Kauhanen 21384b64f7 Translated using Weblate (Finnish)
Currently translated at 99.1% (9870 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/fi/
2025-03-09 01:47:30 +01:00
CloverGit 184798b770 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.8% (9939 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-09 01:47:30 +01:00
dsa-t f93a954c7b Translated using Weblate (Russian)
Currently translated at 100.0% (9953 of 9953 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-03-09 01:47:30 +01:00
JamesJCode a69d6a129a Mirror netclass DRC expression semantics for component classes
With this change, "A.Component_Class == 'SOME_CLASS'" will return
true if either SOME_CLASS exists in the list of component classes
attached o the footprint, or if SOME_CLASS is the full component
class name.

(cherry picked from commit 85e6978aa2)
2025-03-08 22:20:55 +00:00
Jeff Young 491af0df39 When following board or plot settings, write results to current config.
Also adds migration from older layer numbers to strings.
This may require users to dump their 9.0 settings files
(which will have the wrong layer numbers in them), but
those files are often useless anyway as they'll already
have messed up colours if they were migrated from 8.0.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18709
2025-03-08 19:10:39 +00:00
jean-pierre charras 34458cf738 Pcbnew: remove dead code.
The export SVG dialog was removed some time ago (merged with plot svg).
But some settings of this removed dialogs were not removed.

(cherry picked from commit 9a1cf81ca6)
2025-03-08 13:35:15 +01:00
jean-pierre charras 809948333e Fix compil warnings
(cherry picked from commit 9d1b320896)
2025-03-08 09:42:15 +01:00
Seth Hillbrand 1a6160b132 Removed shared_ptr circular references
When A references B and B references A, the shared pointer reference
count will never go to zero by just removing the parent container.  We
need to explicitly clear the shared pointer references when we are done

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

(cherry picked from commit 641e06e67c)
2025-03-07 17:31:32 -08:00
JamesJCode 51f588b55b Check for constituent netclasses in DRC netclass equality checks
This reverts previous behaviour whereby 'A.Netclass == x' compared
the full name of an effective netclass (e.g. 'Class1,Default'). This
was found to be unexpected behaviour to users, who were expecting
the equality to compare single netclasses. The equality check now
first checks for a constituent class with the given name, and then
falls back to a check of the full class name.

Inequality requires the netclass name being tested to not be a
constituent netclass and to not be the full class name.

(cherry picked from commit f0e287a87b)
2025-03-07 23:57:13 +00:00
Seth Hillbrand 1effbe5d01 Prevent ERC error with NC pin+NC marker
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20222

(cherry picked from commit 4f6a73d83c)
2025-03-07 15:26:06 -08:00
Seth Hillbrand 50711b1294 Revert "Allow a no-connect to connect to a single pin (but not multiple pins)."
This reverts commit ee4a6127c6.

(cherry picked from commit 2b557c5497)
2025-03-07 15:25:53 -08:00
Damjan b3ba8d78b5 pcbnew: table rotation: table jumps if rotation ends at 180°
(cherry picked from commit bded181ad0)
2025-03-07 20:39:59 +00:00
Jeff Young 11df4b32eb Fix merge mess-up.
(cherry picked from commit 727fc9bd06)
2025-03-07 19:00:46 +00:00
Jeff Young 1de9a83ff0 Printing is not zoom-specific.
(Some of these items don't currently get printed, but
there's no sense in leaving a latent bug around in case
we ever change our minds.)

(cherry picked from commit 877c6bce89)
2025-03-07 19:00:10 +00:00
Jeff Young 25de338bdd Support ctrl-delete for delete word forward.
(On non-Macs, anyway.  Mac doesn't appear to use this
paradigm.)

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

(cherry picked from commit ce5469b95e)
2025-03-07 19:00:05 +00:00
Seth Hillbrand 4df101b94e Ensure imported schematic sheet names are unique
Altium doesn't require sheet names to be unique but KiCad does, so we
disambiguate the names when importing

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

(cherry picked from commit ca51b0f37d)
2025-03-06 16:10:08 -08:00
Seth Hillbrand cf78215276 Fix multi-unit symbol import in Altium sch
Set the library symbol equal to total unit count so that we can assign
elements to the correct unit in the SCH_SYMBOL

(cherry picked from commit 81fcc16cc9)
2025-03-06 15:20:44 -08:00
JamesJCode ed5ec0f749 Don't dereference null COMPONENT_CLASS in testFootprintSelector
This can happen when running standalone, where component classes
have not been resolved.

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

(cherry picked from commit 54540f9e82)
2025-03-06 21:45:38 +00:00
Seth Hillbrand 2da1294492 Fix IsEffectiveLine calculation
We sometimes represent circles as 360° arcs.  These are approximately
colinear but are definitely not a line

(cherry picked from commit c24832f72b)
2025-03-06 12:45:39 -08:00
Wayne Stambaugh 04733511fc Use case insensitive comparison in symbol footprint filter match DRC.
This keeps the DRC test in line with the ERC test which is also case
insensitive.

(cherry picked from commit a1b78d170d)
2025-03-06 15:42:03 -05:00
JamesJCode 1414e90ce9 Fix Specctra export for multiple netclasses
(cherry picked from commit 57952a7a86)
2025-03-06 20:25:58 +00:00
Seth Hillbrand 5c492429be Printing should never hide small elements
Since it is effectively infinite resolution, pass the vectors to the
printer and let it decide if there should be a dot there or not.  Hiding
based on perspective is a screen optimization

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

(cherry picked from commit 8e048d0c42)
2025-03-06 12:18:57 -08:00
jean-pierre charras e9e2c9399b French translation update 2025-03-06 18:12:27 +01:00
jean-pierre charras 58422f2c97 SCH_IO_MGR::GuessPluginTypeFromLibPath(): fix issue for new .kicad_sym files
GuessPluginTypeFromLibPath() was previously testing the type, but also the
existence of the lib file of *.kicad_sym filename, but when creating a new lib,
its existence obviously must not be tested

(cherry picked from commit e54c73b516)
2025-03-06 18:12:27 +01:00
Jeff Young 618077bbf2 Resolve hotkey conflicts.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18201
2025-03-06 16:15:23 +00:00
Jeff Young 6aa274bc0d Formatting.
(cherry picked from commit 52648497b2)
2025-03-06 16:15:23 +00:00
Jeff Young 12f460cc7a Don't treat version-bumped file as modified.
But do allow Save to still work.

(cherry picked from commit 5c91a7fa3a)
2025-03-06 16:15:23 +00:00
JamesJCode cbe22a23b8 Enable use of double properties in DRC rules expression parser
Also fixes name clash with Orientation property for footprints

(cherry picked from commit 671d84562b)
2025-03-06 15:41:40 +00:00
jean-pierre charras 0f8f9214b0 Fix compil issue on mingw (missing change from OUTPUT to DESTINATION)
(cherry picked from commit a32c0a8687)
2025-03-06 15:59:58 +01:00
Jeff Young 4f63cb6a26 Move arrow direction to more appropriate section.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20208

(cherry picked from commit 124eccb710)
2025-03-06 14:26:59 +00:00
Alex Shvartzkop 64d8bbd1d9 Update translations 2025-03-06 13:54:46 +03:00
Marco Ciampa f957dfa218 Translated using Weblate (Italian)
Currently translated at 95.8% (9540 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-06 11:53:21 +01:00
CloverGit 0d18ad188b Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.8% (9939 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-06 11:53:21 +01:00
Henrik Kauhanen bf189855f8 Translated using Weblate (Swedish)
Currently translated at 99.9% (9950 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-06 11:53:21 +01:00
Marco Ciampa 81658cb2c9 Translated using Weblate (Italian)
Currently translated at 95.6% (9523 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-06 11:53:21 +01:00
Henrik Kauhanen 5e80f4bf32 Translated using Weblate (Finnish)
Currently translated at 99.1% (9870 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/fi/
2025-03-06 11:53:21 +01:00
Kliment 684b92dfa6 Translated using Weblate (Finnish)
Currently translated at 99.1% (9870 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/fi/
2025-03-06 11:53:20 +01:00
Henrik Kauhanen 22e2850cdc Translated using Weblate (German)
Currently translated at 99.9% (9949 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-06 11:53:20 +01:00
Pferd O be7b69172f Translated using Weblate (German)
Currently translated at 99.9% (9949 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-06 11:53:20 +01:00
Kliment 07f74ab56e Translated using Weblate (German)
Currently translated at 99.9% (9949 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-06 11:53:20 +01:00
Henrik Kauhanen 89bbaa6d2e Translated using Weblate (Swedish)
Currently translated at 99.9% (9946 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-06 11:53:20 +01:00
Kliment ce8737936e Translated using Weblate (Finnish)
Currently translated at 98.7% (9830 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/fi/
2025-03-06 11:53:20 +01:00
Kliment 8c45d3621e Translated using Weblate (German)
Currently translated at 99.9% (9946 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-06 11:53:20 +01:00
Wellington Terumi Uemura bae042b934 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9951 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pt_BR/
2025-03-06 11:53:20 +01:00
CloverGit 5e724a2909 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.8% (9939 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-06 11:53:20 +01:00
Henrik Kauhanen 4810f50083 Translated using Weblate (Swedish)
Currently translated at 99.9% (9944 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-06 11:53:20 +01:00
co8 j 771c6b21df Translated using Weblate (Japanese)
Currently translated at 99.9% (9946 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-03-06 11:53:20 +01:00
Pferd O 5f1feb4532 Translated using Weblate (German)
Currently translated at 99.8% (9934 of 9951 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-06 11:53:20 +01:00
Jeff Young 759b279009 Allow a no-connect to connect to a single pin (but not multiple pins).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20222
2025-03-06 10:26:30 +00:00
Jeff Young 456fc581f1 Don't flag double no-connect annotations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20222
2025-03-06 10:26:30 +00:00
Jon Evans d18d47fbeb Fix accidental removal of properties pane
(cherry picked from commit 984041f57e)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-05 17:45:19 -05:00
JamesJCode efae811143 Fix incorrect inequality in component class expression evaluation
(cherry picked from commit a091b6c1c9)
2025-03-05 19:11:12 +00:00
Jeff Young f7eb925bfe An arbitrary layer flip can not be done without the board.
(User-defined layers can be sided or not.)

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

(cherry picked from commit 9856cb2210)
2025-03-05 18:01:09 +00:00
Jeff Young f92c46d585 User layer bug fixes.
1) Don't set user layer count right after we've
cleared the enabled user layers.  (It will
always be 0 by then.)

2) Allow un-enabled layers in some layer
selectors.  (Currently this is just the private
layers selector.

3) Reset the appearance panel layers each time a
footprint is loaded.  Also, auto-enable any user
layers that the footprint already has.

4) Footprint editor layer visibility is stored in
the view, not in the boars (as is usual).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20022
2025-03-05 16:39:52 +00:00
Tomasz Wlostowski 648c3aec39 IO_BASE: don't try to modify the case of a temporary string in-place, work on a copy
(cherry picked from commit 6a0efe6883)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20228
2025-03-05 12:21:52 +00:00
Jeff Young 46ef12ff4d Implement severity checking for CLI_REPORTER.
(cherry picked from commit 699fd2b3ac)
2025-03-05 11:56:48 +00:00
Jon Evans 477f856e9a Fix pad edit fighting with active group
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20129


(cherry picked from commit 50507212fd)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-05 00:05:18 -05:00
Jon Evans 3a1cb402ad Improve 259e249a for macOS
(cherry picked from commit a6ef2d97fb)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-04 22:57:02 -05:00
Jon Evans 9c50f208af Improve default sizes of right panels
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19965


(cherry picked from commit 259e249aed)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-04 22:56:53 -05:00
Jeff Young 0d9daa372e Keep user-defined common layers order.
(And use it when plotting.)

(And don't shadow it with a second variable.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20214
2025-03-04 23:37:02 +00:00
Jeff Young 91a2edd16f Don't add CONSTRUCTION_GEOM to the selection.
We'll crash later after it gets freed.
2025-03-04 14:13:26 +00:00
Jeff Young 765c4ffce6 Report errors from jobset plotting.
Also fixes an out-of-scope smart-pointer access.
2025-03-04 13:26:04 +00:00
Wayne Stambaugh 50b8b797f7 Test full LIB_ID in symbol footprint filter match DRC.
Apparently newer symbol libraries are using the library nickname in the
footprint filter string.  The symbol footprint filter match DRC was only
checking the footprint name against the new filter which would always
fail.  A test against the full LIB_ID string is now performed when the
filter string contains the library separator character ':'.  The ERC test
already performed this check.

(cherry picked from commit 001d3dfd88)
2025-03-04 08:06:15 -05:00
Jeff Young 9025f04f20 Button margins.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20207
2025-03-04 12:39:33 +00:00
Damjan ce2b4a7b16 pcbnew: Plotting tables with non-90 degree rotation angles is not working
(cherry picked from commit b419058df3)
2025-03-04 12:11:05 +00:00
Jeff Young ed76b543a0 Don't render thickness walls of text we're not going to draw.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20200
2025-03-04 10:55:36 +00:00
Mark Roszko 622a3f5bad Restore the page size mode behavior
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20014


(cherry picked from commit b6743653f3)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2025-03-04 04:16:07 +00:00
Alex Shvartzkop f125ab95c9 Update translations 2025-03-04 06:36:48 +03:00
Arnau Llovet Vidal d52811d367 Translated using Weblate (Catalan)
Currently translated at 41.4% (4120 of 9941 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ca/
2025-03-04 04:36:01 +01:00
Henrik Kauhanen 549258a5cc Translated using Weblate (Swedish)
Currently translated at 99.9% (9934 of 9941 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-04 04:36:01 +01:00
Pferd O 2ae04b32b4 Translated using Weblate (German)
Currently translated at 99.9% (9935 of 9941 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-04 04:36:01 +01:00
Henrik Kauhanen ab0d02b322 Translated using Weblate (Swedish)
Currently translated at 99.9% (9933 of 9941 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-04 04:36:01 +01:00
Henrik Kauhanen 9e163b7480 Translated using Weblate (Swedish)
Currently translated at 99.8% (9930 of 9941 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-04 04:36:01 +01:00
dsa-t d69e7c579c Translated using Weblate (Russian)
Currently translated at 100.0% (9941 of 9941 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-03-04 04:36:00 +01:00
Pferd O 2a1de79916 Translated using Weblate (German)
Currently translated at 99.9% (9933 of 9941 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-04 04:36:00 +01:00
Jeff Young 7116be4ae0 Put non-sided layers on front, not back of board.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20201

(cherry picked from commit 7cfa826c9a)
2025-03-03 21:38:47 +00:00
Jeff Young 66bf97bc0f Fix SCH plot to PDF for jobsets.
(Fix for CLI bug #19522 broke it for jobsets.)
2025-03-03 20:39:06 +00:00
Jeff Young 42a18ad3b6 Fix job run-log sizing issues.
wxLIST_AUTOSIZE_USEHEADER doesn't work on
some
platforms, and using OnSize was having seizures
on Mac.
2025-03-03 20:19:50 +00:00
Jeff Young afd35001cb Fix job run log sizing issues.
wxLIST_AUTOSIZE_USEHEADER doesn't work on
several platforms, and dynamic sizing of the
list columns falls apart on Mac.
2025-03-03 19:23:38 +00:00
Jeff Young cbc964fb94 Jobset Output -> Destination.
(cherry picked from commit d8cdb69831)
2025-03-03 18:36:14 +00:00
Jeff Young d033859596 Handle exporting symbols into libraries already under LIB_MGR.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17840

(cherry picked from commit afa4ebcc84)
2025-03-03 16:13:40 +00:00
Jeff Young c7a6f3c63b Restore "Export Symbol".
The workflow turns out to be slightly different
than a Save As to a new library.

(We don't assume it goes in a library table; we
flatten the symbol; and we pre-load the library
name.)

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

(cherry picked from commit 6b146874c1)
2025-03-03 16:13:40 +00:00
Jeff Young 984b872c28 Formatting.
(cherry picked from commit 1c48e97cd7)
2025-03-03 16:13:40 +00:00
Jeff Young a246a96d18 Disable multi-via dragging.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20150

(cherry picked from commit d0e86cad7c)
2025-03-03 16:13:40 +00:00
Mark Roszko 12d3f54da4 Fix compilation on mingw
(cherry picked from commit c2685ef76f)

a3c14a6e Build: fix: allow compilation on mingw

Co-authored-by: Kreijstal <rainb@tfwno.gf>
2025-03-03 01:56:46 +00:00
Jeff Young 97b0e6d403 Persist some missing jobset arguments.
Also adds some missing CLI arguments.

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

(cherry picked from commit b0eef3ee28)
2025-03-02 19:28:01 +00:00
Jeff Young 89226575c6 Deprecate (instead of remove) --plot-invisible-text
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20171

(cherry picked from commit 307798ac92)
2025-03-02 19:27:52 +00:00
Jeff Young 6febb9ddde Yet another static line issue. 2025-03-02 18:42:28 +00:00
Jeff Young 47150649b7 Yet another static line issue. 2025-03-02 18:20:42 +00:00
Jeff Young ae6c865a77 Handle circular holes with y==0.
(Because legacy code assumed this.)

(cherry picked from commit 164eff1a3b)
2025-03-02 17:55:22 +00:00
Jeff Young 154c89765f Remove extra divider from Pad Properties.
(cherry picked from commit 7d9dd50b08)
2025-03-02 17:55:19 +00:00
Jeff Young 341818306e Remove extra divider from Pad Properties.
(cherry picked from commit dc12fdfc33)
2025-03-02 17:55:15 +00:00
Jeff Young 87a0106c57 Compiler warnings. 2025-03-02 17:05:42 +00:00
jean-pierre charras 2504195e6e Fix a collision with a Windows define and our use of the same var name.
We use IN for INCH as units, but IN is defined in a Windows header

(cherry picked from commit b0fe4df3c5)
(cherry picked from commit 0acdabd1eb)
(cherry picked from commit eaa1e6d594)
2025-03-02 16:13:11 +01:00
jean-pierre charras 3f5195de3d French translation update 2025-03-02 15:16:11 +01:00
Jeff Young 31fe178504 Don't generate -1 width non-filled splines.
They serve no purpose, and will get replaced with
default-line-width non-filled splines.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20138
2025-03-02 11:33:34 +00:00
Jeff Young e44e3ae25e Windows compiler doesn't like the trailing ','? 2025-03-02 10:49:59 +00:00
Jeff Young ae96cf1715 Provide easier on-ramp for jobsets.
1) Perform initial save of new jobset.
2) Add default output folder to new jobset.

(cherry picked from commit 26871b56f0)
2025-03-02 09:10:21 +00:00
Jeff Young 203ddb7b47 Code brevity.
(cherry picked from commit f951497a4f)
2025-03-01 22:23:30 +00:00
Jeff Young 0ec82b65be Formatting; code brevity.
(cherry picked from commit 481e467968)
2025-03-01 22:18:35 +00:00
Jeff Young 09c63ea1ec Consistent spacing.
(cherry picked from commit ef75f63f10)
2025-03-01 22:18:31 +00:00
Jeff Young 0c2edf8e5c Persist generate-gerber-job-file setting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20158

(cherry picked from commit c0e4c6a865)
2025-03-01 22:17:36 +00:00
Jon Evans d9a779d8ce Make sure to fully repaint pads when loading a board
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19896


(cherry picked from commit 547a063981)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-01 21:54:55 +00:00
Jon Evans e56894ccc2 Fixup cherry-pick 9055821d for 9.0 2025-03-01 12:05:50 -05:00
Jon Evans 5c624dacd2 Fix SCH_SHEET field layer settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20128

(cherry picked from commit 10cb0592ee)
2025-03-01 11:32:04 -05:00
Jon Evans 3ad740c920 Remove unused CN_ITEM m_visited
Visited flag should not be stored in the item itself
since these items are used in parallelized code and
the visited state should remain local to the thread


(cherry picked from commit e44eed6e6b)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-01 15:43:27 +00:00
Jon Evans 9055821db6 Fix inadvertent logic bug in SearchClusters
The safety changes in 3d526edc introduced a subtle
bug where aExcludeZones was not actually excluding
zones anymore because its behavior depended on the
item visited flag being set to true by a previous
call to the function.

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


(cherry picked from commit 51f56ab31c)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-03-01 15:39:57 +00:00
Alex Shvartzkop d08cb55d94 Update translations 2025-03-01 18:35:02 +03:00
Henrik Kauhanen 240a7bb238 Translated using Weblate (Swedish)
Currently translated at 99.9% (9935 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/sv/
2025-03-01 16:32:51 +01:00
co8 j e453da97af Translated using Weblate (Japanese)
Currently translated at 99.9% (9936 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ja/
2025-03-01 16:32:51 +01:00
Wellington Terumi Uemura 140f92b1d7 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9938 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pt_BR/
2025-03-01 16:32:51 +01:00
ZbeeGin 51ec75e565 Translated using Weblate (Polish)
Currently translated at 99.9% (9936 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/pl/
2025-03-01 16:32:51 +01:00
Pferd O 4c13ca2bea Translated using Weblate (German)
Currently translated at 99.9% (9936 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-01 16:32:51 +01:00
CloverGit a638ca22c2 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.9% (9934 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/zh_Hans/
2025-03-01 16:32:51 +01:00
dsa-t 6526fe75ea Translated using Weblate (Russian)
Currently translated at 100.0% (9938 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/ru/
2025-03-01 16:32:51 +01:00
Marco Ciampa 3c41c33e39 Translated using Weblate (Italian)
Currently translated at 95.8% (9527 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/it/
2025-03-01 16:32:51 +01:00
Pferd O d267f46c21 Translated using Weblate (German)
Currently translated at 99.9% (9930 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/de/
2025-03-01 16:32:51 +01:00
109247019824 a47298b72f Translated using Weblate (Bulgarian)
Currently translated at 8.2% (823 of 9938 strings)

Translation: KiCad EDA/v9
Translate-URL: https://hosted.weblate.org/projects/kicad/v9/bg/
2025-03-01 16:32:50 +01:00
Jon Evans 41c3607512 Fix 9.0 formatting of fields
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20166
2025-03-01 08:53:32 -05:00
Fabien Corona d7ba90c573 iec60664-1 : preferred values
(cherry picked from commit 81428e14a6)

Co-authored-by: Fabien Corona <f.corona@laposte.net>
2025-03-01 07:58:19 +00:00
Seth Hillbrand 3f984704be Prevent fetch without repo
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20152

(cherry picked from commit 18ac99d838)
2025-02-28 08:35:58 -08:00
jean-pierre charras 2bb2f1398c BRDITEMS_PLOTTER::PlotFootprintTextItems(): fix a typo about Value layer.
The typo was using the reference layer to plot the value field

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

(cherry picked from commit 75bed91789)
2025-02-28 10:02:09 +01:00
Mark Roszko 9b1b2c626a Fix MSVC build error for VC 17.13+
(cherry picked from commit 7eb07c00a2)

50171749 Fix MSVC build in 17.13.2

Co-authored-by: Jan Wichmann <j-wichmann@gmx.net>
2025-02-27 23:41:53 +00:00
Jon Evans ff74d7b24a More safety against corrupted visibility settings
(cherry picked from commit 1205464472)
2025-02-27 18:18:40 -05:00
Jeff Young 9a3ae62b70 Clarifying comments. 2025-02-27 17:51:34 +00:00
Jeff Young 2e17848d3f Don't use connectivity system for Track & Via Properties dialog.
It will propagate through zones, and since we haven't
yet done a refill it will pick up a bunch of false
stuff any time the track was widened more than the
clearance.

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

(cherry picked from commit 888cbf8e7a)
2025-02-27 17:51:34 +00:00
Jeff Young 36b4bab5cc Cleanup.
(cherry picked from commit 931b1b0231)
2025-02-27 17:51:34 +00:00
Jeff Young 3a91fc8c2b Apply EEschema fixes to PCBNew and Footprint Editor.
(Symbol Editor doesn't have the issue of the properties
being overwritten.)

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

(cherry picked from commit 797de67c6c)
2025-02-27 17:51:34 +00:00
Jeff Young f4f92b0184 Treat changes in solder mask like a width change.
Also in theory keeps from losing tenting properties
on vias that are shoved, though I can't get via
shoving to work at all right now.

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

(cherry picked from commit 144e660684)
2025-02-27 17:51:34 +00:00
Jeff Young 87532491e1 Formatting.
(cherry picked from commit 8e461941c0)
2025-02-27 17:51:34 +00:00
Wayne Stambaugh 5cdca70bf1 Show the correct footprint name on footprint filter mismatch ERC warning.
The lower case variant used for internal comparison was being used which
is confusing because it doesn't match the footprint name capitalization.

(cherry picked from commit a9cea9fbb7)
2025-02-27 09:54:06 -05:00
Wayne Stambaugh cb7ea2f117 Fix git clone project dialog layout issues.
Use enable/disable instead of show/hide to prevent large areas of blank
space in the dialog.

Set the minimum dialog size after the initial launch to prevent controls
from being cut off when resizing dialog to less than the initial size.

Fix static and dialog title bar string capitalization.

Add colons (:) to the end of description static text controls as is done
elsewhere in KiCad.

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

(cherry picked from commit f538908f62)
2025-02-27 09:20:13 -05:00
jean-pierre charras 1c0769ce27 Eeschema: fix incorrect plot of SCH_TABLE items.
(cherry picked from commit ba85c54f81)
2025-02-27 14:12:08 +01:00
Seth Hillbrand c7afa8ce87 Fix windows build
(cherry picked from commit 9211136953)
2025-02-26 18:15:44 -08:00
Seth Hillbrand cc2ca441fa Adjust git timing parameters
Move most of the update firing to the file system watcher (except for
windows network shares that still need timed updated).  Gate the repo
status for sync

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

(cherry picked from commit 5027a562e4)
2025-02-26 16:17:49 -08:00
Seth Hillbrand 8d1f1fd4f5 Fix git flicker on Windows
(cherry picked from commit aa1baec062)
2025-02-26 16:17:43 -08:00
Jon Evans 377476df1d Fix export SVG mode logic
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20089


(cherry picked from commit 52e86303c0)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-26 22:31:44 +00:00
jean-pierre charras 5465ff8143 PCB_DIM_XXX::updateGeometry(): protect against re-entrance.
After calling updateText(), updateGeometry() was sometimes re-run before the
current updateGeometry() was finished, thus creating a incorrect geometry
(duplicate items)

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

(cherry picked from commit 7c067e25d9)
2025-02-26 21:07:06 +01:00
Jeff Young 969c28864f Apply List Hotkeys fix to Edit Hotkeys.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19989
2025-02-26 18:53:35 +00:00
Jeff Young fd202d7b8d Better alignment betweeen controls in Pad Properties. 2025-02-26 18:53:32 +00:00
Jeff Young 7e79a99cea There is no support (as yet) for layer-specific soldermask expansions.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20053
2025-02-26 18:53:29 +00:00
Jeff Young ad2c243220 Formatting. 2025-02-26 18:53:16 +00:00
Jeff Young fb02d02698 Don't exit DRC when one test passes.
Also adds handling for table cells.

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

(cherry picked from commit fde4aac075)
2025-02-26 18:52:39 +00:00
Jeff Young a10ab54bf2 Formatting.
(cherry picked from commit 6ccacd232e)
2025-02-26 18:52:36 +00:00
Jeff Young 72454180c1 DRC_LAST is the last index, not the size.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20049

(cherry picked from commit 956875e2f4)
2025-02-26 18:51:34 +00:00
Alex Shvartzkop 5909fc1c8f Update translations 2025-02-26 20:15:45 +03:00
Wayne Stambaugh 82ead56d9a Fix zone manager dialog layout issues.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20046

(cherry picked from commit 4e4ebe536e)
2025-02-26 08:14:07 -05:00
Jon Evans 798e9999c2 Add missing change from previous commit
See b6aac93


(cherry picked from commit de160e4af6)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-26 04:42:19 +00:00
Jon Evans a752dd5105 Fix creation of Altium compound files from IntLibs
A previous change introduced an invalid cast from
base to derived class.  To clean this up, changed
DecodeIntLibStream to have an out param and allow
two-step initialization of ALTIUM_COMPOUND_FILE

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


(cherry picked from commit b6aac9369e)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-26 03:34:49 +00:00
Jon Evans da8dcab1de Fix logic in via high contrast LOD calculation
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20093


(cherry picked from commit 41f5750be7)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-26 01:59:51 +00:00
Jon Evans b707b305ac API: Add board origin setter/getter
See https://gitlab.com/kicad/code/kicad-python/-/issues/20


(cherry picked from commit 5cec2fac9d)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-26 01:14:01 +00:00
Seth Hillbrand 038b927cfa Thread git checks
Push the git checks from the main thread into child threads to prevent
resource contention in some cases where Windows machines might have many
files in git that are _also_ being managed by Google Drive

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

(cherry picked from commit 2c54ab277b)
2025-02-25 16:09:56 -08:00
Alex Shvartzkop bdd4a88127 Simplify layer list update in PANEL_SETUP_LAYERS. 2025-02-25 23:43:48 +03:00
Alex Shvartzkop f60313367c Fix scrollbars not appearing in Appearance layers panel after board import. 2025-02-25 23:39:59 +03:00
Alex Shvartzkop a4e2d54221 Fix scrollbars not appearing initially in PANEL_SETUP_LAYERS. 2025-02-25 23:22:20 +03:00
Alex Shvartzkop 8ef8ca4d39 Auto-size PANEL_SETUP_LAYERS_BASE.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20106
2025-02-25 23:20:58 +03:00
Jon Evans ae0396ee3c API: Add new user layers
See https://gitlab.com/kicad/code/kicad-python/-/issues/23


(cherry picked from commit c4c1842bc4)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-25 00:30:37 +00:00
Damjan b97bd36b44 pcbnew: Table Rotation
(cherry picked from commit 5771467ca3)
2025-02-24 11:57:26 +00:00
Jon Evans f3523b6ad9 Re-add accidentally removed increment
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20069


(cherry picked from commit 4123f75d5a)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-24 03:42:04 +00:00
Jon Evans 0fccad7183 PCM: Prompt to enable IPC API when required
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20062


(cherry picked from commit 3525731a4e)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-23 23:07:30 +00:00
Damjan 337689a69e pcbnew: Table Cell Text Justification
(cherry picked from commit 9c6ebb44b6)
2025-02-23 22:15:40 +00:00
Jeff Young a3e3c0384e Mirror location of textbox.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20021
2025-02-23 22:08:48 +00:00
Jeff Young 36924926de Filled shapes can still have a border width. 2025-02-23 22:08:48 +00:00
Jeff Young ec1353168b Better namespacing.
Also fixes a bug with calculating eagle annular
ring sizes.
2025-02-23 22:08:48 +00:00
Jeff Young 1712f5f8e7 Cleanup stale comment. 2025-02-23 22:08:48 +00:00
Jeff Young 6485465301 Fix plot dialog layout. 2025-02-23 22:08:48 +00:00
Jon Evans 87f7ed7846 Clear render cache for hole walls on zoom change
(cherry picked from commit bacb6bf40f)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-23 18:04:27 +00:00
Jon Evans f8993933a9 Do not persist canvas type fallback due to OpenGL failure
If the user wants to always use fallback,
they can set this option explicitly


(cherry picked from commit 0e8934f887)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-23 18:04:16 +00:00
Seth Hillbrand b135491d35 Allow sim models to reference embedded files
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20024

(cherry picked from commit 157c7422b0)
2025-02-22 14:54:38 -08:00
Seth Hillbrand 2aa9d4851e Limit the size of the PTH hole walls
Should always be at least 2px thick but no larger than the minimum
thickness of the pad (walls do not extend beyond the pad itself)

(cherry picked from commit b02a449be8)
2025-02-22 14:54:38 -08:00
Jon Evans 4cd8833687 API: Refresh screen after changing selection
Required on Linux/Windows

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


(cherry picked from commit d29025ef78)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-22 21:01:52 +00:00
Connor Goss 870807fbad Add IPC-D-356 Export to kicad-cli
ADDED: Added IPC-D-356 exporting to kicad-cli.

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

(cherry picked from commit 5a5759c41a)
2025-02-22 13:01:22 -08:00
Seth Hillbrand a844554443 Quiet down the Exclude from Sim marks in Schematic
The big grey X and dimming the component made it look like the component
was no longer a part of the circuit, rather than just being excluded for
a single purpose.

The changes the display to make a more subtle grey outline with an icon
in the corner to indicate that this refers to simulation.

(cherry picked from commit 878cf768d6)
2025-02-22 13:01:16 -08:00
Jon Evans d6f10f9f88 Remove accidentally-added tree
(cherry picked from commit 5abfdac639)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-22 19:44:16 +00:00
Jon Evans dcc09a9e77 Improvements to kicad-cli test repeatability
(cherry picked from commit ca21a35bfc)
2025-02-22 14:08:55 -05:00
jean-pierre charras 45bb1da77a pcb_calculator, STRIPLINE: fix incorrect formula for conductor loss.
(cherry picked from commit fc9795e95d)
2025-02-22 17:09:16 +01:00
Jon Evans a153e4fc63 Enhance library pinning functionality to support pin/unpin multiple libraries in the library editor
(cherry picked from commit c7aaf8b6e1)

Co-authored-by: Dmitry Rezvanov <26044988+Misaka0x2730@users.noreply.github.com>
2025-02-22 15:45:55 +00:00
JamesJCode f3371f9c21 Fix m_zoneLayerOverrides data race in pad.h
From Coverity issue 542093

(cherry picked from commit 1e84d1e496)
2025-02-22 14:59:39 +00:00
Jon Evans 8a3086652a Added enum COL_ORDER for jobset panel's columns
(cherry picked from commit ee614161d7)

Co-authored-by: Dmitry Rezvanov <dmitry.rezvanov@yandex.ru>
2025-02-22 14:07:51 +00:00
Jon Evans 2103f303b7 Fixed description column number in PANEL_JOBSET::OnGridCellChange.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20030


(cherry picked from commit 0c2a5b72ec)

Co-authored-by: Dmitry Rezvanov <dmitry.rezvanov@yandex.ru>
2025-02-22 14:07:42 +00:00
Jon Evans 17cac94c6a Make sure drill layer pairs are created in odb++
fixes #20039


(cherry picked from commit 255f4aee76)

Co-authored-by: Daniel Treffenstädt <d.treffenstaedt@gmail.com>
2025-02-22 13:35:14 +00:00
Seth Hillbrand c4c32aa7bb Prevent crash when importing over existing project
If the hierarchy navigator is open and expanded, we have references to
the existing sheets.  These need to be cleared when importing a new
sheet over top

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

(cherry picked from commit 2e93fb7a24)
2025-02-21 10:34:53 -08:00
Graham Keeth 8162896bd5 Embedded files: standardize on "embedded reference"
(cherry picked from commit ac9f41baaa)
2025-02-21 10:16:21 -08:00
jean-pierre charras 92a605385b kicad-cli pcb export SVG: ensure the "C" locale is used.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20023

(cherry picked from commit aafe6157e2)
2025-02-21 17:55:15 +01:00
jean-pierre charras b948611c6f PANEL_FP_EDITOR_FIELD_DEFAULTS: fix hang when creating the panel (Windows only)
PANEL_FP_EDITOR_FIELD_DEFAULTS::loadFPSettings() was trying to add 0 rows to a
table which hang on Windows (but not on linux)

(cherry picked from commit 22a2cca312)
2025-02-21 17:10:17 +01:00
Jeff Young ba2156a0f1 parseMaybeAbsentBool's param is the naked token value, not the absent value.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20017
2025-02-21 11:17:03 +00:00
jean-pierre charras 966c7e40e5 PCB_TABLE: fix incorrect plot of tables rotated +-90 (missing segments).
This change was missing in commit 276029ee

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

(cherry picked from commit a9fb475cf2)
2025-02-21 09:52:02 +01:00
Jon Evans 89b4adc042 API: Add serialization of footprint mounting style
See https://gitlab.com/kicad/code/kicad-python/-/issues/19


(cherry picked from commit b932487f2e)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2025-02-20 23:16:55 +00:00
Jeff Young ff3687420f Write hide flag at 9.0 level (inside effects). 2025-02-20 18:10:23 +00:00
Jeff Young 7aafe9efe9 Make sure protobuf API stays consistent.
(cherry picked from commit a8a1b08013)
2025-02-20 17:48:09 +00:00
Jeff Young e6f6e7b2f0 Cleanup.
(cherry picked from commit 9ca9d7120a)
2025-02-20 17:48:06 +00:00
Jeff Young 68b590cadb Load actions from frame's actionmanager, not from singleton.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19989

(cherry picked from commit 6b3d01ead9)
2025-02-20 13:49:41 +00:00
Jeff Young 1ec7051f97 Fix comment.
(cherry picked from commit a00aeb7876)
2025-02-20 13:49:37 +00:00
Jeff Young 866a5722f6 Formatting.
(cherry picked from commit e018a33628)
2025-02-20 13:49:34 +00:00
Jeff Young 4e7da6169d Remove prohibition from clearing Value field in Symbol Fields Table.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19745

(cherry picked from commit fea659a002)
2025-02-20 13:49:23 +00:00
Jeff Young ebb8682dde Don't special case output directory label for jobsets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19868

(cherry picked from commit be58dddcab)
2025-02-20 13:49:17 +00:00
Jeff Young 812bbe8919 Ignore negative layers when exporting Gerbers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16871

(cherry picked from commit 6a3f52dbaf)
2025-02-20 13:47:55 +00:00
Jeff Young fd2932bc06 Better way of determining if we're reporting from the footprint editor.
(cherry picked from commit c136df247f)
2025-02-20 13:47:50 +00:00
Jeff Young 1b6621d898 Save copy of AUI config before applying it.
(It's going to do a bunch config saves, which
will otherwise overwrite all the user's preferences
with the defaults.)

(cherry picked from commit 006d8b290a)
2025-02-20 13:47:46 +00:00
Jeff Young 4aa11830e4 Write flipBoard boolean to JSON.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19852

(cherry picked from commit c8f56f24a8)
2025-02-20 13:47:14 +00:00
Jeff Young 91f5096ecc Improve control spacing.
(cherry picked from commit 4e08afd517)
2025-02-20 13:47:12 +00:00
Jeff Young 4dbf39743b No connections AND no-net is not an error
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19737

(cherry picked from commit 1ff0dfb052)
2025-02-20 13:46:31 +00:00
Jeff Young c7d62a23be Check for duplicate footprints.
Also fixes a bug where we were running Validate()
twice.

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

(cherry picked from commit c28039556d)
2025-02-20 13:46:27 +00:00
Jeff Young b81f0b4377 Pretty-print cross references in Symbol Fields Table.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19941

(cherry picked from commit f65d260961)
2025-02-20 13:46:22 +00:00
Jeff Young f45e2b2252 Switch to using unit names in property inspector.
(cherry picked from commit d921a4e916)
2025-02-20 13:37:37 +00:00
Jeff Young db44690460 Update instance reference from property inspector.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19932

(cherry picked from commit 56b8fec74b)
2025-02-20 13:37:33 +00:00
Jeff Young f8c0109c6e Improve code clarity.
(No functional change.)

(cherry picked from commit 1c848bb9fb)
2025-02-20 13:37:29 +00:00
Jeff Young a60f0b3782 MOVED subtract-mask-from-silk to general section.
(Was Gerber-specific.)

(cherry picked from commit 80e7698131)
2025-02-20 13:37:25 +00:00
Jeff Young 7cc2b47d2e REMOVED force-plot-invisible-items.
It's dangerous as the router and DRC will have been
run without regard to invisible items.

(See #19420.)

(cherry picked from commit 4fa02690f8)
2025-02-20 13:37:22 +00:00
Jeff Young 71ebe394d5 Handle clipping silk to mask when there is more than one layer.
(cherry picked from commit b44261c2bd)
2025-02-20 13:18:38 +00:00
Jeff Young 9d27f5526c Cleanup stale comments.
(cherry picked from commit 4959b480c3)
2025-02-20 13:18:34 +00:00
Jeff Young bf1daeab64 Cleanup.
(cherry picked from commit 9c0214afc0)
2025-02-20 13:18:29 +00:00
Jeff Young 5693ba1432 Performance improvements for teardrop regeneration.
Avoid O(n^2) behaviour when deleting many
zones from the board zones list.

(cherry picked from commit 281aa74f30)
2025-02-20 13:18:26 +00:00
Jeff Young a60307340f Finish eradication of visibility flag on text items.
Import/read previously-hidden symbol/footprint
text items as hidden fields.

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

(cherry picked from commit 5edae8250d)
2025-02-20 13:18:23 +00:00
Jeff Young 5a6793f9fb Formatting.
(cherry picked from commit cedb97c4c3)
2025-02-20 13:17:57 +00:00
Jeff Young b3463dce71 Don't allow creation of design blocks in recently used tree node.
(cherry picked from commit 759bfbca99)
2025-02-20 13:17:52 +00:00
Jeff Young 58b8e9736d Fix bugs in library existence checking, and add for symbol libs.
(cherry picked from commit 2a1b93a254)
2025-02-20 13:17:37 +00:00
Jeff Young a1dd583696 LIB_TREE_MODEL_ADAPTER is not symbol-specific.
(cherry picked from commit 4a35468301)
2025-02-20 13:17:31 +00:00
Jeff Young 6429246ce0 ADDED: 'Name' property for fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19706

(cherry picked from commit 426ac96bb7)
2025-02-20 13:15:58 +00:00
Jeff Young aaca5d820b Reduce cover types.
Also, don't use _ITEM for things that aren't EDA::ITEMs.

(cherry picked from commit bf34fe625c)
2025-02-20 13:15:52 +00:00
Jeff Young 2579165733 Resolve field references in symbol text items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19983

(cherry picked from commit 61efe5be18)
2025-02-20 13:15:19 +00:00
Jeff Young 93fdd52d14 IPC-2581 has a hyphen in it.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19770

(cherry picked from commit 40daacbeeb)
2025-02-20 13:14:17 +00:00
Jeff Young 079636ad18 Fix inconsistent capitalisation.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19770

(cherry picked from commit 3fff89820d)
2025-02-20 13:14:13 +00:00
Jeff Young f6148f10e1 ADDED: support naked hyperlinks in tablecells and textboxes.
Also fix flickering due to IS_ROLLOVER flag getting
nuked.

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

(cherry picked from commit 072d8d55fe)
2025-02-20 12:57:16 +00:00
Jeff Young 2a93af1348 Don't disable line styles on filled shapes.
It's too much trouble to figure out what the
user wants, and not always right even then.

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

(cherry picked from commit 42acb62f6e)
2025-02-20 12:22:26 +00:00
Jeff Young ee2039b531 Auto-recognize URLs in SCH_FIELD and PCB_FIELD grids.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17066

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

(cherry picked from commit 3c71e7ab09)
2025-02-20 12:21:56 +00:00
dsa-t cc77cb4252 Vertically center text in cells in jobsets table.
(cherry picked from commit 0201e7286c)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-02-20 11:39:00 +00:00
lucas 072a2b6305 Simulator: Bug fix quoting netnames for user defined signals
- Fixes issue: #18598
- Netnames that contained other netnames weren't quoted correctly
- E.g. /out1 and /out were in conflict in previous method
- Fixed formatting afted review

(cherry picked from commit 2559ac50a3)
2025-02-20 03:02:19 +00:00
Dmitry Rezvanov 3cae075945 Add "Route Selected From Other End" action to edit context menu
(cherry picked from commit 663f00da25)
2025-02-20 03:02:07 +00:00
Ian McInerney 900b6bfffb Ensure vme-wren demo is installed
(cherry picked from commit 0954f8ff76)
2025-02-20 03:01:28 +00:00
Andrej Valek 0c68ab4556 KiwayPlayer(FRAME_FOOTPRINT_CHOOSER): set window parent
The FRAME_FOOTPRINT_CHOOSER dialog is always a modal window, so it
requires to have an parent. Set parent in dialog_field_properties.

(cherry picked from commit 5e64f56d54)
2025-02-19 10:17:37 -08:00
Seth Hillbrand 1a41387a50 Properly handle Altium harnesses
Altium harnesses are imported as buses in KiCad, using bus aliases to
represent the harness elements

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

(cherry picked from commit cf2827c6ec)
2025-02-19 10:07:58 -08:00
Seth Hillbrand e602e0bdbd Speed up the time it takes to GeneratePaths
The loop processes nodes but skips those nodes that share the same
parent.  Because of this, we can get strong performance improvement from
caching gains by sorting the vector first by the parents so that the
inner loop is able to skip ahead without invalidating its cache

(cherry picked from commit 9781da51e1)
2025-02-19 10:05:45 -08:00
Seth Hillbrand f2e814c330 Prevent image duplication
Duplicate ancillary clipboard needs to be tested with the existence of
an image when pasting

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

(cherry picked from commit d2f780dfb4)
2025-02-19 10:04:44 -08:00
1824 changed files with 572844 additions and 798809 deletions
+57
View File
@@ -0,0 +1,57 @@
# minimum clang-format 10
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignOperands: true
AlignTrailingComments: true
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ BOOST_FOREACH ]
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 2
NamespaceIndentation: Inner
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
SpaceAfterCStyleCast: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: true
SpacesInSquareBrackets: false
Standard: c++11
TabWidth: 4
UseTab: Never
-5
View File
@@ -89,9 +89,6 @@ pcbnew/Info.plist
*.orig
*.patch
# _clang-format is used, .clang-format is not
.clang-format
# These CMake files are wanted
!cmake/**/*.cmake
@@ -130,11 +127,9 @@ i18n_status.csv
# Project local settings files and backups (in demos and qa tests)
*.kicad_prl
*-backups
~*.lck
# QA dataoutput
qa/data/**/*.csv
qa/data/**/*.spice
# Don't actually ignore any of these files, since we need them in the tree
!resources/linux/icons/hicolor/**/**/*
-58
View File
@@ -1,58 +0,0 @@
# Despite the unfortunate naming convention of this file, KiCad does not have code "owners".
# All parts of KiCad are worked on by all developers, and we do not require explicit approval
# from any particular person in order to accept contributions or fixes to sections of KiCad.
# This file is used to generate suggested reviewers for pull requests that touch certain parts
# of the KiCad codebase based on the development history of those parts. Most of KiCad does not
# have a particular set of reviewers defined in this file, and in general, it is a good thing if
# entries can be removed from this file over time, because it indicates that expertise about
# parts of the codebase that once were only familiar to one or two developers is now shared among
# a wider set of the core development team.
# Contributors: despite this file, the KiCad team still primarily matches up new merge requests
# with reviewers based on developer availability. If a change you propose touches files that
# are covered by entries in this file, the relevant developer(s) may or may not be the final
# reviewer(s) for your merge request.
# Core team developers: consider adding yourself to places where you are commonly asked for
# review feedback by the rest of the team. Consider removing yourself if you are stepping back
# from participating in KiCad code review, or if you notice that an area you were previously
# listed as a reviewer because not many others were familiar with it is now familiar with the
# larger team.
^[Suggested Reviewers]
/vcpkg*.json @mroszko
/api/ @craftyjon
/cmake/InstallSteps/*MacOS.cmake @craftyjon
/common/api/ @craftyjon
/common/git/ @sethhillbrand
/common/database/ @craftyjon
/common/io/eagle/ @stambaughw
/common/jobs/ @mroszko
/cmake/KiCadVersion.cmake @stambaughw
/eeschema/api/ @craftyjon
/eeschema/erc/ @jeffyoung
/eeschema/connection_graph.* @craftyjon @sethhillbrand
/eeschema/sch_io/database/ @craftyjon
/eeschema/sch_io/kicad_sexpr/ @stambaughw
/eeschema/sch_io/eagle/ @stambaughw
/libs/kinng/ @craftyjon
/pcbnew/api/ @craftyjon
/pcbnew/drc/ @jeffyoung
/pcbnew/pcb_io/easyeda* @dsa-t
/pcbnew/pcb_io/ipc2581/ @sethhillbrand
/pcbnew/pcb_io/odbpp/ @SYSUeric66 @sethhillbrand @craftyjon
/pcbnew/router/ @twlostow @craftyjon @sethhillbrand
/pcbnew/zone_filler* @jeffyoung
/scripting/ @craftyjon @sethhillbrand
/thirdparty/nanodbc/ @craftyjon
-2
View File
@@ -37,8 +37,6 @@ win64_build:
../../
- cmake --build . 2>&1 | tee compilation_log.txt
- cd ../../
after_script:
- Get-Content -Path C:\builder\vcpkg\buildtrees\wxpython-33\python3-tool-post-install-err.log
artifacts:
# Only save the artifacts that are needed for running the tests in the next stage
# and the compilation log. The entire build directory is too large to save as an
+3 -3
View File
@@ -147,7 +147,7 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, const wxString& aBasePa
if( aCachePtr )
*aCachePtr = nullptr;
wxString full3Dpath = m_FNResolver->ResolvePath( aModelFile, aBasePath, std::move( aEmbeddedFilesStack ) );
wxString full3Dpath = m_FNResolver->ResolvePath( aModelFile, aBasePath, aEmbeddedFilesStack );
if( full3Dpath.empty() )
{
@@ -215,7 +215,7 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, const wxString& aBasePa
SCENEGRAPH* S3D_CACHE::Load( const wxString& aModelFile, const wxString& aBasePath,
std::vector<const EMBEDDED_FILES*> aEmbeddedFilesStack )
{
return load( aModelFile, aBasePath, nullptr, std::move( aEmbeddedFilesStack ) );
return load( aModelFile, aBasePath, nullptr, aEmbeddedFilesStack );
}
@@ -552,7 +552,7 @@ S3DMODEL* S3D_CACHE::GetModel( const wxString& aModelFileName, const wxString& a
std::vector<const EMBEDDED_FILES*> aEmbeddedFilesStack )
{
S3D_CACHE_ENTRY* cp = nullptr;
SCENEGRAPH* sp = load( aModelFileName, aBasePath, &cp, std::move( aEmbeddedFilesStack ) );
SCENEGRAPH* sp = load( aModelFileName, aBasePath, &cp, aEmbeddedFilesStack );
if( !sp )
return nullptr;
+1 -3
View File
@@ -752,9 +752,7 @@ bool SGSHAPE::Prepare( const glm::dmat4* aTransform, S3D::MATLIST& materials,
for( unsigned int i = 0; i < nvidx; ++i )
{
mit = indexmap.find( lv[i] );
if( mit != indexmap.end() )
lvidx[i] = mit->second;
lvidx[i] = mit->second;
}
m.m_FaceIdxSize = (unsigned int )nvidx;
+38 -46
View File
@@ -113,8 +113,6 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
m_frontCopperThickness3DU = DEFAULT_COPPER_THICKNESS * m_biuTo3Dunits;
m_backCopperThickness3DU = DEFAULT_COPPER_THICKNESS * m_biuTo3Dunits;
m_nonCopperLayerThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
m_frontMaskThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
m_backMaskThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
m_solderPasteLayerThickness3DU = SOLDERPASTE_LAYER_THICKNESS * m_biuTo3Dunits;
m_trackCount = 0;
@@ -227,11 +225,17 @@ BOARD_ADAPTER::~BOARD_ADAPTER()
void BOARD_ADAPTER::ReloadColorSettings() noexcept
{
PCBNEW_SETTINGS* cfg = GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
COLOR_SETTINGS* cs = ::GetColorSettings( cfg ? cfg->m_ColorTheme : DEFAULT_THEME );
wxCHECK( PgmOrNull(), /* void */ );
for( int layer = F_Cu; layer < PCB_LAYER_ID_COUNT; ++layer )
m_BoardEditorColors[ layer ] = cs->GetColor( layer );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
COLOR_SETTINGS* colors = mgr.GetColorSettings( cfg ? cfg->m_ColorTheme : wxString( "" ) );
if( colors )
{
for( int layer = F_Cu; layer < PCB_LAYER_ID_COUNT; ++layer )
m_BoardEditorColors[ layer ] = colors->GetColor( layer );
}
}
@@ -318,7 +322,7 @@ unsigned int BOARD_ADAPTER::GetCircleSegmentCount( int aDiameterBIU ) const
{
wxASSERT( aDiameterBIU > 0 );
return GetArcToSegmentCount( aDiameterBIU / 2, m_board->GetDesignSettings().m_MaxError, FULL_CIRCLE );
return GetArcToSegmentCount( aDiameterBIU / 2, ARC_HIGH_DEF, FULL_CIRCLE );
}
@@ -377,8 +381,6 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
m_frontCopperThickness3DU = DEFAULT_COPPER_THICKNESS * m_biuTo3Dunits;
m_backCopperThickness3DU = DEFAULT_COPPER_THICKNESS * m_biuTo3Dunits;
m_nonCopperLayerThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
m_frontMaskThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
m_backMaskThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
m_solderPasteLayerThickness3DU = SOLDERPASTE_LAYER_THICKNESS * m_biuTo3Dunits;
g_BevelThickness3DU = pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_3DRT_BevelHeight_um / 1000.0 )
@@ -390,7 +392,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
if( bds.GetStackupDescriptor().GetCount() )
{
int body_thickness = 0;
int thickness = 0;
for( BOARD_STACKUP_ITEM* item : bds.GetStackupDescriptor().GetList() )
{
@@ -398,44 +400,31 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
{
case BS_ITEM_TYPE_DIELECTRIC:
for( int sublayer = 0; sublayer < item->GetSublayersCount(); sublayer++ )
body_thickness += item->GetThickness( sublayer );
thickness += item->GetThickness( sublayer );
break;
case BS_ITEM_TYPE_COPPER:
{
// The copper thickness must be > 0 to avoid draw issues (divide by 0 for
// instance). We use a minimal arbitrary value = 1 micrometer here:
int copper_thickness = std::max( item->GetThickness(), pcbIUScale.mmToIU( 0.001 ) );
int copper_thickness = std::max( item->GetThickness(),
pcbIUScale.mmToIU( 0.001 ) );
if( item->GetBrdLayerId() == F_Cu )
m_frontCopperThickness3DU = copper_thickness * m_biuTo3Dunits;
else if( item->GetBrdLayerId() == B_Cu )
m_backCopperThickness3DU = copper_thickness * m_biuTo3Dunits;
else if( item->IsEnabled() )
body_thickness += copper_thickness;
thickness += copper_thickness;
}
break;
}
case BS_ITEM_TYPE_SOLDERMASK:
{
// The mask thickness must be > 0 to avoid draw issues (divide by 0 for
// instance). We use a minimal arbitrary value = 1 micrometer here:
int mask_thickness = std::max( item->GetThickness(), pcbIUScale.mmToIU( 0.001 ) );
if( item->GetBrdLayerId() == F_Mask )
m_frontMaskThickness3DU = mask_thickness * m_biuTo3Dunits;
else if( item->GetBrdLayerId() == B_Mask )
m_backMaskThickness3DU = mask_thickness * m_biuTo3Dunits;
}
default:
break;
}
}
m_boardBodyThickness3DU = body_thickness * m_biuTo3Dunits;
m_boardBodyThickness3DU = thickness * m_biuTo3Dunits;
}
}
@@ -469,7 +458,8 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
};
m_layerZcoordBottom[layer_id] = m_boardBodyThickness3DU / 2.0
- ( m_boardBodyThickness3DU * layer_pos / ( m_copperLayersCount - 1 ) );
- ( m_boardBodyThickness3DU * layer_pos
/ ( m_copperLayersCount - 1 ) );
if( layer_pos < (m_copperLayersCount / 2) )
m_layerZcoordTop[layer_id] = m_layerZcoordBottom[layer_id] + m_frontCopperThickness3DU;
@@ -507,7 +497,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
case B_Mask:
zposBottom = zpos_copperTop_back;
zposTop = zpos_copperTop_back - m_backMaskThickness3DU;
zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
break;
case B_Paste:
@@ -517,7 +507,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
case F_Mask:
zposBottom = zpos_copperTop_front;
zposTop = zpos_copperTop_front + m_frontMaskThickness3DU;
zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
break;
case F_Paste:
@@ -545,7 +535,8 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
m_boardCenter = SFVEC3F( m_boardPos.x * m_biuTo3Dunits, m_boardPos.y * m_biuTo3Dunits, 0.0f );
SFVEC3F boardSize = SFVEC3F( m_boardSize.x * m_biuTo3Dunits, m_boardSize.y * m_biuTo3Dunits, 0.0f );
SFVEC3F boardSize = SFVEC3F( m_boardSize.x * m_biuTo3Dunits, m_boardSize.y * m_biuTo3Dunits,
0.0f );
boardSize /= 2.0f;
SFVEC3F boardMin = ( m_boardCenter - boardSize );
@@ -611,7 +602,7 @@ std::map<int, COLOR4D> BOARD_ADAPTER::GetDefaultColors() const
colors[ LAYER_3D_USER_ECO1 ] = BOARD_ADAPTER::g_DefaultECOs;
colors[ LAYER_3D_USER_ECO2 ] = BOARD_ADAPTER::g_DefaultECOs;
COLOR_SETTINGS* settings = ::GetColorSettings( DEFAULT_THEME );
COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings( wxEmptyString );
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
colors[ layer ] = settings->GetColor( layer );
@@ -630,7 +621,7 @@ std::map<int, COLOR4D> BOARD_ADAPTER::GetLayerColors() const
}
else
{
COLOR_SETTINGS* settings = ::GetColorSettings( DEFAULT_THEME );
COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings();
for( const auto& [ layer, defaultColor /* unused */ ] : GetDefaultColors() )
colors[ layer ] = settings->GetColor( layer );
@@ -740,7 +731,7 @@ std::map<int, COLOR4D> BOARD_ADAPTER::GetLayerColors() const
void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
{
COLOR_SETTINGS* settings = ::GetColorSettings( DEFAULT_THEME );
COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings();
for( const auto& [ layer, color ] : aColors )
{
@@ -785,7 +776,7 @@ void BOARD_ADAPTER::SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers )
m_Cfg->m_Render.show_model_bbox = aLayers.test( LAYER_3D_BOUNDING_BOXES );
m_Cfg->m_Render.show_off_board_silk = aLayers.test( LAYER_3D_OFF_BOARD_SILK );
m_Cfg->m_Render.show_navigator = aLayers.test( LAYER_3D_NAVIGATOR );
m_Cfg->m_Render.show_axis = aLayers.test( LAYER_3D_AXES );
}
@@ -793,7 +784,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
{
std::bitset<LAYER_3D_END> ret;
if( m_IsPreviewer )
if( m_board && m_board->IsFootprintHolder() )
{
if( m_Cfg->m_Render.preview_show_board_body )
{
@@ -828,7 +819,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
ret.set( LAYER_3D_BOUNDING_BOXES, m_Cfg->m_Render.show_model_bbox );
ret.set( LAYER_3D_OFF_BOARD_SILK, m_Cfg->m_Render.show_off_board_silk );
ret.set( LAYER_3D_NAVIGATOR, m_Cfg->m_Render.show_navigator );
ret.set( LAYER_3D_AXES, m_Cfg->m_Render.show_axis );
return ret;
}
@@ -862,7 +853,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
ret.set( LAYER_3D_BOUNDING_BOXES, m_Cfg->m_Render.show_model_bbox );
ret.set( LAYER_3D_OFF_BOARD_SILK, m_Cfg->m_Render.show_off_board_silk );
ret.set( LAYER_3D_NAVIGATOR, m_Cfg->m_Render.show_navigator );
ret.set( LAYER_3D_AXES, m_Cfg->m_Render.show_axis );
if( m_Cfg->m_CurrentPreset == FOLLOW_PCB )
{
@@ -914,9 +905,9 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
ret.set( layer, layers.test( Map3DLayerToPCBLayer( layer ) ) );
ret.set( LAYER_FP_REFERENCES, plotParams.GetPlotReference() );
ret.set( LAYER_FP_VALUES, plotParams.GetPlotValue() );
ret.set( LAYER_FP_TEXT, plotParams.GetPlotFPText() );
ret.set( LAYER_FP_REFERENCES, plotParams.GetPlotReference() );
ret.set( LAYER_FP_VALUES, plotParams.GetPlotValue() );
ret.set( LAYER_FP_TEXT, plotParams.GetPlotFPText() );
}
else if( LAYER_PRESET_3D* preset = m_Cfg->FindPreset( m_Cfg->m_CurrentPreset ) )
{
@@ -960,7 +951,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetDefaultVisibleLayers() const
ret.set( LAYER_3D_BOUNDING_BOXES, false );
ret.set( LAYER_3D_OFF_BOARD_SILK, false );
ret.set( LAYER_3D_NAVIGATOR, true );
ret.set( LAYER_3D_AXES, true );
return ret;
}
@@ -1053,8 +1044,9 @@ SFVEC4F BOARD_ADAPTER::GetColor( const COLOR4D& aColor ) const
SFVEC2F BOARD_ADAPTER::GetSphericalCoord( int i ) const
{
SFVEC2F sphericalCoord = SFVEC2F( ( m_Cfg->m_Render.raytrace_lightElevation[i] + 90.0f ) / 180.0f,
m_Cfg->m_Render.raytrace_lightAzimuth[i] / 180.0f );
SFVEC2F sphericalCoord =
SFVEC2F( ( m_Cfg->m_Render.raytrace_lightElevation[i] + 90.0f ) / 180.0f,
m_Cfg->m_Render.raytrace_lightAzimuth[i] / 180.0f );
sphericalCoord.x = glm::clamp( sphericalCoord.x, 0.0f, 1.0f );
sphericalCoord.y = glm::clamp( sphericalCoord.y, 0.0f, 2.0f );
+5 -4
View File
@@ -492,15 +492,16 @@ private:
double m_biuTo3Dunits; ///< Scale factor to convert board internal units
///< to 3D units normalized between -1.0 and 1.0.
std::map<PCB_LAYER_ID, float> m_layerZcoordTop; ///< Top (End) Z pos of each layer in 3D units.
std::map<PCB_LAYER_ID, float> m_layerZcoordBottom; ///< Bottom (Start) Z pos of each layer.
std::map<PCB_LAYER_ID, float> m_layerZcoordTop; ///< Top (End) Z position of each
///< layer in 3D units.
std::map<PCB_LAYER_ID, float> m_layerZcoordBottom; ///< Bottom (Start) Z position of
///< each layer in 3D units.
float m_frontCopperThickness3DU;
float m_backCopperThickness3DU;
float m_boardBodyThickness3DU;
float m_nonCopperLayerThickness3DU;
float m_frontMaskThickness3DU;
float m_backMaskThickness3DU;
float m_solderPasteLayerThickness3DU;
unsigned int m_trackCount;
@@ -40,6 +40,7 @@
#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>
#include <convert_basic_shapes_to_polygon.h>
@@ -109,7 +110,8 @@ void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContaine
SHAPE_POLY_SET finalPoly;
const PCB_TEXT* pcbText = static_cast<const PCB_TEXT*>( aOwner );
pcbText->TransformTextToPolySet( finalPoly, 0, aOwner->GetMaxError(), ERROR_INSIDE );
pcbText->TransformTextToPolySet( finalPoly, 0, m_board->GetDesignSettings().m_MaxError,
ERROR_INSIDE );
// Do not call finalPoly.Fracture() here: ConvertPolygonToTriangles() call it
// if needed, and Fracture() called twice can create bad results and is useless
@@ -190,7 +192,7 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
{
KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
for( PCB_FIELD* field : aFootprint->GetFields() )
for( PCB_FIELD* field : aFootprint->GetFields( true /* visibleOnly */ ) )
{
if( !aFlags.test( LAYER_FP_TEXT ) )
continue;
@@ -201,7 +203,7 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
if( field->IsValue() && !aFlags.test( LAYER_FP_VALUES ) )
continue;
if( field->GetLayer() == aLayerId && field->IsVisible() )
if( field->GetLayer() == aLayerId )
addText( field, aContainer, field );
}
@@ -279,8 +281,9 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
}
void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayer, int aMargin )
void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack,
CONTAINER_2D_BASE* aDstContainer, PCB_LAYER_ID aLayer,
int aMargin )
{
SFVEC2F start3DU = TO_SFVEC2F( aTrack->GetStart() );
SFVEC2F end3DU = TO_SFVEC2F( aTrack->GetEnd() );
@@ -316,7 +319,7 @@ void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack, CONTAINER_2D
VECTOR2I center( arc->GetCenter() );
EDA_ANGLE arc_angle = arc->GetAngle();
double radius = arc->GetRadius();
int arcsegcount = GetArcToSegmentCount( KiROUND( radius ), arc->GetMaxError(), arc_angle );
int arcsegcount = GetArcToSegmentCount( KiROUND( radius ), ARC_HIGH_DEF, arc_angle );
int circlesegcount;
// Avoid arcs that cannot be drawn
@@ -336,7 +339,8 @@ void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack, CONTAINER_2D
}
createArcSegments( center, arc->GetStart(), arc_angle, circlesegcount,
arc->GetWidth() + aMargin * 2, aDstContainer, *arc );
arc->GetWidth() + aMargin * 2,
aDstContainer, *arc );
break;
}
@@ -357,6 +361,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
PCB_LAYER_ID aLayer, const VECTOR2I& aMargin ) const
{
SHAPE_POLY_SET poly;
int maxError = GetBoard()->GetDesignSettings().m_MaxError;
VECTOR2I clearance = aMargin;
// Our shape-based builder can't handle negative or differing x:y clearance values (the
@@ -366,7 +371,8 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
// Of course being a hack it falls down when dealing with custom shape pads (where the size
// is only the size of the anchor), so for those we punt and just use aMargin.x.
if( ( clearance.x < 0 || clearance.x != clearance.y ) && aPad->GetShape( aLayer ) != PAD_SHAPE::CUSTOM )
if( ( clearance.x < 0 || clearance.x != clearance.y )
&& aPad->GetShape( aLayer ) != PAD_SHAPE::CUSTOM )
{
VECTOR2I dummySize = VECTOR2I( aPad->GetSize( aLayer ) ) + clearance + clearance;
@@ -375,19 +381,23 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
PAD dummy( *aPad );
dummy.SetSize( aLayer, VECTOR2I( dummySize.x, dummySize.y ) );
dummy.TransformShapeToPolygon( poly, aLayer, 0, aPad->GetMaxError(), ERROR_INSIDE );
dummy.TransformShapeToPolygon( poly, aLayer, 0, maxError, ERROR_INSIDE );
clearance = { 0, 0 };
// Remove group membership from dummy item before deleting
dummy.SetParentGroup( nullptr );
}
else if( aPad->GetShape( aLayer ) == 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, aPad->GetMaxError() );
aPad->TransformShapeToPolygon( poly, aLayer, 0, maxError );
}
else
{
auto padShapes = std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape( aLayer ) );
auto padShapes =
std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape( aLayer ) );
for( const SHAPE* shape : padShapes->Shapes() )
{
@@ -439,7 +449,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
case SH_ARC:
{
const SHAPE_ARC* arc = static_cast<const SHAPE_ARC*>( shape );
SHAPE_LINE_CHAIN l = arc->ConvertToPolyline( aPad->GetMaxError() );
SHAPE_LINE_CHAIN l = arc->ConvertToPolyline( maxError );
for( int i = 0; i < l.SegmentCount(); i++ )
{
@@ -465,7 +475,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
if( !poly.IsEmpty() )
{
if( clearance.x )
poly.Inflate( clearance.x, CORNER_STRATEGY::ROUND_ALL_CORNERS, aPad->GetMaxError() );
poly.Inflate( clearance.x, CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError );
// Add the PAD polygon
ConvertPolygonToTriangles( poly, *aContainer, m_biuTo3Dunits, *aPad );
@@ -589,29 +599,22 @@ void BOARD_ADAPTER::createArcSegments( const VECTOR2I& aCentre, const VECTOR2I&
void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aContainer,
const BOARD_ITEM* aOwner, PCB_LAYER_ID aLayer )
{
LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle();
int linewidth = aShape->GetWidth();
int margin = 0;
bool isSolidFill = aShape->IsSolidFill();
bool isHatchedFill = aShape->IsHatchedFill();
// The full width of the lines to create
int linewidth = aShape->GetWidth();
int margin = 0;
if( IsSolderMaskLayer( aLayer )
&& aShape->HasSolderMask()
&& IsExternalCopperLayer( aShape->GetLayer() ) )
&& aShape->HasSolderMask()
&& IsExternalCopperLayer( aShape->GetLayer() ) )
{
margin = aShape->GetSolderMaskExpansion();
linewidth += margin * 2;
lineStyle = LINE_STYLE::SOLID;
if( isHatchedFill )
{
isSolidFill = true;
isHatchedFill = false;
}
}
float linewidth3DU = TO_3DU( linewidth );
LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle();
if( lineStyle <= LINE_STYLE::FIRST_TYPE )
{
switch( aShape->GetShape() )
@@ -622,7 +625,7 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
float innerR3DU = TO_3DU( aShape->GetRadius() ) - linewidth3DU / 2.0;
float outerR3DU = TO_3DU( aShape->GetRadius() ) + linewidth3DU / 2.0;
if( isSolidFill || innerR3DU <= 0.0 )
if( aShape->IsFilled() || innerR3DU <= 0.0 )
addFILLED_CIRCLE_2D( aContainer, center3DU, outerR3DU, *aOwner );
else
addRING_2D( aContainer, center3DU, innerR3DU, outerR3DU, *aOwner );
@@ -631,18 +634,19 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
}
case SHAPE_T::RECTANGLE:
if( isSolidFill )
if( aShape->IsFilled() )
{
SHAPE_POLY_SET polyList;
aShape->TransformShapeToPolySet( polyList, UNDEFINED_LAYER, 0, aShape->GetMaxError(),
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF,
ERROR_INSIDE );
polyList.Simplify();
if( margin != 0 )
{
polyList.Inflate( margin, CORNER_STRATEGY::ROUND_ALL_CORNERS, aShape->GetMaxError() );
polyList.Inflate( margin, CORNER_STRATEGY::ROUND_ALL_CORNERS,
GetBoard()->GetDesignSettings().m_MaxError );
}
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
@@ -677,10 +681,11 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
break;
case SHAPE_T::BEZIER:
case SHAPE_T::POLY:
{
SHAPE_POLY_SET polyList;
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, aShape->GetMaxError(),
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF,
ERROR_INSIDE );
// Some polygons can be a bit complex (especially when coming from a
@@ -696,56 +701,13 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
CORNER_STRATEGY cornerStr = margin >= 0 ? CORNER_STRATEGY::ROUND_ALL_CORNERS
: CORNER_STRATEGY::ALLOW_ACUTE_CORNERS;
polyList.Inflate( margin, cornerStr, aShape->GetMaxError() );
polyList.Inflate( margin, cornerStr, GetBoard()->GetDesignSettings().m_MaxError );
}
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
break;
}
case SHAPE_T::POLY:
{
if( isSolidFill )
{
SHAPE_POLY_SET polyList;
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, aShape->GetMaxError(),
ERROR_INSIDE );
// Some polygons can be a bit complex (especially when coming from a
// picture of a text converted to a polygon
// So call Simplify before calling ConvertPolygonToTriangles, just in case.
polyList.Simplify();
if( polyList.IsEmpty() ) // Just for caution
break;
if( margin != 0 )
{
CORNER_STRATEGY cornerStr = margin >= 0 ? CORNER_STRATEGY::ROUND_ALL_CORNERS
: CORNER_STRATEGY::ALLOW_ACUTE_CORNERS;
polyList.Inflate( margin, cornerStr, aShape->GetMaxError() );
}
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
}
else
{
std::vector<VECTOR2I> pts = aShape->GetCorners();
for( int i = 0; i < pts.size() - 1; i++ )
{
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( pts[i] ), TO_SFVEC2F( pts[i + 1] ), linewidth3DU,
*aOwner );
}
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( pts[pts.size() - 1] ), TO_SFVEC2F( pts[0] ), linewidth3DU,
*aOwner );
}
break;
}
default:
wxFAIL_MSG( wxT( "BOARD_ADAPTER::addShape no implementation for " )
+ aShape->SHAPE_T_asString() );
@@ -777,9 +739,6 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
for( SHAPE* shape : shapes )
delete shape;
}
if( isHatchedFill )
ConvertPolygonToTriangles( aShape->GetHatching(), *aContainer, m_biuTo3Dunits, *aOwner );
}
@@ -803,7 +762,7 @@ void BOARD_ADAPTER::addShape( const PCB_TEXTBOX* aTextBox, CONTAINER_2D_BASE* aC
{
SHAPE_POLY_SET polyList;
aTextBox->PCB_SHAPE::TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, aTextBox->GetMaxError(),
aTextBox->PCB_SHAPE::TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF,
ERROR_INSIDE );
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
@@ -833,7 +792,8 @@ void BOARD_ADAPTER::addSolidAreasShapes( const ZONE* aZone, CONTAINER_2D_BASE* a
PCB_LAYER_ID aLayerId )
{
// This convert the poly in outline and holes
ConvertPolygonToTriangles( *aZone->GetFilledPolysList( aLayerId ), *aContainer, m_biuTo3Dunits, *aZone );
ConvertPolygonToTriangles( *aZone->GetFilledPolysList( aLayerId ), *aContainer, m_biuTo3Dunits,
*aZone );
}
@@ -852,7 +812,8 @@ void BOARD_ADAPTER::buildPadOutlineAsSegments( const PAD* aPad, PCB_LAYER_ID aLa
else
{
// For other shapes, add outlines as thick segments in polygon buffer
const std::shared_ptr<SHAPE_POLY_SET>& corners = aPad->GetEffectivePolygon( aLayer, ERROR_INSIDE );
const std::shared_ptr<SHAPE_POLY_SET>& corners = aPad->GetEffectivePolygon( aLayer,
ERROR_INSIDE );
const SHAPE_LINE_CHAIN& path = corners->COutline( 0 );
for( int j = 0; j < path.PointCount(); j++ )
+132 -104
View File
@@ -23,17 +23,34 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file create_layer_items.cpp
* @brief This file implements the creation of the pcb board.
*
* It is based on the function found in the files:
* board_items_to_polygon_shape_transform.cpp
* board_items_to_polygon_shape_transform.cpp
*/
#include "board_adapter.h"
#include "../3d_rendering/raytracing/shapes2D/filled_circle_2d.h"
#include "raytracing/shapes2D/triangle_2d.h"
#include <board_design_settings.h>
#include <board.h>
#include <footprint.h>
#include <layer_range.h>
#include <lset.h>
#include <pad.h>
#include <pcb_text.h>
#include <pcb_textbox.h>
#include <pcb_table.h>
#include <pcb_shape.h>
#include <zone.h>
#include <convert_basic_shapes_to_polygon.h>
#include <trigo.h>
#include <vector>
#include <thread>
#include <core/arraydim.h>
#include <algorithm>
#include <atomic>
#include <wx/log.h>
@@ -42,6 +59,9 @@
#include <core/profile.h>
#endif
/*
* This is used to draw pad outlines on silk layers.
*/
@@ -77,7 +97,7 @@ void transformFPShapesToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLaye
if( item->Type() == PCB_SHAPE_T || BaseType( item->Type() ) == PCB_DIMENSION_T )
{
if( item->GetLayer() == aLayer )
item->TransformShapeToPolySet( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
item->TransformShapeToPolygon( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
}
}
}
@@ -117,7 +137,10 @@ void transformFPTextToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLayer,
{
// border
if( textbox->IsBorderEnabled() )
textbox->PCB_SHAPE::TransformShapeToPolygon( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
{
textbox->PCB_SHAPE::TransformShapeToPolygon( aBuffer, aLayer, 0, aMaxError,
aErrorLoc );
}
// text
textbox->TransformTextToPolySet( aBuffer, 0, aMaxError, aErrorLoc );
@@ -125,7 +148,7 @@ void transformFPTextToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLayer,
}
}
for( const PCB_FIELD* field : aFootprint->GetFields() )
for( const PCB_FIELD* field : aFootprint->GetFields( true /* visibleOnly */ ) )
{
if( !aFlags.test( LAYER_FP_TEXT ) )
continue;
@@ -136,7 +159,7 @@ void transformFPTextToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLayer,
if( field->IsValue() && !aFlags.test( LAYER_FP_VALUES ) )
continue;
if( field->GetLayer() == aLayer && field->IsVisible() )
if( field && field->GetLayer() == aLayer )
field->TransformTextToPolySet( aBuffer, 0, aMaxError, aErrorLoc );
}
}
@@ -219,10 +242,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
trackList.clear();
trackList.reserve( m_board->Tracks().size() );
int maxError = m_board->GetDesignSettings().m_MaxError;
for( PCB_TRACK* track : m_board->Tracks() )
{
// Skip tracks (not vias theyt are on more than one layer ) on disabled layers
if( track->Type() != PCB_VIA_T && !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
if( track->Type() != PCB_VIA_T
&& !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
{
continue;
}
@@ -293,7 +319,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Create tracks as objects and add it to container
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layerMap.contains( layer ) );
wxASSERT( m_layerMap.find( layer ) != m_layerMap.end() );
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
@@ -348,7 +374,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
BVH_CONTAINER_2D *layerHoleContainer = nullptr;
// Check if the layer is already created
if( !m_layerHoleMap.contains( layer ) )
if( m_layerHoleMap.find( layer ) == m_layerHoleMap.end() )
{
// not found, create a new container
layerHoleContainer = new BVH_CONTAINER_2D;
@@ -367,8 +393,10 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
else if( layer == layer_ids[0] ) // it only adds once the THT holes
{
// Add through hole object
m_TH_ODs.Add( new FILLED_CIRCLE_2D( via_center, hole_inner_radius + thickness, *track ) );
m_viaTH_ODs.Add( new FILLED_CIRCLE_2D( via_center, hole_inner_radius + thickness, *track ) );
m_TH_ODs.Add( new FILLED_CIRCLE_2D( via_center, hole_inner_radius + thickness,
*track ) );
m_viaTH_ODs.Add( new FILLED_CIRCLE_2D( via_center, hole_inner_radius + thickness,
*track ) );
if( cfg.clip_silk_on_via_annuli && ring_radius > 0.0 )
m_viaAnnuli.Add( new FILLED_CIRCLE_2D( via_center, ring_radius, *track ) );
@@ -380,12 +408,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( cfg.DifferentiatePlatedCopper() && layer == F_Cu )
{
track->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu, 0, track->GetMaxError(),
track->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu, 0, maxError,
ERROR_INSIDE );
}
else if( cfg.DifferentiatePlatedCopper() && layer == B_Cu )
{
track->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu, 0, track->GetMaxError(),
track->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu, 0, maxError,
ERROR_INSIDE );
}
}
@@ -419,13 +447,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
SHAPE_POLY_SET *layerInnerHolesPoly = nullptr;
// Check if the layer is already created
if( !m_layerHoleOdPolys.contains( layer ) )
if( m_layerHoleOdPolys.find( layer ) == m_layerHoleOdPolys.end() )
{
// not found, create a new container
layerOuterHolesPoly = new SHAPE_POLY_SET;
m_layerHoleOdPolys[layer] = layerOuterHolesPoly;
wxASSERT( !m_layerHoleIdPolys.contains( layer ) );
wxASSERT( m_layerHoleIdPolys.find( layer ) == m_layerHoleIdPolys.end() );
layerInnerHolesPoly = new SHAPE_POLY_SET;
m_layerHoleIdPolys[layer] = layerInnerHolesPoly;
@@ -435,7 +463,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// found
layerOuterHolesPoly = m_layerHoleOdPolys[layer];
wxASSERT( m_layerHoleIdPolys.contains( layer ) );
wxASSERT( m_layerHoleIdPolys.find( layer ) != m_layerHoleIdPolys.end() );
layerInnerHolesPoly = m_layerHoleIdPolys[layer];
}
@@ -443,11 +471,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
const int holediameter = via->GetDrillValue();
const int hole_outer_radius = (holediameter / 2) + GetHolePlatingThickness();
TransformCircleToPolygon( *layerOuterHolesPoly, via->GetStart(), hole_outer_radius,
via->GetMaxError(), ERROR_INSIDE );
TransformCircleToPolygon( *layerOuterHolesPoly, via->GetStart(),
hole_outer_radius, maxError, ERROR_INSIDE );
TransformCircleToPolygon( *layerInnerHolesPoly, via->GetStart(), holediameter / 2,
via->GetMaxError(), ERROR_INSIDE );
TransformCircleToPolygon( *layerInnerHolesPoly, via->GetStart(),
holediameter / 2, maxError, ERROR_INSIDE );
}
else if( layer == layer_ids[0] ) // it only adds once the THT holes
{
@@ -457,16 +485,16 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Add through hole contours
TransformCircleToPolygon( m_TH_ODPolys, via->GetStart(), hole_outer_radius,
via->GetMaxError(), ERROR_INSIDE );
maxError, ERROR_INSIDE );
// Add same thing for vias only
TransformCircleToPolygon( m_viaTH_ODPolys, via->GetStart(), hole_outer_radius,
via->GetMaxError(), ERROR_INSIDE );
maxError, ERROR_INSIDE );
if( cfg.clip_silk_on_via_annuli )
{
TransformCircleToPolygon( m_viaAnnuliPolys, via->GetStart(), hole_outer_ring_radius,
via->GetMaxError(), ERROR_INSIDE );
TransformCircleToPolygon( m_viaAnnuliPolys, via->GetStart(),
hole_outer_ring_radius, maxError, ERROR_INSIDE );
}
}
}
@@ -478,7 +506,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layers_poly.contains( layer ) );
wxASSERT( m_layers_poly.find( layer ) != m_layers_poly.end() );
SHAPE_POLY_SET *layerPoly = m_layers_poly[layer];
@@ -493,11 +521,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
continue;
// Skip vias annulus when not flashed on this layer
if( track->Type() == PCB_VIA_T && !static_cast<const PCB_VIA*>( track )->FlashLayer( layer ) )
if( track->Type() == PCB_VIA_T
&& !static_cast<const PCB_VIA*>( track )->FlashLayer( layer ) )
{
continue;
}
// Add the track/via contour
track->TransformShapeToPolygon( *layerPoly, layer, 0, track->GetMaxError(), ERROR_INSIDE );
track->TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
}
}
}
@@ -515,7 +546,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// The hole in the body is inflated by copper thickness, if not plated, no copper
int inflate = 0;
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
if( pad->GetAttribute () != PAD_ATTRIB::NPTH )
inflate = KiROUND( GetHolePlatingThickness() / 2.0 );
m_holeCount++;
@@ -547,20 +578,20 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// The hole in the body is inflated by copper thickness.
const int inflate = GetHolePlatingThickness();
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
if( pad->GetAttribute () != PAD_ATTRIB::NPTH )
{
if( cfg.clip_silk_on_via_annuli )
pad->TransformHoleToPolygon( m_viaAnnuliPolys, inflate, pad->GetMaxError(), ERROR_INSIDE );
pad->TransformHoleToPolygon( m_viaAnnuliPolys, inflate, maxError, ERROR_INSIDE );
pad->TransformHoleToPolygon( m_TH_ODPolys, inflate, pad->GetMaxError(), ERROR_INSIDE );
pad->TransformHoleToPolygon( m_TH_ODPolys, inflate, maxError, ERROR_INSIDE );
}
else
{
// If not plated, no copper.
if( cfg.clip_silk_on_via_annuli )
pad->TransformHoleToPolygon( m_viaAnnuliPolys, 0, pad->GetMaxError(), ERROR_INSIDE );
pad->TransformHoleToPolygon( m_viaAnnuliPolys, 0, maxError, ERROR_INSIDE );
pad->TransformHoleToPolygon( m_NPTH_ODPolys, 0, pad->GetMaxError(), ERROR_INSIDE );
pad->TransformHoleToPolygon( m_NPTH_ODPolys, 0, maxError, ERROR_INSIDE );
}
}
}
@@ -568,7 +599,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Add footprints copper items (pads, shapes and text) to containers
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layerMap.contains( layer ) );
wxASSERT( m_layerMap.find( layer ) != m_layerMap.end() );
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
@@ -578,13 +609,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
addFootprintShapes( fp, layerContainer, layer, visibilityFlags );
// Add copper item to the plated copper polygon list if required
if( cfg.DifferentiatePlatedCopper() && IsExternalCopperLayer( layer ) )
if( cfg.DifferentiatePlatedCopper() && ( layer == F_Cu || layer == B_Cu ) )
{
SHAPE_POLY_SET* layerPoly = layer == F_Cu ? m_frontPlatedCopperPolys : m_backPlatedCopperPolys;
fp->TransformPadsToPolySet( *layerPoly, layer, 0, fp->GetMaxError(), ERROR_INSIDE );
transformFPTextToPolySet( fp, layer, visibilityFlags, *layerPoly, fp->GetMaxError(), ERROR_INSIDE );
transformFPShapesToPolySet( fp, layer, *layerPoly, fp->GetMaxError(), ERROR_INSIDE );
fp->TransformPadsToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE, true );
transformFPTextToPolySet( fp, layer, visibilityFlags, *layerPoly, maxError, ERROR_INSIDE );
transformFPShapesToPolySet( fp, layer, *layerPoly, maxError, ERROR_INSIDE );
}
// Add copper item to poly contours (vertical outlines) if required
@@ -594,9 +625,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
SHAPE_POLY_SET* layerPoly = m_layers_poly[layer];
fp->TransformPadsToPolySet( *layerPoly, layer, 0, fp->GetMaxError(), ERROR_INSIDE );
transformFPTextToPolySet( fp, layer, visibilityFlags, *layerPoly, fp->GetMaxError(), ERROR_INSIDE );
transformFPShapesToPolySet( fp, layer, *layerPoly, fp->GetMaxError(), ERROR_INSIDE );
fp->TransformPadsToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE, true );
transformFPTextToPolySet( fp, layer, visibilityFlags, *layerPoly, maxError, ERROR_INSIDE );
transformFPShapesToPolySet( fp, layer, *layerPoly, maxError, ERROR_INSIDE );
}
}
}
@@ -604,7 +635,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Add graphic item on copper layers to object containers
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layerMap.contains( layer ) );
wxASSERT( m_layerMap.find( layer ) != m_layerMap.end() );
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
@@ -640,16 +671,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
addShape( static_cast<PCB_DIMENSION_BASE*>( item ), layerContainer, item );
break;
case PCB_REFERENCE_IMAGE_T: // ignore
break;
default:
wxLogTrace( m_logTrace, wxT( "createLayers: item type: %d not implemented" ), item->Type() );
break;
}
// Add copper item to the plated copper polygon list if required
if( cfg.DifferentiatePlatedCopper() && IsExternalCopperLayer( layer ) )
if( cfg.DifferentiatePlatedCopper() && ( layer == F_Cu || layer == B_Cu ) )
{
SHAPE_POLY_SET* copperPolys = layer == F_Cu ? m_frontPlatedCopperPolys : m_backPlatedCopperPolys;
@@ -658,20 +686,19 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( item->Type() == PCB_TEXTBOX_T )
{
PCB_TEXTBOX* text_box = static_cast<PCB_TEXTBOX*>( item );
text_box->TransformTextToPolySet( *copperPolys, 0, text_box->GetMaxError(), ERROR_INSIDE );
text_box->TransformTextToPolySet( *copperPolys, 0, maxError, ERROR_INSIDE );
// Add box outlines
text_box->PCB_SHAPE::TransformShapeToPolygon( *copperPolys, layer, 0, text_box->GetMaxError(),
text_box->PCB_SHAPE::TransformShapeToPolygon( *copperPolys, layer, 0, maxError,
ERROR_INSIDE );
}
else if( item->Type() == PCB_TEXT_T )
{
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
text->TransformTextToPolySet( *copperPolys, 0, text->GetMaxError(), ERROR_INSIDE );
text->TransformTextToPolySet( *copperPolys, 0, maxError, ERROR_INSIDE );
}
else if( item->Type() != PCB_REFERENCE_IMAGE_T )
else
{
item->TransformShapeToPolySet( *copperPolys, layer, 0, item->GetMaxError(), ERROR_INSIDE );
item->TransformShapeToPolygon( *copperPolys, layer, 0, maxError, ERROR_INSIDE );
}
}
@@ -685,14 +712,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_SHAPE_T:
item->TransformShapeToPolySet( *layerPoly, layer, 0, item->GetMaxError(), ERROR_INSIDE );
item->TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
break;
case PCB_TEXT_T:
{
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
text->TransformTextToPolySet( *layerPoly, 0, text->GetMaxError(), ERROR_INSIDE );
text->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
break;
}
@@ -702,11 +729,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( textbox->IsBorderEnabled() )
{
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0, textbox->GetMaxError(),
ERROR_INSIDE );
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0,
maxError, ERROR_INSIDE );
}
textbox->TransformTextToPolySet( *layerPoly, 0, textbox->GetMaxError(), ERROR_INSIDE );
textbox->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
break;
}
@@ -715,14 +742,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
for( PCB_TABLECELL* cell : table->GetCells() )
cell->TransformTextToPolySet( *layerPoly, 0, cell->GetMaxError(), ERROR_INSIDE );
cell->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
table->DrawBorders(
[&]( const VECTOR2I& ptA, const VECTOR2I& ptB,
const STROKE_PARAMS& stroke )
{
SHAPE_SEGMENT seg( ptA, ptB, stroke.GetWidth() );
seg.TransformToPolygon( *layerPoly, table->GetMaxError(), ERROR_INSIDE );
seg.TransformToPolygon( *layerPoly, maxError, ERROR_INSIDE );
} );
break;
}
@@ -735,17 +762,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
PCB_DIMENSION_BASE* dimension = static_cast<PCB_DIMENSION_BASE*>( item );
dimension->TransformTextToPolySet( *layerPoly, 0, dimension->GetMaxError(), ERROR_INSIDE );
dimension->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
for( const std::shared_ptr<SHAPE>& shape : dimension->GetShapes() )
shape->TransformToPolygon( *layerPoly, dimension->GetMaxError(), ERROR_INSIDE );
shape->TransformToPolygon( *layerPoly, maxError, ERROR_INSIDE );
break;
}
case PCB_REFERENCE_IMAGE_T: // ignore
break;
default:
wxLogTrace( m_logTrace, wxT( "createLayers: item type: %d not implemented" ), item->Type() );
break;
@@ -769,11 +793,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
zones.emplace_back( std::make_pair( zone, layer ) );
layer_lock.emplace( layer, std::make_unique<std::mutex>() );
if( cfg.DifferentiatePlatedCopper() && IsExternalCopperLayer( layer ) )
if( cfg.DifferentiatePlatedCopper() && ( layer == F_Cu || layer == B_Cu ) )
{
SHAPE_POLY_SET* copperPolys = layer == F_Cu ? m_frontPlatedCopperPolys : m_backPlatedCopperPolys;
zone->TransformShapeToPolygon( *copperPolys, layer, 0, zone->GetMaxError(), ERROR_INSIDE );
zone->TransformShapeToPolygon( *copperPolys, layer, 0, maxError, ERROR_INSIDE );
}
}
}
@@ -800,19 +824,19 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
PCB_LAYER_ID layer = zones[areaId].second;
if( m_layerMap.contains( layer ) )
addSolidAreasShapes( zone, m_layerMap[layer], layer );
auto layerContainer = m_layerMap.find( layer );
auto layerPolyContainer = m_layers_poly.find( layer );
if( layerContainer != m_layerMap.end() )
addSolidAreasShapes( zone, layerContainer->second, layer );
if( cfg.opengl_copper_thickness && cfg.engine == RENDER_ENGINE::OPENGL
&& m_layers_poly.contains( layer ) )
&& layerPolyContainer != m_layers_poly.end() )
{
auto mut_it = layer_lock.find( layer );
if( mut_it != layer_lock.end() )
{
std::lock_guard< std::mutex > lock( *( mut_it->second ) );
zone->TransformSolidAreasShapesToPolygon( layer, *m_layers_poly[layer] );
}
std::lock_guard< std::mutex > lock( *( mut_it->second ) );
zone->TransformSolidAreasShapesToPolygon( layer, *layerPolyContainer->second );
}
}
@@ -973,15 +997,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
continue;
// Only vias on a external copper layer can have a solder mask
PCB_LAYER_ID copper_layer = ( layer == F_Mask ) ? F_Cu : B_Cu;
PCB_LAYER_ID copper_layer = layer == F_Mask ? F_Cu : B_Cu;
if( track->Type() == PCB_VIA_T )
{
const PCB_VIA* via = static_cast<const PCB_VIA*>( track );
if( !via->FlashLayer( copper_layer ) )
continue;
}
if( track->Type() == PCB_VIA_T
&& !static_cast<const PCB_VIA*>( track )->FlashLayer( copper_layer ) )
continue;
int maskExpansion = track->GetSolderMaskExpansion();
createTrackWithMargin( track, layerContainer, layer, maskExpansion );
@@ -1036,14 +1056,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_SHAPE_T:
item->TransformShapeToPolySet( *layerPoly, layer, 0, item->GetMaxError(), ERROR_INSIDE );
item->TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
break;
case PCB_TEXT_T:
{
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
text->TransformTextToPolySet( *layerPoly, 0, text->GetMaxError(), ERROR_INSIDE );
text->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
break;
}
@@ -1053,11 +1073,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( textbox->IsBorderEnabled() )
{
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0, textbox->GetMaxError(),
ERROR_INSIDE );
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0,
maxError, ERROR_INSIDE );
}
textbox->TransformTextToPolySet( *layerPoly, 0, textbox->GetMaxError(), ERROR_INSIDE );
textbox->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
break;
}
@@ -1066,14 +1086,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
for( PCB_TABLECELL* cell : table->GetCells() )
cell->TransformTextToPolySet( *layerPoly, 0, cell->GetMaxError(), ERROR_INSIDE );
cell->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
table->DrawBorders(
[&]( const VECTOR2I& ptA, const VECTOR2I& ptB,
const STROKE_PARAMS& stroke )
{
SHAPE_SEGMENT seg( ptA, ptB, stroke.GetWidth() );
seg.TransformToPolygon( *layerPoly, table->GetMaxError(), ERROR_INSIDE );
seg.TransformToPolygon( *layerPoly, maxError, ERROR_INSIDE );
} );
break;
@@ -1097,7 +1117,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( via->FlashLayer( layer ) && !via->IsTented( layer ) )
{
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, track->GetMaxError(),
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, maxError,
ERROR_INSIDE );
}
}
@@ -1105,7 +1125,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
if( track->HasSolderMask() )
{
track->TransformShapeToPolySet( *layerPoly, layer, maskExpansion, track->GetMaxError(),
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, maxError,
ERROR_INSIDE );
}
}
@@ -1123,19 +1143,21 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
if( pad->IsOnLayer( layer ) )
{
buildPadOutlineAsPolygon( pad, layer, *layerPoly, linewidth, pad->GetMaxError(),
buildPadOutlineAsPolygon( pad, layer, *layerPoly, linewidth, maxError,
ERROR_INSIDE );
}
}
}
else
{
footprint->TransformPadsToPolySet( *layerPoly, layer, 0, footprint->GetMaxError(), ERROR_INSIDE );
footprint->TransformPadsToPolySet( *layerPoly, layer, 0, maxError,
ERROR_INSIDE );
}
transformFPTextToPolySet( footprint, layer, visibilityFlags, *layerPoly, footprint->GetMaxError(),
transformFPTextToPolySet( footprint, layer, visibilityFlags, *layerPoly, maxError,
ERROR_INSIDE );
transformFPShapesToPolySet( footprint, layer, *layerPoly, footprint->GetMaxError(), ERROR_INSIDE );
transformFPShapesToPolySet( footprint, layer, *layerPoly, maxError,
ERROR_INSIDE );
}
if( cfg.show_zones || layer == F_Mask || layer == B_Mask )
@@ -1185,25 +1207,29 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
aStatusReporter->Report( _( "Calculating plated copper" ) );
// TRIM PLATED COPPER TO SOLDERMASK
if( m_layers_poly.contains( F_Mask ) )
if( m_layers_poly.find( F_Mask ) != m_layers_poly.end() )
{
m_frontPlatedCopperPolys->BooleanIntersection( *m_layers_poly.at( F_Mask ) );
}
if( m_layers_poly.contains( B_Mask ))
if( m_layers_poly.find( B_Mask ) != m_layers_poly.end() )
{
m_backPlatedCopperPolys->BooleanIntersection( *m_layers_poly.at( B_Mask ) );
}
// Subtract plated copper from unplated copper
if( m_layers_poly.contains( F_Cu ) )
if( m_layers_poly.find( F_Cu ) != m_layers_poly.end() )
m_layers_poly[F_Cu]->BooleanSubtract( *m_frontPlatedCopperPolys );
if( m_layers_poly.contains( B_Cu ) )
if( m_layers_poly.find( B_Cu ) != m_layers_poly.end() )
m_layers_poly[B_Cu]->BooleanSubtract( *m_backPlatedCopperPolys );
// ADD PLATED COPPER
ConvertPolygonToTriangles( *m_frontPlatedCopperPolys, *m_platedPadsFront, m_biuTo3Dunits,
*DELETED_BOARD_ITEM::GetInstance() );
*m_board->GetItem( niluuid ) );
ConvertPolygonToTriangles( *m_backPlatedCopperPolys, *m_platedPadsBack, m_biuTo3Dunits,
*DELETED_BOARD_ITEM::GetInstance() );
*m_board->GetItem( niluuid ) );
m_platedPadsFront->BuildBVH();
m_platedPadsBack->BuildBVH();
@@ -1252,11 +1278,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
i < selected_layer_id.size();
i = nextItem.fetch_add( 1 ) )
{
if( m_layers_poly.contains( selected_layer_id[i] ) )
auto layerPoly = m_layers_poly.find( selected_layer_id[i] );
if( layerPoly != m_layers_poly.end() )
{
// This will make a union of all added contours
m_layers_poly[ selected_layer_id[i] ]->ClearArcs();
m_layers_poly[ selected_layer_id[i] ]->Simplify();
layerPoly->second->ClearArcs();
layerPoly->second->Simplify();
}
}
@@ -1277,13 +1305,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
for( PCB_LAYER_ID layer : layer_ids )
{
if( m_layerHoleOdPolys.contains( layer ) )
if( m_layerHoleOdPolys.find( layer ) != m_layerHoleOdPolys.end() )
{
// found
SHAPE_POLY_SET *polyLayer = m_layerHoleOdPolys[layer];
polyLayer->Simplify();
wxASSERT( m_layerHoleIdPolys.contains( layer ) );
wxASSERT( m_layerHoleIdPolys.find( layer ) != m_layerHoleIdPolys.end() );
polyLayer = m_layerHoleIdPolys[layer];
polyLayer->Simplify();
+7 -36
View File
@@ -583,19 +583,6 @@ void EDA_3D_CANVAS::DoRePaint()
Request_refresh( false );
}
static constexpr std::array<VIEW3D_TYPE, static_cast<int>( SPHERES_GIZMO::GizmoSphereSelection::Count )>
viewTable = { VIEW3D_TYPE::VIEW3D_RIGHT, VIEW3D_TYPE::VIEW3D_LEFT, VIEW3D_TYPE::VIEW3D_BACK,
VIEW3D_TYPE::VIEW3D_FRONT, VIEW3D_TYPE::VIEW3D_TOP, VIEW3D_TYPE::VIEW3D_BOTTOM };
SPHERES_GIZMO::GizmoSphereSelection selectedGizmoSphere = m_3d_render_opengl->getSelectedGizmoSphere();
int index = static_cast<int>( selectedGizmoSphere );
if( index >= 0 && index < static_cast<int>( viewTable.size() ) )
{
SetView3D( viewTable[index] );
}
m_3d_render_opengl->resetSelectedGizmoSphere();
m_is_currently_painting.clear();
}
@@ -872,22 +859,6 @@ void EDA_3D_CANVAS::OnLeftUp( wxMouseEvent& event )
m_mouse_is_moving = false;
restart_editingTimeOut_Timer();
}
wxSize logicalSize = GetClientSize();
int logicalW = logicalSize.GetWidth();
int logicalH = logicalSize.GetHeight();
int gizmo_x, gizmo_y, gizmo_width, gizmo_height;
std::tie( gizmo_x, gizmo_y, gizmo_width, gizmo_height ) = m_3d_render_opengl->getGizmoViewport();
float scaleX = static_cast<float>( gizmo_width ) / logicalW;
float scaleY = static_cast<float>( gizmo_height ) / logicalH;
int scaledMouseX = static_cast<int>( event.GetX() * scaleX );
int scaledMouseY = static_cast<int>( ( logicalH - event.GetY() ) * scaleY );
m_3d_render_opengl->handleGizmoMouseInput( scaledMouseX, scaledMouseY );
Refresh();
}
@@ -1124,14 +1095,14 @@ bool EDA_3D_CANVAS::SetView3D( VIEW3D_TYPE aRequestedView )
void EDA_3D_CANVAS::RenderEngineChanged()
{
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
switch( cfg->m_Render.engine )
{
switch( cfg->m_Render.engine )
{
case RENDER_ENGINE::OPENGL: m_3d_render = m_3d_render_opengl; break;
case RENDER_ENGINE::RAYTRACING: m_3d_render = m_3d_render_raytracing; break;
default: m_3d_render = nullptr; break;
}
case RENDER_ENGINE::OPENGL: m_3d_render = m_3d_render_opengl; break;
case RENDER_ENGINE::RAYTRACING: m_3d_render = m_3d_render_raytracing; break;
default: m_3d_render = nullptr; break;
}
if( m_3d_render )
@@ -1,368 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright 2025, Damjan Prerad <damjanovmail@gmail.com>
* Copyright (C) The 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 <glm/geometric.hpp>
#include "3d_spheres_gizmo.h"
SPHERES_GIZMO::~SPHERES_GIZMO()
{
if( m_quadric )
{
gluDeleteQuadric( m_quadric );
m_quadric = nullptr;
}
}
SPHERES_GIZMO::SPHERES_GIZMO( int aGizmoPosX, int aGizmoPosY )
{
m_gizmoPosX = aGizmoPosX;
m_gizmoPosY = aGizmoPosY;
m_quadric = gluNewQuadric();
gluQuadricNormals( m_quadric, GLU_SMOOTH );
}
void SPHERES_GIZMO::setViewport( int ax, int ay, int aWidth, int aHeight )
{
m_viewportX = ax;
m_viewportY = ay;
m_viewportW = aWidth;
m_viewportH = aHeight;
}
std::tuple<int, int, int, int> SPHERES_GIZMO::getViewport() const
{
return std::make_tuple( m_viewportX, m_viewportY, m_viewportW, m_viewportH );
}
void SPHERES_GIZMO::setGizmoPosition( int ax, int ay )
{
m_gizmoPosX = ax;
m_gizmoPosY = ay;
}
void SPHERES_GIZMO::setGizmoMaterial()
{
glEnable( GL_COLOR_MATERIAL );
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
const SFVEC4F ambient = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
const SFVEC4F diffuse = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
const SFVEC4F emissive = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
const SFVEC4F specular = SFVEC4F( 0.1f, 0.1f, 0.1f, 1.0f );
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.r );
glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, 96.0f );
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.r );
glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, &diffuse.r );
glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.r );
}
void SPHERES_GIZMO::handleMouseInput( int aMouseX, int aMouseY )
{
int smallViewportW = m_viewportH / 8;
int smallViewportH = m_viewportH / 8;
bool inside = ( aMouseX >= m_gizmoPosX && aMouseX <= m_gizmoPosX + smallViewportW && aMouseY >= m_gizmoPosY
&& aMouseY <= m_gizmoPosY + smallViewportH );
if( inside )
{
m_ndcX = 2.0f * static_cast<float>( aMouseX - m_gizmoPosX ) / smallViewportW - 1.0f;
m_ndcY = 2.0f * static_cast<float>( aMouseY - m_gizmoPosY ) / smallViewportH - 1.0f;
}
else
{
m_ndcX = -1.0f;
m_ndcY = -1.0f;
}
}
void SPHERES_GIZMO::render3dSpheresGizmo( glm::mat4 aCameraRotationMatrix )
{
float fov = 60.0f;
glDisable( GL_CULL_FACE );
// Set up a square viewport (Y x Y)
glViewport( m_gizmoPosX, m_gizmoPosY, m_viewportH / 8, m_viewportH / 8 );
glClear( GL_DEPTH_BUFFER_BIT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( fov, 1.0f, 0.001f, 2.0f * RANGE_SCALE_3D );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glm::mat4 TranslationMatrix = glm::translate( glm::mat4( 1.0f ), SFVEC3F( 0.0f, 0.0f, -( m_arrowSize * 2.75f ) ) );
glm::mat4 ViewMatrix = TranslationMatrix * aCameraRotationMatrix;
glLoadMatrixf( glm::value_ptr( ViewMatrix ) );
setGizmoMaterial();
// Intersection test
glm::mat4 proj = glm::perspective( glm::radians( fov ), 1.0f, 0.001f, 2.0f * RANGE_SCALE_3D );
glm::mat4 invVP = glm::inverse( proj * ViewMatrix );
glm::vec4 rayStartNDC( m_ndcX, m_ndcY, -1.0f, 1.0f );
glm::vec4 rayEndNDC( m_ndcX, m_ndcY, 1.0f, 1.0f );
glm::vec4 rayStartWorld = invVP * rayStartNDC;
rayStartWorld /= rayStartWorld.w;
glm::vec4 rayEndWorld = invVP * rayEndNDC;
rayEndWorld /= rayEndWorld.w;
glm::vec3 rayOrigin = glm::vec3( rayStartWorld );
glm::vec3 rayDirection = glm::normalize( glm::vec3( rayEndWorld - rayStartWorld ) );
auto intersects =
[]( const glm::vec3& aRayOrigin, const glm::vec3& aRayDir, const glm::vec3& aSphereCenter, float aRadius )
{
glm::vec3 L = aSphereCenter - aRayOrigin;
float tca = glm::dot( L, aRayDir );
float d2 = glm::dot( L, L ) - tca * tca;
return d2 <= aRadius * aRadius;
};
int clickedIndex = -1;
m_selectedGizmoSphere = GizmoSphereSelection::None;
for( size_t i = 0; i < m_spheres.size(); ++i )
{
const auto& sphere = m_spheres[i];
if( intersects( rayOrigin, rayDirection, sphere.m_position, sphere.m_radius ) )
{
clickedIndex = static_cast<int>( i );
m_selectedGizmoSphere = static_cast<GizmoSphereSelection>( i );
break; // only pick the first intersected sphere
}
}
// Update colors
for( size_t i = 0; i < m_spheres.size(); ++i )
{
if( static_cast<int>( i ) == clickedIndex )
{
m_spheres[i].m_color = { 1.0f, 1.0f, 1.0f }; // White
}
else
{
m_spheres[i].m_color = m_spheres[i].m_originalColor; // Restore default
}
}
// Intersection test done
auto drawBillboardCircle = []( const glm::vec3& aCenter, float aRadius, const glm::vec3& aColor,
const glm::vec3& aCamRight, const glm::vec3& aCamUp, int aSegments = 64 )
{
float thickness = aRadius * 0.4f;
glColor3f( aColor.r, aColor.g, aColor.b );
glBegin( GL_TRIANGLE_STRIP );
for( int i = 0; i <= aSegments; ++i )
{
float angle = 2.0f * glm::pi<float>() * i / aSegments;
glm::vec3 dir = cos( angle ) * aCamRight + sin( angle ) * aCamUp;
glm::vec3 outer = aCenter + dir * ( aRadius + thickness * 0.5f );
glm::vec3 inner = aCenter + dir * ( aRadius - thickness * 0.5f );
glVertex3f( outer.x, outer.y, outer.z );
glVertex3f( inner.x, inner.y, inner.z );
}
glEnd();
};
glm::vec3 camRight( aCameraRotationMatrix[0][0], aCameraRotationMatrix[1][0], aCameraRotationMatrix[2][0] );
glm::vec3 camUp( aCameraRotationMatrix[0][1], aCameraRotationMatrix[1][1], aCameraRotationMatrix[2][1] );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
for( const auto& sphere : m_spheres )
{
glColor4f( sphere.m_color.r, sphere.m_color.g, sphere.m_color.b, 0.3f );
glPushMatrix();
glTranslatef( sphere.m_position.x, sphere.m_position.y, sphere.m_position.z );
if( m_quadric )
{
gluSphere( m_quadric, sphere.m_radius, 32, 32 );
}
glPopMatrix();
drawBillboardCircle( sphere.m_position, sphere.m_radius, sphere.m_color, camRight, camUp );
}
// Draw sphere labels
glDisable( GL_DEPTH_TEST );
glDisable( GL_LIGHTING );
std::array<std::string, 6> labels = { "X", "", "Y", "", "Z", "" };
// View direction (camera looks along negative Z in view space)
// So we offset a little toward the camera to avoid z-fighting
glm::vec3 offset = glm::normalize( -rayDirection ) * 0.02f;
glColor4f( 0.0f, 0.0f, 0.0f, 1.0f );
auto drawX = []( const glm::vec3& aPos, float aSize, const glm::vec3& aColor, const glm::vec3& aCamRight,
const glm::vec3& aCamUp )
{
glColor3f( aColor.r, aColor.g, aColor.b );
glLineWidth( 3.0f );
float h = aSize * 0.5f;
// Define two diagonal line directions in camera-facing plane
glm::vec3 dir1 = ( -aCamRight + aCamUp ) * h; // one diagonal
glm::vec3 dir2 = ( -aCamRight - aCamUp ) * h; // other diagonal
glBegin( GL_LINES );
glVertex3f( ( aPos - dir1 ).x, ( aPos - dir1 ).y, ( aPos - dir1 ).z );
glVertex3f( ( aPos + dir1 ).x, ( aPos + dir1 ).y, ( aPos + dir1 ).z );
glVertex3f( ( aPos - dir2 ).x, ( aPos - dir2 ).y, ( aPos - dir2 ).z );
glVertex3f( ( aPos + dir2 ).x, ( aPos + dir2 ).y, ( aPos + dir2 ).z );
glEnd();
};
auto drawY = []( const glm::vec3& aPos, float aSize, const glm::vec3& aColor, const glm::vec3& aCamRight,
const glm::vec3& aCamUp )
{
glColor3f( aColor.r, aColor.g, aColor.b );
glLineWidth( 3.0f );
float h = aSize * 0.5f;
// Top-left and top-right in screen plane
glm::vec3 topLeft = aPos + aCamUp * h - aCamRight * h;
glm::vec3 topRight = aPos + aCamUp * h + aCamRight * h;
glm::vec3 bottom = aPos - aCamUp * h;
glBegin( GL_LINES );
glVertex3f( topLeft.x, topLeft.y, topLeft.z );
glVertex3f( aPos.x, aPos.y, aPos.z );
glVertex3f( topRight.x, topRight.y, topRight.z );
glVertex3f( aPos.x, aPos.y, aPos.z );
glVertex3f( aPos.x, aPos.y, aPos.z );
glVertex3f( bottom.x, bottom.y, bottom.z );
glEnd();
};
auto drawZ = []( const glm::vec3& aPos, float aSize, const glm::vec3& aColor, const glm::vec3& aCamRight,
const glm::vec3& aCamUp )
{
glColor3f( aColor.r, aColor.g, aColor.b );
glLineWidth( 3.0f );
float h = aSize * 0.5f;
// Define corners in screen plane relative to camera
glm::vec3 topLeft = aPos + aCamUp * h - aCamRight * h;
glm::vec3 topRight = aPos + aCamUp * h + aCamRight * h;
glm::vec3 bottomLeft = aPos - aCamUp * h - aCamRight * h;
glm::vec3 bottomRight = aPos - aCamUp * h + aCamRight * h;
glBegin( GL_LINE_STRIP );
glVertex3f( topLeft.x, topLeft.y, topLeft.z );
glVertex3f( topRight.x, topRight.y, topRight.z );
glVertex3f( bottomLeft.x, bottomLeft.y, bottomLeft.z );
glVertex3f( bottomRight.x, bottomRight.y, bottomRight.z );
glEnd();
};
for( size_t i = 0; i < m_spheres.size(); ++i )
{
if( labels[i].empty() )
continue;
glm::vec3 textPos = m_spheres[i].m_position + offset;
const std::string& label = labels[i];
if( label == "X" )
{
drawX( textPos, 0.30f, glm::vec3( 0.0f ), camRight, camUp );
}
else if( label == "Y" )
{
drawY( textPos, 0.30f, glm::vec3( 0.0f ), camRight, camUp );
}
else if( label == "Z" )
{
drawZ( textPos, 0.30f, glm::vec3( 0.0f ), camRight, camUp );
}
}
glEnable( GL_LIGHTING );
glEnable( GL_DEPTH_TEST );
// Draw lines only to the positive axis spheres
glLineWidth( 2.0f );
glBegin( GL_LINES );
glColor3f( 0.9f, 0.0f, 0.0f ); // X+
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( m_arrowSize, 0.0f, 0.0f );
glColor3f( 0.0f, 0.9f, 0.0f ); // Y+
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, m_arrowSize, 0.0f );
glColor3f( 0.0f, 0.0f, 0.9f ); // Z+
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, 0.0f, m_arrowSize );
glEnd();
glEnable( GL_CULL_FACE );
}
SPHERES_GIZMO::GizmoSphereSelection SPHERES_GIZMO::getSelectedGizmoSphere() const
{
return m_selectedGizmoSphere;
}
void SPHERES_GIZMO::resetSelectedGizmoSphere()
{
m_selectedGizmoSphere = GizmoSphereSelection::None;
m_ndcX = -1.0f;
m_ndcY = -1.0f;
}
@@ -1,133 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright 2025, Damjan Prerad <damjanovmail@gmail.com>
* Copyright (C) The 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 _3D_SPHERES_GIZMO_H_
#define _3D_SPHERES_GIZMO_H_
#include "../render_3d_base.h"
/**
* @class SPHERES_GIZMO
* @brief Renders a set of colored spheres in 3D space that act as a directional orientation gizmo.
*/
class SPHERES_GIZMO
{
public:
SPHERES_GIZMO( int aGizmoPosX, int aGizmoPosY );
~SPHERES_GIZMO();
void setViewport( int ax, int ay, int aWidth, int aHeight );
std::tuple<int, int, int, int> getViewport() const;
void setGizmoPosition( int ax, int ay );
void handleMouseInput( int aMouseX, int aMouseY );
/**
* @enum GizmoSphereSelection
* @brief Enum to indicate which sphere (direction) is selected.
*/
enum class GizmoSphereSelection
{
None = -1, ///< No sphere selected.
Right = 0, ///< +X direction.
Left, ///< -X direction.
Back, ///< +Y direction.
Front, ///< -Y direction.
Top, ///< +Z direction.
Bottom, ///< -Z direction.
Count ///< Number of selectable spheres.
};
GizmoSphereSelection getSelectedGizmoSphere() const;
void resetSelectedGizmoSphere();
void render3dSpheresGizmo( glm::mat4 aCameraRotationMatrix );
private:
void setGizmoMaterial();
GLUquadric* m_quadric = nullptr;
int m_gizmoPosX = 0;
int m_gizmoPosY = 0;
int m_viewportX = 0;
int m_viewportY = 0;
int m_viewportW = 0;
int m_viewportH = 0;
float m_ndcX = -1.0f;
float m_ndcY = -1.0f;
struct GizmoSphere
{
glm::vec3 m_position;
float m_radius;
glm::vec3 m_labelPosition;
glm::vec3 m_color;
glm::vec3 m_originalColor;
};
// Define sphere positions
const float m_arrowSize = RANGE_SCALE_3D * 0.20f;
const float m_sphereRadius = 0.05f * RANGE_SCALE_3D;
/**
* @brief List of all directional gizmo spheres.
* The order follows the GizmoSphereSelection enum.
*/
std::array<GizmoSphere, 6> m_spheres = { { { { m_arrowSize, 0.0f, 0.0f },
m_sphereRadius,
{ m_arrowSize + 0.02f, 0.0f, 0.0f },
{ 0.9f, 0.0f, 0.0f },
{ 0.9f, 0.0f, 0.0f } },
{ { -m_arrowSize, 0.0f, 0.0f },
m_sphereRadius,
{ -m_arrowSize - 0.02f, 0.0f, 0.0f },
{ 0.4f, 0.0f, 0.0f },
{ 0.4f, 0.0f, 0.0f } },
{ { 0.0f, m_arrowSize, 0.0f },
m_sphereRadius,
{ 0.0f, m_arrowSize + 0.02f, 0.0f },
{ 0.0f, 0.9f, 0.0f },
{ 0.0f, 0.9f, 0.0f } },
{ { 0.0f, -m_arrowSize, 0.0f },
m_sphereRadius,
{ 0.0f, -m_arrowSize - 0.02f, 0.0f },
{ 0.0f, 0.4f, 0.0f },
{ 0.0f, 0.4f, 0.0f } },
{ { 0.0f, 0.0f, m_arrowSize },
m_sphereRadius,
{ 0.0f, 0.0f, m_arrowSize + 0.02f },
{ 0.0f, 0.0f, 0.9f },
{ 0.0f, 0.0f, 0.9f } },
{ { 0.0f, 0.0f, -m_arrowSize },
m_sphereRadius,
{ 0.0f, 0.0f, -m_arrowSize - 0.02f },
{ 0.0f, 0.0f, 0.4f },
{ 0.0f, 0.0f, 0.4f } } } };
GizmoSphereSelection m_selectedGizmoSphere = GizmoSphereSelection::None;
};
#endif // _3D_SPHERES_GIZMO_H_
+15 -13
View File
@@ -481,8 +481,9 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
SHAPE_POLY_SET board_poly_with_holes = m_boardAdapter.GetBoardPoly().CloneDropTriangulation();
board_poly_with_holes.BooleanSubtract( m_boardAdapter.GetTH_ODPolys() );
board_poly_with_holes.BooleanSubtract( m_boardAdapter.GetNPTH_ODPolys() );
m_boardWithHoles = createBoard( board_poly_with_holes, &m_boardAdapter.GetTH_IDs() );
m_boardWithHoles = createBoard( board_poly_with_holes );
if( m_antiBoard )
m_antiBoard->SetItIsTransparent( true );
@@ -566,7 +567,7 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
if( m_boardAdapter.m_Cfg->m_Render.opengl_copper_thickness )
{
if( map_poly.contains( layer ) )
if( map_poly.find( layer ) != map_poly.end() )
{
polyListSubtracted = *map_poly.at( layer );
@@ -583,11 +584,11 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
if( m_boardAdapter.m_Cfg->m_Render.subtract_mask_from_silk )
{
if( layer == B_SilkS && map_poly.contains( B_Mask ) )
if( layer == B_SilkS && map_poly.find( B_Mask ) != map_poly.end() )
{
polyListSubtracted.BooleanSubtract( *map_poly.at( B_Mask ) );
}
else if( layer == F_SilkS && map_poly.contains( F_Mask ) )
else if( layer == F_SilkS && map_poly.find( F_Mask ) != map_poly.end() )
{
polyListSubtracted.BooleanSubtract( *map_poly.at( F_Mask ) );
}
@@ -771,12 +772,13 @@ void RENDER_3D_OPENGL::generateViasAndPads()
wxASSERT( zbot < ztop );
generateCylinder( via_center, hole_inner_radius, hole_inner_radius + platingThickness3d,
generateCylinder( via_center, hole_inner_radius,
hole_inner_radius + platingThickness3d,
ztop, zbot, nrSegments, layerTriangleVIA );
}
}
m_microviaHoles = new OPENGL_RENDER_LIST( *layerTriangleVIA, 0, 0.0f, 0.0f );
m_vias = new OPENGL_RENDER_LIST( *layerTriangleVIA, 0, 0.0f, 0.0f );
delete layerTriangleVIA;
}
@@ -801,10 +803,10 @@ void RENDER_3D_OPENGL::generateViasAndPads()
{
TransformCircleToPolygon( tht_outer_holes_poly, via->GetPosition(),
via->GetDrill() / 2 + platingThickness,
via->GetMaxError(), ERROR_INSIDE );
ARC_HIGH_DEF, ERROR_INSIDE );
TransformCircleToPolygon( tht_inner_holes_poly, via->GetPosition(), via->GetDrill() / 2,
via->GetMaxError(), ERROR_INSIDE );
TransformCircleToPolygon( tht_inner_holes_poly, via->GetPosition(),
via->GetDrill() / 2, ARC_HIGH_DEF, ERROR_INSIDE );
}
}
}
@@ -823,9 +825,9 @@ void RENDER_3D_OPENGL::generateViasAndPads()
continue;
pad->TransformHoleToPolygon( tht_outer_holes_poly, platingThickness,
pad->GetMaxError(), ERROR_INSIDE );
pad->TransformHoleToPolygon( tht_inner_holes_poly, 0,
pad->GetMaxError(), ERROR_INSIDE );
ARC_HIGH_DEF, ERROR_INSIDE );
pad->TransformHoleToPolygon( tht_inner_holes_poly, 0, ARC_HIGH_DEF,
ERROR_INSIDE );
}
}
}
@@ -960,7 +962,7 @@ void RENDER_3D_OPENGL::load3dModels( REPORTER* aStatusReporter )
// Check if the fp_model is not present in our cache map
// (Not already loaded in memory)
if( !m_3dModelMap.contains( fp_model.m_Filename ) )
if( m_3dModelMap.find( fp_model.m_Filename ) == m_3dModelMap.end() )
{
// It is not present, try get it from cache
std::vector<const EMBEDDED_FILES*> embeddedFilesStack;
@@ -49,7 +49,8 @@
*/
#define UNITS3D_TO_UNITSPCB ( pcbIUScale.IU_PER_MM )
RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera ) :
RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter,
CAMERA& aCamera ) :
RENDER_3D_BASE( aAdapter, aCamera ),
m_canvas( aCanvas )
{
@@ -70,7 +71,7 @@ RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdap
m_outerThroughHoles = nullptr;
m_outerThroughHoleRings = nullptr;
m_outerViaThroughHoles = nullptr;
m_microviaHoles = nullptr;
m_vias = nullptr;
m_padHoles = nullptr;
m_circleTexture = 0;
@@ -80,8 +81,6 @@ RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdap
m_boardWithHoles = nullptr;
m_3dModelMap.clear();
m_spheres_gizmo = new SPHERES_GIZMO( 4, 4 );
}
@@ -92,8 +91,6 @@ RENDER_3D_OPENGL::~RENDER_3D_OPENGL()
freeAllLists();
glDeleteTextures( 1, &m_circleTexture );
delete m_spheres_gizmo;
}
@@ -107,13 +104,9 @@ void RENDER_3D_OPENGL::SetCurWindowSize( const wxSize& aSize )
{
if( m_windowSize != aSize )
{
int viewport[4];
int fbWidth, fbHeight;
glGetIntegerv( GL_VIEWPORT, viewport );
m_windowSize = aSize;
glViewport( 0, 0, m_windowSize.x, m_windowSize.y );
setGizmoViewport( 0, 0, m_windowSize.x, m_windowSize.y );
// Initialize here any screen dependent data here
}
}
@@ -146,33 +139,42 @@ void RENDER_3D_OPENGL::setLightBottom( bool enabled )
}
void RENDER_3D_OPENGL::resetSelectedGizmoSphere()
void RENDER_3D_OPENGL::render3dArrows()
{
m_spheres_gizmo->resetSelectedGizmoSphere();
}
const float arrow_size = RANGE_SCALE_3D * 0.30f;
glDisable( GL_CULL_FACE );
SPHERES_GIZMO::GizmoSphereSelection RENDER_3D_OPENGL::getSelectedGizmoSphere() const
{
return m_spheres_gizmo->getSelectedGizmoSphere();
}
// YxY squared view port, this is on propose
glViewport( 4, 4, m_windowSize.y / 8 , m_windowSize.y / 8 );
glClear( GL_DEPTH_BUFFER_BIT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( 45.0f, 1.0f, 0.001f, RANGE_SCALE_3D );
void RENDER_3D_OPENGL::setGizmoViewport( int x, int y, int width, int height )
{
m_spheres_gizmo->setViewport( x, y, width, height );
}
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
const glm::mat4 TranslationMatrix =
glm::translate( glm::mat4( 1.0f ), SFVEC3F( 0.0f, 0.0f, -( arrow_size * 2.75f ) ) );
std::tuple<int, int, int, int> RENDER_3D_OPENGL::getGizmoViewport() const
{
return m_spheres_gizmo->getViewport();
}
const glm::mat4 ViewMatrix = TranslationMatrix * m_camera.GetRotationMatrix();
glLoadMatrixf( glm::value_ptr( ViewMatrix ) );
void RENDER_3D_OPENGL::handleGizmoMouseInput( int mouseX, int mouseY )
{
m_spheres_gizmo->handleMouseInput( mouseX, mouseY );
setArrowMaterial();
glColor3f( 0.9f, 0.0f, 0.0f );
DrawRoundArrow( SFVEC3F( 0.0f, 0.0f, 0.0f ), SFVEC3F( arrow_size, 0.0f, 0.0f ), 0.275f );
glColor3f( 0.0f, 0.9f, 0.0f );
DrawRoundArrow( SFVEC3F( 0.0f, 0.0f, 0.0f ), SFVEC3F( 0.0f, arrow_size, 0.0f ), 0.275f );
glColor3f( 0.0f, 0.0f, 0.9f );
DrawRoundArrow( SFVEC3F( 0.0f, 0.0f, 0.0f ), SFVEC3F( 0.0f, 0.0f, arrow_size ), 0.275f );
glEnable( GL_CULL_FACE );
}
@@ -593,15 +595,15 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
bool skipThickness = aIsMoving && cfg.opengl_thickness_disableOnMove;
bool skipRenderHoles = aIsMoving && cfg.opengl_holes_disableOnMove;
bool skipRenderMicroVias = aIsMoving && cfg.opengl_microvias_disableOnMove;
bool skipRenderVias = aIsMoving && cfg.opengl_vias_disableOnMove;
bool showThickness = !skipThickness;
std::bitset<LAYER_3D_END> layerFlags = m_boardAdapter.GetVisibleLayers();
setLayerMaterial( B_Cu );
if( !( skipRenderMicroVias || skipRenderHoles ) && m_microviaHoles )
m_microviaHoles->DrawAll();
if( !( skipRenderVias || skipRenderHoles ) && m_vias )
m_vias->DrawAll();
if( !skipRenderHoles && m_padHoles )
m_padHoles->DrawAll();
@@ -684,6 +686,10 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
unsetDepthOffset();
}
else if( isPasteLayer && skipRenderHoles )
{
// Do not render paste layers when skipRenderHoles is enabled or we get z-fight issues
}
else
{
setLayerMaterial( layer );
@@ -692,13 +698,10 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
OPENGL_RENDER_LIST* anti_board = nullptr;
OPENGL_RENDER_LIST* solder_mask = nullptr;
if( !skipRenderHoles )
{
if( isSilkLayer && cfg.clip_silk_on_via_annuli )
throughHolesOuter = m_outerThroughHoleRings;
else
throughHolesOuter = m_outerThroughHoles;
}
if( isSilkLayer && cfg.clip_silk_on_via_annuli )
throughHolesOuter = m_outerThroughHoleRings;
else
throughHolesOuter = m_outerThroughHoles;
if( isSilkLayer && cfg.show_off_board_silk )
anti_board = nullptr;
@@ -824,8 +827,8 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
}
// Render 3D arrows
if( cfg.show_navigator )
m_spheres_gizmo->render3dSpheresGizmo( m_camera.GetRotationMatrix() );
if( cfg.show_axis )
render3dArrows();
// Return back to the original viewport (this is important if we want
// to take a screenshot after the render)
@@ -945,7 +948,7 @@ void RENDER_3D_OPENGL::freeAllLists()
DELETE_AND_FREE( m_outerViaThroughHoles )
DELETE_AND_FREE( m_outerThroughHoleRings )
DELETE_AND_FREE( m_microviaHoles )
DELETE_AND_FREE( m_vias )
DELETE_AND_FREE( m_padHoles )
}
@@ -27,7 +27,6 @@
#include "../render_3d_base.h"
#include "layer_triangles.h"
#include "3d_spheres_gizmo.h"
#include "../raytracing/shapes2D/polygon_2d.h"
#include "../raytracing/shapes2D/triangle_2d.h"
@@ -71,11 +70,6 @@ public:
* Load footprint models if they are not already loaded, i.e. if m_3dModelMap is empty
*/
void Load3dModelsIfNeeded();
void handleGizmoMouseInput( int mouseX, int mouseY );
void setGizmoViewport( int x, int y, int width, int height );
std::tuple<int, int, int, int> getGizmoViewport() const;
SPHERES_GIZMO::GizmoSphereSelection getSelectedGizmoSphere() const;
void resetSelectedGizmoSphere();
private:
OPENGL_RENDER_LIST* generateHoles( const LIST_OBJECT2D& aListHolesObject2d,
@@ -174,6 +168,8 @@ private:
void setLightTop( bool enabled );
void setLightBottom( bool enabled );
void render3dArrows();
/**
* Create a 3D grid to an OpenGL display list.
*
@@ -234,7 +230,7 @@ private:
GLuint m_grid; ///< oGL list that stores current grid
GRID3D_TYPE m_lastGridType; ///< Stores the last grid type.
OPENGL_RENDER_LIST* m_microviaHoles;
OPENGL_RENDER_LIST* m_vias;
OPENGL_RENDER_LIST* m_padHoles;
// Caches
@@ -243,9 +239,8 @@ private:
BOARD_ITEM* m_currentRollOverItem;
SHAPE_POLY_SET m_antiBoardPolys; ///< The negative polygon representation of the board
///< outline.
SPHERES_GIZMO* m_spheres_gizmo;
SHAPE_POLY_SET m_antiBoardPolys; ///< The negative polygon representation of the board
///< outline.
};
#endif // RENDER_3D_OPENGL_H
@@ -1296,7 +1296,7 @@ void RENDER_3D_RAYTRACE_BASE::load3DModels( CONTAINER_3D& aDstContainer,
embeddedFilesStack.push_back( m_boardAdapter.GetBoard()->GetEmbeddedFiles() );
const S3DMODEL* modelPtr = cacheMgr->GetModel( model.m_Filename, footprintBasePath,
std::move( embeddedFilesStack ) );
embeddedFilesStack );
// only add it if the return is not NULL.
if( modelPtr )
+17 -4
View File
@@ -48,8 +48,15 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
//
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
fileMenu->Add( EDA_3D_ACTIONS::exportAsPNG );
fileMenu->Add( EDA_3D_ACTIONS::exportAsJPEG );
fileMenu->Add( _( "Export Current View as PNG..." ),
wxEmptyString,
ID_MENU_SCREENCOPY_PNG,
BITMAPS::export_png );
fileMenu->Add( _( "Export Current View as JPEG..." ),
wxEmptyString,
ID_MENU_SCREENCOPY_JPEG,
BITMAPS::export_file );
fileMenu->AppendSeparator();
fileMenu->AddClose( _( "3D Viewer" ) );
@@ -60,7 +67,10 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
// The translated modifiers do not always work
ACTION_MENU* editMenu = new ACTION_MENU( false, tool );
editMenu->Add( EDA_3D_ACTIONS::copyToClipboard );
editMenu->Add( _( "Copy 3D Image" ),
wxEmptyString,
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
BITMAPS::copy );
//-- View menu -------------------------------------------------------
@@ -112,7 +122,10 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
//
ACTION_MENU* prefsMenu = new ACTION_MENU( false, tool );
prefsMenu->Add( EDA_3D_ACTIONS::toggleRaytacing, ACTION_MENU::CHECK );
prefsMenu->Add( _( "Raytracing" ), "",
ID_RENDER_CURRENT_VIEW,
BITMAPS::tools,
ACTION_MENU::CHECK );
prefsMenu->Add( ACTIONS::openPreferences );
+107
View File
@@ -0,0 +1,107 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2023 CERN
* Copyright The 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 <wx/wupdlock.h>
#include <wx/choice.h>
#include <bitmaps.h>
#include <dialogs/eda_view_switcher.h>
#include <eda_3d_viewer_frame.h>
#include <tool/action_toolbar.h>
#include <tools/eda_3d_actions.h>
#include <3d_viewer_id.h>
void EDA_3D_VIEWER_FRAME::ReCreateMainToolbar()
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::ReCreateMainToolbar" ) );
wxWindowUpdateLocker dummy( this );
if( m_mainToolBar )
{
m_mainToolBar->ClearToolbar();
}
else
{
m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT |
wxAUI_TB_HORIZONTAL );
m_mainToolBar->SetAuiManager( &m_auimgr );
}
// Set up toolbar
m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
KiBitmapBundle( BITMAPS::import3d ),
_( "Reload board" ) );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
KiBitmapBundle( BITMAPS::copy ),
_( "Copy 3D image to clipboard" ) );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
KiBitmapBundle( BITMAPS::ray_tracing ),
_( "Render current view using Raytracing" ), wxITEM_CHECK );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( ACTIONS::zoomRedraw );
m_mainToolBar->Add( ACTIONS::zoomInCenter );
m_mainToolBar->Add( ACTIONS::zoomOutCenter );
m_mainToolBar->Add( ACTIONS::zoomFitScreen );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateXCW );
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateXCCW );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateYCW );
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateYCCW );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateZCW );
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateZCCW );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( EDA_3D_ACTIONS::flipView );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( EDA_3D_ACTIONS::moveLeft );
m_mainToolBar->Add( EDA_3D_ACTIONS::moveRight );
m_mainToolBar->Add( EDA_3D_ACTIONS::moveUp );
m_mainToolBar->Add( EDA_3D_ACTIONS::moveDown );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( EDA_3D_ACTIONS::toggleOrtho, ACTION_TOOLBAR::TOGGLE );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( EDA_3D_ACTIONS::showLayersManager, ACTION_TOOLBAR::TOGGLE );
m_mainToolBar->KiRealize();
}
+106 -55
View File
@@ -58,7 +58,6 @@
#include <widgets/wx_aui_utils.h>
#include <wildcards_and_files_ext.h>
#include <project_pcb.h>
#include <toolbars_3d.h>
#include <3d_navlib/nl_3d_viewer_plugin.h>
@@ -81,6 +80,7 @@ BEGIN_EVENT_TABLE( EDA_3D_VIEWER_FRAME, KIWAY_PLAYER )
EDA_3D_VIEWER_FRAME::Process_Special_Functions )
EVT_MENU( wxID_CLOSE, EDA_3D_VIEWER_FRAME::Exit3DFrame )
EVT_MENU( ID_RENDER_CURRENT_VIEW, EDA_3D_VIEWER_FRAME::onRenderEngineSelection )
EVT_MENU( ID_DISABLE_RAY_TRACING, EDA_3D_VIEWER_FRAME::onDisableRayTracing )
EVT_CLOSE( EDA_3D_VIEWER_FRAME::OnCloseWindow )
@@ -91,6 +91,7 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
const wxString& aTitle, long style ) :
KIWAY_PLAYER( aKiway, aParent, FRAME_PCB_DISPLAY3D, aTitle, wxDefaultPosition,
wxDefaultSize, style, QUALIFIED_VIEWER3D_FRAMENAME( aParent ), unityScale ),
m_mainToolBar( nullptr ),
m_canvas( nullptr ),
m_currentCamera( m_trackBallCamera ),
m_trackBallCamera( 2 * RANGE_SCALE_3D )
@@ -111,26 +112,24 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
wxStatusBar *status_bar = CreateStatusBar( arrayDim( status_dims ) );
SetStatusWidths( arrayDim( status_dims ), status_dims );
ANTIALIASING_MODE aaMode = ANTIALIASING_MODE::AA_NONE;
EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
ANTIALIASING_MODE aaMode = static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode );
if( cfg )
aaMode = static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode );
m_canvas = new EDA_3D_CANVAS( this, OGL_ATT_LIST::GetAttributesList( aaMode, true ), m_boardAdapter,
m_currentCamera, PROJECT_PCB::Get3DCacheManager( &Prj() ) );
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() );
LoadSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
LoadSettings( cfg );
loadCommonSettings();
m_appearancePanel->SetUserViewports( Prj().GetProjectFile().m_Viewports3D );
// Create the manager
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetBoard(), nullptr, nullptr,
GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ), this );
m_toolManager->SetEnvironment( GetBoard(), nullptr, nullptr, cfg, this );
m_actions = new EDA_3D_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
@@ -144,22 +143,19 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
setupUIConditions();
if( EDA_3D_CONTROLLER* ctrlTool = GetToolManager()->GetTool<EDA_3D_CONTROLLER>() )
ctrlTool->SetRotationIncrement( cfg ? cfg->m_Camera.rotation_increment : 10.0 );
ctrlTool->SetRotationIncrement( cfg->m_Camera.rotation_increment );
// Run the viewer control tool, it is supposed to be always active
m_toolManager->InvokeTool( "3DViewer.Control" );
ReCreateMenuBar();
m_toolbarSettings = Pgm().GetSettingsManager().GetToolbarSettings<EDA_3D_VIEWER_TOOLBAR_SETTINGS>( "3d_viewer-toolbars" );
configureToolbars();
RecreateToolbars();
ReCreateMainToolbar();
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
m_auimgr.SetManagedWindow( this );
m_auimgr.AddPane( m_tbTopMain, EDA_PANE().HToolbar().Name( wxS( "TopMainToolbar" ) )
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) )
.Top().Layer( 6 ) );
m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( wxS( "InfoBar" ) )
.Top().Layer( 1 ) );
@@ -172,11 +168,10 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
if( cfg && cfg->m_AuiPanels.right_panel_width > 0 )
if( cfg->m_AuiPanels.right_panel_width > 0 )
SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
if( cfg )
layersManager.Show( cfg->m_AuiPanels.show_layer_manager );
layersManager.Show( cfg->m_AuiPanels.show_layer_manager );
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
// hiding it.
@@ -260,9 +255,10 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions()
{
return m_boardAdapter.m_Cfg->m_Render.show_model_bbox;
};
auto showNavig = [this]( const SELECTION& aSel )
auto showAxes =
[this]( const SELECTION& aSel )
{
return m_boardAdapter.m_Cfg->m_Render.show_navigator;
return m_boardAdapter.m_Cfg->m_Render.show_axis;
};
auto ortho =
[this]( const SELECTION& )
@@ -276,7 +272,7 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions()
return m_boardAdapter.m_Cfg->m_AuiPanels.show_layer_manager;
};
mgr->SetConditions( EDA_3D_ACTIONS::toggleRaytacing, ACTION_CONDITIONS().Check( raytracing ) );
RegisterUIUpdateHandler( ID_RENDER_CURRENT_VIEW, ACTION_CONDITIONS().Check( raytracing ) );
mgr->SetConditions( EDA_3D_ACTIONS::showTHT, ACTION_CONDITIONS().Check( showTH ) );
mgr->SetConditions( EDA_3D_ACTIONS::showSMD, ACTION_CONDITIONS().Check( showSMD ) );
@@ -286,7 +282,7 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions()
mgr->SetConditions( EDA_3D_ACTIONS::showDNP, ACTION_CONDITIONS().Check( show_DNP ) );
mgr->SetConditions( EDA_3D_ACTIONS::showBBoxes, ACTION_CONDITIONS().Check( showBBoxes ) );
mgr->SetConditions( EDA_3D_ACTIONS::showNavigator, ACTION_CONDITIONS().Check( showNavig ) );
mgr->SetConditions( EDA_3D_ACTIONS::showAxis, ACTION_CONDITIONS().Check( showAxes ) );
mgr->SetConditions( EDA_3D_ACTIONS::noGrid, GridSizeCheck( GRID3D_TYPE::NONE ) );
mgr->SetConditions( EDA_3D_ACTIONS::show10mmGrid, GridSizeCheck( GRID3D_TYPE::GRID_10MM ) );
@@ -458,25 +454,45 @@ void EDA_3D_VIEWER_FRAME::OnCloseWindow( wxCloseEvent &event )
void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
{
int id = event.GetId();
bool isChecked = event.IsChecked();
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::Process_Special_Functions id %d "
"isChecked %d" ),
id,
isChecked );
if( m_canvas == nullptr )
return;
switch( event.GetId() )
switch( id )
{
case ID_RELOAD3D_BOARD:
NewDisplay( true );
break;
case ID_TOOL_SCREENCOPY_TOCLIBBOARD:
case ID_MENU_SCREENCOPY_PNG:
case ID_MENU_SCREENCOPY_JPEG:
takeScreenshot( event );
return;
case ID_MENU3D_RESET_DEFAULTS:
{
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
m_boardAdapter.SetLayerColors( m_boardAdapter.GetDefaultColors() );
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
cfg->ResetToDefaults();
LoadSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
cfg->ResetToDefaults();
LoadSettings( cfg );
// Tell canvas that we (may have) changed the render engine
RenderEngineChanged();
NewDisplay( true );
return;
}
return;
default:
wxFAIL_MSG( wxT( "Invalid event in EDA_3D_VIEWER_FRAME::Process_Special_Functions()" ) );
@@ -485,9 +501,28 @@ void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
}
void EDA_3D_VIEWER_FRAME::onRenderEngineSelection( wxCommandEvent &event )
{
RENDER_ENGINE& engine = m_boardAdapter.m_Cfg->m_Render.engine;
RENDER_ENGINE old_engine = engine;
if( old_engine == RENDER_ENGINE::OPENGL )
engine = RENDER_ENGINE::RAYTRACING;
else
engine = RENDER_ENGINE::OPENGL;
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::OnRenderEngineSelection type %s " ),
engine == RENDER_ENGINE::RAYTRACING ? wxT( "raytracing" ) : wxT( "realtime" ) );
if( old_engine != engine )
RenderEngineChanged();
}
void EDA_3D_VIEWER_FRAME::onDisableRayTracing( wxCommandEvent& aEvent )
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::%s disabling ray tracing." ), __WXFUNCTION__ );
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::%s disabling ray tracing." ),
__WXFUNCTION__ );
m_disable_ray_tracing = true;
m_boardAdapter.m_Cfg->m_Render.engine = RENDER_ENGINE::OPENGL;
@@ -539,6 +574,9 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
{
applySettings( cfg );
if( !GetBoard()->GetProject() )
GetBoard()->SetProject( &Prj() );
m_boardAdapter.SetBoard( GetBoard() );
// When opening the 3D viewer, we use the OpenGL mode, never the ray tracing engine
@@ -572,9 +610,19 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
void EDA_3D_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE *aCfg )
{
EDA_BASE_FRAME::SaveSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
EDA_BASE_FRAME::SaveSettings( cfg );
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::SaveSettings" ) );
wxLogTrace( m_logTrace, m_boardAdapter.m_Cfg->m_Render.engine == RENDER_ENGINE::RAYTRACING ?
wxT( "EDA_3D_VIEWER_FRAME::SaveSettings render setting Ray Trace" )
:
wxT( "EDA_3D_VIEWER_FRAME::SaveSettings render setting OpenGL" ) );
if( cfg )
{
cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
@@ -595,8 +643,12 @@ void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( int aFlags )
// Regen menu bars, etc
EDA_BASE_FRAME::CommonSettingsChanged( aFlags );
// There is no base class that handles toolbars for this frame
ReCreateMainToolbar();
loadCommonSettings();
applySettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
applySettings(
Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
m_appearancePanel->CommonSettingsChanged();
@@ -609,7 +661,7 @@ void EDA_3D_VIEWER_FRAME::ShowChangedLanguage()
EDA_BASE_FRAME::ShowChangedLanguage();
SetTitle( _( "3D Viewer" ) );
RecreateToolbars();
ReCreateMainToolbar();
if( m_appearancePanel )
{
@@ -624,24 +676,23 @@ void EDA_3D_VIEWER_FRAME::ShowChangedLanguage()
void EDA_3D_VIEWER_FRAME::ToggleAppearanceManager()
{
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
// show auxiliary Vertical layers and visibility manager toolbar
cfg->m_AuiPanels.show_layer_manager = !cfg->m_AuiPanels.show_layer_manager;
layersManager.Show( cfg->m_AuiPanels.show_layer_manager );
if( cfg->m_AuiPanels.show_layer_manager )
{
// show auxiliary Vertical layers and visibility manager toolbar
cfg->m_AuiPanels.show_layer_manager = !cfg->m_AuiPanels.show_layer_manager;
layersManager.Show( cfg->m_AuiPanels.show_layer_manager );
if( cfg->m_AuiPanels.show_layer_manager )
{
SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
}
else
{
cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
m_auimgr.Update();
}
SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
}
else
{
cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
m_auimgr.Update();
}
}
@@ -653,15 +704,15 @@ void EDA_3D_VIEWER_FRAME::OnDarkModeToggle()
}
void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
void EDA_3D_VIEWER_FRAME::takeScreenshot( wxCommandEvent& event )
{
wxString fullFileName;
bool fmt_is_jpeg = false;
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG )
if( event.GetId() == ID_MENU_SCREENCOPY_JPEG )
fmt_is_jpeg = true;
if( aFormat != EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
if( event.GetId() != ID_TOOL_SCREENCOPY_TOCLIBBOARD )
{
// Remember path between saves during this session only.
const wxString wildcard =
@@ -725,7 +776,7 @@ void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
cfg.highlight_on_rollover = allow_highlight;
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD )
{
wxBitmap bitmap( screenshotImage );
+9 -13
View File
@@ -57,13 +57,6 @@ enum EDA_3D_VIEWER_STATUSBAR
ZOOM_LEVEL,
};
enum class EDA_3D_VIEWER_EXPORT_FORMAT
{
CLIPBOARD,
PNG,
JPEG
};
/**
* Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard
*/
@@ -130,12 +123,6 @@ public:
void OnDarkModeToggle();
/**
* Create a Screenshot of the current 3D view.
* Output file format is png or jpeg, or image is copied to the clipboard
*/
void TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat );
protected:
void setupUIConditions() override;
@@ -151,12 +138,20 @@ private:
void Process_Special_Functions( wxCommandEvent& event );
void onRenderEngineSelection( wxCommandEvent& event );
void onDisableRayTracing( wxCommandEvent& aEvent );
void OnActivate( wxActivateEvent& event );
void OnSetFocus( wxFocusEvent& event );
void doReCreateMenuBar() override;
void ReCreateMainToolbar();
/**
* Create a Screenshot of the current 3D view.
* Output file format is png or jpeg, or image is copied to the clipboard
*/
void takeScreenshot( wxCommandEvent& event );
/**
* @brief RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged
@@ -177,6 +172,7 @@ private:
private:
wxFileName m_defaultSaveScreenshotFileName;
ACTION_TOOLBAR* m_mainToolBar;
EDA_3D_CANVAS* m_canvas;
BOARD_ADAPTER m_boardAdapter;
CAMERA& m_currentCamera;
@@ -103,7 +103,7 @@ PARAM_LAYER_PRESET_3D::PARAM_LAYER_PRESET_3D( const std::string& aPath,
LAYER( "user_drawings", LAYER_3D_USER_DRAWINGS );
LAYER( "user_eco1", LAYER_3D_USER_ECO1 );
LAYER( "user_eco2", LAYER_3D_USER_ECO2 );
LAYER( "3d_navigator", LAYER_3D_NAVIGATOR );
LAYER( "3d_axes", LAYER_3D_AXES );
LAYER( "th_models", LAYER_3D_TH_MODELS );
LAYER( "smd_models", LAYER_3D_SMD_MODELS );
LAYER( "virtual_models", LAYER_3D_VIRTUAL_MODELS );
@@ -253,7 +253,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
m_params.emplace_back( new PARAM<bool>( "render.opengl_thickness_disableOnMove",
&m_Render.opengl_thickness_disableOnMove, false ) );
m_params.emplace_back( new PARAM<bool>( "render.opengl_vias_disableOnMove",
&m_Render.opengl_microvias_disableOnMove, false ) );
&m_Render.opengl_vias_disableOnMove, false ) );
m_params.emplace_back( new PARAM<bool>( "render.opengl_holes_disableOnMove",
&m_Render.opengl_holes_disableOnMove, false ) );
m_params.emplace_back( new PARAM<bool>( "render.opengl_render_bbox_only_OnMove",
@@ -320,7 +320,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
m_params.emplace_back( new PARAM_LIST<COLOR4D>( "render.raytrace_lightColor",
&m_Render.raytrace_lightColor,
std::move( default_colors ) ) );
default_colors ) );
const std::vector<int> default_elevation =
{
@@ -329,7 +329,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
m_params.emplace_back( new PARAM_LIST<int>( "render.raytrace_lightElevation",
&m_Render.raytrace_lightElevation,
std::move( default_elevation ) ) );
default_elevation ) );
const std::vector<int> default_azimuth =
{
@@ -338,12 +338,12 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
m_params.emplace_back( new PARAM_LIST<int>( "render.raytrace_lightAzimuth",
&m_Render.raytrace_lightAzimuth,
std::move( default_azimuth ) ) );
default_azimuth ) );
m_params.emplace_back( new PARAM<bool>( "render.show_adhesive",
&m_Render.show_adhesive, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_navigator",
&m_Render.show_navigator, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_axis",
&m_Render.show_axis, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_board_body",
&m_Render.show_board_body, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_comments",
@@ -489,7 +489,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
legacyColorMap[483] = "virtual_models";
legacyColorMap[484] = "non_pos_file_models";
legacyColorMap[485] = "dnp_models";
legacyColorMap[486] = "3d_navigator";
legacyColorMap[486] = "3d_axes";
legacyColorMap[487] = "bounding_boxes";
legacyColorMap[488] = "off_board_silk";
@@ -579,7 +579,7 @@ bool EDA_3D_VIEWER_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
ret &= fromLegacy<bool>( aCfg, "Render_RAY_Shadows", "render.raytrace_shadows" );
ret &= fromLegacy<bool>( aCfg, "ShowRealisticMode", "render.realistic" );
ret &= fromLegacy<bool>( aCfg, "ShowAdhesiveLayers", "render.show_adhesive" );
ret &= fromLegacy<bool>( aCfg, "ShowNavigator", "render.show_navigator" );
ret &= fromLegacy<bool>( aCfg, "ShowAxis", "render.show_axis" );
ret &= fromLegacy<bool>( aCfg, "ShowBoardBody", "render.show_board_body" );
ret &= fromLegacy<bool>( aCfg, "ShowCommentsLayers", "render.show_comments" );
ret &= fromLegacy<bool>( aCfg, "ShowEcoLayers", "render.show_eco" );
+2 -2
View File
@@ -90,7 +90,7 @@ public:
bool opengl_AA_disableOnMove;
bool opengl_thickness_disableOnMove;
bool opengl_microvias_disableOnMove;
bool opengl_vias_disableOnMove;
bool opengl_holes_disableOnMove;
bool opengl_render_bbox_only_OnMove;
bool opengl_copper_thickness;
@@ -126,7 +126,7 @@ public:
std::vector<int> raytrace_lightAzimuth; // 0 .. 359
bool show_adhesive;
bool show_navigator;
bool show_axis;
bool show_board_body;
bool show_comments;
bool show_drawings;
-98
View File
@@ -1,98 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2023 CERN
* Copyright The 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 <wx/wupdlock.h>
#include <wx/choice.h>
#include <bitmaps.h>
#include <dialogs/eda_view_switcher.h>
#include <eda_3d_viewer_frame.h>
#include <tool/action_toolbar.h>
#include <tools/eda_3d_actions.h>
#include <3d_viewer_id.h>
#include <toolbars_3d.h>
std::optional<TOOLBAR_CONFIGURATION> EDA_3D_VIEWER_TOOLBAR_SETTINGS::DefaultToolbarConfig( TOOLBAR_LOC aToolbar )
{
TOOLBAR_CONFIGURATION config;
// clang-format off
switch( aToolbar )
{
case TOOLBAR_LOC::LEFT:
case TOOLBAR_LOC::RIGHT:
case TOOLBAR_LOC::TOP_AUX:
return std::nullopt;
case TOOLBAR_LOC::TOP_MAIN:
config.AppendAction( EDA_3D_ACTIONS::reloadBoard );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::copyToClipboard );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::toggleRaytacing );
config.AppendSeparator()
.AppendAction( ACTIONS::zoomRedraw )
.AppendAction( ACTIONS::zoomInCenter )
.AppendAction( ACTIONS::zoomOutCenter )
.AppendAction( ACTIONS::zoomFitScreen );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::rotateXCW )
.AppendAction( EDA_3D_ACTIONS::rotateXCCW );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::rotateYCW )
.AppendAction( EDA_3D_ACTIONS::rotateYCCW );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::rotateZCW )
.AppendAction( EDA_3D_ACTIONS::rotateZCCW );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::flipView );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::moveLeft )
.AppendAction( EDA_3D_ACTIONS::moveRight )
.AppendAction( EDA_3D_ACTIONS::moveUp )
.AppendAction( EDA_3D_ACTIONS::moveDown );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::toggleOrtho );
config.AppendSeparator()
.AppendAction( EDA_3D_ACTIONS::showLayersManager );
break;
}
// clang-format on
return config;
}
-40
View File
@@ -1,40 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The 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/>.
*/
#ifndef TOOLBARS_3D_H_
#define TOOLBARS_3D_H_
#include <tool/ui/toolbar_configuration.h>
/**
* Toolbar configuration for the 3D viewer.
*/
class EDA_3D_VIEWER_TOOLBAR_SETTINGS : public TOOLBAR_SETTINGS
{
public:
EDA_3D_VIEWER_TOOLBAR_SETTINGS() :
TOOLBAR_SETTINGS( "3d_viewer-toolbars" )
{}
~EDA_3D_VIEWER_TOOLBAR_SETTINGS() {}
std::optional<TOOLBAR_CONFIGURATION> DefaultToolbarConfig( TOOLBAR_LOC aToolbar ) override;
};
#endif /* TOOLBARS_3D_H_ */
+11 -56
View File
@@ -23,7 +23,6 @@
#include <bitmaps.h>
#include <3d_viewer_id.h>
#include <3d_enums.h>
#include <3d-viewer/3d_viewer/eda_3d_viewer_frame.h>
#include "eda_3d_actions.h"
#include "tool/tool_action.h"
@@ -39,47 +38,7 @@
TOOL_ACTION EDA_3D_ACTIONS::controlActivate( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control" )
.Scope( AS_GLOBAL )
.Flags( AF_ACTIVATE )
.ToolbarState( TOOLBAR_STATE::HIDDEN) );
TOOL_ACTION EDA_3D_ACTIONS:: reloadBoard( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.reloadBoard" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Reload board" ) )
.Tooltip( _( "Reload board and refresh 3D view" ) )
.Icon( BITMAPS::import3d ) );
TOOL_ACTION EDA_3D_ACTIONS::toggleRaytacing( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.toggleRaytacing" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Use raytracing" ) )
.Tooltip( _( "Render current view using Raytracing" ) )
.Icon( BITMAPS::ray_tracing )
.ToolbarState( TOOLBAR_STATE::TOGGLE) );
TOOL_ACTION EDA_3D_ACTIONS::copyToClipboard( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.copyToClipboard" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Copy 3D image to clipboard" ) )
.Tooltip( _( "Copy the current 3D image to the clipboard" ) )
.Icon( BITMAPS::copy )
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD ) );
TOOL_ACTION EDA_3D_ACTIONS::exportAsPNG( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.exportAsPNG" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Export Current View as PNG..." ) )
.Tooltip( _( "Export the Current View as a PNG image" ) )
.Icon( BITMAPS::export_png )
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::PNG ) );
TOOL_ACTION EDA_3D_ACTIONS::exportAsJPEG( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.exportAsJPEG" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Export Current View as JPEG..." ) )
.Tooltip( _( "Export the Current View as a JPEG image" ) )
.Icon( BITMAPS::export_file )
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) );
.Flags( AF_ACTIVATE ) );
TOOL_ACTION EDA_3D_ACTIONS::pivotCenter( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.pivotCenter" )
@@ -125,7 +84,6 @@ TOOL_ACTION EDA_3D_ACTIONS::rotateYCCW( TOOL_ACTION_ARGS()
TOOL_ACTION EDA_3D_ACTIONS::rotateZCW( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.rotateZclockwise" )
.Scope( AS_GLOBAL )
.DefaultHotkey( MD_SHIFT + 'R' )
.FriendlyName( _( "Rotate Z Clockwise" ) )
.Icon( BITMAPS::rotate_cw_z )
.Flags( AF_NONE )
@@ -134,7 +92,6 @@ TOOL_ACTION EDA_3D_ACTIONS::rotateZCW( TOOL_ACTION_ARGS()
TOOL_ACTION EDA_3D_ACTIONS::rotateZCCW( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.rotateZcounterclockwise" )
.Scope( AS_GLOBAL )
.DefaultHotkey( 'R' )
.FriendlyName( _( "Rotate Z Counterclockwise" ) )
.Icon( BITMAPS::rotate_ccw_z )
.Flags( AF_NONE )
@@ -200,8 +157,7 @@ TOOL_ACTION EDA_3D_ACTIONS::toggleOrtho( TOOL_ACTION_ARGS()
.Scope( AS_GLOBAL )
.FriendlyName( _( "Toggle Orthographic Projection" ) )
.Tooltip( _( "Enable/disable orthographic projection" ) )
.Icon( BITMAPS::ortho )
.ToolbarState( TOOLBAR_STATE::TOGGLE ) );
.Icon( BITMAPS::ortho ) );
TOOL_ACTION EDA_3D_ACTIONS::viewFront( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.viewFront" )
@@ -363,16 +319,16 @@ TOOL_ACTION EDA_3D_ACTIONS::showDNP( TOOL_ACTION_ARGS()
TOOL_ACTION EDA_3D_ACTIONS::showBBoxes( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.showBoundingBoxes" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Show Model Bounding Boxes" ) )
.Tooltip( _( "Show 3D model bounding boxes in realtime renderer" ) )
.Icon( BITMAPS::ortho )
.Flags( AF_NONE ) );
.Scope( AS_GLOBAL )
.FriendlyName( _( "Show Model Bounding Boxes" ) )
.Tooltip( _( "Show 3D model bounding boxes in realtime renderer" ) )
.Icon( BITMAPS::ortho )
.Flags( AF_NONE ) );
TOOL_ACTION EDA_3D_ACTIONS::showNavigator( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.showNavigator" )
TOOL_ACTION EDA_3D_ACTIONS::showAxis( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.showAxis" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Show 3D Navigator" ) )
.FriendlyName( _( "Show 3D Axis" ) )
.Icon( BITMAPS::axis3d_front )
.Flags( AF_NONE ) );
@@ -381,6 +337,5 @@ TOOL_ACTION EDA_3D_ACTIONS::showLayersManager( TOOL_ACTION_ARGS()
.Scope( AS_GLOBAL )
.FriendlyName( _( "Show Appearance Manager" ) )
.Tooltip( _( "Show/hide the appearance manager" ) )
.Icon( BITMAPS::layers_manager )
.ToolbarState( TOOLBAR_STATE::TOGGLE ) );
.Icon( BITMAPS::layers_manager ) );
+1 -8
View File
@@ -42,13 +42,6 @@ class EDA_3D_ACTIONS : public ACTIONS
public:
static TOOL_ACTION controlActivate;
static TOOL_ACTION reloadBoard;
static TOOL_ACTION toggleRaytacing;
static TOOL_ACTION copyToClipboard;
static TOOL_ACTION exportAsPNG;
static TOOL_ACTION exportAsJPEG;
static TOOL_ACTION pivotCenter;
static TOOL_ACTION rotateXCW;
static TOOL_ACTION rotateXCCW;
@@ -87,7 +80,7 @@ public:
static TOOL_ACTION showNotInPosFile;
static TOOL_ACTION showDNP;
static TOOL_ACTION showBBoxes;
static TOOL_ACTION showNavigator;
static TOOL_ACTION showAxis;
static TOOL_ACTION showLayersManager;
};
@@ -256,8 +256,8 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent )
flipLayer( LAYER_3D_MODELS_NOT_IN_POS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showDNP ) )
flipLayer( LAYER_3D_MODELS_MARKED_DNP );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNavigator ) )
flipLayer( LAYER_3D_NAVIGATOR );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showAxis ) )
flipLayer( LAYER_3D_AXES );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showBBoxes ) )
flipLayer( LAYER_3D_BOUNDING_BOXES );
}
@@ -334,65 +334,11 @@ int EDA_3D_CONTROLLER::ZoomFitScreen( const TOOL_EVENT& aEvent )
}
int EDA_3D_CONTROLLER::ReloadBoard( const TOOL_EVENT& aEvent )
{
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
if( frame && frame->GetFrameType() == FRAME_PCB_DISPLAY3D )
static_cast<EDA_3D_VIEWER_FRAME*>( frame )->NewDisplay( true );
return 0;
}
int EDA_3D_CONTROLLER::ToggleRaytracing( const TOOL_EVENT& aEvent )
{
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
if( frame && frame->GetFrameType() == FRAME_PCB_DISPLAY3D )
{
EDA_3D_VIEWER_FRAME* frame3d = static_cast<EDA_3D_VIEWER_FRAME*>( frame );
RENDER_ENGINE& engine = frame3d->GetAdapter().m_Cfg->m_Render.engine;
RENDER_ENGINE old_engine = engine;
if( old_engine == RENDER_ENGINE::OPENGL )
engine = RENDER_ENGINE::RAYTRACING;
else
engine = RENDER_ENGINE::OPENGL;
// Directly tell the canvas the rendering engine changed
if( old_engine != engine )
frame3d->GetCanvas()->RenderEngineChanged();
}
return 0;
}
int EDA_3D_CONTROLLER::ExportImage( const TOOL_EVENT& aEvent )
{
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
if( frame && frame->GetFrameType() == FRAME_PCB_DISPLAY3D )
static_cast<EDA_3D_VIEWER_FRAME*>( frame )->TakeScreenshot( aEvent.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>() );
return 0;
}
void EDA_3D_CONTROLLER::setTransitions()
{
Go( &EDA_3D_CONTROLLER::Main, EDA_3D_ACTIONS::controlActivate.MakeEvent() );
Go( &EDA_3D_CONTROLLER::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
// Miscellaneous control
Go( &EDA_3D_CONTROLLER::ReloadBoard, EDA_3D_ACTIONS::reloadBoard.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ToggleRaytracing, EDA_3D_ACTIONS::toggleRaytacing.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::copyToClipboard.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportAsPNG.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportAsJPEG.MakeEvent() );
// Pan control
Go( &EDA_3D_CONTROLLER::PanControl, ACTIONS::panUp.MakeEvent() );
Go( &EDA_3D_CONTROLLER::PanControl, ACTIONS::panDown.MakeEvent() );
@@ -96,10 +96,6 @@ public:
int ToggleVisibility( const TOOL_EVENT& aEvent );
int ToggleLayersManager( const TOOL_EVENT& aEvent );
int ReloadBoard( const TOOL_EVENT& aEvent );
int ToggleRaytracing( const TOOL_EVENT& aEvent );
int ExportImage( const TOOL_EVENT& aEvent );
private:
/// Set up handlers for various events.
void setTransitions() override;
+8
View File
@@ -34,12 +34,20 @@
enum id_3dview_frm
{
ID_START_COMMAND_3D = ID_KICAD_3D_VIEWER_START,
ID_RELOAD3D_BOARD,
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
ID_MENU_SCREENCOPY_PNG,
ID_MENU_SCREENCOPY_JPEG,
ID_MENU_SCREENCOPY_TOCLIBBOARD,
ID_MENU3D_RESET_DEFAULTS,
// Help
ID_MENU_COMMAND_END,
ID_RENDER_CURRENT_VIEW,
ID_DISABLE_RAY_TRACING,
ID_CUSTOM_EVENT_1, // A id for a custom event (canvas refresh request)
+1 -2
View File
@@ -38,7 +38,6 @@ set(3D-VIEWER_SRCS
3d_rendering/opengl/create_scene.cpp
3d_rendering/opengl/render_3d_opengl.cpp
3d_rendering/opengl/layer_triangles.cpp
3d_rendering/opengl/3d_spheres_gizmo.cpp
${DIR_RAY_ACC}/accelerator_3d.cpp
${DIR_RAY_ACC}/bvh_packet_traversal.cpp
${DIR_RAY_ACC}/bvh_pbrt.cpp
@@ -82,7 +81,7 @@ set(3D-VIEWER_SRCS
3d_rendering/test_cases.cpp
3d_rendering/trackball.cpp
3d_viewer/3d_menubar.cpp
3d_viewer/toolbars_3d.cpp
3d_viewer/3d_toolbar.cpp
3d_viewer/tools/eda_3d_actions.cpp
3d_viewer/tools/eda_3d_conditions.cpp
3d_viewer/tools/eda_3d_controller.cpp
+6
View File
@@ -31,12 +31,18 @@
#define OPENGL_INCLUDES_H
#ifdef __APPLE__
#ifndef GL_SILENCE_DEPRECATION
// Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated.
// Luckily we can silence warnings about its deprecation.
#define GL_SILENCE_DEPRECATION 1
#endif
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#ifdef _WIN32
// required for the windows gl.h to work
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
+35 -25
View File
@@ -47,6 +47,7 @@
/// Render Row abbreviation to reduce source width.
#define RR APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D
// clang-format off
/// Template for object appearance settings
const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_layerSettings[] = {
@@ -117,26 +118,27 @@ const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_la
RR( _HKI( "Models marked DNP" ), LAYER_3D_MODELS_MARKED_DNP, EDA_3D_ACTIONS::showDNP ),
RR( _HKI( "Model Bounding Boxes" ), LAYER_3D_BOUNDING_BOXES, EDA_3D_ACTIONS::showBBoxes ),
RR(),
RR( _HKI( "Values" ), LAYER_FP_VALUES, _HKI( "Show footprint values" ) ),
RR( _HKI( "References" ), LAYER_FP_REFERENCES, _HKI( "Show footprint references" ) ),
RR( _HKI( "Footprint Text" ), LAYER_FP_TEXT, _HKI( "Show all footprint text" ) ),
RR( _HKI( "Off-board Silkscreen" ), LAYER_3D_OFF_BOARD_SILK, _HKI( "Do not clip silk layers to board outline" ) ),
RR( _HKI( "Values" ), LAYER_FP_VALUES, _HKI( "Show footprint values" ) ),
RR( _HKI( "References" ), LAYER_FP_REFERENCES, _HKI( "Show footprint references" ) ),
RR( _HKI( "Footprint Text" ), LAYER_FP_TEXT, _HKI( "Show all footprint text" ) ),
RR( _HKI( "Off-board Silkscreen" ), LAYER_3D_OFF_BOARD_SILK, _HKI( "Do not clip silk layers to board outline" ) ),
RR(),
RR( _HKI( "3D Navigator" ), LAYER_3D_NAVIGATOR, EDA_3D_ACTIONS::showNavigator ),
RR( _HKI( "3D Axis" ), LAYER_3D_AXES, EDA_3D_ACTIONS::showAxis ),
RR( _HKI( "Background Start" ), LAYER_3D_BACKGROUND_TOP, _HKI( "Background gradient start color" ) ),
RR( _HKI( "Background End" ), LAYER_3D_BACKGROUND_BOTTOM, _HKI( "Background gradient end color" ) ),
};
// clang-format on
// The list of IDs that can have colors coming from the board stackup, and cannot be
// modified if use colors from stackup is activated
static std::vector<int> inStackupColors{ LAYER_3D_BOARD,
LAYER_3D_COPPER_TOP, LAYER_3D_COPPER_BOTTOM,
LAYER_3D_SOLDERPASTE,
static std::vector<int> inStackupColors{ LAYER_3D_BOARD, LAYER_3D_COPPER_TOP,
LAYER_3D_COPPER_BOTTOM, LAYER_3D_SOLDERPASTE,
LAYER_3D_SILKSCREEN_TOP, LAYER_3D_SILKSCREEN_BOTTOM,
LAYER_3D_SOLDERMASK_TOP, LAYER_3D_SOLDERMASK_BOTTOM
};
APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent, wxWindow* aFocusOwner ) :
APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent,
wxWindow* aFocusOwner ) :
APPEARANCE_CONTROLS_3D_BASE( aParent ),
m_frame( aParent ),
m_focusOwner( aFocusOwner ),
@@ -198,17 +200,18 @@ APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent, wx
m_panelLayersSizer->Add( m_cbUseBoardEditorCopperColors, 0,
wxEXPAND | wxALL, 5 );
m_cbLayerPresets->SetToolTip( wxString::Format( _( "Save and restore color and visibility combinations.\n"
m_cbLayerPresets->SetToolTip( wxString::Format( _( "Save and restore color and visibility "
"combinations.\n"
"Use %s+Tab to activate selector.\n"
"Successive Tabs while holding %s down will cycle through "
"presets in the popup." ),
"Successive Tabs while holding %s down will "
"cycle through presets in the popup." ),
KeyNameFromKeyCode( PRESET_SWITCH_KEY ),
KeyNameFromKeyCode( PRESET_SWITCH_KEY ) ) );
m_cbViewports->SetToolTip( wxString::Format( _( "Save and restore camera position and zoom.\n"
"Use %s+Tab to activate selector.\n"
"Successive Tabs while holding %s down will cycle through "
"viewports in the popup." ),
"Successive Tabs while holding %s down will "
"cycle through viewports in the popup." ),
KeyNameFromKeyCode( VIEWPORT_SWITCH_KEY ),
KeyNameFromKeyCode( VIEWPORT_SWITCH_KEY ) ) );
@@ -472,7 +475,8 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
if( doFastRefresh && m_frame->GetAdapter().m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL )
{
RENDER_3D_OPENGL* renderer = static_cast<RENDER_3D_OPENGL*>( m_frame->GetCanvas()->GetCurrentRender() );
RENDER_3D_OPENGL* renderer =
static_cast<RENDER_3D_OPENGL*>( m_frame->GetCanvas()->GetCurrentRender() );
renderer->Load3dModelsIfNeeded();
m_frame->GetCanvas()->Request_refresh();
}
@@ -591,10 +595,9 @@ void APPEARANCE_CONTROLS_3D::rebuildLayers()
}
else
{
BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE( m_windowLayers, layer,
KiBitmapBundle( BITMAPS::visibility ),
KiBitmapBundle( BITMAPS::visibility_off ),
aSetting->m_Visible );
BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE(
m_windowLayers, layer, KiBitmapBundle( BITMAPS::visibility ),
KiBitmapBundle( BITMAPS::visibility_off ), aSetting->m_Visible );
btn_visible->Bind( TOGGLE_CHANGED,
[this]( wxCommandEvent& aEvent )
@@ -667,8 +670,12 @@ void APPEARANCE_CONTROLS_3D::UpdateLayerCtls()
// if cfg->m_UseStackupColors is set, board colors cannot be modified locally, but
// other colors can be
if( alg::contains( inStackupColors, setting->m_Id ) && cfg )
setting->m_Ctl_color->SetReadOnly( cfg->m_UseStackupColors );
if( std::find( inStackupColors.begin(), inStackupColors.end(), setting->m_Id )
!= inStackupColors.end() )
{
if( cfg )
setting->m_Ctl_color->SetReadOnly( cfg->m_UseStackupColors );
}
}
}
@@ -715,8 +722,11 @@ void APPEARANCE_CONTROLS_3D::syncLayerPresetSelection()
presets.begin(), presets.end(),
[&]( const LAYER_PRESET_3D& aPreset )
{
if( aPreset.name.Lower() == _( "legacy colors" ) && m_cbUseBoardStackupColors->GetValue() )
if( aPreset.name.Lower() == _( "legacy colors" )
&& m_cbUseBoardStackupColors->GetValue() )
{
return false;
}
for( int layer = LAYER_3D_BOARD; layer < LAYER_3D_END; ++layer )
{
@@ -864,8 +874,7 @@ void APPEARANCE_CONTROLS_3D::onLayerPresetChanged( wxCommandEvent& aEvent )
if( cfg->m_CurrentPreset == name )
cfg->m_CurrentPreset = wxEmptyString;
if( m_presetMRU.Index( name ) >= 0 )
m_presetMRU.Remove( name );
m_presetMRU.Remove( name );
}
resetSelection();
@@ -977,7 +986,8 @@ void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
{
m_viewports[name] = VIEWPORT3D( name, m_frame->GetCurrentCamera().GetViewMatrix() );
index = m_cbViewports->Insert( name, index-1, static_cast<void*>( &m_viewports[name] ) );
index = m_cbViewports->Insert( name, index-1,
static_cast<void*>( &m_viewports[name] ) );
}
else
{
+18 -14
View File
@@ -64,28 +64,32 @@ void PANEL_3D_DISPLAY_OPTIONS::loadViewSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
bool PANEL_3D_DISPLAY_OPTIONS::TransferDataToWindow()
{
loadViewSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
loadViewSettings( cfg );
return true;
}
bool PANEL_3D_DISPLAY_OPTIONS::TransferDataFromWindow()
{
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
{
// Set visibility of items
cfg->m_Render.show_zones = m_checkBoxAreas->GetValue();
cfg->m_Render.subtract_mask_from_silk = m_checkBoxSubtractMaskFromSilk->GetValue();
cfg->m_Render.clip_silk_on_via_annuli = m_checkBoxClipSilkOnViaAnnulus->GetValue();
cfg->m_Render.differentiate_plated_copper = m_checkBoxRenderPlatedPadsAsPlated->GetValue();
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
cfg->m_Render.material_mode = static_cast<MATERIAL_MODE>( m_materialProperties->GetSelection() );
// Set visibility of items
cfg->m_Render.show_zones = m_checkBoxAreas->GetValue();
cfg->m_Render.subtract_mask_from_silk = m_checkBoxSubtractMaskFromSilk->GetValue();
cfg->m_Render.clip_silk_on_via_annuli = m_checkBoxClipSilkOnViaAnnulus->GetValue();
cfg->m_Render.differentiate_plated_copper = m_checkBoxRenderPlatedPadsAsPlated->GetValue();
// Camera Options
cfg->m_Camera.animation_enabled = m_checkBoxEnableAnimation->GetValue();
cfg->m_Camera.moving_speed_multiplier = m_sliderAnimationSpeed->GetValue();
cfg->m_Camera.rotation_increment = m_spinCtrlRotationAngle->GetValue();
}
cfg->m_Render.material_mode = static_cast<MATERIAL_MODE>( m_materialProperties->GetSelection() );
// Camera Options
cfg->m_Camera.animation_enabled = m_checkBoxEnableAnimation->GetValue();
cfg->m_Camera.moving_speed_multiplier = m_sliderAnimationSpeed->GetValue();
cfg->m_Camera.rotation_increment = m_spinCtrlRotationAngle->GetValue();
return true;
}
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -25,7 +25,7 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent,
bSizeLeft->Add( m_renderOptionsLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 );
m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizeLeft->Add( m_staticline4, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bSizeLeft->Add( m_staticline4, 0, wxEXPAND|wxBOTTOM, 5 );
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 0, 1, 5, 0 );
@@ -33,7 +33,7 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent,
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_checkBoxClipSilkOnViaAnnulus = new wxCheckBox( this, wxID_ANY, _("Clip silkscreen at via annuli"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_checkBoxClipSilkOnViaAnnulus, 0, wxTOP|wxLEFT, 5 );
fgSizer2->Add( m_checkBoxClipSilkOnViaAnnulus, 0, wxLEFT, 5 );
m_checkBoxSubtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Clip silkscreen at solder mask edges"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_checkBoxSubtractMaskFromSilk, 0, wxLEFT, 5 );
@@ -76,22 +76,22 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent,
bSizerRight->Add( m_cameraOptionsLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 );
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerRight->Add( m_staticline5, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bSizerRight->Add( m_staticline5, 0, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bSizerRotAngle;
bSizerRotAngle = new wxBoxSizer( wxHORIZONTAL );
m_staticTextRotAngle = new wxStaticText( this, wxID_ANY, _("Rotation increment:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRotAngle->Wrap( -1 );
bSizerRotAngle->Add( m_staticTextRotAngle, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizerRotAngle->Add( m_staticTextRotAngle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_spinCtrlRotationAngle = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 359, 10, 1 );
m_spinCtrlRotationAngle->SetDigits( 0 );
bSizerRotAngle->Add( m_spinCtrlRotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizerRotAngle->Add( m_spinCtrlRotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_staticTextRotAngleUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRotAngleUnits->Wrap( -1 );
bSizerRotAngle->Add( m_staticTextRotAngleUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
bSizerRotAngle->Add( m_staticTextRotAngleUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
bSizerRight->Add( bSizerRotAngle, 0, wxTOP|wxLEFT, 5 );
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -27,6 +27,7 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_3D_DISPLAY_OPTIONS_BASE
///////////////////////////////////////////////////////////////////////////////
+19 -14
View File
@@ -49,34 +49,39 @@ void PANEL_3D_OPENGL_OPTIONS::loadSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
m_checkBoxDisableAAMove->SetValue( aCfg->m_Render.opengl_AA_disableOnMove );
m_checkBoxDisableMoveThickness->SetValue( aCfg->m_Render.opengl_thickness_disableOnMove );
m_checkBoxDisableMoveVias->SetValue( aCfg->m_Render.opengl_microvias_disableOnMove );
m_checkBoxDisableMoveVias->SetValue( aCfg->m_Render.opengl_vias_disableOnMove );
m_checkBoxDisableMoveHoles->SetValue( aCfg->m_Render.opengl_holes_disableOnMove );
}
bool PANEL_3D_OPENGL_OPTIONS::TransferDataToWindow()
{
loadSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
loadSettings( cfg );
return true;
}
bool PANEL_3D_OPENGL_OPTIONS::TransferDataFromWindow()
{
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
{
cfg->m_Render.opengl_copper_thickness = m_checkBoxCuThickness->GetValue();
cfg->m_Render.show_model_bbox = m_checkBoxBoundingBoxes->GetValue();
cfg->m_Render.highlight_on_rollover = m_checkBoxHighlightOnRollOver->GetValue();
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
cfg->m_Render.opengl_AA_mode = static_cast<ANTIALIASING_MODE>( m_choiceAntiAliasing->GetSelection() );
cfg->m_Render.opengl_selection_color = m_selectionColorSwatch->GetSwatchColor();
cfg->m_Render.opengl_copper_thickness = m_checkBoxCuThickness->GetValue();
cfg->m_Render.show_model_bbox = m_checkBoxBoundingBoxes->GetValue();
cfg->m_Render.highlight_on_rollover = m_checkBoxHighlightOnRollOver->GetValue();
cfg->m_Render.opengl_AA_disableOnMove = m_checkBoxDisableAAMove->GetValue();
cfg->m_Render.opengl_thickness_disableOnMove = m_checkBoxDisableMoveThickness->GetValue();
cfg->m_Render.opengl_microvias_disableOnMove = m_checkBoxDisableMoveVias->GetValue();
cfg->m_Render.opengl_holes_disableOnMove = m_checkBoxDisableMoveHoles->GetValue();
}
cfg->m_Render.opengl_AA_mode =
static_cast<ANTIALIASING_MODE>( m_choiceAntiAliasing->GetSelection() );
cfg->m_Render.opengl_selection_color = m_selectionColorSwatch->GetSwatchColor();
cfg->m_Render.opengl_AA_disableOnMove = m_checkBoxDisableAAMove->GetValue();
cfg->m_Render.opengl_thickness_disableOnMove = m_checkBoxDisableMoveThickness->GetValue();
cfg->m_Render.opengl_vias_disableOnMove = m_checkBoxDisableMoveVias->GetValue();
cfg->m_Render.opengl_holes_disableOnMove = m_checkBoxDisableMoveHoles->GetValue();
return true;
}
@@ -32,7 +32,7 @@ PANEL_3D_OPENGL_OPTIONS_BASE::PANEL_3D_OPENGL_OPTIONS_BASE( wxWindow* parent, wx
m_checkBoxBoundingBoxes = new wxCheckBox( this, wxID_ANY, _("Show model bounding boxes"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerMargins->Add( m_checkBoxBoundingBoxes, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper and tech layers thickness (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper and tech layers thickness (very slow)"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerMargins->Add( m_checkBoxCuThickness, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkBoxHighlightOnRollOver = new wxCheckBox( this, wxID_ANY, _("Highlight items on rollover"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -88,10 +88,10 @@ PANEL_3D_OPENGL_OPTIONS_BASE::PANEL_3D_OPENGL_OPTIONS_BASE( wxWindow* parent, wx
m_checkBoxDisableMoveThickness = new wxCheckBox( this, wxID_ANY, _("Disable thickness"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_checkBoxDisableMoveThickness, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkBoxDisableMoveVias = new wxCheckBox( this, wxID_ANY, _("Disable uVia holes"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxDisableMoveVias = new wxCheckBox( this, wxID_ANY, _("Disable vias"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_checkBoxDisableMoveVias, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkBoxDisableMoveHoles = new wxCheckBox( this, wxID_ANY, _("Disable all plated holes"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxDisableMoveHoles = new wxCheckBox( this, wxID_ANY, _("Disable holes"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_checkBoxDisableMoveHoles, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@@ -299,7 +299,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show copper and tech layers thickness (slow)</property>
<property name="label">Show copper and tech layers thickness (very slow)</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -977,7 +977,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Disable uVia holes</property>
<property name="label">Disable vias</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -1042,7 +1042,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Disable all plated holes</property>
<property name="label">Disable holes</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -110,78 +110,85 @@ void PANEL_3D_RAYTRACING_OPTIONS::loadSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
bool PANEL_3D_RAYTRACING_OPTIONS::TransferDataToWindow()
{
loadSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
loadSettings( cfg );
return true;
}
bool PANEL_3D_RAYTRACING_OPTIONS::TransferDataFromWindow()
{
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
{
cfg->m_Render.raytrace_shadows = m_cbRaytracing_renderShadows->GetValue();
cfg->m_Render.raytrace_backfloor = m_cbRaytracing_addFloor->GetValue();
cfg->m_Render.raytrace_refractions = m_cbRaytracing_showRefractions->GetValue();
cfg->m_Render.raytrace_reflections = m_cbRaytracing_showReflections->GetValue();
cfg->m_Render.raytrace_post_processing = m_cbRaytracing_postProcessing->GetValue();
cfg->m_Render.raytrace_anti_aliasing = m_cbRaytracing_antiAliasing->GetValue();
cfg->m_Render.raytrace_procedural_textures = m_cbRaytracing_proceduralTextures->GetValue();
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
cfg->m_Render.raytrace_nrsamples_shadows = m_numSamples_Shadows->GetValue();
cfg->m_Render.raytrace_nrsamples_reflections = m_numSamples_Reflections->GetValue();
cfg->m_Render.raytrace_nrsamples_refractions = m_numSamples_Refractions->GetValue();
cfg->m_Render.raytrace_shadows = m_cbRaytracing_renderShadows->GetValue();
cfg->m_Render.raytrace_backfloor = m_cbRaytracing_addFloor->GetValue();
cfg->m_Render.raytrace_refractions = m_cbRaytracing_showRefractions->GetValue();
cfg->m_Render.raytrace_reflections = m_cbRaytracing_showReflections->GetValue();
cfg->m_Render.raytrace_post_processing = m_cbRaytracing_postProcessing->GetValue();
cfg->m_Render.raytrace_anti_aliasing = m_cbRaytracing_antiAliasing->GetValue();
cfg->m_Render.raytrace_procedural_textures = m_cbRaytracing_proceduralTextures->GetValue();
cfg->m_Render.raytrace_spread_shadows =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
m_spreadFactor_Shadows->GetValue() ) / 100.0f;
cfg->m_Render.raytrace_spread_reflections =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
m_spreadFactor_Reflections->GetValue() ) / 100.0f;
cfg->m_Render.raytrace_spread_refractions =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
m_spreadFactor_Refractions->GetValue() ) / 100.0f;
cfg->m_Render.raytrace_nrsamples_shadows = m_numSamples_Shadows->GetValue();
cfg->m_Render.raytrace_nrsamples_reflections = m_numSamples_Reflections->GetValue();
cfg->m_Render.raytrace_nrsamples_refractions = m_numSamples_Refractions->GetValue();
cfg->m_Render.raytrace_recursivelevel_reflections = m_recursiveLevel_Reflections->GetValue();
cfg->m_Render.raytrace_recursivelevel_refractions = m_recursiveLevel_Refractions->GetValue();
cfg->m_Render.raytrace_spread_shadows =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
m_spreadFactor_Shadows->GetValue() )
/ 100.0f;
cfg->m_Render.raytrace_spread_reflections =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
m_spreadFactor_Reflections->GetValue() )
/ 100.0f;
cfg->m_Render.raytrace_spread_refractions =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
m_spreadFactor_Refractions->GetValue() )
/ 100.0f;
cfg->m_Render.raytrace_lightColorCamera = m_colourPickerCameraLight->GetSwatchColor();
cfg->m_Render.raytrace_lightColorTop = m_colourPickerTopLight->GetSwatchColor();
cfg->m_Render.raytrace_lightColorBottom = m_colourPickerBottomLight->GetSwatchColor();
cfg->m_Render.raytrace_recursivelevel_reflections = m_recursiveLevel_Reflections->GetValue();
cfg->m_Render.raytrace_recursivelevel_refractions = m_recursiveLevel_Refractions->GetValue();
cfg->m_Render.raytrace_lightColor[0] = m_colourPickerLight1->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[1] = m_colourPickerLight2->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[2] = m_colourPickerLight3->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[3] = m_colourPickerLight4->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[4] = m_colourPickerLight5->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[5] = m_colourPickerLight6->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[6] = m_colourPickerLight7->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[7] = m_colourPickerLight8->GetSwatchColor();
cfg->m_Render.raytrace_lightColorCamera = m_colourPickerCameraLight->GetSwatchColor();
cfg->m_Render.raytrace_lightColorTop = m_colourPickerTopLight->GetSwatchColor();
cfg->m_Render.raytrace_lightColorBottom = m_colourPickerBottomLight->GetSwatchColor();
auto get_value =
[]( wxTextCtrl* aCtrl )
{
return EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::UNSCALED,
aCtrl->GetValue() );
};
cfg->m_Render.raytrace_lightColor[0] = m_colourPickerLight1->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[1] = m_colourPickerLight2->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[2] = m_colourPickerLight3->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[3] = m_colourPickerLight4->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[4] = m_colourPickerLight5->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[5] = m_colourPickerLight6->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[6] = m_colourPickerLight7->GetSwatchColor();
cfg->m_Render.raytrace_lightColor[7] = m_colourPickerLight8->GetSwatchColor();
cfg->m_Render.raytrace_lightElevation[0] = get_value( m_lightElevation1 );
cfg->m_Render.raytrace_lightElevation[1] = get_value( m_lightElevation2 );
cfg->m_Render.raytrace_lightElevation[2] = get_value( m_lightElevation3 );
cfg->m_Render.raytrace_lightElevation[3] = get_value( m_lightElevation4 );
cfg->m_Render.raytrace_lightElevation[4] = get_value( m_lightElevation5 );
cfg->m_Render.raytrace_lightElevation[5] = get_value( m_lightElevation6 );
cfg->m_Render.raytrace_lightElevation[6] = get_value( m_lightElevation7 );
cfg->m_Render.raytrace_lightElevation[7] = get_value( m_lightElevation8 );
auto get_value =
[]( wxTextCtrl* aCtrl )
{
return EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::UNSCALED,
aCtrl->GetValue() );
};
cfg->m_Render.raytrace_lightAzimuth[0] = get_value( m_lightAzimuth1 );
cfg->m_Render.raytrace_lightAzimuth[1] = get_value( m_lightAzimuth2 );
cfg->m_Render.raytrace_lightAzimuth[2] = get_value( m_lightAzimuth3 );
cfg->m_Render.raytrace_lightAzimuth[3] = get_value( m_lightAzimuth4 );
cfg->m_Render.raytrace_lightAzimuth[4] = get_value( m_lightAzimuth5 );
cfg->m_Render.raytrace_lightAzimuth[5] = get_value( m_lightAzimuth6 );
cfg->m_Render.raytrace_lightAzimuth[6] = get_value( m_lightAzimuth7 );
cfg->m_Render.raytrace_lightAzimuth[7] = get_value( m_lightAzimuth8 );
}
cfg->m_Render.raytrace_lightElevation[0] = get_value( m_lightElevation1 );
cfg->m_Render.raytrace_lightElevation[1] = get_value( m_lightElevation2 );
cfg->m_Render.raytrace_lightElevation[2] = get_value( m_lightElevation3 );
cfg->m_Render.raytrace_lightElevation[3] = get_value( m_lightElevation4 );
cfg->m_Render.raytrace_lightElevation[4] = get_value( m_lightElevation5 );
cfg->m_Render.raytrace_lightElevation[5] = get_value( m_lightElevation6 );
cfg->m_Render.raytrace_lightElevation[6] = get_value( m_lightElevation7 );
cfg->m_Render.raytrace_lightElevation[7] = get_value( m_lightElevation8 );
cfg->m_Render.raytrace_lightAzimuth[0] = get_value( m_lightAzimuth1 );
cfg->m_Render.raytrace_lightAzimuth[1] = get_value( m_lightAzimuth2 );
cfg->m_Render.raytrace_lightAzimuth[2] = get_value( m_lightAzimuth3 );
cfg->m_Render.raytrace_lightAzimuth[3] = get_value( m_lightAzimuth4 );
cfg->m_Render.raytrace_lightAzimuth[4] = get_value( m_lightAzimuth5 );
cfg->m_Render.raytrace_lightAzimuth[5] = get_value( m_lightAzimuth6 );
cfg->m_Render.raytrace_lightAzimuth[6] = get_value( m_lightAzimuth7 );
cfg->m_Render.raytrace_lightAzimuth[7] = get_value( m_lightAzimuth8 );
return true;
}
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -19,25 +19,22 @@ PANEL_3D_RAYTRACING_OPTIONS_BASE::PANEL_3D_RAYTRACING_OPTIONS_BASE( wxWindow* pa
bSizerMain->Add( m_renderingLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bSizerMain->Add( 0, 5, 0, wxEXPAND, 5 );
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 5 );
wxGridSizer* gSizer1;
gSizer1 = new wxGridSizer( 0, 1, 0, 20 );
m_cbRaytracing_proceduralTextures = new wxCheckBox( this, wxID_ANY, _("Procedural textures (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
m_cbRaytracing_proceduralTextures->SetValue(true);
gSizer1->Add( m_cbRaytracing_proceduralTextures, 0, wxRIGHT|wxLEFT, 5 );
gSizer1->Add( m_cbRaytracing_proceduralTextures, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_cbRaytracing_addFloor = new wxCheckBox( this, wxID_ANY, _("Add floor (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
m_cbRaytracing_addFloor->SetValue(true);
gSizer1->Add( m_cbRaytracing_addFloor, 0, wxRIGHT|wxLEFT, 5 );
gSizer1->Add( m_cbRaytracing_addFloor, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_cbRaytracing_antiAliasing = new wxCheckBox( this, wxID_ANY, _("Anti-aliasing (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
m_cbRaytracing_antiAliasing->SetValue(true);
gSizer1->Add( m_cbRaytracing_antiAliasing, 0, wxRIGHT|wxLEFT, 5 );
gSizer1->Add( m_cbRaytracing_antiAliasing, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_cbRaytracing_postProcessing = new wxCheckBox( this, wxID_ANY, _("Screen space ambient occlusions and global illumination reflections (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
m_cbRaytracing_postProcessing->SetValue(true);
@@ -126,7 +123,7 @@ PANEL_3D_RAYTRACING_OPTIONS_BASE::PANEL_3D_RAYTRACING_OPTIONS_BASE( wxWindow* pa
bSizerMain->Add( m_lightsLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 );
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bSizerMain->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bLightsSizer;
bLightsSizer = new wxBoxSizer( wxVERTICAL );
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -27,6 +27,7 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_3D_RAYTRACING_OPTIONS_BASE
///////////////////////////////////////////////////////////////////////////////
+4 -1
View File
@@ -212,7 +212,10 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings()
// TODO(JE) use all control options
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
if( cfg )
{
// Save the 3D viewer render settings, to restore it after closing the preview
m_initialRender = cfg->m_Render;
@@ -158,7 +158,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Opacity") ), wxVERTICAL );
m_opacity = new wxSlider( sbSizer4->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
sbSizer4->Add( m_opacity, 0, wxRIGHT|wxLEFT|wxEXPAND, 2 );
sbSizer4->Add( m_opacity, 0, wxRIGHT|wxLEFT, 2 );
bSizerLeft->Add( sbSizer4, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
@@ -1889,7 +1889,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">2</property>
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxSlider" expanded="true">
<property name="BottomDockable">1</property>
+2 -3
View File
@@ -168,9 +168,9 @@
Thomas Gambier
Ashutosh Gangwar
Alessandro Gatti
Zenn Geeraerts
Alex Gellen
Robert Antoni Buj Gelonch
Robert Antoni Buj Genlonch
Hal Gentz
Lucas Gerads
Davide Gerhard
@@ -228,7 +228,6 @@
Mario Hros
Hubert Hu
Josue Huaroto
Eli Hughes
Huibean
Matt Huszagh
José Ignacio
@@ -622,7 +621,7 @@
欠陥電気
木 王
郝弘毅
Damjan Prerad
Eli Hughes
See git repo on GitLab for contributors at
https://gitlab.com/kicad/code/kicad/-/graphs/master
+70 -96
View File
@@ -22,7 +22,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
cmake_minimum_required( VERSION 3.22 FATAL_ERROR )
cmake_minimum_required( VERSION 3.21 FATAL_ERROR )
# Generate DEPFILES without transforming relative paths
cmake_policy( SET CMP0116 OLD )
@@ -62,21 +62,6 @@ set( CMAKE_MODULE_PATH "${KICAD_CMAKE_MODULE_PATH}" )
include( ConfigurePlatform )
if( WIN32 )
# Without WIN32_LEAN_AND_MEAN defined including windows.h pulls in legacy
# winsocks.h which conflicts with winsocks2.h used by modern libraries such
# as curl.
# There is no harm in defining this globally, at worst some additional
# headers have to be included explicitly.
add_compile_definitions( WIN32_LEAN_AND_MEAN )
endif()
if( APPLE )
# Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated.
# Luckily we can silence warnings about its deprecation.
add_compile_definitions( GL_SILENCE_DEPRECATION=1 )
endif()
# Create a flag to identify the non-Apple unix systems
if( UNIX AND NOT APPLE )
set( UNIX_NOT_APPLE ON )
@@ -130,6 +115,12 @@ option( KICAD_UPDATE_CHECK
"Build in update check"
ON )
# EGL is only needed on Linux with Wayland
cmake_dependent_option( KICAD_USE_EGL
"Build KiCad with EGL backend support for Wayland."
OFF "UNIX_NOT_APPLE"
OFF)
cmake_dependent_option( KICAD_USE_BUNDLED_GLEW
"Use the bundled version of GLEW - only available when KICAD_USE_EGL is set"
ON "KICAD_USE_EGL"
@@ -295,6 +286,16 @@ add_compile_definitions( $<$<BOOL:${KICAD_GAL_PROFILE}>:KICAD_GAL_PROFILE> )
add_compile_definitions( $<$<BOOL:${KICAD_WIN32_VERIFY_CODESIGN}>:KICAD_WIN32_VERIFY_CODESIGN> )
add_compile_definitions( $<$<BOOL:${KICAD_UPDATE_CHECK}>:KICAD_UPDATE_CHECK> )
if( KICAD_USE_EGL )
message( STATUS "Configuring KiCad for the wxGLCanvas EGL backend" )
add_compile_definitions( KICAD_USE_EGL )
endif()
if( KICAD_WAYLAND )
message( STATUS "Configuring KiCad to support Wayland features" )
add_compile_definitions( KICAD_WAYLAND )
endif()
if( KICAD_IPC_API )
add_definitions( -DKICAD_IPC_API )
endif()
@@ -754,6 +755,43 @@ if( KICAD_BUILD_I18N )
find_package( Gettext REQUIRED )
endif()
#
# Find OpenGL library, required
#
if( KICAD_USE_EGL )
find_package( OpenGL REQUIRED COMPONENTS OpenGL EGL )
else()
set( OpenGL_GL_PREFERENCE "LEGACY" ) # CMake 3.11+ setting; see 'cmake --help-policy CMP0072'
find_package( OpenGL REQUIRED )
endif()
#
# Find GLEW library, required
#
# The EGL canvas on GTK requires the use of a GLEW version compiled with an EGL flag.
# The one built in the thirdparty directory has the flag for EGL set, so we use it unless told
# otherwise. Then we search for the system GLEW version and use that instead.
#
if( KICAD_USE_EGL AND KICAD_USE_BUNDLED_GLEW AND UNIX AND NOT APPLE )
if( OpenGL_EGL_FOUND )
message( STATUS "Found OpenGL EGL library: ${OPENGL_egl_LIBRARY}" )
else()
message( FATAL_ERROR "OpenGL EGL library not found" )
endif()
# Add the custom GLEW target
add_subdirectory( thirdparty/glew )
# Set the standard package variables to point to our custom target to mimic the system version.
set( GLEW_LIBRARIES glew )
set( GLEW_FOUND TRUE )
include_directories( SYSTEM $<TARGET_PROPERTY:glew,INCLUDE_DIRECTORIES> )
else()
find_package( GLEW REQUIRED )
check_find_package_result( GLEW_FOUND "GLEW" )
include_directories( SYSTEM ${GLEW_INCLUDE_DIR} )
endif()
#
# Find GLM library, required
#
@@ -786,7 +824,7 @@ find_package( Pixman 0.30 REQUIRED )
include_directories( SYSTEM ${PIXMAN_INCLUDE_DIR} )
# Find libgit2, required
find_package( libgit2 1.5 REQUIRED )
find_package( libgit2 REQUIRED )
# Set include directories for libgit
include_directories(${LIBGIT2_INCLUDE_DIRS})
@@ -838,37 +876,24 @@ if( OCC_VERSION_STRING VERSION_LESS 7.5.0 )
endif()
include_directories( SYSTEM ${OCC_INCLUDE_DIR} )
# Try to find Protobuf with modern approach first, fallback to legacy if needed
set( _protobuf_found FALSE )
if( NOT KICAD_USE_CMAKE_FINDPROTOBUF )
message( STATUS "Attempting to find Protobuf using CONFIG mode..." )
find_package( Protobuf QUIET CONFIG )
if( Protobuf_FOUND )
set( Protobuf_LIBRARY "protobuf::libprotobuf" )
set( _protobuf_found TRUE )
message( STATUS "Found Protobuf using CONFIG mode" )
else()
message( STATUS "CONFIG mode failed, falling back to FindProtobuf.cmake" )
set( KICAD_USE_CMAKE_FINDPROTOBUF ON )
endif()
endif()
if( NOT _protobuf_found )
message( STATUS "Using FindProtobuf.cmake to locate Protobuf..." )
if( KICAD_USE_CMAKE_FINDPROTOBUF )
include( FindProtobuf )
find_package( Protobuf REQUIRED )
if( Protobuf_FOUND )
message( STATUS "Found Protobuf using FindProtobuf.cmake" )
endif()
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()
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()
@@ -1035,7 +1060,7 @@ include( ${wxWidgets_USE_FILE} )
# Detect wxWidgets port being used
if( wxWidgets_FIND_STYLE STREQUAL "win32" )
string(REGEX MATCH "(msw|qt|gtk)" KICAD_WX_PORT "${WX_CONFIGURATION}")
string(REGEX MATCH "^[msw|qt|gtk]*" KICAD_WX_PORT "${WX_CONFIGURATION}")
if( KICAD_WX_PORT STREQUAL "qt" )
add_compile_definitions( __WXQT__ )
@@ -1043,7 +1068,7 @@ if( wxWidgets_FIND_STYLE STREQUAL "win32" )
add_compile_definitions( __WXGTK__ )
endif()
elseif( _wx_selected_config )
string(REGEX MATCH "(msw|qt|gtk|osx)" KICAD_WX_PORT "${_wx_selected_config}")
string(REGEX MATCH "^[msw|qt|gtk|osx]*" KICAD_WX_PORT "${_wx_selected_config}")
endif()
if( KICAD_WX_PORT )
@@ -1052,8 +1077,6 @@ else()
message( FATAL_ERROR "Unable to detect wxWidgets port")
endif()
message(STATUS "wxUSE_GLCANVAS_EGL=${wxWidgets_GLCANVAS_EGL}")
if( NOT MSVC )
if( ${wxWidgets_VERSION_STRING} VERSION_LESS 3.2 )
message( FATAL_ERROR "wxWidgets 3.2.0 or greater is required" )
@@ -1070,55 +1093,6 @@ if( MINGW )
endif()
endif()
#
# Find OpenGL library, required
#
if( wxWidgets_GLCANVAS_EGL EQUAL 1 )
set( KICAD_USE_EGL ON )
find_package( OpenGL REQUIRED COMPONENTS OpenGL EGL )
else()
set( KICAD_USE_EGL OFF )
set( OpenGL_GL_PREFERENCE "LEGACY" ) # CMake 3.11+ setting; see 'cmake --help-policy CMP0072'
find_package( OpenGL REQUIRED )
endif()
if( KICAD_USE_EGL )
message( STATUS "Configuring KiCad for the wxGLCanvas EGL backend" )
add_compile_definitions( KICAD_USE_EGL )
endif()
if( KICAD_WAYLAND )
message( STATUS "Configuring KiCad to support Wayland features" )
add_compile_definitions( KICAD_WAYLAND )
endif()
#
# Find GLEW library, required
#
# The EGL canvas on GTK requires the use of a GLEW version compiled with an EGL flag.
# The one built in the thirdparty directory has the flag for EGL set, so we use it unless told
# otherwise. Then we search for the system GLEW version and use that instead.
#
if( KICAD_USE_EGL AND KICAD_USE_BUNDLED_GLEW )
if( OpenGL_EGL_FOUND )
message( STATUS "Found OpenGL EGL library: ${OPENGL_egl_LIBRARY}" )
else()
message( FATAL_ERROR "OpenGL EGL library not found" )
endif()
# Add the custom GLEW target
add_subdirectory( thirdparty/glew )
# Set the standard package variables to point to our custom target to mimic the system version.
set( GLEW_LIBRARIES glew )
set( GLEW_FOUND TRUE )
include_directories( SYSTEM $<TARGET_PROPERTY:glew,INCLUDE_DIRECTORIES> )
else()
find_package( GLEW REQUIRED )
check_find_package_result( GLEW_FOUND "GLEW" )
include_directories( SYSTEM ${GLEW_INCLUDE_DIR} )
endif()
if( APPLE )
# Remove app bundles in ${KICAD_BIN} before installing anything new.
# Must be defined before all includes so that it is executed first.
+47 -74
View File
@@ -1,83 +1,56 @@
{
"version": 9,
"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": "base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
{
"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"
]
"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"
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"description": "Sets debug build type and x64 arch",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
"architecture": {
"value": "x64",
"strategy": "external"
},
{
"name": "x64-release",
"displayName": "x64 Release",
"description": "Sets release build type",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
"inherits": [
"base"
]
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"description": "Sets debug build type and x64 arch",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
],
"buildPresets": [
{
"name": "kicad",
"configurePreset": "x64-debug",
"configuration": "Debug",
"targets": [
"install"
]
}
],
"workflowPresets": [
{
"name": "kicad",
"description": "kicad",
"displayName": "kicad",
"steps": [
{
"type": "configure",
"name": "x64-debug"
},
{
"type": "build",
"name": "kicad"
}
]
},
{
"name": "x64-release",
"displayName": "x64 Release",
"description": "Sets release build type",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
}
]
}
+3 -2
View File
@@ -6,6 +6,7 @@ AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignOperands: true
AlignTrailingComments: true
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
@@ -23,7 +24,8 @@ BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakStringLiterals: true
ColumnLimit: 120
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
@@ -37,7 +39,6 @@ KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 2
NamespaceIndentation: Inner
PackConstructorInitializers: Never
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
-36
View File
@@ -189,42 +189,6 @@ message PadShapeAsPolygonResponse
repeated kiapi.common.types.PolygonWithHoles polygons = 2;
}
// Tests if the given set of items with padstacks (pads or vias) has content on the given set of layers.
// This is a dynamic call rather than a property of the padstack because pads and vias can be set to only include
// shapes on connected copper layers, and whether or not the pad is connected can't be determined in isolation.
// To optimize API call performance, multiple items and multiple layers to test may be passed in with this
// command message. The return will include the results for each valid item on each valid layer.
// Note that not all layers make sense for a given item (for example, testing against BL_UNDEFINED never makes
// sense). In general, the internal KiCad APIs will not return an error when testing non-sensical layers for a given
// item, and instead will return a default of "true" for any such layers.
message CheckPadstackPresenceOnLayers
{
kiapi.common.types.DocumentSpecifier board = 1;
repeated kiapi.common.types.KIID items = 2;
repeated kiapi.board.types.BoardLayer layers = 3;
}
enum PadstackPresence
{
PSP_UNKNOWN = 0;
PSP_PRESENT = 1; // The padstack has a shape on a given layer (is flashed)
PSP_NOT_PRESENT = 2; // The padstack has no shape on a given layer (is not flashed)
}
message PadstackPresenceEntry
{
kiapi.common.types.KIID item = 1;
kiapi.board.types.BoardLayer layer = 2;
PadstackPresence presence = 3;
}
message PadstackPresenceResponse
{
repeated PadstackPresenceEntry entries = 1;
}
// PCB editor commands
// returns BoardLayers
+3 -73
View File
@@ -294,31 +294,15 @@ message PadStackLayer
enum SolderMaskMode
{
SMM_UNKNOWN = 0;
SMM_UNKOWN = 0;
SMM_MASKED = 1;
SMM_UNMASKED = 2;
SMM_FROM_DESIGN_RULES = 3;
}
enum ViaCoveringMode
{
VCM_UNKNOWN = 0;
VCM_COVERED = 1;
VCM_UNCOVERED = 2;
VCM_FROM_DESIGN_RULES = 3;
}
enum ViaPluggingMode
{
VPM_UNKNOWN = 0;
VPM_PLUGGED = 1;
VPM_UNPLUGGED = 2;
VPM_FROM_DESIGN_RULES = 3;
}
enum SolderPasteMode
{
SPM_UNKNOWN = 0;
SPM_UNKOWN = 0;
SPM_PASTE = 1;
SPM_NO_PASTE = 2;
SPM_FROM_DESIGN_RULES = 3;
@@ -335,9 +319,6 @@ message PadStackOuterLayer
// NOTE: At present, KiCad does not support different solder paste expansion settings for the top and bottom layers
SolderPasteOverrides solder_paste_settings = 4;
ViaPluggingMode plugging_mode = 5;
ViaCoveringMode covering_mode = 6;
}
enum DrillShape
@@ -348,22 +329,6 @@ enum DrillShape
DS_UNDEFINED = 3;
}
enum ViaDrillCappingMode
{
VDCM_UNKNOWN = 0;
VDCM_CAPPED = 1;
VDCM_UNCAPPED = 2;
VDCM_FROM_DESIGN_RULES = 3;
}
enum ViaDrillFillingMode
{
VDFM_UNKNOWN = 0;
VDFM_FILLED = 1;
VDFM_UNFILLED = 2;
VDFM_FROM_DESIGN_RULES = 3;
}
message DrillProperties
{
// Lowest (closest to F_Cu) layer this drill exists on.
@@ -377,10 +342,6 @@ message DrillProperties
kiapi.common.types.Vector2 diameter = 3;
DrillShape shape = 4;
ViaDrillCappingMode capped = 5;
ViaDrillFillingMode filled = 6;
}
// A pad stack definition for a multilayer pad or via.
@@ -609,7 +570,6 @@ enum PlacementRuleSourceType
PRST_UNKNOWN = 0;
PRST_SHEET_NAME = 1;
PRST_COMPONENT_CLASS = 2;
PRST_GROUP = 3;
}
message RuleAreaSettings
@@ -648,14 +608,6 @@ message ZoneFilledPolygons
kiapi.common.types.PolySet shapes = 2;
}
message ZoneLayerProperties
{
BoardLayer layer = 1;
kiapi.common.types.Vector2 hatching_offset = 2;
}
message Zone
{
kiapi.common.types.KIID id = 1;
@@ -682,8 +634,6 @@ message Zone
ZoneBorderSettings border = 11;
kiapi.common.types.LockedState locked = 12;
repeated ZoneLayerProperties layer_properties = 13;
}
// An aligned dimension is drawn parallel to the line segment between the start and end points
@@ -841,9 +791,7 @@ message ReferenceImage
message Group
{
kiapi.common.types.KIID id = 1;
string name = 2;
repeated kiapi.common.types.KIID items = 3;
// TODO
}
message FieldId
@@ -912,19 +860,6 @@ message Footprint3DModel
double opacity = 6;
}
message JumperGroup
{
repeated string pad_names = 1;
}
message JumperSettings
{
/// If true, duplicate pad names in this footprint are jumpered together
bool duplicate_names_are_jumpered = 1;
repeated JumperGroup groups = 2;
}
// A footprint definition (i.e. what would be in a library)
message Footprint
{
@@ -942,8 +877,6 @@ message Footprint
// All footprint items except for mandatory fields
repeated google.protobuf.Any items = 11;
JumperSettings jumpers = 12;
}
// An instance of a footprint on a board
@@ -963,7 +896,4 @@ message FootprintInstance
FootprintAttributes attributes = 11;
FootprintDesignRuleOverrides overrides = 12;
// The sheet path to the associated symbol for this footprint instance, if one exists
kiapi.common.types.SheetPath symbol_path = 13;
}
@@ -222,14 +222,6 @@ message GetItems
repeated kiapi.common.types.KiCadObjectType types = 2;
}
message GetItemsById
{
// Specifies which document to query, which fields to return, etc.
kiapi.common.types.ItemHeader header = 1;
repeated kiapi.common.types.KIID items = 2;
}
message GetItemsResponse
{
// Specifies which document was modified, which fields are included in items, etc.
-2
View File
@@ -84,8 +84,6 @@ enum KiCadObjectType
KOT_WSG_TEXT = 48;
KOT_WSG_BITMAP = 49;
KOT_WSG_PAGE = 50;
KOT_SCH_GROUP = 51;
}
// Mapped to GR_TEXT_H_ALIGN_T
+1 -38
View File
@@ -30,15 +30,11 @@
#include <common.h>
#include <math/util.h> // for KiROUND
#include <potracelib.h>
#include <vector>
#include <wx/arrstr.h>
#include <wx/clipbrd.h>
#include <wx/dnd.h>
#include <wx/rawbmp.h>
#include <wx/msgdlg.h>
#include <wx/dcclient.h>
#include <wx/log.h>
#include <wx/string.h>
#define DEFAULT_DPI 300 // the image DPI used in formats that do not define a DPI
@@ -62,12 +58,9 @@ BITMAP2CMP_PANEL::BITMAP2CMP_PANEL( BITMAP2CMP_FRAME* aParent ) :
m_buttonExportFile->Enable( false );
m_buttonExportClipboard->Enable( false );
m_InitialPicturePanel->SetDropTarget( new DROP_FILE( this ) );
m_GreyscalePicturePanel->SetDropTarget( new DROP_FILE( this ) );
m_BNPicturePanel->SetDropTarget( new DROP_FILE( this ) );
}
wxWindow* BITMAP2CMP_PANEL::GetCurrentPage()
{
return m_Notebook->GetCurrentPage();
@@ -569,33 +562,3 @@ void BITMAP2CMP_PANEL::OnFormatChange( wxCommandEvent& event )
m_layerLabel->Enable( m_rbFootprint->GetValue() );
m_layerCtrl->Enable( m_rbFootprint->GetValue() );
}
DROP_FILE::DROP_FILE( BITMAP2CMP_PANEL* panel ) :
m_panel( panel )
{
}
bool DROP_FILE::OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames )
{
m_panel->SetFocus();
// If a file is already loaded
if( m_panel->GetOutputSizeX().GetOriginalSizePixels() != 0 )
{
wxString cap = _( "Replace Loaded File?" );
wxString msg = _( "There is already a file loaded. Do you want to replace it?" );
wxMessageDialog acceptFileDlg( m_panel, msg, cap, wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
int replace = acceptFileDlg.ShowModal();
if( replace == wxID_NO )
return false;
}
std::vector<wxString> fNameVec;
fNameVec.insert( fNameVec.begin(), filenames.begin(), filenames.end() );
m_panel->OpenProjectFiles( fNameVec );
return true;
}
+1 -15
View File
@@ -25,7 +25,7 @@
#include <bitmap2cmp_panel_base.h>
#include <eda_units.h>
#include <wx/dnd.h>
class BITMAP2CMP_FRAME;
class BITMAP2CMP_SETTINGS;
@@ -134,18 +134,4 @@ private:
bool m_negative;
double m_aspectRatio;
};
class DROP_FILE : public wxFileDropTarget
{
public:
DROP_FILE( BITMAP2CMP_PANEL* panel );
DROP_FILE() = delete;
bool OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames ) override;
private:
BITMAP2CMP_PANEL* m_panel;
};
#endif// BITMAP2CMP_PANEL
+2 -1
View File
@@ -48,7 +48,9 @@ set( OCC_LIBS_COMMON
TKLCAF
TKMath
TKMesh
TKMeshVS
TKOffset
TKOpenGl
TKPrim
TKRWMesh
TKService
@@ -136,7 +138,6 @@ else(WIN32)
HINTS
${OCC_LIBRARY_DIR}
/usr
/usr/opencascade
/usr/local
/usr/local/opencascade
/opt/opencascade
-23
View File
@@ -520,15 +520,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
set(WX_LIB_DIR_PREFIX vc)
endif()
set( EXTRA_LIB_PATH "" )
if(VCPKG_TOOLCHAIN)
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
set( EXTRA_LIB_PATH "${WX_ROOT_DIR}/debug/lib" )
else()
set( EXTRA_LIB_PATH "${WX_ROOT_DIR}/lib" )
endif()
endif()
if(BUILD_SHARED_LIBS)
find_path(wxWidgets_LIB_DIR
NAMES
@@ -545,7 +536,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
PATHS
${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll # prefer shared
${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib
${EXTRA_LIB_PATH}
DOC "Path to wxWidgets libraries"
NO_DEFAULT_PATH
)
@@ -565,7 +555,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
PATHS
${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib # prefer static
${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll
${EXTRA_LIB_PATH}
DOC "Path to wxWidgets libraries"
NO_DEFAULT_PATH
)
@@ -625,10 +614,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
set(WX_USE_REL_AND_DBG FALSE)
endif()
if( VCPKG_TOOLCHAIN )
set(WX_USE_REL_AND_DBG FALSE)
endif()
# Get configuration parameters from the name.
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} PF UNV UCD DBG)
@@ -799,14 +784,6 @@ else()
DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
execute_process(
COMMAND sh -c "echo '#include <wx/platform.h>' ; echo CMAKE_WXTEST_RESULT wxUSE_GLCANVAS_EGL"
COMMAND ${CMAKE_CXX_COMPILER} ${wxWidgets_CXX_FLAGS} -E -
COMMAND grep CMAKE_WXTEST_RESULT
COMMAND cut "-d " -f2
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE wxWidgets_GLCANVAS_EGL )
# parse definitions from cxxflags;
# drop -D* from CXXFLAGS and the -D prefix
string(REGEX MATCHALL "-D[^;]+"
+1 -1
View File
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "9.99.0-unknown" )
set( KICAD_SEMANTIC_VERSION "9.0.2" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
-2
View File
@@ -259,8 +259,6 @@ if( MSVC )
string( APPEND WARN_FLAGS_CXX " /wd5204 /wd4265" )
# disable "layout of class may have changed from a previous version of the compiler"
string( APPEND WARN_FLAGS_CXX " /wd4371" )
# disable "'this': used in base member initializer list"
string( APPEND WARN_FLAGS_CXX " /wd4355" )
# disable "relative include path contains '..'"
string( APPEND WARN_FLAGS_CXX " /wd4464" )
# disable "'const' variable is not used"
+3 -46
View File
@@ -71,14 +71,12 @@ set( KICOMMON_SRCS
jobs/job_export_pcb_dxf.cpp
jobs/job_export_pcb_gerber.cpp
jobs/job_export_pcb_gerbers.cpp
jobs/job_export_pcb_hpgl.cpp
jobs/job_export_pcb_ipc2581.cpp
jobs/job_export_pcb_ipcd356.cpp
jobs/job_export_pcb_odb.cpp
jobs/job_export_pcb_pdf.cpp
jobs/job_export_pcb_plot.cpp
jobs/job_export_pcb_pos.cpp
jobs/job_export_pcb_ps.cpp
jobs/job_export_pcb_svg.cpp
jobs/job_export_pcb_gencad.cpp
jobs/job_export_pcb_3d.cpp
@@ -115,15 +113,10 @@ set( KICOMMON_SRCS
settings/settings_manager.cpp
project/board_project_settings.cpp
project/component_class_settings.cpp
project/net_settings.cpp
project/project_archiver.cpp
project/project_file.cpp
project/project_local_settings.cpp
project/time_domain_parameters.cpp
# This is basically a settings object, but for the toolbar
tool/ui/toolbar_configuration.cpp
dialogs/dialog_migrate_settings.cpp
dialogs/dialog_migrate_settings_base.cpp
@@ -148,7 +141,6 @@ set( KICOMMON_SRCS
design_block_info_impl.cpp
advanced_config.cpp
app_monitor.cpp
asset_archive.cpp
array_axis.cpp
array_options.cpp
@@ -245,7 +237,6 @@ target_link_libraries( kicommon
fmt::fmt
CURL::libcurl
picosha2
rapidcsv
${ZSTD_LIBRARY}
${wxWidgets_LIBRARIES}
${LIBGIT2_LIBRARIES}
@@ -267,7 +258,7 @@ if( KICAD_USE_SENTRY )
target_link_libraries( kicommon
sentry )
set_property(SOURCE app_monitor.cpp APPEND PROPERTY COMPILE_DEFINITIONS KICAD_SENTRY_DSN="${KICAD_SENTRY_DSN}")
set_property(SOURCE pgm_base.cpp APPEND PROPERTY COMPILE_DEFINITIONS KICAD_SENTRY_DSN="${KICAD_SENTRY_DSN}")
endif()
if( KICAD_IPC_API )
@@ -358,8 +349,6 @@ set( COMMON_DLG_SRCS
dialogs/dialog_color_picker_base.cpp
dialogs/dialog_configure_paths.cpp
dialogs/dialog_configure_paths_base.cpp
dialogs/dialog_design_block_properties.cpp
dialogs/dialog_design_block_properties_base.cpp
dialogs/dialog_display_html_text_base.cpp
dialogs/dialog_edit_library_tables.cpp
dialogs/dialog_embed_files.cpp
@@ -368,8 +357,6 @@ set( COMMON_DLG_SRCS
dialogs/dialog_global_design_block_lib_table_config.cpp
dialogs/dialog_grid_settings.cpp
dialogs/dialog_grid_settings_base.cpp
dialogs/dialog_group_properties.cpp
dialogs/dialog_group_properties_base.cpp
dialogs/dialog_hotkey_list.cpp
dialogs/dialog_HTML_reporter_base.cpp
dialogs/dialog_import_choose_project.cpp
@@ -418,15 +405,10 @@ set( COMMON_DLG_SRCS
dialogs/panel_plugin_settings.cpp
dialogs/panel_plugin_settings_base.cpp
dialogs/panel_setup_netclasses.cpp
dialogs/panel_printer_list.cpp
dialogs/panel_printer_list_base.cpp
dialogs/panel_setup_netclasses_base.cpp
dialogs/panel_setup_severities.cpp
dialogs/panel_text_variables.cpp
dialogs/panel_text_variables_base.cpp
dialogs/panel_toolbar_customization.cpp
dialogs/panel_toolbar_customization_base.cpp
)
if( KICAD_USE_SENTRY )
@@ -437,11 +419,9 @@ endif()
set( COMMON_WIDGET_SRCS
widgets/app_progress_dialog.cpp
widgets/wx_bitmap_combobox.cpp
widgets/bitmap_toggle.cpp
widgets/button_row_panel.cpp
widgets/color_swatch.cpp
widgets/design_block_pane.cpp
widgets/filter_combobox.cpp
widgets/font_choice.cpp
widgets/footprint_choice.cpp
@@ -467,7 +447,6 @@ set( COMMON_WIDGET_SRCS
widgets/mathplot.cpp
widgets/msgpanel.cpp
widgets/paged_dialog.cpp
widgets/panel_design_block_chooser.cpp
widgets/properties_panel.cpp
widgets/search_pane.cpp
widgets/search_pane_base.cpp
@@ -530,6 +509,7 @@ set( PLOTTERS_CONTROL_SRCS
plotters/plotter.cpp
plotters/DXF_plotter.cpp
plotters/GERBER_plotter.cpp
plotters/HPGL_plotter.cpp
plotters/PDF_plotter.cpp
plotters/PS_plotter.cpp
plotters/SVG_plotter.cpp
@@ -558,16 +538,6 @@ set( COMMON_IO_SRCS
# EasyEDA pro
io/easyedapro/easyedapro_parser.cpp
io/easyedapro/easyedapro_import_utils.cpp
io/csv.cpp
)
set ( COMMON_TRANSLINE_CALCULATION_SRCS
transline_calculations/transline_calculation_base.cpp
transline_calculations/microstrip.cpp
transline_calculations/coupled_microstrip.cpp
transline_calculations/stripline.cpp
transline_calculations/coupled_stripline.cpp
)
set( COMMON_IMPORT_GFX_SRCS
@@ -604,7 +574,6 @@ set( COMMON_SRCS
${FONT_SRCS}
${COMMON_IMPORT_GFX_SRCS}
${COMMON_GIT_SRCS}
${COMMON_TRANSLINE_CALCULATION_SRCS}
base_screen.cpp
bin_mod.cpp
bitmap_base.cpp
@@ -618,7 +587,6 @@ set( COMMON_SRCS
eda_dde.cpp
eda_doc.cpp
eda_draw_frame.cpp
eda_group.cpp
eda_item.cpp
eda_shape.cpp
eda_text.cpp
@@ -640,7 +608,6 @@ set( COMMON_SRCS
lib_table_grid_tricks.cpp
lib_tree_model.cpp
lib_tree_model_adapter.cpp
design_block_tree_model_adapter.cpp
marker_base.cpp
origin_transforms.cpp
printout.cpp
@@ -674,14 +641,12 @@ set( COMMON_SRCS
tool/construction_manager.cpp
tool/common_tools.cpp
tool/conditional_menu.cpp
tool/design_block_control.cpp
tool/edit_constraints.cpp
tool/edit_points.cpp
tool/editor_conditions.cpp
tool/embed_tool.cpp
tool/grid_helper.cpp
tool/grid_menu.cpp
tool/group_tool.cpp
tool/library_editor_control.cpp
tool/picker_tool.cpp
tool/point_editor_behavior.cpp
@@ -803,10 +768,7 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp #needed by board_design_settings.cpp
${CMAKE_SOURCE_DIR}/pcbnew/router/pns_meander.cpp #needed by board_design_settings.cpp
${CMAKE_SOURCE_DIR}/pcbnew/board.cpp
${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class.cpp
${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_assignment_rule.cpp
${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_cache_proxy.cpp
${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_manager.cpp
${CMAKE_SOURCE_DIR}/pcbnew/component_class_manager.cpp #needed by board.cpp
${CMAKE_SOURCE_DIR}/pcbnew/board_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_dimension.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
@@ -865,7 +827,6 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_utils.cpp
${CMAKE_SOURCE_DIR}/pcbnew/zone_settings.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_board_outline.cpp
# IO files
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io.cpp
@@ -881,10 +842,6 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_editor_conditions.cpp
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_viewer_tools.cpp
${CMAKE_SOURCE_DIR}/pcbnew/length_delay_calculation/length_delay_calculation.cpp
${CMAKE_SOURCE_DIR}/pcbnew/length_delay_calculation/length_delay_calculation_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/length_delay_calculation/time_domain_parameters_user_defined.cpp
widgets/net_selector.cpp
)
+20 -21
View File
@@ -98,10 +98,12 @@ static const wxChar AllowManualCanvasScale[] = wxT( "AllowManualCanvasScale" );
static const wxChar UpdateUIEventInterval[] = wxT( "UpdateUIEventInterval" );
static const wxChar V3DRT_BevelHeight_um[] = wxT( "V3DRT_BevelHeight_um" );
static const wxChar V3DRT_BevelExtentFactor[] = wxT( "V3DRT_BevelExtentFactor" );
static const wxChar EnablePcbDesignBlocks[] = wxT( "EnablePcbDesignBlocks" );
static const wxChar EnableDesignBlocks[] = wxT( "EnableDesignBlocks" );
static const wxChar EnableGenerators[] = wxT( "EnableGenerators" );
static const wxChar EnableLibWithText[] = wxT( "EnableLibWithText" );
static const wxChar EnableLibDir[] = wxT( "EnableLibDir" );
static const wxChar EnableEeschemaPrintCairo[] = wxT( "EnableEeschemaPrintCairo" );
static const wxChar EnableEeschemaExportClipboardCairo[] = wxT( "EnableEeschemaExportClipboardCairo" );
static const wxChar DisambiguationTime[] = wxT( "DisambiguationTime" );
static const wxChar PcbSelectionVisibilityRatio[] = wxT( "PcbSelectionVisibilityRatio" );
static const wxChar FontErrorSize[] = wxT( "FontErrorSize" );
@@ -126,8 +128,6 @@ static const wxChar NetInspectorBulkUpdateOptimisationThreshold[] =
wxT( "NetInspectorBulkUpdateOptimisationThreshold" );
static const wxChar ExcludeFromSimulationLineWidth[] = wxT( "ExcludeFromSimulationLineWidth" );
static const wxChar GitIconRefreshInterval[] = wxT( "GitIconRefreshInterval" );
static const wxChar ConfigurableToolbars[] = wxT( "ConfigurableToolbars" );
static const wxChar MaxPastedTextLength[] = wxT( "MaxPastedTextLength" );
} // namespace KEYS
@@ -256,11 +256,14 @@ ADVANCED_CFG::ADVANCED_CFG()
m_CompactSave = false;
m_UpdateUIEventInterval = 0;
m_ShowRepairSchematic = false;
m_EnablePcbDesignBlocks = false;
m_EnableDesignBlocks = true;
m_EnableGenerators = false;
m_EnableLibWithText = false;
m_EnableLibDir = false;
m_EnableEeschemaPrintCairo = true;
m_EnableEeschemaExportClipboardCairo = true;
m_3DRT_BevelHeight_um = 30;
m_3DRT_BevelExtentFactor = 1.0 / 16.0;
@@ -302,16 +305,12 @@ ADVANCED_CFG::ADVANCED_CFG()
m_MinimumMarkerSeparationDistance = 0.15;
m_NetInspectorBulkUpdateOptimisationThreshold = 100;
m_NetInspectorBulkUpdateOptimisationThreshold = 25;
m_ExcludeFromSimulationLineWidth = 25;
m_GitIconRefreshInterval = 10000;
m_ConfigurableToolbars = false;
m_MaxPastedTextLength = 100;
loadFromConfigFile();
}
@@ -492,8 +491,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
m_DisambiguationMenuDelay,
50, 10000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnablePcbDesignBlocks, &m_EnablePcbDesignBlocks,
m_EnablePcbDesignBlocks ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableDesignBlocks,
&m_EnableDesignBlocks, m_EnableDesignBlocks ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGenerators,
&m_EnableGenerators, m_EnableGenerators ) );
@@ -507,6 +506,14 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibDir,
&m_EnableLibDir, m_EnableLibDir ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaPrintCairo,
&m_EnableEeschemaPrintCairo,
m_EnableEeschemaPrintCairo ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaExportClipboardCairo,
&m_EnableEeschemaExportClipboardCairo,
m_EnableEeschemaExportClipboardCairo ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::PcbSelectionVisibilityRatio,
&m_PcbSelectionVisibilityRatio,
m_PcbSelectionVisibilityRatio, 0.0, 1.0 ) );
@@ -525,11 +532,11 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::TriangulateSimplificationLevel,
&m_TriangulateSimplificationLevel,
m_TriangulateSimplificationLevel, 5, 1000 ) );
m_TriangulateSimplificationLevel, 0, 1000 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::TriangulateMinimumArea,
&m_TriangulateMinimumArea,
m_TriangulateMinimumArea, 25, 100000 ) );
m_TriangulateMinimumArea, 0, 100000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableCacheFriendlyFracture,
&m_EnableCacheFriendlyFracture,
@@ -594,14 +601,6 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_GitIconRefreshInterval,
m_GitIconRefreshInterval, 0, 100000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ConfigurableToolbars,
&m_ConfigurableToolbars,
m_ConfigurableToolbars ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaxPastedTextLength,
&m_MaxPastedTextLength,
m_MaxPastedTextLength, 0, 100000 ) );
// 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;
-2
View File
@@ -53,7 +53,6 @@ KICAD_T FromProtoEnum( types::KiCadObjectType aValue )
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_GROUP: return SCH_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;
@@ -127,7 +126,6 @@ types::KiCadObjectType ToProtoEnum( KICAD_T aValue )
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_GROUP_T: return types::KiCadObjectType::KOT_SCH_GROUP;
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;
-9
View File
@@ -21,7 +21,6 @@
#include <magic_enum.hpp>
#include <api/api_utils.h>
#include <geometry/shape_poly_set.h>
#include <kiid.h>
#include <wx/log.h>
const wxChar* const traceApi = wxT( "KICAD_API" );
@@ -233,12 +232,4 @@ KICOMMON_API KIGFX::COLOR4D UnpackColor( const types::Color& aInput )
return KIGFX::COLOR4D( r, g, b, a );
}
KICOMMON_API void PackSheetPath( types::SheetPath& aOutput, const KIID_PATH& aInput )
{
aOutput.clear_path();
for( const KIID& entry : aInput )
aOutput.add_path()->set_value( entry.AsStdString() );
}
} // namespace kiapi::common
-480
View File
@@ -1,480 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The 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 <app_monitor.h>
#include <pgm_base.h>
#include <magic_enum.hpp>
#include <kiplatform/policy.h>
#include <policy_keys.h>
#include <paths.h>
#include <wx/filename.h>
#include <wx/ffile.h>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <build_version.h>
#ifdef KICAD_USE_SENTRY
#include <sentry.h>
#endif
using namespace APP_MONITOR;
SENTRY::SENTRY() :
m_isOptedIn( false )
{
}
void SENTRY::Init()
{
#ifdef KICAD_USE_SENTRY
sentryInit();
#endif
}
void SENTRY::Cleanup()
{
#ifdef KICAD_USE_SENTRY
sentry_close();
#endif
}
void SENTRY::AddTag( const wxString& aKey, const wxString& aValue )
{
#ifdef KICAD_USE_SENTRY
sentry_set_tag( aKey.c_str(), aValue.c_str() );
#endif
}
void SENTRY::SetSentryOptIn( bool aOptIn )
{
#ifdef KICAD_USE_SENTRY
if( aOptIn )
{
// Opting in (when not opted in before) may require reading the uid off disk
// as it was skipped previously.
readOrCreateUid();
if( !m_sentry_optin_fn.Exists() )
{
wxFFile sentryInitFile( m_sentry_optin_fn.GetFullPath(), "w" );
sentryInitFile.Write( "" );
sentryInitFile.Close();
}
m_isOptedIn = true;
}
else
{
if( m_sentry_optin_fn.Exists() )
{
wxRemoveFile( m_sentry_optin_fn.GetFullPath() );
sentry_close();
}
m_isOptedIn = false;
}
#else
m_isOptedIn = false;
#endif
}
wxString SENTRY::sentryCreateUid()
{
boost::uuids::uuid uuid = boost::uuids::random_generator()();
wxString userGuid = boost::uuids::to_string( uuid );
wxFFile sentryInitFile( m_sentry_uid_fn.GetFullPath(), "w" );
sentryInitFile.Write( userGuid );
sentryInitFile.Close();
return userGuid;
}
void SENTRY::ResetSentryId()
{
m_sentryUid = sentryCreateUid();
}
const wxString& SENTRY::GetSentryId()
{
return m_sentryUid;
}
void SENTRY::readOrCreateUid()
{
wxFFile sentryInitFile( m_sentry_uid_fn.GetFullPath() );
sentryInitFile.ReadAll( &m_sentryUid );
sentryInitFile.Close();
if( m_sentryUid.IsEmpty() || m_sentryUid.length() != 36 )
{
ResetSentryId();
}
}
void SENTRY::sentryInit()
{
#ifdef KICAD_USE_SENTRY
m_sentry_optin_fn = wxFileName( PATHS::GetUserCachePath(), "sentry-opt-in" );
m_sentry_uid_fn = wxFileName( PATHS::GetUserCachePath(), "sentry-uid" );
if( isConfiguredOptedIn() )
{
m_isOptedIn = true;
readOrCreateUid();
sentry_options_t* options = sentry_options_new();
#ifndef KICAD_SENTRY_DSN
#error "Project configuration error, missing KICAD_SENTRY_DSN"
#endif
// only capture 5% of transactions
sentry_options_set_traces_sample_rate( options, 0.05 );
sentry_options_set_dsn( options, KICAD_SENTRY_DSN );
wxFileName tmp;
tmp.AssignDir( PATHS::GetUserCachePath() );
tmp.AppendDir( "sentry" );
#ifdef __WINDOWS__
sentry_options_set_database_pathw( options, tmp.GetPathWithSep().wc_str() );
#else
sentry_options_set_database_path( options, tmp.GetPathWithSep().c_str() );
#endif
sentry_options_set_symbolize_stacktraces( options, true );
sentry_options_set_auto_session_tracking( options, false );
sentry_options_set_release( options, GetCommitHash().ToStdString().c_str() );
// This just gives us more filtering within sentry, issues still get grouped across
// environments.
sentry_options_set_environment( options, GetMajorMinorVersion().c_str() );
sentry_init( options );
sentry_value_t user = sentry_value_new_object();
sentry_value_set_by_key( user, "id", sentry_value_new_string( m_sentryUid.c_str() ) );
sentry_set_user( user );
sentry_set_tag( "kicad.version", GetBuildVersion().ToStdString().c_str() );
}
#endif
}
bool SENTRY::isConfiguredOptedIn()
{
// policy takes precedence
KIPLATFORM::POLICY::PBOOL policyState = KIPLATFORM::POLICY::GetPolicyBool( POLICY_KEY_DATACOLLECTION );
if( policyState != KIPLATFORM::POLICY::PBOOL::NOT_CONFIGURED )
{
return policyState == KIPLATFORM::POLICY::PBOOL::ENABLED;
}
return m_sentry_optin_fn.Exists();
}
bool SENTRY::IsOptedIn()
{
#ifdef KICAD_USE_SENTRY
// always override with policy, just in case
KIPLATFORM::POLICY::PBOOL policyState = KIPLATFORM::POLICY::GetPolicyBool( POLICY_KEY_DATACOLLECTION );
if( policyState != KIPLATFORM::POLICY::PBOOL::NOT_CONFIGURED )
{
return policyState == KIPLATFORM::POLICY::PBOOL::ENABLED;
}
return m_isOptedIn;
#else
return false;
#endif
}
void SENTRY::LogAssert( const ASSERT_CACHE_KEY& aKey, const wxString& aAssertMsg )
{
#ifdef KICAD_USE_SENTRY
if( !APP_MONITOR::SENTRY::Instance()->IsOptedIn() )
{
return;
}
// We use an assert cache to avoid collecting too many events
// Because they can come from functions that are called hundreds of times in loops
if( m_assertCache.find( aKey ) == m_assertCache.end() )
{
sentry_value_t exc = sentry_value_new_exception( "assert", aAssertMsg.c_str() );
sentry_value_set_stacktrace( exc, NULL, 0 );
sentry_value_t sentryEvent = sentry_value_new_event();
sentry_event_add_exception( sentryEvent, exc );
sentry_capture_event( sentryEvent );
m_assertCache.insert( aKey );
}
#endif
}
void SENTRY::LogException( const wxString& aMsg )
{
#ifdef KICAD_USE_SENTRY
if( !APP_MONITOR::SENTRY::Instance()->IsOptedIn() )
{
return;
}
sentry_value_t exc = sentry_value_new_exception( "exception", aMsg.c_str() );
sentry_value_set_stacktrace( exc, NULL, 0 );
sentry_value_t sentryEvent = sentry_value_new_event();
sentry_event_add_exception( sentryEvent, exc );
sentry_capture_event( sentryEvent );
#endif
}
#ifdef KICAD_USE_SENTRY
static std::string GetSentryBreadCrumbType( BREADCRUMB_TYPE aType )
{
// the only special case due to collisions with defines
if( aType == BREADCRUMB_TYPE::DBG )
return "debug";
if( aType == BREADCRUMB_TYPE::ERR )
return "error";
std::string ret( magic_enum::enum_name( aType ) );
std::transform( ret.begin(), ret.end(), ret.begin(),
[]( unsigned char c )
{
return std::tolower( c );
} );
return ret;
}
static std::string GetSentryBreadCrumbLevel( BREADCRUMB_LEVEL aLevel )
{
// the only special case due to collisions with defines
if( aLevel == BREADCRUMB_LEVEL::DBG )
return "debug";
if( aLevel == BREADCRUMB_LEVEL::ERR )
return "error";
std::string ret( magic_enum::enum_name( aLevel ) );
std::transform( ret.begin(), ret.end(), ret.begin(),
[]( unsigned char c )
{
return std::tolower( c );
} );
return ret;
}
#endif
namespace APP_MONITOR
{
SENTRY* SENTRY::m_instance = nullptr;
bool operator<( const ASSERT_CACHE_KEY& aKey1, const ASSERT_CACHE_KEY& aKey2 )
{
return aKey1.file < aKey2.file || aKey1.line < aKey2.line || aKey1.func < aKey2.func || aKey1.cond < aKey2.cond;
}
void AddBreadcrumb( BREADCRUMB_TYPE aType, const wxString& aMsg, const wxString& aCategory, BREADCRUMB_LEVEL aLevel )
{
#ifdef KICAD_USE_SENTRY
if( !SENTRY::Instance()->IsOptedIn() )
{
return;
}
std::string type = GetSentryBreadCrumbType( aType );
sentry_value_t crumb = sentry_value_new_breadcrumb( type.c_str(), aMsg.c_str() );
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( aCategory.c_str() ) );
if( aType == BREADCRUMB_TYPE::ERR )
{
std::string level = GetSentryBreadCrumbLevel( aLevel );
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( level.c_str() ) );
}
sentry_add_breadcrumb( crumb );
#endif
}
void AddNavigationBreadcrumb( const wxString& aMsg, const wxString& aCategory )
{
#ifdef KICAD_USE_SENTRY
AddBreadcrumb( BREADCRUMB_TYPE::NAVIGATION, aMsg, aCategory, BREADCRUMB_LEVEL::INFO );
#endif
}
void AddTransactionBreadcrumb( const wxString& aMsg, const wxString& aCategory )
{
#ifdef KICAD_USE_SENTRY
AddBreadcrumb( BREADCRUMB_TYPE::TRANSACTION, aMsg, aCategory, BREADCRUMB_LEVEL::INFO );
#endif
}
#ifdef KICAD_USE_SENTRY
class TRANSACTION_IMPL
{
public:
TRANSACTION_IMPL( const std::string& aName, const std::string& aOperation )
{
m_ctx = sentry_transaction_context_new( aName.c_str(), aOperation.c_str() );
}
~TRANSACTION_IMPL() {
Finish();
// note m_ctx is handled by sentry
}
void Start()
{
m_tx = sentry_transaction_start( m_ctx, sentry_value_new_null() );
}
void Finish()
{
FinishSpan();
if( m_tx )
{
sentry_transaction_finish( m_tx );
m_tx = nullptr;
}
}
void StartSpan( const std::string& aOperation, const std::string& aDescription )
{
if( m_span )
return;
if( !m_tx )
return;
m_span = sentry_transaction_start_child( m_tx, aOperation.c_str(), aDescription.c_str() );
}
void FinishSpan()
{
if( m_span )
{
sentry_span_finish( m_span );
m_span = nullptr;
}
}
private:
sentry_transaction_context_t* m_ctx = nullptr;
sentry_transaction_t* m_tx = nullptr;
sentry_span_t* m_span = nullptr;
};
#endif
}
TRANSACTION::TRANSACTION( const std::string& aName, const std::string& aOperation )
{
#ifdef KICAD_USE_SENTRY
if( SENTRY::Instance()->IsOptedIn() )
{
m_impl = new TRANSACTION_IMPL( aName, aOperation );
}
#endif
}
TRANSACTION::~TRANSACTION()
{
#ifdef KICAD_USE_SENTRY
delete m_impl;
#endif
}
void TRANSACTION::Start()
{
#ifdef KICAD_USE_SENTRY
if( m_impl )
{
m_impl->Start();
}
#endif
}
void TRANSACTION::StartSpan( const std::string& aOperation, const std::string& aDescription )
{
#ifdef KICAD_USE_SENTRY
if( m_impl )
{
m_impl->StartSpan( aOperation, aDescription );
}
#endif
}
void TRANSACTION::Finish()
{
#ifdef KICAD_USE_SENTRY
if( m_impl )
{
m_impl->Finish();
}
#endif
}
void TRANSACTION::FinishSpan()
{
#ifdef KICAD_USE_SENTRY
if( m_impl )
{
m_impl->FinishSpan();
}
#endif
}
+1
View File
@@ -134,6 +134,7 @@ void ARRAY_AXIS::SetStep( int aStep )
wxString ARRAY_AXIS::GetItemNumber( int n ) const
{
wxString itemNum;
const wxString& alphabet = GetAlphabet();
const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( m_type );
-5
View File
@@ -133,11 +133,6 @@ ARRAY_OPTIONS::TRANSFORM ARRAY_CIRCULAR_OPTIONS::GetTransform( int n, const VECT
// n'th step
angle = EDA_ANGLE( m_angle.AsDegrees() * n, DEGREES_T );
angle += m_angleOffset;
if( m_clockwise )
angle = -angle;
VECTOR2I new_pos = aPos;
RotatePoint( new_pos, m_centre, angle );
+5 -4
View File
@@ -173,10 +173,9 @@ private:
BACKGROUND_JOB_REPORTER::BACKGROUND_JOB_REPORTER( BACKGROUND_JOBS_MONITOR* aMonitor,
const std::shared_ptr<BACKGROUND_JOB>& aJob ) :
std::shared_ptr<BACKGROUND_JOB> aJob ) :
PROGRESS_REPORTER_BASE( 1 ),
m_monitor( aMonitor ),
m_job( aJob )
m_monitor( aMonitor ), m_job( aJob )
{
}
@@ -306,8 +305,10 @@ void BACKGROUND_JOBS_MONITOR::ShowList( wxWindow* aParent, wxPoint aPos )
std::shared_lock<std::shared_mutex> lock( m_mutex, std::try_to_lock );
for( const std::shared_ptr<BACKGROUND_JOB>& job : m_jobs )
for( std::shared_ptr<BACKGROUND_JOB> job : m_jobs )
{
list->Add( job );
}
lock.unlock();
-10
View File
@@ -102,8 +102,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_16.png" ), 16, wxT( "light" ) );
@@ -187,8 +185,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_dark_16.png" ), 16, wxT( "dark" ) );
@@ -272,8 +268,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_32.png" ), 32, wxT( "light" ) );
@@ -357,8 +351,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_dark_32.png" ), 32, wxT( "dark" ) );
@@ -4901,7 +4893,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::color_code_tolerance].emplace_back( BITMAPS::color_code_tolerance, wxT( "color_code_tolerance.png" ), -1, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::color_code_value].emplace_back( BITMAPS::color_code_value, wxT( "color_code_value.png" ), -1, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::color_code_value_and_name].emplace_back( BITMAPS::color_code_value_and_name, wxT( "color_code_value_and_name.png" ), -1, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::coupled_stripline].emplace_back( BITMAPS::coupled_stripline, wxT( "coupled_stripline.png" ), -1, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::creepage_clearance].emplace_back( BITMAPS::creepage_clearance, wxT( "creepage_clearance.png" ), -1, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cpw].emplace_back( BITMAPS::cpw, wxT( "cpw.png" ), -1, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cpw_back].emplace_back( BITMAPS::cpw_back, wxT( "cpw_back.png" ), -1, wxT( "light" ) );
@@ -4937,7 +4928,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::color_code_tolerance].emplace_back( BITMAPS::color_code_tolerance, wxT( "color_code_tolerance_dark.png" ), -1, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::color_code_value].emplace_back( BITMAPS::color_code_value, wxT( "color_code_value_dark.png" ), -1, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::color_code_value_and_name].emplace_back( BITMAPS::color_code_value_and_name, wxT( "color_code_value_and_name_dark.png" ), -1, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::coupled_stripline].emplace_back( BITMAPS::coupled_stripline, wxT( "coupled_stripline_dark.png" ), -1, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::creepage_clearance].emplace_back( BITMAPS::creepage_clearance, wxT( "creepage_clearance_dark.png" ), -1, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cpw].emplace_back( BITMAPS::cpw, wxT( "cpw_dark.png" ), -1, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cpw_back].emplace_back( BITMAPS::cpw_back, wxT( "cpw_back_dark.png" ), -1, wxT( "dark" ) );
+14 -28
View File
@@ -31,7 +31,6 @@
#include <build_version.h>
#include <tuple>
#include <mutex>
// kicad_curl.h must be included before wx headers, to avoid
// conflicts for some defines, at least on Windows
@@ -52,9 +51,6 @@ extern std::string GetCurlLibVersion();
#include <kicad_build_version.h>
#undef INCLUDE_KICAD_VERSION
// Mutex for wxPlatformInfo
static std::recursive_mutex s_platformInfoMutex;
// Remember OpenGL info
static wxString s_glVendor;
static wxString s_glRenderer;
@@ -70,10 +66,8 @@ void SetOpenGLInfo( const char* aVendor, const char* aRenderer, const char* aVer
wxString GetPlatformGetBitnessName()
{
// wxPlatformInfo is not thread-safe, so protect it
std::unique_lock lock(s_platformInfoMutex);
return wxPlatformInfo().GetBitnessName();
wxPlatformInfo platform;
return platform.GetBitnessName();
}
@@ -163,6 +157,7 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
#endif
<< " build";
wxPlatformInfo platform;
aMsg << "Application: " << aTitle;
aMsg << " " << wxGetCpuArchitectureName() << " on " << wxGetNativeCpuArchitectureName();
@@ -192,19 +187,14 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
// Linux uses the lsb-release program to get the description of the OS, if lsb-release
// isn't installed, then the string will be empty and we fallback to the method used on
// the other platforms (to at least get the kernel/uname info).
if( osDescription.empty() )
osDescription = wxGetOsDescription();
if( osDescription.empty() )
osDescription = wxGetOsDescription();
{
// wxPlatformInfo is not thread-safe, so protect it
std::unique_lock lock( s_platformInfoMutex );
aMsg << "Platform: "
<< osDescription << ", "
<< GetPlatformGetBitnessName() << ", "
<< wxPlatformInfo().GetEndiannessName() << ", "
<< wxPlatformInfo().GetPortIdName();
}
aMsg << "Platform: "
<< osDescription << ", "
<< GetPlatformGetBitnessName() << ", "
<< platform.GetEndiannessName() << ", "
<< platform.GetPortIdName();
#ifdef __WXGTK__
if( wxTheApp && wxTheApp->IsGUI() )
@@ -250,15 +240,11 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
// Get the GTK+ version where possible.
#ifdef __WXGTK__
{
// wxPlatformInfo is not thread-safe, so protect it
std::unique_lock lock( s_platformInfoMutex );
int major, minor;
int major, minor;
major = wxPlatformInfo().GetToolkitMajorVersion();
minor = wxPlatformInfo().GetToolkitMinorVersion();
aMsg << " GTK+ " << major << "." << minor;
}
major = wxPlatformInfo().Get().GetToolkitMajorVersion();
minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
aMsg << " GTK+ " << major << "." << minor;
#endif
aMsg << eol;
+1 -69
View File
@@ -26,12 +26,6 @@
#include <wx/clipbrd.h>
#include <wx/image.h>
#include <wx/log.h>
#include <wx/string.h>
#include <wx/sstream.h>
#include <sstream>
#include <io/csv.h>
bool SaveClipboard( const std::string& aTextUTF8 )
@@ -112,66 +106,4 @@ std::unique_ptr<wxImage> GetImageFromClipboard()
}
return image;
}
bool SaveTabularDataToClipboard( const std::vector<std::vector<wxString>>& aData )
{
wxLogNull doNotLog; // disable logging of failed clipboard actions
if( wxTheClipboard->Open() )
{
wxDataObjectComposite* data = new wxDataObjectComposite();
// Set plain text CSV
{
wxStringOutputStream os;
CSV_WRITER writer( os );
writer.WriteLines( aData );
data->Add( new wxTextDataObject( os.GetString() ), true );
}
// At this point, it would be great if we could add some format that spreadsheet
// programs can understand without asking the user for options: perhaps SYLK or DIF.
// But it doesn't seem like WX allows to put arbitrary MIME types on the clipboard,
// even with wxCustomDataObject( wxDataFormat( "mime/type" ) ), which just ends up as
// wxDF_PRIVATE, and wxDF_SYLK/DIF aren't mapped on GTK.
wxTheClipboard->SetData( data );
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
wxTheClipboard->Close();
return true;
}
return false;
}
bool GetTabularDataFromClipboard( std::vector<std::vector<wxString>>& aData )
{
// Again, it would be ideal if we could detect a spreadsheet mimetype here,
// but WX doesn't seem to do that on Linux, at least.
bool ok = false;
// First try for text data
if( wxTheClipboard->Open() )
{
if( wxTheClipboard->IsSupported( wxDF_TEXT ) )
{
wxTextDataObject data;
if( wxTheClipboard->GetData( data ) )
{
ok = AutoDecodeCSV( data.GetText(), aData );
}
}
// We could also handle .csv wxDF_FILENAMEs here
wxTheClipboard->Close();
}
return ok;
}
}
+28 -13
View File
@@ -28,7 +28,6 @@
#include <core/kicad_algo.h>
#include <commit.h>
#include <eda_item.h>
#include <eda_group.h>
#include <macros.h>
COMMIT::COMMIT()
@@ -39,12 +38,14 @@ COMMIT::COMMIT()
COMMIT::~COMMIT()
{
for( COMMIT_LINE& ent : m_changes )
delete ent.m_copy;
{
if( ent.m_copy )
delete ent.m_copy;
}
}
COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aScreen,
RECURSE_MODE aRecurse )
COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aScreen )
{
// CHT_MODIFY and CHT_DONE are not compatible
wxASSERT( ( aChangeType & ( CHT_MODIFY | CHT_DONE ) ) != ( CHT_MODIFY | CHT_DONE ) );
@@ -55,25 +56,32 @@ COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aS
{
case CHT_ADD:
makeEntry( aItem, CHT_ADD | flag, nullptr, aScreen );
break;
return *this;
case CHT_REMOVE:
wxASSERT( m_deletedItems.find( aItem ) == m_deletedItems.end() );
m_deletedItems.insert( aItem );
makeEntry( aItem, CHT_REMOVE | flag, makeImage( aItem ), aScreen );
if( EDA_GROUP* parentGroup = aItem->GetParentGroup() )
Modify( parentGroup->AsEdaItem(), aScreen, RECURSE_MODE::NO_RECURSE );
break;
makeEntry( aItem, CHT_REMOVE | flag, nullptr, aScreen );
return *this;
case CHT_MODIFY:
{
EDA_ITEM* parent = parentObject( aItem );
createModified( parent, makeImage( parent ), flag, aScreen );
EDA_ITEM* clone = makeImage( parent );
wxASSERT( clone );
if( clone )
return createModified( parent, clone, flag, aScreen );
break;
}
case CHT_GROUP:
case CHT_UNGROUP:
makeEntry( aItem, aChangeType, nullptr, aScreen );
return *this;
default:
wxFAIL;
}
@@ -83,7 +91,7 @@ COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aS
COMMIT& COMMIT::Stage( std::vector<EDA_ITEM*> &container, CHANGE_TYPE aChangeType,
BASE_SCREEN *aScreen )
BASE_SCREEN *aScreen )
{
for( EDA_ITEM* item : container )
Stage( item, aChangeType, aScreen);
@@ -146,6 +154,9 @@ COMMIT& COMMIT::createModified( EDA_ITEM* aItem, EDA_ITEM* aCopy, int aExtraFlag
void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BASE_SCREEN *aScreen )
{
// Expect an item copy if it is going to be modified
wxASSERT( !!aCopy == ( ( aType & CHT_TYPE ) == CHT_MODIFY ) );
COMMIT_LINE ent;
ent.m_item = aItem;
@@ -179,6 +190,8 @@ CHANGE_TYPE COMMIT::convert( UNDO_REDO aType ) const
{
case UNDO_REDO::NEWITEM: return CHT_ADD;
case UNDO_REDO::DELETED: return CHT_REMOVE;
case UNDO_REDO::REGROUP: return CHT_GROUP;
case UNDO_REDO::UNGROUP: return CHT_UNGROUP;
case UNDO_REDO::CHANGED: return CHT_MODIFY;
default: wxASSERT( false ); return CHT_MODIFY;
}
@@ -191,6 +204,8 @@ UNDO_REDO COMMIT::convert( CHANGE_TYPE aType ) const
{
case CHT_ADD: return UNDO_REDO::NEWITEM;
case CHT_REMOVE: return UNDO_REDO::DELETED;
case CHT_GROUP: return UNDO_REDO::REGROUP;
case CHT_UNGROUP: return UNDO_REDO::UNGROUP;
case CHT_MODIFY: return UNDO_REDO::CHANGED;
default: wxASSERT( false ); return UNDO_REDO::CHANGED;
}
+2 -2
View File
@@ -40,7 +40,7 @@
#include <wx/regex.h>
#ifdef _WIN32
#include <windows.h>
#include <Windows.h>
#endif
@@ -433,7 +433,7 @@ wxString EnsureFileExtension( const wxString& aFilename, const wxString& aExtens
// extension, such as "Schematic_1.1".
if( newFilename.Lower().AfterLast( '.' ) != aExtension )
{
if( !newFilename.EndsWith( '.' ) )
if( newFilename.Last() != '.' )
newFilename.Append( '.' );
newFilename.Append( aExtension );
+23 -25
View File
@@ -31,6 +31,8 @@
#include <wx/msgdlg.h>
#include <wx/choicdlg.h>
#include <wx/crt.h>
/**
* Flag to enable confirmation dialog debugging output.
*
@@ -51,7 +53,7 @@ bool AskOverrideLock( wxWindow* aParent, const wxString& aMessage )
+ wxS( "\n" ) );
dlg.SetYesNoLabels( _( "&Cancel" ), _( "&Open Anyway" ) );
#else
KICAD_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, _( "File Open Warning" ),
wxMessageDialog dlg( aParent, aMessage, _( "File Open Warning" ),
wxYES_NO | wxICON_ERROR | wxCENTER );
dlg.SetExtendedMessage( _( "Interleaved saves may produce very unexpected results." ) );
dlg.SetYesNoLabels( _( "&Cancel" ), _( "&Open Anyway" ) );
@@ -65,9 +67,8 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage, bool* aApp
{
static bool s_apply_to_all = false;
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( parent, aMessage, _( "Save Changes?" ),
wxYES_NO | wxCANCEL |
wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
wxRichMessageDialog dlg( parent, aMessage, _( "Save Changes?" ),
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." )
+ wxS( "\n" ) );
dlg.SetYesNoLabels( _( "&Save" ), _( "&Discard Changes" ) );
@@ -104,7 +105,7 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
wxWindowDisabler disable( true );
#endif
KICAD_MESSAGE_DIALOG_BASE dlg( parent, aMessage, _( "Save Changes?" ),
wxMessageDialog dlg( parent, aMessage, _( "Save Changes?" ),
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
dlg.SetYesNoLabels( _( "&Save" ), _( "&Discard Changes" ) );
@@ -117,8 +118,8 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage )
{
KICAD_MESSAGE_DIALOG_BASE dlg( parent, aMessage, wxEmptyString,
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
wxMessageDialog dlg( parent, aMessage, wxEmptyString,
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.SetExtendedMessage( _( "Your current changes will be permanently lost." ) );
dlg.SetOKCancelLabels( _( "&Revert" ), _( "&Cancel" ) );
@@ -143,8 +144,8 @@ int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxStrin
const wxString& aDetailedMessage, const wxString& aOKLabel,
const wxString& aCancelLabel, bool* aApplyToAll )
{
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, aWarning,
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
wxRichMessageDialog dlg( aParent, aMessage, aWarning,
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.SetOKCancelLabels( ( aOKLabel.IsEmpty() ) ? _( "&OK" ) : aOKLabel,
( aCancelLabel.IsEmpty() ) ? _( "&Cancel" ) : aCancelLabel );
@@ -166,7 +167,7 @@ int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxStrin
// DisplayError should be deprecated, use DisplayErrorMessage instead
void DisplayError( wxWindow* aParent, const wxString& aText )
void DisplayError( wxWindow* aParent, const wxString& aText, int aDisplayTime )
{
if( !wxTheApp || !wxTheApp->IsMainLoopRunning() )
{
@@ -180,11 +181,11 @@ void DisplayError( wxWindow* aParent, const wxString& aText )
return;
}
KICAD_MESSAGE_DIALOG_BASE* dlg;
wxMessageDialog* dlg;
int icon = aDisplayTime > 0 ? wxICON_INFORMATION : wxICON_ERROR;
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aText, _( "Error" ),
wxOK | wxCENTRE | wxRESIZE_BORDER |
wxICON_ERROR | wxSTAY_ON_TOP );
dlg = new wxMessageDialog( aParent, aText, _( "Warning" ),
wxOK | wxCENTRE | wxRESIZE_BORDER | icon | wxSTAY_ON_TOP );
dlg->ShowModal();
dlg->Destroy();
@@ -205,11 +206,10 @@ void DisplayErrorMessage( wxWindow* aParent, const wxString& aText, const wxStri
return;
}
KICAD_MESSAGE_DIALOG_BASE* dlg;
wxMessageDialog* dlg;
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aText, _( "Error" ),
wxOK | wxCENTRE | wxRESIZE_BORDER |
wxICON_ERROR | wxSTAY_ON_TOP );
dlg = new wxMessageDialog( aParent, aText, _( "Error" ),
wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_ERROR | wxSTAY_ON_TOP );
if( !aExtraInfo.IsEmpty() )
dlg->SetExtendedMessage( aExtraInfo );
@@ -233,12 +233,11 @@ void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxSt
return;
}
KICAD_MESSAGE_DIALOG_BASE* dlg;
wxMessageDialog* dlg;
int icon = wxICON_INFORMATION;
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aMessage, _( "Information" ),
wxOK | wxCENTRE | wxRESIZE_BORDER |
icon | wxSTAY_ON_TOP );
dlg = new wxMessageDialog( aParent, aMessage, _( "Information" ),
wxOK | wxCENTRE | wxRESIZE_BORDER | icon | wxSTAY_ON_TOP );
if( !aExtraInfo.IsEmpty() )
dlg->SetExtendedMessage( aExtraInfo );
@@ -264,9 +263,8 @@ bool IsOK( wxWindow* aParent, const wxString& aMessage )
#endif
#if !defined( __WXGTK__ )
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, _( "Confirmation" ),
wxOK | wxCANCEL | wxOK_DEFAULT |
wxCENTRE | icon | wxSTAY_ON_TOP );
wxRichMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
wxOK | wxCANCEL | wxOK_DEFAULT | wxCENTRE | icon | wxSTAY_ON_TOP );
#else
wxMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
wxOK | wxCANCEL | wxOK_DEFAULT | wxCENTRE | icon | wxSTAY_ON_TOP );
+1 -1
View File
@@ -33,7 +33,7 @@
const int dblibSchemaVersion = 1;
DATABASE_FIELD_MAPPING::DATABASE_FIELD_MAPPING( const std::string& aColumn, const std::string& aName,
DATABASE_FIELD_MAPPING::DATABASE_FIELD_MAPPING( std::string aColumn, std::string aName,
bool aVisibleOnAdd, bool aVisibleInChooser,
bool aShowName, bool aInheritProperties ) :
column( aColumn ),
+2 -12
View File
@@ -21,10 +21,6 @@
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef DESIGN_BLOCK_H
#define DESIGN_BLOCK_H
#include <kicommon.h>
#include <lib_id.h>
#include <json_common.h>
@@ -45,9 +41,6 @@ public:
const wxString& GetSchematicFile() const { return m_schematicFile; }
void SetSchematicFile( const wxString& aFile ) { m_schematicFile = aFile; }
const wxString& GetBoardFile() const { return m_boardFile; }
void SetBoardFile( const wxString& aFile ) { m_boardFile = aFile; }
void SetFields( nlohmann::ordered_map<wxString, wxString>& aFields )
{
m_fields = std::move( aFields );
@@ -62,12 +55,9 @@ public:
private:
LIB_ID m_lib_id;
wxString m_schematicFile; ///< File name and path for schematic file.
wxString m_boardFile; ///< File name and path for board file
wxString m_schematicFile; ///< File name and path for schematic symbol.
wxString m_libDescription; ///< File name and path for documentation file.
wxString m_keywords; ///< Search keywords to find design block in library.
wxString m_keywords; ///< Search keywords to find footprint in library.
nlohmann::ordered_map<wxString, wxString> m_fields;
};
#endif
+5 -2
View File
@@ -21,9 +21,11 @@
#include <design_block_info_impl.h>
#include <design_block.h>
#include <design_block_info.h>
#include <design_block_lib_table.h>
#include <kiway.h>
#include <locale_io.h>
#include <lib_id.h>
#include <progress_reporter.h>
#include <string_utils.h>
#include <thread_pool.h>
@@ -31,6 +33,7 @@
#include <kiplatform/io.h>
#include <wx/textfile.h>
#include <wx/txtstrm.h>
#include <wx/wfstream.h>
@@ -41,8 +44,7 @@ void DESIGN_BLOCK_INFO_IMPL::load()
wxASSERT( dbtable );
std::unique_ptr<const DESIGN_BLOCK> design_block( dbtable->GetEnumeratedDesignBlock( m_nickname,
m_dbname ) );
const DESIGN_BLOCK* design_block = dbtable->GetEnumeratedDesignBlock( m_nickname, m_dbname );
if( design_block )
{
@@ -126,6 +128,7 @@ bool DESIGN_BLOCK_LIST_IMPL::ReadDesignBlockFiles( DESIGN_BLOCK_LIB_TABLE* aTabl
m_queue.push( nickname );
}
if( m_progress_reporter )
{
m_progress_reporter->SetMaxProgress( (int) m_queue.size() );
+20 -71
View File
@@ -267,9 +267,7 @@ void DESIGN_BLOCK_IO::DesignBlockEnumerate( wxArrayString& aDesignBlockNames,
wxDir dir( aLibraryPath );
if( !dir.IsOpened() )
{
THROW_IO_ERROR( wxString::Format( _( "Design block '%s' does not exist." ), aLibraryPath ) );
}
return;
wxString dirname;
wxString fileSpec = wxT( "*." ) + wxString( FILEEXT::KiCadDesignBlockPathExtension );
@@ -291,23 +289,17 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
+ FILEEXT::KiCadDesignBlockPathExtension + wxFileName::GetPathSeparator();
wxString dbSchPath = dbPath + aDesignBlockName + wxT( "." )
+ FILEEXT::KiCadSchematicFileExtension;
wxString dbPcbPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::KiCadPcbFileExtension;
wxString dbMetadataPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::JsonFileExtension;
if( !wxDir::Exists( dbPath ) )
THROW_IO_ERROR( wxString::Format( _( "Design block '%s' does not exist." ), dbPath ) );
if( !wxFileExists( dbSchPath ) )
return nullptr;
DESIGN_BLOCK* newDB = new DESIGN_BLOCK();
// Library name needs to be empty for when we fill it in with the correct library nickname
// one layer above
newDB->SetLibId( LIB_ID( wxEmptyString, aDesignBlockName ) );
if( wxFileExists( dbSchPath ) )
newDB->SetSchematicFile( dbSchPath );
if( wxFileExists( dbPcbPath ) )
newDB->SetBoardFile( dbPcbPath );
newDB->SetSchematicFile( dbSchPath );
// Parse the JSON file if it exists
if( wxFileExists( dbMetadataPath ) )
@@ -343,27 +335,16 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
}
catch( ... )
{
delete newDB;
THROW_IO_ERROR( wxString::Format(
_( "Design block metadata file '%s' could not be read." ), dbMetadataPath ) );
}
}
return newDB;
}
bool DESIGN_BLOCK_IO::DesignBlockExists( const wxString& aLibraryPath,
const wxString& aDesignBlockName,
const std::map<std::string, UTF8>* aProperties )
{
wxString dbPath = aLibraryPath + wxFileName::GetPathSeparator() + aDesignBlockName + wxT( "." )
+ FILEEXT::KiCadDesignBlockPathExtension + wxFileName::GetPathSeparator();
return wxDir::Exists( dbPath );
}
void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibraryPath,
const DESIGN_BLOCK* aDesignBlock,
const std::map<std::string, UTF8>* aProperties )
@@ -374,23 +355,12 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
THROW_IO_ERROR( _( "Design block does not have a valid library ID." ) );
}
if( aDesignBlock->GetSchematicFile().IsEmpty() && aDesignBlock->GetBoardFile().IsEmpty() )
{
THROW_IO_ERROR( _( "Design block does not have a schematic or board file." ) );
}
wxFileName schematicFile( aDesignBlock->GetSchematicFile() );
wxFileName boardFile( aDesignBlock->GetBoardFile() );
if( !aDesignBlock->GetSchematicFile().IsEmpty() && !schematicFile.FileExists() )
if( !schematicFile.FileExists() )
{
THROW_IO_ERROR(
wxString::Format( _( "Schematic source file '%s' does not exist." ), schematicFile.GetFullPath() ) );
}
if( !aDesignBlock->GetBoardFile().IsEmpty() && !boardFile.FileExists() )
{
THROW_IO_ERROR( wxString::Format( _( "Board source file '%s' does not exist." ), boardFile.GetFullPath() ) );
THROW_IO_ERROR( wxString::Format( _( "Schematic source file '%s' does not exist." ),
schematicFile.GetFullPath() ) );
}
// Create the design block folder
@@ -408,44 +378,23 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
}
}
if( !aDesignBlock->GetSchematicFile().IsEmpty() )
{
// The new schematic file name is based on the design block name, not the source sheet name
wxString dbSchematicFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName() + wxT( "." )
+ FILEEXT::KiCadSchematicFileExtension;
// The new schematic file name is based on the design block name, not the source sheet name
wxString dbSchematicFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName()
+ wxT( "." ) + FILEEXT::KiCadSchematicFileExtension;
// If the source and destination files are the same, then we don't need to copy the file
// as we are just updating the metadata
if( schematicFile.GetFullPath() != dbSchematicFile )
// If the source and destination files are the same, then we don't need to copy the file
// as we are just updating the metadata
if( schematicFile.GetFullPath() != dbSchematicFile )
{
// Copy the source sheet file to the design block folder, under the design block name
if( !wxCopyFile( schematicFile.GetFullPath(), dbSchematicFile ) )
{
// Copy the source sheet file to the design block folder, under the design block name
if( !wxCopyFile( schematicFile.GetFullPath(), dbSchematicFile ) )
{
THROW_IO_ERROR(
wxString::Format( _( "Schematic file '%s' could not be saved as design block at '%s'." ),
schematicFile.GetFullPath(), dbSchematicFile ) );
}
THROW_IO_ERROR( wxString::Format(
_( "Schematic file '%s' could not be saved as design block at '%s'." ),
schematicFile.GetFullPath(), dbSchematicFile ) );
}
}
if( !aDesignBlock->GetBoardFile().IsEmpty() )
{
// The new Board file name is based on the design block name, not the source sheet name
wxString dbBoardFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName() + wxT( "." )
+ FILEEXT::KiCadPcbFileExtension;
// If the source and destination files are the same, then we don't need to copy the file
// as we are just updating the metadata
if( boardFile.GetFullPath() != dbBoardFile )
{
// Copy the source sheet file to the design block folder, under the design block name
if( !wxCopyFile( boardFile.GetFullPath(), dbBoardFile ) )
{
THROW_IO_ERROR( wxString::Format( _( "Board file '%s' could not be saved as design block at '%s'." ),
boardFile.GetFullPath(), dbBoardFile ) );
}
}
}
wxString dbMetadataFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName()
+ wxT( "." ) + FILEEXT::JsonFileExtension;
+4 -1
View File
@@ -76,7 +76,10 @@ public:
}
bool DesignBlockExists( const wxString& aLibraryPath, const wxString& aDesignBlockName,
const std::map<std::string, UTF8>* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr )
{
return DesignBlockLoad( aLibraryPath, aDesignBlockName, true, aProperties ) != nullptr;
}
DESIGN_BLOCK* ImportDesignBlock( const wxString& aDesignBlockPath,
wxString& aDesignBlockNameOut,
+17 -28
View File
@@ -73,23 +73,6 @@ void DESIGN_BLOCK_LIB_TABLE_ROW::SetType( const wxString& aType )
}
bool DESIGN_BLOCK_LIB_TABLE_ROW::Refresh()
{
if( !plugin )
{
wxArrayString dummyList;
plugin.reset( DESIGN_BLOCK_IO_MGR::FindPlugin( type ) );
SetLoaded( false );
plugin->DesignBlockEnumerate( dummyList, GetFullURI( true ), true, GetProperties() );
SetLoaded( true );
return true;
}
return false;
}
DESIGN_BLOCK_LIB_TABLE::DESIGN_BLOCK_LIB_TABLE( DESIGN_BLOCK_LIB_TABLE* aFallBackTable ) :
LIB_TABLE( aFallBackTable )
{
@@ -450,7 +433,7 @@ DESIGN_BLOCK_LIB_TABLE::DesignBlockSave( const wxString& aNickname,
std::unique_ptr<DESIGN_BLOCK> design_block( row->plugin->DesignBlockLoad(
row->GetFullURI( true ), DesignBlockname, row->GetProperties() ) );
if( design_block )
if( design_block.get() )
return SAVE_SKIPPED;
}
@@ -554,11 +537,13 @@ public:
// consider a directory to be a lib if it's name ends with the design block lib dir
// extension it is under $KICADn_3RD_PARTY/design_blocks/<pkgid>/ i.e. has nested
// level of at least +3.
if( dirPath.EndsWith( wxString::Format( wxS( ".%s" ), FILEEXT::KiCadDesignBlockLibPathExtension ) )
if( dirPath.EndsWith( wxString::Format( wxS( ".%s" ),
FILEEXT::KiCadDesignBlockLibPathExtension ) )
&& dir.GetDirCount() >= m_prefix_dir_count + 3 )
{
wxString versionedPath;
versionedPath.Printf( wxS( "${%s}" ), ENV_VAR::GetVersionedEnvVarName( wxS( "3RD_PARTY" ) ) );
versionedPath.Printf( wxS( "${%s}" ),
ENV_VAR::GetVersionedEnvVarName( wxS( "3RD_PARTY" ) ) );
wxArrayString parts = dir.GetDirs();
parts.RemoveAt( 0, m_prefix_dir_count );
@@ -587,9 +572,9 @@ public:
} while( m_lib_table.HasLibrary( nickname ) );
}
m_lib_table.InsertRow( new DESIGN_BLOCK_LIB_TABLE_ROW( nickname, libPath, wxT( "KiCad" ),
wxEmptyString,
_( "Added by Plugin and Content Manager" ) ) );
m_lib_table.InsertRow( new DESIGN_BLOCK_LIB_TABLE_ROW(
nickname, libPath, wxT( "KiCad" ), wxEmptyString,
_( "Added by Plugin and Content Manager" ) ) );
}
}
@@ -626,7 +611,8 @@ bool DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable( DESIGN_BLOCK_LIB_TABLE& aTable )
SystemDirsAppend( &ss );
const ENV_VAR_MAP& envVars = Pgm().GetLocalEnvVariables();
std::optional<wxString> v = ENV_VAR::GetVersionedEnvVarValue( envVars, wxT( "TEMPLATE_DIR" ) );
std::optional<wxString> v = ENV_VAR::GetVersionedEnvVarValue( envVars,
wxT( "TEMPLATE_DIR" ) );
if( v && !v->IsEmpty() )
ss.AddPaths( *v, 0 );
@@ -645,14 +631,16 @@ bool DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable( DESIGN_BLOCK_LIB_TABLE& aTable )
aTable.clear();
aTable.Load( fn.GetFullPath() );
KICAD_SETTINGS* cfg = GetAppSettings<KICAD_SETTINGS>( "kicad" );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
KICAD_SETTINGS* settings = mgr.GetAppSettings<KICAD_SETTINGS>( "kicad" );
const ENV_VAR_MAP& env = Pgm().GetLocalEnvVariables();
wxString packagesPath;
if( std::optional<wxString> v = ENV_VAR::GetVersionedEnvVarValue( env, wxT( "3RD_PARTY" ) ) )
packagesPath = *v;
if( cfg && cfg->m_PcmLibAutoAdd )
if( settings->m_PcmLibAutoAdd )
{
// Scan for libraries in PCM packages directory
@@ -661,14 +649,15 @@ bool DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable( DESIGN_BLOCK_LIB_TABLE& aTable )
if( d.DirExists() )
{
PCM_DESIGN_BLOCK_LIB_TRAVERSER traverser( packagesPath, aTable, cfg->m_PcmLibPrefix );
PCM_DESIGN_BLOCK_LIB_TRAVERSER traverser( packagesPath, aTable,
settings->m_PcmLibPrefix );
wxDir dir( d.GetPath() );
dir.Traverse( traverser );
}
}
if( cfg && cfg->m_PcmLibAutoRemove )
if( settings->m_PcmLibAutoRemove )
{
// Remove PCM libraries that no longer exist
std::vector<wxString> to_remove;
+2 -14
View File
@@ -23,7 +23,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <app_monitor.h>
#include <dialog_shim.h>
#include <core/ignore.h>
#include <kiway_player.h>
@@ -112,9 +111,6 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
#endif
Bind( wxEVT_PAINT, &DIALOG_SHIM::OnPaint, this );
wxString msg = wxString::Format( "Opening dialog %s", GetTitle() );
APP_MONITOR::AddNavigationBreadcrumb( msg, "dialog.open" );
}
@@ -569,6 +565,8 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
m_qmodal_loop->Exit( 0 );
else
m_qmodal_loop->ScheduleExit( 0 );
m_qmodal_loop = nullptr;
}
delete m_qmodal_parent_disabler;
@@ -580,9 +578,6 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
void DIALOG_SHIM::OnCloseWindow( wxCloseEvent& aEvent )
{
wxString msg = wxString::Format( "Closing dialog %s", GetTitle() );
APP_MONITOR::AddNavigationBreadcrumb( msg, "dialog.close" );
if( IsQuasiModal() )
{
EndQuasiModal( wxID_CANCEL );
@@ -665,13 +660,6 @@ void DIALOG_SHIM::OnCharHook( wxKeyEvent& aEvt )
if( wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( eventSource ) )
{
// If the text control is not multi-line, we want to close the dialog
if( !textCtrl->IsMultiLine() )
{
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
return;
}
#if defined( __WXMAC__ ) || defined( __WXMSW__ )
wxString eol = "\r\n";
#else
+2 -4
View File
@@ -423,9 +423,8 @@ void DIALOG_COLOR_PICKER::drawRGBPalette()
// Use Y axis from bottom to top and origin to center
bitmapDC.SetAxisOrientation( true, true );
#if defined( __WXMSW__ ) && !wxCHECK_VERSION( 3, 3, 0 )
#if defined( __WXMSW__ )
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
// It was fixed in wx >= 3.3
bitmapDC.SetDeviceOrigin( half_size, -half_size );
#else
bitmapDC.SetDeviceOrigin( half_size, half_size );
@@ -497,9 +496,8 @@ void DIALOG_COLOR_PICKER::drawHSVPalette()
// Use Y axis from bottom to top and origin to center
bitmapDC.SetAxisOrientation( true, true );
#if defined( __WXMSW__ ) && !wxCHECK_VERSION(3,3,0)
#if defined( __WXMSW__)
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
// It was fixed in wx >= 3.3
bitmapDC.SetDeviceOrigin( half_size, -half_size );
#else
bitmapDC.SetDeviceOrigin( half_size, half_size );
@@ -82,6 +82,9 @@ DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS( wxWindow* aParent ) :
attr->SetEditor( new GRID_CELL_PATH_EDITOR( this, m_EnvVars, &m_curdir, wxEmptyString ) );
m_EnvVars->SetColAttr( TV_VALUE_COL, attr );
// Give a bit more room for combobox editors
m_EnvVars->SetDefaultRowSize( m_EnvVars->GetDefaultRowSize() + FromDIP( 4 ) );
m_EnvVars->PushEventHandler( new GRID_TRICKS( m_EnvVars,
[this]( wxCommandEvent& aEvent )
{
@@ -1,735 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="code_generation">C++</property>
<property name="cpp_class_decoration"></property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="file">dialog_group_properties_base</property>
<property name="first_id">1000</property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">dialog_group_properties</property>
<property name="path">.</property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="use_microsoft_bom">0</property>
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center">wxBOTH</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_GROUP_PROPERTIES_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Group Properties</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnClose">onClose</event>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizerUpper</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="true">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgSizer1</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Group name:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_nameLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_nameCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Library link:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_libraryLinkLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_libraryLink</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Locked</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_locked</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Prevents group from being moved on canvas</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Group members:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_membersLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxListBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices"></property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">360,200</property>
<property name="moveable">1</property>
<property name="name">m_membersList</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnListBox">OnMemberSelected</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bMembershipButtons</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">MyButton</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_bpAddMember</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnAddMember</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="spacer" expanded="true">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">10</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">MyButton</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_bpRemoveMember</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRemoveMember</event>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="true">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>
@@ -60,17 +60,11 @@ void DIALOG_LOCKED_ITEMS_QUERY::onOverrideLocks( wxCommandEvent& event )
int DIALOG_LOCKED_ITEMS_QUERY::ShowModal()
{
static int doNotShowValue = wxID_ANY;
if( doNotShowValue != wxID_ANY && m_lockingOptions.m_sessionSkipPrompts )
return doNotShowValue;
int ret = DIALOG_SHIM::ShowModal();
// Has the user asked not to show the dialog again this session?
if( m_doNotShowBtn->IsChecked() && ret != wxID_CANCEL )
{
doNotShowValue = ret;
m_lockingOptions.m_sessionSkipPrompts = true;
}
+16 -9
View File
@@ -474,16 +474,23 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
wxString msg;
wxString fileName = GetWksFileName();
wxString fullFileName = m_filenameResolver->ResolvePath( fileName, m_projectPath, { m_embeddedFiles } );
BASE_SCREEN::m_DrawingSheetFileName = fileName;
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( fullFileName, &msg ) )
if( fileName != BASE_SCREEN::m_DrawingSheetFileName )
{
DisplayErrorMessage( this, wxString::Format( _( "Error loading drawing sheet '%s'." ), fullFileName ), msg );
}
wxString fullFileName = m_filenameResolver->ResolvePath( fileName, m_projectPath,
{ m_embeddedFiles } );
m_localPrjConfigChanged = true;
BASE_SCREEN::m_DrawingSheetFileName = fileName;
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( fullFileName, &msg ) )
{
DisplayErrorMessage( this,
wxString::Format( _( "Error loading drawing sheet '%s'." ),
fullFileName ),
msg );
}
m_localPrjConfigChanged = true;
}
int idx = std::max( m_paperSizeComboBox->GetSelection(), 0 );
const wxString paperType = m_pageFmt[idx];
@@ -816,7 +823,7 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
if( m_embeddedFiles && customize.GetEmbed() )
{
fn.Assign( fileName );
EMBEDDED_FILES::EMBEDDED_FILE* result = m_embeddedFiles->AddFile( fn, true );
EMBEDDED_FILES::EMBEDDED_FILE* result = m_embeddedFiles->AddFile( fn, false );
shortFileName = result->GetLink();
fileName = m_embeddedFiles->GetTemporaryFileName( result->name ).GetFullPath();
}
+19 -12
View File
@@ -39,19 +39,22 @@
DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS( wxWindow* aParent,
const wxString& aNickname,
const std::map<std::string, UTF8>& aPluginOptions,
const wxString& aFormattedOptions,
wxString* aResult ) :
DIALOG_PLUGIN_OPTIONS_BASE( aParent ),
m_callers_options( aFormattedOptions ),
m_result( aResult ),
m_choices( aPluginOptions ),
m_initial_help( INITIAL_HELP ),
m_grid_widths_dirty( true )
const wxString& aNickname,
const std::map<std::string, UTF8>& aPluginOptions,
const wxString& aFormattedOptions,
wxString* aResult ) :
DIALOG_PLUGIN_OPTIONS_BASE( aParent ),
m_callers_options( aFormattedOptions ),
m_result( aResult ),
m_choices( aPluginOptions ),
m_initial_help( INITIAL_HELP ),
m_grid_widths_dirty( true )
{
SetTitle( wxString::Format( _( "Options for Library '%s'" ), aNickname ) );
// Give a bit more room for combobox editors
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
m_grid->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
// add Cut, Copy, and Paste to wxGrid
@@ -62,7 +65,8 @@ DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS( wxWindow* aParent,
{
unsigned int row = 0;
for( std::map<std::string, UTF8>::const_iterator it = m_choices.begin(); it != m_choices.end(); ++it, ++row )
for( std::map<std::string, UTF8>::const_iterator it = m_choices.begin();
it != m_choices.end(); ++it, ++row )
{
wxString item = From_UTF8( it->first.c_str() );
@@ -107,7 +111,8 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataToWindow()
int row = 0;
for( std::map<std::string, UTF8>::const_iterator it = props->begin(); it != props->end(); ++it, ++row )
for( std::map<std::string, UTF8>::const_iterator it = props->begin(); it != props->end();
++it, ++row )
{
m_grid->SetCellValue( row, 0, From_UTF8( it->first.c_str() ) );
m_grid->SetCellValue( row, 1, it->second );
@@ -137,7 +142,9 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataFromWindow()
UTF8 value = m_grid->GetCellValue( row, 1 ).Trim( false ).Trim();
if( name.size() )
{
props[name] = value;
}
}
*m_result = LIB_TABLE::FormatOptions( &props ).wx_str();
-19
View File
@@ -27,8 +27,6 @@
#include <wx/print.h>
#include <wx/printdlg.h>
#include <dialogs/panel_printer_list.h>
// Define min and max reasonable values for print scale
static constexpr double MIN_SCALE = 0.01;
static constexpr double MAX_SCALE = 100.0;
@@ -95,9 +93,6 @@ DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SE
m_scaleValidator.SetRange( 0.0, MAX_SCALE );
m_scaleCustomText->SetValidator( m_scaleValidator );
// Show m_panelPrinters only if there are printers to list:
m_panelPrinters->Show( m_panelPrinters->AsPrintersAvailable() );
SetupStandardButtons( { { wxID_OK, _( "Print" ) },
{ wxID_APPLY, _( "Print Preview" ) },
{ wxID_CANCEL, _( "Close" ) } } );
@@ -250,13 +245,6 @@ void DIALOG_PRINT_GENERIC::onPrintPreview( wxCommandEvent& event )
return;
}
wxString selectedPrinterName;
if( m_panelPrinters )
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
s_PrintData->SetPrinterName( selectedPrinterName );
// Pass two printout objects: for preview, and possible printing.
wxString title = _( "Print Preview" );
wxPrintPreview* preview =
@@ -308,13 +296,6 @@ void DIALOG_PRINT_GENERIC::onPrintButtonClick( wxCommandEvent& event )
return;
}
wxString selectedPrinterName;
if( m_panelPrinters )
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
s_PrintData->SetPrinterName( selectedPrinterName );
wxPrintDialogData printDialogData( *s_PrintData );
printDialogData.SetMaxPage( m_settings->m_pageCount );
@@ -5,8 +5,6 @@
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialogs/panel_printer_list.h"
#include "dialog_print_generic_base.h"
///////////////////////////////////////////////////////////////////////////
@@ -18,15 +16,6 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerPanelPrinters;
bSizerPanelPrinters = new wxBoxSizer( wxVERTICAL );
m_panelPrinters = new PANEL_PRINTER_LIST( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
bSizerPanelPrinters->Add( m_panelPrinters, 1, wxEXPAND | wxALL, 5 );
bMainSizer->Add( bSizerPanelPrinters, 0, wxEXPAND, 5 );
m_bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bRightCol;
@@ -65,75 +65,6 @@
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizerPanelPrinters</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_panelPrinters</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">PANEL_PRINTER_LIST; dialogs/panel_printer_list.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
+3 -7
View File
@@ -10,20 +10,17 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class PANEL_PRINTER_LIST;
#include "dialog_shim.h"
#include <wx/panel.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/checkbox.h>
#include <wx/gbsizer.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/radiobut.h>
#include <wx/textctrl.h>
@@ -49,7 +46,6 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
wxID_PRINT_OPTIONS,
};
PANEL_PRINTER_LIST* m_panelPrinters;
wxBoxSizer* m_bUpperSizer;
wxStaticBoxSizer* m_sbOptionsSizer;
wxGridBagSizer* m_gbOptionsSizer;
+13 -13
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -17,8 +17,8 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
m_enableGit = new wxCheckBox( this, wxID_ANY, _("Enable Git tracking"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_enableGit, 0, wxEXPAND|wxALL, 10 );
m_enableGit = new wxCheckBox( this, wxID_ANY, _("Enable Git Tracking"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_enableGit, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 13 );
m_gitSizer = new wxBoxSizer( wxVERTICAL );
@@ -30,7 +30,7 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
bSizerUpdate->Add( m_staticText6, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 13 );
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerUpdate->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bSizerUpdate->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
wxGridBagSizer* gbUpdate;
gbUpdate = new wxGridBagSizer( 4, 5 );
@@ -54,10 +54,10 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
gbUpdate->AddGrowableCol( 2 );
bSizerUpdate->Add( gbUpdate, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
bSizerUpdate->Add( gbUpdate, 0, wxEXPAND|wxLEFT, 13 );
m_gitSizer->Add( bSizerUpdate, 0, wxEXPAND|wxTOP, 5 );
m_gitSizer->Add( bSizerUpdate, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerCommitData;
bSizerCommitData = new wxBoxSizer( wxVERTICAL );
@@ -67,7 +67,7 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
bSizerCommitData->Add( m_staticText12, 0, wxEXPAND|wxLEFT|wxTOP, 13 );
m_staticline31 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerCommitData->Add( m_staticline31, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bSizerCommitData->Add( m_staticline31, 0, wxEXPAND | wxALL, 5 );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 );
@@ -86,29 +86,29 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
m_authorLabel->Wrap( -1 );
m_authorLabel->Enable( false );
fgSizer1->Add( m_authorLabel, 0, wxTOP|wxLEFT, 5 );
fgSizer1->Add( m_authorLabel, 0, wxALL, 5 );
m_author = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_author->Enable( false );
fgSizer1->Add( m_author, 1, wxTOP|wxRIGHT|wxLEFT, 5 );
fgSizer1->Add( m_author, 0, wxALL|wxEXPAND, 5 );
m_authorEmailLabel = new wxStaticText( this, wxID_ANY, _("Author e-mail:"), wxDefaultPosition, wxDefaultSize, 0 );
m_authorEmailLabel->Wrap( -1 );
m_authorEmailLabel->Enable( false );
fgSizer1->Add( m_authorEmailLabel, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
fgSizer1->Add( m_authorEmailLabel, 0, wxALL, 5 );
m_authorEmail = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_authorEmail->Enable( false );
fgSizer1->Add( m_authorEmail, 1, wxALL, 5 );
fgSizer1->Add( m_authorEmail, 0, wxALL|wxEXPAND, 5 );
bSizerCommitData->Add( fgSizer1, 0, wxEXPAND|wxALL, 5 );
bSizerCommitData->Add( fgSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT, 8 );
m_gitSizer->Add( bSizerCommitData, 1, wxEXPAND|wxTOP, 10 );
m_gitSizer->Add( bSizerCommitData, 1, wxEXPAND, 5 );
bLeftSizer->Add( m_gitSizer, 0, wxEXPAND, 0 );
+1 -1
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -70,8 +70,8 @@
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="border">13</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
@@ -103,7 +103,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Enable Git tracking</property>
<property name="label">Enable Git Tracking</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -146,7 +146,7 @@
<property name="permission">protected</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
@@ -216,8 +216,8 @@
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="false">
<property name="BottomDockable">1</property>
@@ -275,10 +275,10 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="border">13</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxGridBagSizer" expanded="true">
<object class="wxGridBagSizer" expanded="false">
<property name="empty_cell_size">-1,2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">2</property>
@@ -490,8 +490,8 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
@@ -561,8 +561,8 @@
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="false">
<property name="BottomDockable">1</property>
@@ -620,8 +620,8 @@
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="border">8</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="false">
<property name="cols">2</property>
@@ -713,7 +713,7 @@
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxTOP|wxLEFT</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
@@ -775,8 +775,8 @@
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@@ -840,7 +840,7 @@
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM|wxLEFT</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
@@ -902,8 +902,8 @@
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
+3 -2
View File
@@ -369,14 +369,15 @@ bool PANEL_COLOR_SETTINGS::saveCurrentTheme( bool aValidate )
if( aValidate && !validateSave() )
return false;
COLOR_SETTINGS* selected = ::GetColorSettings( m_currentSettings->GetFilename() );
SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
COLOR_SETTINGS* selected = settingsMgr.GetColorSettings( m_currentSettings->GetFilename() );
selected->SetOverrideSchItemColors( m_optOverrideColors->GetValue() );
for( int layer : m_validLayers )
selected->SetColor( layer, m_currentSettings->GetColor( layer ) );
Pgm().GetSettingsManager().SaveColorSettings( selected, m_colorNamespace );
settingsMgr.SaveColorSettings( selected, m_colorNamespace );
return true;
}
+26 -23
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6-dirty)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -24,7 +24,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
bLeftSizer->Add( m_staticText20, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 );
m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bLeftSizer->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bLeftSizer->Add( m_staticline3, 0, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bAntialiasingSizer;
bAntialiasingSizer = new wxBoxSizer( wxVERTICAL );
@@ -72,7 +72,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
bLeftSizer->Add( m_staticText21, 0, wxTOP|wxRIGHT|wxLEFT, 13 );
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bLeftSizer->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bLeftSizer->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bHelperAppsSizer;
bHelperAppsSizer = new wxBoxSizer( wxVERTICAL );
@@ -144,7 +144,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
bLeftSizer->Add( m_staticText22, 0, wxTOP|wxRIGHT|wxLEFT, 13 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bLeftSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
bLeftSizer->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bUserInterfaceSizer;
bUserInterfaceSizer = new wxBoxSizer( wxVERTICAL );
@@ -203,7 +203,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
bSizerIconsTheme->Add( m_rbIconThemeAuto, 0, wxALL, 5 );
bUserInterfaceSizer->Add( bSizerIconsTheme, 0, wxEXPAND|wxTOP, 5 );
bUserInterfaceSizer->Add( bSizerIconsTheme, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerToolbarSize;
bSizerToolbarSize = new wxBoxSizer( wxHORIZONTAL );
@@ -230,30 +230,33 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
bUserInterfaceSizer->Add( bSizerToolbarSize, 0, wxEXPAND, 5 );
m_scaleFonts = new wxCheckBox( this, wxID_ANY, _("Apply icon scaling to fonts"), wxDefaultPosition, wxDefaultSize, 0 );
bUserInterfaceSizer->Add( m_scaleFonts, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_fontScalingHelp = new wxStaticText( this, wxID_ANY, _("(This workaround will improve some GTK HiDPI font scaling issues.)"), wxDefaultPosition, wxDefaultSize, 0 );
m_fontScalingHelp->Wrap( -1 );
bUserInterfaceSizer->Add( m_fontScalingHelp, 0, wxBOTTOM|wxLEFT, 8 );
m_gbUserInterface = new wxGridBagSizer( 5, 0 );
m_gbUserInterface->SetFlexibleDirection( wxVERTICAL );
m_gbUserInterface->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
m_staticTextCanvasScale = new wxStaticText( this, wxID_ANY, _("Canvas scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCanvasScale->Wrap( -1 );
m_gbUserInterface->Add( m_staticTextCanvasScale, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_gbUserInterface->Add( m_staticTextCanvasScale, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_canvasScaleCtrl = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0, 1 );
m_canvasScaleCtrl->SetDigits( 0 );
m_gbUserInterface->Add( m_canvasScaleCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_gbUserInterface->Add( m_canvasScaleCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_canvasScaleAuto = new wxCheckBox( this, wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 );
m_gbUserInterface->Add( m_canvasScaleAuto, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 15 );
m_gbUserInterface->Add( m_canvasScaleAuto, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 15 );
bUserInterfaceSizer->Add( m_gbUserInterface, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
bUserInterfaceSizer->Add( m_gbUserInterface, 0, wxTOP|wxBOTTOM|wxLEFT|wxEXPAND, 5 );
bUserInterfaceSizer->Add( 0, 10, 0, wxEXPAND, 5 );
m_scaleFonts = new wxCheckBox( this, wxID_ANY, _("Apply icon scaling to fonts"), wxDefaultPosition, wxDefaultSize, 0 );
bUserInterfaceSizer->Add( m_scaleFonts, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_fontScalingHelp = new wxStaticText( this, wxID_ANY, _("(This workaround will improve some GTK HiDPI font scaling issues.)"), wxDefaultPosition, wxDefaultSize, 0 );
m_fontScalingHelp->Wrap( -1 );
bUserInterfaceSizer->Add( m_fontScalingHelp, 0, wxBOTTOM|wxLEFT, 8 );
wxBoxSizer* bSizerHighContrast;
bSizerHighContrast = new wxBoxSizer( wxHORIZONTAL );
@@ -270,13 +273,13 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
bSizerHighContrast->Add( m_highContrastUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
bUserInterfaceSizer->Add( bSizerHighContrast, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
bUserInterfaceSizer->Add( bSizerHighContrast, 0, wxBOTTOM|wxEXPAND, 5 );
bLeftSizer->Add( bUserInterfaceSizer, 0, wxTOP|wxLEFT|wxEXPAND, 5 );
bPanelSizer->Add( bLeftSizer, 0, wxRIGHT, 35 );
bPanelSizer->Add( bLeftSizer, 0, wxRIGHT, 20 );
wxBoxSizer* rightSizer;
rightSizer = new wxBoxSizer( wxVERTICAL );
@@ -286,7 +289,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
rightSizer->Add( m_staticText23, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 13 );
m_staticline6 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
rightSizer->Add( m_staticline6, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
rightSizer->Add( m_staticline6, 0, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bEditingSizer;
bEditingSizer = new wxBoxSizer( wxVERTICAL );
@@ -311,7 +314,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
rightSizer->Add( m_staticText24, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 13 );
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
rightSizer->Add( m_staticline5, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
rightSizer->Add( m_staticline5, 0, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bSessionSizer;
bSessionSizer = new wxBoxSizer( wxVERTICAL );
@@ -320,7 +323,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
m_cbRememberOpenFiles->SetValue(true);
m_cbRememberOpenFiles->SetToolTip( _("If checked, launching a project will also launch tools such as the schematic and board editors with previously open files") );
bSessionSizer->Add( m_cbRememberOpenFiles, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSessionSizer->Add( m_cbRememberOpenFiles, 0, wxALL, 5 );
bSessionSizer->Add( 0, 5, 0, 0, 5 );
@@ -381,7 +384,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
rightSizer->Add( m_staticText25, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 13 );
m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
rightSizer->Add( m_staticline4, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
rightSizer->Add( m_staticline4, 0, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bProjectBackupSizer;
bProjectBackupSizer = new wxBoxSizer( wxVERTICAL );
@@ -454,7 +457,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
rightSizer->Add( bProjectBackupSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
bPanelSizer->Add( rightSizer, 0, wxRIGHT|wxLEFT, 5 );
bPanelSizer->Add( rightSizer, 0, wxLEFT, 5 );
this->SetSizer( bPanelSizer );
+247 -237
View File
@@ -61,7 +61,7 @@
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">35</property>
<property name="border">20</property>
<property name="flag">wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
@@ -132,8 +132,8 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="true">
<property name="BottomDockable">1</property>
@@ -557,8 +557,8 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="true">
<property name="BottomDockable">1</property>
@@ -1354,8 +1354,8 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="true">
<property name="BottomDockable">1</property>
@@ -1416,7 +1416,7 @@
<property name="border">5</property>
<property name="flag">wxTOP|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bUserInterfaceSizer</property>
<property name="orient">wxVERTICAL</property>
@@ -1759,7 +1759,7 @@
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
@@ -2293,6 +2293,235 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxGridBagSizer" expanded="false">
<property name="empty_cell_size">-1,-1</property>
<property name="flexible_direction">wxVERTICAL</property>
<property name="growablecols"></property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">m_gbUserInterface</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_ALL</property>
<property name="permission">protected</property>
<property name="vgap">5</property>
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Canvas scale:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextCanvasScale</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxSpinCtrlDouble" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="digits">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="inc">1</property>
<property name="initial">0</property>
<property name="max">100</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_canvasScaleCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="false">
<property name="border">15</property>
<property name="colspan">1</property>
<property name="column">2</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Automatic</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_canvasScaleAuto</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCanvasScaleAuto</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="false">
<property name="height">10</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
@@ -2420,228 +2649,9 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxGridBagSizer" expanded="true">
<property name="empty_cell_size">-1,-1</property>
<property name="flexible_direction">wxVERTICAL</property>
<property name="growablecols"></property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">m_gbUserInterface</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_ALL</property>
<property name="permission">protected</property>
<property name="vgap">5</property>
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Canvas scale:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextCanvasScale</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxSpinCtrlDouble" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="digits">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="inc">1</property>
<property name="initial">0</property>
<property name="max">100</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_canvasScaleCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="false">
<property name="border">15</property>
<property name="colspan">1</property>
<property name="column">2</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Automatic</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_canvasScaleAuto</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCanvasScaleAuto</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="flag">wxBOTTOM|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
@@ -2845,7 +2855,7 @@
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="flag">wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
@@ -2915,8 +2925,8 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="true">
<property name="BottomDockable">1</property>
@@ -3187,8 +3197,8 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="true">
<property name="BottomDockable">1</property>
@@ -3256,7 +3266,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
@@ -3944,8 +3954,8 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="true">
<property name="BottomDockable">1</property>
+3 -3
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6-dirty)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -75,12 +75,12 @@ class PANEL_COMMON_SETTINGS_BASE : public RESETTABLE_PANEL
wxRadioButton* m_rbIconSizeSmall;
wxRadioButton* m_rbIconSizeNormal;
wxRadioButton* m_rbIconSizeLarge;
wxCheckBox* m_scaleFonts;
wxStaticText* m_fontScalingHelp;
wxGridBagSizer* m_gbUserInterface;
wxStaticText* m_staticTextCanvasScale;
wxSpinCtrlDouble* m_canvasScaleCtrl;
wxCheckBox* m_canvasScaleAuto;
wxCheckBox* m_scaleFonts;
wxStaticText* m_fontScalingHelp;
wxStaticText* m_highContrastLabel;
wxTextCtrl* m_highContrastCtrl;
wxStaticText* m_highContrastUnits;
+6 -6
View File
@@ -24,12 +24,12 @@
#include <dialogs/panel_data_collection.h>
#include <advanced_config.h>
#include <app_monitor.h>
#include <bitmaps.h>
#include <dialog_shim.h>
#include <kiface_base.h>
#include <kiplatform/policy.h>
#include <kiplatform/ui.h>
#include <pgm_base.h>
#include <policy_keys.h>
#include <id.h>
#include <settings/common_settings.h>
@@ -54,7 +54,7 @@ bool PANEL_DATA_COLLECTION::TransferDataToWindow()
Disable();
}
m_sentryUid->SetValue( APP_MONITOR::SENTRY::Instance()->GetSentryId() );
m_sentryUid->SetValue( Pgm().GetSentryId() );
return true;
}
@@ -62,7 +62,7 @@ bool PANEL_DATA_COLLECTION::TransferDataToWindow()
bool PANEL_DATA_COLLECTION::TransferDataFromWindow()
{
APP_MONITOR::SENTRY::Instance()->SetSentryOptIn( m_cbOptIn->GetValue() );
Pgm().SetSentryOptIn( m_cbOptIn->GetValue() );
return true;
}
@@ -76,12 +76,12 @@ void PANEL_DATA_COLLECTION::ResetPanel()
void PANEL_DATA_COLLECTION::applySettingsToPanel()
{
m_cbOptIn->SetValue( APP_MONITOR::SENTRY::Instance()->IsOptedIn() );
m_cbOptIn->SetValue( Pgm().IsSentryOptedIn() );
}
void PANEL_DATA_COLLECTION::OnResetIdClick( wxCommandEvent& aEvent )
{
APP_MONITOR::SENTRY::Instance()->ResetSentryId();
m_sentryUid->SetValue( APP_MONITOR::SENTRY::Instance()->GetSentryId() );
Pgm().ResetSentryId();
m_sentryUid->SetValue( Pgm().GetSentryId() );
}

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