Compare commits

...

427 Commits

Author SHA1 Message Date
Wayne Stambaugh f9a2dced07 Tag release version 6.0.7. 2022-07-25 18:57:34 -04:00
qu1ck 52157acbfe PCM: fix kicad version restriction logic
The json schema for packages implies that kicad min/max version
restriction takes major.minor.patch string but actual logic
only checks major and minor.

This fixes the logic to work with full major.minor.patch tuple.
Additionally the version max logic will substitute missing portions
with 999 for a reasonable default so that say 7.1 is still considered
as >= 7.1.5 when checking for max version.

Reported here
https://forum.kicad.info/t/updating-already-installed-plugins-using-content-manager/35532/5?u=qu1ck

(cherry picked from commit 06028d5015)
2022-07-18 10:26:27 -07:00
dsa-t 17f220590b OpenGL: Use glGetProgramiv instead of the extension function.
(cherry picked from commit 3a76435eda)
2022-07-18 10:20:04 -07:00
Alex 33027b8f66 OpenGL: Fix SetSwapInterval logic.
- Don't use GLX extension functions unless they are supported on the
connection. GLEW only checks for client library support.

- Don't try to set swap interval using glXSwapIntervalSGI when vsync is
not requested.

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

(cherry picked from commit 0e2d3236b5)
2022-07-18 10:19:36 -07:00
Seth Hillbrand 064a9688c0 Make annotation case-insensitive
U1 and u1 are allowed but if they both exist in the same schematic, they
will throw an ERC and annotation error.  Reannotating will make them U1
and u2.

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

(cherry picked from commit 00c7b64b13)
2022-07-18 09:49:28 -07:00
Seth Hillbrand c1ec63d4f9 Protect the Kiway dereference
Also find a few more places where we are reaching into a new frame to
perform actions that need to have dialogs closed.

Running actions should also wait for the next cycle rather than being
immediately executed when we are calling into a new frame.  This allow
for the cleanup actions onClose() to happen prior to the next action
starting

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

(cherry picked from commit 93fb00d815)
2022-07-18 09:48:50 -07:00
Seth Hillbrand 995b2c517d Catch some crashes on shutdown
These can happen when a tool is active that sends signals when exiting
(e.g. deselectEvent).  These may be caught by the active loop in another
tool which might try to update the UI after it has been freed.  By
marking all tools as "shutdown", the only event returned to them should
be null.  As an extra precaution, we flag the shutdown globally within
the tool manager and check this flag before launching either events or
new tools

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

(cherry picked from commit db4f2d9dd8)
2022-07-18 09:48:16 -07:00
Seth Hillbrand a8c0bc0430 Keep track of blocking windows
Allows the calling KiWAY player to send messages to the blocking window
before signaling a separate call

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

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

(cherry picked from commit b5bf1da251)
2022-07-18 09:47:32 -07:00
Seth Hillbrand 902629c139 Fix name escaping in symbol editor
When renaming a symbol, be sure to handle name escaping in all of the
various places that we do renaming (!)

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

(cherry picked from commit 0dab566270)
2022-07-18 09:46:57 -07:00
Seth Hillbrand 63e638cfab Enforce group selection to abide by L/R behavior
When selecting greedy (right to left), selecting any part of the group
will get the whole group.  When selecting left to right, we must select
all items in the group to get the grouped items unless we are in the
group itself

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

