Compare commits

...

397 Commits

Author SHA1 Message Date
Wayne Stambaugh 761bfcd291 Tag stable version 8.0.4. 2024-07-16 14:39:53 -04:00
Seth Hillbrand 7663928a66 Update translations 2024-07-16 11:00:39 -07:00
boromyr dd3c846f4a Translated using Weblate (Italian)
Currently translated at 99.9% (9191 of 9194 strings)

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

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

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

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

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

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

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

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

From master branch.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


(cherry picked from commit e5a5b59ac1)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Issue was introduced in d939004bbd

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


(cherry picked from commit f6994702aa)

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

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

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

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


(cherry picked from commit acec5552c0)

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

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

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

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

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

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

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

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

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

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

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

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

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

Cherry-picked from 0826c10a20

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

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

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

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

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

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

This reverts commit 616510aca2.

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

From master branch.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Clean up created line segments when operation is cancelled.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Also removes some comments which were no longer accurate.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


(cherry picked from commit 5b3b0ff836)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Translated using Weblate (Finnish)

Currently translated at 99.7% (9148 of 9171 strings)

Translated using Weblate (Swedish)

Currently translated at 99.9% (9168 of 9171 strings)

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

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

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

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

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

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

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

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

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

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


(cherry picked from commit 90ee5e097a)

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


(cherry picked from commit 7a3db2d176)

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

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


(cherry picked from commit aaf3142e9a)

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


(cherry picked from commit 4f3117aea0)

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


(cherry picked from commit f8c8dcde13)

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

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

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

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

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

Also implements proper threadlocking for the cache.

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

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

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

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

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

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

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

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

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

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

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


(cherry picked from commit 2836025402)

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

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

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

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

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

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

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

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

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

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

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

(cherry picked from commit 03459723b3)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


(cherry picked from commit 030a251090)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
2024-05-03 01:39:50 +00:00
Alex Shvartzkop 451cb7a194 Fix warnings. 2024-05-03 00:09:24 +03:00
Alex Shvartzkop 17175fe71e EasyEDA Std/Pro: import (some) component metadata for symbols.
Also fixes Reference numbering.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17806
2024-05-03 00:05:39 +03:00
Seth Hillbrand f8b02f99dd Keep FP chooser on top of KiCad but not system
We don't need to float the window over other programs, so setting to
parental floating keeps it focused just the right amount

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

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

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

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

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

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

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


(cherry picked from commit aaf776db9e)

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

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

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

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

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

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

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

The destructor of PGM_BASE is sufficient allowance of lifetime.

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


(cherry picked from commit 9ffa5db667)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


(cherry picked from commit 60d5780c1c)

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

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


