Compare commits

...

432 Commits

Author SHA1 Message Date
Seth Hillbrand 2bc8c0ace5 Fix Eeschema Find/Replace
Find/Replace skipped elements that were inside the same symbol,
preventing a full search of the schematic.
2023-03-09 11:51:29 -08:00
jean-pierre charras f439dfb6ea Pcb editor: fix crash when trying to activate the "place anchor" tool.
"place anchor" tool exists only in the Fp editor. However, the hotkey
to activate this tool was also active in the board editor. Now disabled.
From master branch.
2023-02-09 16:58:54 +01:00
Wayne Stambaugh 9fdc1257a1 Fix broken update symbol from library.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13782

(cherry picked from commit baeeeec492)
2023-02-05 11:01:29 -05:00
Wayne Stambaugh 95828ff2e2 Use references instead of copies in map pair for loops. 2023-02-03 10:04:08 -05:00
jean-pierre charras 98e55c0a04 Fix compatibility with older wxWidgets versions. 2023-02-02 20:38:51 +01:00
Wayne Stambaugh 2757d81231 Fix schematic update library symbols issues.
Rather than update library symbols one at a time, queue them up by
schematic symbol to prevent multiple updates to the same symbol in
complex hierarchies.  This also removes all of the library symbols
first which will clear out all of the library symbol variants that
were created by modifying library symbols in place and/or changes to
the symbol in the library.

Don't add new variant library symbol if an equivalent variant already
exists in the schematic local cache.  This prevents duplicate library
symbols from being added to the local cache when the first variant in
the cache does not match that of the symbol being added.
2023-02-02 12:54:08 -05:00
Wayne Stambaugh 985ceb365b Begin 6.0.12 development.
Note: There should not be a 6.0.12 but we said that about 6.0.11.  We
      want to keep the 6.0 branch alive for testing builds for any
      lingering critical bugs until 7.0.0 is released.
2023-02-02 12:45:36 -05:00
Wayne Stambaugh cdf04d5582 Tag release version 6.0.11. 2023-01-24 16:08:09 -05:00
Seth Hillbrand a1ff9134f4 Don't double-tap Connectivity Recalculate
Cherry-picked from 43e4797d4d
2023-01-24 10:35:42 -08:00
Marek Roszko cc0b51c81a Ensure glew is initialized in the 3d model viewer
Fixes KICAD-7M


(cherry picked from commit b3f55e7f8b)
2023-01-24 12:15:13 +00:00
Seth Hillbrand 4e34bdb621 Force realtime connectivity on
The pressure relief valve was not useful for common work patterns as it
forced the recalculation on many common actions such as bus expansion.
This caused it to actually feel slower than with the pressure relief
valve off.

For most schematics, realtime is now fast enough to not need the valve
and for those that are extremely complex, removing the valve helps this
run more predictably

(cherry picked from commit e6dbca051c)
2023-01-23 11:11:48 -08:00
Seth Hillbrand 6d96059917 Fix compile error 2023-01-23 10:47:23 -08:00
Seth Hillbrand 99cfa1fad7 Avoid the obsolete GetNextPin() call
This iterated over all pins to find the pin after a given item.  Because
out pattern is consistently to iterate in the outer loop, this means
that we were an O(n^2) loop for the pins just to find their names.  This
affected very large parts (e.g. FPGAs) when switching sheets to display

(cherry picked from commit 6fa2eedb4b)
2023-01-23 10:46:07 -08:00
Seth Hillbrand b2a6f12645 Don't do a full connection database reset on HardRedraw()
Only update the intersheet references to avoid the penalty of
connectivity re-calculations on each redraw

Cherry-picked from b8ee588a76 and 08c2828bd3
2023-01-23 10:28:29 -08:00
Wayne Stambaugh b33cf23bda Fix library symbol rescue issues.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13602

(cherry picked from commit 0a7bd85cd6)
2023-01-21 11:21:38 -05:00
Steven Falco 5a36c3685e Fix GCC 13 build error.
GCC removed the cstdint header from many other headers, so we can't rely on transitive includes to define these types. This led to a compile error in this file due to no more transitive inclusion.
2023-01-20 21:13:34 +00:00
Seth Hillbrand 5991842ae4 Place hidden PDF text behind words better
Rather than hiding a single line at once, we align each word in the
string with the approximate location of the output word.  This allows
better selecting text in the output pdf

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

(cherry picked from commit da1707d5ba)
2023-01-20 11:15:28 -08:00
Mark Roszko 6c0a30e2f3 Pin curl to the older curl that works 2023-01-19 12:24:55 +00:00
Wayne Stambaugh c0eee45876 Fix another broken graphics import file filter.
(cherry picked from commit 022c913e8f)
2023-01-17 11:43:34 -05:00
Wayne Stambaugh 6ebd970f88 Fix broken graphics import file filters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13570

(cherry picked from commit f81642bbb3)
2023-01-17 11:27:25 -05:00
Seth Hillbrand 5e3b74aee5 Fix name escaping in Save As
Fixes https://gitlab.com/kicad/code/kicad/issues/13504
2023-01-12 13:34:14 -08:00
jean-pierre charras 316087c468 Protect against null pointer use.
Fixes #13349
https://gitlab.com/kicad/code/kicad/issues/13349
2023-01-02 18:00:18 +01:00
jean-pierre charras 1b1586696f Do not prune items/layers when copying the clipboard to the FP editor: all are allowed
(Some are disabled only for GUI)
Fixes #13334
https://gitlab.com/kicad/code/kicad/issues/13334
2023-01-01 13:39:41 +01:00
Mark Roszko 339a349a58 Fix doxygen output path for copy 2023-01-01 00:14:27 +00:00
Mark Roszko 1a161858fc Add the doxygen dockerfile 2022-12-31 21:43:31 +00:00
Marco Ciampa 12abcd6ece Updated Italian translation 2022-12-30 17:59:16 +01:00
Marco Ciampa 5e64fb1415 Updated Italian translation 2022-12-29 14:41:54 +01:00
Marco Ciampa 7616461e61 Small fix in Italian translation 2022-12-28 09:39:57 +01:00
Jon Evans 968406c6b5 KiWay: Make sure to mark closed windows as closed
Also make sure to veto project import if we couldn't close the existing project.

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

Maybe also fixes some other weird crashes, we'll see.


(cherry picked from commit 7e778c9856)
2022-12-27 15:32:34 +00:00
Jon Evans 5144186fca Fix c0fb041b for old API 2022-12-27 08:33:40 -05:00
Jon Evans c0fb041be6 No-connects might not be connected to a pin
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13256

(cherry picked from commit 5657ca5a04)
2022-12-27 08:14:43 -05:00
Wayne Stambaugh 45e15f2394 Begin 6.0.11 development.
Note: there should not be a 6.0.11 but we want to keep the 6.0 branch
      alive for testing builds for any lingering critical bugs until
      7.0.0 is released.
