Compare commits

...

176 Commits

Author SHA1 Message Date
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
163 changed files with 23383 additions and 24285 deletions
+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
@@ -926,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 );
+6 -6
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.
+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()
+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.5" )
set( KICAD_SEMANTIC_VERSION "6.0.6" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+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 =
{
+6
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();
}
+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 -2
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
@@ -486,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;
};
+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 )
+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 ) )
+2 -2
View File
@@ -459,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 )
+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 );
+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
+33 -20
View File
@@ -210,13 +210,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 +238,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 +248,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 +264,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 +285,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 +322,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
+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() )
{
@@ -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>
@@ -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 ) );
@@ -471,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();
+1 -1
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;
@@ -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*>(
@@ -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
{
@@ -778,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
@@ -1179,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 );
@@ -1189,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 );
+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_parentType == SCH_SYMBOL_T && 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
{
+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.
+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;
@@ -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;
}
}
+20 -14
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() );
@@ -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;
@@ -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();
+1 -1
View File
@@ -97,7 +97,7 @@ namespace std
SCH_SHEET_PATH::SCH_SHEET_PATH()
{
m_virtualPageNumber = 0;
m_virtualPageNumber = 1;
m_current_hash = 0;
}
+24 -2
View File
@@ -886,7 +886,7 @@ void SCH_SYMBOL::GetLibPins( std::vector<LIB_PIN*>& aPinsList ) const
}
SCH_PIN* SCH_SYMBOL::GetPin( LIB_PIN* aLibPin )
SCH_PIN* SCH_SYMBOL::GetPin( LIB_PIN* aLibPin ) const
{
wxASSERT( m_pinMap.count( aLibPin ) );
return m_pins[ m_pinMap.at( aLibPin ) ].get();
@@ -1877,10 +1877,32 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter ) const
{
if( m_part )
{
LIB_PINS libPins;
m_part->GetPins( libPins, GetUnit(), GetConvert() );
// Copy the source so we can re-orient and translate it.
LIB_SYMBOL tempSymbol( *m_part );
LIB_PINS tempPins;
tempSymbol.GetPins( tempPins, GetUnit(), GetConvert() );
// Copy the pin info from the symbol to the temp pins
for( unsigned i = 0; i < tempPins.size(); ++ i )
{
SCH_PIN* symbolPin = GetPin( libPins[ i ] );
LIB_PIN* tempPin = tempPins[ i ];
tempPin->SetName( symbolPin->GetShownName() );
tempPin->SetType( symbolPin->GetType() );
tempPin->SetShape( symbolPin->GetShape() );
if( symbolPin->IsDangling() )
tempPin->SetFlags( IS_DANGLING );
}
TRANSFORM temp = GetTransform();
aPlotter->StartBlock( nullptr );
m_part->Plot( aPlotter, GetUnit(), GetConvert(), m_pos, temp );
tempSymbol.Plot( aPlotter, GetUnit(), GetConvert(), m_pos, temp );
for( SCH_FIELD field : m_fields )
field.Plot( aPlotter );
+1 -1
View File
@@ -456,7 +456,7 @@ public:
*/
void GetLibPins( std::vector<LIB_PIN*>& aPinsList ) const;
SCH_PIN* GetPin( LIB_PIN* aLibPin );
SCH_PIN* GetPin( LIB_PIN* aLibPin ) const;
/**
* Retrieve a list of the SCH_PINs for the given sheet path.
+10 -13
View File
@@ -619,21 +619,18 @@ wxString SCH_TEXT::GetShownText( int aDepth ) const
return true;
}
if( Type() == SCH_TEXT_T )
if( token->Contains( ':' ) )
{
if( token->Contains( ':' ) )
{
if( Schematic()->ResolveCrossReference( token, aDepth ) )
return true;
}
else
{
SCHEMATIC* schematic = Schematic();
SCH_SHEET* sheet = schematic ? schematic->CurrentSheet().Last() : nullptr;
if( Schematic()->ResolveCrossReference( token, aDepth ) )
return true;
}
else
{
SCHEMATIC* schematic = Schematic();
SCH_SHEET* sheet = schematic ? schematic->CurrentSheet().Last() : nullptr;
if( sheet && sheet->ResolveTextVar( token, aDepth + 1 ) )
return true;
}
if( sheet && sheet->ResolveTextVar( token, aDepth + 1 ) )
return true;
}
return false;
@@ -225,30 +225,38 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri
{
LIB_SYMBOL* newSymbol;
if( symbol->IsAlias() )
try
{
std::shared_ptr< LIB_SYMBOL > oldParent = symbol->GetParent().lock();
wxCHECK_MSG( oldParent, false,
wxString::Format( wxT( "Derived symbol '%s' found with undefined parent." ),
symbol->GetName() ) );
LIB_SYMBOL* libParent = pi->LoadSymbol( aLibrary, oldParent->GetName(),
&properties );
if( !libParent )
if( symbol->IsAlias() )
{
libParent = new LIB_SYMBOL( *oldParent.get() );
pi->SaveSymbol( aLibrary, libParent, &properties );
}
std::shared_ptr< LIB_SYMBOL > oldParent = symbol->GetParent().lock();
newSymbol = new LIB_SYMBOL( *symbol );
newSymbol->SetParent( libParent );
pi->SaveSymbol( aLibrary, newSymbol, &properties );
wxCHECK_MSG( oldParent, false,
wxString::Format( wxT( "Derived symbol '%s' found with undefined parent." ),
symbol->GetName() ) );
LIB_SYMBOL* libParent = pi->LoadSymbol( aLibrary, oldParent->GetName(),
&properties );
if( !libParent )
{
libParent = new LIB_SYMBOL( *oldParent.get() );
pi->SaveSymbol( aLibrary, libParent, &properties );
}
newSymbol = new LIB_SYMBOL( *symbol );
newSymbol->SetParent( libParent );
pi->SaveSymbol( aLibrary, newSymbol, &properties );
}
else if( !pi->LoadSymbol( aLibrary, symbol->GetName(), &properties ) )
{
pi->SaveSymbol( aLibrary, new LIB_SYMBOL( *symbol ), &properties );
}
}
else if( !pi->LoadSymbol( aLibrary, symbol->GetName(), &properties ) )
catch( ... )
{
pi->SaveSymbol( aLibrary, new LIB_SYMBOL( *symbol ), &properties );
res = false;
break;
}
}
}
@@ -951,11 +959,23 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
PROPERTIES properties;
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, wxEmptyString );
wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" );
// Delete the original symbol if the symbol name has been changed.
if( libSymbol->GetName() != originalSymbol->GetName() )
{
if( aLibTable->LoadSymbol( m_libName, originalSymbol->GetName() ) )
aLibTable->DeleteSymbol( m_libName, originalSymbol->GetName() );
// DeleteSymbol may throw
try
{
if( aLibTable->LoadSymbol( m_libName, originalSymbol->GetName() ) )
aLibTable->DeleteSymbol( m_libName, originalSymbol->GetName() );
}
catch( const IO_ERROR& ioe )
{
wxLogError( errorMsg, UnescapeString( originalSymbol->GetName() ), m_libName,
ioe.What() );
return false;
}
}
if( libSymbol->IsAlias() )
@@ -1046,8 +1066,17 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
// Delete the original symbol if the symbol name has been changed.
if( libSymbol->GetName() != originalSymbol->GetName() )
{
if( aPlugin->LoadSymbol( aFileName, originalSymbol->GetName() ) )
aPlugin->DeleteSymbol( aFileName, originalSymbol->GetName(), &properties );
try
{
if( aPlugin->LoadSymbol( aFileName, originalSymbol->GetName() ) )
aPlugin->DeleteSymbol( aFileName, originalSymbol->GetName(), &properties );
}
catch( const IO_ERROR& ioe )
{
wxLogError( errorMsg, UnescapeString( originalSymbol->GetName() ), aFileName,
ioe.What() );
return false;
}
}
if( libSymbol->IsAlias() )
+7 -9
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 Alexander Shuklin <Jasuramme@gmail.com>
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -290,7 +290,7 @@ void BACK_ANNOTATE::checkForUnusedSymbols()
wxString msg = wxString::Format( _( "Footprint '%s' is not present on PCB. "
"Corresponding symbols in schematic must be "
"manually deleted (if desired)." ),
m_refs[i].GetFullRef() );
m_refs[i].GetRef() );
m_reporter.ReportTail( msg, RPT_SEVERITY_WARNING );
}
@@ -327,7 +327,7 @@ void BACK_ANNOTATE::applyChangelist()
{
++m_changesCount;
msg.Printf( _( "Change '%s' reference designator to '%s'." ),
ref.GetFullRef(),
ref.GetRef(),
fpData.m_ref );
if( !m_dryRun )
@@ -344,7 +344,7 @@ void BACK_ANNOTATE::applyChangelist()
{
++m_changesCount;
msg.Printf( _( "Change %s footprint assignment from '%s' to '%s'." ),
ref.GetFullRef(),
ref.GetRef(),
oldFootprint,
fpData.m_footprint );
@@ -362,7 +362,7 @@ void BACK_ANNOTATE::applyChangelist()
{
++m_changesCount;
msg.Printf( _( "Change %s value from '%s' to '%s'." ),
ref.GetFullRef(),
ref.GetRef(),
oldValue,
fpData.m_value );
@@ -387,7 +387,7 @@ void BACK_ANNOTATE::applyChangelist()
if( !pin )
{
msg.Printf( _( "Cannot find %s pin '%s'." ),
ref.GetFullRef(),
ref.GetRef(),
pinNumber );
m_reporter.ReportHead( msg, RPT_SEVERITY_ERROR );
@@ -398,7 +398,7 @@ void BACK_ANNOTATE::applyChangelist()
if( connection && connection->Name( true ) != shortNetName )
{
processNetNameChange( ref.GetFullRef(), pin, connection,
processNetNameChange( ref.GetRef(), pin, connection,
connection->Name( true ), shortNetName );
}
}
@@ -410,8 +410,6 @@ void BACK_ANNOTATE::applyChangelist()
m_frame->RecalculateConnections( NO_CLEANUP );
m_frame->UpdateNetHighlightStatus();
}
m_reporter.ReportHead( msg, RPT_SEVERITY_INFO );
}
+10 -2
View File
@@ -245,9 +245,17 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
LIB_PIN* pin = pinList[ii - 1];
LIB_PIN* next = pinList[ii];
if( pin->GetNumber() != next->GetNumber() || pin->GetConvert() != next->GetConvert() )
if( pin->GetNumber() != next->GetNumber() )
continue;
// Pins are not duplicated only if they are in different convert bodies
// (but GetConvert() == 0 means commun to all convert bodies)
if( pin->GetConvert() != 0 && next->GetConvert() != 0 )
{
if( pin->GetConvert() != next->GetConvert() )
continue;
}
wxString pinName;
wxString nextName;
@@ -527,7 +535,7 @@ int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent )
}
else
{
GetAssociatedDocument( m_frame, datasheet, &m_frame->Prj() );
GetAssociatedDocument( m_frame, datasheet, &m_frame->Prj(), m_frame->Prj().SchSearchS() );
}
return 0;
+3 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 CERN
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-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
@@ -133,6 +133,8 @@ protected:
///< parents.
void saveCopyInUndoList( EDA_ITEM* aItem, UNDO_REDO aType, bool aAppend = false )
{
wxASSERT( aItem );
KICAD_T itemType = aItem->Type();
bool selected = aItem->IsSelected();
+19 -6
View File
@@ -1201,22 +1201,35 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent )
int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent )
{
EE_SELECTION& selection = m_selectionTool->RequestSelection( rotatableItems );
SCH_ITEM* head = static_cast<SCH_ITEM*>( selection.Front() );
bool moving = head && head->IsMoving();
if( selection.Empty() )
return 0;
SCH_ITEM* head = static_cast<SCH_ITEM*>( selection.Front() );
bool moving = head && head->IsMoving();
std::vector<SCH_ITEM*> autoplaceItems;
for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
{
SCH_ITEM* sch_item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
if( item->IsType( EE_COLLECTOR::FieldOwners ) )
autoplaceItems.push_back( item );
else if( item->GetParent() && item->GetParent()->IsType( EE_COLLECTOR::FieldOwners ) )
autoplaceItems.push_back( static_cast<SCH_ITEM*>( item->GetParent() ) );
}
bool appendUndo = false;
for( SCH_ITEM* sch_item : autoplaceItems )
{
if( !moving && !sch_item->IsNew() )
saveCopyInUndoList( sch_item, UNDO_REDO::CHANGED, ii > 0 );
{
saveCopyInUndoList( sch_item, UNDO_REDO::CHANGED, appendUndo );
appendUndo = true;
}
if( sch_item->IsType( EE_COLLECTOR::FieldOwners ) )
sch_item->AutoplaceFields( m_frame->GetScreen(), /* aManual */ true );
sch_item->AutoplaceFields( m_frame->GetScreen(), /* aManual */ true );
updateItem( sch_item, true );
}
+4 -5
View File
@@ -499,18 +499,17 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
continue;
}
SCH_SCREEN* screen = sheet->LastScreen();
sheet->UpdateAllScreenReferences();
item = nextMatch( screen, sheet, nullptr, data );
item = nextMatch( sheet->LastScreen(), sheet, nullptr, data );
if( item )
{
m_frame->Schematic().SetCurrentSheet( *sheet );
m_frame->GetCurrentSheet().UpdateAllScreenReferences();
screen->TestDanglingEnds();
sheet->LastScreen()->TestDanglingEnds();
m_frame->SetScreen( screen );
m_frame->SetScreen( sheet->LastScreen() );
m_frame->UpdateHierarchyNavigator();
UpdateFind( ACTIONS::updateFind.MakeEvent() );
@@ -290,6 +290,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
controls->SetAutoPan( false );
controls->CaptureCursor( false );
controls->ForceCursorPosition( false );
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
return 0;
}
+3 -10
View File
@@ -484,18 +484,11 @@ void GBR_TO_PCB_EXPORTER::writePcbHeader( const LAYER_NUM* aLayerLookUpTable )
void GBR_TO_PCB_EXPORTER::writePcbPolygon( const SHAPE_POLY_SET& aPolys, LAYER_NUM aLayer,
const wxPoint& aOffset )
{
SHAPE_POLY_SET polys = aPolys;
// Cleanup the polygon
polys.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
// Ensure the polygon is valid:
if( polys.OutlineCount() == 0 )
if( aPolys.OutlineCount() == 0 )
return;
polys.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
SHAPE_LINE_CHAIN& poly = polys.Outline( 0 );
const SHAPE_LINE_CHAIN& poly = aPolys.COutline( 0 );
fprintf( m_fp, "(gr_poly (pts " );
@@ -532,7 +525,7 @@ void GBR_TO_PCB_EXPORTER::writePcbPolygon( const SHAPE_POLY_SET& aPolys, LAYER_N
void GBR_TO_PCB_EXPORTER::writePcbZoneItem( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
{
SHAPE_POLY_SET polys = aGbrItem->m_Polygon;
polys.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
polys.Simplify( SHAPE_POLY_SET::PM_FAST );
if( polys.OutlineCount() == 0 )
return;
+5 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2021 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
@@ -299,8 +299,11 @@ void GERBVIEW_PAINTER::draw( /*const*/ GERBER_DRAW_ITEM* aItem, int aLayer )
// On Opengl, a not convex filled polygon is usually drawn by using triangles as primitives.
// CacheTriangulation() can create basic triangle primitives to draw the polygon solid shape
// on Opengl
// We use the fastest CacheTriangulation calculation mode: no partition created because
// the partition is useless in Gerbview, and very time consumming (optimized only
// for pcbnew that has different internal unit)
if( m_gal->IsOpenGlEngine() && !aItem->m_AbsolutePolygon.IsTriangulationUpToDate() )
aItem->m_AbsolutePolygon.CacheTriangulation();
aItem->m_AbsolutePolygon.CacheTriangulation( false /* fastest triangulation calculation mode */ );
m_gal->DrawPolygon( aItem->m_AbsolutePolygon );
}
+3 -1
View File
@@ -40,8 +40,10 @@
*
* @param aParent main frame.
* @param aDocName filename of file to open (Full filename or short filename).
* @param aPaths Additional paths to search for local disk datasheet files
*/
bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT* aProject );
bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT* aProject,
SEARCH_STACK* aPaths = nullptr );
#endif /* __INCLUDE__EDA_DOC_H__ */
+3 -2
View File
@@ -114,8 +114,8 @@ protected:
class GRID_CELL_URL_EDITOR : public GRID_CELL_TEXT_BUTTON
{
public:
GRID_CELL_URL_EDITOR( DIALOG_SHIM* aParent ) :
m_dlg( aParent )
GRID_CELL_URL_EDITOR( DIALOG_SHIM* aParent, SEARCH_STACK* aSearchStack = nullptr ) :
m_dlg( aParent ), m_searchStack( aSearchStack )
{ }
wxGridCellEditor* Clone() const override
@@ -127,6 +127,7 @@ public:
protected:
DIALOG_SHIM* m_dlg;
SEARCH_STACK* m_searchStack;
};
+1 -1
View File
@@ -84,7 +84,7 @@ public:
/**
* Set new value (in Internal Units) for the text field, taking care of units conversion.
*/
virtual void SetValue( int aValue );
virtual void SetValue( long long int aValue );
void SetValue( const wxString& aValue );
+9 -1
View File
@@ -132,12 +132,14 @@ DIALOG_PCM::DIALOG_PCM( wxWindow* parent ) : DIALOG_PCM_BASE( parent )
m_sdbSizer1OK->SetLabel( _( "Close" ) );
m_sdbSizer1Cancel->SetLabel( _( "Discard Changes" ) );
m_sdbSizer1Apply->SetLabel( _( "Apply Changes" ) );
m_sdbSizer1->Layout();
SetDefaultItem( m_sdbSizer1OK );
Bind( wxEVT_CLOSE_WINDOW, &DIALOG_PCM::OnCloseWindow, this );
m_sdbSizer1Cancel->Bind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
m_sdbSizer1Apply->Bind( wxEVT_UPDATE_UI, &DIALOG_PCM::OnUpdateEventButtons, this );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
KICAD_SETTINGS* app_settings = mgr.GetAppSettings<KICAD_SETTINGS>();
@@ -166,6 +168,12 @@ DIALOG_PCM::~DIALOG_PCM()
}
void DIALOG_PCM::OnUpdateEventButtons( wxUpdateUIEvent& event )
{
event.Enable( !m_pendingActions.empty() );
}
void DIALOG_PCM::OnCloseClicked( wxCommandEvent& event )
{
if( m_pendingActions.size() == 0
+3
View File
@@ -67,6 +67,9 @@ public:
///< Discards selected pending actions
void OnDiscardActionClicked( wxCommandEvent& event ) override;
///< Handles modification of the buttons' status
void OnUpdateEventButtons( wxUpdateUIEvent& event );
private:
/**
* @brief Gets package data from PCM and displays it on repository tab
@@ -335,7 +335,6 @@ void PANEL_PACKAGES_VIEW::setPackageDetails( const PACKAGE_VIEW_DATA& aPackageDa
{
if( m_gridVersions->GetCellValue( i, COL_VERSION ) == version )
{
std::cout << "auto select row: " << i << std::endl;
m_gridVersions->SelectRow( i );
break;
}
+1 -1
View File
@@ -337,7 +337,7 @@ void PCM_TASK_MANAGER::InstallFromFile( wxWindow* aParent, const wxString& aFile
m_pcm->MarkInstalled( package, package.versions[0].version, "" );
m_reporter->SetFinished();
m_reporter->KeepRefreshing( true );
m_reporter->KeepRefreshing( false );
m_reporter->Destroy();
m_reporter.reset();
}
+11 -1
View File
@@ -499,6 +499,16 @@ public:
SHAPE_POLY_SET& operator=( const SHAPE_POLY_SET& aOther );
/**
* Build a polygon triangulation, needed to draw a polygon on OpenGL and in some
* other calculations
* @param aPartition = true to created a trinagulation in a partition on a grid
* false to create a more basic triangulation of the polygons
* Note
* in partition calculations the grid size is hard coded to 1e7.
* This is a good value for Pcbnew: 1cm, in internal units.
* But not good for Gerbview (1e7 = 10cm), however using a partition is not useful.
*/
void CacheTriangulation( bool aPartition = true );
bool IsTriangulationUpToDate() const;
@@ -1352,7 +1362,7 @@ public:
/**
* Build a SHAPE_POLY_SET from a bunch of outlines in provided in random order.
*
*
* @param aPath set of closed outlines forming the polygon. Positive orientation = outline, negative = hole
* @param aReverseOrientation inverts the sign of the orientation of aPaths (so negative = outline)
* @param aEvenOdd forces the even-off fill rule (default is non zero)
+45 -4
View File
@@ -35,6 +35,39 @@ int sgn( T aVal )
return ( T( 0 ) < aVal ) - ( aVal < T( 0 ) );
}
template <typename T>
constexpr T sqrt_helper(T x, T lo, T hi)
{
if (lo == hi)
return lo;
const T mid = (lo + hi + 1) / 2;
if (x / mid < mid)
return sqrt_helper<T>(x, lo, mid - 1);
else
return sqrt_helper(x, mid, hi);
}
template <typename T>
constexpr T ct_sqrt(T x)
{
return sqrt_helper<T>(x, 0, x / 2 + 1);
}
template <typename T>
T isqrt(T x)
{
T r = (T) std::sqrt((double) x);
T sqrt_max = ct_sqrt(std::numeric_limits<T>::max());
while (r < sqrt_max && r * r < x)
r++;
while (r > sqrt_max || r * r > x)
r--;
return r;
}
SEG::ecoord SEG::SquaredDistance( const SEG& aSeg ) const
{
@@ -209,7 +242,7 @@ bool SEG::Collide( const SEG& aSeg, int aClearance, int* aActual ) const
if( dist_sq == 0 || dist_sq < (ecoord) aClearance * aClearance )
{
if( aActual )
*aActual = sqrt( dist_sq );
*aActual = isqrt( dist_sq );
return true;
}
@@ -284,13 +317,13 @@ VECTOR2I SEG::LineProject( const VECTOR2I& aP ) const
int SEG::Distance( const SEG& aSeg ) const
{
return KiROUND( sqrt( SquaredDistance( aSeg ) ) );
return isqrt( SquaredDistance( aSeg ) );
}
int SEG::Distance( const VECTOR2I& aP ) const
{
return KiROUND( sqrt( SquaredDistance( aP ) ) );
return isqrt( SquaredDistance( aP ) );
}
@@ -299,8 +332,16 @@ int SEG::LineDistance( const VECTOR2I& aP, bool aDetermineSide ) const
ecoord p = ecoord{ A.y } - B.y;
ecoord q = ecoord{ B.x } - A.x;
ecoord r = -p * A.x - q * A.y;
ecoord l = p * p + q * q;
ecoord det = p * aP.x + q * aP.y + r;
ecoord dist_sq = 0;
ecoord dist = KiROUND( ( p * aP.x + q * aP.y + r ) / sqrt( p * p + q * q ) );
if( l > 0 )
{
dist_sq = rescale( det, det, l );
}
ecoord dist = isqrt( dist_sq );
return aDetermineSide ? dist : std::abs( dist );
}
+23 -33
View File
@@ -1743,46 +1743,36 @@ SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify( bool aRemoveColinear )
i = 0;
// stage 2: eliminate colinear segments
while( i < np - 2 )
for( i = 1 ; i < np - 1 ; i ++ )
{
const VECTOR2I p0 = pts_unique[i];
const VECTOR2I p1 = pts_unique[i + 1];
int n = i;
const VECTOR2I p_prev = pts_unique[i - 1];
const VECTOR2I midpoint = pts_unique[i];
const VECTOR2I p_next = pts_unique[i + 1];
if( aRemoveColinear && shapes_unique[i] == SHAPES_ARE_PT
&& shapes_unique[i + 1] == SHAPES_ARE_PT )
if( aRemoveColinear && shapes_unique[i - 1] == SHAPES_ARE_PT
&& shapes_unique[i] == SHAPES_ARE_PT )
{
while( n < np - 2
&& ( SEG( p0, p1 ).LineDistance( pts_unique[n + 2] ) <= 1
|| SEG( p0, p1 ).Collinear( SEG( p1, pts_unique[n + 2] ) ) ) )
n++;
}
const auto distToMidpoint = SEG( p_prev, p_next ).LineDistance( midpoint );
const auto isMidpointColinear = SEG( p_prev, p_next ).Collinear( SEG( p_prev, midpoint ) );
m_points.push_back( p0 );
if( distToMidpoint <= 1 || isMidpointColinear )
{
pts_unique.erase( pts_unique.begin() + i );
shapes_unique.erase( shapes_unique.begin() + i );
i--;
np--;
continue;
}
}
}
for( i = 0 ; i < np; i ++ )
{
m_points.push_back( pts_unique[i] );
m_shapes.push_back( shapes_unique[i] );
if( n > i )
i = n;
if( n == np - 2 )
{
m_points.push_back( pts_unique[np - 1] );
m_shapes.push_back( shapes_unique[np - 1] );
return *this;
}
i++;
}
if( np > 1 )
{
m_points.push_back( pts_unique[np - 2] );
m_shapes.push_back( shapes_unique[np - 2] );
}
m_points.push_back( pts_unique[np - 1] );
m_shapes.push_back( shapes_unique[np - 1] );
assert( m_points.size() == m_shapes.size() );
return *this;
+6 -2
View File
@@ -1191,6 +1191,7 @@ void SHAPE_POLY_SET::unfractureSingle( SHAPE_POLY_SET::POLYGON& aPoly )
int outline = -1;
POLYGON result;
double max_poly = 0.0;
while( queue.size() )
{
@@ -1215,10 +1216,13 @@ void SHAPE_POLY_SET::unfractureSingle( SHAPE_POLY_SET::POLYGON& aPoly )
outl.SetClosed( true );
bool cw = outl.Area() > 0.0;
double area = std::fabs( outl.Area() );
if( cw )
if( area > max_poly )
{
outline = n;
max_poly = area;
}
result.push_back( outl );
n++;
+1 -1
View File
@@ -209,7 +209,7 @@ set( PCBNEW_EXPORTERS
exporters/export_footprint_associations.cpp
exporters/export_gencad.cpp
exporters/export_idf.cpp
exporters/export_vrml.cpp
exporters/exporter_vrml.cpp
exporters/export_footprints_placefile.cpp
exporters/gen_drill_report_files.cpp
exporters/gen_footprints_placefile.cpp
@@ -427,20 +427,14 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
// Go through all other footprint items
for( BOARD_ITEM* boardItem : fp->GraphicalItems() )
{
if( boardItem->Type() == PCB_FP_TEXT_T )
{
// We are guaranteed to always get an EDA_TEXT in this statement, but we must
// use the dynamic_cast to move through the type tree anyway.
const wxString text = dynamic_cast<EDA_TEXT*>( boardItem )->GetText();
KICAD_T itemType = boardItem->Type();
if( m_references->GetValue() && text == wxT( "${REFERENCE}" ) )
visitItem( commit, boardItem );
else if( m_values->GetValue() && text == wxT( "${VALUE}" ) )
visitItem( commit, boardItem );
else if( m_otherFields->GetValue() )
if( itemType == PCB_FP_TEXT_T )
{
if( m_otherFields->GetValue() )
visitItem( commit, boardItem );
}
else if( boardItem->Type() == PCB_FP_SHAPE_T )
else if( itemType == PCB_FP_SHAPE_T )
{
if( m_footprintGraphics->GetValue() )
visitItem( commit, boardItem );
+6 -2
View File
@@ -516,15 +516,19 @@ bool PANEL_SETUP_LAYERS::TransferDataFromWindow()
m_enabledLayers = GetUILayerMask();
if( m_enabledLayers != m_pcb->GetEnabledLayers() )
LSET previousEnabled = m_pcb->GetEnabledLayers();
if( m_enabledLayers != previousEnabled )
{
m_pcb->SetEnabledLayers( m_enabledLayers );
LSET changedLayers = m_enabledLayers ^ previousEnabled;
/* Ensure enabled layers are also visible
* This is mainly to avoid mistakes if some enabled
* layers are not visible when exiting this dialog
*/
m_pcb->SetVisibleLayers( m_enabledLayers );
m_pcb->SetVisibleLayers( m_pcb->GetVisibleLayers() | changedLayers );
modified = true;
}
+6 -6
View File
@@ -55,12 +55,12 @@ PANEL_SETUP_RULES::PANEL_SETUP_RULES( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFr
m_textEditor->AutoCompSetSeparator( '|' );
m_netClassRegex.Compile( "NetClass\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_netNameRegex.Compile( "NetName\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_typeRegex.Compile( "Type\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_padTypeRegex.Compile( "Pad_Type\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_pinTypeRegex.Compile( "Pin_Type\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_fabPropRegex.Compile( "Fabrication_Property\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_netClassRegex.Compile( "^NetClass\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_netNameRegex.Compile( "^NetName\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_typeRegex.Compile( "^Type\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_padTypeRegex.Compile( "^Pad_Type\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_pinTypeRegex.Compile( "^Pin_Type\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_fabPropRegex.Compile( "^Fabrication_Property\\s*[!=]=\\s*$", wxRE_ADVANCED );
m_compileButton->SetBitmap( KiBitmap( BITMAPS::drc ) );
+6
View File
@@ -192,6 +192,9 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
GetDesignSettings().m_TempOverrideTrackWidth = true;
}
// Needed on Windows because the canvas loses focus after clicking on m_SelTrackWidthBox:
GetCanvas()->SetFocus();
break;
case ID_AUX_TOOLBAR_PCB_VIA_SIZE:
@@ -212,6 +215,9 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
GetDesignSettings().SetViaSizeIndex( ii );
}
// Needed on Windows because the canvas loses focus after clicking on m_SelViaSizeBox:
GetCanvas()->SetFocus();
break;
default:
+18 -5
View File
@@ -179,12 +179,19 @@ private:
switch( aStack.m_shape )
{
case PAD_SHAPE::CIRCLE:
case PAD_SHAPE::OVAL: shapeId = 0; break;
case PAD_SHAPE::ROUNDRECT: shapeId = 2; break;
case PAD_SHAPE::RECT: shapeId = 1; break;
default:
case PAD_SHAPE::OVAL:
shapeId = 0;
break;
case PAD_SHAPE::ROUNDRECT:
shapeId = 2;
break;
case PAD_SHAPE::RECT:
shapeId = 1;
break;
default:
if( m_reporter )
{
m_reporter->Report( _( "File contains pad shapes that are not supported by the "
@@ -194,6 +201,8 @@ private:
m_reporter->Report( _( "They have been exported as oval pads." ),
RPT_SEVERITY_INFO );
}
shapeId = 0;
break;
}
@@ -253,7 +262,7 @@ HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const PCB_VIA* aVia )
m_sx = aVia->GetWidth();
m_sy = aVia->GetWidth();
m_angle = 0;
m_layers = LSET::AllCuMask();
m_layers = aVia->GetLayerSet();
m_drill = aVia->GetDrillValue();
m_shape = PAD_SHAPE::CIRCLE;
m_type = PAD_ATTRIB::PTH;
@@ -479,6 +488,10 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
iu2hyp( track->GetEnd().x ), iu2hyp( track->GetEnd().y ),
iu2hyp( track->GetWidth() ), (const char*) layerName.c_str() );
}
else if( PCB_ARC* arc = dyn_cast<PCB_ARC*>( item ) )
{
// TODO!
}
else if( ZONE* zone = dyn_cast<ZONE*>( item ) )
{
for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
@@ -58,14 +58,29 @@
#define ERR_APPROX_MAX_MM 0.005
EXPORTER_PCB_VRML::EXPORTER_PCB_VRML() :
CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::g_SilkscreenColors;
CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::g_MaskColors;
CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::g_PasteColors;
CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::g_FinishColors;
CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::g_BoardColors;
KIGFX::COLOR4D EXPORTER_PCB_VRML::g_DefaultSilkscreen;
KIGFX::COLOR4D EXPORTER_PCB_VRML::g_DefaultSolderMask;
KIGFX::COLOR4D EXPORTER_PCB_VRML::g_DefaultSolderPaste;
KIGFX::COLOR4D EXPORTER_PCB_VRML::g_DefaultSurfaceFinish;
KIGFX::COLOR4D EXPORTER_PCB_VRML::g_DefaultBoardBody;
static bool g_ColorsLoaded = false;
EXPORTER_PCB_VRML::EXPORTER_PCB_VRML( BOARD* aPCB ) :
m_OutputPCB( nullptr )
{
m_ReuseDef = true;
m_precision = 6;
m_WorldScale = 1.0;
m_Cache3Dmodels = nullptr;
m_Pcb = nullptr;
m_Pcb = aPCB;
m_UseInlineModelsInBrdfile = false;
m_UseRelPathIn3DModelFilename = false;
m_BoardToVrmlScale = MM_PER_IU;
@@ -77,23 +92,181 @@ EXPORTER_PCB_VRML::EXPORTER_PCB_VRML() :
m_layer_z[i] = 0;
// this default only makes sense if the output is in mm
m_brd_thickness = 1.6;
m_brd_thickness = Iu2Millimeter( m_Pcb->GetDesignSettings().GetBoardThickness() );
// pcb green
vrml_colors_list[VRML_COLOR_PCB] = VRML_COLOR(
0.12f, 0.20f, 0.19f, 0.01f, 0.03f, 0.01f, 0.0f, 0.0f, 0.0f, 0.8f, 0.0f, 0.02f );
// copper color
vrml_colors_list[VRML_COLOR_COPPER] = VRML_COLOR(
0.72f, 0.45f, 0.2f, 0.01f, 0.05f, 0.01f, 0.0f, 0.0f, 0.0f, 0.8f, 0.0f, 0.02f );
// silkscreen white
vrml_colors_list[VRML_COLOR_SILK] = VRML_COLOR(
0.7f, 0.7f, 0.9f, 0.1f, 0.1f, 0.1f, 0.0f, 0.0f, 0.0f, 0.9f, 0.0f, 0.02f );
// solder paste silver (gray)
vrml_colors_list[VRML_COLOR_PASTE] = VRML_COLOR( 0.4f, 0.4f, 0.4f, 0.2f, 0.2f, 0.2f, 0.0f,
0.0f, 0.0f, 0.8f, 0.0f, 0.8f );
// solder mask green with transparency
vrml_colors_list[VRML_COLOR_SOLDMASK] = VRML_COLOR(
0.07f, 0.3f, 0.12f, 0.01f, 0.03f, 0.01f, 0.0f, 0.0f, 0.0f, 0.8f, 0.25f, 0.02f );
// TODO: figure out a way to share all these stackup color definitions....
if( !g_ColorsLoaded )
{
#define ADD_COLOR( list, r, g, b, a, name ) \
list.emplace_back( r/255.0, g/255.0, b/255.0, a, name )
ADD_COLOR( g_SilkscreenColors, 245, 245, 245, 1.0, _HKI( "Not specified" ) ); // White
ADD_COLOR( g_SilkscreenColors, 20, 51, 36, 1.0, wxT( "Green" ) );
ADD_COLOR( g_SilkscreenColors, 181, 19, 21, 1.0, wxT( "Red" ) );
ADD_COLOR( g_SilkscreenColors, 2, 59, 162, 1.0, wxT( "Blue" ) );
ADD_COLOR( g_SilkscreenColors, 11, 11, 11, 1.0, wxT( "Black" ) );
ADD_COLOR( g_SilkscreenColors, 245, 245, 245, 1.0, wxT( "White" ) );
ADD_COLOR( g_SilkscreenColors, 32, 2, 53, 1.0, wxT( "Purple" ) );
ADD_COLOR( g_SilkscreenColors, 194, 195, 0, 1.0, wxT( "Yellow" ) );
ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, _HKI( "Not specified" ) ); // Green
ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, wxT( "Green" ) );
ADD_COLOR( g_MaskColors, 91, 168, 12, 0.83, wxT( "Light Green" ) );
ADD_COLOR( g_MaskColors, 13, 104, 11, 0.83, wxT( "Saturated Green" ) );
ADD_COLOR( g_MaskColors, 181, 19, 21, 0.83, wxT( "Red" ) );
ADD_COLOR( g_MaskColors, 210, 40, 14, 0.83, wxT( "Light Red" ) );
ADD_COLOR( g_MaskColors, 239, 53, 41, 0.83, wxT( "Red/Orange" ) );
ADD_COLOR( g_MaskColors, 2, 59, 162, 0.83, wxT( "Blue" ) );
ADD_COLOR( g_MaskColors, 54, 79, 116, 0.83, wxT( "Light Blue 1" ) );
ADD_COLOR( g_MaskColors, 61, 85, 130, 0.83, wxT( "Light Blue 2" ) );
ADD_COLOR( g_MaskColors, 21, 70, 80, 0.83, wxT( "Green/Blue" ) );
ADD_COLOR( g_MaskColors, 11, 11, 11, 0.83, wxT( "Black" ) );
ADD_COLOR( g_MaskColors, 245, 245, 245, 0.83, wxT( "White" ) );
ADD_COLOR( g_MaskColors, 32, 2, 53, 0.83, wxT( "Purple" ) );
ADD_COLOR( g_MaskColors, 119, 31, 91, 0.83, wxT( "Light Purple" ) );
ADD_COLOR( g_MaskColors, 194, 195, 0, 0.83, wxT( "Yellow" ) );
ADD_COLOR( g_PasteColors, 128, 128, 128, 1.0, wxT( "Grey" ) );
ADD_COLOR( g_PasteColors, 90, 90, 90, 1.0, wxT( "Dark Grey" ) );
ADD_COLOR( g_PasteColors, 213, 213, 213, 1.0, wxT( "Silver" ) );
ADD_COLOR( g_FinishColors, 184, 115, 50, 1.0, wxT( "Copper" ) );
ADD_COLOR( g_FinishColors, 178, 156, 0, 1.0, wxT( "Gold" ) );
ADD_COLOR( g_FinishColors, 213, 213, 213, 1.0, wxT( "Silver" ) );
ADD_COLOR( g_FinishColors, 160, 160, 160, 1.0, wxT( "Tin" ) );
ADD_COLOR( g_BoardColors, 51, 43, 22, 0.83, wxT( "FR4 natural, dark" ) );
ADD_COLOR( g_BoardColors, 109, 116, 75, 0.83, wxT( "FR4 natural" ) );
ADD_COLOR( g_BoardColors, 252, 252, 250, 0.90, wxT( "PTFE natural" ) );
ADD_COLOR( g_BoardColors, 205, 130, 0, 0.68, wxT( "Polyimide" ) );
ADD_COLOR( g_BoardColors, 92, 17, 6, 0.90, wxT( "Phenolic natural" ) );
ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, wxT( "Brown 1" ) );
ADD_COLOR( g_BoardColors, 160, 123, 54, 0.83, wxT( "Brown 2" ) );
ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, wxT( "Brown 3" ) );
ADD_COLOR( g_BoardColors, 213, 213, 213, 1.0, wxT( "Aluminum" ) );
g_DefaultSilkscreen = COLOR4D( 0.94, 0.94, 0.94, 1.0 );
g_DefaultSolderMask = COLOR4D( 0.08, 0.20, 0.14, 0.83 );
g_DefaultSolderPaste = COLOR4D( 0.50, 0.50, 0.50, 1.0 );
g_DefaultSurfaceFinish = COLOR4D( 0.75, 0.61, 0.23, 1.0 );
g_DefaultBoardBody = COLOR4D( 0.43, 0.45, 0.30, 0.90 );
g_ColorsLoaded = true;
}
#undef ADD_COLOR
COLOR4D topSilk = g_DefaultSilkscreen;
COLOR4D botSilk = g_DefaultSilkscreen;
COLOR4D topMask = g_DefaultSolderMask;
COLOR4D botMask = g_DefaultSolderMask;
COLOR4D paste = g_DefaultSolderPaste;
COLOR4D finish = g_DefaultSurfaceFinish;
COLOR4D boardBody( 0, 0, 0, 0 );
const BOARD_STACKUP& stackup = m_Pcb->GetDesignSettings().GetStackupDescriptor();
auto findColor =
[]( const wxString& aColorName, const CUSTOM_COLORS_LIST& aColorSet )
{
if( aColorName.StartsWith( wxT( "#" ) ) )
{
return KIGFX::COLOR4D( aColorName );
}
else
{
for( const CUSTOM_COLOR_ITEM& color : aColorSet )
{
if( color.m_ColorName == aColorName )
return color.m_Color;
}
}
return KIGFX::COLOR4D();
};
for( const BOARD_STACKUP_ITEM* stackupItem : stackup.GetList() )
{
wxString colorName = stackupItem->GetColor();
switch( stackupItem->GetType() )
{
case BS_ITEM_TYPE_SILKSCREEN:
if( stackupItem->GetBrdLayerId() == F_SilkS )
topSilk = findColor( colorName, g_SilkscreenColors );
else
botSilk = findColor( colorName, g_SilkscreenColors );
break;
case BS_ITEM_TYPE_SOLDERMASK:
if( stackupItem->GetBrdLayerId() == F_Mask )
topMask = findColor( colorName, g_MaskColors );
else
botMask = findColor( colorName, g_MaskColors );
break;
case BS_ITEM_TYPE_DIELECTRIC:
{
KIGFX::COLOR4D layerColor = findColor( colorName, g_BoardColors );
if( boardBody == COLOR4D( 0, 0, 0, 0 ) )
boardBody = layerColor;
else
boardBody = boardBody.Mix( layerColor, 1.0 - layerColor.a );
boardBody.a += ( 1.0 - boardBody.a ) * layerColor.a / 2;
break;
}
default:
break;
}
}
if( boardBody == COLOR4D( 0, 0, 0, 0 ) )
boardBody = g_DefaultBoardBody;
const wxString& finishName = stackup.m_FinishType;
if( finishName.EndsWith( wxT( "OSP" ) ) )
{
finish = findColor( wxT( "Copper" ), g_FinishColors );
}
else if( finishName.EndsWith( wxT( "IG" ) )
|| finishName.EndsWith( wxT( "gold" ) ) )
{
finish = findColor( wxT( "Gold" ), g_FinishColors );
}
else if( finishName.StartsWith( wxT( "HAL" ) )
|| finishName.StartsWith( wxT( "HASL" ) )
|| finishName.EndsWith( wxT( "tin" ) )
|| finishName.EndsWith( wxT( "nickel" ) ) )
{
finish = findColor( wxT( "Tin" ), g_FinishColors );
}
else if( finishName.EndsWith( wxT( "silver" ) ) )
{
finish = findColor( wxT( "Silver" ), g_FinishColors );
}
auto toVRMLColor =
[]( const COLOR4D& aColor, double aSpecular, double aAmbient, double aShiny )
{
COLOR4D diff = aColor;
COLOR4D spec = aColor.Brightened( aSpecular );
return VRML_COLOR( diff.r, diff.g, diff.b,
spec.r, spec.g, spec.b,
aAmbient, 1.0 - aColor.a, aShiny );
};
vrml_colors_list[VRML_COLOR_TOP_SILK] = toVRMLColor( topSilk, 0.1, 0.7, 0.02 );
vrml_colors_list[VRML_COLOR_BOT_SILK] = toVRMLColor( botSilk, 0.1, 0.7, 0.02 );
vrml_colors_list[VRML_COLOR_TOP_SOLDMASK] = toVRMLColor( topMask, 0.3, 0.8, 0.30 );
vrml_colors_list[VRML_COLOR_BOT_SOLDMASK] = toVRMLColor( botMask, 0.3, 0.8, 0.30 );
vrml_colors_list[VRML_COLOR_PASTE] = toVRMLColor( paste, 0.6, 0.7, 0.70 );
vrml_colors_list[VRML_COLOR_COPPER] = toVRMLColor( finish, 0.6, 0.7, 0.90 );
vrml_colors_list[VRML_COLOR_PCB] = toVRMLColor( boardBody, 0.1, 0.7, 0.01 );
SetOffset( 0.0, 0.0 );
}
@@ -164,15 +337,15 @@ bool EXPORTER_PCB_VRML::GetLayer3D( LAYER_NUM layer, VRML_LAYER** vlayer )
// a layer has been selected.
switch( layer )
{
case B_Cu: *vlayer = &m_bot_copper; return true;
case F_Cu: *vlayer = &m_top_copper; return true;
case B_SilkS: *vlayer = &m_bot_silk; return true;
case F_SilkS: *vlayer = &m_top_silk; return true;
case B_Cu: *vlayer = &m_bot_copper; return true;
case F_Cu: *vlayer = &m_top_copper; return true;
case B_SilkS: *vlayer = &m_bot_silk; return true;
case F_SilkS: *vlayer = &m_top_silk; return true;
case B_Mask: *vlayer = &m_bot_soldermask; return true;
case F_Mask: *vlayer = &m_top_soldermask; return true;
case B_Paste: *vlayer = &m_bot_paste; return true;
case F_Paste: *vlayer = &m_top_paste; return true;
default: return false;
case B_Paste: *vlayer = &m_bot_paste; return true;
case F_Paste: *vlayer = &m_top_paste; return true;
default: return false;
}
}
@@ -394,7 +567,7 @@ void EXPORTER_PCB_VRML::writeLayers( const char* aFileName, OSTREAM* aOutputFile
if( m_UseInlineModelsInBrdfile )
{
write_triangle_bag( *aOutputFile, GetColor( VRML_COLOR_SOLDMASK ),
write_triangle_bag( *aOutputFile, GetColor( VRML_COLOR_TOP_SOLDMASK ),
&m_top_soldermask, true, true,
GetLayerZ( F_Cu ) + Millimeter2iu( ART_OFFSET / 2.0 ) *
m_BoardToVrmlScale,
@@ -402,7 +575,7 @@ void EXPORTER_PCB_VRML::writeLayers( const char* aFileName, OSTREAM* aOutputFile
}
else
{
create_vrml_plane( m_OutputPCB, VRML_COLOR_SOLDMASK, &m_top_soldermask,
create_vrml_plane( m_OutputPCB, VRML_COLOR_TOP_SOLDMASK, &m_top_soldermask,
GetLayerZ( F_Cu ) + Millimeter2iu( ART_OFFSET / 2.0 ) *
m_BoardToVrmlScale,
true );
@@ -446,7 +619,7 @@ void EXPORTER_PCB_VRML::writeLayers( const char* aFileName, OSTREAM* aOutputFile
if( m_UseInlineModelsInBrdfile )
{
write_triangle_bag( *aOutputFile, GetColor( VRML_COLOR_SOLDMASK ),
write_triangle_bag( *aOutputFile, GetColor( VRML_COLOR_BOT_SOLDMASK ),
&m_bot_soldermask, true, false,
GetLayerZ( B_Cu ) - Millimeter2iu( ART_OFFSET / 2.0 ) *
m_BoardToVrmlScale,
@@ -454,7 +627,7 @@ void EXPORTER_PCB_VRML::writeLayers( const char* aFileName, OSTREAM* aOutputFile
}
else
{
create_vrml_plane( m_OutputPCB, VRML_COLOR_SOLDMASK, &m_bot_soldermask,
create_vrml_plane( m_OutputPCB, VRML_COLOR_BOT_SOLDMASK, &m_bot_soldermask,
GetLayerZ( B_Cu ) - Millimeter2iu( ART_OFFSET / 2.0 ) *
m_BoardToVrmlScale,
false );
@@ -486,12 +659,12 @@ void EXPORTER_PCB_VRML::writeLayers( const char* aFileName, OSTREAM* aOutputFile
if( m_UseInlineModelsInBrdfile )
{
write_triangle_bag( *aOutputFile, GetColor( VRML_COLOR_SILK ), &m_top_silk,
write_triangle_bag( *aOutputFile, GetColor( VRML_COLOR_TOP_SILK ), &m_top_silk,
true, true, GetLayerZ( F_SilkS ), 0 );
}
else
{
create_vrml_plane( m_OutputPCB, VRML_COLOR_SILK, &m_top_silk,
create_vrml_plane( m_OutputPCB, VRML_COLOR_TOP_SILK, &m_top_silk,
GetLayerZ( F_SilkS ), true );
}
@@ -500,12 +673,12 @@ void EXPORTER_PCB_VRML::writeLayers( const char* aFileName, OSTREAM* aOutputFile
if( m_UseInlineModelsInBrdfile )
{
write_triangle_bag( *aOutputFile, GetColor( VRML_COLOR_SILK ), &m_bot_silk,
write_triangle_bag( *aOutputFile, GetColor( VRML_COLOR_BOT_SILK ), &m_bot_silk,
true, false, GetLayerZ( B_SilkS ), 0 );
}
else
{
create_vrml_plane( m_OutputPCB, VRML_COLOR_SILK, &m_bot_silk,
create_vrml_plane( m_OutputPCB, VRML_COLOR_BOT_SILK, &m_bot_silk,
GetLayerZ( B_SilkS ), false );
}
@@ -982,12 +1155,10 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt
const wxString& a3D_Subdir,
double aXRef, double aYRef )
{
BOARD* pcb = GetBoard();
bool success = true;
bool success = true;
EXPORTER_PCB_VRML model3d( GetBoard() );
EXPORTER_PCB_VRML model3d;
model_vrml = &model3d;
model3d.m_Pcb = GetBoard();
model3d.SetScale( aMMtoWRMLunit );
model3d.m_UseInlineModelsInBrdfile = aExport3DFiles;
model3d.m_Subdir3DFpModels = a3D_Subdir;
@@ -1037,7 +1208,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt
else
{
// merge footprints in the .vrml board file
for( FOOTPRINT* footprint : pcb->Footprints() )
for( FOOTPRINT* footprint : GetBoard()->Footprints() )
model3d.ExportVrmlFootprint( footprint, nullptr );
// write out the board and all layers
+49 -33
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021-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
@@ -23,6 +23,8 @@
#pragma once
#include <dialogs/dialog_color_picker.h>
// offset for art layers, mm (silk, paste, etc)
#define ART_OFFSET 0.025
// offset for plating
@@ -34,9 +36,11 @@ enum VRML_COLOR_INDEX
VRML_COLOR_NONE = -1,
VRML_COLOR_PCB = 0,
VRML_COLOR_COPPER,
VRML_COLOR_SOLDMASK,
VRML_COLOR_TOP_SOLDMASK,
VRML_COLOR_BOT_SOLDMASK,
VRML_COLOR_PASTE,
VRML_COLOR_SILK,
VRML_COLOR_TOP_SILK,
VRML_COLOR_BOT_SILK,
VRML_COLOR_LAST // Sentinel
};
@@ -79,7 +83,6 @@ struct VRML_COLOR
VRML_COLOR( float dr, float dg, float db,
float sr, float sg, float sb,
float er, float eg, float eb,
float am, float tr, float sh )
{
diffuse_red = dr;
@@ -88,9 +91,9 @@ struct VRML_COLOR
spec_red = sr;
spec_grn = sg;
spec_blu = sb;
emit_red = er;
emit_grn = eg;
emit_blu = eb;
emit_red = 0.0f;
emit_grn = 0.0f;
emit_blu = 0.0f;
ambient = am;
transp = tr;
@@ -103,7 +106,7 @@ struct VRML_COLOR
class EXPORTER_PCB_VRML
{
public:
EXPORTER_PCB_VRML();
EXPORTER_PCB_VRML( BOARD* aPCB );
~EXPORTER_PCB_VRML();
VRML_COLOR& GetColor( VRML_COLOR_INDEX aIndex )
@@ -140,8 +143,6 @@ public:
// Build and exports the board outlines (board body)
void ExportVrmlBoard();
void ExportVrmlVia( const PCB_VIA* aVia );
// Export all via holes
void ExportVrmlViaHoles();
@@ -177,49 +178,64 @@ private:
SGNODE* getSGColor( VRML_COLOR_INDEX colorIdx );
public:
IFSG_TRANSFORM m_OutputPCB;
VRML_LAYER m_holes;
VRML_LAYER m_3D_board;
VRML_LAYER m_top_copper;
VRML_LAYER m_bot_copper;
VRML_LAYER m_top_silk;
VRML_LAYER m_bot_silk;
VRML_LAYER m_top_soldermask;
VRML_LAYER m_bot_soldermask;
VRML_LAYER m_top_paste;
VRML_LAYER m_bot_paste;
VRML_LAYER m_plated_holes;
static CUSTOM_COLORS_LIST g_SilkscreenColors;
static CUSTOM_COLORS_LIST g_MaskColors;
static CUSTOM_COLORS_LIST g_PasteColors;
static CUSTOM_COLORS_LIST g_FinishColors;
static CUSTOM_COLORS_LIST g_BoardColors;
std::list< SGNODE* > m_components;
S3D_CACHE* m_Cache3Dmodels;
BOARD* m_Pcb;
static KIGFX::COLOR4D g_DefaultBackgroundTop;
static KIGFX::COLOR4D g_DefaultBackgroundBot;
static KIGFX::COLOR4D g_DefaultSilkscreen;
static KIGFX::COLOR4D g_DefaultSolderMask;
static KIGFX::COLOR4D g_DefaultSolderPaste;
static KIGFX::COLOR4D g_DefaultSurfaceFinish;
static KIGFX::COLOR4D g_DefaultBoardBody;
public:
IFSG_TRANSFORM m_OutputPCB;
VRML_LAYER m_holes;
VRML_LAYER m_3D_board;
VRML_LAYER m_top_copper;
VRML_LAYER m_bot_copper;
VRML_LAYER m_top_silk;
VRML_LAYER m_bot_silk;
VRML_LAYER m_top_soldermask;
VRML_LAYER m_bot_soldermask;
VRML_LAYER m_top_paste;
VRML_LAYER m_bot_paste;
VRML_LAYER m_plated_holes;
std::list<SGNODE*> m_components;
S3D_CACHE* m_Cache3Dmodels;
BOARD* m_Pcb;
/* true to use VRML inline{} syntax for footprint 3D models, like:
* Inline { url "F:/tmp/pic_programmer/shapes3D/DIP-18_W7.62mm_Socket.wrl" }
* false to merge VRML 3D modules in the .wrl board file
*/
bool m_UseInlineModelsInBrdfile;
bool m_UseInlineModelsInBrdfile;
// 3D subdirectory to copy footprint vrml 3D models when not merged in board file
wxString m_Subdir3DFpModels;
// true to use relative paths in VRML inline{} for footprint 3D models
// used only if m_UseInlineModelsInBrdfile = true
bool m_UseRelPathIn3DModelFilename;
bool m_UseRelPathIn3DModelFilename;
// true to reuse component definitions
bool m_ReuseDef;
bool m_ReuseDef;
// scaling from 0.1 inch to desired VRML unit
double m_WorldScale = 1.0;
double m_WorldScale = 1.0;
// scaling from mm to desired VRML world scale
double m_BoardToVrmlScale;
double m_BoardToVrmlScale;
double m_tx; // global translation along X
double m_ty; // global translation along Y
double m_tx; // global translation along X
double m_ty; // global translation along Y
double m_brd_thickness; // depth of the PCB
double m_brd_thickness; // depth of the PCB
private:
VRML_COLOR vrml_colors_list[VRML_COLOR_LAST];
+24 -4
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 Jean_Pierre Charras <jp.charras at wanadoo.fr>
* 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 as published by the
@@ -140,7 +140,8 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
GBR_CMP_PNP_METADATA pnpAttrib;
// Add rotation info (rotation is CCW, in degrees):
pnpAttrib.m_Orientation = mapRotationAngle( footprint->GetOrientationDegrees() );
pnpAttrib.m_Orientation = mapRotationAngle( footprint->GetOrientationDegrees(),
aLayer == B_Cu ? true : false );
pnpAttrib.m_MountType = GBR_CMP_PNP_METADATA::MOUNT_TYPE_UNSPECIFIED;
@@ -313,10 +314,29 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
}
double PLACEFILE_GERBER_WRITER::mapRotationAngle( double aAngle )
double PLACEFILE_GERBER_WRITER::mapRotationAngle( double aAngle, bool aIsFlipped )
{
// Convert a KiCad footprint orientation to gerber rotation, depending on the layer
// Currently, same notation as KiCad.
// Gerber rotation is:
// rot angle > 0 for rot CW, seen from Top side
// same a Pcbnew for Top side
// (angle + 180) for Bottom layer i.e flipped around Y axis: X axis coordinates mirrored.
// because Pcbnew flip around the X axis : Y coord mirrored, that is similar to mirror
// around Y axis + 180 deg rotation
if( aIsFlipped )
{
double gbr_angle = 180.0 + aAngle;
// Normalize between -180 ... + 180 deg
// Not mandatory, but the angle is more easy to read
if( gbr_angle <= -180 )
gbr_angle += 360.0;
else if( gbr_angle > 180 )
gbr_angle -= 360.0;
return gbr_angle;
}
return aAngle;
}
+7 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 Jean_Pierre Charras <jp.charras at wanadoo.fr>
* 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 as published by the
@@ -80,8 +80,13 @@ public:
private:
/**
* Convert a KiCad footprint orientation to gerber rotation both are in degrees.
* @param aAngle is the Pcbnew angle in degrees
* @param aIsFlipped = false for footprints on top side, true on bottom side (flipped)
* @return the angle in degrees in Gerber convention:
* same as Pcbnew for top side
* 180 + angle for bottom side
*/
double mapRotationAngle( double aAngle );
double mapRotationAngle( double aAngle, bool aIsFlipped );
/**
* Find the pad(s) 1 (or pad "A1") of a footprint.
+14 -11
View File
@@ -2373,18 +2373,21 @@ static struct FOOTPRINT_DESC
propMgr.AddProperty( new PROPERTY<FOOTPRINT, int>( _HKI( "Solderpaste Margin Override" ),
&FOOTPRINT::SetLocalSolderPasteMargin, &FOOTPRINT::GetLocalSolderPasteMargin,
PROPERTY_DISPLAY::DISTANCE ) );
propMgr.AddProperty( new PROPERTY<FOOTPRINT,
double>( _HKI( "Solderpaste Margin Ratio Override" ),
&FOOTPRINT::SetLocalSolderPasteMarginRatio,
&FOOTPRINT::GetLocalSolderPasteMarginRatio ) );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, double>( _HKI( "Solderpaste Margin Ratio Override" ),
&FOOTPRINT::SetLocalSolderPasteMarginRatio,
&FOOTPRINT::GetLocalSolderPasteMarginRatio ) );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, int>( _HKI( "Thermal Relief Width" ),
&FOOTPRINT::SetThermalWidth,
&FOOTPRINT::GetThermalWidth,
PROPERTY_DISPLAY::DISTANCE ) );
&FOOTPRINT::SetThermalWidth, &FOOTPRINT::GetThermalWidth,
PROPERTY_DISPLAY::DISTANCE ) );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, int>( _HKI( "Thermal Relief Gap" ),
&FOOTPRINT::SetThermalGap,
&FOOTPRINT::GetThermalGap,
PROPERTY_DISPLAY::DISTANCE ) );
// TODO zone connection, FPID?
&FOOTPRINT::SetThermalGap, &FOOTPRINT::GetThermalGap,
PROPERTY_DISPLAY::DISTANCE ) );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Library ID" ),
&FOOTPRINT::SetFPIDAsString, &FOOTPRINT::GetFPIDAsString ) );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Description" ),
&FOOTPRINT::SetDescription, &FOOTPRINT::GetDescription ) );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Keywords" ),
&FOOTPRINT::SetKeywords, &FOOTPRINT::GetKeywords ) );
// TODO zone connection
}
} _FOOTPRINT_DESC;
+3
View File
@@ -195,6 +195,9 @@ public:
const LIB_ID& GetFPID() const { return m_fpid; }
void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
const wxString GetFPIDAsString() const { return m_fpid.Format(); }
void SetFPIDAsString( const wxString& aFPID ) { m_fpid.Parse( aFPID ); }
const wxString& GetDescription() const { return m_doc; }
void SetDescription( const wxString& aDoc ) { m_doc = aDoc; }
+2
View File
@@ -800,6 +800,8 @@ void FOOTPRINT_EDIT_FRAME::ShowChangedLanguage()
wxAuiPaneInfo& lm_pane_info = m_auimgr.GetPane( m_appearancePanel );
bool lm_shown = lm_pane_info.IsShown();
lm_pane_info.Caption( _( "Appearance" ) );
wxAuiPaneInfo& sf_pane_info = m_auimgr.GetPane( m_selectionFilterPanel );
sf_pane_info.Caption( _( "Selection Filter" ) );
// update the layer manager
m_appearancePanel->OnLanguageChanged();
+5 -1
View File
@@ -247,7 +247,11 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
id.SetLibNickname( getCurNickname() );
id.SetLibItemName( getCurFootprintName() );
GetBoard()->Add( loadFootprint( id ) );
FOOTPRINT* footprint = loadFootprint( id );
if( footprint )
GetBoard()->Add( footprint );
}
drawPanel->DisplayBoard( m_pcb );
+5 -2
View File
@@ -476,12 +476,15 @@ void FP_TEXT::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffe
bool aIgnoreLineWidth ) const
{
SHAPE_POLY_SET buffer;
EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon( &buffer, aClearance );
FP_TEXT dummy( *this );
// Take parent footprint in account:
const FOOTPRINT* parentFootprint = static_cast<const FOOTPRINT*>( m_parent );
if( parentFootprint )
buffer.Rotate( DECIDEG2RAD( GetDrawRotation() ), GetTextPos() );
dummy.SetTextAngle( GetTextAngle() + parentFootprint->GetOrientation() );
dummy.EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon( &buffer, aClearance );
aCornerBuffer.Append( buffer );
}
+14 -24
View File
@@ -100,36 +100,26 @@ public:
if( idx >= 0 )
{
// And, sadly, it appears to have also become customary to bury the url inside
// parentheses.
if( idx >= 1 && desc.at( idx - 1 ) == '(' )
int nesting = 0;
for( auto chit = desc.begin() + idx; chit != desc.end(); ++chit )
{
int nesting = 0;
int ch = *chit;
while( idx < (int) desc.size() )
{
char c = desc.at( idx++ );
// Break on invalid URI characters
if( ch <= 0x20 || ch >= 0x7F || ch == '"' )
break;
if( c == '(' )
nesting++;
else if( c == ')' && --nesting < 0 )
break;
// Check for nesting parentheses, e.g. (Body style from: https://this.url/part.pdf)
if( ch == '(' )
++nesting;
else if( ch == ')' && --nesting < 0 )
break;
doc += c;
}
doc += ch;
}
desc.Replace( doc, _( "doc url" ) );
}
else
{
doc = desc.substr( (unsigned) idx );
desc = desc.substr( 0, (unsigned) idx );
desc = desc.Trim( true );
if( !desc.IsEmpty() && desc.Last() == ',' )
desc.RemoveLast( 1 );
}
}
m_html.Replace( "__NAME__", EscapeHTML( name ) );
+2
View File
@@ -885,6 +885,8 @@ void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
return false;
} );
GetCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR );
RecreateToolbars();
// The 3D viewer isn't in the Kiway, so send its update manually
+4 -2
View File
@@ -1249,8 +1249,10 @@ void PCB_EDIT_FRAME::ShowChangedLanguage()
// call my base class
PCB_BASE_EDIT_FRAME::ShowChangedLanguage();
wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_appearancePanel );
pane_info.Caption( _( "Appearance" ) );
wxAuiPaneInfo& ap_pane_info = m_auimgr.GetPane( m_appearancePanel );
ap_pane_info.Caption( _( "Appearance" ) );
wxAuiPaneInfo& sf_pane_info = m_auimgr.GetPane( m_selectionFilterPanel );
sf_pane_info.Caption( _( "Selection Filter" ) );
m_auimgr.Update();
m_appearancePanel->OnLanguageChanged();
+2 -2
View File
@@ -197,7 +197,7 @@ void PCBNEW_PRINTOUT::setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet
renderSettings->SetLayerColor( LAYER_PAD_BK, invisible_color );
// Enable items on copper layers, but do not draw holes
for( GAL_LAYER_ID layer : { LAYER_PADS_TH, LAYER_VIA_THROUGH } )
for( GAL_LAYER_ID layer : { LAYER_PADS_TH, LAYER_VIA_THROUGH, LAYER_VIA_MICROVIA, LAYER_VIA_BBLIND } )
{
if( ( aLayerSet & LSET::AllCuMask() ).any() ) // Items visible on any copper layer
aView.SetLayerVisible( layer, true );
@@ -212,7 +212,7 @@ void PCBNEW_PRINTOUT::setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet
{
LAYER_MOD_TEXT, LAYER_MOD_FR, LAYER_MOD_BK,
LAYER_MOD_VALUES, LAYER_MOD_REFERENCES, LAYER_TRACKS, LAYER_ZONES, LAYER_PADS,
LAYER_VIAS, LAYER_VIA_MICROVIA, LAYER_VIA_BBLIND,
LAYER_VIAS,
LAYER_PAD_FR, LAYER_PAD_BK, LAYER_PADS_TH
};
+3 -8
View File
@@ -1857,8 +1857,7 @@ void EAGLE_PLUGIN::packageWire( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
}
}
// FIXME: the cap attribute is ignored because KiCad can't create lines
// with flat ends.
// FIXME: the cap attribute is ignored because KiCad can't create lines with flat ends.
FP_SHAPE* dwg;
if( !w.curve )
@@ -1926,12 +1925,9 @@ void EAGLE_PLUGIN::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree )
break;
case EPAD::OCTAGON:
// no KiCad octagonal pad shape, use PAD_CIRCLE for now.
// pad->SetShape( PAD_OCTAGON );
wxASSERT( pad->GetShape() == PAD_SHAPE::CIRCLE ); // verify set in PAD constructor
pad->SetShape( PAD_SHAPE::CHAMFERED_RECT );
pad->SetChamferPositions( RECT_CHAMFER_ALL );
pad->SetChamferRectRatio( 0.25 );
pad->SetChamferRectRatio( 1 - M_SQRT1_2 ); // Regular polygon
break;
case EPAD::LONG:
@@ -1968,8 +1964,7 @@ void EAGLE_PLUGIN::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree )
if( pad->GetShape() == PAD_SHAPE::OVAL )
{
// The Eagle "long" pad is wider than it is tall,
// m_elongation is percent elongation
// The Eagle "long" pad is wider than it is tall; m_elongation is percent elongation
wxSize sz = pad->GetSize();
sz.x = ( sz.x * ( 100 + m_rules->psElongationLong ) ) / 100;
pad->SetSize( sz );
+16 -16
View File
@@ -161,7 +161,7 @@ double StrToDoublePrecisionUnits( const wxString& aStr, char aAxe,
else
{
ls.ToCDouble( &i );
i = Mils2iu( i );
i *= IU_PER_MILS;
}
}
else
@@ -304,21 +304,21 @@ TTEXT_JUSTIFY GetJustifyIdentificator( const wxString& aJustify )
{
TTEXT_JUSTIFY id;
if( aJustify == wxT( "LowerCenter" ) )
if( aJustify.IsSameAs( wxT( "LowerCenter" ), false ) )
id = LowerCenter;
else if( aJustify == wxT( "LowerRight" ) )
else if( aJustify.IsSameAs( wxT( "LowerRight" ), false ) )
id = LowerRight;
else if( aJustify == wxT( "UpperLeft" ) )
else if( aJustify.IsSameAs( wxT( "UpperLeft" ), false ) )
id = UpperLeft;
else if( aJustify == wxT( "UpperCenter" ) )
else if( aJustify.IsSameAs( wxT( "UpperCenter" ), false ) )
id = UpperCenter;
else if( aJustify == wxT( "UpperRight" ) )
else if( aJustify.IsSameAs( wxT( "UpperRight" ), false ) )
id = UpperRight;
else if( aJustify == wxT( "Left" ) )
else if( aJustify.IsSameAs( wxT( "Left" ), false ) )
id = Left;
else if( aJustify == wxT( "Center" ) )
else if( aJustify.IsSameAs( wxT( "Center" ), false ) )
id = Center;
else if( aJustify == wxT( "Right" ) )
else if( aJustify.IsSameAs( wxT( "Right" ), false ) )
id = Right;
else
id = LowerLeft;
@@ -354,7 +354,7 @@ void SetTextParameters( XNODE* aNode, TTEXTVALUE* aTextValue,
str = FindNodeGetContent( aNode, wxT( "isVisible" ) );
if( str == wxT( "True" ) )
if( str.IsSameAs( wxT( "True" ), false ) )
aTextValue->textIsVisible = 1;
else
aTextValue->textIsVisible = 0;
@@ -364,7 +364,7 @@ void SetTextParameters( XNODE* aNode, TTEXTVALUE* aTextValue,
str = FindNodeGetContent( aNode, wxT( "isFlipped" ) );
if( str == wxT( "True" ) )
if( str.IsSameAs( wxT( "True" ), false ) )
aTextValue->mirror = 1;
else
aTextValue->mirror = 0;
@@ -408,13 +408,13 @@ void SetFontProperty( XNODE* aNode, TTEXTVALUE* aTextValue, const wxString& aDef
wxString fontType;
propValue = FindNodeGetContent( aNode, wxT( "textStyleDisplayTType" ) );
aTextValue->isTrueType = ( propValue == wxT( "True" ) );
aTextValue->isTrueType = ( propValue.IsSameAs( wxT( "True" ), false ) );
aNode = FindNode( aNode, wxT( "font" ) );
fontType = FindNodeGetContent( aNode, wxT( "fontType" ) );
if( ( aTextValue->isTrueType && ( fontType != wxT( "TrueType" ) ) ) ||
( !aTextValue->isTrueType && ( fontType != wxT( "Stroke" ) ) ) )
if( ( aTextValue->isTrueType && !fontType.IsSameAs( wxT( "TrueType" ), false ) ) ||
( !aTextValue->isTrueType && !fontType.IsSameAs( wxT( "Stroke" ), false ) ) )
aNode = aNode->GetNext();
if( aNode )
@@ -422,7 +422,7 @@ void SetFontProperty( XNODE* aNode, TTEXTVALUE* aTextValue, const wxString& aDef
if( aTextValue->isTrueType )
{
propValue = FindNodeGetContent( aNode, wxT( "fontItalic" ) );
aTextValue->isItalic = ( propValue == wxT( "True" ) );
aTextValue->isItalic = propValue.IsSameAs( wxT( "True" ), false );
propValue = FindNodeGetContent( aNode, wxT( "fontWeight" ) );
@@ -562,7 +562,7 @@ XNODE* FindNode( XNODE* aChild, const wxString& aTag )
while( aChild )
{
if( aChild->GetName() == aTag )
if( aChild->GetName().IsSameAs( aTag, false ) )
return aChild;
aChild = aChild->GetNext();
+41 -38
View File
@@ -148,7 +148,7 @@ XNODE* PCB::FindCompDefName( XNODE* aNode, const wxString& aName ) const
while( lNode )
{
if( lNode->GetName() == wxT( "compDef" ) )
if( lNode->GetName().IsSameAs( wxT( "compDef" ), false ) )
{
lNode->GetAttribute( wxT( "Name" ), &propValue );
@@ -190,7 +190,7 @@ void PCB::SetTextProperty( XNODE* aNode, TTEXTVALUE* aTextValue, const wxString&
while( tNode )
{
if( tNode->GetName() == wxT( "patternGraphicsRef" ) )
if( tNode->GetName().IsSameAs( wxT( "patternGraphicsRef" ), false ) )
{
if( FindNode( tNode, wxT( "patternGraphicsNameRef" ) ) )
{
@@ -252,7 +252,7 @@ void PCB::DoPCBComponents( XNODE* aNode, wxXmlDocument* aXmlDoc, const wxString&
{
fp = nullptr;
if( lNode->GetName() == wxT( "pattern" ) )
if( lNode->GetName().IsSameAs( wxT( "pattern" ), false ) )
{
FindNode( lNode, wxT( "patternRef" ) )->GetAttribute( wxT( "Name" ),
&cn );
@@ -309,7 +309,7 @@ void PCB::DoPCBComponents( XNODE* aNode, wxXmlDocument* aXmlDoc, const wxString&
str = FindNodeGetContent( lNode, wxT( "isFlipped" ) );
if( str == wxT( "True" ) )
if( str.IsSameAs( wxT( "True" ), false ) )
fp->m_Mirror = 1;
tNode = aNode;
@@ -370,7 +370,7 @@ void PCB::DoPCBComponents( XNODE* aNode, wxXmlDocument* aXmlDoc, const wxString&
while( mNode )
{
if( mNode->GetName() == wxT( "padNum" ) )
if( mNode->GetName().IsSameAs( wxT( "padNum" ), false ) )
{
str = mNode->GetNodeContent();
mNode = mNode->GetNext();
@@ -398,19 +398,19 @@ void PCB::DoPCBComponents( XNODE* aNode, wxXmlDocument* aXmlDoc, const wxString&
m_PcbComponents.Add( fp );
}
}
else if( lNode->GetName() == wxT( "pad" ) )
else if( lNode->GetName().IsSameAs( wxT( "pad" ), false ) )
{
pad = new PCB_PAD( this, m_board );
pad->Parse( lNode, m_DefaultMeasurementUnit, aActualConversion );
m_PcbComponents.Add( pad );
}
else if( lNode->GetName() == wxT( "via" ) )
else if( lNode->GetName().IsSameAs( wxT( "via" ), false ) )
{
via = new PCB_VIA( this, m_board );
via->Parse( lNode, m_DefaultMeasurementUnit, aActualConversion );
m_PcbComponents.Add( via );
}
else if( lNode->GetName() == wxT( "polyKeepOut" ) )
else if( lNode->GetName().IsSameAs( wxT( "polyKeepOut" ), false ) )
{
keepOut = new PCB_KEEPOUT( m_callbacks, m_board, 0 );
@@ -455,9 +455,9 @@ void PCB::ConnectPinToNet( const wxString& aCompRef, const wxString& aPinRef,
int PCB::FindLayer( const wxString& aLayerName ) const
{
for( LAYER_NUM i = 0; i < (int)m_layersStackup.GetCount(); ++i )
for( LAYER_NUM i = 0; i < (int)m_layersStackup.size(); ++i )
{
if( m_layersStackup[i] == aLayerName )
if( m_layersStackup[i].first == aLayerName )
return i;
}
@@ -525,11 +525,7 @@ void PCB::MapLayer( XNODE* aNode )
if( layernum == -1 )
KiCadLayer = Dwgs_User; // default
else
#if 0 // was:
KiCadLayer = FIRST_COPPER_LAYER + m_layersStackup.GetCount() - 1 - layernum;
#else
KiCadLayer = ToLAYER_ID( layernum );
#endif
}
if( FindNode( aNode, wxT( "layerNum" ) ) )
@@ -545,13 +541,13 @@ void PCB::MapLayer( XNODE* aNode )
{
layerType = FindNode( aNode, wxT( "layerType" ) )->GetNodeContent().Trim( false );
if( layerType == wxT( "NonSignal" ) )
if( layerType.IsSameAs( wxT( "NonSignal" ), false ) )
newlayer.layerType = LAYER_TYPE_NONSIGNAL;
if( layerType == wxT( "Signal" ) )
if( layerType.IsSameAs( wxT( "Signal" ), false ) )
newlayer.layerType = LAYER_TYPE_SIGNAL;
if( layerType == wxT( "Plane" ) )
if( layerType.IsSameAs( wxT( "Plane" ), false ) )
newlayer.layerType = LAYER_TYPE_PLANE;
}
@@ -578,15 +574,6 @@ int PCB::FindOutlinePoint( const VERTICES_ARRAY* aOutline, wxRealPoint aPoint )
}
/*int cmpFunc( wxRealPoint **first, wxRealPoint **second )
{
return sqrt( pow( (double) aPointA.x - (double) aPointB.x, 2 ) +
pow( (double) aPointA.y - (double) aPointB.y, 2 ) );
return 0;
}*/
double PCB::GetDistance( const wxRealPoint* aPoint1, const wxRealPoint* aPoint2 ) const
{
return sqrt( ( aPoint1->x - aPoint2->x ) * ( aPoint1->x - aPoint2->x ) +
@@ -611,7 +598,7 @@ void PCB::GetBoardOutline( wxXmlDocument* aXmlDoc, const wxString& aActualConver
while( iNode )
{
// objects
if( iNode->GetName() == wxT( "layerContents" ) )
if( iNode->GetName().IsSameAs( wxT( "layerContents" ), false ) )
{
if( FindNode( iNode, wxT( "layerNumRef" ) ) )
FindNode( iNode, wxT( "layerNumRef" ) )->GetNodeContent().ToLong( &PCadLayer );
@@ -622,7 +609,7 @@ void PCB::GetBoardOutline( wxXmlDocument* aXmlDoc, const wxString& aActualConver
while( lNode )
{
if( lNode->GetName() == wxT( "line" ) )
if( lNode->GetName().IsSameAs( wxT( "line" ), false ) )
{
pNode = FindNode( lNode, wxT( "pt" ) );
@@ -747,18 +734,24 @@ void PCB::ParseBoard( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc,
while( aNode )
{
if( aNode->GetName() == wxT( "layerDef" ) )
if( aNode->GetName().IsSameAs( wxT( "layerDef" ), false ) )
{
if( FindNode( aNode, wxT( "layerType" ) ) )
{
layerType = FindNode( aNode,
wxT( "layerType" ) )->GetNodeContent().Trim( false );
long num = -1;
if( layerType == wxT( "Signal" ) || layerType == wxT( "Plane" ) )
if( FindNode( aNode, wxT( "layerNum" ) ) )
FindNode( aNode, wxT( "layerNum" ) )->GetNodeContent().ToLong( &num );
layerType = FindNode( aNode, wxT( "layerType" ) )->GetNodeContent().Trim(
false );
if( num > 0 && ( layerType.IsSameAs( wxT( "Signal" ), false )
|| layerType.IsSameAs( wxT( "Plane" ), false ) ) )
{
aNode->GetAttribute( wxT( "Name" ), &layerName );
layerName = layerName.MakeUpper();
m_layersStackup.Add( layerName );
m_layersStackup.emplace_back( layerName, num );
if( m_layersStackup.size() > 32 )
THROW_IO_ERROR( _( "KiCad only supports 32 signal layers." ) );
@@ -768,6 +761,16 @@ void PCB::ParseBoard( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc,
aNode = aNode->GetNext();
}
// Ensure that the layers are properly mapped to their order with the bottom
// copper (layer 2 in PCAD) at the end
std::sort( m_layersStackup.begin(), m_layersStackup.end(),
[&]( const std::pair<wxString, long>& a, const std::pair<wxString, long>& b ) {
long lhs = a.second == 2 ? std::numeric_limits<long>::max() : a.second;
long rhs = b.second == 2 ? std::numeric_limits<long>::max() : b.second;
return lhs < rhs;
} );
}
// Layers mapping
@@ -779,7 +782,7 @@ void PCB::ParseBoard( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc,
while( aNode )
{
if( aNode->GetName() == wxT( "layerDef" ) )
if( aNode->GetName().IsSameAs( wxT( "layerDef" ), false ) )
MapLayer( aNode );
aNode = aNode->GetNext();
@@ -822,11 +825,11 @@ void PCB::ParseBoard( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc,
while( aNode )
{
// Components/footprints
if( aNode->GetName() == wxT( "multiLayer" ) )
if( aNode->GetName().IsSameAs( wxT( "multiLayer" ), false ) )
DoPCBComponents( aNode, aXmlDoc, aActualConversion, aStatusBar );
// objects
if( aNode->GetName() == wxT( "layerContents" ) )
if( aNode->GetName().IsSameAs( wxT( "layerContents" ), false ) )
DoLayerContentsObjects( aNode, nullptr, &m_PcbComponents, aStatusBar,
m_DefaultMeasurementUnit, aActualConversion );
@@ -924,7 +927,7 @@ void PCB::ParseBoard( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc,
{
// aStatusBar->SetStatusText( wxT( "Processing COMPONENTS " ) );
if( aNode->GetName() == wxT( "compDef" ) )
if( aNode->GetName().IsSameAs( wxT( "compDef" ), false ) )
{
footprint = new PCB_FOOTPRINT( this, m_board );
footprint->Parse( aNode, aStatusBar, m_DefaultMeasurementUnit,
@@ -944,7 +947,7 @@ void PCB::AddToBoard()
int i;
PCB_NET* net;
m_board->SetCopperLayerCount( m_layersStackup.GetCount() );
m_board->SetCopperLayerCount( m_layersStackup.size() );
for( i = 0; i < (int) m_PcbNetlist.GetCount(); i++ )
{
+1 -1
View File
@@ -83,7 +83,7 @@ private:
double GetDistance( const wxRealPoint* aPoint1, const wxRealPoint* aPoint2 ) const;
void GetBoardOutline( wxXmlDocument* aXmlDoc, const wxString& aActualConversion );
wxArrayString m_layersStackup;
std::vector<std::pair<wxString, long>> m_layersStackup;
};
} // namespace PCAD2KICAD
+4
View File
@@ -86,6 +86,10 @@ bool PCB_COPPER_POUR::Parse( XNODE* aNode, const wxString& aDefaultUnits,
lNode = FindNode( aNode, wxT( "pcbPoly" ) );
// If the pour doesn't have the newer `pcbPoly` tag, check for the older `pourOutline` tag
if( !lNode )
lNode = FindNode( aNode, wxT( "pourOutline" ) );
if( lNode )
{
// retrieve copper pour outline
+1 -18
View File
@@ -476,23 +476,6 @@ void PCB_FOOTPRINT::Parse( XNODE* aNode, wxStatusBar* aStatusBar,
}
wxString PCB_FOOTPRINT::ModuleLayer( int aMirror )
{
wxString result;
// ///NOT ! {IntToStr(KiCadLayer)} NOT !
// / FOOTPRINTs ARE HARD PLACED ON COMPONENT OR COPPER LAYER.
// / IsFLIPPED--> MIRROR attribute is decision Point!!!
if( aMirror == 0 )
result = wxT( "15" ); // Components side
else
result = wxT( "0" ); // Copper side
return result;
}
void PCB_FOOTPRINT::AddToBoard()
{
int i;
@@ -540,7 +523,7 @@ void PCB_FOOTPRINT::AddToBoard()
ref_text->SetMirrored( m_name.mirror );
ref_text->SetVisible( m_name.textIsVisible );
ref_text->SetLayer( m_name.mirror ? FlipLayer( m_KiCadLayer ) : m_KiCadLayer );
ref_text->SetLayer( m_Mirror ? FlipLayer( m_KiCadLayer ) : m_KiCadLayer );
// Calculate the actual position.
ref_text->SetDrawCoord();
-1
View File
@@ -67,7 +67,6 @@ public:
private:
XNODE* FindPatternMultilayerSection( XNODE* aNode, wxString* aPatGraphRefName );
wxString ModuleLayer( int aMirror );
};
} // namespace PCAD2KICAD
+9 -9
View File
@@ -154,14 +154,14 @@ void PCB_PAD::Parse( XNODE* aNode, const wxString& aDefaultUnits,
if( cNode )
SetWidth( cNode->GetNodeContent(), aDefaultUnits, &m_Hole, aActualConversion );
if( FindNodeGetContent( lNode, wxT( "isHolePlated" ) ) == wxT( "False" ) )
if( FindNodeGetContent( lNode, wxT( "isHolePlated" ) ).IsSameAs( wxT( "False" ), false ) )
m_IsHolePlated = false;
cNode = FindNode( lNode, wxT( "padShape" ) );
while( cNode )
{
if( cNode->GetName() == wxT( "padShape" ) )
if( cNode->GetName().IsSameAs( wxT( "padShape" ), false ) )
{
// we support only Pads on specific layers......
// we do not support pads on "Plane", "NonSignal" , "Signal" ... layerr
@@ -215,7 +215,7 @@ void PCB_PAD::AddToFootprint( FOOTPRINT* aFootprint, int aRotation, bool aEncaps
// Mounting Hole: Solder Mask Margin from Top Layer Width size.
// Used the default zone clearance (simplify)
if( m_Shapes.GetCount() && m_Shapes[0]->m_Shape == wxT( "MtHole" ) )
if( m_Shapes.GetCount() && m_Shapes[0]->m_Shape.IsSameAs( wxT( "MtHole" ), false ) )
{
int sm_margin = ( m_Shapes[0]->m_Width - m_Hole ) / 2;
pad->SetLocalSolderMaskMargin( sm_margin );
@@ -265,24 +265,24 @@ void PCB_PAD::AddToFootprint( FOOTPRINT* aFootprint, int aRotation, bool aEncaps
pad->SetNumber( m_name.text );
if( padShapeName == wxT( "Oval" )
|| padShapeName == wxT( "Ellipse" )
|| padShapeName == wxT( "MtHole" ) )
if( padShapeName.IsSameAs( wxT( "Oval" ), false )
|| padShapeName.IsSameAs( wxT( "Ellipse" ), false )
|| padShapeName.IsSameAs( wxT( "MtHole" ), false ) )
{
if( width != height )
pad->SetShape( PAD_SHAPE::OVAL );
else
pad->SetShape( PAD_SHAPE::CIRCLE );
}
else if( padShapeName == wxT( "Rect" ) )
else if( padShapeName.IsSameAs( wxT( "Rect" ), false ) )
{
pad->SetShape( PAD_SHAPE::RECT );
}
else if( padShapeName == wxT( "RndRect" ) )
else if( padShapeName.IsSameAs( wxT( "RndRect" ), false ) )
{
pad->SetShape( PAD_SHAPE::ROUNDRECT );
}
else if( padShapeName == wxT( "Polygon" ) )
else if( padShapeName.IsSameAs( wxT( "Polygon" ), false ) )
{
pad->SetShape( PAD_SHAPE::RECT ); // approximation
}

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