(cherry picked from commit e26778c599)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2024-04-27 17:26:57 +00:00
Wayne Stambaugh 2ca07b47af Begin version 8.0.3 development. 2024-04-27 13:10:22 -04:00
737 changed files with 135152 additions and 99349 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ build_doxygen_docker:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_JOB_NAME == "doxygen"
tags:
- docker
- gitlab-org-docker
before_script:
- docker info
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
+1 -19
View File
@@ -15,25 +15,7 @@ macos_build:
- cd build/macos
- cmake
-G Ninja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DDEFAULT_INSTALL_PATH=/Library/Application\ Support /kicad
-DOCC_INCLUDE_DIR=/opt/homebrew/Cellar/opencascade/7.7.2_2/include/opencascade
-DOCC_LIBRARY_DIR=/opt/homebrew/Cellar/opencascade/7.7.2_2/Lib
-DCMAKE_INSTALL_PREFIX=/Users/ci/kicad-mac-builder/build/kicad-dest
-DCMAKE_C_COMPILER=/usr/bin/clang
-DCMAKE_CXX_COMPILER=/usr/bin/clang++
-DwxWidgets_CONFIG_EXECUTABLE=/Users/ci/kicad-mac-builder/build/wxwidgets-dest/bin/wx-config
-DKICAD_BUILD_I18N=ON
-DKICAD_SCRIPTING_WXPYTHON=ON
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON
-DPYTHON_EXECUTABLE=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/bin/python3
-DPYTHON_INCLUDE_DIR=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/include/python3.9/
-DPYTHON_LIBRARY=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/lib/libpython3.9.dylib
-DPYTHON_SITE_PACKAGE_PATH=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework/Versions/Current/lib/python3.9/site-packages
-DPYTHON_FRAMEWORK=/Users/ci/kicad-mac-builder/build/python-dest/Library/Frameworks/Python.framework
-DNGSPICE_INCLUDE_DIR=/Users/ci/kicad-mac-builder/build/ngspice-dest/include
-DNGSPICE_LIBRARY=/Users/ci/kicad-mac-builder/build/ngspice-dest/lib/libngspice.dylib
-DKICAD_USE_3DCONNEXION=ON
-DCMAKE_TOOLCHAIN_FILE=/Users/ci/kicad-mac-builder/toolchain/kicad-mac-builder.cmake
../../
- cmake --build . 2>&1 | tee compilation_log.txt
- cd ../../
+2
View File
@@ -708,6 +708,8 @@ void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
for( const auto& [ layer, color ] : aColors )
settings->SetColor( layer, color );
Pgm().GetSettingsManager().SaveColorSettings( settings, "3d_viewer" );
}
+4
View File
@@ -33,6 +33,7 @@
#include <3d_rendering/opengl/render_3d_opengl.h>
#include <3d_viewer_id.h>
#include <advanced_config.h>
#include <build_version.h>
#include <board.h>
#include <reporter.h>
#include <gal/opengl/gl_context_mgr.h>
@@ -229,6 +230,9 @@ bool EDA_3D_CANVAS::initializeOpenGL()
From_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
}
SetOpenGLInfo( (const char*) glGetString( GL_VENDOR ), (const char*) glGetString( GL_RENDERER ),
(const char*) glGetString( GL_VERSION ) );
wxString version = From_UTF8( (char *) glGetString( GL_VERSION ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::%s OpenGL version string %s." ),
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -35,6 +35,7 @@
#include "../3d_cache/3d_cache.h"
#include <wx/dcclient.h>
#include <base_units.h>
#include <build_version.h>
#include <gal/opengl/gl_context_mgr.h>
#include <settings/common_settings.h>
#include <pgm_base.h>
@@ -102,11 +103,6 @@ EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribL
m_BiuTo3dUnits = 1.0;
m_glRC = nullptr;
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
SetScaleFactor( dpi.GetScaleFactor() );
}
@@ -200,6 +196,9 @@ void EDA_3D_MODEL_VIEWER::ogl_initialize()
From_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
}
SetOpenGLInfo( (const char*) glGetString( GL_VENDOR ), (const char*) glGetString( GL_RENDERER ),
(const char*) glGetString( GL_VERSION ) );
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
@@ -812,9 +812,6 @@ void EDA_3D_VIEWER_FRAME::loadCommonSettings()
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
m_canvas->SetScaleFactor( dpi.GetScaleFactor() );
// TODO(JE) use all control options
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
}
+24 -11
View File
@@ -210,9 +210,6 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings()
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
const DPI_SCALING_COMMON dpi{ settings, this };
m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
// TODO(JE) use all control options
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
@@ -444,10 +441,15 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementScale( wxSpinEvent& event, double aSign
else if( spinCtrl == m_spinZscale )
textCtrl = zscale;
double step = SCALE_INCREMENT;
if( wxGetMouseState().ShiftDown( ) )
step = SCALE_INCREMENT_FINE;
double curr_value = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::UNSCALED,
textCtrl->GetValue() );
curr_value += ( SCALE_INCREMENT * aSign );
curr_value += ( step * aSign );
curr_value = std::max( 1/MAX_SCALE, curr_value );
curr_value = std::min( curr_value, MAX_SCALE );
@@ -465,10 +467,15 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementRotation( wxSpinEvent& aEvent, double aS
else if( spinCtrl == m_spinZrot )
textCtrl = zrot;
double step = ROTATION_INCREMENT;
if( wxGetMouseState().ShiftDown( ) )
step = ROTATION_INCREMENT_FINE;
double curr_value = EDA_UNIT_UTILS::UI::DoubleValueFromString( unityScale, EDA_UNITS::DEGREES,
textCtrl->GetValue() );
curr_value += ( ROTATION_INCREMENT * aSign );
curr_value += ( step * aSign );
curr_value = std::max( -MAX_ROTATION, curr_value );
curr_value = std::min( curr_value, MAX_ROTATION );
@@ -488,16 +495,22 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign
textCtrl = zoff;
double step_mm = OFFSET_INCREMENT_MM;
double curr_value_mm =
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, m_userUnits,
textCtrl->GetValue() )
/ pcbIUScale.IU_PER_MM;
if( wxGetMouseState().ShiftDown( ) )
step_mm = OFFSET_INCREMENT_MM_FINE;
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
{
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
if( wxGetMouseState().ShiftDown( ) )
step_mm = 25.4*OFFSET_INCREMENT_MIL_FINE/1000;;
}
double curr_value_mm = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, m_userUnits,
textCtrl->GetValue() )
/ pcbIUScale.IU_PER_MM;
curr_value_mm += ( step_mm * aSign );
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
@@ -533,10 +546,10 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelRot( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
double step = ROTATION_INCREMENT_WHEEL;
double step = ROTATION_INCREMENT;
if( event.ShiftDown( ) )
step = ROTATION_INCREMENT_WHEEL_FINE;
step = ROTATION_INCREMENT_FINE;
if( event.GetWheelRotation() >= 0 )
step = -step;
+2 -3
View File
@@ -43,9 +43,8 @@
#define SCALE_INCREMENT_FINE 0.02
#define SCALE_INCREMENT 0.1
#define ROTATION_INCREMENT 90 // in degrees, for spin button command
#define ROTATION_INCREMENT_WHEEL 90 // in degrees, for mouse wheel command
#define ROTATION_INCREMENT_WHEEL_FINE 1 // in degrees, for mouse wheel command
#define ROTATION_INCREMENT 90 // in degrees
#define ROTATION_INCREMENT_FINE 1 // in degrees
#define OFFSET_INCREMENT_MM 0.5
#define OFFSET_INCREMENT_MM_FINE 0.1
+2 -1
View File
@@ -138,7 +138,7 @@ void IMAGE_SIZE::SetUnit( EDA_UNITS aUnit )
}
BEGIN_EVENT_TABLE( BITMAP2CMP_FRAME, EDA_BASE_FRAME )
BEGIN_EVENT_TABLE( BITMAP2CMP_FRAME, KIWAY_PLAYER )
EVT_MENU( wxID_CLOSE, BITMAP2CMP_FRAME::OnExit )
EVT_MENU( wxID_EXIT, BITMAP2CMP_FRAME::OnExit )
@@ -193,6 +193,7 @@ BITMAP2CMP_FRAME::BITMAP2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_toolManager->InitTools();
ReCreateMenuBar();
setupUIConditions();
GetSizer()->SetSizeHints( this );
+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.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.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.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.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 "8.0.2" )
set( KICAD_SEMANTIC_VERSION "8.0.4" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+19
View File
@@ -51,6 +51,19 @@ extern std::string GetCurlLibVersion();
#include <kicad_build_version.h>
#undef INCLUDE_KICAD_VERSION
// Remember OpenGL info
static wxString s_glVendor;
static wxString s_glRenderer;
static wxString s_glVersion;
void SetOpenGLInfo( const char* aVendor, const char* aRenderer, const char* aVersion )
{
s_glVendor = wxString::FromUTF8( aVendor );
s_glRenderer = wxString::FromUTF8( aRenderer );
s_glVersion = wxString::FromUTF8( aVersion );
}
wxString GetPlatformGetBitnessName()
{
wxPlatformInfo platform;
@@ -200,6 +213,12 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
<< ", " << wxGetenv( "XDG_SESSION_TYPE" );
#endif
if( !s_glVendor.empty() || !s_glRenderer.empty() || !s_glVersion.empty() )
{
aMsg << eol;
aMsg << "OpenGL: " << s_glVendor << ", " << s_glRenderer << ", " << s_glVersion;
}
aMsg << eol << eol;
if( !aBrief )
+86 -51
View File
@@ -347,6 +347,24 @@ bool DATABASE_CONNECTION::SelectOne( const std::string& aTable,
return true;
}
}
else
{
wxLogTrace( traceDatabase, wxT( "SelectOne: table `%s` not in row cache; will SelectAll" ),
tableName, aWhere.second );
selectAllAndCache( tableName, aWhere.first );
if( m_cache->Get( tableName, cacheEntry ) )
{
if( cacheEntry.count( aWhere.second ) )
{
wxLogTrace( traceDatabase, wxT( "SelectOne: `%s` with parameter `%s` - cache hit" ),
tableName, aWhere.second );
aResult = cacheEntry.at( aWhere.second );
return true;
}
}
}
if( !m_columnCache.count( tableName ) )
{
@@ -372,15 +390,14 @@ bool DATABASE_CONNECTION::SelectOne( const std::string& aTable,
columnsFor( tableName ),
m_quoteChar, tableName, m_quoteChar,
m_quoteChar, columnName, m_quoteChar );
nanodbc::statement statement( *m_conn );
nanodbc::string query = fromUTF8( queryStr );
PROF_TIMER timer;
nanodbc::statement statement;
try
{
statement.prepare( query );
statement.prepare( *m_conn, query );
statement.bind( 0, aWhere.second.c_str() );
}
catch( nanodbc::database_error& e )
@@ -474,44 +491,14 @@ bool DATABASE_CONNECTION::SelectOne( const std::string& aTable,
}
bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::string& aKey,
std::vector<ROW>& aResults )
bool DATABASE_CONNECTION::selectAllAndCache( const std::string& aTable, const std::string& aKey )
{
if( !m_conn )
{
wxLogTrace( traceDatabase, wxT( "Called SelectAll without valid connection!" ) );
return false;
}
auto tableMapIter = m_tables.find( aTable );
if( tableMapIter == m_tables.end() )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: requested table %s not found in cache" ),
aTable );
return false;
}
DB_CACHE_TYPE::CACHE_VALUE cacheEntry;
if( m_cache->Get( aTable, cacheEntry ) )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` - cache hit" ), aTable );
aResults.reserve( cacheEntry.size() );
for( auto &[ key, row ] : cacheEntry )
aResults.emplace_back( row );
return true;
}
nanodbc::statement statement( *m_conn );
nanodbc::string query = fromUTF8( fmt::format( "SELECT {} FROM {}{}{}", columnsFor( aTable ),
m_quoteChar, aTable, m_quoteChar ) );
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s`" ), toUTF8( query ) );
wxLogTrace( traceDatabase, wxT( "selectAllAndCache: `%s`" ), toUTF8( query ) );
PROF_TIMER timer;
@@ -522,7 +509,8 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
catch( nanodbc::database_error& e )
{
m_lastError = e.what();
wxLogTrace( traceDatabase, wxT( "Exception while preparing query for SelectAll: %s" ),
wxLogTrace( traceDatabase,
wxT( "Exception while preparing query for selectAllAndCache: %s" ),
m_lastError );
// Exception may be due to a connection error; nanodbc won't auto-reconnect
@@ -540,7 +528,8 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
catch( nanodbc::database_error& e )
{
m_lastError = e.what();
wxLogTrace( traceDatabase, wxT( "Exception while executing query for SelectAll: %s" ),
wxLogTrace( traceDatabase,
wxT( "Exception while executing query for selectAllAndCache: %s" ),
m_lastError );
// Exception may be due to a connection error; nanodbc won't auto-reconnect
@@ -551,15 +540,17 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
timer.Stop();
DB_CACHE_TYPE::CACHE_VALUE cacheEntry;
auto handleException =
[&]( std::runtime_error& aException, const std::string& aExtraContext = "" )
{
m_lastError = aException.what();
std::string extra = aExtraContext.empty() ? "" : ": " + aExtraContext;
wxLogTrace( traceDatabase,
wxT( "Exception while parsing result %d from SelectAll: %s%s" ),
aResults.size(), m_lastError, extra );
};
{
m_lastError = aException.what();
std::string extra = aExtraContext.empty() ? "" : ": " + aExtraContext;
wxLogTrace( traceDatabase,
wxT( "Exception while parsing result %d from selectAllAndCache: %s%s" ),
cacheEntry.size(), m_lastError, extra );
};
while( results.next() )
{
@@ -636,20 +627,64 @@ bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::strin
}
}
aResults.emplace_back( std::move( result ) );
wxASSERT( result.count( aKey ) );
std::string keyStr = std::any_cast<std::string>( result.at( aKey ) );
cacheEntry[keyStr] = result;
}
wxLogTrace( traceDatabase, wxT( "SelectAll from %s completed in %0.1f ms" ), aTable,
wxLogTrace( traceDatabase, wxT( "selectAllAndCache from %s completed in %0.1f ms" ), aTable,
timer.msecs() );
for( const ROW& row : aResults )
m_cache->Put( aTable, cacheEntry );
return true;
}
bool DATABASE_CONNECTION::SelectAll( const std::string& aTable, const std::string& aKey,
std::vector<ROW>& aResults )
{
if( !m_conn )
{
wxASSERT( row.count( aKey ) );
std::string keyStr = std::any_cast<std::string>( row.at( aKey ) );
cacheEntry[keyStr] = row;
wxLogTrace( traceDatabase, wxT( "Called SelectAll without valid connection!" ) );
return false;
}
m_cache->Put( aTable, cacheEntry );
auto tableMapIter = m_tables.find( aTable );
if( tableMapIter == m_tables.end() )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: requested table %s not found in cache" ),
aTable );
return false;
}
DB_CACHE_TYPE::CACHE_VALUE cacheEntry;
if( !m_cache->Get( aTable, cacheEntry ) )
{
if( !selectAllAndCache( aTable, aKey ) )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` cache fill failed" ), aTable );
return false;
}
// Now it should be filled
m_cache->Get( aTable, cacheEntry );
}
if( !m_cache->Get( aTable, cacheEntry ) )
{
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` failed to get results from cache!" ),
aTable );
return false;
}
wxLogTrace( traceDatabase, wxT( "SelectAll: `%s` - returning cached results" ), aTable );
aResults.reserve( cacheEntry.size() );
for( auto &[ key, row ] : cacheEntry )
aResults.emplace_back( row );
return true;
}
@@ -43,6 +43,9 @@ void DIALOG_EDIT_LIBRARY_TABLES::InstallPanel( wxPanel* aPanel )
auto mainSizer = new wxBoxSizer( wxVERTICAL );
SetSizer( mainSizer );
m_infoBar = new WX_INFOBAR( this );
mainSizer->Add( m_infoBar, 0, wxEXPAND, 0 );
mainSizer->Add( m_contentPanel, 1, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 5 );
m_contentPanel->SetMinSize( FromDIP( wxSize( 1000, 600 ) ) );
+3 -6
View File
@@ -442,14 +442,11 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
wxString netclass = m_assignmentGrid->GetCellValue( row, 1 );
m_netSettings->m_NetClassPatternAssignments.push_back(
{
std::make_unique<EDA_COMBINED_MATCHER>( pattern, CTX_NETCLASS ),
netclass
} );
m_netSettings->m_NetClassPatternAssignmentCache.clear();
{ std::make_unique<EDA_COMBINED_MATCHER>( pattern, CTX_NETCLASS ), netclass } );
}
m_netSettings->m_NetClassPatternAssignmentCache.clear();
return true;
}
+15 -2
View File
@@ -648,8 +648,21 @@ void EDA_DRAW_PANEL_GAL::onShowTimer( wxTimerEvent& aEvent )
void EDA_DRAW_PANEL_GAL::SetCurrentCursor( KICURSOR aCursor )
{
if( m_gal )
m_gal->SetNativeCursorStyle( aCursor );
if( !m_gal )
return;
DPI_SCALING_COMMON dpi( nullptr, m_parent );
bool hidpi = false;
// Cursor scaling factor cannot be set for a wxCursor on GTK and OSX (at least before wx 3.3),
// resulting in 4x rendered size on 2x window scale.
// MSW renders the bitmap as-is, without scaling, so this works here.
#ifdef __WXMSW__
hidpi = dpi.GetContentScaleFactor() >= 2.0;
#endif
m_gal->SetNativeCursorStyle( aCursor, hidpi );
}
+29
View File
@@ -681,6 +681,35 @@ void DS_DATA_ITEM_TEXT::SetConstrainedTextSize()
if( m_ConstrainedTextSize.y == 0 )
m_ConstrainedTextSize.y = DS_DATA_MODEL::GetTheInstance().m_DefaultTextSize.y;
if( m_BoundingBoxSize.x > 0 || m_BoundingBoxSize.y > 0 )
{
// to know the X and Y size of the line, we should use EDA_TEXT::GetTextBox()
// but this function uses integers
// So, to avoid truncations with our unit in mm, use microns.
VECTOR2I size_micron;
#define FSCALE 1000.0
int linewidth = 0;
size_micron.x = KiROUND( m_ConstrainedTextSize.x * FSCALE );
size_micron.y = KiROUND( m_ConstrainedTextSize.y * FSCALE );
DS_DRAW_ITEM_TEXT dummy( unityScale, this, 0, m_FullText, VECTOR2I( 0, 0 ), size_micron,
linewidth, m_Font, m_Italic, m_Bold, m_TextColor );
dummy.SetMultilineAllowed( true );
dummy.SetHorizJustify( m_Hjustify ) ;
dummy.SetVertJustify( m_Vjustify );
dummy.SetTextAngle( EDA_ANGLE( m_Orient, DEGREES_T ) );
BOX2I rect = dummy.GetTextBox();
VECTOR2D size;
size.x = KiROUND( (int) rect.GetWidth() / FSCALE );
size.y = KiROUND( (int) rect.GetHeight() / FSCALE );
if( m_BoundingBoxSize.x > 0 && size.x > m_BoundingBoxSize.x )
m_ConstrainedTextSize.x *= m_BoundingBoxSize.x / size.x;
if( m_BoundingBoxSize.y > 0 && size.y > m_BoundingBoxSize.y )
m_ConstrainedTextSize.y *= m_BoundingBoxSize.y / size.y;
}
}
+2 -2
View File
@@ -1991,13 +1991,13 @@ static struct EDA_SHAPE_DESC
.SetAvailableFunc( isNotPolygonOrCircle );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Center X" ),
&EDA_SHAPE::SetStartX, &EDA_SHAPE::GetStartX, PROPERTY_DISPLAY::PT_COORD,
&EDA_SHAPE::SetCenterX, &EDA_SHAPE::GetStartX, PROPERTY_DISPLAY::PT_COORD,
ORIGIN_TRANSFORMS::ABS_X_COORD ),
shapeProps )
.SetAvailableFunc( isCircle );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Center Y" ),
&EDA_SHAPE::SetStartY, &EDA_SHAPE::GetStartY, PROPERTY_DISPLAY::PT_COORD,
&EDA_SHAPE::SetCenterY, &EDA_SHAPE::GetStartY, PROPERTY_DISPLAY::PT_COORD,
ORIGIN_TRANSFORMS::ABS_Y_COORD ),
shapeProps )
.SetAvailableFunc( isCircle );
+5 -1
View File
@@ -528,10 +528,13 @@ EDA_TEXT::GetRenderCache( const KIFONT::FONT* aFont, const wxString& forResolved
}
void EDA_TEXT::SetupRenderCache( const wxString& aResolvedText, const EDA_ANGLE& aAngle )
void EDA_TEXT::SetupRenderCache( const wxString& aResolvedText, const KIFONT::FONT* aFont,
const EDA_ANGLE& aAngle, const VECTOR2I& aOffset )
{
m_render_cache_text = aResolvedText;
m_render_cache_font = aFont;
m_render_cache_angle = aAngle;
m_render_cache_offset = aOffset;
m_render_cache.clear();
}
@@ -539,6 +542,7 @@ void EDA_TEXT::SetupRenderCache( const wxString& aResolvedText, const EDA_ANGLE&
void EDA_TEXT::AddRenderCacheGlyph( const SHAPE_POLY_SET& aPoly )
{
m_render_cache.emplace_back( std::make_unique<KIFONT::OUTLINE_GLYPH>( aPoly ) );
static_cast<KIFONT::OUTLINE_GLYPH*>( m_render_cache.back().get() )->CacheTriangulation();
}
+14 -2
View File
@@ -26,6 +26,7 @@
#include <string_utils.h>
#include <macros.h>
#include <cstdint>
#include <reporter.h>
#ifdef __WIN32__
#define WIN32_LEAN_AND_MEAN
@@ -37,6 +38,8 @@ using namespace fontconfig;
static FONTCONFIG* g_config = nullptr;
static bool g_fcInitSuccess = false;
REPORTER* FONTCONFIG::s_reporter = nullptr;
/**
* A simple wrapper to avoid exporing fontconfig in the header
*/
@@ -57,6 +60,12 @@ FONTCONFIG::FONTCONFIG()
};
void fontconfig::FONTCONFIG::SetReporter( REPORTER* aReporter )
{
s_reporter = aReporter;
}
/**
* This is simply a wrapper to call FcInit() with SEH for Windows
* SEH on Windows can only be used in functions without objects that might be unwinded
@@ -317,12 +326,15 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
if( retval == FF_RESULT::FF_ERROR )
{
wxLogWarning( _( "Error loading font '%s'." ), qualifiedFontName );
if( s_reporter )
s_reporter->Report( wxString::Format( _( "Error loading font '%s'." ), qualifiedFontName ) );
}
else if( retval == FF_RESULT::FF_SUBSTITUTE )
{
fontName.Replace( ':', ' ' );
wxLogWarning( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName );
if( s_reporter )
s_reporter->Report( wxString::Format( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName ) );
}
FcPatternDestroy( pat );
+4 -2
View File
@@ -259,6 +259,7 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphs( BOX2I* aBBox, std::vector<std::unique_pt
struct GLYPH_CACHE_KEY {
FT_Face face;
hb_codepoint_t codepoint;
double scaler;
bool fakeItalic;
bool fakeBold;
bool mirror;
@@ -266,7 +267,7 @@ struct GLYPH_CACHE_KEY {
bool operator==(const GLYPH_CACHE_KEY& rhs ) const
{
return face == rhs.face && codepoint == rhs.codepoint
return face == rhs.face && codepoint == rhs.codepoint && scaler == rhs.scaler
&& fakeItalic == rhs.fakeItalic && fakeBold == rhs.fakeBold
&& mirror == rhs.mirror && angle == rhs.angle;
}
@@ -280,6 +281,7 @@ namespace std
std::size_t operator()( const GLYPH_CACHE_KEY& k ) const
{
return hash<const void*>()( k.face ) ^ hash<unsigned>()( k.codepoint )
^ hash<double>()( k.scaler )
^ hash<int>()( k.fakeItalic ) ^ hash<int>()( k.fakeBold )
^ hash<int>()( k.mirror ) ^ hash<int>()( k.angle.AsTenthsOfADegree() );
}
@@ -339,7 +341,7 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox,
if( aGlyphs )
{
GLYPH_CACHE_KEY key = { face, glyphInfo[i].codepoint, m_fakeItal, m_fakeBold,
GLYPH_CACHE_KEY key = { face, glyphInfo[i].codepoint, scaler, m_fakeItal, m_fakeBold,
aMirror, aAngle };
GLYPH_DATA& glyphData = s_glyphCache[ key ];
+19 -17
View File
@@ -190,7 +190,7 @@ static double roundp( double x )
const VECTOR2D CAIRO_GAL_BASE::roundp( const VECTOR2D& v )
{
if( m_lineWidthIsOdd && m_isStrokeEnabled )
if( m_lineWidthIsOdd )
return VECTOR2D( ::roundp( v.x ), ::roundp( v.y ) );
else
return VECTOR2D( floor( v.x + 0.5 ), floor( v.y + 0.5 ) );
@@ -352,13 +352,18 @@ void CAIRO_GAL_BASE::DrawArc( const VECTOR2D& aCenterPoint, double aRadius,
double r = xform( aRadius );
// N.B. This is backwards. We set this because we want to adjust the center
// point that changes both endpoints. In the worst case, this is twice as far.
// We cannot adjust radius or center based on the other because this causes the
// whole arc to change position/size
m_lineWidthIsOdd = !( static_cast<int>( aRadius ) % 2 );
// Adjust center and radius slightly to better match the rounding of endpoints.
VECTOR2D mid = roundp( xform( aCenterPoint ) );
auto mid = roundp( xform( aCenterPoint ) );
VECTOR2D startPointS = VECTOR2D( r, 0.0 );
VECTOR2D endPointS = VECTOR2D( r, 0.0 );
RotatePoint( startPointS, -EDA_ANGLE( startAngle, RADIANS_T ) );
RotatePoint( endPointS, -EDA_ANGLE( endAngle, RADIANS_T ) );
VECTOR2D refStart = roundp( xform( aCenterPoint ) + startPointS );
VECTOR2D refEnd = roundp( xform( aCenterPoint ) + endPointS );
r = ( ( refStart - mid ).EuclideanNorm() + ( refEnd - mid ).EuclideanNorm() ) / 2.0;
cairo_set_line_width( m_currentContext, m_lineWidthInPixels );
cairo_new_sub_path( m_currentContext );
@@ -403,13 +408,7 @@ void CAIRO_GAL_BASE::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadiu
double r = xform( aRadius );
// N.B. This is backwards. We set this because we want to adjust the center
// point that changes both endpoints. In the worst case, this is twice as far.
// We cannot adjust radius or center based on the other because this causes the
// whole arc to change position/size
m_lineWidthIsOdd = !( static_cast<int>( aRadius ) % 2 );
VECTOR2D mid = roundp( xform( aCenterPoint ) );
VECTOR2D mid = xform( aCenterPoint );
double width = xform( aWidth / 2.0 );
VECTOR2D startPointS = VECTOR2D( r, 0.0 );
VECTOR2D endPointS = VECTOR2D( r, 0.0 );
@@ -1672,13 +1671,16 @@ bool CAIRO_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
}
bool CAIRO_GAL::SetNativeCursorStyle( KICURSOR aCursor )
bool CAIRO_GAL::SetNativeCursorStyle( KICURSOR aCursor, bool aHiDPI )
{
// Store the current cursor type and get the wxCursor for it
if( !GAL::SetNativeCursorStyle( aCursor ) )
if( !GAL::SetNativeCursorStyle( aCursor, aHiDPI ) )
return false;
m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
if( aHiDPI )
m_currentwxCursor = CURSOR_STORE::GetHiDPICursor( m_currentNativeCursor );
else
m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
// Update the cursor in the wx control
wxWindow::SetCursor( m_currentwxCursor );
+259 -51
View File
@@ -44,85 +44,76 @@
#include <cursors/cursor-subtract.xpm>
#include <cursors/cursor-text.xpm>
#include <cursors/cursor-xor.xpm>
#include <cursors/cursor-zoom.xpm>
#include <cursors/cursor-zoom-in.xpm>
#include <cursors/cursor-zoom-out.xpm>
#include <cursors/cursor_tune.xpm>
#include <cursors/voltage_probe.xpm>
#include <cursors/current_probe.xpm>
// HiDPI cursor files
#include <cursors/cursor-add64.xpm>
#include <cursors/cursor-component64.xpm>
#include <cursors/cursor-eraser64.xpm>
#include <cursors/cursor-label-global64.xpm>
#include <cursors/cursor-label-hier64.xpm>
#include <cursors/cursor-label-net64.xpm>
#include <cursors/cursor-line-bus64.xpm>
#include <cursors/cursor-line-graphic64.xpm>
#include <cursors/cursor-line-wire64.xpm>
#include <cursors/cursor-line-wire-add64.xpm>
#include <cursors/cursor-measure64.xpm>
#include <cursors/cursor-pencil64.xpm>
#include <cursors/cursor-select-lasso64.xpm>
#include <cursors/cursor-select-window64.xpm>
#include <cursors/cursor-subtract64.xpm>
#include <cursors/cursor-text64.xpm>
#include <cursors/cursor-xor64.xpm>
#include <cursors/cursor-zoom-in64.xpm>
#include <cursors/cursor-zoom-out64.xpm>
#include <cursors/cursor_tune64.xpm>
#include <cursors/voltage_probe64.xpm>
#include <cursors/current_probe64.xpm>
// Under MSW, the standard cursor is white on black. Elsewhere it is black on white
#ifdef __WINDOWS__
#include <cursors/cursor-place.xpm>
#include <cursors/cursor-place64.xpm>
#include <cursors/cursor-select-m.xpm>
#include <cursors/cursor-select-m64.xpm>
#else
#include <cursors/cursor-place-black.xpm>
#include <cursors/cursor-place-black64.xpm>
#include <cursors/cursor-select-m-black.xpm>
#include <cursors/cursor-select-m-black64.xpm>
#endif
#include <wx/bitmap.h>
#include <wx/debug.h>
static const unsigned char voltage_probe[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00,
0x00, 0x30, 0x06, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x0e, 0x08, 0x00, 0x80, 0x07, 0x08, 0x00,
0xc0, 0x07, 0x18, 0x00, 0xe0, 0x07, 0x30, 0x00, 0xf0, 0x03, 0x60, 0x00, 0xf8, 0x01, 0x00, 0x00,
0xfc, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0xc0,
0x0f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf0,
0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const unsigned char current_probe[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x60, 0x06, 0x00,
0x00, 0x30, 0x0c, 0x00, 0x00, 0x1c, 0x08, 0x00, 0x00, 0x0f, 0x08, 0x00, 0x80, 0x0f, 0x18, 0x00,
0xc0, 0x0f, 0x30, 0x80, 0xe1, 0x07, 0x60, 0x80, 0xf1, 0x03, 0x00, 0x80, 0xf9, 0x01, 0x00, 0x80,
0xfd, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0xc0,
0x0f, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x83,
0x01, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xfc,
0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00 };
static const unsigned char cursor_tune[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xc0, 0x0f, 0x00,
0x00, 0xe0, 0x1f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xfc, 0x07, 0x00,
0x00, 0xfe, 0x03, 0x00, 0x00, 0xff, 0x01, 0x00, 0x80, 0xff, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00,
0xe0, 0x3f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00,
0xfc, 0x03, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x50,
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0a,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 };
static const unsigned char cursor_tune_mask[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xc0, 0x0f,
0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xfc, 0x07,
0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xff, 0x01, 0x00, 0x80, 0xff, 0x00, 0x00, 0xc0, 0x7f, 0x00,
0x00, 0xe0, 0x3f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x07, 0x00,
0x00, 0xfc, 0x03, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
0x70, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 };
static const std::vector<CURSOR_STORE::CURSOR_DEF> standard_cursors = {
{
KICURSOR::VOLTAGE_PROBE,
voltage_probe,
voltage_probe,
nullptr,
nullptr,
voltage_probe_xpm,
{ 32, 32 },
{ 1, 31 },
},
{
KICURSOR::CURRENT_PROBE,
current_probe,
current_probe,
nullptr,
nullptr,
current_probe_xpm,
{ 32, 32 },
{ 4, 27 },
},
{
KICURSOR::TUNE,
cursor_tune,
cursor_tune_mask,
nullptr,
nullptr,
cursor_tune_xpm,
{ 32, 32 },
{ 1, 30 },
},
@@ -198,7 +189,7 @@ static const std::vector<CURSOR_STORE::CURSOR_DEF> standard_cursors = {
KICURSOR::ZOOM_IN,
nullptr,
nullptr,
cursor_zoom_xpm,
cursor_zoom_in_xpm,
{ 32, 32 },
{ 6, 6 },
},
@@ -305,6 +296,209 @@ static const std::vector<CURSOR_STORE::CURSOR_DEF> standard_cursors = {
};
static const std::vector<CURSOR_STORE::CURSOR_DEF> hidpi_cursors = {
{
KICURSOR::VOLTAGE_PROBE,
nullptr,
nullptr,
voltage_probe64_xpm,
{ 64, 64 },
{ 1, 62 },
},
{
KICURSOR::CURRENT_PROBE,
nullptr,
nullptr,
current_probe64_xpm,
{ 64, 64 },
{ 8, 54 },
},
{
KICURSOR::TUNE,
nullptr,
nullptr,
cursor_tune64_xpm,
{ 64, 64 },
{ 2, 60 },
},
{
KICURSOR::PENCIL,
nullptr,
nullptr,
cursor_pencil64_xpm,
{ 64, 64 },
{ 8, 54 },
},
{
KICURSOR::MOVING,
nullptr,
nullptr,
#ifdef __WINDOWS__
cursor_select_m64_xpm,
#else
cursor_select_m_black64_xpm,
#endif
{ 64, 64 },
{ 2, 2 },
},
{
KICURSOR::REMOVE,
nullptr,
nullptr,
cursor_eraser64_xpm,
{ 64, 64 },
{ 8, 8 },
},
{
KICURSOR::TEXT,
nullptr,
nullptr,
cursor_text64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::MEASURE,
nullptr,
nullptr,
cursor_measure64_xpm,
{ 64, 64 },
{ 8, 8 },
},
{
KICURSOR::ADD,
nullptr,
nullptr,
cursor_add64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::SUBTRACT,
nullptr,
nullptr,
cursor_subtract64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::XOR,
nullptr,
nullptr,
cursor_xor64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::ZOOM_IN,
nullptr,
nullptr,
cursor_zoom_in64_xpm,
{ 64, 64 },
{ 12, 12 },
},
{
KICURSOR::ZOOM_OUT,
nullptr,
nullptr,
cursor_zoom_out64_xpm,
{ 64, 64 },
{ 12, 12 },
},
{
KICURSOR::LABEL_NET,
nullptr,
nullptr,
cursor_label_net64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::LABEL_GLOBAL,
nullptr,
nullptr,
cursor_label_global64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::COMPONENT,
nullptr,
nullptr,
cursor_component64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::SELECT_LASSO,
nullptr,
nullptr,
cursor_select_lasso64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::SELECT_WINDOW,
nullptr,
nullptr,
cursor_select_window64_xpm,
{ 64, 64 },
{ 14, 20 },
},
{
KICURSOR::LINE_BUS,
nullptr,
nullptr,
cursor_line_bus64_xpm,
{ 64, 64 },
{ 10, 52 },
},
{
KICURSOR::LINE_WIRE,
nullptr,
nullptr,
cursor_line_wire64_xpm,
{ 64, 64 },
{ 10, 52 },
},
{
KICURSOR::LINE_WIRE_ADD,
nullptr,
nullptr,
cursor_line_wire_add64_xpm,
{ 64, 64 },
{ 10, 52 },
},
{
KICURSOR::LINE_GRAPHIC,
nullptr,
nullptr,
cursor_line_graphic64_xpm,
{ 64, 64 },
{ 10, 52 },
},
{
KICURSOR::LABEL_HIER,
nullptr,
nullptr,
cursor_label_hier64_xpm,
{ 64, 64 },
{ 14, 14 },
},
{
KICURSOR::PLACE,
nullptr,
nullptr,
#ifdef __WINDOWS__
cursor_place64_xpm,
#else
cursor_place_black64_xpm,
#endif
{ 64, 64 },
{ 2, 2 },
},
};
/**
* Construct a cursor for the given definition.
*
@@ -393,8 +587,8 @@ const wxCursor& CURSOR_STORE::Get( KICURSOR aIdKey ) const
const wxCursor CURSOR_STORE::GetCursor( KICURSOR aCursorType )
{
wxStockCursor stock =
GetStockCursor( aCursorType );
wxStockCursor stock = GetStockCursor( aCursorType );
if( stock != wxCURSOR_MAX )
{
return wxCursor( stock );
@@ -405,6 +599,20 @@ const wxCursor CURSOR_STORE::GetCursor( KICURSOR aCursorType )
}
const wxCursor CURSOR_STORE::GetHiDPICursor( KICURSOR aCursorType )
{
wxStockCursor stock = GetStockCursor( aCursorType );
if( stock != wxCURSOR_MAX )
{
return wxCursor( stock );
}
static CURSOR_STORE store( hidpi_cursors );
return store.Get( aCursorType );
}
wxStockCursor CURSOR_STORE::GetStockCursor( KICURSOR aCursorType )
{
wxStockCursor stockCursor;
+2 -2
View File
@@ -81,7 +81,7 @@ GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) :
SetCursorEnabled( false );
// Initialize the native widget to an arrow cursor
SetNativeCursorStyle( KICURSOR::ARROW );
SetNativeCursorStyle( KICURSOR::ARROW, false );
// Initialize text properties
ResetTextAttributes();
@@ -277,7 +277,7 @@ void GAL::BitmapText( const wxString& aText, const VECTOR2I& aPosition, const ED
}
bool GAL::SetNativeCursorStyle( KICURSOR aCursor )
bool GAL::SetNativeCursorStyle( KICURSOR aCursor, bool aHiDPI )
{
if( m_currentNativeCursor == aCursor )
return false;
+2 -9
View File
@@ -34,8 +34,7 @@ HIDPI_GL_CANVAS::HIDPI_GL_CANVAS( const KIGFX::VC_SETTINGS& aSettings, wxWindow*
const wxPoint& aPos, const wxSize& aSize, long aStyle,
const wxString& aName, const wxPalette& aPalette ) :
wxGLCanvas( aParent, aId, aAttribList, aPos, aSize, aStyle, aName, aPalette ),
m_settings( aSettings ),
m_scale_factor( DPI_SCALING::GetDefaultScaleFactor() )
m_settings( aSettings )
{
}
@@ -64,13 +63,7 @@ wxPoint HIDPI_GL_CANVAS::GetNativePosition( const wxPoint& aPoint ) const
}
void HIDPI_GL_CANVAS::SetScaleFactor( double aNewScaleFactor )
{
m_scale_factor = aNewScaleFactor;
}
double HIDPI_GL_CANVAS::GetScaleFactor() const
{
return m_scale_factor;
return GetContentScaleFactor();
}
+13 -12
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012-2023 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2024 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013-2017 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@@ -33,6 +33,7 @@
#endif
#include <advanced_config.h>
#include <build_version.h>
#include <gal/opengl/opengl_gal.h>
#include <gal/opengl/utils.h>
#include <gal/definitions.h>
@@ -254,7 +255,8 @@ GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap )
bmp.accessTime = currentTime;
#ifndef DISABLE_BITMAP_CACHE
if( m_cacheLru.size() + 1 > m_cacheMaxElements || m_cacheSize + bmp.size > m_cacheMaxSize )
if( ( m_cacheLru.size() + 1 > m_cacheMaxElements || m_cacheSize + bmp.size > m_cacheMaxSize )
&& !m_cacheLru.empty() )
{
KIID toRemove( 0 );
auto toRemoveLru = m_cacheLru.end();
@@ -506,13 +508,6 @@ bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
refresh = true;
}
if( m_options.m_scaleFactor != GetScaleFactor() )
{
SetScaleFactor( m_options.m_scaleFactor );
m_gridLineWidth = m_options.m_scaleFactor * ( m_options.m_gridLineWidth + 0.25 );
refresh = true;
}
if( super::updatedGalDisplayOptions( aOptions ) || refresh )
{
Refresh();
@@ -2133,13 +2128,16 @@ void OPENGL_GAL::EndDiffLayer()
}
bool OPENGL_GAL::SetNativeCursorStyle( KICURSOR aCursor )
bool OPENGL_GAL::SetNativeCursorStyle( KICURSOR aCursor, bool aHiDPI )
{
// Store the current cursor type and get the wxCursor for it
if( !GAL::SetNativeCursorStyle( aCursor ) )
if( !GAL::SetNativeCursorStyle( aCursor, aHiDPI ) )
return false;
m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
if( aHiDPI )
m_currentwxCursor = CURSOR_STORE::GetHiDPICursor( m_currentNativeCursor );
else
m_currentwxCursor = CURSOR_STORE::GetCursor( m_currentNativeCursor );
// Update the cursor in the wx control
HIDPI_GL_CANVAS::SetCursor( m_currentwxCursor );
@@ -2678,6 +2676,9 @@ void OPENGL_GAL::init()
#endif // KICAD_USE_EGL
SetOpenGLInfo( (const char*) glGetString( GL_VENDOR ), (const char*) glGetString( GL_RENDERER ),
(const char*) glGetString( GL_VERSION ) );
if( GLEW_OK != err )
throw std::runtime_error( (const char*) glewGetErrorString( err ) );
+4 -4
View File
@@ -642,10 +642,6 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
if( startAngle > endAngle )
endAngle += ANGLE_360;
// Angles are relative to major axis
startAngle -= EDA_ANGLE( major );
endAngle -= EDA_ANGLE( major );
if( aData.ratio == 1.0 )
{
double radius = major.EuclideanNorm();
@@ -658,6 +654,10 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseData& aData )
}
else
{
// Angles are relative to major axis
startAngle -= EDA_ANGLE( major );
endAngle -= EDA_ANGLE( major );
DL_ArcData arc( aData.cx, aData.cy, aData.cz, radius, startAngle.AsDegrees(),
endAngle.AsDegrees() );
addArc( arc );
+2 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2023-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -246,7 +246,7 @@ EASYEDA_PARSER_BASE::ParseLineChains( const wxString& data, int aArcMinSegLen, b
arc.ConstructFromStartEndCenter( RelPos( start ), RelPos( end ), RelPos( arcCenter ),
!cw );
chain.Append( arc );
chain.Append( arc, aArcMinSegLen );
prevPt = end;
}
+14 -1
View File
@@ -57,7 +57,6 @@ KIWAY_PLAYER::KIWAY_PLAYER( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType
KIWAY_PLAYER::~KIWAY_PLAYER() throw()
{
// socket server must be destructed before we complete
// destructing the frame or else we could crash
// as the socket server holds a reference to this frame
@@ -69,6 +68,20 @@ KIWAY_PLAYER::~KIWAY_PLAYER() throw()
delete m_socketServer;
m_socketServer = nullptr;
}
// remove active sockets as well
for( wxSocketBase* socket : m_sockets )
{
if( !socket )
continue;
// ensure any event handling stops
socket->Notify( false );
delete socket;
}
m_sockets.clear();
}
+11 -1
View File
@@ -24,6 +24,7 @@
*/
#include <wx/debug.h>
#include <wx/filename.h>
#include <set>
#include <common.h>
@@ -198,7 +199,16 @@ LIB_TABLE_ROW* LIB_TABLE::findRow( const wxString& aNickName, bool aCheckIfEnabl
do
{
std::shared_lock<std::shared_mutex> lock( cur->m_mutex );
try
{
std::shared_lock<std::shared_mutex> lock( cur->m_mutex );
}
catch( std::system_error& e )
{
wxASSERT_MSG( false, wxString::Format( wxS( "Failed to lock lib table mutex: %s" ),
e.what() ) );
continue;
}
if( cur->m_rowsMap.count( aNickName ) )
row = &*cur->m_rowsMap.at( aNickName );
+9 -5
View File
@@ -21,7 +21,8 @@
#include "lib_table_grid.h"
LIB_TABLE_GRID_TRICKS::LIB_TABLE_GRID_TRICKS( WX_GRID* aGrid ) : GRID_TRICKS( aGrid )
LIB_TABLE_GRID_TRICKS::LIB_TABLE_GRID_TRICKS( WX_GRID* aGrid ) :
GRID_TRICKS( aGrid )
{
}
@@ -65,11 +66,14 @@ void LIB_TABLE_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
if( showDeactivate )
menu.Append( LIB_TABLE_GRID_TRICKS_DEACTIVATE_SELECTED, _( "Deactivate selected" ) );
if( showSetVisible )
menu.Append( LIB_TABLE_GRID_TRICKS_SET_VISIBLE, _( "Set visible flag" ) );
if( supportsVisibilityColumn() )
{
if( showSetVisible )
menu.Append( LIB_TABLE_GRID_TRICKS_SET_VISIBLE, _( "Set visible flag" ) );
if( showUnsetVisible )
menu.Append( LIB_TABLE_GRID_TRICKS_UNSET_VISIBLE, _( "Unset visible flag" ) );
if( showUnsetVisible )
menu.Append( LIB_TABLE_GRID_TRICKS_UNSET_VISIBLE, _( "Unset visible flag" ) );
}
bool showSettings = false;
+1 -1
View File
@@ -416,7 +416,7 @@ wxDataViewColumn* LIB_TREE_MODEL_ADAPTER::doAddColumn( const wxString& aHeader,
wxDataViewColumn* col = new wxDataViewColumn(
translatedHeader, new LIB_TREE_RENDERER(), index, m_colWidths[aHeader], wxALIGN_NOT,
wxDATAVIEW_CELL_INERT | wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_COL_SORTABLE );
wxDATAVIEW_CELL_INERT | static_cast<int>( wxDATAVIEW_COL_RESIZABLE ) );
m_widget->AppendColumn( col );
col->SetMinWidth( headerMinWidth.x );
+4 -5
View File
@@ -153,6 +153,9 @@ PGM_BASE::~PGM_BASE()
}
delete[] m_argvUtf8;
delete m_locale;
m_locale = nullptr;
}
@@ -164,10 +167,6 @@ void PGM_BASE::Destroy()
sentry_close();
#endif
// unlike a normal destructor, this is designed to be called more than once safely:
delete m_locale;
m_locale = nullptr;
m_pgm_checker.reset();
}
@@ -990,7 +989,7 @@ void PGM_BASE::HandleAssert( const wxString& aFile, int aLine, const wxString& a
{
static std::set<SENTRY_ASSERT_CACHE_KEY> assertCache;
SENTRY_ASSERT_CACHE_KEY key = { aFile, aLine, aFunc, aCond, aMsg };
SENTRY_ASSERT_CACHE_KEY key = { aFile, aLine, aFunc, aCond };
if( assertCache.find( key ) == assertCache.end() )
{
+1 -1
View File
@@ -851,7 +851,7 @@ void SVG_PLOTTER::Text( const VECTOR2I& aPos,
fprintf( m_outputFile,
"textLength=\"%.*f\" font-size=\"%.*f\" lengthAdjust=\"spacingAndGlyphs\"\n"
"text-anchor=\"%s\" opacity=\"0\">%s</text>\n",
"text-anchor=\"%s\" opacity=\"0\" stroke-opacity=\"0\">%s</text>\n",
m_precision, sz_dev.x, m_precision, sz_dev.y, hjust, TO_UTF8( XmlEsc( aText ) ) );
if( !aOrient.IsZero() )
+3
View File
@@ -160,6 +160,9 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV
m_params.emplace_back( new PARAM<int>( "system.last_imperial_units",
&m_System.last_imperial_units, static_cast<int>( EDA_UNITS::MILS ) ) );
m_params.emplace_back( new PARAM<bool>( "system.show_import_issues",
&m_System.show_import_issues, true ) );
m_params.emplace_back( new PARAM<wxString>( "appearance.color_theme",
&m_ColorTheme, COLOR_SETTINGS::COLOR_BUILTIN_DEFAULT ) );
+1 -1
View File
@@ -36,7 +36,7 @@ const wxString COLOR_SETTINGS::COLOR_BUILTIN_CLASSIC = "_builtin_classic";
COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath ) :
JSON_SETTINGS( std::move( aFilename ), SETTINGS_LOC::COLORS, colorsSchemaVersion ),
JSON_SETTINGS( aFilename, SETTINGS_LOC::COLORS, colorsSchemaVersion ),
m_overrideSchItemColors( false )
{
if( aAbsolutePath )
+7 -6
View File
@@ -591,7 +591,7 @@ wxString RemoveHTMLTags( const wxString& aInput )
wxString LinkifyHTML( wxString aStr )
{
wxRegEx regex( wxS( "\\b(https?|ftp|file)://([-\\w+&@#/%?=~|!:,.;]*[^.<>\\s\u00b6])" ),
wxRegEx regex( wxS( "\\b(https?|ftp|file)://([-\\w+&@#/%?=~|!:,.;]*[^.,:;<>\\s\u00b6])" ),
wxRE_ICASE );
regex.ReplaceAll( &aStr, "<a href=\"\\0\">\\0</a>" );
@@ -907,11 +907,12 @@ bool ApplyModifier( double& value, const wxString& aString )
}
if( units.length()
&& !units.CmpNoCase( wxT( "F" ) )
&& !units.CmpNoCase( wxT( "hz" ) )
&& !units.CmpNoCase( wxT( "W" ) )
&& !units.CmpNoCase( wxT( "V" ) )
&& !units.CmpNoCase( wxT( "H" ) ) )
&& !units.IsSameAs( wxT( "F" ), false )
&& !units.IsSameAs( wxT( "hz" ), false )
&& !units.IsSameAs( wxT( "W" ), false )
&& !units.IsSameAs( wxT( "V" ), false )
&& !units.IsSameAs( wxT( "A" ), false )
&& !units.IsSameAs( wxT( "H" ), false ) )
{
return false;
}
+1 -1
View File
@@ -130,7 +130,7 @@ VECTOR2I SELECTION::GetCenter() const
}
BOX2I SELECTION::GetBoundingBox() const
BOX2I SELECTION::GetBoundingBox( bool aOnlyVisible ) const
{
BOX2I bbox;
+4 -1
View File
@@ -455,8 +455,11 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
if( isMouseClick( type ) )
{
if( m_toolMgr->GetToolHolder() && m_toolMgr->GetToolHolder()->GetToolCanvas() )
if( m_toolMgr->GetToolHolder() && m_toolMgr->GetToolHolder()->GetToolCanvas() &&
!m_toolMgr->GetToolHolder()->GetToolCanvas()->HasFocus() )
{
m_toolMgr->GetToolHolder()->GetToolCanvas()->SetFocus();
}
}
// Mouse handling
+5 -1
View File
@@ -362,7 +362,11 @@ bool TOOL_MANAGER::doRunAction( const TOOL_ACTION& aAction, bool aNow, const std
while( synchronousControl == STS_RUNNING )
{
wxYield();
wxYield(); // Needed to honor mouse (and other) events during editing
wxMilliSleep( 1 ); // Needed to avoid 100% use of one cpu core.
// The sleeping time must be must be small to avoid
// noticeable lag in mouse and editing events
// (1 to 5 ms is a good value)
}
retVal = synchronousControl != STS_CANCELLED;
+25 -25
View File
@@ -399,35 +399,19 @@ void VIEW::SetRequired( int aLayerId, int aRequiredId, bool aRequired )
}
// stupid C++... python lambda would do this in one line
template <class CONTAINER>
struct QUERY_VISITOR
{
typedef typename CONTAINER::value_type item_type;
QUERY_VISITOR( CONTAINER& aCont, int aLayer ) :
m_cont( aCont ), m_layer( aLayer )
{
}
bool operator()( VIEW_ITEM* aItem )
{
if( aItem->viewPrivData()->GetFlags() & VISIBLE )
m_cont.push_back( VIEW::LAYER_ITEM_PAIR( aItem, m_layer ) );
return true;
}
CONTAINER& m_cont;
int m_layer;
};
int VIEW::Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) const
{
if( m_orderedLayers.empty() )
return 0;
int layer = UNDEFINED_LAYER;
auto visitor =
[&]( VIEW_ITEM* item ) -> bool
{
aResult.push_back( VIEW::LAYER_ITEM_PAIR( item, layer ) );
return true;
};
std::vector<VIEW_LAYER*>::const_reverse_iterator i;
// execute queries in reverse direction, so that items that are on the top of
@@ -438,7 +422,7 @@ int VIEW::Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) con
if( ( *i )->displayOnly || !( *i )->visible )
continue;
QUERY_VISITOR<std::vector<LAYER_ITEM_PAIR> > visitor( aResult, ( *i )->id );
layer = ( *i )->id;
( *i )->items->Query( aRect, visitor );
}
@@ -446,6 +430,22 @@ int VIEW::Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) con
}
void VIEW::Query( const BOX2I& aRect, const std::function<bool( VIEW_ITEM* )>& aFunc ) const
{
if( m_orderedLayers.empty() )
return;
for( const auto& i : m_orderedLayers )
{
// ignore layers that do not contain actual items (i.e. the selection box, menus, floats)
if( i->displayOnly || !i->visible )
continue;
i->items->Query( aRect, aFunc );
}
}
VECTOR2D VIEW::ToWorld( const VECTOR2D& aCoord, bool aAbsolute ) const
{
const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();
+6 -2
View File
@@ -45,7 +45,7 @@
#include <wx/log.h>
#ifdef __WXMSW__
#define USE_MOUSE_CAPTURE
#define USE_MOUSE_CAPTURE
#endif
using namespace KIGFX;
@@ -694,7 +694,11 @@ void WX_VIEW_CONTROLS::CaptureCursor( bool aEnabled )
// Note: for some reason, m_parentPanel->HasCapture() can be false even if CaptureMouse()
// was called (i.e. mouse was captured, so when need to test m_MouseCapturedLost to be
// sure a wxEVT_MOUSE_CAPTURE_LOST event was fired before. Otherwise wxMSW complains
if( aEnabled && !m_parentPanel->HasCapture() && m_parentPanel->m_MouseCapturedLost )
// The IsModalDialogFocused is checked because it's possible to start a capture
// due to event ordering while a modal dialog was just opened, the mouse capture steels focus
// from the modal and causes odd behavior
if( aEnabled && !m_parentPanel->HasCapture() && m_parentPanel->m_MouseCapturedLost
&& !KIUI::IsModalDialogFocused() )
{
m_parentPanel->CaptureMouse();
+34 -16
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 CERN
* Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -213,13 +213,15 @@ protected:
if( rawValue.IsEmpty() )
rawValue = m_preselect;
wxString symbolId = escapeLibId( rawValue );
KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_SYMBOL_CHOOSER, true, m_dlg );
wxString symbolId = escapeLibId( rawValue );
if( frame->ShowModal( &symbolId, m_dlg ) )
SetValue( UnescapeString( symbolId ) );
if( KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_SYMBOL_CHOOSER, true, m_dlg ) )
{
if( frame->ShowModal( &symbolId, m_dlg ) )
SetValue( UnescapeString( symbolId ) );
frame->Destroy();
frame->Destroy();
}
}
DIALOG_SHIM* m_dlg;
@@ -247,6 +249,7 @@ public:
m_preselect( aPreselect ),
m_symbolNetlist( aSymbolNetlist.ToStdString() )
{
m_buttonFpChooserLock = false;
SetButtonBitmaps( KiBitmap( BITMAPS::small_library ) );
// win32 fix, avoids drawing the "native dropdown caret"
@@ -261,30 +264,45 @@ protected:
void OnButtonClick() override
{
if( m_buttonFpChooserLock ) // The button to show the FP chooser is clicked, but
// a previous click is currently in progress.
return;
// Disable the button until we have finished processing it. Normally this is not an issue
// but if the footprint chooser is loading for the first time, it can be slow enough that
// multiple clicks will cause multiple instances of the footprint loader process to start
m_buttonFpChooserLock = true;
// pick a footprint using the footprint picker.
wxString fpid = GetValue();
if( fpid.IsEmpty() )
fpid = m_preselect;
KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg );
if( !m_symbolNetlist.empty() )
if( KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg ) )
{
KIWAY_EXPRESS event( FRAME_FOOTPRINT_CHOOSER, MAIL_SYMBOL_NETLIST, m_symbolNetlist );
frame->KiwayMailIn( event );
if( !m_symbolNetlist.empty() )
{
KIWAY_EXPRESS event( FRAME_FOOTPRINT_CHOOSER, MAIL_SYMBOL_NETLIST, m_symbolNetlist );
frame->KiwayMailIn( event );
}
if( frame->ShowModal( &fpid, m_dlg ) )
SetValue( fpid );
frame->Destroy();
}
if( frame->ShowModal( &fpid, m_dlg ) )
SetValue( fpid );
frame->Destroy();
m_buttonFpChooserLock = false;
}
protected:
DIALOG_SHIM* m_dlg;
wxString m_preselect;
// Lock flag to lock the button to show the FP chooser
// true when the button is busy, waiting all footprints loaded to
// avoid running more than once the FP chooser
bool m_buttonFpChooserLock;
/*
* Symbol netlist format:
* pinNumber pinName <tab> pinNumber pinName...
-12
View File
@@ -725,18 +725,6 @@ void LIB_TREE::onIdle( wxIdleEvent& aEvent )
if( m_previewItem.IsOk() )
{
// Scroll checker
if( m_tree_ctrl->GetItemRect( m_previewItem ) != m_previewItemRect )
{
hidePreview();
m_hoverPos = clientPos;
m_hoverItem = item;
m_hoverItemRect = m_tree_ctrl->GetItemRect( m_hoverItem );
m_hoverTimer.StartOnce( HOVER_TIMER_MILLIS );
return;
}
if( item != m_previewItem )
{
#ifdef __WXGTK__
+9 -5
View File
@@ -518,8 +518,10 @@ void mpFXY::Plot( wxDC& dc, mpWindow& w )
ys.insert( w.y2p( py ) );
}
}
else
else for( int sweep = 0; sweep < GetSweepCount(); ++sweep )
{
SetSweepWindow( sweep );
int count = 0;
int x0 = 0; // X position of merged current vertical line
int ymin0 = 0; // y min coord of merged current vertical line
@@ -2456,18 +2458,20 @@ double mpScaleXLog::TransformFromPlot( double xplot ) const
void mpFXYVector::Rewind()
{
m_index = 0;
m_sweepWindow = std::numeric_limits<size_t>::max();
}
size_t mpFXYVector::GetCount() const
void mpFXYVector::SetSweepWindow( int aSweepIdx )
{
return m_xs.size();
m_index = aSweepIdx * m_sweepSize;
m_sweepWindow = ( aSweepIdx + 1 ) * m_sweepSize;
}
bool mpFXYVector::GetNextXY( double& x, double& y )
{
if( m_index >= m_xs.size() )
if( m_index >= m_xs.size() || m_index >= m_sweepWindow )
{
return false;
}
@@ -2475,7 +2479,7 @@ bool mpFXYVector::GetNextXY( double& x, double& y )
{
x = m_xs[m_index];
y = m_ys[m_index++];
return m_index <= m_xs.size();
return m_index <= m_xs.size() && m_index <= m_sweepWindow;
}
}
+6 -1
View File
@@ -406,14 +406,19 @@ void PROPERTIES_PANEL::onShow( wxShowEvent& aEvent )
{
if( aEvent.IsShown() )
UpdateData();
aEvent.Skip();
}
void PROPERTIES_PANEL::onCharHook( wxKeyEvent& aEvent )
{
if( aEvent.GetKeyCode() == WXK_TAB && !aEvent.ShiftDown() )
if( aEvent.GetKeyCode() == WXK_TAB && !aEvent.ShiftDown() && m_grid->IsAnyModified() )
{
m_grid->CommitChangesFromEditor();
// Pass the tab key on so the default property grid tab behavior is honored.
aEvent.Skip();
return;
}
+2 -2
View File
@@ -87,8 +87,8 @@ protected:
virtual wxPGProperty* createPGProperty( const PROPERTY_BASE* aProperty ) const = 0;
// Event handlers
virtual void valueChanging( wxPropertyGridEvent& aEvent ) {}
virtual void valueChanged( wxPropertyGridEvent& aEvent ) {}
virtual void valueChanging( wxPropertyGridEvent& aEvent ) { aEvent.Skip(); }
virtual void valueChanged( wxPropertyGridEvent& aEvent ) { aEvent.Skip(); }
void onCharHook( wxKeyEvent& aEvent );
void onShow( wxShowEvent& aEvent );
+13 -2
View File
@@ -991,8 +991,19 @@ void CVPCB_MAINFRAME::BuildLibrariesList()
COMMON_SETTINGS* cfg = Pgm().GetCommonSettings();
PROJECT_FILE& project = Kiway().Prj().GetProjectFile();
FP_LIB_TABLE* tbl = PROJECT_PCB::PcbFootprintLibs( &Prj() );
std::set<wxString> pinnedMatches;
std::set<wxString> otherMatches;
// Use same sorting algorithm as LIB_TREE_NODE::AssignIntrinsicRanks
struct library_sort
{
bool operator()( const wxString& lhs, const wxString& rhs ) const
{
return StrNumCmp( lhs, rhs, true ) < 0;
}
};
std::set<wxString, library_sort> pinnedMatches;
std::set<wxString, library_sort> otherMatches;
m_librariesListBox->ClearList();
auto process =
+3 -3
View File
@@ -176,11 +176,11 @@ int CVPCB_CONTROL::ShowFootprintViewer( const TOOL_EVENT& aEvent )
fpframe = (DISPLAY_FOOTPRINTS_FRAME*) m_frame->Kiway().Player( FRAME_CVPCB_DISPLAY, true,
m_frame );
// If Kiway() cannot create the eeschema frame, it shows a error message, and
// frame is null
if( !fpframe )
{
wxMessageBox( _( "Unable to create the footprint viewer frame" ) );
return 0;
}
fpframe->Show( true );
}
+1
View File
@@ -397,6 +397,7 @@ set( EESCHEMA_SRCS
symbol_tree_model_adapter.cpp
symbol_tree_synchronizing_adapter.cpp
symbol_viewer_frame.cpp
symb_transforms_utils.cpp
toolbars_sch_editor.cpp
toolbars_symbol_viewer.cpp
+56 -8
View File
@@ -720,6 +720,20 @@ void CONNECTION_GRAPH::Recalculate( const SCH_SHEET_LIST& aSheetList, bool aUnco
item->GetTypeDesc() );
items.push_back( item );
dirty_items.insert( item );
// Add any symbol dirty pins to the dirty_items list
if( item->Type() == SCH_SYMBOL_T )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
for( SCH_PIN* pin : symbol->GetPins( &sheet ) )
{
if( pin->IsConnectivityDirty() )
{
dirty_items.insert( pin );
}
}
}
}
// If the symbol isn't dirty, look at the pins
// TODO: remove symbols from connectivity graph and only use pins
@@ -736,6 +750,19 @@ void CONNECTION_GRAPH::Recalculate( const SCH_SHEET_LIST& aSheetList, bool aUnco
}
}
}
else if( item->Type() == SCH_SHEET_T )
{
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
for( SCH_SHEET_PIN* pin : sheet->GetPins() )
{
if( pin->IsConnectivityDirty() )
{
items.push_back( pin );
dirty_items.insert( pin );
}
}
}
// Ensure the hierarchy info stored in the SCH_SCREEN (such as symbol units) reflects
// the current SCH_SHEET_PATH
@@ -890,6 +917,9 @@ std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> CONNECTION_GRAPH::ExtractAffected
removeSubgraphs( subgraphs );
for( const auto& [path, item] : retvals )
alg::delete_matching( m_items, item );
return retvals;
}
@@ -2304,6 +2334,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Prj().GetProjectFile().m_NetSettings;
std::map<wxString, wxString> oldAssignments = netSettings->m_NetClassLabelAssignments;
std::set<wxString> affectedNetclassNetAssignments;
netSettings->m_NetClassLabelAssignments.clear();
@@ -2345,9 +2376,6 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
}
}
if( netclass.IsEmpty() )
return;
if( !driverSubgraph )
driverSubgraph = subgraphs.front();
@@ -2357,7 +2385,10 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
{
for( const auto& member : driverSubgraph->m_driver_connection->Members() )
{
netSettings->m_NetClassLabelAssignments[ member->Name() ] = netclass;
if( netclass.IsEmpty() )
netSettings->m_NetClassLabelAssignments.erase( member->Name() );
else
netSettings->m_NetClassLabelAssignments[member->Name()] = netclass;
auto ii = m_net_name_to_subgraphs_map.find( member->Name() );
@@ -2366,10 +2397,24 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
}
}
netSettings->m_NetClassLabelAssignments[ netname ] = netclass;
if( netclass.IsEmpty() )
netSettings->m_NetClassLabelAssignments.erase( netname );
else
netSettings->m_NetClassLabelAssignments[netname] = netclass;
if( oldAssignments[ netname ] != netclass )
if( oldAssignments.count( netname ) )
{
if( oldAssignments[netname] != netclass )
{
affectedNetclassNetAssignments.insert( netname );
dirtySubgraphs( subgraphs );
}
}
else if( !netclass.IsEmpty() )
{
affectedNetclassNetAssignments.insert( netname );
dirtySubgraphs( subgraphs );
}
};
for( const auto& [ netname, subgraphs ] : m_net_name_to_subgraphs_map )
@@ -2379,8 +2424,11 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
{
for( auto& [ netname, netclass ] : oldAssignments )
{
if( netSettings->m_NetClassLabelAssignments.count( netname ) )
if( netSettings->m_NetClassLabelAssignments.count( netname )
|| affectedNetclassNetAssignments.count( netname ) )
{
continue;
}
netSettings->m_NetClassLabelAssignments[ netname ] = netclass;
}
@@ -2988,7 +3036,7 @@ CONNECTION_SUBGRAPH* CONNECTION_GRAPH::FindFirstSubgraphByName( const wxString&
}
CONNECTION_SUBGRAPH* CONNECTION_GRAPH::GetSubgraphForItem( SCH_ITEM* aItem )
CONNECTION_SUBGRAPH* CONNECTION_GRAPH::GetSubgraphForItem( SCH_ITEM* aItem ) const
{
auto it = m_item_to_subgraph_map.find( aItem );
CONNECTION_SUBGRAPH* ret = it != m_item_to_subgraph_map.end() ? it->second : nullptr;
+1 -1
View File
@@ -428,7 +428,7 @@ public:
*/
CONNECTION_SUBGRAPH* FindFirstSubgraphByName( const wxString& aNetName );
CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem );
CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem ) const;
const std::vector<CONNECTION_SUBGRAPH*> GetAllSubgraphs( const wxString& aNetName ) const;
+1 -1
View File
@@ -907,7 +907,7 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
KIID uuid( payload );
SCH_SHEET_PATH path;
if( SCH_ITEM* item = m_schematic->GetSheets().GetItem( uuid, &path ) )
if( SCH_ITEM* item = m_schematic->GetItem( uuid, &path ) )
{
if( item->Type() == SCH_SHEET_T )
payload = static_cast<SCH_SHEET*>( item )->GetShownName( false );
+16 -14
View File
@@ -248,15 +248,16 @@ void DIALOG_CHANGE_SYMBOLS::launchMatchIdSymbolBrowser( wxCommandEvent& aEvent )
{
wxString newName = getLibIdValue( m_specifiedId );
KIWAY_PLAYER* frame = Kiway().Player( FRAME_SYMBOL_CHOOSER, true, this );
if( frame->ShowModal( &newName, this ) )
if( KIWAY_PLAYER* frame = Kiway().Player( FRAME_SYMBOL_CHOOSER, true, this ) )
{
m_specifiedId->SetValue( UnescapeString( newName ) );
updateFieldsList();
}
if( frame->ShowModal( &newName, this ) )
{
m_specifiedId->SetValue( UnescapeString( newName ) );
updateFieldsList();
}
frame->Destroy();
frame->Destroy();
}
}
@@ -264,15 +265,16 @@ void DIALOG_CHANGE_SYMBOLS::launchNewIdSymbolBrowser( wxCommandEvent& aEvent )
{
wxString newName = getLibIdValue( m_newId );
KIWAY_PLAYER* frame = Kiway().Player( FRAME_SYMBOL_CHOOSER, true, this );
if( frame->ShowModal( &newName, this ) )
if( KIWAY_PLAYER* frame = Kiway().Player( FRAME_SYMBOL_CHOOSER, true, this ) )
{
m_newId->SetValue( UnescapeString( newName ) );
updateFieldsList();
}
if( frame->ShowModal( &newName, this ) )
{
m_newId->SetValue( UnescapeString( newName ) );
updateFieldsList();
}
frame->Destroy();
frame->Destroy();
}
}
+4 -1
View File
@@ -79,6 +79,7 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
m_currentSchematic = &parent->Schematic();
SetName( DIALOG_ERC_WINDOW_NAME ); // Set a window name to be able to find it
KIPLATFORM::UI::SetFloatLevel( this );
EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
m_severities = settings->m_Appearance.erc_severities;
@@ -466,6 +467,8 @@ void DIALOG_ERC::OnRunERCClick( wxCommandEvent& event )
m_ercRun = true;
redrawDrawPanel();
updateDisplayedCounts();
// set float level again, it can be lost due to window events during test run
KIPLATFORM::UI::SetFloatLevel( this );
}
@@ -510,7 +513,7 @@ void DIALOG_ERC::OnERCItemSelected( wxDataViewEvent& aEvent )
{
const KIID& itemID = RC_TREE_MODEL::ToUUID( aEvent.GetItem() );
SCH_SHEET_PATH sheet;
SCH_ITEM* item = m_parent->Schematic().GetSheets().GetItem( itemID, &sheet );
SCH_ITEM* item = m_parent->Schematic().GetItem( itemID, &sheet );
if( m_centerMarkerOnIdle )
{
+1 -1
View File
@@ -677,7 +677,7 @@ void DIALOG_SCH_FIELD_PROPERTIES::UpdateField( SCH_COMMIT* aCommit, SCH_FIELD* a
int unit = symbol->GetUnit();
LIB_ID libId = symbol->GetLibId();
for( SCH_SHEET_PATH& sheet : editFrame->Schematic().GetSheets() )
for( SCH_SHEET_PATH& sheet : editFrame->Schematic().GetUnorderedSheets() )
{
SCH_SCREEN* screen = sheet.LastScreen();
std::vector<SCH_SYMBOL*> otherUnits;
+3 -3
View File
@@ -501,7 +501,7 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
if( m_sheet->GetScreen() == nullptr ) // New just created sheet.
{
if( !m_frame->AllowCaseSensitiveFileNameClashes( newAbsoluteFilename ) )
if( !m_frame->AllowCaseSensitiveFileNameClashes( m_sheet->GetFileName(), newAbsoluteFilename ) )
return false;
if( useScreen || loadFromFile ) // Load from existing file.
@@ -526,7 +526,7 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
{
isExistingSheet = true;
if( !m_frame->AllowCaseSensitiveFileNameClashes( newAbsoluteFilename ) )
if( !m_frame->AllowCaseSensitiveFileNameClashes( m_sheet->GetFileName(), newAbsoluteFilename ) )
return false;
// We are always using here a case insensitive comparison to avoid issues
@@ -640,7 +640,7 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
SCH_SHEET_LIST sheetHierarchy( m_sheet ); // The hierarchy of the loaded file.
sheetHierarchy.AddNewSymbolInstances( currentSheet );
sheetHierarchy.AddNewSymbolInstances( currentSheet, m_frame->Prj().GetProjectName() );
sheetHierarchy.AddNewSheetInstances( currentSheet,
fullHierarchy.GetLastVirtualPageNumber() );
}
+1 -1
View File
@@ -50,7 +50,7 @@ DIALOG_SIM_FORMAT_VALUE::DIALOG_SIM_FORMAT_VALUE( wxWindow* aParent, SPICE_VALUE
m_units = aFormat->Range.Right( 2 );
SetTitle( wxString::Format( GetTitle(), _( "Frequency" ) ) );
}
else if( aFormat->Range.EndsWith( wxS( "dBV" ) ) )
else if( aFormat->Range.EndsWith( wxS( "dB" ) ) )
{
m_units = aFormat->Range.Right( 3 );
SetTitle( wxString::Format( GetTitle(), _( "Gain" ) ) );
@@ -109,14 +109,15 @@ protected:
if( event.GetId() == MYID_SELECT_FOOTPRINT )
{
// pick a footprint using the footprint picker.
wxString fpid = m_grid->GetCellValue( m_grid->GetGridCursorRow(),
FOOTPRINT_FIELD );
KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg );
wxString fpid = m_grid->GetCellValue( m_grid->GetGridCursorRow(), FOOTPRINT_FIELD );
if( frame->ShowModal( &fpid, m_dlg ) )
m_grid->SetCellValue( m_grid->GetGridCursorRow(), FOOTPRINT_FIELD, fpid );
if( KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg ) )
{
if( frame->ShowModal( &fpid, m_dlg ) )
m_grid->SetCellValue( m_grid->GetGridCursorRow(), FOOTPRINT_FIELD, fpid );
frame->Destroy();
frame->Destroy();
}
}
else if (event.GetId() == MYID_SHOW_DATASHEET )
{
@@ -305,7 +306,7 @@ DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE( SCH_EDIT_FRAME* parent )
case SCOPE::SCOPE_SHEET_RECURSIVE: m_radioRecursive->SetValue( true ); break;
}
m_outputFileName->SetValue( cfg->m_FieldEditorPanel.export_filename );
m_outputFileName->SetValue( m_schSettings.m_BomExportFileName );
Center();
@@ -1338,12 +1339,13 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnClose( wxCloseEvent& aEvent )
// Save all our settings since we're really closing
savePresetsToSchematic();
m_schSettings.m_BomExportFileName = m_outputFileName->GetValue();
EESCHEMA_SETTINGS* cfg = m_parent->eeconfig();
cfg->m_FieldEditorPanel.width = GetSize().x;
cfg->m_FieldEditorPanel.height = GetSize().y;
cfg->m_FieldEditorPanel.page = m_nbPages->GetSelection();
cfg->m_FieldEditorPanel.export_filename = m_outputFileName->GetValue();
if( m_radioHighlight->GetValue() )
cfg->m_FieldEditorPanel.selection_mode = 0;
@@ -792,7 +792,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
int unit = m_symbol->GetUnit();
LIB_ID libId = m_symbol->GetLibId();
for( SCH_SHEET_PATH& sheet : GetParent()->Schematic().GetSheets() )
for( SCH_SHEET_PATH& sheet : GetParent()->Schematic().GetUnorderedSheets() )
{
SCH_SCREEN* screen = sheet.LastScreen();
std::vector<SCH_SYMBOL*> otherUnits;
+1 -1
View File
@@ -150,7 +150,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_ITE
m_separator5->SetIsSeparator();
SCH_SHEET_LIST sheetList = m_frame->Schematic().GetSheets();
SCH_SHEET_LIST sheetList = m_frame->Schematic().GetUnorderedSheets();
sheetList.SortByPageNumbers( false );
for( const SCH_SHEET_PATH& sheet : sheetList )
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -29,6 +29,7 @@
#include <../sim/simulator_frame.h>
#include <dialog_user_defined_signals.h>
#include <string_utils.h>
#include <validators.h>
DIALOG_USER_DEFINED_SIGNALS::DIALOG_USER_DEFINED_SIGNALS( SIMULATOR_FRAME* aParent,
@@ -86,12 +87,19 @@ void DIALOG_USER_DEFINED_SIGNALS::addGridRow( const wxString& aText, int aId )
m_grid->SetCellValue( row, 1, wxString::Format( wxS( "%d" ), aId ) );
wxGridCellAttr* attr = new wxGridCellAttr;
#if defined( __WXMSW__ )
// For some obscure reason, a GRID_CELL_STC_EDITOR does not work on MSW:
// It has a strange behavior when entering data, making it unusable.
// (see https://gitlab.com/kicad/code/kicad/-/issues/15837)
// So use a GRID_CELL_TEXT_EDITOR.
attr->SetEditor( new GRID_CELL_TEXT_EDITOR() );
#else
attr->SetEditor( new GRID_CELL_STC_EDITOR( true,
[this]( wxStyledTextEvent& aEvent, SCINTILLA_TRICKS* aScintillaTricks )
{
onScintillaCharAdded( aEvent, aScintillaTricks );
} ) );
#endif
m_grid->SetAttr( row, 0, attr );
}
@@ -106,7 +106,11 @@ PANEL_EESCHEMA_COLOR_SETTINGS::~PANEL_EESCHEMA_COLOR_SETTINGS()
delete m_currentSettings;
for( EDA_ITEM* item : m_previewItems )
{
// Avoid referencing items after they are deleted (we don't control order)
item->SetParent( nullptr );
delete item;
}
}
+5
View File
@@ -226,6 +226,11 @@ protected:
m_grid->AutoSizeColumns( false );
}
}
bool supportsVisibilityColumn() override
{
return true;
}
};
+1
View File
@@ -102,6 +102,7 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
Prj().IncrementTextVarsTicker();
Prj().IncrementNetclassesTicker();
Pgm().GetSettingsManager().SaveProject();
GetRenderSettings()->SetDefaultPenWidth( Schematic().Settings().m_DefaultLineWidth );
GetRenderSettings()->m_LabelSizeRatio = Schematic().Settings().m_LabelSizeRatio;
+2 -2
View File
@@ -740,7 +740,7 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob,
}
// Get the symbol bounding box to fit the plot page to it
BOX2I symbolBB = symbol->Flatten()->GetUnitBoundingBox( unit, bodyStyle, false );
BOX2I symbolBB = symbol->Flatten()->GetUnitBoundingBox( unit, bodyStyle, !aSvgJob->m_includeHiddenFields );
PAGE_INFO pageInfo( PAGE_INFO::Custom );
pageInfo.SetHeightMils( schIUScale.IUToMils( symbolBB.GetHeight() * 1.2 ) );
pageInfo.SetWidthMils( schIUScale.IUToMils( symbolBB.GetWidth() * 1.2 ) );
@@ -750,7 +750,7 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob,
plotter->SetPageSettings( pageInfo );
plotter->SetColorMode( !aSvgJob->m_blackAndWhite );
VECTOR2I plot_offset;
VECTOR2I plot_offset = symbolBB.GetCenter();
const double scale = 1.0;
// Currently, plot units are in decimal
+65 -76
View File
@@ -131,12 +131,9 @@ const std::set<ELECTRICAL_PINTYPE> DrivenPinTypes =
int ERC_TESTER::TestDuplicateSheetNames( bool aCreateMarker )
{
SCH_SCREEN* screen;
int err_count = 0;
int err_count = 0;
SCH_SCREENS screenList( m_schematic->Root() );
for( screen = screenList.GetFirst(); screen != nullptr; screen = screenList.GetNext() )
for( SCH_SCREEN* screen = m_screens.GetFirst(); screen; screen = m_screens.GetNext() )
{
std::vector<SCH_SHEET*> list;
@@ -197,7 +194,7 @@ void ERC_TESTER::TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet )
wsItems.BuildDrawItemsList( aDrawingSheet->GetPageInfo(), aDrawingSheet->GetTitleBlock() );
}
for( SCH_SHEET_PATH& sheet : m_schematic->GetSheets() )
for( const SCH_SHEET_PATH& sheet : m_sheetList )
{
SCH_SCREEN* screen = sheet.LastScreen();
@@ -300,13 +297,11 @@ void ERC_TESTER::TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet )
int ERC_TESTER::TestConflictingBusAliases()
{
wxString msg;
int err_count = 0;
wxString msg;
int err_count = 0;
std::vector<std::shared_ptr<BUS_ALIAS>> aliases;
SCH_SCREENS screens( m_schematic->Root() );
std::vector< std::shared_ptr<BUS_ALIAS> > aliases;
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
for( SCH_SCREEN* screen = m_screens.GetFirst(); screen; screen = m_screens.GetNext() )
{
const auto& screen_aliases = screen->GetBusAliases();
@@ -347,13 +342,9 @@ int ERC_TESTER::TestConflictingBusAliases()
int ERC_TESTER::TestMultiunitFootprints()
{
SCH_SHEET_LIST sheets = m_schematic->GetSheets();
int errors = 0;
SCH_MULTI_UNIT_REFERENCE_MAP refMap;
sheets.GetMultiUnitSymbols( refMap, true );
for( std::pair<const wxString, SCH_REFERENCE_LIST>& symbol : refMap )
for( std::pair<const wxString, SCH_REFERENCE_LIST>& symbol : m_refMap )
{
SCH_REFERENCE_LIST& refList = symbol.second;
@@ -412,14 +403,9 @@ int ERC_TESTER::TestMultiunitFootprints()
int ERC_TESTER::TestMissingUnits()
{
ERC_SETTINGS& settings = m_schematic->ErcSettings();
SCH_SHEET_LIST sheets = m_schematic->GetSheets();
int errors = 0;
SCH_MULTI_UNIT_REFERENCE_MAP refMap;
sheets.GetMultiUnitSymbols( refMap, true );
for( std::pair<const wxString, SCH_REFERENCE_LIST>& symbol : refMap )
for( std::pair<const wxString, SCH_REFERENCE_LIST>& symbol : m_refMap )
{
SCH_REFERENCE_LIST& refList = symbol.second;
@@ -437,38 +423,38 @@ int ERC_TESTER::TestMissingUnits()
std::set<int> instance_units;
std::set<int> missing_units;
auto report_missing = [&]( std::set<int>& aMissingUnits, wxString aErrorMsg,
int aErrorCode )
{
wxString msg;
wxString missing_pin_units = wxS( "[ " );
int ii = 0;
for( int missing_unit : aMissingUnits )
{
if( ii++ == 3 )
auto report_missing =
[&]( std::set<int>& aMissingUnits, wxString aErrorMsg, int aErrorCode )
{
missing_pin_units += wxS( "....." );
break;
}
wxString msg;
wxString missing_pin_units = wxS( "[ " );
int ii = 0;
missing_pin_units += libSymbol->GetUnitDisplayName( missing_unit ) + ", " ;
}
for( int missing_unit : aMissingUnits )
{
if( ii++ == 3 )
{
missing_pin_units += wxS( "....." );
break;
}
missing_pin_units.Truncate( missing_pin_units.length() - 2 );
missing_pin_units += wxS( " ]" );
missing_pin_units += libSymbol->GetUnitDisplayName( missing_unit ) + ", " ;
}
msg.Printf( aErrorMsg, symbol.first, missing_pin_units );
missing_pin_units.Truncate( missing_pin_units.length() - 2 );
missing_pin_units += wxS( " ]" );
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( aErrorCode );
ercItem->SetErrorMessage( msg );
ercItem->SetItems( unit );
msg.Printf( aErrorMsg, symbol.first, missing_pin_units );
SCH_MARKER* marker = new SCH_MARKER( ercItem, unit->GetPosition() );
base_ref.GetSheetPath().LastScreen()->Append( marker );
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( aErrorCode );
ercItem->SetErrorMessage( msg );
ercItem->SetItems( unit );
++errors;
};
SCH_MARKER* marker = new SCH_MARKER( ercItem, unit->GetPosition() );
base_ref.GetSheetPath().LastScreen()->Append( marker );
++errors;
};
for( int ii = 1; ii <= libSymbol->GetUnitCount(); ++ii )
lib_units.insert( lib_units.end(), ii );
@@ -480,7 +466,7 @@ int ERC_TESTER::TestMissingUnits()
instance_units.begin(), instance_units.end(),
std::inserter( missing_units, missing_units.begin() ) );
if( !missing_units.empty() && settings.IsTestEnabled( ERCE_MISSING_UNIT ) )
if( !missing_units.empty() && m_settings.IsTestEnabled( ERCE_MISSING_UNIT ) )
{
report_missing( missing_units, _( "Symbol %s has unplaced units %s" ),
ERCE_MISSING_UNIT );
@@ -528,21 +514,21 @@ int ERC_TESTER::TestMissingUnits()
}
}
if( !missing_power.empty() && settings.IsTestEnabled( ERCE_MISSING_POWER_INPUT_PIN ) )
if( !missing_power.empty() && m_settings.IsTestEnabled( ERCE_MISSING_POWER_INPUT_PIN ) )
{
report_missing( missing_power,
_( "Symbol %s has input power pins in units %s that are not placed." ),
ERCE_MISSING_POWER_INPUT_PIN );
}
if( !missing_input.empty() && settings.IsTestEnabled( ERCE_MISSING_INPUT_PIN ) )
if( !missing_input.empty() && m_settings.IsTestEnabled( ERCE_MISSING_INPUT_PIN ) )
{
report_missing( missing_input,
_( "Symbol %s has input pins in units %s that are not placed." ),
ERCE_MISSING_INPUT_PIN );
}
if( !missing_bidi.empty() && settings.IsTestEnabled( ERCE_MISSING_BIDI_PIN ) )
if( !missing_bidi.empty() && m_settings.IsTestEnabled( ERCE_MISSING_BIDI_PIN ) )
{
report_missing( missing_bidi,
_( "Symbol %s has bidirectional pins in units %s that are not "
@@ -576,7 +562,7 @@ int ERC_TESTER::TestMissingNetclasses()
sheet.LastScreen()->Append( marker );
};
for( const SCH_SHEET_PATH& sheet : m_schematic->GetSheets() )
for( const SCH_SHEET_PATH& sheet : m_sheetList )
{
for( SCH_ITEM* item : sheet.LastScreen()->Items() )
{
@@ -612,7 +598,7 @@ int ERC_TESTER::TestNoConnectPins()
{
int err_count = 0;
for( const SCH_SHEET_PATH& sheet : m_schematic->GetSheets() )
for( const SCH_SHEET_PATH& sheet : m_sheetList )
{
std::map<VECTOR2I, std::vector<SCH_ITEM*>> pinMap;
@@ -679,12 +665,9 @@ int ERC_TESTER::TestNoConnectPins()
int ERC_TESTER::TestPinToPin()
{
ERC_SETTINGS& settings = m_schematic->ErcSettings();
const NET_MAP& nets = m_schematic->ConnectionGraph()->GetNetMap();
int errors = 0;
for( const std::pair<NET_NAME_CODE_CACHE_KEY, std::vector<CONNECTION_SUBGRAPH*>> net : nets )
for( const std::pair<NET_NAME_CODE_CACHE_KEY, std::vector<CONNECTION_SUBGRAPH*>> net : m_nets )
{
std::vector<ERC_SCH_PIN_CONTEXT> pins;
std::unordered_map<EDA_ITEM*, SCH_SCREEN*> pinToScreenMap;
@@ -705,6 +688,21 @@ int ERC_TESTER::TestPinToPin()
}
}
std::sort( pins.begin(), pins.end(),
[]( const ERC_SCH_PIN_CONTEXT& lhs, const ERC_SCH_PIN_CONTEXT& rhs )
{
int ret = StrNumCmp( lhs.Pin()->GetParentSymbol()->GetRef( &lhs.Sheet() ),
rhs.Pin()->GetParentSymbol()->GetRef( &rhs.Sheet() ) );
if( ret == 0 )
ret = StrNumCmp( lhs.Pin()->GetNumber(), rhs.Pin()->GetNumber() );
if( ret == 0 )
ret = lhs < rhs; // Fallback to hash to guarantee deterministic sort
return ret < 0;
} );
ERC_SCH_PIN_CONTEXT needsDriver;
bool hasDriver = false;
@@ -765,9 +763,9 @@ int ERC_TESTER::TestPinToPin()
else
hasDriver |= ( DrivingPinTypes.count( testType ) != 0 );
PIN_ERROR erc = settings.GetPinMapValue( refType, testType );
PIN_ERROR erc = m_settings.GetPinMapValue( refType, testType );
if( erc != PIN_ERROR::OK && settings.IsTestEnabled( ERCE_PIN_TO_PIN_WARNING ) )
if( erc != PIN_ERROR::OK && m_settings.IsTestEnabled( ERCE_PIN_TO_PIN_WARNING ) )
{
std::shared_ptr<ERC_ITEM> ercItem =
ERC_ITEM::Create( erc == PIN_ERROR::WARNING ? ERCE_PIN_TO_PIN_WARNING :
@@ -793,7 +791,7 @@ int ERC_TESTER::TestPinToPin()
{
int err_code = ispowerNet ? ERCE_POWERPIN_NOT_DRIVEN : ERCE_PIN_NOT_DRIVEN;
if( settings.IsTestEnabled( err_code ) )
if( m_settings.IsTestEnabled( err_code ) )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( err_code );
@@ -815,13 +813,11 @@ int ERC_TESTER::TestPinToPin()
int ERC_TESTER::TestMultUnitPinConflicts()
{
const NET_MAP& nets = m_schematic->ConnectionGraph()->GetNetMap();
int errors = 0;
std::unordered_map<wxString, std::pair<wxString, SCH_PIN*>> pinToNetMap;
for( const std::pair<NET_NAME_CODE_CACHE_KEY, std::vector<CONNECTION_SUBGRAPH*>> net : nets )
for( const std::pair<NET_NAME_CODE_CACHE_KEY, std::vector<CONNECTION_SUBGRAPH*>> net : m_nets )
{
const wxString& netName = net.first.Name;
@@ -875,13 +871,11 @@ int ERC_TESTER::TestMultUnitPinConflicts()
int ERC_TESTER::TestSimilarLabels()
{
const NET_MAP& nets = m_schematic->ConnectionGraph()->GetNetMap();
int errors = 0;
std::unordered_map<wxString, std::pair<SCH_LABEL_BASE*, SCH_SHEET_PATH>> labelMap;
for( const std::pair<NET_NAME_CODE_CACHE_KEY, std::vector<CONNECTION_SUBGRAPH*>> net : nets )
for( const std::pair<NET_NAME_CODE_CACHE_KEY, std::vector<CONNECTION_SUBGRAPH*>> net : m_nets )
{
for( CONNECTION_SUBGRAPH* subgraph : net.second )
{
@@ -942,9 +936,7 @@ int ERC_TESTER::TestLibSymbolIssues()
wxString msg;
int err_count = 0;
SCH_SCREENS screens( m_schematic->Root() );
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
for( SCH_SCREEN* screen = m_screens.GetFirst(); screen; screen = m_screens.GetNext() )
{
std::vector<SCH_MARKER*> markers;
@@ -1027,11 +1019,9 @@ int ERC_TESTER::TestLibSymbolIssues()
int ERC_TESTER::TestOffGridEndpoints()
{
const int gridSize = m_schematic->Settings().m_ConnectionGridSize;
int err_count = 0;
SCH_SCREENS screens( m_schematic->Root() );
int err_count = 0;
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
for( SCH_SCREEN* screen = m_screens.GetFirst(); screen; screen = m_screens.GetNext() )
{
std::vector<SCH_MARKER*> markers;
@@ -1093,11 +1083,10 @@ int ERC_TESTER::TestSimModelIssues()
{
wxString msg;
WX_STRING_REPORTER reporter( &msg );
SCH_SHEET_LIST sheets = m_schematic->GetSheets();
int err_count = 0;
SIM_LIB_MGR libMgr( &m_schematic->Prj() );
for( SCH_SHEET_PATH& sheet : sheets )
for( SCH_SHEET_PATH& sheet : m_sheetList )
{
std::vector<SCH_MARKER*> markers;
+14 -4
View File
@@ -27,9 +27,10 @@
#define ERC_H
#include <erc_settings.h>
#include <sch_screen.h>
#include <connection_graph.h>
class SCH_SHEET_LIST;
class SCHEMATIC;
class DS_PROXY_VIEW_ITEM;
class SCH_EDIT_FRAME;
@@ -47,8 +48,13 @@ class ERC_TESTER
public:
ERC_TESTER( SCHEMATIC* aSchematic ) :
m_schematic( aSchematic )
m_schematic( aSchematic ),
m_settings( aSchematic->ErcSettings() ),
m_sheetList( aSchematic->GetSheets() ),
m_screens( aSchematic->Root() ),
m_nets( aSchematic->ConnectionGraph()->GetNetMap() )
{
m_sheetList.GetMultiUnitSymbols( m_refMap, true );
}
/**
@@ -139,8 +145,12 @@ public:
KIFACE* aCvPcb, PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter );
private:
SCHEMATIC* m_schematic;
SCHEMATIC* m_schematic;
ERC_SETTINGS& m_settings;
SCH_SHEET_LIST m_sheetList;
SCH_SCREENS m_screens;
SCH_MULTI_UNIT_REFERENCE_MAP m_refMap;
const NET_MAP& m_nets;
};
+2 -2
View File
@@ -30,13 +30,13 @@
#include <erc_sch_pin_context.h>
SCH_PIN* ERC_SCH_PIN_CONTEXT::Pin()
SCH_PIN* ERC_SCH_PIN_CONTEXT::Pin() const
{
return m_pin;
}
SCH_SHEET_PATH& ERC_SCH_PIN_CONTEXT::Sheet()
const SCH_SHEET_PATH& ERC_SCH_PIN_CONTEXT::Sheet() const
{
return m_sheet;
}
+2 -2
View File
@@ -56,12 +56,12 @@ public:
/**
* Get the SCH_PIN for this context.
*/
SCH_PIN* Pin();
SCH_PIN* Pin() const;
/**
* Get the #SCH_SHEET_PATH context for the paired #SCH_PIN.
*/
SCH_SHEET_PATH& Sheet();
const SCH_SHEET_PATH& Sheet() const;
/**
* Test two pin contexts for equality based on the deterministic hash.
+3 -4
View File
@@ -53,11 +53,10 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn( const wxString& aFieldName, const
void FIELDS_EDITOR_GRID_DATA_MODEL::updateDataStoreSymbolField( const SCH_SYMBOL& aSymbol,
const wxString& aFieldName )
{
if( const SCH_FIELD* field = aSymbol.GetFieldByName( aFieldName ) )
m_dataStore[aSymbol.m_Uuid][aFieldName] = field->GetText();
else if( isAttribute( aFieldName ) )
if( isAttribute( aFieldName ) )
m_dataStore[aSymbol.m_Uuid][aFieldName] = getAttributeValue( aSymbol, aFieldName );
else if( const SCH_FIELD* field = aSymbol.GetFieldByName( aFieldName ) )
m_dataStore[aSymbol.m_Uuid][aFieldName] = field->GetText();
// Handle fields with variables as names that are not present in the symbol
// by giving them the correct value
else if( IsTextVar( aFieldName ) )
+7 -5
View File
@@ -946,13 +946,15 @@ void FIELDS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
if( event.GetId() == MYID_SELECT_FOOTPRINT )
{
// pick a footprint using the footprint picker.
wxString fpid = m_grid->GetCellValue( FOOTPRINT_FIELD, FDC_VALUE );
KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg );
wxString fpid = m_grid->GetCellValue( FOOTPRINT_FIELD, FDC_VALUE );
if( frame->ShowModal( &fpid, m_dlg ) )
m_grid->SetCellValue( FOOTPRINT_FIELD, FDC_VALUE, fpid );
if( KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg ) )
{
if( frame->ShowModal( &fpid, m_dlg ) )
m_grid->SetCellValue( FOOTPRINT_FIELD, FDC_VALUE, fpid );
frame->Destroy();
frame->Destroy();
}
}
else if (event.GetId() == MYID_SHOW_DATASHEET )
{
+22 -5
View File
@@ -61,6 +61,7 @@
#include <tools/sch_editor_control.h>
#include <tools/sch_navigate_tool.h>
#include <trace_helpers.h>
#include <widgets/filedlg_import_non_kicad.h>
#include <widgets/wx_infobar.h>
#include <wildcards_and_files_ext.h>
#include <drawing_sheet/ds_data_model.h>
@@ -145,6 +146,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// unload current project file before loading new
{
ClearUndoRedoList();
ClearRepeatItemsList();
SetScreen( nullptr );
m_toolManager->GetTool<EE_INSPECTION_TOOL>()->Reset( TOOL_BASE::SUPERMODEL_RELOAD );
CreateScreens();
@@ -179,7 +181,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
CreateScreens();
}
SCH_IO_MGR::SCH_FILE_T schFileType = SCH_IO_MGR::GuessPluginTypeFromSchPath( fullFileName );
SCH_IO_MGR::SCH_FILE_T schFileType = SCH_IO_MGR::GuessPluginTypeFromSchPath( fullFileName, KICTL_KICAD_ONLY );
if( schFileType == SCH_IO_MGR::SCH_LEGACY )
{
@@ -229,7 +231,10 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
if( schFileType == SCH_IO_MGR::SCH_FILE_T::SCH_FILE_UNKNOWN )
{
msg.Printf( _( "Unsupported schematic file '%s'." ), fullFileName );
msg.Printf( _( "'%s' is not a KiCad schematic file.\nUse File -> Import for "
"non-KiCad schematic files." ),
fullFileName );
progressReporter.Hide();
DisplayErrorMessage( this, msg );
}
@@ -730,12 +735,18 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
wxFileDialog dlg( this, _( "Import Schematic" ), path, wxEmptyString, fileFiltersStr,
wxFD_OPEN | wxFD_FILE_MUST_EXIST ); // TODO
FILEDLG_IMPORT_NON_KICAD importOptions( eeconfig()->m_System.show_import_issues );
dlg.SetCustomizeHook( importOptions );
if( dlg.ShowModal() == wxID_CANCEL )
return;
eeconfig()->m_System.show_import_issues = importOptions.GetShowIssues();
// Don't leave dangling pointers to previously-opened document.
m_toolManager->GetTool<EE_SELECTION_TOOL>()->ClearSelection();
ClearUndoRedoList();
ClearRepeatItemsList();
if( setProject )
{
@@ -1069,7 +1080,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
// File doesn't exist yet; true if we just imported something
updateFileHistory = true;
}
else if( !Schematic().GetSheets().IsModified() )
else if( !IsContentModified() )
{
return true;
}
@@ -1383,7 +1394,11 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType,
std::placeholders::_1 ) );
}
pi->SetReporter( errorReporter.m_Reporter );
if( eeconfig()->m_System.show_import_issues )
pi->SetReporter( errorReporter.m_Reporter );
else
pi->SetReporter( &NULL_REPORTER::GetInstance() );
pi->SetProgressReporter( &progressReporter );
SCH_SHEET* loadedSheet =
@@ -1452,6 +1467,7 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType,
}
ClearUndoRedoList();
ClearRepeatItemsList();
initScreenZoom();
SetSheetNumberAndCount();
@@ -1650,7 +1666,8 @@ void SCH_EDIT_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName )
}
// Attempt to back up the last schematic file before overwriting it with the auto
// save file.
else if( !wxCopyFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
else if( recoveredFn.Exists()
&& !wxCopyFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
{
unrecoveredFiles.Add( recoveredFn.GetFullPath() );
}
+5
View File
@@ -664,6 +664,11 @@ static struct LIB_FIELD_DESC
propMgr.Mask( TYPE_HASH( LIB_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Width" ) );
propMgr.Mask( TYPE_HASH( LIB_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Height" ) );
propMgr.AddProperty( new PROPERTY<LIB_FIELD, int>(
_HKI( "Text Size" ), &LIB_FIELD::SetLibTextSize,
&LIB_FIELD::GetLibTextSize, PROPERTY_DISPLAY::PT_SIZE ),
_HKI( "Text Properties" ) );
propMgr.Mask( TYPE_HASH( LIB_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Orientation" ) );
}
} _LIB_FIELD_DESC;
+3
View File
@@ -161,6 +161,9 @@ public:
wxString GetShownText( bool aAllowExtraText, int aDepth = 0 ) const override;
int GetLibTextSize() const { return GetTextWidth(); }
void SetLibTextSize( int aSize ) { SetTextSize( VECTOR2I( aSize, aSize ) ); }
SCH_LAYER_ID GetDefaultLayer() const;
void BeginEdit( const VECTOR2I& aStartPoint ) override;
+1
View File
@@ -669,6 +669,7 @@ std::unique_ptr< LIB_SYMBOL > LIB_SYMBOL::Flatten() const
retv->SetExcludedFromBoard( parent->GetExcludedFromBoard() );
retv->UpdateFieldOrdinals();
retv->m_parent.reset();
}
else
{
+1
View File
@@ -159,6 +159,7 @@ public:
virtual void SetName( const wxString& aName );
wxString GetName() const override { return m_name; }
const LIB_ID& LibId() const { return m_libId; }
LIB_ID& LibId() { return m_libId; }
LIB_ID GetLibId() const override { return m_libId; }
void SetLibId( const LIB_ID& aLibId ) { m_libId = aLibId; }
+8 -5
View File
@@ -171,7 +171,8 @@ static wxString GetNetNavigatorItemText( const SCH_ITEM* aItem,
void SCH_EDIT_FRAME::MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
const NET_NAVIGATOR_ITEM_DATA* aSelection )
const NET_NAVIGATOR_ITEM_DATA* aSelection,
bool aSingleSheetSchematic )
{
wxCHECK( !aNetName.IsEmpty(), /* void */ );
wxCHECK( m_schematic, /* void */ );
@@ -206,7 +207,7 @@ void SCH_EDIT_FRAME::MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemI
m_netNavigator->SelectItem( sheetId );
// If there is only one sheet in the schematic, always expand the sheet tree.
if( Schematic().GetSheets().size() == 1 )
if( aSingleSheetSchematic )
expandId = sheetId;
for( const SCH_ITEM* item : subGraph->GetItems() )
@@ -243,6 +244,8 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
if( m_netNavigator->IsEmpty() && m_highlightedConn.IsEmpty() )
return;
bool singleSheetSchematic = m_schematic->GetUnorderedSheets().size() == 1;
if( !m_netNavigator->IsEmpty() && m_highlightedConn.IsEmpty() )
{
m_netNavigator->DeleteAllItems();
@@ -259,7 +262,7 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection );
MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection, singleSheetSchematic );
}
else
{
@@ -273,14 +276,14 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
m_netNavigator->DeleteAllItems();
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
MakeNetNavigatorNode( m_highlightedConn, rootId, itemData );
MakeNetNavigatorNode( m_highlightedConn, rootId, itemData, singleSheetSchematic );
}
}
else
{
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection );
MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection, singleSheetSchematic );
}
}
@@ -84,8 +84,7 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName,
if( symbol->GetLibSymbolRef()
&& symbol->GetLibSymbolRef()->GetFPFilters().GetCount() != 0 )
{
cmpList.push_back( SCH_REFERENCE( symbol, symbol->GetLibSymbolRef().get(),
sheet ) );
cmpList.push_back( SCH_REFERENCE( symbol, sheet ) );
}
footprint = symbol->GetFootprintFieldText( true, &sheet, false );
@@ -479,7 +479,8 @@ void NETLIST_EXPORTER_SPICE::readModel( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSym
auto spiceGenerator = static_cast<const SPICE_GENERATOR_KIBIS&>( kibisModel->SpiceGenerator() );
std::string modelData = spiceGenerator.IbisDevice(
aItem, m_schematic->Prj(), cacheFn.GetPath( wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR ) );
aItem, m_schematic->Prj(),
cacheFn.GetPath( wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR ), aReporter );
cacheFile.Write( wxString( modelData ) );
m_rawIncludes.insert( cacheFn.GetFullPath() );
+89 -82
View File
@@ -23,7 +23,6 @@
#include <bitmaps.h>
#include <cstddef>
#include <core/arraydim.h>
#include <magic_enum.hpp>
#include <lib_pin.h>
#include "pgm_base.h"
@@ -47,56 +46,18 @@ struct pinTypeStruct
BITMAPS bitmap;
};
std::map<ELECTRICAL_PINTYPE, struct pinTypeStruct> g_pinTypes = {
{ ELECTRICAL_PINTYPE::PT_INPUT, { _( "Input" ), BITMAPS::pintype_input } },
{ ELECTRICAL_PINTYPE::PT_OUTPUT, { _( "Output" ), BITMAPS::pintype_output } },
{ ELECTRICAL_PINTYPE::PT_BIDI, { _( "Bidirectional" ), BITMAPS::pintype_bidi } },
{ ELECTRICAL_PINTYPE::PT_TRISTATE, { _( "Tri-state" ), BITMAPS::pintype_3states } },
{ ELECTRICAL_PINTYPE::PT_PASSIVE, { _( "Passive" ), BITMAPS::pintype_passive } },
{ ELECTRICAL_PINTYPE::PT_NIC, { _( "Free" ), BITMAPS::pintype_nic } },
{ ELECTRICAL_PINTYPE::PT_UNSPECIFIED, { _( "Unspecified" ), BITMAPS::pintype_notspecif } },
{ ELECTRICAL_PINTYPE::PT_POWER_IN, { _( "Power input" ), BITMAPS::pintype_powerinput } },
{ ELECTRICAL_PINTYPE::PT_POWER_OUT, { _( "Power output" ), BITMAPS::pintype_poweroutput } },
{ ELECTRICAL_PINTYPE::PT_OPENCOLLECTOR,{ _( "Open collector" ), BITMAPS::pintype_opencoll } },
{ ELECTRICAL_PINTYPE::PT_OPENEMITTER, { _( "Open emitter" ), BITMAPS::pintype_openemit } },
{ ELECTRICAL_PINTYPE::PT_NC, { _( "Unconnected" ), BITMAPS::pintype_noconnect } },
};
int g_pinTypesLanguage = wxLANGUAGE_UNKNOWN;
struct pinShapeStruct
{
wxString name;
BITMAPS bitmap;
};
// clang-format off
const std::map<GRAPHIC_PINSHAPE, struct pinShapeStruct> pinShapes = {
{ GRAPHIC_PINSHAPE::LINE, { _( "Line" ), BITMAPS::pinshape_normal } },
{ GRAPHIC_PINSHAPE::INVERTED, { _( "Inverted" ), BITMAPS::pinshape_invert } },
{ GRAPHIC_PINSHAPE::CLOCK, { _( "Clock" ), BITMAPS::pinshape_clock_normal } },
{ GRAPHIC_PINSHAPE::INVERTED_CLOCK, { _( "Inverted clock" ), BITMAPS::pinshape_clock_invert } },
{ GRAPHIC_PINSHAPE::INPUT_LOW, { _( "Input low" ), BITMAPS::pinshape_active_low_input } },
{ GRAPHIC_PINSHAPE::CLOCK_LOW, { _( "Clock low" ), BITMAPS::pinshape_clock_active_low } },
{ GRAPHIC_PINSHAPE::OUTPUT_LOW, { _( "Output low" ), BITMAPS::pinshape_active_low_output } },
{ GRAPHIC_PINSHAPE::FALLING_EDGE_CLOCK, { _( "Falling edge clock" ), BITMAPS::pinshape_clock_fall } },
{ GRAPHIC_PINSHAPE::NONLOGIC, { _( "NonLogic" ), BITMAPS::pinshape_nonlogic } },
};
// clang-format on
static std::map<ELECTRICAL_PINTYPE, struct pinTypeStruct> g_pinElectricalTypes;
static std::map<GRAPHIC_PINSHAPE, struct pinShapeStruct> g_pinShapes;
static std::map<PIN_ORIENTATION, struct pinShapeStruct> g_pinOrientations;
// clang-format off
std::map<PIN_ORIENTATION, struct pinShapeStruct> pinOrientations = {
{ PIN_ORIENTATION::PIN_RIGHT, { _( "Right" ), BITMAPS::pinorient_right } },
{ PIN_ORIENTATION::PIN_LEFT, { _( "Left" ), BITMAPS::pinorient_left } },
{ PIN_ORIENTATION::PIN_UP, { _( "Up" ), BITMAPS::pinorient_up } },
{ PIN_ORIENTATION::PIN_DOWN, { _( "Down" ), BITMAPS::pinorient_down } },
};
// clang-format on
static int g_language = wxLANGUAGE_UNKNOWN;
PIN_ORIENTATION PinOrientationCode( size_t index )
@@ -119,18 +80,65 @@ int PinOrientationIndex( PIN_ORIENTATION code )
void InitTables()
{
// clang-format off
g_pinElectricalTypes = {
{ ELECTRICAL_PINTYPE::PT_INPUT, { _( "Input" ), BITMAPS::pintype_input } },
{ ELECTRICAL_PINTYPE::PT_OUTPUT, { _( "Output" ), BITMAPS::pintype_output } },
{ ELECTRICAL_PINTYPE::PT_BIDI, { _( "Bidirectional" ), BITMAPS::pintype_bidi } },
{ ELECTRICAL_PINTYPE::PT_TRISTATE, { _( "Tri-state" ), BITMAPS::pintype_3states } },
{ ELECTRICAL_PINTYPE::PT_PASSIVE, { _( "Passive" ), BITMAPS::pintype_passive } },
{ ELECTRICAL_PINTYPE::PT_NIC, { _( "Free" ), BITMAPS::pintype_nic } },
{ ELECTRICAL_PINTYPE::PT_UNSPECIFIED, { _( "Unspecified" ), BITMAPS::pintype_notspecif } },
{ ELECTRICAL_PINTYPE::PT_POWER_IN, { _( "Power input" ), BITMAPS::pintype_powerinput } },
{ ELECTRICAL_PINTYPE::PT_POWER_OUT, { _( "Power output" ), BITMAPS::pintype_poweroutput } },
{ ELECTRICAL_PINTYPE::PT_OPENCOLLECTOR, { _( "Open collector" ), BITMAPS::pintype_opencoll } },
{ ELECTRICAL_PINTYPE::PT_OPENEMITTER, { _( "Open emitter" ), BITMAPS::pintype_openemit } },
{ ELECTRICAL_PINTYPE::PT_NC, { _( "Unconnected" ), BITMAPS::pintype_noconnect } },
};
g_pinShapes = {
{ GRAPHIC_PINSHAPE::LINE, { _( "Line" ), BITMAPS::pinshape_normal } },
{ GRAPHIC_PINSHAPE::INVERTED, { _( "Inverted" ), BITMAPS::pinshape_invert } },
{ GRAPHIC_PINSHAPE::CLOCK, { _( "Clock" ), BITMAPS::pinshape_clock_normal } },
{ GRAPHIC_PINSHAPE::INVERTED_CLOCK, { _( "Inverted clock" ), BITMAPS::pinshape_clock_invert } },
{ GRAPHIC_PINSHAPE::INPUT_LOW, { _( "Input low" ), BITMAPS::pinshape_active_low_input } },
{ GRAPHIC_PINSHAPE::CLOCK_LOW, { _( "Clock low" ), BITMAPS::pinshape_clock_active_low } },
{ GRAPHIC_PINSHAPE::OUTPUT_LOW, { _( "Output low" ), BITMAPS::pinshape_active_low_output } },
{ GRAPHIC_PINSHAPE::FALLING_EDGE_CLOCK, { _( "Falling edge clock" ), BITMAPS::pinshape_clock_fall } },
{ GRAPHIC_PINSHAPE::NONLOGIC, { _( "NonLogic" ), BITMAPS::pinshape_nonlogic } },
};
g_pinOrientations = {
{ PIN_ORIENTATION::PIN_RIGHT, { _( "Right" ), BITMAPS::pinorient_right } },
{ PIN_ORIENTATION::PIN_LEFT, { _( "Left" ), BITMAPS::pinorient_left } },
{ PIN_ORIENTATION::PIN_UP, { _( "Up" ), BITMAPS::pinorient_up } },
{ PIN_ORIENTATION::PIN_DOWN, { _( "Down" ), BITMAPS::pinorient_down } },
};
// clang-format on
g_language = Pgm().GetSelectedLanguageIdentifier();
g_typeIcons.clear();
g_typeNames.clear();
for( unsigned i = 0; i < ELECTRICAL_PINTYPES_TOTAL; ++i )
{
g_typeIcons.push_back( ElectricalPinTypeGetBitmap( static_cast<ELECTRICAL_PINTYPE>( i ) ) );
g_typeNames.push_back( ElectricalPinTypeGetText( static_cast<ELECTRICAL_PINTYPE>( i ) ) );
}
g_shapeIcons.clear();
g_shapeNames.clear();
for( unsigned i = 0; i < GRAPHIC_PINSHAPES_TOTAL; ++i )
{
g_shapeIcons.push_back( PinShapeGetBitmap( static_cast<GRAPHIC_PINSHAPE>( i ) ) );
g_shapeNames.push_back( PinShapeGetText( static_cast<GRAPHIC_PINSHAPE>( i ) ) );
}
g_orientationIcons.clear();
g_orientationNames.clear();
for( PIN_ORIENTATION orientation : magic_enum::enum_values<PIN_ORIENTATION>() )
{
g_orientationIcons.push_back( PinOrientationGetBitmap( orientation ) );
@@ -141,7 +149,7 @@ void InitTables()
const wxArrayString& PinTypeNames()
{
if( g_typeNames.empty() )
if( g_typeNames.empty() || g_language != Pgm().GetSelectedLanguageIdentifier() )
InitTables();
return g_typeNames;
@@ -159,7 +167,7 @@ const std::vector<BITMAPS>& PinTypeIcons()
const wxArrayString& PinShapeNames()
{
if( g_shapeNames.empty() )
if( g_shapeNames.empty() || g_language != Pgm().GetSelectedLanguageIdentifier() )
InitTables();
return g_shapeNames;
@@ -177,7 +185,7 @@ const std::vector<BITMAPS>& PinShapeIcons()
const wxArrayString& PinOrientationNames()
{
if( g_orientationNames.empty() )
if( g_orientationNames.empty() || g_language != Pgm().GetSelectedLanguageIdentifier() )
InitTables();
return g_orientationNames;
@@ -195,78 +203,77 @@ const std::vector<BITMAPS>& PinOrientationIcons()
wxString ElectricalPinTypeGetText( ELECTRICAL_PINTYPE aType )
{
if( g_pinTypesLanguage != Pgm().GetSelectedLanguageIdentifier() )
{
g_pinTypes[ELECTRICAL_PINTYPE::PT_INPUT].name = _( "Input" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OUTPUT].name = _( "Output" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_BIDI].name = _( "Bidirectional" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_TRISTATE].name = _( "Tri-state" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_PASSIVE].name = _( "Passive" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_NIC].name = _( "Free" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_UNSPECIFIED].name = _( "Unspecified" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_POWER_IN].name = _( "Power input" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_POWER_OUT].name = _( "Power output" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OPENCOLLECTOR].name = _( "Open collector" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OPENEMITTER].name = _( "Open emitter" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_NC].name = _( "Unconnected" );
if( g_pinElectricalTypes.empty() || g_language != Pgm().GetSelectedLanguageIdentifier() )
InitTables();
g_pinTypesLanguage = Pgm().GetSelectedLanguageIdentifier();
}
auto it = g_pinElectricalTypes.find( aType );
auto findIt = g_pinTypes.find( aType );
wxCHECK_MSG( it != g_pinElectricalTypes.end(), wxT( "???" ), wxT( "Pin type not found!" ) );
wxCHECK_MSG( findIt != g_pinTypes.end(), wxT( "???" ), wxT( "Pin type not found!" ) );
return findIt->second.name;
return it->second.name;
}
BITMAPS ElectricalPinTypeGetBitmap( ELECTRICAL_PINTYPE aType )
{
auto findIt = g_pinTypes.find( aType );
if( g_pinElectricalTypes.empty() )
InitTables();
wxCHECK_MSG( findIt != g_pinTypes.end(), BITMAPS::INVALID_BITMAP, wxT( "Pin type not found!" ) );
auto it = g_pinElectricalTypes.find( aType );
return findIt->second.bitmap;
wxCHECK_MSG( it != g_pinElectricalTypes.end(), BITMAPS::INVALID_BITMAP, wxT( "Pin type not found!" ) );
return it->second.bitmap;
}
wxString PinShapeGetText( GRAPHIC_PINSHAPE aShape )
{
auto findIt = pinShapes.find( aShape );
if( g_pinShapes.empty() || g_language != Pgm().GetSelectedLanguageIdentifier() )
InitTables();
wxCHECK_MSG( findIt != pinShapes.end(), wxT( "?" ), wxT( "Pin type not found!" ) );
auto it = g_pinShapes.find( aShape );
return findIt->second.name;
wxCHECK_MSG( it != g_pinShapes.end(), wxT( "?" ), wxT( "Pin type not found!" ) );
return it->second.name;
}
BITMAPS PinShapeGetBitmap( GRAPHIC_PINSHAPE aShape )
{
auto findIt = pinShapes.find( aShape );
if( g_pinShapes.empty() )
InitTables();
wxCHECK_MSG( findIt != pinShapes.end(), BITMAPS::INVALID_BITMAP, wxT( "Pin type not found!" ) );
auto it = g_pinShapes.find( aShape );
return findIt->second.bitmap;
wxCHECK_MSG( it != g_pinShapes.end(), BITMAPS::INVALID_BITMAP, wxT( "Pin type not found!" ) );
return it->second.bitmap;
}
wxString PinOrientationName( PIN_ORIENTATION aOrientation )
{
auto findIt = pinOrientations.find( aOrientation );
if( g_pinOrientations.empty() || g_language != Pgm().GetSelectedLanguageIdentifier() )
InitTables();
wxCHECK_MSG( findIt != pinOrientations.end(), wxT( "?" ), wxT( "Pin orientation not found!" ) );
auto it = g_pinOrientations.find( aOrientation );
return findIt->second.name;
wxCHECK_MSG( it != g_pinOrientations.end(), wxT( "?" ), wxT( "Pin orientation not found!" ) );
return it->second.name;
}
BITMAPS PinOrientationGetBitmap( PIN_ORIENTATION aOrientation )
{
auto findIt = pinOrientations.find( aOrientation );
if( g_pinOrientations.empty() )
InitTables();
wxCHECK_MSG( findIt != pinOrientations.end(), BITMAPS::INVALID_BITMAP,
wxT( "Pin orientation not found!" ) );
auto it = g_pinOrientations.find( aOrientation );
return findIt->second.bitmap;
wxCHECK_MSG( it != g_pinOrientations.end(), BITMAPS::INVALID_BITMAP, wxT( "Pin orientation not found!" ) );
return it->second.bitmap;
}
+12 -1
View File
@@ -209,9 +209,20 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
schematic = schItem->Schematic();
if( schItem->IsSelected() )
{
selectedModified = true;
}
else
{
schItem->RunOnChildren(
[&selectedModified]( SCH_ITEM* aChild )
{
if( aChild->IsSelected() )
selectedModified = true;
} );
}
auto updateConnectivityFlag = [&, this]()
auto updateConnectivityFlag = [&]()
{
if( schItem->IsConnectable() )
{
+12 -10
View File
@@ -404,6 +404,11 @@ SCH_EDIT_FRAME::~SCH_EDIT_FRAME()
if( m_schematic )
m_schematic->RemoveAllListeners();
// Delete all items not in draw list before deleting schematic
// to avoid dangling pointers stored in these items
ClearUndoRedoList();
ClearRepeatItemsList();
delete m_schematic;
m_schematic = nullptr;
@@ -774,7 +779,7 @@ void SCH_EDIT_FRAME::AddCopyForRepeatItem( const SCH_ITEM* aItem )
EDA_ITEM* SCH_EDIT_FRAME::GetItem( const KIID& aId ) const
{
return Schematic().GetSheets().GetItem( aId );
return Schematic().GetItem( aId );
}
@@ -894,7 +899,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
// Shutdown blocks must be determined and vetoed as early as possible
if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION
&& Schematic().GetSheets().IsModified() )
&& IsContentModified() )
{
return false;
}
@@ -942,9 +947,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
if( !Schematic().IsValid() )
return false;
SCH_SHEET_LIST sheetlist = Schematic().GetSheets();
if( sheetlist.IsModified() )
if( IsContentModified() )
{
wxFileName fileName = Schematic().RootScreen()->GetFileName();
wxString msg = _( "Save changes to '%s' before closing?" );
@@ -965,7 +968,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
void SCH_EDIT_FRAME::doCloseWindow()
{
SCH_SHEET_LIST sheetlist = Schematic().GetSheets();
SCH_SHEET_LIST sheetlist = Schematic().GetUnorderedSheets();
// Shutdown all running tools
if( m_toolManager )
@@ -1057,7 +1060,7 @@ void SCH_EDIT_FRAME::doCloseWindow()
// Make sure local settings are persisted
SaveProjectLocalSettings();
Schematic().RootScreen()->Clear();
Schematic().RootScreen()->Clear( true );
// all sub sheets are deleted, only the main sheet is usable
GetCurrentSheet().clear();
@@ -2037,7 +2040,7 @@ const BOX2I SCH_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
bool SCH_EDIT_FRAME::IsContentModified() const
{
return Schematic().GetSheets().IsModified();
return Schematic().GetUnorderedSheets().IsModified();
}
@@ -2052,9 +2055,8 @@ void SCH_EDIT_FRAME::FocusOnItem( SCH_ITEM* aItem )
{
static KIID lastBrightenedItemID( niluuid );
SCH_SHEET_LIST sheetList = Schematic().GetSheets();
SCH_SHEET_PATH dummy;
SCH_ITEM* lastItem = sheetList.GetItem( lastBrightenedItemID, &dummy );
SCH_ITEM* lastItem = Schematic().GetItem( lastBrightenedItemID, &dummy );
if( lastItem && lastItem != aItem )
{
+12 -2
View File
@@ -545,7 +545,7 @@ public:
* @param aSchematicFileName is the absolute path and file name of the file to test.
* @return true if the user accepts the potential file name clash risk.
*/
bool AllowCaseSensitiveFileNameClashes( const wxString& aSchematicFileName );
bool AllowCaseSensitiveFileNameClashes( const wxString& aOldName, const wxString& aSchematicFileName );
/**
* Edit an existing sheet or add a new sheet to the schematic.
@@ -710,6 +710,15 @@ public:
return m_items_to_repeat;
}
/**
* Clear the list of items which are to be repeated with the insert key.
* These objects are owned by this container.
*/
void ClearRepeatItemsList()
{
m_items_to_repeat.clear();
}
EDA_ITEM* GetItem( const KIID& aId ) const override;
/**
@@ -866,7 +875,8 @@ public:
void RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
void MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
const NET_NAVIGATOR_ITEM_DATA* aSelection,
bool aSingleSheetSchematic );
void SelectNetNavigatorItem( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
+36 -5
View File
@@ -195,15 +195,30 @@ wxString SCH_FIELD::GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraT
return symbol->ResolveTextVar( aPath, token, aDepth + 1 );
};
std::function<bool( wxString* )> schematicResolver =
[&]( wxString* token ) -> bool
{
if( SCHEMATIC* schematic = Schematic() )
return schematic->ResolveTextVar( aPath, token, aDepth + 1 );
return false;
};
std::function<bool( wxString* )> sheetResolver =
[&]( wxString* token ) -> bool
{
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( m_parent );
SCHEMATIC* schematic = Schematic();
SCH_SHEET_PATH path = *aPath;
path.push_back( sheet );
return sheet->ResolveTextVar( &path, token, aDepth + 1 );
bool retval = sheet->ResolveTextVar( &path, token, aDepth + 1 );
if( schematic )
retval |= schematic->ResolveTextVar( &path, token, aDepth + 1 );
return retval;
};
std::function<bool( wxString* )> labelResolver =
@@ -222,7 +237,8 @@ wxString SCH_FIELD::GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraT
{
text = wxS( "" );
}
else if( HasTextVars() )
for( int ii = 0; ii < 10 && text.Contains( wxT( "${" ) ); ++ii )
{
if( aDepth < 10 )
{
@@ -233,7 +249,10 @@ wxString SCH_FIELD::GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraT
else if( m_parent && m_parent->IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
text = ExpandTextVars( text, &labelResolver );
else if( Schematic() )
{
text = ExpandTextVars( text, &Schematic()->Prj() );
text = ExpandTextVars( text, &schematicResolver );
}
}
}
@@ -740,11 +759,10 @@ void SCH_FIELD::OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks,
}
else
{
SCH_SHEET_LIST sheets = schematic->GetSheets();
SCH_REFERENCE_LIST refs;
SCH_SYMBOL* refSymbol = nullptr;
sheets.GetSymbols( refs );
schematic->GetUnorderedSheets().GetSymbols( refs );
for( size_t jj = 0; jj < refs.GetCount(); jj++ )
{
@@ -998,7 +1016,11 @@ void SCH_FIELD::SetText( const wxString& aText )
if( m_isNamedVariable )
return;
EDA_TEXT::SetText( aText );
// Mandatory fields should not have leading or trailing whitespace.
if( IsMandatory() )
EDA_TEXT::SetText( aText.Strip( wxString::both ) );
else
EDA_TEXT::SetText( aText );
}
@@ -1291,6 +1313,15 @@ VECTOR2I SCH_FIELD::GetParentPosition() const
}
bool SCH_FIELD::IsMandatory() const
{
if( m_parent && m_parent->Type() == SCH_SHEET_T )
return m_id >= 0 && m_id < SHEET_MANDATORY_FIELDS;
else
return m_id >= 0 && m_id < MANDATORY_FIELDS;
}
bool SCH_FIELD::operator <( const SCH_ITEM& aItem ) const
{
if( Type() != aItem.Type() )
+2
View File
@@ -209,6 +209,8 @@ public:
*/
void ImportValues( const LIB_FIELD& aSource );
bool IsMandatory() const;
int GetPenWidth() const override;
void ClearCaches() override;
+7 -1
View File
@@ -460,7 +460,8 @@ ASCH_ROUND_RECTANGLE::ASCH_ROUND_RECTANGLE( const std::map<wxString, wxString>&
ASCH_ARC::ASCH_ARC( const std::map<wxString, wxString>& aProps ) :
ASCH_OWNER_INTERFACE( aProps ),
ASCH_BORDER_INTERFACE( aProps )
ASCH_BORDER_INTERFACE( aProps ),
ASCH_FILL_INTERFACE( aProps )
{
m_IsElliptical = ReadRecord( aProps ) == ALTIUM_SCH_RECORD::ELLIPTICAL_ARC;
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::ARC || m_IsElliptical );
@@ -478,6 +479,11 @@ ASCH_ARC::ASCH_ARC( const std::map<wxString, wxString>& aProps ) :
}
ASCH_PIECHART::ASCH_PIECHART( const std::map<wxString, wxString>& aProps ) :
ASCH_ARC( aProps )
{}
ASCH_ELLIPSE::ASCH_ELLIPSE( const std::map<wxString, wxString>& aProps ) :
ASCH_OWNER_INTERFACE( aProps ),
ASCH_FILL_INTERFACE( aProps ),
+7 -1
View File
@@ -482,7 +482,7 @@ struct ASCH_ROUND_RECTANGLE : ASCH_OWNER_INTERFACE, ASCH_FILL_INTERFACE, ASCH_BO
};
struct ASCH_ARC : ASCH_OWNER_INTERFACE, ASCH_BORDER_INTERFACE
struct ASCH_ARC : ASCH_OWNER_INTERFACE, ASCH_BORDER_INTERFACE, ASCH_FILL_INTERFACE
{
bool m_IsElliptical;
VECTOR2I m_Center;
@@ -495,6 +495,12 @@ struct ASCH_ARC : ASCH_OWNER_INTERFACE, ASCH_BORDER_INTERFACE
};
struct ASCH_PIECHART : ASCH_ARC
{
explicit ASCH_PIECHART( const std::map<wxString, wxString>& aProps );
};
struct ASCH_ELLIPSE : ASCH_OWNER_INTERFACE, ASCH_FILL_INTERFACE, ASCH_BORDER_INTERFACE
{
VECTOR2I Center;
+138 -21
View File
@@ -57,6 +57,7 @@
#include <bezier_curves.h>
#include <compoundfilereader.h>
#include <font/fontconfig.h>
#include <geometry/ellipse.h>
#include <string_utils.h>
#include <sch_edit_frame.h>
@@ -325,6 +326,9 @@ SCH_SHEET* SCH_IO_ALTIUM::LoadSchematicFile( const wxString& aFileName, SCHEMATI
fileName.SetExt( FILEEXT::KiCadSchematicFileExtension );
m_schematic = aSchematic;
// Show the font substitution warnings
fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() );
// Delete on exception, if I own m_rootSheet, according to aAppendToMe
std::unique_ptr<SCH_SHEET> deleter( aAppendToMe ? nullptr : m_rootSheet );
@@ -892,9 +896,9 @@ void SCH_IO_ALTIUM::ParseRecord( int index, std::map<wxString, wxString>& proper
ParseEllipse( properties );
break;
case ALTIUM_SCH_RECORD::PIECHART:
m_reporter->Report( _( "Record 'PIECHART' not handled." ), RPT_SEVERITY_INFO );
break;
case ALTIUM_SCH_RECORD::PIECHART:
ParsePieChart( properties );
break;
case ALTIUM_SCH_RECORD::ROUND_RECTANGLE:
ParseRoundRectangle( properties );
@@ -2152,7 +2156,9 @@ void SCH_IO_ALTIUM::ParseArc( const std::map<wxString, wxString>& aProperties,
circle->SetPosition( elem.m_Center + m_sheetOffset );
circle->SetEnd( circle->GetPosition() + VECTOR2I( arc_radius, 0 ) );
circle->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) );
SetSchShapeLine( elem, circle );
SetSchShapeFillAndColor( elem, circle );
currentScreen->Append( circle );
}
@@ -2168,7 +2174,8 @@ void SCH_IO_ALTIUM::ParseArc( const std::map<wxString, wxString>& aProperties,
arc->SetStart( elem.m_Center + startOffset + m_sheetOffset );
arc->SetArcAngleAndEnd( includedAngle.Normalize(), true );
arc->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) );
SetSchShapeLine( elem, arc );
SetSchShapeFillAndColor( elem, arc );
currentScreen->Append( arc );
}
@@ -2214,6 +2221,7 @@ void SCH_IO_ALTIUM::ParseArc( const std::map<wxString, wxString>& aProperties,
circle->SetEnd( circle->GetPosition() + VECTOR2I( arc_radius, 0 ) );
SetLibShapeLine( elem, circle, ALTIUM_SCH_RECORD::ARC );
SetLibShapeFillAndColor( elem, circle, ALTIUM_SCH_RECORD::ARC, elem.Color );
}
else
{
@@ -2241,6 +2249,7 @@ void SCH_IO_ALTIUM::ParseArc( const std::map<wxString, wxString>& aProperties,
arc->SetArcAngleAndEnd( includedAngle.Normalize(), true );
SetLibShapeLine( elem, arc, ALTIUM_SCH_RECORD::ARC );
SetLibShapeFillAndColor( elem, arc, ALTIUM_SCH_RECORD::ARC, elem.Color );
}
}
}
@@ -2341,6 +2350,92 @@ void SCH_IO_ALTIUM::ParseEllipticalArc( const std::map<wxString, wxString>& aPro
}
void SCH_IO_ALTIUM::ParsePieChart( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol )
{
ParseArc( aProperties, aSymbol );
ASCH_PIECHART elem( aProperties );
int arc_radius = elem.m_Radius;
VECTOR2I center = elem.m_Center;
EDA_ANGLE startAngle( elem.m_EndAngle, DEGREES_T );
EDA_ANGLE endAngle( elem.m_StartAngle, DEGREES_T );
VECTOR2I startOffset( KiROUND( arc_radius * startAngle.Cos() ),
-KiROUND( arc_radius * startAngle.Sin() ) );
VECTOR2I endOffset( KiROUND( arc_radius * endAngle.Cos() ),
-KiROUND( arc_radius * endAngle.Sin() ) );
if( aSymbol.empty() && ShouldPutItemOnSheet( elem.ownerindex ) )
{
SCH_SCREEN* screen = getCurrentScreen();
wxCHECK( screen, /* void */ );
// close polygon
SCH_LINE* line = new SCH_LINE( center + m_sheetOffset, SCH_LAYER_ID::LAYER_NOTES );
line->SetEndPoint( center + startOffset + m_sheetOffset );
line->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) );
line->SetFlags( IS_NEW );
screen->Append( line );
line = new SCH_LINE( center + m_sheetOffset, SCH_LAYER_ID::LAYER_NOTES );
line->SetEndPoint( center + endOffset + m_sheetOffset );
line->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) );
line->SetFlags( IS_NEW );
screen->Append( line );
}
else
{
LIB_SYMBOL* symbol = (int) aSymbol.size() <= elem.ownerpartdisplaymode
? nullptr
: aSymbol[elem.ownerpartdisplaymode];
SCH_SYMBOL* schsym = nullptr;
if( !symbol )
{
const auto& libSymbolIt = m_libSymbols.find( elem.ownerindex );
if( libSymbolIt == m_libSymbols.end() )
{
// TODO: e.g. can depend on Template (RECORD=39
m_reporter->Report( wxString::Format( wxT( "Piechart's owner (%d) not found." ),
elem.ownerindex ),
RPT_SEVERITY_DEBUG );
return;
}
symbol = libSymbolIt->second;
schsym = m_symbols.at( libSymbolIt->first );
}
if( aSymbol.empty() && !IsComponentPartVisible( elem ) )
return;
LIB_SHAPE* line = new LIB_SHAPE( symbol, SHAPE_T::POLY );
symbol->AddDrawItem( line, false );
line->SetUnit( std::max( 0, elem.ownerpartid ) );
if( !schsym )
{
line->AddPoint( center + startOffset );
line->AddPoint( center );
line->AddPoint( center + endOffset );
}
else
{
line->AddPoint( GetRelativePosition( center + startOffset + m_sheetOffset, schsym ) );
line->AddPoint( GetRelativePosition( center + m_sheetOffset, schsym ) );
line->AddPoint( GetRelativePosition( center + endOffset + m_sheetOffset, schsym ) );
}
SetLibShapeLine( elem, line, ALTIUM_SCH_RECORD::LINE );
}
}
void SCH_IO_ALTIUM::ParseEllipse( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol )
{
@@ -3193,8 +3288,8 @@ void SCH_IO_ALTIUM::ParsePowerPort( const std::map<wxString, wxString>& aPropert
{
libSymbol = powerSymbolIt->second; // cache hit
}
else if( LIB_SYMBOL* alreadyLoaded =
m_pi->LoadSymbol( getLibFileName().GetFullPath(), elem.text, m_properties.get() ) )
else if( LIB_SYMBOL* alreadyLoaded = m_pi->LoadSymbol( getLibFileName().GetFullPath(), symName,
m_properties.get() ) )
{
libSymbol = alreadyLoaded;
}
@@ -4210,6 +4305,8 @@ std::map<wxString,LIB_SYMBOL*> SCH_IO_ALTIUM::ParseLibFile( const ALTIUM_COMPOUN
case ALTIUM_SCH_RECORD::ELLIPSE: ParseEllipse( properties, symbols ); break;
case ALTIUM_SCH_RECORD::PIECHART: ParsePieChart( properties, symbols ); break;
case ALTIUM_SCH_RECORD::ROUND_RECTANGLE: ParseRoundRectangle( properties, symbols ); break;
case ALTIUM_SCH_RECORD::ELLIPTICAL_ARC: ParseEllipticalArc( properties, symbols ); break;
@@ -4292,6 +4389,9 @@ long long SCH_IO_ALTIUM::getLibraryTimestamp( const wxString& aLibraryPath ) con
void SCH_IO_ALTIUM::ensureLoadedLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
// Suppress font substitution warnings
fontconfig::FONTCONFIG::SetReporter( nullptr );
if( m_libCache.count( aLibraryPath ) )
{
wxCHECK( m_timestamps.count( aLibraryPath ), /*void*/ );
@@ -4396,20 +4496,40 @@ void SCH_IO_ALTIUM::ParseLibHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchFile,
}
void SCH_IO_ALTIUM::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
void SCH_IO_ALTIUM::doEnumerateSymbolLib( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties,
std::function<void(const wxString&, LIB_SYMBOL*)> aInserter )
{
ensureLoadedLibrary( aLibraryPath, aProperties );
bool powerSymbolsOnly = ( aProperties &&
aProperties->find( SYMBOL_LIB_TABLE::PropPowerSymsOnly )
!= aProperties->end() );
auto it = m_libCache.find( aLibraryPath );
if( it != m_libCache.end() )
{
for( auto& [libnameStr, libSymbol] : it->second )
aSymbolNameList.Add( libnameStr );
}
{
if( powerSymbolsOnly && !libSymbol->IsPower() )
continue;
aInserter( libnameStr, libSymbol );
}
}
}
void SCH_IO_ALTIUM::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
doEnumerateSymbolLib( aLibraryPath, aProperties,
[&]( const wxString& aStr, LIB_SYMBOL* )
{
aSymbolNameList.Add( aStr );
} );
}
@@ -4417,17 +4537,14 @@ void SCH_IO_ALTIUM::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
ensureLoadedLibrary( aLibraryPath, aProperties );
auto it = m_libCache.find( aLibraryPath );
if( it != m_libCache.end() )
{
for( auto& [libnameStr, libSymbol] : it->second )
aSymbolList.push_back( libSymbol );
}
doEnumerateSymbolLib( aLibraryPath, aProperties,
[&]( const wxString&, LIB_SYMBOL* aSymbol )
{
aSymbolList.emplace_back( aSymbol );
} );
}
LIB_SYMBOL* SCH_IO_ALTIUM::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
+4
View File
@@ -152,6 +152,7 @@ private:
void ParseHarnessType( const std::map<wxString, wxString>& aProperties );
void ParseHarnessPort( const ASCH_PORT& aElem );
void ParseHyperlink( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol = nullsym);
void ParsePieChart( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol = nullsym);
void ParseRectangle( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol = nullsym);
void ParseSheetSymbol( int aIndex, const std::map<wxString, wxString>& aProperties );
void ParseSheetEntry( const std::map<wxString, wxString>& aProperties );
@@ -178,6 +179,9 @@ private:
std::map<wxString,LIB_SYMBOL*> ParseLibFile( const ALTIUM_COMPOUND_FILE& aAltiumSchFile );
std::vector<LIB_SYMBOL*> ParseLibComponent( const std::map<wxString, wxString>& aProperties );
void doEnumerateSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties,
std::function<void(const wxString&, LIB_SYMBOL*)> aInserter );
private:
SCH_SHEET* m_rootSheet; // The root sheet of the schematic being loaded..
SCH_SHEET_PATH m_sheetPath;
@@ -22,6 +22,7 @@
#include <sch_io/cadstar/sch_io_cadstar_archive.h>
#include <io/cadstar/cadstar_parts_lib_parser.h>
#include <font/fontconfig.h>
#include <lib_symbol.h>
#include <progress_reporter.h>
#include <project_sch.h>
@@ -68,6 +69,9 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi
{
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );
// Show the font substitution warnings
fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() );
SCH_SHEET* rootSheet = nullptr;
@@ -251,6 +255,9 @@ void SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary( const wxString& aLibraryPath,
wxFileName csafn;
wxString fplibname = "cadstarpcblib";
// Suppress font substitution warnings
fontconfig::FONTCONFIG::SetReporter( nullptr );
if( aProperties && aProperties->count( "csa" ) )
{
csafn = wxFileName( aProperties->at( "csa" ) );
+17 -11
View File
@@ -39,19 +39,21 @@
#include <symbol_library.h>
#include <io/eagle/eagle_parser.h>
#include <string_utils.h>
#include <font/fontconfig.h>
#include <gr_text.h>
#include <lib_shape.h>
#include <lib_id.h>
#include <lib_pin.h>
#include <lib_text.h>
#include <progress_reporter.h>
#include <project.h>
#include <project/net_settings.h>
#include <project_sch.h>
#include <sch_bus_entry.h>
#include <sch_symbol.h>
#include <project/net_settings.h>
#include <sch_edit_frame.h>
#include <sch_junction.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <sch_junction.h>
#include <sch_label.h>
#include <sch_marker.h>
#include <sch_screen.h>
#include <sch_shape.h>
@@ -59,9 +61,9 @@
#include <sch_sheet_path.h>
#include <sch_label.h>
#include <schematic.h>
#include <string_utils.h>
#include <symbol_lib_table.h>
#include <wildcards_and_files_ext.h>
#include <progress_reporter.h>
// Eagle schematic axes are aligned with x increasing left to right and Y increasing bottom to top
@@ -408,6 +410,9 @@ SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC
wxASSERT( !aFileName || aSchematic != nullptr );
LOCALE_IO toggle; // toggles on, then off, the C locale.
// Show the font substitution warnings
fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() );
m_filename = aFileName;
m_schematic = aSchematic;
@@ -582,6 +587,9 @@ long long SCH_IO_EAGLE::getLibraryTimestamp( const wxString& aLibraryPath ) cons
void SCH_IO_EAGLE::ensureLoadedLibrary( const wxString& aLibraryPath )
{
// Suppress font substitution warnings
fontconfig::FONTCONFIG::SetReporter( nullptr );
if( m_eagleLibs.find( m_libName ) != m_eagleLibs.end() )
{
wxCHECK( m_timestamps.count( m_libName ), /*void*/ );
@@ -973,7 +981,7 @@ void SCH_IO_EAGLE::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex )
ReplaceIllegalFileNameChars( &filename );
replace( filename.begin(), filename.end(), ' ', '_' );
wxFileName fn( m_filename );
wxFileName fn( m_schematic->Prj().GetProjectPath() );
fn.SetName( filename );
fn.SetExt( FILEEXT::KiCadSchematicFileExtension );
@@ -1839,9 +1847,10 @@ void SCH_IO_EAGLE::loadInstance( wxXmlNode* aInstanceNode )
SCH_FIELD* valueField = symbol->GetField( VALUE_FIELD );
bool userValue = m_userValue.at( libIdSymbolName );
valueField->SetVisible( part->GetFieldById( VALUE_FIELD )->IsVisible() );
if( userValue && epart->value )
if( epart->value )
{
valueField->SetText( *epart->value );
}
@@ -1953,11 +1962,8 @@ void SCH_IO_EAGLE::loadInstance( wxXmlNode* aInstanceNode )
// Use the instance attribute to determine the reference and value field visibility.
if( einstance.smashed && einstance.smashed.Get() )
{
if( !valueAttributeFound )
symbol->GetField( VALUE_FIELD )->SetVisible( false );
if( !nameAttributeFound )
symbol->GetField( REFERENCE_FIELD )->SetVisible( false );
symbol->GetField( VALUE_FIELD )->SetVisible( valueAttributeFound );
symbol->GetField( REFERENCE_FIELD )->SetVisible( nameAttributeFound );
}
symbol->AddHierarchicalReference( m_sheetPath.Path(), reference, unit );
+97 -95
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2023-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -43,12 +43,27 @@
#include <wx/base64.h>
#include <wx/url.h>
#include <wx/mstream.h>
#include <core/map_helpers.h>
#include <gfx_import_utils.h>
#include <import_gfx/svg_import_plugin.h>
#include <import_gfx/graphics_importer_lib_symbol.h>
#include <import_gfx/graphics_importer_sch.h>
// clang-format off
static const std::vector<wxString> c_attributesWhitelist = { "Datasheet",
"Manufacturer Part",
"Manufacturer",
"BOM_Manufacturer Part",
"BOM_Manufacturer",
"Supplier Part",
"Supplier",
"BOM_Supplier Part",
"BOM_Supplier",
"LCSC Part Name" };
// clang-format on
SCH_EASYEDA_PARSER::SCH_EASYEDA_PARSER( SCHEMATIC* aSchematic,
PROGRESS_REPORTER* aProgressReporter )
{
@@ -561,97 +576,61 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol
wxString fillColor = arr[6].Lower();
//bool locked = arr[8] != wxS( "0" );
VECTOR2D start, end;
VECTOR2D rad( 10, 10 );
bool isFar = false;
bool cw = false;
std::vector<SHAPE_LINE_CHAIN> chains =
ParseLineChains( data, schIUScale.MilsToIU( 10 ), false );
size_t pos = 0;
auto readNumber = [&]( wxString& aOut )
auto transform = []( VECTOR2I aVec )
{
wxUniChar ch = data[pos];
while( ch == ' ' || ch == ',' )
ch = data[++pos];
while( isdigit( ch ) || ch == '.' || ch == '-' )
{
aOut += ch;
pos++;
if( pos == data.size() )
break;
ch = data[pos];
}
return VECTOR2I( aVec.x, -aVec.y );
};
do
for( const SHAPE_LINE_CHAIN& chain : chains )
{
wxUniChar sym = data[pos++];
if( sym == 'M' )
for( int i = 0; i <= chain.PointCount() && i != -1; i = chain.NextShape( i ) )
{
wxString xStr, yStr;
readNumber( xStr );
readNumber( yStr );
if( chain.IsArcStart( i ) )
{
SHAPE_ARC arc = chain.Arc( chain.ArcIndex( i ) );
start = VECTOR2D( Convert( xStr ), Convert( yStr ) );
std::unique_ptr<LIB_SHAPE> shape =
std::make_unique<LIB_SHAPE>( aSymbol, SHAPE_T::ARC );
shape->SetArcGeometry( transform( arc.GetP0() ),
transform( arc.GetArcMid() ),
transform( arc.GetP1() ) );
shape->SetUnit( 0 );
shape->SetStroke( STROKE_PARAMS( ScaleSize( lineWidth ), strokeStyle ) );
if( fillColor != wxS( "none" ) )
{
shape->SetFilled( true );
if( fillColor == strokeColor )
shape->SetFillMode( FILL_T::FILLED_SHAPE );
else
shape->SetFillMode( FILL_T::FILLED_WITH_BG_BODYCOLOR );
}
aSymbol->AddDrawItem( shape.release() );
}
else
{
SEG seg = chain.CSegment( i );
std::unique_ptr<LIB_SHAPE> shape =
std::make_unique<LIB_SHAPE>( aSymbol, SHAPE_T::POLY );
shape->AddPoint( transform( seg.A ) );
shape->AddPoint( transform( seg.B ) );
shape->SetUnit( 0 );
shape->SetStroke( STROKE_PARAMS( ScaleSize( lineWidth ), strokeStyle ) );
aSymbol->AddDrawItem( shape.release() );
}
}
else if( sym == 'A' )
{
wxString radX, radY, unknown, farFlag, cwFlag, endX, endY;
readNumber( radX );
readNumber( radY );
readNumber( unknown );
readNumber( farFlag );
readNumber( cwFlag );
readNumber( endX );
readNumber( endY );
isFar = farFlag == wxS( "1" );
cw = cwFlag == wxS( "1" );
rad = VECTOR2D( Convert( radX ), Convert( radY ) );
end = VECTOR2D( Convert( endX ), Convert( endY ) );
}
} while( pos < data.size() );
VECTOR2D delta = end - start;
double avgRad = ( rad.x + rad.y ) / 2;
double d = delta.EuclideanNorm();
double h = sqrt( std::max( 0.0, avgRad * avgRad - d * d / 4 ) );
//( !far && cw ) => h
//( far && cw ) => -h
//( !far && !cw ) => -h
//( far && !cw ) => h
VECTOR2D arcCenter =
start + delta / 2 + delta.Perpendicular().Resize( ( isFar ^ cw ) ? h : -h );
if( cw )
std::swap( start, end );
std::unique_ptr<LIB_SHAPE> shape = std::make_unique<LIB_SHAPE>( aSymbol, SHAPE_T::ARC );
shape->SetStart( RelPosSym( start ) );
shape->SetEnd( RelPosSym( end ) );
shape->SetCenter( RelPosSym( arcCenter ) );
shape->SetUnit( 0 );
shape->SetStroke( STROKE_PARAMS( ScaleSize( lineWidth ), strokeStyle ) );
if( fillColor != wxS( "none" ) )
{
shape->SetFilled( true );
if( fillColor == strokeColor )
shape->SetFillMode( FILL_T::FILLED_SHAPE );
else
shape->SetFillMode( FILL_T::FILLED_WITH_BG_BODYCOLOR );
}
aSymbol->AddDrawItem( shape.release() );
}
else if( elType == wxS( "R" ) )
{
@@ -962,22 +941,20 @@ LIB_SYMBOL* SCH_EASYEDA_PARSER::ParseSymbol( const VECTOR2D& aOrigi
m_relOrigin = aOrigin;
wxString symbolName = wxS( "Unknown" );
std::optional<wxString> valOpt;
wxString symbolName = wxS( "Unknown" );
if( aParams.find( wxS( "name" ) ) != aParams.end() )
symbolName = aParams.at( wxS( "name" ) );
else if( aParams.find( wxS( "spiceSymbolName" ) ) != aParams.end() )
symbolName = aParams.at( wxS( "spiceSymbolName" ) );
if( valOpt = get_opt( aParams, wxS( "name" ) ) )
symbolName = *valOpt;
else if( valOpt = get_opt( aParams, wxS( "spiceSymbolName" ) ) )
symbolName = *valOpt;
wxString symbolPrefix;
if( aParams.find( wxS( "pre" ) ) != aParams.end() )
symbolPrefix = aParams.at( wxS( "pre" ) );
else if( aParams.find( wxS( "spicePre" ) ) != aParams.end() )
symbolPrefix = aParams.at( wxS( "spicePre" ) );
if( !symbolPrefix.EndsWith( wxS( "?" ) ) )
symbolPrefix += wxS( "?" );
if( valOpt = get_opt( aParams, wxS( "pre" ) ) )
symbolPrefix = *valOpt;
else if( valOpt = get_opt( aParams, wxS( "spicePre" ) ) )
symbolPrefix = *valOpt;
LIB_ID libId = EasyEdaToKiCadLibID( wxEmptyString, symbolName );
@@ -987,6 +964,31 @@ LIB_SYMBOL* SCH_EASYEDA_PARSER::ParseSymbol( const VECTOR2D& aOrigi
ksymbol->GetReferenceField().SetText( symbolPrefix );
ksymbol->GetValueField().SetText( symbolName );
for( wxString attrName : c_attributesWhitelist )
{
wxString srcName = attrName;
if( srcName == wxS( "Datasheet" ) )
srcName = wxS( "link" );
if( valOpt = get_opt( aParams, srcName ) )
{
if( valOpt->empty() )
continue;
LIB_FIELD* fd = ksymbol->FindField( attrName, true );
if( !fd )
{
fd = new LIB_FIELD( ksymbol->GetNextAvailableFieldId(), attrName );
ksymbol->AddField( fd );
}
fd->SetText( *valOpt );
fd->SetVisible( false );
}
}
ParseSymbolShapes( ksymbol.get(), aParams, aShapes );
return ksymbol.release();
+37 -7
View File
@@ -25,14 +25,14 @@
#include "sch_easyeda_parser.h"
#include "sch_io_easyeda.h"
#include <schematic.h>
#include <sch_sheet.h>
#include <sch_screen.h>
#include <font/fontconfig.h>
#include <kiplatform/environment.h>
#include <project_sch.h>
#include <wildcards_and_files_ext.h>
#include <sch_screen.h>
#include <sch_sheet.h>
#include <schematic.h>
#include <string_utils.h>
#include <wildcards_and_files_ext.h>
#include <wx/log.h>
#include <wx/stdstream.h>
#include <wx/zipstrm.h>
@@ -225,7 +225,19 @@ LIB_SYMBOL* loadSymbol( const wxString& aLibraryPath, nlohmann::json aFileData,
{
parts.RemoveAt( 0 );
return parser.ParseSymbol( origin, paramMap, parts );
LIB_SYMBOL* ksymbol = parser.ParseSymbol( origin, paramMap, parts );
// Clear reference numbers
LIB_FIELD& refField = ksymbol->GetReferenceField();
wxString origRef = refField.GetText();
wxString reference;
for( size_t i = 0; i < origRef.size() && !wxIsdigit( origRef[i] ); i++ )
reference << origRef[i];
refField.SetText( reference );
return ksymbol;
}
}
}
@@ -261,7 +273,19 @@ LIB_SYMBOL* loadSymbol( const wxString& aLibraryPath, nlohmann::json aFileData,
VECTOR2D origin( topDoc.head.x, topDoc.head.y );
return parser.ParseSymbol( origin, *c_para, topDoc.shape );
LIB_SYMBOL* ksymbol = parser.ParseSymbol( origin, *c_para, topDoc.shape );
// Clear reference numbers
LIB_FIELD& refField = ksymbol->GetReferenceField();
wxString origRef = refField.GetText();
wxString reference;
for( size_t i = 0; i < origRef.size() && !wxIsdigit( origRef[i] ); i++ )
reference << origRef[i];
refField.SetText( reference );
return ksymbol;
}
}
catch( nlohmann::json::exception& e )
@@ -285,6 +309,9 @@ void SCH_IO_EASYEDA::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
{
std::map<wxString, int> namesCounter;
// Suppress font substitution warnings
fontconfig::FONTCONFIG::SetReporter( nullptr );
try
{
wxFFileInputStream in( aLibraryPath );
@@ -588,6 +615,9 @@ SCH_SHEET* SCH_IO_EASYEDA::LoadSchematicFile( const wxString& aFileName, SCHEMAT
{
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );
// Show the font substitution warnings
fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() );
SCH_SHEET* rootSheet = nullptr;
if( aAppendToMe )
@@ -1,8 +1,8 @@
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2023-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -52,6 +52,21 @@
#include <import_gfx/graphics_importer_sch.h>
// clang-format off
static const std::vector<wxString> c_attributesWhitelist = { "Value",
"Datasheet",
"Manufacturer Part",
"Manufacturer",
"BOM_Manufacturer Part",
"BOM_Manufacturer",
"Supplier Part",
"Supplier",
"BOM_Supplier Part",
"BOM_Supplier",
"LCSC Part Name" };
// clang-format on
SCH_EASYEDAPRO_PARSER::SCH_EASYEDAPRO_PARSER( SCHEMATIC* aSchematic,
PROGRESS_REPORTER* aProgressReporter )
{
@@ -383,7 +398,9 @@ void SCH_EASYEDAPRO_PARSER::ApplyAttrToField( const std::map<wxString, nlohmann:
}
EASYEDAPRO::SYM_INFO SCH_EASYEDAPRO_PARSER::ParseSymbol( const std::vector<nlohmann::json>& aLines )
EASYEDAPRO::SYM_INFO
SCH_EASYEDAPRO_PARSER::ParseSymbol( const std::vector<nlohmann::json>& aLines,
const std::map<wxString, wxString>& aDeviceAttributes )
{
EASYEDAPRO::SYM_INFO symInfo;
@@ -686,11 +703,35 @@ EASYEDAPRO::SYM_INFO SCH_EASYEDAPRO_PARSER::ParseSymbol( const std::vector<nlohm
{
wxString symbolPrefix = designatorAttr->value;
if( !symbolPrefix.EndsWith( wxS( "?" ) ) )
symbolPrefix += wxS( "?" );
if( symbolPrefix.EndsWith( wxS( "?" ) ) )
symbolPrefix.RemoveLast();
ksymbol->GetReferenceField().SetText( symbolPrefix );
}
for( const wxString& attrName : c_attributesWhitelist )
{
if( auto valOpt = get_opt( aDeviceAttributes, attrName ) )
{
if( valOpt->empty() )
continue;
LIB_FIELD* fd = ksymbol->FindField( attrName, true );
if( !fd )
{
fd = new LIB_FIELD( ksymbol->GetNextAvailableFieldId(), attrName );
ksymbol->AddField( fd );
}
wxString value = *valOpt;
value.Replace( wxS( "\u2103" ), wxS( "\u00B0C" ), true ); // ℃ -> °C
fd->SetText( value );
fd->SetVisible( false );
}
}
}
for( auto& [unitId, parentedLines] : unitParentedLines )
@@ -1107,7 +1148,7 @@ void SCH_EASYEDAPRO_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aR
if( !deviceAttr )
continue;
nlohmann::json compAttrs =
std::map<wxString, wxString> compAttrs =
aProject.at( "devices" ).at( deviceAttr->value ).at( "attributes" );
wxString symbolId;
@@ -1115,7 +1156,7 @@ void SCH_EASYEDAPRO_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aR
if( symbolAttr && !symbolAttr->value.IsEmpty() )
symbolId = symbolAttr->value;
else
symbolId = compAttrs.at( "Symbol" ).get<wxString>();
symbolId = compAttrs.at( "Symbol" );
auto it = aSymbolMap.find( symbolId );
if( it == aSymbolMap.end() )
@@ -1217,6 +1258,30 @@ void SCH_EASYEDAPRO_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aR
}
else
{
for( const wxString& attrKey : c_attributesWhitelist )
{
if( auto valOpt = get_opt( compAttrs, attrKey ) )
{
if( valOpt->empty() )
continue;
SCH_FIELD* text = schSym->FindField( attrKey, true );
if( !text )
{
text = schSym->AddField(
SCH_FIELD( schSym.get(), schSym->GetFieldCount(), attrKey ) );
}
wxString value = *valOpt;
value.Replace( wxS( "\u2103" ), wxS( "\u00B0C" ), true ); // ℃ -> °C
text->SetText( value );
text->SetVisible( false );
}
}
auto nameAttr = get_opt( attributes, "Name" );
auto valueAttr = get_opt( attributes, "Value" );
@@ -1265,15 +1330,18 @@ void SCH_EASYEDAPRO_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aR
if( attr.value.IsEmpty() )
continue;
SCH_FIELD* text =
new SCH_FIELD( schSym.get(), schSym->GetFieldCount(), attrKey );
SCH_FIELD* text = schSym->FindField( attrKey, true );
if( !text )
{
text = schSym->AddField(
SCH_FIELD( schSym.get(), schSym->GetFieldCount(), attrKey ) );
}
text->SetPosition( schSym->GetPosition() );
ApplyAttrToField( fontStyles, text, attr, false, true, compAttrs,
schSym.get() );
schSym->AddField( *text );
}
}
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Alex Shvartzkop <dudesuchamazing@gmail.com>
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2023-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -101,7 +101,8 @@ public:
double SizeToKi( wxString units );
EASYEDAPRO::SYM_INFO ParseSymbol( const std::vector<nlohmann::json>& aLines );
EASYEDAPRO::SYM_INFO ParseSymbol( const std::vector<nlohmann::json>& aLines,
const std::map<wxString, wxString>& aDeviceAttributes );
void ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet,
const nlohmann::json& aProject,
@@ -1,4 +1,4 @@
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 Alex Shvartzkop <dudesuchamazing@gmail.com>
@@ -25,6 +25,7 @@
#include "sch_easyedapro_parser.h"
#include "sch_io_easyedapro.h"
#include <font/fontconfig.h>
#include <schematic.h>
#include <sch_sheet.h>
#include <sch_screen.h>
@@ -156,7 +157,11 @@ static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryP
return nullptr;
wxString prjSymUuid = prjSymIt->first;
wxString fpTitle;
wxString description;
wxString customTags;
std::map<wxString, wxString> deviceAttributes;
wxString fpTitle;
for( auto& [key, device] : prjDevices )
{
@@ -164,6 +169,12 @@ static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryP
if( val && *val == prjSymUuid )
{
description = device.description;
deviceAttributes = device.attributes;
if( device.custom_tags.is_string() )
customTags = device.custom_tags.get<wxString>();
if( auto fpUuid = get_opt( device.attributes, "Footprint" ) )
{
if( auto prjFp = get_opt( prjFootprints, *fpUuid ) )
@@ -192,7 +203,7 @@ static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryP
lines.emplace_back( js );
}
EASYEDAPRO::SYM_INFO symInfo = parser.ParseSymbol( lines );
EASYEDAPRO::SYM_INFO symInfo = parser.ParseSymbol( lines, deviceAttributes );
if( !symInfo.libSymbol )
EASY_IT_CONTINUE;
@@ -202,6 +213,15 @@ static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryP
symInfo.libSymbol->SetName( aAliasName );
symInfo.libSymbol->GetFootprintField().SetText( symLibName + wxS( ":" ) + fpTitle );
wxString keywords = customTags;
keywords.Replace( wxS( ":" ), wxS( " " ), true );
symInfo.libSymbol->SetKeyWords( keywords );
description.Replace( wxS( "\u2103" ), wxS( "\u00B0C" ), true ); // ℃ -> °C
symInfo.libSymbol->SetDescription( description );
symbol = symInfo.libSymbol.release();
EASY_IT_BREAK;
@@ -314,13 +334,10 @@ void SCH_IO_EASYEDAPRO::LoadAllDataFromProject( const wxString& aProjectPath )
if( name.EndsWith( wxS( ".esym" ) ) )
{
EASYEDAPRO::PRJ_SYMBOL symData = prjSymbols.at( baseName );
EASYEDAPRO::SYM_INFO symInfo = parser.ParseSymbol( lines );
if( !symInfo.libSymbol )
EASY_IT_CONTINUE;
wxString fpTitle;
wxString description;
wxString customTags;
std::map<wxString, wxString> deviceAttributes;
wxString fpTitle;
for( auto& [key, device] : prjDevices )
{
@@ -328,6 +345,12 @@ void SCH_IO_EASYEDAPRO::LoadAllDataFromProject( const wxString& aProjectPath )
if( val && *val == baseName )
{
description = device.description;
deviceAttributes = device.attributes;
if( device.custom_tags.is_string() )
customTags = device.custom_tags.get<wxString>();
if( auto fpUuid = get_opt( device.attributes, "Footprint" ) )
{
if( auto prjFp = get_opt( prjFootprints, *fpUuid ) )
@@ -339,11 +362,26 @@ void SCH_IO_EASYEDAPRO::LoadAllDataFromProject( const wxString& aProjectPath )
}
}
EASYEDAPRO::PRJ_SYMBOL symData = prjSymbols.at( baseName );
EASYEDAPRO::SYM_INFO symInfo = parser.ParseSymbol( lines, deviceAttributes );
if( !symInfo.libSymbol )
EASY_IT_CONTINUE;
LIB_ID libID = EASYEDAPRO::ToKiCadLibID( symLibName, symData.title );
symInfo.libSymbol->SetLibId( libID );
symInfo.libSymbol->SetName( symData.title );
symInfo.libSymbol->GetFootprintField().SetText( symLibName + wxS( ":" ) + fpTitle );
wxString keywords = customTags;
keywords.Replace( wxS( ":" ), wxS( " " ), true );
symInfo.libSymbol->SetKeyWords( keywords );
description.Replace( wxS( "\u2103" ), wxS( "\u00B0C" ), true ); // ℃ -> °C
symInfo.libSymbol->SetDescription( description );
m_projectData->m_Symbols.emplace( baseName, std::move( symInfo ) );
}
else if( name.EndsWith( wxS( ".eblob" ) ) )
@@ -386,6 +424,9 @@ SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
{
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );
// Show the font substitution warnings
fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() );
SCH_SHEET* rootSheet = nullptr;
if( aAppendToMe )
@@ -539,7 +539,9 @@ void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSym
LIB_FIELD* field;
if( id >= 0 && id < MANDATORY_FIELDS )
// Description was not mandatory until v8.0, so any fields with an index
// past this point should be user fields
if( id >= 0 && id < DESCRIPTION_FIELD )
{
field = aSymbol->GetFieldById( id );
@@ -550,6 +552,7 @@ void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSym
}
else
{
id = aSymbol->GetNextAvailableFieldId();
field = new LIB_FIELD( aSymbol.get(), id );
aSymbol->AddDrawItem( field, false );
}

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