2022-12-26 13:51:17 -05:00
Marco Ciampa f5b592e38c Updated Italian translation 2022-12-19 14:12:46 +01:00
Marco Ciampa 60a8eee515 Updated Italian translation 2022-12-18 11:47:10 +01:00
Wayne Stambaugh 38e09789e5 Tag release version 6.0.10. 2022-12-17 17:12:38 -05:00
Seth Hillbrand f993e51fba Update translations 2022-12-17 11:14:38 -08:00
Neko Nekowazarashi 7600f45d11 Translated using Weblate (Indonesian)
Currently translated at 24.7% (1769 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/id/
2022-12-17 20:13:43 +01:00
Ulices 48d8c149a8 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-12-17 20:13:43 +01:00
Henrik Kauhanen 131115e19f Translated using Weblate (Swedish)
Currently translated at 99.9% (7152 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-12-17 20:13:43 +01:00
jean-pierre charras cd7cab9794 SHAPE_ARC::GetCentralAngle(): ensure a 360 deg arc angle is always returned as 360 deg.
An arc having the same start and end points can be 0 or 360 deg arc.
In Kicad it is always 360 deg arc (i.e. a circle)
Fixes #13182
https://gitlab.com/kicad/code/kicad/issues/13182
2022-12-17 14:47:26 +01:00
Wayne Stambaugh 22bece0922 Schematic import bug fix.
Check for already loaded schematics in the current sheet path as well
as the current project root sheet path to prevent multiple loads of
shared schematic.  This bug was causing shared sheets to be loaded more
than once which caused instance data to get separated by each copy rather
than saved in one copy of the schematic which would result in all instance
data being lost except the last saved copy of the schematic.  This bug has
been around forever and may be the cause of some unexplained schematic
instance data corruption issues.  This bug does not apply when opening
the full project.

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

(cherry picked from commit 84f927d057)
2022-12-15 11:44:59 -05:00
Mark Roszko 01cff24e4e vcpkg bump to ngspice 38 2022-12-15 03:02:55 +00:00
Seth Hillbrand 948071183c Don't report a pin if the pin is null
The pins can exist on a different sheet from the no-connect.  In this
case, we do not set the ERC for the current sheet to the remote pins,
instead only link the NC

(cherry picked from commit bc8366cd95)
2022-12-12 19:31:20 -08:00
Seth Hillbrand ee05b67599 Fix crash when moving empty selection
Need to pop the move tool when exiting, even at the beginning

Fixes https://gitlab.com/kicad/code/kicad/issues/13114
2022-12-12 12:59:31 -08:00
Seth Hillbrand c07043e762 Respect the "report all errors" checkbox
When we have objects spanning multiple layers, the user doesn't need to
see every layer/hole combination violation if they do not request it
2022-12-12 10:53:44 -08:00
Alex bd9c37aa5f Fix an incorrect calculation in length tuning tools.
MEANDER_PLACER_BASE::lineLength wasn't calculating the length correctly
when starting and ending pads were on different layers.

Naturally, now jointA corresponds to the start of the path, jointB to the end.

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


(cherry picked from commit 348c3d4216)
2022-12-12 01:58:36 +00:00
Alex 6e6a748320 Use correct pad to die lengths in DP length tuner.
Fixes https://gitlab.com/kicad/code/kicad/issues/12859


(cherry picked from commit 126914859a)
2022-12-12 01:58:13 +00:00
Seth Hillbrand 61c0cac22d Update translations 2022-12-11 12:20:46 -08:00
ZbeeGin 3c973a788d Translated using Weblate (Polish)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-12-11 21:19:38 +01:00
Mark Hämmerling 048436f0ef Translated using Weblate (German)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-12-11 21:19:38 +01:00
Jan Straka 491e0cac6a Translated using Weblate (Czech)
Currently translated at 93.2% (6676 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-12-11 21:19:38 +01:00
Henrik Kauhanen cf1d0a9667 Translated using Weblate (Swedish)
Currently translated at 99.9% (7150 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-12-11 21:19:38 +01:00
Henrik Kauhanen 3ae39f9614 Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-12-11 21:19:38 +01:00
Henrik Kauhanen 45d9a58bc7 Translated using Weblate (Swedish)
Currently translated at 99.8% (7149 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-12-11 21:19:38 +01:00
Hanna Breisand 1a8d974520 Translated using Weblate (Swedish)
Currently translated at 99.8% (7149 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-12-11 21:19:38 +01:00
Sašo Domadenik 8ea00c42d9 Translated using Weblate (Slovenian)
Currently translated at 3.5% (251 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sl/
2022-12-11 21:19:38 +01:00
Toni Laiho be8750ad1c Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-12-11 21:19:38 +01:00
Henrik Kauhanen 350d0323e1 Translated using Weblate (Swedish)
Currently translated at 99.8% (7149 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-12-11 21:19:38 +01:00
ZbeeGin 2c7aee057a Translated using Weblate (Polish)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-12-11 21:19:38 +01:00
Toni Laiho fb6c89358b Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-12-11 21:19:38 +01:00
VicSanRoPe d790e85fe4 Translated using Weblate (Spanish)
Currently translated at 99.8% (7149 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es/
2022-12-11 21:19:37 +01:00
Seth Hillbrand 7f08356a48 Fix NC and label logic
Largely moved for v6 instead of direct cherry-pick due to code
differences

cherry-picked from eaf56bc05a
cherry-picked from 9a5df73060
2022-12-11 12:16:33 -08:00
Simon Schaak 045633626c Clean up autosave file handling edge cases
(cherry picked from commit bd74489b00)
2022-12-11 08:48:48 -05:00
Wayne Stambaugh 5de05312d5 Fix wxWidgets 3.2 assertion when opening symbol field table editor. 2022-12-09 15:05:38 -05:00
jean-pierre charras ecfd74c1be symbol_editor_control: fix incorrect bounding in SVG export.
Fixes #13093
https://gitlab.com/kicad/code/kicad/issues/13093
2022-12-07 13:18:10 +01:00
Mark Roszko cdeb539254 Restore windows ci 2022-12-03 13:45:55 +00:00
Marco Ciampa 540c5d2b16 Updated Italian translation 2022-12-02 08:22:14 +01:00
Mark Roszko 38886c998b Disable Windows CI until its fixed 2022-12-01 20:45:38 +00:00
jean-pierre charras 46b3188737 Some fixes related to translated/not translated mandatory field names.
DIALOG_SYMBOL_FIELDS_TABLE: add new fields to symbols only if the field is not empty.

(cherry picked from commit 45b167dff5)
2022-11-30 11:41:08 -08:00
Seth Hillbrand f663b42d77 Remove unused vars 2022-11-30 11:26:48 -08:00
jean-pierre charras 9ac87132af Fix a few issues related to field names and their translation.
- Do not use translated field names outside strings displayed in dialogs.
- fix code that does not work well with default locale.
- fix some (not all) I18n issues in DIALOG_UPDATE_SYMBOL_FIELDS.

(cherry picked from commit 20d1d0705e)
2022-11-30 11:19:21 -08:00
Seth Hillbrand 8af64fb326 Do not allow dimensions in the footprint editor
The object type doesn't exist in 6.0

Fixes https://gitlab.com/kicad/code/kicad/issues/12841
2022-11-30 11:04:15 -08:00
Seth Hillbrand be86e9f57f Prevent UI events during footprint dialog ctor
Errors may get thrown when the 3d models are loaded for missing search
paths.  This triggers the idle event that makes assumptions about the
state of the dialog.  We halt event handling until the ctor finishes.

Fixes https://gitlab.com/kicad/code/kicad/issues/12944
2022-11-29 19:38:48 -08:00
Marek Roszko 3253bd9a3d Update vcpkg baseline
(cherry picked from commit 933b3cf3df)
2022-11-30 01:58:52 +00:00
Seth Hillbrand 994dd570de Update Translations 2022-11-29 17:26:22 -08:00
Toni Laiho c171f5b1b0 Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-11-30 02:23:55 +01:00
VicSanRoPe 36bbe733a8 Translated using Weblate (Spanish)
Currently translated at 99.8% (7149 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es/
2022-11-30 02:23:54 +01:00
Mark Hämmerling 3400b567b1 Translated using Weblate (German)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-11-30 02:23:54 +01:00
Jan Straka 28d6c17e42 Translated using Weblate (Czech)
Currently translated at 93.1% (6665 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-11-30 02:23:54 +01:00
Toni Laiho 0df81f67ed Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-11-30 02:23:54 +01:00
Bế Trọng Nghĩa 30f08024b7 Translated using Weblate (Vietnamese)
Currently translated at 17.0% (1219 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/vi/
2022-11-30 02:23:54 +01:00
Håvard Syslak d93364268b Translated using Weblate (Norwegian Bokmål)
Currently translated at 73.2% (5240 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/nb_NO/
2022-11-30 02:23:54 +01:00
VicSanRoPe 11531471c6 Translated using Weblate (Spanish)
Currently translated at 99.6% (7133 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es/
2022-11-30 02:23:54 +01:00
Mark Hämmerling 1626ba3f58 Translated using Weblate (German)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-11-30 02:23:54 +01:00
Jan Straka 76479f40ef Translated using Weblate (Czech)
Currently translated at 93.1% (6665 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-11-30 02:23:54 +01:00
Mark Hämmerling 4c9e409df9 Translated using Weblate (German)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-11-30 02:23:53 +01:00
Neko Nekowazarashi b4b4f1f3ca Translated using Weblate (Indonesian)
Currently translated at 24.2% (1737 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/id/
2022-11-30 02:23:53 +01:00
Jan Straka ed684cd92e Translated using Weblate (Czech)
Currently translated at 93.0% (6661 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-11-30 02:23:53 +01:00
aris-kimi 3f99dae704 Translated using Weblate (Greek)
Currently translated at 99.4% (7118 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/el/
2022-11-30 02:23:53 +01:00
Mark Hämmerling 7e72a3c993 Translated using Weblate (German)
Currently translated at 99.9% (7156 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-11-30 02:23:53 +01:00
Michael Misirlis 2960e9c1b4 Translated using Weblate (Greek)
Currently translated at 99.4% (7117 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/el/
2022-11-30 02:23:53 +01:00
Tokita, Hiroshi 0f5e12a535 Translated using Weblate (Japanese)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-11-30 02:23:53 +01:00
Neko Nekowazarashi acf62122c8 Translated using Weblate (Indonesian)
Currently translated at 24.3% (1745 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/id/
2022-11-30 02:23:53 +01:00
Toni Laiho bf9db4d4f8 Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-11-30 02:23:53 +01:00
Mark Hämmerling e09212ccad Translated using Weblate (German)
Currently translated at 99.9% (7156 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-11-30 02:23:52 +01:00
Jan Straka 390effe3c6 Translated using Weblate (Czech)
Currently translated at 93.0% (6661 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-11-30 02:23:52 +01:00
Mark Hämmerling eaafa5d8f0 Translated using Weblate (German)
Currently translated at 99.9% (7156 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-11-30 02:23:52 +01:00
Mark Hämmerling c558144c7b Translated using Weblate (German)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-11-30 02:23:52 +01:00
Ettore Atalan b7713dbf0d Translated using Weblate (German)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-11-30 02:23:52 +01:00
Jan Straka 9b21712ea0 Translated using Weblate (Czech)
Currently translated at 92.8% (6648 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-11-30 02:23:52 +01:00
Arnau Llovet Vidal 6f7b0cb240 Translated using Weblate (Catalan)
Currently translated at 65.6% (4698 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-11-30 02:23:52 +01:00
Toni Laiho ea1aed2fc9 Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-11-30 02:23:52 +01:00
ssantos 88ad0e5a50 Translated using Weblate (Portuguese)
Currently translated at 99.9% (7152 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt/
2022-11-30 02:23:52 +01:00
ZbeeGin 15ead17cea Translated using Weblate (Polish)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-11-30 02:23:52 +01:00
aris-kimi 92356b4805 Translated using Weblate (Greek)
Currently translated at 99.3% (7112 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/el/
2022-11-30 02:23:51 +01:00
Toni Laiho cec810a452 Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-11-30 02:23:51 +01:00
Jeff Young ec92def539 Add support for unitless values to PCB_EXPR_EVALUATOR.
Fixes https://gitlab.com/kicad/code/kicad/issues/13016

(cherry picked from commit 8260f0ee13)
2022-11-29 23:28:37 +00:00
Jeff Young 2dd04ea43a Protect move tool from re-entrancy.
m_dragInProgress is usually sufficient, except when we haven't started
one yet.  In any case, conflating the two is probably a bad idea.

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

(cherry picked from commit bc271a8d15)
2022-11-29 23:16:48 +00:00
Jeff Young d7a7ddd80e Allow pads in selection and filter them for free-pads later.
Fixes https://gitlab.com/kicad/code/kicad/issues/12912

(cherry picked from commit cefc5268ab)
2022-11-29 23:15:39 +00:00
Jeff Young 27676f4388 Add mapping for -rescue.lib in project Save As.
Fixes https://gitlab.com/kicad/code/kicad/issues/12503

(cherry picked from commit 5366fa8cee)
2022-11-29 23:14:10 +00:00
Jeff Young 2f47857abc Move zone borders back to their "host" layer.
Zone borders shouldn't be affected by zone-opacity control; we always
draw them in full layer opacity.

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

(cherry picked from commit 25f06eed8c)
2022-11-29 23:05:50 +00:00
Jeff Young ede21ed6ae Handle string escaping for Find/Replace in labels.
Fixes https://gitlab.com/kicad/code/kicad/issues/12789

(cherry picked from commit ae9405a4d3)
2022-11-29 22:54:14 +00:00
Jeff Young a09a3dfe68 Be careful of interveneing priority zones when doing divot prevention.
Fixes https://gitlab.com/kicad/code/kicad/issues/12797

(cherry picked from commit 1f4e51b008)
2022-11-29 22:43:41 +00:00
Jeff Young e083cbaf50 Allow a single net collision with a free pad.
(cherry picked from commit 3534cfbba8)
2022-11-29 22:16:15 +00:00
Seth Hillbrand 9d401b00d8 Allow groups in groups
This was allowed in the qa test, so we allow it going forward

(cherry picked from commit 137b4de1c2)
2022-11-28 11:28:51 -08:00
Seth Hillbrand 25e3b6c1bf Ignore generated files 2022-11-28 11:10:16 -08:00
Seth Hillbrand 2029fc4e8f Don't use modifiers when moving with keyboard
The modifier keys on the keyboard control the motion spacing (Ctrl) and
shouldn't be confused with the modifier key used to disable grid
snapping when moving with the mouse (also Ctrl)

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

(cherry picked from commit 4f6b853756)
2022-11-28 11:06:24 -08:00
Seth Hillbrand c9cc29593a Don't add non-groupable items to groups
This is a re-implementation of 259e41be

Fixes https://gitlab.com/kicad/code/kicad/issues/13026
2022-11-28 09:26:48 -08:00
Seth Hillbrand 42bd43407a Remove clone's group info 2022-11-28 09:17:17 -08:00
Seth Hillbrand de05a513f3 Prevent mirror of text elements
While we never allow the creation of mirrored text elements in the
schematic and symbol library editors, external generation of symbols may
cause the property to be set, which can then never be changed.  This
leaves the property unset for all elements

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

(cherry picked from commit f1556ed801)
2022-11-26 10:51:03 -08:00
Seth Hillbrand 554d82b2a4 Ensure that we clear deleted values
When throwing on an invalid value, we may end up freeing the same tree
twice.  This is generally not an issue but we need to mark the freed
memory as null to avoid a double free

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

(cherry picked from commit 62863d6c5b)
2022-11-25 10:47:03 -08:00
Seth Hillbrand 3b3e86b968 Remove structured binding from v6 commit
C++17 is only for the master branch
2022-11-25 10:43:10 -08:00
Seth Hillbrand f6ca98061c Add terrible hack to get subgraph netname
In certain cases, the subgraph does not receive the proper netname,
preventing us from checking for correct pin counts.  This is a backwards
iteration of the net name <-> subgraph map to extract the proper name
and sibling subgraphs

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

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

(cherry picked from commit 938645b29d)
2022-11-25 08:51:12 -08:00
Tomasz Wlostowski cca7f1dbda router: use actual snap point position for routability checks of a segment instead of the segment endpoint(s).
Explanation:
- place a long segment A with something violating the rules close to its endpoint
- try to start routing in the 2/3 of the length of A (on the obstacle side)
- bummer - the router picks the nearest endpoint of A for the collision check (even though we don't care about this collision since we want to route far away from it)

(cherry picked from commit e558893851)
2022-11-23 06:57:11 -08:00
Seth Hillbrand 2cf4cb937f Fix graphic snapping
If the user has requested the ability to snap to graphics, we want to
add any of the graphical layers to the limit list
2022-11-23 06:57:11 -08:00
jean-pierre charras c3b9c65fd6 Gerbview, read zip archive: do not generate a error message for directory names.
A directory is not a file, and is now just skipped.
From master branch
2022-11-22 17:08:18 +01:00
Wayne Stambaugh d9a1703bcc Fix broken schematic instance data loading legacy files (<=5.1). 2022-11-18 10:07:59 -05:00
Wayne Stambaugh a22c466639 Fix broken legacy schematic file save. 2022-11-17 12:23:14 -05:00
Mark Roszko 9a2f83537d Restore missing libxslt 2022-11-15 03:27:48 +00:00
jean-pierre charras f136f3d7ee pcbnew, SVG import: fix an issue for SVG files using a CR+LF end of file
The issue was in a validity test working only if CR+LF is not replaced by LF
Fixes #10096
https://gitlab.com/kicad/code/kicad/issues/10096
2022-11-09 09:36:06 +01:00
Seth Hillbrand 61d4a5bfbe Resolve embedded text vars
Title Block text variables are embedded into the pcb file and should
be used for resolving when the project file is missing

(cherry picked from commit d1bf889e71)
2022-11-03 10:26:06 -07:00
Mike Williams 6289a82a18 PCB Router: return to original active layer after routing
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/12313
(cherry picked from commit fa3e9efdce)
2022-11-03 10:16:26 -07:00
Marek Roszko 6ca2f6a6e1 Try a hackfix for windows icon scaling
Related https://gitlab.com/kicad/code/kicad/-/issues/11880


(cherry picked from commit 321d6e3ea8)
2022-10-31 21:47:11 +00:00
Marek Roszko 2ff3fac7b3 Don't fix the visibility icon size or it will never scale properly
Related https://gitlab.com/kicad/code/kicad/-/issues/11880


(cherry picked from commit c0f8810759)
2022-10-31 21:46:53 +00:00
Mark Roszko 08452433e8 Check the process exit code rather than output variable for git header creation 2022-10-29 18:39:02 +00:00
Wayne Stambaugh 39b9b3e570 Begin version 6.0.10 development. 2022-10-28 16:55:26 -04:00
Wayne Stambaugh b29f91cc15 Tag release version 6.0.9. 2022-10-28 16:51:23 -04:00
Jon Evans f81313068e ERC: Include power connections in multiple driver test
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12138


(cherry picked from commit 141c1f020e)
2022-10-28 02:55:42 +00:00
Jeff Young 882756b676 Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/issues/12753


(cherry picked from commit c026c3af7b)
2022-10-25 17:40:33 +00:00
Jeff Young 8c3cd200d1 Clean up layer handling and normalize to remove magic numbers.
Fixes https://gitlab.com/kicad/code/kicad/issues/12747

(cherry picked from commit 5fe5534822)
2022-10-25 14:21:03 +01:00
Jeff Young a5fd03df88 Don't delete pin out from under selection & move tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/12610

(cherry picked from commit 3cb6a80954)
2022-10-25 14:21:03 +01:00
Jon Evans 2d2912c23d Improve logic of Position Relative tool
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12672
2022-10-24 18:46:15 -04:00
Jeff Young 3106f6c9f4 We must check clearance on all layers of multi-layer items.
(One layer may have a custom rule.)

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

(cherry picked from commit 2dec37f806)
2022-10-24 10:57:07 +01:00
Jeff Young fde2b429b9 Make sure pair caches are layer-specific where they need to be.
(cherry picked from commit 909358e643)
2022-10-24 10:57:07 +01:00
Wayne Stambaugh 0593663462 Fix 3D viewer canvas timer event clash.
Manual cherry-pick of commit f6297d328c.
2022-10-23 07:53:51 -04:00
Marek Roszko bce8c95647 Avoid netlist export dialog crash from trying to delete a non-custom format
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12229
2022-10-22 16:41:32 -04:00
Marek Roszko 4d729110d5 Fix build error due to C++17 use 2022-10-22 16:38:17 -04:00
Mark Roszko 6c2b9eb433 Bring 6.0 msvc ci in line with master 2022-10-22 17:12:29 +00:00
jean-pierre charras df223cced4 pl_editor: fix a crash when trying to delete an item during its creation.
Fixes #12717
https://gitlab.com/kicad/code/kicad/issues/12717
2022-10-22 18:32:46 +02:00
jean-pierre charras 8e331628b6 Do not add a title/comment in mandatory field strings when writting netlists.
This is mainly for "Sheetfile" property because current it is the only one
that has a title when plotting/drawing it.
2022-10-22 15:38:26 +02:00
Mikolaj Wielgus ceaf3fc72d Ngspice: Preload a basically empty circuit to avoid error messages
Fixes https://gitlab.com/kicad/code/kicad/issues/12481

(cherry picked from commit 6e874f4c1e)
2022-10-21 09:22:53 -07:00
Seth Hillbrand b004d7a1cb Fix ERC global label unit tests
Need to test all units in the subgraph as there are chances that the
subgraph might have more than one label, which needs to be consistently
handled

(cherry picked from commit 60374daa49)
2022-10-21 09:17:11 -07:00
Seth Hillbrand f3ff9ddd31 Show ERC errors when any label only has 1 pin
To be connected, the label must have at least two pins on a subgraph
(or, in the case of a hierarchical label, two pins somewhere in its
connection)

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

(cherry picked from commit 05cdf915d0)
2022-10-21 09:11:24 -07:00
jean-pierre charras e5fa18c9b1 fix an issue in a bom script (extra empty lines created)
Fixes #10473
https://gitlab.com/kicad/code/kicad/issues/10473

(cherry picked from commit 380cb452b2)
2022-10-21 09:10:30 -07:00
Seth Hillbrand d52f246b2a Allow up to three discarded characters when detecting gerbers
Some layout programs add a blank block at the beginning but include the
terminating '*' on a line before starting the actual data.  This is
ignored by GerbView so we all this type of behavior in the mimetype file
detection as well

Suggested by Mark Jeronimus

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

(cherry picked from commit 64335d94d7)
2022-10-21 09:10:01 -07:00
Seth Hillbrand 3dfbe582db Add "Letter-like character" Omega for Unicode x2126
Fixes https://gitlab.com/kicad/code/kicad/issues/12531

(cherry picked from commit 1b38acd9c6)
2022-10-21 09:08:58 -07:00
Seth Hillbrand 431aa88612 Allow printing backgrounds prior to foreground
Eeschema shows background fills on a different z-level than the rest of
the symbols/elements.  Print the backgrounds prior to the foregrounds in
order to preserve this view for print output

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

(cherry picked from commit e055302a3c)
2022-10-21 09:00:13 -07:00
Seth Hillbrand 03a1a8e6d3 Fix missing token initializer
Fixes https://gitlab.com/kicad/code/kicad/issues/12555

(cherry picked from commit fdf9fcc24d)
2022-10-21 08:58:59 -07:00
Seth Hillbrand 5f6de83981 Ensure that token size is large enough
Input tokens can be arbitrary, so output needs to keep pace

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

(cherry picked from commit 19378675f1)
2022-10-21 08:40:30 -07:00
jean-pierre charras 02d38db577 Fix about fix_swig_imports.py, useless or not working with swig 4, but needed by swig 3
fix_swig_imports.py cleans pcbnew.py, but the section to clean does not exist
in swig 4, only in swig 3.
2022-10-21 16:33:01 +02:00
Alex bd1698f80e Allow GAL_DRAWING_CONTEXT dtor to throw exceptions.
These destructors are implicitly noexcept, which woudnt't allow
OpenGL errors to be caught in DoRePaint.

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

(cherry picked from commit 39089ad805)
2022-10-21 17:24:11 +03:00
Alex 6de30b19a0 Don't sync the world twice in inline router tools.
Activate() already clears and syncs the world via PNS::TOOL_BASE::Reset,
so there's no need to sync in InlineDrag and InlineBreakTrack.

(cherry picked from commit cc4e34ef49)
2022-10-21 17:21:24 +03:00
Alex 00ff5baf59 kiplatform: Add quotes to restart registration command line.
(cherry picked from commit 6e0d940b98)
2022-10-21 17:20:29 +03:00
Alex 152252c685 Fix selecting pads of footprints in groups.
(cherry picked from commit 67985510a8)
2022-10-21 17:19:05 +03:00
Alex 3b0466f3e8 Fix selection and entering in nested groups.
Fixes https://gitlab.com/kicad/code/kicad/issues/12586

(cherry picked from commit 0fea6f5ac3)
2022-10-21 17:18:07 +03:00
Seth Hillbrand 2ca7a76693 Don't connect disparate nets
Only some elements get their nets assigned based on connectivity.  Other
elements should be keps in different clusters for connection

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

(cherry picked from commit c9f11827a7)
2022-10-21 11:35:31 +01:00
Seth Hillbrand af159c9841 Be sure to update UUID when placing new elements
Fixes https://gitlab.com/kicad/code/kicad/issues/12588

(cherry picked from commit a5da46459c)
2022-10-21 11:19:46 +01:00
Jeff Young de9ae28bdb Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/issues/12467

(cherry picked from commit bb1eb94aa0)
2022-10-21 11:16:19 +01:00
Jeff Young 9f151025b3 Fix typo found by dsa-t.
(cherry picked from commit 7e97dc6974)
2022-10-21 11:14:05 +01:00
Jeff Young 549dca1a05 Copy connected-only and keep-top-bottom properties.
Fixes https://gitlab.com/kicad/code/kicad/issues/12691

(cherry picked from commit 585fac19c6)
2022-10-21 11:12:02 +01:00
Jeff Young da520f83ee Use comma to separate diff pair nets/netclassse rather than /.
("/" is problematic because it's more likely to appear in netnames.)

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

(cherry picked from commit 6fd195c389)
2022-10-21 11:11:02 +01:00
Jeff Young 47547713de Broaden reset-sizes-after-layer-switch algorithm.
Fixes https://gitlab.com/kicad/code/kicad/issues/12576

(cherry picked from commit 40ad5b6de3)
2022-10-21 11:09:47 +01:00
jean-pierre charras 705570923e Fix some outdated things (mainly about fix_swig_imports.py, useless with swig version 4)
From Master, commit 397a9302.
Fixes #12414
2022-10-20 17:12:57 +02:00
jean-pierre charras 2827835720 board_stackup_manager: fix incorrect behavior when adding a new dielectric layer.
From Master branch
Fixes #12680
https://gitlab.com/kicad/code/kicad/issues/12680
2022-10-20 11:47:04 +02:00
Jeff Young bf95906f90 Re-entrancy guard for router tool.
Fixes https://gitlab.com/kicad/code/kicad/issues/12604

(cherry picked from commit 413fd82813)
2022-10-19 18:24:33 +01:00
Jeff Young e8d2c222b6 We need both a tool-oriented delete and one that doesn't push/pop, etc.
Fixes https://gitlab.com/kicad/code/kicad/issues/12600

(cherry picked from commit 46752499df)
2022-10-19 18:22:32 +01:00
Jeff Young f891c4641b We were saving the old board pointer, but not updating the current one.
This also makes a few other adjustments to order and to where we look
for the enabled layers which should make it more robust.

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

(cherry picked from commit 631980b0ab)
2022-10-19 18:17:40 +01:00
Jeff Young a65fc7f82a Pin 0-sized pads at 1um rather than throwing them out.
(See bug report for more commentary.)

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

(cherry picked from commit 46a41e2e34)
2022-10-19 18:15:49 +01:00
Jeff Young 5bcd0a5828 Update router sizes when switching layers.
We may have layer-specific rules involved.  Note that at some point
we also need to do something similar on every "fix route" step to
handle area-specific rules.

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

(cherry picked from commit d8a3ba7917)
2022-10-19 14:47:08 +01:00
Jeff Young 74d8040e8c Force flashing when generating SOLIDs.
We only have a single SOLID per pad, so the solid's shape must always
be the flashed shape and then we can do layer-specific flashing tests
internally.

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

(cherry picked from commit 08260661b8)
2022-10-19 14:43:13 +01:00
Jeff Young c5514d43c7 Don't reset editPad if it still exists after model reset.
Fixes https://gitlab.com/kicad/code/kicad/issues/12630

(cherry picked from commit 8b9cbd5805)
2022-10-19 14:42:16 +01:00
Jeff Young 0704e37eb5 Make sure a collector has a guide before handing it to a client filter.
Fixes https://gitlab.com/kicad/code/kicad/issues/12460

(cherry picked from commit 1566bd8b14)
2022-10-19 14:41:30 +01:00
Jeff Young c94de31a8c Try to reconcile SELECTION and BRIGHTENED use of overlay.
For some reason the overlay doesn't get redrawn during the PCBNew
selection disambiguation menu, so we need to not hide BRIGHTENED
items.

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

(cherry picked from commit 436d75e7f9)
2022-10-19 14:40:07 +01:00
Jeff Young 2793e67bab Bring adding-to-group and hiding in sync.
(cherry picked from commit 6a6ef9b1f4)
2022-10-19 14:39:45 +01:00
Jeff Young 3213ea582d Avoid trying to draw empty pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/12605

(cherry picked from commit e866dfe137)
2022-10-19 14:38:40 +01:00
Jeff Young 6003097411 Areas might have layers defined in area as well as rule.
Fixes https://gitlab.com/kicad/code/kicad/issues/12584

(cherry picked from commit 51c20da93e)
2022-10-19 14:34:22 +01:00
Jeff Young 6390633a7b Use GetCurrentNets(), not m_startItem for message panel updates.
Fixes https://gitlab.com/kicad/code/kicad/issues/12592

(cherry picked from commit cbb997a3b5)
2022-10-19 14:28:06 +01:00
Jeff Young dde5f2bed1 Respect DRCEpsilon in diff-pair coupling test.
Fixes https://gitlab.com/kicad/code/kicad/issues/12587

(cherry picked from commit 9119b5072a)
2022-10-19 14:26:19 +01:00
Jeff Young 7c4b8d50dd Fix qa test. 2022-10-19 14:26:19 +01:00
Jeff Young 56f58cf53f Manual cherry-pick of 6ed3618ce5. 2022-10-19 13:49:53 +01:00
Jeff Young 914e396e2e Implement annular ring checking for pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/12109

(cherry picked from commit 9a4136de00)
2022-10-19 13:49:40 +01:00
Jeff Young f6bdd40c30 Manual cherry-pick of ba630971af. 2022-10-19 13:31:16 +01:00
Jeff Young 1bf1620157 Improve default new-library destination logic to be more project aware.
Fixes https://gitlab.com/kicad/code/kicad/issues/12570

(cherry picked from commit 2be9586c38)
2022-10-19 12:59:24 +01:00
Jeff Young da85a5f6bf Work around more instances of the wxWidgets color string locale bug.
Fixes https://gitlab.com/kicad/code/kicad/issues/12552

(cherry picked from commit c0a666507c)
2022-10-19 12:56:17 +01:00
Jeff Young e2219a0c4d Attempt to work-around wxWidgets bug with Serbian & Russian locales.
Fixes https://gitlab.com/kicad/code/kicad/issues/12002

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

(cherry picked from commit 7386e64923)
2022-10-19 12:52:03 +01:00
Mark Roszko de46097ce0 Woops, wrong hash 2022-10-18 04:41:29 +00:00
Mark Roszko ae53986487 Update vcpkg wxpython again 2022-10-18 04:37:50 +00:00
Mark Roszko 3cf3a3ebe0 Bump vcpkg for patched wxpython 2022-10-17 23:50:14 +00:00
Seth Hillbrand a62e6b1f7f Update Translations 2022-10-17 10:28:21 -07:00
Seth Hillbrand d99ce976b9 Don't translate new strings in 6
Debian bookworm updated the ITS files to translate keywords as well.
This puts new strings into the 6 translation archive.  We explicitly set
keywords to non-translate in KiCad version 6
2022-10-17 10:26:49 -07:00
Ulices 161d15dcea Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-10-17 19:04:59 +02:00
taotieren 81319a5fcf Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-10-17 19:04:59 +02:00
Huanyin Liu 628b4ca8b8 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-10-17 19:04:59 +02:00
Henrik Kauhanen d8ed1fea61 Translated using Weblate (Swedish)
Currently translated at 99.9% (7149 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-10-17 19:04:59 +02:00
___davidpr 6f474a389f Translated using Weblate (Serbian)
Currently translated at 14.0% (1008 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sr/
2022-10-17 19:04:59 +02:00
Mads Dyrmann 5a1a147585 Translated using Weblate (Danish)
Currently translated at 75.1% (5375 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/da/
2022-10-17 19:04:59 +02:00
Jan Straka de9ef4ce70 Translated using Weblate (Czech)
Currently translated at 92.9% (6648 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-10-17 19:04:59 +02:00
Jan Straka 835f358816 Translated using Weblate (Czech)
Currently translated at 92.8% (6643 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-10-17 19:04:59 +02:00
Seth Hillbrand 61cfe53be1 Correctly sort positions for default align
When not aligning under mouse cursor, choose the X-most element where X
is top/bottom/left/right.  Previous sorting was not correct for two
directions

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

(cherry picked from commit 697056fa7e)
2022-10-14 16:15:51 -07:00
Seth Hillbrand 535982f245 Avoid scaling unity models
There is no benefit to applying the identity transformation to models
when exporting the board to STEP

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

(cherry picked from commit 98431eed79)

Fixes https://gitlab.com/kicad/code/kicad/issues/10232
2022-10-14 13:08:13 -07:00
jean-pierre charras 8ee73903c6 GERBVIEW_SELECTION_TOOL, disambiguationMenu: do not hide an item before highlight it.
This is not useful, and creates an issue when closing the menu by ESC key.
Fixes #12636
https://gitlab.com/kicad/code/kicad/issues/12636
2022-10-14 09:34:02 +02:00
Seth Hillbrand 292492bd01 Prevent crashes when canceling duplication
Duplicating multiple footprints, moving and then pressing Esc could
crash when we attempt to re-select the original items.  This allows
bypassing the issue when running from the duplication tool
2022-10-13 16:32:56 -07:00
Jeff Young f1029b7280 We don't always have a line when dragging.
Fixes https://gitlab.com/kicad/code/kicad/issues/12612

(cherry picked from commit b2f05c758b)
2022-10-13 09:15:24 -07:00
jean-pierre charras 578c0ef0f0 3D viewer: add missing initialization of FL_SOLDERPASTE in BOARD_ADAPTER.
Fixes #12631
https://gitlab.com/kicad/code/kicad/issues/12631
2022-10-13 10:08:24 +02:00
Alex 238c8df8b5 Fix crash on Specctra import.
Fixes https://gitlab.com/kicad/code/kicad/issues/12583


(cherry picked from commit 2741d0eb4b)
2022-10-10 18:37:59 +00:00
jean-pierre charras 95acc1bf33 Eeschema printing: fix some issues.
The offset setting was incorrect when using wxAffineMatrix2D.
It was visible when printing more than one sheet.
Note also when not using wxAffineMatrix2D, all pages must have the same orientation
(PORTRAIT/LANDSCAPE is not managed)
From master branch, commit 79c30180
2022-10-09 19:57:32 +02:00
jean-pierre charras 8dbfe79536 Symbol Editor: Fix reverting changes on a root symbol: derived symbols are displayed wrong
Reverting changes broke links between derived symbols and the root symbol.
Now fixed by do not delete and recreate reverted symbol.
From master, commit f5fd12c0
Fixes #10792
2022-10-08 16:15:16 +02:00
Seth Hillbrand 8f9830eb92 Update Translations 2022-10-07 11:37:40 -07:00
Seth Hillbrand bf0b80d676 Remove errant new string 2022-10-07 11:37:28 -07:00
Henrik Kauhanen bc8e3c22d8 Translated using Weblate (Swedish)
Currently translated at 99.8% (7149 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-10-06 11:15:53 +02:00
Jan Straka 28ddfbadbf Translated using Weblate (Czech)
Currently translated at 92.7% (6641 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-10-05 00:26:50 +02:00
Seth Hillbrand e834374ad2 Drill size is absolute
Use hole plating size for visibility only, not zone filling, routing or
DRC

(cherry picked from commit b4f3390626)
2022-10-04 10:00:36 -07:00
Seth Hillbrand 981aafd5d9 Allow non-named tool in Remove()
The tool command string was optional and not set when calling Remove()
through the Cut action.  Referencing the value causes unhandled
assertions.  We don't actually need the value because we don't pop
anything without a match.  The empty string will not match

Fixes https://gitlab.com/kicad/code/kicad/issues/12562
2022-10-02 13:43:33 -07:00
jean-pierre charras 09960caa66 Apply commit e73dd40f from master to this branch.
(APPEARANCE_CONTROLS: fix incorrect behavior of Preset layers widget in non English languages)
fixes #12227
2022-10-02 17:57:02 +02:00
Jeff Young cf6fd64758 Remove wxFloatingPointValidator which causes issues in some locales.
Fixes https://gitlab.com/kicad/code/kicad/issues/12176
2022-10-02 13:00:20 +01:00
Seth Hillbrand b08dccb7b3 Update Translations 2022-09-29 19:10:56 -07:00
boonchai k d6e5c74573 Translated using Weblate (Thai)
Currently translated at 99.5% (7128 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/th/
2022-09-29 19:10:18 -07:00
obit ea93502ab3 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-09-29 19:10:18 -07:00
Henrik Kauhanen e1f402aa3d Translated using Weblate (Swedish)
Currently translated at 99.8% (7149 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-09-29 19:10:18 -07:00
obit 08f1b666d1 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-09-29 19:10:18 -07:00
boonchai k 8d62725598 Translated using Weblate (Thai)
Currently translated at 99.5% (7127 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/th/
2022-09-29 19:10:18 -07:00
ZbeeGin cbd8b3c59e Translated using Weblate (Polish)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-09-29 19:10:17 -07:00
Jan Straka e9cc66cc8d Translated using Weblate (Czech)
Currently translated at 92.7% (6638 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-09-29 19:10:17 -07:00
Henrik Kauhanen 258b702dad Translated using Weblate (Swedish)
Currently translated at 99.8% (7149 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-09-29 19:10:17 -07:00
ZbeeGin 6c3e891123 Translated using Weblate (Polish)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-09-29 19:10:17 -07:00
taotieren 80937ae2c0 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-09-29 19:10:17 -07:00
Henrik Kauhanen 2d37b86530 Translated using Weblate (Swedish)
Currently translated at 99.8% (7148 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-09-29 19:10:17 -07:00
Henrik Kauhanen 8bdcd299d7 Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-09-29 19:10:17 -07:00
Jeff Young 22e9985f5d Use more basic strings which have already been translated. 2022-09-29 23:58:35 +01:00
Mark Roszko 594beef22e Bump vcpkg wxwidgets to 3.2.1 2022-09-29 13:38:53 +00:00
Marek Roszko 03ed7a4a27 Ensure the socket server is killed during destruction of the kiway player
(cherry picked from commit 8ae48bb093)
2022-09-29 02:22:54 +00:00
Jeff Young 8cbfd8af9f Files missing from earlier commit. 2022-09-28 15:10:28 +01:00
Jeff Young c16e86be9a Use router's connectivity algorithm, not CONNECTIVITY_DATA's.
Fixes https://gitlab.com/kicad/code/kicad/issues/10745

(cherry picked from commit 107f409106)
2022-09-28 15:01:29 +01:00
Jeff Young b0e2aeb972 Apply the same accuracy band to connectivity as we use for hittesting.
Fixes https://gitlab.com/kicad/code/kicad/issues/10745

(cherry picked from commit 9cf3c529d3)
2022-09-28 14:58:43 +01:00
Jeff Young fc06192643 More improvements to drag tool selection disambiguation.
Fixes https://gitlab.com/kicad/code/kicad/issues/10745

(cherry picked from commit 2743fd583f)
2022-09-28 14:57:22 +01:00
Jeff Young 2faaa0a042 Improve drop-a-knee-selection-to-a-single-segment algorithm.
In particular, don't rely on there being only two items in the
collector at the start.

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

(cherry picked from commit a619ef9d53)
2022-09-28 14:56:11 +01:00
Jeff Young 2d4bcc6557 Move cvpcb filter to a timer.
Fixes https://gitlab.com/kicad/code/kicad/issues/12445

(cherry picked from commit 1fcd7d6285)
2022-09-28 14:53:10 +01:00
Jeff Young ba72676edb Fix uninitialized variable.
(cherry picked from commit 1e1aedbe30)
2022-09-28 14:51:57 +01:00
Jeff Young 1a2e2bd29a Try and reduce opportunity for lost keystrokes.
Fixes https://gitlab.com/kicad/code/kicad/issues/12445

(cherry picked from commit d2712bac37)
2022-09-28 14:50:49 +01:00
Jeff Young 8b690c9a3c Restore fix for #10029.
Fixes https://gitlab.com/kicad/code/kicad/issues/12445

(cherry picked from commit 1be8adebf5)
2022-09-28 14:50:31 +01:00
Jeff Young 6d25e57cd7 Allow free pad usage in router.
Fixes https://gitlab.com/kicad/code/kicad/issues/11730

(cherry picked from commit 7c83c78afe)
2022-09-28 14:49:44 +01:00
Jeff Young 7dfa715a45 Bug fixes for layer expression processing.
1) Push a VAR onto the stack, not a resolved value
2) Don't collapse a PCB_LAYER_VALUE to a VALUE during processing
3) Make sure we run overloaded operators from the correct side

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

(cherry picked from commit cf1565a16a)
2022-09-28 14:00:25 +01:00
Jeff Young e8a10939b5 Fix old copy/paste error (from 2017, believe it or not).
Fixes https://gitlab.com/kicad/code/kicad/issues/11487

(cherry picked from commit d9f75556bd)
2022-09-28 13:55:44 +01:00
Jeff Young 44ec38ad2d Fix logic around Select All inside an entered group.
Fixes https://gitlab.com/kicad/code/kicad/issues/12411

(cherry picked from commit 2d3b8d6393)
2022-09-28 13:31:16 +01:00
Jeff Young 9cb6df9c38 Don't crash on empty SHAPE_LINE_CHAINs.
Fixes https://gitlab.com/kicad/code/kicad/issues/12407

(cherry picked from commit fc74de81fb)
2022-09-28 13:30:04 +01:00
Jeff Young 4a5fdd4214 Display crosshairs in picker tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/10183

(cherry picked from commit 0a5ca5b485)
2022-09-28 13:29:32 +01:00
Jeff Young fe7ed364b6 Allow vias to connect <no net> tracks even when DRC checking is on.
Fixes https://gitlab.com/kicad/code/kicad/issues/12403

(cherry picked from commit eaccd40c75)
2022-09-28 13:26:12 +01:00
Jeff Young 43f9863182 Copy field properly.
Offset for new parent, and set parent property.

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

(cherry picked from commit 45fb0107a0)
2022-09-28 12:50:02 +01:00
Jeff Young 4987809fe3 Make Scintilla paste a separate undo operation.
Fixes https://gitlab.com/kicad/code/kicad/issues/11756

(cherry picked from commit c3a5947fe6)
2022-09-28 12:49:12 +01:00
Jeff Young 894f424d14 Don't give Scintilla a colour with alpha; it doesn't know what to do.
Fixes https://gitlab.com/kicad/code/kicad/issues/10829

(cherry picked from commit 1b104f20b6)
2022-09-28 12:48:24 +01:00
Jeff Young e21995c401 Prune pasted data of non-enabled layers.
Fixes https://gitlab.com/kicad/code/kicad/issues/11997

(cherry picked from commit 5b3bd9be83)
2022-09-28 12:47:14 +01:00
Jeff Young bb7362ceba Don't allow a SaveAs to overwrite the root sheet.
Also prevents EESchema from loading sheets which recurse.

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

(cherry picked from commit d030f03844)
2022-09-28 12:45:20 +01:00
Wayne Stambaugh 334268f5e7 Begin version 6.0.9 development. 2022-09-26 21:11:47 -04:00
Wayne Stambaugh 3abcdb7e63 Tag release version 6.0.8. 2022-09-26 21:06:50 -04:00
Seth Hillbrand c45aa734b0 Fix missing DRC via/track check
Depending on pointer ordering, the via/track clearance check might not
run as we were only checking when the first element was a track not via.

Re-written version of 0150655ed3 for v6
2022-09-20 15:32:55 -07:00
Wayne Stambaugh a35b89258a Eeschema: fix schematic symbol library cache refresh bug.
Please note that this changes the LIB_PIN object name comparison from case
insensitive to case sensitive.

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

(cherry picked from commit 26e7261b20)
2022-09-19 07:20:44 -04:00
Seth Hillbrand 408bf85cf5 Update Translations 2022-09-18 19:34:42 -07:00
Petter Reinholdtsen ba34cd629e Translated using Weblate (Norwegian Bokmål)
Currently translated at 73.1% (5238 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/nb_NO/
2022-09-19 04:30:16 +02:00
Jan Straka 81dba33c8f Translated using Weblate (Czech)
Currently translated at 92.7% (6638 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-09-19 04:30:14 +02:00
Henrik Kauhanen 2b238de012 Translated using Weblate (Swedish)
Currently translated at 99.8% (7148 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-09-19 04:30:11 +02:00
Mark Roszko c0ce4cb0bc Bump vcpkg python3 to 3.9.14 2022-09-18 18:04:31 +00:00
jean-pierre charras f379fa4f7f Fix a UTF8 convert issue in some BOM python scripts.
Fixes #12435
https://gitlab.com/kicad/code/kicad/issues/12435
2022-09-16 11:35:09 +02:00
Seth Hillbrand 4e67b94b00 Update Translations 2022-09-12 13:21:16 -07:00
Grzegorz Szymaszek bb0f3550e0 Translated using Weblate (Polish)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-09-12 13:21:16 -07:00
Tokita, Hiroshi ce1f166aa8 Translated using Weblate (Japanese)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-09-12 13:21:16 -07:00
Mark Roszko 437cd8b1e5 Trim down 3d viewer search paths
(cherry picked from commit 17bec365db)
2022-09-09 17:05:47 +00:00
Eduardo Behr 3e8532264e Fix severe simulation memory leaks 2022-09-08 01:52:32 +02:00
Seth Hillbrand 9b15717349 Update Translations 2022-09-07 14:37:32 -07:00
Seth Hillbrand 73d00cc5d7 Remove extra new string 2022-09-07 14:36:34 -07:00
lê văn lập 295aa15c3d Translated using Weblate (Vietnamese)
Currently translated at 17.0% (1218 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/vi/
2022-09-07 22:50:41 +02:00
Zoran 50adb45c33 Translated using Weblate (Serbian)
Currently translated at 14.0% (1007 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sr/
2022-09-07 22:50:41 +02:00
Vitan Košpenda a1a44db01d Translated using Weblate (Slovenian)
Currently translated at 3.2% (233 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sl/
2022-09-07 22:50:41 +02:00
Konstantin Baranovskiy b2f68854b2 Translated using Weblate (Russian)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-09-07 22:50:41 +02:00
Jan Straka 42f844826d Translated using Weblate (Czech)
Currently translated at 92.7% (6637 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-09-07 22:50:41 +02:00
Henrik Kauhanen 52ca321b11 Translated using Weblate (Swedish)
Currently translated at 99.8% (7147 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-09-07 22:50:41 +02:00
Toni Laiho 5af5511dfe Translated using Weblate (Finnish)
Currently translated at 99.9% (7154 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-09-07 22:50:41 +02:00
jean-pierre charras f06f205886 orcadpcb2 netlist export: fix an issue with duplicated pins in multi-unit symbols.
Due to some changes in code, pins common to units were written more than once.
From master branch
2022-09-07 17:56:38 +02:00
Mark Roszko 030a562ba6 Fix autopan sticking on Windows due to lost events
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11425
2022-09-07 14:30:59 +00:00
Roberto Fernandez Bautista 2393165ada CADSTAR PCB: Fix regression when loading pads in footprints
Zero sized pads can be valid - e.g. a through hole pad

(cherry picked from commit fa5dc23797)
2022-09-06 20:29:49 +02:00
Tomasz Wlostowski e593e0b014 router: somewhat improved stop-if-walk-path-is-too-long heuristic in the walkaround algorithm 2022-09-06 11:06:38 -07:00
Tomasz Wlostowski 42dae1504a router: fix negative chamfer value for hulls generated for 0-length segments 2022-09-06 11:06:31 -07:00
Seth Hillbrand 440d324c9e Don't prevent immediate actions while router active
Immediate actions that can take place are useful.  We should only be
preventing immediate actions while actively routing or dragging

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

(cherry picked from commit 91fbb5c957)
2022-09-06 11:04:33 -07:00
Seth Hillbrand 29cadaf54e Force removal of zero-sized pads on load.
Pads with zero width or height cause issues when rendering and
selecting.  KiCad has never allowed these elements but hasn't prevented
importing systems where they exist.  This prevents their import and
cleans existing designs where the pads are placed

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

(cherry picked from commit 2ee65b2d83)
2022-09-06 11:03:41 -07:00
Seth Hillbrand 83eb9e03b1 Keep the reset text correct
Ensures that after setting the initial dialog page, we also set the
proper text in the reset button as the event does not get fired

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

(cherry picked from commit 9faff78258)
2022-09-06 10:42:02 -07:00
Seth Hillbrand b324abefe5 Handle cases where Simplify removes all outlines
This could theoretically happen for a fully degenerate polygon

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

(cherry picked from commit 5a37211fdb)
2022-09-06 10:42:02 -07:00
Seth Hillbrand b72675ba92 Allow board saves without modifying project files
Without the project files, certain settings will not be saved by this
python call.  This defaults to false (current behavior) but setting the
`aSkipSettings` to true will revert to v5 behavior

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

(cherry picked from commit 8418fe12d8)
2022-09-06 10:18:24 -07:00
Seth Hillbrand 70b69af313 Hide cursor while warping on Wayland
Based on https://gitlab.freedesktop.org/xorg/xserver/-/issues/734 we
hide the window cursor prior to warping, which allows XWayland to
reposition the cursor.  This is only performed when Wayland is detected;
all other configurations call the standard warp routine

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

(cherry picked from commit a118f20464)
2022-09-06 10:13:40 -07:00
jean-pierre charras 83f135315c 3D models list in footprint properties: fix issue when a lot of 3D models is added
From master branch
2022-09-06 17:33:09 +02:00
Jeff Young c276280e5c Remove curly brace from string encoding.
It causes issues with formatting constructs and text variable refs,
and it's not a reserved character even in filenames.

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

(cherry picked from commit 71724bea0c)
2022-09-04 10:37:32 +01:00
Roberto Fernandez Bautista 07481cd4ca CADSTAR PCB: Invert logic for guessing which layer is top / bottom
Ensures correct automatic layer mapping is applied to the design in
https://gitlab.com/kicad/code/kicad/-/issues/12349

(cherry picked from commit 9abf3438b8)
2022-09-04 01:03:55 +02:00
Roberto Fernandez Bautista 8a9ee0f9e1 CADSTAR PCB: Load 2-point polygons as line segments
Fixes asserts when loading design from https://gitlab.com/kicad/code/kicad/-/issues/12349

(cherry picked from commit c961624d43)
2022-09-04 01:03:55 +02:00
Roberto Fernandez Bautista 9a823ca61b CADSTAR PCB: Parse Teardrops
Todo: We need to figure out how we will load teardrops. For now
just drop them on import.

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

(cherry picked from commit 21b3753e9b)
Edited to remove string changes
2022-09-04 01:03:51 +02:00
Wayne Stambaugh 5afeb45a84 Eeschema: fix crash when attempting to edit missing library symbol.
Disable the edit symbol buttons in the symbol properties dialog when
there is no library symbol to edit.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11318
2022-09-02 15:48:10 -04:00
Seth Hillbrand 45da795668 Units are stored in the instance data
At the moment, units are stored in the instance data, so when loading
the file, all symbols will have bbox for the first unit.  After calling
`UpdateUnit()`, we need to recache the rtree bounding boxes to get
correct hit tests

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


(cherry picked from commit 939313088e)
2022-09-02 12:06:24 +00:00
Mark Roszko 87a8e69632 Move the PCM download cache to PATHS::GetUserCachePath
Second commit for https://gitlab.com/kicad/code/kicad/-/issues/10165

(cherry picked from commit 097f30a272)
2022-09-02 13:44:00 +02:00
Marek Roszko d57caf2ad7 Move the PCM cache to PATHS::GetUserCachePath
It still remains that on Windows, Documents can be bounded to network or cloud storage.
AppData\Local is intended for local PC caching.

Fix https://gitlab.com/kicad/code/kicad/-/issues/10165

(cherry picked from commit a855be28fa)
2022-09-02 13:44:00 +02:00
passionateengineer 7f1c2461b5 Fixes inverted Y position in pin table.
Fixes https://gitlab.com/kicad/code/kicad/issues/11988


(cherry picked from commit 3389e456b1)
2022-09-02 10:49:14 +00:00
Roberto Fernandez Bautista 26104c83ba Fix wxWidgets sizer assert in SYMBOL_PREVIEW_WIDGET 2022-09-02 12:29:23 +02:00
BugRepellentExtraStrong 6d14ce24aa eeschema: Fixes wrong displayed secondary worksheet
Fixes https://gitlab.com/kicad/code/kicad/issues/12017


(cherry picked from commit 02a6566438)
2022-09-02 10:03:44 +00:00
Roberto Fernandez Bautista e760579828 Fix annotation of incomplete multi-unit symbols and re-annotation of duplicates
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11496

(cherry picked from commit 55f22c526a)
2022-09-02 12:01:33 +02:00
Roberto Fernandez Bautista 7640246097 Assign default hotkey to Flip Board in 3D viewer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12337


(cherry picked from commit ad45b81dee)
2022-09-02 09:30:43 +00:00
Jeff Young e25d937fd8 Null-ptr safety for diff-pair-coupling test.
Fixes https://gitlab.com/kicad/code/kicad/issues/12329

(cherry picked from commit 854acd4c77)
2022-09-02 01:18:18 +01:00
Jeff Young ea3f6c8406 Make sure dirty flag gets set, and leave save enabled regardless.
Fixes https://gitlab.com/kicad/code/kicad/issues/11824

(cherry picked from commit 09773e3e2e)
2022-09-02 01:11:20 +01:00
Jeff Young bf272e379f Run hole-to-hole checks on Edge_Cuts layer.
Also makes the flashing logic inside PAD::GetEffectiveShape() easier
to understand.

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

(cherry picked from commit e0f6a6e475)
2022-09-02 01:11:20 +01:00
Jeff Young 0acea2e386 Make sure via-gap-same-as-trace-gap gets turned off for board settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/12236

(cherry picked from commit 7baa56528a)
2022-09-02 00:55:53 +01:00
Roberto Fernandez Bautista 83305dd407 Re-route m_last_head after routing fails
This should ensure the shove state gets reverted

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9023
2022-09-01 22:06:06 +00:00
Seth Hillbrand 1d5db513a1 Ensure arcs are handled in topology
Use the connection-independent `Anchor()` function to get connection
points for either arcs or segments in topology.  This allows the
ratsnest to be correctly drawn between nets with arcs

Fixes https://gitlab.com/kicad/code/kicad/issues/12205
2022-09-01 22:06:06 +00:00
Jeff Young 9d0d45450b Account for groups in undo of Position Relative To.
Also fixes a bug were pads weren't correctly being found for anchoring
the selection before the Position Relative To.

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

(cherry picked from commit 1e68c353f1)
2022-09-01 16:25:41 +01:00
Jeff Young 9bce3c243a Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/issues/12140

(cherry picked from commit e3e24322bb)
2022-09-01 14:35:36 +01:00
Roberto Fernandez Bautista ace0032c82 Fix build error & just completely remove the string instead of guarding 2022-09-01 13:45:40 +02:00
Roberto Fernandez Bautista cd30711cf8 Remove additional string from a3da0b9af6 2022-09-01 11:35:22 +02:00
Roberto Fernandez Bautista a3da0b9af6 CADSTAR Schematic: Load symbols even if part definition is incomplete
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11671


(cherry picked from commit 8725c3a35f)
2022-09-01 09:25:14 +00:00
Wayne Stambaugh 32a11e4df0 Eeschema: fix broken instance data when adding new symbol.
Pass the current SCHEMATIC object pointer in SCH_SYMBOL ctor so that
newly created symbols will update the current instance data on creation
when the current sheet instance is being displayed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12190
2022-08-26 12:47:13 -04:00
Roberto Fernandez Bautista 5606714952 DIALOG_PASTE_SPECIAL: Set focus on OK button
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12285


(cherry picked from commit 8a02f2f809)
2022-08-25 19:26:20 +00:00
jean-pierre charras 9af666ba34 Eeschema: ensure reference field is initialized when adding a new symbol in schematic 2022-08-24 14:30:14 +02:00
jean-pierre charras 4d9802760e Set locale in SaveToFile routine before calling json stuff.
It avoid wxWidgets alerts about locale when running some python scripts
2022-08-24 09:30:05 +02:00
Seth Hillbrand c3496d61eb Set locale in python save routine
Fixes https://gitlab.com/kicad/code/kicad/issues/11006
2022-08-23 09:41:55 -07:00
Wayne Stambaugh 1e09f0e8b0 Fix Eagle plugin footprint QA test issue.
Apparently mapping Eagle footprint layers to the KiCad Dwg_User
that were previously mapped to UNDEFINED_LAYER breaks the QA test
and causes the footprint editor to crash when opening Eagle
footprints.  This means that the potential data loss issue when
loading Eagle footprints is still in play.

(cherry picked from commit c72457482c)
2022-08-22 11:40:15 -04:00
Wayne Stambaugh c2c4609272 Fix Eagle plugin board layer mapping issue.
The Eagle plugin layers have to be mapped differently depending on
whether a board is being imported or a footprint library is being
cached.  Footprint libraries can bypass the manual layer remapping
step that happens when importing a board.

Please note that when loading footprints in the footprint editor
and viewer, all layers that do not directly map to KiCad layers are
put on the Dwg_User layer so that there is data loss.  Users will
have to manually remap objects to the correct layer as required.
This is less than ideal but until the footprint library table parser
supports prompting users to remap unknown layers, it will have to do.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11839
(cherry picked from commit 0bc1188897)
2022-08-22 11:40:15 -04:00
Seth Hillbrand 9328cf42c5 Don't close blocking dialog in backannotate
Back annotate is called from a dialog, so this will close itself but not
exit, locking the UI

(cherry picked from commit 28876bef90)

Fixes https://gitlab.com/kicad/code/kicad/issues/12255
2022-08-22 07:05:30 -07:00
Seth Hillbrand 93f23dbdcd Update translations 2022-08-20 20:10:29 -07:00
Seth Hillbrand 9e9b38ef6a Revert "cadstar: Report warning that imported text may be different"
This reverts commit f637a820b6.

New strings are not allowed in v6
2022-08-20 20:09:40 -07:00
Seth Hillbrand 5e409f0f6c Remove string change and associated new feature
String changes are not allowed in v6 branch
2022-08-20 20:06:26 -07:00
Seth Hillbrand 408e7fed29 Translated using Weblate (German)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-08-21 04:53:12 +02:00
boonchai k 85ce1a2a20 Translated using Weblate (Thai)
Currently translated at 99.5% (7123 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/th/
2022-08-21 04:53:12 +02:00
김랑기 c1947c108b Translated using Weblate (Korean)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-08-21 04:53:12 +02:00
Arnau Llovet Vidal d2916bf399 Translated using Weblate (Catalan)
Currently translated at 65.6% (4695 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-08-21 04:53:12 +02:00
김랑기 93f973d825 Translated using Weblate (Korean)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-08-21 04:53:11 +02:00
Henrik Kauhanen 72503c47c6 Translated using Weblate (Swedish)
Currently translated at 99.8% (7147 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-08-21 04:53:11 +02:00
김랑기 db96624990 Translated using Weblate (Korean)
Currently translated at 100.0% (7157 of 7157 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-08-21 04:53:11 +02:00
jean-pierre charras 962df45b65 Fix some issues in PCB_SELECTION_TOOL::selectAllItemsOnSheet():
especially a typo that prevent working on root sheet.
Clearly, commit 6b2bb4d8 was very poorly designed and (or not even) tested.
2022-08-20 13:04:06 +02:00
Roberto Fernandez Bautista f92d25e00b Fix SHAPE_LINE_CHAIN::Simplify() when there are only 3 points in the chain
We weren't updating m_shapes properly.

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

(cherry picked from commit 1fa1b44d02)
2022-08-19 20:58:28 +01:00
Marek Roszko 64220656e9 Avoid missing null check in RC_TREE_MODEL::DeleteItems
(cherry picked from commit 19e27ef587)
2022-08-17 22:08:59 +00:00
Wayne Stambaugh 39940fe5ab Fix missing legacy value and footprint field instance data.
The legacy and s-expression (prior to version 20200828) file formats only
supported symbol unit and reference fields so the newly added value and
footprint fields must be updated from the original symbol fields.

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

(cherry picked from commit 797827b833)
2022-08-17 14:24:13 -04:00
Wayne Stambaugh 40977514ce Fix more wxWidgets 3.1 and later deprecated build warnings. 2022-08-17 14:13:33 -04:00
Wayne Stambaugh cfde5300d7 Fix wxWidgets 3.1 and later deprecated build warnings.
wxWidgets 3.1 has deprecated wxPATH_NORM_ALL when normalizing file
paths when calling wxFileName::Normalize().  This change keeps the
existing behavior except in places where our own internal
ExpandEnvVarSubstitutions() to expand environment variables.

(cherry picked from commit 898ec0d094)
2022-08-17 14:07:06 -04:00
Forrest Voight 30c83ed055 kiid.cpp: Fix Boost version incompatibility and use of boost::*::detail
Fix compile with Boost 1.65.1 (and possibly some or all of the 1.59-1.66
range); remove dependence on private boost::*::detail members.

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

Comment tweaks by Mark Roszko @mroszko

(cherry picked from commit bbc0c61ccb)
2022-08-17 11:37:12 -04:00
Marek Roszko 64acd8bd47 Throw in default initializers for MINOPTMAX to silence coverity 2022-08-16 23:53:42 -04:00
Marek Roszko ca4da4706a Fix reserve call with the wrong source for size 2022-08-16 23:53:42 -04:00
Roberto Fernandez Bautista 1005f75cdb CADSTAR PCB: Allow remapping all non-electrical layers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12196


(cherry picked from commit 6b349fdb0a)
2022-08-14 21:26:37 +00:00
Roberto Fernandez Bautista f637a820b6 cadstar: Report warning that imported text may be different
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12195


(cherry picked from commit 69d696660b)
2022-08-14 21:25:46 +00:00
Wayne Stambaugh 47cb817a86 Fix compile warnings. 2022-08-11 15:48:49 -04:00
jean-pierre charras 7769069078 DIALOG_COLOR_PICKER: fix an issue in DC.SetDeviceOrigin() due to changes in wxWidgets.
DC.SetDeviceOrigin() behavior has changed in version 3.1.7 (or 3.1.6), and the settings
needs a small change.
From master branch
Fixes #12204
https://gitlab.com/kicad/code/kicad/issues/12204
2022-08-11 10:20:46 +02:00
jean-pierre charras 411d57396c eeschema: Fix issue when saving labels having more than 50 chars
These labels (or global label...) were saved with a erroneous angle.
Fixes #12151
https://gitlab.com/kicad/code/kicad/issues/12151
2022-08-05 13:33:35 +02:00
jean-pierre charras 5f00847a86 Eeschema: another trial to fix bitmap printing in wx version > 3.1.5
We had on a regular basis problems when printing bitmaps.
Probably due to issues both in wx and in our code.
From master branch
2022-08-04 14:56:37 +02:00
Jeff Young 36a0c2a9cc Fix issue with caches not being initialized when printing msg bar.
(cherry picked from commit 43df863df2)
2022-08-04 13:04:21 +01:00
Jeff Young 4ac48ad829 Cherry-pick of 2bf33321d1. 2022-08-04 09:29:45 +01:00
Jeff Young 3bca4f8835 Fix another case of the instance data getting messed up.
(Or, more accurately in this case, of the instance data not getting
applied to the current view.)

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

(cherry picked from commit 5295342f42)
2022-08-04 09:22:23 +01:00
Jeff Young afc491c5a5 58f553a9ca requires that cache be layer-sensitive.
Fixes https://gitlab.com/kicad/code/kicad/issues/11814

(cherry picked from commit 5e80e2a421)
2022-08-04 00:48:18 +01:00
Jeff Young f75104d456 Performance improvements for CvPCB.
Fixes https://gitlab.com/kicad/code/kicad/issues/12063

(cherry picked from commit 66d6a5a9dd)
2022-08-04 00:31:51 +01:00
Jeff Young 1f3bb83a06 Make EEschema highlight net consistent with PCBNew.
In particular, highlight net on an already highlighted net clears
highlight.

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

(cherry picked from commit e36491f231)
2022-08-04 00:08:12 +01:00
Jeff Young efc75047c1 Pay attention to units for page frames.
Fixes https://gitlab.com/kicad/code/kicad/issues/11408

(cherry picked from commit 404015b0a5)
2022-08-04 00:07:24 +01:00
Jeff Young 7b5e3feb19 By-hand cherry-pick of 004abcd370. 2022-08-04 00:05:48 +01:00
Jeff Young fec9331b48 Handle rotation while moving from move tool.
This keeps us from getting CancelInteractive events in the move tool
when the EditTool runs to do the rotate.

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

(cherry picked from commit bdffbbd43b)
2022-08-04 00:00:43 +01:00
Seth Hillbrand a12ae5050a Cleanup unused code
(cherry picked from commit 76b9e25143)
2022-08-02 08:51:04 -07:00
Seth Hillbrand 82e8e38054 PNS: Handle via-in-pad distances when tuning
Tuning with a via in pad, the via isn't a part of the full line.  But we
still need to account for the line length distance of the
starting/ending vias.  To do this, we simply measure the height from
the ending track to the ending pad and starting track to starting pad
2022-08-01 20:23:07 -07:00
Seth Hillbrand 57de5a6b65 Net Inspector: Handle via layers
Rather than measuring the total via height, measure from the entry to
exit track height to get a more accurate distance
2022-08-01 20:22:13 -07:00
Seth Hillbrand 675a5a6e7b Fix simplify routine
The change in c9c31fcbc2 missed a number of cases.  This reverts back to
the system as it existed before 2be352b9f9
but using the revised method of determining A-B-C distance and avoiding
resizing the arrays
2022-08-01 09:48:29 -07:00
Seth Hillbrand 6c617d84ca Prevent drag index from exceeding full line count
Simplification removes segments, so we might lose our valid index.
Ideally, we would simplify during the assembly or pass the input index
to the simplify routine to maintain the proper value.

Fixes https://gitlab.com/kicad/code/kicad/issues/12137
2022-08-01 08:57:45 -07:00
Seth Hillbrand 7f71eef45b Move sheetpins by their connection point
Need to calculate the sheet pin anchor position in order to get it
aligned to the grid while moving

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

(cherry picked from commit 225b03d702)
2022-07-31 20:04:29 -07:00
Seth Hillbrand b50d7adaeb Update translations 2022-07-31 13:00:56 -07:00
Seth Hillbrand 027b745124 Merge remote-tracking branch 'weblate/6.0' into 6.0
Resolves conflicts
2022-07-31 12:59:51 -07:00
Seth Hillbrand c9c31fcbc2 Don't resize vectors in hot loops
Fixes a slowdown caused by erasing elements from the middle of a vector
during a hot loop in SHAPE_LINE_CHAIN::Simplify().  This gets called
quite a bit when loading boards and updating lines, so it needs to be as
fast as possible

Fixes https://gitlab.com/kicad/code/kicad/issues/12115
2022-07-31 12:48:25 -07:00
김세영 45c20bec49 Translated using Weblate (Korean)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-31 21:18:59 +02:00
Tokita, Hiroshi fe0d09222d Translated using Weblate (Japanese)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-07-31 21:18:58 +02:00
Toni Laiho 28d755ac27 Translated using Weblate (Finnish)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-07-31 21:18:57 +02:00
김랑기 37d9186e2d Translated using Weblate (Korean)
Currently translated at 99.9% (7154 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-30 14:01:42 +02:00
minsu kim (0xGabriel) c076239915 Translated using Weblate (Korean)
Currently translated at 99.9% (7154 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-30 14:01:42 +02:00
김낙환 ca34cea2c1 Translated using Weblate (Korean)
Currently translated at 99.9% (7154 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-30 02:45:40 +02:00
박세훈 4c064e41f6 Translated using Weblate (Korean)
Currently translated at 99.9% (7154 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-30 02:45:39 +02:00
jean-pierre charras 650caae323 Avoid changing a translated string when not mandatory. 2022-07-29 20:04:52 +02:00
jean-pierre charras 06e612661c Kicad2step: fix STEP export from Pcbnew, broken by changes in commit 8456d6c
also: DIALOG_EXPORT_STEP: remember tolerance option during a session.
From Master branch.
Fixes #12119
https://gitlab.com/kicad/code/kicad/issues/12119
2022-07-29 19:46:34 +02:00
Alex ee4e4d0773 Don't recalculate constants at every call in isqrt.
(cherry picked from commit 27869b1a37)
2022-07-29 08:55:43 -07:00
jean-pierre charras 147b11abe0 Fix an issue when printing bitmaps when not on wxWidgets 3.1.6 and 3.1.7
This this a hack to fix a bug in wxWidgets.
From Master branch
2022-07-29 13:35:51 +02:00
Seth Hillbrand df9cf0a0c3 Fix crash in PNS walkaround
Placing via in walkaround mode and colliding with an arc triggered an
unneeded assertion.

Also fixes the bad assertion format that did not receive strings
2022-07-28 09:36:31 -07:00
Henrik Kauhanen b1ce6be634 Translated using Weblate (Swedish)
Currently translated at 99.8% (7142 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-07-28 12:15:13 +02:00
Jeff Young 3f448a7eaa Clear dimension pointer after committing.
Fixes https://gitlab.com/kicad/code/kicad/issues/11864

(cherry picked from commit b80fd5329d)
2022-07-28 10:46:02 +01:00
Jeff Young 5214290000 Get rid of error-prone reverse logic.
Fixes https://gitlab.com/kicad/code/kicad/issues/12049

(cherry picked from commit 012d861aab)
2022-07-28 10:45:56 +01:00
Jeff Young fcd7e827e6 Hook up ID_GRID_SETTINGS for footprint viewers.
Fixes https://gitlab.com/kicad/code/kicad/issues/12030

(cherry picked from commit 6a9c6e8599)
2022-07-28 10:44:03 +01:00
Jeff Young 466f1283c1 DXF parameters are for DXF (only).
Fixes https://gitlab.com/kicad/code/kicad/issues/12021

(cherry picked from commit 763c77eab8)
2022-07-28 10:43:56 +01:00
Seth Hillbrand 39dd51490d Protect against double-refresh
The wxtimer can fire multiple times and there exists the possiblity for
this to happen before the flags are properly set to prevent it.  This
creates a concurrency mutex to skip the EDA_DRAW_PANEL_GAL refresh if
one is already underway.

Fixes https://gitlab.com/kicad/code/kicad/issues/12094
2022-07-27 20:28:18 -07:00
Seth Hillbrand 120ceade06 Update Translations 2022-07-27 19:48:56 -07:00
Jeff Young f3caac5bfd Ensure no string changes for 6.0.x. 2022-07-28 01:14:58 +01:00
Jeff Young 7bd073b5cb Make sure there are no translation changes for 6.0.x. 2022-07-28 01:08:42 +01:00
Jeff Young af40ddd0e1 Make sure strings are either 6.0.7 values or 5.1 values. 2022-07-28 00:25:45 +01:00
Jeff Young e59d8b0a2d Fix up merge errors. 2022-07-28 00:12:25 +01:00
Seth Hillbrand 7113f1f879 Fix through via drawing width
Related to fix for https://gitlab.com/kicad/code/kicad/-/issues/11851
2022-07-27 12:09:35 -07:00
Peter B 31db2b8525 Translated using Weblate (Romanian)
Currently translated at 38.7% (2774 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ro/
2022-07-27 01:55:22 +02:00
maksz42 3363fdb248 Translated using Weblate (Polish)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-07-27 01:55:20 +02:00
kmn4555 983f389b24 Translated using Weblate (Korean)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-27 01:55:18 +02:00
YunJiSang 8d48a56b4a Translated using Weblate (Korean)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-27 01:55:16 +02:00
Tokita, Hiroshi 2460276e85 Translated using Weblate (Japanese)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-07-27 01:55:14 +02:00
Jan Straka 70f2e80dd1 Translated using Weblate (Czech)
Currently translated at 92.7% (6635 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-07-27 01:55:11 +02:00
Peter B 8a5233912f Translated using Weblate (Romanian)
Currently translated at 37.7% (2698 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ro/
2022-07-27 01:55:08 +02:00
ZbeeGin c2a6906c31 Translated using Weblate (Polish)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-07-27 01:55:07 +02:00
kmn4555 b05fd8f209 Translated using Weblate (Korean)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-27 01:55:05 +02:00
Tokita, Hiroshi f3a906dc86 Translated using Weblate (Japanese)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-07-27 01:55:03 +02:00
jean-pierre charras a5b676fa0e Avoid crashes when, for some reason, a dll cannot be loaded.
In this case a null pointer was returned by the internal code.
This pointer is now tested against nullptr to avoid the application crashing.
Fixes #12080
https://gitlab.com/kicad/code/kicad/issues/12080
2022-07-26 16:04:27 +02:00
Jeff Young 38b75db12c Fix merge breakage.
Fixes https://gitlab.com/kicad/code/kicad/issues/12088
2022-07-26 14:42:36 +01:00
Wayne Stambaugh fb2cf7b8be Begin version 6.0.8 development. 2022-07-25 19:32:38 -04:00
Jeff Young ac28ed9888 Cherry-pick fix for pad clearances from master. 2022-07-25 21:50:23 +01:00
Jeff Young d9fef3da72 Don't allow 0 line-width for unfilled shapes.
Fixes https://gitlab.com/kicad/code/kicad/issues/12010

(cherry picked from commit d0547cbde7)
2022-07-25 21:46:27 +01:00
Jeff Young 61bb793324 Save fp browser list widths and apply known hack to work around wxWidgets bug.
Fixes https://gitlab.com/kicad/code/kicad/issues/11744

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

(cherry picked from commit 0a623bff9f)
2022-07-25 21:21:23 +01:00
Jeff Young ccb416eead Bring symbol editor in line with eeschema for empty text.
Fixes https://gitlab.com/kicad/code/kicad/issues/11799

(cherry picked from commit d07c6699ce)
2022-07-25 21:12:15 +01:00
Jeff Young 6e10a496ef Honour m_resolveTextVars flag for properties as well as fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/11937

(cherry picked from commit 5479514819)
2022-07-25 21:03:47 +01:00
Jeff Young e06e65cdde Add newly-drawn objects to any entered group.
Fixes https://gitlab.com/kicad/code/kicad/issues/11912

(cherry picked from commit 654740b90d)
2022-07-25 21:02:26 +01:00
Jeff Young 832c689345 Labels can connect directly to symbols, other labels, etc.
Fixes https://gitlab.com/kicad/code/kicad/issues/11768

(cherry picked from commit c6604e3576)
2022-07-25 20:56:11 +01:00
Jeff Young 0580fc6819 Add create-wire logic to labels.
Fixes https://gitlab.com/kicad/code/kicad/issues/11768

(cherry picked from commit 29900cad34)
2022-07-25 20:44:50 +01:00
Jeff Young 0f882d91e5 Add proper collision test to via placer.
Also moves DISALLOW constraint processing outside the loop as it
performs it's own loop over any objects referenced by the rules.

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

(cherry picked from commit 73836b50fc)
2022-07-25 20:16:01 +01:00
Jeff Young 2fdddb970f Bug fixes for printing vias.
Blind/buried and microvias didn't get their layers trimmed properly,
nor did through vias with dropped pads.

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

(cherry picked from commit 231ac567b8)
2022-07-25 20:05:40 +01:00
Jeff Young 0321d96b1e Fill in missing bits of LAYER variable for printing/plotting.
Fixes https://gitlab.com/kicad/code/kicad/issues/11788

(cherry picked from commit f22cf1cc3a)
2022-07-25 19:49:09 +01:00
Jeff Young ce92c676e6 Use unit references in status bar.
Fixes https://gitlab.com/kicad/code/kicad/issues/11854

(cherry picked from commit 45ab15dc95)
2022-07-25 19:40:08 +01:00
Jeff Young bb5fd5a2ec Fix broken logic for hidden pins.
Fixes https://gitlab.com/kicad/code/kicad/issues/11771

(cherry picked from commit b710982875)
2022-07-25 19:36:58 +01:00
Jeff Young 41a9293106 Update grid attributes after sorting.
Fixes https://gitlab.com/kicad/code/kicad/issues/11753

(cherry picked from commit 46fd32b738)
2022-07-25 19:36:13 +01:00
Jeff Young 3c4f8a335f Save selection *before* clearing it. Saving after doesn't do much good.
Fixes https://gitlab.com/kicad/code/kicad/issues/11242

(cherry picked from commit 1751c8e1cf)
2022-07-25 19:35:06 +01:00
Jeff Young 1a6e9538cd Handle empty directories in template projects.
Fixes https://gitlab.com/kicad/code/kicad/issues/10191

(cherry picked from commit cff52c70d0)
2022-07-25 19:33:52 +01:00
Jeff Young 06baaa33fa Rely on DRC rules when items might overlap.
Fixes https://gitlab.com/kicad/code/kicad/issues/1790

(cherry picked from commit f48ed79039)
2022-07-25 19:31:05 +01:00
Jeff Young cd5b4ec8f2 Add edge-exclusions to router (for castellated pads).
Fixes https://gitlab.com/kicad/code/kicad/issues/1790

(cherry picked from commit 833dc70bff)
2022-07-25 19:30:49 +01:00
Jeff Young 58451335cb Apply DRC fixes to ERC.
Fixes https://gitlab.com/kicad/code/kicad/issues/11844

(cherry picked from commit 83a2f43661)
2022-07-25 19:23:57 +01:00
Jeff Young e7dd9f9337 Don't reset Footprint Tests Run if the board didn't change.
Fixes https://gitlab.com/kicad/code/kicad/issues/11844

(cherry picked from commit 048f277b1e)
2022-07-25 18:41:48 +01:00
Jeff Young 7bf66be2ac Don't clear marker counts when closing DRC dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/11844

(cherry picked from commit 801a98a302)
2022-07-25 18:41:21 +01:00
Jeff Young 0bc97b7952 Handle double-click in dimension drawing tool.
Fixes https://gitlab.com/kicad/code/kicad/issues/11815

(cherry picked from commit d40664d171)
2022-07-25 18:35:29 +01:00
380 changed files with 57052 additions and 48546 deletions
+9
View File
@@ -54,6 +54,15 @@ common/pcb_keywords.cpp
include/pcb_lexer.h
fp-info-cache
# .md generated files
eeschema/dialogs/dialog_bom_help_md.h
pcb_calculator/attenuators/bridget_tee_formula.h
pcb_calculator/attenuators/pi_formula.h
pcb_calculator/attenuators/splitter_formula.h
pcb_calculator/attenuators/tee_formula.h
pcb_calculator/eserie_help.h
pcb_calculator/tracks_width_versus_current_formula.h
# demo project auxiliary files
demos/**/*-bak
demos/**/_autosave-*
+2 -1
View File
@@ -40,6 +40,7 @@ include:
- local: '/.gitlab/templates.yml'
- local: '/.gitlab/Fedora-Linux-CI.yml'
- local: '/.gitlab/Ubuntu-20.04-CI.yml'
# - local: '/.gitlab/Windows-CI.yml'
- local: '/.gitlab/Windows-CI.yml'
- local: '/.gitlab/coverity.yml'
- local: '/.gitlab/linux-metadata-validate.yml'
- local: '/.gitlab/doxygen.yml'
+13 -2
View File
@@ -7,16 +7,27 @@ win64_build:
- kicad-windows-1809
extends: .only_code
interruptible: false
image: registry.gitlab.com/kicad/kicad-ci/source_containers/win64:msvc1809
image: registry.gitlab.com/kicad/kicad-ci/windows-build-image/win1809-msvc:latest
variables:
VCPKG_BINARY_SOURCES: 'nuget,kicad,readwrite'
cache:
key: win64-vcpkg-"$CI_COMMIT_REF_SLUG"
paths:
- build\windows\vcpkg_installed
- .vcpkgCache
only:
- branches@kicad/code/kicad
- tags@kicad/code/kicad
script:
- C:\builder\build.ps1 -Env -Arch x64
- $vcpkgCache=Join-Path -Path (Get-Location) -ChildPath ".vcpkgCache";$env:VCPKG_DEFAULT_BINARY_CACHE=$vcpkgCache;New-Item -ItemType Directory -Force -Path $vcpkgCache
- nuget.exe sources add -Name kicad -Source "https://nuget.kicad.org:443/v3/index.json"
- nuget.exe setapikey $env:KICAD_NUGET_KEY -Source "https://nuget.kicad.org:443/v3/index.json"
- mkdir -p build/windows -Force
- cd build/windows
- cmake `
-G "Ninja" `
-DCMAKE_TOOLCHAIN_FILE=C:\build\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DCMAKE_TOOLCHAIN_FILE=C:\builder\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DCMAKE_BUILD_TYPE=Debug `
-DKICAD_SCRIPTING_WXPYTHON=OFF `
-DKICAD_USE_OCC=ON `
+18
View File
@@ -0,0 +1,18 @@
build_doxygen_docker:
image: docker:stable
services:
- docker:dind
stage: build
tags:
- docker
before_script:
- docker info
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
script:
- docker build -t "${CI_REGISTRY_IMAGE}/doxygen:$CI_COMMIT_BRANCH" -f ./Documentation/doxygen.Dockerfile .
- docker push "${CI_REGISTRY_IMAGE}/doxygen:$CI_COMMIT_BRANCH"
only:
refs:
- schedules
variables:
- $SCHEDULED_JOB_NAME == "doxygen"
+3 -3
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
* Copyright (C) 2018-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018-2022 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,7 +29,6 @@
#include <wx/datetime.h>
#include <wx/dir.h>
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/stdpaths.h>
@@ -55,6 +54,7 @@
#include <project.h>
#include <settings/common_settings.h>
#include <settings/settings_manager.h>
#include <wx_filename.h>
#define MASK_3D_CACHE "3D_CACHE"
@@ -514,7 +514,7 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), wxEmptyString );
cfgdir.Normalize();
cfgdir.Normalize( FN_NORMALIZE_FLAGS );
if( !cfgdir.DirExists() )
{
+6 -16
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2022 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,13 +29,13 @@
#include <wx/dir.h>
#include <wx/dynlib.h>
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/stdpaths.h>
#include <wx/string.h>
#include <common.h>
#include <paths.h>
#include <wx_filename.h>
#include "3d_plugin_manager.h"
#include "plugins/3d/3d_plugin.h"
#include "3d_cache/sg/scenegraph.h"
@@ -153,24 +153,14 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
checkPluginPath( std::string( fn.GetPathWithSep().ToUTF8() ), searchpaths );
// check for per-user third party plugins
// note: GetUserDataDir() gives '.pcbnew' rather than '.kicad' since it uses the exe name;
fn.AssignDir( PATHS::GetUserPlugins3DPath() );
checkPluginPath( fn.GetPathWithSep(), searchpaths );
#else
// Search path on OS X is
// (1) User ~/Library/Application Support/kicad/PlugIns/3d
checkPluginPath( PATHS::GetOSXKicadUserDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
// (2) Machine /Library/Application Support/kicad/PlugIns/3d
// (1) Machine /Library/Application Support/kicad/PlugIns/3d
checkPluginPath( PATHS::GetOSXKicadMachineDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
// (3) Bundle kicad.app/Contents/PlugIns/3d
// (2) Bundle kicad.app/Contents/PlugIns/3d
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
checkPluginPath( fn.GetPathWithSep(), searchpaths );
#endif
std::list< wxString >::iterator sPL = searchpaths.begin();
@@ -288,7 +278,7 @@ void S3D_PLUGIN_MANAGER::checkPluginName( const wxString& aPath,
wxFileName path( ExpandEnvVarSubstitutions( aPath, nullptr ) );
path.Normalize();
path.Normalize( FN_NORMALIZE_FLAGS );
// determine if the path is already in the list
wxString wxpath = path.GetFullPath();
@@ -326,7 +316,7 @@ void S3D_PLUGIN_MANAGER::checkPluginPath( const wxString& aPath,
else
path.Assign( aPath, wxEmptyString );
path.Normalize();
path.Normalize( FN_NORMALIZE_FLAGS );
if( !wxFileName::DirExists( path.GetFullPath() ) )
return;
+1
View File
@@ -119,6 +119,7 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
SetFlag( FL_ZONE, true );
SetFlag( FL_SILKSCREEN, true );
SetFlag( FL_SOLDERMASK, true );
SetFlag( FL_SOLDERPASTE, true );
SetFlag( FL_SUBTRACT_MASK_FROM_SILK, false );
SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, true );
+40 -26
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 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
@@ -89,30 +89,32 @@ END_EVENT_TABLE()
EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList,
BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera,
S3D_CACHE* a3DCachePointer )
: HIDPI_GL_CANVAS( aParent, wxID_ANY, aAttribList, wxDefaultPosition, wxDefaultSize,
S3D_CACHE* a3DCachePointer ) :
HIDPI_GL_CANVAS( aParent, wxID_ANY, aAttribList, wxDefaultPosition, wxDefaultSize,
wxFULL_REPAINT_ON_RESIZE ),
m_eventDispatcher( nullptr ),
m_parentStatusBar( nullptr ),
m_parentInfoBar( nullptr ),
m_glRC( nullptr ),
m_is_opengl_initialized( false ),
m_is_opengl_version_supported( true ),
m_mouse_is_moving( false ),
m_mouse_was_moved( false ),
m_camera_is_moving( false ),
m_render_pivot( false ),
m_camera_moving_speed( 1.0f ),
m_strtime_camera_movement( 0 ),
m_animation_enabled( true ),
m_moving_speed_multiplier( 3 ),
m_boardAdapter( aBoardAdapter ),
m_camera( aCamera ),
m_3d_render( nullptr ),
m_opengl_supports_raytracing( true ),
m_render_raytracing_was_requested( false ),
m_accelerator3DShapes( nullptr ),
m_currentRollOverItem( nullptr )
m_eventDispatcher( nullptr ),
m_parentStatusBar( nullptr ),
m_parentInfoBar( nullptr ),
m_glRC( nullptr ),
m_is_opengl_initialized( false ),
m_is_opengl_version_supported( true ),
m_editing_timeout_timer( this, wxID_HIGHEST + 1 ),
m_redraw_trigger_timer( this, wxID_HIGHEST + 2 ),
m_mouse_is_moving( false ),
m_mouse_was_moved( false ),
m_camera_is_moving( false ),
m_render_pivot( false ),
m_camera_moving_speed( 1.0f ),
m_strtime_camera_movement( 0 ),
m_animation_enabled( true ),
m_moving_speed_multiplier( 3 ),
m_boardAdapter( aBoardAdapter ),
m_camera( aCamera ),
m_3d_render( nullptr ),
m_opengl_supports_raytracing( true ),
m_render_raytracing_was_requested( false ),
m_accelerator3DShapes( nullptr ),
m_currentRollOverItem( nullptr )
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::EDA_3D_CANVAS" ) );
@@ -845,8 +847,14 @@ void EDA_3D_CANVAS::OnMiddleUp( wxMouseEvent& event )
}
void EDA_3D_CANVAS::OnTimerTimeout_Editing( wxTimerEvent& /* event */ )
void EDA_3D_CANVAS::OnTimerTimeout_Editing( wxTimerEvent& aEvent )
{
if( aEvent.GetId() != m_editing_timeout_timer.GetId() )
{
aEvent.Skip();
return;
}
m_mouse_is_moving = false;
m_mouse_was_moved = false;
@@ -867,8 +875,14 @@ void EDA_3D_CANVAS::restart_editingTimeOut_Timer()
}
void EDA_3D_CANVAS::OnTimerTimeout_Redraw( wxTimerEvent& event )
void EDA_3D_CANVAS::OnTimerTimeout_Redraw( wxTimerEvent& aEvent )
{
if( aEvent.GetId() != m_redraw_trigger_timer.GetId() )
{
aEvent.Skip();
return;
}
Request_refresh( true );
}
@@ -27,6 +27,7 @@
* 3d models that come in the original data from the files without any transformations.
*/
#include <gal/opengl/kiglew.h> // Must be included first
#include <iostream>
#include "3d_rendering/opengl/3d_model.h"
#include "eda_3d_model_viewer.h"
@@ -38,6 +39,7 @@
#include <settings/common_settings.h>
#include <pgm_base.h>
#include <gal/dpi_scaling.h>
#include <macros.h>
/**
* Scale conversion from 3d model units to pcb units
@@ -182,6 +184,20 @@ void EDA_3D_MODEL_VIEWER::Clear3DModel()
void EDA_3D_MODEL_VIEWER::ogl_initialize()
{
const GLenum err = glewInit();
if( GLEW_OK != err )
{
const wxString msgError = (const char*) glewGetErrorString( err );
wxLogMessage( msgError );
}
else
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::ogl_initialize Using GLEW version %s" ),
FROM_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
}
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
+1 -1
View File
@@ -111,7 +111,7 @@ TOOL_ACTION EDA_3D_ACTIONS::resetView( "3DViewer.Control.resetView",
TOOL_ACTION EDA_3D_ACTIONS::flipView( "3DViewer.Control.flipView",
AS_ACTIVE,
0, "",
'F', "",
_( "Flip Board" ), _( "Flip the board view" ),
BITMAPS::flip_board, AF_NONE, (void*) ID_VIEW3D_FLIP );
+3 -2
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2022 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
@@ -34,6 +34,7 @@
#include <common_ogl/ogl_attr_list.h>
#include <filename_resolver.h>
#include <pcbnew/footprint.h>
#include <wx_filename.h>
#include <wx/filedlg.h>
@@ -164,7 +165,7 @@ bool DIALOG_SELECT_3DMODEL::TransferDataFromWindow()
// file selection mode: retrieve the filename and specify a
// path relative to one of the config paths
wxFileName fname = m_FileTree->GetFilePath();
fname.Normalize();
fname.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS );
m_model->m_Filename = m_resolver->ShortenPath( fname.GetFullPath() );
return true;
+6 -6
View File
@@ -38,8 +38,8 @@ macro( create_git_version_header _git_src_path )
${GIT_EXECUTABLE} describe --dirty
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_DESCRIBE
ERROR_VARIABLE _git_log_error
RESULT_VARIABLE _git_log_result
ERROR_VARIABLE _git_describe_error
RESULT_VARIABLE _git_describe_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
@@ -47,8 +47,8 @@ macro( create_git_version_header _git_src_path )
${GIT_EXECUTABLE} rev-list --count --first-parent HEAD
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_REV_COUNT
ERROR_VARIABLE _git_log_error
RESULT_VARIABLE _git_log_result
ERROR_VARIABLE _git_rev_count_error
RESULT_VARIABLE _git_rev_count_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
set( ENV{LC_ALL} ${_Git_SAVED_LC_ALL} )
@@ -56,11 +56,11 @@ macro( create_git_version_header _git_src_path )
# Check to make sure 'git' command did not fail. Otherwise fallback
# to KiCadVersion.cmake as the revision level.
if( _git_DESCRIBE )
if( _git_describe_result EQUAL 0 )
set( KICAD_VERSION "(${_git_DESCRIBE})" )
endif()
if( _git_REV_COUNT )
if( _git_rev_count_result EQUAL 0 )
set( KICAD_GIT_REV "${_git_REV_COUNT}" )
# Sanity check
+2 -2
View File
@@ -2,7 +2,7 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2016 Wayne Stambaugh <stambaughw@gmail.com>
# Copyright (C) 2016-2022 KiCad Developers, see AUTHORS.txt for contributors.
# Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "6.0.6-unknown" )
set( KICAD_SEMANTIC_VERSION "6.0.11-unknown" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+23
View File
@@ -0,0 +1,23 @@
FROM registry.gitlab.com/kicad/kicad-ci/source_containers/master/ubuntu:22.04 as build-doxygen-env
USER root
WORKDIR /src
COPY . ./
RUN ls
RUN mkdir build && cd build
WORKDIR /src/build
RUN cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DKICAD_USE_OCC=ON \
-DKICAD_SCRIPTING_WXPYTHON=ON \
-DKICAD_SPICE=ON
RUN make doxygen-docs
RUN make doxygen-python
FROM scratch as output-image
COPY --from=build-doxygen-env /src/Documentation/doxygen/html /doxygen-docs_html
COPY --from=build-doxygen-env /src/build/pcbnew/doxygen-python/html /doxygen-python_html
@@ -0,0 +1,6 @@
doxygen.Dockerfile.dockerignore.git
.gitlab
.github
.idea
.vs
build
+14 -13
View File
@@ -503,21 +503,22 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
polyset_areas.BooleanSubtract( polyset_holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
// Ensure there are no self intersecting polygons
polyset_areas.NormalizeAreaOutlines();
// Convert polygon with holes to a unique polygon
polyset_areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
// Output current resulting polygon(s)
for( int ii = 0; ii < polyset_areas.OutlineCount(); ii++ )
if( polyset_areas.NormalizeAreaOutlines() )
{
SHAPE_LINE_CHAIN& poly = polyset_areas.Outline( ii );
outputOnePolygon( poly, getBoardLayerName( aModLayer ));
}
// Convert polygon with holes to a unique polygon
polyset_areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
polyset_areas.RemoveAllContours();
polyset_holes.RemoveAllContours();
main_outline = true;
// Output current resulting polygon(s)
for( int ii = 0; ii < polyset_areas.OutlineCount(); ii++ )
{
SHAPE_LINE_CHAIN& poly = polyset_areas.Outline( ii );
outputOnePolygon( poly, getBoardLayerName( aModLayer ));
}
polyset_areas.RemoveAllContours();
polyset_holes.RemoveAllContours();
main_outline = true;
}
}
paths = paths->next;
-11
View File
@@ -82,13 +82,6 @@ static const wxChar DRCEpsilon[] = wxT( "DRCEpsilon" );
*/
static const wxChar HoleWallThickness[] = wxT( "HoleWallPlatingThickness" );
/**
* Testing mode for new connectivity algorithm. Setting this to on will cause all modifications
* to the netlist to be recalculated on the fly. This may be slower than the standard process
* at the moment
*/
static const wxChar RealtimeConnectivity[] = wxT( "RealtimeConnectivity" );
/**
* Configure the coroutine stack size in bytes. This should be allocated in multiples of
* the system page size (n*4096 is generally safe)
@@ -260,7 +253,6 @@ ADVANCED_CFG::ADVANCED_CFG()
// Init defaults - this is done in case the config doesn't exist,
// then the values will remain as set here.
m_RealTimeConnectivity = true;
m_CoroutineStackSize = AC_STACK::default_stack;
m_ShowRouterDebugGraphics = false;
m_DrawArcAccuracy = 10.0;
@@ -333,9 +325,6 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
{
std::vector<PARAM_CFG*> configParams;
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity,
&m_RealTimeConnectivity, m_RealTimeConnectivity ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin,
&m_ExtraClearance, m_ExtraClearance, 0.0, 1.0 ) );
+8
View File
@@ -121,6 +121,13 @@ wxBitmap KiBitmap( const BITMAP_OPAQUE* aBitmap )
int KiIconScale( wxWindow* aWindow )
{
#if defined( __WXMSW__) && wxCHECK_VERSION( 3, 1, 6 )
// Basically don't try and scale within kicad and let wx do its thing
// with wx introducing bitmap bundles, it will auto scale automatically with dpi
// the issue is, none of the scaling factors have any tie to system scaling
// this means wx is actually going to scale again causing even more distorted icons
return 4;
#else
const int vert_size = aWindow->ConvertDialogToPixels( wxSize( 0, 8 ) ).y;
// Autoscale won't exceed unity until the system has quite high resolution,
@@ -131,6 +138,7 @@ int KiIconScale( wxWindow* aWindow )
else if( vert_size > 29 ) return 7;
else if( vert_size > 24 ) return 6;
else return 4;
#endif
}
+14
View File
@@ -251,6 +251,16 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
aDC->GetLogicalOrigin( &logicalOriginX, &logicalOriginY );
bool useTransform = aDC->CanUseTransformMatrix();
// We already have issues to draw a bitmap on the wxDC, depending on wxWidgets version.
// Now we have an issue on wxWidgets 3.1.6 and later to fix the clipboard
// and the bitmap position when using TransformMatrix
// So for version >= 3.1.6 do not use it
// Be carefull before changing the code.
#if wxCHECK_VERSION( 3, 1, 6 )
useTransform = false;
#endif
wxAffineMatrix2D init_matrix = aDC->GetTransformMatrix();
wxPoint clipAreaPos;
@@ -261,8 +271,12 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
matrix.Translate( pos.x, pos.y );
matrix.Scale( GetScalingFactor(), GetScalingFactor() );
aDC->SetTransformMatrix( matrix );
// Needed on wx <= 3.1.5, and this is strange...
// Nevertheless, this code has problem (the bitmap is not seen)
// with wx version > 3.1.5
clipAreaPos.x = pos.x;
clipAreaPos.y = pos.y;
pos.x = pos.y = 0;
}
else
+3
View File
@@ -136,6 +136,9 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
setupPainter( *painter );
setupViewLayers( *view, m_settings.m_LayerSet );
dstSettings->SetPrintLayers( m_settings.m_LayerSet );
dstSettings->SetLayerName( aLayerName );
wxSize sheetSizeMils = m_settings.m_pageInfo.GetSizeMils();
VECTOR2I sheetSizeIU( milsToIU( sheetSizeMils.GetWidth() ),
+13 -3
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -396,13 +396,18 @@ void DIALOG_COLOR_PICKER::drawRGBPalette()
// Use Y axis from bottom to top and origin to center
bitmapDC.SetAxisOrientation( true, true );
#if wxCHECK_VERSION( 3, 1, 7 )
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
bitmapDC.SetDeviceOrigin( half_size, -half_size );
#else
bitmapDC.SetDeviceOrigin( half_size, half_size );
#endif
// Reserve room to draw cursors inside the bitmap
half_size -= m_cursorsSize/2;
// Draw the 3 RGB cursors, using white color to make them always visible:
wxPen pen( wxColor( 255, 255, 255 ) );
wxPen pen( wxColor( 255, 255, 255 ), 2 ); // use 2 pixels for pen size
wxBrush brush( wxColor( 0, 0, 0 ), wxBRUSHSTYLE_TRANSPARENT );
bitmapDC.SetPen( pen );
bitmapDC.SetBrush( brush );
@@ -461,7 +466,12 @@ void DIALOG_COLOR_PICKER::drawHSVPalette()
// Use Y axis from bottom to top and origin to center
bitmapDC.SetAxisOrientation( true, true );
#if wxCHECK_VERSION( 3, 1, 7 )
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
bitmapDC.SetDeviceOrigin( half_size, -half_size );
#else
bitmapDC.SetDeviceOrigin( half_size, half_size );
#endif
// Reserve room to draw cursors inside the bitmap
half_size -= m_cursorsSize / 2;
@@ -470,7 +480,7 @@ void DIALOG_COLOR_PICKER::drawHSVPalette()
m_cursorBitmapHSV.x = cos( m_hue * M_PI / 180.0 ) * half_size * m_sat;
m_cursorBitmapHSV.y = sin( m_hue * M_PI / 180.0 ) * half_size * m_sat;
wxPen pen( wxColor( 0, 0, 0 ) );
wxPen pen( wxColor( 0, 0, 0 ), 2 ); // Use 2 pixels as pensize
wxBrush brush( wxColor( 0, 0, 0 ), wxBRUSHSTYLE_TRANSPARENT );
bitmapDC.SetPen( pen );
bitmapDC.SetBrush( brush );
+2
View File
@@ -45,6 +45,8 @@ DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent,
"with '%s'." ),
aReplacement ) );
m_sdbSizerOK->SetFocus();
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
+4 -2
View File
@@ -40,10 +40,11 @@ static int DEFAULT_COL_WIDTHS[] = { 200, 600 };
EDA_LIST_DIALOG::EDA_LIST_DIALOG( wxWindow* aParent, const wxString& aTitle,
const wxArrayString& aItemHeaders,
const std::vector<wxArrayString>& aItemList,
const wxString& aPreselectText ) :
const wxString& aPreselectText, bool aSortList ) :
EDA_LIST_DIALOG_BASE( aParent, wxID_ANY, aTitle )
{
m_itemsList = &aItemList;
m_sortList = aSortList;
m_filterBox->SetHint( _( "Filter" ) );
@@ -234,5 +235,6 @@ static int wxCALLBACK myCompareFunction( wxIntPtr aItem1, wxIntPtr aItem2,
void EDA_LIST_DIALOG::sortList()
{
m_listBox->SortItems( myCompareFunction, 0 );
if( m_sortList )
m_listBox->SortItems( myCompareFunction, 0 );
}
+1 -1
View File
@@ -250,7 +250,7 @@ static void netclassToGridRow( EDA_UNITS aUnits, wxGrid* aGrid, int aRow, const
SET_MILS_CELL( GRID_WIREWIDTH, nc->GetWireWidth() );
SET_MILS_CELL( GRID_BUSWIDTH, nc->GetBusWidth() );
wxString colorAsString = nc->GetSchematicColor().ToWxString( wxC2S_CSS_SYNTAX );
wxString colorAsString = nc->GetSchematicColor().ToCSSString();
aGrid->SetCellValue( aRow, GRID_SCHEMATIC_COLOR, colorAsString );
int lineStyleIdx = std::max( 0, nc->GetLineStyle() );
+5
View File
@@ -174,6 +174,11 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
void EDA_DRAW_PANEL_GAL::DoRePaint()
{
if( !m_refreshMutex.try_lock() )
return;
std::lock_guard<std::mutex> lock( m_refreshMutex, std::adopt_lock );
// Repaint the canvas, and fix scrollbar cursors
// Usually called by a OnPaint event, but because it does not use a wxPaintDC,
// it can be called outside a wxPaintEvent.
@@ -83,6 +83,7 @@ void DS_PROXY_VIEW_ITEM::buildDrawList( VIEW* aView, DS_DRAW_ITEM_LIST* aDrawLis
aDrawList->SetSheetCount( m_sheetCount );
aDrawList->SetFileName( fileName );
aDrawList->SetSheetName( sheetName );
aDrawList->SetSheetLayer( settings->GetLayerName() );
aDrawList->SetProject( m_project );
aDrawList->BuildDrawItemsList( *m_pageInfo, *m_titleBlock );
+17 -17
View File
@@ -969,22 +969,27 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
wxString prompt = doOpen ? _( "Select Library" ) : _( "New Library" );
aFilename.SetExt( ext );
wxString dir;
wxString projectDir = Prj().IsNullProject() ? aFilename.GetPath() : Prj().GetProjectPath();
wxString defaultDir;
if( GetMruPath().IsEmpty() )
dir = aGlobalPath;
if( aIsGlobal )
{
if( !GetMruPath().IsEmpty() && !GetMruPath().StartsWith( projectDir ) )
defaultDir = GetMruPath();
else
defaultDir = aGlobalPath;
}
else
dir = GetMruPath();
{
if( !GetMruPath().IsEmpty() && GetMruPath().StartsWith( projectDir ) )
defaultDir = GetMruPath();
else
defaultDir = projectDir;
}
if( isDirectory && doOpen )
{
if( !aIsGlobal && GetMruPath().IsEmpty() )
{
dir = Prj().GetProjectPath();
}
wxDirDialog dlg( this, prompt, dir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
wxDirDialog dlg( this, prompt, defaultDir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
if( dlg.ShowModal() == wxID_CANCEL )
return false;
@@ -998,12 +1003,7 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
if( aFilename.GetName().empty() )
aFilename.SetName( wxT( "Library" ) );
if( !aIsGlobal && GetMruPath().IsEmpty() )
{
dir = Prj().IsNullProject() ? aFilename.GetFullPath() : Prj().GetProjectPath();
}
wxFileDialog dlg( this, prompt, dir, aFilename.GetFullName(),
wxFileDialog dlg( this, prompt, defaultDir, aFilename.GetFullName(),
wildcard, doOpen ? wxFD_OPEN | wxFD_FILE_MUST_EXIST
: wxFD_SAVE | wxFD_CHANGE_DIR | wxFD_OVERWRITE_PROMPT );
+1 -1
View File
@@ -365,7 +365,7 @@ void EDA_SHAPE::flip( const wxPoint& aCentre, bool aFlipLeftRight )
void EDA_SHAPE::RebuildBezierToSegmentsPointsList( int aMinSegLen )
{
// Has meaning only for S_CURVE DRAW_SEGMENT shape
// Has meaning only for SHAPE_T::BEZIER
if( m_shape != SHAPE_T::BEZIER )
{
m_bezierPoints.clear();
+15 -11
View File
@@ -26,7 +26,6 @@
#include <mutex>
#include <sstream>
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <pgm_base.h>
@@ -34,6 +33,7 @@
#include "common.h"
#include "filename_resolver.h"
#include <wx_filename.h>
// configuration file version
#define CFGFILE_VERSION 1
@@ -66,7 +66,7 @@ bool FILENAME_RESOLVER::Set3DConfigDir( const wxString& aConfigDir )
wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), wxEmptyString );
cfgdir.Normalize();
cfgdir.Normalize( FN_NORMALIZE_FLAGS );
if( !cfgdir.DirExists() )
return false;
@@ -87,7 +87,7 @@ bool FILENAME_RESOLVER::SetProject( PROJECT* aProject, bool* flgChanged )
wxFileName projdir( ExpandEnvVarSubstitutions( aProject->GetProjectPath(), aProject ), wxEmptyString );
projdir.Normalize();
projdir.Normalize( FN_NORMALIZE_FLAGS );
if( !projdir.DirExists() )
return false;
@@ -189,7 +189,7 @@ bool FILENAME_RESOLVER::createPathList()
else
{
fndummy.Assign( pathVal, wxEmptyString );
fndummy.Normalize();
fndummy.Normalize( FN_NORMALIZE_FLAGS );
lpath.m_Pathexp = fndummy.GetFullPath();
}
@@ -269,7 +269,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
// working directory (which is not necessarily the current project directory)
if( tmpFN.FileExists() )
{
tmpFN.Normalize();
tmpFN.Normalize( FN_NORMALIZE_FLAGS );
tname = tmpFN.GetFullPath();
// special case: if a path begins with ${ENV_VAR} but is not in the resolver's path list
@@ -316,7 +316,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
if( wxFileName::FileExists( fullPath ) )
{
tmpFN.Assign( fullPath );
tmpFN.Normalize();
tmpFN.Normalize( FN_NORMALIZE_FLAGS );
tname = tmpFN.GetFullPath();
return tname;
}
@@ -333,7 +333,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
fullPath = ExpandEnvVarSubstitutions( fullPath, m_project );
fpath.Assign( fullPath );
if( fpath.Normalize() && fpath.FileExists() )
if( fpath.Normalize( FN_NORMALIZE_FLAGS ) && fpath.FileExists() )
{
tname = fpath.GetFullPath();
return tname;
@@ -381,7 +381,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
wxFileName tmp( fullPath );
if( tmp.Normalize() )
if( tmp.Normalize( FN_NORMALIZE_FLAGS ) )
tname = tmp.GetFullPath();
return tname;
@@ -422,7 +422,7 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath )
wxFileName path( ExpandEnvVarSubstitutions( tpath.m_Pathvar, m_project ), wxEmptyString );
path.Normalize();
path.Normalize( FN_NORMALIZE_FLAGS );
if( !path.DirExists() )
{
@@ -496,7 +496,11 @@ bool FILENAME_RESOLVER::readPathList()
}
wxFileName cfgpath( m_configDir, RESOLVER_CONFIG );
cfgpath.Normalize();
// This should be the same as wxWidgets 3.0 wxPATH_NORM_ALL which is deprecated in 3.1.
// There are known issues with environment variable expansion so maybe we should be using
// our own ExpandEnvVarSubstitutions() here instead.
cfgpath.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS );
wxString cfgname = cfgpath.GetFullPath();
size_t nitems = m_paths.size();
@@ -716,7 +720,7 @@ void FILENAME_RESOLVER::checkEnvVarPath( const wxString& aPath )
wxFileName tmpFN( ExpandEnvVarSubstitutions( lpath.m_Alias, m_project ), wxEmptyString );
wxUniChar psep = tmpFN.GetPathSeparator();
tmpFN.Normalize();
tmpFN.Normalize( FN_NORMALIZE_FLAGS );
if( !tmpFN.DirExists() )
return;
+27 -4
View File
@@ -144,10 +144,33 @@ bool COLOR4D::SetFromWxString( const wxString& aColorString )
}
wxString COLOR4D::ToWxString( long flags ) const
wxString COLOR4D::ToCSSString() const
{
wxColour c = ToColour();
return c.GetAsString( flags );
wxString str;
const int red = c.Red();
const int green = c.Green();
const int blue = c.Blue();
const int alpha = c.Alpha();
if ( alpha == wxALPHA_OPAQUE )
{
str.Printf( wxT( "rgb(%d, %d, %d)" ), red, green, blue );
}
else // use rgba() form
{
wxString alpha_str = wxString::FromCDouble( alpha / 255.0, 3 );
// The wxC2S_CSS_SYNTAX is particularly sensitive to ','s (as it uses them for value
// delimiters), and wxWidgets is known to be buggy in this respect when dealing with
// Serbian and Russian locales (at least), so we enforce an extra level of safety.
alpha_str.Replace( wxT( "," ), wxT( "." ) );
str.Printf( wxT( "rgba(%d, %d, %d, %s)" ), red, green, blue, alpha_str );
}
return str;
}
@@ -271,13 +294,13 @@ const bool operator<( const COLOR4D& lhs, const COLOR4D& rhs )
std::ostream &operator<<( std::ostream &aStream, COLOR4D const &aColor )
{
return aStream << aColor.ToWxString( wxC2S_CSS_SYNTAX );
return aStream << aColor.ToCSSString();
}
void to_json( nlohmann::json& aJson, const COLOR4D& aColor )
{
aJson = nlohmann::json( aColor.ToWxString( wxC2S_CSS_SYNTAX ).ToStdString() );
aJson = nlohmann::json( aColor.ToCSSString().ToStdString() );
}
+6 -8
View File
@@ -41,14 +41,11 @@
static std::mutex rng_mutex;
// Static rng and generators are used because the overhead of constant seeding is expensive
// We break out the rng separately from the generator because we want to control seeding in cases like unit tests
#if BOOST_VERSION >= 106700
static boost::uuids::detail::random_provider seeder; // required to ensure the rng has a random initial seed
#else
static boost::uuids::detail::seed_rng seeder; // required to ensure the rng has a random initial seed
#endif
static boost::mt19937 rng( seeder );
static boost::uuids::basic_random_generator<boost::mt19937> randomGenerator( rng );
// We rely on the default non-arg constructor of basic_random_generator to provide a random seed.
// We use a separate rng object for cases where we want to control the basic_random_generator
// initial seed by calling SeedGenerator from unit tests and other special cases.
static boost::mt19937 rng;
static boost::uuids::basic_random_generator<boost::mt19937> randomGenerator;
// These don't have the same performance penalty, but we might as well be consistent
static boost::uuids::string_generator stringGenerator;
@@ -279,6 +276,7 @@ void KIID::CreateNilUuids( bool aNil )
void KIID::SeedGenerator( unsigned int aSeed )
{
rng.seed( aSeed );
randomGenerator = boost::uuids::basic_random_generator<boost::mt19937>( rng );
}
+3
View File
@@ -465,7 +465,10 @@ bool KIWAY::PlayerClose( FRAME_T aFrameType, bool doForce )
return true;
if( frame->NonUserClose( doForce ) )
{
m_playerFrameId[aFrameType] = wxID_NONE;
return true;
}
return false;
}
+14 -1
View File
@@ -31,6 +31,7 @@
#include <typeinfo>
#include <wx/utils.h>
#include <wx/evtloop.h>
#include <wx/socket.h>
BEGIN_EVENT_TABLE( KIWAY_PLAYER, EDA_BASE_FRAME )
@@ -65,7 +66,19 @@ KIWAY_PLAYER::KIWAY_PLAYER( wxWindow* aParent, wxWindowID aId, const wxString& a
}
KIWAY_PLAYER::~KIWAY_PLAYER() throw() {}
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
if( m_socketServer )
{
// ensure any event handling stops
m_socketServer->Notify( false );
delete m_socketServer;
}
}
void KIWAY_PLAYER::KiwayMailIn( KIWAY_EXPRESS& aEvent )
+6 -6
View File
@@ -77,7 +77,7 @@ NUMERIC_EVALUATOR::~NUMERIC_EVALUATOR()
void NUMERIC_EVALUATOR::Clear()
{
free( m_token.token );
delete[] m_token.token;
m_token.token = nullptr;
m_token.input = nullptr;
m_parseError = true;
@@ -103,7 +103,7 @@ void NUMERIC_EVALUATOR::parseSetResult( double val )
{
// Naively printing this with %g produces "nan" on some platforms
// and "-nan(ind)" on others (e.g. MSVC). So force a "standard" string.
snprintf( m_token.token, m_token.OutLen, "%s", "NaN" );
snprintf( m_token.token, m_token.outputLen, "%s", "NaN" );
}
else
{
@@ -111,7 +111,7 @@ void NUMERIC_EVALUATOR::parseSetResult( double val )
// Warning: DO NOT use a format like %f or %g, because they can create issues.
// especially %g can generate an exponent, incompatible with UNIT_BINDER
// Use the optimized Double2Str
snprintf( m_token.token, m_token.OutLen, "%s", Double2Str( val ).c_str() );
snprintf( m_token.token, m_token.outputLen, "%s", Double2Str( val ).c_str() );
}
}
@@ -159,12 +159,12 @@ void NUMERIC_EVALUATOR::newString( const wxString& aString )
Clear();
m_originalText = aString;
m_token.token = reinterpret_cast<decltype( m_token.token )>( malloc( TokenStat::OutLen + 1 ) );
strcpy( m_token.token, "0" );
m_token.inputLen = aString.length();
m_token.outputLen = std::max<std::size_t>( 64, m_token.inputLen + 1 );
m_token.pos = 0;
m_token.input = aString.mb_str();
m_token.token = new char[m_token.outputLen]();
m_token.token[0] = '0';
m_parseFinished = false;
}
+26 -9
View File
@@ -249,6 +249,7 @@ COMPILER::~COMPILER()
if( m_tree )
{
freeTree( m_tree );
m_tree = nullptr;
}
// Allow explicit call to destructor
@@ -693,6 +694,7 @@ void COMPILER::freeTree( LIBEVAL::TREE_NODE *tree )
freeTree( tree->leaf[1] );
delete tree->uop;
tree->uop = nullptr;
}
@@ -1006,10 +1008,13 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
}
else
{
msg.Printf( _( "Missing units for '%s'| (%s)" ),
*node->value.str,
m_unitResolver->GetSupportedUnitsMessage() );
reportError( CST_CODEGEN, msg, node->srcPos );
if( !m_unitResolver->GetSupportedUnitsMessage().empty() )
{
msg.Printf( _( "Missing units for '%s'| (%s)" ),
*node->value.str,
m_unitResolver->GetSupportedUnitsMessage() );
reportError( CST_CODEGEN, msg, node->srcPos );
}
value = DoubleValueFromString( EDA_UNITS::UNSCALED, *node->value.str );
}
@@ -1038,7 +1043,7 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
reportError( CST_CODEGEN, msg, node->srcPos - (int) node->value.str->length() );
}
node->SetUop( TR_UOP_PUSH_VALUE, std::move( vref ) );
node->SetUop( TR_UOP_PUSH_VAR, std::move( vref ) );
node->isTerminal = true;
break;
}
@@ -1090,10 +1095,12 @@ void UOP::Exec( CONTEXT* ctx )
{
case TR_UOP_PUSH_VAR:
{
VALUE* value = ctx->AllocValue();
VALUE* value = nullptr;
if( m_ref )
value->Set( m_ref->GetValue( ctx ) );
value = ctx->StoreValue( m_ref->GetValue( ctx ) );
else
value = ctx->AllocValue();
ctx->Push( value );
}
@@ -1162,10 +1169,20 @@ void UOP::Exec( CONTEXT* ctx )
result = arg1Value > arg2Value ? 1 : 0;
break;
case TR_OP_EQUAL:
result = arg1 && arg2 && arg1->EqualTo( ctx, arg2 ) ? 1 : 0;
if( !arg1 || !arg2 )
result = arg1 == arg2 ? 1 : 0;
else if( arg2->GetType() == VT_UNDEFINED )
result = arg2->EqualTo( ctx, arg1 ) ? 1 : 0;
else
result = arg1->EqualTo( ctx, arg2 ) ? 1 : 0;
break;
case TR_OP_NOT_EQUAL:
result = arg1 && arg2 && arg1->NotEqualTo( ctx, arg2 ) ? 1 : 0;
if( !arg1 || !arg2 )
result = arg1 != arg2 ? 1 : 0;
else if( arg2->GetType() == VT_UNDEFINED )
result = arg2->NotEqualTo( ctx, arg1 ) ? 1 : 0;
else
result = arg1->NotEqualTo( ctx, arg2 ) ? 1 : 0;
break;
case TR_OP_BOOL_AND:
result = arg1Value != 0.0 && arg2Value != 0.0 ? 1 : 0;
+3 -2
View File
@@ -8635,7 +8635,7 @@ const char* const newstroke_font[] =
"F^K[KFYFY[K[",
"F^K[KFYFY[K[",
"F^K[KFYFY[K[",
/* // Letterlike Symbols (2100-214F) */
/* // Letterlike Symbols (2100-2125) */
"F^K[KFYFY[K[", /* U+2100 */
"F^K[KFYFY[K[",
"F^K[KFYFY[K[",
@@ -8674,7 +8674,8 @@ const char* const newstroke_font[] =
"F^K[KFYFY[K[",
"F^K[KFYFY[K[",
"F^K[KFYFY[K[",
"F^K[KFYFY[K[",
"F^J[O[OWMVKTJQJLKIMGPFTFWGYIZLZQYTWVUWU[Z[",
/* // Letterlike Symbols (2127-214F) */
"F^K[KFYFY[K[",
"F^K[KFYFY[K[",
"F^K[KFYFY[K[",
+55 -17
View File
@@ -38,6 +38,7 @@
#include <macros.h>
#include <trigo.h>
#include <basic_gal.h>
#include <plotters/plotters_pslike.h>
@@ -837,6 +838,7 @@ void PDF_PLOTTER::Text( const wxPoint& aPos,
// be pixel-accurate, but it doesn't matter for searching.
int render_mode = 3; // invisible
wxPoint pos( aPos );
const char *fontname = aItalic ? ( aBold ? "/KicadFontBI" : "/KicadFontI" )
: ( aBold ? "/KicadFontB" : "/KicadFont" );
@@ -844,28 +846,64 @@ void PDF_PLOTTER::Text( const wxPoint& aPos,
double ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f;
double wideningFactor, heightFactor;
computeTextParameters( aPos, aText, aOrient, aSize, m_plotMirror, aH_justify,
aV_justify, aWidth, aItalic, aBold,
&wideningFactor, &ctm_a, &ctm_b, &ctm_c,
&ctm_d, &ctm_e, &ctm_f, &heightFactor );
SetColor( aColor );
SetCurrentLineWidth( aWidth, aData );
/* We use the full CTM instead of the text matrix because the same
coordinate system will be used for the overlining. Also the %f
for the trig part of the matrix to avoid %g going in exponential
format (which is not supported) */
fprintf( workFile, "q %f %f %f %f %g %g cm BT %s %g Tf %d Tr %g Tz ",
ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f,
fontname, heightFactor, render_mode, wideningFactor * 100 );
const auto& font = basic_gal.GetStrokeFont();
VECTOR2D fontSize( aSize.x, aSize.y );
double penWidth( aWidth );
VECTOR2D extents = font.ComputeStringBoundaryLimits( aText, fontSize, penWidth );
// The text must be escaped correctly
std:: string txt_pdf = encodeStringForPlotter( aText );
fprintf( workFile, "%s Tj ET\n", txt_pdf.c_str() );
wxPoint box_x( KiROUND( extents.x ), 0 );
wxPoint box_y( 0, KiROUND( extents.y ) );
// Restore the CTM
fputs( "Q\n", workFile );
RotatePoint( &box_x, aOrient );
RotatePoint( &box_y, aOrient );
if( aH_justify == GR_TEXT_HJUSTIFY_CENTER )
pos -= box_x / 2;
else if( aH_justify == GR_TEXT_HJUSTIFY_RIGHT )
pos -= box_x;
if( aV_justify == GR_TEXT_VJUSTIFY_CENTER )
pos += box_y / 2;
else if( aV_justify == GR_TEXT_VJUSTIFY_TOP )
pos += box_y;
wxStringTokenizer str_tok( aText, " ", wxTOKEN_RET_DELIMS );
while( str_tok.HasMoreTokens() )
{
wxString word = str_tok.GetNextToken();
computeTextParameters( pos, word, aOrient, aSize, m_plotMirror, GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_BOTTOM, aWidth, aItalic, aBold, &wideningFactor, &ctm_a,
&ctm_b, &ctm_c, &ctm_d, &ctm_e, &ctm_f, &heightFactor );
// Extract the changed width and rotate by the orientation to get the offset for the
// next word
extents = font.ComputeStringBoundaryLimits( word, fontSize, penWidth );
wxPoint bbox( KiROUND( extents.x ), 0 );
RotatePoint( &bbox, aOrient );
pos += bbox;
// Don't try to output a blank string
if( word.Trim( false ).Trim( true ).empty() )
continue;
/* We use the full CTM instead of the text matrix because the same
coordinate system will be used for the overlining. Also the %f
for the trig part of the matrix to avoid %g going in exponential
format (which is not supported) */
fprintf( workFile, "q %f %f %f %f %g %g cm BT %s %g Tf %d Tr %g Tz ",
ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f,
fontname, heightFactor, render_mode, wideningFactor * 100 );
std::string txt_pdf = encodeStringForPlotter( word );
fprintf( workFile, "%s Tj ET\n", txt_pdf.c_str() );
// Restore the CTM
fputs( "Q\n", workFile );
}
// Plot the stroked text (if requested)
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify, aWidth,
@@ -84,6 +84,7 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL
drawList.SetSheetCount( aSheetCount );
drawList.SetFileName( fn.GetFullName() ); // Print only the short filename
drawList.SetSheetName( aSheetDesc );
drawList.SetSheetLayer( plotter->RenderSettings()->GetLayerName() );
drawList.SetProject( aProject );
drawList.SetIsFirstPage( aIsFirstPage );
+2 -2
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2014-2022 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
@@ -273,7 +273,7 @@ const wxString PROJECT::AbsolutePath( const wxString& aFileName ) const
if( !fn.IsAbsolute() )
{
wxString pro_dir = wxPathOnly( GetProjectFullName() );
fn.Normalize( wxPATH_NORM_ALL, pro_dir );
fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS, pro_dir );
}
return fn.GetFullPath();
+1 -1
View File
@@ -466,7 +466,7 @@ void RC_TREE_MODEL::DeleteCurrentItem( bool aDeep )
void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, bool aDeep )
{
RC_TREE_NODE* current_node = ToNode( m_view->GetCurrentItem() );
RC_TREE_NODE* current_node = m_view ? ToNode( m_view->GetCurrentItem() ) : nullptr;
const std::shared_ptr<RC_ITEM> current_item = current_node ? current_node->m_RcItem : nullptr;
/// Keep a vector of elements to free after wxWidgets is definitely done accessing them
+21 -15
View File
@@ -79,18 +79,23 @@ void SCINTILLA_TRICKS::onThemeChanged( wxSysColourChangedEvent &aEvent )
void SCINTILLA_TRICKS::setupStyles()
{
wxTextCtrl dummy( m_te->GetParent(), wxID_ANY );
wxColour foreground = dummy.GetForegroundColour();
wxColour background = dummy.GetBackgroundColour();
wxColour highlight = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT );
wxColour highlightText = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT );
wxTextCtrl dummy( m_te->GetParent(), wxID_ANY );
wxColour foreground = dummy.GetForegroundColour();
wxColour background = dummy.GetBackgroundColour();
KIGFX::COLOR4D highlight = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT );
KIGFX::COLOR4D highlightText = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT );
m_te->StyleSetForeground( wxSTC_STYLE_DEFAULT, foreground );
m_te->StyleSetBackground( wxSTC_STYLE_DEFAULT, background );
m_te->StyleClearAll();
m_te->SetSelForeground( true, highlightText );
m_te->SetSelBackground( true, highlight );
// Scintilla doesn't handle alpha channel, which at least OSX uses in some highlight colours,
// such as "graphite".
highlight = highlight.Mix( background, highlight.a ).WithAlpha( 1.0 );
highlightText = highlightText.Mix( background, highlightText.a ).WithAlpha( 1.0 );
m_te->SetSelForeground( true, highlightText.ToColour() );
m_te->SetSelBackground( true, highlight.ToColour() );
m_te->SetCaretForeground( foreground );
if( !m_singleLine )
@@ -105,14 +110,13 @@ void SCINTILLA_TRICKS::setupStyles()
m_te->SetTabWidth( 4 );
}
// Set up the brace highlighting
unsigned char r = highlight.Red();
unsigned char g = highlight.Green();
unsigned char b = highlight.Blue();
wxColour::MakeGrey( &r, &g, &b );
highlight.Set( r, g, b );
m_te->StyleSetForeground( wxSTC_STYLE_BRACELIGHT, highlightText );
m_te->StyleSetBackground( wxSTC_STYLE_BRACELIGHT, highlight );
// Set up the brace highlighting. Scintilla doesn't handle alpha, so we construct our own
// 20% wash by blending with the background.
KIGFX::COLOR4D braceText = foreground;
KIGFX::COLOR4D braceHighlight = braceText.Mix( background, 0.2 );
m_te->StyleSetForeground( wxSTC_STYLE_BRACELIGHT, highlightText.ToColour() );
m_te->StyleSetBackground( wxSTC_STYLE_BRACELIGHT, braceHighlight.ToColour() );
m_te->StyleSetForeground( wxSTC_STYLE_BRACEBAD, *wxRED );
}
@@ -228,7 +232,9 @@ void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent )
str = data.GetText();
ConvertSmartQuotesAndDashes( &str );
m_te->BeginUndoAction();
m_te->AddText( str );
m_te->EndUndoAction();
}
wxTheClipboard->Close();
+1 -1
View File
@@ -230,7 +230,7 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath )
// Fix LAYER_VIA_HOLES color - before version 2, this setting had no effect
nlohmann::json::json_pointer ptr( "/board/via_hole");
( *m_internals )[ptr] = COLOR4D( 0.5, 0.4, 0, 0.8 ).ToWxString( wxC2S_CSS_SYNTAX );
( *m_internals )[ptr] = COLOR4D( 0.5, 0.4, 0, 0.8 ).ToCSSString();
return true;
} );
+3
View File
@@ -22,6 +22,7 @@
#include <settings/json_settings_internals.h>
#include <settings/nested_settings.h>
#include <locale_io.h>
NESTED_SETTINGS::NESTED_SETTINGS( const std::string& aName, int aVersion, JSON_SETTINGS* aParent,
const std::string& aPath ) :
@@ -116,6 +117,8 @@ bool NESTED_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
if( !m_parent )
return false;
LOCALE_IO dummy;
try
{
bool modified = Store();
+2 -15
View File
@@ -145,13 +145,6 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
wxString converted;
std::vector<bool> braceStack; // true == formatting construct
auto hasFormattingPrefix =
[&]()
{
static wxString prefixes = wxT( "~_^" );
return !converted.IsEmpty() && prefixes.Find( converted.Last() ) >= 0;
};
converted.reserve( aSource.length() );
for( wxUniChar c: aSource )
@@ -167,9 +160,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
}
else if( aContext == CTX_LIBID )
{
if( c == '{' && !hasFormattingPrefix() )
converted += wxT( "{brace}" );
else if( c == '/' )
if( c == '/' )
converted += wxT( "{slash}" );
else if( c == '\\' )
converted += wxT( "{backslash}" );
@@ -202,9 +193,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
}
else if( aContext == CTX_FILENAME )
{
if( c == '{' )
converted += wxT( "{brace}" );
else if( c == '/' )
if( c == '/' )
converted += wxT( "{slash}" );
else if( c == '\\' )
converted += wxT( "{backslash}" );
@@ -229,8 +218,6 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
{
if( c == ' ' )
converted += wxT( "{space}" );
else if( c == '{' )
converted += wxT( "{brace}" );
else
converted += c;
}
+9 -40
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.TXT for contributors.
* Copyright (C) 2015-2022 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,18 +35,9 @@ using namespace TFIELD_T;
#define FOOTPRINT_CANONICAL "Footprint"
#define DATASHEET_CANONICAL "Datasheet"
static std::mutex s_defaultFieldMutex;
const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx, bool aTranslate )
const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx, bool aTranslateForHI )
{
static void* locale = nullptr;
static wxString referenceDefault;
static wxString valueDefault;
static wxString footprintDefault;
static wxString datasheetDefault;
static wxString fieldDefault;
if( !aTranslate )
if( !aTranslateForHI )
{
switch( aFieldNdx )
{
@@ -54,42 +45,20 @@ const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx, bool aTra
case VALUE_FIELD: return VALUE_CANONICAL; // The symbol value
case FOOTPRINT_FIELD: return FOOTPRINT_CANONICAL; // The footprint for use with Pcbnew
case DATASHEET_FIELD: return DATASHEET_CANONICAL; // Link to a datasheet for symbol
default: return wxString::Format( wxT( "Field%d" ), aFieldNdx );
}
}
// Mutex protection is needed so that multiple loader threads don't write to the static
// variables at once
std::lock_guard<std::mutex> lock( s_defaultFieldMutex );
// Fetching translations can take a surprising amount of time when loading libraries,
// so only do it when necessary.
if( Pgm().GetLocale() != locale )
{
referenceDefault = _( REFERENCE_CANONICAL );
valueDefault = _( VALUE_CANONICAL );
footprintDefault = _( FOOTPRINT_CANONICAL );
datasheetDefault = _( DATASHEET_CANONICAL );
fieldDefault = _( "Field%d" );
locale = Pgm().GetLocale();
}
// Fixed values for the mandatory fields
switch( aFieldNdx )
{
case REFERENCE_FIELD: return referenceDefault; // The symbol reference, R1, C1, etc.
case VALUE_FIELD: return valueDefault; // The symbol value
case FOOTPRINT_FIELD: return footprintDefault; // The footprint for use with Pcbnew
case DATASHEET_FIELD: return datasheetDefault; // Link to a datasheet for symbol
default: return wxString::Format( fieldDefault, aFieldNdx );
case REFERENCE_FIELD: return _( REFERENCE_CANONICAL ); // The symbol reference, R1, C1, etc.
case VALUE_FIELD: return _( VALUE_CANONICAL ); // The symbol value
case FOOTPRINT_FIELD: return _( FOOTPRINT_CANONICAL ); // The footprint for use with Pcbnew
case DATASHEET_FIELD: return _( DATASHEET_CANONICAL ); // Link to a datasheet for symbol
default: return wxString::Format( _( "Field%d" ), aFieldNdx );
}
}
#undef REFERENCE_CANONICAL
#undef VALUE_CANONICAL
#undef FOOTPRINT_CANONICAL
#undef DATASHEET_CANONICAL
void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const
{
+7 -1
View File
@@ -91,6 +91,7 @@ void TITLE_BLOCK::GetContextualTextVars( wxArrayString* aVars )
bool TITLE_BLOCK::TextVarResolver( wxString* aToken, const PROJECT* aProject ) const
{
bool tokenUpdated = false;
wxString originalToken = *aToken;
if( aToken->IsSameAs( wxT( "ISSUE_DATE" ) ) )
{
@@ -146,7 +147,12 @@ bool TITLE_BLOCK::TextVarResolver( wxString* aToken, const PROJECT* aProject ) c
if( tokenUpdated )
{
*aToken = ExpandTextVars( *aToken, aProject );
*aToken = ExpandTextVars( *aToken, aProject );
// This is the default fallback, so don't claim we resolved it
if( *aToken == wxT( "${" ) + originalToken + wxT( "}" ) )
return false;
return true;
}
+7
View File
@@ -242,6 +242,13 @@ bool TOOL_EVENT::IsMoveTool() const
}
bool TOOL_EVENT::IsEditorTool() const
{
return ( m_commandStr
&& m_commandStr.value().find( "InteractiveEdit" ) != GetCommandStr()->npos );
}
bool TOOL_EVENT::IsSimulator() const
{
return( m_commandStr.is_initialized()
+5 -2
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2022 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
@@ -117,8 +117,11 @@ bool TOOLS_HOLDER::IsCurrentTool( const TOOL_ACTION& aAction ) const
void TOOLS_HOLDER::ShowChangedLanguage()
{
if( !GetToolManager() )
return;
std::string actionName = CurrentToolName();
TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
TOOL_ACTION* action = GetToolManager()->GetActionManager()->FindAction( actionName );
if( action )
DisplayToolMsg( action->GetLabel() );
+1
View File
@@ -39,6 +39,7 @@ const wxChar* const kicadTraceCoroutineStack = wxT( "KICAD_COROUTINE_STACK" );
const wxChar* const traceSchLibMem = wxT( "KICAD_SCH_LIB_MEM" );
const wxChar* const traceFindItem = wxT( "KICAD_FIND_ITEM" );
const wxChar* const traceSchLegacyPlugin = wxT( "KICAD_SCH_LEGACY_PLUGIN" );
const wxChar* const traceSchPlugin = wxT( "KICAD_SCH_PLUGIN" );
const wxChar* const traceGedaPcbPlugin = wxT( "KICAD_GEDA_PLUGIN" );
const wxChar* const traceKicadPcbPlugin = wxT( "KICAD_PCB_PLUGIN" );
const wxChar* const tracePrinting = wxT( "KICAD_PRINT" );
+1 -1
View File
@@ -148,7 +148,7 @@ void VIEW_GROUP::ViewDraw( int aLayer, VIEW* aView ) const
{
int layer = layers[i];
if( IsZoneLayer( layer ) )
if( IsZoneFillLayer( layer ) )
layer = layer - LAYER_ZONE_START;
bool draw = aView->IsLayerVisible( layer );
+34 -17
View File
@@ -248,7 +248,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
{
if( !justWarped )
{
m_parentPanel->WarpPointer( x + warpX, y + warpY );
KIPLATFORM::UI::WarpPointer( m_parentPanel, x + warpX, y + warpY );
m_dragStartPoint += VECTOR2D( warpX, warpY );
justWarped = true;
}
@@ -288,7 +288,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
{
if( !justWarped )
{
m_parentPanel->WarpPointer( x, y + warpY );
KIPLATFORM::UI::WarpPointer( m_parentPanel, x, y + warpY );
m_dragStartPoint += VECTOR2D( 0, warpY );
justWarped = true;
}
@@ -353,7 +353,7 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
// Refresh the zoom level and mouse position on message panel
// (mouse position has not changed, only the zoom level has changed):
refreshMouse();
refreshMouse( true );
}
else
{
@@ -371,7 +371,7 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
VECTOR2D delta( scrollX, scrollY );
m_view->SetCenter( m_view->GetCenter() + delta );
refreshMouse();
refreshMouse( true );
}
// Do not skip this event, otherwise wxWidgets will fire
@@ -507,6 +507,18 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
return;
}
#ifdef __WXMSW__
// Hackfix: It's possible for the mouse to leave the canvas
// without triggering any leave events on windows
// Use a MSW only wx function
if( !m_parentPanel->IsMouseInWindow() )
{
m_panTimer.Stop();
m_state = IDLE;
return;
}
#endif
if( !m_parentPanel->HasFocus() )
break;
@@ -533,7 +545,7 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
dir = m_view->ToWorld( dir, false );
m_view->SetCenter( m_view->GetCenter() + dir );
refreshMouse();
refreshMouse( true );
}
break;
@@ -741,20 +753,22 @@ void WX_VIEW_CONTROLS::WarpCursor( const VECTOR2D& aPosition, bool aWorldCoordin
if( aWarpView )
{
m_view->SetCenter( clampedPosition );
m_parentPanel->WarpPointer( screenSize.x / 2, screenSize.y / 2 );
KIPLATFORM::UI::WarpPointer( m_parentPanel, screenSize.x / 2, screenSize.y / 2 );
}
}
else
{
m_parentPanel->WarpPointer( screenPos.x, screenPos.y );
KIPLATFORM::UI::WarpPointer( m_parentPanel, screenPos.x, screenPos.y );
}
}
else
{
m_parentPanel->WarpPointer( aPosition.x, aPosition.y );
KIPLATFORM::UI::WarpPointer( m_parentPanel, aPosition.x, aPosition.y );
}
refreshMouse();
// If we are not refreshing because of mouse movement, don't set the modifiers
// because we are refreshing for keyboard movement, which uses the same modifiers for other actions
refreshMouse( m_updateCursor );
}
@@ -766,7 +780,7 @@ void WX_VIEW_CONTROLS::CenterOnCursor() const
if( GetMousePosition( false ) != screenCenter )
{
m_view->SetCenter( GetCursorPosition() );
m_parentPanel->WarpPointer( KiROUND( screenSize.x / 2 ), KiROUND( screenSize.y / 2 ) );
KIPLATFORM::UI::WarpPointer( m_parentPanel, KiROUND( screenSize.x / 2 ), KiROUND( screenSize.y / 2 ) );
}
}
@@ -877,12 +891,12 @@ void WX_VIEW_CONTROLS::handleCursorCapture( int x, int y )
}
if( warp )
m_parentPanel->WarpPointer( x, y );
KIPLATFORM::UI::WarpPointer( m_parentPanel, x, y );
}
}
void WX_VIEW_CONTROLS::refreshMouse()
void WX_VIEW_CONTROLS::refreshMouse( bool aSetModifiers )
{
// Notify tools that the cursor position has changed in the world coordinates
wxMouseEvent moveEvent( EVT_REFRESH_MOUSE );
@@ -890,10 +904,13 @@ void WX_VIEW_CONTROLS::refreshMouse()
moveEvent.SetX( msp.x );
moveEvent.SetY( msp.y );
// Set the modifiers state
moveEvent.SetControlDown( wxGetKeyState( WXK_CONTROL ) );
moveEvent.SetShiftDown( wxGetKeyState( WXK_SHIFT ) );
moveEvent.SetAltDown( wxGetKeyState( WXK_ALT ) );
if( aSetModifiers )
{
// Set the modifiers state
moveEvent.SetControlDown( wxGetKeyState( WXK_CONTROL ) );
moveEvent.SetShiftDown( wxGetKeyState( WXK_SHIFT ) );
moveEvent.SetAltDown( wxGetKeyState( WXK_ALT ) );
}
m_cursorPos = GetClampedCoords( m_view->ToWorld( VECTOR2D( msp.x, msp.y ) ) );
wxPostEvent( m_parentPanel, moveEvent );
@@ -942,7 +959,7 @@ void WX_VIEW_CONTROLS::UpdateScrollbars()
// Trigger a mouse refresh to get the canvas update in GTK (re-draws the scrollbars).
// Note that this causes an infinite loop on OSX and Windows (in certain cases) as it
// generates a paint event.
refreshMouse();
refreshMouse( false );
#endif
}
}
+1 -1
View File
@@ -44,7 +44,7 @@ BITMAP_TOGGLE::BITMAP_TOGGLE( wxWindow *aParent, wxWindowID aId, const wxBitmap&
const wxBitmap& bitmap = aChecked ? m_checked_bitmap : m_unchecked_bitmap;
m_bitmap = new wxStaticBitmap( this, aId, bitmap, wxDefaultPosition, bitmap.GetSize() );
m_bitmap = new wxStaticBitmap( this, aId, bitmap, wxDefaultPosition );
sizer->Add( m_bitmap, 0, 0 );
+1 -1
View File
@@ -146,7 +146,7 @@ void GRID_CELL_COLOR_SELECTOR::Create( wxWindow* aParent, wxWindowID aId,
wxString GRID_CELL_COLOR_SELECTOR::GetValue() const
{
return m_value.ToWxString( wxC2S_CSS_SYNTAX );
return m_value.ToCSSString();
}
+25 -17
View File
@@ -237,7 +237,9 @@ bool PAGED_DIALOG::TransferDataToWindow()
}
}
m_treebook->SetSelection( (unsigned) std::max( 0, lastPageIndex ) );
lastPageIndex = std::max( 0, lastPageIndex );
m_treebook->ChangeSelection( lastPageIndex );
UpdateResetButton( lastPageIndex );
return true;
}
@@ -360,18 +362,17 @@ void PAGED_DIALOG::OnUpdateUI( wxUpdateUIEvent& event )
}
void PAGED_DIALOG::OnPageChange( wxBookCtrlEvent& event )
void PAGED_DIALOG::UpdateResetButton( int aPage )
{
size_t page = event.GetSelection();
// Enable the reset button only if the page is re-settable
if( m_resetButton )
{
if( auto panel = dynamic_cast<RESETTABLE_PANEL*>( m_treebook->GetPage( page ) ) )
if( auto panel = dynamic_cast<RESETTABLE_PANEL*>( m_treebook->GetPage( aPage ) ) )
{
m_resetButton->SetLabel( wxString::Format( _( "Reset %s to Defaults" ),
m_treebook->GetPageText( page ) ) );
m_resetButton->SetToolTip( panel->GetResetTooltip() );
m_treebook->GetPageText( aPage ) ) );
m_resetButton->SetToolTip( panel->GetHelpTextAtPoint( wxPoint( -INT_MAX, INT_MAX ),
wxHelpEvent::Origin_Unknown ) );
m_resetButton->Enable( true );
}
else
@@ -382,20 +383,27 @@ void PAGED_DIALOG::OnPageChange( wxBookCtrlEvent& event )
}
}
}
// Work around an OSX bug where the wxGrid children don't get placed correctly until
// the first resize event
#ifdef __WXMAC__
if( page + 1 <= m_macHack.size() && m_macHack[ page ] )
void PAGED_DIALOG::OnPageChange( wxBookCtrlEvent& event )
{
int page = event.GetSelection();
// Use the first sub-page when a tree level node is selected.
if( m_treebook->GetCurrentPage()->GetChildren().IsEmpty() )
{
wxSize pageSize = m_treebook->GetPage( page )->GetSize();
pageSize.x -= 5;
pageSize.y += 2;
unsigned next = page + 1;
m_treebook->GetPage( page )->SetSize( pageSize );
m_macHack[ page ] = false;
if( next < m_treebook->GetPageCount() )
m_treebook->ChangeSelection( next );
}
#endif
UpdateResetButton( page );
wxSizeEvent evt( wxDefaultSize );
wxQueueEvent( m_treebook, evt.Clone() );
}
+80 -12
View File
@@ -60,8 +60,9 @@
#define CVPCB_MAINFRAME_NAME wxT( "CvpcbFrame" )
CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
KIWAY_PLAYER( aKiway, aParent, FRAME_CVPCB, _( "Assign Footprints" ), wxDefaultPosition,
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, CVPCB_MAINFRAME_NAME )
KIWAY_PLAYER( aKiway, aParent, FRAME_CVPCB, _( "Assign Footprints" ), wxDefaultPosition,
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, CVPCB_MAINFRAME_NAME ),
m_viewerPendingUpdate( false )
{
m_symbolsListBox = nullptr;
m_footprintListBox = nullptr;
@@ -209,12 +210,17 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
// Start the main processing loop
m_toolManager->InvokeTool( "cvpcb.Control" );
m_filterTimer->StartOnce( 100 );
KIPLATFORM::APP::SetShutdownBlockReason( this, _( "Symbol to footprint changes are unsaved" ) );
}
CVPCB_MAINFRAME::~CVPCB_MAINFRAME()
{
// Stop the timer during destruction early to avoid potential race conditions (that do happen)
m_filterTimer->Stop();
// Shutdown all running tools
if( m_toolManager )
m_toolManager->ShutdownAllTools();
@@ -370,6 +376,9 @@ void CVPCB_MAINFRAME::setupEventHandlers()
// Attach the events to the tool dispatcher
Bind( wxEVT_CHAR, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
Bind( wxEVT_CHAR_HOOK, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
m_filterTimer = new wxTimer( this );
Bind( wxEVT_TIMER, &CVPCB_MAINFRAME::onTextFilterChangedTimer, this, m_filterTimer->GetId() );
}
@@ -420,11 +429,37 @@ void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
// of available footprints which match the filter
m_filterTimer->StartOnce( 200 );
}
void CVPCB_MAINFRAME::onTextFilterChangedTimer( wxTimerEvent& aEvent )
{
// GTK loses the search-control's focus on a Refresh event, so we record the focus and
// insertion point here and then restore them at the end.
bool searchCtrlHasFocus = m_tcFilterString->HasFocus();
long pos = m_tcFilterString->GetInsertionPoint();
wxListEvent l_event;
OnSelectComponent( l_event );
m_tcFilterString->SetFocus();
m_tcFilterString->SetInsertionPoint( pos );
COMPONENT* symbol = GetSelectedComponent();
wxString libraryName = m_librariesListBox->GetSelectedLibrary();
m_footprintListBox->SetFootprints( *m_FootprintsList, libraryName, symbol,
m_tcFilterString->GetValue(), m_filteringOptions );
if( symbol && symbol->GetFPID().IsValid() )
m_footprintListBox->SetSelectedFootprint( symbol->GetFPID() );
else if( m_footprintListBox->GetSelection() >= 0 )
m_footprintListBox->SetSelection( m_footprintListBox->GetSelection(), false );
RefreshFootprintViewer();
DisplayStatus();
if( searchCtrlHasFocus )
{
m_tcFilterString->SetFocus();
m_tcFilterString->SetInsertionPoint( pos );
}
}
@@ -433,22 +468,58 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
if( m_skipComponentSelect )
return;
wxString libraryName;
COMPONENT* symbol = GetSelectedComponent();
libraryName = m_librariesListBox->GetSelectedLibrary();
wxString libraryName = m_librariesListBox->GetSelectedLibrary();
m_footprintListBox->SetFootprints( *m_FootprintsList, libraryName, symbol,
m_tcFilterString->GetValue(), m_filteringOptions );
if( symbol && symbol->GetFPID().IsValid() )
m_footprintListBox->SetSelectedFootprint( symbol->GetFPID() );
else
else if( m_footprintListBox->GetSelection() >= 0 )
m_footprintListBox->SetSelection( m_footprintListBox->GetSelection(), false );
RefreshFootprintViewer();
refreshAfterSymbolSearch( symbol );
}
void CVPCB_MAINFRAME::RefreshFootprintViewer()
{
if( GetFootprintViewerFrame() && !m_viewerPendingUpdate )
{
Bind( wxEVT_IDLE, &CVPCB_MAINFRAME::updateFootprintViewerOnIdle, this );
m_viewerPendingUpdate = true;
}
}
void CVPCB_MAINFRAME::updateFootprintViewerOnIdle( wxIdleEvent& aEvent )
{
Unbind( wxEVT_IDLE, &CVPCB_MAINFRAME::updateFootprintViewerOnIdle, this );
m_viewerPendingUpdate = false;
// On some plateforms (OSX) the focus is lost when the viewers (fp and 3D viewers)
// are opened and refreshed when a new footprint is selected.
// If the listbox has the focus before selecting a new footprint, it will be forced
// after selection.
bool footprintListHasFocus = m_footprintListBox->HasFocus();
bool symbolListHasFocus = m_symbolsListBox->HasFocus();
// If the footprint view window is displayed, update the footprint.
if( GetFootprintViewerFrame() )
GetToolManager()->RunAction( CVPCB_ACTIONS::showFootprintViewer, true );
DisplayStatus();
if( footprintListHasFocus )
m_footprintListBox->SetFocus();
else if( symbolListHasFocus )
m_symbolsListBox->SetFocus();
}
void CVPCB_MAINFRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
{
EDA_BASE_FRAME::LoadSettings( aCfg );
@@ -652,9 +723,6 @@ void CVPCB_MAINFRAME::refreshAfterSymbolSearch( COMPONENT* aSymbol )
break;
}
}
if( GetFootprintViewerFrame() )
m_toolManager->RunAction( CVPCB_ACTIONS::showFootprintViewer, true );
}
SendMessageToEESCHEMA();
+14 -3
View File
@@ -330,6 +330,8 @@ public:
*/
wxString GetSelectedFootprint();
void RefreshFootprintViewer();
void SetStatusText( const wxString& aText, int aNumber = 0 ) override;
protected:
@@ -351,6 +353,12 @@ private:
*/
void setupEventHandlers();
void onTextFilterChanged( wxCommandEvent& event );
void updateFootprintViewerOnIdle( wxIdleEvent& aEvent );
void onTextFilterChangedTimer( wxTimerEvent& aEvent );
/**
* Read the .equ files and populate the list of equivalents.
*
@@ -398,9 +406,12 @@ private:
ACTION_MENU* m_footprintContextMenu;
ACTION_MENU* m_symbolsContextMenu;
// Undo/Redo item lists
CVPCB_UNDO_REDO_LIST m_undoList;
CVPCB_UNDO_REDO_LIST m_redoList;
CVPCB_UNDO_REDO_LIST m_undoList;
CVPCB_UNDO_REDO_LIST m_redoList;
wxTimer* m_filterTimer;
bool m_viewerPendingUpdate;
};
#endif //#ifndef _CVPCB_MAINFRAME_H_
+17 -12
View File
@@ -62,13 +62,15 @@ BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME )
EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow )
EVT_CHOICE( ID_ON_ZOOM_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectZoom )
EVT_CHOICE( ID_ON_GRID_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectGrid )
EVT_MENU( ID_GRID_SETTINGS, DISPLAY_FOOTPRINTS_FRAME::OnGridSettings )
END_EVENT_TABLE()
DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
wxDefaultPosition, wxDefaultSize,
KICAD_DEFAULT_DRAWFRAME_STYLE, FOOTPRINTVIEWER_FRAME_NAME )
PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
wxDefaultPosition, wxDefaultSize,
KICAD_DEFAULT_DRAWFRAME_STYLE, FOOTPRINTVIEWER_FRAME_NAME ),
m_currentComp( nullptr )
{
// Give an icon
wxIcon icon;
@@ -451,21 +453,20 @@ FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintNam
void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
{
CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
COMPONENT* comp = parentframe->GetSelectedComponent();
FOOTPRINT* footprint = nullptr;
const FOOTPRINT_INFO* fpInfo = nullptr;
GetBoard()->DeleteAllFootprints();
GetCanvas()->GetView()->Clear();
wxString footprintName = parentframe->GetSelectedFootprint();
if( footprintName.IsEmpty() )
{
COMPONENT* comp = parentframe->GetSelectedComponent();
if( footprintName.IsEmpty() && comp )
footprintName = comp->GetFPID().Format();
if( comp )
footprintName = comp->GetFPID().GetUniStringLibId();
}
if( m_currentFootprint == footprintName && m_currentComp == comp )
return;
GetBoard()->DeleteAllFootprints();
GetCanvas()->GetView()->Clear();
INFOBAR_REPORTER infoReporter( m_infoBar );
m_infoBar->Dismiss();
@@ -480,7 +481,11 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
}
if( footprint )
{
GetBoard()->Add( footprint );
m_currentFootprint = footprintName;
m_currentComp = comp;
}
if( fpInfo )
SetStatusText( wxString::Format( _( "Lib: %s" ), fpInfo->GetLibNickname() ), 0 );
+4
View File
@@ -114,6 +114,10 @@ public:
protected:
void setupUIConditions() override;
private:
wxString m_currentFootprint;
COMPONENT* m_currentComp;
};
#endif // DISPLAY_FOOTPRINTS_FRAME_H
+8 -24
View File
@@ -99,15 +99,15 @@ wxString FOOTPRINTS_LISTBOX::OnGetItemText( long item, long column ) const
}
void FOOTPRINTS_LISTBOX::SetSelection( int index, bool State )
void FOOTPRINTS_LISTBOX::SetSelection( int aIndex, bool aState )
{
if( index >= GetCount() )
index = GetCount() - 1;
if( aIndex >= GetCount() )
aIndex = GetCount() - 1;
if( (index >= 0) && (GetCount() > 0) )
if(( aIndex >= 0) && ( GetCount() > 0) )
{
Select( index, State );
EnsureVisible( index );
Select( aIndex, aState );
EnsureVisible( aIndex );
Refresh();
}
}
@@ -156,7 +156,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
if( GetSelection() >= 0 && GetSelection() < (int)m_footprintList.GetCount() )
oldSelection = m_footprintList[ GetSelection() ];
for( auto& i: filter )
for( const FOOTPRINT_INFO& i : filter )
{
msg.Printf( wxT( "%3d %s:%s" ),
int( newList.GetCount() + 1 ),
@@ -199,23 +199,7 @@ END_EVENT_TABLE()
void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event )
{
if( m_footprintList.IsEmpty() )
return;
// On some plateforms (OSX) the focus is lost when the viewers (fp and 3D viewers)
// are opened and refreshed when a new footprint is selected.
// If the listbox has the focus before selecting a new footprint, it will be forced
// after selection.
bool hasFocus = HasFocus();
// If the footprint view window is displayed, update the footprint.
if( GetParent()->GetFootprintViewerFrame() )
GetParent()->GetToolManager()->RunAction( CVPCB_ACTIONS::showFootprintViewer, true );
GetParent()->DisplayStatus();
if( hasFocus )
SetFocus();
GetParent()->RefreshFootprintViewer();
}
+1 -1
View File
@@ -100,7 +100,7 @@ public:
~FOOTPRINTS_LISTBOX();
int GetCount();
void SetSelection( int index, bool State = true );
void SetSelection( int aIndex, bool aState = true );
void SetSelectedFootprint( const LIB_ID& aFPID );
void SetString( unsigned linecount, const wxString& text );
void AppendLine( const wxString& text );
+2 -2
View File
@@ -161,8 +161,8 @@ int CVPCB_CONTROL::ShowFootprintViewer( const TOOL_EVENT& aEvent )
if( !fpframe )
{
fpframe = (DISPLAY_FOOTPRINTS_FRAME*) m_frame->Kiway().Player(
FRAME_CVPCB_DISPLAY, true, m_frame );
fpframe = (DISPLAY_FOOTPRINTS_FRAME*) m_frame->Kiway().Player( FRAME_CVPCB_DISPLAY, true,
m_frame );
fpframe->Show( true );
}
else
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2022 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
@@ -182,10 +182,6 @@ void SCH_EDIT_FRAME::AnnotateSymbols( ANNOTATE_SCOPE_T aAnnotateScope,
// Store previous annotations for building info messages
mapExistingAnnotation( previousAnnotation );
// If it is an annotation for all the symbols, reset previous annotation.
if( aResetAnnotation )
DeleteAnnotation( aAnnotateScope, &appendUndo );
// Set sheet number and number of sheets.
SetSheetNumberAndCount();
@@ -205,6 +201,12 @@ void SCH_EDIT_FRAME::AnnotateSymbols( ANNOTATE_SCOPE_T aAnnotateScope,
break;
}
// Remove annotation only updates the "new" flag to indicate to the algorithm
// that these references must be reannotated, but keeps the original reference
// so that we can reannotate multi-unit symbols together.
if( aResetAnnotation )
references.RemoveAnnotation();
// Build additional list of references to be used during reannotation
// to avoid duplicate designators (no additional references when annotating
// the full schematic)
+124 -99
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2018 jean-pierre Charras <jp.charras at wanadoo.fr>
* Copyright (C) 1992-2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 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 <sch_reference_list.h>
#include <core/kicad_algo.h>
#include <wx/regex.h>
#include <algorithm>
@@ -48,7 +49,7 @@ void SCH_REFERENCE_LIST::RemoveItem( unsigned int aIndex )
}
bool SCH_REFERENCE_LIST::Contains( const SCH_REFERENCE& aItem )
bool SCH_REFERENCE_LIST::Contains( const SCH_REFERENCE& aItem ) const
{
for( unsigned ii = 0; ii < GetCount(); ii++ )
{
@@ -154,14 +155,14 @@ bool SCH_REFERENCE_LIST::sortByTimeStamp( const SCH_REFERENCE& item1,
}
int SCH_REFERENCE_LIST::FindUnit( size_t aIndex, int aUnit ) const
int SCH_REFERENCE_LIST::FindUnit( size_t aIndex, int aUnit, bool aIncludeNew ) const
{
int NumRef = flatList[aIndex].m_numRef;
for( size_t ii = 0; ii < flatList.size(); ii++ )
{
if( ( aIndex == ii )
|| ( flatList[ii].m_isNew )
|| ( flatList[ii].m_isNew && !aIncludeNew )
|| ( flatList[ii].m_numRef != NumRef )
|| ( flatList[aIndex].CompareRef( flatList[ii] ) != 0 ) )
continue;
@@ -210,34 +211,98 @@ void SCH_REFERENCE_LIST::GetRefsInUse( int aIndex, std::vector< int >& aIdList,
aIdList.push_back( ref.m_numRef );
}
sort( aIdList.begin(), aIdList.end() );
std::sort( aIdList.begin(), aIdList.end() );
// Ensure each reference number appears only once. If there are symbols with
// multiple parts per package the same number will be stored for each part.
std::vector< int >::iterator it = unique( aIdList.begin(), aIdList.end() );
// Using the C++ unique algorithm only moves the duplicate entries to the end of
// of the array. This removes the duplicate entries from the array.
aIdList.resize( it - aIdList.begin() );
alg::remove_duplicates( aIdList );
}
int SCH_REFERENCE_LIST::GetLastReference( int aIndex, int aMinValue ) const
std::vector<int> SCH_REFERENCE_LIST::GetUnitsMatchingRef( const SCH_REFERENCE& aRef ) const
{
int lastNumber = aMinValue;
std::vector<int> unitsList;
// Always add this reference to the list
unitsList.push_back( aRef.m_unit );
for( SCH_REFERENCE ref : flatList )
{
if( ref.CompareValue( aRef ) != 0 )
continue;
if( ref.CompareLibName( aRef ) != 0 )
continue;
// Split if needed before comparing ref and number
if( ref.IsSplitNeeded() )
ref.Split();
if( ref.CompareRef( aRef ) != 0 )
continue;
if( ref.m_numRef != aRef.m_numRef )
continue;
unitsList.push_back( ref.m_unit );
}
std::sort( unitsList.begin(), unitsList.end() );
// Ensure each reference number appears only once. If there are symbols with
// multiple parts per package the same number will be stored for each part.
alg::remove_duplicates( unitsList );
return unitsList;
}
int SCH_REFERENCE_LIST::FindFirstUnusedReference( const SCH_REFERENCE& aRef, int aMinValue,
const std::vector<int>& aRequiredUnits ) const
{
// Create a map of references indexed by reference number, only including those with the same
// reference prefix as aRef
std::map<int, std::vector<SCH_REFERENCE>> refNumberMap;
for( const SCH_REFERENCE& ref : flatList )
{
// search only for the current reference prefix:
if( flatList[aIndex].CompareRef( ref ) != 0 )
if( ref.CompareRef( aRef ) != 0 )
continue;
// update max value for the current reference prefix
if( lastNumber < ref.m_numRef )
lastNumber = ref.m_numRef;
if( ref.m_isNew )
continue; // It will be reannotated
refNumberMap[ref.m_numRef].push_back( ref );
}
return lastNumber;
// Start at the given minimum value
int minFreeNumber = aMinValue;
for( ; refNumberMap[minFreeNumber].size() > 0; ++minFreeNumber )
{
auto isNumberInUse = [&]() -> bool
{
for( const int& unit : aRequiredUnits )
{
for( const SCH_REFERENCE& ref : refNumberMap[minFreeNumber] )
{
if( ref.CompareLibName( aRef ) || ref.CompareValue( aRef )
|| ref.GetUnit() == unit )
{
return true;
}
}
}
return false;
};
if( !isNumberInUse() )
return minFreeNumber;
}
return minFreeNumber;
}
@@ -261,7 +326,7 @@ std::vector<SYMBOL_INSTANCE_REFERENCE> SCH_REFERENCE_LIST::GetSymbolInstances()
}
int SCH_REFERENCE_LIST::CreateFirstFreeRefId( std::vector<int>& aIdList, int aFirstValue )
int SCH_REFERENCE_LIST::createFirstFreeRefId( std::vector<int>& aIdList, int aFirstValue )
{
int expectedId = aFirstValue;
@@ -327,9 +392,9 @@ void SCH_REFERENCE_LIST::ReannotateDuplicates( const SCH_REFERENCE_LIST& aAdditi
if( refstr[refstr.Len() - 1] == '?' )
continue;
lockedSymbols[refstr].AddItem( ref );
ref.m_isNew = true; // We want to reannotate all references
lockedSymbols[refstr].AddItem( ref );
}
Annotate( false, 0, 0, lockedSymbols, aAdditionalReferences, true );
@@ -372,7 +437,6 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
}
int LastReferenceNumber = 0;
int NumberOfUnits, Unit;
/* calculate index of the first symbol with the same reference prefix
* than the current symbol. All symbols having the same reference
@@ -390,10 +454,6 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
else
minRefId = aStartNumber + 1;
// This is the list of all Id already in use for a given reference prefix.
// Will be refilled for each new reference prefix.
std::vector<int>idList;
GetRefsInUse( first, idList, minRefId );
for( unsigned ii = 0; ii < flatList.size(); ii++ )
{
@@ -435,23 +495,20 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
minRefId = ref_unit.m_sheetNum * aSheetIntervalId + 1;
else
minRefId = aStartNumber + 1;
GetRefsInUse( first, idList, minRefId );
}
// Find references greater than current reference (unless not annotated)
if( aStartAtCurrent && ref_unit.m_numRef > 0 )
{
minRefId = ref_unit.m_numRef;
GetRefsInUse( first, idList, minRefId );
}
// Annotation of one part per package symbols (trivial case).
if( ref_unit.GetLibPart()->GetUnitCount() <= 1 )
{
if( ref_unit.m_isNew )
{
LastReferenceNumber = CreateFirstFreeRefId( idList, minRefId );
std::vector<int> idList;
GetRefsInUse( first, idList, minRefId );
LastReferenceNumber = createFirstFreeRefId( idList, minRefId );
ref_unit.m_numRef = LastReferenceNumber;
}
@@ -460,48 +517,46 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
continue;
}
// Annotation of multi-unit parts ( n units per part ) (complex case)
NumberOfUnits = ref_unit.GetLibPart()->GetUnitCount();
if( ref_unit.m_isNew )
{
LastReferenceNumber = CreateFirstFreeRefId( idList, minRefId );
ref_unit.m_numRef = LastReferenceNumber;
ref_unit.m_flag = 1;
}
// If this symbol is in aLockedUnitMap, copy the annotation to all
// symbols that are not it
if( lockedList != nullptr )
{
unsigned n_refs = lockedList->GetCount();
std::vector<int> units = lockedList->GetUnitsMatchingRef( ref_unit );
for( unsigned thisRefI = 0; thisRefI < n_refs; ++thisRefI )
if( ref_unit.m_isNew )
{
SCH_REFERENCE &thisRef = (*lockedList)[thisRefI];
LastReferenceNumber = FindFirstUnusedReference( ref_unit, minRefId, units );
ref_unit.m_numRef = LastReferenceNumber;
ref_unit.m_isNew = false;
ref_unit.m_flag = 1;
}
if( thisRef.IsSameInstance( ref_unit ) )
for( unsigned lockedRefI = 0; lockedRefI < n_refs; ++lockedRefI )
{
SCH_REFERENCE& lockedRef = ( *lockedList )[lockedRefI];
if( lockedRef.IsSameInstance( ref_unit ) )
{
// This is the symbol we're currently annotating. Hold the unit!
ref_unit.m_unit = thisRef.m_unit;
ref_unit.m_unit = lockedRef.m_unit;
// lock this new full reference
inUseRefs.insert( buildFullReference( ref_unit ) );
}
if( thisRef.CompareValue( ref_unit ) != 0 )
if( lockedRef.CompareValue( ref_unit ) != 0 )
continue;
if( thisRef.CompareLibName( ref_unit ) != 0 )
if( lockedRef.CompareLibName( ref_unit ) != 0 )
continue;
// Find the matching symbol
for( unsigned jj = ii + 1; jj < flatList.size(); jj++ )
{
if( ! thisRef.IsSameInstance( flatList[jj] ) )
if( !lockedRef.IsSameInstance( flatList[jj] ) )
continue;
wxString ref_candidate = buildFullReference( ref_unit, thisRef.m_unit );
wxString ref_candidate = buildFullReference( ref_unit, lockedRef.m_unit );
// propagate the new reference and unit selection to the "old" symbol,
// if this new full reference is not already used (can happens when initial
@@ -518,56 +573,16 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
}
}
}
else
else if( ref_unit.m_isNew )
{
/* search for others units of this symbol.
* we search for others parts that have the same value and the same
* reference prefix (ref without ref number)
*/
for( Unit = 1; Unit <= NumberOfUnits; Unit++ )
{
if( ref_unit.m_unit == Unit )
continue;
int found = FindUnit( ii, Unit );
if( found >= 0 )
continue; // this unit exists for this reference (unit already annotated)
// Search a symbol to annotate ( same prefix, same value, not annotated)
for( unsigned jj = ii + 1; jj < flatList.size(); jj++ )
{
auto& cmp_unit = flatList[jj];
if( cmp_unit.m_flag ) // already tested
continue;
if( cmp_unit.CompareRef( ref_unit ) != 0 )
continue;
if( cmp_unit.CompareValue( ref_unit ) != 0 )
continue;
if( cmp_unit.CompareLibName( ref_unit ) != 0 )
continue;
if( aUseSheetNum &&
cmp_unit.GetSheetPath().Cmp( ref_unit.GetSheetPath() ) != 0 )
continue;
if( !cmp_unit.m_isNew )
continue;
// Symbol without reference number found, annotate it if possible.
if( cmp_unit.m_unit == Unit )
{
cmp_unit.m_numRef = ref_unit.m_numRef;
cmp_unit.m_flag = 1;
cmp_unit.m_isNew = false;
break;
}
}
}
// Reference belonging to multi-unit symbol that has not yet been annotated. We don't
// know what group this might belong to, so just find the first unused reference for
// this specific unit. The other units will be annotated in the following passes.
std::vector<int> units = { ref_unit.GetUnit() };
LastReferenceNumber = FindFirstUnusedReference( ref_unit, minRefId, units );
ref_unit.m_numRef = LastReferenceNumber;
ref_unit.m_isNew = false;
ref_unit.m_flag = 1;
}
}
@@ -824,6 +839,16 @@ void SCH_REFERENCE::Split()
}
bool SCH_REFERENCE::IsSplitNeeded()
{
std::string refText = GetRefStr();
int ll = refText.length() - 1;
return ( refText[ll] == '?' ) || isdigit( refText[ll] );
}
wxString SCH_REFERENCE_LIST::Shorthand( std::vector<SCH_REFERENCE> aList )
{
wxString retVal;
+182 -139
View File
@@ -410,9 +410,6 @@ CONNECTION_SUBGRAPH::PRIORITY CONNECTION_SUBGRAPH::GetDriverPriority( SCH_ITEM*
}
bool CONNECTION_GRAPH::m_allowRealTime = true;
void CONNECTION_GRAPH::Reset()
{
for( auto& subgraph : m_subgraphs )
@@ -481,17 +478,6 @@ void CONNECTION_GRAPH::Recalculate( const SCH_SHEET_LIST& aSheetList, bool aUnco
if( wxLog::IsAllowedTraceMask( ConnProfileMask ) )
recalc_time.Show();
#ifndef DEBUG
// Pressure relief valve for release builds
const double max_recalc_time_msecs = 250.;
if( m_allowRealTime && ADVANCED_CFG::GetCfg().m_RealTimeConnectivity &&
recalc_time.msecs() > max_recalc_time_msecs )
{
m_allowRealTime = false;
}
#endif
}
@@ -2205,6 +2191,31 @@ CONNECTION_SUBGRAPH* CONNECTION_GRAPH::FindSubgraphByName( const wxString& aNetN
}
wxString CONNECTION_GRAPH::GetResolvedSubgraphName( const CONNECTION_SUBGRAPH* aSubGraph ) const
{
wxString retval = aSubGraph->GetNetName();
bool found = false;
// This is a hacky way to find the true subgraph net name (why do we not store it?)
// TODO: Remove once the actual netname of the subgraph is stored with the subgraph
for( auto it = m_net_name_to_subgraphs_map.begin(); it != m_net_name_to_subgraphs_map.end() && !found; ++it )
{
for( CONNECTION_SUBGRAPH* graph : it->second )
{
if( graph == aSubGraph )
{
retval = it->first;
found = true;
break;
}
}
}
return retval;
}
CONNECTION_SUBGRAPH* CONNECTION_GRAPH::FindFirstSubgraphByName( const wxString& aNetName )
{
auto it = m_net_name_to_subgraphs_map.find( aNetName );
@@ -2372,7 +2383,9 @@ bool CONNECTION_GRAPH::ercCheckMultipleDrivers( const CONNECTION_SUBGRAPH* aSubg
if( driver->Type() == SCH_GLOBAL_LABEL_T
|| driver->Type() == SCH_HIER_LABEL_T
|| driver->Type() == SCH_LABEL_T )
|| driver->Type() == SCH_LABEL_T
|| ( driver->Type() == SCH_PIN_T
&& static_cast<SCH_PIN*>( driver )->IsPowerConnection() ) )
{
wxString primaryName = aSubgraph->GetNameForDriver( aSubgraph->m_driver );
wxString secondaryName = aSubgraph->GetNameForDriver( driver );
@@ -2628,68 +2641,96 @@ bool CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts( const CONNECTION_SUBGRAPH
bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph )
{
ERC_SETTINGS& settings = m_schematic->ErcSettings();
wxString msg;
const SCH_SHEET_PATH& sheet = aSubgraph->m_sheet;
SCH_SCREEN* screen = sheet.LastScreen();
bool ok = true;
SCH_PIN* pin = nullptr;
if( aSubgraph->m_no_connect != nullptr )
std::set<SCH_PIN*> unique_pins;
std::set<SCH_TEXT*> unique_labels;
wxString netName = GetResolvedSubgraphName( aSubgraph );
auto process_subgraph = [&]( const CONNECTION_SUBGRAPH* aProcessGraph )
{
bool has_invalid_items = false;
bool has_other_items = false;
SCH_PIN* pin = nullptr;
std::vector<SCH_ITEM*> invalid_items;
wxPoint noConnectPos = aSubgraph->m_no_connect->GetPosition();
double minDist = 0;
// Any subgraph that contains a no-connect should not
// more than one pin (which would indicate it is connected
// Any subgraph that contains both a pin and a no-connect should not
// contain any other driving items.
for( SCH_ITEM* item : aSubgraph->m_items )
for( SCH_ITEM* item : aProcessGraph->m_items )
{
switch( item->Type() )
{
case SCH_PIN_T:
{
SCH_PIN* candidate = static_cast<SCH_PIN*>( item );
double dist = VECTOR2I( candidate->GetTransformedPosition() - noConnectPos )
.SquaredEuclideanNorm();
SCH_PIN* test_pin = static_cast<SCH_PIN*>( item );
if( !pin || dist < minDist )
// Only link NC to pin on the current subgraph being checked
if( aProcessGraph == aSubgraph )
pin = test_pin;
if( std::none_of( unique_pins.begin(), unique_pins.end(),
[test_pin]( SCH_PIN* aPin )
{
return test_pin->IsStacked( aPin );
}
) )
{
pin = candidate;
minDist = dist;
unique_pins.insert( test_pin );
}
has_invalid_items |= has_other_items;
has_other_items = true;
break;
}
case SCH_LINE_T:
case SCH_JUNCTION_T:
case SCH_NO_CONNECT_T:
break;
case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T:
unique_labels.insert( static_cast<SCH_TEXT*>( item ) );
KI_FALLTHROUGH;
default:
has_invalid_items = true;
has_other_items = true;
invalid_items.push_back( item );
break;
}
}
};
if( pin && has_invalid_items && settings.IsTestEnabled( ERCE_NOCONNECT_CONNECTED ) )
auto it = m_net_name_to_subgraphs_map.find( netName );
if( it != m_net_name_to_subgraphs_map.end() )
{
for( const CONNECTION_SUBGRAPH* subgraph : it->second )
{
process_subgraph( subgraph );
}
}
else
{
process_subgraph( aSubgraph );
}
if( aSubgraph->m_no_connect != nullptr )
{
if( unique_pins.size() > 1 && settings.IsTestEnabled( ERCE_NOCONNECT_CONNECTED ) )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_NOCONNECT_CONNECTED );
ercItem->SetItems( pin );
wxPoint pos;
SCH_MARKER* marker = new SCH_MARKER( ercItem, pin->GetTransformedPosition() );
if( pin )
{
ercItem->SetItems( pin, aSubgraph->m_no_connect );
pos = pin->GetTransformedPosition();
}
else
{
ercItem->SetItems( aSubgraph->m_no_connect );
pos = aSubgraph->m_no_connect->GetPosition();
}
SCH_MARKER* marker = new SCH_MARKER( ercItem, pos );
screen->Append( marker );
ok = false;
}
if( !has_other_items && settings.IsTestEnabled( ERCE_NOCONNECT_NOT_CONNECTED ) )
if( unique_pins.empty() && unique_labels.empty() && settings.IsTestEnabled( ERCE_NOCONNECT_NOT_CONNECTED ) )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_NOCONNECT_NOT_CONNECTED );
ercItem->SetItems( aSubgraph->m_no_connect );
@@ -2717,12 +2758,11 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
// Stacked pins do not count as other connections but non-stacked pins do
if( !has_other_connections && !pins.empty() )
{
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
SCH_PIN* test_pin = static_cast<SCH_PIN*>( item );
for( SCH_PIN* other_pin : pins )
{
if( other_pin->GetParent() != pin->GetParent()
|| other_pin->GetPosition() != pin->GetPosition() )
if( !test_pin->IsStacked( other_pin ) )
{
has_other_connections = true;
break;
@@ -2744,7 +2784,17 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
}
// For many checks, we can just use the first pin
SCH_PIN* pin = pins.empty() ? nullptr : pins[0];
pin = pins.empty() ? nullptr : pins[0];
// But if there is a power pin, it might be connected elsewhere
for( SCH_PIN* test_pin : pins )
{
if( test_pin->GetType() == ELECTRICAL_PINTYPE::PT_POWER_IN )
{
pin = test_pin;
break;
}
}
// Check if invisible power input pins connect to anything else via net name,
// but not for power symbols as the ones in the standard library all have invisible pins
@@ -2852,13 +2902,11 @@ bool CONNECTION_GRAPH::ercCheckFloatingWires( const CONNECTION_SUBGRAPH* aSubgra
bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
{
// Label connection rules:
// Any label without a no-connect needs to have at least 2 pins, otherwise it is invalid
// Local labels are flagged if they don't connect to any pins and don't have a no-connect
// Global labels are flagged if they appear only once, don't connect to any local labels,
// and don't have a no-connect marker
// So, if there is a no-connect, we will never generate a warning here
if( aSubgraph->m_no_connect )
return true;
if( !aSubgraph->m_driver_connection )
return true;
@@ -2868,30 +2916,36 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
if( aSubgraph->m_driver_connection->IsBus() )
return true;
ERC_SETTINGS& settings = m_schematic->ErcSettings();
bool ok = true;
SCH_TEXT* text = nullptr;
bool hasOtherConnections = false;
int pinCount = 0;
ERC_SETTINGS& settings = m_schematic->ErcSettings();
bool ok = true;
int pinCount = 0;
bool has_nc = !!aSubgraph->m_no_connect;
std::map<KICAD_T, std::vector<SCH_TEXT*>> label_map;
auto hasPins =
[]( const CONNECTION_SUBGRAPH* aLocSubgraph )
[]( const CONNECTION_SUBGRAPH* aLocSubgraph ) -> int
{
for( const SCH_ITEM* item : aLocSubgraph->m_items )
{
switch( item->Type() )
{
case SCH_PIN_T:
case SCH_SHEET_PIN_T:
return true;
default: break;
}
}
return false;
return
std::count_if( aLocSubgraph->m_items.begin(), aLocSubgraph->m_items.end(), []( const SCH_ITEM* item )
{ return item->Type() == SCH_PIN_T; } );
};
auto reportError = [&]( SCH_TEXT* aText, int errCode )
{
if( settings.IsTestEnabled( errCode ) )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( errCode );
ercItem->SetItems( aText );
SCH_MARKER* marker = new SCH_MARKER( ercItem, aText->GetPosition() );
aSubgraph->m_sheet.LastScreen()->Append( marker );
}
};
pinCount = hasPins( aSubgraph );
for( SCH_ITEM* item : aSubgraph->m_items )
{
switch( item->Type() )
@@ -2900,105 +2954,94 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T:
{
text = static_cast<SCH_TEXT*>( item );
SCH_TEXT* text = static_cast<SCH_TEXT*>( item );
label_map[item->Type()].push_back( text );
// Below, we'll create an ERC if the whole subgraph is unconnected. But, additionally,
// we want to error if an individual label in the subgraph is floating, even if it's
// connected to other valid things by way of another label on the same sheet.
if( text->IsDangling() && settings.IsTestEnabled( ERCE_LABEL_NOT_CONNECTED ) )
if( text->IsDangling() )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_LABEL_NOT_CONNECTED );
ercItem->SetItems( text );
SCH_MARKER* marker = new SCH_MARKER( ercItem, text->GetPosition() );
aSubgraph->m_sheet.LastScreen()->Append( marker );
ok = false;
reportError( text, ERCE_LABEL_NOT_CONNECTED );
return false;
}
break;
}
case SCH_PIN_T:
case SCH_SHEET_PIN_T:
hasOtherConnections = true;
pinCount++;
break;
default:
break;
}
}
if( !text )
if( label_map.empty() )
return true;
bool isGlobal = text->Type() == SCH_GLOBAL_LABEL_T;
int errCode = isGlobal ? ERCE_GLOBLABEL : ERCE_LABEL_NOT_CONNECTED;
wxString netName = GetResolvedSubgraphName( aSubgraph );
wxCHECK_MSG( m_schematic, true, wxT( "Null m_schematic in CONNECTION_GRAPH::ercCheckLabels" ) );
wxCHECK_MSG( m_schematic, true, "Null m_schematic in CONNECTION_GRAPH::ercCheckLabels" );
wxString name = EscapeString( text->GetShownText(), CTX_NETNAME );
// Labels that have multiple pins connected are not dangling (may be used for naming segments)
// so leave them without errors here
if( pinCount > 1 )
return true;
if( isGlobal )
for( auto label_el : label_map )
{
// This will be set to true if the global is connected to a pin above, but we want to
// reset this to false so that globals get flagged if they only have a single instance
// connected to a single pin
hasOtherConnections = ( pinCount > 1 );
KICAD_T type = label_el.first;
std::vector<SCH_TEXT*>& label_vec = label_el.second;
auto it = m_net_name_to_subgraphs_map.find( name );
if( it != m_net_name_to_subgraphs_map.end() )
switch( type )
{
if( it->second.size() > 1 || aSubgraph->m_multiple_drivers )
hasOtherConnections = true;
case SCH_GLOBAL_LABEL_T:
if( !settings.IsTestEnabled( ERCE_GLOBLABEL ) )
continue;
break;
default:
if( !settings.IsTestEnabled( ERCE_LABEL_NOT_CONNECTED ) )
continue;
break;
}
}
else if( text->Type() == SCH_HIER_LABEL_T )
{
// For a hier label, check if the parent pin is connected
if( aSubgraph->m_hier_parent
&& ( aSubgraph->m_hier_parent->m_strong_driver
|| aSubgraph->m_hier_parent->m_drivers.size() > 1) )
{
// For now, a simple check: if there is more than one driver, the parent is probably
// connected elsewhere (because at least one driver will be the hier pin itself)
hasOtherConnections = true;
}
}
else
{
auto pair = std::make_pair( aSubgraph->m_sheet, name );
auto it = m_local_label_cache.find( pair );
if( it != m_local_label_cache.end() && it->second.size() > 1 )
for( SCH_TEXT* text : label_vec )
{
for( const CONNECTION_SUBGRAPH* neighbor : it->second )
int allPins = pinCount;
auto net_it = m_net_name_to_subgraphs_map.find( netName );
if( net_it != m_net_name_to_subgraphs_map.end() )
{
if( neighbor == aSubgraph )
continue;
if( hasPins( neighbor ) )
for( const CONNECTION_SUBGRAPH* neighbor : net_it->second )
{
hasOtherConnections = true;
break;
if( neighbor == aSubgraph )
continue;
if( neighbor->m_no_connect )
has_nc = true;
allPins += hasPins( neighbor );
}
}
if( allPins == 1 && !has_nc )
{
reportError( text,
type == SCH_GLOBAL_LABEL_T ? ERCE_GLOBLABEL : ERCE_LABEL_NOT_CONNECTED );
ok = false;
}
if( allPins == 0 )
{
reportError( text,
type == SCH_GLOBAL_LABEL_T ? ERCE_GLOBLABEL : ERCE_LABEL_NOT_CONNECTED );
ok = false;
}
}
}
if( !hasOtherConnections && settings.IsTestEnabled( errCode ) )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( errCode );
ercItem->SetItems( text );
SCH_MARKER* marker = new SCH_MARKER( ercItem, text->GetPosition() );
aSubgraph->m_sheet.LastScreen()->Append( marker );
return false;
}
return ok;
}
+7 -4
View File
@@ -324,6 +324,13 @@ public:
CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem );
/**
* Returns the fully-resolved netname for a given subgraph
* @param aSubGraph Reference to the subgraph
* @return Netname string usable with m_net_name_to_subgraphs_map
*/
wxString GetResolvedSubgraphName( const CONNECTION_SUBGRAPH* aSubGraph ) const;
private:
/**
* Updates the graphical connectivity between items (i.e. where they touch)
@@ -530,10 +537,6 @@ private:
*/
int ercCheckHierSheets();
public:
// TODO(JE) Remove this when pressure valve is removed
static bool m_allowRealTime;
private:
// All the sheets in the schematic (as long as we don't have partial updates)
SCH_SHEET_LIST m_sheetList;
-5
View File
@@ -578,11 +578,6 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
NETLIST_EXPORTER_KICAD exporter( &Schematic() );
STRING_FORMATTER formatter;
// TODO remove once real-time connectivity is a given
if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
// Ensure the netlist data is up to date:
RecalculateConnections( NO_CLEANUP );
exporter.Format( &formatter, GNL_ALL | GNL_OPT_KICAD );
payload = formatter.GetString();
-145
View File
@@ -1,145 +0,0 @@
// Do not edit this file, it is autogenerated by CMake from the .md file
_HKI( "# 1 - Full documentation\n"
"\n"
"The Eeschema documentation (*eeschema.html*) describes this intermediate netlist and gives examples(chapter ***creating customized netlists and bom files***).\n"
"\n"
"# 2 - The intermediate Netlist File\n"
"\n"
"BOM files (and netlist files) can be created from an *Intermediate netlist file* created by Eeschema.\n"
"\n"
"This file uses XML syntax and is called the intermediate netlist. The intermediate netlist includes a large amount of data about your board and because of this, it can be used with post-processing to create a BOM or other reports.\n"
"\n"
"Depending on the output (BOM or netlist), different subsets of the complete Intermediate Netlist file will be used in the post-processing.\n"
"\n"
"# 3 - Conversion to a new format\n"
"\n"
"By applying a post-processing filter to the Intermediate netlist file you can generate foreign netlist files as well as BOM files. Because this conversion is a text to text transformation, this post-processing filter can be written using *Python*, *XSLT*, or any other tool capable of taking XML as input.\n"
"\n"
"XSLT itself is a XML language suitable for XML transformations. There is a free program called `xsltproc` that you can download and install. The `xsltproc` program can be used to read the Intermediate XML netlist input file, apply a style-sheet to transform the input, and save the results in an output file. Use of `xsltproc` requires a style-sheet file using XSLT conventions. The full conversion process is handled by Eeschema, after it is configured once to run `xsltproc` in a specific way.\n"
"\n"
"A Python script is somewhat more easy to create.\n"
"\n"
"# 4 - Initialization of the dialog window\n"
"\n"
"You should add a new plugin (a script) in the plugin list by clicking on the Add Plugin button.\n"
"\n"
"## 4.1 - Plugin Configuration Parameters\n"
"\n"
"The Eeschema plug-in configuration dialog requires the following information:\n"
"\n"
" * The title: for instance, the name of the netlist format.\n"
" * The command line to launch the converter (usually a script).\n"
"\n"
"***Note (Windows only):***\n"
"*By default, the command line runs with hidden console window and output is redirected to \"Plugin info\" field. To show the window of the running command, set the checkbox \"Show console window\".*\n"
"\n"
"Once you click on the generate button the following will happen:\n"
"\n"
"1. Eeschema creates an intermediate netlist file \\*.xml, for instance `test.xml`.\n"
"2. Eeschema runs the script from the command line to create the final output file.\n"
"\n"
"## 4.2 - Generate netlist files with the command line\n"
"\n"
"Assuming we are using the program `xsltproc.exe` to apply the sheet style to the intermediate file, `xsltproc.exe` is executed with the following command.\n"
"\n"
"```\n"
"xsltproc.exe -o <output filename> <style-sheet filename> <input XML file to convert>\n"
"```\n"
"\n"
"On Windows the command line is the following.\n"
"\n"
"```\n"
"f:/kicad/bin/xsltproc.exe -o \"%O\" f:/kicad/bin/plugins/myconverter.xsl \"%I\"\n"
"```\n"
"\n"
"On Linux the command becomes as following.\n"
"\n"
"```\n"
"xsltproc -o \"%O\" /usr/local/kicad/bin/plugins/myconverter .xsl \"%I\"\n"
"```\n"
"where `myconverter.xsl` is the style-sheet that you are applying.\n"
"\n"
"Do not forget the double quotes around the file names, this allows them to have spaces after the substitution by Eeschema.\n"
"\n"
"If a Python script is used, the command line is something like (depending on the Python script):\n"
"\n"
"```\n"
"python f:/kicad/bin/plugins/bom-in-python/myconverter.py \"%I\" \"%O\"\n"
"```\n"
"\n"
"or\n"
"\n"
"```\n"
"python /usr/local/kicad/bin/plugins/bom-in-python/myconverter .xsl \"%I\" \"%O\"\n"
"```\n"
"\n"
"The command line format accepts parameters for filenames. The supported formatting parameters are:\n"
"\n"
" * `%B`: base filename of selected output file, minus path and extension.\n"
" * `%P`: project directory, without name and without trailing '/'.\n"
" * `%I`: complete filename and path of the temporary input file\n"
"(the intermediate net file).\n"
" * `%O`: complete filename and path (but without extension) of the user\n"
"chosen output file.\n"
"\n"
"`%I` will be replaced by the actual intermediate file name (usually the full root sheet filename with extension \".xml\").\n"
"`%O` will be replaced by the actual output file name (the full root sheet filename minus extension).\n"
"`%B` will be replaced by the actual output short file name (the short root sheet filename minus extension).\n"
"`%P` will be replaced by the actual current project path.\n"
"\n"
"## 4.3 - Command line format:\n"
"\n"
"### 4.3.1 - Remark:\n"
"\n"
"Most of time, the created file must have an extension, depending on its type.\n"
"Therefore you have to add to the option ***%O*** the right file extension.\n"
"\n"
"For instance:\n"
"\n"
" * **%O.csv** to create a .csv file (comma separated value file).\n"
" * **%O.htm** to create a .html file.\n"
" * **%O.bom** to create a .bom file.\n"
"\n"
"### 4.3.2 Example for xsltproc:\n"
"\n"
"The command line format for xsltproc is the following:\n"
"\n"
"```\n"
"<path of xsltproc> xsltproc <xsltproc parameters>\n"
"```\n"
"\n"
"On Windows:\n"
"```\n"
"f:/kicad/bin/xsltproc.exe -o \"%O.bom\" f:/kicad/bin/plugins/netlist_form_pads-pcb.xsl \"%I\"\n"
"```\n"
"\n"
"On Linux:\n"
"```\n"
"xsltproc -o \"%O.bom\" /usr/local/kicad/bin/plugins/netlist_form_pads-pcb.xsl \"%I\"\n"
"```\n"
"\n"
"The above examples assume `xsltproc` is installed on your PC under Windows and xsl files located in `<path_to_kicad>/kicad/bin/plugins/`.\n"
"\n"
"\n"
"### 4.3.3 Example for Python scripts:\n"
"\n"
"Assuming python is installed on your PC, and python scripts are located in\n"
"\n"
" `<path_to_kicad>/kicad/bin/plugins/bom-in-python/`,\n"
"\n"
"the command line format for python is something like:\n"
"\n"
"```\n"
"python <script file name> <input filename> <output filename>\n"
"```\n"
"\n"
"On Windows:\n"
"```\n"
"python.exe f:/kicad/bin/plugins/bom-in-python/my_python_script.py \"%I\" \"%O.html\"\n"
"```\n"
"\n"
"On Linux:\n"
"```\n"
"python /usr/local/kicad/bin/plugins/bom-in-python/my_python_script.py \"%I\" \"%O.csv\"\n"
"```\n"
"" );
+223 -161
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020-2021 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Wayne Stambaugh <stambaughw@gmail.com>
*
@@ -25,14 +25,12 @@
#include <bitmaps.h>
#include <string_utils.h> // WildCompareString
#include <kiway.h>
#include <lib_id.h>
#include <refdes_utils.h>
#include <core/kicad_algo.h>
#include <dialog_change_symbols.h>
#include <sch_symbol.h>
#include <sch_edit_frame.h>
#include <sch_screen.h>
#include <sch_sheet_path.h>
#include <schematic.h>
#include <template_fieldnames.h>
#include <wx_html_report_panel.h>
@@ -100,7 +98,7 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_SYMBO
for( int i = 0; i < MANDATORY_FIELDS; ++i )
{
m_fieldsBox->Append( TEMPLATE_FIELDNAME::GetDefaultFieldName( i ) );
m_fieldsBox->Append( TEMPLATE_FIELDNAME::GetDefaultFieldName( i, DO_TRANSLATE ) );
if( i == REFERENCE_FIELD )
m_fieldsBox->Check( i, g_selectRefDes );
@@ -399,7 +397,9 @@ void DIALOG_CHANGE_SYMBOLS::onOkButtonClicked( wxCommandEvent& aEvent )
m_updateFields.insert( dummy_field.GetCanonicalName() );
}
else
{
m_updateFields.insert( m_fieldsBox->GetString( i ) );
}
}
}
@@ -451,15 +451,16 @@ bool DIALOG_CHANGE_SYMBOLS::isMatch( SCH_SYMBOL* aSymbol, SCH_SHEET_PATH* aInsta
}
bool DIALOG_CHANGE_SYMBOLS::processMatchingSymbols()
int DIALOG_CHANGE_SYMBOLS::processMatchingSymbols()
{
SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( GetParent() );
wxCHECK( frame, false );
LIB_ID newId;
bool appendToUndo = false;
bool changed = false;
wxString msg;
int matchesProcessed = 0;
SCH_SYMBOL* symbol = nullptr;
SCH_SHEET_LIST hierarchy = frame->Schematic().GetSheets();
if( m_mode == MODE::CHANGE )
@@ -470,70 +471,258 @@ bool DIALOG_CHANGE_SYMBOLS::processMatchingSymbols()
return false;
}
std::map<SCH_SYMBOL*, SYMBOL_CHANGE_INFO> symbols;
for( SCH_SHEET_PATH& instance : hierarchy )
{
SCH_SCREEN* screen = instance.LastScreen();
wxCHECK2( screen, continue );
std::vector<SCH_SYMBOL*> symbols;
// Fetch all the symbols that meet the change criteria.
for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
for( SCH_SYMBOL* symbol : symbols )
{
symbol = static_cast<SCH_SYMBOL*>( item );
wxCHECK2( symbol, continue );
if( !isMatch( symbol, &instance ) )
continue;
if( m_mode == MODE::UPDATE )
newId = symbol->GetLibId();
auto it = symbols.find( symbol );
if( it == symbols.end() )
{
if( processSymbol( symbol, &instance, symbol->GetLibId(), appendToUndo ) )
changed = true;
SYMBOL_CHANGE_INFO info;
info.m_Instances.emplace_back( instance );
info.m_LibId = newId;
symbols.insert( { symbol, info } );
}
else
{
if( processSymbol( symbol, &instance, newId, appendToUndo ) )
changed = true;
it->second.m_Instances.emplace_back( instance );
}
if( changed )
appendToUndo = true;
}
}
matchesProcessed += processSymbols( symbols );
frame->GetCurrentSheet().UpdateAllScreenReferences();
return changed;
return matchesProcessed;
}
bool DIALOG_CHANGE_SYMBOLS::processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_PATH* aInstance,
const LIB_ID& aNewId, bool aAppendToUndo )
int DIALOG_CHANGE_SYMBOLS::processSymbols( const std::map<SCH_SYMBOL*,
SYMBOL_CHANGE_INFO>& aSymbols )
{
wxCHECK( aSymbol, false );
wxCHECK( aNewId.IsValid(), false );
wxCHECK( !aSymbols.empty(), 0 );
SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( GetParent() );
SCH_SCREEN* screen = aInstance->LastScreen();
int matchesProcessed = 0;
SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( GetParent() );
SCH_SCREEN* screen = nullptr;
SCH_SYMBOL* symbol = nullptr;
LIB_SYMBOL* libSymbol = nullptr;
std::map<SCH_SYMBOL*, SYMBOL_CHANGE_INFO> symbols = aSymbols;
wxCHECK( frame, false );
wxCHECK( frame, 0 );
LIB_ID oldId = aSymbol->GetLibId();
wxString msg;
wxString references;
for( SYMBOL_INSTANCE_REFERENCE instance : aSymbol->GetInstanceReferences() )
auto it = symbols.begin();
// Remove all symbols that don't have a valid library symbol link or enough units to
// satify the library symbol update.
while( it != symbols.end() )
{
symbol = it->first;
wxCHECK2( symbol && it->second.m_LibId.IsValid(), continue );
libSymbol = frame->GetLibSymbol( it->second.m_LibId );
if( !libSymbol )
{
msg = getSymbolReferences( *symbol, it->second.m_LibId );
msg << wxT( ": " ) << _( "*** symbol not found ***" );
m_messagePanel->Report( msg, RPT_SEVERITY_ERROR );
it = symbols.erase( it );
continue;
}
std::unique_ptr<LIB_SYMBOL> flattenedSymbol = libSymbol->Flatten();
if( flattenedSymbol->GetUnitCount() < symbol->GetUnit() )
{
msg = getSymbolReferences( *symbol, it->second.m_LibId );
msg << wxT( ": " ) << _( "*** new symbol has too few units ***" );
m_messagePanel->Report( msg, RPT_SEVERITY_ERROR );
it = symbols.erase( it );
}
else
{
++it;
}
}
// Removing the symbol needs to be done before the LIB_SYMBOL is changed to prevent stale
// library symbols in the schematic file.
for( auto& pair : symbols )
{
symbol = pair.first;
wxCHECK( symbol && !pair.second.m_Instances.empty(), 0 );
screen = pair.second.m_Instances[0].LastScreen();
wxCHECK( screen, 0 );
screen->Remove( symbol );
frame->SaveCopyInUndoList( screen, symbol, UNDO_REDO::CHANGED, true );
}
for( auto& pair : symbols )
{
symbol = pair.first;
if( pair.second.m_LibId != symbol->GetLibId() )
symbol->SetLibId( pair.second.m_LibId );
libSymbol = frame->GetLibSymbol( pair.second.m_LibId );
std::unique_ptr<LIB_SYMBOL> flattenedSymbol = libSymbol->Flatten();
symbol->SetLibSymbol( flattenedSymbol.release() );
if( m_resetAttributes->GetValue() )
{
symbol->SetIncludeInBom( libSymbol->GetIncludeInBom() );
symbol->SetIncludeOnBoard( libSymbol->GetIncludeOnBoard() );
}
bool removeExtras = m_removeExtraBox->GetValue();
bool resetVis = m_resetFieldVisibilities->GetValue();
bool resetEffects = m_resetFieldEffects->GetValue();
bool resetPositions = m_resetFieldPositions->GetValue();
for( unsigned i = 0; i < symbol->GetFields().size(); ++i )
{
SCH_FIELD& field = symbol->GetFields()[i];
LIB_FIELD* libField = nullptr;
// Mandatory fields always exist in m_updateFields, but these names can be translated.
// so use GetCanonicalName().
if( !alg::contains( m_updateFields, field.GetCanonicalName() ) )
continue;
if( i < MANDATORY_FIELDS )
libField = libSymbol->GetFieldById( (int) i );
else
libField = libSymbol->FindField( field.GetName() );
if( libField )
{
bool resetText = libField->GetText().IsEmpty() ? m_resetEmptyFields->GetValue()
: m_resetFieldText->GetValue();
if( resetText )
{
for( const SCH_SHEET_PATH& instance : pair.second.m_Instances )
{
if( i == REFERENCE_FIELD )
symbol->SetRef( &instance,
UTIL::GetRefDesUnannotated( libField->GetText() ) );
else if( i == VALUE_FIELD )
symbol->SetValue( &instance, UnescapeString( libField->GetText() ) );
else if( i == FOOTPRINT_FIELD )
symbol->SetFootprint( &instance, libField->GetText() );
else
field.SetText( libField->GetText() );
}
}
if( resetVis )
field.SetVisible( libField->IsVisible() );
if( resetEffects )
{
// Careful: the visible bit and position are also in Effects
bool visible = field.IsVisible();
wxPoint pos = field.GetPosition();
field.SetEffects( *libField );
field.SetVisible( visible );
field.SetPosition( pos );
}
if( resetPositions )
field.SetTextPos( symbol->GetPosition() + libField->GetTextPos() );
}
else if( i >= MANDATORY_FIELDS && removeExtras )
{
symbol->RemoveField( field.GetName() );
i--;
}
}
std::vector<LIB_FIELD*> libFields;
libSymbol->GetFields( libFields );
for( unsigned i = MANDATORY_FIELDS; i < libFields.size(); ++i )
{
const LIB_FIELD& libField = *libFields[i];
if( !alg::contains( m_updateFields, libField.GetCanonicalName() ) )
continue;
if( !symbol->FindField( libField.GetName(), false ) )
{
wxString fieldName = libField.GetCanonicalName();
SCH_FIELD newField( wxPoint( 0, 0 ), symbol->GetFieldCount(), symbol,
fieldName );
SCH_FIELD* schField = symbol->AddField( newField );
schField->SetEffects( libField );
schField->SetText( libField.GetText() );
schField->SetTextPos( symbol->GetPosition() + libField.GetTextPos() );
}
}
symbol->SetSchSymbolLibraryName( wxEmptyString );
screen = pair.second.m_Instances[0].LastScreen();
screen->Append( symbol );
frame->GetCanvas()->GetView()->Update( symbol );
msg = getSymbolReferences( *symbol, pair.second.m_LibId );
msg += wxS( ": OK" );
m_messagePanel->Report( msg, RPT_SEVERITY_ACTION );
matchesProcessed +=1;
}
return matchesProcessed;
}
wxString DIALOG_CHANGE_SYMBOLS::getSymbolReferences( SCH_SYMBOL& aSymbol, const LIB_ID& aNewId )
{
wxString msg;
wxString references;
LIB_ID oldId = aSymbol.GetLibId();
for( const SYMBOL_INSTANCE_REFERENCE& instance : aSymbol.GetInstanceReferences() )
{
if( references.IsEmpty() )
references = instance.m_Reference;
else
references += wxT( " " ) + instance.m_Reference;
}
if( m_mode == MODE::UPDATE )
{
if( aSymbol->GetInstanceReferences().size() == 1 )
if( aSymbol.GetInstanceReferences().size() == 1 )
{
msg.Printf( _( "Update symbol %s from '%s' to '%s'" ),
references,
@@ -550,7 +739,7 @@ bool DIALOG_CHANGE_SYMBOLS::processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_
}
else
{
if( aSymbol->GetInstanceReferences().size() == 1 )
if( aSymbol.GetInstanceReferences().size() == 1 )
{
msg.Printf( _( "Change symbol %s from '%s' to '%s'" ),
references,
@@ -566,132 +755,5 @@ bool DIALOG_CHANGE_SYMBOLS::processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_
}
}
LIB_SYMBOL* libSymbol = frame->GetLibSymbol( aNewId );
if( !libSymbol )
{
msg << wxT( ": " ) << _( "*** symbol not found ***" );
m_messagePanel->Report( msg, RPT_SEVERITY_ERROR );
return false;
}
std::unique_ptr<LIB_SYMBOL> flattenedSymbol = libSymbol->Flatten();
if( flattenedSymbol->GetUnitCount() < aSymbol->GetUnit() )
{
msg << wxT( ": " ) << _( "*** new symbol has too few units ***" );
m_messagePanel->Report( msg, RPT_SEVERITY_ERROR );
return false;
}
// Removing the symbol needs to be done before the LIB_SYMBOL is changed to prevent stale
// library symbols in the schematic file.
screen->Remove( aSymbol );
frame->SaveCopyInUndoList( screen, aSymbol, UNDO_REDO::CHANGED, aAppendToUndo );
if( aNewId != aSymbol->GetLibId() )
aSymbol->SetLibId( aNewId );
aSymbol->SetLibSymbol( flattenedSymbol.release() );
if( m_resetAttributes->GetValue() )
{
aSymbol->SetIncludeInBom( libSymbol->GetIncludeInBom() );
aSymbol->SetIncludeOnBoard( libSymbol->GetIncludeOnBoard() );
}
bool removeExtras = m_removeExtraBox->GetValue();
bool resetVis = m_resetFieldVisibilities->GetValue();
bool resetEffects = m_resetFieldEffects->GetValue();
bool resetPositions = m_resetFieldPositions->GetValue();
for( unsigned i = 0; i < aSymbol->GetFields().size(); ++i )
{
SCH_FIELD& field = aSymbol->GetFields()[i];
LIB_FIELD* libField = nullptr;
// Mandatory fields always exist in m_updateFields, but these names can be translated.
// so use GetCanonicalName().
if( !alg::contains( m_updateFields, field.GetCanonicalName() ) )
continue;
if( i < MANDATORY_FIELDS )
libField = libSymbol->GetFieldById( (int) i );
else
libField = libSymbol->FindField( field.GetName() );
if( libField )
{
bool resetText = libField->GetText().IsEmpty() ? m_resetEmptyFields->GetValue()
: m_resetFieldText->GetValue();
if( resetText )
{
if( i == REFERENCE_FIELD )
aSymbol->SetRef( aInstance, UTIL::GetRefDesUnannotated( libField->GetText() ) );
else if( i == VALUE_FIELD )
aSymbol->SetValue( aInstance, UnescapeString( libField->GetText() ) );
else if( i == FOOTPRINT_FIELD )
aSymbol->SetFootprint( aInstance, libField->GetText() );
else
field.SetText( libField->GetText() );
}
if( resetVis )
field.SetVisible( libField->IsVisible() );
if( resetEffects )
{
// Careful: the visible bit and position are also in Effects
bool visible = field.IsVisible();
wxPoint pos = field.GetPosition();
field.SetEffects( *libField );
field.SetVisible( visible );
field.SetPosition( pos );
}
if( resetPositions )
field.SetTextPos( aSymbol->GetPosition() + libField->GetTextPos() );
}
else if( i >= MANDATORY_FIELDS && removeExtras )
{
aSymbol->RemoveField( field.GetName() );
i--;
}
}
std::vector<LIB_FIELD*> libFields;
libSymbol->GetFields( libFields );
for( unsigned i = MANDATORY_FIELDS; i < libFields.size(); ++i )
{
const LIB_FIELD& libField = *libFields[i];
if( !alg::contains( m_updateFields, libField.GetCanonicalName() ) )
continue;
if( !aSymbol->FindField( libField.GetName(), false ) )
{
wxString fieldName = libField.GetCanonicalName();
SCH_FIELD newField( wxPoint( 0, 0), aSymbol->GetFieldCount(), aSymbol, fieldName );
SCH_FIELD* schField = aSymbol->AddField( newField );
schField->SetEffects( libField );
schField->SetText( libField.GetText() );
schField->SetTextPos( aSymbol->GetPosition() + libField.GetTextPos() );
}
}
aSymbol->SetSchSymbolLibraryName( wxEmptyString );
screen->Append( aSymbol );
frame->GetCanvas()->GetView()->Update( aSymbol );
msg += wxT( ": OK" );
m_messagePanel->Report( msg, RPT_SEVERITY_ACTION );
return true;
return msg;
}
+16 -6
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Wayne Stambaugh <stambaughw@gmail.com>
*
@@ -25,11 +25,21 @@
#include <dialog_change_symbols_base.h>
class LIB_ID;
#include <lib_id.h>
#include <sch_sheet_path.h>
class SCH_SYMBOL;
class SCH_EDIT_FRAME;
class SCH_SCREEN;
class SCH_SHEET_PATH;
struct SYMBOL_CHANGE_INFO
{
std::vector<SCH_SHEET_PATH> m_Instances;
LIB_ID m_LibId;
};
/**
* Dialog to update or change schematic library symbols.
@@ -73,9 +83,9 @@ private:
void updateFieldsList();
bool isMatch( SCH_SYMBOL* aSymbol, SCH_SHEET_PATH* aInstance );
bool processMatchingSymbols();
bool processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_PATH* aInstance,
const LIB_ID& aNewId, bool aAppendToUndo );
int processMatchingSymbols();
int processSymbols( const std::map<SCH_SYMBOL*, SYMBOL_CHANGE_INFO>& aSymbols );
wxString getSymbolReferences( SCH_SYMBOL& aSymbol, const LIB_ID& aNewId );
SCH_SYMBOL* m_symbol;
MODE m_mode;
+52 -7
View File
@@ -49,6 +49,10 @@
#include <string_utils.h>
#include <kiplatform/ui.h>
static SCHEMATIC* g_lastERCSchematic = nullptr;
static bool g_lastERCRun = false;
DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
DIALOG_ERC_BASE( parent ),
PROGRESS_REPORTER_BASE( 1 ),
@@ -57,6 +61,8 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
m_ercRun( false ),
m_severities( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING )
{
m_currentSchematic = &parent->Schematic();
SetName( DIALOG_ERC_WINDOW_NAME ); // Set a window name to be able to find it
EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
@@ -70,8 +76,9 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
m_markerTreeModel->SetSeverities( m_severities );
m_markerTreeModel->SetProvider( m_markerProvider );
syncCheckboxes();
updateDisplayedCounts();
if( m_currentSchematic == g_lastERCSchematic )
m_ercRun = g_lastERCRun;
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but
// that requires us to correct the button labels here.
@@ -81,12 +88,24 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
m_sdbSizer1OK->SetDefault();
m_violationsTitleTemplate = m_notebook->GetPageText( 1 );
// Hack to keep from changing translated string in 6.0.x
m_violationsTitleTemplate.Append( wxT( " (%s)" ) );
m_errorsBadge->SetMaximumNumber( 999 );
m_warningsBadge->SetMaximumNumber( 999 );
m_exclusionsBadge->SetMaximumNumber( 999 );
UpdateAnnotationWarning();
Layout();
SetFocus();
syncCheckboxes();
updateDisplayedCounts();
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
@@ -94,6 +113,9 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
DIALOG_ERC::~DIALOG_ERC()
{
g_lastERCSchematic = m_currentSchematic;
g_lastERCRun = m_ercRun;
EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
wxASSERT( settings );
@@ -176,18 +198,41 @@ void DIALOG_ERC::updateDisplayedCounts()
int numWarnings = 0;
int numExcluded = 0;
int numMarkers = 0;
if( m_markerProvider )
{
numMarkers += m_markerProvider->GetCount();
numErrors += m_markerProvider->GetCount( RPT_SEVERITY_ERROR );
numWarnings += m_markerProvider->GetCount( RPT_SEVERITY_WARNING );
numExcluded += m_markerProvider->GetCount( RPT_SEVERITY_EXCLUSION );
}
if( !m_ercRun )
bool markersOverflowed = false;
// We don't currently have a limit on ERC violations, so the above is always false.
wxString num;
wxString msg;
if( m_ercRun )
{
numErrors = -1;
numWarnings = -1;
num.Printf( markersOverflowed ? wxT( "%d+" ) : wxT( "%d" ), numMarkers );
msg.Printf( m_violationsTitleTemplate, num );
}
else
{
msg = m_violationsTitleTemplate;
msg.Replace( wxT( "(%s)" ), wxEmptyString );
}
m_notebook->SetPageText( 1, msg );
if( !m_ercRun && numErrors == 0 )
numErrors = -1;
if( !m_ercRun && numWarnings == 0 )
numWarnings = -1;
m_errorsBadge->UpdateNumber( numErrors, RPT_SEVERITY_ERROR );
m_warningsBadge->UpdateNumber( numWarnings, RPT_SEVERITY_WARNING );
@@ -221,9 +266,9 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
deleteAllMarkers( includeExclusions );
m_ercRun = false;
// redraw the schematic
redrawDrawPanel();
updateDisplayedCounts();
m_parent->GetCanvas()->Refresh();
}
+3
View File
@@ -91,6 +91,9 @@ private:
private:
SCH_EDIT_FRAME* m_parent;
SCHEMATIC* m_currentSchematic;
wxString m_violationsTitleTemplate;
RC_ITEMS_PROVIDER* m_markerProvider;
RC_TREE_MODEL* m_markerTreeModel;
+1 -1
View File
@@ -309,7 +309,7 @@
</object>
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Violations</property>
<property name="label">Violations (%d)</property>
<property name="select">0</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
+8 -3
View File
@@ -53,8 +53,6 @@ DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES( SCH_BASE_FRAME* aParent, const
{
wxASSERT( aTextItem );
SetTitle( aTitle );
m_note->SetFont( KIUI::GetInfoFont( this ).Italic() );
m_note->Show( false );
@@ -348,7 +346,14 @@ DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen
m_isPower = false;
m_textLabel->SetLabel( m_field->GetName() + wxT( ":" ) );
wxString translated_fieldname;
if( m_field->GetId() < MANDATORY_FIELDS )
translated_fieldname = TEMPLATE_FIELDNAME::GetDefaultFieldName( m_field->GetId(), DO_TRANSLATE );
else
translated_fieldname = m_field->GetName();
m_textLabel->SetLabel( translated_fieldname + ":" );
m_position = m_field->GetPosition();
@@ -109,10 +109,6 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS( SCH_
m_parent = parent;
m_appendUndo = false;
// TODO(JE) remove once real-time connectivity is a given
if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
m_parent->RecalculateConnections( NO_CLEANUP );
m_lineStyle->Append( DEFAULT_STYLE );
m_lineStyle->Append( INDETERMINATE_ACTION );
@@ -132,7 +132,7 @@ public:
val = StringFromValue( aUserUnits, pin->GetPosition().x, true );
break;
case COL_POSY:
val = StringFromValue( aUserUnits, pin->GetPosition().y, true );
val = StringFromValue( aUserUnits, -pin->GetPosition().y, true );
break;
case COL_VISIBLE:
val = StringFromBool( pin->IsVisible() );
@@ -216,7 +216,7 @@ public:
case COL_POSY:
pin->SetPosition( wxPoint( pin->GetPosition().x,
ValueFromString( m_frame->GetUserUnits(), aValue ) ) );
-ValueFromString( m_frame->GetUserUnits(), aValue ) ) );
break;
case COL_VISIBLE:
@@ -556,7 +556,9 @@ DIALOG_LIB_EDIT_PIN_TABLE::~DIALOG_LIB_EDIT_PIN_TABLE()
bool DIALOG_LIB_EDIT_PIN_TABLE::TransferDataToWindow()
{
// Make a copy of the pins for editing
for( LIB_PIN* pin = m_part->GetNextPin( nullptr ); pin; pin = m_part->GetNextPin( pin ) )
std::vector<LIB_PIN*> pins = m_part->GetAllLibPins();
for( LIB_PIN* pin : pins )
m_pins.push_back( new LIB_PIN( *pin ) );
m_dataModel->RebuildRows( m_pins, m_cbGroup->GetValue() );
@@ -573,7 +575,9 @@ bool DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow()
return false;
// Delete the part's pins
while( LIB_PIN* pin = m_part->GetNextPin( nullptr ) )
std::vector<LIB_PIN*> pins = m_part->GetAllLibPins();
for( LIB_PIN* pin : pins )
m_part->RemoveDrawItem( pin );
// Transfer our pins to the part
@@ -28,7 +28,7 @@
#include <dialog_lib_text_properties.h>
#include <symbol_editor/symbol_editor_settings.h>
#include <tools/symbol_editor_drawing_tools.h>
#include "confirm.h"
DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aParent,
LIB_TEXT* aText ) :
@@ -116,9 +116,15 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
if( m_graphicText )
{
if( m_TextCtrl->GetValue().IsEmpty() )
m_graphicText->SetText( wxT( "[null]" ) );
{
// Other text items do not have defined extents, and so will disappear if empty
DisplayError( this, _( "Value may not be empty." ) );
return false;
}
else
{
m_graphicText->SetText( m_TextCtrl->GetValue() );
}
m_graphicText->SetPosition( wxPoint( m_posX.GetValue(), m_posY.GetValue() ) );
+40 -22
View File
@@ -83,8 +83,8 @@ public:
* @param title is the title of the notebook page.
* @param id_NetType is the netlist ID type.
*/
NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title,
NETLIST_TYPE_ID id_NetType );
NETLIST_PAGE_DIALOG( wxNotebook* aParent, const wxString& aTitle,
NETLIST_TYPE_ID aIdNetType, bool aCustom );
~NETLIST_PAGE_DIALOG() { };
/**
@@ -102,8 +102,12 @@ public:
wxBoxSizer* m_RightOptionsBoxSizer;
wxBoxSizer* m_LowBoxSizer;
bool IsCustom() const { return m_custom; }
private:
wxString m_pageNetFmtName;
bool m_custom;
};
@@ -125,6 +129,8 @@ private:
bool TransferDataFromWindow() override;
void NetlistUpdateOpt();
void updateGeneratorButtons();
// Called when changing the notebook page (and therefore the current netlist format)
void OnNetlistTypeSelection( wxNotebookEvent& event ) override;
@@ -206,17 +212,18 @@ BEGIN_EVENT_TABLE( NETLIST_DIALOG, NETLIST_DIALOG_BASE )
END_EVENT_TABLE()
NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title,
NETLIST_TYPE_ID id_NetType ) :
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL )
NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* aParent, const wxString& aTitle,
NETLIST_TYPE_ID aIdNetType, bool aCustom ) :
wxPanel( aParent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL )
{
m_IdNetType = id_NetType;
m_pageNetFmtName = title;
m_IdNetType = aIdNetType;
m_pageNetFmtName = aTitle;
m_CommandStringCtrl = nullptr;
m_TitleStringCtrl = nullptr;
m_AdjustPassiveValues = nullptr;
m_custom = aCustom;
parent->AddPage( this, title, false );
aParent->AddPage( this, aTitle, false );
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxVERTICAL );
SetSizer( MainBoxSizer );
@@ -245,14 +252,14 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
page = nullptr;
// Add notebook pages:
m_PanelNetType[PANELPCBNEW] = new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "KiCad" ),
NET_TYPE_PCBNEW );
m_PanelNetType[PANELPCBNEW] =
new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "KiCad" ), NET_TYPE_PCBNEW, false );
m_PanelNetType[PANELORCADPCB2] = new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "OrcadPCB2" ),
NET_TYPE_ORCADPCB2 );
m_PanelNetType[PANELORCADPCB2] =
new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "OrcadPCB2" ), NET_TYPE_ORCADPCB2, false );
m_PanelNetType[PANELCADSTAR] = new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "CadStar" ),
NET_TYPE_CADSTAR );
m_PanelNetType[PANELCADSTAR] =
new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "CadStar" ), NET_TYPE_CADSTAR, false );
InstallPageSpice();
InstallCustomPages();
@@ -275,6 +282,8 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
updateGeneratorButtons();
}
@@ -320,7 +329,7 @@ void NETLIST_DIALOG::OnRunSpiceButtUI( wxUpdateUIEvent& aEvent )
void NETLIST_DIALOG::InstallPageSpice()
{
NETLIST_PAGE_DIALOG* page = m_PanelNetType[PANELSPICE] =
new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "Spice" ), NET_TYPE_SPICE );
new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "Spice" ), NET_TYPE_SPICE, false );
SCHEMATIC_SETTINGS& settings = m_Parent->Schematic().Settings();
@@ -385,7 +394,7 @@ NETLIST_PAGE_DIALOG* NETLIST_DIALOG::AddOneCustomPage( const wxString& aTitle,
const wxString& aCommandString,
NETLIST_TYPE_ID aNetTypeId )
{
NETLIST_PAGE_DIALOG* currPage = new NETLIST_PAGE_DIALOG( m_NoteBook, aTitle, aNetTypeId );
NETLIST_PAGE_DIALOG* currPage = new NETLIST_PAGE_DIALOG( m_NoteBook, aTitle, aNetTypeId, true );
currPage->m_LowBoxSizer->Add( new wxStaticText( currPage, -1, _( "Title:" ) ), 0,
wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
@@ -413,12 +422,7 @@ NETLIST_PAGE_DIALOG* NETLIST_DIALOG::AddOneCustomPage( const wxString& aTitle,
void NETLIST_DIALOG::OnNetlistTypeSelection( wxNotebookEvent& event )
{
NETLIST_PAGE_DIALOG* currPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
if( currPage == nullptr )
return;
m_buttonDelGenerator->Enable( currPage->m_IdNetType >= NET_TYPE_CUSTOM1 );
updateGeneratorButtons();
}
@@ -588,6 +592,9 @@ void NETLIST_DIALOG::OnDelGenerator( wxCommandEvent& event )
{
NETLIST_PAGE_DIALOG* currPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
if( !currPage->IsCustom() )
return;
currPage->m_CommandStringCtrl->SetValue( wxEmptyString );
currPage->m_TitleStringCtrl->SetValue( wxEmptyString );
@@ -712,6 +719,17 @@ void NETLIST_DIALOG_ADD_GENERATOR::OnBrowseGenerators( wxCommandEvent& event )
}
void NETLIST_DIALOG::updateGeneratorButtons()
{
NETLIST_PAGE_DIALOG* currPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
if( currPage == nullptr )
return;
m_buttonDelGenerator->Enable( currPage->IsCustom() );
}
int InvokeDialogNetList( SCH_EDIT_FRAME* aCaller )
{
NETLIST_DIALOG dlg( aCaller );
+4 -3
View File
@@ -4,7 +4,7 @@
* Copyright (C) 1992-2018 Jean-Pierre Charras jp.charras at wanadoo.fr
* Copyright (C) 1992-2010 Lorenzo Marcantonio
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -38,6 +38,7 @@
#include <trace_helpers.h>
#include <settings/settings_manager.h>
#include <drawing_sheet/ds_painter.h>
#include <wx_filename.h>
#include <sch_edit_frame.h>
#include <sch_painter.h>
@@ -1283,7 +1284,7 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
fn.SetName( wxEmptyString );
fn.SetExt( wxEmptyString );
if( fn.Normalize() )
if( fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) )
{
path = fn.GetPath();
}
@@ -1318,7 +1319,7 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
// Build the absolute path of current output directory and the project path.
fn.SetPath( Prj().GetProjectPath() + path );
if( fn.Normalize() )
if( fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) )
{
path = fn.GetPath();
}
@@ -409,6 +409,11 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage )
*/
void SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen )
{
// Warning:
// When printing many pages, changes in the current wxDC will affect all next printings
// because all prints are using the same wxPrinterDC after creation
// So be careful and reinit parameters, especially when using offsets.
wxPoint tmp_startvisu;
wxSize pageSizeIU; // Page size in internal units
wxPoint old_org;
@@ -439,16 +444,31 @@ void SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen )
int xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
int yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
// Using a wxAffineMatrix2D has a big advantage: it handles different pages orientations
//(PORTRAIT/LANDSCAPE), but the affine matrix is not always supported
if( dc->CanUseTransformMatrix() )
{
wxAffineMatrix2D matrix = dc->GetTransformMatrix();
wxAffineMatrix2D matrix; // starts from a unity matrix (the current wxDC default)
// Check for portrait/landscape mismatch:
if( ( fitRect.width > fitRect.height ) != ( pageSizeIU.x > pageSizeIU.y ) )
{
// Rotate the coordinates, and keep the draw coordinates inside the page
matrix.Rotate( M_PI_2 );
xoffset = ( fitRect.height - pageSizeIU.x ) / 2;
yoffset = ( fitRect.width - pageSizeIU.y ) / 2;
matrix.Translate( 0, -pageSizeIU.y );
// Recalculate the offsets and page sizes according to the page rotation
std::swap( pageSizeIU.x, pageSizeIU.y );
FitThisSizeToPaper( pageSizeIU );
fitRect = GetLogicalPaperRect();
xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
// All the coordinates will be rotated 90 deg when printing,
// so the X,Y offset vector must be rotated -90 deg before printing
std::swap( xoffset, yoffset );
yoffset = -yoffset;
}
matrix.Translate( xoffset, yoffset );
@@ -456,12 +476,8 @@ void SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen )
}
else
{
// wxWidgets appears to have a bug when OffsetLogicalOrigin()'s yoffset changes from
// page to page.
// NB: this is a workaround, not a fix. The Y centering will be off, but this is less
// annoying than a blank page. See https://bugs.launchpad.net/kicad/+bug/1464773.
yoffset = 0;
SetLogicalOrigin( 0, 0 ); // Reset all offset settings made previously.
// When printing previous pages (all prints are using the same wxDC)
OffsetLogicalOrigin( xoffset, yoffset );
}
+3 -1
View File
@@ -29,6 +29,7 @@
#include <wx/tooltip.h>
#include <confirm.h>
#include <validators.h>
#include <wx_filename.h>
#include <wildcards_and_files_ext.h>
#include <widgets/tab_traversal.h>
#include <sch_edit_frame.h>
@@ -425,7 +426,8 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
// SCH_SCREEN file names are always absolute.
wxFileName currentScreenFileName = currentScreen->GetFileName();
if( !screenFileName.Normalize( wxPATH_NORM_ALL, currentScreenFileName.GetPath() ) )
if( !screenFileName.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS,
currentScreenFileName.GetPath() ) )
{
msg = wxString::Format( _( "Cannot normalize new sheet schematic file path:\n"
"'%s'\n"
@@ -233,6 +233,10 @@ public:
if( aCol == QUANTITY_COLUMN )
return _( "Qty" );
else if( aCol < MANDATORY_FIELDS )
// FIX ME: the column label should be displayed translated.
// but when translated, and the DATASHEET column is shown, a new field
// with the translated DATASHEET field name is added when saving fields
// return TEMPLATE_FIELDNAME::GetDefaultFieldName( aCol, DO_TRANSLATE );
return TEMPLATE_FIELDNAME::GetDefaultFieldName( aCol );
else
return m_fieldNames[ aCol ];
@@ -615,19 +619,21 @@ public:
const wxString& srcValue = srcData.second;
SCH_FIELD* destField = symbol.FindField( srcName );
if( !destField && !srcValue.IsEmpty() )
// Add a not existing field if it has a value for this symbol
bool createField = !destField && !srcValue.IsEmpty();
if( createField )
{
const wxPoint symbolPos = symbol.GetPosition();
destField = symbol.AddField( SCH_FIELD( symbolPos, -1, &symbol, srcName ) );
}
if( !destField )
continue;
if( destField->GetId() == REFERENCE_FIELD )
{
symbol.RemoveField( srcName );
}
else if( destField->GetId() == REFERENCE_FIELD )
{
// Reference is not editable
// Reference is not editable from this dialog
}
else if( destField->GetId() == VALUE_FIELD )
{
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Oliver Walters
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2022 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
@@ -74,6 +74,8 @@ private:
SCH_REFERENCE_LIST m_symbolsList;
FIELDS_EDITOR_GRID_DATA_MODEL* m_dataModel;
static int m_newFieldsOption; // Store the option choice for new fields
// during a session:
};
#endif /* DIALOG_SYMBOL_FIELDS_TABLE_H */
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -32,7 +32,7 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare
m_groupSymbolsBox->SetValue(true);
m_groupSymbolsBox->SetToolTip( _("Group symbols together based on common properties") );
bGroupSizer->Add( m_groupSymbolsBox, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 );
bGroupSizer->Add( m_groupSymbolsBox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
bGroupSizer->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
@@ -103,7 +103,7 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare
bButtonsSizer->Add( 0, 0, 1, wxEXPAND, 5 );
m_buttonApply = new wxButton( this, wxID_ANY, _("Apply, Save Schematic && Continue"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonApply, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
bButtonsSizer->Add( m_buttonApply, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
@@ -112,10 +112,10 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bButtonsSizer->Add( m_sdbSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 );
bButtonsSizer->Add( m_sdbSizer, 0, wxEXPAND|wxLEFT, 5 );
bMainSizer->Add( bButtonsSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bButtonsSizer, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
this->SetSizer( bMainSizer );
@@ -191,7 +191,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
@@ -603,7 +603,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
@@ -622,7 +622,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@@ -696,7 +696,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
+38 -4
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2022 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
@@ -89,6 +89,14 @@ public:
void BuildAttrs()
{
for( wxGridCellAttr* attr : m_nameAttrs )
attr->DecRef();
m_nameAttrs.clear();
if( m_readOnlyAttr )
m_readOnlyAttr->DecRef();
m_readOnlyAttr = new wxGridCellAttr;
m_readOnlyAttr->SetReadOnly( true );
@@ -117,11 +125,17 @@ public:
m_nameAttrs.push_back( attr );
}
if( m_typeAttr )
m_typeAttr->DecRef();
m_typeAttr = new wxGridCellAttr;
m_typeAttr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinTypeIcons(),
PinTypeNames() ) );
m_typeAttr->SetReadOnly( true );
if( m_shapeAttr )
m_shapeAttr->DecRef();
m_shapeAttr = new wxGridCellAttr;
m_shapeAttr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinShapeIcons(),
PinShapeNames() ) );
@@ -744,8 +758,14 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
}
else
{
SCH_FIELD* newField = otherUnit->AddField( m_fields->at( ii ) );
const_cast<KIID&>( newField->m_Uuid ) = KIID();
SCH_FIELD newField( m_fields->at( ii ) );
const_cast<KIID&>( newField.m_Uuid ) = KIID();
newField.Offset( -m_symbol->GetPosition() );
newField.Offset( otherUnit->GetPosition() );
newField.SetParent( otherUnit );
otherUnit->AddField( newField );
}
}
@@ -847,7 +867,7 @@ void DIALOG_SYMBOL_PROPERTIES::OnAddField( wxCommandEvent& event )
SCHEMATIC_SETTINGS& settings = m_symbol->Schematic()->Settings();
int fieldID = m_fields->size();
SCH_FIELD newField( wxPoint( 0, 0 ), fieldID, m_symbol,
TEMPLATE_FIELDNAME::GetDefaultFieldName( fieldID ) );
TEMPLATE_FIELDNAME::GetDefaultFieldName( fieldID, DO_TRANSLATE ) );
newField.SetTextAngle( m_fields->at( REFERENCE_FIELD ).GetTextAngle() );
newField.SetTextSize( wxSize( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) );
@@ -1024,6 +1044,7 @@ void DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort( wxGridEvent& aEvent )
ascending = true;
m_dataModel->SortRows( sortCol, ascending );
m_dataModel->BuildAttrs();
}
@@ -1139,3 +1160,16 @@ void DIALOG_SYMBOL_PROPERTIES::OnChoice( wxCommandEvent& event )
{
OnModify();
}
void DIALOG_SYMBOL_PROPERTIES::onUpdateEditSymbol( wxUpdateUIEvent& event )
{
event.Enable( m_symbol && m_symbol->GetLibSymbolRef() );
}
void DIALOG_SYMBOL_PROPERTIES::onUpdateEditLibrarySymbol( wxUpdateUIEvent& event )
{
event.Enable( m_symbol && m_symbol->GetLibSymbolRef() );
}
+4 -1
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 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
@@ -88,6 +88,9 @@ private:
void OnUpdateSymbol( wxCommandEvent& ) override;
void OnExchangeSymbol( wxCommandEvent& ) override;
virtual void onUpdateEditSymbol( wxUpdateUIEvent& event ) override;
virtual void onUpdateEditLibrarySymbol( wxUpdateUIEvent& event ) override;
void AdjustGridColumns( int aWidth );
private:
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -49,7 +49,6 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
m_fieldsGrid->SetColSize( 10, 84 );
m_fieldsGrid->EnableDragColMove( false );
m_fieldsGrid->EnableDragColSize( true );
m_fieldsGrid->SetColLabelSize( 22 );
m_fieldsGrid->SetColLabelValue( 0, _("Name") );
m_fieldsGrid->SetColLabelValue( 1, _("Value") );
m_fieldsGrid->SetColLabelValue( 2, _("Show") );
@@ -61,6 +60,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
m_fieldsGrid->SetColLabelValue( 8, _("Orientation") );
m_fieldsGrid->SetColLabelValue( 9, _("X Position") );
m_fieldsGrid->SetColLabelValue( 10, _("Y Position") );
m_fieldsGrid->SetColLabelSize( 22 );
m_fieldsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
@@ -260,12 +260,12 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
m_pinGrid->SetColSize( 4, 140 );
m_pinGrid->EnableDragColMove( false );
m_pinGrid->EnableDragColSize( true );
m_pinGrid->SetColLabelSize( 24 );
m_pinGrid->SetColLabelValue( 0, _("Pin Number") );
m_pinGrid->SetColLabelValue( 1, _("Base Pin Name") );
m_pinGrid->SetColLabelValue( 2, _("Alternate Assignment") );
m_pinGrid->SetColLabelValue( 3, _("Electrical Type") );
m_pinGrid->SetColLabelValue( 4, _("Graphic Style") );
m_pinGrid->SetColLabelSize( 24 );
m_pinGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
@@ -353,7 +353,9 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
m_updateSymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnUpdateSymbol ), NULL, this );
m_changeSymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnExchangeSymbol ), NULL, this );
m_editSchematicSymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSymbol ), NULL, this );
m_editSchematicSymbolBtn->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::onUpdateEditSymbol ), NULL, this );
m_editLibrarySymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditLibrarySymbol ), NULL, this );
m_editLibrarySymbolBtn->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::onUpdateEditLibrarySymbol ), NULL, this );
m_pinGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnPinTableCellEdited ), NULL, this );
m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this );
m_stdDialogButtonSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
@@ -381,7 +383,9 @@ DIALOG_SYMBOL_PROPERTIES_BASE::~DIALOG_SYMBOL_PROPERTIES_BASE()
m_updateSymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnUpdateSymbol ), NULL, this );
m_changeSymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnExchangeSymbol ), NULL, this );
m_editSchematicSymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSymbol ), NULL, this );
m_editSchematicSymbolBtn->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::onUpdateEditSymbol ), NULL, this );
m_editLibrarySymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditLibrarySymbol ), NULL, this );
m_editLibrarySymbolBtn->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::onUpdateEditLibrarySymbol ), NULL, this );
m_pinGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnPinTableCellEdited ), NULL, this );
m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this );
m_stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration">; </property>
<property name="code_generation">C++</property>
@@ -14,6 +14,7 @@
<property name="file">dialog_symbol_properties_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_edit_component_in_schematic_base</property>
@@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@@ -50,6 +52,7 @@
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Symbol Properties</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@@ -301,6 +304,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -374,6 +378,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -447,6 +452,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -530,6 +536,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -1429,6 +1436,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -1502,6 +1510,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -1575,6 +1584,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -1633,6 +1643,7 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnEditSymbol</event>
<event name="OnUpdateUI">onUpdateEditSymbol</event>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -1658,6 +1669,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -1716,6 +1728,7 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnEditLibrarySymbol</event>
<event name="OnUpdateUI">onUpdateEditLibrarySymbol</event>
</object>
</object>
</object>
@@ -2058,6 +2071,7 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -77,7 +77,7 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
wxButton* m_stdDialogButtonSizerOK;
wxButton* m_stdDialogButtonSizerCancel;
// Virtual event handlers, overide them in your derived class
// Virtual event handlers, override them in your derived class
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnGridEditorShown( wxGridEvent& event ) { event.Skip(); }
@@ -91,7 +91,9 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
virtual void OnUpdateSymbol( wxCommandEvent& event ) { event.Skip(); }
virtual void OnExchangeSymbol( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEditSymbol( wxCommandEvent& event ) { event.Skip(); }
virtual void onUpdateEditSymbol( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnEditLibrarySymbol( wxCommandEvent& event ) { event.Skip(); }
virtual void onUpdateEditLibrarySymbol( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnPinTableCellEdited( wxGridEvent& event ) { event.Skip(); }
virtual void OnEditSpiceModel( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
@@ -100,6 +102,7 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
public:
DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
~DIALOG_SYMBOL_PROPERTIES_BASE();
};
+3 -2
View File
@@ -6,7 +6,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -29,6 +29,7 @@
#include <confirm.h>
#include <reporter.h>
#include <wildcards_and_files_ext.h>
#include <wx_filename.h>
#include <wx_html_report_panel.h>
#include <symbol_library.h>
@@ -201,7 +202,7 @@ void DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable( REPORTER& aReporter )
wxFileName tmpFn = fullFileName;
// Don't add symbol libraries that do not exist.
if( tmpFn.Normalize() && tmpFn.FileExists() )
if( tmpFn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) && tmpFn.FileExists() )
{
msg.Printf( _( "Adding library '%s', file '%s' to project symbol library table." ),
libName,
@@ -47,7 +47,7 @@ DIALOG_UPDATE_SYMBOL_FIELDS::DIALOG_UPDATE_SYMBOL_FIELDS( SYMBOL_EDIT_FRAME* aPa
for( int i = 0; i < MANDATORY_FIELDS; ++i )
{
m_fieldsBox->Append( TEMPLATE_FIELDNAME::GetDefaultFieldName( i ) );
m_fieldsBox->Append( TEMPLATE_FIELDNAME::GetDefaultFieldName( i, DO_TRANSLATE ) );
m_fieldsBox->Check( i, true );
}
+17 -1
View File
@@ -321,7 +321,20 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
ext == KiCadSchematicFileExtension + BackupFileSuffix )
{
if( destFile.GetName() == aProjectName )
{
destFile.SetName( aNewProjectName );
}
else if( destFile.GetName() == aNewProjectName )
{
wxString msg;
if( !aErrors.empty() )
aErrors += "\n";
msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
aErrors += msg;
return;
}
// Sheet paths when auto-generated are relative to the root, so those will stay
// pointing to whatever they were pointing at.
@@ -343,7 +356,10 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
ext == KiCadSymbolLibFileExtension )
{
if( destFile.GetName() == aProjectName + wxT( "-cache" ) )
destFile.SetName( aNewProjectName + wxT( "-cache" ) );
destFile.SetName( aNewProjectName + wxT( "-cache" ) );
if( destFile.GetName() == aProjectName + wxT( "-rescue" ) )
destFile.SetName( aNewProjectName + wxT( "-rescue" ) );
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
}
+1 -1
View File
@@ -389,7 +389,7 @@ wxString FIELDS_GRID_TABLE<T>::GetValue( int aRow, int aCol )
if( aRow < m_mandatoryFieldCount )
{
if( m_parentType == SCH_SYMBOL_T )
return TEMPLATE_FIELDNAME::GetDefaultFieldName( aRow );
return TEMPLATE_FIELDNAME::GetDefaultFieldName( aRow, DO_TRANSLATE );
else if( m_parentType == SCH_SHEET_T )
return SCH_SHEET::GetDefaultFieldName( aRow );
}
+14 -9
View File
@@ -4,7 +4,7 @@
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2013 CERN (www.cern.ch)
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -489,7 +489,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
{
DIALOG_MIGRATE_BUSES dlg( this );
dlg.ShowQuasiModal();
RecalculateConnections( NO_CLEANUP );
OnModify();
}
@@ -516,6 +515,8 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
SyncView();
GetScreen()->ClearDrawingState();
TestDanglingEnds();
UpdateHierarchyNavigator();
UpdateTitle();
@@ -624,7 +625,8 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
allWildcards += "*." + formatWildcardExt( plugin->GetFileExtension() ) + ";";
}
fileFilters = _( "All supported formats|" ) + allWildcards + "|" + fileFilters;
fileFilters = _( "All supported formats" ) + wxS( "|" ) + allWildcards + wxS( "|" ) +
fileFilters;
wxFileDialog dlg( this, _( "Import Schematic" ), path, wxEmptyString, fileFilters,
wxFD_OPEN | wxFD_FILE_MUST_EXIST ); // TODO
@@ -1419,12 +1421,17 @@ void SCH_EDIT_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName )
" Auto save file: '%s'" ),
recoveredFn.GetFullPath(), backupFn.GetFullPath(), fn );
// Attempt to back up the last schematic file before overwriting it with the auto
// save file.
if( !wxCopyFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
if( !wxFileExists( fn ) )
{
unrecoveredFiles.Add( recoveredFn.GetFullPath() );
}
// Attempt to back up the last schematic file before overwriting it with the auto
// save file.
else if( !wxCopyFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
{
unrecoveredFiles.Add( recoveredFn.GetFullPath() );
}
// Attempt to replace last saved file with auto save file
else if( !wxRenameFile( fn, recoveredFn.GetFullPath() ) )
{
unrecoveredFiles.Add( recoveredFn.GetFullPath() );
@@ -1452,10 +1459,8 @@ void SCH_EDIT_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName )
{
wxLogTrace( traceAutoSave, wxT( "Removing auto save file " ) + fn );
if( !wxRemoveFile( fn ) )
{
if( wxFileExists( fn ) && !wxRemoveFile( fn ) )
unremovedFiles.Add( fn );
}
}
if( !unremovedFiles.IsEmpty() )
+5 -4
View File
@@ -403,10 +403,11 @@ wxString LIB_FIELD::GetCanonicalName() const
{
switch( m_id )
{
case REFERENCE_FIELD: return wxT( "Reference" );
case VALUE_FIELD: return wxT( "Value" );
case FOOTPRINT_FIELD: return wxT( "Footprint" );
case DATASHEET_FIELD: return wxT( "Datasheet" );
case REFERENCE_FIELD:
case VALUE_FIELD:
case FOOTPRINT_FIELD:
case DATASHEET_FIELD:
return TEMPLATE_FIELDNAME::GetDefaultFieldName( m_id );
}
return m_name;
+1 -1
View File
@@ -85,7 +85,7 @@ public:
void Init( int aId );
/**
* Return the field name.
* Return the field name (not translated).
*
* The first four field IDs are reserved and therefore always return their respective
* names.
+2 -2
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras at wanadoo.fr
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2021 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2022 KiCad Developers, see change_log.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
@@ -49,7 +49,7 @@ void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_IT
if( m_unit == 0 )
msg = _( "All" );
else
msg.Printf( wxT( "%d" ), m_unit );
msg = LIB_SYMBOL::SubReference( m_unit, false );
aList.emplace_back( _( "Unit" ), msg );
+1 -1
View File
@@ -886,7 +886,7 @@ int LIB_PIN::compare( const LIB_ITEM& aOther, int aCompareFlags ) const
if( !( aCompareFlags & COMPARE_FLAGS::UNIT ) && m_number != tmp->m_number )
return m_number.Cmp( tmp->m_number );
int result = m_name.CmpNoCase( tmp->m_name );
int result = m_name.Cmp( tmp->m_name );
if( result )
return result;

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