Compare commits

...

1014 Commits

Author SHA1 Message Date
Seth Hillbrand e808544c20 Revert "Replace glew with epoxy"
This reverts merge request !2217
2025-04-22 15:16:45 -07:00
Michal Suchánek 0c36e16292 Replace glew with epoxy
Glew has the problem that it has to be selected at build time if GLX or
EGL is supported by the library, and this in not encoded in the library
name, nor ABI, nor anything.

Then it's easy to get into the situation that a binary is built but
cannot run because glew supports an API different from the one used by
wxWidgets, or the binary fails to link in the end after all objects are
compiled.

epoxy can support both with the same library avoiding this problem.

epoxy is not initialized explicitly, replaced initialization with
version check where one was not done already.

It seems to be available as vcpkg https://vcpkg.link/ports/libepoxy

There are problems related to GL context switching on Windows which does
not seem to be used in kicad
https://github.com/anholt/libepoxy#known-issues-when-running-on-windows
There is also a problem related to multithreaded rendering on Windows
https://github.com/anholt/libepoxy/pull/265 It's harder to tell if
threading is used for rendering but it does not look like kicad is doing
anything complex enough to warrant using multiple rendering threads.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20630
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12543
2025-04-22 12:54:39 -07:00
John Beard d2307fdcaa PCB array tool: make it easier to skip renumbering entirely
This was already possible by setting a 0-sized step, but that's
a bit clunky - provide an obvious way to do it via a
"do/do not renumber at all" checkbox.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20470
2025-04-23 00:00:00 +08:00
John Beard 1b1623885c PCB array tool: don't count array source pad as reserving its number
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20722
2025-04-23 23:32:20 +08:00
jean-pierre charras 874fad4846 QA test: Update issue11814.kicad_pcb by removing old teardrops
These teardrops created by a old plugin have all the same priority.
Overlapping zones must avoid using the same priority.
Now replaced by teardrops created by Pcbnew.
2025-04-22 15:46:29 +02:00
Jeff Young a53a639523 Formatting. 2025-04-22 13:15:03 +01:00
Jeff Young 5573dce448 Fix various errors in intersecting zones test.
Also gives a clearer error message, and better
descriptions of named zones.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20718
2025-04-22 13:15:03 +01:00
jean-pierre charras 57102b87ce 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.
2025-04-22 09:28:47 +02:00
JamesJCode 8ef54c3651 Remove delay_profile API parameter until design matures 2025-04-22 00:08:04 +01:00
JamesJCode bd1f6e505c PCB Calcs: Reset default units along with values 2025-04-21 21:28:00 +01:00
Mike Williams f51c5c396f sch groups: add swap data fix
Copied from 199a7a34ea for board items
2025-04-21 15:02:35 -04:00
Mike Williams 9cb0d100e5 sch design blocks: block illegal characters before creation failure
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20676
2025-04-21 14:59:31 -04:00
Seth Hillbrand 9d1142839a After removing items from the conn list, check valid
When cancelling, we mark elements invalid if they are removed from the
connectivity list.  Be cause when iterating through the list again.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20566
2025-04-21 11:44:30 -07:00
Jeff Young 199a7a34ea Don't leak PCB_GROUP internals into BOARD_COMMIT.
(This also fixes a potential bug where the image
group's children didn't get the image as a parent.)
2025-04-21 18:24:30 +01:00
Jeff Young c1b1c689ad Don't double-add/remove items from connectivity.
BOARD::Add()/Remove() already do this.
2025-04-21 18:20:52 +01:00
Jeff Young 519b29472f Remove temporary debugging code. 2025-04-21 17:40:28 +01:00
John Beard 207199fd80 PCB_PICKER_TOOL: avoid popping a dismabiguation menu after point selection completes
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20680
2025-04-22 00:27:25 +08:00
jean-pierre charras 7c56b04436 DIALOG_CREATE_ARRAY_BASE: fix better size of dlg in fp editor.
A panel was set as stretchable (which was not useful) thus creating
a very large dialog in FP editor.
2025-04-21 15:45:39 +02:00
Jeff Young 5a3b2cc8fd Temporary debugging code. 2025-04-21 14:42:41 +01:00
Jeff Young 072932df80 Don't process all items in a move individually. 2025-04-21 14:42:41 +01:00
Damjan af11746cc4 pcbnew and eeschema: Table and textbox rotation / text justification fix 2025-04-21 13:32:46 +00:00
Mike Williams 54681278c5 sch groups: don't double move on paste 2025-04-21 09:28:27 -04:00
Mike Williams 82043e374a sch groups/lines: correctly handle view lifetime and drawing in group 2025-04-21 09:28:27 -04:00
Mike Williams 6a24c5c5a4 sch groups: add delete support 2025-04-21 07:50:05 -04:00
Alex Shvartzkop f72d5c43f3 Update translations 2025-04-21 13:43:28 +03:00
dsa-t 81e2e4e8d2 Translated using Weblate (Russian)
Currently translated at 96.3% (9878 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-04-21 12:42:53 +02:00
ZbeeGin e6c8618386 Translated using Weblate (Polish)
Currently translated at 100.0% (10256 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-04-21 12:42:53 +02:00
ZbeeGin f3392b5c99 Translated using Weblate (Polish)
Currently translated at 100.0% (10256 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-04-21 12:42:53 +02:00
Pferd O 7a38e3bf1e Translated using Weblate (German)
Currently translated at 99.0% (10154 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-04-21 12:42:53 +02:00
Pferd O 254ba394f1 Translated using Weblate (German)
Currently translated at 98.8% (10136 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-04-21 12:42:53 +02:00
Ivan Chuba 396b7b0054 Translated using Weblate (Estonian)
Currently translated at 3.7% (383 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/et/
2025-04-21 12:42:53 +02:00
Ivan Chuba ef594d7bb2 Translated using Weblate (Ukrainian)
Currently translated at 73.7% (7564 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/uk/
2025-04-21 12:42:53 +02:00
Henrik Kauhanen a43956a87b Translated using Weblate (Swedish)
Currently translated at 99.5% (10213 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-04-21 12:42:53 +02:00
Ettore Atalan cfd5846f4e Translated using Weblate (German)
Currently translated at 98.8% (10133 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-04-21 12:42:53 +02:00
Henrik Kauhanen 6d22d32f46 Translated using Weblate (Swedish)
Currently translated at 99.5% (10205 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-04-21 12:42:53 +02:00
Henrik Kauhanen 64d2fef703 Translated using Weblate (Swedish)
Currently translated at 99.4% (10204 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-04-21 12:42:53 +02:00
Henrik Kauhanen 95b8e1241f Translated using Weblate (Swedish)
Currently translated at 99.0% (10160 of 10256 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-04-21 12:42:52 +02:00
Alex Shvartzkop 8051904211 Un-translate layer names in 3D appearance panel.
(cherry picked from commit 33fad39cf4)
2025-04-21 13:40:59 +03:00
Alex Shvartzkop 4239e706ea LTspice import: don't fail if some symbols are missing.
(cherry picked from commit c2d3c9b292)
2025-04-21 05:42:30 +03:00
Alex Shvartzkop c737bd392e LTspice import: adapt label spin when multiple wires connected
(cherry picked from commit 37103c6e15)
2025-04-21 05:42:30 +03:00
Alex Shvartzkop 496fc3b6bf 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 05:42:30 +03:00
Jeff Young 5371312c6f Make auto text thickness active. 2025-04-20 19:59:05 +01:00
JamesJCode b23bd0ed92 Remove files from other branch 2025-04-20 18:00:50 +01:00
JamesJCode 2483ab4d7a Add calculation of unit propagation delay to PCB calculator 2025-04-20 13:04:04 +01:00
jean-pierre charras 1af76a9bef Pad properties dlg: Clearing thermal relief override (gap/spoke) does not work
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20709
2025-04-20 11:05:21 +02:00
jean-pierre charras 86b17f46de QA tests: fix missing initialization. 2025-04-20 10:28:42 +02:00
Alex Shvartzkop 6afedab205 OCCT 3D model export: parallelize fusing shapes and subtracting holes.
(cherry picked from commit aab730abc1)
2025-04-20 02:05:55 +03:00
Alex Shvartzkop 97be2d1ce0 OCCT 3D model export: fix missing soldermask shape when there's no polygons.
(cherry picked from commit ee513f7a8b)
2025-04-20 02:05:46 +03:00
Alex Shvartzkop 80373e90eb 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-20 02:05:30 +03:00
Alex Shvartzkop ad12fbd2f9 OCCT 3D model export: support different line styles for graphics.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18873
2025-04-20 01:59:45 +03:00
Lucas Gerads 16b4ee92bb 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"
2025-04-19 19:43:14 +02:00
Wayne Stambaugh f0f6b5a09b 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.
2025-04-19 12:56:39 -04:00
Jeff Young f102298eeb Use link icon instead of refresh icon. 2025-04-19 16:53:23 +01:00
jean-pierre charras b5a913e582 Fix a non-existing bitmap issue.
the bitmap BITMAPS::calculator, although in bitmaps_list.h, does not exists.
A suitable bitmap can be BITMAPS::icon_pcbcalculator_24.
So it is now used in ACTIONS::showCalculatorTool()
2025-04-19 16:52:33 +02:00
jean-pierre charras fd2822fb15 French translation update 2025-04-19 14:28:44 +02:00
jean-pierre charras a90e83a699 FOOTPRINT_WIZARD_FRAME: fix tools missing in toolbar (i.e. fix TODO items)
These TODO were to convert missing tools to actions.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20694
2025-04-19 14:14:14 +02:00
Jeff Young 49e04d3327 Remove accidental debug code. 2025-04-19 11:31:55 +01:00
Jeff Young 61986ab7c8 Load appearances presets to render job.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20660
2025-04-19 11:08:54 +01:00
JamesJCode 8229d2e915 Remove delay profile cache check only used on board load 2025-04-19 00:54:22 +01:00
JamesJCode f1344e921a Final purge of 'tuning profile' -> 'delay profile' in time-domain code
Only mention remains in the delay profile settings JSON
2025-04-19 00:30:34 +01:00
JamesJCode 80a25764eb Don't allow creation of delay via override if no profiles created 2025-04-19 00:06:36 +01:00
JamesJCode 0331ecb173 Fix stale data crash when updating delay profile data 2025-04-18 23:57:06 +01:00
Jeff Young 846ffa5659 Remove duplicate handling for grid checkboxes.
Also corrects logic of otherRow loop.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18843
2025-04-18 15:26:51 -07:00
Jeff Young ec6af4a5b4 Move Execute() to COMMON_CONTROL.
Also fixes other apps coming up in background.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20426
2025-04-18 13:41:19 -07:00
Jeff Young 920173a197 Make dialog spacing consistent. 2025-04-18 13:41:19 -07:00
Jeff Young 53e509326c Don't put null value in map as a side-effect of using []. 2025-04-18 13:41:19 -07:00
Jeff Young 24cef6d165 ADDED: calculator tools to Tools menu.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20426
2025-04-18 13:41:19 -07:00
Jeff Young f9011e9e35 Update sample script.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20538
2025-04-18 13:41:18 -07:00
Jeff Young 046f1c916b Reset colors on Reset to Default Settings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20624
2025-04-18 13:41:18 -07:00
Jeff Young 8113824f7c Don't conflate generated fields (${DNP}) and fields with variable references.
They're not quite the same thing as the later
can have un-applied values which require expanding.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20417
2025-04-18 13:41:18 -07:00
JamesJCode c2df0951f9 Time domain tuning UI improvements 2025-04-18 13:41:18 -07:00
Alex Shvartzkop 8814d452fe Update translations 2025-04-18 03:09:55 +03:00
Ivan Chuba 30912470cd Translated using Weblate (Estonian)
Currently translated at 3.7% (379 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/et/
2025-04-18 02:07:57 +02:00
Ivan Chuba 15d88aed92 Translated using Weblate (Ukrainian)
Currently translated at 73.8% (7552 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/uk/
2025-04-18 02:07:57 +02:00
Marco Ciampa 27910d0228 Translated using Weblate (Italian)
Currently translated at 99.9% (10216 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-04-18 02:07:57 +02:00
ZbeeGin 00d756ea66 Translated using Weblate (Polish)
Currently translated at 100.0% (10226 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-04-18 02:07:57 +02:00
2tama3 a088ddd693 Translated using Weblate (Japanese)
Currently translated at 98.3% (10060 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-04-18 02:07:57 +02:00
ZbeeGin fc8e41a0de Translated using Weblate (Polish)
Currently translated at 98.1% (10033 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-04-18 02:07:57 +02:00
Tokita, Hiroshi 3724789249 Translated using Weblate (Japanese)
Currently translated at 98.1% (10041 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-04-18 02:07:57 +02:00
CloverGit fc158d5d4b Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.4% (10174 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-04-18 02:07:57 +02:00
rsr.private 109c15d22f Translated using Weblate (Catalan)
Currently translated at 41.2% (4217 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-04-18 02:07:56 +02:00
2tama3 b12a4b2650 Translated using Weblate (Japanese)
Currently translated at 98.1% (10037 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-04-18 02:07:56 +02:00
Adolfo Jayme Barrientos ccdb4e7f18 Translated using Weblate (Spanish)
Currently translated at 85.8% (8775 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-04-18 02:07:56 +02:00
Adolfo Jayme Barrientos 8f2707c663 Translated using Weblate (Catalan)
Currently translated at 41.0% (4202 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-04-18 02:07:56 +02:00
CloverGit 661437ba5b Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.4% (10171 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-04-18 02:07:56 +02:00
Adolfo Jayme Barrientos c0e31e278f Translated using Weblate (Spanish)
Currently translated at 85.8% (8775 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-04-18 02:07:56 +02:00
Adolfo Jayme Barrientos c20165b13f Translated using Weblate (Catalan)
Currently translated at 41.0% (4194 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-04-18 02:07:56 +02:00
pominglee e873b85cd2 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.9% (10224 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-04-18 02:07:56 +02:00
Adolfo Jayme Barrientos f96372f100 Translated using Weblate (Catalan)
Currently translated at 40.7% (4168 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-04-18 02:07:56 +02:00
ZbeeGin 7fe235cd27 Translated using Weblate (Polish)
Currently translated at 98.0% (10024 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-04-18 02:07:56 +02:00
ZbeeGin 24f5e1c53a Translated using Weblate (Polish)
Currently translated at 97.7% (10000 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-04-18 02:07:55 +02:00
Pferd O 7158a9a693 Translated using Weblate (German)
Currently translated at 99.4% (10173 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-04-18 02:07:55 +02:00
Wellington Terumi Uemura 6f7c98d7d9 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (10226 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2025-04-18 02:07:55 +02:00
co8 j 2d644aedbe Translated using Weblate (Japanese)
Currently translated at 98.0% (10026 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-04-18 02:07:55 +02:00
CloverGit 04feb955ef Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.4% (10170 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-04-18 02:07:55 +02:00
pominglee be167c021b Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.9% (10224 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-04-18 02:07:55 +02:00
CloverGit 1f1e98a7cf Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.3% (10163 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-04-18 02:07:55 +02:00
Henrik Kauhanen 75f369ece9 Translated using Weblate (Swedish)
Currently translated at 99.5% (10182 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-04-18 02:07:55 +02:00
ZbeeGin d60a0cc27c Translated using Weblate (Polish)
Currently translated at 97.7% (9992 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-04-18 02:07:55 +02:00
Pferd O 1df9195de5 Translated using Weblate (German)
Currently translated at 99.1% (10134 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-04-18 02:07:55 +02:00
pominglee 6b59655102 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.7% (10205 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-04-18 02:07:55 +02:00
Anonymous a4ff701e7a Translated using Weblate (Korean)
Currently translated at 96.2% (9839 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2025-04-18 02:07:55 +02:00
Pferd O 2ee6c6b133 Translated using Weblate (German)
Currently translated at 98.8% (10104 of 10226 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-04-18 02:07:54 +02:00
JamesJCode eb17ebee4e Implement time-domain length tuning
- Adds time and delay units
- Adds time domain tuning parameters entry and storage
- Adds pad-to-die delay property
- Adds time domain parameter interface for length / delay calculations
- Adds unit tracking for numerical constants through LIBEVAL
   - Will need future work to truly propagate through binary expressions
- Adds time domain tuning to meander placers
- Adds time delay display to net inspector panel
- Modifies DRC to handle time domain constraints
2025-04-17 21:46:56 +01:00
Jeff Young 0820e90c73 Fix button sizing.
Hack appears to be no longer needed, and is causing
the side and bottom to clip (at least on MacOS).
2025-04-17 14:37:16 +01:00
Jeff Young c5093a5df0 ADDED: path info to job destination panel. 2025-04-17 14:37:16 +01:00
Jeff Young 70cbdbff89 ADDED: appearance preset selection to Render Jobs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20682
2025-04-17 14:37:16 +01:00
Damjan df8250fd70 pcbnew: Text box dialog doesn't have -Update Thickness According to Text Size- button 2025-04-17 11:06:55 +00:00
jean-pierre charras e6240f9fbf 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
2025-04-17 11:26:27 +02:00
Jeff Young 194ee9ef25 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
2025-04-16 18:09:56 +01:00
Jeff Young 6bc9653029 Make sure footprint chooser has correct board.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20669
2025-04-16 18:09:56 +01:00
JamesJCode 1c8e20b61f Further chasing of non-standard std::char_traits implementations 2025-04-16 17:48:46 +01:00
Jeff Young f66f2e522f Fix logic error in checking IsErrorLimitExceeded().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20671
2025-04-16 13:02:38 +01:00
Jeff Young 5279cc8767 Use EDA_COMBINED_MATCHER more consistently.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20678
2025-04-16 12:20:15 +01:00
Jeff Young 69bf9894e9 Fields don't currently have any metadata to search. 2025-04-16 11:41:56 +01:00
Jeff Young 0a8d5ea78b Fields don't currently have any metadata to search. 2025-04-16 11:33:16 +01:00
Jeff Young 6befe4badf Toolbars & SetConditions for SCH groups. 2025-04-16 11:31:56 +01:00
Alexander Boehm 70af60c930 multi-channel tool: do not duplicate uuids
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20665
2025-04-16 03:20:04 -04:00
JamesJCode a5be581b1b Add char_traits<T> specialisations for wxUniChar and NANODBC_SQLCHAR
when building on Apple with Clang >= 17.

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20631
2025-04-15 20:57:23 +01:00
JamesJCode 2ee66ccfac Fix compiler warning 2025-04-15 20:40:56 +01:00
Andrej Valek 9364bcdc9e 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.
2025-04-15 09:38:48 -07:00
wh201906 6d2b728fb1 Exclude brackets at the end of a URL in LinkifyHTML()
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20347
2025-04-15 09:37:23 -07:00
Dmitry Rezvanov a3fae053c4 pcbnew: Add sorting functionality for netclass assignments
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18819
2025-04-15 09:32:16 -07:00
Alexander Boehm 4bc099429c 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
2025-04-15 09:28:27 -07:00
Mike Williams e64eeb0161 sch groups: make copy/paste work
Need to expand selection on copy
2025-04-15 10:19:40 -04:00
Mike Williams a57cd8a207 sch: don't remove/add items to selection while iterating
Likely needs backport
2025-04-15 10:19:40 -04:00
Mike Williams b9013b87d0 sch groups: add test case for loading from file 2025-04-15 10:19:40 -04:00
Mike Williams fd4b18140f group tool: make sure frame specific commits are created 2025-04-15 10:19:40 -04:00
Mike Williams 6ebadf9fbe sch groups: add load/save support 2025-04-15 10:19:40 -04:00
Mike Williams cdac27b2bc sch groups: implement rotate/mirror 2025-04-15 10:19:40 -04:00
Mike Williams 82ec293907 CW rotation: add missing default hotkey in sch/3d to match pcb editor hotkeys 2025-04-15 10:19:40 -04:00
Mike Williams 5eee8f1c5f sch_view: update to handle items with children 2025-04-15 10:19:39 -04:00
Mike Williams 0ba6882c47 commit: when deleting extra copy of double staged item, remove group 2025-04-15 10:14:40 -04:00
Mike Williams 5db091fc79 sch groups: clear group membership on destruction, add tests 2025-04-15 10:14:38 -04:00
Mike Williams 718bf40807 sch groups: add to API 2025-04-15 10:13:52 -04:00
Mike Williams 027b01750c sch view: mark some layers as display only 2025-04-15 10:13:52 -04:00
Mike Williams 05f3c47b4f groups: make selection tool work with groups 2025-04-15 10:13:50 -04:00
Mike Williams 8c9f4e7832 groups: tools/dialogs need commit screens for schematic 2025-04-15 09:59:38 -04:00
Mike Williams d6e7970738 sch: add group tool 2025-04-15 09:59:38 -04:00
Mike Williams f483fcd2d9 schematic: add groups support to undo/redo/commit 2025-04-15 09:59:38 -04:00
Mike Williams fa02c70604 schematic: draw groups 2025-04-15 09:59:38 -04:00
Mike Williams 0c0dbc6271 groups: commonize group tool 2025-04-15 09:59:38 -04:00
Dhineshkumar S fa517a0429 Fix missing change that ensures text is auto-completed.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13508
2025-04-14 19:50:40 -07:00
Damjan c4ff42cb54 Adds dedicated anchor points for table
Allows snapping and easier alignment first tables



Fixes https://gitlab.com/kicad/code/kicad/-/issues/20184
2025-04-14 19:47:35 -07:00
Jeff Young d421af6e4d 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 21:38:01 +01:00
Jeff Young adc5523f43 Bounds-check unit and body style from prop inspector.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20649
2025-04-14 21:36:19 +01:00
Jeff Young 10af2f04d3 Make test use the solder-mask healing algo. 2025-04-14 15:38:18 +01:00
Jeff Young ac265926b1 Restore bounds checking (even though its a performance hit). 2025-04-14 15:38:18 +01:00
Damjan 2d2f443aa4 pcbnew: Multi-line text in table cell 2025-04-14 14:07:36 +00:00
Damjan f4107fa4d6 pcbnew: flipping tables makes them walk 2025-04-14 14:06:06 +00:00
Jeff Young 38c822db9c Use individual silk/mask collision checking if solder mask min width is 0.
Using the combinde solder mask doesn't deal well
with exclusions since almost any change will affect
the combined mask.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17429
2025-04-14 14:05:35 +01:00
Jeff Young 8827323361 Remove Help menu hacks which appear to no longer be necessary.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10124
2025-04-14 11:52:07 +01:00
Jeff Young 2a2a73a1e9 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:52:04 +01:00
dsa-t e6c76c6e21 Fix too small angle increment when stroking arcs.
The previous angle increment was about 0.0087 degrees.
Change it to 0.5 degrees.


(cherry picked from commit c5771d8874)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-04-14 06:45:32 +03:00
dsa-t 352e0035cf OCCT 3D model export: fix copper fusing issues on StickHub GND and #20515
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20515


(cherry picked from commit 2cebea3b04)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-04-14 00:16:31 +03:00
Jeff Young 8b19777d5d Revert part of name change that affects settings files. 2025-04-13 21:09:07 +01:00
dsa-t 4faa00e262 OCCT 3D model export: don't skip pads with duplicate pad numbers for pad points data.
(cherry picked from commit dfb66e2fdb)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-04-13 22:42:39 +03:00
dsa-t 6cb690fe6b Remove annoying tooltips in DRC/ERC dialogs.
(cherry picked from commit 58a76a2617)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-04-13 21:13:04 +03:00
Jeff Young 2d69b6e8ba Update pads connected to any connected tracks.
(Not just those selected.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20628
2025-04-13 18:23:52 +01:00
Jeff Young eece18f4a8 Formatting. 2025-04-13 18:23:52 +01:00
Jeff Young 57d0fa6f2d Handle ref & value proxies as if they were refs and values.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20613
2025-04-13 18:23:52 +01:00
jean-pierre charras 66a7abca09 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
2025-04-13 18:01:44 +02:00
Jeff Young ecb5c5e0d4 Visibility control is for *filled* shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20635
2025-04-13 13:12:43 +01:00
Jeff Young f1718370c4 Tests assume {0,0} sized table cells. 2025-04-13 12:04:14 +01:00
Jeff Young e90a3112f8 "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
2025-04-13 11:42:47 +01:00
Jeff Young 191327f7e8 Formatting. 2025-04-13 11:42:47 +01:00
dsa-t 9111a65302 OCCT 3D model export: don't show fusing errors for non-copper pads.
(cherry picked from commit 09da370512)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-04-13 08:18:55 +03:00
Matt Kosman 0890d3f1cb 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
2025-04-12 16:11:05 -07:00
Seth Hillbrand 6f54b11431 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

(cherry picked from commit ff6bee400e)
2025-04-12 14:11:35 -07:00
Andrej Valek 069954fa31 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
2025-04-12 14:06:13 -07:00
Jeff Young 159302063a Move board characteristics and stackup to PCB_TABLEs. 2025-04-12 20:41:01 +01:00
Wayne Stambaugh aa1dbcba34 Fix broken label position algorithm in Eagle schematic importer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20593
2025-04-12 11:05:49 -04:00
Seth Hillbrand 7d195b73b2 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
2025-04-11 15:12:55 -07:00
Wayne Stambaugh 9228369617 Code clean up of board GenCAD exporter. 2025-04-11 09:33:44 -04:00
Jeff Young a24f7121d8 Don't show mandatory fields in chooser.
Those we want are already accounted for in the
scoring algorithm.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20541
2025-04-11 12:23:47 +01:00
Jeff Young 598d446a38 Simplify libTree scoring algorithm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20610
2025-04-11 12:23:47 +01:00
jean-pierre charras a661deb0ad BOARD_NETLIST_UPDATER: fix crash related to fields handling.
The crash happened when removing and deleting fields in footprint no
longer existing in netlist.
Crash due to a std::deque<PCB_FIELD*> modified during parsing, invalidating pointer.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20607
2025-04-11 11:16:25 +02:00
Wayne Stambaugh c810ef716d 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.
2025-04-10 16:31:59 -04:00
Jeff Young 45abc90885 Be explicit about table highlight colors.
(Unsurprisingly, the previous hack had side effects.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20606
2025-04-10 17:32:00 +01:00
Wayne Stambaugh 66fad52331 Update QA JSON files to prevent modified status after running QA test. 2025-04-10 11:47:33 -04:00
Wayne Stambaugh 4ae07d1122 Fix GenCAD arc track export when using board offset. 2025-04-10 10:11:00 -04:00
Brian Lu ea4b2b73bb Pcbnew: VRML Export: Footprint-relative 3D Models
CHANGED: Provide the footprint base path as the working directory to the
3D shape cache such that 3D models relative to the footprint may be
correctly resolved when exporting a PCB as VRML.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14505
2025-04-10 06:55:26 -07:00
Jeff Young 65a49cc3ba Resolve fonts for tablecells.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20605
2025-04-10 14:13:07 +01:00
jean-pierre charras e57bc3304f DIALOG_SIM_MODEL: fix possible crash when no lib loaded (null pointer)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20599
2025-04-10 13:17:30 +02:00
Jeff Young 7232a98b65 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
2025-04-10 11:40:37 +01:00
jean-pierre charras 065e9dbf46 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.
2025-04-10 09:03:21 +02:00
jean-pierre charras f29c19ef02 DIALOG_RULE_AREA_PROPERTIES: fix incorrect tool-tip
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20592
2025-04-10 09:00:26 +02:00
jean-pierre charras 945c990a53 pcb_group.i: add missing include to use PCB_GROUP. 2025-04-10 08:57:53 +02:00
Wayne Stambaugh 7ce2b2b85f Fix broken GenCAD arc tracks export. 2025-04-09 14:39:55 -04:00
Jeff Young 1d45de0d1d Performance.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20506
2025-04-09 18:21:15 +01:00
Jeff Young 98ec2d7ba2 ADDED: metadata searching.
Symbol and footprint search panels can now optionally
search library links, descriptions and keywords.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10602
2025-04-09 17:46:07 +01:00
Jeff Young ec6bc85a29 No requirement to UNGROUP when we're recording entire parent FP.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20589
2025-04-09 12:18:26 +01:00
Jeff Young 702d802b22 Show library info for components in search panels.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19721
2025-04-09 11:56:42 +01:00
Julien Serin f381c6e846 Feat add table selection with shift+click
ADDED now user can use shift+click to select multiple cell in a table with two click

Fixes https://gitlab.com/kicad/code/kicad/issues/19878
2025-04-08 11:57:35 -07:00
Jeff Young 60364a9062 Performance improvements for hatched fills (round 2)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20570
2025-04-08 17:35:35 +01:00
Jeff Young ee68280b27 Uninitialised member var. 2025-04-08 17:35:35 +01:00
Wayne Stambaugh cb1e6b62e9 Update QA test json files with latest changes. 2025-04-08 08:17:12 -04:00
Wayne Stambaugh 1176ff4a15 Use symbol line width schematic setting when printing and plotting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20574
2025-04-08 08:11:28 -04:00
Seth Hillbrand 3d29fae7a9 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
2025-04-07 17:05:54 -07:00
Lucas Gerads 82003c8660 Simulator: Error checks for parsing ngspice intermediate file
- verify that the string "Values:" is actually found
- catch exceptions while parsing
- error messages
2025-04-07 15:48:34 -07:00
Alex Shvartzkop c5b132dd27 Altium PCB: fix 3D model opacity variable type.
See https://gitlab.com/kicad/code/kicad/-/issues/20507

(cherry picked from commit de1257abdf)
2025-04-07 23:24:09 +03:00
Alex Shvartzkop f4695081c1 Altium PCB: support 3D models import with duplicate filenames.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20507

(cherry picked from commit 3d36d41ea7)
2025-04-07 23:24:09 +03:00
Alex Shvartzkop 5d70b07c99 Altium PCB: fix padstack shapes import on F.Cu.
(cherry picked from commit 2c74d46d79)
2025-04-07 23:24:09 +03:00
Jeff Young 43aa63c1ec De-duplicate find results.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20569
2025-04-07 21:11:46 +01:00
Jeff Young 845cdb1b25 Performance optimisations for hatching. 2025-04-07 21:11:46 +01:00
Seth Hillbrand bccf365380 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
2025-04-07 12:17:11 -07:00
Jeff Young f0ebf0a7cc Don't assume existence of default FP text items. 2025-04-07 18:19:10 +01:00
Jeff Young 3def4afaec 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
2025-04-07 17:00:48 +01:00
Jeff Young 0659290417 Simplify hatch damage/rebuild and move it out of view.
There should be far fewer hatched objects than other
objects, so we're spending too much effort finding
all the possible damage when we probably should
just be auto-regenerating all the hatching.

This also moves it out of being done during redraw,
which was proving problematic.  Plus the refill
zones architecture does it during commit, and has
a lot more miles behind it.
2025-04-07 11:46:02 +01:00
Wayne Stambaugh c5ff61ba9c 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.
2025-04-06 17:53:49 -04:00
jean-pierre charras 848a6b6930 Pcbnew, DIALOG_SHAPE_PROPERTIES: fix an issue noticeable with POLY shapes.
After editing a polygon, the pointers m_parent and m_group where cleared.
They are now restored (like for other shapes).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20564
2025-04-06 14:45:42 +02:00
Jeff Young ac616b8c19 Restore visibility editing for fields.
(It got accidentally thrown out with visibility
for text items.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20560
2025-04-05 22:18:17 +01:00
Jeff Young 7a9db0f8c1 Formatting. 2025-04-05 22:18:17 +01:00
Jeff Young 2745945894 Improve thermal reliefs for hatched zones. 2025-04-05 22:18:17 +01:00
Jeff Young 860f52800e Performance. 2025-04-05 22:18:17 +01:00
Jeff Young 96491132ce Performance. 2025-04-05 22:18:17 +01:00
Wayne Stambaugh 598850b1f0 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
2025-04-05 15:53:59 -04:00
jean-pierre charras 12c82149bf DIALOG_SHAPE_PROPERTIES: fix wxWidgets debug alert. 2025-04-05 18:11:38 +02:00
jean-pierre charras 91d9863cc3 kicad-cli export gerbers: avoid incorrect behavior with a broken layer list.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20555
2025-04-05 12:03:29 +02:00
Jeff Young d4cc91f17a Via needs a parent for formatting. 2025-04-04 22:45:52 +01:00
Jeff Young 8b33b25e83 Use thermal reliefs to guarantee connection to hatched zones.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20447
2025-04-04 22:45:52 +01:00
Jeff Young 2c9c607b95 Fix thermal spokes for pad stacks. 2025-04-04 22:45:52 +01:00
Alex Shvartzkop 82f94e9185 Improve GetAppSettings performance.
There's no need to construct a wxString first.

(cherry picked from commit a6d81d019f)
2025-04-04 23:28:02 +03:00
Alex Shvartzkop 7a04389ac2 Improve pan performance when showing a large amount of TH pads.
See https://gitlab.com/kicad/code/kicad/-/issues/20506

(cherry picked from commit a1a710dfed)
2025-04-04 22:49:05 +03:00
Wayne Stambaugh 11edaa6e4a 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
2025-04-04 15:30:44 -04:00
Wayne Stambaugh 642e4d37bc Include arc tracks when exporting to GenCAD. 2025-04-04 13:20:59 -04:00
jean-pierre charras 91dda80530 Pcbnew, printing vias: always print the via hole, even for small holes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20546
2025-04-04 16:40:53 +02:00
Jeff Young 200c4a9eae Be explicit about default anchor shape.
(Otherwise it doesn't work for padstack overrides.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20551
2025-04-04 13:28:27 +01:00
Jeff Young 7151d21f0b Performance optimisation.
Reduces board loading for #17820 from 15 seconds
to about 6.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17820
2025-04-04 13:28:27 +01:00
jean-pierre charras 9eea670617 SCH_TEXTBOX: Do not plot twice the textbox shape.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20545
2025-04-04 13:03:07 +02:00
Wayne Stambaugh cf3dae0bb9 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.
2025-04-03 18:16:51 -04:00
Sean Mollet 380b5160d6 GENCAD export: Fixes to footprint hashing 2025-04-03 13:34:28 -04:00
Jeff Young cf96295fa1 Clipper2 is much faster at intersecting layers for drawing vertical walls.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9202
2025-04-03 16:57:45 +01:00
Sean Mollet 185491f2b8 GENCAD Export only produces a single pad - Fix 2025-04-03 11:30:03 -04:00
Jeff Young 661d002234 CHANGED: moved footprint lock shadows to children.
A full bounding hull wash gets overwhelming on
boards with lots of mechanically-constrained
objects.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14007
2025-04-03 14:38:14 +01:00
Jeff Young 2e556d0abc Plot tables in footprints. 2025-04-03 14:38:14 +01:00
jean-pierre charras f8ec23db00 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.
2025-04-03 13:19:20 +02:00
Mike Williams 40058ebe80 actions: move all basic selection operations to common actions 2025-04-02 12:02:01 -04:00
Jeff Young 8ff0aafbb8 Handle groups in footprints when filtering selection. 2025-04-02 16:22:21 +01:00
Jeff Young a0ec7f59c4 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
2025-04-02 13:22:40 +01:00
Jeff Young 901ad3064d Remove assert that fires when applying preset.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20467
2025-04-02 13:06:40 +01:00
Jeff Young db911c0d91 Improve debugging. 2025-04-02 13:06:40 +01:00
Jeff Young 967bf1d0a1 m_root is not guaranteed to be non-null. 2025-04-02 13:06:40 +01:00
Mike Williams 05e9772d54 groups: extract common class methods into EDA_GROUP base class 2025-04-01 14:34:20 -04:00
Mike Williams 8b69ec4761 dialog_group_properties: move to common 2025-04-01 14:34:20 -04:00
Mike Williams 5fd294cad2 eda frame: hoist FocusItem calls up a layer
Prep for SCH_GROUPs
2025-04-01 14:34:20 -04:00
Mike Williams f40b24d04a groups: move actions to common actions 2025-04-01 14:34:20 -04:00
Mike Williams 43e432f9ad sch_group: add basic class implementation + test 2025-04-01 14:34:20 -04:00
jean-pierre charras 76929808d3 PCB_TEXTBOX:: Rotate: fix size change for rotation by not 90deg
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20529
2025-04-01 19:55:53 +02:00
Jeff Young 7f9a277594 Remove unsafe C-style casts. 2025-04-01 18:04:33 +01:00
Jeff Young 0573a32f36 Fix first tab having no effect after changing grid value. 2025-04-01 16:27:35 +01:00
Jeff Young a1fe0f7faf 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.
2025-04-01 15:26:56 +01:00
Jeff Young 6f6ef8e626 Reset status popup.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20489
2025-04-01 14:36:02 +01:00
Jeff Young 5e0beb97ee Nullptr safety.
KICAD-7DX
2025-04-01 12:19:56 +01:00
Jeff Young 7b76aa4992 Move HasMessageOfSeverity to base class.
KICAD-HPP
2025-04-01 12:19:53 +01:00
Jeff Young 2ce7535318 Stack objects should not have parents or groups.
KICAD-KXY
2025-04-01 12:19:50 +01:00
Jeff Young 22769b9159 Once the selection has changed, we can't commit changes.
KICAD-6Y9, among others.
2025-04-01 12:19:46 +01:00
JamesJCode 9920751eb7 Fix net inspector thaw location to not break selection on MSW 2025-03-31 21:06:52 +01:00
JamesJCode 1202838135 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:47:03 +01:00
Jeff Young 6e566b2819 Remove shadowed type (DRILL_MARKS).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20522
2025-03-31 20:00:16 +01:00
Steven A. Falco 688448f9ab Fedora 43 will need python 3.14 support 2025-03-31 19:46:55 +01:00
Wayne Stambaugh ef5cd6bb28 Merge PAD::addPadPrimitivesToPolygon() into PAD::MergePrimitivesAsPolygon().
It was only used in MergePrimitivesAsPolygon() and it was only a few lines
long.
2025-03-31 14:25:01 -04:00
jean-pierre charras c8b57c50dc 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.
2025-03-31 18:46:47 +02:00
Jeff Young 822e188d55 Knockout entire hatched shape when filling zones.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20510
2025-03-31 17:31:35 +01:00
Wayne Stambaugh d52d0d0aad 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
2025-03-31 11:22:33 -04:00
Jeff Young 9b71102dd8 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.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20398
2025-03-31 15:34:46 +01:00
Jeff Young 14ca6e7b08 Clearer column titles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20509
2025-03-31 15:14:59 +01:00
Jeff Young 4ae4f9ea87 Wait for wxWidgets to destroy window. 2025-03-31 15:14:59 +01:00
JamesJCode 141097549c Fix incorrect iterator container comparison
Fixes Coverity warning CID 548258
2025-03-31 14:39:28 +01:00
Jeff Young 582aef0220 Don't assume a hypertext link is a cross-sheet reference.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20511
2025-03-30 21:55:28 +01:00
Wayne Stambaugh 2b0d082df5 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.
2025-03-30 11:35:06 -04:00
jean-pierre charras d729b34986 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
2025-03-30 17:29:03 +02:00
Jeff Young 9066ad3620 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
2025-03-30 14:22:56 +01:00
Carsten Presser 33ee9e99fe Improve rectifier demo
This demo project used old symbols that don't match the current style of
the library. Replace them with the correct ones.
But also move them to the project library again.
Add a workbook that has the simulation traces selected.
2025-03-30 06:53:21 -04:00
jean-pierre charras 79fbae00ce FP editor preferences: Fix crash when closing (by OK) the dialog if no FP loaded.
After opening the PANEL_FP_EDITOR_FIELD_DEFAULTS panel, due to a null pointer
when no FP loaded in FP editor, closing the dialog by OK button crashed Pcbnew.
2025-03-30 11:19:37 +02:00
jean-pierre charras 97e1c107c9 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
2025-03-30 11:19:37 +02:00
JamesJCode 906c24bc6d Unify length calculation between router, board / frame, and DRC 2025-03-30 09:18:41 +01:00
Jon Evans 12861345d3 API: Brute-force fix for footprint modifications 2025-03-29 23:53:55 -04:00
JamesJCode 7a4325e610 Net inspector groups should be case insensitive 2025-03-30 00:04:37 +00:00
Jeff Young 60a26308ae 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.
2025-03-29 21:24:08 +00:00
Jeff Young 4f115b12a4 Fix format string. 2025-03-29 21:24:08 +00:00
Jeff Young b62f00912e Remove debug assert that's clogging up Sentry. 2025-03-29 21:24:08 +00:00
Jeff Young 408d3a0170 Code clarity. 2025-03-29 21:24:08 +00:00
Jeff Young baaf341d0d Remove debug assert.
Yes, it does indeed fire (a lot, as Sentry can
tell us).
2025-03-29 21:24:08 +00:00
Jeff Young 4783bc4cfd Don't respond to net navigator events while we're updating the wxTreeCtrl. 2025-03-29 21:24:08 +00:00
Jon Evans 31f3c44520 API: Clear footprint caches when making changes 2025-03-29 16:47:13 -04:00
jean-pierre charras 313cc15fd3 French translation update 2025-03-29 12:54:43 +01:00
Jon Evans dc9fa2e2ac More functional fix for IPC API item modifications
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20206
2025-03-28 20:27:45 -04:00
Jon Evans 3bac9344d2 Revert "Switch to operator= for item updates"
This reverts commit d0b22d21bb.
2025-03-28 20:27:45 -04:00
Seth Hillbrand 6d0e0312b2 Update translations 2025-03-28 16:28:56 -07:00
pominglee 175a326307 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.0% (10100 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-03-29 00:27:42 +01:00
Adolfo Jayme Barrientos a4ad5dc773 Translated using Weblate (Spanish)
Currently translated at 85.3% (8704 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-29 00:27:42 +01:00
pominglee 1437e66741 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 98.3% (10031 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-03-29 00:27:42 +01:00
Adolfo Jayme Barrientos 7f32b2452d Translated using Weblate (Spanish)
Currently translated at 85.2% (8701 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-29 00:27:42 +01:00
Wellington Terumi Uemura 1bed76bed8 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (10201 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2025-03-29 00:27:42 +01:00
CloverGit 3990c61ea8 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.6% (10170 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-29 00:27:42 +01:00
Henrik Kauhanen 11ba582d87 Translated using Weblate (Swedish)
Currently translated at 99.5% (10156 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-29 00:27:41 +01:00
CloverGit e6f4b02e9c Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.6% (10163 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-29 00:27:41 +01:00
Adolfo Jayme Barrientos 560e91880e Translated using Weblate (Spanish)
Currently translated at 85.0% (8675 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-29 00:27:41 +01:00
pominglee c187c098ae Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 88.7% (9051 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-03-29 00:27:41 +01:00
Adolfo Jayme Barrientos be4b25026d Translated using Weblate (Spanish)
Currently translated at 85.0% (8673 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-29 00:27:41 +01:00
Ettore Atalan 286518e926 Translated using Weblate (German)
Currently translated at 99.1% (10116 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-29 00:27:41 +01:00
Marco Ciampa 49b145a6a0 Translated using Weblate (Italian)
Currently translated at 99.9% (10191 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-29 00:27:41 +01:00
lylythechosenone 8f9a6fde98 Translated using Weblate (Spanish (Mexico))
Currently translated at 83.9% (8559 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es_MX/
2025-03-29 00:27:41 +01:00
yanzhen zhu 5107bd43e7 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.2% (10126 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-29 00:27:41 +01:00
Pferd O 01936b1683 Translated using Weblate (German)
Currently translated at 99.1% (10113 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-29 00:27:41 +01:00
Henrik Kauhanen 5d49f4a3e9 Translated using Weblate (Swedish)
Currently translated at 98.5% (10054 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-29 00:27:41 +01:00
dsa-t 7c5ce03a93 Translated using Weblate (Russian)
Currently translated at 97.4% (9936 of 10201 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-03-29 00:27:41 +01:00
Seth Hillbrand deb14110aa Remove accident call to default SSHKey
The sshkey should not be reset when changing to https protocol.
2025-03-28 16:25:32 -07:00
Jeff Young 629a12ab2e Don't obliterate user data when syncing copper layer count.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20484
2025-03-28 19:24:58 +00:00
Michael712 d59f624001 Don't use transform coordination for height/width property display of rectangles
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20468
2025-03-28 16:38:12 +00:00
Ian McInerney fd94488289 Mark ODB++ as export-only
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20493
2025-03-28 15:32:03 +00:00
Jeff Young 151cb01795 Mirror pad numbers when appropriate.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20459
2025-03-27 23:28:30 +00:00
Mike Williams 659c783e5e API: unbreak the build (SwapData -> SwapItemData) 2025-03-27 14:11:06 -04:00
Jeff Young 7ba07a3bb0 Use action to change current sheet.
That way it gets into the navigation hierarchy,
the current zoom gets saved, etc.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20466
2025-03-27 17:56:53 +00:00
Mike Williams c67924ccac schematic: convert RunOnChildren to also take recursion mode argument
Prepping for SCH_GROUPS, making consistent with the PCB code.
2025-03-27 13:16:09 -04:00
Mike Williams a90b8ec57a pcb: merge RunOnChildren/Descendants into one function with a mode 2025-03-27 13:16:09 -04:00
Mike Williams 7cf699bc9d eeschema: move SwapData to SwapItemData/swapData paradigm
Used by BOARD_ITEM to support groups, which we are adding to the
schematic. Also adds an unused group pointer for now.
2025-03-27 13:16:09 -04:00
Jeff Young 79924b5dfd Don't gate drill mark plotting on unenabled copper layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20460
2025-03-27 16:57:10 +00:00
Quentin Freimanis 78b6ca8256 clear itemByIdCache in IncrementTimestamp 2025-03-27 11:50:54 -04:00
Jeff Young 8076bfa3c7 Use std::optional to better flag presence of arguments.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20460
2025-03-27 13:58:11 +00:00
Jeff Young 96835cbfcf Job layersets come in already parsed.
Only CLI argments need parsing at the handler level.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20460
2025-03-27 12:01:22 +00:00
Jeff Young 07eda5d57e ADDED: report copper area for current selection.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20439
2025-03-27 10:14:30 +00:00
Jeff Young d16a5bf87d Formatting. 2025-03-27 10:14:30 +00:00
Seth Hillbrand 937f225df0 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

(cherry picked from commit 579c08155f)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20464
2025-03-26 13:11:58 -07:00
Seth Hillbrand 22e1f70a7e Remove requirement for name
Name is not needed for new git repos and is hidden, so can't be set
2025-03-26 12:36:31 -07:00
Jeff Young 88267c4a47 Formatting. 2025-03-26 16:49:36 +00:00
jean-pierre charras 99e65afa1f 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
2025-03-26 16:26:30 +01:00
Jeff Young 01c1ff47ad Don't generate hatched fills for connectivity, etc.
(And in particular, don't regenerate them from
within the multi-threaded connectivity algo.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20451
2025-03-26 14:50:34 +00:00
Jeff Young 2ca09457b0 Formatting. 2025-03-26 14:50:34 +00:00
jean-pierre charras 3dfd164e2b Fix typo 2025-03-26 14:55:25 +01:00
jean-pierre charras 3e51b2c647 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
2025-03-26 13:19:00 +01:00
jean-pierre charras 7bd4fa3fa6 Fix a Coverity and a compil minor warning 2025-03-26 13:19:00 +01:00
Jeff Young 34f12dc4be ADDED: fieldname template reordering.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20420
2025-03-26 11:11:09 +00:00
Tomasz Wlostowski 5f620f0fa1 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
2025-03-26 00:12:43 +01:00
Seth Hillbrand 2dfe4d4716 Cleanup noisy assert
When undoing the addition of a symbol to the schematic, the symbol does
not originally have a parent, so we can't find the current sheet in
order to find the correct pins.  But we know the sheet in the undo list,
so we can just pass it in
2025-03-25 16:02:31 -07:00
Mike Williams cdbf71a562 eeschema: remove old source file 2025-03-25 14:06:37 -04:00
Jeff Young da05ad93ac 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.)
2025-03-25 18:06:00 +00:00
Jeff Young 3380afd9fd Auto-enable user layers that have custom FPEditor names. 2025-03-25 17:34:43 +00:00
Wayne Stambaugh 1b40ddaba5 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
2025-03-25 11:13:33 -04:00
Tomasz Wlostowski 1638322649 KIGIT: fix crash when the repo has no remote set 2025-03-25 16:06:52 +01:00
Wayne Stambaugh 69f758dbcd Update QA configuration files to the latest changes.
This prevents having to revert the changes to these files every time the
QA tests are run.
2025-03-25 10:56:33 -04:00
Wayne Stambaugh 7bc1404956 Fix broken Eeschema QA test when building jumper connectivity.
Don't attempt to access the library symbol jumper pin information when the
symbol doesn't have a valid library symbol reference.
2025-03-25 10:44:30 -04:00
Jeff Young b5cd5d2e27 Remove performance disclaimers from Render Job Options. 2025-03-25 13:25:00 +00:00
Jeff Young 6181fa5a91 Code clarity. 2025-03-25 13:22:24 +00:00
Jeff Young 4cd007cb6d Don't cover STL types. 2025-03-25 13:09:14 +00:00
Jeff Young 6e2914b990 Update terminology. 2025-03-25 12:05:54 +00:00
Jeff Young ab43c3c6b5 Process non-copper keepouts in footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20405
2025-03-25 11:52:34 +00:00
Jeff Young e48ad06cab Footprint editor doesn't need grid overrides for tracks/vias. 2025-03-25 11:13:13 +00:00
Jeff Young 9a7b82a8c0 MOVED: fp editor layer names to Display Options.
(It was on Footprint Defaults, which didn't make
any sense.  Probably just ended up there because
there was similar code there.)

Also fixed a bug with accepting the dialog with
a grid cell editor open.

Also fixed a bug where the number of copper layers
would get set back to 2.

Also fixed a bug where the layer names weren't
getting updated in the Appearances tab.
2025-03-25 10:34:01 +00:00
Jon Evans 1c83f0a70b Implement jumpers for footprints
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2558
2025-03-24 22:17:46 -04:00
Jon Evans 805ca0c791 ADDED: Jumpers for symbols
Support explicit jumper symbols, defined either by a
flag that all pins with the same number are connected,
or by explicit groups of jumpered pins

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2558
2025-03-24 22:08:46 -04:00
Seth Hillbrand cf93cdf13f Respect user preference for rebase/merge 2025-03-24 15:40:25 -07:00
Seth Hillbrand 074b511fab 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
2025-03-24 14:07:23 -07:00
Jeff Young d2b3f8ba28 ADDED: some individual flags for render jobs.
Also fixes bug where error code wasn't returned.

Also fixes bug where user's preferences were being
overwritten with each job.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20436
2025-03-24 20:00:13 +00:00
Seth Hillbrand 9113651076 Update translations 2025-03-24 12:08:07 -07:00
Håvard Syslak 5422cff30b Translated using Weblate (Norwegian Bokmål)
Currently translated at 40.1% (4078 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nb_NO/
2025-03-24 19:59:32 +01:00
Viktor Döme 2fb0fd8de1 Translated using Weblate (Hungarian)
Currently translated at 5.8% (597 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-03-24 19:59:32 +01:00
Adolfo Jayme Barrientos d8f37ff86a Translated using Weblate (Spanish)
Currently translated at 85.1% (8654 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-24 19:59:32 +01:00
Pferd O b57d1f9ab5 Translated using Weblate (German)
Currently translated at 99.5% (10119 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-24 19:59:32 +01:00
Adolfo Jayme Barrientos 09e34d2b58 Translated using Weblate (Catalan)
Currently translated at 41.0% (4172 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-03-24 19:59:32 +01:00
Adolfo Jayme Barrientos 65e1e12eaf Translated using Weblate (Spanish)
Currently translated at 84.5% (8589 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-24 19:59:32 +01:00
co8 j 51ddfa359f Translated using Weblate (Japanese)
Currently translated at 98.8% (10046 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-24 19:59:32 +01:00
Adolfo Jayme Barrientos 6f0350c761 Translated using Weblate (Spanish)
Currently translated at 84.4% (8578 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-24 19:59:32 +01:00
Adolfo Jayme Barrientos 7562f6a804 Translated using Weblate (Catalan)
Currently translated at 40.9% (4165 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-03-24 19:59:32 +01:00
ZbeeGin 3eef769de5 Translated using Weblate (Polish)
Currently translated at 98.3% (9993 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-03-24 19:59:32 +01:00
Marco Ciampa ea62ece5a4 Translated using Weblate (Italian)
Currently translated at 99.9% (10153 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-24 19:59:32 +01:00
Marco Ciampa e167bd8782 Translated using Weblate (Italian)
Currently translated at 99.2% (10083 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-24 19:59:31 +01:00
Marco Ciampa fccddf8330 Translated using Weblate (Italian)
Currently translated at 98.7% (10040 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-24 19:59:31 +01:00
Marco Ciampa 63d5b2bea9 Translated using Weblate (Italian)
Currently translated at 98.5% (10020 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-24 19:59:31 +01:00
Marco Ciampa ef76fbbd94 Translated using Weblate (Italian)
Currently translated at 97.8% (9946 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-24 19:59:31 +01:00
CloverGit 4ab1964a1c Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.6% (10123 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-24 19:59:31 +01:00
Adolfo Jayme Barrientos 84d6ee94c7 Translated using Weblate (Spanish)
Currently translated at 83.5% (8492 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-24 19:59:31 +01:00
Pferd O 95f99c2731 Translated using Weblate (German)
Currently translated at 99.5% (10117 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-24 19:59:31 +01:00
Adolfo Jayme Barrientos 60f331862a Translated using Weblate (Spanish)
Currently translated at 83.5% (8491 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-24 19:59:31 +01:00
ZbeeGin 67b8226960 Translated using Weblate (Polish)
Currently translated at 98.1% (9979 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-03-24 19:59:31 +01:00
Adolfo Jayme Barrientos b678e73e71 Translated using Weblate (Spanish)
Currently translated at 83.3% (8468 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-24 19:59:31 +01:00
co8 j 750956da7b Translated using Weblate (Japanese)
Currently translated at 98.8% (10044 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-24 19:59:30 +01:00
Tokita, Hiroshi 30fc350550 Translated using Weblate (Japanese)
Currently translated at 98.8% (10043 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-24 19:59:30 +01:00
Adolfo Jayme Barrientos 0ee47a3492 Translated using Weblate (Spanish)
Currently translated at 82.7% (8414 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-03-24 19:59:30 +01:00
Marco Ciampa b618cd353b Translated using Weblate (Italian)
Currently translated at 97.8% (9943 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-24 19:59:30 +01:00
Marco Ciampa cfc3364b58 Translated using Weblate (Italian)
Currently translated at 97.1% (9875 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-24 19:59:30 +01:00
co8 j 66f670ca18 Translated using Weblate (Japanese)
Currently translated at 98.7% (10039 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-24 19:59:30 +01:00
Tokita, Hiroshi ab27d41dfe Translated using Weblate (Japanese)
Currently translated at 98.7% (10039 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-24 19:59:30 +01:00
Wellington Terumi Uemura 8dc2733a33 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (10163 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2025-03-24 19:59:30 +01:00
Niyazi 76eee9be4a Translated using Weblate (Turkish)
Currently translated at 65.0% (6606 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-24 19:59:30 +01:00
Pferd O ba782e5bed Translated using Weblate (German)
Currently translated at 98.6% (10026 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-24 19:59:30 +01:00
Henrik Kauhanen c5804bebde Translated using Weblate (Swedish)
Currently translated at 98.9% (10056 of 10163 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-24 19:59:30 +01:00
Seth Hillbrand f83e607e6e Enable/disable git tracking in user prefs
Don't require advanced config for people who want to disable
2025-03-24 11:52:50 -07:00
Mike Williams 6d0a8cd346 pcb design blocks: fix net code mismatch when saving selection 2025-03-24 10:21:27 -04:00
Jeff Young 9c375581ff Don't assert (or crash) on shutdown.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20433
2025-03-24 12:36:44 +00:00
Jeff Young 0a4533703c Performance. 2025-03-24 10:28:41 +00:00
Jon Evans d205a136a9 Ignore KiCad lock files 2025-03-23 20:08:05 -04:00
Jon Evans 8921824128 Mark pad as dirty when changing layerset
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20435
2025-03-23 20:08:05 -04:00
Ethan Chien 52514e1bfe Update CMake presets to version 9 and enhance build configurations for Windows 2025-03-23 03:51:38 +08:00
Seth Hillbrand 36366e254d Ignore autogenerated files 2025-03-22 08:04:31 -07:00
Seth Hillbrand ea36110980 Trying again to fix Mac build 2025-03-21 17:07:28 -07:00
Seth Hillbrand b65ceb60b2 Fix builds for newer libgit2 (1.8.0 and newer) 2025-03-21 17:03:28 -07:00
Seth Hillbrand faf6243d1a Fix build on Windows 2025-03-21 14:42:52 -07:00
Seth Hillbrand b8225ba2d6 Fix some regressions in git handling
Set default to rebase for pull
Update error string on auth failure
Improve trace logging
2025-03-21 11:55:44 -07:00
Jeff Young 0d6838b803 Add support for mixed-state checkboxes in grids.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17730
2025-03-21 13:49:07 +00:00
Jeff Young 5e61a5193f Fix misleading cast. 2025-03-21 13:49:07 +00:00
Seth Hillbrand e6843cde64 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

(cherry picked from commit d2550138bc)
2025-03-20 13:12:44 -07:00
Mike Williams e11cf94a3e design blocks: add PCB design blocks behind advanced config
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2508
2025-03-20 15:13:52 -04:00
JamesJCode e64239969a Fix compiler warnings 2025-03-20 18:42:20 +00:00
Jeff Young 9a1e42f228 Autocomplete for Execute Command job.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19735
2025-03-20 16:59:40 +00:00
Wayne Stambaugh f5cae044d0 Fix Coverity issue #545159 and all related issues.
Don't use fmt::format() when formatting wxString objects.  It will throw
an exception on an argument type mismatch which isn't handled in most
code paths.

This also prevents the conversion of the fmt::format() arguments from
wxString to std::string and the result from std::string back to wxString
for the return value.

https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=545159
2025-03-20 11:16:02 -04:00
Seth Hillbrand b567532af7 Add minimum libgit2 version
Crashes have been reported with libgit2 1.3.2 and ssh key handling

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20204
2025-03-20 06:56:34 -07:00
Jeff Young 59e77e977e Don't use net/netclass colors for label graphic shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19589
2025-03-20 13:52:21 +00:00
Jeff Young 1b7f92f4c5 Refresh search when showing pane.
(Events will have been ignored while it is
hidden.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20009
2025-03-20 12:25:58 +00:00
Jeff Young b366204824 Handle home dir shortcut in jobset destinations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20032
2025-03-20 10:45:53 +00:00
Brendan Hickey 33a8cd942f Increase GerbView max DCode Id to 2^31-1
I (charrasjp) fixed the compil issues of the Brendan Hickey's initial work and some other minor issues.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20323
2025-03-20 11:27:53 +01:00
Jeff Young 86e1d4c684 Shorten opt-in text and improve Yes/No button labels.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20027
2025-03-20 10:24:02 +00:00
Jeff Young 5ec526fe4f Don't write out empty footprint filters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20394
2025-03-20 10:02:26 +00:00
Jeff Young d3f57fac5a Must assign extension to keep from stripping last '.' section.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20065
2025-03-20 09:48:08 +00:00
Jeff Young 0aa4f11970 Fix format string. 2025-03-20 09:48:08 +00:00
jean-pierre charras 21725eeef3 ~EDA_DRAW_PANEL_GAL(): Fix crash: ensure a onShowEvent is not fired.
Due to changes in EDA_DRAW_PANEL_GAL (a wxEVT_SHOW event was added) when
destroyed a dialog using it (namely the PAD editor) a wxEVT_SHOW event was fired
during Dtor process (at least on Windows). It is now disabled in Dtor.
2025-03-20 10:12:59 +01:00
Mike Williams a648fccbb3 schematic editor: remove 10ms OnShow timer to reduce CPU load
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20385
2025-03-19 15:05:54 -04:00
Jeff Young 19d1b6ec52 Don't let legacy overbar processing mess up empty-string test. 2025-03-19 18:14:30 +00:00
Jeff Young eb4a52f372 Remove debugging code accidentally left in. 2025-03-19 17:44:17 +00:00
Jeff Young f0c81e972f Fix accidental ingoring of rotation angle.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20271
2025-03-19 17:16:55 +00:00
Jeff Young 7e046e6c8b Remove '~' == empty_string.
It has long outlived its usefulness (which was
to preserve token sequence in pre-sexpr files).

This will no doubt turn up latent issues....
2025-03-19 17:16:55 +00:00
Wayne Stambaugh bc4a40de76 Fix Coverity issue #543091.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=543091
2025-03-19 12:38:50 -04:00
Wayne Stambaugh 4cb234862c Fix Coverity issue #542006.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=542006
2025-03-19 12:07:05 -04:00
Mike Williams 18010b1104 selection: sort box selection by rows and columns by default
Some tools can take a selection order and it is nice to provide a
sane human-oriented default sorting when box selecting.
2025-03-19 10:25:35 -04:00
Mike Williams 7578439b0c PCB editor: extend create array functionality to arrange existing items
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19919
2025-03-19 10:23:15 -04:00
jean-pierre charras b7fd26e026 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
2025-03-19 11:33:53 +01:00
Jeff Young 8994f6abd7 Leave navigation controls active.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20378
2025-03-19 10:20:43 +00:00
Jeff Young 3328dc48be Don't leave dangling event handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20380
2025-03-19 10:14:24 +00:00
Jeff Young b4640cdc55 Search all fields, hidden or not.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20370
2025-03-19 08:55:32 +00:00
Jeff Young 0a3ddd33ee Use ERROR_INSIDE for knockout text (and a 0 gap). 2025-03-19 08:55:32 +00:00
Jeff Young 824c7ecfa7 Improve readability.
Also drops a parameter that hasn't been implemented
since early 2022.
2025-03-19 08:55:32 +00:00
JamesJCode 983d14d371 Fix compiler warning 2025-03-18 23:46:09 +00:00
JamesJCode 0f1f6b23a8 Test symbol outline collisions for rule areas, not just bounding boxes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20383
2025-03-18 23:04:48 +00:00
JamesJCode 24a8c2a684 Ensure PNS length tuning calculation uses correct layer ID context
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20372
2025-03-18 12:37:16 +00:00
Jon Evans 4ef0d3554e Handle duplicate entries in BOM presets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20342
2025-03-17 18:37:52 -04:00
Jon Evans 2ef123d9e1 Code style 2025-03-17 18:27:33 -04:00
Wayne Stambaugh 7645f05962 Change code formatter configuration files from 100 to 120 characters. 2025-03-17 17:34:15 -04:00
Jeff Young 6307f0aee8 Use board layer names when available.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20360
2025-03-17 21:23:56 +00:00
Jeff Young 142f8265c5 Simplify (and fix) plated copper differentiation.
Also a few fixes for 3D rendering textboxes and
tables.
2025-03-17 20:11:20 +00:00
Jeff Young 683444733a Formatting. 2025-03-17 20:11:20 +00:00
Wayne Stambaugh cf4369a2ef Fix Coverity issue #545180.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=545180
2025-03-17 15:16:49 -04:00
Wayne Stambaugh 19b0ac6ec4 Revert "Fix Coverity issue #545181."
This reverts commit 31d3c17d99.
2025-03-17 15:12:48 -04:00
Wayne Stambaugh 31d3c17d99 Fix Coverity issue #545181.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=545181
2025-03-17 15:09:30 -04:00
Wayne Stambaugh 8fa48c7be2 Fix Coverity issue #514495.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=514495
2025-03-17 14:43:43 -04:00
Wayne Stambaugh 62cb67d854 Fix Coverity issue #541995.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=541995
2025-03-17 14:04:40 -04:00
Jeff Young 5094f750df Adjust GTK STC margins. Yes, again.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16685
2025-03-17 17:33:23 +00:00
Wayne Stambaugh dd806aa902 Fix Coverity issue #542006.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=542006
2025-03-17 13:30:41 -04:00
Wayne Stambaugh 5783623c50 Add code to test if schematic file belongs to another project. 2025-03-17 13:12:35 -04:00
Jeff Young 858f6b0fc2 Adjust GTK STC margins.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16685
2025-03-17 17:00:25 +00:00
Wayne Stambaugh f53d1a5356 Fix Coverity issue #543084.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=543084
2025-03-17 12:55:54 -04:00
Wayne Stambaugh 47984b6793 Coding policy house keeping. 2025-03-17 12:45:25 -04:00
Wayne Stambaugh 4131089260 Fix Coverity issue #544154.
https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=543084
2025-03-17 12:21:02 -04:00
Wayne Stambaugh b364f5dbde Properly prevent duplicate sheet names on paste.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20357
2025-03-17 12:02:01 -04:00
JamesJCode 4a99a3060d 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
2025-03-17 15:55:59 +00:00
Alex Shvartzkop d0518c96b2 Update translations 2025-03-17 18:42:55 +03:00
Marco Ciampa 32e3570758 Translated using Weblate (Italian)
Currently translated at 96.7% (9749 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-17 16:42:09 +01:00
Pferd O 1dfc09a39d Translated using Weblate (German)
Currently translated at 99.2% (10000 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-17 16:42:09 +01:00
ZbeeGin 2230fd2518 Translated using Weblate (Polish)
Currently translated at 98.8% (9962 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-03-17 16:42:09 +01:00
Jan Straka 3e838bce5b Translated using Weblate (Czech)
Currently translated at 76.8% (7737 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2025-03-17 16:42:09 +01:00
Pferd O b6b5c4be54 Translated using Weblate (German)
Currently translated at 99.2% (9999 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-17 16:42:09 +01:00
Marco Ciampa 6fdad6c799 Translated using Weblate (Italian)
Currently translated at 96.3% (9708 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-17 16:42:09 +01:00
Marco Ciampa a06fd8a97e Translated using Weblate (Italian)
Currently translated at 96.3% (9706 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-17 16:42:09 +01:00
Ertuğrul Reisoğlu 5a732b7b9f Translated using Weblate (Turkish)
Currently translated at 65.0% (6556 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-17 16:42:09 +01:00
Henrik Kauhanen 2ac2bffa9e Translated using Weblate (Swedish)
Currently translated at 99.7% (10047 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-17 16:42:09 +01:00
NAXSISFLYBY df02aec8a5 Translated using Weblate (Turkish)
Currently translated at 65.0% (6548 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-17 16:42:09 +01:00
NAXSISFLYBY 627d9e5e50 Translated using Weblate (Turkish)
Currently translated at 65.0% (6548 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-17 16:42:09 +01:00
NAXSISFLYBY 36255b90e4 Translated using Weblate (Turkish)
Currently translated at 64.9% (6546 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-17 16:42:09 +01:00
dsa-t 25f883cf63 Translated using Weblate (Russian)
Currently translated at 98.4% (9920 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-03-17 16:42:08 +01:00
Jan Straka 403c9055ed Translated using Weblate (Czech)
Currently translated at 75.4% (7605 of 10073 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2025-03-17 16:42:08 +01:00
Jeff Young 17712ba321 Improve text alignment in grids and one-line Scintilla controls.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16685
2025-03-17 13:56:10 +00:00
Jeff Young 6c97a40b8c Attempt to fix lack of initialisation on GTK/MSW.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20050
2025-03-17 11:42:11 +00:00
jean-pierre charras 60f65e68c1 Step export: handle castellated pads.
Only pads having the fab property "Castellated" are handled.
2025-03-17 11:14:53 +01:00
Jeff Young 1848401d5b Update layer per page.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20352
2025-03-17 09:51:53 +00:00
Jeff Young dd921354fc Cleanup. 2025-03-17 09:50:06 +00:00
Jeff Young 413d6747c5 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
2025-03-16 20:21:49 +00:00
Jeff Young 1333c4c305 Move layer arg parsing up so we can handle user-defined layer names.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18773
2025-03-16 17:28:44 +00:00
Jon Evans 77747aa41e Use UI order for drill report stackup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20069
2025-03-16 11:13:14 -04:00
Jon Evans fe22166d9f Use stable sort ordering in ERC reports
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20333
2025-03-16 10:25:29 -04:00
Jeff Young 6708f7b10c Fix off-by-one error when dragging to the left.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20307
2025-03-16 12:16:47 +00:00
Jeff Young 533551f014 Don't bleed settings between 3D viewer and 3D footprint preview.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17353
2025-03-16 11:52:56 +00:00
Seth Hillbrand 676dd4ceec Fix inheritance for git_common
Avoids repo type pointer issues when casting from void
2025-03-15 13:05:45 -07:00
Jeff Young f4a5404e0a Resolve variables in hrefs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20340
2025-03-15 19:31:46 +00:00
Jeff Young f9b19bbb5b Fix is-same logic in updateFootprintParameters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19988
2025-03-15 18:42:02 +00:00
Jeff Young f33f10bb38 User-defined layers for 3D viewer. 2025-03-15 16:14:33 +00:00
Alex Shvartzkop 29c0c35f5f Update translations 2025-03-15 19:00:51 +03:00
Marco Ciampa 13c295e141 Translated using Weblate (Italian)
Currently translated at 96.3% (9684 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-15 16:58:21 +01:00
İclal Gör d9a0c001b2 Translated using Weblate (Turkish)
Currently translated at 65.1% (6544 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-15 16:58:21 +01:00
Marco Ciampa e526c5b988 Translated using Weblate (Italian)
Currently translated at 96.3% (9681 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-15 16:58:21 +01:00
İclal Gör 6df678a227 Translated using Weblate (Turkish)
Currently translated at 65.0% (6540 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-15 16:58:21 +01:00
Marco Ciampa e5a275038d Translated using Weblate (Italian)
Currently translated at 96.2% (9675 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-15 16:58:21 +01:00
İclal Gör e6200bb5eb Translated using Weblate (Turkish)
Currently translated at 63.0% (6342 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-15 16:58:21 +01:00
Shuwn Hsu c7bfe02382 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 89.8% (9031 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-03-15 16:58:20 +01:00
Pferd O 6ddd5ae050 Translated using Weblate (German)
Currently translated at 99.3% (9988 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-15 16:58:20 +01:00
Henrik Kauhanen da267aed7e Translated using Weblate (Swedish)
Currently translated at 99.9% (10047 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-15 16:58:20 +01:00
dsa-t dfd81c7521 Translated using Weblate (Russian)
Currently translated at 98.6% (9913 of 10051 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-03-15 16:58:20 +01:00
JamesJCode ede5faee72 Implement dynamic assignment of component classes 2025-03-15 14:33:47 +00:00
aris-kimi bb62444fe9 Fix a git2 related crash when closing KiCad
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20202
2025-03-14 20:00:17 -07:00
Seth Hillbrand de09403b10 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
2025-03-14 18:06:09 -07:00
Seth Hillbrand 2c52f98da4 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
2025-03-14 17:01:03 -07:00
Seth Hillbrand 26c331a837 Adjust git handling
- Utilize scoped deletion for individual git_*_free() calls
- Protect against multiple usage when updating icons
- Reduce frequency of git update calls
2025-03-14 17:01:03 -07:00
JamesJCode 078a01976f Include child SCH_PINs in SCH_RULE_AREA item caches
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20332
2025-03-14 20:57:17 +00:00
Jeff Young 10237c4270 Remove extraneous parameter and fix error dialog title.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20061
2025-03-14 20:00:43 +00:00
Jeff Young 1ee3131e4a Check silk/soldermask collisions in FP checker.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19707
2025-03-14 19:45:26 +00:00
Jeff Young be183c94c0 Make sure color gets set on background layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20241
2025-03-14 15:35:05 +00:00
Jeff Young 8894c470ef 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:49 +00:00
jean-pierre charras 7f1b412203 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)
2025-03-14 15:17:04 +01:00
jean-pierre charras 2210fc3518 minor compil warning fix 2025-03-14 15:01:01 +01:00
jean-pierre charras d3c05c7ccd minor additional fix to commit ddd27f28 2025-03-14 14:58:58 +01:00
Jeff Young 521b411090 Init checkboxes after reading prefs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20309
2025-03-14 13:26:55 +00:00
Jeff Young 3c32f4d31d Refresh preview after rotate/flip/mirror during move.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19561
2025-03-14 13:17:52 +00:00
Lucas Gerads 313232c9f3 Simulator: Fix line offset in intermediate ngspice file
- Fixes issue #20268
- Replace the hard coded line numbers
- Search for "Value:" string instead
2025-03-13 18:29:56 -04:00
Seth Hillbrand 54be62b8fa Allow unprintable characters in LIB_ID
We were allowing people to paste lower-level ASCII characters into a
symbol name, but not load them.  The characters don't print but they
don't break anything either, so allowing them is the most compatible
method
2025-03-13 11:39:11 -07:00
Jeff Young 2304d10879 Fix failure to increment job number.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20034
2025-03-13 16:37:27 +00:00
Jeff Young e48a2b5ee4 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:32:25 +00:00
dsa-t 18b5046fae Fix Eagle PCB layers handling after v9 layer changes.
(cherry picked from commit 2bf369793c)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-03-13 17:48:56 +03:00
Jeff Young f3f9730f2c Render tables & their borders to 3D view.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19981
2025-03-13 14:04:31 +00:00
Jeff Young 93ea523eec 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.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20319
2025-03-13 13:15:47 +00:00
Jeff Young 5996cffabc EE -> SCH (no functional changes) 2025-03-13 13:15:47 +00:00
Alex Shvartzkop d5f02ba7bc Update translations 2025-03-13 15:25:56 +03:00
Marco Ciampa 61a89f1c83 Translated using Weblate (Italian)
Currently translated at 96.1% (9661 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-13 13:23:25 +01:00
co8 j f8a1de4945 Translated using Weblate (Japanese)
Currently translated at 99.0% (9950 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-13 13:23:25 +01:00
Pferd O 7167faaab6 Translated using Weblate (German)
Currently translated at 99.4% (9989 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-13 13:23:25 +01:00
dsa-t 1ac75d2c04 Translated using Weblate (Russian)
Currently translated at 98.6% (9913 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-03-13 13:23:25 +01:00
İclal Gör df1c7802d7 Translated using Weblate (Turkish)
Currently translated at 59.9% (6026 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:25 +01:00
İclal Gör 7c8187cb56 Translated using Weblate (Turkish)
Currently translated at 59.8% (6013 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:25 +01:00
İclal Gör 37dca5b2e6 Translated using Weblate (Turkish)
Currently translated at 58.3% (5862 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:24 +01:00
Argeolog 423ea8deae Translated using Weblate (Turkish)
Currently translated at 57.7% (5802 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:24 +01:00
2tama3 dc8ad32e92 Translated using Weblate (Japanese)
Currently translated at 99.0% (9948 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-13 13:23:24 +01:00
co8 j 02c9336de1 Translated using Weblate (Japanese)
Currently translated at 99.0% (9948 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-13 13:23:24 +01:00
Marc de Miguel 6fdd2cc119 Translated using Weblate (Catalan)
Currently translated at 41.2% (4148 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-03-13 13:23:24 +01:00
Ahmet Saygın ÖĞÜLMÜŞ fd4871409b Translated using Weblate (Turkish)
Currently translated at 57.7% (5803 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:23 +01:00
Marc de Miguel 37249d0fd1 Translated using Weblate (Catalan)
Currently translated at 41.0% (4127 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-03-13 13:23:23 +01:00
İclal Gör 087cd06deb Translated using Weblate (Turkish)
Currently translated at 57.6% (5791 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:23 +01:00
Marc de Miguel d6cfd3e41c Translated using Weblate (Catalan)
Currently translated at 40.9% (4119 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-03-13 13:23:23 +01:00
dsa-t 48fc765a38 Translated using Weblate (Turkish)
Currently translated at 56.8% (5715 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:23 +01:00
İclal Gör 8c700eac1b Translated using Weblate (Turkish)
Currently translated at 56.8% (5715 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:23 +01:00
Marc de Miguel 62fc117473 Translated using Weblate (Catalan)
Currently translated at 40.9% (4115 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-03-13 13:23:23 +01:00
İclal Gör 039b03cd7a Translated using Weblate (Turkish)
Currently translated at 54.7% (5505 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:23 +01:00
Argeolog 487afaad96 Translated using Weblate (Turkish)
Currently translated at 54.4% (5471 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:23 +01:00
İclal Gör 442fa8f511 Translated using Weblate (Turkish)
Currently translated at 54.4% (5471 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:23 +01:00
CloverGit f6d4815c8a Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.8% (10028 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-13 13:23:22 +01:00
CloverGit 3a087b5baf Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 89.8% (9027 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-03-13 13:23:22 +01:00
CloverGit ed29c73763 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.6% (10010 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-13 13:23:22 +01:00
Ahmet Saygın ÖĞÜLMÜŞ 9cdaa7848a Translated using Weblate (Turkish)
Currently translated at 54.3% (5459 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:22 +01:00
Henrik Kauhanen fc264aaa60 Translated using Weblate (Swedish)
Currently translated at 99.9% (10047 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-13 13:23:22 +01:00
Ettore Atalan 9a04c1ce37 Translated using Weblate (German)
Currently translated at 99.3% (9982 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-13 13:23:22 +01:00
Pferd O ea0a26b8a8 Translated using Weblate (German)
Currently translated at 99.3% (9982 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-13 13:23:22 +01:00
dogukansahil 76243ef2c9 Translated using Weblate (Turkish)
Currently translated at 53.9% (5423 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:21 +01:00
Ahmet Saygın ÖĞÜLMÜŞ 99adcbb1ed Translated using Weblate (Turkish)
Currently translated at 53.9% (5423 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-13 13:23:21 +01:00
dsa-t d5ad5f7c81 Translated using Weblate (Russian)
Currently translated at 98.6% (9913 of 10048 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-03-13 13:23:21 +01:00
jean-pierre charras ddd27f2869 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
2025-03-13 11:01:06 +01:00
Seth Hillbrand de4d7882e6 Fix compile 2025-03-12 18:34:22 -07:00
Zenn Geeraerts d31eeb5c1b Use case insensitivity when loading Altium files
Altium is case insensitive, so our match for internal names should be also
2025-03-12 18:23:01 -07:00
JamesJCode 7d8b385a72 Fix compiler warning 2025-03-12 20:03:32 +00:00
Seth Hillbrand 1c245ad01e 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
2025-03-12 11:48:21 -07:00
Seth Hillbrand 96794e94e3 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
2025-03-12 11:48:21 -07:00
jean-pierre charras dd604361d3 LISTBOX_TRICKS::listBoxDeleteSelected(): fix crash when trying to remove 0 entries.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20320
2025-03-12 16:03:01 +01:00
Jeff Young 6df9c90440 Add textOnEdgeCuts to global DRC items list.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20308
2025-03-12 11:30:48 +00:00
Jeff Young e5bedd937c Formatting. 2025-03-12 10:21:59 +00:00
Jeff Young 63435df77d Don't wait for mouse move to draw selection shadows.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20309
2025-03-12 09:41:10 +00:00
jean-pierre charras ccc396a6c2 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.
2025-03-12 09:44:45 +01:00
Jon Evans 95e6ca44c6 Don't use size events for persistence
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20060
2025-03-11 22:36:46 -04:00
Jon Evans 5774338af2 Fix build with protobuf 30
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20300
2025-03-11 17:33:17 -04:00
Jeff Young b7ef57a97d Apply Damjan's rotated table fixes to PCB_TABLE::GetEffectiveShape().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20143
2025-03-11 20:12:32 +00:00
Jeff Young 459cf030b8 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 19:11:11 +00:00
Seth Hillbrand a6fbf4bbdb 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
2025-03-11 09:44:58 -07:00
Jeff Young 31b788c04f Add a bit of protection from integer overflows.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19660
2025-03-11 15:11:31 +00:00
Jeff Young 4a64aa9816 Fix wrapping of text in infobar.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19171
2025-03-11 14:47:26 +00:00
Jeff Young d527ce92ca Formatting. 2025-03-11 11:02:27 +00:00
Jeff Young 7401b57fcb Warning messages for simulation tuning.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20274
2025-03-11 11:02:20 +00:00
Jeff Young b11b1a6f72 Ease in a bit more fmt::format(). 2025-03-11 10:08:04 +00:00
Jeff Young b569d919ea No more invisible (non-field) text. 2025-03-10 21:58:30 +00:00
Jeff Young 9ac851b314 Fixes for CLI input and output directories.
Plot functions use an output directory.

Those functions that support an input directory also support
input files.
2025-03-10 20:11:39 +00:00
Jeff Young 567da3de91 Tables support for router.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20295
2025-03-10 15:45:42 +00:00
Jeff Young 6ac64d290b 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-10 13:34:01 +00:00
Alex Shvartzkop c4655da4e6 Don't translate wxFileDialog "All Files" filter.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20297
2025-03-10 16:05:56 +03:00
Lucas Dumont 3ddaa24775 Change deleting for-range loop to while loop
It seem that the iterator may be invalidated in the loop.
By always taking the first element and looping until empty, we avoid the issue

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20283
2025-03-09 19:34:13 -07:00
Tomasz Wlostowski c05cc345f3 multichannel: possible fix for ghosting footprints when using grouping 2025-03-09 23:36:54 +01:00
Tomasz Wlostowski b1bf5127fa connectivity: treat empty FPIDs as matching in TOPO_MATCH 2025-03-09 23:36:54 +01:00
Tomasz Wlostowski 8192ba73d9 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.
2025-03-09 23:36:53 +01:00
Tomasz Wlostowski 91ee987cfe 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.
2025-03-09 23:36:27 +01:00
Jeff Young a468c486eb DRC for tables. (And some fixes for dimensions.) 2025-03-09 17:59:32 +00:00
Jeff Young 4b38932129 Group members are still children of the board (not
the group).
2025-03-09 17:59:32 +00:00
Alex Shvartzkop b13318b854 Update translations 2025-03-09 19:04:34 +03:00
dsa-t e72c5e9e82 Translated using Weblate (Turkish)
Currently translated at 53.0% (5330 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-09 17:04:08 +01:00
Argeolog f5629f04e3 Translated using Weblate (Turkish)
Currently translated at 53.0% (5331 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-09 17:04:08 +01:00
Argeolog 8caa051e8b Translated using Weblate (Turkish)
Currently translated at 52.8% (5312 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-09 17:04:07 +01:00
Argeolog cd0cbb5acb Translated using Weblate (Turkish)
Currently translated at 52.7% (5304 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-09 17:04:07 +01:00
Wellington Terumi Uemura e674827255 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (10047 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2025-03-09 17:04:07 +01:00
Argeolog c6fee328e2 Translated using Weblate (Turkish)
Currently translated at 52.7% (5303 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-03-09 17:04:07 +01:00
Ettore Atalan 569d38c39e Translated using Weblate (German)
Currently translated at 99.3% (9977 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-09 17:04:07 +01:00
ZbeeGin b47b04b795 Translated using Weblate (Polish)
Currently translated at 98.9% (9945 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-03-09 17:04:07 +01:00
Pferd O 2335fa7708 Translated using Weblate (German)
Currently translated at 99.2% (9974 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-09 17:04:07 +01:00
Rigo Ligo 97753e8208 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.4% (9995 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-09 17:04:07 +01:00
CloverGit 456e2e18b4 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.4% (9995 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-09 17:04:07 +01:00
co8 j 2d81ba665a Translated using Weblate (Japanese)
Currently translated at 98.8% (9936 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-09 17:04:07 +01:00
Marco Ciampa a7b9d1cabe Translated using Weblate (Italian)
Currently translated at 96.1% (9664 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-09 17:04:07 +01:00
Henrik Kauhanen 35eaef151c Translated using Weblate (Swedish)
Currently translated at 99.9% (10046 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-09 17:04:07 +01:00
Henrik Kauhanen 6de078ffad Translated using Weblate (Finnish)
Currently translated at 97.8% (9829 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fi/
2025-03-09 17:04:06 +01:00
CloverGit 17eb1f0558 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.3% (9977 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-09 17:04:06 +01:00
dsa-t 7e7b78707d Translated using Weblate (Russian)
Currently translated at 98.6% (9913 of 10047 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-03-09 17:04:06 +01:00
Jeff Young 2ed2d733c3 Revert 1f620e9cca.
(A group member is still a child of the board; it's just
also a member of the group.)
2025-03-09 16:01:08 +00:00
Alex Shvartzkop dc961d37ad Optimize SHAPE_LINE_CHAIN_BASE::EdgeContainingPoint. 2025-03-09 16:27:07 +03:00
Alex Shvartzkop b91e005277 Pre-fetch segments in SHAPE_LINE_CHAIN::SelfIntersecting. 2025-03-09 16:27:04 +03:00
Alex Shvartzkop a82916f4db Improve performance of SEG::Contains. 2025-03-09 16:27:01 +03:00
Alex Shvartzkop 18d836ef8b Reduce CSegment calls in SHAPE_LINE_CHAIN::SelfIntersecting. 2025-03-09 16:26:57 +03:00
Jeff Young 0a3f14c855 Sync selection & selection flags after replacing fields. 2025-03-09 11:47:31 +00:00
Jeff Young 1f620e9cca forAllGeometryItems must account for PCB_GROUP descendants. 2025-03-09 11:47:31 +00:00
Jeff Young e163c40e54 Formatting. 2025-03-09 11:47:31 +00:00
JamesJCode 85e6978aa2 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.
2025-03-08 22:18:22 +00:00
Jeff Young 50174ec528 Beware of infinite recursion on colliding hatched shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20264
2025-03-08 21:23:14 +00:00
Marek Roszko ab6ee168cf Convert PDF_PLOTTER to fmtlib 2025-03-08 14:29:20 -05:00
Jeff Young 241962a84d 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:11:23 +00:00
jean-pierre charras 6729e313a5 Pcbnew, DIALOG_DRC: fix incorrect behavior of Shaw All checkbox. 2025-03-08 18:23:08 +01:00
jean-pierre charras 4ef627edb9 GERBER_PLOTTER: fix missing separator (comma) after ADDxxOutlinexP
It was missing after commit 2cdc1ed8
2025-03-08 16:36:49 +01:00
Marek Roszko 2cdc1ed88e Move GERBER_PLOTTER to fmtlib 2025-03-08 07:56:54 -05:00
jean-pierre charras 9a1cf81ca6 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.
2025-03-08 10:09:47 +01:00
jean-pierre charras 9d1b320896 Fix compil warnings 2025-03-08 09:40:23 +01:00
Seth Hillbrand 641e06e67c 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
2025-03-07 17:31:02 -08:00
Seth Hillbrand 4ef81ee3ea Revert "Remove prototype zone fill option"
This reverts commit 3f17aabcd0.
2025-03-07 15:25:13 -08:00
Seth Hillbrand 4f6a73d83c Prevent ERC error with NC pin+NC marker
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20222
2025-03-07 15:24:30 -08:00
Seth Hillbrand 3f17aabcd0 Remove prototype zone fill option
This option is not exposed in the UI or advanced config and duplicates
the action of changing the zone fill type and creates additional ways
that boards can be modified by local, non-board settings.
2025-03-07 13:45:40 -08:00
Damjan bded181ad0 pcbnew: table rotation: table jumps if rotation ends at 180° 2025-03-07 20:38:56 +00:00
Jeff Young 95d8634401 Fix drawing of selected/highlighted local power port labels.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20262
2025-03-07 20:33:19 +00:00
Jeff Young eedd811c0a Fix bad static_cast. 2025-03-07 18:42:45 +00:00
Jeff Young 880442e8ed Propagate damage from footprint children. 2025-03-07 17:52:53 +00:00
Jeff Young b532a849b8 Don't attempt to knockout self from hatching. 2025-03-07 17:52:53 +00:00
Seth Hillbrand b401505259 Fix previous commit 2025-03-07 08:42:35 -08:00
Seth Hillbrand 1157b5b0b3 Add missing arch directory to appimage plugin 2025-03-07 08:42:12 -08:00
Seth Hillbrand 2b557c5497 Revert "Allow a no-connect to connect to a single pin (but not multiple pins)."
This reverts commit ee4a6127c6.
2025-03-07 08:10:04 -08:00
Jeff Young 0fae6a0db0 Initialize field ordinals for LIB_SYMBOLs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20263
2025-03-07 15:52:31 +00:00
Jeff Young 727fc9bd06 Fix merge mess-up. 2025-03-07 13:23:57 +00:00
Marek Roszko dd4c9af265 Move HPGL_PLOTTER to fmtlib 2025-03-07 08:02:13 -05:00
Jeff Young 877c6bce89 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.)
2025-03-07 13:01:00 +00:00
Jeff Young ce5469b95e 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
2025-03-07 13:01:00 +00:00
Marek Roszko a1e897c245 Move PS_plotter to fmtlib
Also we wrote %Page but the postscript standard wants %%Page
2025-03-07 07:05:13 -05:00
Seth Hillbrand 7558b49afd Ensure all via layers are printed 2025-03-06 17:57:34 -08:00
Seth Hillbrand ca51b0f37d 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
2025-03-06 16:08:04 -08:00
Seth Hillbrand 81fcc16cc9 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
2025-03-06 15:18:51 -08:00
JamesJCode 54540f9e82 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
2025-03-06 21:43:52 +00:00
Seth Hillbrand c24832f72b Fix IsEffectiveLine calculation
We sometimes represent circles as 360° arcs.  These are approximately
colinear but are definitely not a line
2025-03-06 12:45:10 -08:00
JamesJCode 57952a7a86 Fix Specctra export for multiple netclasses 2025-03-06 20:24:56 +00:00
Seth Hillbrand 8e048d0c42 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
2025-03-06 12:18:38 -08:00
Wayne Stambaugh a1b78d170d 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.
2025-03-06 15:12:57 -05:00
Jeff Young 413468cd04 Resolve hotkey conflicts.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18201
2025-03-06 16:53:11 +00:00
Seth Hillbrand 8ee263b341 Ensure that layers are set prior to assigning nets
Zones will have their net code cleared if they are non-copper items, so
we need to ensure that the zone exists on a copper layer

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20219
2025-03-06 08:49:25 -08:00
Seth Hillbrand 4b07565d35 Remove debug printing 2025-03-06 08:13:57 -08:00
JamesJCode 68b6c2d1da Add Orientation DRC property QA check 2025-03-06 15:56:39 +00:00
Jeff Young 52648497b2 Formatting. 2025-03-06 15:47:18 +00:00
Jeff Young 5c91a7fa3a Don't treat version-bumped file as modified.
But do allow Save to still work.
2025-03-06 15:37:18 +00:00
Jeff Young 124eccb710 Move arrow direction to more appropriate section.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20208
2025-03-06 14:26:25 +00:00
JamesJCode 671d84562b Enable use of double properties in DRC rules expression parser
Also removes previous special-casing of FOOTPRINT Orientation
property as this is now supported natively

Also fixes name clash with Orientation property for footprints
2025-03-06 14:24:47 +00:00
JamesJCode 3d41eca856 Fix use of footprint Orientation property in DRC expression parser 2025-03-06 13:08:03 +00:00
Marek Roszko c92014f759 Move DXF_PLOTTER to fmtlib 2025-03-06 07:26:47 -05:00
Alex Shvartzkop c6ccb195a1 Update translations 2025-03-06 13:54:17 +03:00
Marco Ciampa f104ded1d5 Translated using Weblate (Italian)
Currently translated at 96.0% (9646 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-06 11:53:12 +01:00
Marco Ciampa c738bc9f37 Translated using Weblate (Italian)
Currently translated at 95.6% (9605 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-06 11:53:12 +01:00
CloverGit 95dd38c3e8 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.3% (9978 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-06 11:53:12 +01:00
Henrik Kauhanen 985a62aad2 Translated using Weblate (Swedish)
Currently translated at 99.9% (10039 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-06 11:53:12 +01:00
Henrik Kauhanen f6aa8a0e3d Translated using Weblate (Finnish)
Currently translated at 97.9% (9830 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fi/
2025-03-06 11:53:12 +01:00
Kliment 02b603af50 Translated using Weblate (Finnish)
Currently translated at 97.9% (9830 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fi/
2025-03-06 11:53:11 +01:00
Henrik Kauhanen 72a832175e Translated using Weblate (German)
Currently translated at 99.3% (9973 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-06 11:53:11 +01:00
Pferd O 378e1765a0 Translated using Weblate (German)
Currently translated at 99.3% (9973 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-06 11:53:11 +01:00
Kliment 8907937e94 Translated using Weblate (German)
Currently translated at 99.3% (9973 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-06 11:53:11 +01:00
Henrik Kauhanen de49ba63c1 Translated using Weblate (Swedish)
Currently translated at 99.9% (10039 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-06 11:53:11 +01:00
Kliment fdfc28c034 Translated using Weblate (Finnish)
Currently translated at 97.5% (9790 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fi/
2025-03-06 11:53:11 +01:00
Kliment 80753f2f6e Translated using Weblate (German)
Currently translated at 99.3% (9970 of 10040 strings)

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

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2025-03-06 11:53:11 +01:00
CloverGit cff5888751 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.3% (9978 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-06 11:53:11 +01:00
Henrik Kauhanen 22f4b6bad5 Translated using Weblate (Swedish)
Currently translated at 99.9% (10039 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-06 11:53:11 +01:00
co8 j c22ed9aa39 Translated using Weblate (Japanese)
Currently translated at 98.8% (9927 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-06 11:53:11 +01:00
Pferd O f80c52f0af Translated using Weblate (German)
Currently translated at 99.2% (9964 of 10040 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-06 11:53:11 +01:00
Jeff Young ee4a6127c6 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:27:11 +00:00
Jeff Young 38cf86cb09 Don't flag double no-connect annotations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20222
2025-03-06 10:27:07 +00:00
jean-pierre charras e54c73b516 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
2025-03-06 09:52:26 +01:00
jean-pierre charras af3aba3c46 Revert "SCH_IO_MGR::GuessPluginTypeFromLibPath(): fix incorrect behavior"
This reverts commit 3051a40376.
It was incorrect for non Kicad lib files.
2025-03-06 08:18:57 +01:00
Marek Roszko 086b9907c2 Convert fputs to fmt::print to get exceptions on io fail 2025-03-05 21:28:56 -05:00
Marek Roszko 237953fd55 Move SVG_PLOTTER to {fmt} to punt locale issues 2025-03-05 19:03:25 -05:00
Seth Hillbrand ff6eb9c091 Apparently, despite documentation, this was missing
Only APPDIR is set.  We also set some APPRUN_* variables that we could
use if this ends up being too similar to other elements
2025-03-05 15:35:31 -08:00
Jon Evans 984041f57e Fix accidental removal of properties pane 2025-03-05 17:44:47 -05:00
Seth Hillbrand 4a3b33df4e 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
2025-03-05 13:28:01 -08:00
JamesJCode f0e287a87b 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.
2025-03-05 20:30:54 +00:00
Seth Hillbrand c108b20616 Cleanup unused code 2025-03-05 11:33:38 -08:00
JamesJCode a091b6c1c9 Fix incorrect inequality in component class expression evaluation 2025-03-05 19:10:48 +00:00
JamesJCode c7cec5f21a Fix broken placement of SCH_DIRECTIVE_LABELs 2025-03-05 19:10:48 +00:00
Seth Hillbrand 8e10c539f5 Remove dependency on Visual lib for OCC 2025-03-05 11:03:07 -08:00
Jeff Young 9856cb2210 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
2025-03-05 17:59:22 +00:00
Jeff Young 305bb6302b 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 17:59:22 +00:00
jean-pierre charras 3051a40376 SCH_IO_MGR::GuessPluginTypeFromLibPath(): fix incorrect behavior
GuessPluginTypeFromLibPath() was previously testing the tye, but also the
existence of the lib file, but we only need to know the plugin type of
the given file, regardless it exists or not.
2025-03-05 18:24:37 +01:00
jean-pierre charras b0c42362b6 French translation update 2025-03-05 18:20:42 +01:00
Jon Evans 50507212fd Fix pad edit fighting with active group
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20129
2025-03-05 00:04:47 -05:00
Marek Roszko 4f4ece61bb Move the fp svg cli to more similar plot code 2025-03-04 23:01:00 -05:00
Seth Hillbrand fdcfa8f354 Add additional OCCT search path 2025-03-04 20:00:40 -08:00
Jon Evans a6ef2d97fb Improve 259e249a for macOS 2025-03-04 22:56:24 -05:00
Jon Evans 259e249aed Improve default sizes of right panels
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19965
2025-03-04 21:54:31 -05:00
Jon Evans 32b5cf6221 Fix broken build 2025-03-04 21:32:42 -05:00
Jon Evans d0b22d21bb Switch to operator= for item updates
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20206
2025-03-04 21:12:21 -05:00
Seth Hillbrand 49a4699d5a ADDED: Local power symbol option
Local power symbols work like regular power symbols except that they are
scoped only the the sheet in which they are instantiated

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2075
2025-03-04 17:07:46 -08:00
Jeff Young 699fd2b3ac Implement severity checking for CLI_REPORTER. 2025-03-05 00:12:08 +00:00
Jeff Young 9be7464681 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:39:19 +00:00
Marek Roszko 4248fba976 Add back custom add_choices function to argparse 2025-03-04 18:31:53 -05:00
Marek Roszko 9eb2b13833 Update argparse to latest 2025-03-04 18:31:53 -05:00
Mark Roszko 7a7dfdc043 Edit CODEOWNERS 2025-03-04 23:23:45 +00:00
Tomasz Wlostowski 6a0efe6883 IO_BASE: don't try to modify the case of a temporary string in-place, work on a copy 2025-03-05 00:23:04 +01:00
Wayne Stambaugh 251a6ea8cb Update GitLab CODEOWNERS information. 2025-03-04 14:54:09 -05:00
Jeff Young d9c952d90c Don't add CONSTRUCTION_GEOM to the selection.
We'll crash later after it gets freed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20211
2025-03-04 14:12:54 +00:00
Jeff Young b0e2e9e35e Report errors from jobset plotting.
Also fixes an out-of-scope smart-pointer access.
2025-03-04 13:27:31 +00:00
Jeff Young ea9cece5fe Button margins.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20207
2025-03-04 13:26:46 +00:00
Wayne Stambaugh 001d3dfd88 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.
2025-03-04 07:59:45 -05:00
Damjan b419058df3 pcbnew: Plotting tables with non-90 degree rotation angles is not working 2025-03-04 12:08:18 +00:00
Jeff Young c61b6b8bdd Initialize props of fields created by BOM table.
We use the same algorithm as the Symbol Properties
dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20212
2025-03-04 11:57:24 +00:00
Jeff Young f00947266f 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 11:29:05 +00:00
Marek Roszko b6743653f3 Restore the page size mode behavior
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20014
2025-03-03 23:15:32 -05:00
Alex Shvartzkop 28ce3c2e7d Update translations 2025-03-04 06:36:23 +03:00
Pferd O 56997e75e9 Translated using Weblate (German)
Currently translated at 99.7% (9970 of 9991 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-04 04:35:51 +01:00
Arnau Llovet Vidal 8e5d2e18e7 Translated using Weblate (Catalan)
Currently translated at 41.0% (4106 of 9991 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ca/
2025-03-04 04:35:51 +01:00
Henrik Kauhanen 0f92164f29 Translated using Weblate (Swedish)
Currently translated at 99.9% (9990 of 9991 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-04 04:35:51 +01:00
Pferd O 48e5de1a50 Translated using Weblate (German)
Currently translated at 99.6% (9956 of 9991 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-04 04:35:51 +01:00
Henrik Kauhanen 9f4b242713 Translated using Weblate (Swedish)
Currently translated at 99.7% (9971 of 9991 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-04 04:35:51 +01:00
Henrik Kauhanen 16b8649969 Translated using Weblate (Swedish)
Currently translated at 99.3% (9929 of 9991 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-04 04:35:51 +01:00
dsa-t 60889bebd4 Translated using Weblate (Russian)
Currently translated at 99.1% (9907 of 9991 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-03-04 04:35:51 +01:00
Pferd O 51ee5c97ff Translated using Weblate (German)
Currently translated at 99.5% (9946 of 9991 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-04 04:35:51 +01:00
Seth Hillbrand aff0ad971f Update search dialog
Allow regular expression in search and replace
Allow searching netnames including nets contained in buses

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17102
2025-03-03 16:57:49 -08:00
Seth Hillbrand 1e9cf4e3d7 Add ability to quickly move through nets
After highlighting a net (`), press Tab to quikcly move to the next item
on the net and Shift-Tab to move to the previous

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10911
2025-03-03 14:02:43 -08:00
Jeff Young 7cfa826c9a Put non-sided layers on front, not back of board.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20201
2025-03-03 21:38:14 +00:00
Jeff Young 3960480819 Fix SCH plot to PDF for jobsets.
(Fix for CLI bug #19522 broke it for jobsets.)
2025-03-03 21:38:14 +00:00
Jeff Young 92b4b7187e 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 21:38:14 +00:00
Jeff Young 1808fcec78 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 21:38:14 +00:00
JamesJCode d9ab3a6228 Fix unused variable compiler warning 2025-03-03 20:51:03 +00:00
Seth Hillbrand 2afa67f946 Allow AppImages to pick out different location
Don't assume that libraries are located in the CMAKE lib install
directory as AppImage will relocate them based on the mount point
2025-03-03 12:34:31 -08:00
jean-pierre charras a32c0a8687 Fix compil issue on mingw (missing change from OUTPUT to DESTINATION) 2025-03-03 20:02:28 +01:00
Jeff Young d8cdb69831 Jobset Output -> Destination. 2025-03-03 18:34:33 +00:00
Seth Hillbrand 6f6ca2a35f Allow multi label input
This is a re-implementation of 39c2745f55
that was removed by e5089d783d

This implementation works in the tool, containing side effects
(hopefully) better than the initial implementation.  The multiple labels
are input as multiple lines instead of labels with spaces, allowing for
copy/paste between spreadsheets of labels

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10950
2025-03-03 09:03:02 -08:00
Jeff Young afa4ebcc84 Handle exporting symbols into libraries already under LIB_MGR.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17840
2025-03-03 14:00:57 +00:00
Jeff Young 6b146874c1 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
2025-03-03 12:37:36 +00:00
Jeff Young 1c48e97cd7 Formatting. 2025-03-03 12:31:33 +00:00
Jeff Young d0e86cad7c Disable multi-via dragging.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20150
2025-03-03 11:01:33 +00:00
Jeff Young 46378dc760 Dirty hatching from SwapShape().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20180
2025-03-03 10:35:05 +00:00
Jeff Young bb074f73aa Fix alignment issues in Track & Via properties. 2025-03-03 10:35:05 +00:00
Kreijstal c2685ef76f Fix compilation on mingw 2025-03-03 01:56:30 +00:00
Daniel Treffenstädt 27edf0b949 ADDED: Per layer properties of zones used for control over zone hatching position 2025-03-02 20:31:04 +00:00
Jeff Young b0eef3ee28 Persist some missing jobset arguments.
Also adds some missing CLI arguments.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20116
2025-03-02 19:27:15 +00:00
Jeff Young 3fc87a841d Yet another static line issue. 2025-03-02 18:43:12 +00:00
Jeff Young 559a966ef7 Yet another static line issue. 2025-03-02 18:43:09 +00:00
Jeff Young 164eff1a3b Handle circular holes with y==0.
(Because legacy code assumed this.)
2025-03-02 17:51:44 +00:00
Jeff Young 7d9dd50b08 Remove extra divider from Pad Properties. 2025-03-02 17:28:44 +00:00
Jeff Young dc12fdfc33 Remove extra divider from Pad Properties. 2025-03-02 17:25:44 +00:00
Jeff Young f5d2b40c9e Compiler warnings. 2025-03-02 17:12:05 +00:00
Jeff Young 163a26111a Introduce lambda to improve readability. 2025-03-02 16:05:35 +00:00
Jeff Young b1a4b77291 Solid fill mode is FILL_T::FILLED_WITH_COLOR for SCH_SHAPE.
(It can also be FILL_T::FILLED_WITH_BACKGROUND_COLOR
for symbol items, but those have their own getters/
setters.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20168
2025-03-02 16:05:35 +00:00
Jeff Young 833bcba06c Simplify background colour handling. 2025-03-02 16:05:35 +00:00
jean-pierre charras 925f2f9bc1 class TOOLBAR_ITEM_TYPE: replace GROUP by TB_GROUP (collision with a Windows header) 2025-03-02 14:49:03 +01:00
jean-pierre charras b0fe4df3c5 More fixes about use of IN versus INCH 2025-03-02 13:59:25 +01:00
jean-pierre charras 2890500f4c PANEL_TOOLBAR_CUSTOMIZATION: fix sizer issues. 2025-03-02 12:53:59 +01:00
jean-pierre charras 0acdabd1eb Fix other places where "IN" is used instead of INCH (mainly QA tests) 2025-03-02 12:52:16 +01:00
Jeff Young 1a10b5fb64 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:34:21 +00:00
Jeff Young 8d096590dc Windows compiler doesn't like the trailing ','? 2025-03-02 11:34:21 +00:00
jean-pierre charras 5694c90ae9 Fix a compil issue on msys2 / gcc 14.2.0 2025-03-02 11:36:38 +01:00
jean-pierre charras eaa1e6d594 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
2025-03-02 11:34:30 +01:00
Jeff Young 307798ac92 Deprecate (instead of remove) --plot-invisible-text
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20171
2025-03-01 21:58:31 +00:00
Jeff Young f951497a4f Code brevity. 2025-03-01 21:58:31 +00:00
Jeff Young 481e467968 Formatting; code brevity. 2025-03-01 21:58:31 +00:00
Jeff Young ef75f63f10 Consistent spacing. 2025-03-01 21:58:31 +00:00
Jon Evans 547a063981 Make sure to fully repaint pads when loading a board
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19896
2025-03-01 16:54:27 -05:00
Jeff Young 8b541f03e9 Edit CODEOWNERS 2025-03-01 21:53:29 +00:00
Seth Hillbrand b21814b973 Global labels are labels too
And without knowing that they are labels, we might accidentally think
that they are text items, crashing KiCad.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20174
2025-03-01 13:34:32 -08:00
JamesJCode 93549a649b Fix unused variable compiler warnings 2025-03-01 18:32:18 +00:00
Daniel Treffenstädt 3768221d9c ADDED: Support for IPC-4761 Via protection features
Fixes https://gitlab.com/kicad/code/kicad/-/work_items/18837
2025-03-01 18:02:54 +00:00
jean-pierre charras 5bdeb40d66 French translation update 2025-03-01 17:45:33 +01:00
Jon Evans 10cb0592ee Fix SCH_SHEET field layer settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20128
2025-03-01 11:19:47 -05:00
jean-pierre charras 00dca4edb3 Pcbnew, hatched fill shapes: fix 2 issues:
- Ensure the hatched fill polygon is fractured in all cases
- ensure the filled polygon only, not the outline, is drawn
2025-03-01 16:59:09 +01:00
Jon Evans 49a5b44220 Fix usage of CmpNoCase in SymbolNameInUse
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20165
2025-03-01 10:56:13 -05:00
Jon Evans e44eed6e6b 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
2025-03-01 10:43:04 -05:00
Jon Evans 51f56ab31c 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
2025-03-01 10:39:35 -05:00
Alex Shvartzkop 8762f7e5e6 Update translations 2025-03-01 18:34:32 +03:00
Henrik Kauhanen c5c368af6c Translated using Weblate (Swedish)
Currently translated at 99.9% (9947 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-03-01 16:32:43 +01:00
co8 j a3b5c209d8 Translated using Weblate (Japanese)
Currently translated at 99.8% (9940 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-03-01 16:32:43 +01:00
ZbeeGin e8aad579ec Translated using Weblate (Polish)
Currently translated at 100.0% (9951 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-03-01 16:32:43 +01:00
Pferd O 72a2ae5fa1 Translated using Weblate (German)
Currently translated at 100.0% (9951 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-01 16:32:43 +01:00
Wellington Terumi Uemura 2f7a4518b6 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9951 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2025-03-01 16:32:43 +01:00
Marco Ciampa 6d7f958026 Translated using Weblate (Italian)
Currently translated at 96.2% (9578 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-03-01 16:32:43 +01:00
CloverGit 344d501d82 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 99.8% (9939 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-03-01 16:32:43 +01:00
dsa-t 8050cb614d Translated using Weblate (Russian)
Currently translated at 99.7% (9922 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-03-01 16:32:43 +01:00
Pferd O 3d43e026af Translated using Weblate (German)
Currently translated at 99.8% (9937 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-03-01 16:32:43 +01:00
109247019824 92eb945a46 Translated using Weblate (Bulgarian)
Currently translated at 8.2% (823 of 9951 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/bg/
2025-03-01 16:32:43 +01:00
Jon Evans 99cdb6238c Mark the entire file as optional 2025-03-01 09:48:10 -05:00
Jon Evans 47b955b187 Add CODEOWNERS file for suggesting MR reviewers 2025-03-01 09:44:51 -05:00
Fabien Corona 81428e14a6 iec60664-1 : preferred values 2025-03-01 08:27:42 +01:00
Jeff Young c0e4c6a865 Persist generate-gerber-job-file setting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20158
2025-02-28 22:10:24 +00:00
Dhineshkumar S 6e66b22a13 Fix cell selecting instead of table dragging in schematic editor
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17380
2025-02-28 19:14:56 +00:00
Jeff Young 7f935e290a Fracture hatched fill polygon.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20125
2025-02-28 18:52:56 +00:00
Jeff Young 2aa0c15b41 FOOTPRINT::GetBoundingHull(): don't crash on non-copper layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20124
2025-02-28 18:49:41 +00:00
Jeff Young 26871b56f0 Provide easier on-ramp for jobsets.
1) Perform initial save of new jobset.
2) Add default output folder to new jobset.
2025-02-28 18:49:26 +00:00
Seth Hillbrand 18ac99d838 Prevent fetch without repo
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20152
2025-02-28 08:34:24 -08:00
jean-pierre charras 75bed91789 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
2025-02-28 09:42:07 +01:00
Ian McInerney e202b00a74 Rework the toolbar settings storage and panel
This format is more extendable in the future, should separator and
spacer support be added to groups.

Also, this now has a working UI for modifying the toolbars.
2025-02-28 02:05:50 +00:00
Ian McInerney 18e5a16040 Improve the toolbar customization UI 2025-02-28 01:57:37 +00:00
Ian McInerney 85810510f4 Tweak toolbar settings a bit
* Manage the settings using the settings manager for better lifetimes
* Better architect the internals and JSON to make it easier to identify
  the various tool types
2025-02-28 01:57:37 +00:00
Ian McInerney ab114c4159 Put preferences panes for toolbars, but hide behind an advanced config
There is still more work to do to make this feature actually
user-friendly and make it so people can't break their UI config too
easily.
2025-02-28 01:57:37 +00:00
Ian McInerney e53c155b8c Initial dialog work 2025-02-28 01:57:37 +00:00
Ian McInerney 548334b4e2 Load toolbar configuration from settings 2025-02-28 01:57:37 +00:00
Ian McInerney caa03ab59e Add setting for custom toolbar and read custom toolbar config 2025-02-28 01:57:37 +00:00
Ian McInerney 7e2a81da15 Initial JSON work 2025-02-28 01:57:37 +00:00
Ian McInerney 29c62e9d9a Move project manager actions to the tool framework 2025-02-28 01:57:37 +00:00
Ian McInerney ea2f8a63c1 Actionize more PCB actions 2025-02-28 01:57:37 +00:00
Ian McInerney 784246575b Move footprint viewer/cvpcb actions to tool framework 2025-02-28 01:57:37 +00:00
Ian McInerney 04ab369a49 Make the PCB layerbox not needed in pcbcommon 2025-02-28 01:57:37 +00:00
Ian McInerney 9e9db8bd4d Make tool framework assert more useful 2025-02-28 01:57:37 +00:00
Ian McInerney c18bc2472b Actionize more 3D viewer actions 2025-02-28 01:57:37 +00:00
Ian McInerney 384ca6bf98 Actionize more toolbar items 2025-02-28 01:57:37 +00:00
Ian McInerney fc6f3f2332 Formatting tweak 2025-02-28 01:57:37 +00:00
Ian McInerney f0a76f62b6 Cleanup PCB/fpeditor layer box handling 2025-02-28 01:57:37 +00:00
Ian McInerney 7ad1103f55 Move toolbars to a serializable storage format 2025-02-28 01:57:37 +00:00
Ian McInerney df15db3236 Initial toolbar reconfigurability settings 2025-02-28 01:57:37 +00:00
Ian McInerney c24dbc17bf Move toolbar setup flags into the action definition
This makes them centrally defined, and removes the need to specify them
when creating the toolbar.
2025-02-28 01:57:37 +00:00
Jan Wichmann 7eb07c00a2 Fix MSVC build error for VC 17.13+ 2025-02-27 23:41:08 +00:00
Jon Evans 268094320b Remove accidental commented-out block 2025-02-27 18:17:34 -05:00
Jon Evans 1205464472 More safety against corrupted visibility settings 2025-02-27 18:16:51 -05:00
Dhineshkumar S 46db959074 Add autocomplete for label names in label properties dialog
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13508
2025-02-27 22:56:02 +00:00
Tomasz Wlostowski b4d29a98f9 router: refine the endpoint moving logic so that it doesn't block shoving 2025-02-27 23:51:12 +01:00
Ethan Chien 007db5f957 Improve string clarity in Zone Manager and DIALOG_COPPER_ZONE for "Minimum island size"
- Renamed "Minimum island size" to "Area limit" in Zone Manager and DIALOG_COPPER_ZONE to align with terminology used in the dropdown.
- The change aims to make the connection between the dropdown choice and the field more intuitive, reducing ambiguity for users.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17255
2025-02-27 22:45:58 +00:00
aris-kimi e80780d3ad Added more simulation cursors at will.
Added m_signalsGrid context menu entries, Create a new cursor from every cell but Delete only from Cursor 3 and above

New entries are saved into their *.wbk files. Loading of current files should not be affected, as tested,
and on save they get the new property added.

Updates *.wbk file version to "7".

If the tab has more cursors than the loaded file, extra cursors should not be affected, otherwise new cursors shown up.
CursorD left hopefully untouched and kept the legacy behavior close to Cursors 1 & 2.

No more known bugs. It is now working as expected as tested on win11 and Debian 12.

m_cursorsGrid events also work.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15211
2025-02-27 22:42:11 +00:00
Daniel Treffenstädt 5e467a969d Added check for custom thermal spoke count
When using custom thermal spoke templates, the user can create templates with fewer, or more, thermal spokes than 4.
2025-02-27 22:40:40 +00:00
Seth Hillbrand e81956f292 Import Altium Projects
Handle Altium project file format

Parse individual schematic files and layout files
Create top-level schematic file
Link imported UUIDs between schematic symbol and footprints based on
refdes
Create KiCad project
Map Altium layout layers between KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2117
2025-02-27 14:36:24 -08:00
Jeff Young 320a298394 Clarifying comments. 2025-02-27 17:53:06 +00:00
jean-pierre charras a414cb0a17 EDA_SHAPE: fix crash when trying to create a hatch pattern inside a circle. 2025-02-27 18:03:24 +01:00
Damjan 230a976742 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
2025-02-27 16:47:21 +00:00
Jeff Young 144e660684 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
2025-02-27 15:24:30 +00:00
Jeff Young 8e461941c0 Formatting. 2025-02-27 15:24:30 +00:00
Wayne Stambaugh a9cea9fbb7 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.
2025-02-27 09:48:13 -05:00
jean-pierre charras ba85c54f81 Eeschema: fix incorrect plot of SCH_TABLE items. 2025-02-27 13:59:24 +01:00
Seth Hillbrand 9211136953 Fix windows build 2025-02-26 18:15:17 -08:00
Seth Hillbrand 5027a562e4 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
2025-02-26 15:56:38 -08:00
Jon Evans 52e86303c0 Fix export SVG mode logic
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20089
2025-02-26 17:31:18 -05:00
Dhineshkumar S 20c72504c3 Eeschema: Import and auto place all sheet pins
https://gitlab.com/kicad/code/kicad/-/issues/6736
2025-02-26 21:24:02 +00:00
Jeff Young 797de67c6c 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
2025-02-26 20:06:30 +00:00
Jeff Young f510cce2da Apply List Hotkeys fix to Edit Hotkeys.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19989
2025-02-26 19:17:53 +00:00
Jeff Young 53e784caef Better alignment betweeen controls in Pad Properties. 2025-02-26 19:17:53 +00:00
Jeff Young 500962b3a4 There is no support (as yet) for layer-specific soldermask expansions.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20053
2025-02-26 19:17:53 +00:00
Jeff Young 23528425ef Formatting. 2025-02-26 19:17:53 +00:00
Wayne Stambaugh f538908f62 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
2025-02-26 14:04:50 -05:00
jean-pierre charras 7c067e25d9 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
2025-02-26 20:01:29 +01:00
Alex Shvartzkop 7faee6acc2 Update translations 2025-02-26 20:12:47 +03:00
An Nguyen ef9fc7841a Translated using Weblate (Vietnamese)
Currently translated at 24.0% (2387 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/vi/
2025-02-26 18:12:30 +01:00
CloverGit 50d976be35 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (9936 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-02-26 18:12:30 +01:00
Marco Ciampa f13f8f788f Translated using Weblate (Italian)
Currently translated at 95.8% (9524 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-02-26 18:12:30 +01:00
Marco Ciampa caf99cc3b4 Translated using Weblate (Italian)
Currently translated at 95.5% (9490 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/it/
2025-02-26 18:12:30 +01:00
Wellington Terumi Uemura c2bcb36369 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9936 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2025-02-26 18:12:30 +01:00
ZbeeGin f2205e0c83 Translated using Weblate (Polish)
Currently translated at 100.0% (9936 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-02-26 18:12:30 +01:00
Henrik Kauhanen 638d6bbf2a Translated using Weblate (Swedish)
Currently translated at 99.9% (9935 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-02-26 18:12:30 +01:00
dsa-t 0ae37c0f60 Translated using Weblate (Russian)
Currently translated at 100.0% (9936 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-02-26 18:12:30 +01:00
co8 j b7401a5087 Translated using Weblate (Japanese)
Currently translated at 99.9% (9934 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-02-26 18:12:29 +01:00
Pferd O e029537739 Translated using Weblate (German)
Currently translated at 100.0% (9936 of 9936 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-02-26 18:12:29 +01:00
Jeff Young b85c5eb8cc Fix wxWidgets assertion.
(I also increased the spacing between the left
and right columns at the top.)
2025-02-26 13:06:51 +00:00
Jeff Young fde4aac075 Don't exit DRC when one test passes.
Also adds handling for table cells.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20049
2025-02-26 12:50:57 +00:00
Jeff Young 956875e2f4 DRC_LAST is the last index, not the size.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20049
2025-02-26 12:50:49 +00:00
Jeff Young 6ccacd232e Formatting. 2025-02-26 12:16:51 +00:00
Jeff Young 20f40c1030 Replace GetConnectedItems() type list with an EXCLUDE_ZONES flag.
The type list kept atrophying when various new
items were added (arcs, shapes).

And god knows what the purpose of putting PCB_FOOTPRINT_T
in some of them was.  As far as I can tell a CN_ITEMs
parent can never be a footprint.

(Also moves IGNORE_NETS to a flag so that we don't
end up with two booleans and the potential to have
them out-of-order.)
2025-02-26 11:02:10 +00:00
Jeff Young 888cbf8e7a 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
2025-02-26 11:02:10 +00:00
Jeff Young 931b1b0231 Cleanup. 2025-02-26 11:02:10 +00:00
Eric 92cdca69b3 ODB++:Fix date format in misc/info file
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20103
2025-02-26 15:30:36 +08:00
Jon Evans de160e4af6 Add missing change from previous commit
See b6aac93
2025-02-25 23:42:00 -05:00
Marek Roszko 9d5e143d08 ADDEDL: gencad job support to jobsets 2025-02-25 22:44:24 -05:00
Seth Hillbrand aa1baec062 Fix git flicker on Windows 2025-02-25 19:38:01 -08:00
Jon Evans b6aac9369e Fix creation of Altium compound files from IntLibs
A previous change introduced an invalid cast from
base to derived class.  To clean this up, changed
DecodeIntLibStream to have an out param and allow
two-step initialization of ALTIUM_COMPOUND_FILE

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20099
2025-02-25 22:34:26 -05:00
Jon Evans 41f5750be7 Fix logic in via high contrast LOD calculation
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20093
2025-02-25 20:59:26 -05:00
Jon Evans 5cec2fac9d API: Add board origin setter/getter
See https://gitlab.com/kicad/code/kicad-python/-/issues/20
2025-02-25 20:13:16 -05:00
Seth Hillbrand 72411af9de 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
2025-02-25 17:03:52 -08:00
Seth Hillbrand 0877467384 Don't worry about generated spice files 2025-02-25 16:56:15 -08:00
Marek Roszko 59b297dcdc Fix missing change 2025-02-25 19:29:22 -05:00
Seth Hillbrand 2c54ab277b 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
2025-02-25 16:07:19 -08:00
Marek Roszko 42e448dbf6 Elems clear should be private 2025-02-25 18:03:26 -05:00
dsa-t 71fdc9b199 Simplify layer list update in PANEL_SETUP_LAYERS.
(cherry picked from commit bdd4a88127)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-02-25 20:44:07 +00:00
dsa-t d2edf6796c Fix scrollbars not appearing in Appearance layers panel after board import.
(cherry picked from commit f60313367c)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-02-25 20:40:27 +00:00
dsa-t 62b208e0a5 Fix scrollbars not appearing initially in PANEL_SETUP_LAYERS.
(cherry picked from commit a4e2d54221)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-02-25 20:23:27 +00:00
dsa-t b6a0a7cd14 Auto-size PANEL_SETUP_LAYERS_BASE.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20106


(cherry picked from commit 8ef8ca4d39)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-02-25 20:23:17 +00:00
Marek Roszko bc5fca1daa Make schematic and project inherit from PROJECT::ELEM
Just to see if anything weird happens first.
2025-02-24 22:22:56 -05:00
Marek Roszko dbab601c0a Bump cmake minimum
This is so we can use the ENVIRONMENT_MODIFICATION feature across all platforms and simplify some QA cmake. Right now MSVC is special cased to use it since the other PATH variable editing doesn't work due to semicolon/colon issues in cmake parsing.
2025-02-24 19:48:58 -05:00
Jon Evans c4c1842bc4 API: Add new user layers
See https://gitlab.com/kicad/code/kicad-python/-/issues/23
2025-02-24 19:27:13 -05:00
Jon Evans f928b6b7e0 Fix typo that broke simulation field extraction 2025-02-24 19:12:44 -05:00
Jeff Young 8f40feedbb m_ordinal has no meaning for mandatory fields.
... but it should still be initialised.
2025-02-24 23:42:56 +00:00
Seth Hillbrand 141d50f0c1 Initialize m_orginal 2025-02-24 15:11:08 -08:00
Jeff Young 7db3ccd98a Better algorithm for knocking out footprints.
(Though anything would have been as the previous
one didn't work at all.)
2025-02-24 23:01:07 +00:00
Tomasz Wlostowski 78fc95fd6d 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.
2025-02-24 23:45:19 +01:00
Tomasz Wlostowski 9e4947ed36 router: prevent assertion fail in MULTI_DRAGGER
Fixes https://gitlab.com/kicad/code/kicad/issues/20075
2025-02-24 23:42:20 +01:00
Tomasz Wlostowski 29a4ec0fde 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.
2025-02-24 23:42:20 +01:00
Tomasz Wlostowski bfbdfcf872 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
2025-02-24 23:42:20 +01:00
Jon Evans 6be2468e05 Fix uninitialized member in non-user fields 2025-02-24 17:39:38 -05:00
Seth Hillbrand 3b24b5b74b Fix SWIG QA 2025-02-24 14:13:36 -08:00
Seth Hillbrand ea520da1c8 Protect search from mis-attributed LIB/SCH instance
The parent of fields might be a LIB_SYMBOL, not SCH_SYMBOL.  We need to
watch for and avoid these in the search/replace for schematics

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20079
2025-02-24 10:13:38 -08:00
Jeff Young 907f21e739 Hatching knockout fixes. 2025-02-24 17:35:43 +00:00
Jeff Young 0de8d75dec Fixup parent after blasting it. 2025-02-24 17:35:43 +00:00
Jeff Young f5cee2ee0a Formatting. 2025-02-24 17:35:43 +00:00
Jeff Young 86e9f47875 Minor cleanup to table dialogs, take 2. 2025-02-24 17:35:43 +00:00
jean-pierre charras ddcf3f9855 Fix compil warning and issue. 2025-02-24 14:35:10 +01:00
Jeff Young 8fd175dd22 Minor cleanup to table dialogs. 2025-02-24 11:53:50 +00:00
Jeff Young 29b8066473 Minor dialog cleanup.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20047
2025-02-24 11:08:29 +00:00
Jeff Young 562ff37314 Mirror location of textbox.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20021
2025-02-24 11:08:29 +00:00
Jeff Young 1691d8d2b2 Fix plot dialog layout. 2025-02-24 11:08:29 +00:00
Jeff Young 3f15b0d75b ADDED: hatched fills for shapes. 2025-02-24 11:08:29 +00:00
Jeff Young 59d6152cf0 Cleanup stale comment. 2025-02-24 11:08:29 +00:00
Jeff Young 34db9ed245 Better namespacing.
Also fixes a bug with calculating eagle annular
ring sizes.
2025-02-24 11:08:29 +00:00
Jeff Young 01a19bf3d0 Filled shapes can still have a border width. 2025-02-24 11:08:29 +00:00
Jeff Young 7b80e93a4b 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
2025-02-24 11:08:29 +00:00
Jeff Young 675624b926 ADDED: Knockout text boxes. 2025-02-24 11:08:29 +00:00
Jeff Young 7583c0e69d Retire DIALOG_FOOTPRINT_CHOOSER. 2025-02-24 11:08:29 +00:00
Jeff Young c5bb59468d Get rid of assumptions about field order. 2025-02-24 11:08:29 +00:00
Jeff Young 9d901188cb Use specific thickness for mask layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19024
2025-02-24 11:08:29 +00:00
Jeff Young f2da0c791f Retire non-cairo printing.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19323
2025-02-24 11:08:29 +00:00
Jeff Young f9c41d70d1 No-connect pins aren't endpoints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18316
2025-02-24 11:08:29 +00:00
Jeff Young e7652685f0 Always report all track keepout violations.
(Regardless of report-all-errors-per-track setting.
There's no clear rule here, but to do otherwise just
feels wrong.  Keepout areas are distinct, it's not
like tracks too close together reporting lots of
clearance errors.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13219
2025-02-24 11:08:29 +00:00
Jeff Young 79eeb1492c Improve grid settings layout. 2025-02-24 11:08:29 +00:00
Jeff Young 3a4aec7267 Account for solder mask thickness from board stackup.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19024
2025-02-24 11:08:29 +00:00
Jeff Young 28684cfeba Formatting. 2025-02-24 11:08:29 +00:00
Jeff Young 7eb75720b5 Start to retire "alias" in favour of "symbol" and "derived symbol".
Note: terminology changes only.  No (intentional)
functional changes.
2025-02-24 11:08:29 +00:00
Jeff Young aaca66351e Case-insensitive collision detection for symbol names.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19370
2025-02-24 11:08:29 +00:00
Jeff Young 85c4319185 Formatting. 2025-02-24 11:08:29 +00:00
Jeff Young b74c2791f4 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.
2025-02-24 11:08:29 +00:00
Jeff Young 9d051d096e 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
2025-02-24 11:08:28 +00:00
Jeff Young 97a0ec504b Search Panel hint in Find Dialogs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19722
2025-02-24 11:08:28 +00:00
Jeff Young 3b3fd95430 MOVED subtract-mask-from-silk to general section.
(Was Gerber-specific.)
2025-02-24 11:08:28 +00:00
Jeff Young 0c9f08742c REMOVED force-plot-invisible-items.
It's dangerous as the router and DRC will have been
run without regard to invisible items.

(See #19420.)
2025-02-24 11:08:28 +00:00
Jeff Young e483c48fe6 Re-balance file sizes. 2025-02-24 11:08:28 +00:00
Damjan 76a3d1c845 Eeschema and pcbnew: Table Cell Properties 2025-02-24 11:07:58 +00:00
Damjan 5771467ca3 pcbnew: Table Rotation 2025-02-24 11:00:29 +00:00
Jon Evans 4123f75d5a Re-add accidentally removed increment
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20069
2025-02-23 22:41:44 -05:00
Seth Hillbrand 03af293683 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
2025-02-23 15:38:39 -08:00
Jon Evans 3525731a4e PCM: Prompt to enable IPC API when required
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20062
2025-02-23 18:07:02 -05:00
Dmitry Rezvanov 58d2b34304 Prevent overwriting alias members when adding new rows in panel setup.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20040
2025-02-23 22:21:28 +00:00
Damjan 9c6ebb44b6 pcbnew: Table Cell Text Justification 2025-02-23 21:27:57 +00:00
Jon Evans bacb6bf40f Clear render cache for hole walls on zoom change 2025-02-23 13:03:54 -05:00
Jon Evans 0e8934f887 Do not persist canvas type fallback due to OpenGL failure
If the user wants to always use fallback,
they can set this option explicitly
2025-02-23 12:50:43 -05:00
Graham Keeth 89a5fadcdc improve tooltips in sync sheet pins dialog 2025-02-22 23:16:39 +00:00
Seth Hillbrand 157c7422b0 Allow sim models to reference embedded files
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20024
2025-02-22 14:53:59 -08:00
Seth Hillbrand b02a449be8 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)
2025-02-22 14:53:59 -08:00
Graham Keeth c57088a60c Add ellipses for sheet/sheet pin actions 2025-02-22 21:33:24 +00:00
Graham Keeth 812a3ff83e Add ellipses in net inspector menus 2025-02-22 21:33:24 +00:00
Graham Keeth 2e7db39751 Add ellipsis for zone manager 2025-02-22 21:33:24 +00:00
Jon Evans d29025ef78 API: Refresh screen after changing selection
Required on Linux/Windows

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20008
2025-02-22 16:00:40 -05:00
Connor Goss 5a5759c41a 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
2025-02-22 21:00:54 +00:00
Wayne Stambaugh 4e4ebe536e Fix zone manager dialog layout issues.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20046
2025-02-22 15:48:00 -05:00
Jon Evans 5abfdac639 Remove accidentally-added tree 2025-02-22 14:43:49 -05:00
Jon Evans 8082d6ffa9 Remove debug output 2025-02-22 14:02:52 -05:00
Jon Evans 78d117bf3b Attempt a better fix for CI paths in kicad-cli tests
Also check in other default configs
2025-02-22 13:37:48 -05:00
Jon Evans 8d7d769bb6 Prevent assertion running on wx 3.3 2025-02-22 12:15:46 -05:00
Jon Evans cc1f513a6e Add some env debug output to kicad-cli tests 2025-02-22 12:01:35 -05:00
jean-pierre charras fc9795e95d pcb_calculator, STRIPLINE: fix incorrect formula for conductor loss. 2025-02-22 17:02:09 +01:00
Eli Hughes e972fb42ee Seeding a simple python script to create a test server for http libs. 2025-02-22 15:47:56 +00:00
Dmitry Rezvanov c7aaf8b6e1 Enhance library pinning functionality to support pin/unpin multiple libraries in the library editor 2025-02-22 15:41:35 +00:00
Jon Evans ca21a35bfc Improvements to kicad-cli test repeatability 2025-02-22 10:35:27 -05:00
JamesJCode 1e84d1e496 Fix m_zoneLayerOverrides data race in pad.h
From Coverity issue 542093
2025-02-22 14:58:11 +00:00
Dmitry Rezvanov ee614161d7 Added enum COL_ORDER for jobset panel's columns 2025-02-22 14:07:08 +00:00
Dmitry Rezvanov 0c2a5b72ec Fixed description column number in PANEL_JOBSET::OnGridCellChange.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20030
2025-02-22 14:07:08 +00:00
Daniel Treffenstädt 255f4aee76 Make sure drill layer pairs are created in odb++
fixes #20039
2025-02-22 10:58:14 +01:00
Seth Hillbrand 878cf768d6 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.
2025-02-21 12:38:23 -08:00
Seth Hillbrand 2e93fb7a24 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
2025-02-21 10:34:25 -08:00
Graham Keeth ac9f41baaa Embedded files: standardize on "embedded reference" 2025-02-21 12:46:43 -05:00
jean-pierre charras aafe6157e2 kicad-cli pcb export SVG: ensure the "C" locale is used.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20023
2025-02-21 17:44:02 +01:00
jean-pierre charras 22a2cca312 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)
2025-02-21 17:08:22 +01:00
Graham Keeth 68869f6439 capitalize Git in display strings 2025-02-21 15:18:16 +00:00
Jeff Young 0885d48d6b 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:45 +00:00
jean-pierre charras a9fb475cf2 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
2025-02-21 09:47:45 +01:00
Jon Evans b932487f2e API: Add serialization of footprint mounting style
See https://gitlab.com/kicad/code/kicad-python/-/issues/19
2025-02-20 17:46:23 -05:00
Jeff Young a8a1b08013 Make sure protobuf API stays consistent. 2025-02-20 17:47:40 +00:00
Jeff Young 9ca9d7120a Cleanup. 2025-02-20 17:47:40 +00:00
jean-pierre charras 1748c3c893 PANEL_PREVIEW_3D_MODEL_BASE: fix opacity slider.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19990
2025-02-20 18:21:24 +01:00
jean-pierre charras 8a5b71a01b Print dlgs: add panel printer to select the current printer. Windows only
Other platforms show the available printers in print dialog.
2025-02-20 17:04:47 +01:00
Alex Shvartzkop 0201e7286c Vertically center text in cells in jobsets table. 2025-02-20 14:23:35 +03:00
John Beard f24c8d7410 Pcbnew: add a tooltop for always-on layers 2025-02-06 22:45:32 +08:00
Marek Roszko 3d15317282 Add missing demo installs 2025-02-19 23:07:10 -05:00
Ian McInerney 0954f8ff76 Ensure vme-wren demo is installed 2025-02-20 03:00:10 +00:00
Jeff Young 6b3d01ead9 Load actions from frame's actionmanager, not from singleton.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19989
2025-02-19 23:43:53 +00:00
Jeff Young a00aeb7876 Fix comment. 2025-02-19 23:43:53 +00:00
Jeff Young e018a33628 Formatting. 2025-02-19 23:43:53 +00:00
Jeff Young 61efe5be18 Resolve field references in symbol text items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19983
2025-02-19 23:43:53 +00:00
Jeff Young bf34fe625c Reduce cover types.
Also, don't use _ITEM for things that aren't EDA::ITEMs.
2025-02-19 23:43:53 +00:00
Jeff Young fea659a002 Remove prohibition from clearing Value field in Symbol Fields Table.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19745
2025-02-19 23:43:53 +00:00
Jeff Young 426ac96bb7 ADDED: 'Name' property for fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19706
2025-02-19 23:43:53 +00:00
Jeff Young be58dddcab Don't special case output directory label for jobsets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19868
2025-02-19 23:43:53 +00:00
Jeff Young 6a3f52dbaf Ignore negative layers when exporting Gerbers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16871
2025-02-19 23:43:53 +00:00
Jeff Young 3c71e7ab09 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
2025-02-19 23:43:53 +00:00
Jeff Young c136df247f Better way of determining if we're reporting from the footprint editor. 2025-02-19 23:43:53 +00:00
Jeff Young 006d8b290a 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.)
2025-02-19 23:43:53 +00:00
Jeff Young 072d8d55fe 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
2025-02-19 23:43:53 +00:00
Jeff Young c8f56f24a8 Write flipBoard boolean to JSON.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19852
2025-02-19 23:43:53 +00:00
Jeff Young 4e08afd517 Improve control spacing. 2025-02-19 23:43:53 +00:00
Jeff Young 1ff0dfb052 No connections AND no-net is not an error
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19737
2025-02-19 23:43:53 +00:00
Jeff Young c28039556d Check for duplicate footprints.
Also fixes a bug where we were running Validate()
twice.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19857
2025-02-19 23:43:53 +00:00
Jeff Young 42acb62f6e 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
2025-02-19 23:43:53 +00:00
Jeff Young f65d260961 Pretty-print cross references in Symbol Fields Table.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19941
2025-02-19 23:43:53 +00:00
Jeff Young d921a4e916 Switch to using unit names in property inspector. 2025-02-19 23:43:53 +00:00
Jeff Young 56b8fec74b Update instance reference from property inspector.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19932
2025-02-19 23:43:53 +00:00
Jeff Young 1c848bb9fb Improve code clarity.
(No functional change.)
2025-02-19 23:43:53 +00:00
Jeff Young 80e7698131 MOVED subtract-mask-from-silk to general section.
(Was Gerber-specific.)
2025-02-19 23:43:53 +00:00
Jeff Young 4fa02690f8 REMOVED force-plot-invisible-items.
It's dangerous as the router and DRC will have been
run without regard to invisible items.

(See #19420.)
2025-02-19 23:43:53 +00:00
Jeff Young b44261c2bd Handle clipping silk to mask when there is more than one layer. 2025-02-19 23:43:53 +00:00
Jeff Young 4959b480c3 Cleanup stale comments. 2025-02-19 23:43:53 +00:00
Jeff Young 9c0214afc0 Cleanup. 2025-02-19 23:43:53 +00:00
Jeff Young 281aa74f30 Performance improvements for teardrop regeneration.
Avoid O(n^2) behaviour when deleting many
zones from the board zones list.
2025-02-19 23:43:53 +00:00
Jeff Young 5edae8250d 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
2025-02-19 23:43:52 +00:00
Jeff Young 40daacbeeb IPC-2581 has a hyphen in it.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19770
2025-02-19 23:43:52 +00:00
Jeff Young 3fff89820d Fix inconsistent capitalisation.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19770
2025-02-19 23:43:52 +00:00
Jeff Young cedb97c4c3 Formatting. 2025-02-19 23:43:52 +00:00
Jeff Young 759bfbca99 Don't allow creation of design blocks in recently used tree node. 2025-02-19 23:43:52 +00:00
Jeff Young 2a1b93a254 Fix bugs in library existence checking, and add for symbol libs. 2025-02-19 23:43:52 +00:00
Jeff Young 4a35468301 LIB_TREE_MODEL_ADAPTER is not symbol-specific. 2025-02-19 23:43:52 +00:00
Andrej Valek 5e64f56d54 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.
2025-02-19 18:16:55 +00:00
lucas 2559ac50a3 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
2025-02-19 18:15:57 +00:00
Dmitry Rezvanov 663f00da25 Add "Route Selected From Other End" action to edit context menu 2025-02-19 18:12:04 +00:00
Seth Hillbrand cf2827c6ec 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
2025-02-19 18:06:57 +00:00
Seth Hillbrand 9781da51e1 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
2025-02-19 18:05:07 +00:00
Seth Hillbrand d2f780dfb4 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
2025-02-19 18:02:27 +00:00
Wayne Stambaugh ef49d83bc1 Begin version 10 development. 2025-02-19 11:01:40 -05:00
1554 changed files with 630299 additions and 480572 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true
ColumnLimit: 100
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
+4
View File
@@ -24,6 +24,7 @@ common/template_fieldnames_lexer.h
eeschema/schematic_keywords.*
pcbnew/pcb_plot_params_keywords.cpp
pcbnew/pcb_plot_params_lexer.h
pcbnew/dialogs/panel_setup_rules_help_*.h
Makefile
CMakeUserPresets.json
CMakeCache.txt
@@ -51,6 +52,7 @@ common/pcb_keywords.cpp
include/pcb_lexer.h
fp-info-cache
qa/tests/output/**
qa/tests/cli/output/**
# demo project auxiliary files
demos/**/*-bak
@@ -125,9 +127,11 @@ 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
@@ -0,0 +1,58 @@
# 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
+134 -92
View File
@@ -91,7 +91,6 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
m_IsPreviewer( false ),
m_board( nullptr ),
m_3dModelManager( nullptr ),
m_colors( nullptr ),
m_layerZcoordTop(),
m_layerZcoordBottom()
{
@@ -114,6 +113,8 @@ 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;
@@ -137,13 +138,14 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
m_ECO1Color = SFVEC4F( 0.70, 0.10, 0.10, 1.0 );
m_ECO2Color = SFVEC4F( 0.70, 0.10, 0.10, 1.0 );
for( int ii = 0; ii < 45; ++ii )
m_UserDefinedLayerColor[ii] = SFVEC4F( 0.70, 0.10, 0.10, 1.0 );
m_platedPadsFront = nullptr;
m_platedPadsBack = nullptr;
m_offboardPadsFront = nullptr;
m_offboardPadsBack = nullptr;
m_frontPlatedPadAndGraphicPolys = nullptr;
m_backPlatedPadAndGraphicPolys = nullptr;
m_frontPlatedCopperPolys = nullptr;
m_backPlatedCopperPolys = nullptr;
@@ -229,11 +231,12 @@ void BOARD_ADAPTER::ReloadColorSettings() noexcept
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
COLOR_SETTINGS* colors = mgr.GetColorSettings( cfg ? cfg->m_ColorTheme : wxString( "" ) );
if( cfg )
if( colors )
{
m_colors = Pgm().GetSettingsManager().GetColorSettings( cfg->m_ColorTheme );
GetBoardEditorCopperLayerColors( cfg );
for( int layer = F_Cu; layer < PCB_LAYER_ID_COUNT; ++layer )
m_BoardEditorColors[ layer ] = colors->GetColor( layer );
}
}
@@ -262,7 +265,15 @@ bool BOARD_ADAPTER::Is3dLayerEnabled( PCB_LAYER_ID aLayer,
case Cmts_User: return aVisibilityFlags.test( LAYER_3D_USER_COMMENTS );
case Eco1_User: return aVisibilityFlags.test( LAYER_3D_USER_ECO1 );
case Eco2_User: return aVisibilityFlags.test( LAYER_3D_USER_ECO2 );
default: return m_board && m_board->IsLayerVisible( aLayer );
default:
{
int layer3D = MapPCBLayerTo3DLayer( aLayer );
if( layer3D != UNDEFINED_LAYER )
return aVisibilityFlags.test( layer3D );
return m_board && m_board->IsLayerVisible( aLayer );
}
}
}
@@ -372,6 +383,8 @@ 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 )
@@ -383,7 +396,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
if( bds.GetStackupDescriptor().GetCount() )
{
int thickness = 0;
int body_thickness = 0;
for( BOARD_STACKUP_ITEM* item : bds.GetStackupDescriptor().GetList() )
{
@@ -391,31 +404,44 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
{
case BS_ITEM_TYPE_DIELECTRIC:
for( int sublayer = 0; sublayer < item->GetSublayersCount(); sublayer++ )
thickness += item->GetThickness( sublayer );
body_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() )
thickness += copper_thickness;
}
body_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 = thickness * m_biuTo3Dunits;
m_boardBodyThickness3DU = body_thickness * m_biuTo3Dunits;
}
}
@@ -449,8 +475,7 @@ 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;
@@ -465,26 +490,14 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
const float zpos_copperTop_back = m_layerZcoordTop[B_Cu];
const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
// Fill not copper layers zpos with a dummy position
// (m_layerZcoordTop[B_Cu]with a small margin)
// Some important layer position will be set later
// Fill not copper layers zpos
for( int layer_id = 0; layer_id < PCB_LAYER_ID_COUNT; layer_id++ )
{
if( IsCopperLayer( (PCB_LAYER_ID)layer_id ) )
continue;
m_layerZcoordBottom[(PCB_LAYER_ID)layer_id] = zpos_copperTop_back - 2.0f * zpos_offset;
m_layerZcoordTop[(PCB_LAYER_ID) layer_id] =
m_layerZcoordBottom[(PCB_LAYER_ID) layer_id] - m_backCopperThickness3DU;
}
// calculate z position for each technical layer
// Solder mask and Solder paste have the same Z position
for( PCB_LAYER_ID layer_id :
{ B_Adhes, B_Mask, B_Paste, F_Adhes, F_Mask, F_Paste, B_SilkS, F_SilkS } )
{
float zposTop = 0.0;
float zposBottom = 0.0;
float zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
float zposTop = zposBottom + m_frontCopperThickness3DU;
switch( layer_id )
{
@@ -500,7 +513,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
case B_Mask:
zposBottom = zpos_copperTop_back;
zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
zposTop = zpos_copperTop_back - m_backMaskThickness3DU;
break;
case B_Paste:
@@ -510,7 +523,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
case F_Mask:
zposBottom = zpos_copperTop_front;
zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
zposTop = zpos_copperTop_front + m_frontMaskThickness3DU;
break;
case F_Paste:
@@ -532,14 +545,13 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
break;
}
m_layerZcoordTop[layer_id] = zposTop;
m_layerZcoordBottom[layer_id] = zposBottom;
m_layerZcoordTop[(PCB_LAYER_ID)layer_id] = zposTop;
m_layerZcoordBottom[(PCB_LAYER_ID)layer_id] = zposBottom;
}
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 );
@@ -580,6 +592,9 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
m_UserCommentsColor = to_SFVEC4F( colors[ LAYER_3D_USER_COMMENTS ] );
m_ECO1Color = to_SFVEC4F( colors[ LAYER_3D_USER_ECO1 ] );
m_ECO2Color = to_SFVEC4F( colors[ LAYER_3D_USER_ECO2 ] );
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
m_UserDefinedLayerColor[ layer - LAYER_3D_USER_1 ] = to_SFVEC4F( colors[ layer ] );
}
@@ -602,28 +617,15 @@ 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 = Pgm().GetSettingsManager().GetColorSettings( wxEmptyString );
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
colors[ layer ] = settings->GetColor( layer );
return colors;
}
void BOARD_ADAPTER::GetBoardEditorCopperLayerColors( PCBNEW_SETTINGS* aCfg )
{
m_BoardEditorColors.clear();
if( m_copperLayersCount <= 0 )
return;
COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings( aCfg->m_ColorTheme );
LSET copperLayers = LSET::AllCuMask();
for( auto layer : LAYER_RANGE( F_Cu, B_Cu, m_copperLayersCount ) )
{
m_BoardEditorColors[ layer ] = settings->GetColor( layer );
}
}
std::map<int, COLOR4D> BOARD_ADAPTER::GetLayerColors() const
{
std::map<int, COLOR4D> colors;
@@ -747,8 +749,13 @@ void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings();
for( const auto& [ layer, color ] : aColors )
{
settings->SetColor( layer, color );
if( layer >= LAYER_3D_USER_1 && layer <= LAYER_3D_USER_45 )
m_UserDefinedLayerColor[ layer - LAYER_3D_USER_1 ] = GetColor( color );
}
Pgm().GetSettingsManager().SaveColorSettings( settings, "3d_viewer" );
}
@@ -769,6 +776,9 @@ void BOARD_ADAPTER::SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers )
m_Cfg->m_Render.show_eco1 = aLayers.test( LAYER_3D_USER_ECO1 );
m_Cfg->m_Render.show_eco2 = aLayers.test( LAYER_3D_USER_ECO2 );
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
m_Cfg->m_Render.show_user[ layer - LAYER_3D_USER_1 ] = aLayers.test( layer );
m_Cfg->m_Render.show_footprints_normal = aLayers.test( LAYER_3D_TH_MODELS );
m_Cfg->m_Render.show_footprints_insert = aLayers.test( LAYER_3D_SMD_MODELS );
m_Cfg->m_Render.show_footprints_virtual = aLayers.test( LAYER_3D_VIRTUAL_MODELS );
@@ -789,6 +799,46 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
{
std::bitset<LAYER_3D_END> ret;
if( m_board && m_board->IsFootprintHolder() )
{
if( m_Cfg->m_Render.preview_show_board_body )
{
ret.set( LAYER_3D_BOARD, m_Cfg->m_Render.show_board_body );
ret.set( LAYER_3D_SOLDERMASK_TOP, m_Cfg->m_Render.show_soldermask_top );
ret.set( LAYER_3D_SOLDERMASK_BOTTOM, m_Cfg->m_Render.show_soldermask_bottom );
ret.set( LAYER_3D_SOLDERPASTE, m_Cfg->m_Render.show_solderpaste );
ret.set( LAYER_3D_ADHESIVE, m_Cfg->m_Render.show_adhesive );
}
ret.set( LAYER_3D_COPPER_TOP, true );
ret.set( LAYER_3D_COPPER_BOTTOM, true );
ret.set( LAYER_3D_SILKSCREEN_TOP, true );
ret.set( LAYER_3D_SILKSCREEN_BOTTOM, true );
ret.set( LAYER_3D_USER_COMMENTS, true );
ret.set( LAYER_3D_USER_DRAWINGS, true );
ret.set( LAYER_3D_USER_ECO1, true );
ret.set( LAYER_3D_USER_ECO2, true );
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
ret.set( layer, true );
ret.set( LAYER_FP_REFERENCES, true );
ret.set( LAYER_FP_VALUES, true );
ret.set( LAYER_FP_TEXT, true );
ret.set( LAYER_3D_TH_MODELS, true );
ret.set( LAYER_3D_SMD_MODELS, true );
ret.set( LAYER_3D_VIRTUAL_MODELS, true );
ret.set( LAYER_3D_MODELS_NOT_IN_POS, true );
ret.set( LAYER_3D_MODELS_MARKED_DNP, true );
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_AXES, m_Cfg->m_Render.show_axis );
return ret;
}
ret.set( LAYER_3D_BOARD, m_Cfg->m_Render.show_board_body );
ret.set( LAYER_3D_COPPER_TOP, m_Cfg->m_Render.show_copper_top );
ret.set( LAYER_3D_COPPER_BOTTOM, m_Cfg->m_Render.show_copper_bottom );
@@ -803,6 +853,9 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
ret.set( LAYER_3D_USER_ECO1, m_Cfg->m_Render.show_eco1 );
ret.set( LAYER_3D_USER_ECO2, m_Cfg->m_Render.show_eco2 );
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
ret.set( layer, m_Cfg->m_Render.show_user[ layer - LAYER_3D_USER_1 ] );
ret.set( LAYER_FP_REFERENCES, m_Cfg->m_Render.show_fp_references );
ret.set( LAYER_FP_VALUES, m_Cfg->m_Render.show_fp_values );
ret.set( LAYER_FP_TEXT, m_Cfg->m_Render.show_fp_text );
@@ -845,7 +898,10 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
return ret;
const PCB_PLOT_PARAMS& plotParams = m_board->GetPlotOptions();
LSET layers = plotParams.GetLayerSelection() | plotParams.GetPlotOnAllLayersSelection();
LSET layers = plotParams.GetLayerSelection();
for( PCB_LAYER_ID commonLayer : plotParams.GetPlotOnAllLayersSequence() )
layers.set( commonLayer );
ret.set( LAYER_3D_BOARD, true );
ret.set( LAYER_3D_COPPER_TOP, layers.test( F_Cu ) );
@@ -861,34 +917,17 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
ret.set( LAYER_3D_USER_ECO1, layers.test( Eco1_User ) );
ret.set( LAYER_3D_USER_ECO2, layers.test( Eco2_User ) );
ret.set( LAYER_FP_REFERENCES, plotParams.GetPlotReference() );
ret.set( LAYER_FP_VALUES, plotParams.GetPlotValue() );
ret.set( LAYER_FP_TEXT, plotParams.GetPlotFPText() );
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() );
}
else if( LAYER_PRESET_3D* preset = m_Cfg->FindPreset( m_Cfg->m_CurrentPreset ) )
{
ret = preset->layers;
}
else
{
ret.set( LAYER_3D_BOARD, m_Cfg->m_Render.show_board_body );
ret.set( LAYER_3D_COPPER_TOP, m_Cfg->m_Render.show_copper_top );
ret.set( LAYER_3D_COPPER_BOTTOM, m_Cfg->m_Render.show_copper_bottom );
ret.set( LAYER_3D_SILKSCREEN_TOP, m_Cfg->m_Render.show_silkscreen_top );
ret.set( LAYER_3D_SILKSCREEN_BOTTOM, m_Cfg->m_Render.show_silkscreen_bottom );
ret.set( LAYER_3D_SOLDERMASK_TOP, m_Cfg->m_Render.show_soldermask_top );
ret.set( LAYER_3D_SOLDERMASK_BOTTOM, m_Cfg->m_Render.show_soldermask_bottom );
ret.set( LAYER_3D_SOLDERPASTE, m_Cfg->m_Render.show_solderpaste );
ret.set( LAYER_3D_ADHESIVE, m_Cfg->m_Render.show_adhesive );
ret.set( LAYER_3D_USER_COMMENTS, m_Cfg->m_Render.show_comments );
ret.set( LAYER_3D_USER_DRAWINGS, m_Cfg->m_Render.show_drawings );
ret.set( LAYER_3D_USER_ECO1, m_Cfg->m_Render.show_eco1 );
ret.set( LAYER_3D_USER_ECO2, m_Cfg->m_Render.show_eco2 );
ret.set( LAYER_FP_REFERENCES, m_Cfg->m_Render.show_fp_references );
ret.set( LAYER_FP_VALUES, m_Cfg->m_Render.show_fp_values );
ret.set( LAYER_FP_TEXT, m_Cfg->m_Render.show_fp_text );
}
return ret;
}
@@ -912,6 +951,9 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetDefaultVisibleLayers() const
ret.set( LAYER_3D_USER_ECO1, false );
ret.set( LAYER_3D_USER_ECO2, false );
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
ret.set( layer, false );
ret.set( LAYER_FP_REFERENCES, true );
ret.set( LAYER_FP_VALUES, true );
ret.set( LAYER_FP_TEXT, true );
@@ -930,6 +972,12 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetDefaultVisibleLayers() const
}
bool BOARD_ADAPTER::GetUseBoardEditorCopperLayerColors() const
{
return m_Cfg->m_Render.use_board_editor_copper_colors && !m_board->IsFootprintHolder();
}
bool BOARD_ADAPTER::createBoardPolygon( wxString* aErrorMsg )
{
m_board_poly.RemoveAllContours();
@@ -992,19 +1040,14 @@ float BOARD_ADAPTER::GetFootprintZPos( bool aIsFlipped ) const
}
SFVEC4F BOARD_ADAPTER::GetLayerColor( PCB_LAYER_ID aLayerId ) const
SFVEC4F BOARD_ADAPTER::GetLayerColor( int aLayerId ) const
{
if( aLayerId >= LAYER_3D_USER_1 && aLayerId <= LAYER_3D_USER_45 )
aLayerId = Map3DLayerToPCBLayer( aLayerId );
wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
const COLOR4D color = m_colors->GetColor( aLayerId );
return SFVEC4F( color.r, color.g, color.b, color.a );
}
SFVEC4F BOARD_ADAPTER::GetItemColor( int aItemId ) const
{
return GetColor( m_colors->GetColor( aItemId ) );
return GetColor( m_BoardEditorColors.at( aLayerId ) );
}
@@ -1016,9 +1059,8 @@ 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 );
+13 -27
View File
@@ -112,11 +112,6 @@ public:
*/
std::map<int, COLOR4D> GetLayerColors() const;
/**
* Build the copper color list used by the board editor, and store it in m_BoardEditorColors
*/
void GetBoardEditorCopperLayerColors( PCBNEW_SETTINGS* aCfg );
std::map<int, COLOR4D> GetDefaultColors() const;
void SetLayerColors( const std::map<int, COLOR4D>& aColors );
@@ -124,6 +119,8 @@ public:
std::bitset<LAYER_3D_END> GetDefaultVisibleLayers() const;
void SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers );
bool GetUseBoardEditorCopperLayerColors() const;
/**
* Function to be called by the render when it need to reload the settings for the board.
*
@@ -210,15 +207,7 @@ public:
* @param aLayerId the layer to get the color information.
* @return the color in SFVEC3F format.
*/
SFVEC4F GetLayerColor( PCB_LAYER_ID aLayerId ) const;
/**
* Get the technical color of a layer.
*
* @param aItemId the item id to get the color information.
* @return the color in SFVEC3F format.
*/
SFVEC4F GetItemColor( int aItemId ) const;
SFVEC4F GetLayerColor( int aLayerId ) const;
/**
* @param[in] aColor is the color mapped.
@@ -352,14 +341,14 @@ public:
*/
const MAP_POLY& GetPolyMap() const noexcept { return m_layers_poly; }
const SHAPE_POLY_SET* GetFrontPlatedPadAndGraphicPolys()
const SHAPE_POLY_SET* GetFrontPlatedCopperPolys()
{
return m_frontPlatedPadAndGraphicPolys;
return m_frontPlatedCopperPolys;
}
const SHAPE_POLY_SET* GetBackPlatedPadAndGraphicPolys()
const SHAPE_POLY_SET* GetBackPlatedCopperPolys()
{
return m_backPlatedPadAndGraphicPolys;
return m_backPlatedCopperPolys;
}
const MAP_POLY& GetHoleIdPolysMap() const noexcept { return m_layerHoleIdPolys; }
@@ -386,7 +375,7 @@ private:
int aInflateValue );
void addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayerId, bool aSkipPlatedPads, bool aSkipNonPlatedPads );
PCB_LAYER_ID aLayerId );
void addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayerId,
@@ -455,6 +444,7 @@ public:
SFVEC4F m_UserCommentsColor;
SFVEC4F m_ECO1Color;
SFVEC4F m_ECO2Color;
SFVEC4F m_UserDefinedLayerColor[45];
std::map<int, COLOR4D> m_ColorOverrides; ///< allows to override color scheme colors
std::map<int, COLOR4D> m_BoardEditorColors; ///< list of colors used by the board editor
@@ -462,7 +452,6 @@ public:
private:
BOARD* m_board;
S3D_CACHE* m_3dModelManager;
COLOR_SETTINGS* m_colors;
VECTOR2I m_boardPos; ///< Board center position in board internal units.
VECTOR2I m_boardSize; ///< Board size in board internal units.
@@ -472,8 +461,6 @@ private:
MAP_POLY m_layers_poly; ///< Amalgamated polygon contours for various types
///< of items
SHAPE_POLY_SET* m_frontPlatedPadAndGraphicPolys;
SHAPE_POLY_SET* m_backPlatedPadAndGraphicPolys;
SHAPE_POLY_SET* m_frontPlatedCopperPolys;
SHAPE_POLY_SET* m_backPlatedCopperPolys;
@@ -505,16 +492,15 @@ 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 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.
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.
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;
@@ -96,6 +96,7 @@ void addROUND_SEGMENT_2D( CONTAINER_2D_BASE* aContainer, const SFVEC2F& aStart,
void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContainer,
const BOARD_ITEM* aOwner )
{
int maxError = m_board->GetDesignSettings().m_MaxError;
KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
TEXT_ATTRIBUTES attrs = aText->GetAttributes();
float penWidth_3DU = TO_3DU( aText->GetEffectiveTextPenWidth() );
@@ -110,8 +111,7 @@ 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, m_board->GetDesignSettings().m_MaxError,
ERROR_INSIDE );
pcbText->TransformTextToPolySet( finalPoly, 0, 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
@@ -188,23 +188,23 @@ void BOARD_ADAPTER::addShape( const PCB_DIMENSION_BASE* aDimension, CONTAINER_2D
void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aContainer,
PCB_LAYER_ID aLayerId,
const std::bitset<LAYER_3D_END>& aVisibilityFlags )
const std::bitset<LAYER_3D_END>& aFlags )
{
KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
for( PCB_FIELD* field : aFootprint->GetFields() )
{
if( field->GetLayer() == aLayerId && field->IsVisible() )
{
if( !aVisibilityFlags.test( LAYER_FP_TEXT ) )
continue;
else if( field->IsReference() && !aVisibilityFlags.test( LAYER_FP_REFERENCES ) )
continue;
else if( field->IsValue() && !aVisibilityFlags.test( LAYER_FP_VALUES ) )
continue;
if( !aFlags.test( LAYER_FP_TEXT ) )
continue;
if( field->IsReference() && !aFlags.test( LAYER_FP_REFERENCES ) )
continue;
if( field->IsValue() && !aFlags.test( LAYER_FP_VALUES ) )
continue;
if( field->GetLayer() == aLayerId && field->IsVisible() )
addText( field, aContainer, field );
}
}
for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
@@ -215,19 +215,17 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
{
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
if( text->GetLayer() == aLayerId && text->IsVisible() )
{
if( !aVisibilityFlags.test( LAYER_FP_TEXT ) )
continue;
else if( text->GetText() == wxT( "${REFERENCE}" )
&& !aVisibilityFlags.test( LAYER_FP_REFERENCES ) )
continue;
else if( text->GetText() == wxT( "${VALUE}" )
&& !aVisibilityFlags.test( LAYER_FP_VALUES ) )
continue;
if( !aFlags.test( LAYER_FP_TEXT ) )
continue;
if( text->GetText() == wxT( "${REFERENCE}" ) && !aFlags.test( LAYER_FP_REFERENCES ) )
continue;
if( text->GetText() == wxT( "${VALUE}" ) && !aFlags.test( LAYER_FP_VALUES ) )
continue;
if( text->GetLayer() == aLayerId )
addText( text, aContainer, text );
}
break;
}
@@ -283,9 +281,8 @@ 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() );
@@ -341,8 +338,7 @@ void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack,
}
createArcSegments( center, arc->GetStart(), arc_angle, circlesegcount,
arc->GetWidth() + aMargin * 2,
aDstContainer, *arc );
arc->GetWidth() + aMargin * 2, aDstContainer, *arc );
break;
}
@@ -373,8 +369,7 @@ 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;
@@ -398,8 +393,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
}
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() )
{
@@ -505,7 +499,7 @@ void BOARD_ADAPTER::createPadWithHole( const PAD* aPad, CONTAINER_2D_BASE* aDstC
void BOARD_ADAPTER::addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aContainer,
PCB_LAYER_ID aLayerId, bool aSkipPlatedPads, bool aSkipNonPlatedPads )
PCB_LAYER_ID aLayerId )
{
for( PAD* pad : aFootprint->Pads() )
{
@@ -529,24 +523,6 @@ void BOARD_ADAPTER::addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aCo
switch( aLayerId )
{
case F_Cu:
if( aSkipPlatedPads && pad->FlashLayer( F_Mask ) )
continue;
if( aSkipNonPlatedPads && !pad->FlashLayer( F_Mask ) )
continue;
break;
case B_Cu:
if( aSkipPlatedPads && pad->FlashLayer( B_Mask ) )
continue;
if( aSkipNonPlatedPads && !pad->FlashLayer( B_Mask ) )
continue;
break;
case F_Mask:
case B_Mask:
margin.x += pad->GetSolderMaskExpansion( aLayerId );
@@ -624,16 +600,15 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
int margin = 0;
if( IsSolderMaskLayer( aLayer )
&& aShape->HasSolderMask()
&& IsExternalCopperLayer( aShape->GetLayer() ) )
&& aShape->HasSolderMask()
&& IsExternalCopperLayer( aShape->GetLayer() ) )
{
margin = aShape->GetSolderMaskExpansion();
linewidth += margin * 2;
}
float linewidth3DU = TO_3DU( linewidth );
LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle();
float linewidth3DU = TO_3DU( linewidth );
LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle();
if( lineStyle <= LINE_STYLE::FIRST_TYPE )
{
@@ -645,7 +620,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( aShape->IsFilled() || innerR3DU <= 0.0 )
if( aShape->IsSolidFill() || innerR3DU <= 0.0 )
addFILLED_CIRCLE_2D( aContainer, center3DU, outerR3DU, *aOwner );
else
addRING_2D( aContainer, center3DU, innerR3DU, outerR3DU, *aOwner );
@@ -654,12 +629,11 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
}
case SHAPE_T::RECTANGLE:
if( aShape->IsFilled() )
if( aShape->IsSolidFill() )
{
SHAPE_POLY_SET polyList;
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF,
ERROR_INSIDE );
aShape->TransformShapeToPolySet( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF, ERROR_INSIDE );
polyList.Simplify();
@@ -705,8 +679,7 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
{
SHAPE_POLY_SET polyList;
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF,
ERROR_INSIDE );
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF, ERROR_INSIDE );
// Some polygons can be a bit complex (especially when coming from a
// picture of a text converted to a polygon
@@ -759,6 +732,9 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
for( SHAPE* shape : shapes )
delete shape;
}
if( aShape->IsHatchedFill() )
ConvertPolygonToTriangles( aShape->GetHatching(), *aContainer, m_biuTo3Dunits, *aOwner );
}
@@ -793,11 +769,18 @@ void BOARD_ADAPTER::addShape( const PCB_TEXTBOX* aTextBox, CONTAINER_2D_BASE* aC
void BOARD_ADAPTER::addTable( const PCB_TABLE* aTable, CONTAINER_2D_BASE* aContainer,
const BOARD_ITEM* aOwner )
{
// JEY TODO: tables
// add borders
aTable->DrawBorders(
[&]( const VECTOR2I& ptA, const VECTOR2I& ptB, const STROKE_PARAMS& stroke )
{
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( ptA ), TO_SFVEC2F( ptB ),
TO_3DU( stroke.GetWidth() ), *aOwner );
} );
for( PCB_TABLECELL* cell : aTable->GetCells() )
addText( cell, aContainer, aOwner );
{
if( cell->GetColSpan() > 0 && cell->GetRowSpan() > 0 )
addText( cell, aContainer, aOwner );
}
}
@@ -805,8 +788,7 @@ 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 );
}
@@ -825,8 +807,7 @@ 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++ )
+218 -181
View File
@@ -23,34 +23,17 @@
* 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>
@@ -59,9 +42,6 @@
#include <core/profile.h>
#endif
/*
* This is used to draw pad outlines on silk layers.
*/
@@ -97,12 +77,71 @@ 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->TransformShapeToPolygon( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
item->TransformShapeToPolySet( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
}
}
}
void transformFPTextToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLayer,
const std::bitset<LAYER_3D_END>& aFlags, SHAPE_POLY_SET& aBuffer,
int aMaxError, ERROR_LOC aErrorLoc )
{
for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
{
if( item->GetLayer() != aLayer )
continue;
if( item->Type() == PCB_TEXT_T )
{
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
if( !aFlags.test( LAYER_FP_TEXT ) )
continue;
if( text->GetText() == wxT( "${REFERENCE}" ) && !aFlags.test( LAYER_FP_REFERENCES ) )
continue;
if( text->GetText() == wxT( "${VALUE}" ) && !aFlags.test( LAYER_FP_VALUES ) )
continue;
if( aLayer != UNDEFINED_LAYER && text->GetLayer() == aLayer )
text->TransformTextToPolySet( aBuffer, 0, aMaxError, aErrorLoc );
}
if( item->Type() == PCB_TEXTBOX_T )
{
PCB_TEXTBOX* textbox = static_cast<PCB_TEXTBOX*>( item );
if( aLayer != UNDEFINED_LAYER && textbox->GetLayer() == aLayer )
{
// border
if( textbox->IsBorderEnabled() )
textbox->PCB_SHAPE::TransformShapeToPolygon( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
// text
textbox->TransformTextToPolySet( aBuffer, 0, aMaxError, aErrorLoc );
}
}
}
for( const PCB_FIELD* field : aFootprint->GetFields() )
{
if( !aFlags.test( LAYER_FP_TEXT ) )
continue;
if( field->IsReference() && !aFlags.test( LAYER_FP_REFERENCES ) )
continue;
if( field->IsValue() && !aFlags.test( LAYER_FP_VALUES ) )
continue;
if( field->GetLayer() == aLayer && field->IsVisible() )
field->TransformTextToPolySet( aBuffer, 0, aMaxError, aErrorLoc );
}
}
void BOARD_ADAPTER::destroyLayers()
{
#define DELETE_AND_FREE( ptr ) \
@@ -121,8 +160,6 @@ void BOARD_ADAPTER::destroyLayers()
DELETE_AND_FREE_MAP( m_layers_poly );
DELETE_AND_FREE( m_frontPlatedPadAndGraphicPolys )
DELETE_AND_FREE( m_backPlatedPadAndGraphicPolys )
DELETE_AND_FREE( m_frontPlatedCopperPolys )
DELETE_AND_FREE( m_backPlatedCopperPolys )
@@ -240,8 +277,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( cfg.DifferentiatePlatedCopper() )
{
m_frontPlatedPadAndGraphicPolys = new SHAPE_POLY_SET;
m_backPlatedPadAndGraphicPolys = new SHAPE_POLY_SET;
m_frontPlatedCopperPolys = new SHAPE_POLY_SET;
m_backPlatedCopperPolys = new SHAPE_POLY_SET;
@@ -261,7 +296,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.find( layer ) != m_layerMap.end() );
wxASSERT( m_layerMap.contains( layer ) );
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
@@ -319,7 +354,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
BVH_CONTAINER_2D *layerHoleContainer = nullptr;
// Check if the layer is already created
if( m_layerHoleMap.find( layer ) == m_layerHoleMap.end() )
if( !m_layerHoleMap.contains( layer ) )
{
// not found, create a new container
layerHoleContainer = new BVH_CONTAINER_2D;
@@ -339,10 +374,8 @@ 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 ) );
@@ -353,15 +386,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
}
if( cfg.DifferentiatePlatedCopper() && layer == F_Cu )
{
track->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu, 0, maxError,
ERROR_INSIDE );
}
track->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu, 0, maxError, ERROR_INSIDE );
else if( cfg.DifferentiatePlatedCopper() && layer == B_Cu )
{
track->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu, 0, maxError,
ERROR_INSIDE );
}
track->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu, 0, maxError, ERROR_INSIDE );
}
}
@@ -393,13 +420,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
SHAPE_POLY_SET *layerInnerHolesPoly = nullptr;
// Check if the layer is already created
if( m_layerHoleOdPolys.find( layer ) == m_layerHoleOdPolys.end() )
if( !m_layerHoleOdPolys.contains( layer ) )
{
// not found, create a new container
layerOuterHolesPoly = new SHAPE_POLY_SET;
m_layerHoleOdPolys[layer] = layerOuterHolesPoly;
wxASSERT( m_layerHoleIdPolys.find( layer ) == m_layerHoleIdPolys.end() );
wxASSERT( !m_layerHoleIdPolys.contains( layer ) );
layerInnerHolesPoly = new SHAPE_POLY_SET;
m_layerHoleIdPolys[layer] = layerInnerHolesPoly;
@@ -409,7 +436,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// found
layerOuterHolesPoly = m_layerHoleOdPolys[layer];
wxASSERT( m_layerHoleIdPolys.find( layer ) != m_layerHoleIdPolys.end() );
wxASSERT( m_layerHoleIdPolys.contains( layer ) );
layerInnerHolesPoly = m_layerHoleIdPolys[layer];
}
@@ -417,11 +444,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, maxError, ERROR_INSIDE );
TransformCircleToPolygon( *layerOuterHolesPoly, via->GetStart(), hole_outer_radius,
maxError, ERROR_INSIDE );
TransformCircleToPolygon( *layerInnerHolesPoly, via->GetStart(),
holediameter / 2, maxError, ERROR_INSIDE );
TransformCircleToPolygon( *layerInnerHolesPoly, via->GetStart(), holediameter / 2,
maxError, ERROR_INSIDE );
}
else if( layer == layer_ids[0] ) // it only adds once the THT holes
{
@@ -439,8 +466,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( cfg.clip_silk_on_via_annuli )
{
TransformCircleToPolygon( m_viaAnnuliPolys, via->GetStart(),
hole_outer_ring_radius, maxError, ERROR_INSIDE );
TransformCircleToPolygon( m_viaAnnuliPolys, via->GetStart(), hole_outer_ring_radius,
maxError, ERROR_INSIDE );
}
}
}
@@ -452,7 +479,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layers_poly.find( layer ) != m_layers_poly.end() );
wxASSERT( m_layers_poly.contains( layer ) );
SHAPE_POLY_SET *layerPoly = m_layers_poly[layer];
@@ -545,17 +572,20 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Add footprints PADs objects to containers
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layerMap.find( layer ) != m_layerMap.end() );
wxASSERT( m_layerMap.contains( layer ) );
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
// ADD PADS
for( FOOTPRINT* footprint : m_board->Footprints() )
{
addPads( footprint, layerContainer, layer, cfg.DifferentiatePlatedCopper(), false );
// Micro-wave footprints may have items on copper layers
addPads( footprint, layerContainer, layer );
addFootprintShapes( footprint, layerContainer, layer, visibilityFlags );
if( cfg.DifferentiatePlatedCopper() && layer == F_Cu )
footprint->TransformPadsToPolySet( *m_frontPlatedCopperPolys, F_Cu, 0, maxError, ERROR_INSIDE );
else if( cfg.DifferentiatePlatedCopper() && layer == B_Cu )
footprint->TransformPadsToPolySet( *m_backPlatedCopperPolys, B_Cu, 0, maxError, ERROR_INSIDE );
}
}
@@ -564,40 +594,23 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layers_poly.find( layer ) != m_layers_poly.end() );
wxASSERT( m_layers_poly.contains( layer ) );
SHAPE_POLY_SET *layerPoly = m_layers_poly[layer];
// Add pads to polygon list
for( FOOTPRINT* footprint : m_board->Footprints() )
{
// Note: NPTH pads are not drawn on copper layers when the pad has same shape as
// its hole
footprint->TransformPadsToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE,
true, cfg.DifferentiatePlatedCopper(), false );
footprint->TransformPadsToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
transformFPShapesToPolySet( footprint, layer, *layerPoly, maxError, ERROR_INSIDE );
}
}
if( cfg.DifferentiatePlatedCopper() )
{
// ADD PLATED PADS contours
for( FOOTPRINT* footprint : m_board->Footprints() )
{
footprint->TransformPadsToPolySet( *m_frontPlatedPadAndGraphicPolys, F_Cu, 0, maxError,
ERROR_INSIDE, true, false, true );
footprint->TransformPadsToPolySet( *m_backPlatedPadAndGraphicPolys, B_Cu, 0, maxError,
ERROR_INSIDE, true, false, true );
}
}
}
// Add graphic item on copper layers to object containers
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layerMap.find( layer ) != m_layerMap.end() );
wxASSERT( m_layerMap.contains( layer ) );
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
@@ -640,34 +653,28 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
}
// add also this shape to the plated copper polygon list if required
if( cfg.DifferentiatePlatedCopper() )
if( cfg.DifferentiatePlatedCopper() && ( layer == F_Cu || layer == B_Cu ) )
{
// Note: for TEXT and TEXTBOX, TransformShapeToPolygon returns the bounding
// box shape, not the exact text shape. So it is not used for these items
if( layer == F_Cu || layer == B_Cu )
{
SHAPE_POLY_SET* platedCopperPolys = layer == F_Cu
? m_frontPlatedCopperPolys
SHAPE_POLY_SET* copperPolys = layer == F_Cu ? m_frontPlatedCopperPolys
: m_backPlatedCopperPolys;
if( item->Type() == PCB_TEXTBOX_T )
{
PCB_TEXTBOX* text_box = static_cast<PCB_TEXTBOX*>( item );
text_box->TransformTextToPolySet( *platedCopperPolys,
0, maxError, ERROR_INSIDE );
// Add box outlines
text_box->PCB_SHAPE::TransformShapeToPolygon( *platedCopperPolys, layer,
0, maxError, ERROR_INSIDE );
}
else if( item->Type() == PCB_TEXT_T )
{
static_cast<PCB_TEXT*>( item )->TransformTextToPolySet(
*platedCopperPolys,
0, maxError, ERROR_INSIDE );
}
else
item->TransformShapeToPolygon( *platedCopperPolys, layer,
0, maxError, ERROR_INSIDE );
// Note: for TEXT and TEXTBOX, TransformShapeToPolygon returns the bounding
// box shape, not the exact text shape. So it is not used for these items
if( item->Type() == PCB_TEXTBOX_T )
{
PCB_TEXTBOX* text_box = static_cast<PCB_TEXTBOX*>( item );
text_box->TransformTextToPolySet( *copperPolys, 0, maxError, ERROR_INSIDE );
// Add box outlines
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, maxError, ERROR_INSIDE );
}
else
{
item->TransformShapeToPolySet( *copperPolys, layer, 0, maxError, ERROR_INSIDE );
}
}
}
@@ -678,7 +685,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
for( PCB_LAYER_ID layer : layer_ids )
{
wxASSERT( m_layers_poly.find( layer ) != m_layers_poly.end() );
wxASSERT( m_layers_poly.contains( layer ) );
SHAPE_POLY_SET *layerPoly = m_layers_poly[layer];
@@ -691,7 +698,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_SHAPE_T:
item->TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
item->TransformShapeToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
break;
case PCB_TEXT_T:
@@ -706,13 +713,29 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
PCB_TEXTBOX* textbox = static_cast<PCB_TEXTBOX*>( item );
if( textbox->IsBorderEnabled() )
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
textbox->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
break;
}
case PCB_TABLE_T:
// JEY TODO: tables
{
PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
for( PCB_TABLECELL* cell : table->GetCells() )
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, maxError, ERROR_INSIDE );
} );
break;
}
default:
wxLogTrace( m_logTrace, wxT( "createLayers: item type: %d not implemented" ),
@@ -739,15 +762,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
layer_lock.emplace( layer, std::make_unique<std::mutex>() );
if( cfg.DifferentiatePlatedCopper() && layer == F_Cu )
{
zone->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu, 0, maxError,
ERROR_INSIDE );
}
zone->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu, 0, maxError, ERROR_INSIDE );
else if( cfg.DifferentiatePlatedCopper() && layer == B_Cu )
{
zone->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu, 0, maxError,
ERROR_INSIDE );
}
zone->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu, 0, maxError, ERROR_INSIDE );
}
}
@@ -773,19 +790,16 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
PCB_LAYER_ID layer = zones[areaId].second;
auto layerContainer = m_layerMap.find( layer );
auto layerPolyContainer = m_layers_poly.find( layer );
if( layerContainer != m_layerMap.end() )
addSolidAreasShapes( zone, layerContainer->second, layer );
if( m_layerMap.contains( layer ) )
addSolidAreasShapes( zone, m_layerMap[layer], layer );
if( cfg.opengl_copper_thickness && cfg.engine == RENDER_ENGINE::OPENGL
&& layerPolyContainer != m_layers_poly.end() )
&& m_layers_poly.contains( layer ) )
{
auto mut_it = layer_lock.find( layer );
std::lock_guard< std::mutex > lock( *( mut_it->second ) );
zone->TransformSolidAreasShapesToPolygon( layer, *layerPolyContainer->second );
zone->TransformSolidAreasShapesToPolygon( layer, *m_layers_poly[layer] );
}
}
@@ -828,7 +842,52 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
Dwgs_User,
Cmts_User,
Eco1_User,
Eco2_User
Eco2_User,
User_1,
User_2,
User_3,
User_4,
User_5,
User_6,
User_7,
User_8,
User_9,
User_10,
User_11,
User_12,
User_13,
User_14,
User_15,
User_16,
User_17,
User_18,
User_19,
User_20,
User_21,
User_22,
User_23,
User_24,
User_25,
User_26,
User_27,
User_28,
User_29,
User_30,
User_31,
User_32,
User_33,
User_34,
User_35,
User_36,
User_37,
User_38,
User_39,
User_40,
User_41,
User_42,
User_43,
User_44,
User_45,
} );
std::bitset<LAYER_3D_END> enabledFlags = visibilityFlags;
@@ -876,7 +935,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
break;
case PCB_TABLE_T:
// JEY TODO: tables
addTable( static_cast<PCB_TABLE*>( item ), layerContainer, item );
break;
case PCB_DIM_ALIGNED_T:
@@ -903,9 +962,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Only vias on a external copper layer can have a solder mask
PCB_LAYER_ID copper_layer = layer == F_Mask ? F_Cu : B_Cu;
if( track->Type() == PCB_VIA_T
&& !static_cast<const PCB_VIA*>( track )->FlashLayer( copper_layer ) )
continue;
if( track->Type() == PCB_VIA_T )
{
const PCB_VIA* via = static_cast<const PCB_VIA*>( track );
if( !via->FlashLayer( copper_layer ) )
continue;
}
int maskExpansion = track->GetSolderMaskExpansion();
createTrackWithMargin( track, layerContainer, layer, maskExpansion );
@@ -929,7 +992,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
}
else
{
addPads( footprint, layerContainer, layer, false, false );
addPads( footprint, layerContainer, layer );
}
addFootprintShapes( footprint, layerContainer, layer, visibilityFlags );
@@ -960,7 +1023,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_SHAPE_T:
item->TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
item->TransformShapeToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
break;
case PCB_TEXT_T:
@@ -975,13 +1038,30 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
PCB_TEXTBOX* textbox = static_cast<PCB_TEXTBOX*>( item );
if( textbox->IsBorderEnabled() )
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
textbox->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
break;
}
case PCB_TABLE_T:
// JEY TODO: tables
{
PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
for( PCB_TABLECELL* cell : table->GetCells() )
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, maxError, ERROR_INSIDE );
} );
break;
}
default:
break;
@@ -999,8 +1079,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
&& static_cast<const PCB_VIA*>( track )->FlashLayer( layer )
&& !static_cast<const PCB_VIA*>( track )->IsTented( layer ) )
{
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, maxError,
ERROR_INSIDE );
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, maxError, ERROR_INSIDE );
}
}
}
@@ -1015,10 +1094,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
for( PAD* pad : footprint->Pads() )
{
if( pad->IsOnLayer( layer ) )
{
buildPadOutlineAsPolygon( pad, layer, *layerPoly, linewidth, maxError,
ERROR_INSIDE );
}
buildPadOutlineAsPolygon( pad, layer, *layerPoly, linewidth, maxError, ERROR_INSIDE );
}
}
else
@@ -1026,10 +1102,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
footprint->TransformPadsToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
}
// On tech layers, use a poor circle approximation, only for texts (stroke font)
footprint->TransformFPTextToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
// Add the remaining things with dynamic seg count for circles
transformFPTextToPolySet( footprint, layer, visibilityFlags, *layerPoly, maxError, ERROR_INSIDE );
transformFPShapesToPolySet( footprint, layer, *layerPoly, maxError, ERROR_INSIDE );
}
@@ -1059,9 +1132,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( !footprint->GetBoundingBox().Intersects( boardBBox ) )
{
if( footprint->IsFlipped() )
addPads( footprint, m_offboardPadsBack, B_Cu, false, false );
addPads( footprint, m_offboardPadsBack, B_Cu );
else
addPads( footprint, m_offboardPadsFront, F_Cu, false, false );
addPads( footprint, m_offboardPadsFront, F_Cu );
}
}
@@ -1080,52 +1153,18 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
aStatusReporter->Report( _( "Calculating plated copper" ) );
// TRIM PLATED COPPER TO SOLDERMASK
if( m_layers_poly.find( F_Mask ) != m_layers_poly.end() )
{
if( m_layers_poly.contains( F_Mask ) )
m_frontPlatedCopperPolys->BooleanIntersection( *m_layers_poly.at( F_Mask ) );
}
if( m_layers_poly.find( B_Mask ) != m_layers_poly.end() )
{
if( m_layers_poly.contains( B_Mask ))
m_backPlatedCopperPolys->BooleanIntersection( *m_layers_poly.at( B_Mask ) );
}
// Subtract plated copper from unplated copper
bool hasF_Cu = false;
bool hasB_Cu = false;
if( m_layers_poly.find( F_Cu ) != m_layers_poly.end() )
{
m_layers_poly[F_Cu]->BooleanSubtract( *m_frontPlatedPadAndGraphicPolys );
if( m_layers_poly.contains( F_Cu ) )
m_layers_poly[F_Cu]->BooleanSubtract( *m_frontPlatedCopperPolys );
hasF_Cu = true;
}
if( m_layers_poly.find( B_Cu ) != m_layers_poly.end() )
{
m_layers_poly[B_Cu]->BooleanSubtract( *m_backPlatedPadAndGraphicPolys );
if( m_layers_poly.contains( B_Cu ) )
m_layers_poly[B_Cu]->BooleanSubtract( *m_backPlatedCopperPolys );
hasB_Cu = true;
}
// Add plated graphic items to build vertical walls
if( hasF_Cu && m_frontPlatedCopperPolys->OutlineCount() )
m_frontPlatedPadAndGraphicPolys->Append( *m_frontPlatedCopperPolys );
if( hasB_Cu && m_backPlatedCopperPolys->OutlineCount() )
m_backPlatedPadAndGraphicPolys->Append( *m_backPlatedCopperPolys );
m_frontPlatedPadAndGraphicPolys->Simplify();
m_backPlatedPadAndGraphicPolys->Simplify();
m_frontPlatedCopperPolys->Simplify();
m_backPlatedCopperPolys->Simplify();
// ADD PLATED PADS
for( FOOTPRINT* footprint : m_board->Footprints() )
{
addPads( footprint, m_platedPadsFront, F_Cu, false, true );
addPads( footprint, m_platedPadsBack, B_Cu, false, true );
}
// ADD PLATED COPPER
ConvertPolygonToTriangles( *m_frontPlatedCopperPolys, *m_platedPadsFront, m_biuTo3Dunits,
@@ -1181,13 +1220,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
i < selected_layer_id.size();
i = nextItem.fetch_add( 1 ) )
{
auto layerPoly = m_layers_poly.find( selected_layer_id[i] );
if( layerPoly != m_layers_poly.end() )
if( m_layers_poly.contains( selected_layer_id[i] ) )
{
// This will make a union of all added contours
layerPoly->second->ClearArcs();
layerPoly->second->Simplify();
m_layers_poly[ selected_layer_id[i] ]->ClearArcs();
m_layers_poly[ selected_layer_id[i] ]->Simplify();
}
}
@@ -1208,13 +1245,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
for( PCB_LAYER_ID layer : layer_ids )
{
if( m_layerHoleOdPolys.find( layer ) != m_layerHoleOdPolys.end() )
if( m_layerHoleOdPolys.contains( layer ) )
{
// found
SHAPE_POLY_SET *polyLayer = m_layerHoleOdPolys[layer];
polyLayer->Simplify();
wxASSERT( m_layerHoleIdPolys.find( layer ) != m_layerHoleIdPolys.end() );
wxASSERT( m_layerHoleIdPolys.contains( layer ) );
polyLayer = m_layerHoleIdPolys[layer];
polyLayer->Simplify();
+10 -12
View File
@@ -567,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.find( layer ) != map_poly.end() )
if( map_poly.contains( layer ) )
{
polyListSubtracted = *map_poly.at( layer );
@@ -584,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.find( B_Mask ) != map_poly.end() )
if( layer == B_SilkS && map_poly.contains( B_Mask ) )
{
polyListSubtracted.BooleanSubtract( *map_poly.at( B_Mask ) );
}
else if( layer == F_SilkS && map_poly.find( F_Mask ) != map_poly.end() )
else if( layer == F_SilkS && map_poly.contains( F_Mask ) )
{
polyListSubtracted.BooleanSubtract( *map_poly.at( F_Mask ) );
}
@@ -607,14 +607,12 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
if( m_boardAdapter.m_Cfg->m_Render.DifferentiatePlatedCopper() )
{
const SHAPE_POLY_SET* frontPlatedPadAndGraphicPolys =
m_boardAdapter.GetFrontPlatedPadAndGraphicPolys();
const SHAPE_POLY_SET* backPlatedPadAndGraphicPolys =
m_boardAdapter.GetBackPlatedPadAndGraphicPolys();
const SHAPE_POLY_SET* frontPlatedCopperPolys = m_boardAdapter.GetFrontPlatedCopperPolys();
const SHAPE_POLY_SET* backPlatedCopperPolys = m_boardAdapter.GetBackPlatedCopperPolys();
if( frontPlatedPadAndGraphicPolys )
if( frontPlatedCopperPolys )
{
SHAPE_POLY_SET poly = frontPlatedPadAndGraphicPolys->CloneDropTriangulation();
SHAPE_POLY_SET poly = frontPlatedCopperPolys->CloneDropTriangulation();
poly.BooleanIntersection( m_boardAdapter.GetBoardPoly() );
poly.BooleanSubtract( m_boardAdapter.GetTH_ODPolys() );
poly.BooleanSubtract( m_boardAdapter.GetNPTH_ODPolys() );
@@ -627,9 +625,9 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
m_layers[F_Cu] = generateEmptyLayerList( F_Cu );
}
if( backPlatedPadAndGraphicPolys )
if( backPlatedCopperPolys )
{
SHAPE_POLY_SET poly = backPlatedPadAndGraphicPolys->CloneDropTriangulation();
SHAPE_POLY_SET poly = backPlatedCopperPolys->CloneDropTriangulation();
poly.BooleanIntersection( m_boardAdapter.GetBoardPoly() );
poly.BooleanSubtract( m_boardAdapter.GetTH_ODPolys() );
poly.BooleanSubtract( m_boardAdapter.GetNPTH_ODPolys() );
@@ -964,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.find( fp_model.m_Filename ) == m_3dModelMap.end() )
if( !m_3dModelMap.contains( fp_model.m_Filename ) )
{
// It is not present, try get it from cache
const S3DMODEL* modelPtr =
@@ -271,9 +271,7 @@ void RENDER_3D_OPENGL::setupMaterials()
void RENDER_3D_OPENGL::setLayerMaterial( PCB_LAYER_ID aLayerID )
{
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS& cfg = m_boardAdapter.m_Cfg->m_Render;
if( cfg.use_board_editor_copper_colors && IsCopperLayer( aLayerID ) )
if( m_boardAdapter.GetUseBoardEditorCopperLayerColors() && IsCopperLayer( aLayerID ) )
{
COLOR4D copper_color = m_boardAdapter.m_BoardEditorColors[aLayerID];
m_materials.m_Copper.m_Diffuse = SFVEC3F( copper_color.r, copper_color.g,
@@ -362,10 +360,34 @@ void RENDER_3D_OPENGL::setLayerMaterial( PCB_LAYER_ID aLayerID )
break;
default:
{
int layer3D = MapPCBLayerTo3DLayer( aLayerID );
// Note: MUST do this in LAYER_3D space; User_1..User_45 are NOT contiguous
if( layer3D >= LAYER_3D_USER_1 && layer3D <= LAYER_3D_USER_45 )
{
int user_idx = layer3D - LAYER_3D_USER_1;
m_materials.m_Plastic.m_Diffuse = m_boardAdapter.m_UserDefinedLayerColor[ user_idx ];
m_materials.m_Plastic.m_Ambient = SFVEC3F( m_materials.m_Plastic.m_Diffuse.r * 0.05f,
m_materials.m_Plastic.m_Diffuse.g * 0.05f,
m_materials.m_Plastic.m_Diffuse.b * 0.05f );
m_materials.m_Plastic.m_Specular = SFVEC3F( m_materials.m_Plastic.m_Diffuse.r * 0.7f,
m_materials.m_Plastic.m_Diffuse.g * 0.7f,
m_materials.m_Plastic.m_Diffuse.b * 0.7f );
m_materials.m_Plastic.m_Shininess = 0.078125f * 128.0f;
m_materials.m_Plastic.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
OglSetMaterial( m_materials.m_Plastic, 1.0f );
break;
}
m_materials.m_Copper.m_Diffuse = m_boardAdapter.m_CopperColor;
OglSetMaterial( m_materials.m_Copper, 1.0f );
break;
}
}
}
@@ -632,7 +632,15 @@ void RENDER_3D_RAYTRACE_BASE::Reload( REPORTER* aStatusReporter, REPORTER* aWarn
break;
default:
if( m_boardAdapter.m_Cfg->m_Render.differentiate_plated_copper )
{
int layer3D = MapPCBLayerTo3DLayer( layer_id );
// Note: MUST do this in LAYER_3D space; User_1..User_45 are NOT contiguous
if( layer3D >= LAYER_3D_USER_1 && layer3D <= LAYER_3D_USER_45 )
{
layerColor = m_boardAdapter.m_UserDefinedLayerColor[ layer3D - LAYER_3D_USER_1 ];
}
else if( m_boardAdapter.m_Cfg->m_Render.differentiate_plated_copper )
{
layerColor = SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, 50.0f / 255.0f );
materialLayer = &m_materials.m_NonPlatedCopper;
@@ -645,6 +653,7 @@ void RENDER_3D_RAYTRACE_BASE::Reload( REPORTER* aStatusReporter, REPORTER* aWarn
break;
}
}
createItemsFromContainer( container2d, layer_id, materialLayer, layerColor, 0.0f );
} // for each layer on map
@@ -274,10 +274,12 @@ void RENDER_3D_RAYTRACE_BASE::renderTracing( uint8_t* ptrPBO, REPORTER* aStatusR
}
};
for( size_t i = 0; i < tp.get_thread_count() + 1; ++i )
tp.push_task( processBlocks );
BS::multi_future<void> futures;
tp.wait_for_tasks();
for( size_t i = 0; i < tp.get_thread_count(); ++i )
futures.push_back( tp.submit( processBlocks ) );
futures.wait();
m_blockRenderProgressCount += numBlocksRendered;
+4 -17
View File
@@ -48,15 +48,8 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
//
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
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->Add( EDA_3D_ACTIONS::exportAsPNG );
fileMenu->Add( EDA_3D_ACTIONS::exportAsJPEG );
fileMenu->AppendSeparator();
fileMenu->AddClose( _( "3D Viewer" ) );
@@ -67,10 +60,7 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
// The translated modifiers do not always work
ACTION_MENU* editMenu = new ACTION_MENU( false, tool );
editMenu->Add( _( "Copy 3D Image" ),
wxEmptyString,
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
BITMAPS::copy );
editMenu->Add( EDA_3D_ACTIONS::copyToClipboard );
//-- View menu -------------------------------------------------------
@@ -122,10 +112,7 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
//
ACTION_MENU* prefsMenu = new ACTION_MENU( false, tool );
prefsMenu->Add( _( "Raytracing" ), "",
ID_RENDER_CURRENT_VIEW,
BITMAPS::tools,
ACTION_MENU::CHECK );
prefsMenu->Add( EDA_3D_ACTIONS::toggleRaytacing, ACTION_MENU::CHECK );
prefsMenu->Add( ACTIONS::openPreferences );
-107
View File
@@ -1,107 +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>
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();
}
+14 -41
View File
@@ -58,6 +58,7 @@
#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>
@@ -80,7 +81,6 @@ 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,7 +91,6 @@ 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 )
@@ -149,13 +148,16 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
m_toolManager->InvokeTool( "3DViewer.Control" );
ReCreateMenuBar();
ReCreateMainToolbar();
m_toolbarSettings = Pgm().GetSettingsManager().GetToolbarSettings<EDA_3D_VIEWER_TOOLBAR_SETTINGS>( "3d_viewer-toolbars" );
configureToolbars();
RecreateToolbars();
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
m_auimgr.SetManagedWindow( this );
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) )
m_auimgr.AddPane( m_tbTopMain, EDA_PANE().HToolbar().Name( wxS( "TopMainToolbar" ) )
.Top().Layer( 6 ) );
m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( wxS( "InfoBar" ) )
.Top().Layer( 1 ) );
@@ -272,7 +274,7 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions()
return m_boardAdapter.m_Cfg->m_AuiPanels.show_layer_manager;
};
RegisterUIUpdateHandler( ID_RENDER_CURRENT_VIEW, ACTION_CONDITIONS().Check( raytracing ) );
mgr->SetConditions( EDA_3D_ACTIONS::toggleRaytacing, ACTION_CONDITIONS().Check( raytracing ) );
mgr->SetConditions( EDA_3D_ACTIONS::showTHT, ACTION_CONDITIONS().Check( showTH ) );
mgr->SetConditions( EDA_3D_ACTIONS::showSMD, ACTION_CONDITIONS().Check( showSMD ) );
@@ -467,21 +469,13 @@ void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
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() );
cfg->ResetToDefaults();
LoadSettings( cfg );
@@ -499,24 +493,6 @@ 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." ),
@@ -641,9 +617,6 @@ 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(
Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
@@ -659,7 +632,7 @@ void EDA_3D_VIEWER_FRAME::ShowChangedLanguage()
EDA_BASE_FRAME::ShowChangedLanguage();
SetTitle( _( "3D Viewer" ) );
ReCreateMainToolbar();
RecreateToolbars();
if( m_appearancePanel )
{
@@ -702,15 +675,15 @@ void EDA_3D_VIEWER_FRAME::OnDarkModeToggle()
}
void EDA_3D_VIEWER_FRAME::takeScreenshot( wxCommandEvent& event )
void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
{
wxString fullFileName;
bool fmt_is_jpeg = false;
if( event.GetId() == ID_MENU_SCREENCOPY_JPEG )
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG )
fmt_is_jpeg = true;
if( event.GetId() != ID_TOOL_SCREENCOPY_TOCLIBBOARD )
if( aFormat != EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
{
// Remember path between saves during this session only.
const wxString wildcard =
@@ -774,7 +747,7 @@ void EDA_3D_VIEWER_FRAME::takeScreenshot( wxCommandEvent& event )
cfg.highlight_on_rollover = allow_highlight;
if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD )
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
{
wxBitmap bitmap( screenshotImage );
+13 -9
View File
@@ -57,6 +57,13 @@ 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
*/
@@ -123,6 +130,12 @@ 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;
@@ -138,20 +151,12 @@ 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
@@ -172,7 +177,6 @@ private:
private:
wxFileName m_defaultSaveScreenshotFileName;
ACTION_TOOLBAR* m_mainToolBar;
EDA_3D_CANVAS* m_canvas;
BOARD_ADAPTER m_boardAdapter;
CAMERA& m_currentCamera;
+112 -16
View File
@@ -19,6 +19,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <fmt/format.h>
#include <3d_enums.h>
#include <common_ogl/ogl_attr_list.h>
#include <settings/parameters.h>
@@ -81,6 +82,35 @@ PARAM_LAYER_PRESET_3D::PARAM_LAYER_PRESET_3D( const std::string& aPath,
m_presets( aPresetList )
{
wxASSERT( aPresetList );
#define LAYER( n, l ) m_layerToLayerNameMap[l] = n; m_layerNameToLayerMap[n] = l;
LAYER( "fp_values", LAYER_FP_VALUES );
LAYER( "fp_references", LAYER_FP_REFERENCES );
LAYER( "fp_text", LAYER_FP_TEXT );
LAYER( "background_bottom", LAYER_3D_BACKGROUND_BOTTOM );
LAYER( "background_top", LAYER_3D_BACKGROUND_TOP );
LAYER( "board", LAYER_3D_BOARD );
LAYER( "copper", LAYER_3D_COPPER_TOP );
LAYER( "copper_bottom", LAYER_3D_COPPER_BOTTOM );
LAYER( "silkscreen_bottom", LAYER_3D_SILKSCREEN_BOTTOM );
LAYER( "silkscreen_top", LAYER_3D_SILKSCREEN_TOP );
LAYER( "soldermask_bottom", LAYER_3D_SOLDERMASK_BOTTOM );
LAYER( "soldermask_top", LAYER_3D_SOLDERMASK_TOP );
LAYER( "solderpaste", LAYER_3D_SOLDERPASTE );
LAYER( "adhesive", LAYER_3D_ADHESIVE );
LAYER( "user_comments", LAYER_3D_USER_COMMENTS );
LAYER( "user_drawings", LAYER_3D_USER_DRAWINGS );
LAYER( "user_eco1", LAYER_3D_USER_ECO1 );
LAYER( "user_eco2", LAYER_3D_USER_ECO2 );
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 );
LAYER( "non_pos_file_models", LAYER_3D_MODELS_NOT_IN_POS );
LAYER( "dnp_models", LAYER_3D_MODELS_MARKED_DNP );
LAYER( "bounding_boxes", LAYER_3D_BOUNDING_BOXES );
LAYER( "off_board_silk", LAYER_3D_OFF_BOARD_SILK );
}
@@ -99,7 +129,7 @@ nlohmann::json PARAM_LAYER_PRESET_3D::presetsToJson()
for( int layer = 0; layer < LAYER_3D_END; ++layer )
{
if( preset.layers.test( layer ) )
layers.push_back( layer );
layers.push_back( m_layerToLayerNameMap[layer] );
}
js["layers"] = layers;
@@ -109,7 +139,7 @@ nlohmann::json PARAM_LAYER_PRESET_3D::presetsToJson()
for( const auto& [ layer, color ] : preset.colors )
{
nlohmann::json layerColor = {
{ "layer", layer },
{ "layer", m_layerToLayerNameMap[layer] },
{ "color", color.ToCSSString() }
};
@@ -144,26 +174,20 @@ void PARAM_LAYER_PRESET_3D::jsonToPresets( const nlohmann::json& aJson )
for( const nlohmann::json& layer : preset.at( "layers" ) )
{
if( layer.is_number_integer() )
{
int layerNum = layer.get<int>();
if( layerNum >= 0 && layerNum < LAYER_3D_END )
p.layers.set( layerNum );
}
if( layer.is_string() )
p.layers.set( m_layerNameToLayerMap[layer.get<wxString>()] );
}
}
if( preset.contains( "colors" ) && preset.at( "colors" ).is_array() )
{
for( const nlohmann::json& layerColor : preset.at( "colors" ) )
for( const nlohmann::json& entry : preset.at( "colors" ) )
{
if( layerColor.contains( "layer" ) && layerColor.contains( "color" )
&& layerColor.at( "layer" ).is_number_integer() )
if( entry.contains( "layer" ) && entry.contains( "color" )
&& entry.at( "layer" ).is_string() )
{
int layerNum = layerColor.at( "layer" ).get<int>();
COLOR4D color = layerColor.at( "color" ).get<COLOR4D>();
p.colors[ layerNum ] = color;
int layerNum = m_layerNameToLayerMap[entry.at( "layer" ).get<wxString>()];
p.colors[ layerNum ] = entry.at( "color" ).get<COLOR4D>();
}
}
}
@@ -175,7 +199,7 @@ void PARAM_LAYER_PRESET_3D::jsonToPresets( const nlohmann::json& aJson )
///! Update the schema version whenever a migration is required
const int viewer3dSchemaVersion = 3;
const int viewer3dSchemaVersion = 4;
EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
@@ -330,6 +354,13 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
&m_Render.show_eco1, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_eco2",
&m_Render.show_eco2, true ) );
for( int layer = 0; layer < 45; ++layer )
{
m_params.emplace_back( new PARAM<bool>( fmt::format( "render.show_user{}", layer + 1 ),
&m_Render.show_user[layer], false ) );
}
m_params.emplace_back( new PARAM<bool>( "render.show_footprints_insert",
&m_Render.show_footprints_insert, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_footprints_normal",
@@ -370,6 +401,8 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
&m_Render.differentiate_plated_copper, false ) );
m_params.emplace_back( new PARAM<bool>( "render.use_board_editor_copper_colors",
&m_Render.use_board_editor_copper_colors, false ) );
m_params.emplace_back( new PARAM<bool>( "render.preview_show_board_body",
&m_Render.preview_show_board_body, true ) );
m_params.emplace_back( new PARAM<bool>( "camera.animation_enabled",
&m_Camera.animation_enabled, true ) );
m_params.emplace_back( new PARAM<int>( "camera.moving_speed_multiplier",
@@ -425,6 +458,69 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
Set( "render.show_eco2", *optval );
}
return true;
} );
registerMigration( 3, 4,
[&]() -> bool
{
std::map<int, wxString> legacyColorMap;
legacyColorMap[142] = "fp_values";
legacyColorMap[143] = "fp_references";
legacyColorMap[130] = "fp_text";
legacyColorMap[466] = "background_bottom";
legacyColorMap[467] = "background_top";
legacyColorMap[468] = "board";
legacyColorMap[469] = "copper";
legacyColorMap[470] = "copper_bottom";
legacyColorMap[471] = "silkscreen_bottom";
legacyColorMap[472] = "silkscreen_top";
legacyColorMap[473] = "soldermask_bottom";
legacyColorMap[474] = "soldermask_top";
legacyColorMap[475] = "solderpaste";
legacyColorMap[476] = "adhesive";
legacyColorMap[477] = "user_comments";
legacyColorMap[478] = "user_drawings";
legacyColorMap[479] = "user_eco1";
legacyColorMap[480] = "user_eco2";
legacyColorMap[481] = "th_models";
legacyColorMap[482] = "smd_models";
legacyColorMap[483] = "virtual_models";
legacyColorMap[484] = "non_pos_file_models";
legacyColorMap[485] = "dnp_models";
legacyColorMap[486] = "3d_axes";
legacyColorMap[487] = "bounding_boxes";
legacyColorMap[488] = "off_board_silk";
if( !Contains( "layer_presets" ) || !At( "layer_presets" ).is_array() )
return true;
for( nlohmann::json& preset : At( "layer_presets" ) )
{
if( preset.contains( "colors" ) && preset.at( "colors" ).is_array() )
{
for( nlohmann::json& color : preset.at( "colors" ) )
{
if( color.contains( "layer" ) && color.at( "layer" ).is_number_integer() )
color["layer"] = legacyColorMap[color["layer"].get<int>()];
}
}
if( preset.contains( "layers" ) && preset.at( "layers" ).is_array() )
{
nlohmann::json mappedLayers = nlohmann::json::array();
for( const nlohmann::json& layer : preset.at( "layers" ) )
{
if( layer.is_number_integer() )
mappedLayers.push_back( legacyColorMap[layer.get<int>()] );
}
preset["layers"] = mappedLayers;
}
}
return true;
} );
}
+11 -8
View File
@@ -64,7 +64,11 @@ private:
void jsonToPresets( const nlohmann::json& aJson );
private:
std::vector<LAYER_PRESET_3D>* m_presets;
std::map<int, wxString> m_layerToLayerNameMap;
std::map<wxString, int> m_layerNameToLayerMap;
};
@@ -128,6 +132,7 @@ public:
bool show_drawings;
bool show_eco1;
bool show_eco2;
bool show_user[45];
bool show_footprints_insert;
bool show_footprints_normal;
bool show_footprints_virtual;
@@ -147,21 +152,19 @@ public:
bool subtract_mask_from_silk;
bool clip_silk_on_via_annuli;
bool differentiate_plated_copper;
// Board editor copper colors are used only in OpenGL mode if
// use_board_editor_copper_colors is true
bool use_board_editor_copper_colors;
bool use_board_editor_copper_colors; // OpenGL only
bool preview_show_board_body;
/**
* return true if platted copper aeras and non platted copper areas must be drawn
* using a different color
* in OPENGL mode, if use_board_editor_copper_colors, always false
* in RAYTRACING mode, use_board_editor_copper_colors is ignored (board editor copper
* colors are ignored)
*/
bool DifferentiatePlatedCopper()
{
return engine == RENDER_ENGINE::RAYTRACING ? differentiate_plated_copper
: differentiate_plated_copper && !use_board_editor_copper_colors;
if( engine == RENDER_ENGINE::OPENGL && use_board_editor_copper_colors )
return false;
return differentiate_plated_copper;
}
};
+98
View File
@@ -0,0 +1,98 @@
/*
* 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
@@ -0,0 +1,40 @@
/*
* 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_ */
+48 -3
View File
@@ -23,6 +23,7 @@
#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"
@@ -38,7 +39,47 @@
TOOL_ACTION EDA_3D_ACTIONS::controlActivate( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control" )
.Scope( AS_GLOBAL )
.Flags( AF_ACTIVATE ) );
.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 ) );
TOOL_ACTION EDA_3D_ACTIONS::pivotCenter( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.pivotCenter" )
@@ -84,6 +125,7 @@ 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 )
@@ -92,6 +134,7 @@ 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 )
@@ -157,7 +200,8 @@ TOOL_ACTION EDA_3D_ACTIONS::toggleOrtho( TOOL_ACTION_ARGS()
.Scope( AS_GLOBAL )
.FriendlyName( _( "Toggle Orthographic Projection" ) )
.Tooltip( _( "Enable/disable orthographic projection" ) )
.Icon( BITMAPS::ortho ) );
.Icon( BITMAPS::ortho )
.ToolbarState( TOOLBAR_STATE::TOGGLE ) );
TOOL_ACTION EDA_3D_ACTIONS::viewFront( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.viewFront" )
@@ -337,5 +381,6 @@ 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 ) );
.Icon( BITMAPS::layers_manager )
.ToolbarState( TOOLBAR_STATE::TOGGLE ) );
@@ -42,6 +42,13 @@ 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;
@@ -334,11 +334,65 @@ 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,6 +96,10 @@ 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,20 +34,12 @@
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 -1
View File
@@ -81,7 +81,7 @@ set(3D-VIEWER_SRCS
3d_rendering/test_cases.cpp
3d_rendering/trackball.cpp
3d_viewer/3d_menubar.cpp
3d_viewer/3d_toolbar.cpp
3d_viewer/toolbars_3d.cpp
3d_viewer/tools/eda_3d_actions.cpp
3d_viewer/tools/eda_3d_conditions.cpp
3d_viewer/tools/eda_3d_controller.cpp
+153 -100
View File
@@ -29,8 +29,7 @@
#include <eda_3d_viewer_frame.h>
#include <pcbnew_settings.h>
#include <project.h>
#include <settings/settings_manager.h>
#include <settings/color_settings.h>
#include <board.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/eda_3d_actions.h>
@@ -51,52 +50,93 @@
/// Template for object appearance settings
const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_layerSettings[] = {
// text id tooltip
RR( _HKI( "Board Body" ), LAYER_3D_BOARD, _HKI( "Show board body" ) ),
RR( _HKI( "F.Cu" ), LAYER_3D_COPPER_TOP, _HKI( "Show front copper / surface finish color" ) ),
RR( _HKI( "B.Cu" ), LAYER_3D_COPPER_BOTTOM, _HKI( "Show back copper / surface finish color" ) ),
RR( _HKI( "Adhesive" ), LAYER_3D_ADHESIVE, _HKI( "Show adhesive" ) ),
RR( _HKI( "Solder Paste" ), LAYER_3D_SOLDERPASTE, _HKI( "Show solder paste" ) ),
RR( _HKI( "F.Silkscreen" ), LAYER_3D_SILKSCREEN_TOP, _HKI( "Show front silkscreen" ) ),
RR( _HKI( "B.Silkscreen" ), LAYER_3D_SILKSCREEN_BOTTOM, _HKI( "Show back silkscreen" ) ),
RR( _HKI( "F.Mask" ), LAYER_3D_SOLDERMASK_TOP, _HKI( "Show front solder mask" ) ),
RR( _HKI( "B.Mask" ), LAYER_3D_SOLDERMASK_BOTTOM, _HKI( "Show back solder mask" ) ),
RR( _HKI( "User.Drawings" ), LAYER_3D_USER_DRAWINGS, _HKI( "Show user drawings layer" ) ),
RR( _HKI( "User.Comments" ), LAYER_3D_USER_COMMENTS, _HKI( "Show user comments layer" ) ),
RR( _HKI( "User.Eco1" ), LAYER_3D_USER_ECO1, _HKI( "Show user ECO1 layer" ) ),
RR( _HKI( "User.Eco2" ), LAYER_3D_USER_ECO2, _HKI( "Show user ECO2 layer" ) ),
// text id tooltip
RR( _HKI( "Board Body" ), LAYER_3D_BOARD, _HKI( "Show board body" ) ),
RR( wxS( "F.Cu" ), LAYER_3D_COPPER_TOP, _HKI( "Show front copper / surface finish color" ) ),
RR( wxS( "B.Cu" ), LAYER_3D_COPPER_BOTTOM, _HKI( "Show back copper / surface finish color" ) ),
RR( _HKI( "Adhesive" ), LAYER_3D_ADHESIVE, _HKI( "Show adhesive" ) ),
RR( _HKI( "Solder Paste" ), LAYER_3D_SOLDERPASTE, _HKI( "Show solder paste" ) ),
RR( wxS( "F.Silkscreen" ), LAYER_3D_SILKSCREEN_TOP, _HKI( "Show front silkscreen" ) ),
RR( wxS( "B.Silkscreen" ), LAYER_3D_SILKSCREEN_BOTTOM, _HKI( "Show back silkscreen" ) ),
RR( wxS( "F.Mask" ), LAYER_3D_SOLDERMASK_TOP, _HKI( "Show front solder mask" ) ),
RR( wxS( "B.Mask" ), LAYER_3D_SOLDERMASK_BOTTOM, _HKI( "Show back solder mask" ) ),
RR( wxS( "User.Drawings" ), LAYER_3D_USER_DRAWINGS, _HKI( "Show user drawings layer" ) ),
RR( wxS( "User.Comments" ), LAYER_3D_USER_COMMENTS, _HKI( "Show user comments layer" ) ),
RR( wxS( "User.Eco1" ), LAYER_3D_USER_ECO1, _HKI( "Show user ECO1 layer" ) ),
RR( wxS( "User.Eco2" ), LAYER_3D_USER_ECO2, _HKI( "Show user ECO2 layer" ) ),
RR( wxS( "User.1" ), LAYER_3D_USER_1, _HKI( "Show user defined layer 1" ) ),
RR( wxS( "User.2" ), LAYER_3D_USER_2, _HKI( "Show user defined layer 2" ) ),
RR( wxS( "User.3" ), LAYER_3D_USER_3, _HKI( "Show user defined layer 3" ) ),
RR( wxS( "User.4" ), LAYER_3D_USER_4, _HKI( "Show user defined layer 4" ) ),
RR( wxS( "User.5" ), LAYER_3D_USER_5, _HKI( "Show user defined layer 5" ) ),
RR( wxS( "User.6" ), LAYER_3D_USER_6, _HKI( "Show user defined layer 6" ) ),
RR( wxS( "User.7" ), LAYER_3D_USER_7, _HKI( "Show user defined layer 7" ) ),
RR( wxS( "User.8" ), LAYER_3D_USER_8, _HKI( "Show user defined layer 8" ) ),
RR( wxS( "User.9" ), LAYER_3D_USER_9, _HKI( "Show user defined layer 9" ) ),
RR( wxS( "User.10" ), LAYER_3D_USER_10, _HKI( "Show user defined layer 10" ) ),
RR( wxS( "User.11" ), LAYER_3D_USER_11, _HKI( "Show user defined layer 11" ) ),
RR( wxS( "User.12" ), LAYER_3D_USER_12, _HKI( "Show user defined layer 12" ) ),
RR( wxS( "User.13" ), LAYER_3D_USER_13, _HKI( "Show user defined layer 13" ) ),
RR( wxS( "User.14" ), LAYER_3D_USER_14, _HKI( "Show user defined layer 14" ) ),
RR( wxS( "User.15" ), LAYER_3D_USER_15, _HKI( "Show user defined layer 15" ) ),
RR( wxS( "User.16" ), LAYER_3D_USER_16, _HKI( "Show user defined layer 16" ) ),
RR( wxS( "User.17" ), LAYER_3D_USER_17, _HKI( "Show user defined layer 17" ) ),
RR( wxS( "User.18" ), LAYER_3D_USER_18, _HKI( "Show user defined layer 18" ) ),
RR( wxS( "User.19" ), LAYER_3D_USER_19, _HKI( "Show user defined layer 19" ) ),
RR( wxS( "User.20" ), LAYER_3D_USER_20, _HKI( "Show user defined layer 20" ) ),
RR( wxS( "User.21" ), LAYER_3D_USER_21, _HKI( "Show user defined layer 21" ) ),
RR( wxS( "User.22" ), LAYER_3D_USER_22, _HKI( "Show user defined layer 22" ) ),
RR( wxS( "User.23" ), LAYER_3D_USER_23, _HKI( "Show user defined layer 23" ) ),
RR( wxS( "User.24" ), LAYER_3D_USER_24, _HKI( "Show user defined layer 24" ) ),
RR( wxS( "User.25" ), LAYER_3D_USER_25, _HKI( "Show user defined layer 25" ) ),
RR( wxS( "User.26" ), LAYER_3D_USER_26, _HKI( "Show user defined layer 26" ) ),
RR( wxS( "User.27" ), LAYER_3D_USER_27, _HKI( "Show user defined layer 27" ) ),
RR( wxS( "User.28" ), LAYER_3D_USER_28, _HKI( "Show user defined layer 28" ) ),
RR( wxS( "User.29" ), LAYER_3D_USER_29, _HKI( "Show user defined layer 29" ) ),
RR( wxS( "User.30" ), LAYER_3D_USER_30, _HKI( "Show user defined layer 30" ) ),
RR( wxS( "User.31" ), LAYER_3D_USER_31, _HKI( "Show user defined layer 31" ) ),
RR( wxS( "User.32" ), LAYER_3D_USER_32, _HKI( "Show user defined layer 32" ) ),
RR( wxS( "User.33" ), LAYER_3D_USER_33, _HKI( "Show user defined layer 33" ) ),
RR( wxS( "User.34" ), LAYER_3D_USER_34, _HKI( "Show user defined layer 34" ) ),
RR( wxS( "User.35" ), LAYER_3D_USER_35, _HKI( "Show user defined layer 35" ) ),
RR( wxS( "User.36" ), LAYER_3D_USER_36, _HKI( "Show user defined layer 36" ) ),
RR( wxS( "User.37" ), LAYER_3D_USER_37, _HKI( "Show user defined layer 37" ) ),
RR( wxS( "User.38" ), LAYER_3D_USER_38, _HKI( "Show user defined layer 38" ) ),
RR( wxS( "User.39" ), LAYER_3D_USER_39, _HKI( "Show user defined layer 39" ) ),
RR( wxS( "User.40" ), LAYER_3D_USER_40, _HKI( "Show user defined layer 40" ) ),
RR( wxS( "User.41" ), LAYER_3D_USER_41, _HKI( "Show user defined layer 41" ) ),
RR( wxS( "User.42" ), LAYER_3D_USER_42, _HKI( "Show user defined layer 42" ) ),
RR( wxS( "User.43" ), LAYER_3D_USER_43, _HKI( "Show user defined layer 43" ) ),
RR( wxS( "User.44" ), LAYER_3D_USER_44, _HKI( "Show user defined layer 44" ) ),
RR( wxS( "User.45" ), LAYER_3D_USER_45, _HKI( "Show user defined layer 45" ) ),
RR(),
RR( _HKI( "Through-hole Models" ), LAYER_3D_TH_MODELS, EDA_3D_ACTIONS::showTHT ),
RR( _HKI( "SMD Models" ), LAYER_3D_SMD_MODELS, EDA_3D_ACTIONS::showSMD ),
RR( _HKI( "Virtual Models" ), LAYER_3D_VIRTUAL_MODELS, EDA_3D_ACTIONS::showVirtual ),
RR( _HKI( "Models not in POS File" ), LAYER_3D_MODELS_NOT_IN_POS,
EDA_3D_ACTIONS::showNotInPosFile ),
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( _HKI( "Through-hole Models" ), LAYER_3D_TH_MODELS, EDA_3D_ACTIONS::showTHT ),
RR( _HKI( "SMD Models" ), LAYER_3D_SMD_MODELS, EDA_3D_ACTIONS::showSMD ),
RR( _HKI( "Virtual Models" ), LAYER_3D_VIRTUAL_MODELS, EDA_3D_ACTIONS::showVirtual ),
RR( _HKI( "Models not in POS File" ), LAYER_3D_MODELS_NOT_IN_POS, EDA_3D_ACTIONS::showNotInPosFile ),
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 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" ) ),
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" ) ),
};
// 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 ),
@@ -135,15 +175,14 @@ APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent,
cfg->m_UseStackupColors = aEvent.IsChecked();
UpdateLayerCtls();
syncLayerPresetSelection();
m_frame->NewDisplay( true );
} );
m_cbUseBoardEditorCopperColors = new wxCheckBox( m_panelLayers, wxID_ANY,
_( "Use board editor copper colors" ) );
_( "Use PCB editor copper colors" ) );
m_cbUseBoardEditorCopperColors->SetFont( infoFont );
m_cbUseBoardEditorCopperColors->SetToolTip(
_( "Use the board editor copper colors (openGL only)" ) );
m_cbUseBoardEditorCopperColors->SetToolTip( _( "Use the board editor layer colors for copper "
"layers (realtime renderer only)" ) );
m_cbUseBoardEditorCopperColors->Bind( wxEVT_CHECKBOX,
[this]( wxCommandEvent& aEvent )
@@ -152,27 +191,24 @@ APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent,
cfg->m_Render.use_board_editor_copper_colors = aEvent.IsChecked();
UpdateLayerCtls();
syncLayerPresetSelection();
m_frame->NewDisplay( true );
} );
m_panelLayersSizer->Add( m_cbUseBoardStackupColors, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 7 );
m_panelLayersSizer->Add( m_cbUseBoardStackupColors, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 5 );
m_panelLayersSizer->Add( m_cbUseBoardEditorCopperColors, 0,
wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 7 );
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 ) ) );
@@ -273,22 +309,19 @@ void APPEARANCE_CONTROLS_3D::CommonSettingsChanged()
rebuildControls();
UpdateLayerCtls();
syncLayerPresetSelection();
const wxString& currentPreset = m_frame->GetAdapter().m_Cfg->m_CurrentPreset;
if( currentPreset == FOLLOW_PCB || currentPreset == FOLLOW_PLOT_SETTINGS )
updateLayerPresetWidget( currentPreset );
else
syncLayerPresetSelection();
}
void APPEARANCE_CONTROLS_3D::ApplyLayerPreset( const wxString& aPresetName )
{
if( aPresetName == FOLLOW_PCB || aPresetName == FOLLOW_PLOT_SETTINGS )
{
m_frame->GetAdapter().m_Cfg->m_CurrentPreset = aPresetName;
UpdateLayerCtls();
m_frame->NewDisplay( true );
}
else if( LAYER_PRESET_3D* preset = m_frame->GetAdapter().m_Cfg->FindPreset( aPresetName ) )
{
doApplyLayerPreset( *preset );
}
doApplyLayerPreset( aPresetName );
// Move to front of MRU list
if( m_presetMRU.Index( aPresetName ) != wxNOT_FOUND )
@@ -420,6 +453,10 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
default:
visibleLayers.set( aLayer, isVisible );
if( aLayer >= LAYER_3D_USER_1 && aLayer <= LAYER_3D_USER_45 )
killFollow = true;
break;
}
@@ -435,8 +472,7 @@ 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();
}
@@ -453,7 +489,6 @@ void APPEARANCE_CONTROLS_3D::onColorSwatchChanged( COLOR_SWATCH* aSwatch )
std::map<int, COLOR4D> colors = m_frame->GetAdapter().GetLayerColors();
m_frame->GetAdapter().SetVisibleLayers( visibleLayers );
m_frame->GetAdapter().SetLayerColors( colors );
int layer = aSwatch->GetId();
COLOR4D newColor = aSwatch->GetSwatchColor();
@@ -467,7 +502,12 @@ void APPEARANCE_CONTROLS_3D::onColorSwatchChanged( COLOR_SWATCH* aSwatch )
m_frame->GetAdapter().SetLayerColors( colors );
syncLayerPresetSelection();
const wxString& currentPreset = m_frame->GetAdapter().m_Cfg->m_CurrentPreset;
if( currentPreset == FOLLOW_PCB || currentPreset == FOLLOW_PLOT_SETTINGS )
updateLayerPresetWidget( currentPreset );
else
syncLayerPresetSelection();
m_frame->NewDisplay( true );
}
@@ -480,6 +520,7 @@ void APPEARANCE_CONTROLS_3D::rebuildLayers()
std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
std::map<int, COLOR4D> colors = m_frame->GetAdapter().GetLayerColors();
std::map<int, COLOR4D> defaultColors = m_frame->GetAdapter().GetDefaultColors();
LSET enabled = m_frame->GetBoard()->GetEnabledLayers();
m_layerSettings.clear();
m_layersOuterSizer->Clear( true );
@@ -534,8 +575,13 @@ void APPEARANCE_CONTROLS_3D::rebuildLayers()
sizer->AddSpacer( 5 );
wxStaticText* label = new wxStaticText( m_windowLayers, layer,
aSetting->GetLabel() );
wxString layerName = aSetting->GetLabel();
PCB_LAYER_ID boardLayer = Map3DLayerToPCBLayer( layer );
if( boardLayer != UNDEFINED_LAYER )
layerName = m_frame->GetBoard()->GetLayerName( boardLayer );
wxStaticText* label = new wxStaticText( m_windowLayers, layer, layerName );
label->Wrap( -1 );
label->SetToolTip( aSetting->GetTooltip() );
@@ -545,9 +591,10 @@ void APPEARANCE_CONTROLS_3D::rebuildLayers()
}
else
{
BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE(
m_windowLayers, layer, KiBitmapBundle( BITMAPS::visibility ),
KiBitmapBundle( BITMAPS::visibility_off ), aSetting->m_Visible );
BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE( m_windowLayers, layer,
KiBitmapBundle( BITMAPS::visibility ),
KiBitmapBundle( BITMAPS::visibility_off ),
aSetting->m_Visible );
btn_visible->Bind( TOGGLE_CHANGED,
[this]( wxCommandEvent& aEvent )
@@ -580,9 +627,18 @@ void APPEARANCE_CONTROLS_3D::rebuildLayers()
std::unique_ptr<APPEARANCE_SETTING_3D>& setting = m_layerSettings.back();
if( setting->m_Spacer )
{
m_layersOuterSizer->AddSpacer( m_pointSize );
}
else if( setting->m_Id >= LAYER_3D_USER_1 && setting->m_Id <= LAYER_3D_USER_45 )
{
if( enabled.test( Map3DLayerToPCBLayer( setting->m_Id ) ) )
appendLayer( setting );
}
else
{
appendLayer( setting );
}
m_layerSettingsMap[setting->m_Id] = setting.get();
}
@@ -611,12 +667,8 @@ void APPEARANCE_CONTROLS_3D::UpdateLayerCtls()
// if cfg->m_UseStackupColors is set, board colors cannot be modified locally, but
// other colors can be
if( std::find( inStackupColors.begin(), inStackupColors.end(), setting->m_Id )
!= inStackupColors.end() )
{
if( cfg )
setting->m_Ctl_color->SetReadOnly( cfg->m_UseStackupColors );
}
if( alg::contains( inStackupColors, setting->m_Id ) && cfg )
setting->m_Ctl_color->SetReadOnly( cfg->m_UseStackupColors );
}
}
@@ -663,11 +715,8 @@ 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 )
{
@@ -731,17 +780,11 @@ void APPEARANCE_CONTROLS_3D::onLayerPresetChanged( wxCommandEvent& aEvent )
if( index == 0 )
{
name = FOLLOW_PCB;
cfg->m_CurrentPreset = name;
UpdateLayerCtls();
m_frame->NewDisplay( true );
doApplyLayerPreset( FOLLOW_PCB );
}
else if( index == 1 )
{
name = FOLLOW_PLOT_SETTINGS;
cfg->m_CurrentPreset = name;
UpdateLayerCtls();
m_frame->NewDisplay( true );
doApplyLayerPreset( FOLLOW_PLOT_SETTINGS );
}
else if( index == count - 3 )
{
@@ -827,10 +870,9 @@ void APPEARANCE_CONTROLS_3D::onLayerPresetChanged( wxCommandEvent& aEvent )
resetSelection();
return;
}
else if( LAYER_PRESET_3D* preset = cfg->FindPreset( m_cbLayerPresets->GetStringSelection() ) )
else
{
name = preset->name;
doApplyLayerPreset( *preset );
doApplyLayerPreset( m_cbLayerPresets->GetStringSelection() );
}
// Move to front of MRU list
@@ -843,16 +885,28 @@ void APPEARANCE_CONTROLS_3D::onLayerPresetChanged( wxCommandEvent& aEvent )
}
void APPEARANCE_CONTROLS_3D::doApplyLayerPreset( const LAYER_PRESET_3D& aPreset )
void APPEARANCE_CONTROLS_3D::doApplyLayerPreset( const wxString& aPresetName )
{
BOARD_ADAPTER& adapter = m_frame->GetAdapter();
adapter.m_Cfg->m_CurrentPreset = aPreset.name;
adapter.SetVisibleLayers( aPreset.layers );
adapter.SetLayerColors( aPreset.colors );
if( aPresetName == FOLLOW_PCB || aPresetName == FOLLOW_PLOT_SETTINGS )
{
adapter.m_Cfg->m_CurrentPreset = aPresetName;
adapter.SetVisibleLayers( adapter.GetVisibleLayers() );
}
else if( LAYER_PRESET_3D* preset = adapter.m_Cfg->FindPreset( aPresetName ) )
{
adapter.m_Cfg->m_CurrentPreset = aPresetName;
adapter.SetVisibleLayers( preset->layers );
adapter.SetLayerColors( preset->colors );
if( aPreset.name.Lower() == _( "legacy colors" ) )
adapter.m_Cfg->m_UseStackupColors = false;
if( preset->name.Lower() == _( "legacy colors" ) )
adapter.m_Cfg->m_UseStackupColors = false;
}
else
{
return;
}
UpdateLayerCtls();
m_frame->NewDisplay( true );
@@ -922,8 +976,7 @@ 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
{
+1 -1
View File
@@ -157,7 +157,7 @@ private:
void onLayerPresetChanged( wxCommandEvent& aEvent ) override;
void doApplyLayerPreset( const LAYER_PRESET_3D& aPreset );
void doApplyLayerPreset( const wxString& aPresetName );
void onViewportChanged( wxCommandEvent& aEvent ) override;
void onUpdateViewportsCb( wxUpdateUIEvent& aEvent ) override;
@@ -11,7 +11,7 @@
APPEARANCE_CONTROLS_3D_BASE::APPEARANCE_CONTROLS_3D_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : WX_PANEL( parent, id, pos, size, style, name )
{
this->SetMinSize( wxSize( 200,360 ) );
this->SetMinSize( wxSize( 210,360 ) );
m_sizerOuter = new wxBoxSizer( wxVERTICAL );
@@ -45,7 +45,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">200,360</property>
<property name="minimum_size">210,360</property>
<property name="name">APPEARANCE_CONTROLS_3D_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
@@ -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 (very slow)"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper and tech layers thickness (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 );
@@ -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 (very slow)</property>
<property name="label">Show copper and tech layers thickness (slow)</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
+23 -28
View File
@@ -68,8 +68,6 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
// This board will only be used to hold a footprint for viewing
m_dummyBoard->SetBoardUse( BOARD_USE::FPHOLDER );
m_bodyStyleShowAll = true;
BOARD_DESIGN_SETTINGS parent_bds = aFrame->GetDesignSettings();
BOARD_DESIGN_SETTINGS& dummy_bds = m_dummyBoard->GetDesignSettings();
dummy_bds.SetBoardThickness( parent_bds.GetBoardThickness() );
@@ -225,16 +223,6 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings()
m_previewPane->SetAnimationEnabled( cfg->m_Camera.animation_enabled );
m_previewPane->SetMovingSpeedMultiplier( cfg->m_Camera.moving_speed_multiplier );
m_previewPane->SetProjectionMode( cfg->m_Camera.projection_mode );
// Ensure the board body is always shown, and do not use the settings of the 3D viewer
cfg->m_Render.show_copper_top = m_bodyStyleShowAll;
cfg->m_Render.show_copper_bottom = m_bodyStyleShowAll;
cfg->m_Render.show_soldermask_top = m_bodyStyleShowAll;
cfg->m_Render.show_soldermask_bottom = m_bodyStyleShowAll;
cfg->m_Render.show_solderpaste = m_bodyStyleShowAll;
cfg->m_Render.show_zones = m_bodyStyleShowAll;
cfg->m_Render.show_board_body = m_bodyStyleShowAll;
cfg->m_Render.use_board_editor_copper_colors = false;
}
}
@@ -286,7 +274,7 @@ wxString PANEL_PREVIEW_3D_MODEL::formatRotationValue( double aValue )
wxString PANEL_PREVIEW_3D_MODEL::formatOffsetValue( double aValue )
{
// Convert from internal units (mm) to user units
if( m_userUnits == EDA_UNITS::INCHES )
if( m_userUnits == EDA_UNITS::INCH )
aValue /= 25.4;
else if( m_userUnits == EDA_UNITS::MILS )
aValue /= 25.4 / 1e3;
@@ -405,13 +393,7 @@ void PANEL_PREVIEW_3D_MODEL::setBodyStyleView( wxCommandEvent& event )
if( !cfg )
return;
m_bodyStyleShowAll = !m_bodyStyleShowAll;
cfg->m_Render.show_soldermask_top = m_bodyStyleShowAll;
cfg->m_Render.show_soldermask_bottom = m_bodyStyleShowAll;
cfg->m_Render.show_solderpaste = m_bodyStyleShowAll;
cfg->m_Render.show_zones = m_bodyStyleShowAll;
cfg->m_Render.show_board_body = m_bodyStyleShowAll;
cfg->m_Render.preview_show_board_body = !cfg->m_Render.preview_show_board_body;
m_previewPane->ReloadRequest();
m_previewPane->Refresh();
@@ -444,7 +426,9 @@ void PANEL_PREVIEW_3D_MODEL::View3DSettings( wxCommandEvent& event )
void PANEL_PREVIEW_3D_MODEL::doIncrementScale( wxSpinEvent& event, double aSign )
{
wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
wxSpinButton* spinCtrl = dynamic_cast<wxSpinButton*>( event.GetEventObject() );
wxCHECK( spinCtrl, /* void */ );
wxTextCtrl * textCtrl = xscale;
@@ -471,7 +455,10 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementScale( wxSpinEvent& event, double aSign
void PANEL_PREVIEW_3D_MODEL::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
{
wxSpinButton* spinCtrl = (wxSpinButton*) aEvent.GetEventObject();
wxSpinButton* spinCtrl = dynamic_cast<wxSpinButton*>( aEvent.GetEventObject() );
wxCHECK( spinCtrl, /* void */ );
wxTextCtrl* textCtrl = xrot;
if( spinCtrl == m_spinYrot )
@@ -497,7 +484,9 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementRotation( wxSpinEvent& aEvent, double aS
void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign )
{
wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
wxSpinButton* spinCtrl = dynamic_cast<wxSpinButton*>( event.GetEventObject() );
wxCHECK( spinCtrl, /* void */ );
wxTextCtrl * textCtrl = xoff;
@@ -511,7 +500,7 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign
if( wxGetMouseState().ShiftDown( ) )
step_mm = OFFSET_INCREMENT_MM_FINE;
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCH )
{
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
@@ -533,7 +522,9 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign
void PANEL_PREVIEW_3D_MODEL::onMouseWheelScale( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( event.GetEventObject() );
wxCHECK( textCtrl, /* void */ );
double step = SCALE_INCREMENT;
@@ -556,7 +547,9 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelScale( wxMouseEvent& event )
void PANEL_PREVIEW_3D_MODEL::onMouseWheelRot( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( event.GetEventObject() );
wxCHECK( textCtrl, /* void */ );
double step = ROTATION_INCREMENT;
@@ -579,14 +572,16 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelRot( wxMouseEvent& event )
void PANEL_PREVIEW_3D_MODEL::onMouseWheelOffset( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( event.GetEventObject() );
wxCHECK( textCtrl, /* void */ );
double step_mm = OFFSET_INCREMENT_MM;
if( event.ShiftDown( ) )
step_mm = OFFSET_INCREMENT_MM_FINE;
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCH )
{
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000.0;
+4 -4
View File
@@ -222,11 +222,11 @@ private:
int m_selected; /// Index into m_parentInfoList
EDA_UNITS m_userUnits;
bool m_bodyStyleShowAll; /// true if the board body is show
/// The 3d viewer Render initial settings (must be saved and restored)
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS m_initialRender;
std::unique_ptr<NL_FOOTPRINT_PROPERTIES_PLUGIN> m_spaceMouse;
/// The 3d viewer Render initial settings (must be saved and restored)
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS m_initialRender;
std::unique_ptr<NL_FOOTPRINT_PROPERTIES_PLUGIN> m_spaceMouse;
};
#endif // PANEL_PREVIEW_3D_MODEL_H
@@ -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, 2 );
sbSizer4->Add( m_opacity, 0, wxRIGHT|wxLEFT|wxEXPAND, 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</property>
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxSlider" expanded="true">
<property name="BottomDockable">1</property>
+2 -1
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,6 +228,7 @@
Mario Hros
Hubert Hu
Josue Huaroto
Eli Hughes
Huibean
Matt Huszagh
José Ignacio
+2 -2
View File
@@ -22,7 +22,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
cmake_minimum_required( VERSION 3.21 FATAL_ERROR )
cmake_minimum_required( VERSION 3.22 FATAL_ERROR )
# Generate DEPFILES without transforming relative paths
cmake_policy( SET CMP0116 OLD )
@@ -824,7 +824,7 @@ find_package( Pixman 0.30 REQUIRED )
include_directories( SYSTEM ${PIXMAN_INCLUDE_DIR} )
# Find libgit2, required
find_package( libgit2 REQUIRED )
find_package( libgit2 1.5 REQUIRED )
# Set include directories for libgit
include_directories(${LIBGIT2_INCLUDE_DIRS})
+74 -47
View File
@@ -1,56 +1,83 @@
{
"version": 3,
"version": 9,
"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"
{
"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"
}
},
"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": "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"
]
},
"architecture": {
"value": "x64",
"strategy": "external"
{
"name": "x64-debug",
"displayName": "x64 Debug",
"description": "Sets debug build type and x64 arch",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
"inherits": [
"base"
]
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"description": "Sets debug build type and x64 arch",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
{
"name": "x64-release",
"displayName": "x64 Release",
"description": "Sets release build type",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
"description": "Sets release build type",
"inherits": "win64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
],
"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"
}
]
}
}
]
}
+1 -1
View File
@@ -24,7 +24,7 @@ BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakStringLiterals: true
ColumnLimit: 100
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
+24
View File
@@ -58,6 +58,30 @@ message GraphicsDefaultsResponse
kiapi.board.GraphicsDefaults defaults = 1;
}
enum BoardOriginType
{
BOT_UNKNOWN = 0;
BOT_GRID = 1;
BOT_DRILL = 2;
}
// Returns a Vector2 with the specified origin point
message GetBoardOrigin
{
kiapi.common.types.DocumentSpecifier board = 1;
BoardOriginType type = 2;
}
message SetBoardOrigin
{
kiapi.common.types.DocumentSpecifier board = 1;
BoardOriginType type = 2;
kiapi.common.types.Vector2 origin = 3;
}
/*
* Net management
*/
+105 -2
View File
@@ -89,6 +89,42 @@ enum BoardLayer
BL_User_8 = 60;
BL_User_9 = 61;
BL_Rescue = 62;
BL_User_10 = 63;
BL_User_11 = 64;
BL_User_12 = 65;
BL_User_13 = 66;
BL_User_14 = 67;
BL_User_15 = 68;
BL_User_16 = 69;
BL_User_17 = 70;
BL_User_18 = 71;
BL_User_19 = 72;
BL_User_20 = 73;
BL_User_21 = 74;
BL_User_22 = 75;
BL_User_23 = 76;
BL_User_24 = 77;
BL_User_25 = 78;
BL_User_26 = 79;
BL_User_27 = 80;
BL_User_28 = 81;
BL_User_29 = 82;
BL_User_30 = 83;
BL_User_31 = 84;
BL_User_32 = 85;
BL_User_33 = 86;
BL_User_34 = 87;
BL_User_35 = 88;
BL_User_36 = 89;
BL_User_37 = 90;
BL_User_38 = 91;
BL_User_39 = 92;
BL_User_40 = 93;
BL_User_41 = 94;
BL_User_42 = 95;
BL_User_43 = 96;
BL_User_44 = 97;
BL_User_45 = 98;
}
message NetCode
@@ -258,15 +294,31 @@ message PadStackLayer
enum SolderMaskMode
{
SMM_UNKOWN = 0;
SMM_UNKNOWN = 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_UNKOWN = 0;
SPM_UNKNOWN = 0;
SPM_PASTE = 1;
SPM_NO_PASTE = 2;
SPM_FROM_DESIGN_RULES = 3;
@@ -283,6 +335,9 @@ 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
@@ -293,6 +348,22 @@ 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.
@@ -306,6 +377,10 @@ 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.
@@ -572,6 +647,14 @@ 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;
@@ -598,6 +681,8 @@ 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
@@ -768,6 +853,9 @@ message Field
FieldId id = 1;
string name = 2;
BoardText text = 3;
// Since 9.0.1
bool visible = 4;
}
enum FootprintMountingStyle
@@ -821,6 +909,19 @@ 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
{
@@ -838,6 +939,8 @@ 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
+5 -2
View File
@@ -291,7 +291,10 @@ message TextAttributes
bool italic = 7;
bool bold = 8;
bool underlined = 9;
// Deprecated since 9.0.1 (text items are now always visible, only Fields can be hidden)
bool visible = 10;
bool mirrored = 11;
bool multiline = 12;
bool keep_upright = 13;
@@ -305,7 +308,7 @@ message Text
kiapi.common.types.Vector2 position = 2;
kiapi.common.types.TextAttributes attributes = 3;
// Reserved for future use; base objects don't support locking right nos
// Reserved for future use; base objects don't support locking right now
//kiapi.common.types.LockedState locked = 4;
string text = 5;
@@ -318,7 +321,7 @@ message TextBox
kiapi.common.types.Vector2 bottom_right = 3;
kiapi.common.types.TextAttributes attributes = 4;
// Reserved for future use; base objects don't support locking right nos
// Reserved for future use; base objects don't support locking right now
//kiapi.common.types.LockedState locked = 5;
string text = 6;
+2
View File
@@ -84,6 +84,8 @@ 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
+9 -9
View File
@@ -51,7 +51,7 @@ IMAGE_SIZE::IMAGE_SIZE()
m_outputSize = 0.0;
m_originalDPI = DEFAULT_DPI;
m_originalSizePixels = 0;
m_unit = EDA_UNITS::MILLIMETRES;
m_unit = EDA_UNITS::MM;
}
@@ -61,9 +61,9 @@ void IMAGE_SIZE::SetOutputSizeFromInitialImageSize()
m_originalDPI = std::max( 1, m_originalDPI );
// Set the m_outputSize value from the m_originalSizePixels and the selected unit
if( m_unit == EDA_UNITS::MILLIMETRES )
if( m_unit == EDA_UNITS::MM )
m_outputSize = (double)GetOriginalSizePixels() / m_originalDPI * 25.4;
else if( m_unit == EDA_UNITS::INCHES )
else if( m_unit == EDA_UNITS::INCH )
m_outputSize = (double)GetOriginalSizePixels() / m_originalDPI;
else
m_outputSize = m_originalDPI;
@@ -74,9 +74,9 @@ int IMAGE_SIZE::GetOutputDPI()
{
int outputDPI;
if( m_unit == EDA_UNITS::MILLIMETRES )
if( m_unit == EDA_UNITS::MM )
outputDPI = GetOriginalSizePixels() / ( m_outputSize / 25.4 );
else if( m_unit == EDA_UNITS::INCHES )
else if( m_unit == EDA_UNITS::INCH )
outputDPI = GetOriginalSizePixels() / m_outputSize;
else
outputDPI = KiROUND( m_outputSize );
@@ -98,11 +98,11 @@ void IMAGE_SIZE::SetUnit( EDA_UNITS aUnit )
// Convert m_outputSize to mm:
double size_mm;
if( m_unit == EDA_UNITS::MILLIMETRES )
if( m_unit == EDA_UNITS::MM )
{
size_mm = m_outputSize;
}
else if( m_unit == EDA_UNITS::INCHES )
else if( m_unit == EDA_UNITS::INCH )
{
size_mm = m_outputSize * 25.4;
}
@@ -117,11 +117,11 @@ void IMAGE_SIZE::SetUnit( EDA_UNITS aUnit )
}
// Convert m_outputSize to new value:
if( aUnit == EDA_UNITS::MILLIMETRES )
if( aUnit == EDA_UNITS::MM )
{
m_outputSize = size_mm;
}
else if( aUnit == EDA_UNITS::INCHES )
else if( aUnit == EDA_UNITS::INCH )
{
m_outputSize = size_mm / 25.4;
}
+4 -4
View File
@@ -266,9 +266,9 @@ wxString BITMAP2CMP_PANEL::formatOutputSize( double aSize )
{
wxString text;
if( getUnitFromSelection() == EDA_UNITS::MILLIMETRES )
if( getUnitFromSelection() == EDA_UNITS::MM )
text.Printf( wxS( "%.1f" ), aSize );
else if( getUnitFromSelection() == EDA_UNITS::INCHES )
else if( getUnitFromSelection() == EDA_UNITS::INCH )
text.Printf( wxS( "%.2f" ), aSize );
else
text.Printf( wxT( "%d" ), KiROUND( aSize ) );
@@ -295,10 +295,10 @@ EDA_UNITS BITMAP2CMP_PANEL::getUnitFromSelection()
// return the EDA_UNITS from the m_PixelUnit choice
switch( m_PixelUnit->GetSelection() )
{
case 1: return EDA_UNITS::INCHES;
case 1: return EDA_UNITS::INCH;
case 2: return EDA_UNITS::UNSCALED;
case 0:
default: return EDA_UNITS::MILLIMETRES;
default: return EDA_UNITS::MM;
}
}
+1 -2
View File
@@ -48,9 +48,7 @@ set( OCC_LIBS_COMMON
TKLCAF
TKMath
TKMesh
TKMeshVS
TKOffset
TKOpenGl
TKPrim
TKRWMesh
TKService
@@ -138,6 +136,7 @@ else(WIN32)
HINTS
${OCC_LIBRARY_DIR}
/usr
/usr/opencascade
/usr/local
/usr/local/opencascade
/opt/opencascade
+1 -1
View File
@@ -37,7 +37,7 @@ unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
set(_PYTHON3_VERSIONS 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
# Disabling the "search every possible place" code for now
# see https://gitlab.com/kicad/code/kicad/-/issues/8553
+1 -1
View File
@@ -44,7 +44,7 @@ cmake_find_frameworks(Python)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
set(_PYTHON3_VERSIONS 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
if(PythonLibs_FIND_VERSION)
if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+1 -1
View File
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "9.0.0-unknown" )
set( KICAD_SEMANTIC_VERSION "9.99.0-unknown" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+30 -2
View File
@@ -72,6 +72,7 @@ set( KICOMMON_SRCS
jobs/job_export_pcb_gerber.cpp
jobs/job_export_pcb_gerbers.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
@@ -112,10 +113,15 @@ 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
@@ -348,6 +354,8 @@ 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
@@ -356,6 +364,8 @@ 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
@@ -404,10 +414,15 @@ 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 )
@@ -421,6 +436,7 @@ set( COMMON_WIDGET_SRCS
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
@@ -431,6 +447,7 @@ set( COMMON_WIDGET_SRCS
widgets/gal_options_panel_base.cpp
widgets/grid_bitmap_toggle.cpp
widgets/grid_button.cpp
widgets/grid_checkbox.cpp
widgets/grid_color_swatch_helpers.cpp
widgets/grid_combobox.cpp
widgets/grid_icon_text_helpers.cpp
@@ -445,6 +462,7 @@ 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
@@ -585,6 +603,7 @@ 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
@@ -606,6 +625,7 @@ 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
@@ -639,12 +659,14 @@ 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
@@ -766,7 +788,10 @@ 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_class_manager.cpp #needed by 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/board_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_dimension.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
@@ -810,7 +835,6 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/kicad_netlist_reader.cpp
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/legacy_netlist_reader.cpp
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/netlist_reader.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pad_custom_shape_functions.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_draw_panel_gal.cpp
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/pcb_netlist.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_origin_transforms.cpp
@@ -841,6 +865,10 @@ 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
)
+26 -23
View File
@@ -98,13 +98,10 @@ 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 EnableDesignBlocks[] = wxT( "EnableDesignBlocks" );
static const wxChar EnablePcbDesignBlocks[] = wxT( "EnablePcbDesignBlocks" );
static const wxChar EnableGenerators[] = wxT( "EnableGenerators" );
static const wxChar EnableGit[] = wxT( "EnableGit" );
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" );
@@ -127,6 +124,9 @@ static const wxChar MsgPanelShowUuids[] = wxT( "MsgPanelShowUuids" );
static const wxChar MaximumThreads[] = wxT( "MaximumThreads" );
static const wxChar NetInspectorBulkUpdateOptimisationThreshold[] =
wxT( "NetInspectorBulkUpdateOptimisationThreshold" );
static const wxChar ExcludeFromSimulationLineWidth[] = wxT( "ExcludeFromSimulationLineWidth" );
static const wxChar GitIconRefreshInterval[] = wxT( "GitIconRefreshInterval" );
static const wxChar ConfigurableToolbars[] = wxT( "ConfigurableToolbars" );
} // namespace KEYS
@@ -255,15 +255,11 @@ ADVANCED_CFG::ADVANCED_CFG()
m_CompactSave = false;
m_UpdateUIEventInterval = 0;
m_ShowRepairSchematic = false;
m_EnableDesignBlocks = true;
m_EnablePcbDesignBlocks = false;
m_EnableGenerators = false;
m_EnableGit = true;
m_EnableLibWithText = false;
m_EnableLibDir = false;
m_EnableEeschemaPrintCairo = true;
m_EnableEeschemaExportClipboardCairo = true;
m_3DRT_BevelHeight_um = 30;
m_3DRT_BevelExtentFactor = 1.0 / 16.0;
@@ -305,7 +301,13 @@ ADVANCED_CFG::ADVANCED_CFG()
m_MinimumMarkerSeparationDistance = 0.15;
m_NetInspectorBulkUpdateOptimisationThreshold = 25;
m_NetInspectorBulkUpdateOptimisationThreshold = 100;
m_ExcludeFromSimulationLineWidth = 25;
m_GitIconRefreshInterval = 10000;
m_ConfigurableToolbars = false;
loadFromConfigFile();
}
@@ -487,8 +489,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
m_DisambiguationMenuDelay,
50, 10000 ) );
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::EnablePcbDesignBlocks, &m_EnablePcbDesignBlocks,
m_EnablePcbDesignBlocks ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGenerators,
&m_EnableGenerators, m_EnableGenerators ) );
@@ -496,23 +498,12 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableAPILogging,
&m_EnableAPILogging, m_EnableAPILogging ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGit,
&m_EnableGit, m_EnableGit ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibWithText,
&m_EnableLibWithText, m_EnableLibWithText ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::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 ) );
@@ -592,6 +583,18 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_NetInspectorBulkUpdateOptimisationThreshold,
m_NetInspectorBulkUpdateOptimisationThreshold, 0, 1000 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::ExcludeFromSimulationLineWidth,
&m_ExcludeFromSimulationLineWidth,
m_ExcludeFromSimulationLineWidth, 1, 100 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::GitIconRefreshInterval,
&m_GitIconRefreshInterval,
m_GitIconRefreshInterval, 0, 100000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ConfigurableToolbars,
&m_ConfigurableToolbars,
m_ConfigurableToolbars ) );
// 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;
+74
View File
@@ -53,6 +53,7 @@ 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;
@@ -126,6 +127,7 @@ 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;
@@ -214,6 +216,42 @@ PCB_LAYER_ID FromProtoEnum( board::types::BoardLayer aValue )
case board::types::BoardLayer::BL_User_8: return User_8;
case board::types::BoardLayer::BL_User_9: return User_9;
case board::types::BoardLayer::BL_Rescue: return Rescue;
case board::types::BoardLayer::BL_User_10: return User_10;
case board::types::BoardLayer::BL_User_11: return User_11;
case board::types::BoardLayer::BL_User_12: return User_12;
case board::types::BoardLayer::BL_User_13: return User_13;
case board::types::BoardLayer::BL_User_14: return User_14;
case board::types::BoardLayer::BL_User_15: return User_15;
case board::types::BoardLayer::BL_User_16: return User_16;
case board::types::BoardLayer::BL_User_17: return User_17;
case board::types::BoardLayer::BL_User_18: return User_18;
case board::types::BoardLayer::BL_User_19: return User_19;
case board::types::BoardLayer::BL_User_20: return User_20;
case board::types::BoardLayer::BL_User_21: return User_21;
case board::types::BoardLayer::BL_User_22: return User_22;
case board::types::BoardLayer::BL_User_23: return User_23;
case board::types::BoardLayer::BL_User_24: return User_24;
case board::types::BoardLayer::BL_User_25: return User_25;
case board::types::BoardLayer::BL_User_26: return User_26;
case board::types::BoardLayer::BL_User_27: return User_27;
case board::types::BoardLayer::BL_User_28: return User_28;
case board::types::BoardLayer::BL_User_29: return User_29;
case board::types::BoardLayer::BL_User_30: return User_30;
case board::types::BoardLayer::BL_User_31: return User_31;
case board::types::BoardLayer::BL_User_32: return User_32;
case board::types::BoardLayer::BL_User_33: return User_33;
case board::types::BoardLayer::BL_User_34: return User_34;
case board::types::BoardLayer::BL_User_35: return User_35;
case board::types::BoardLayer::BL_User_36: return User_36;
case board::types::BoardLayer::BL_User_37: return User_37;
case board::types::BoardLayer::BL_User_38: return User_38;
case board::types::BoardLayer::BL_User_39: return User_39;
case board::types::BoardLayer::BL_User_40: return User_40;
case board::types::BoardLayer::BL_User_41: return User_41;
case board::types::BoardLayer::BL_User_42: return User_42;
case board::types::BoardLayer::BL_User_43: return User_43;
case board::types::BoardLayer::BL_User_44: return User_44;
case board::types::BoardLayer::BL_User_45: return User_45;
case board::types::BoardLayer::BL_UNKNOWN: return UNDEFINED_LAYER;
default:
@@ -290,6 +328,42 @@ board::types::BoardLayer ToProtoEnum( PCB_LAYER_ID aValue )
case User_8: return board::types::BoardLayer::BL_User_8;
case User_9: return board::types::BoardLayer::BL_User_9;
case Rescue: return board::types::BoardLayer::BL_Rescue;
case User_10: return board::types::BoardLayer::BL_User_10;
case User_11: return board::types::BoardLayer::BL_User_11;
case User_12: return board::types::BoardLayer::BL_User_12;
case User_13: return board::types::BoardLayer::BL_User_13;
case User_14: return board::types::BoardLayer::BL_User_14;
case User_15: return board::types::BoardLayer::BL_User_15;
case User_16: return board::types::BoardLayer::BL_User_16;
case User_17: return board::types::BoardLayer::BL_User_17;
case User_18: return board::types::BoardLayer::BL_User_18;
case User_19: return board::types::BoardLayer::BL_User_19;
case User_20: return board::types::BoardLayer::BL_User_20;
case User_21: return board::types::BoardLayer::BL_User_21;
case User_22: return board::types::BoardLayer::BL_User_22;
case User_23: return board::types::BoardLayer::BL_User_23;
case User_24: return board::types::BoardLayer::BL_User_24;
case User_25: return board::types::BoardLayer::BL_User_25;
case User_26: return board::types::BoardLayer::BL_User_26;
case User_27: return board::types::BoardLayer::BL_User_27;
case User_28: return board::types::BoardLayer::BL_User_28;
case User_29: return board::types::BoardLayer::BL_User_29;
case User_30: return board::types::BoardLayer::BL_User_30;
case User_31: return board::types::BoardLayer::BL_User_31;
case User_32: return board::types::BoardLayer::BL_User_32;
case User_33: return board::types::BoardLayer::BL_User_33;
case User_34: return board::types::BoardLayer::BL_User_34;
case User_35: return board::types::BoardLayer::BL_User_35;
case User_36: return board::types::BoardLayer::BL_User_36;
case User_37: return board::types::BoardLayer::BL_User_37;
case User_38: return board::types::BoardLayer::BL_User_38;
case User_39: return board::types::BoardLayer::BL_User_39;
case User_40: return board::types::BoardLayer::BL_User_40;
case User_41: return board::types::BoardLayer::BL_User_41;
case User_42: return board::types::BoardLayer::BL_User_42;
case User_43: return board::types::BoardLayer::BL_User_43;
case User_44: return board::types::BoardLayer::BL_User_44;
case User_45: return board::types::BoardLayer::BL_User_45;
default:
wxCHECK_MSG( false, board::types::BoardLayer::BL_UNKNOWN,
"Unhandled case in ToProtoEnum<PCB_LAYER_ID>");
+1 -1
View File
@@ -19,7 +19,7 @@
*/
#include <magic_enum.hpp>
#include <nlohmann/json.hpp>
#include <json_common.h>
#include <wx/log.h>
#include <wx/regex.h>
#include <wx/stdstream.h>
+1
View File
@@ -142,6 +142,7 @@ COMMIT& COMMIT::createModified( EDA_ITEM* aItem, EDA_ITEM* aCopy, int aExtraFlag
if( m_changedItems.find( parent ) != m_changedItems.end() )
{
aCopy->SetParentGroup( nullptr );
delete aCopy;
return *this; // item has been already modified once
}
+5 -3
View File
@@ -118,11 +118,12 @@ wxString ExpandTextVars( const wxString& aSource,
}
wxString GetTextVars( const wxString& aSource )
wxString GetGeneratedFieldDisplayName( const wxString& aSource )
{
std::function<bool( wxString* )> tokenExtractor =
[&]( wxString* token ) -> bool
{
*token = *token; // token value is the token name
return true;
};
@@ -130,9 +131,10 @@ wxString GetTextVars( const wxString& aSource )
}
bool IsTextVar( const wxString& aSource )
bool IsGeneratedField( const wxString& aSource )
{
return aSource.StartsWith( wxS( "${" ) );
static wxRegEx expr( wxS( "^\\$\\{\\w*\\}$" ) );
return expr.Matches( aSource );
}
+3 -4
View File
@@ -167,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, int aDisplayTime )
void DisplayError( wxWindow* aParent, const wxString& aText )
{
if( !wxTheApp || !wxTheApp->IsMainLoopRunning() )
{
@@ -182,10 +182,9 @@ void DisplayError( wxWindow* aParent, const wxString& aText, int aDisplayTime )
}
wxMessageDialog* dlg;
int icon = aDisplayTime > 0 ? wxICON_INFORMATION : wxICON_ERROR;
dlg = new wxMessageDialog( aParent, aText, _( "Warning" ),
wxOK | wxCENTRE | wxRESIZE_BORDER | icon | wxSTAY_ON_TOP );
dlg = new wxMessageDialog( aParent, aText, _( "Error" ),
wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_ERROR | wxSTAY_ON_TOP );
dlg->ShowModal();
dlg->Destroy();
+13 -3
View File
@@ -21,9 +21,13 @@
* 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 <nlohmann/json.hpp>
#include <json_common.h>
class KICOMMON_API DESIGN_BLOCK
@@ -41,6 +45,9 @@ 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 );
@@ -55,9 +62,12 @@ public:
private:
LIB_ID m_lib_id;
wxString m_schematicFile; ///< File name and path for schematic symbol.
wxString m_schematicFile; ///< File name and path for schematic file.
wxString m_boardFile; ///< File name and path for board file
wxString m_libDescription; ///< File name and path for documentation file.
wxString m_keywords; ///< Search keywords to find footprint in library.
wxString m_keywords; ///< Search keywords to find design block in library.
nlohmann::ordered_map<wxString, wxString> m_fields;
};
#endif
+2
View File
@@ -72,7 +72,9 @@ std::vector<SEARCH_TERM> DESIGN_BLOCK_INFO::GetSearchTerms()
{
std::vector<SEARCH_TERM> terms;
terms.emplace_back( SEARCH_TERM( GetLibNickname(), 4 ) );
terms.emplace_back( SEARCH_TERM( GetName(), 8 ) );
terms.emplace_back( SEARCH_TERM( GetLIB_ID().Format(), 16 ) );
wxStringTokenizer keywordTokenizer( GetKeywords(), wxS( " " ), wxTOKEN_STRTOK );
+76 -23
View File
@@ -74,8 +74,10 @@ DESIGN_BLOCK_IO_MGR::DESIGN_BLOCK_FILE_T
DESIGN_BLOCK_IO_MGR::GuessPluginTypeFromLibPath( const wxString& aLibPath, int aCtl )
{
if( IO_RELEASER<DESIGN_BLOCK_IO>( FindPlugin( KICAD_SEXP ) )->CanReadLibrary( aLibPath )
&& aCtl != KICTL_NONKICAD_ONLY )
&& aCtl != KICTL_NONKICAD_ONLY )
{
return KICAD_SEXP;
}
return DESIGN_BLOCK_IO_MGR::FILE_TYPE_NONE;
}
@@ -265,7 +267,9 @@ void DESIGN_BLOCK_IO::DesignBlockEnumerate( wxArrayString& aDesignBlockNames,
wxDir dir( aLibraryPath );
if( !dir.IsOpened() )
return;
{
THROW_IO_ERROR( wxString::Format( _( "Design block '%s' does not exist." ), aLibraryPath ) );
}
wxString dirname;
wxString fileSpec = wxT( "*." ) + wxString( FILEEXT::KiCadDesignBlockPathExtension );
@@ -287,17 +291,23 @@ 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( !wxFileExists( dbSchPath ) )
return nullptr;
if( !wxDir::Exists( dbPath ) )
THROW_IO_ERROR( wxString::Format( _( "Design block '%s' does not exist." ), dbPath ) );
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 ) );
newDB->SetSchematicFile( dbSchPath );
if( wxFileExists( dbSchPath ) )
newDB->SetSchematicFile( dbSchPath );
if( wxFileExists( dbPcbPath ) )
newDB->SetBoardFile( dbPcbPath );
// Parse the JSON file if it exists
if( wxFileExists( dbMetadataPath ) )
@@ -333,16 +343,27 @@ 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 )
@@ -353,12 +374,23 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
THROW_IO_ERROR( _( "Design block does not have a valid library ID." ) );
}
wxFileName schematicFile( aDesignBlock->GetSchematicFile() );
if( !schematicFile.FileExists() )
if( aDesignBlock->GetSchematicFile().IsEmpty() && aDesignBlock->GetBoardFile().IsEmpty() )
{
THROW_IO_ERROR( wxString::Format( _( "Schematic source file '%s' does not exist." ),
schematicFile.GetFullPath() ) );
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() )
{
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() ) );
}
// Create the design block folder
@@ -376,23 +408,44 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
}
}
// 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( !aDesignBlock->GetSchematicFile().IsEmpty() )
{
// Copy the source sheet file to the design block folder, under the design block name
if( !wxCopyFile( schematicFile.GetFullPath(), dbSchematicFile ) )
// 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 )
{
THROW_IO_ERROR( wxString::Format(
_( "Schematic file '%s' could not be saved as design block at '%s'." ),
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 ) );
}
}
}
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;
+1 -4
View File
@@ -76,10 +76,7 @@ public:
}
bool DesignBlockExists( const wxString& aLibraryPath, const wxString& aDesignBlockName,
const std::map<std::string, UTF8>* aProperties = nullptr )
{
return DesignBlockLoad( aLibraryPath, aDesignBlockName, true, aProperties ) != nullptr;
}
const std::map<std::string, UTF8>* aProperties = nullptr );
DESIGN_BLOCK* ImportDesignBlock( const wxString& aDesignBlockPath,
wxString& aDesignBlockNameOut,
+44 -19
View File
@@ -73,6 +73,23 @@ 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 )
{
@@ -205,7 +222,8 @@ void DESIGN_BLOCK_LIB_TABLE::Parse( LIB_TABLE_LEXER* in )
row->SetVisible();
break;
default: in->Unexpected( tok );
default:
in->Unexpected( tok );
}
in->NeedRIGHT();
@@ -253,7 +271,9 @@ bool DESIGN_BLOCK_LIB_TABLE::operator==( const DESIGN_BLOCK_LIB_TABLE& aDesignBl
{
if( (DESIGN_BLOCK_LIB_TABLE_ROW&) m_rows[i]
!= (DESIGN_BLOCK_LIB_TABLE_ROW&) aDesignBlockTable.m_rows[i] )
{
return false;
}
}
return true;
@@ -268,8 +288,8 @@ void DESIGN_BLOCK_LIB_TABLE::Format( OUTPUTFORMATTER* aOutput, int aIndentLevel
aOutput->Print( aIndentLevel, "(design_block_lib_table\n" );
aOutput->Print( aIndentLevel + 1, "(version %d)\n", m_version );
for( LIB_TABLE_ROWS_CITER it = m_rows.begin(); it != m_rows.end(); ++it )
it->Format( aOutput, aIndentLevel + 1 );
for( const LIB_TABLE_ROW& row : m_rows)
row.Format( aOutput, aIndentLevel + 1 );
aOutput->Print( aIndentLevel, ")\n" );
}
@@ -330,9 +350,9 @@ const DESIGN_BLOCK_LIB_TABLE_ROW* DESIGN_BLOCK_LIB_TABLE::FindRow( const wxStrin
if( !row )
{
wxString msg = wxString::Format(
_( "design-block-lib-table files contain no library named '%s'." ), aNickname );
THROW_IO_ERROR( msg );
THROW_IO_ERROR( wxString::Format( _( "design-block-lib-table files contain no library "
"named '%s'." ),
aNickname ) );
}
if( !row->plugin )
@@ -490,14 +510,12 @@ DESIGN_BLOCK_LIB_TABLE::DesignBlockLoadWithOptionalNickname( const LIB_ID& aDesi
// nickname is empty, sequentially search (alphabetically) all libs/nicks for first match:
else
{
std::vector<wxString> nicks = GetLogicalLibs();
// Search each library going through libraries alphabetically.
for( unsigned i = 0; i < nicks.size(); ++i )
for( const wxString& library : GetLogicalLibs() )
{
// DesignBlockLoad() returns NULL on not found, does not throw exception
// unless there's an IO_ERROR.
DESIGN_BLOCK* ret = DesignBlockLoad( nicks[i], DesignBlockname, aKeepUUID );
DESIGN_BLOCK* ret = DesignBlockLoad( library, DesignBlockname, aKeepUUID );
if( ret )
return ret;
@@ -520,7 +538,8 @@ public:
explicit PCM_DESIGN_BLOCK_LIB_TRAVERSER( const wxString& aPath, DESIGN_BLOCK_LIB_TABLE& aTable,
const wxString& aPrefix ) :
m_lib_table( aTable ),
m_path_prefix( aPath ), m_lib_prefix( aPrefix )
m_path_prefix( aPath ),
m_lib_prefix( aPrefix )
{
wxFileName f( aPath, wxS( "" ) );
m_prefix_dir_count = f.GetDirCount();
@@ -539,8 +558,9 @@ public:
FILEEXT::KiCadDesignBlockLibPathExtension ) )
&& dir.GetDirCount() >= m_prefix_dir_count + 3 )
{
wxString versionedPath = wxString::Format(
wxS( "${%s}" ), ENV_VAR::GetVersionedEnvVarName( wxS( "3RD_PARTY" ) ) );
wxString versionedPath;
versionedPath.Printf( wxS( "${%s}" ),
ENV_VAR::GetVersionedEnvVarName( wxS( "3RD_PARTY" ) ) );
wxArrayString parts = dir.GetDirs();
parts.RemoveAt( 0, m_prefix_dir_count );
@@ -551,16 +571,21 @@ public:
if( !m_lib_table.HasLibraryWithPath( libPath ) )
{
wxString name = parts.Last().substr( 0, parts.Last().length() - 7 );
wxString nickname = wxString::Format( wxS( "%s%s" ), m_lib_prefix, name );
wxString nickname;
nickname.Printf( wxS( "%s%s" ),
m_lib_prefix,
name );
if( m_lib_table.HasLibrary( nickname ) )
{
int increment = 1;
do
{
nickname =
wxString::Format( wxS( "%s%s_%d" ), m_lib_prefix, name, increment );
increment++;
nickname.Printf( wxS( "%s%s_%d" ),
m_lib_prefix,
name,
increment++ );
} while( m_lib_table.HasLibrary( nickname ) );
}
@@ -603,8 +628,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 );
@@ -25,30 +25,32 @@
#include <project/project_file.h>
#include <wx/log.h>
#include <wx/tokenzr.h>
#include <settings/app_settings.h>
#include <string_utils.h>
#include <eda_pattern_match.h>
#include <design_block.h>
#include <design_block_lib_table.h>
#include <design_block_info.h>
#include <design_block_tree_model_adapter.h>
#include <tools/sch_design_block_control.h>
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>
DESIGN_BLOCK_TREE_MODEL_ADAPTER::Create( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs,
APP_SETTINGS_BASE::LIB_TREE& aSettings )
APP_SETTINGS_BASE::LIB_TREE& aSettings,
TOOL_INTERACTIVE* aContextMenuTool )
{
auto* adapter = new DESIGN_BLOCK_TREE_MODEL_ADAPTER( aParent, aLibs, aSettings );
adapter->m_frame = aParent;
auto* adapter = new DESIGN_BLOCK_TREE_MODEL_ADAPTER( aParent, aLibs, aSettings, aContextMenuTool );
return wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>( adapter );
}
DESIGN_BLOCK_TREE_MODEL_ADAPTER::DESIGN_BLOCK_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent,
LIB_TABLE* aLibs,
APP_SETTINGS_BASE::LIB_TREE& aSettings ) :
LIB_TREE_MODEL_ADAPTER( aParent, wxT( "pinned_design_block_libs" ), aSettings ),
DESIGN_BLOCK_TREE_MODEL_ADAPTER::DESIGN_BLOCK_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs,
APP_SETTINGS_BASE::LIB_TREE& aSettings,
TOOL_INTERACTIVE* aContextMenuTool ) :
LIB_TREE_MODEL_ADAPTER( aParent, wxT( "pinned_design_block_libs" ),
Kiface().KifaceSettings()->m_DesignBlockChooserPanel.tree ),
m_libs( (DESIGN_BLOCK_LIB_TABLE*) aLibs ),
m_frame( aParent )
m_frame( aParent ),
m_contextMenuTool( aContextMenuTool )
{
}
@@ -74,8 +76,7 @@ void DESIGN_BLOCK_TREE_MODEL_ADAPTER::AddLibraries( EDA_BASE_FRAME* aParent )
bool pinned = alg::contains( cfg->m_Session.pinned_design_block_libs, libName )
|| alg::contains( project.m_PinnedDesignBlockLibs, libName );
DoAddLibrary( libName, library->GetDescr(), getDesignBlocks( aParent, libName ), pinned,
true );
DoAddLibrary( libName, library->GetDescr(), getDesignBlocks( aParent, libName ), pinned, true );
}
m_tree.AssignIntrinsicRanks();
@@ -88,23 +89,20 @@ void DESIGN_BLOCK_TREE_MODEL_ADAPTER::ClearLibraries()
}
std::vector<LIB_TREE_ITEM*>
DESIGN_BLOCK_TREE_MODEL_ADAPTER::getDesignBlocks( EDA_BASE_FRAME* aParent,
const wxString& aLibName )
std::vector<LIB_TREE_ITEM*> DESIGN_BLOCK_TREE_MODEL_ADAPTER::getDesignBlocks( EDA_BASE_FRAME* aParent,
const wxString& aLibName )
{
std::vector<LIB_TREE_ITEM*> libList;
auto fullListStart = DESIGN_BLOCK_LIB_TABLE::GetGlobalList().GetList().begin();
auto fullListEnd = DESIGN_BLOCK_LIB_TABLE::GetGlobalList().GetList().end();
std::unique_ptr<DESIGN_BLOCK_INFO> dummy =
std::make_unique<DESIGN_BLOCK_INFO_IMPL>( aLibName, wxEmptyString );
std::unique_ptr<DESIGN_BLOCK_INFO> dummy = std::make_unique<DESIGN_BLOCK_INFO_IMPL>( aLibName, wxEmptyString );
// List is sorted, so use a binary search to find the range of footnotes for our library
auto libBounds = std::equal_range(
fullListStart, fullListEnd, dummy,
[]( const std::unique_ptr<DESIGN_BLOCK_INFO>& a,
const std::unique_ptr<DESIGN_BLOCK_INFO>& b )
[]( const std::unique_ptr<DESIGN_BLOCK_INFO>& a, const std::unique_ptr<DESIGN_BLOCK_INFO>& b )
{
return StrNumCmp( a->GetLibNickname(), b->GetLibNickname(), false ) < 0;
} );
@@ -148,8 +146,7 @@ wxString DESIGN_BLOCK_TREE_MODEL_ADAPTER::GenerateInfo( LIB_ID const& aLibId, in
catch( const IO_ERROR& ioe )
{
wxLogError( _( "Error loading design block %s from library '%s'." ) + wxS( "\n%s" ),
aLibId.GetLibItemName().wx_str(), aLibId.GetLibNickname().wx_str(),
ioe.What() );
aLibId.GetLibItemName().wx_str(), aLibId.GetLibNickname().wx_str(), ioe.What() );
return wxEmptyString;
}
@@ -206,5 +203,5 @@ wxString DESIGN_BLOCK_TREE_MODEL_ADAPTER::GenerateInfo( LIB_ID const& aLibId, in
TOOL_INTERACTIVE* DESIGN_BLOCK_TREE_MODEL_ADAPTER::GetContextMenuTool()
{
return m_frame->GetToolManager()->GetTool<SCH_DESIGN_BLOCK_CONTROL>();
return m_contextMenuTool;
}
@@ -33,9 +33,9 @@ public:
*
* @param aLibs library set from which parts will be loaded
*/
static wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> Create( EDA_BASE_FRAME* aParent,
LIB_TABLE* aLibs,
APP_SETTINGS_BASE::LIB_TREE& aSettings );
static wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> Create( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs,
APP_SETTINGS_BASE::LIB_TREE& aSettings,
TOOL_INTERACTIVE* aContextMenuTool );
void AddLibraries( EDA_BASE_FRAME* aParent );
void ClearLibraries();
@@ -51,16 +51,17 @@ protected:
* Constructor; takes a set of libraries to be included in the search.
*/
DESIGN_BLOCK_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs,
APP_SETTINGS_BASE::LIB_TREE& aSettings );
APP_SETTINGS_BASE::LIB_TREE& aSettings,
TOOL_INTERACTIVE* aContextMenuTool );
std::vector<LIB_TREE_ITEM*> getDesignBlocks( EDA_BASE_FRAME* aParent,
const wxString& aLibName );
std::vector<LIB_TREE_ITEM*> getDesignBlocks( EDA_BASE_FRAME* aParent, const wxString& aLibName );
PROJECT::LIB_TYPE_T getLibType() override { return PROJECT::LIB_TYPE_T::DESIGN_BLOCK_LIB; }
protected:
DESIGN_BLOCK_LIB_TABLE* m_libs;
EDA_BASE_FRAME* m_frame;
TOOL_INTERACTIVE* m_contextMenuTool;
};
#endif // DESIGN_BLOCK_TREE_MODEL_ADAPTER_H
+1
View File
@@ -622,6 +622,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
ADD_DEV( wxT( "Nick Østergaard" ), CONTRIB_DEV );
ADD_DEV( wxT( "木 王" ), CONTRIB_DEV );
ADD_DEV( wxT( "wh201906" ), CONTRIB_DEV );
// The document writers
#define DOC_TEAM _( "Documentation Team" )
+50 -61
View File
@@ -42,43 +42,6 @@
#include <algorithm>
/// Toggle a window's "enable" status to disabled, then enabled on destruction.
class WDO_ENABLE_DISABLE
{
wxWindow* m_win;
public:
WDO_ENABLE_DISABLE( wxWindow* aWindow ) :
m_win( aWindow )
{
if( m_win )
m_win->Disable();
}
~WDO_ENABLE_DISABLE()
{
if( m_win )
{
m_win->Enable();
m_win->Raise(); // let's focus back on the parent window
}
}
void SuspendForTrueModal()
{
if( m_win )
m_win->Enable();
}
void ResumeAfterTrueModal()
{
if( m_win )
m_win->Disable();
}
};
BEGIN_EVENT_TABLE( DIALOG_SHIM, wxDialog )
EVT_CHAR_HOOK( DIALOG_SHIM::OnCharHook )
END_EVENT_TABLE()
@@ -87,17 +50,17 @@ END_EVENT_TABLE()
DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, long style,
const wxString& name ) :
wxDialog( aParent, id, title, pos, size, style, name ),
KIWAY_HOLDER( nullptr, KIWAY_HOLDER::DIALOG ),
m_units( EDA_UNITS::MILLIMETRES ),
m_useCalculatedSize( false ),
m_firstPaintEvent( true ),
m_initialFocusTarget( nullptr ),
m_isClosing( false ),
m_qmodal_loop( nullptr ),
m_qmodal_showing( false ),
m_qmodal_parent_disabler( nullptr ),
m_parentFrame( nullptr )
wxDialog( aParent, id, title, pos, size, style, name ),
KIWAY_HOLDER( nullptr, KIWAY_HOLDER::DIALOG ),
m_units( EDA_UNITS::MM ),
m_useCalculatedSize( false ),
m_firstPaintEvent( true ),
m_initialFocusTarget( nullptr ),
m_isClosing( false ),
m_qmodal_loop( nullptr ),
m_qmodal_showing( false ),
m_qmodal_parent_disabler( nullptr ),
m_parentFrame( nullptr )
{
KIWAY_HOLDER* kiwayHolder = nullptr;
m_initialSize = size;
@@ -521,15 +484,7 @@ int DIALOG_SHIM::ShowModal()
int DIALOG_SHIM::ShowQuasiModal()
{
// This is an exception safe way to zero a pointer before returning.
// Yes, even though DismissModal() clears this first normally, this is
// here in case there's an exception before the dialog is dismissed.
struct NULLER
{
void*& m_what;
NULLER( void*& aPtr ) : m_what( aPtr ) {}
~NULLER() { m_what = nullptr; } // indeed, set it to NULL on destruction
} clear_this( (void*&) m_qmodal_loop );
NULLER raii_nuller( (void*&) m_qmodal_loop );
// release the mouse if it's currently captured as the window having it
// will be disabled when this dialog is shown -- but will still keep the
@@ -545,7 +500,7 @@ int DIALOG_SHIM::ShowQuasiModal()
"window?" ) );
// quasi-modal: disable only my "optimal" parent
m_qmodal_parent_disabler = new WDO_ENABLE_DISABLE( parent );
m_qmodal_parent_disabler = new WINDOW_DISABLER( parent );
// Apple in its infinite wisdom will raise a disabled window before even passing
// us the event, so we have no way to stop it. Instead, we must set an order on
@@ -698,9 +653,43 @@ void DIALOG_SHIM::OnCharHook( wxKeyEvent& aEvt )
return;
}
}
// shift-return (Mac default) or Ctrl-Return (GTK) for OK
else if( ( aEvt.GetKeyCode() == WXK_RETURN || aEvt.GetKeyCode() == WXK_NUMPAD_ENTER )
&& ( aEvt.ShiftDown() || aEvt.ControlDown() ) )
// shift-return (Mac default) or Ctrl-Return (GTK) for new line input
else if( ( aEvt.GetKeyCode() == WXK_RETURN || aEvt.GetKeyCode() == WXK_NUMPAD_ENTER ) && aEvt.ShiftDown() )
{
wxObject* eventSource = aEvt.GetEventObject();
if( wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( eventSource ) )
{
#if defined( __WXMAC__ ) || defined( __WXMSW__ )
wxString eol = "\r\n";
#else
wxString eol = "\n";
#endif
long pos = textCtrl->GetInsertionPoint();
textCtrl->WriteText( eol );
textCtrl->SetInsertionPoint( pos + eol.length() );
return;
}
else if( wxStyledTextCtrl* scintilla = dynamic_cast<wxStyledTextCtrl*>( eventSource ) )
{
wxString eol = "\n";
switch( scintilla->GetEOLMode() )
{
case wxSTC_EOL_CRLF: eol = "\r\n"; break;
case wxSTC_EOL_CR: eol = "\r"; break;
case wxSTC_EOL_LF: eol = "\n"; break;
}
long pos = scintilla->GetCurrentPos();
scintilla->InsertText( pos, eol );
scintilla->GotoPos( pos + eol.length() );
return;
}
return;
}
// command-return (Mac default) or Ctrl-Return (GTK) for OK
else if( ( aEvt.GetKeyCode() == WXK_RETURN || aEvt.GetKeyCode() == WXK_NUMPAD_ENTER ) && aEvt.ControlDown() )
{
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
return;
@@ -24,20 +24,20 @@
#include <dialogs/dialog_design_block_properties.h>
#include <sch_edit_frame.h>
#include <wx/msgdlg.h>
#include <wx/tooltip.h>
#include <grid_tricks.h>
#include <widgets/std_bitmap_button.h>
#include <bitmaps.h>
#include <design_block.h>
DIALOG_DESIGN_BLOCK_PROPERTIES::DIALOG_DESIGN_BLOCK_PROPERTIES( SCH_EDIT_FRAME* aParent,
DESIGN_BLOCK* aDesignBlock ) :
DIALOG_DESIGN_BLOCK_PROPERTIES::DIALOG_DESIGN_BLOCK_PROPERTIES( wxWindow* aParent,
DESIGN_BLOCK* aDesignBlock,
bool aDisableName ) :
DIALOG_DESIGN_BLOCK_PROPERTIES_BASE( aParent ), m_designBlock( aDesignBlock )
{
if( !m_textName->IsEmpty() )
m_textName->SetEditable( false );
m_textName->SetEditable( !aDisableName );
wxToolTip::Enable( true );
SetupStandardButtons();
@@ -50,10 +50,11 @@ DIALOG_DESIGN_BLOCK_PROPERTIES::DIALOG_DESIGN_BLOCK_PROPERTIES( SCH_EDIT_FRAME*
m_fieldsGrid->SetUseNativeColLabels();
m_fieldsGrid->PushEventHandler( new GRID_TRICKS( m_fieldsGrid, [this]( wxCommandEvent& aEvent )
{
OnAddField( aEvent );
} ) );
m_fieldsGrid->PushEventHandler( new GRID_TRICKS( m_fieldsGrid,
[this]( wxCommandEvent& aEvent )
{
OnAddField( aEvent );
} ) );
m_fieldsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
}
@@ -86,8 +87,25 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataToWindow()
bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromWindow()
{
m_designBlock->SetLibId(
LIB_ID( m_designBlock->GetLibId().GetLibNickname(), m_textName->GetValue() ) );
unsigned int illegalCh = LIB_ID::FindIllegalLibraryNameChar( m_textName->GetValue() );
// Also check for / in the name, since this is a path character which is illegal for
// design blocks and footprints but not symbols
if( illegalCh == 0 && m_textName->GetValue().Find( '/' ) != wxNOT_FOUND )
illegalCh = '/';
if( illegalCh )
{
wxString msg = wxString::Format( _( "Illegal character '%c' in name '%s'." ),
illegalCh,
m_textName->GetValue() );
wxMessageDialog errdlg( this, msg, _( "Error" ) );
errdlg.ShowModal();
return false;
}
m_designBlock->SetLibId( LIB_ID( m_designBlock->GetLibId().GetLibNickname(), m_textName->GetValue() ) );
m_designBlock->SetLibDescription( m_textDescription->GetValue() );
m_designBlock->SetKeywords( m_textKeywords->GetValue() );
@@ -22,8 +22,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef DIALOG_DESIGN_BLOCK_PROPERTIES_H
#define DIALOG_DESIGN_BLOCK_PROPERTIES_H
#include <dialogs/dialog_design_block_properties_base.h>
#include <nlohmann/json.hpp>
#include <json_common.h>
class SCH_EDIT_FRAME;
class DESIGN_BLOCK;
@@ -31,7 +34,7 @@ class DESIGN_BLOCK;
class DIALOG_DESIGN_BLOCK_PROPERTIES : public DIALOG_DESIGN_BLOCK_PROPERTIES_BASE
{
public:
DIALOG_DESIGN_BLOCK_PROPERTIES( SCH_EDIT_FRAME* aParent, DESIGN_BLOCK* aDesignBlock );
DIALOG_DESIGN_BLOCK_PROPERTIES( wxWindow* aParent, DESIGN_BLOCK* aDesignBlock, bool aDisableName = false );
~DIALOG_DESIGN_BLOCK_PROPERTIES() override;
bool TransferDataToWindow() override;
@@ -50,6 +53,8 @@ public:
private:
void AdjustGridColumns( int aWidth );
DESIGN_BLOCK* m_designBlock;
DESIGN_BLOCK* m_designBlock;
nlohmann::ordered_map<wxString, wxString> m_fields;
};
#endif
+6 -6
View File
@@ -77,14 +77,14 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow()
{
double gridX = m_gridSizeX.GetDoubleValue();
if( !m_gridSizeX.Validate( 0.001, 1000.0, EDA_UNITS::MILLIMETRES ) )
if( !m_gridSizeX.Validate( 0.001, 1000.0, EDA_UNITS::MM ) )
{
wxMessageBox( _( "Grid size X out of range." ), _( "Error" ), wxOK | wxICON_ERROR );
return false;
}
if( !m_checkLinked->IsChecked()
&& !m_gridSizeY.Validate( 0.001, 1000.0, EDA_UNITS::MILLIMETRES ) )
&& !m_gridSizeY.Validate( 0.001, 1000.0, EDA_UNITS::MM ) )
{
wxMessageBox( _( "Grid size Y out of range." ), _( "Error" ), wxOK | wxICON_ERROR );
return false;
@@ -94,10 +94,10 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow()
m_grid.name = m_textName->GetValue();
// Grid X/Y are always stored in millimeters so we can compare them easily
m_grid.x = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(),
EDA_UNITS::MILLIMETRES, gridX );
m_grid.y = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(),
EDA_UNITS::MILLIMETRES, gridY );
m_grid.x = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM,
gridX );
m_grid.y = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM,
gridY );
return true;
}
@@ -22,34 +22,36 @@
*/
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_picker_tool.h>
#include <pcb_base_edit_frame.h>
#include <pcb_group.h>
#include <tool/actions.h>
#include <eda_draw_frame.h>
#include <eda_group.h>
#include <status_popup.h>
#include <board_commit.h>
#include <commit.h>
#include <bitmaps.h>
#include <widgets/std_bitmap_button.h>
#include <dialogs/dialog_group_properties.h>
DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent,
PCB_GROUP* aGroup ) :
DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES( EDA_DRAW_FRAME* aParent,
EDA_GROUP* aGroup,
COMMIT& aCommit ) :
DIALOG_GROUP_PROPERTIES_BASE( aParent ),
m_brdEditor( aParent ),
m_frame( aParent ),
m_toolMgr( aParent->GetToolManager() ),
m_group( aGroup )
m_group( aGroup ),
m_commit( aCommit )
{
m_bpAddMember->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
m_bpRemoveMember->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
m_nameCtrl->SetValue( m_group->GetName() );
m_locked->SetValue( aGroup->AsEdaItem()->IsLocked() );
m_locked->SetValue( m_group->IsLocked() );
m_locked->Show( dynamic_cast<PCB_EDIT_FRAME*>( aParent ) != nullptr );
if( aGroup->AsEdaItem()->Type() != PCB_GROUP_T )
m_locked->Hide();
for( BOARD_ITEM* item : m_group->GetItems() )
m_membersList->Append( item->GetItemDescription( m_brdEditor, true ), item );
for( EDA_ITEM* item : m_group->GetItems() )
m_membersList->Append( item->GetItemDescription( m_frame, true ), item );
SetupStandardButtons();
@@ -62,11 +64,11 @@ DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent,
DIALOG_GROUP_PROPERTIES::~DIALOG_GROUP_PROPERTIES()
{
if( m_brdEditor->IsBeingDeleted() )
if( m_frame->IsBeingDeleted() )
return;
m_brdEditor->FocusOnItem( nullptr );
m_brdEditor->GetCanvas()->Refresh();
m_frame->ClearFocus();
m_frame->GetCanvas()->Refresh();
}
@@ -80,38 +82,37 @@ bool DIALOG_GROUP_PROPERTIES::TransferDataToWindow()
bool DIALOG_GROUP_PROPERTIES::TransferDataFromWindow()
{
BOARD_COMMIT commit( m_brdEditor );
commit.Modify( m_group );
m_commit.Modify( m_group->AsEdaItem(), m_frame->GetScreen() );
for( size_t ii = 0; ii < m_membersList->GetCount(); ++ii )
{
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( m_membersList->GetClientData( ii ) );
PCB_GROUP* existingGroup = item->GetParentGroup();
EDA_ITEM* item = static_cast<EDA_ITEM*>( m_membersList->GetClientData( ii ) );
EDA_GROUP* existingGroup = item->GetParentGroup();
if( existingGroup != m_group )
{
commit.Modify( item );
m_commit.Modify( item, m_frame->GetScreen() );
if( existingGroup )
commit.Modify( existingGroup );
m_commit.Modify( existingGroup->AsEdaItem(), m_frame->GetScreen() );
}
}
m_group->SetName( m_nameCtrl->GetValue() );
m_group->SetLocked( m_locked->GetValue() );
m_group->AsEdaItem()->SetLocked( m_locked->GetValue() );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
m_toolMgr->RunAction( ACTIONS::selectionClear );
m_group->RemoveAll();
for( size_t ii = 0; ii < m_membersList->GetCount(); ++ii )
{
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( m_membersList->GetClientData( ii ) );
EDA_ITEM* item = static_cast<EDA_ITEM*>( m_membersList->GetClientData( ii ) );
m_group->AddItem( item );
}
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, m_group );
m_toolMgr->RunAction<EDA_ITEM*>( ACTIONS::selectItem, m_group->AsEdaItem() );
commit.Push( _( "Edit Group Properties" ) );
m_commit.Push( _( "Edit Group Properties" ) );
return true;
}
@@ -122,11 +123,11 @@ void DIALOG_GROUP_PROPERTIES::OnMemberSelected( wxCommandEvent& aEvent )
if( selected >= 0 )
{
WINDOW_THAWER thawer( m_brdEditor );
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( m_membersList->GetClientData( selected ) );
WINDOW_THAWER thawer( m_frame );
EDA_ITEM* item = static_cast<EDA_ITEM*>( m_membersList->GetClientData( selected ) );
m_brdEditor->FocusOnItem( item );
m_brdEditor->GetCanvas()->Refresh();
m_frame->FocusOnItem( item );
m_frame->GetCanvas()->Refresh();
}
aEvent.Skip();
@@ -135,7 +136,7 @@ void DIALOG_GROUP_PROPERTIES::OnMemberSelected( wxCommandEvent& aEvent )
void DIALOG_GROUP_PROPERTIES::OnAddMember( wxCommandEvent& event )
{
m_toolMgr->RunAction( PCB_ACTIONS::pickNewGroupMember );
m_toolMgr->RunAction( ACTIONS::pickNewGroupMember );
}
@@ -144,14 +145,14 @@ void DIALOG_GROUP_PROPERTIES::DoAddMember( EDA_ITEM* aItem )
for( size_t ii = 0; ii < m_membersList->GetCount(); ++ii )
{
if( aItem == static_cast<BOARD_ITEM*>( m_membersList->GetClientData( ii ) ) )
if( aItem == static_cast<EDA_ITEM*>( m_membersList->GetClientData( ii ) ) )
return;
}
if( aItem == m_group )
if( aItem == m_group->AsEdaItem() )
return;
m_membersList->Append( aItem->GetItemDescription( m_brdEditor, true ), aItem );
m_membersList->Append( aItem->GetItemDescription( m_frame, true ), aItem );
}
@@ -162,8 +163,8 @@ void DIALOG_GROUP_PROPERTIES::OnRemoveMember( wxCommandEvent& event )
if( selected >= 0 )
m_membersList->Delete( selected );
m_brdEditor->FocusOnItem( nullptr );
m_brdEditor->GetCanvas()->Refresh();
m_frame->ClearFocus();
m_frame->GetCanvas()->Refresh();
}
@@ -26,16 +26,19 @@
#include <dialogs/dialog_group_properties_base.h>
class PCB_BASE_EDIT_FRAME;
class EDA_DRAW_FRAME;
class TOOL_MANAGER;
class PCB_GROUP;
class EDA_GROUP;
class EDA_ITEM;
class COMMIT;
class BASE_SCREEN;
class DIALOG_GROUP_PROPERTIES : public DIALOG_GROUP_PROPERTIES_BASE
{
public:
DIALOG_GROUP_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, PCB_GROUP* aTarget );
~DIALOG_GROUP_PROPERTIES();
DIALOG_GROUP_PROPERTIES( EDA_DRAW_FRAME* aParent, EDA_GROUP* aTarget, COMMIT& aCommit );
~DIALOG_GROUP_PROPERTIES() override;
void OnMemberSelected( wxCommandEvent& event ) override;
void OnAddMember( wxCommandEvent& event ) override;
@@ -47,9 +50,10 @@ private:
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
PCB_BASE_EDIT_FRAME* m_brdEditor;
TOOL_MANAGER* m_toolMgr;
PCB_GROUP* m_group;
EDA_DRAW_FRAME* m_frame;
TOOL_MANAGER* m_toolMgr;
EDA_GROUP* m_group;
COMMIT& m_commit;
};
#endif // DIALOG_GROUP_PROPERTIES_H
+11 -1
View File
@@ -21,11 +21,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "kicad_manager_frame.h"
#include <dialogs/dialog_hotkey_list.h>
#include <kiface_base.h>
#include <eda_base_frame.h>
#include <panel_hotkeys_editor.h>
#include <widgets/ui_common.h>
#include <tool/tool_manager.h>
#include <wx/sizer.h>
#include <wx/button.h>
@@ -39,7 +41,15 @@ DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS( EDA_BASE_FRAME* aParent ):
m_hk_list = new PANEL_HOTKEYS_EDITOR( aParent, this, true );
Kiway().GetActions( m_hk_list->ActionsList() );
wxWindow* kicadMgr_window = wxWindow::FindWindowByName( KICAD_MANAGER_FRAME_NAME );
if( KICAD_MANAGER_FRAME* kicadMgr = static_cast<KICAD_MANAGER_FRAME*>( kicadMgr_window ) )
{
ACTION_MANAGER* actionMgr = kicadMgr->GetToolManager()->GetActionManager();
for( const auto& [name, action] : actionMgr->GetActions() )
m_hk_list->ActionsList().push_back( action );
}
kiface = Kiway().KiFACE( KIWAY::FACE_SCH );
kiface->GetActions( m_hk_list->ActionsList() );
@@ -27,7 +27,7 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxVERTICAL );
m_messageLine1 = new wxStaticText( this, wxID_ANY, _("The selection contains %lu locked items."), wxDefaultPosition, wxDefaultSize, 0 );
m_messageLine1 = new wxStaticText( this, wxID_ANY, _("The selection contains %zu locked items."), wxDefaultPosition, wxDefaultSize, 0 );
m_messageLine1->Wrap( -1 );
bSizer4->Add( m_messageLine1, 0, wxALL, 5 );
@@ -182,7 +182,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">The selection contains %lu locked items.</property>
<property name="label">The selection contains %zu locked items.</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
+19
View File
@@ -27,6 +27,8 @@
#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;
@@ -93,6 +95,9 @@ 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" ) } } );
@@ -245,6 +250,13 @@ 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 =
@@ -296,6 +308,13 @@ 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,6 +5,8 @@
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialogs/panel_printer_list.h"
#include "dialog_print_generic_base.h"
///////////////////////////////////////////////////////////////////////////
@@ -16,6 +18,15 @@ 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,6 +65,75 @@
<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>
+7 -3
View File
@@ -10,17 +10,20 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class PANEL_PRINTER_LIST;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/panel.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>
@@ -46,6 +49,7 @@ 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;
+10 -3
View File
@@ -50,11 +50,13 @@ int WX_UNIT_ENTRY_DIALOG::GetValue()
WX_PT_ENTRY_DIALOG::WX_PT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aCaption,
const wxString& aLabelX, const wxString& aLabelY,
const VECTOR2I& aDefaultValue ) :
const VECTOR2I& aDefaultValue, bool aShowResetButt ) :
WX_PT_ENTRY_DIALOG_BASE( ( wxWindow* ) aParent, wxID_ANY, aCaption ),
m_unit_binder_x( aParent, m_labelX, m_textCtrlX, m_unitsX, true ),
m_unit_binder_y( aParent, m_labelY, m_textCtrlY, m_unitsY, true )
{
m_ButtonReset->Show( aShowResetButt );
m_labelX->SetLabel( aLabelX );
m_labelY->SetLabel( aLabelY );
@@ -67,8 +69,7 @@ WX_PT_ENTRY_DIALOG::WX_PT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString&
SetInitialFocus( m_textCtrlX );
SetupStandardButtons();
Layout();
bSizerMain->Fit( this );
finishDialogSettings();
}
@@ -76,3 +77,9 @@ VECTOR2I WX_PT_ENTRY_DIALOG::GetValue()
{
return VECTOR2I( m_unit_binder_x.GetIntValue(), m_unit_binder_y.GetIntValue() );
}
void WX_PT_ENTRY_DIALOG::ResetValues( wxCommandEvent& event )
{
m_unit_binder_x.SetValue( 0 );
m_unit_binder_y.SetValue( 0 );
}
+11 -2
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -102,8 +102,11 @@ WX_PT_ENTRY_DIALOG_BASE::WX_PT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindowID i
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_ButtonReset = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_ButtonReset, 0, wxALL|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 );
bSizerButtons->Add( 100, 0, 1, wxALIGN_CENTER_VERTICAL, 5 );
bSizerButtons->Add( 30, 0, 1, wxALIGN_CENTER_VERTICAL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
@@ -123,8 +126,14 @@ WX_PT_ENTRY_DIALOG_BASE::WX_PT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindowID i
bSizerMain->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_ButtonReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WX_PT_ENTRY_DIALOG_BASE::ResetValues ), NULL, this );
}
WX_PT_ENTRY_DIALOG_BASE::~WX_PT_ENTRY_DIALOG_BASE()
{
// Disconnect Events
m_ButtonReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WX_PT_ENTRY_DIALOG_BASE::ResetValues ), NULL, this );
}
File diff suppressed because it is too large Load Diff
+9 -2
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -21,10 +21,12 @@
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class WX_UNIT_ENTRY_DIALOG_BASE
///////////////////////////////////////////////////////////////////////////////
@@ -64,10 +66,15 @@ class WX_PT_ENTRY_DIALOG_BASE : public DIALOG_SHIM
wxStaticText* m_labelY;
wxTextCtrl* m_textCtrlY;
wxStaticText* m_unitsY;
wxButton* m_ButtonReset;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, override them in your derived class
virtual void ResetValues( wxCommandEvent& event ) { event.Skip(); }
public:
WX_PT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Move Point to Location"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+56 -84
View File
@@ -25,6 +25,9 @@
#include <confirm.h>
#include <git2.h>
#include <git/kicad_git_memory.h>
#include <git/kicad_git_common.h>
#include <git/git_repo_mixin.h>
#include <gestfich.h>
#include <cerrno>
@@ -42,9 +45,6 @@ DIALOG_GIT_REPOSITORY::DIALOG_GIT_REPOSITORY( wxWindow* aParent, git_repository*
DIALOG_GIT_REPOSITORY_BASE( aParent ),
m_repository( aRepository ),
m_prevFile( wxEmptyString ),
m_tested( 0 ),
m_failedTest( false ),
m_testError( wxEmptyString ),
m_tempRepo( false )
{
m_txtURL->SetFocus();
@@ -68,13 +68,18 @@ DIALOG_GIT_REPOSITORY::DIALOG_GIT_REPOSITORY( wxWindow* aParent, git_repository*
if( !m_txtURL->GetValue().IsEmpty() )
updateURLData();
else
m_ConnType->SetSelection( static_cast<int>( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_LOCAL ) );
SetupStandardButtons();
updateAuthControls();
SetupStandardButtons( { { wxID_HELP, _( "Test Connection" ) } } );
Layout();
finishDialogSettings();
updateAuthControls();
}
DIALOG_GIT_REPOSITORY::~DIALOG_GIT_REPOSITORY()
{
if( m_tempRepo )
@@ -140,6 +145,13 @@ void DIALOG_GIT_REPOSITORY::setDefaultSSHKey()
}
void DIALOG_GIT_REPOSITORY::onCbCustom( wxCommandEvent& event )
{
updateAuthControls();
event.Skip();
}
void DIALOG_GIT_REPOSITORY::OnUpdateUI( wxUpdateUIEvent& event )
{
// event.Enable( !m_txtName->GetValue().IsEmpty() && !m_txtURL->GetValue().IsEmpty() );
@@ -161,6 +173,7 @@ void DIALOG_GIT_REPOSITORY::SetEncrypted( bool aEncrypted )
}
}
std::tuple<bool,wxString,wxString,wxString> DIALOG_GIT_REPOSITORY::isValidHTTPS( const wxString& url )
{
wxRegEx regex( R"((https?:\/\/)(([^:]+)(:([^@]+))?@)?([^\/]+\/[^\s]+))" );
@@ -228,6 +241,7 @@ void DIALOG_GIT_REPOSITORY::updateURLData()
if( valid )
{
m_fullURL = url;
m_ConnType->SetSelection( static_cast<int>( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_HTTPS ) );
SetUsername( username );
SetPassword( password );
@@ -235,7 +249,6 @@ void DIALOG_GIT_REPOSITORY::updateURLData()
if( m_txtName->GetValue().IsEmpty() )
m_txtName->SetValue( get_repo_name( repoAddress ) );
}
}
else if( url.Contains( "ssh://" ) || url.Contains( "git@" ) )
@@ -244,6 +257,7 @@ void DIALOG_GIT_REPOSITORY::updateURLData()
if( valid )
{
m_fullURL = url;
m_ConnType->SetSelection( static_cast<int>( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH ) );
m_txtUsername->SetValue( username );
m_txtURL->SetValue( repoAddress );
@@ -259,6 +273,11 @@ void DIALOG_GIT_REPOSITORY::updateURLData()
void DIALOG_GIT_REPOSITORY::OnTestClick( wxCommandEvent& event )
{
if( m_txtURL->GetValue().Trim().Trim( false ).IsEmpty() )
return;
wxString error;
bool success = false;
git_remote* remote = nullptr;
git_remote_callbacks callbacks;
git_remote_init_callbacks( &callbacks, GIT_REMOTE_CALLBACKS_VERSION );
@@ -266,81 +285,40 @@ void DIALOG_GIT_REPOSITORY::OnTestClick( wxCommandEvent& event )
// We track if we have already tried to connect.
// If we have, the server may come back to offer another connection
// type, so we need to keep track of how many times we have tried.
m_tested = 0;
callbacks.credentials = []( git_cred** aOut, const char* aUrl, const char* aUsername,
unsigned int aAllowedTypes, void* aPayload ) -> int
{
DIALOG_GIT_REPOSITORY* dialog = static_cast<DIALOG_GIT_REPOSITORY*>( aPayload );
if( dialog->GetRepoType() == KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_LOCAL )
return GIT_PASSTHROUGH;
if( aAllowedTypes & GIT_CREDTYPE_USERNAME
&& !( dialog->GetTested() & GIT_CREDTYPE_USERNAME ) )
{
wxString username = dialog->GetUsername().Trim().Trim( false );
git_cred_username_new( aOut, username.ToStdString().c_str() );
dialog->GetTested() |= GIT_CREDTYPE_USERNAME;
}
else if( dialog->GetRepoType() == KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_HTTPS
&& ( aAllowedTypes & GIT_CREDTYPE_USERPASS_PLAINTEXT )
&& !( dialog->GetTested() & GIT_CREDTYPE_USERPASS_PLAINTEXT ) )
{
wxString username = dialog->GetUsername().Trim().Trim( false );
wxString password = dialog->GetPassword().Trim().Trim( false );
git_cred_userpass_plaintext_new( aOut, username.ToStdString().c_str(),
password.ToStdString().c_str() );
dialog->GetTested() |= GIT_CREDTYPE_USERPASS_PLAINTEXT;
}
else if( dialog->GetRepoType() == KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH
&& ( aAllowedTypes & GIT_CREDTYPE_SSH_KEY )
&& !( dialog->GetTested() & GIT_CREDTYPE_SSH_KEY ) )
{
// SSH key authentication
wxString sshKey = dialog->GetRepoSSHPath();
wxString sshPubKey = sshKey + ".pub";
wxString username = dialog->GetUsername().Trim().Trim( false );
wxString password = dialog->GetPassword().Trim().Trim( false );
git_cred_ssh_key_new( aOut, username.ToStdString().c_str(),
sshPubKey.ToStdString().c_str(), sshKey.ToStdString().c_str(),
password.ToStdString().c_str() );
dialog->GetTested() |= GIT_CREDTYPE_SSH_KEY;
}
else
{
return GIT_PASSTHROUGH;
}
return GIT_OK;
};
callbacks.payload = this;
KIGIT_COMMON common( m_repository );
common.SetRemote( m_txtURL->GetValue() );
callbacks.credentials = credentials_cb;
common.SetPassword( m_txtPassword->GetValue() );
common.SetUsername( m_txtUsername->GetValue() );
common.SetSSHKey( m_fpSSHKey->GetFileName().GetFullPath() );
KIGIT_REPO_MIXIN repoMixin( &common );
callbacks.payload = &repoMixin;
wxString txtURL = m_txtURL->GetValue();
git_remote_create_with_fetchspec( &remote, m_repository, "origin", txtURL.ToStdString().c_str(),
git_remote_create_with_fetchspec( &remote, m_repository, "origin", txtURL.mbc_str(),
"+refs/heads/*:refs/remotes/origin/*" );
KIGIT::GitRemotePtr remotePtr( remote );
if( git_remote_connect( remote, GIT_DIRECTION_FETCH, &callbacks, nullptr, nullptr ) != GIT_OK )
SetTestResult( true, git_error_last()->message );
if( git_remote_connect( remote, GIT_DIRECTION_FETCH, &callbacks, nullptr, nullptr ) == GIT_OK )
success = true;
else
SetTestResult( false, wxEmptyString );
error = KIGIT_COMMON::GetLastGitError();
git_remote_disconnect( remote );
git_remote_free( remote );
auto dlg = wxMessageDialog( this, wxEmptyString, _( "Test connection" ), wxOK | wxICON_INFORMATION );
auto dlg = wxMessageDialog( this, wxEmptyString, _( "Test Connection" ),
wxOK | wxICON_INFORMATION );
if( !m_failedTest )
if( success )
{
dlg.SetMessage( _( "Connection successful" ) );
}
else
{
dlg.SetMessage( wxString::Format( _( "Could not connect to '%s' " ), m_txtURL->GetValue() ) );
dlg.SetExtendedMessage( m_testError );
dlg.SetMessage( wxString::Format( _( "Could not connect to '%s' " ),
m_txtURL->GetValue() ) );
dlg.SetExtendedMessage( error );
}
dlg.ShowModal();
@@ -413,13 +391,6 @@ void DIALOG_GIT_REPOSITORY::OnOKClick( wxCommandEvent& event )
{
// Save the repository details
if( m_txtName->GetValue().IsEmpty() )
{
DisplayErrorMessage( this, _( "Missing information" ),
_( "Please enter a name for the repository" ) );
return;
}
if( m_txtURL->GetValue().IsEmpty() )
{
DisplayErrorMessage( this, _( "Missing information" ),
@@ -435,28 +406,29 @@ void DIALOG_GIT_REPOSITORY::updateAuthControls()
{
if( m_ConnType->GetSelection() == static_cast<int>( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_LOCAL ) )
{
m_panelAuth->Show( false );
m_panelAuth->Enable( false );
}
else
{
m_panelAuth->Show( true );
m_panelAuth->Enable( true );
if( m_ConnType->GetSelection() == static_cast<int>( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH ) )
{
m_fpSSHKey->Show( true );
m_labelSSH->Show( true );
m_labelPass1->SetLabel( _( "SSH Key Password" ) );
m_cbCustom->Enable( true );
m_fpSSHKey->Enable( m_cbCustom->IsChecked() );
m_txtUsername->Enable( m_cbCustom->IsChecked() );
m_txtPassword->Enable( m_cbCustom->IsChecked() );
m_labelPass1->SetLabel( _( "SSH key password:" ) );
}
else
{
m_fpSSHKey->Show( false );
m_labelSSH->Show( false );
m_labelPass1->SetLabel( _( "Password" ) );
setDefaultSSHKey();
m_cbCustom->Enable( false );
m_fpSSHKey->Enable( false );
m_txtUsername->Enable( true );
m_txtPassword->Enable( true );
m_labelPass1->SetLabel( _( "Password:" ) );
}
}
Layout();
}
+4 -12
View File
@@ -36,12 +36,6 @@ public:
wxString aURL = wxEmptyString );
~DIALOG_GIT_REPOSITORY() override;
void SetTestResult( bool aFailed, const wxString& aError )
{
m_failedTest = aFailed;
m_testError = aError;
}
void SetRepoType( KIGIT_COMMON::GIT_CONN_TYPE aType )
{
m_ConnType->SetSelection( static_cast<int>( aType ) );
@@ -78,6 +72,8 @@ public:
return url;
}
const wxString& GetFullURL() const { return m_fullURL; }
void SetUsername( const wxString& aUsername ) { m_txtUsername->SetValue( aUsername ); }
wxString GetUsername() const { return m_txtUsername->GetValue(); }
@@ -87,8 +83,6 @@ public:
void SetRepoSSHPath( const wxString& aPath ) { m_fpSSHKey->SetFileName( aPath ); m_prevFile = aPath; }
wxString GetRepoSSHPath() const { return m_fpSSHKey->GetFileName().GetFullPath(); }
unsigned& GetTested() { return m_tested; }
void SetEncrypted( bool aEncrypted = true );
private:
@@ -100,6 +94,7 @@ private:
void OnTestClick( wxCommandEvent& event ) override;
void OnFileUpdated( wxFileDirPickerEvent& event ) override;
void onCbCustom( wxCommandEvent& event ) override;
void setDefaultSSHKey();
@@ -112,13 +107,10 @@ private:
private:
git_repository* m_repository;
wxString m_fullURL;
wxString m_prevFile;
unsigned m_tested;
bool m_failedTest;
wxString m_testError;
bool m_tempRepo;
wxString m_tempPath;
};
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -13,7 +13,6 @@ DIALOG_GIT_REPOSITORY_BASE::DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWind
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Connection"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -21,31 +20,37 @@ DIALOG_GIT_REPOSITORY_BASE::DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWind
bSizerMain->Add( m_staticText1, 0, wxLEFT|wxTOP, 10 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxTOP, 5 );
bSizerMain->Add( m_staticline1, 0, wxALL|wxEXPAND, 5 );
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer2 = new wxFlexGridSizer( 0, 2, 5, 0 );
fgSizer2->AddGrowableCol( 1 );
fgSizer2->SetFlexibleDirection( wxBOTH );
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
fgSizer2->Add( m_staticText3, 0, wxALL, 5 );
m_staticText3->Hide();
fgSizer2->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_txtName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_txtName, 0, wxALL|wxEXPAND, 5 );
m_txtName->Hide();
m_staticText4 = new wxStaticText( this, wxID_ANY, _("Location"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_txtName, 0, wxEXPAND|wxRIGHT, 5 );
m_staticText4 = new wxStaticText( this, wxID_ANY, _("Location:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
fgSizer2->Add( m_staticText4, 0, wxALL, 5 );
fgSizer2->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_txtURL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_txtURL, 0, wxALL|wxEXPAND, 5 );
fgSizer2->Add( m_txtURL, 0, wxEXPAND|wxRIGHT, 5 );
m_staticText9 = new wxStaticText( this, wxID_ANY, _("Connection Type"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9 = new wxStaticText( this, wxID_ANY, _("Connection type:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 );
fgSizer2->Add( m_staticText9, 0, wxALL, 5 );
m_staticText9->Hide();
fgSizer2->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
@@ -54,97 +59,84 @@ DIALOG_GIT_REPOSITORY_BASE::DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWind
int m_ConnTypeNChoices = sizeof( m_ConnTypeChoices ) / sizeof( wxString );
m_ConnType = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ConnTypeNChoices, m_ConnTypeChoices, 0 );
m_ConnType->SetSelection( 0 );
bSizer3->Add( m_ConnType, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ConnType->Hide();
bSizer3->Add( m_ConnType, 0, wxRIGHT, 5 );
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
bSizer3->Add( 0, 0, 0, wxEXPAND, 5 );
fgSizer2->Add( bSizer3, 1, wxEXPAND, 5 );
bSizerMain->Add( fgSizer2, 1, wxEXPAND, 5 );
bSizerMain->Add( fgSizer2, 0, wxEXPAND, 5 );
m_panelAuth = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* m_szAuth;
m_szAuth = new wxBoxSizer( wxVERTICAL );
m_szAuth->Add( 0, 0, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer11;
bSizer11 = new wxBoxSizer( wxHORIZONTAL );
m_staticText2 = new wxStaticText( m_panelAuth, wxID_ANY, _("Authentication"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
bSizer11->Add( m_staticText2, 0, wxLEFT|wxTOP, 10 );
bSizer11->Add( 0, 0, 1, wxEXPAND, 5 );
m_szAuth->Add( bSizer11, 0, wxEXPAND, 5 );
m_szAuth->Add( m_staticText2, 0, wxLEFT|wxTOP, 10 );
m_staticline2 = new wxStaticLine( m_panelAuth, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
m_szAuth->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
wxFlexGridSizer* fgSshSizer;
fgSshSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSshSizer->AddGrowableCol( 1 );
fgSshSizer->SetFlexibleDirection( wxBOTH );
fgSshSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxFlexGridSizer* fgSizer21;
fgSizer21 = new wxFlexGridSizer( 0, 2, 5, 0 );
fgSizer21->SetFlexibleDirection( wxBOTH );
fgSizer21->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_labelSSH = new wxStaticText( m_panelAuth, wxID_ANY, _("SSH Private Key"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelSSH->Wrap( -1 );
fgSshSizer->Add( m_labelSSH, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 );
wxBoxSizer* bSizer41;
bSizer41 = new wxBoxSizer( wxHORIZONTAL );
m_cbCustom = new wxCheckBox( m_panelAuth, wxID_ANY, _("SSH private key: "), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer21->Add( m_cbCustom, 0, wxALL, 5 );
m_fpSSHKey = new wxFilePickerCtrl( m_panelAuth, wxID_ANY, wxEmptyString, _("Select SSH private key file"), _("*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN );
bSizer41->Add( m_fpSSHKey, 1, wxEXPAND|wxLEFT|wxRESERVE_SPACE_EVEN_IF_HIDDEN|wxRIGHT, 5 );
m_fpSSHKey->SetMinSize( wxSize( 250,-1 ) );
m_btnTest = new wxButton( m_panelAuth, wxID_ANY, _("Test"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer41->Add( m_btnTest, 0, wxLEFT|wxRIGHT, 5 );
fgSizer21->Add( m_fpSSHKey, 0, wxEXPAND|wxRIGHT, 5 );
fgSshSizer->Add( bSizer41, 1, wxEXPAND, 5 );
m_staticText11 = new wxStaticText( m_panelAuth, wxID_ANY, _("Username"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11 = new wxStaticText( m_panelAuth, wxID_ANY, _("User name:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
fgSshSizer->Add( m_staticText11, 0, wxALL, 5 );
fgSizer21->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_txtUsername = new wxTextCtrl( m_panelAuth, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSshSizer->Add( m_txtUsername, 0, wxALL|wxEXPAND, 5 );
fgSizer21->Add( m_txtUsername, 0, wxEXPAND|wxRIGHT, 5 );
m_labelPass1 = new wxStaticText( m_panelAuth, wxID_ANY, _("SSH Key Password"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelPass1 = new wxStaticText( m_panelAuth, wxID_ANY, _("SSH key password:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelPass1->Wrap( -1 );
fgSshSizer->Add( m_labelPass1, 0, wxALL, 5 );
fgSizer21->Add( m_labelPass1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_txtPassword = new wxTextCtrl( m_panelAuth, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSshSizer->Add( m_txtPassword, 0, wxALL|wxEXPAND, 5 );
fgSizer21->Add( m_txtPassword, 0, wxEXPAND|wxRIGHT, 5 );
m_szAuth->Add( fgSshSizer, 1, wxEXPAND, 5 );
m_szAuth->Add( fgSizer21, 1, wxBOTTOM|wxEXPAND, 5 );
m_panelAuth->SetSizer( m_szAuth );
m_panelAuth->Layout();
m_szAuth->Fit( m_panelAuth );
bSizerMain->Add( m_panelAuth, 1, wxALL|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 0 );
bSizerMain->Add( m_panelAuth, 0, wxEXPAND|wxTOP, 5 );
bSizerMain->Add( 0, 0, 1, wxEXPAND, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizerHelp = new wxButton( this, wxID_HELP );
m_sdbSizer->AddButton( m_sdbSizerHelp );
m_sdbSizer->Realize();
bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
bSizerMain->Add( m_sdbSizer, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );
@@ -153,8 +145,9 @@ DIALOG_GIT_REPOSITORY_BASE::DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWind
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnUpdateUI ) );
m_txtURL->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnLocationExit ), NULL, this );
m_ConnType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnSelectConnType ), NULL, this );
m_cbCustom->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::onCbCustom ), NULL, this );
m_fpSSHKey->Connect( wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnFileUpdated ), NULL, this );
m_btnTest->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnTestClick ), NULL, this );
m_sdbSizerHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnTestClick ), NULL, this );
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnOKClick ), NULL, this );
}
@@ -165,8 +158,9 @@ DIALOG_GIT_REPOSITORY_BASE::~DIALOG_GIT_REPOSITORY_BASE()
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnUpdateUI ) );
m_txtURL->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnLocationExit ), NULL, this );
m_ConnType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnSelectConnType ), NULL, this );
m_cbCustom->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::onCbCustom ), NULL, this );
m_fpSSHKey->Disconnect( wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnFileUpdated ), NULL, this );
m_btnTest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnTestClick ), NULL, this );
m_sdbSizerHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnTestClick ), NULL, this );
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GIT_REPOSITORY_BASE::OnOKClick ), NULL, this );
}
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -21,17 +21,14 @@
#include <wx/textctrl.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/filepicker.h>
#include <wx/button.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/panel.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GIT_REPOSITORY_BASE
///////////////////////////////////////////////////////////////////////////////
@@ -40,6 +37,7 @@ class DIALOG_GIT_REPOSITORY_BASE : public DIALOG_SHIM
private:
protected:
wxBoxSizer* bSizerMain;
wxStaticText* m_staticText1;
wxStaticLine* m_staticline1;
wxStaticText* m_staticText3;
@@ -51,9 +49,8 @@ class DIALOG_GIT_REPOSITORY_BASE : public DIALOG_SHIM
wxPanel* m_panelAuth;
wxStaticText* m_staticText2;
wxStaticLine* m_staticline2;
wxStaticText* m_labelSSH;
wxCheckBox* m_cbCustom;
wxFilePickerCtrl* m_fpSSHKey;
wxButton* m_btnTest;
wxStaticText* m_staticText11;
wxTextCtrl* m_txtUsername;
wxStaticText* m_labelPass1;
@@ -61,12 +58,14 @@ class DIALOG_GIT_REPOSITORY_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
wxButton* m_sdbSizerHelp;
// Virtual event handlers, override them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnLocationExit( wxFocusEvent& event ) { event.Skip(); }
virtual void OnSelectConnType( wxCommandEvent& event ) { event.Skip(); }
virtual void onCbCustom( wxCommandEvent& event ) { event.Skip(); }
virtual void OnFileUpdated( wxFileDirPickerEvent& event ) { event.Skip(); }
virtual void OnTestClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
@@ -74,7 +73,7 @@ class DIALOG_GIT_REPOSITORY_BASE : public DIALOG_SHIM
public:
DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Git Repository"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 682,598 ), long style = wxCAPTION|wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Git Repository"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GIT_REPOSITORY_BASE();
+15 -13
View File
@@ -24,9 +24,13 @@
#include "dialog_git_switch.h"
#include <git/kicad_git_memory.h>
#include <trace_helpers.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/listctrl.h>
#include <wx/log.h>
#include <wx/event.h>
#include <wx/sizer.h>
#include <wx/timer.h>
@@ -240,39 +244,42 @@ void DIALOG_GIT_SWITCH::GetBranches()
git_reference* currentBranchReference = nullptr;
git_repository_head( &currentBranchReference, m_repository );
// Get the current branch name
if( currentBranchReference )
if( !currentBranchReference )
{
m_currentBranch = git_reference_shorthand( currentBranchReference );
git_reference_free( currentBranchReference );
wxLogTrace( traceGit, "Failed to get current branch" );
return;
}
KIGIT::GitReferencePtr currentBranch( currentBranchReference );
m_currentBranch = git_reference_shorthand( currentBranchReference );
// Initialize branch iterator
git_branch_iterator_new( &branchIterator, m_repository, GIT_BRANCH_ALL );
KIGIT::GitBranchIteratorPtr branchIteratorPtr( branchIterator );
// Iterate over local branches
git_reference* branchReference = nullptr;
while( git_branch_next( &branchReference, &branchType, branchIterator ) == 0 )
{
KIGIT::GitReferencePtr branchReferencePtr( branchReference );
// Get the branch OID
const git_oid* branchOid = git_reference_target( branchReference );
// Skip this branch if it doesn't have an OID
if( !branchOid )
{
git_reference_free( branchReference );
continue;
}
git_commit* commit = nullptr;
if( git_commit_lookup( &commit, m_repository, branchOid ) )
{
// Skip this branch if it doesn't have a commit
git_reference_free( branchReference );
continue;
}
KIGIT::GitCommitPtr commitPtr( commit );
// Retrieve commit details
BranchData branchData;
branchData.commitString = git_commit_message( commit );
@@ -280,10 +287,5 @@ void DIALOG_GIT_SWITCH::GetBranches()
branchData.isRemote = branchType == GIT_BRANCH_REMOTE;
m_branches[git_reference_shorthand( branchReference )] = branchData;
git_commit_free( commit );
git_reference_free( branchReference );
}
git_branch_iterator_free( branchIterator );
}
+41 -274
View File
@@ -24,10 +24,12 @@
#include <kiplatform/secrets.h>
#include <pgm_base.h>
#include <settings/common_settings.h>
#include <trace_helpers.h>
#include <widgets/std_bitmap_button.h>
#include <widgets/wx_grid.h>
#include <git2.h>
#include <git/kicad_git_memory.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/checkbox.h>
@@ -36,11 +38,6 @@
PANEL_GIT_REPOS::PANEL_GIT_REPOS( wxWindow* aParent ) : PANEL_GIT_REPOS_BASE( aParent)
{
m_btnAddRepo->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
m_btnEditRepo->SetBitmap( KiBitmapBundle( BITMAPS::small_edit ) );
m_btnDelete->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
}
PANEL_GIT_REPOS::~PANEL_GIT_REPOS()
@@ -50,7 +47,6 @@ PANEL_GIT_REPOS::~PANEL_GIT_REPOS()
void PANEL_GIT_REPOS::ResetPanel()
{
m_grid->ClearGrid();
m_cbDefault->SetValue( true );
m_author->SetValue( wxEmptyString );
m_authorEmail->SetValue( wxEmptyString );
@@ -67,56 +63,44 @@ static std::pair<wxString, wxString> getDefaultAuthorAndEmail()
if( git_config_open_default( &config ) != 0 )
{
printf( "Failed to open default Git config: %s\n", giterr_last()->message );
wxLogTrace( traceGit, "Failed to open default Git config: %s", KIGIT_COMMON::GetLastGitError() );
return std::make_pair( name, email );
}
KIGIT::GitConfigPtr configPtr( config );
if( git_config_get_entry( &name_c, config, "user.name" ) != 0 )
{
printf( "Failed to get user.name from Git config: %s\n", giterr_last()->message );
wxLogTrace( traceGit, "Failed to get user.name from Git config: %s", KIGIT_COMMON::GetLastGitError() );
return std::make_pair( name, email );
}
KIGIT::GitConfigEntryPtr namePtr( name_c );
if( git_config_get_entry( &email_c, config, "user.email" ) != 0 )
{
printf( "Failed to get user.email from Git config: %s\n", giterr_last()->message );
wxLogTrace( traceGit, "Failed to get user.email from Git config: %s", KIGIT_COMMON::GetLastGitError() );
return std::make_pair( name, email );
}
KIGIT::GitConfigEntryPtr emailPtr( email_c );
if( name_c )
name = name_c->value;
if( email_c )
email = email_c->value;
git_config_entry_free( name_c );
git_config_entry_free( email_c );
git_config_free( config );
return std::make_pair( name, email );
}
bool PANEL_GIT_REPOS::TransferDataFromWindow()
{
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
std::vector<COMMON_SETTINGS::GIT_REPOSITORY>& repos = settings->m_Git.repositories;
repos.clear();
for( int row = 0; row < m_grid->GetNumberRows(); row++ )
{
COMMON_SETTINGS::GIT_REPOSITORY repo;
repo.active = m_grid->GetCellValue( row, COL_ACTIVE ) == "1";
repo.name = m_grid->GetCellValue( row, COL_NAME );
repo.path = m_grid->GetCellValue( row, COL_PATH );
repo.authType = m_grid->GetCellValue( row, COL_AUTH_TYPE );
repo.username = m_grid->GetCellValue( row, COL_USERNAME );
KIPLATFORM::SECRETS::StoreSecret( repo.path, repo.username,
m_grid->GetCellValue( row, COL_PASSWORD ) );
repo.ssh_path = m_grid->GetCellValue( row, COL_SSH_PATH );
repo.checkValid = m_grid->GetCellValue( row, COL_STATUS ) == "1";
repos.push_back( repo );
}
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
settings->m_Git.enableGit = m_enableGit->GetValue();
settings->m_Git.updatInterval = m_updateInterval->GetValue();
settings->m_Git.useDefaultAuthor = m_cbDefault->GetValue();
settings->m_Git.authorName = m_author->GetValue();
settings->m_Git.authorEmail = m_authorEmail->GetValue();
@@ -124,153 +108,38 @@ bool PANEL_GIT_REPOS::TransferDataFromWindow()
return true;
}
static bool testRepositoryConnection( COMMON_SETTINGS::GIT_REPOSITORY& repository)
{
git_libgit2_init();
git_remote_callbacks callbacks;
callbacks.version = GIT_REMOTE_CALLBACKS_VERSION;
typedef struct
{
COMMON_SETTINGS::GIT_REPOSITORY* repo;
bool success;
} callbacksPayload;
callbacksPayload cb_data( { &repository, true } ); // If we don't need authentication, then,
// we are successful
callbacks.payload = &cb_data;
callbacks.credentials =
[](git_cred** out, const char* url, const char* username, unsigned int allowed_types,
void* payload) -> int
{
// If we are asking for credentials, then, we need authentication
callbacksPayload* data = static_cast<callbacksPayload*>(payload);
data->success = false;
if( allowed_types & GIT_CREDTYPE_USERNAME )
{
data->success = true;
}
else if( data->repo->authType == "ssh" && ( allowed_types & GIT_CREDTYPE_SSH_KEY ) )
{
wxString sshKeyPath = data->repo->ssh_path;
// Check if the SSH key exists and is readable
if( wxFileExists( sshKeyPath ) && wxFile::Access( sshKeyPath, wxFile::read ) )
data->success = true;
}
else if( data->repo->authType == "password" )
{
data->success = ( allowed_types & GIT_CREDTYPE_USERPASS_PLAINTEXT );
}
return 0;
};
// Create a temporary directory to initialize the Git repository
wxString tempDirPath = wxFileName::CreateTempFileName(wxT("kigit_temp"));
if( !wxFileName::Mkdir( tempDirPath, wxS_DIR_DEFAULT ) )
{
git_libgit2_shutdown();
wxLogError( "Failed to create temporary directory for Git repository (%s): %s", tempDirPath,
wxSysErrorMsg() );
return false;
}
// Initialize the Git repository
git_repository* repo = nullptr;
int result = git_repository_init( &repo, tempDirPath.mb_str( wxConvUTF8 ), 0 );
if (result != 0)
{
git_repository_free(repo);
git_libgit2_shutdown();
wxRmdir(tempDirPath);
return false;
}
git_remote* remote = nullptr;
result = git_remote_create_anonymous( &remote, repo, tempDirPath.mb_str( wxConvUTF8 ) );
if (result != 0)
{
git_remote_free(remote);
git_repository_free(repo);
git_libgit2_shutdown();
wxRmdir(tempDirPath);
return false;
}
// We don't really care about the result of this call, the authentication callback
// will set the return values we need
git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks, nullptr, nullptr);
git_remote_disconnect(remote);
git_remote_free(remote);
git_repository_free(repo);
git_libgit2_shutdown();
// Clean up the temporary directory
wxRmdir(tempDirPath);
return cb_data.success;
}
bool PANEL_GIT_REPOS::TransferDataToWindow()
{
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
std::pair<wxString, wxString> defaultAuthor = getDefaultAuthorAndEmail();
m_grid->ClearGrid();
for( COMMON_SETTINGS::GIT_REPOSITORY& repo : settings->m_Git.repositories )
{
if( repo.name.IsEmpty() || repo.path.IsEmpty() )
continue;
int row = m_grid->GetNumberRows();
m_grid->AppendRows( 1 );
m_grid->SetCellRenderer( row, COL_ACTIVE, new wxGridCellBoolRenderer() );
m_grid->SetCellEditor( row, COL_ACTIVE, new wxGridCellBoolEditor() );
m_grid->SetCellValue( row, COL_ACTIVE, repo.active ? "1" : "0" );
m_grid->SetCellValue( row, COL_NAME, repo.name );
m_grid->SetCellValue( row, COL_PATH, repo.path );
m_grid->SetCellValue( row, COL_AUTH_TYPE, repo.authType );
m_grid->SetCellValue( row, COL_USERNAME, repo.username );
wxString password;
KIPLATFORM::SECRETS::GetSecret( repo.path, repo.username, password );
m_grid->SetCellValue( row, COL_PASSWORD, password );
m_grid->SetCellValue( row, COL_SSH_PATH, repo.ssh_path );
if( repo.active )
m_grid->SetCellValue( row, 3, testRepositoryConnection( repo ) ? "C" : "NC" );
}
m_enableGit->SetValue( settings->m_Git.enableGit );
m_updateInterval->SetValue( settings->m_Git.updatInterval );
m_cbDefault->SetValue( settings->m_Git.useDefaultAuthor );
if( settings->m_Git.useDefaultAuthor )
{
std::pair<wxString, wxString> defaultAuthor = getDefaultAuthorAndEmail();
m_author->SetValue( defaultAuthor.first );
m_authorEmail->SetValue( defaultAuthor.second );
m_author->Disable();
m_authorEmail->Disable();
}
else
{
m_author->SetValue( settings->m_Git.authorName );
m_authorEmail->SetValue( settings->m_Git.authorEmail );
if( settings->m_Git.authorName.IsEmpty() )
m_author->SetValue( defaultAuthor.first );
else
m_author->SetValue( settings->m_Git.authorName );
if( settings->m_Git.authorEmail.IsEmpty() )
m_authorEmail->SetValue( defaultAuthor.second );
else
m_authorEmail->SetValue( settings->m_Git.authorEmail );
}
wxCommandEvent event;
onDefaultClick( event );
onEnableGitClick( event );
return true;
}
@@ -282,115 +151,13 @@ void PANEL_GIT_REPOS::onDefaultClick( wxCommandEvent& event )
m_authorEmailLabel->Enable( !m_cbDefault->GetValue() );
}
void PANEL_GIT_REPOS::onGridDClick( wxGridEvent& event )
void PANEL_GIT_REPOS::onEnableGitClick( wxCommandEvent& aEvent )
{
if( m_grid->GetNumberRows() <= 0 )
{
wxCommandEvent evt;
onAddClick( evt );
return;
}
int row = event.GetRow();
if( row < 0 || row >= m_grid->GetNumberRows() )
return;
DIALOG_GIT_REPOSITORY dialog( this, nullptr );
dialog.SetRepoName( m_grid->GetCellValue( row, COL_NAME ) );
dialog.SetRepoURL( m_grid->GetCellValue( row, COL_PATH ) );
dialog.SetUsername( m_grid->GetCellValue( row, COL_USERNAME ) );
dialog.SetRepoSSHPath( m_grid->GetCellValue( row, COL_SSH_PATH ) );
dialog.SetPassword( m_grid->GetCellValue( row, COL_PASSWORD ) );
wxString type = m_grid->GetCellValue( row, COL_AUTH_TYPE );
if( type == "password" )
dialog.SetRepoType( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_HTTPS );
else if( type == "ssh" )
dialog.SetRepoType( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH );
else
dialog.SetRepoType( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_LOCAL);
if( dialog.ShowModal() == wxID_OK )
{
m_grid->SetCellValue( row, COL_NAME, dialog.GetRepoName() );
m_grid->SetCellValue( row, COL_PATH, dialog.GetRepoURL() );
m_grid->SetCellValue( row, COL_USERNAME, dialog.GetUsername() );
m_grid->SetCellValue( row, COL_SSH_PATH, dialog.GetRepoSSHPath() );
m_grid->SetCellValue( row, COL_PASSWORD, dialog.GetPassword() );
if( dialog.GetRepoType() == KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_HTTPS )
{
m_grid->SetCellValue( row, COL_AUTH_TYPE, "password" );
}
else if( dialog.GetRepoType() == KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH )
{
m_grid->SetCellValue( row, COL_AUTH_TYPE, "ssh" );
}
else
{
m_grid->SetCellValue( row, COL_AUTH_TYPE, "none" );
}
}
}
void PANEL_GIT_REPOS::onAddClick( wxCommandEvent& event )
{
DIALOG_GIT_REPOSITORY dialog( m_parent, nullptr );
if( dialog.ShowModal() == wxID_OK )
{
int row = m_grid->GetNumberRows();
m_grid->AppendRows( 1 );
m_grid->SetCellValue( row, COL_NAME, dialog.GetRepoName() );
m_grid->SetCellValue( row, COL_PATH, dialog.GetRepoURL() );
m_grid->SetCellValue( row, COL_USERNAME, dialog.GetUsername() );
m_grid->SetCellValue( row, COL_SSH_PATH, dialog.GetRepoSSHPath() );
m_grid->SetCellValue( row, COL_PASSWORD, dialog.GetPassword() );
if( dialog.GetRepoType() == KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_HTTPS )
{
m_grid->SetCellValue( row, COL_AUTH_TYPE, "password" );
}
else if( dialog.GetRepoType() == KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH )
{
m_grid->SetCellValue( row, COL_AUTH_TYPE, "ssh" );
}
else
{
m_grid->SetCellValue( row, COL_AUTH_TYPE, "none" );
}
m_grid->MakeCellVisible( row, 0 );
}
}
void PANEL_GIT_REPOS::onEditClick( wxCommandEvent& event )
{
wxGridEvent evt( m_grid->GetId(), wxEVT_GRID_CELL_LEFT_DCLICK, m_grid,
m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
onGridDClick( evt );
}
void PANEL_GIT_REPOS::onDeleteClick( wxCommandEvent& event )
{
if( !m_grid->CommitPendingChanges() || m_grid->GetNumberRows() <= 0 )
return;
int curRow = m_grid->GetGridCursorRow();
m_grid->DeleteRows( curRow );
curRow = std::max( 0, curRow - 1 );
m_grid->MakeCellVisible( curRow, m_grid->GetGridCursorCol() );
m_grid->SetGridCursor( curRow, m_grid->GetGridCursorCol() );
bool enable = m_enableGit->GetValue();
m_updateInterval->Enable( enable );
m_cbDefault->Enable( enable );
m_author->Enable( enable && !m_cbDefault->GetValue() );
m_authorEmail->Enable( enable && !m_cbDefault->GetValue() );
m_authorLabel->Enable( enable && !m_cbDefault->GetValue() );
m_authorEmailLabel->Enable( enable && !m_cbDefault->GetValue() );
}
+1 -4
View File
@@ -49,10 +49,7 @@ public:
private:
void onDefaultClick( wxCommandEvent& event ) override;
void onGridDClick( wxGridEvent& event ) override;
void onAddClick( wxCommandEvent& event ) override;
void onEditClick( wxCommandEvent& event ) override;
void onDeleteClick( wxCommandEvent& event ) override;
void onEnableGitClick( wxCommandEvent& event ) override;
};
+55 -87
View File
@@ -1,13 +1,10 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/std_bitmap_button.h"
#include "widgets/wx_grid.h"
#include "panel_git_repos_base.h"
///////////////////////////////////////////////////////////////////////////
@@ -20,9 +17,57 @@ 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|wxLEFT|wxRIGHT|wxTOP, 13 );
m_gitSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerUpdate;
bSizerUpdate = new wxBoxSizer( wxVERTICAL );
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Remote Tracking"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 );
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 | wxALL, 5 );
wxGridBagSizer* gbUpdate;
gbUpdate = new wxGridBagSizer( 4, 5 );
gbUpdate->SetFlexibleDirection( wxBOTH );
gbUpdate->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
gbUpdate->SetEmptyCellSize( wxSize( -1,2 ) );
m_updateLabel = new wxStaticText( this, wxID_ANY, _("Update interval:"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateLabel->Wrap( -1 );
gbUpdate->Add( m_updateLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_updateInterval = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 60, 5 );
m_updateInterval->SetToolTip( _("Number of minutes between remote update checks. Zero disables automatic checks.") );
gbUpdate->Add( m_updateInterval, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_staticText7 = new wxStaticText( this, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
gbUpdate->Add( m_staticText7, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
gbUpdate->AddGrowableCol( 2 );
bSizerUpdate->Add( gbUpdate, 0, wxEXPAND|wxLEFT, 13 );
m_gitSizer->Add( bSizerUpdate, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerCommitData;
bSizerCommitData = new wxBoxSizer( wxVERTICAL );
m_staticText12 = new wxStaticText( this, wxID_ANY, _("Git Commit Data"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
bLeftSizer->Add( m_staticText12, 0, wxEXPAND|wxLEFT|wxTOP, 10 );
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 | wxALL, 5 );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 );
@@ -60,84 +105,13 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
fgSizer1->Add( m_authorEmail, 0, wxALL|wxEXPAND, 5 );
bLeftSizer->Add( fgSizer1, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 13 );
m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bLeftSizer->Add( m_staticline3, 0, wxEXPAND|wxBOTTOM, 5 );
m_staticText20 = new wxStaticText( this, wxID_ANY, _("Git Repositories"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText20->Wrap( -1 );
bLeftSizer->Add( m_staticText20, 0, wxEXPAND|wxLEFT|wxRIGHT, 13 );
wxBoxSizer* bAntialiasingSizer;
bAntialiasingSizer = new wxBoxSizer( wxVERTICAL );
m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxSize( 820,200 ), 0 );
// Grid
m_grid->CreateGrid( 0, 10 );
m_grid->EnableEditing( false );
m_grid->EnableGridLines( true );
m_grid->EnableDragGridSize( false );
m_grid->SetMargins( 0, 0 );
// Columns
m_grid->SetColSize( 0, 60 );
m_grid->SetColSize( 1, 200 );
m_grid->SetColSize( 2, 500 );
m_grid->SetColSize( 3, 60 );
m_grid->SetColSize( 4, 0 );
m_grid->SetColSize( 5, 0 );
m_grid->SetColSize( 6, 0 );
m_grid->SetColSize( 7, 0 );
m_grid->SetColSize( 8, 0 );
m_grid->SetColSize( 9, 0 );
m_grid->EnableDragColMove( false );
m_grid->EnableDragColSize( true );
m_grid->SetColLabelValue( 0, _("Active") );
m_grid->SetColLabelValue( 1, _("Name") );
m_grid->SetColLabelValue( 2, _("Path") );
m_grid->SetColLabelValue( 3, _("Status") );
m_grid->SetColLabelSize( 22 );
m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
m_grid->EnableDragRowSize( true );
m_grid->SetRowLabelSize( 0 );
m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Label Appearance
// Cell Defaults
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
bAntialiasingSizer->Add( m_grid, 5, wxALL|wxEXPAND, 5 );
bSizerCommitData->Add( fgSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT, 8 );
bLeftSizer->Add( bAntialiasingSizer, 0, wxEXPAND|wxLEFT|wxTOP, 5 );
wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
m_btnAddRepo = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_btnAddRepo->SetToolTip( _("Add new repository") );
bButtonsSizer->Add( m_btnAddRepo, 0, wxALL, 5 );
m_btnEditRepo = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_btnEditRepo->SetToolTip( _("Edit repository properties") );
bButtonsSizer->Add( m_btnEditRepo, 0, wxALL, 5 );
m_gitSizer->Add( bSizerCommitData, 1, wxEXPAND, 5 );
bButtonsSizer->Add( 0, 0, 1, wxEXPAND, 5 );
m_btnDelete = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_btnDelete->SetToolTip( _("Remove Git Repository") );
bButtonsSizer->Add( m_btnDelete, 0, wxBOTTOM|wxRIGHT|wxTOP, 5 );
bLeftSizer->Add( bButtonsSizer, 1, wxALL|wxEXPAND, 5 );
bLeftSizer->Add( m_gitSizer, 0, wxEXPAND, 0 );
bPanelSizer->Add( bLeftSizer, 0, wxRIGHT, 20 );
@@ -148,20 +122,14 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
bPanelSizer->Fit( this );
// Connect Events
m_enableGit->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onEnableGitClick ), NULL, this );
m_cbDefault->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onDefaultClick ), NULL, this );
m_grid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( PANEL_GIT_REPOS_BASE::onGridDClick ), NULL, this );
m_btnAddRepo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onAddClick ), NULL, this );
m_btnEditRepo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onEditClick ), NULL, this );
m_btnDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onDeleteClick ), NULL, this );
}
PANEL_GIT_REPOS_BASE::~PANEL_GIT_REPOS_BASE()
{
// Disconnect Events
m_enableGit->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onEnableGitClick ), NULL, this );
m_cbDefault->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onDefaultClick ), NULL, this );
m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( PANEL_GIT_REPOS_BASE::onGridDClick ), NULL, this );
m_btnAddRepo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onAddClick ), NULL, this );
m_btnEditRepo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onEditClick ), NULL, this );
m_btnDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_GIT_REPOS_BASE::onDeleteClick ), NULL, this );
}
+16 -24
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -10,26 +10,19 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class STD_BITMAP_BUTTON;
class WX_GRID;
#include "widgets/resettable_panel.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/checkbox.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/statline.h>
#include <wx/grid.h>
#include <wx/bmpbuttn.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/spinctrl.h>
#include <wx/gbsizer.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
@@ -42,25 +35,24 @@ class PANEL_GIT_REPOS_BASE : public RESETTABLE_PANEL
private:
protected:
wxCheckBox* m_enableGit;
wxBoxSizer* m_gitSizer;
wxStaticText* m_staticText6;
wxStaticLine* m_staticline2;
wxStaticText* m_updateLabel;
wxSpinCtrl* m_updateInterval;
wxStaticText* m_staticText7;
wxStaticText* m_staticText12;
wxStaticLine* m_staticline31;
wxCheckBox* m_cbDefault;
wxStaticText* m_authorLabel;
wxTextCtrl* m_author;
wxStaticText* m_authorEmailLabel;
wxTextCtrl* m_authorEmail;
wxStaticLine* m_staticline3;
wxStaticText* m_staticText20;
WX_GRID* m_grid;
STD_BITMAP_BUTTON* m_btnAddRepo;
STD_BITMAP_BUTTON* m_btnEditRepo;
STD_BITMAP_BUTTON* m_btnDelete;
// Virtual event handlers, override them in your derived class
virtual void onEnableGitClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onDefaultClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onGridDClick( wxGridEvent& event ) { event.Skip(); }
virtual void onAddClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onEditClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onDeleteClick( wxCommandEvent& event ) { event.Skip(); }
public:
File diff suppressed because it is too large Load Diff
@@ -633,6 +633,44 @@ bool PANEL_DESIGN_BLOCK_LIB_TABLE::verifyTables()
}
}
for( DESIGN_BLOCK_LIB_TABLE* table : { global_model(), project_model() } )
{
if( !table )
continue;
for( unsigned int r = 0; r < table->GetCount(); ++r )
{
DESIGN_BLOCK_LIB_TABLE_ROW& row = dynamic_cast<DESIGN_BLOCK_LIB_TABLE_ROW&>( table->At( r ) );
// Newly-added rows won't have set this yet
row.SetParent( table );
if( !row.GetIsEnabled() )
continue;
try
{
if( row.Refresh() )
{
if( table == global_model() )
m_parent->m_GlobalTableChanged = true;
else
m_parent->m_ProjectTableChanged = true;
}
}
catch( const IO_ERROR& ioe )
{
msg.Printf( _( "Design block library '%s' failed to load." ), row.GetNickName() );
wxWindow* topLevelParent = wxGetTopLevelParent( this );
wxMessageDialog errdlg( topLevelParent, msg + wxS( "\n" ) + ioe.What(), _( "Error Loading Library" ) );
errdlg.ShowModal();
return true;
}
}
}
return true;
}
@@ -1214,7 +1252,7 @@ void InvokeEditDesignBlockLibTable( KIWAY* aKiway, wxWindow *aParent )
std::string payload = "";
aKiway->ExpressMail( FRAME_SCH, MAIL_RELOAD_LIB, payload );
aKiway->ExpressMail( FRAME_SCH_VIEWER, MAIL_RELOAD_LIB, payload );
aKiway->ExpressMail( FRAME_PCB_EDITOR, MAIL_RELOAD_LIB, payload );
return;
}
+9 -4
View File
@@ -36,6 +36,7 @@
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/menu.h>
#include <wx/wfstream.h>
/* ---------- GRID_TRICKS for embedded files grid ---------- */
@@ -317,7 +318,7 @@ void PANEL_EMBEDDED_FILES::onAddEmbeddedFiles( wxCommandEvent& event )
{
// TODO: Update strings to reflect that multiple files can be selected.
wxFileDialog fileDialog( this, _( "Select a file to embed" ), wxEmptyString, wxEmptyString,
_( "All files|*.*" ),
_( "All Files" ) + wxT( " (*.*)|*.*" ),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE );
if( fileDialog.ShowModal() == wxID_OK )
@@ -445,9 +446,10 @@ void PANEL_EMBEDDED_FILES::onExportFiles( wxCommandEvent& event )
if( skip_file )
continue;
wxFFile ffile( fileName.GetFullPath(), wxT( "w" ) );
if( !ffile.IsOpened() )
wxFFileOutputStream out( fileName.GetFullPath() );
if( !out.IsOk() )
{
wxString msg = wxString::Format( _( "Failed to open file '%s'." ),
fileName.GetFullName() );
@@ -457,12 +459,15 @@ void PANEL_EMBEDDED_FILES::onExportFiles( wxCommandEvent& event )
continue;
}
if( !ffile.Write( file->decompressedData.data(), file->decompressedData.size() ) )
out.Write( file->decompressedData.data(), file->decompressedData.size() );
if( !out.IsOk() || ( out.LastWrite() != file->decompressedData.size() ) )
{
wxString msg = wxString::Format( _( "Failed to write file '%s'." ),
fileName.GetFullName() );
KIDIALOG errorDlg( m_parent, msg, _( "Error" ), wxOK | wxICON_ERROR );
errorDlg.ShowModal();
}
}

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