(cherry picked from commit e87ba10a5a)
2022-07-18 09:45:10 -07:00
Seth Hillbrand 48b520a098 Update Translations 2022-07-18 09:39:03 -07:00
Tokita, Hiroshi b55352da7e 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-18 18:31:51 +02:00
dsa-t cd41a42775 Translated using Weblate (Russian)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-07-18 18:31:51 +02:00
김랑기 6f82cec3a4 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-18 18:31:51 +02:00
jeongsuAn 2f9cd25850 Translated using Weblate (Korean)
Currently translated at 99.9% (7150 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-18 18:31:51 +02:00
Seth Hillbrand 865bb54591 Flag ERC error on non-stacked pins
Pins that are explicitly connected in the schematic should not have an
"unconnected pin" ERC error.  But stacked pins do not count as
explicitly connected because the schematic designer has not connected
them
2022-07-17 20:16:55 -07:00
Alex 6d26e8e3e8 math: Use intrinsic functions for 64-bit rescale on MSVC.
(cherry picked from commit c107abe247)
2022-07-16 18:05:35 +00:00
jean-pierre charras 9c50a9fa4a FP_SHAPE in pads: always specify fill mode for shapes that can be filled or not.
From Master branch
2022-07-15 17:42:31 +02:00
이기형 406dd58002 Translated using Weblate (Korean)
Currently translated at 99.9% (7150 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-13 15:29:26 +02:00
이상수 bd7ba5f6b1 Translated using Weblate (Korean)
Currently translated at 99.9% (7149 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-13 15:29:26 +02:00
박세훈 d174cff9ae Translated using Weblate (Korean)
Currently translated at 99.8% (7147 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-13 15:29:26 +02:00
gurqja3810 bbce24ab32 Translated using Weblate (Korean)
Currently translated at 99.8% (7147 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-13 15:29:26 +02:00
박세훈 ad2c5b40ff Translated using Weblate (Korean)
Currently translated at 99.8% (7146 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-13 15:29:25 +02:00
Tokita, Hiroshi 8e0784d4fa 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-13 15:29:25 +02:00
jean-pierre charras 926818097b Fix compatibility issues with wxWidgets 3.2 and gcc 12.1:
hastable.h: remove deprecated binary/unary base class not actually needed.
Fix  compil warnings.
From master branch.
2022-07-12 18:24:12 +02:00
jean-pierre charras fd65bd8e6e Rework on bitmap_info.cpp cmake build process.
on gcc 12.1 / msys2 the large initialized list in bitmap_info.cpp breaks the
compiler (perhaps a bug in the compiler).
So, as workaround, the initialization sequence is modified.
Form master branch
2022-07-12 17:34:25 +02:00
jean-pierre charras d53c6f8abe Eeschema, DIALOG_SCH_FIND: ensure the search flags actually used are up to date.
Flags are encoded using internal wx values, that can change with wxWidgets versions.
They need to be always rebuilt from the displayed options in dialog.
From master branch.
2022-07-12 08:36:15 +02:00
Jon Evans 2512375988 PNS: Fix IsLineCorner logic
Handle segment width test in the case of locked segs
Fix logic failure where vias on path cause crash

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11990
2022-07-11 22:47:28 -04:00
Wayne Stambaugh 4b4d082fa4 Pcbnew: fix minor white space issue in board file.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11669

(cherry picked from commit 6a74ecbffd)
2022-07-11 11:25:02 -04:00
Seth Hillbrand 374dfdbe16 Update Translations 2022-07-08 08:59:32 -07:00
co8 j 3c476157c1 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-08 17:57:36 +02:00
Marcel Hecko 3af058a281 Translated using Weblate (Slovak)
Currently translated at 77.0% (5513 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sk/
2022-07-08 17:57:36 +02:00
leonardokr 8a1e400d81 Translated using Weblate (Portuguese)
Currently translated at 99.5% (7122 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt/
2022-07-08 17:57:36 +02:00
Eric fb4fa9ae41 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-07-08 17:57:35 +02:00
Mustafa Selçuk ÇAVDAR ede0ab5b79 Translated using Weblate (Turkish)
Currently translated at 43.9% (3147 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/tr/
2022-07-08 17:57:35 +02:00
Henrik Kauhanen 2723898ff4 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-08 17:57:35 +02:00
dsa-t b470d9ed8a Translated using Weblate (Russian)
Currently translated at 99.9% (7151 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-07-08 17:57:35 +02:00
Wellington Terumi Uemura f0446aab90 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-07-08 17:57:35 +02:00
ZbeeGin be3ee24826 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-08 17:57:35 +02:00
김랑기 68a1f9e512 Translated using Weblate (Korean)
Currently translated at 99.8% (7145 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-07-08 17:57:35 +02:00
co8 j bf90966901 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-08 17:57:35 +02:00
Toni Laiho 7a5e9cce6d 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-08 17:57:35 +02:00
Ulices 3f7da644eb Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-07-08 17:57:35 +02:00
Jonathan Haas e424dbea2d Translated using Weblate (German)
Currently translated at 100.0% (7155 of 7155 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-07-08 17:57:34 +02:00
Seth Hillbrand 4d1fcff732 Fix compile error in v6 2022-07-07 12:19:38 -07:00
Seth Hillbrand dac08643c3 Update Altium SCH QA with rounding factors 2022-07-07 12:03:18 -07:00
Seth Hillbrand 95fcf53353 Handle basic rounding error in schematic import
The fractional part of Altium schematic units is an integer number of
1/10000 mil segments, which is 2.54 nm.  The internal unit of eeschema
is 10 nm, so each fractional unit in Altium is 0.254 base eeschema
units.  To be consistent with
https://gitlab.com/kicad/code/kicad/-/commit/cf33cfcad1ce01d866548c4ef87a1125141d427b
we round to the nearest 10nm for each element

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

(cherry picked from commit 6fef054c51)
2022-07-07 11:14:25 -07:00
Marek Roszko 7dc6abd533 Add 3.2 as search candidates for wxwidgets
(cherry picked from commit c12a723d41)
2022-07-07 11:45:44 +00:00
Jeff Young 042b49ee7b Update message panel from PCB point editor and SCH drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/11961

(cherry picked from commit 4f62960334)
2022-07-06 19:48:09 -07:00
Seth Hillbrand 6a1dfd6e32 Overplot schematic symbol fields and pins
In the absence of z-ordering, we need to ensure that pin text and symbol
fields are always visible in plots as they are in the schematic window.
We do this by overplotting the fields/pins when symbols overlap each
other.

This can be removed if/when we implement https://gitlab.com/kicad/code/kicad/-/issues/2211

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

(cherry picked from commit ff54b8c718)
2022-07-05 16:47:07 -07:00
Wayne Stambaugh b2855e6288 Fix KiCad2Step virtual keyword handling.
The "virtual" keyword has been deprecated from the board file format so
use "exclude_from_bom" as the flag for the old virtual behavior.  This
is only a partial fix.  Full support for the "exclude_from_bom" will be
added later for V7.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10563
(cherry picked from commit 497061de35)
2022-07-05 09:30:59 -04:00
jean-pierre charras 86f9f169cd Pcbnew, printing in B&W: never draw the background color.
Otherwise a black background is printed.
Fixes #11625
https://gitlab.com/kicad/code/kicad/issues/11625
2022-07-04 12:03:17 +02:00
Seth Hillbrand 9052b063de Remove duplicate strid 2022-06-30 13:24:48 -07:00
Seth Hillbrand 1a6be90c4f Update Translations 2022-06-30 11:25:11 -07:00
Seth Hillbrand 55de16e874 Remove extraneous files added in 69858ab4c0
Files were master-only
2022-06-30 11:09:03 -07:00
Seth Hillbrand ef2bb0b621 Avoid documentation in dialogs
If the nomenclature is unclear, we should rework the dialog rather than
adding documentation strings to a crowded dialog.

This also prevents new strings from appearing in v6

(cherry picked from commit 0c796697b4)
2022-06-30 10:58:13 -07:00
Mark Hämmerling 09d4543071 Translated using Weblate (German)
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-06-30 19:44:04 +02:00
Allan Nordhøy 7ef63f0159 Translated using Weblate (Norwegian Bokmål)
Currently translated at 73.1% (5235 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/nb_NO/
2022-06-30 19:44:04 +02:00
Toni Laiho d0e34bf013 Translated using Weblate (Finnish)
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-06-30 19:44:04 +02:00
Mark Hämmerling 46a17ff272 Translated using Weblate (German)
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-06-30 19:44:04 +02:00
Eric 51cc4b8811 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-06-30 19:44:04 +02:00
Wellington Terumi Uemura 5634dfa6ed Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-06-30 19:44:04 +02:00
co8 j 5a8d56f3db Translated using Weblate (Japanese)
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-06-30 19:44:04 +02:00
Ulices 0c5ea8565d 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-06-30 19:44:04 +02:00
Mark Hämmerling 1431bd1143 Translated using Weblate (German)
Currently translated at 100.0% (7156 of 7156 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-06-30 19:44:03 +02:00
Seth Hillbrand 7a3a7d1af6 Python add param to change UUIDs on fp load
By default, we load all footprints with a new UUID set to allow them to
be added to the board as unique objects.  But when editing footprints,
we want to maintain the same UUID.

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

(cherry picked from commit 802745398a)
2022-06-29 12:10:51 -07:00
Mike Williams 761ddcad21 Schematic: Add shift-space hotkey for consistency with PCB editor
Already in 7.0/master.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10858
2022-06-29 12:54:18 +00:00
Seth Hillbrand 8aabdcff9c Refresh draw objects when common settings change
Common settings may change colors so make sure that we refresh the draw
objects when the settings change to draw them in the proper colors.
Failing to do this may also cause left over lines on the screen
depending on OpenGL drivers

Fixes https://gitlab.com/kicad/code/kicad/issues/11921
2022-06-28 16:45:55 -07:00
Adam Wahab 29d58ae063 Corrected syntax in kicad2step's help message regarding user-specified origin.
(cherry picked from commit 8456d6cea9)
2022-06-28 16:24:44 -07:00
Seth Hillbrand 90ef84b958 Fix ERC error missing on stacked pins
Stacked pins are not connected, so they should be flagged as such.  This
checks for stacked pins that are not part of different symbols

Fixes https://gitlab.com/kicad/code/kicad/issues/11926
2022-06-28 15:03:52 -07:00
Seth Hillbrand 9cebea5f11 Correct SWIG call for board design settings
Use the backend call rather than rely on the naming of internal
variables

Fixes https://gitlab.com/kicad/code/kicad/issues/11924
2022-06-28 14:02:56 -07:00
Wayne Stambaugh b7b955e37b Eeschema: fix project rescue bug.
When a rescue library already existed, the disabled writing of legacy
symbol library table entries prevented the rescue library from being
updated.

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

(cherry picked from commit 4e7b5b9784)
2022-06-28 16:14:47 -04:00
Mark Roszko 87d4249d9f Match vcpkg baseline of master 2022-06-25 13:22:44 +00:00
Mark Roszko 8bf5240d60 Fix windows build 2022-06-25 13:21:54 +00:00
jean-pierre charras 20bebeb543 Gen Drill map: Re-add Gerber option but only using X2 format.
Only the X2 format allows the TF.FileFunction option, mandatory to
avoid mistakes about this file that is not a standard Gerber file.
2022-06-23 14:20:32 +02:00
jean-pierre charras 1f4b288664 gen drill maps: remove unusable format (HPGL and GERBER) for map files.
Especially, on a regular basis, map files in gerber format create problems
for board house.
From Master branch.
2022-06-22 11:29:27 +02:00
Seth Hillbrand 5cf346c233 Unify symbol browser/editor unit display
Fixes https://gitlab.com/kicad/code/kicad/issues/11881

(cherry picked from commit aeef5b00a8)
2022-06-21 16:23:27 -07:00
Seth Hillbrand 617755f991 Treat all units equally when converting to string
Excessive trucation in mils can lead to data loss when round-tripping
values.  Better to keep decimal count consistent between units

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

(cherry picked from commit 67d9729311)
2022-06-21 15:30:24 -07:00
Seth Hillbrand 45329ceafa Push wxString allocation to smaller context
Prevents creation of new wxString on stack for each clearance check

(cherry picked from commit 4043dca613)
2022-06-21 10:30:42 -07:00
Seth Hillbrand 69858ab4c0 Remove shared wxString instance in DRC
Threaded DRC access will write to this string, re-allocating the memory
without any synchronization between threads using the string.  Comment
adding this listed performance as a reason for using shared strings.
Measured performance does not seem noticeably different in either case,
even with high-error count boards.  If there is a case where the
performance is limiting, we can replace these wxStrings with
std::wstring and utilize fmt

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

(cherry picked from commit 5327b10064)
2022-06-21 10:27:21 -07:00
Seth Hillbrand c53a1e00f6 Fix one missing commit for MSVC
(cherry picked from commit 8f1b2acdc6)
2022-06-21 10:08:02 -07:00
Seth Hillbrand 178a36fc66 Patch pybind11 for MSVC
Re-comit of earlier ef38642bf1 after updating pybind11 to 2.9.2

(cherry picked from commit c483c58276)
2022-06-21 10:08:02 -07:00
Seth Hillbrand 8ce38d3820 Update pybind11 to 2.9.2
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10729

(cherry picked from commit 8d003804e0)
2022-06-21 10:08:02 -07:00
Mark Roszko e0802dcd26 Walk vcpkg config forwards for wx 3.1.7 2022-06-20 03:21:18 +00:00
Wayne Stambaugh c8a1c5c707 Begin version 6.0.7 development. 2022-06-17 21:13:23 -04:00
Wayne Stambaugh 59091ec263 Tag release version 6.0.6. 2022-06-17 21:11:16 -04:00
jean-pierre charras 92fbc42214 PANEL_SYM_LIB_TABLE: fix a bug in filenames from wxFileDialog dialog.
We want the full path, so use GetPaths.
GetFilenames sometimes return the full path in wxWidgets 3.1.7, not always the filename
Fixes #11821
https://gitlab.com/kicad/code/kicad/issues/11821
2022-06-16 13:06:19 +02:00
Jeff Young 00226cb0f2 Make sure Type regex doesn't match before Pad_Type or Pin_Type.
Fixes https://gitlab.com/kicad/code/kicad/issues/11423

(cherry picked from commit 7cb7a68b0e)
2022-06-13 10:59:33 -07:00
Seth Hillbrand 7128f6adf0 Prevent focus stealing in some Linux WMs
OnEnter events will only raise the windows within KiCad rather than
between applications

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

(cherry picked from commit 110728af48)
2022-06-13 10:18:13 -07:00
Jeff Young 38a7cb9731 Write out partial pad-stacks for blind/buried/microvias.
Fixes https://gitlab.com/kicad/code/kicad/issues/11692

(cherry picked from commit 80124d2463)
2022-06-13 10:11:58 -07:00
Seth Hillbrand b6e7bf4768 Handle updated document description format
parentheses are rarely if ever used independently, so trim the unmatched
ones regardless of whether we find the starting parenthesis in the
description

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

(cherry picked from commit be7e9d300e)
2022-06-13 10:02:26 -07:00
Seth Hillbrand d600fd3498 Update Translations 2022-06-13 10:00:04 -07:00
Jan Straka 48bad152bb Translated using Weblate (Czech)
Currently translated at 92.4% (6670 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-06-13 18:56:16 +02:00
Jakub Janek da80c6796d Translated using Weblate (Slovak)
Currently translated at 75.2% (5430 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sk/
2022-06-13 18:56:16 +02:00
co8 j 48d347ce45 Translated using Weblate (Japanese)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-06-13 18:56:16 +02:00
Mark Hämmerling 76139ac110 Translated using Weblate (German)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-06-13 18:56:16 +02:00
Ivan Chuba 1d65480097 Translated using Weblate (Russian)
Currently translated at 99.9% (7210 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-06-13 18:56:15 +02:00
Henrik Kauhanen 338b7e4c78 Translated using Weblate (Swedish)
Currently translated at 99.8% (7200 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-06-13 18:56:15 +02:00
Ivan Chuba 5b64231b33 Translated using Weblate (Russian)
Currently translated at 99.9% (7210 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-06-13 18:56:15 +02:00
Henrik Kauhanen cdaf829404 Translated using Weblate (Swedish)
Currently translated at 99.8% (7200 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-06-13 18:56:15 +02:00
Jan Straka e920cdf809 Translated using Weblate (Czech)
Currently translated at 92.2% (6655 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-06-13 18:56:15 +02:00
Ivan Chuba 28ad719db6 Translated using Weblate (Polish)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-06-13 18:56:15 +02:00
Ivan Chuba 83b5c5bf7f Translated using Weblate (German)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-06-13 18:56:15 +02:00
Mark Hämmerling f76678d20c Translated using Weblate (German)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-06-13 18:56:15 +02:00
Ivan Chuba 9b46ed2449 Translated using Weblate (Russian)
Currently translated at 99.9% (7210 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-06-13 18:56:15 +02:00
Mark Hämmerling 70ab4c8e8d Translated using Weblate (German)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-06-13 18:56:15 +02:00
jean-pierre charras 24d049c017 Fix bounding box of text in footprint not properly rotated in 6.0.5 stable version
It is fixed in Master branch, so apply a fix similar to b6e8beb3 from master
Fixes #8728
https://gitlab.com/kicad/code/kicad/issues/8728
2022-06-13 16:46:40 +02:00
Jeff Young 54c68080f5 Nullptr defensive code.
Fixes https://gitlab.com/kicad/code/kicad/issues/11690

(cherry picked from commit 9b70308f5c)
2022-06-12 10:43:30 +01:00
Jeff Young 16d63b7772 Handle alt pins in plot code.
Fixes https://gitlab.com/kicad/code/kicad/issues/11728

(cherry picked from commit e4798199c6)
2022-06-12 10:39:31 +01:00
Jeff Young 797cb2aaac Typo.
LIB_SYMBOL's value field is the name; SCH_SYMBOL's value field is not.

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

(cherry picked from commit d381fd8b29)
2022-06-12 10:39:31 +01:00
Mark Roszko 2044fe591d Declare the ngspice version in vcpkg.json 2022-06-12 03:43:45 +00:00
Mark Roszko d5baea21cd Update kicad-vcpkg registry baseline for ngspice 2022-06-12 02:26:38 +00:00
Tomasz Wlostowski b59c334edb router: another attempt at improving 'kink' robustness of the hull generator
(cherry picked from commit f5fe1d5462)
2022-06-10 09:17:07 -04:00
Alex bb8719b9d5 3D viewer: Fix GL_INVALID_ENUM error.
(cherry picked from commit 58f9b82c1e)
2022-06-09 11:36:11 -07:00
Seth Hillbrand 817c4645eb Sort PCAD layers
Better fix for 11750.  Instead of figeting with layer values, we sort
our map based on the layer numbers in the PCAD file.  F_Cu is always
layer 1 and B_Cu is always layer 2.

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

(cherry picked from commit ac0f95683f)
2022-06-09 11:11:15 -07:00
Marco Ciampa f1462e9fd6 Updated Italian translation 2022-06-09 19:42:08 +02:00
Seth Hillbrand 32aabaf010 Handle B_Cu ordering
Stopgap until we introduce multi-layer mapping widget

Fixes https://gitlab.com/kicad/code/kicad/issues/11750
2022-06-08 17:17:26 -07:00
Seth Hillbrand 72b7f9fe10 Check for older tags in pcad import
The pourOutline/planeOutline do not include support for fillets

Fixes https://gitlab.com/kicad/code/kicad/issues/11749
2022-06-08 16:17:40 -07:00
Tomasz Wlostowski 4d5b5d3791 router: fix SegmentHull() corner case when it 'chamfers' more than the clearance permits (corner case for 0-length segments, which we use
for representing holes)


(cherry picked from commit 56df462474)
2022-06-08 22:39:22 +00:00
Tomasz Wlostowski 4694a2622e router: use either copper or hole clearance, whichever is larger, when checking track -> hole collisions
(cherry picked from commit 990281a897)
2022-06-08 22:39:08 +00:00
Tomasz Wlostowski 92ba60628e router: improvements in robustness of SegmentHull()
- ensure the 'chamfer' radius and clearance is rounded before computing the actual hull vertices
- for small, non-45 degree line segments (present in many boards), generate a slightly larger but still axis-aligned 45 degree hull instead of following exactly the segment direction


(cherry picked from commit bcfe12ce47)
2022-06-08 16:14:03 +00:00
Tomasz Wlostowski 2be352b9f9 geometry: more robust colinearity test in SHAPE_LINE_CHAIN::Simplify()
We now test the midpoint (B) of the 3 consecutive polyline points (A, B, C), since (assuming the angle between AB and BC is > 90 degrees) AC is always longer than
AB or BC. This minimizes the distance computation rounding error (in the previous algorithm, taking the point C for colineraity test) if AB is short and BC is very long, the test would
often fail due to rouding error in projection/line distance computation


(cherry picked from commit 3aed13278d)
2022-06-08 16:13:15 +00:00
Tomasz Wlostowski 8afb8190af geometry: use dedicated 64-bit integer square root for distance computations
Guarantees 1 LSB error, while the C++ double type has 55 mantissa bits (meaning for sqrt(X) >~ 2^22.5) the error is not guaranteed.


(cherry picked from commit e6ebc2b9b9)
2022-06-08 16:12:59 +00:00
Jeff Young 275afdc1d5 Expose footprint ID, description and keywords to property system.
(cherry picked from commit dee22a31d9)
2022-06-08 15:58:53 +01:00
Jeff Young 3a8ad7165b Clear point editor before recombining pad.
Fixes https://gitlab.com/kicad/code/kicad/issues/11731

(cherry picked from commit bd51b33f65)
2022-06-08 15:58:52 +01:00
Jeff Young bbe70e2f67 Repair Eagle importer page number handling.
The root sheet needs a page number, and the other sheets need to not
have their last step in the path duplicated.

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

(cherry picked from commit aaff163d7c)
2022-06-08 15:58:52 +01:00
Jeff Young 4a5f74422c Take pad angle into account when generating spokes.
Fixes https://gitlab.com/kicad/code/kicad/issues/11765
2022-06-08 15:46:56 +01:00
Jon Evans 7053981835 Don't wipe out visibility state when changing layer count 2022-06-07 23:00:32 -04:00
Jon Evans 895314b639 PNS: Fixup hole clearance to use exact hulls for walkaround
(partially cherry picked from commit 30fb298ed3)
2022-06-07 22:34:16 -04:00
Jon Evans 6253b878a0 PNS: Implement HoleHull for VIA
(cherry picked from commit 23596812b6)
2022-06-08 02:05:25 +00:00
Marco Ciampa 5855a9ed89 Updated Italian translation 2022-06-06 19:11:54 +02:00
Wayne Stambaugh c861c31f24 Eeschema: fix symbol library remap bug.
The original decision to escape the legacy symbol library names results
in them being escaped every time they are opened which cause the curly
braces '}' from the original escaping to be escaped on subsequent
openings.  This resulted in the symbol library names in the rescue
library not matching the library ID in the schematic.

This fix is likely to have other corner case bugs given the potential
for escaped characters in legacy symbol libraries.  Given that we now
have escaped rescue libraries in play, removing the escaping will only
result in more issues so we will have to fix the corner cases as we go.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11563
2022-06-05 18:12:39 -04:00
jean-pierre charras 87d55402e4 Pcbnew, physical layer names: never translate them (they are proper noun)
physical layer names are not translated in files, but they were translated
in UI. Using these translated names can create issues and misunderstanding for users.
Now physical layer names are seen as proper nouns and are never translated.
Fixes #11715
https://gitlab.com/kicad/code/kicad/issues/11715
2022-06-04 11:07:49 +02:00
jean-pierre charras 7168441a1b Symbol checker: fix incorrect test for duplicate pins.
From master branch
https://gitlab.com/kicad/code/kicad/issues/11660
2022-06-04 11:07:13 +02:00
Jon Evans 5d4e2aa595 PNS: Remove offsets from hull generation
This is likely an old workaround to numerical precision issues
in the DRC system that no longer exist.  Removing this is necessary
for "exact" hull generation to produce walkaround results that
look nice (paths falling exactly on the grid lines)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10710
2022-06-03 17:39:22 -04:00
Jon Evans 2a91ba35c1 PNS: Use exact hulls for walkaround path generation
When we generate hulls, by default we subtract the clearance epsilon
to prevent false collisions in the router that wouldn't be flagged
by DRC.  However, we need to use the actual hull with no epsilon
when generating hulls for pathfinding in the walkaround system.

Without this change, it is possible for the walkaround to generate
a valid-seeming path that results in a DRC violation, for example
when dragging a drag against a board edge.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10536
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11365
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10710
2022-06-03 17:39:22 -04:00
Roberto Fernandez Bautista 2553da38b4 CADSTAR Schematic: Fix parsing of ATTRCOLORS.
Apparently there can be a `INVISIBLE` token. Unclear what it means,
but lets read it anyway


(cherry picked from commit 41bf397d24)
2022-06-03 21:21:15 +00:00
Jon Evans 8d8f96b094 PNS: Fix off-by-one in dragCornerInternal
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10919
2022-06-01 17:11:03 -04:00
Jon Evans eb1164fc93 UNIT_BINDER should support long long ints
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10870
2022-05-31 21:50:52 -04:00
Jon Evans a4aa447b95 [PNS] Fix invalid assumption in IsLineCorner 2022-05-31 20:19:20 -04:00
Jon Evans 53dbd3bb02 PNS: Fix skew calculation with pad-to-die specified
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11710
2022-05-31 20:19:19 -04:00
Jeff Young 781e98acbc Eagle octagonal pads are regular (~29% chamfered).
Also cleans up setting of KeepTopBottom (which is ignored unless
we're doing optional flahing -- which we're not for Eagle imports).

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

(cherry picked from commit 4afca58ce7)
2022-05-31 23:21:43 +01:00
Jeff Young ab70124b68 Make use of board stackup data when exporting VRML.
Specifically layer colors and board thickness.

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

(cherry picked from commit deeb7d4d6d)
2022-05-31 23:21:43 +01:00
Jeff Young c117708220 Unset forced cursor before leaving two-click place.
Fixes https://gitlab.com/kicad/code/kicad/issues/11607

(cherry picked from commit 79a0ce9137)
2022-05-31 23:21:43 +01:00
Jeff Young 68d9b3cbf7 Add board stackup parsing to Kicad2Step.
Fixes https://gitlab.com/kicad/code/kicad/issues/11565

(cherry picked from commit e85105a907)
2022-05-31 23:21:43 +01:00
Jeff Young aac4f30b7d Fix zone merge intersection algorithm.
Fixes https://gitlab.com/kicad/code/kicad/issues/11492

(cherry picked from commit 5f10c15a87)
2022-05-31 23:21:43 +01:00
Seth Hillbrand a2e9c0ea73 Text BB is already rotated, don't re-do
EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon already accounts
for text rotation, so we don't need to apply that twice

Fixes https://gitlab.com/kicad/code/kicad/issues/11714
2022-05-31 13:46:16 -07:00
Seth Hillbrand 0f4eefc9fc Fix PCAD silk layer for solder-side fp
The layer should be flipped based on the footprint mirror value rather
than the text mirror value (which is independent)

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

(cherry picked from commit 6c0856c384)
2022-05-31 13:03:53 -07:00
Seth Hillbrand 19d9dcdd2a Update Translations 2022-05-31 10:30:31 -07:00
co8 j 38c68b008c Translated using Weblate (Japanese)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-31 19:29:54 +02:00
ZbeeGin 8f2060a3f6 Translated using Weblate (Polish)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-05-31 19:29:54 +02:00
Toni Laiho 837dba2419 Translated using Weblate (Finnish)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-05-31 19:29:54 +02:00
Seth Hillbrand 2d092437f4 Make PCAD import case-insensitive
According to the PCAD specification, all tags are case insensitive.
Most exporters honor the defaults but there is always an outlier or two

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

(cherry picked from commit 35b79c2ec9)
2022-05-27 10:10:47 -07:00
Marco Ciampa c38da73151 Fixed typo in Italian translation 2022-05-27 13:43:58 +02:00
Seth Hillbrand 37c5885946 Fix missing assignment
(cherry picked from commit 77cd56fbd3)
2022-05-26 08:20:42 -07:00
Seth Hillbrand 2c2f69d05c Initialize area check
Ensure that the max_poly set is zero before using

(cherry picked from commit 2a9d7314ca)
2022-05-26 08:20:15 -07:00
Seth Hillbrand 592c2c6872 Handle settings sequencing
Avoids crash when window close ordering places 3d viewer after the
common settings are closed

(cherry picked from commit c0a9a02591)
2022-05-25 16:58:10 -07:00
Alex 6b2bb4d808 Allow sheet recursion, fix sheet paths in "Highlight on PCB".
"Highlight on PCB" and "Select" - "Items in Same Hierarchical Sheet"
actions were extended to select items on subsheets too.

"Highlight on PCB" now uses a proper full sheet path, allowing it to
work in subsheets.

Fixes https://gitlab.com/kicad/code/kicad/issues/11493
2022-05-25 23:38:52 +00:00
Seth Hillbrand 8cd289cf69 Update Translations 2022-05-25 16:22:31 -07:00
Toni Laiho 30d07ac556 Translated using Weblate (Finnish)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-05-26 01:21:34 +02:00
Jan Straka 39f5c04821 Translated using Weblate (Czech)
Currently translated at 92.1% (6644 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-05-26 01:21:34 +02:00
Mark Hämmerling 161c7a38bc Translated using Weblate (German)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-05-26 01:21:34 +02:00
Arnau Llovet Vidal a95360154d Translated using Weblate (Catalan)
Currently translated at 65.8% (4752 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-05-26 01:21:34 +02:00
VicSanRoPe 5f072eb7d5 Translated using Weblate (Spanish)
Currently translated at 99.6% (7190 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es/
2022-05-26 01:21:34 +02:00
Toni Laiho 1febd61583 Translated using Weblate (Finnish)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-05-26 01:21:34 +02:00
VicSanRoPe 0d8c066e05 Translated using Weblate (Spanish)
Currently translated at 99.5% (7183 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es/
2022-05-26 01:21:34 +02:00
Mark Hämmerling 6e6d88ec2e Translated using Weblate (German)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-05-26 01:21:34 +02:00
Arnau Llovet Vidal 9db7a7f6f7 Translated using Weblate (Catalan)
Currently translated at 65.8% (4750 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-05-26 01:21:33 +02:00
Tokita, Hiroshi 16d1a80f6e Translated using Weblate (Japanese)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-26 01:21:33 +02:00
Alex Gellen b8ea9c59db Translated using Weblate (Romanian)
Currently translated at 38.1% (2755 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ro/
2022-05-26 01:21:33 +02:00
VicSanRoPe 962ccab3ed Translated using Weblate (Spanish)
Currently translated at 99.4% (7174 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es/
2022-05-26 01:21:33 +02:00
Seth Hillbrand 1fe956c069 Handle hand-drawn holes in unfracture
We can't know that all holes will be ccw when entering unfracture.
Instead, we set the largest polyline to be the outline and the others to
be the holes.
2022-05-25 13:19:07 -07:00
Marco Ciampa d9db4f7bfd Updated Italian translation 2022-05-18 17:02:25 +02:00
Seth Hillbrand 0d93be0af2 Make sure that we have a visible layer
Before setting the active layer to our visible sequence, make sure that
the sequence is not empty (leads to invalid layer id->crash)

Fixes https://gitlab.com/kicad/code/kicad/issues/11629
2022-05-16 15:24:22 -07:00
jean-pierre charras bda1f684fc gerber_placefile_writer: fix angle rotation for flipped footprints.
According to latest Gerber documents (rev 2022.02), the previous angle was
missing a +180 rotation
Fixes #11621
https://gitlab.com/kicad/code/kicad/issues/11621
2022-05-16 10:27:17 +02:00
Jonathan Haas 7fdfd77422 Change default value of MatchByReference to false.
Fixes https://gitlab.com/kicad/code/kicad/issues/11382


(cherry picked from commit 5802ede3fd)
2022-05-14 12:44:14 +00:00
Seth Hillbrand 49ba218264 Update Translations 2022-05-13 15:05:21 -07:00
ZbeeGin f117f14b58 Translated using Weblate (Polish)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-05-14 00:03:10 +02:00
Eric c143e49d94 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-05-14 00:03:10 +02:00
Henrik Kauhanen 627255f464 Translated using Weblate (Swedish)
Currently translated at 99.8% (7200 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-05-14 00:03:10 +02:00
Wellington Terumi Uemura ba90ef6c5f Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-05-14 00:03:10 +02:00
co8 j 6a65f918f1 Translated using Weblate (Japanese)
Currently translated at 99.9% (7212 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-14 00:03:10 +02:00
Toni Laiho ef419fee0a Translated using Weblate (Finnish)
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-05-14 00:03:09 +02:00
Ulices c399b87fce Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7213 of 7213 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-05-14 00:03:09 +02:00
Toni Laiho 20dffba10f Translated using Weblate (Finnish)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-05-14 00:03:09 +02:00
jean-pierre charras c07ac8b3db Gerbview: seriously speed up the calculation time to draw polygons on OpenGL.
Mainly CacheTriangulation() was creating triangles using partition mode.
But this mode is optimized for Pcbnew and Gerbview and different internal units.
Now CacheTriangulation() is used in no partition, much faster in GERBVIEW_PAINTER.
From Master branch
2022-05-13 18:33:53 +02:00
jean-pierre charras f25d74628b Plot pad outlines on Fab files: fix many issues. Depending on
plotter type and pad type, the plotted shapes were not always the outlines,
but a outline inside the pad shape (due to legacy reasons). In many cases the
plotted shape was in fact incorrect. Now the actual pads outlines are plotted
without modification.
From Master branch
2022-05-13 14:25:02 +02:00
Marek Roszko ebb3e04718 Update Fedora-Linux-CI.yml to match master 2022-05-12 23:44:22 -04:00
Seth Hillbrand d971cbefcb Resolve title variable when plotting
Be sure to use variable name if it exists when plotting the file

Fixes https://gitlab.com/kicad/code/kicad/issues/11608
2022-05-12 15:30:45 -07:00
Seth Hillbrand e317818076 Remove debugging cout 2022-05-12 15:30:45 -07:00
Mark Roszko f89d5f9949 Pointsvcpkg to wx 3.1.6 2022-05-11 22:55:18 +00:00
Marek Roszko d45ce2f659 Suppress wx3.1.6 assert because it wants the window handle for dpi
(cherry picked from commit ccf235a8c3)
2022-05-11 22:53:02 +00:00
Seth Hillbrand 09a2d50e09 Enable/Disable the apply/discard buttons
When there are no pending actions, we should not show the user the
ability to apply/discard the pending actions.  This uses wxUpdateUI in
the correct manner, limiting it to only the elements being updated and
using the event actions to ensure we don't have a cascade

Fixes https://gitlab.com/kicad/code/kicad/issues/10761
2022-05-11 13:50:01 -07:00
Seth Hillbrand d9ec998ff0 Don't wait after installing from ZIP
The extraction process completes prior to the call to KeepRefreshing(),
so we should only let it update once and close

Fixes https://gitlab.com/kicad/code/kicad/issues/11601
2022-05-11 11:42:20 -07:00
Marek Roszko 7563f51212 Fix eda_doc not looking for schematic locally
It looks like this was overlooked by Jeff in 2020 not realizing eda_doc isn't built under eeschema but common in cc9ac37a0e


(cherry picked from commit f85251ef75)
2022-05-11 03:33:40 +00:00
Seth Hillbrand 1101eb9f94 Update Translations 2022-05-10 12:12:56 -07:00
Henrik Kauhanen 5a8845ad22 Translated using Weblate (Swedish)
Currently translated at 99.7% (7196 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-05-10 20:51:24 +02:00
Eric 897ac863fc Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-05-10 20:51:24 +02:00
Alex Gellen f4080741b3 Translated using Weblate (Romanian)
Currently translated at 37.5% (2706 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ro/
2022-05-10 20:51:24 +02:00
Wellington Terumi Uemura c1018b1ff3 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-05-10 20:51:24 +02:00
co8 j e40f8f3a49 Translated using Weblate (Japanese)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-10 20:51:23 +02:00
Tokita, Hiroshi 4bfcc42c10 Translated using Weblate (Japanese)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-10 20:51:23 +02:00
Toni Laiho 1e5d93b54f Translated using Weblate (Finnish)
Currently translated at 99.9% (7210 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-05-10 20:51:23 +02:00
Mark Hämmerling 75eb2b96d8 Translated using Weblate (German)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-05-10 20:51:23 +02:00
co8 j 7a6f6d3fe9 Translated using Weblate (Japanese)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-10 20:51:23 +02:00
Tokita, Hiroshi 117afb068f Translated using Weblate (Japanese)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-10 20:51:23 +02:00
co8 j bf61dfa008 Translated using Weblate (Japanese)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-10 20:51:23 +02:00
Tokita, Hiroshi a2b197ad0e Translated using Weblate (Japanese)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-10 20:51:23 +02:00
co8 j 7be6d780c2 Translated using Weblate (Japanese)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-10 20:51:23 +02:00
Wellington Terumi Uemura fb6d9d7f74 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-05-10 20:51:23 +02:00
co8 j be87e71d53 Translated using Weblate (Japanese)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-05-10 20:51:22 +02:00
Jan Straka 8612010979 Translated using Weblate (Czech)
Currently translated at 92.1% (6642 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-05-10 20:51:22 +02:00
Ulices b860dcb676 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-05-10 20:51:22 +02:00
Henrik Kauhanen eb676233fd Translated using Weblate (Swedish)
Currently translated at 99.7% (7196 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-05-10 20:51:22 +02:00
Wellington Terumi Uemura edacc3fbf1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-05-10 20:51:22 +02:00
ZbeeGin 01f56a070e Translated using Weblate (Polish)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-05-10 20:51:22 +02:00
Miklós Márton 83d1d57363 Translated using Weblate (Hungarian)
Currently translated at 43.9% (3166 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/hu/
2022-05-10 20:51:22 +02:00
Henrik Kauhanen c63230dec6 Translated using Weblate (Finnish)
Currently translated at 99.9% (7205 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-05-10 20:51:22 +02:00
Toni Laiho ee1263ff53 Translated using Weblate (Finnish)
Currently translated at 99.9% (7205 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-05-10 20:51:22 +02:00
Mark Hämmerling 1c7c0db7c7 Translated using Weblate (German)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-05-10 20:51:22 +02:00
Jan Straka dc4a6732be Translated using Weblate (Czech)
Currently translated at 92.0% (6639 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-05-10 20:51:21 +02:00
Henrik Kauhanen 3f5b65842d Translated using Weblate (Swedish)
Currently translated at 99.7% (7190 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-05-10 20:51:21 +02:00
Johannes Maibaum ea0d9076e7 Fix stock templates path for flatpak
Commit ad251b7b8c broke the template path
lookup for flatpak via `PATHS::GetStockTemplatesPath()`. Fix this by
using `::GetStockEDALibraryPath()` in all EDA Library related path
lookup functions.

`GetStockEDALibraryPath()` effectively does the same as
`GetStockDataPath()`, but it takes care to check the
`KICAD_LIBRARY_DATA` build config, which is being used by flatpak to
point to the flatpak EDA Library extensions in
`/app/extensions/Library/`.

Closes #11174
2022-05-10 17:57:23 +00:00
Alex bd97aaa63e Symbol Fields Table fields list: improve scrollbar behaviour on Windows. 2022-05-09 23:51:57 +00:00
Mike Williams e811b9a2dd Hierarchy: update just selection on sheet change
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11550
2022-05-09 17:31:29 +00:00
Jeff Young 8524042352 Implement cross-references for labels.
Fixes https://gitlab.com/kicad/code/kicad/issues/11564

(cherry picked from commit f9f0f6fe24)
2022-05-09 12:22:49 +01:00
Jeff Young 5b24003f6c Promote field selection to field-owner for Autoplace.
Fixes https://gitlab.com/kicad/code/kicad/issues/11529

(cherry picked from commit f6f316bd8c)
2022-05-09 12:07:33 +01:00
Jeff Young 71ea56dea4 Remove special-case processing of ${REFERENCE} and ${VALUE}.
Fixes https://gitlab.com/kicad/code/kicad/issues/11476

(cherry picked from commit 6b557d8631)
2022-05-09 12:05:51 +01:00
Jeff Young 362eec7ee3 Update findnext to handle new instance data architecture.
Fixes https://gitlab.com/kicad/code/kicad/issues/11424

(cherry picked from commit e0f2a5f07c)
2022-05-09 00:36:27 +01:00
Jeff Young c63c3d1891 Fix minor layout issue in dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/11490

(cherry picked from commit 2cccd5b090)
2022-05-09 00:36:27 +01:00
Jeff Young 058f6e0a9b All via pad layers need checking for copper.
Fixes https://gitlab.com/kicad/code/kicad/issues/11429

(cherry picked from commit e7f5deedb8)
2022-05-09 00:36:27 +01:00
Jeff Young e3eaa50600 Add on-the-fly i18n update for m_inactiveLayersLabel.
Fixes https://gitlab.com/kicad/code/kicad/issues/11435

(cherry picked from commit 3304ad75ca)
2022-05-09 00:36:27 +01:00
Jeff Young f4b5b65342 Initialize virtual page no. to something more reasonable.
Fixes https://gitlab.com/kicad/code/kicad/issues/11295

(cherry picked from commit 52eb210aa8)
2022-05-09 00:36:27 +01:00
Jeff Young 624d88dff9 Disable background color when printing in black & white.
Fixes https://gitlab.com/kicad/code/kicad/issues/11180

(cherry picked from commit 6738708a7f)
2022-05-09 00:36:27 +01:00
Jeff Young c04a183141 Hand cherry-pick of fix from master.
Fixes https://gitlab.com/kicad/code/kicad/issues/11261
2022-05-09 00:36:27 +01:00
Jeff Young 1831e034be Fix missing line keeping tabs from switching.
Fixes https://gitlab.com/kicad/code/kicad/issues/11417

(cherry picked from commit fc2eb2d7c9)
2022-05-09 00:36:27 +01:00
Jeff Young 2dcff109df Update Selection Filter title bar with language changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/11421

(cherry picked from commit 4ab2c93070)
2022-05-09 00:36:27 +01:00
Jeff Young 936040fe8b Remove extra test.
Fixes https://gitlab.com/kicad/code/kicad/issues/10364

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

(cherry picked from commit c78a47c3fb)
2022-05-09 00:36:27 +01:00
Mark Roszko 092c11b054 vcpkg.json declare wxpython version 2022-05-08 23:05:02 +00:00
Mark Roszko 43b8adad1a Update vcpkg-configuration.json 2022-05-07 11:34:54 +00:00
Seth Hillbrand e05c8f8852 Catch throws in DeleteSymbol
DeleteSymbol may call SaveSymbol if the name is changed.  In this case,
SaveSymbol may throw back and needs to be caught

Fixes https://gitlab.com/kicad/code/kicad/issues/11566
2022-05-06 16:13:13 -07:00
Seth Hillbrand 485e89f7a5 Finally found the intermittant QA crash
When loading footprints/zones in parallel, we cannot reference a static
vector that gets cleared by other threads.

It is unclear why this element was ever static to begin with (premature
optimization?) but it has been this way for a long time.  We never
noticed until we threaded load cycles, which gave the hatch a chance to
override itself and cause crashes

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

(cherry picked from commit 8218f9ab44)
2022-05-06 11:53:49 -07:00
Seth Hillbrand 611311697e Revert "Fix another static variable instance"
This reverts commit 5bd3a9cca8.

Reverted in favor of cherry-picking the more complete fix
from 8218f9ab44
2022-05-06 11:53:21 -07:00
Seth Hillbrand 5bd3a9cca8 Fix another static variable instance
Premature optimization appears to be the issue.  When we threaded zone
handling and added multiple layers, we started overwriting the
pointbuffer variable, which was declared static for unknown reasons

Fixes https://gitlab.com/kicad/code/kicad/issues/9888
2022-05-06 11:49:57 -07:00
Seth Hillbrand f4d4f23876 Catch errors when saving individual symbols
Fixes https://gitlab.com/kicad/code/kicad/issues/11566
2022-05-06 09:47:55 -07:00
Wayne Stambaugh 827abb01a3 Eeschema: fix broken project symbol rescue.
The legacy symbol library plugin code was changed to escape symbol names
which broke the LIB_ID string comparison when checking to see if symbols
needed to be rescued.  Escaping the LIB_ID names before comparison resolves
the issue.

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

(cherry picked from commit a19490b097)
2022-05-06 10:09:19 -04:00
Marek Roszko 370ce6a74d Revert "Increment kicad-vcpkg baseline for wxpython fix"
This reverts commit 9dd8bc1060.
2022-05-06 07:52:03 -04:00
Marek Roszko 9f2ca9b4d6 Fix FindPythonInterp for vcpkg again 2022-05-06 07:51:12 -04:00
Marek Roszko b21f37e22f Reorder pybind11 to be after we find the interp and libs ourselves
Our python find module is patched for vcpkg and we want it to execute first.
2022-05-06 07:51:12 -04:00
Mark Roszko 9dd8bc1060 Increment kicad-vcpkg baseline for wxpython fix
(cherry picked from commit cf69337466)
2022-05-06 11:10:46 +00:00
jean-pierre charras 511e862cfe Gerbview export to kicad_pcb file: remove calls to Simplify and Fracture.
They are not needed to export polygons because they are already
fractured, and these calls are very time consuming.
From Master branch
2022-05-06 13:06:41 +02:00
jean-pierre charras ed153bd7d7 Symbol editor crash: Fix use of a null pointer.
LIB_TEXT::Clone() did not copy a member set to nullptr.
From Master branch
Fixes #11569
https://gitlab.com/kicad/code/kicad/issues/11569
2022-05-06 12:54:32 +02:00
jean-pierre charras 6971e409bf Pcbnew: fix lost of focus after clicking on a wxChoice in toolbar.
After changing track width, via size, grid or zoom from the toolbar, the
canvas has no longer the focus on Windows. So we force the focus after clicking
on these widgets.
From Master branch
Fixes #11103
https://gitlab.com/kicad/code/kicad/issues/11103
2022-05-05 11:54:47 +02:00
jean-pierre charras ea1a1a43c0 Cvpcb: fix SaveAssociations. Save association to disk only from the Apply button.
Previously, the association was saved to disk also on OK button click.
From master branch
2022-05-05 11:33:13 +02:00
jean-pierre charras 7890d78801 Cvpcb: fix not working icon "select previous symbol"
From Master branch
Fixes #11509 https://gitlab.com/kicad/code/kicad/issues/11509
2022-05-05 11:31:38 +02:00
jean-pierre charras 82631db1bb Eeschema, backannotate: fix minor issues in displayed messages.
From Master branch
Fixes #11530 https://gitlab.com/kicad/code/kicad/issues/11530
2022-05-05 11:29:58 +02:00
jean-pierre charras fbc6c8f8f4 pcad importer: fix a truncation when converting mils to IU.
The value in mils is a double, but the function to convert in IU uses int.
From master branch.
Fixes #11380 https://gitlab.com/kicad/code/kicad/issues/11380
2022-05-04 17:37:11 +02:00
Mark Roszko 4e13677281 FindwxPython VCPKG_INSTALLED_DIR over the old _VCPKG_INSTALLED_DIR
(cherry picked from commit b6522bfc66)
2022-05-03 22:46:10 +00:00
Seth Hillbrand ba276fe470 Fix botched commit 2022-05-02 16:28:39 -07:00
Seth Hillbrand 4d47857738 Catch IO_ERRORs that we throw
FILEOUTPUT_FORMATTER likes to throw when it gets an issue.  We need to
catch this to avoid the app falling apart

Fixes https://gitlab.com/kicad/code/kicad/issues/11516
2022-05-02 15:15:04 -07:00
Wayne Stambaugh 08c216e796 Begin version 6.0.6 development. 2022-05-02 16:24:18 -04:00
Wayne Stambaugh 3d87537dd2 Tag release version 6.0.5. 2022-05-02 15:37:58 -04:00
Marek Roszko 862d975c2c Update vcpkg manifest for debuggable wxwidgets 3.1.5 2022-04-30 23:10:15 -04:00
Mark Roszko 45d58fbefc Remove errant phoenix message when disabled 2022-04-30 23:10:10 -04:00
Mark Roszko 7b7e4e1ae5 Move forwards kicad-vcpkg registry to get our ngspice 2022-04-30 03:40:40 +00:00
Marek Roszko 3f04b80ff4 Remove the vcpkg specific hack to FindwxWidgets.cmake which is no longer needed/broken with manifests 2022-04-28 23:27:09 -04:00
Mark Roszko 5830cdd1c0 Disable windows ci for now 2022-04-29 01:24:09 +00:00
Marek Roszko 2416b28cda Add vcpkg manifest 2022-04-28 21:20:30 -04:00
Seth Hillbrand 729cf7a39d Use instance data to store values
Previous use of instance was as an "override" of the default value.
This has changed to be used as the primary storage location for all
values.  This means that we cannot clear the instance data when setting
a new value for all instances, instead we have to change the instance
data and the default value is superfluous

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

(cherry picked from commit 1a70465927)
2022-04-25 13:03:41 -07:00
Seth Hillbrand 4d56690a7e Update Translations 2022-04-19 14:55:57 -07:00
Henrik Kauhanen e30128f6f5 Translated using Weblate (Swedish)
Currently translated at 99.7% (7190 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-04-19 23:54:45 +02:00
ZbeeGin c4a42f28c8 Translated using Weblate (Polish)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-04-19 23:54:45 +02:00
co8 j bdbbba54f9 Translated using Weblate (Japanese)
Currently translated at 99.8% (7201 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-04-19 23:54:45 +02:00
Toni Laiho 80c2fb39b1 Translated using Weblate (Finnish)
Currently translated at 99.9% (7205 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-04-19 23:54:44 +02:00
Mark Hämmerling 63506cf777 Translated using Weblate (German)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-04-19 23:54:44 +02:00
Jan Straka 6c1d615f66 Translated using Weblate (Czech)
Currently translated at 91.8% (6622 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-04-19 23:54:44 +02:00
Jan Straka c0ca2f1830 Translated using Weblate (Czech)
Currently translated at 91.7% (6613 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-04-19 23:54:44 +02:00
Seth Hillbrand cf5f36aac5 Fix broken comparison in pin_numbers
Pin names like "+V" were incorrectly parsed as doubles leading to broken
comparisons.  These caused heap overflows when sorting pin tables

This corrects the comparison so that numeric sorts are only performed
when there is an actual number in the symbol segment.  Also adds unit
tests for common error cases

(cherry picked from commit aac6f576c2)
2022-04-19 14:49:52 -07:00
Simon Richter cc51807241 Fix minimum size calculation for new hierarchical sheets
These constants are given in mil, but are used in a context of internal
units.
2022-04-18 02:16:17 +02:00
Marco Ciampa e1865c1178 Updated Italian translation 2022-04-17 10:49:41 +02:00
Henrik Kauhanen b81ba520f8 Translated using Weblate (Swedish)
Currently translated at 99.7% (7190 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-04-16 00:13:45 +02:00
Toni Laiho edbb9c5194 Translated using Weblate (Finnish)
Currently translated at 99.9% (7205 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-04-16 00:13:45 +02:00
Eric cda6aed408 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-04-16 00:13:45 +02:00
Henrik Kauhanen 74172612fa Translated using Weblate (Swedish)
Currently translated at 99.6% (7188 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-04-16 00:13:45 +02:00
Wellington Terumi Uemura 7209239a62 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-04-16 00:13:45 +02:00
Bas Wijnen 16edde8611 Translated using Weblate (Dutch)
Currently translated at 98.4% (7098 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/nl/
2022-04-16 00:13:45 +02:00
Toni Laiho 33f8bcb7c7 Translated using Weblate (Finnish)
Currently translated at 99.8% (7203 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-04-16 00:13:45 +02:00
Ulices fb6505d8cb Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-04-16 00:13:44 +02:00
Arnau Llovet Vidal 39935311fc Translated using Weblate (Catalan)
Currently translated at 65.8% (4749 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-04-16 00:13:44 +02:00
Seth Hillbrand 851f893e8e Fix crash due to cleared view data
When changing fields, we need to update the view before allowing canvas
updates
2022-04-15 14:56:18 -07:00
Seth Hillbrand bfa1661edf Sync via/pad flashing for null boards
Pads return true by default and so should vias
2022-04-15 11:39:18 -07:00
Jeff Young 110663d214 Fix crash bug when selecting marker. 2022-04-15 13:40:19 +01:00
Jeff Young 847fa7f2c4 Add PCB_ARCs to type enum.
Fixes https://gitlab.com/kicad/code/kicad/issues/11384

(cherry picked from commit d01c2a6614)
2022-04-14 18:37:25 +01:00
jean-pierre charras ef798f446f STEP export: handle polygons with arcs (and convert arcs to segments).
From Master branch
Fixes #11389
https://gitlab.com/kicad/code/kicad/issues/11389
2022-04-14 16:31:56 +02:00
jean-pierre charras 2de1bd7a4a Ensure "Open Recent" and "Clear files" menu titles are updated after language change.
From Master branch.
2022-04-14 15:06:17 +02:00
Roberto Fernandez Bautista 250942264b CADSTAR Sch: Clear symbol of all elements before overwriting with new one
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11378

(cherry picked from commit 85f6ff48e7)
2022-04-12 21:42:03 +01:00
Jeff Young 6818eff90e Improvements to Eagle dimension importing.
1) Import leaders
2) Drop radius and angle dimensions
3) Import dimension text sizes
4) Correctly interpret which side dimension offset is on
5) Correclty handle offsets for non-cardinal dimensions

Fixes https://gitlab.com/kicad/code/kicad/issues/10763
2022-04-12 13:24:34 +01:00
Jeff Young b2eb1f829e Dual-purpose IsMovableFromAnchorPoint to keep from moving symbols off-grid.
Fixes https://gitlab.com/kicad/code/kicad/issues/11360

(cherry picked from commit 8358685920)
2022-04-12 13:24:34 +01:00
Jeff Young a60e7e27b6 A better blob vs web detector.
Since we're in a deflated state, a long web *could* still have a very
small area.  So check max extents instead.

(cherry picked from commit 1dae5eb7c4)
2022-04-12 13:24:34 +01:00
Jeff Young 601995c759 Apply the min-width-by-min-width test to islands after pruning.
We're looking for minimum *web* width.  A blob does not a web make.

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

(cherry picked from commit 1a2e0d8226)
2022-04-12 13:24:14 +01:00
Jeff Young 63ce2307c8 Adjust LIB_SYMBOL compare for use with ERC.
Fixes https://gitlab.com/kicad/code/kicad/issues/10783

(cherry picked from commit 117bd4fc22)
2022-04-12 13:24:14 +01:00
Jeff Young 03bc9551c7 Don't save schematic symbol back to lib manager.
Also, since it doesn't get saved, changing symbols will lose any edits.
Make sure to ask the user first.

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

(cherry picked from commit 16acba34d3)
2022-04-12 13:24:14 +01:00
Jeff Young c8cd214cb0 Make sure to add any now-necessary junctions after a rotate.
Fixes https://gitlab.com/kicad/code/kicad/issues/11242

(cherry picked from commit 74a578047c)
2022-04-12 13:24:14 +01:00
Marek Roszko fe11bc8330 Change the behavior of ACTION_MENU::Add to require clones if required outside the function 2022-04-11 20:39:08 -04:00
Seth Hillbrand d0796399a2 DP tolerance needs to be 1IU on each axis
ApproximatelyParallel will only check for parallel within 1 IU, so a 1x1
SEG will always be parallel and the projection is invalid
2022-04-11 16:55:54 -07:00
Seth Hillbrand c2d72180f8 Revert "Change the behavior of ACTION_MENU::Add to require clones if required outside the function"
This reverts commit 651f50a26d.
2022-04-11 11:03:19 -07:00
Seth Hillbrand 57729414e3 Update Translations 2022-04-11 09:40:06 -07:00
Henrik Kauhanen b664fb7a7d Translated using Weblate (Swedish)
Currently translated at 99.7% (7191 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-04-11 18:38:45 +02:00
Toni Laiho fe1a8bea8c Translated using Weblate (Finnish)
Currently translated at 99.8% (7202 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-04-11 18:38:45 +02:00
Tian Yunhao 3606ad725c Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-04-11 18:38:45 +02:00
Eric e8e24b372f Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-04-11 18:38:45 +02:00
Henrik Kauhanen 3bfa5807c8 Translated using Weblate (Swedish)
Currently translated at 99.7% (7191 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-04-11 18:38:44 +02:00
Toni Laiho b797735c24 Translated using Weblate (Finnish)
Currently translated at 99.9% (7203 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-04-11 18:38:44 +02:00
Ulices d0af5fb5fc Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-04-11 18:38:44 +02:00
Mark Hämmerling 5ca91c404a Translated using Weblate (German)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-04-11 18:38:44 +02:00
Jan Straka 6ba7967adc Translated using Weblate (Czech)
Currently translated at 91.6% (6608 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-04-11 18:38:44 +02:00
Arnau Llovet Vidal 9dfc492cb9 Translated using Weblate (Catalan)
Currently translated at 65.7% (4741 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-04-11 18:38:44 +02:00
Marco Ciampa 0876fed91b Small fix in Italian translation 2022-04-11 10:06:56 +02:00
Marek Roszko 651f50a26d Change the behavior of ACTION_MENU::Add to require clones if required outside the function
Fix https://gitlab.com/kicad/code/kicad/-/issues/10994
2022-04-10 22:40:58 -04:00
Marek Roszko 99456d4351 Don't pointlessly construct a wxBitmap
(cherry picked from commit fd83e675a2)
2022-04-10 11:48:10 +00:00
Jeff Young 529048dac1 Better error reporting for DP uncoupled length.
Fixes https://gitlab.com/kicad/code/kicad/issues/10087

(cherry picked from commit 722b2588f4)
2022-04-09 23:09:10 +01:00
Jeff Young be2e0cc272 A right-to-left single-char sel followed by typing leaves cursor the same.
Fixes https://gitlab.com/kicad/code/kicad/issues/11349

(cherry picked from commit dead84e7a1)
2022-04-09 21:23:54 +01:00
Jeff Young 48a776f7c5 Repair code that was supposed to be after LoadSymbol().
(Even the comment said so.)

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

(cherry picked from commit ed361925ba)
2022-04-09 21:23:18 +01:00
Jeff Young 43929781a2 On-the-fly translations for pin electrical types.
Also add on-the-fly translation for editor title bars.

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

(cherry picked from commit 68ca385e07)
2022-04-09 21:22:50 +01:00
Seth Hillbrand e02229a234 Don't flag pin missing driver when there is an NC
The NC flag indicates user intention to override the lack of connection
to input pins
2022-04-07 09:29:02 -07:00
Seth Hillbrand 821fe6ea42 Don't set the dirty bit when running DRC
Dirty bit is set in the zone filler separately, there is no action in
the DRC that needs to be saved

Fixes https://gitlab.com/kicad/code/kicad/issues/11344
2022-04-06 17:03:01 -07:00
Seth Hillbrand e740db61f5 Show non-driven error on single-pin nets
Better to have both the single-pin error message and the non-driven
error message when an input pin is not connected than miss error
messages when the pin is connected to a blank net

Fixes https://gitlab.com/kicad/code/kicad/issues/10430
2022-04-06 16:53:23 -07:00
Marek Roszko a700531aba Forcefully ignore PYTHONPATH env variable on Windows
Fix https://gitlab.com/kicad/code/kicad/-/issues/11328


(cherry picked from commit 44296dfea2)
2022-04-05 02:11:32 +00:00
Wayne Stambaugh 7d9cf00fd9 Improve sheet schematic import messages and simplify code.
There was also a logic bug when the selected schematic was in a different
path than the current project and was already part of the current project.
The symbol library table reconciliation code was still run which was wrong.

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

(cherry picked from commit e336a0e403)
2022-04-04 17:19:40 -04:00
jean-pierre charras 6127ae92a5 PLOTTER: do not clamp coordinates to an arbitrary value.
Previously, coordinates were clamped to +- 60 inches. It makes no sense to
clamp them at plotter level: max cooed depends on the editor (schematic/board...)
Rename MAX_PAGE_SIZE_MILS to MAX_PAGE_SIZE_EESCHEMA_MILS and use it only for Eeschema.
Fixes #11196
https://gitlab.com/kicad/code/kicad/issues/11196

(cherry picked from commit 21144481d2)
2022-04-04 13:52:21 -07:00
Jeff Young f8c92e355b Plating thickness appears on both sides of hole wall. 2022-04-04 21:51:30 +01:00
Jeff Young f7f6ea54fe Fix incorrect m_SyncPinEdit setting.
Fixes https://gitlab.com/kicad/code/kicad/issues/11331

(cherry picked from commit 3f9cfc0ac1)
2022-04-04 21:51:30 +01:00
dsa-t fdfe5a813e Clamp cursor to limits of coordinates representation
Also improves large distance handling.

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

(cherry picked from commit 68655540eb)
2022-04-04 13:38:50 -07:00
aris-kimi 636d009860 Added footprint rule area anchors
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10461

(cherry picked from commit 47c0672ff3)
2022-04-04 13:38:00 -07:00
Seth Hillbrand 7d96d5940d UNDEFINED_LAYER is always flashed
This is already true for vias and should be true for pads as well

Fixes https://gitlab.com/kicad/code/kicad/issues/11335
2022-04-04 12:25:55 -07:00
Wayne Stambaugh d3a60f7d83 Fix broken symbol field table editor dialog.
Do not use the symbol field string to populate the value and footprint
grid cells.  The field strings may be empty because the symbol has not
been instantiated yet by entering a sheet.  This fix makes an incorrect
assumption that the first instance value and footprint data in the symbol
is the same for all instances.

Note: this fix is incomplete because the value and footprint fields are
      can now be different between sheet instances.  The entire field
      table editor design will need to be rethought because the current
      grouping doesn't allow different value and footprint instance
      changes.

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

(cherry picked from commit b87fc45e33)
2022-04-04 14:32:07 -04:00
jean-pierre charras 604871518f Export VRML: fix some (minor) issues, from Master branch. 2022-04-04 14:46:55 +02:00
jean-pierre charras 5a68077f60 VRML exporter: make export faster by using SHAPE_POLY_SET::PM_FAST. 2022-04-04 12:28:54 +02:00
Jeff Young 8054f1a948 Apply a more sophisticated test for ignoring isInCoupledDiffPair.
The basic problem is that the DRC engine does length testing and skew
testing by collecting all the diff pair constituent parts and pairing them
itself.  Since each part is collected on its own, we need to ignore the
'B' unit when evaluating any conditional expressions.  However, doing this
in general means that when evaluating "OwnClearance()" we also ignore the
'B' unit and return the diff pair CLEARANCE_CONSTRAINT when we shouldn't.

This implements a more discerning test which know what the current requested
constraint is when evaluating expressions.

See also https://forum.kicad.info/t/solved-custom-differencing-rule-not-working-drc/34034/6

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

(cherry picked from commit f7cdc7af75)
2022-04-03 18:23:41 +01:00
Jeff Young 80bf1048d0 Look for sheet pins inside sheets.
Fixes https://gitlab.com/kicad/code/kicad/issues/11297

(cherry picked from commit 6b99a937d8)
2022-04-03 18:22:15 +01:00
Jeff Young d85e52e9fd A better is-modified test.
Fixes https://gitlab.com/kicad/code/kicad/issues/10791

(cherry picked from commit 09ba7468ae)
2022-04-03 18:21:41 +01:00
Jeff Young e21f0ec9fb Honour prime-event-location when starting router.
Fixes https://gitlab.com/kicad/code/kicad/issues/11239

(cherry picked from commit a54bbfe12b)
2022-04-03 18:21:00 +01:00
Jeff Young 1adfca8f2d Don't re-fetch selection when running select-in-same-sheet.
Fixes https://gitlab.com/kicad/code/kicad/issues/11110

(cherry picked from commit a35ae8cdce)
2022-04-03 18:20:32 +01:00
Jeff Young f89256e51e Implement align-to-grid for sheets.
Fixes https://gitlab.com/kicad/code/kicad/issues/11201

(cherry picked from commit 8dc680adbb)
2022-04-03 18:14:23 +01:00
Jeff Young e98e9f72df Only write Allow DRC Violations if enabled.
Fixes https://gitlab.com/kicad/code/kicad/issues/11177

(cherry picked from commit b78a260326)
2022-04-03 18:13:04 +01:00
Jeff Young f8ff9705ff Fix issues with importing NPTH pads from CircuitStudio.
Fixes https://gitlab.com/kicad/code/kicad/issues/10493

(cherry picked from commit 118a37f19f)
2022-04-03 15:51:33 +01:00
Jeff Young e3e52d055a Don't rely on HasConversion() for Symbol Properties in Symbol Editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/11200

(cherry picked from commit 2681ad6cfc)
2022-04-03 15:51:33 +01:00
Jeff Young 6de8b99cf2 Don't default to Annotate All just because the selection is empty.
Fixes https://gitlab.com/kicad/code/kicad/issues/11181

(cherry picked from commit 6fa8cab188)
2022-04-03 15:51:33 +01:00
Jeff Young c9829cf9a8 Enable bb and/or uvias when encountering them on Altium import.
Fixes https://gitlab.com/kicad/code/kicad/issues/10044

(cherry picked from commit 1d66925f5f)
2022-04-03 15:51:33 +01:00
Jeff Young 0fc4ccf8d9 Clean up pad handling in 3D viewer.
Most importantly, create F_Cu/B_Cu layers if they're otherwise empty
but we have plated pads to render on them.

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

(cherry picked from commit 0dc857b5ab)
2022-04-03 15:51:33 +01:00
Jeff Young 330b1fd733 Don't leave dangling pointers to old document when importing.
This goes for both selection pointers and undo/redo pointers.

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

(cherry picked from commit 535ecb9b7b)
2022-04-03 09:49:37 +01:00
Marek Roszko 455ec428f2 Free memory in dxf import sooner on bad_alloc
(cherry picked from commit b18e441a88)
2022-04-02 13:58:35 +00:00
jean-pierre charras 39959844e5 SYMBOL_EDITOR_CONTROL::DuplicateSymbol(): fix incorrect validation test.
DuplicateSymbol() is called both to duplicate and paste. Only duplicate
needs a test to know if a symbol is selected.
Fixes #11053
https://gitlab.com/kicad/code/kicad/issues/11053
2022-04-02 08:20:27 +02:00
Marek Roszko d5de4bb5c7 Catch memory exhaustion trying to import large DXFs
See https://gitlab.com/kicad/code/kicad/-/issues/11308


(cherry picked from commit 9f8c0a8185)
2022-04-02 03:15:33 +00:00
Seth Hillbrand 6706a5c462 Skip zero-size elements when converting
Also fixes an assertion when converting to polygon from the board editor

Fixes https://gitlab.com/kicad/code/kicad/issues/11313
2022-04-01 13:22:08 -07:00
Seth Hillbrand 15fe2f2fd0 Allow common greek letters in passive regex
Adds common letters (µ and Ω) as prefix and unit

Fixes https://gitlab.com/kicad/code/kicad/issues/11289
2022-04-01 12:51:21 -07:00
Seth Hillbrand c23679d9bd Consistently handle env/prj variables
User-defined variables cannot be used for internally-reserved variables

Fixes https://gitlab.com/kicad/code/kicad/issues/11232
2022-03-31 17:05:25 -07:00
jean-pierre charras f226772938 Cvpcb: fix "not found" .equ files.
Fixes #11264
https://gitlab.com/kicad/code/kicad/issues/11264
2022-03-29 18:54:11 +02:00
Seth Hillbrand 6a53e318e5 Thread the connectivity vector updates
Now that we are dealing with individual connection elements that do not
update their connected elements as well, we can thread the update, just
being careful to guard any remaining updates (bus_enty/busLine) that
need reciprocal updating

Fixes https://gitlab.com/kicad/code/kicad/issues/10974
2022-03-28 15:35:52 -07:00
Seth Hillbrand 776a28a10e Avoid generating SCH_CONNECTION if not needed
If the SCH_ITEM has already been processed, the extra time needed to
iterated over the memberset and get the SCH_CONNECTION when we won't use
it is not neccesary.

Fixes https://gitlab.com/kicad/code/kicad/issues/10974
2022-03-28 15:07:18 -07:00
Seth Hillbrand 3a98eacdb9 Handle connection vector inline
Normally, you will gain by resursing a nested loop only over the
pairs that are not already handled.  In this case, however, you lose
time because you step outside of the cache by adding the reciprocal test
at each step.

Instead, we process one element at a time, keeping it cached and loop
over all other elements to add to the connection.  This saves us about
75% of the time for larger loops (e.g. stacked power pins on a large
BGA)

Fixes https://gitlab.com/kicad/code/kicad/issues/10974
2022-03-28 15:07:18 -07:00
Seth Hillbrand a8004cb161 Update Translations 2022-03-28 11:14:40 -07:00
Henrik Kauhanen f00222b3a6 Translated using Weblate (Swedish)
Currently translated at 99.6% (7186 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-03-28 19:50:37 +02:00
Mark Hämmerling 96dded48d4 Translated using Weblate (German)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-03-28 19:50:37 +02:00
Allan Nordhøy 950cccdc1c Translated using Weblate (Norwegian Bokmål)
Currently translated at 73.4% (5295 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/nb_NO/
2022-03-28 19:50:37 +02:00
Mark Hämmerling 5b7a1a8177 Translated using Weblate (German)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-03-28 19:50:37 +02:00
taotieren 96aa472ff9 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hant/
2022-03-28 19:50:37 +02:00
Henrik Kauhanen 0ec50e9096 Translated using Weblate (Swedish)
Currently translated at 99.4% (7173 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-03-28 19:50:37 +02:00
Henrik Kauhanen 6bc48e9ca8 Translated using Weblate (Swedish)
Currently translated at 99.4% (7173 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-03-28 19:50:36 +02:00
Arnau Llovet Vidal 5505add08e Translated using Weblate (Catalan)
Currently translated at 65.7% (4740 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-03-28 19:50:36 +02:00
Marek Roszko 4d8297a1f6 Try and ducktape boost api change for seeder
idk what im doing


(cherry picked from commit d440ff7c37)
2022-03-28 01:48:50 +00:00
Marek Roszko e1cd74dd78 Remove extra boost include
(cherry picked from commit 7a0d8c2fe0)
2022-03-28 01:48:41 +00:00
Mario Luzeiro 2567f45c1d 3D-Viewer: binds the default texture after draw and before end the list
Fixes https://gitlab.com/kicad/code/kicad/issues/2547

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

(cherry picked from commit 7659f3c81b)
2022-03-25 16:22:57 -07:00
Marek Roszko 0ea7dabc12 Read the boost manual right-side up
(cherry picked from commit 3f0f846435)
2022-03-24 22:17:19 +00:00
jean-pierre charras bf8c7d7697 GERBER_JOBFILE_WRITER: fix a crash due to use of a null pointer.
Can happens when it is created from a Python script.
From Master branch
Fixes #11227
https://gitlab.com/kicad/code/kicad/issues/11227
2022-03-24 18:01:24 +01:00
Marek Roszko 891c919c23 Ensure the kiid generator rng is actually uniquely seeded each start
(cherry picked from commit 2e689901fc)
2022-03-23 22:51:33 +00:00
jean-pierre charras 375a7303c5 Gerbview: Fix incorrect rendering of aperture macros combining polygons.
A aperture macro can have polygons with holes, and/or many polygons.
When combining polygons holes can be created. So ensure the resulting polygon
is fractured before drawing it.
From Master branch
Fixes #11218
https://gitlab.com/kicad/code/kicad/issues/11218
2022-03-23 20:56:57 +01:00
jean-pierre charras e14e9cf8a9 PLOTTER: do not clamp coordinates to an arbitrary value.
Previously, coordinates were clamped to +- 60 inches. It makes no sense to
clamp them at plotter level: max coord depends on the editor (schematic/board...)
From Master.
2022-03-23 20:55:25 +01:00
Seth Hillbrand 4e98ce87c7 All triangular trapezoid pads
A triangular trapezoid will have the deltaX/deltaY of the same size as
the length of that axis.  This creates a three-point polygon, which is
perfectly valid for our use
2022-03-22 13:38:36 -07:00
Seth Hillbrand 207820e112 Avoid duplicate points in trapezoid pads
Duplicate points can be either positive-facing or negative facing, so
test absolutes

Fixes https://gitlab.com/kicad/code/kicad/issues/11025
2022-03-22 13:30:22 -07:00
Henrik Kauhanen dbbecefcb9 Translated using Weblate (Swedish)
Currently translated at 99.4% (7173 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-03-22 19:24:35 +01:00
Wellington Terumi Uemura df8f166847 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-03-22 19:24:35 +01:00
Henrik Kauhanen 79ef8e14aa Translated using Weblate (Swedish)
Currently translated at 99.4% (7173 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-03-22 19:24:35 +01:00
taotieren 5081165611 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hant/
2022-03-22 19:24:34 +01:00
taotieren 3bfcaf2455 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-03-22 19:24:34 +01:00
Mustafa Selçuk ÇAVDAR 9e2416d2c9 Translated using Weblate (Turkish)
Currently translated at 44.4% (3205 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/tr/
2022-03-22 19:24:34 +01:00
boonchai k 49eecf66fe Translated using Weblate (Thai)
Currently translated at 99.6% (7188 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/th/
2022-03-22 19:24:34 +01:00
Henrik Kauhanen bc3a4e4ede Translated using Weblate (Swedish)
Currently translated at 99.4% (7173 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-03-22 19:24:34 +01:00
Konstantin Baranovskiy 3645c3c0cc Translated using Weblate (Russian)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-03-22 19:24:34 +01:00
Wellington Terumi Uemura 7902c1cc58 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-03-22 19:24:34 +01:00
ZbeeGin 2a2781e1bc Translated using Weblate (Polish)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-03-22 19:24:34 +01:00
Tokita, Hiroshi 9510b07807 Translated using Weblate (Japanese)
Currently translated at 99.9% (7204 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-03-22 19:24:34 +01:00
Ulices 072c0f06cd Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-03-22 19:24:34 +01:00
Eric b75e782aef Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (7209 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-03-22 19:24:34 +01:00
Seth Hillbrand d9fe48171b Attempt to fix the Mac DPI grid mixing
When moving windows between monitors on Mac that changes the DPI, we
observe incorrect re-sizing of columns and rows.  This attempts to
rectify the situation by avoiding DPI changes for Mac builds.

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

(cherry picked from commit 9722a05820)
2022-03-22 11:23:49 -07:00
Jeff Young eeee5afdfd Zero out parent rule when overridden by local property.
Fixes https://gitlab.com/kicad/code/kicad/issues/11197

(cherry picked from commit b679a21651)
2022-03-21 20:56:00 +00:00
Jeff Young 790b810621 A little bit of nullptr safety.
Fixes https://gitlab.com/kicad/code/kicad/issues/11077

(cherry picked from commit b3ae0fdca5)
2022-03-21 20:54:28 +00:00
Seth Hillbrand e33bf78d96 Separate flashing check for connectivity
When building the connectivity database, we should not be using the
connectivity to check for shapes.

To make this deterministic, we introduce two flags (ALWAYS_FLASH and
NEVER_FLASH) that are used with connectivity building to determine
whether a pad is flashed for connectivity or not.  ZONE <-> PAD/VIA
connectivity will be checked with ALWAYS_FLASHED and all other
connectivity will be checked with NEVER_FLASHED if they are marked for
potential annular ring removal.  If they are not marked for removal,
they will be checked ALWAYS_FLASHED.

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

(cherry picked from commit 442aae19d9)
2022-03-21 08:37:53 -07:00
jean-pierre charras bd86999615 QA test: fix incorrect call to BOOST_TEST_MESSGE.
It expects a C string, not a wxString.
Fromm Master.
2022-03-21 14:02:18 +01:00
jean-pierre charras 1b108afd0b Specctra import/export: fix some issues (tested only with FreeRouter):
- Handling of locked tracks
- Locked tracks are now exported with attribute "fix".
- Incorrect view cleaning
- Fix memory leak.
From master branch.
2022-03-20 19:05:23 +01:00
jean-pierre charras a8384beb6f Python, board.i: fix incorrect order of an include.
The result was ignoring PCB_SHAPE in pcb_text.i.
2022-03-20 18:47:14 +01:00
Seth Hillbrand c44d31fcfb Fix expand variables for built-in
Allow falling back to the alternate variable definitions if the built-in
text block variables are not set.

Also push the project into variable resolution when plotting

Fixes https://gitlab.com/kicad/code/kicad/issues/11168
2022-03-18 16:46:36 -07:00
Marco Ciampa d801a8689c Updated Italian translation 2022-03-18 21:35:14 +01:00
Frank Zeeman 4a1abd239a Append True to Python 3 AddPrimitivePoly() call
Fixes https://gitlab.com/kicad/code/kicad/issues/11012

(cherry picked from commit b3a319b77e)
2022-03-18 13:01:56 -07:00
Seth Hillbrand 423732910d Update Translations 2022-03-18 12:53:10 -07:00
Arnau Llovet Vidal e4ce5e5262 Translated using Weblate (Catalan)
Currently translated at 65.6% (4737 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-03-18 20:52:12 +01:00
taotieren 2998d31f2c Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (7210 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-03-18 20:52:12 +01:00
Mustafa Selçuk ÇAVDAR da98413f82 Translated using Weblate (Turkish)
Currently translated at 43.9% (3170 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/tr/
2022-03-18 20:52:11 +01:00
Bas Wijnen f562466189 Translated using Weblate (Dutch)
Currently translated at 98.4% (7096 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/nl/
2022-03-18 20:52:11 +01:00
김랑기 0deae6bdd2 Translated using Weblate (Korean)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-03-18 20:52:11 +01:00
Mark Hämmerling 31f8e73cf8 Translated using Weblate (German)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-03-18 20:52:11 +01:00
Arnau Llovet Vidal e58f50602d Translated using Weblate (Catalan)
Currently translated at 65.4% (4721 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-03-18 20:52:11 +01:00
Ulices c870505141 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-03-18 20:52:11 +01:00
Eric c20e81fbdd Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (7210 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-03-18 20:52:11 +01:00
Trần Phi Hải 58d0c4112d Translated using Weblate (Vietnamese)
Currently translated at 17.6% (1271 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/vi/
2022-03-18 20:52:11 +01:00
Henrik Kauhanen 1cb80e1ad0 Translated using Weblate (Swedish)
Currently translated at 99.5% (7175 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-03-18 20:52:11 +01:00
___davidpr 2584c46c28 Translated using Weblate (Serbian)
Currently translated at 13.9% (1006 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sr/
2022-03-18 20:52:11 +01:00
Konstantin Baranovskiy 2ce96415a6 Translated using Weblate (Russian)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-03-18 20:52:10 +01:00
Wellington Terumi Uemura 8eded13d96 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-03-18 20:52:10 +01:00
ZbeeGin 069143dc05 Translated using Weblate (Polish)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-03-18 20:52:10 +01:00
Mark Hämmerling 9d09ce0538 Translated using Weblate (German)
Currently translated at 100.0% (7211 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-03-18 20:52:10 +01:00
Arnau Llovet Vidal d9dd691108 Translated using Weblate (Catalan)
Currently translated at 65.4% (4718 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-03-18 20:52:10 +01:00
Jeff Young f69ebe55ad Improved performance for Cleanup Tracks & Vias.
(cherry picked from commit 14378812be)
2022-03-18 12:50:09 -07:00
Jeff Young ff604cc6a3 Pull some fixes back from master.
Mostly wxT(), but also some performance, and some for better response
to Cancel button.

(cherry picked from commit 5c63df28e4)
2022-03-18 12:49:54 -07:00
Jeff Young 8ccc5bd8f2 Special-case synthetic click after tool selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/11057

(cherry picked from commit 1f745b000d)
(cherry picked from commit dd55ffb75c)
2022-03-18 12:49:44 -07:00
Jeff Young 02b1f552fd Make sure LIB_ID escape context allows for formatting constructs.
Also make sure that value field is updated from name changes when the
symbol is a power symbol (even if it's from the schematic instead of
the library).

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

(cherry picked from commit a9eb7a0e28)
(cherry picked from commit 02252be29d)
2022-03-18 12:49:32 -07:00
Wayne Stambaugh f058dc9ed8 Begin version 6.0.5 development. 2022-03-17 19:35:07 -04:00
515 changed files with 78480 additions and 70730 deletions
+1 -1
View File
@@ -40,6 +40,6 @@ 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'
+85 -14
View File
@@ -1,10 +1,11 @@
##########################################################################
# Build KiCad on Fedora and save the results
##########################################################################
fedora_build_linux:
.fedora_build_linux_base:
stage: build
tags:
- kicad-fedora
# Don't tag until we have separate CI for MRs
# tags:
# - kicad-fedora
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:34
extends: .only_code
interruptible: false
@@ -22,7 +23,7 @@ fedora_build_linux:
- cd build/linux
- cmake
-G Ninja
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DKICAD_STDLIB_LIGHT_DEBUG=ON
-DKICAD_USE_OCC=ON
-DKICAD_SPICE=ON
@@ -42,15 +43,31 @@ fedora_build_linux:
- build/linux/pcbnew/_pcbnew.so
- build/linux/qa/
- build/linux/compilation_log.txt
exclude:
- build/linux/**/*.o
- build/linux/**/*.a
# This split is to ensure we can always use our runner for our jobs
fedora_build_linux_kicad:
extends: .fedora_build_linux_base
tags:
- kicad-fedora
only:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
fedora_build_linux_public:
extends: .fedora_build_linux_base
except:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
# Upload the compilation log in an easily downloadable form
fedora_report_build_warn:
.fedora_report_build_warn:
stage: report
extends: .only_code
when: always
needs:
- job: fedora_build_linux
artifacts: true
script:
- echo "Uploading compilation log"
- cp build/linux/compilation_log.txt compilation_log.txt
@@ -61,14 +78,32 @@ fedora_report_build_warn:
paths:
- compilation_log.txt
fedora_report_build_warn_kicad:
extends: .fedora_report_build_warn
tags:
- kicad-fedora
needs:
- job: fedora_build_linux_kicad
artifacts: true
only:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
fedora_report_build_warn_public:
extends: .fedora_report_build_warn
needs:
- job: fedora_build_linux_public
artifacts: true
except:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
# Report on the metrics of the code
fedora_report_metrics:
.fedora_report_metrics:
stage: report
extends: .only_code
when: always
needs:
- job: fedora_build_linux
artifacts: true
script:
- cat build/linux/compilation_log.txt | { grep "warning:" || test $? = 1; } | awk 'END{print "number_of_fedora_warnings "NR}' > metrics.txt
- cat metrics.txt
@@ -76,11 +111,30 @@ fedora_report_metrics:
reports:
metrics: metrics.txt
fedora_report_metrics_kicad:
extends: .fedora_report_metrics
tags:
- kicad-fedora
needs:
- job: fedora_build_linux_kicad
artifacts: true
only:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
fedora_report_metrics_public:
extends: .fedora_report_metrics
needs:
- job: fedora_build_linux_public
artifacts: true
except:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
##########################################################################
# Run the code unit tests.
##########################################################################
fedora_qa:
.fedora_qa:
extends:
- .unit_test
- .only_code
@@ -88,6 +142,23 @@ fedora_qa:
matrix:
# The name of the test without the qa_ prefix
- TEST: [python, common, gerbview, pcbnew, eeschema, kimath, sexpr, kicad2step]
fedora_qa_kicad:
extends: .fedora_qa
tags:
- kicad-fedora
needs:
- job: fedora_build_linux
- job: fedora_build_linux_kicad
artifacts: true
only:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
fedora_qa_public:
extends: .fedora_qa
needs:
- job: fedora_build_linux_public
artifacts: true
except:
variables:
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
+4 -3
View File
@@ -194,12 +194,13 @@ S3D_CACHE::S3D_CACHE()
S3D_CACHE::~S3D_CACHE()
{
COMMON_SETTINGS* commonSettings = Pgm().GetCommonSettings();
FlushCache();
// We'll delete ".3dc" cache files older than this many days
int clearCacheInterval = commonSettings->m_System.clear_3d_cache_interval;
int clearCacheInterval = 0;
if( Pgm().GetCommonSettings() )
clearCacheInterval = Pgm().GetCommonSettings()->m_System.clear_3d_cache_interval;
// An interval of zero means the user doesn't want to ever clear the cache
@@ -493,15 +493,10 @@ void BOARD_ADAPTER::addPadsWithClearance( const FOOTPRINT* aFootprint,
{
for( PAD* pad : aFootprint->Pads() )
{
if( !pad->IsOnLayer( aLayerId ) )
if( !pad->FlashLayer( aLayerId ) )
continue;
// Skip pad annulus when not connected on this layer (if removing is enabled)
if( !pad->FlashLayer( aLayerId ) && IsCopperLayer( aLayerId ) )
continue;
// NPTH pads are not drawn on layers if the
// shape size and pos is the same as their hole:
// NPTH pads are not drawn on layers if the shape size and pos is the same as their hole:
if( aSkipNPTHPadsWihNoCopper && ( pad->GetAttribute() == PAD_ATTRIB::NPTH ) )
{
if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) )
@@ -526,19 +521,28 @@ void BOARD_ADAPTER::addPadsWithClearance( const FOOTPRINT* aFootprint,
}
}
const bool isPlated = ( ( aLayerId == F_Cu ) && pad->FlashLayer( F_Mask ) ) ||
( ( aLayerId == B_Cu ) && pad->FlashLayer( B_Mask ) );
if( aSkipPlatedPads && isPlated )
continue;
if( aSkipNonPlatedPads && !isPlated )
continue;
wxSize margin( aInflateValue, aInflateValue );
switch( aLayerId )
{
case F_Cu:
if( aSkipPlatedPads && pad->FlashLayer( F_Mask ) )
continue;
if( aSkipNonPlatedPads && !pad->FlashLayer( F_Mask ) )
continue;
break;
case B_Cu:
if( aSkipPlatedPads && pad->FlashLayer( B_Mask ) )
continue;
if( aSkipNonPlatedPads && !pad->FlashLayer( B_Mask ) )
continue;
break;
case F_Mask:
case B_Mask:
margin.x += pad->GetSolderMaskMargin();
+2 -3
View File
@@ -549,7 +549,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
for( FOOTPRINT* footprint : m_board->Footprints() )
{
addPadsWithClearance( footprint, m_platedPadsFront, F_Cu, 0, true, false, true );
addPadsWithClearance( footprint, m_platedPadsBack, B_Cu, 0, true, false, true );
}
@@ -569,8 +568,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Add pads to polygon list
for( FOOTPRINT* footprint : m_board->Footprints() )
{
// Note: NPTH pads are not drawn on copper layers when the pad
// has same shape as its hole
// Note: NPTH pads are not drawn on copper layers when the pad has same shape as
// its hole
footprint->TransformPadsWithClearanceToPolygon( *layerPoly, curr_layer_id,
0, ARC_HIGH_DEF, ERROR_INSIDE,
true, renderPlatedPadsAsPlated,
+31 -9
View File
@@ -374,6 +374,22 @@ OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateLayerList( const BVH_CONTAINER_2D*
}
OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateEmptyLayerList( PCB_LAYER_ID aLayerId )
{
float layer_z_bot = 0.0f;
float layer_z_top = 0.0f;
getLayerZPos( aLayerId, layer_z_top, layer_z_bot );
TRIANGLE_DISPLAY_LIST* layerTriangles = new TRIANGLE_DISPLAY_LIST( 1 );
// store in a list so it will be latter deleted
m_triangles.push_back( layerTriangles );
return new OPENGL_RENDER_LIST( *layerTriangles, m_circleTexture, layer_z_bot, layer_z_top );
}
OPENGL_RENDER_LIST* RENDER_3D_OPENGL::createBoard( const SHAPE_POLY_SET& aBoardPoly,
const BVH_CONTAINER_2D* aThroughHoles )
{
@@ -388,9 +404,8 @@ OPENGL_RENDER_LIST* RENDER_3D_OPENGL::createBoard( const SHAPE_POLY_SET& aBoardP
if( listBoardObject2d.size() > 0 )
{
// We will set a unitary Z so it will in future used with transformations
// since the board poly will be used not only to draw itself but also the
// solder mask layers.
// We will set a unitary Z so it will in future used with transformations since the
// board poly will be used not only to draw itself but also the solder mask layers.
const float layer_z_top = 1.0f;
const float layer_z_bot = 0.0f;
@@ -563,7 +578,7 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
const BVH_CONTAINER_2D* container2d = ii.second;
SHAPE_POLY_SET polyListSubtracted;
SHAPE_POLY_SET* aPolyList = nullptr;
SHAPE_POLY_SET* polyList = nullptr;
// Load the vertical (Z axis) component of shapes
@@ -580,9 +595,8 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
{
polyListSubtracted.BooleanSubtract( m_boardAdapter.GetThroughHoleOdPolys(),
SHAPE_POLY_SET::PM_FAST );
polyListSubtracted.BooleanSubtract(
m_boardAdapter.GetOuterNonPlatedThroughHolePoly(),
SHAPE_POLY_SET::PM_FAST );
polyListSubtracted.BooleanSubtract( m_boardAdapter.GetOuterNonPlatedThroughHolePoly(),
SHAPE_POLY_SET::PM_FAST );
}
if( m_boardAdapter.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) )
@@ -600,10 +614,10 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
}
}
aPolyList = &polyListSubtracted;
polyList = &polyListSubtracted;
}
OPENGL_RENDER_LIST* oglList = generateLayerList( container2d, aPolyList, layer_id,
OPENGL_RENDER_LIST* oglList = generateLayerList( container2d, polyList, layer_id,
&m_boardAdapter.GetThroughHoleIds() );
if( oglList != nullptr )
@@ -626,6 +640,10 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
m_platedPadsFront = generateLayerList( m_boardAdapter.GetPlatedPadsFront(),
&polySubtracted, F_Cu );
// An entry for F_Cu must exist in m_layers or we'll never look at m_platedPadsFront
if( m_layers.count( F_Cu ) == 0 )
m_layers[F_Cu] = generateEmptyLayerList( F_Cu );
}
if( m_boardAdapter.GetBackPlatedPadPolys() )
@@ -640,6 +658,10 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
m_platedPadsBack = generateLayerList( m_boardAdapter.GetPlatedPadsBack(),
&polySubtracted, B_Cu );
// An entry for B_Cu must exist in m_layers or we'll never look at m_platedPadsBack
if( m_layers.count( B_Cu ) == 0 )
m_layers[B_Cu] = generateEmptyLayerList( B_Cu );
}
}
@@ -650,6 +650,7 @@ GLuint OPENGL_RENDER_LIST::generate_top_or_bot_seg_ends(
glDrawArrays( GL_TRIANGLES, 0, aTriangleContainer->GetVertexSize() );
glBindTexture( GL_TEXTURE_2D, 0 );
glDisable( GL_TEXTURE_2D );
glDisable( GL_ALPHA_TEST );
glDisable( GL_BLEND );
@@ -504,7 +504,7 @@ void RENDER_3D_OPENGL::setCopperMaterial()
void RENDER_3D_OPENGL::setPlatedCopperAndDepthOffset( PCB_LAYER_ID aLayer_id )
{
glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset(-0.1f, -2.0f );
glPolygonOffset( -0.1f, -2.0f );
setLayerMaterial( aLayer_id );
}
@@ -704,18 +704,16 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
{
pLayerDispList->DrawAllCameraCulled( m_camera.GetPos().z, drawMiddleSegments );
// Draw copper plated pads
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
( m_platedPadsFront || m_platedPadsBack ) )
setPlatedCopperAndDepthOffset( layer_id );
// Draw plated pads
if( layer_id == F_Cu && m_platedPadsFront )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsFront->DrawAllCameraCulled( m_camera.GetPos().z,
drawMiddleSegments );
}
else if( layer_id == B_Cu && m_platedPadsBack )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsBack->DrawAllCameraCulled( m_camera.GetPos().z,
drawMiddleSegments );
}
@@ -751,16 +749,10 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
viasHolesLayer,
m_antiBoard );
// Draw copper plated pads
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
( m_platedPadsFront || m_platedPadsBack ) )
{
setPlatedCopperAndDepthOffset( layer_id );
}
// Draw plated pads
if( layer_id == F_Cu && m_platedPadsFront )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsFront->DrawAllCameraCulledSubtractLayer(
drawMiddleSegments,
m_outerThroughHoles,
@@ -769,6 +761,7 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
}
else if( layer_id == B_Cu && m_platedPadsBack )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsBack->DrawAllCameraCulledSubtractLayer(
drawMiddleSegments,
m_outerThroughHoles,
@@ -785,21 +778,16 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
m_outerThroughHoles,
m_antiBoard );
// Draw copper plated pads
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
( m_platedPadsFront || m_platedPadsBack ) )
{
setPlatedCopperAndDepthOffset( layer_id );
}
if( layer_id == F_Cu && m_platedPadsFront )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsFront->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
m_outerThroughHoles,
m_antiBoard );
}
else if( layer_id == B_Cu && m_platedPadsBack )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsBack->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
m_outerThroughHoles,
m_antiBoard );
@@ -938,7 +926,7 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
glTexEnvi( GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PRIMARY_COLOR );
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA );
glTexEnvi( GL_TEXTURE_ENV, GL_SRC1_ALPHA, GL_CONSTANT );
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_CONSTANT );
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA );
render3dModels( false, true );
render3dModels( true, true );
@@ -84,6 +84,8 @@ private:
PCB_LAYER_ID aLayerId,
const BVH_CONTAINER_2D* aThroughHoles = nullptr );
OPENGL_RENDER_LIST* generateEmptyLayerList( PCB_LAYER_ID aLayerId );
void addTopAndBottomTriangles( TRIANGLE_DISPLAY_LIST* aDst, const SFVEC2F& v0,
const SFVEC2F& v1, const SFVEC2F& v2, float top, float bot );
+11 -9
View File
@@ -779,12 +779,6 @@ set( INC_AFTER
find_package( SWIG 3.0 REQUIRED )
include( ${SWIG_USE_FILE} )
# pybind11 is header-only, so include the subdir
add_subdirectory(thirdparty/pybind11)
# Make sure that we get our pybind11 and not the system pybind11 (ours is patched to work with wx)
include_directories( BEFORE SYSTEM ${PYBIND11_INCLUDE_DIR} )
set( PythonInterp_FIND_VERSION 3.6 )
set( PythonLibs_FIND_VERSION 3.6 )
@@ -826,6 +820,12 @@ message( STATUS "Python module install path: ${PYTHON_DEST}" )
find_package( PythonLibs 3.6 REQUIRED )
# pybind11 is header-only, so include the subdir
add_subdirectory(thirdparty/pybind11)
# Make sure that we get our pybind11 and not the system pybind11 (ours is patched to work with wx)
include_directories( BEFORE SYSTEM ${PYBIND11_INCLUDE_DIR} )
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
# although is used for all components, should be a harmless hit for something like eeschema
# so long as unused search paths are at the end like this.
@@ -848,9 +848,11 @@ if( UNIX AND NOT APPLE AND KICAD_SCRIPTING_WXPYTHON )
endif()
endif()
message( STATUS "Found ${WXPYTHON_FLAVOR} "
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
"(wxWidgets ${WXPYTHON_WXVERSION})" )
if( WXPYTHON_FLAVOR )
message( STATUS "Found wxPython ${WXPYTHON_FLAVOR} "
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
"(wxWidgets ${WXPYTHON_WXVERSION})" )
endif()
#
# Find wxWidgets library, required
@@ -36,9 +36,9 @@ string( REGEX MATCH
if( CMAKE_MATCH_COUNT EQUAL 3 )
# Match slot 0 is the full string, so we want slots 1 & 2
set( KICAD_MAJOR_MINOR_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" )
set( KICAD_MAJOR_MINOR_VERSION_TUPLE "{ ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2} }" )
set( KICAD_MAJOR_MINOR_PATCH_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}" )
set( KICAD_MAJOR_MINOR_PATCH_TUPLE "{ ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, ${CMAKE_MATCH_3} }" )
set( KICAD_MAJOR_VERSION "${CMAKE_MATCH_1}" )
set( KICAD_MINOR_VERSION "${CMAKE_MATCH_2}" )
@@ -67,7 +67,7 @@ set( _wvh_new_version_text
#define KICAD_MINOR_VERSION \"${KICAD_MINOR_VERSION}\"
#define KICAD_PATCH_VERSION \"${KICAD_PATCH_VERSION}\"
#define KICAD_MAJOR_MINOR_VERSION \"${KICAD_MAJOR_MINOR_VERSION}\"
#define KICAD_MAJOR_MINOR_VERSION_TUPLE ${KICAD_MAJOR_MINOR_VERSION_TUPLE}
#define KICAD_MAJOR_MINOR_PATCH_TUPLE ${KICAD_MAJOR_MINOR_PATCH_TUPLE}
#define KICAD_WIN32_RC_PRODVER ${KICAD_WIN32_RC_PRODVER}
#define KICAD_WIN32_RC_PRODVER_STR \"${KICAD_WIN32_RC_PRODVER_STR}\"
#define KICAD_WIN32_RC_FILEVER ${KICAD_WIN32_RC_FILEVER}
+8 -6
View File
@@ -75,11 +75,15 @@ if( ${PYTHON_ROOT_DIR} )
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES}
PATHS ${PYTHON_ROOT_DIR}
NO_DEFAULT_PATH )
elseif(VCPKG_TOOLCHAIN)
# Our VCPKG usage will always place it in a known location
find_program(PYTHON_EXECUTABLE
NAMES ${_Python_NAMES}
PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/python3"
)
else()
if(NOT VCPKG_TOOLCHAIN)
# If there is no specific path given, look for python in the path
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
endif()
# If there is no specific path given, look for python in the path
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
endif()
# Set up the versions we know about, in the order we will search. Always add
@@ -112,8 +116,6 @@ if(NOT PYTHON_EXECUTABLE)
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.2" )
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.1" )
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.0" )
elseif(VCPKG_TOOLCHAIN)
list( APPEND _Python_PPATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/python3" )
else()
list( APPEND _Python_PPATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] )
endif()
+1 -1
View File
@@ -40,7 +40,7 @@ if( VCPKG_TOOLCHAIN )
# python 3.8+ requires us to use python to add additional load directories (PATH no longer supported)
# vcpkg does not copy all the dlls into the python folder so we need this for development
# as the wxpython modules need the wxwidgets library DLLs to load
set( _py_dll "import os;os.add_dll_directory(\"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin\");os.add_dll_directory(\"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin\");" )
set( _py_dll "import os;os.add_dll_directory(\"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin\");os.add_dll_directory(\"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin\");" )
else()
set( _py_dll "" )
endif()
+30 -98
View File
@@ -231,11 +231,7 @@ endif()
#=====================================================================
if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Useful common wx libs needed by almost all components.
if(VCPKG_TOOLCHAIN)
set(wxWidgets_COMMON_LIBRARIES libpng16 tiff jpeg zlib libexpat)
else()
set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
endif()
set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
# DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead.
if(NOT wxWidgets_FIND_COMPONENTS)
@@ -258,22 +254,24 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
#-------------------------------------------------------------------
#
# Get filename components for a configuration. For example,
# if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d
# if _CONFIGURATION = mswu, then _UNV="", _UCD=u _DBG=""
# if _CONFIGURATION = mswunivud, then _PF="msw", _UNV=univ, _UCD=u _DBG=d
# if _CONFIGURATION = mswu, then _PF="msw", _UNV="", _UCD=u _DBG=""
#
macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG)
macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _PF _UNV _UCD _DBG)
DBG_MSG_V(${_CONFIGURATION})
string(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}")
string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
string(REGEX REPLACE "[msw|qt].*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
if(${_UCD} STREQUAL ${_CONFIGURATION})
set(${_UCD} "")
endif()
string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
string(REGEX MATCH "^[msw|qt]*" ${_PF} "${_CONFIGURATION}")
endmacro()
#
# Find libraries associated to a configuration.
#
macro(WX_FIND_LIBS _UNV _UCD _DBG)
macro(WX_FIND_LIBS _PF _UNV _UCD _DBG)
DBG_MSG_V("m_unv = ${_UNV}")
DBG_MSG_V("m_ucd = ${_UCD}")
DBG_MSG_V("m_dbg = ${_DBG}")
@@ -286,7 +284,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
NAMES
wx${LIB}${_UCD}${_DBG} # for regex
wx${LIB}${_DBG}
${LIB}${_DBG} # vcpkg libraries aren't specific to wx
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
@@ -296,6 +293,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets multilib base libraries.
find_library(WX_base${_DBG}
NAMES
wxbase32${_UCD}${_DBG}
wxbase31${_UCD}${_DBG}
wxbase30${_UCD}${_DBG}
wxbase29${_UCD}${_DBG}
@@ -310,6 +308,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
foreach(LIB net odbc xml)
find_library(WX_${LIB}${_DBG}
NAMES
wxbase32${_UCD}${_DBG}_${LIB}
wxbase31${_UCD}${_DBG}_${LIB}
wxbase30${_UCD}${_DBG}_${LIB}
wxbase29${_UCD}${_DBG}_${LIB}
@@ -326,13 +325,14 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets monolithic library.
find_library(WX_mono${_DBG}
NAMES
wxmsw${_UNV}31${_UCD}${_DBG}
wxmsw${_UNV}30${_UCD}${_DBG}
wxmsw${_UNV}29${_UCD}${_DBG}
wxmsw${_UNV}28${_UCD}${_DBG}
wxmsw${_UNV}27${_UCD}${_DBG}
wxmsw${_UNV}26${_UCD}${_DBG}
wxmsw${_UNV}25${_UCD}${_DBG}
wx${_PF}${_UNV}32${_UCD}${_DBG}
wx${_PF}${_UNV}31${_UCD}${_DBG}
wx${_PF}${_UNV}30${_UCD}${_DBG}
wx${_PF}${_UNV}29${_UCD}${_DBG}
wx${_PF}${_UNV}28${_UCD}${_DBG}
wx${_PF}${_UNV}27${_UCD}${_DBG}
wx${_PF}${_UNV}26${_UCD}${_DBG}
wx${_PF}${_UNV}25${_UCD}${_DBG}
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
@@ -340,16 +340,17 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets multilib libraries.
foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
webview stc ribbon propgrid)
stc ribbon propgrid webview)
find_library(WX_${LIB}${_DBG}
NAMES
wxmsw${_UNV}31${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}30${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}28${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}27${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}26${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}25${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}32${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}31${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}30${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}29${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}28${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}27${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}26${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}25${_UCD}${_DBG}_${LIB}
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
@@ -515,74 +516,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
set(WX_LIB_DIR_PREFIX vc)
endif()
if(VCPKG_TOOLCHAIN)
set(wxWidgets_FOUND TRUE)
find_path(wxWidgets_ROOT_DIR
NAMES include/wx/wx.h
PATHS
ENV wxWidgets_ROOT_DIR
DOC "wxWidgets base/installation directory"
)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/debug/lib)
set(wxWidgets_CONFIGURATION mswud)
else()
set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/lib)
set(wxWidgets_CONFIGURATION mswu)
endif()
set(wxWidgets_BIN_DIR ${wxWidgets_ROOT_DIR}/bin)
set(wxWidgets_INCLUDE_DIR ${wxWidgets_ROOT_DIR}/include)
file(GLOB DLL ${wxWidgets_BIN_DIR}/wxmsw*.dll)
if (DLL)
set(wxWidgets_DEFINITIONS WXUSINGDLL)
DBG_MSG_V("detected SHARED/DLL tree wxWidgets_LIB_DIR=${wxWidgets_LIB_DIR}")
endif ()
set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR})
set(WX_LIB_DIR ${wxWidgets_LIB_DIR}) # needed by macro
set(WX_CONFIGURATION_LIST ${wxWidgets_CONFIGURATION})
# Set wxWidgets lib setup include directory.
if (EXISTS ${wxWidgets_INCLUDE_DIR}/wx/setup.h)
set(wxWidgets_INCLUDE_DIRS ${wxWidgets_INCLUDE_DIR})
else ()
DBG_MSG("wxWidgets_FOUND FALSE because ${wxWidgets_INCLUDE_DIR}/wx/setup.h does not exists.")
set(wxWidgets_FOUND FALSE)
endif ()
# Set wxWidgets main include directory.
if (EXISTS ${wxWidgets_ROOT_DIR}/include/wx/wx.h)
list(APPEND wxWidgets_INCLUDE_DIRS ${wxWidgets_ROOT_DIR}/include)
else ()
DBG_MSG("wxWidgets_FOUND FALSE because wxWidgets_ROOT_DIR=${wxWidgets_ROOT_DIR} has no ${wxWidgets_ROOT_DIR}/include/wx/wx.h")
set(wxWidgets_FOUND FALSE)
endif ()
DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}")
# Get configuration parameters from the name.
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
# Find wxWidgets libraries.
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
if (WX_USE_REL_AND_DBG)
WX_FIND_LIBS("${UNV}" "${UCD}" "d")
endif ()
# Settings for requested libs (i.e., include dir, libraries, etc.).
WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}")
# Add necessary definitions for unicode builds
if ("${UCD}" STREQUAL "u")
list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
endif ()
# Add necessary definitions for debug builds
set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
else()
if(BUILD_SHARED_LIBS)
find_path(wxWidgets_LIB_DIR
NAMES
@@ -617,7 +550,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
DOC "Path to wxWidgets libraries"
NO_DEFAULT_PATH
)
endif()
endif()
# If wxWidgets_LIB_DIR changed, clear all libraries.
@@ -675,7 +607,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
endif()
# Get configuration parameters from the name.
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} PF UNV UCD DBG)
# Set wxWidgets lib setup include directory.
if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
@@ -695,9 +627,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
endif()
# Find wxWidgets libraries.
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
WX_FIND_LIBS("${PF}" "${UNV}" "${UCD}" "${DBG}")
if(WX_USE_REL_AND_DBG)
WX_FIND_LIBS("${UNV}" "${UCD}" "d")
WX_FIND_LIBS("${PF}" "${UNV}" "${UCD}" "d")
endif()
# Settings for requested libs (i.e., include dir, libraries, etc.).
+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-2021 KiCad Developers, see AUTHORS.txt for contributors.
# Copyright (C) 2016-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
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "6.0.4" )
set( KICAD_SEMANTIC_VERSION "6.0.7" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+3 -3
View File
@@ -619,8 +619,8 @@ set( TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp" )
# generate logs is useful only if you have problems
set( CREATE_LOG_FILES true )
set( BITMAP_INFO_FILE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.h" )
set( BITMAP_INFO_TEMPLATE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.h.in" )
set( BITMAP_INFO_FILE "${CMAKE_SOURCE_DIR}/common/bitmap_info.cpp" )
set( BITMAP_INFO_TEMPLATE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.cpp.in" )
set( BITMAP_INFO_LIST "" )
set( ALL_PNGS "" )
@@ -739,7 +739,7 @@ function( bitmap_dir pngWidth pngHeight bmapList )
png2png( ${tmpFile} ${pngPath} )
set( bitmapInfo
" { BITMAPS::${bmn}, wxT( \"${pngFile}\" ), ${pngHeight}, wxT( \"${theme}\" ) },\n"
" aBitmapInfoCache[BITMAPS::${bmn}].emplace_back( BITMAPS::${bmn}, wxT( \"${pngFile}\" ), ${pngHeight}, wxT( \"${theme}\" ) );\n"
)
set( BITMAP_INFO_LIST "${BITMAP_INFO_LIST}${bitmapInfo}" )
+1
View File
@@ -315,6 +315,7 @@ set( COMMON_SRCS
bin_mod.cpp
bitmap.cpp
bitmap_base.cpp
bitmap_info.cpp
bitmap_store.cpp
board_printout.cpp
build_version.cpp
+3 -8
View File
@@ -226,22 +226,17 @@ wxString StringFromValue( EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol,
if( value_to_print != 0.0 && fabs( value_to_print ) <= 0.0001 )
{
len = sprintf( buf, "%.10f", value_to_print );
len = snprintf( buf, sizeof( buf ) - 1, "%.10f", value_to_print );
while( --len > 0 && buf[len] == '0' )
buf[len] = '\0';
if( buf[len]=='.' || buf[len]==',' )
if( len >= 0 && ( buf[len]=='.' || buf[len]==',' ) )
buf[len] = '\0';
else
++len;
}
else
{
if( aUnits == EDA_UNITS::MILS )
len = sprintf( buf, "%.7g", value_to_print );
else
len = sprintf( buf, "%.10g", value_to_print );
snprintf( buf, sizeof( buf ) - 1, "%.10g", value_to_print );
}
wxString stringValue( buf, wxConvUTF8 );
File diff suppressed because it is too large Load Diff
+6 -8
View File
@@ -101,7 +101,7 @@ BITMAP_STORE::BITMAP_STORE()
{
wxFileName path( PATHS::GetStockDataPath() + wxT( "/resources" ), IMAGE_ARCHIVE );
wxLogTrace( traceBitmaps, wxT( "Loading bitmaps from " ) + path.GetFullPath() );
wxLogTrace( traceBitmaps, "Loading bitmaps from " + path.GetFullPath() );
m_archive = std::make_unique<ASSET_ARCHIVE>( path.GetFullPath() );
@@ -148,8 +148,8 @@ wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight )
if( count < 0 )
{
wxLogTrace( traceBitmaps, wxT( "Bitmap for %d, %d, %s has an info tag with file %s," )
wxT( "but that file could not be found in the archive!" ),
wxLogTrace( traceBitmaps, "Bitmap for %d, %d, %s has an info tag with file %s,"
"but that file could not be found in the archive!",
aBitmapId, aHeight, m_theme );
data = s_imageNotFound;
count = sizeof( s_imageNotFound );
@@ -158,7 +158,6 @@ wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight )
wxMemoryInputStream is( data, count );
wxImage image( is, wxBITMAP_TYPE_PNG );
wxBitmap bitmap( image );
return image;
}
@@ -205,7 +204,7 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight )
{
if( !m_bitmapInfoCache.count( aBitmapId ) )
{
wxLogTrace( traceBitmaps, wxT( "No bitmap info available for %d" ), aBitmapId );
wxLogTrace( traceBitmaps, "No bitmap info available for %d", aBitmapId );
return wxEmptyString;
}
@@ -225,7 +224,7 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight )
if( fn.IsEmpty() )
{
wxLogTrace( traceBitmaps, wxT( "No bitmap found matching ID %d, height %d, theme %s" ),
wxLogTrace( traceBitmaps, "No bitmap found matching ID %d, height %d, theme %s",
aBitmapId, aHeight, m_theme );
return m_bitmapInfoCache.at( aBitmapId ).begin()->filename;
}
@@ -236,6 +235,5 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight )
void BITMAP_STORE::buildBitmapInfoCache()
{
for( const BITMAP_INFO& entry : g_BitmapInfo )
m_bitmapInfoCache[entry.id].emplace_back( entry );
BuildBitmapInfo( m_bitmapInfoCache );
}
+4
View File
@@ -116,6 +116,10 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
{
for( int i = 0; i < LAYER_ID_COUNT; ++i )
dstSettings->SetLayerColor( i, COLOR4D::BLACK );
// In B&W mode, draw the background only in wxhite, because any other color
// will be replaced by a black background
dstSettings->SetBackgroundColor( COLOR4D::WHITE );
}
else // color enabled
{
+7
View File
@@ -25,6 +25,7 @@
#include <dialog_shim.h>
#include <ignore.h>
#include <kiway_player.h>
#include <kiway.h>
#include <pgm_base.h>
#include <tool/tool_manager.h>
#include <kiplatform/ui.h>
@@ -122,6 +123,9 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
if( kiwayHolder )
SetKiway( this, &kiwayHolder->Kiway() );
if( HasKiway() )
Kiway().SetBlockingDialog( this );
Bind( wxEVT_CLOSE_WINDOW, &DIALOG_SHIM::OnCloseWindow, this );
Bind( wxEVT_BUTTON, &DIALOG_SHIM::OnButton, this );
@@ -143,6 +147,9 @@ DIALOG_SHIM::~DIALOG_SHIM()
if( IsQuasiModal() )
EndQuasiModal( wxID_CANCEL );
if( HasKiway() )
Kiway().SetBlockingDialog( nullptr );
if( m_qmodal_parent_disabler )
delete m_qmodal_parent_disabler; // usually NULL by now
}
+1 -2
View File
@@ -152,9 +152,8 @@ wxString DS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase )
}
else if( m_titleBlock )
{
m_titleBlock->TextVarResolver( token, m_project );
// no need for tokenUpdated; TextVarResolver() did a full resolve
return true;
return m_titleBlock->TextVarResolver( token, m_project );
}
if( tokenUpdated )
+1 -6
View File
@@ -71,19 +71,14 @@ static const wxFileTypeInfo EDAfallbacks[] =
};
bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT* aProject )
bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT* aProject, SEARCH_STACK* aPaths )
{
SEARCH_STACK* aPaths = nullptr;
wxString docname;
wxString fullfilename;
wxString msg;
wxString command;
bool success = false;
#if defined( EESCHEMA )
SEARCH_STACK* aPaths = aProject ? aProject->SchSearchS() : nullptr;
#endif
// Is an internet url
static const std::vector<wxString> url_header =
{
+7 -1
View File
@@ -387,6 +387,9 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
UpdateStatusBar();
m_canvas->Refresh();
// Needed on Windows because clicking on m_gridSelectBox remove the focus from m_canvas
// (Windows specific
m_canvas->SetFocus();
}
@@ -463,6 +466,9 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
m_toolManager->RunAction( ACTIONS::zoomPreset, true, static_cast<intptr_t>( id ) );
UpdateStatusBar();
m_canvas->Refresh();
// Needed on Windows because clicking on m_zoomSelectBox remove the focus from m_canvas
// (Windows specific
m_canvas->SetFocus();
}
@@ -694,7 +700,7 @@ void EDA_DRAW_FRAME::SetMsgPanel( EDA_ITEM* aItem )
void EDA_DRAW_FRAME::UpdateMsgPanel()
{
GetToolManager()->PostEvent( EVENTS::SelectedItemsModified );
GetToolManager()->ProcessEvent( EVENTS::SelectedItemsModified );
}
+1
View File
@@ -320,6 +320,7 @@ static struct EDA_ITEM_DESC
.Map( PCB_FP_SHAPE_T, _HKI( "Graphic" ) )
.Map( PCB_FP_ZONE_T, _HKI( "Zone" ) )
.Map( PCB_TRACE_T, _HKI( "Track" ) )
.Map( PCB_ARC_T, _HKI( "Track" ) )
.Map( PCB_VIA_T, _HKI( "Via" ) )
.Map( PCB_MARKER_T, _HKI( "Marker" ) )
.Map( PCB_DIM_ALIGNED_T, _HKI( "Dimension" ) )
+13 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 Ian McInerney <Ian.S.McInerney@ieee.org>
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 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
@@ -165,6 +165,18 @@ void FILE_HISTORY::doAddClearItem( wxMenu* aMenu )
}
void FILE_HISTORY::UpdateClearText( wxMenu* aMenu, wxString aClearText )
{
size_t itemPos;
wxMenuItem* clearItem = aMenu->FindChildItem( m_clearId, &itemPos );
if( clearItem && itemPos > 1 ) // clearItem is the last menu, after a separator
{
clearItem->SetItemLabel( aClearText );
}
}
void FILE_HISTORY::ClearFileHistory()
{
while( GetCount() > 0 )
+1 -1
View File
@@ -106,7 +106,7 @@ bool SHADER::Link()
// Check the Link state
GLint tmp;
glGetObjectParameterivARB( programNumber, GL_OBJECT_LINK_STATUS_ARB, &tmp );
glGetProgramiv( programNumber, GL_LINK_STATUS, &tmp );
isShaderLinked = !!tmp;
#ifdef DEBUG
+8 -2
View File
@@ -40,8 +40,14 @@
// boost:mt19937 is not thread-safe
static std::mutex rng_mutex;
// Create only once, as seeding is *very* expensive
static boost::mt19937 rng;
// 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 );
// These don't have the same performance penalty, but we might as well be consistent
+14 -1
View File
@@ -50,7 +50,7 @@ int KIWAY::m_kiface_version[KIWAY_FACE_COUNT];
KIWAY::KIWAY( PGM_BASE* aProgram, int aCtlBits, wxFrame* aTop ):
m_program( aProgram ), m_ctl( aCtlBits ), m_top( nullptr )
m_program( aProgram ), m_ctl( aCtlBits ), m_top( nullptr ), m_blockingDialog( wxID_NONE )
{
SetTop( aTop ); // hook player_destroy_handler() into aTop.
@@ -606,6 +606,19 @@ void KIWAY::ProjectChanged()
}
}
wxWindow* KIWAY::GetBlockingDialog()
{
return wxWindow::FindWindowById( m_blockingDialog );
}
void KIWAY::SetBlockingDialog( wxWindow* aWin )
{
if( !aWin )
m_blockingDialog = wxID_NONE;
else
m_blockingDialog = aWin->GetId();
}
bool KIWAY::ProcessEvent( wxEvent& aEvent )
{
+63 -60
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 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
@@ -23,79 +23,82 @@
/**
* Returns the default display name for a given layer. These are not the same as the canonical
* name in LSET::Name(), which is used in board files and cannot be translated or changed.
* WARNING: do not translate board physical layers names (F.Cu to User.9): because canonical names
* are used in files (boards and fab files), using translated names in UI create mistakes for users.
* Board physical layers names must be seen as proper nouns.
*/
wxString LayerName( int aLayer )
{
switch( aLayer )
{
// PCB_LAYER_ID
case F_Cu: return _( "F.Cu" );
case In1_Cu: return _( "In1.Cu" );
case In2_Cu: return _( "In2.Cu" );
case In3_Cu: return _( "In3.Cu" );
case In4_Cu: return _( "In4.Cu" );
case In5_Cu: return _( "In5.Cu" );
case In6_Cu: return _( "In6.Cu" );
case In7_Cu: return _( "In7.Cu" );
case In8_Cu: return _( "In8.Cu" );
case In9_Cu: return _( "In9.Cu" );
case In10_Cu: return _( "In10.Cu" );
case In11_Cu: return _( "In11.Cu" );
case In12_Cu: return _( "In12.Cu" );
case In13_Cu: return _( "In13.Cu" );
case In14_Cu: return _( "In14.Cu" );
case In15_Cu: return _( "In15.Cu" );
case In16_Cu: return _( "In16.Cu" );
case In17_Cu: return _( "In17.Cu" );
case In18_Cu: return _( "In18.Cu" );
case In19_Cu: return _( "In19.Cu" );
case In20_Cu: return _( "In20.Cu" );
case In21_Cu: return _( "In21.Cu" );
case In22_Cu: return _( "In22.Cu" );
case In23_Cu: return _( "In23.Cu" );
case In24_Cu: return _( "In24.Cu" );
case In25_Cu: return _( "In25.Cu" );
case In26_Cu: return _( "In26.Cu" );
case In27_Cu: return _( "In27.Cu" );
case In28_Cu: return _( "In28.Cu" );
case In29_Cu: return _( "In29.Cu" );
case In30_Cu: return _( "In30.Cu" );
case B_Cu: return _( "B.Cu" );
case F_Cu: return wxT( "F.Cu" );
case In1_Cu: return wxT( "In1.Cu" );
case In2_Cu: return wxT( "In2.Cu" );
case In3_Cu: return wxT( "In3.Cu" );
case In4_Cu: return wxT( "In4.Cu" );
case In5_Cu: return wxT( "In5.Cu" );
case In6_Cu: return wxT( "In6.Cu" );
case In7_Cu: return wxT( "In7.Cu" );
case In8_Cu: return wxT( "In8.Cu" );
case In9_Cu: return wxT( "In9.Cu" );
case In10_Cu: return wxT( "In10.Cu" );
case In11_Cu: return wxT( "In11.Cu" );
case In12_Cu: return wxT( "In12.Cu" );
case In13_Cu: return wxT( "In13.Cu" );
case In14_Cu: return wxT( "In14.Cu" );
case In15_Cu: return wxT( "In15.Cu" );
case In16_Cu: return wxT( "In16.Cu" );
case In17_Cu: return wxT( "In17.Cu" );
case In18_Cu: return wxT( "In18.Cu" );
case In19_Cu: return wxT( "In19.Cu" );
case In20_Cu: return wxT( "In20.Cu" );
case In21_Cu: return wxT( "In21.Cu" );
case In22_Cu: return wxT( "In22.Cu" );
case In23_Cu: return wxT( "In23.Cu" );
case In24_Cu: return wxT( "In24.Cu" );
case In25_Cu: return wxT( "In25.Cu" );
case In26_Cu: return wxT( "In26.Cu" );
case In27_Cu: return wxT( "In27.Cu" );
case In28_Cu: return wxT( "In28.Cu" );
case In29_Cu: return wxT( "In29.Cu" );
case In30_Cu: return wxT( "In30.Cu" );
case B_Cu: return wxT( "B.Cu" );
// Technicals
case B_Adhes: return _( "B.Adhesive" );
case F_Adhes: return _( "F.Adhesive" );
case B_Paste: return _( "B.Paste" );
case F_Paste: return _( "F.Paste" );
case B_SilkS: return _( "B.Silkscreen" );
case F_SilkS: return _( "F.Silkscreen" );
case B_Mask: return _( "B.Mask" );
case F_Mask: return _( "F.Mask" );
case B_Adhes: return wxT( "B.Adhesive" );
case F_Adhes: return wxT( "F.Adhesive" );
case B_Paste: return wxT( "B.Paste" );
case F_Paste: return wxT( "F.Paste" );
case B_SilkS: return wxT( "B.Silkscreen" );
case F_SilkS: return wxT( "F.Silkscreen" );
case B_Mask: return wxT( "B.Mask" );
case F_Mask: return wxT( "F.Mask" );
// Users
case Dwgs_User: return _( "User.Drawings" );
case Cmts_User: return _( "User.Comments" );
case Eco1_User: return _( "User.Eco1" );
case Eco2_User: return _( "User.Eco2" );
case Edge_Cuts: return _( "Edge.Cuts" );
case Margin: return _( "Margin" );
case Dwgs_User: return wxT( "User.Drawings" );
case Cmts_User: return wxT( "User.Comments" );
case Eco1_User: return wxT( "User.Eco1" );
case Eco2_User: return wxT( "User.Eco2" );
case Edge_Cuts: return wxT( "Edge.Cuts" );
case Margin: return wxT( "Margin" );
// Footprint
case F_CrtYd: return _( "F.Courtyard" );
case B_CrtYd: return _( "B.Courtyard" );
case F_Fab: return _( "F.Fab" );
case B_Fab: return _( "B.Fab" );
case F_CrtYd: return wxT( "F.Courtyard" );
case B_CrtYd: return wxT( "B.Courtyard" );
case F_Fab: return wxT( "F.Fab" );
case B_Fab: return wxT( "B.Fab" );
// User definable layers.
case User_1: return _( "User.1" );
case User_2: return _( "User.2" );
case User_3: return _( "User.3" );
case User_4: return _( "User.4" );
case User_5: return _( "User.5" );
case User_6: return _( "User.6" );
case User_7: return _( "User.7" );
case User_8: return _( "User.8" );
case User_9: return _( "User.9" );
case User_1: return wxT( "User.1" );
case User_2: return wxT( "User.2" );
case User_3: return wxT( "User.3" );
case User_4: return wxT( "User.4" );
case User_5: return wxT( "User.5" );
case User_6: return wxT( "User.6" );
case User_7: return wxT( "User.7" );
case User_8: return wxT( "User.8" );
case User_9: return wxT( "User.9" );
// Rescue
case Rescue: return _( "Rescue" );
+4 -4
View File
@@ -203,7 +203,7 @@ wxString PATHS::GetStockSymbolsPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/symbols" );
path = GetStockEDALibraryPath() + wxT( "/symbols" );
return path;
}
@@ -213,7 +213,7 @@ wxString PATHS::GetStockFootprintsPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/footprints" );
path = GetStockEDALibraryPath() + wxT( "/footprints" );
return path;
}
@@ -223,7 +223,7 @@ wxString PATHS::GetStock3dmodelsPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/3dmodels" );
path = GetStockEDALibraryPath() + wxT( "/3dmodels" );
return path;
}
@@ -243,7 +243,7 @@ wxString PATHS::GetStockTemplatesPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/template" );
path = GetStockEDALibraryPath() + wxT( "/template" );
return path;
}
+1 -1
View File
@@ -384,7 +384,7 @@ void PGM_BASE::SaveCommonSettings()
COMMON_SETTINGS* PGM_BASE::GetCommonSettings() const
{
return m_settings_manager ? GetSettingsManager().GetCommonSettings() : nullptr;
return m_settings_manager ? m_settings_manager->GetCommonSettings() : nullptr;
}
+3 -7
View File
@@ -1252,7 +1252,7 @@ void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, OUTLINE_M
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
Circle( pos, diametre - m_currentPenWidth, FILL_T::NO_FILL, DO_NOT_SET_LINE_WIDTH );
Circle( pos, diametre, FILL_T::NO_FILL, DO_NOT_SET_LINE_WIDTH );
}
else
{
@@ -1372,10 +1372,8 @@ void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
Rect( wxPoint( pos.x - (size.x - GetCurrentLineWidth()) / 2,
pos.y - (size.y - GetCurrentLineWidth()) / 2 ),
wxPoint( pos.x + (size.x - GetCurrentLineWidth()) / 2,
pos.y + (size.y - GetCurrentLineWidth()) / 2 ),
Rect( wxPoint( pos.x - ( size.x / 2 ), pos.y - ( size.y / 2 ) ),
wxPoint( pos.x + ( size.x / 2 ), pos.y + ( size.y / 2 ) ),
FILL_T::NO_FILL, GetCurrentLineWidth() );
}
else
@@ -1445,7 +1443,6 @@ void GERBER_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS
0.0, 0, 0, GetPlotterArcHighDef(), ERROR_INSIDE );
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, &gbr_metadata );
outline.Inflate( -GetCurrentLineWidth()/2, 16 );
std::vector< wxPoint > cornerList;
// TransformRoundRectToPolygon creates only one convex polygon
@@ -1657,7 +1654,6 @@ void GERBER_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize
if( aTraceMode != FILLED )
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, &gbr_metadata );
polyshape.Inflate( -GetCurrentLineWidth()/2, 16 );
}
std::vector< wxPoint > cornerList;
+5 -5
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* 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
@@ -486,7 +486,7 @@ void HPGL_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList, FILL_T aFi
m_current_item->content << hpgl_end_polygon_cmd; // Close, fill polygon and draw outlines
m_current_item->pen_returns = true;
}
else if( aWidth > 0 )
else if( aWidth != 0 )
{
// Plot only the polygon outline.
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
@@ -659,10 +659,10 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
// if filled mode, the pen diameter is removed from diameter
// to keep the pad size
radius -= KiROUND( penDiameter ) / 2;
}
if( radius < 0 )
radius = 0;
if( radius < 0 )
radius = 0;
}
double rsize = userToDeviceSize( radius );
+2 -39
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* 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
@@ -127,13 +127,7 @@ void PSLIKE_PLOTTER::FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
else // Plot a ring:
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
int linewidth = GetCurrentLineWidth();
// avoid aDiameter <= 1 )
if( linewidth > aDiameter-2 )
linewidth = aDiameter-2;
Circle( aPadPos, aDiameter - linewidth, FILL_T::NO_FILL, linewidth );
Circle( aPadPos, aDiameter, FILL_T::NO_FILL, GetCurrentLineWidth() );
}
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
@@ -152,15 +146,6 @@ void PSLIKE_PLOTTER::FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
else
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
size.x -= GetCurrentLineWidth();
size.y -= GetCurrentLineWidth();
if( size.x < 1 )
size.x = 1;
if( size.y < 1 )
size.y = 1;
int dx = size.x / 2;
int dy = size.y / 2;
@@ -203,9 +188,6 @@ void PSLIKE_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS
else
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
size.x -= GetCurrentLineWidth();
size.y -= GetCurrentLineWidth();
aCornerRadius -= GetCurrentLineWidth() / 2;
}
@@ -243,8 +225,6 @@ void PSLIKE_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize
else
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
size.x -= GetCurrentLineWidth();
size.y -= GetCurrentLineWidth();
}
@@ -283,23 +263,6 @@ void PSLIKE_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCor
else
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
int w = GetCurrentLineWidth();
// offset polygon by w
// coord[0] is assumed the lower left
// coord[1] is assumed the upper left
// coord[2] is assumed the upper right
// coord[3] is assumed the lower right
/* Trace the outline. */
cornerList[0].x += w;
cornerList[0].y -= w;
cornerList[1].x += w;
cornerList[1].y += w;
cornerList[2].x -= w;
cornerList[2].y += w;
cornerList[3].x -= w;
cornerList[3].y -= w;
}
for( int ii = 0; ii < 4; ii++ )
+2 -8
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* 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
@@ -93,12 +93,6 @@ DPOINT PLOTTER::userToDeviceCoordinates( const wxPoint& aCoordinate )
{
wxPoint pos = aCoordinate - m_plotOffset;
// Don't allow overflows; they can cause rendering failures in some file viewers
// (such as Acrobat)
int clampSize = MAX_PAGE_SIZE_MILS * m_IUsPerDecimil * 10 / 2;
pos.x = std::max( -clampSize, std::min( pos.x, clampSize ) );
pos.y = std::max( -clampSize, std::min( pos.y, clampSize ) );
double x = pos.x * m_plotScale;
double y = ( m_paperSize.y - pos.y * m_plotScale );
@@ -492,7 +486,7 @@ void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, double orient
}
deltaxy = size.y - size.x; /* distance between centers of the oval */
radius = ( size.x - width ) / 2;
radius = size.x / 2;
cx = -radius;
cy = -deltaxy / 2;
RotatePoint( &cx, &cy, orient );
@@ -2258,6 +2258,10 @@ void CADSTAR_ARCHIVE_PARSER::ATTRCOLORS::Parse( XNODE* aNode, PARSER_CONTEXT* aC
attrcol.Parse( cNode, aContext );
AttributeColors.insert( { attrcol.AttributeID, attrcol } );
}
else if( cNodeName == wxT( "INVISIBLE" ) )
{
IsVisible = false;
}
else
{
THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
@@ -1253,6 +1253,8 @@ public:
DFLTSETTINGS DefaultSettings;
std::map<ATTRIBUTE_ID, ATTRCOL> AttributeColors;
bool IsVisible = true; // unclear what this represents - maybe all attributes are hidden?
void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
};
+9 -7
View File
@@ -538,18 +538,20 @@ EDIMENSION::EDIMENSION( wxXmlNode* aDimension )
y2 %Coord; #REQUIRED
x3 %Coord; #REQUIRED
y3 %Coord; #REQUIRED
textsize %Coord;
layer %Layer; #REQUIRED
dtype %DimensionType; "parallel"
>
*/
x1 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x1" ) );
y1 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y1" ) );
x2 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x2" ) );
y2 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y2" ) );
x3 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x3" ) );
y3 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y3" ) );
layer = parseRequiredAttribute<int>( aDimension, wxT( "layer" ) );
x1 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x1" ) );
y1 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y1" ) );
x2 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x2" ) );
y2 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y2" ) );
x3 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x3" ) );
y3 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y3" ) );
textsize = parseOptionalAttribute<ECOORD>( aDimension, wxT( "textsize" ) );
layer = parseRequiredAttribute<int>( aDimension, wxT( "layer" ) );
dimensionType = parseOptionalAttribute<wxString>( aDimension, wxT( "dtype" ) );
}
+14 -14
View File
@@ -531,13 +531,13 @@ struct EJUNCTION
/// Eagle label
struct ELABEL
{
ECOORD x;
ECOORD y;
ECOORD size;
LAYER_NUM layer;
opt_erot rot;
ECOORD x;
ECOORD y;
ECOORD size;
LAYER_NUM layer;
opt_erot rot;
opt_wxString xref;
wxString netname;
wxString netname;
ELABEL( wxXmlNode* aLabel, const wxString& aNetName );
};
@@ -619,14 +619,14 @@ struct EATTR
/// Eagle dimension element
struct EDIMENSION
{
ECOORD x1;
ECOORD y1;
ECOORD x2;
ECOORD y2;
ECOORD x3;
ECOORD y3;
int layer;
ECOORD x1;
ECOORD y1;
ECOORD x2;
ECOORD y2;
ECOORD x3;
ECOORD y3;
opt_ecoord textsize;
int layer;
opt_wxString dimensionType;
EDIMENSION( wxXmlNode* aDimension );
+7 -1
View File
@@ -37,6 +37,8 @@ SCINTILLA_TRICKS::SCINTILLA_TRICKS( wxStyledTextCtrl* aScintilla, const wxString
m_te( aScintilla ),
m_braces( aBraces ),
m_lastCaretPos( -1 ),
m_lastSelStart( -1 ),
m_lastSelEnd( -1 ),
m_suppressAutocomplete( false ),
m_singleLine( aSingleLine ),
m_returnCallback( aReturnCallback )
@@ -337,10 +339,14 @@ void SCINTILLA_TRICKS::onScintillaUpdateUI( wxStyledTextEvent& aEvent )
// Has the caret changed position?
int caretPos = m_te->GetCurrentPos();
int selStart = m_te->GetSelectionStart();
int selEnd = m_te->GetSelectionEnd();
if( m_lastCaretPos != caretPos )
if( m_lastCaretPos != caretPos || m_lastSelStart != selStart || m_lastSelEnd != selEnd )
{
m_lastCaretPos = caretPos;
m_lastSelStart = selStart;
m_lastSelEnd = selEnd;
int bracePos1 = -1;
int bracePos2 = -1;
+5
View File
@@ -96,7 +96,12 @@ static struct PGM_SINGLE_TOP : public PGM_BASE
KIWAY_PLAYER* frame = (KIWAY_PLAYER*) App().GetTopWindow();
#endif
if( frame )
{
if( wxWindow* blocking_win = frame->Kiway().GetBlockingDialog() )
blocking_win->Close( true );
frame->OpenProjectFiles( std::vector<wxString>( 1, aFileName ) );
}
}
}
+12 -2
View File
@@ -142,7 +142,15 @@ bool ConvertSmartQuotesAndDashes( wxString* aString )
wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
{
wxString converted;
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() );
@@ -159,7 +167,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
}
else if( aContext == CTX_LIBID )
{
if( c == '{' )
if( c == '{' && !hasFormattingPrefix() )
converted += wxT( "{brace}" );
else if( c == '/' )
converted += wxT( "{slash}" );
@@ -227,7 +235,9 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
converted += c;
}
else
{
converted += c;
}
}
return converted;
+5 -6
View File
@@ -183,21 +183,20 @@ wxMenuItem* ACTION_MENU::Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry
wxMenuItem* ACTION_MENU::Add( ACTION_MENU* aMenu )
{
ACTION_MENU* menuCopy = aMenu->Clone();
m_submenus.push_back( menuCopy );
m_submenus.push_back( aMenu );
wxASSERT_MSG( !menuCopy->m_title.IsEmpty(), wxT( "Set a title for ACTION_MENU using SetTitle()" ) );
wxASSERT_MSG( !aMenu->m_title.IsEmpty(), wxT( "Set a title for ACTION_MENU using SetTitle()" ) );
if( !!aMenu->m_icon )
{
wxMenuItem* newItem = new wxMenuItem( this, -1, menuCopy->m_title );
wxMenuItem* newItem = new wxMenuItem( this, -1, aMenu->m_title );
AddBitmapToMenuItem( newItem, KiBitmap( aMenu->m_icon ) );
newItem->SetSubMenu( menuCopy );
newItem->SetSubMenu( aMenu );
return Append( newItem );
}
else
{
return AppendSubMenu( menuCopy, menuCopy->m_title );
return AppendSubMenu( aMenu, aMenu->m_title );
}
}
+5
View File
@@ -335,7 +335,12 @@ void ACTION_TOOLBAR::doSelectAction( ACTION_GROUP* aGroup, const TOOL_ACTION& aA
// Update the item information
item->SetShortHelp( aAction.GetDescription() );
item->SetBitmap( KiScaledBitmap( aAction.GetIcon(), GetParent() ) );
#if wxCHECK_VERSION( 3, 1, 6 )
item->SetDisabledBitmap(
MakeDisabledBitmap( item->GetBitmapBundle().GetBitmapFor( GetParent() ) ) );
#else
item->SetDisabledBitmap( MakeDisabledBitmap( item->GetBitmap() ) );
#endif
// Register a new handler with the new UI conditions
if( m_toolManager )
+7
View File
@@ -177,6 +177,13 @@ int COMMON_CONTROL::ShowPlayer( const TOOL_EVENT& aEvent )
if( wxWindow::FindFocus() != editor )
editor->SetFocus();
// If the player is currently blocked, focus the user attention on the correct window
if( wxWindow* blocking_win = editor->Kiway().GetBlockingDialog() )
{
blocking_win->Raise();
blocking_win->SetFocus();
}
return 0;
}
+1 -1
View File
@@ -150,7 +150,7 @@ void CONDITIONAL_MENU::Evaluate( SELECTION& aSelection )
case ENTRY::MENU:
entry.Menu()->UpdateTitle();
Add( entry.Menu() );
Add( entry.Menu()->Clone() );
menu_count++;
break;
+1 -1
View File
@@ -452,7 +452,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
{
wxWindow* holderWindow = dynamic_cast<wxWindow*>( m_toolMgr->GetToolHolder() );
#if defined( _WIN32 )
#if defined( _WIN32 ) || defined( __WXGTK__ )
// Mouse events may trigger regardless of window status (windows feature)
// However we need to avoid focus fighting (especially modals)
if( holderWindow && KIPLATFORM::UI::IsWindowActive( holderWindow ) )
+22 -1
View File
@@ -206,7 +206,8 @@ TOOL_MANAGER::TOOL_MANAGER() :
m_warpMouseAfterContextMenu( true ),
m_menuActive( false ),
m_menuOwner( -1 ),
m_activeState( nullptr )
m_activeState( nullptr ),
m_shuttingDown( false )
{
m_actionMgr = new ACTION_MANAGER( this );
}
@@ -313,6 +314,9 @@ VECTOR2D TOOL_MANAGER::GetCursorPosition() const
bool TOOL_MANAGER::RunAction( const TOOL_ACTION& aAction, bool aNow, void* aParam )
{
if( m_shuttingDown )
return true;
bool handled = false;
TOOL_EVENT event = aAction.MakeEvent();
@@ -446,10 +450,22 @@ bool TOOL_MANAGER::runTool( TOOL_BASE* aTool )
void TOOL_MANAGER::ShutdownAllTools()
{
m_shuttingDown = true;
// Create a temporary list of tools to iterate over since when the tools shutdown
// they remove themselves from the list automatically (invalidating the iterator)
ID_LIST tmpList = m_activeTools;
// Make sure each tool knows that it is shutting down, so that loops get shut down
// at the dispatcher
for( auto id : tmpList )
{
if( m_toolIdIndex.count( id ) == 0 )
continue;
m_toolIdIndex[id]->shutdown = true;
}
for( auto id : tmpList )
{
ShutdownTool( id );
@@ -949,6 +965,11 @@ TOOL_MANAGER::ID_LIST::iterator TOOL_MANAGER::finishTool( TOOL_STATE* aState )
bool TOOL_MANAGER::ProcessEvent( const TOOL_EVENT& aEvent )
{
// Once the tool manager is shutting down, don't start
// activating more tools
if( m_shuttingDown )
return true;
bool handled = processEvent( aEvent );
TOOL_STATE* activeTool = GetCurrentToolState();
+25 -17
View File
@@ -36,6 +36,7 @@
#include <trace_helpers.h>
#include <settings/common_settings.h>
#include <math/util.h> // for KiROUND
#include <geometry/geometry_utils.h>
#include <widgets/ui_common.h>
#include <class_draw_panel_gal.h>
#include <kiplatform/ui.h>
@@ -300,7 +301,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
}
if( m_updateCursor ) // do not update the cursor position if it was explicitly set
m_cursorPos = m_view->ToWorld( mousePos );
m_cursorPos = GetClampedCoords( m_view->ToWorld( mousePos ) );
else
m_updateCursor = true;
@@ -458,8 +459,8 @@ void WX_VIEW_CONTROLS::onEnter( wxMouseEvent& aEvent )
return;
}
#if defined( _WIN32 )
// Win32 transmits mouse move and wheel events to all controls below the mouse regardless
#if defined( _WIN32 ) || defined( __WXGTK__ )
// Win32 and some *nix WMs transmit mouse move and wheel events to all controls below the mouse regardless
// of focus. Forcing the focus here will cause the EDA FRAMES to immediately become the
// top level active window.
if( m_parentPanel->GetParent() != nullptr )
@@ -648,7 +649,7 @@ VECTOR2D WX_VIEW_CONTROLS::GetMousePosition( bool aWorldCoordinates ) const
wxPoint msp = getMouseScreenPosition();
VECTOR2D screenPos( msp.x, msp.y );
return aWorldCoordinates ? m_view->ToWorld( screenPos ) : screenPos;
return aWorldCoordinates ? GetClampedCoords( m_view->ToWorld( screenPos ) ) : screenPos;
}
@@ -675,7 +676,7 @@ VECTOR2D WX_VIEW_CONTROLS::GetCursorPosition( bool aEnableSnapping ) const
}
else
{
return GetRawCursorPosition( aEnableSnapping );
return GetClampedCoords( GetRawCursorPosition( aEnableSnapping ) );
}
}
@@ -685,10 +686,12 @@ void WX_VIEW_CONTROLS::SetCursorPosition( const VECTOR2D& aPosition, bool aWarpV
{
m_updateCursor = false;
VECTOR2D clampedPosition = GetClampedCoords( aPosition );
if( aTriggeredByArrows )
{
m_settings.m_lastKeyboardCursorPositionValid = true;
m_settings.m_lastKeyboardCursorPosition = aPosition;
m_settings.m_lastKeyboardCursorPosition = clampedPosition;
m_settings.m_lastKeyboardCursorCommand = aArrowCommand;
m_cursorWarped = false;
}
@@ -700,8 +703,8 @@ void WX_VIEW_CONTROLS::SetCursorPosition( const VECTOR2D& aPosition, bool aWarpV
m_cursorWarped = true;
}
WarpCursor( aPosition, true, aWarpView );
m_cursorPos = aPosition;
WarpCursor( clampedPosition, true, aWarpView );
m_cursorPos = clampedPosition;
}
@@ -710,14 +713,16 @@ void WX_VIEW_CONTROLS::SetCrossHairCursorPosition( const VECTOR2D& aPosition,
{
m_updateCursor = false;
VECTOR2D clampedPosition = GetClampedCoords( aPosition );
const VECTOR2I& screenSize = m_view->GetGAL()->GetScreenPixelSize();
BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
VECTOR2D screenPos = m_view->ToScreen( aPosition );
BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
VECTOR2D screenPos = m_view->ToScreen( clampedPosition );
if( aWarpView && !screen.Contains( screenPos ) )
m_view->SetCenter( aPosition );
m_view->SetCenter( clampedPosition );
m_cursorPos = aPosition;
m_cursorPos = clampedPosition;
}
@@ -727,14 +732,15 @@ void WX_VIEW_CONTROLS::WarpCursor( const VECTOR2D& aPosition, bool aWorldCoordin
if( aWorldCoordinates )
{
const VECTOR2I& screenSize = m_view->GetGAL()->GetScreenPixelSize();
BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
VECTOR2D screenPos = m_view->ToScreen( aPosition );
BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
VECTOR2D clampedPosition = GetClampedCoords( aPosition );
VECTOR2D screenPos = m_view->ToScreen( clampedPosition );
if( !screen.Contains( screenPos ) )
{
if( aWarpView )
{
m_view->SetCenter( aPosition );
m_view->SetCenter( clampedPosition );
m_parentPanel->WarpPointer( screenSize.x / 2, screenSize.y / 2 );
}
}
@@ -889,7 +895,7 @@ void WX_VIEW_CONTROLS::refreshMouse()
moveEvent.SetShiftDown( wxGetKeyState( WXK_SHIFT ) );
moveEvent.SetAltDown( wxGetKeyState( WXK_ALT ) );
m_cursorPos = m_view->ToWorld( VECTOR2D( msp.x, msp.y ) );
m_cursorPos = GetClampedCoords( m_view->ToWorld( VECTOR2D( msp.x, msp.y ) ) );
wxPostEvent( m_parentPanel, moveEvent );
}
@@ -943,6 +949,8 @@ void WX_VIEW_CONTROLS::UpdateScrollbars()
void WX_VIEW_CONTROLS::ForceCursorPosition( bool aEnabled, const VECTOR2D& aPosition )
{
VECTOR2D clampedPosition = GetClampedCoords( aPosition );
m_settings.m_forceCursorPosition = aEnabled;
m_settings.m_forcedPosition = aPosition;
m_settings.m_forcedPosition = clampedPosition;
}
+6 -4
View File
@@ -298,10 +298,11 @@ void GRID_CELL_FOOTPRINT_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
class TEXT_BUTTON_URL : public wxComboCtrl
{
public:
TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg ) :
TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg, SEARCH_STACK* aSearchStack ) :
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER ),
m_dlg( aParentDlg )
m_dlg( aParentDlg ),
m_searchStack( aSearchStack )
{
SetButtonBitmaps( KiBitmap( BITMAPS::www ) );
@@ -320,17 +321,18 @@ protected:
wxString filename = GetValue();
if( !filename.IsEmpty() && filename != wxT( "~" ) )
GetAssociatedDocument( m_dlg, GetValue(), &m_dlg->Prj() );
GetAssociatedDocument( m_dlg, GetValue(), &m_dlg->Prj(), m_searchStack );
}
DIALOG_SHIM* m_dlg;
SEARCH_STACK* m_searchStack;
};
void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
wxEvtHandler* aEventHandler )
{
m_control = new TEXT_BUTTON_URL( aParent, m_dlg );
m_control = new TEXT_BUTTON_URL( aParent, m_dlg, m_searchStack );
#if wxUSE_VALIDATORS
// validate text in textctrl, if validator is set
+1 -1
View File
@@ -250,7 +250,7 @@ bool UNIT_BINDER::Validate( double aMin, double aMax, EDA_UNITS aUnits )
}
void UNIT_BINDER::SetValue( int aValue )
void UNIT_BINDER::SetValue( long long int aValue )
{
double value = aValue;
double displayValue = m_originTransforms.ToDisplay( value, m_coordType );
+21
View File
@@ -40,6 +40,11 @@ WX_GRID::WX_GRID( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxS
// Make sure the GUI font scales properly on GTK
SetDefaultCellFont( KIUI::GetControlFont( this ) );
#if wxCHECK_VERSION( 3, 1, 0 )
Connect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this );
#endif
}
@@ -47,9 +52,25 @@ WX_GRID::~WX_GRID()
{
if( m_weOwnTable )
DestroyTable( GetTable() );
#if wxCHECK_VERSION( 3, 1, 0 )
Disconnect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this );
#endif
}
#if wxCHECK_VERSION( 3, 1, 0 )
void WX_GRID::onDPIChanged(wxDPIChangedEvent& aEvt)
{
/// This terrible hack is a way to avoid the incredibly disruptive resizing of grids that happens on Macs
/// when moving a window between monitors of different DPIs.
#ifndef __WXMAC__
aEvt.Skip();
#endif
}
#endif
void WX_GRID::SetColLabelSize( int aHeight )
{
if( aHeight == 0 )
+6 -4
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
@@ -94,7 +94,10 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList,
{
fn = wxExpandEnvVars( equfile );
tmp = search.FindValidPath( fn.GetFullPath() );
if( fn.IsAbsolute() || fn.FileExists() )
tmp = fn.GetFullPath();
else
tmp = search.FindValidPath( fn.GetFullPath() );
if( !tmp )
{
@@ -102,8 +105,7 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList,
if( aErrorMessages )
{
error_msg.Printf( _( "Equivalence file '%s' could not be found in the "
"default search paths." ),
error_msg.Printf( _( "Equivalence file '%s' could not be found." ),
fn.GetFullName() );
if( ! aErrorMessages->IsEmpty() )
+6 -5
View File
@@ -276,9 +276,10 @@ void CVPCB_MAINFRAME::setupUIConditions()
#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
mgr->SetConditions( CVPCB_ACTIONS::saveAssociations, ENABLE( cond.ContentModified() ) );
mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
mgr->SetConditions( CVPCB_ACTIONS::saveAssociationsToSchematic, ENABLE( cond.ContentModified() ) );
mgr->SetConditions( CVPCB_ACTIONS::saveAssociationsToFile, ENABLE( cond.ContentModified() ) );
mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
auto compFilter =
[this] ( const SELECTION& )
@@ -327,7 +328,7 @@ void CVPCB_MAINFRAME::setupEventHandlers()
[this]( wxCommandEvent& )
{
// saveAssociations must be run immediately
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociations, true );
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToFile, true );
} );
// Connect the handlers for the ok/cancel buttons
@@ -335,7 +336,7 @@ void CVPCB_MAINFRAME::setupEventHandlers()
[this]( wxCommandEvent& )
{
// saveAssociations must be run immediately, before running Close( true )
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociations, true );
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToSchematic, true );
Close( true );
}, wxID_OK );
Bind( wxEVT_BUTTON,
+1 -1
View File
@@ -46,7 +46,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
//
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
fileMenu->Add( CVPCB_ACTIONS::saveAssociations );
fileMenu->Add( CVPCB_ACTIONS::saveAssociationsToSchematic );
fileMenu->AppendSeparator();
fileMenu->AddClose( _( "Assign Footprints" ) );
+1 -1
View File
@@ -46,7 +46,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
m_mainToolBar->SetAuiManager( &m_auimgr );
}
m_mainToolBar->Add( CVPCB_ACTIONS::saveAssociations );
m_mainToolBar->Add( CVPCB_ACTIONS::saveAssociationsToSchematic );
m_mainToolBar->AddScaledSeparator( this );
m_mainToolBar->Add( ACTIONS::showFootprintLibTable );
+8 -1
View File
@@ -61,13 +61,20 @@ TOOL_ACTION CVPCB_ACTIONS::showEquFileTable( "cvpcb.Control.ShowEquFileTable",
_( "Configure footprint association file (.equ) list. These files are "
"used to automatically assign footprint names from symbol values." ) );
TOOL_ACTION CVPCB_ACTIONS::saveAssociations( "cvpcb.Control.SaveAssociations",
TOOL_ACTION CVPCB_ACTIONS::saveAssociationsToSchematic( "cvpcb.Control.SaveAssociationsToSchematic",
AS_GLOBAL,
MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
_( "Save to Schematic" ),
_( "Save footprint associations in schematic symbol footprint fields" ),
BITMAPS::save );
TOOL_ACTION CVPCB_ACTIONS::saveAssociationsToFile( "cvpcb.Control.SaveAssociationsToFile",
AS_GLOBAL,
MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
_( "Save to Schematic and File" ),
_( "Save footprint associations in schematic symbol footprint fields and schematic files" ),
BITMAPS::save );
// Actions to navigate the display
TOOL_ACTION CVPCB_ACTIONS::changeFocusRight( "cvpcb.Control.changeFocusRight",
AS_GLOBAL,
+2 -1
View File
@@ -53,7 +53,8 @@ public:
static TOOL_ACTION gotoNextNA;
/// Management actions
static TOOL_ACTION saveAssociations;
static TOOL_ACTION saveAssociationsToSchematic;
static TOOL_ACTION saveAssociationsToFile;
static TOOL_ACTION showEquFileTable;
/// Footprint Association actions
+36 -20
View File
@@ -167,6 +167,9 @@ int CVPCB_CONTROL::ShowFootprintViewer( const TOOL_EVENT& aEvent )
}
else
{
if( wxWindow* blocking_win = fpframe->Kiway().GetBlockingDialog() )
blocking_win->Close( true );
if( fpframe->IsIconized() )
fpframe->Iconize( false );
@@ -210,13 +213,20 @@ int CVPCB_CONTROL::ShowEquFileTable( const TOOL_EVENT& aEvent )
}
int CVPCB_CONTROL::SaveAssociations( const TOOL_EVENT& aEvent )
int CVPCB_CONTROL::SaveAssociationsToFile( const TOOL_EVENT& aEvent )
{
m_frame->SaveFootprintAssociation( true );
return 0;
}
int CVPCB_CONTROL::SaveAssociationsToSchematic( const TOOL_EVENT& aEvent )
{
m_frame->SaveFootprintAssociation( false );
return 0;
}
int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
{
int tmp = aEvent.Parameter<intptr_t>();
@@ -231,8 +241,9 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
return 0;
// Extract the current selection
unsigned int curSel = -1;
unsigned int newSel = -1;
bool changeSel = false;
unsigned int newSel = UINT_MAX;
switch( dir )
{
case CVPCB_MAINFRAME::ITEM_NEXT:
@@ -240,11 +251,12 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
newSel = tempSel.front();
// Find the next index in the component list
for( unsigned int i : naComp )
for( unsigned int idx : naComp )
{
if( i > newSel )
if( idx > newSel )
{
newSel = i;
changeSel = true;
newSel = idx;
break;
}
}
@@ -255,7 +267,19 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
if( !tempSel.empty() )
{
newSel = tempSel.front();
curSel = newSel - 1; // Break one before the current selection
// Find the previous index in the component list
for( int jj = naComp.size()-1; jj >= 0; jj-- )
{
unsigned idx = naComp[jj];
if( idx < newSel )
{
changeSel = true;
newSel = idx;
break;
}
}
}
break;
@@ -264,18 +288,9 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
wxASSERT_MSG( false, wxT( "Invalid direction" ) );
}
// Find the next index in the component list
for( unsigned int i : naComp )
{
if( i >= curSel )
{
newSel = i;
break;
}
}
// Set the component selection
m_frame->SetSelectedComponent( newSel );
// Set the new component selection
if( changeSel )
m_frame->SetSelectedComponent( newSel );
return 0;
}
@@ -310,7 +325,8 @@ void CVPCB_CONTROL::setTransitions()
// Management actions
Go( &CVPCB_CONTROL::ShowEquFileTable, CVPCB_ACTIONS::showEquFileTable.MakeEvent() );
Go( &CVPCB_CONTROL::SaveAssociations, CVPCB_ACTIONS::saveAssociations.MakeEvent() );
Go( &CVPCB_CONTROL::SaveAssociationsToSchematic, CVPCB_ACTIONS::saveAssociationsToSchematic.MakeEvent() );
Go( &CVPCB_CONTROL::SaveAssociationsToFile,CVPCB_ACTIONS::saveAssociationsToFile.MakeEvent() );
// Navigation actions
Go( &CVPCB_CONTROL::ToNA, CVPCB_ACTIONS::gotoNextNA.MakeEvent() );
+8 -1
View File
@@ -75,7 +75,14 @@ public:
*
* @param aEvent is the event generated by the tool framework
*/
int SaveAssociations( const TOOL_EVENT& aEvent );
int SaveAssociationsToSchematic( const TOOL_EVENT& aEvent );
/**
* Save the associations to the schematic and save schematic to file.
*
* @param aEvent is the event generated by the tool framework
*/
int SaveAssociationsToFile( const TOOL_EVENT& aEvent );
/**
* Create or Update the frame showing the current highlighted footprint
+1 -4
View File
@@ -49,10 +49,7 @@ void SCH_EDIT_FRAME::mapExistingAnnotation( std::map<wxString, wxString>& aMap )
curr_full_uuid.push_back( symbol->m_Uuid );
wxString ref = symbol->GetRef( curr_sheetpath );
if( symbol->GetUnitCount() > 1 )
ref << LIB_SYMBOL::SubReference( symbol->GetUnitSelection( curr_sheetpath ) );
wxString ref = symbol->GetRef( curr_sheetpath, true );
if( symbol->IsAnnotated( curr_sheetpath ) )
aMap[ curr_full_uuid.AsString() ] = ref;
+151 -96
View File
@@ -588,112 +588,140 @@ void CONNECTION_GRAPH::updateItemConnectivity( const SCH_SHEET_PATH& aSheet,
// Pre-scan to see if we have a bus at this location
SCH_LINE* busLine = aSheet.LastScreen()->GetBus( it.first );
for( auto primary_it = connection_vec.begin(); primary_it != connection_vec.end(); primary_it++ )
// We don't want to spin up a new thread for fewer than 4 items (overhead costs)
size_t parallelThreadCount = std::min<size_t>( std::thread::hardware_concurrency(),
( connection_vec.size() + 3 ) / 4 );
std::atomic<size_t> nextItem( 0 );
std::mutex update_mutex;
std::vector<std::future<size_t>> returns( parallelThreadCount );
auto update_lambda = [&]() -> size_t
{
SCH_ITEM* connected_item = *primary_it;
// Bus entries are special: they can have connection points in the
// middle of a wire segment, because the junction algo doesn't split
// the segment in two where you place a bus entry. This means that
// bus entries that don't land on the end of a line segment need to
// have "virtual" connection points to the segments they graphically
// touch.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
for( size_t ii = nextItem++; ii < connection_vec.size(); ii = nextItem++ )
{
// If this location only has the connection point of the bus
// entry itself, this means that either the bus entry is not
// connected to anything graphically, or that it is connected to
// a segment at some point other than at one of the endpoints.
if( connection_vec.size() == 1 )
{
if( busLine )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
bus_entry->m_connected_bus_item = busLine;
}
}
}
// Bus-to-bus entries are treated just like bus wires
else if( connected_item->Type() == SCH_BUS_BUS_ENTRY_T )
{
if( connection_vec.size() < 2 )
{
if( busLine )
{
auto bus_entry = static_cast<SCH_BUS_BUS_ENTRY*>( connected_item );
if( it.first == bus_entry->GetPosition() )
bus_entry->m_connected_bus_items[0] = busLine;
else
bus_entry->m_connected_bus_items[1] = busLine;
bus_entry->AddConnectionTo( aSheet, busLine );
busLine->AddConnectionTo( aSheet, bus_entry );
}
}
}
// Change junctions to be on bus junction layer if they are touching a bus
else if( connected_item->Type() == SCH_JUNCTION_T )
{
connected_item->SetLayer( busLine ? LAYER_BUS_JUNCTION : LAYER_JUNCTION );
}
for( auto test_it = primary_it + 1; test_it != connection_vec.end(); test_it++ )
{
bool bus_connection_ok = true;
SCH_ITEM* test_item = *test_it;
wxASSERT( test_item != connected_item );
// Set up the link between the bus entry net and the bus
SCH_ITEM* connected_item = connection_vec[ii];
// Bus entries are special: they can have connection points in the
// middle of a wire segment, because the junction algo doesn't split
// the segment in two where you place a bus entry. This means that
// bus entries that don't land on the end of a line segment need to
// have "virtual" connection points to the segments they graphically
// touch.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
if( test_item->GetLayer() == LAYER_BUS )
// If this location only has the connection point of the bus
// entry itself, this means that either the bus entry is not
// connected to anything graphically, or that it is connected to
// a segment at some point other than at one of the endpoints.
if( connection_vec.size() == 1 )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
bus_entry->m_connected_bus_item = test_item;
if( busLine )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
bus_entry->m_connected_bus_item = busLine;
}
}
}
// Bus entries only connect to bus lines on the end that is touching a bus line.
// If the user has overlapped another net line with the endpoint of the bus entry
// where the entry connects to a bus, we don't want to short-circuit it.
// Bus-to-bus entries are treated just like bus wires
else if( connected_item->Type() == SCH_BUS_BUS_ENTRY_T )
{
if( connection_vec.size() < 2 )
{
if( busLine )
{
auto bus_entry = static_cast<SCH_BUS_BUS_ENTRY*>( connected_item );
if( it.first == bus_entry->GetPosition() )
bus_entry->m_connected_bus_items[0] = busLine;
else
bus_entry->m_connected_bus_items[1] = busLine;
std::lock_guard<std::mutex> lock( update_mutex );
bus_entry->AddConnectionTo( aSheet, busLine );
busLine->AddConnectionTo( aSheet, bus_entry );
}
}
}
// Change junctions to be on bus junction layer if they are touching a bus
else if( connected_item->Type() == SCH_JUNCTION_T )
{
connected_item->SetLayer( busLine ? LAYER_BUS_JUNCTION : LAYER_JUNCTION );
}
SCH_ITEM_SET& connected_set = connected_item->ConnectedItems( aSheet );
connected_set.reserve( connection_vec.size() );
for( SCH_ITEM* test_item : connection_vec )
{
bool bus_connection_ok = true;
if( test_item == connected_item )
continue;
// Set up the link between the bus entry net and the bus
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
if( test_item->GetLayer() == LAYER_BUS )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
bus_entry->m_connected_bus_item = test_item;
}
}
// Bus entries only connect to bus lines on the end that is touching a bus line.
// If the user has overlapped another net line with the endpoint of the bus entry
// where the entry connects to a bus, we don't want to short-circuit it.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
bus_connection_ok = !busLine || test_item->GetLayer() == LAYER_BUS;
}
else if( test_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
bus_connection_ok = !busLine || connected_item->GetLayer() == LAYER_BUS;
}
if( connected_item->ConnectionPropagatesTo( test_item ) &&
test_item->ConnectionPropagatesTo( connected_item ) &&
bus_connection_ok )
{
connected_set.push_back( test_item );
}
}
// If we got this far and did not find a connected bus item for a bus entry,
// we should do a manual scan in case there is a bus item on this connection
// point but we didn't pick it up earlier because there is *also* a net item here.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
bus_connection_ok = !busLine || test_item->GetLayer() == LAYER_BUS;
}
else if( test_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
bus_connection_ok = !busLine || connected_item->GetLayer() == LAYER_BUS;
}
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
if( connected_item->ConnectionPropagatesTo( test_item ) &&
test_item->ConnectionPropagatesTo( connected_item ) &&
bus_connection_ok )
{
connected_item->AddConnectionTo( aSheet, test_item );
test_item->AddConnectionTo( aSheet, connected_item );
if( !bus_entry->m_connected_bus_item )
{
SCH_SCREEN* screen = aSheet.LastScreen();
SCH_LINE* bus = screen->GetBus( it.first );
if( bus )
bus_entry->m_connected_bus_item = bus;
}
}
}
// If we got this far and did not find a connected bus item for a bus entry,
// we should do a manual scan in case there is a bus item on this connection
// point but we didn't pick it up earlier because there is *also* a net item here.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
return 1;
};
if( !bus_entry->m_connected_bus_item )
{
SCH_SCREEN* screen = aSheet.LastScreen();
SCH_LINE* bus = screen->GetBus( it.first );
if( bus )
bus_entry->m_connected_bus_item = bus;
}
}
if( parallelThreadCount == 1 )
update_lambda();
else
{
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
returns[ii] = std::async( std::launch::async, update_lambda );
// Finalize the threads
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
returns[ii].wait();
}
}
}
@@ -736,7 +764,6 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
return ( unique && conn && ( conn->SubgraphCode() == 0 ) );
};
std::copy_if( item->ConnectedItems( sheet ).begin(),
item->ConnectedItems( sheet ).end(),
std::back_inserter( memberlist ), get_items );
@@ -755,10 +782,16 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
connected_conn->SetSubgraphCode( subgraph->m_code );
m_item_to_subgraph_map[connected_item] = subgraph;
subgraph->AddItem( connected_item );
SCH_ITEM_SET citemset = connected_item->ConnectedItems( sheet );
SCH_ITEM_SET& citemset = connected_item->ConnectedItems( sheet );
std::copy_if( citemset.begin(), citemset.end(),
std::back_inserter( memberlist ), get_items );
for( SCH_ITEM* citem : citemset )
{
if( citem->HasFlag( CANDIDATE ) )
continue;
if( get_items( citem ) )
memberlist.push_back( citem );
}
}
}
@@ -1333,8 +1366,13 @@ void CONNECTION_GRAPH::buildConnectionGraph()
m_bus_alias_cache[ alias->GetName() ] = alias;
}
PROF_TIMER sub_graph( "buildItemSubGraphs" );
buildItemSubGraphs();
if( wxLog::IsAllowedTraceMask( ConnProfileMask ) )
sub_graph.Show();
/**
* TODO(JE): Net codes are non-deterministic. Fortunately, they are also not really used for
* anything. We should consider removing them entirely and just using net names everywhere.
@@ -1346,8 +1384,12 @@ void CONNECTION_GRAPH::buildConnectionGraph()
generateInvisiblePinSubGraphs();
PROF_TIMER proc_sub_graph( "ProcessSubGraphs" );
processSubGraphs();
if( wxLog::IsAllowedTraceMask( ConnProfileMask ) )
proc_sub_graph.Show();
// Absorbed subgraphs should no longer be considered
alg::delete_if( m_driver_subgraphs, [&]( const CONNECTION_SUBGRAPH* candidate ) -> bool
{
@@ -2672,8 +2714,21 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
{
case SCH_PIN_T:
{
if( !pins.empty() )
has_other_connections = true;
// 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 );
for( SCH_PIN* other_pin : pins )
{
if( other_pin->GetParent() != pin->GetParent()
|| other_pin->GetPosition() != pin->GetPosition() )
{
has_other_connections = true;
break;
}
}
}
pins.emplace_back( static_cast<SCH_PIN*>( item ) );
+4 -15
View File
@@ -379,7 +379,8 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
}
std::string FormatProbeItem( EDA_ITEM* aItem, SCH_SYMBOL* aSymbol )
std::string FormatProbeItem( const SCH_SHEET_PATH& aCurrentSheet, EDA_ITEM* aItem,
SCH_SYMBOL* aSymbol )
{
// This is a keyword followed by a quoted string.
@@ -403,20 +404,8 @@ std::string FormatProbeItem( EDA_ITEM* aItem, SCH_SYMBOL* aSymbol )
{
// For cross probing, we need the full path of the sheet, because
// in complex hierarchies the sheet uuid of not unique
SCH_SHEET* sheet = (SCH_SHEET*)aItem;
wxString full_path;
SCH_SHEET* parent = sheet;
while( (parent = dynamic_cast<SCH_SHEET*>( parent->GetParent() ) ) )
{
if( parent->GetParent() ) // The root sheet has no parent and path is just "/"
{
full_path.Prepend( parent->m_Uuid.AsString() );
full_path.Prepend( "/" );
}
}
full_path += "/" + sheet->m_Uuid.AsString();
wxString full_path = aCurrentSheet.PathAsString() + aItem->m_Uuid.AsString();
return StrPrintf( "$SHEET: \"%s\"", TO_UTF8( full_path ) );
}
@@ -454,7 +443,7 @@ void SCH_EDIT_FRAME::SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_SYMBOL* a
if( !aObjectToSync )
return;
std::string packet = FormatProbeItem( aObjectToSync, aLibItem );
std::string packet = FormatProbeItem( GetCurrentSheet(), aObjectToSync, aLibItem );
if( !packet.empty() )
{
+1 -1
View File
@@ -396,7 +396,7 @@ void DIALOG_ERC::testErc()
|| settings.IsTestEnabled( ERCE_POWERPIN_NOT_DRIVEN )
|| settings.IsTestEnabled( ERCE_PIN_NOT_DRIVEN ) )
{
tester.TestPinToPin();
tester.TestPinToPin();
}
// Test similar labels (i;e. labels which are identical when
@@ -30,6 +30,7 @@
#include <sch_line.h>
#include <sch_junction.h>
#include <sch_sheet.h>
#include <sch_sheet_pin.h>
#include <schematic.h>
#include <advanced_config.h>
#include <tool/tool_manager.h>
@@ -412,6 +413,12 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( const SCH_SHEET_PATH& aShe
if( m_setBgColor->GetValue() )
sheet->SetBackgroundColor( m_bgColorSwatch->GetSwatchColor() );
}
if( m_sheetPins->GetValue() )
{
for( SCH_SHEET_PIN* pin : sheet->GetPins() )
processItem( aSheetPath, pin );
}
}
else if( aItem->Type() == SCH_JUNCTION_T )
{
@@ -439,8 +446,6 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( const SCH_SHEET_PATH& aShe
processItem( aSheetPath, aItem );
else if( m_hierLabels->GetValue() && aItem->Type() == SCH_HIER_LABEL_T )
processItem( aSheetPath, aItem );
else if( m_sheetPins->GetValue() && aItem->Type() == SCH_SHEET_PIN_T )
processItem( aSheetPath, aItem );
else if( m_schTextAndGraphics->GetValue() && aItem->IsType( schTextAndGraphics ) )
processItem( aSheetPath, aItem );
}
@@ -283,7 +283,7 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_
fgSizer1->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 7 );
m_staticline4 = new wxStaticLine( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgSizer1->Add( m_staticline4, 0, wxEXPAND|wxBOTTOM, 7 );
fgSizer1->Add( m_staticline4, 0, wxEXPAND|wxTOP|wxBOTTOM, 7 );
m_staticline5 = new wxStaticLine( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgSizer1->Add( m_staticline5, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 7 );
@@ -2956,7 +2956,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">7</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property>
@@ -75,10 +75,10 @@ bool DIALOG_LIB_SHAPE_PROPERTIES::TransferDataToWindow()
bool enblConvOptStyle = symbol && symbol->HasConversion();
// if a symbol contains no graphic items, symbol->HasConversion() returns false.
// but when creating a new symbol, with DeMorgan option set, the ApplyToAllConversions
// must be enabled even if symbol->HasConversion() returns false in order to be able
// to create graphic items shared by all body styles
// If a symbol contains no conversion-specific pins or graphic items, symbol->HasConversion()
// will return false.
// But when creating a new symbol, with DeMorgan option set, the ApplyToAllConversions
// must be enabled in order to be able to create graphic items shared by all body styles.
if( m_frame->GetShowDeMorgan() )
enblConvOptStyle = true;
@@ -72,7 +72,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( SYMBOL_EDIT_FRAME* a
m_grid->ShowHideColumns( cfg->m_EditSymbolVisibleColumns );
wxGridCellAttr* attr = new wxGridCellAttr;
attr->SetEditor( new GRID_CELL_URL_EDITOR( this ) );
attr->SetEditor( new GRID_CELL_URL_EDITOR( this, Prj().SchSearchS() ) );
m_grid->SetAttr( DATASHEET_FIELD, FDC_VALUE, attr );
m_SymbolNameCtrl->SetValidator( SCH_FIELD_VALIDATOR( true, VALUE_FIELD ) );
@@ -174,7 +174,13 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow()
m_SelNumberOfUnits->SetValue( m_libEntry->GetUnitCount() );
m_OptionPartsInterchangeable->SetValue( !m_libEntry->UnitsLocked() ||
m_libEntry->GetUnitCount() == 1 );
m_AsConvertButt->SetValue( m_libEntry->HasConversion() );
// If a symbol contains no conversion-specific pins or graphic items, symbol->HasConversion()
// will return false. But when editing a symbol with DeMorgan option set, we don't want to
// keep turning it off just because there aren't any conversion-specific items yet, so we force
// it to on if the parent frame has it enabled.
m_AsConvertButt->SetValue( m_Parent->GetShowDeMorgan() );
m_OptionPower->SetValue( m_libEntry->IsPower() );
m_excludeFromBomCheckBox->SetValue( !m_libEntry->GetIncludeInBom() );
m_excludeFromBoardCheckBox->SetValue( !m_libEntry->GetIncludeOnBoard() );
@@ -302,7 +308,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
return false;
// We need to keep the name and the value the same at the moment!
wxString newName = m_fields->at( VALUE_FIELD ).GetText();
wxString newName = EscapeString( m_fields->at( VALUE_FIELD ).GetText(), CTX_LIBID );
wxString oldName = m_libEntry->GetName();
if( oldName != newName )
@@ -367,6 +373,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
m_libEntry->LockUnits( m_libEntry->GetUnitCount() > 1 &&
!m_OptionPartsInterchangeable->GetValue() );
m_libEntry->SetConversion( m_AsConvertButt->GetValue() );
m_Parent->SetShowDeMorgan( m_AsConvertButt->GetValue() );
if( m_OptionPower->GetValue() )
m_libEntry->SetPower();
@@ -448,7 +455,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging( wxGridEvent& event )
void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameText( wxCommandEvent& event )
{
if( !m_Parent->IsSymbolFromSchematic() )
if( !m_Parent->IsSymbolFromSchematic() || m_OptionPower->IsChecked() )
m_grid->SetCellValue( VALUE_FIELD, FDC_VALUE, m_SymbolNameCtrl->GetValue() );
}
@@ -464,7 +471,10 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameKillFocus( wxFocusEvent& event )
m_delayedFocusPage = 0;
if( m_SymbolNameCtrl->GetValidator()->Validate( m_SymbolNameCtrl ) )
{
m_delayedFocusCtrl = nullptr;
m_delayedFocusPage = -1;
}
}
event.Skip();
+10 -2
View File
@@ -802,7 +802,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotDrawingSheet
plotter->SetRenderSettings( aRenderSettings );
plotter->SetColorMode( getModeColor() );
plotter->SetCreator( wxT( "Eeschema-PDF" ) );
plotter->SetTitle( m_parent->GetTitleBlock().GetTitle() );
plotter->SetTitle( ExpandTextVars( m_parent->GetTitleBlock().GetTitle(), &m_parent->Prj() ) );
wxString msg;
wxFileName plotFileName;
@@ -1250,7 +1250,15 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
wxStandardPaths::Get().GetDocumentsDir() );
// Build the absolute path of current output directory to preselect it in the file browser.
wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
std::function<bool( wxString* )> textResolver =
[&]( wxString* token ) -> bool
{
return m_parent->Schematic().ResolveTextVar( token, 0 );
};
wxString path = m_outputDirectoryName->GetValue();
path = ExpandTextVars( path, &textResolver, nullptr, &Prj() );
path = ExpandEnvVarSubstitutions( path, &Prj() );
fn.SetPath( path );
@@ -171,6 +171,12 @@ bool DIALOG_PRINT_USING_PRINTER::TransferDataToWindow()
{
EESCHEMA_SETTINGS* cfg = m_parent->eeconfig();
if( cfg->m_Printing.monochrome )
{
m_checkBackgroundColor->SetValue( false );
m_checkBackgroundColor->Enable( false );
}
m_checkReference->SetValue( cfg->m_Printing.title_block );
m_checkMonochrome->SetValue( cfg->m_Printing.monochrome );
m_checkBackgroundColor->SetValue( cfg->m_Printing.background );
@@ -246,7 +252,10 @@ void DIALOG_PRINT_USING_PRINTER::SavePrintOptions()
cfg->m_Printing.monochrome = m_checkMonochrome->IsChecked();
cfg->m_Printing.title_block = m_checkReference->IsChecked();
cfg->m_Printing.background = m_checkBackgroundColor->IsChecked();
if( m_checkBackgroundColor->IsEnabled() )
cfg->m_Printing.background = m_checkBackgroundColor->IsChecked();
cfg->m_Printing.use_theme = m_checkUseColorTheme->IsChecked();
COLOR_SETTINGS* theme = static_cast<COLOR_SETTINGS*>(
+13 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2010-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2010-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
@@ -196,6 +196,14 @@ void DIALOG_SCH_FIND::OnReplaceWithEnter( wxCommandEvent& aEvent )
void DIALOG_SCH_FIND::OnOptions( wxCommandEvent& aEvent )
{
updateFlags();
m_findDirty = true;
}
void DIALOG_SCH_FIND::updateFlags()
{
// Rebuild the search flags in m_findReplaceData from dialog settings
int flags = 0;
if( m_radioForward->GetValue() )
@@ -223,12 +231,13 @@ void DIALOG_SCH_FIND::OnOptions( wxCommandEvent& aEvent )
flags |= FR_REPLACE_REFERENCES;
m_findReplaceData->SetFlags( flags );
m_findDirty = true;
}
void DIALOG_SCH_FIND::OnFind( wxCommandEvent& aEvent )
{
updateFlags(); // Ensure search flags are up to date
int index = m_comboFind->FindString( m_comboFind->GetValue(), true );
if( index == wxNOT_FOUND )
@@ -250,6 +259,8 @@ void DIALOG_SCH_FIND::OnFind( wxCommandEvent& aEvent )
void DIALOG_SCH_FIND::OnReplace( wxCommandEvent& aEvent )
{
updateFlags(); // Ensure search flags are up to date
int index = m_comboReplace->FindString( m_comboReplace->GetValue(), true );
if( index == wxNOT_FOUND )
+4 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2010-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2010-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
@@ -75,6 +75,9 @@ protected:
void OnFind( wxCommandEvent& aEvent ) override;
void OnReplace( wxCommandEvent& aEvent ) override;
// Rebuild the search flags from dialog settings
void updateFlags();
SCH_EDIT_FRAME* m_frame;
SCH_EDITOR_CONTROL* m_editorControl;
wxFindReplaceData* m_findReplaceData;
@@ -37,6 +37,7 @@
#include <sch_reference_list.h>
#include <schematic.h>
#include <tools/sch_editor_control.h>
#include <kiplatform/ui.h>
#include <widgets/grid_text_button_helpers.h>
#include <widgets/wx_grid.h>
#include <wx/grid.h>
@@ -114,7 +115,7 @@ protected:
{
wxString datasheet_uri = m_grid->GetCellValue( m_grid->GetGridCursorRow(),
DATASHEET_FIELD );
GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj() );
GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj(), m_dlg->Prj().SchSearchS() );
}
else
{
@@ -208,8 +209,17 @@ public:
for( unsigned i = 0; i < m_symbolsList.GetCount(); ++i )
{
SCH_SYMBOL* symbol = m_symbolsList[ i ].GetSymbol();
m_dataStore[ symbol->m_Uuid ][ aFieldName ] = symbol->GetFieldText( aFieldName,
m_frame );
wxCHECK( symbol && ( symbol->GetInstanceReferences().size() != 0 ), /* void */ );
wxString val = symbol->GetFieldText( aFieldName, m_frame );
if( aFieldName == wxT( "Value" ) )
val = symbol->GetInstanceReferences()[0].m_Value;
else if( aFieldName == wxT( "Footprint" ) )
val = symbol->GetInstanceReferences()[0].m_Footprint;
m_dataStore[ symbol->m_Uuid ][ aFieldName ] = val;
}
}
@@ -769,7 +779,7 @@ DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE( SCH_EDIT_FRAME* parent )
// set datasheet column viewer button
attr = new wxGridCellAttr;
attr->SetEditor( new GRID_CELL_URL_EDITOR( this ) );
attr->SetEditor( new GRID_CELL_URL_EDITOR( this, Prj().SchSearchS() ) );
m_grid->SetColAttr( DATASHEET_FIELD, attr );
// set quantities column attributes
@@ -1170,8 +1180,8 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableItemContextMenu( wxGridEvent& event )
void DIALOG_SYMBOL_FIELDS_TABLE::OnSizeFieldList( wxSizeEvent& event )
{
int nameColWidth = event.GetSize().GetX() - m_showColWidth - m_groupByColWidth
- wxSystemSettings::GetMetric( wxSYS_VSCROLL_X );
int nameColWidth = KIPLATFORM::UI::GetUnobscuredSize( m_fieldsCtrl ).x - m_showColWidth
- m_groupByColWidth;
// GTK loses its head and messes these up when resizing the splitter bar:
m_fieldsCtrl->GetColumn( SHOW_FIELD_COLUMN )->SetWidth( m_showColWidth );
@@ -1180,6 +1190,8 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnSizeFieldList( wxSizeEvent& event )
m_fieldsCtrl->GetColumn( CANONICAL_NAME_COLUMN )->SetHidden( true );
m_fieldsCtrl->GetColumn( DISPLAY_NAME_COLUMN )->SetWidth( nameColWidth );
m_fieldsCtrl->Refresh(); // To refresh checkboxes on Windows.
event.Skip();
}
@@ -635,7 +635,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
switch( m_mirrorCtrl->GetSelection() )
{
case 0: break;
case 0: break;
case 1: m_symbol->SetOrientation( SYM_MIRROR_X ); break;
case 2: m_symbol->SetOrientation( SYM_MIRROR_Y ); break;
}
@@ -176,17 +176,22 @@ bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataToWindow()
if( !wxDialog::TransferDataToWindow() )
return false;
SCHEMATIC& schematic = m_Parent->Schematic();
if( m_CurrentText->Type() == SCH_TEXT_T )
{
SCHEMATIC& schematic = m_Parent->Schematic();
// show text variable cross-references in a human-readable format
m_valueMultiLine->SetValue( schematic.ConvertKIIDsToRefs( m_CurrentText->GetText() ) );
}
else
{
// show control characters in a human-readable format
m_activeTextEntry->SetValue( UnescapeString( m_CurrentText->GetText() ) );
wxString text = UnescapeString( m_CurrentText->GetText() );
// show text variable cross-references in a human-readable format
text = schematic.ConvertKIIDsToRefs( text );
m_activeTextEntry->SetValue( text );
}
if( m_valueCombo->IsShown() )
@@ -315,7 +320,8 @@ bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow()
if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
return false;
wxString text;
SCHEMATIC& schematic = m_Parent->Schematic();
wxString text;
/* save old text in undo list if not already in edit */
if( m_CurrentText->GetEditFlags() == 0 )
@@ -325,8 +331,7 @@ bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow()
if( m_CurrentText->Type() == SCH_TEXT_T )
{
// convert any text variable cross-references to their UUIDs
text = m_Parent->Schematic().ConvertRefsToKIIDs( m_valueMultiLine->GetValue() );
text = m_valueMultiLine->GetValue();
}
else
{
@@ -334,6 +339,9 @@ bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow()
text = EscapeString( m_activeTextEntry->GetValue(), CTX_NETNAME );
}
// convert any text variable cross-references to their UUIDs
text = schematic.ConvertRefsToKIIDs( text );
if( !text.IsEmpty() )
{
#ifdef __WXMAC__
+1 -1
View File
@@ -30,7 +30,7 @@
// Saved dialog settings
DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB_SAVED_STATE
DIALOG_UPDATE_FROM_PCB::s_savedDialogState{ true, true, true, true, false };
DIALOG_UPDATE_FROM_PCB::s_savedDialogState{ false, true, true, true, false };
DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB( SCH_EDIT_FRAME* aParent )
+5 -6
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2021 CERN
* 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
@@ -510,12 +510,11 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
wxString detailedMsg = _( "One of the nicknames will need to be changed after "
"adding this library." );
wxArrayString files;
dlg.GetFilenames( files );
wxArrayString filePathsList;
dlg.GetPaths( filePathsList );
for( const wxString& file : files )
for( const wxString& filePath : filePathsList )
{
wxString filePath = dlg.GetDirectory() + wxFileName::GetPathSeparator() + file;
wxFileName fn( filePath );
wxString nickname = LIB_ID::FixIllegalChars( fn.GetName(), true );
bool doAdd = true;
@@ -561,7 +560,7 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
}
}
if( !files.IsEmpty() )
if( !filePathsList.IsEmpty() )
{
m_cur_grid->MakeCellVisible( m_cur_grid->GetNumberRows() - 1, 0 );
m_cur_grid->SetGridCursor( m_cur_grid->GetNumberRows() - 1, 1 );
+5 -5
View File
@@ -439,9 +439,13 @@ int ERC_TESTER::TestPinToPin()
{
std::vector<SCH_PIN*> pins;
std::unordered_map<EDA_ITEM*, SCH_SCREEN*> pinToScreenMap;
bool has_noconnect = false;
for( CONNECTION_SUBGRAPH* subgraph: net.second )
{
if( subgraph->m_no_connect )
has_noconnect = true;
for( EDA_ITEM* item : subgraph->m_items )
{
if( item->Type() == SCH_PIN_T )
@@ -452,10 +456,6 @@ int ERC_TESTER::TestPinToPin()
}
}
// Single-pin nets are handled elsewhere
if( pins.size() < 2 )
continue;
std::set<std::pair<SCH_PIN*, SCH_PIN*>> tested;
SCH_PIN* needsDriver = nullptr;
@@ -542,7 +542,7 @@ int ERC_TESTER::TestPinToPin()
}
}
if( needsDriver && !hasDriver )
if( needsDriver && !hasDriver && !has_noconnect )
{
int err_code = ispowerNet ? ERCE_POWERPIN_NOT_DRIVEN : ERCE_PIN_NOT_DRIVEN;
+4 -3
View File
@@ -119,7 +119,8 @@ void FIELDS_GRID_TABLE<T>::initGrid( WX_GRID* aGrid )
m_footprintAttr->SetEditor( fpIdEditor );
m_urlAttr = new wxGridCellAttr;
GRID_CELL_URL_EDITOR* urlEditor = new GRID_CELL_URL_EDITOR( m_dialog );
GRID_CELL_URL_EDITOR* urlEditor = new GRID_CELL_URL_EDITOR( m_dialog,
m_frame->Prj().SchSearchS() );
urlEditor->SetValidator( m_urlValidator );
m_urlAttr->SetEditor( urlEditor );
@@ -502,7 +503,7 @@ void FIELDS_GRID_TABLE<T>::SetValue( int aRow, int aCol, const wxString &aValue
value = fn.GetFullPath();
}
}
else if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) && aRow == VALUE_FIELD )
else if( m_parentType == LIB_SYMBOL_T && aRow == VALUE_FIELD )
{
value = EscapeString( value, CTX_LIBID );
}
@@ -647,7 +648,7 @@ void FIELDS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
else if (event.GetId() == MYID_SHOW_DATASHEET )
{
wxString datasheet_uri = m_grid->GetCellValue( DATASHEET_FIELD, FDC_VALUE );
GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj() );
GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj(), m_dlg->Prj().SchSearchS() );
}
else
{
+4 -2
View File
@@ -632,6 +632,10 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
if( dlg.ShowModal() == wxID_CANCEL )
return;
// Don't leave dangling pointers to previously-opened document.
m_toolManager->GetTool<EE_SELECTION_TOOL>()->ClearSelection();
ClearUndoRedoList();
if( setProject )
{
Schematic().SetProject( nullptr );
@@ -665,8 +669,6 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
return;
}
m_toolManager->GetTool<EE_SELECTION_TOOL>()->ClearSelection();
importFile( dlg.GetPath(), pluginType );
RefreshCanvas();
+30 -1
View File
@@ -205,6 +205,34 @@ void HIERARCHY_NAVIG_DLG::buildHierarchyTree( SCH_SHEET_PATH* aList, wxTreeItemI
}
void HIERARCHY_NAVIG_DLG::UpdateHierarchySelection()
{
m_currSheet = m_SchFrameEditor->GetCurrentSheet();
std::function<void( const wxTreeItemId& )> selectSheet = [&]( const wxTreeItemId& id )
{
wxCHECK_RET( id.IsOk(), wxT( "Invalid tree item" ) );
TreeItemData* itemData = static_cast<TreeItemData*>( m_Tree->GetItemData( id ) );
if( itemData->m_SheetPath == m_currSheet )
{
m_Tree->EnsureVisible( id );
m_Tree->SelectItem( id );
}
wxTreeItemIdValue cookie = id;
wxTreeItemId child = m_Tree->GetFirstChild( id, cookie );
while( child.IsOk() )
{
selectSheet( child );
child = m_Tree->GetNextChild( child, cookie );
}
};
selectSheet( m_Tree->GetRootItem() );
}
void HIERARCHY_NAVIG_DLG::UpdateHierarchyTree()
{
Freeze();
@@ -315,5 +343,6 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
TOOL_EVENT dummy;
editTool->UpdateNetHighlighting( dummy );
UpdateHierarchyNavigator();
if( FindHierarchyNavigator() )
FindHierarchyNavigator()->UpdateHierarchySelection();
}
+5
View File
@@ -76,6 +76,11 @@ public:
*/
void UpdateHierarchyTree();
/**
* Updates the tree's selection to match current page
*/
void UpdateHierarchySelection();
private:
/**
* Create the hierarchical tree of the schematic.
+19 -7
View File
@@ -214,15 +214,20 @@ int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, int aCompareFlags ) const
if( m_me == aRhs.m_me )
return 0;
int retv = m_name.Cmp( aRhs.m_name );
int retv = 0;
if( retv )
return retv;
if( ( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::ERC ) == 0 )
{
retv = m_name.Cmp( aRhs.m_name );
retv = m_libId.compare( aRhs.m_libId );
if( retv )
return retv;
if( retv )
return retv;
retv = m_libId.compare( aRhs.m_libId );
if( retv )
return retv;
}
if( m_parent.lock() < aRhs.m_parent.lock() )
return -1;
@@ -258,8 +263,15 @@ int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, int aCompareFlags ) const
{
const LIB_FIELD* lhsField = static_cast<const LIB_FIELD*>( lhsItem );
if( lhsField->IsMandatory() )
if( lhsField->GetId() == VALUE_FIELD )
{
if( ( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::ERC ) == 0 || IsPower() )
retv = lhsItem->compare( *rhsItem, aCompareFlags );
}
else if( lhsField->IsMandatory() )
{
retv = lhsItem->compare( *rhsItem, aCompareFlags );
}
}
else
{
+1
View File
@@ -73,6 +73,7 @@ EDA_ITEM* LIB_TEXT::Clone() const
{
LIB_TEXT* newitem = new LIB_TEXT( nullptr );
newitem->m_parent = m_parent;
newitem->m_unit = m_unit;
newitem->m_convert = m_convert;
newitem->m_flags = m_flags;
+5 -2
View File
@@ -62,17 +62,20 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
if( !openRecentMenu )
{
openRecentMenu = new ACTION_MENU( false, selTool );
openRecentMenu->SetTitle( _( "Open Recent" ) );
openRecentMenu->SetIcon( BITMAPS::recent );
fileHistory.UseMenu( openRecentMenu );
fileHistory.AddFilesToMenu( openRecentMenu );
}
// Ensure the title is up to date after changing language
openRecentMenu->SetTitle( _( "Open Recent" ) );
fileHistory.UpdateClearText( openRecentMenu, _( "Clear Recent Files" ) );
fileMenu->Add( ACTIONS::doNew );
fileMenu->Add( ACTIONS::open );
wxMenuItem* item = fileMenu->Add( openRecentMenu );
wxMenuItem* item = fileMenu->Add( openRecentMenu->Clone() );
// Add the file menu condition here since it needs the item ID for the submenu
ACTION_CONDITIONS cond;
@@ -63,9 +63,20 @@ wxString NETLIST_EXPORTER_PSPICE::GetSpiceDevice( const wxString& aSymbol ) cons
bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsigned aNetlistOptions )
{
FILE_OUTPUTFORMATTER outputFile( aOutFileName, wxT( "wt" ), '\'' );
try
{
FILE_OUTPUTFORMATTER outputFile( aOutFileName, wxT( "wt" ), '\'' );
return Format( &outputFile, aNetlistOptions );
return Format( &outputFile, aNetlistOptions );
}
catch( IO_ERROR& )
{
wxString msg;
msg.Printf( _( "Failed to create file '%s'." ), aOutFileName );
DisplayError( nullptr, msg );
return false;
}
}
@@ -209,12 +220,12 @@ wxString NETLIST_EXPORTER_PSPICE::GetSpiceFieldDefVal( SPICE_FIELD aField, SCH_S
wxString value = aSymbol->GetField( VALUE_FIELD )->GetShownText();
// Is it a passive component?
if( aCtl & NET_ADJUST_PASSIVE_VALS && ( prim == 'C' || prim == 'L' || prim == 'R' ) )
if( ( aCtl & NET_ADJUST_PASSIVE_VALS ) && ( prim == 'C' || prim == 'L' || prim == 'R' ) )
{
// Regular expression to match common formats used for passive parts description
// (e.g. 100k, 2k3, 1 uF)
wxRegEx passiveVal(
"^([0-9\\. ]+)([fFpPnNuUmMkKgGtT]|M(e|E)(g|G))?([fFhH]|ohm)?([-1-9 ]*)$" );
wxT( "^([0-9\\. ]+)([fFpPnNuUmMkKgGtTμµ𝛍𝜇𝝁 ]|M(e|E)(g|G))?([fFhHΩΩ𝛀𝛺𝝮]|ohm)?([-1-9 ]*)$" ) );
if( passiveVal.Matches( value ) )
{
+11 -13
View File
@@ -25,9 +25,8 @@
#include "pin_numbers.h"
#include <wx/crt.h>
namespace {
wxString GetNextSymbol( const wxString& str, wxString::size_type& cursor )
wxString PIN_NUMBERS::getNextSymbol( const wxString& str, wxString::size_type& cursor )
{
if( str.size() <= cursor )
return wxEmptyString;
@@ -36,14 +35,15 @@ wxString GetNextSymbol( const wxString& str, wxString::size_type& cursor )
wxChar c = str[cursor];
if( wxIsdigit( c ) || c == '+' || c == '-' )
// Need to check that there is a digit in the string before we parse it as a numeric
if( ( wxIsdigit( c ) || ( ( c == '+' || c == '-' ) && ( cursor < str.size() - 1 ) && wxIsdigit( str[cursor + 1] ) ) ) )
{
// number, possibly with sign
while( ++cursor < str.size() )
{
c = str[cursor];
if( wxIsdigit( c ) || c == 'v' || c == 'V' )
if( wxIsdigit( c ) || c == 'v' || c == 'V' || c == '.' )
continue;
else
break;
@@ -65,8 +65,6 @@ wxString GetNextSymbol( const wxString& str, wxString::size_type& cursor )
return str.substr( begin, cursor - begin );
}
}
wxString PIN_NUMBERS::GetSummary() const
{
@@ -117,8 +115,8 @@ int PIN_NUMBERS::Compare( const wxString& lhs, const wxString& rhs )
for( ; ; )
{
symbol1 = GetNextSymbol( lhs, cursor1 );
symbol2 = GetNextSymbol( rhs, cursor2 );
symbol1 = getNextSymbol( lhs, cursor1 );
symbol2 = getNextSymbol( rhs, cursor2 );
if( symbol1.empty() && symbol2.empty() )
return 0;
@@ -129,12 +127,12 @@ int PIN_NUMBERS::Compare( const wxString& lhs, const wxString& rhs )
if( symbol2.empty() )
return 2;
wxChar c1 = symbol1[0];
wxChar c2 = symbol2[0];
bool sym1_isnumeric = symbol1.find_first_of( "0123456789" ) != wxString::npos;
bool sym2_isnumeric = symbol2.find_first_of( "0123456789" ) != wxString::npos;
if( wxIsdigit( c1 ) || c1 == '-' || c1 == '+' )
if( sym1_isnumeric )
{
if( wxIsdigit( c2 ) || c2 == '-' || c2 == '+' )
if( sym2_isnumeric )
{
// numeric comparison
wxString::size_type v1 = symbol1.find_first_of( wxT( "vV" ) );
@@ -173,7 +171,7 @@ int PIN_NUMBERS::Compare( const wxString& lhs, const wxString& rhs )
}
else
{
if( wxIsdigit( c2 ) || c2 == '-' || c2 == '+' )
if( sym2_isnumeric )
return 2;
int res = symbol1.Cmp( symbol2 );
+2
View File
@@ -47,6 +47,8 @@ private:
typedef std::set<wxString, less> container_type;
static wxString getNextSymbol( const wxString& str, wxString::size_type& cursor );
public:
typedef container_type::value_type value_type;
typedef container_type::iterator iterator;
+29 -8
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 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
@@ -26,6 +26,7 @@
#include <core/arraydim.h>
#include <lib_pin.h>
#include <pin_type.h>
#include "pgm_base.h"
// These are true singletons so it's OK for them to be globals.
@@ -46,8 +47,8 @@ struct pinTypeStruct
BITMAPS bitmap;
};
// clang-format off
const std::map<ELECTRICAL_PINTYPE, struct pinTypeStruct> pinTypes = {
std::map<ELECTRICAL_PINTYPE, struct pinTypeStruct> g_pinTypes = {
{ ELECTRICAL_PINTYPE::PT_INPUT, { _( "Input" ), BITMAPS::pintype_input } },
{ ELECTRICAL_PINTYPE::PT_OUTPUT, { _( "Output" ), BITMAPS::pintype_output } },
{ ELECTRICAL_PINTYPE::PT_BIDI, { _( "Bidirectional" ), BITMAPS::pintype_bidi } },
@@ -61,7 +62,9 @@ const std::map<ELECTRICAL_PINTYPE, struct pinTypeStruct> pinTypes = {
{ ELECTRICAL_PINTYPE::PT_OPENEMITTER, { _( "Open emitter" ), BITMAPS::pintype_openemit } },
{ ELECTRICAL_PINTYPE::PT_NC, { _( "Unconnected" ), BITMAPS::pintype_noconnect } },
};
// clang-format on
int g_pinTypesLanguage = wxLANGUAGE_UNKNOWN;
struct pinShapeStruct
@@ -236,9 +239,27 @@ const std::vector<BITMAPS>& PinOrientationIcons()
wxString ElectricalPinTypeGetText( ELECTRICAL_PINTYPE aType )
{
auto findIt = pinTypes.find( aType );
if( g_pinTypesLanguage != Pgm().GetSelectedLanguageIdentifier() )
{
g_pinTypes[ELECTRICAL_PINTYPE::PT_INPUT].name = _( "Input" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OUTPUT].name = _( "Output" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_BIDI].name = _( "Bidirectional" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_TRISTATE].name = _( "Tri-state" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_PASSIVE].name = _( "Passive" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_NIC].name = _( "Free" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_UNSPECIFIED].name = _( "Unspecified" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_POWER_IN].name = _( "Power input" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_POWER_OUT].name = _( "Power output" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OPENCOLLECTOR].name = _( "Open collector" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OPENEMITTER].name = _( "Open emitter" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_NC].name = _( "Unconnected" );
wxCHECK_MSG( findIt != pinTypes.end(), wxT( "???" ), "Could not find pin type in lookup map" );
g_pinTypesLanguage = Pgm().GetSelectedLanguageIdentifier();
}
auto findIt = g_pinTypes.find( aType );
wxCHECK_MSG( findIt != g_pinTypes.end(), wxT( "???" ), wxT( "Pin type not found!" ) );
return findIt->second.name;
}
@@ -246,9 +267,9 @@ wxString ElectricalPinTypeGetText( ELECTRICAL_PINTYPE aType )
BITMAPS ElectricalPinTypeGetBitmap( ELECTRICAL_PINTYPE aType )
{
auto findIt = pinTypes.find( aType );
auto findIt = g_pinTypes.find( aType );
wxCHECK_MSG( findIt != pinTypes.end(), BITMAPS::INVALID_BITMAP,
wxCHECK_MSG( findIt != g_pinTypes.end(), BITMAPS::INVALID_BITMAP,
wxT( "Could not find pin type in lookup map" ) );
return findIt->second.bitmap;
+55 -31
View File
@@ -34,6 +34,7 @@
#include <sch_sheet.h>
#include <sch_edit_frame.h>
#include <schematic.h>
#include <string_utils.h>
#include <symbol_lib_table.h>
#include <wildcards_and_files_ext.h>
@@ -100,17 +101,6 @@ static LIB_SYMBOL* findSymbol( const wxString& aName, SYMBOL_LIBS* aLibs, bool a
symbol = each_lib.FindSymbol( aName );
// At some point during V5 development, the LIB_ID delimiter character ':' was
// replaced by '_' when writing the symbol cache library so we have to test for
// the LIB_NICKNAME_LIB_SYMBOL_NAME case.
if( symbol == nullptr && each_lib.IsCache() )
{
wxString name = aName;
if( name.Replace( wxT( ":" ), wxT( "_" ) ) )
symbol = each_lib.FindSymbol( name );
}
if( symbol )
break;
}
@@ -160,7 +150,7 @@ void RESCUE_CASE_CANDIDATE::FindRescues( RESCUER& aRescuer,
for( SCH_SYMBOL* eachSymbol : *( aRescuer.GetSymbols() ) )
{
symbol_name = eachSymbol->GetLibId().GetLibItemName();
search_name = LIB_ID::FixIllegalChars( symbol_name, false );
search_name = EscapeString ( symbol_name, CTX_LIBID );
if( last_symbol_name != symbol_name )
{
@@ -265,7 +255,7 @@ void RESCUE_CACHE_CANDIDATE::FindRescues( RESCUER& aRescuer,
for( SCH_SYMBOL* eachSymbol : *( aRescuer.GetSymbols() ) )
{
symbol_name = eachSymbol->GetLibId().GetLibItemName();
search_name = LIB_ID::FixIllegalChars( symbol_name, false );
search_name = EscapeString ( symbol_name, CTX_LIBID );
if( old_symbol_name != symbol_name )
{
@@ -388,6 +378,8 @@ void RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues(
LIB_SYMBOL* lib_match = nullptr;
LIB_ID old_symbol_id;
wxString escapedSymbolName;
for( SCH_SYMBOL* eachSymbol : *( aRescuer.GetSymbols() ) )
{
const LIB_ID& symbol_id = eachSymbol->GetLibId();
@@ -398,11 +390,25 @@ void RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues(
// Search the symbol names candidates only once for this group:
old_symbol_id = symbol_id;
escapedSymbolName = EscapeString( symbol_id.Format().wx_str(), CTX_LIBID );
// Get the library symbol from the cache library. It will be a flattened
// symbol by default (no inheritance).
cache_match = findSymbol( symbol_id.Format().wx_str(), aRescuer.GetPrj()->SchLibs(),
cache_match = findSymbol( escapedSymbolName, aRescuer.GetPrj()->SchLibs(),
true );
// At some point during V5 development, the LIB_ID delimiter character ':' was
// replaced by '_' when writing the symbol cache library so we have to test for
// the LIB_NICKNAME_LIB_SYMBOL_NAME case.
if( !cache_match )
{
escapedSymbolName = EscapeString( symbol_id.GetLibNickname().wx_str() +
wxT( "_" ) + symbol_id.GetLibItemName().wx_str(),
CTX_LIBID );
cache_match = findSymbol( escapedSymbolName, aRescuer.GetPrj()->SchLibs(),
true );
}
// Get the library symbol from the symbol library table.
lib_match = SchGetLibSymbol( symbol_id, aRescuer.GetPrj()->SchSymbolLibTable() );
@@ -663,13 +669,13 @@ void LEGACY_RESCUER::OpenRescueLibrary()
wxFileName fn = GetRescueLibraryFileName( m_schematic );
std::unique_ptr<SYMBOL_LIB> rescue_lib = std::make_unique<SYMBOL_LIB>( SCH_LIB_TYPE::LT_EESCHEMA,
fn.GetFullPath() );
fn.GetFullPath() );
m_rescue_lib = std::move( rescue_lib );
m_rescue_lib->EnableBuffering();
// If a rescue library already exists copy the contents of that library so we do not
// lose an previous rescues.
// lose any previous rescues.
SYMBOL_LIB* rescueLib = m_prj->SchLibs()->FindLibrary( fn.GetName() );
if( rescueLib )
@@ -804,6 +810,27 @@ void SYMBOL_LIB_TABLE_RESCUER::OpenRescueLibrary()
{
m_pi.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
(*m_properties)[ SCH_LEGACY_PLUGIN::PropBuffering ] = "";
wxFileName fn = GetRescueLibraryFileName( m_schematic );
// If a rescue library already exists copy the contents of that library so we do not
// lose any previous rescues.
if( m_prj->SchSymbolLibTable()->HasLibrary( fn.GetName() ) )
{
std::vector<LIB_SYMBOL*> symbols;
try
{
m_prj->SchSymbolLibTable()->LoadSymbolLib( symbols, fn.GetName() );
}
catch( ... /* IO_ERROR */ )
{
return;
}
for( LIB_SYMBOL* symbol : symbols )
AddSymbol( symbol );
}
}
@@ -812,21 +839,21 @@ bool SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary( wxWindow *aParent )
wxString msg;
wxFileName fn = GetRescueLibraryFileName( m_schematic );
try
{
m_pi->SaveLibrary( fn.GetFullPath() );
}
catch( const IO_ERROR& ioe )
{
msg.Printf( _( "Failed to save rescue library %s." ), fn.GetFullPath() );
DisplayErrorMessage( aParent, msg, ioe.What() );
return false;
}
// If the rescue library already exists in the symbol library table no need save it to add
// it to the table.
if( !m_prj->SchSymbolLibTable()->HasLibrary( fn.GetName() ) )
{
try
{
m_pi->SaveLibrary( fn.GetFullPath() );
}
catch( const IO_ERROR& ioe )
{
msg.Printf( _( "Failed to save rescue library %s." ), fn.GetFullPath() );
DisplayErrorMessage( aParent, msg, ioe.What() );
return false;
}
wxString uri = wxT( "${KIPRJMOD}/" ) + fn.GetFullName();
wxString libNickname = fn.GetName();
@@ -874,10 +901,7 @@ void SYMBOL_LIB_TABLE_RESCUER::AddSymbol( LIB_SYMBOL* aNewSymbol )
try
{
if( !m_prj->SchSymbolLibTable()->HasLibrary( fn.GetName() ) )
m_pi->SaveSymbol( fn.GetFullPath(), new LIB_SYMBOL( *aNewSymbol ), m_properties.get() );
else
m_prj->SchSymbolLibTable()->SaveSymbol( fn.GetName(), new LIB_SYMBOL( *aNewSymbol ) );
m_pi->SaveSymbol( fn.GetFullPath(), new LIB_SYMBOL( *aNewSymbol ), m_properties.get() );
}
catch( ... /* IO_ERROR */ )
{
+2
View File
@@ -1502,6 +1502,8 @@ void SCH_EDIT_FRAME::ShowChangedLanguage()
// status bar
UpdateMsgPanel();
UpdateTitle();
// This ugly hack is to fix an option(left) toolbar update bug that seems to only affect
// windows. See https://bugs.launchpad.net/kicad/+bug/1816492. For some reason, calling
// wxWindow::Refresh() does not resolve the issue. Only a resize event seems to force the
+4 -4
View File
@@ -1013,10 +1013,10 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
c = getRenderColor( aPin, LAYER_HIDDEN, drawingShadows );
}
float insideOffset = textOffset - thickness[INSIDE] / 2.0;
float outsideOffset = 2 * Mils2iu( PIN_TEXT_MARGIN ) - thickness[OUTSIDE] / 2.0;
float aboveOffset = Mils2iu( PIN_TEXT_MARGIN ) + ( thickness[ABOVE] + penWidth ) / 2.0;
float belowOffset = Mils2iu( PIN_TEXT_MARGIN ) + ( thickness[BELOW] + penWidth ) / 2.0;
float insideOffset = textOffset - thickness[INSIDE] / 2.0;
float outsideOffset = Mils2iu( PIN_TEXT_MARGIN ) + TARGET_PIN_RADIUS - thickness[OUTSIDE] / 2.0;
float aboveOffset = Mils2iu( PIN_TEXT_MARGIN ) + penWidth / 2.0 + thickness[ABOVE] / 2.0;
float belowOffset = Mils2iu( PIN_TEXT_MARGIN ) + penWidth / 2.0 + thickness[BELOW] / 2.0;
if( isDangling )
outsideOffset += TARGET_PIN_RADIUS / 2.0;
@@ -27,6 +27,7 @@
#include <convert_to_biu.h>
#include <ki_exception.h>
#include <math/util.h>
#include <wx/log.h>
@@ -43,7 +44,12 @@ ALTIUM_SCH_RECORD ReadRecord( const std::map<wxString, wxString>& aProps )
constexpr int Altium2KiCadUnit( const int val, const int frac )
{
return Mils2iu( val ) * 10 + Mils2iu( frac ) / 10000; // TODO: correct, rounding issues?
constexpr double int_limit = ( std::numeric_limits<int>::max() - 10 ) / 2.54;
double dbase = 10 * Mils2iu( val );
double dfrac = Mils2iu( frac ) / 10000.0;
return KiROUND( Clamp<double>( -int_limit, ( dbase + dfrac ) / 10.0, int_limit ) ) * 10;
}
@@ -1308,6 +1308,13 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
SYMDEF_SCM symbol = Library.SymbolDefinitions.at( aSymdefID );
int gateNumber = getKiCadUnitNumberFromGate( aGateID );
// Ensure there are no items on this unit (e.g. if we already previously loaded the symbol from
// the part definition)
std::vector<LIB_ITEM*> drawItems = aSymbol->GetUnitDrawItems( gateNumber, 0 );
for( LIB_ITEM* item : drawItems )
aSymbol->RemoveDrawItem( item );
for( std::pair<FIGURE_ID, FIGURE> figPair : symbol.Figures )
{
FIGURE fig = figPair.second;
@@ -692,15 +692,21 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
if( sheet_count > 1 )
{
int x, y, i;
i = 1;
i = 2;
x = 1;
y = 1;
SCH_SHEET_PATH rootsheetpath;
rootsheetpath.push_back( m_rootSheet );
m_rootSheet->AddInstance( rootsheetpath );
m_rootSheet->SetPageNumber( rootsheetpath, wxT( "1" ) );
while( sheetNode )
{
wxPoint pos = wxPoint( x * Mils2iu( 1000 ), y * Mils2iu( 1000 ) );
std::unique_ptr<SCH_SHEET> sheet = std::make_unique<SCH_SHEET>( m_rootSheet, pos );
SCH_SCREEN* screen = new SCH_SCREEN( m_schematic );
wxString pageNo = wxString::Format( wxT( "%d" ), i );
sheet->SetScreen( screen );
sheet->GetScreen()->SetFileName( sheet->GetFileName() );
@@ -711,10 +717,10 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
SCH_SHEET_PATH sheetpath;
m_rootSheet->LocatePathOfScreen( m_currentSheet->GetScreen(), &sheetpath );
sheetpath.push_back( m_currentSheet );
m_currentSheet->AddInstance( sheetpath );
m_currentSheet->SetPageNumber( sheetpath, pageNo );
m_rootSheet->AddInstance( sheetpath );
m_rootSheet->SetPageNumber( sheetpath, wxString::Format( wxT( "%d" ), i ) );
m_rootSheet->SetPageNumber( sheetpath, pageNo );
sheetNode = sheetNode->GetNext();
x += 2;
@@ -1569,15 +1569,15 @@ void SCH_SEXPR_PARSER::parsePAGE_INFO( PAGE_INFO& aPageInfo )
// Perform some controls to avoid crashes if the size is edited by hands
if( width < MIN_PAGE_SIZE_MILS )
width = MIN_PAGE_SIZE_MILS;
else if( width > MAX_PAGE_SIZE_MILS )
width = MAX_PAGE_SIZE_MILS;
else if( width > MAX_PAGE_SIZE_EESCHEMA_MILS )
width = MAX_PAGE_SIZE_EESCHEMA_MILS;
int height = Mm2mils( parseDouble( "height" ) ); // height stored in mm so we convert to mils
if( height < MIN_PAGE_SIZE_MILS )
height = MIN_PAGE_SIZE_MILS;
else if( height > MAX_PAGE_SIZE_MILS )
height = MAX_PAGE_SIZE_MILS;
else if( height > MAX_PAGE_SIZE_EESCHEMA_MILS )
height = MAX_PAGE_SIZE_EESCHEMA_MILS;
aPageInfo.SetWidthMils( width );
aPageInfo.SetHeightMils( height );
@@ -2833,7 +2833,13 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN_CACHE::LoadPart( LINE_READER& aReader, int aMajorV
wxString name, prefix, tmp;
name = tokens.GetNextToken();
name = EscapeString( name, CTX_LIBID );
// Don't escape symbol library name if it's already been escaped. Given that the original
// change to escape the symbol library name has resulted in rescue libraries with escaped
// names, we will have to live with the consequences.
if( name == UnescapeString( name ) )
name = EscapeString( name, CTX_LIBID );
pos += name.size() + 1;
prefix = tokens.GetNextToken();

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