Compare commits

...

426 Commits

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Also push the project into variable resolution when plotting

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(cherry picked from commit a9eb7a0e28)
(cherry picked from commit 02252be29d)
2022-03-18 12:49:32 -07:00
Wayne Stambaugh f058dc9ed8 Begin version 6.0.5 development. 2022-03-17 19:35:07 -04:00
Wayne Stambaugh 2c061ed67a Tag release version 6.0.4. 2022-03-17 19:33:28 -04:00
Seth Hillbrand 9bfbe3acd8 Revert "Special-case synthetic click after tool selection."
This reverts commit dd55ffb75c.
2022-03-17 16:21:39 -07:00
Seth Hillbrand 40bdd26e39 Revert "Make sure LIB_ID escape context allows for formatting constructs."
This reverts commit 02252be29d.
2022-03-17 16:21:38 -07:00
Seth Hillbrand b0f8055377 Revert "Pull some fixes back from master."
This reverts commit 5c63df28e4.
2022-03-17 16:21:37 -07:00
Seth Hillbrand 33f4fc9873 Revert "Improved performance for Cleanup Tracks & Vias."
This reverts commit 14378812be.
2022-03-17 16:21:34 -07:00
Jeff Young c90842dd08 Update value & footprint from clipboard whether keeping annotation or not.
Fixes https://gitlab.com/kicad/code/kicad/issues/11116

(cherry picked from commit 400cff994d)
2022-03-17 22:34:52 +00:00
Jeff Young 310b4cdf75 Re-entrancy blocker for line/wire/bus tool.
Also clear infobar messages after a cancelInteractive.

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

(cherry picked from commit 05bca282f7)
2022-03-17 22:34:52 +00:00
Seth Hillbrand 2208e0db16 Avoid marking symbols that will not be processed
We want to shorting the processing time by marking symbols that have
already been processed.  But we must avoid marking symbols that will not
be processed due to their other flags

Fixes https://gitlab.com/kicad/code/kicad/issues/11164
2022-03-17 10:10:21 -07:00
jean-pierre charras cf4c403094 Gerber plotter: fix incorrect handling of arcs in polygons.
From master branch.
Fixes #11156
https://gitlab.com/kicad/code/kicad/issues/11156
2022-03-17 13:06:37 +01:00
Jeff Young dd55ffb75c Special-case synthetic click after tool selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/11057

(cherry picked from commit 1f745b000d)
2022-03-16 17:11:07 +00:00
Jeff Young d34faf30cc Save pointer to markers provider.
Fixes https://gitlab.com/kicad/code/kicad/issues/11136

(cherry picked from commit a81c8d4922)
2022-03-16 16:23:10 +00:00
Jeff Young 3720a52ecb Bubble ESC up from the 3D preview.
Fixes https://gitlab.com/kicad/code/kicad/issues/9984

(cherry picked from commit 32fdab8902)
2022-03-16 16:21:24 +00:00
Jeff Young 47de9f8f04 Fix typo which leads to catastrophic performance on boards with tons of zones.
(cherry picked from commit 392a3ec131)
2022-03-16 15:16:11 +00:00
Jeff Young 14378812be Improved performance for Cleanup Tracks & Vias. 2022-03-16 15:15:20 +00:00
Jeff Young 0070a4686e Cherry-pick the short-arc-is-really-a-segment fix from master.
Fixes https://gitlab.com/kicad/code/kicad/issues/11119
2022-03-16 15:15:15 +00:00
Jeff Young 5c63df28e4 Pull some fixes back from master.
Mostly wxT(), but also some performance, and some for better response
to Cancel button.
2022-03-16 15:15:09 +00:00
Jeff Young e5ea37507c Exclude hidden text from selection in FP Editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/11111

(cherry picked from commit 06c1bccccd)
2022-03-16 15:15:01 +00:00
Jeff Young 53bd87d792 Performance fixes for the board from hell....
(cherry picked from commit e4b56ab7f1)
2022-03-16 15:14:51 +00:00
Jeff Young 02252be29d Make sure LIB_ID escape context allows for formatting constructs.
Also make sure that value field is updated from name changes when the
symbol is a power symbol (even if it's from the schematic instead of
the library).

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

(cherry picked from commit a9eb7a0e28)
2022-03-16 15:14:29 +00:00
Wayne Stambaugh 9e9598af5f Begin version 6.0.4 development. 2022-03-15 20:14:40 -04:00
Wayne Stambaugh 9dc35b575c Tag release version 6.0.3. 2022-03-15 20:06:04 -04:00
Wayne Stambaugh 3cd24f656b Correct sheet schematic import from different project warning file name. 2022-03-15 18:21:47 -04:00
Marco Ciampa 73eac90922 Updated Italian translation 2022-03-15 20:36:19 +01:00
Marco Ciampa 70e5c9f7c6 Updated Italian translation 2022-03-15 20:21:04 +01:00
Marco Ciampa d820a7fe42 Updated Italian translation 2022-03-15 19:12:11 +01:00
Jeff Young b9d7a0565f Hand cherry-pick fixes from master.
https://gitlab.com/kicad/code/kicad/-/commit/0a8718cd1d62a40ea9094b773fb6caf56a695a05
https://gitlab.com/kicad/code/kicad/-/commit/7fb4a2c0a53089439ef3c31800bc310bc7c8a6ba
2022-03-15 13:19:12 +00:00
jean-pierre charras ad2486b09f Fix a incorrect filename in a copy command (MSW specific).
Also fix a regression and respect the KICAD_BUILD_QA_TESTS build option.
2022-03-14 21:14:04 -04:00
Marek Roszko 4742043a7e Extend manifest product version to include minor 2022-03-14 20:34:23 -04:00
Marek Roszko 9e56c7e5c9 Stuff a resource manifest into the kipython kiface 2022-03-14 20:32:29 -04:00
Marek Roszko 674fbfa889 Switch the kiface extension on windows to native dll
Fixes issue where Windows really wants to see the DLL extension to load the resource metadata
2022-03-14 20:23:37 -04:00
Seth Hillbrand ae1cc29dc6 Revert "Move connected_items from hash table to tree"
This reverts commit 187aa1c171.
2022-03-14 17:22:44 -07:00
jean-pierre charras f1c772ba55 Try to blindly fix a QA test issue. 2022-03-14 20:39:34 +01:00
jean-pierre charras 6f6505f6a1 Fix crash in SCH_LABEL_BASE::IsType() when the item is not living in a schematic.
It happens for instance when copying the item from the clipboard.
From master branch.
Fixes #11128
2022-03-14 09:36:10 +01:00
Marek Roszko af4a4cbc08 Don't use wxScreenDC as this returns "a" screen but not "the" screen
Windows supports per-monitor and per-app DPI. wxScreenDC is unable to resolve the actual DPI setting since it has no window context.

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


(cherry picked from commit 605dd8a580)
2022-03-14 03:32:04 +00:00
Marek Roszko 40462012ee Don't pre-scale the line width
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11122


(cherry picked from commit d74a0cdaa3)
2022-03-14 03:09:23 +00:00
jean-pierre charras 70514be11f Fix CMakeLists.txt syntax error and msys2 compatibility. 2022-03-13 12:50:26 +01:00
Marek Roszko 7558dad915 Don't use the ANSI version of SetDllDirectory 2022-03-12 21:45:14 -05:00
Marek Roszko 5e9b982ddf Plant the ability to verify code signing signatures when trying to load kifaces
Off by default and intended for use in released builds only
2022-03-12 21:44:36 -05:00
Marek Roszko 17539a564e Two very minor win32 calls to lock down dll/exe search paths from cwd 2022-03-12 15:47:48 -05:00
Marek Roszko 43aa0bfdc3 Tweak the "pyd" extension if for windows to be completely inclusive 2022-03-12 15:47:48 -05:00
Marco Ciampa 7ab4bf3823 Small fix in Italian translation 2022-03-12 17:47:54 +01:00
Marek Roszko ae01dc8ef1 Set SetErrorMode on Debug build
(cherry picked from commit d3ca857af7)
2022-03-12 01:57:45 +00:00
Seth Hillbrand 187aa1c171 Move connected_items from hash table to tree
This gains about 10% speed in heavily connected sheets

Fixes https://gitlab.com/kicad/code/kicad/issues/10974
2022-03-11 16:19:03 -08:00
Seth Hillbrand 17b1b68ac7 Break up buildConnectionGraph for debugging
Needed to find bottlenecks in fns, so break out individual sections of
the massive function for easier understanding.

buildItemSubgraphs (one section of the previous function) would build
millions of connections that were never used as stacked pins created X!
connections.  Also tested using sets instead of lists and keeping unique
lists to avoid flagging but none of these were as performant as using
flags to remember which items had already been processed.

Fixes https://gitlab.com/kicad/code/kicad/issues/10974
2022-03-11 16:18:56 -08:00
Wayne Stambaugh 35f15f016d Improve shared schematic file churn heuristics.
The previous solution cleared all of the fields and force the unit setting
to unit one which would have less than desirable effects when reusing a
schematic in another project.  This solution forces all of the instance
settings to the first sheet instance of the current project to prevent file
change churn when changing shared sheets in the current project.

This will not prevent shared schematic file changes when the first sheet
instance data differs between projects.

(cherry picked from commit dd1dbb81f6)
2022-03-11 14:34:30 -05:00
Wayne Stambaugh 70277e5514 Reduce shared schematic file change churn.
(cherry picked from commit bf5d585e24)
2022-03-11 14:34:04 -05:00
Marek Roszko 2874688281 Set some error flags for win32
(cherry picked from commit afaff022d7)
2022-03-11 01:17:50 +00:00
Seth Hillbrand 826096790d Cleanup a few more raw strings
(cherry picked from commit 455e330f3b)
2022-03-10 11:23:19 -08:00
Seth Hillbrand a2e66f6667 Don't write bytecode on MacOS
MacOS packages are signed and checked on each run.  Since Python lives
inside the package, adding byte code will break the package signature

(cherry picked from commit 5881471a52)
2022-03-10 11:23:19 -08:00
Jeff Young c241032a3b Redraw pads when mask or paste layer is visible after board setup.
Fixes https://gitlab.com/kicad/code/kicad/issues/11079
2022-03-10 17:54:38 +00:00
Seth Hillbrand 9ca35cbcee Rework of a24cdcb3f0
Inflate with linked holes needs to account for fractured polygons,
otherwise inflating with positive value will create rounded divots where
overlapping fracture lines meet and inflating with negative value will
create spaces between fracture lines.

Calling Simplify before Inflate takes an inordinate amount of time as
the Clipper healing routine is rather slow.  Our own Unfracture is meant
to heal the results of our Fracture routine and works much more quickly.
After healing, we still call the Simplify routine
2022-03-10 09:14:13 -08:00
Jon Evans 9c386026a8 Use actual project path when saving project
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10540
2022-03-10 09:08:20 -05:00
Marek Roszko 012a9bb7cb Don't forget to cache bust oce
(cherry picked from commit 25507ad6cf)
2022-03-10 02:39:42 +00:00
Marek Roszko 563aa3ed74 Avoid loading duplicate shapes due to hierarchy structure
Fix https://gitlab.com/kicad/code/kicad/-/issues/9416
Fix https://gitlab.com/kicad/code/kicad/-/issues/6107


(cherry picked from commit 2de4906d65)
2022-03-10 02:39:35 +00:00
Seth Hillbrand e8ef863861 Remove double-call of settings from Netlister
Double-calls are no longer needed when using settings.  They can
interfere depending on how the system executes the commands.

Removing keeps the last used plugin as the default, rather than the last
selected

Fixes https://gitlab.com/kicad/code/kicad/issues/11094
2022-03-09 17:12:18 -08:00
Seth Hillbrand a24cdcb3f0 Always return simplified polygons
Clipper can handle complex input polygons but we will sometimes struggle
dealing with outputs from the inflate routine that have degenerate or
overlapping points.  Calling Simplify after the inflate keeps our
polygons easier to handle

Fixes https://gitlab.com/kicad/code/kicad/issues/11036
2022-03-09 16:19:15 -08:00
Seth Hillbrand 5314ba6440 Avoid implementation dependent on events
Adding a page in the ctor can generate events that change the default
page.  Instead, we set the default after all pages have been added,
avoiding the reset

Fixes https://gitlab.com/kicad/code/kicad/issues/10910
2022-03-09 15:41:38 -08:00
Marek Roszko c465a6ebc7 Add some more reserves for string funcs
(cherry picked from commit 2df80c6473)
2022-03-09 16:45:28 +00:00
Marek Roszko 4e5038eb3e Try and reduce memory allocs when (un)escaping strings
(cherry picked from commit ca5049b6bc)
2022-03-09 16:45:02 +00:00
Jeff Young 2372359aaa Don't kill entire OpenGL cache on undo.
The comment regarding bitmaps was true for one more month in 2018, but
hasn't been true for the last 3 years, and clearing the cache is a huge
performance hit.

(cherry picked from commit d58427a519)
2022-03-09 15:06:40 +00:00
Jeff Young 5e0251c2ba Natural sorting for nets.
Fixes https://gitlab.com/kicad/code/kicad/issues/10534

(cherry picked from commit 96f9ea286e)
2022-03-09 14:37:46 +00:00
Jeff Young fd5eeceb4f Reentrancy block for symbol editor symbol properties dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/11060

(cherry picked from commit d3716b9956)
2022-03-09 14:35:47 +00:00
Seth Hillbrand da480aba47 Fix one more test case for arc approx 2022-03-08 12:36:08 -08:00
Seth Hillbrand 63f4f42e6a Fix testcases for arc rounding 2022-03-08 11:36:35 -08:00
Seth Hillbrand 8d246dbee0 We're not c++20 yet
Remove designated initializers
2022-03-08 11:08:41 -08:00
Seth Hillbrand 79517e44ce Fix QA for arc/arc collisions
We no longer need the arbitary offset when we are calculating collisions
based on values that are not nm off from a "round" value.

(cherry picked from commit 2200c1319d)
2022-03-08 10:37:04 -08:00
Seth Hillbrand a940607524 Adds uncertainty propagation to center point calc
Since we use center points to move back and forth for angle and
adjustments, we want to ensure that our center point is stable.

Rounding using integers introduces a 0.5 int uncertainty in each
measurement.  These are combined together multiple times to calculate
the center point, which combines the uncertainty.  Propagating the
uncertainty to the final calculation allows us to assign a range of true
values and pick the value that is most likely the correct value.

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

(cherry picked from commit ed7222b1e7)
2022-03-08 10:34:41 -08:00
Seth Hillbrand 0cf1a67e29 Cache read arc data for stability
Arcs can be altered by the process of changing from on-disk
representation to in-memory representation.  Saving back to disk without
modifying the arc should not modify the calculated values.

This stores a copy of the on-disk representation that is only used to
save back to disk in the event that the arc is not modified during
editing.

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

(cherry picked from commit cd7141fd10)
2022-03-08 10:33:49 -08:00
Seth Hillbrand f4cdb97141 Normalize IsInsideCourtyard
(cherry picked from commit c18d9b9baf)
2022-03-08 10:07:59 -08:00
Seth Hillbrand 0cfa88ca9a Move temp save files to temporary directory
Avoid excess writes to the project directory to dodge issues with remote
file systems not fully writing data.

wxRename works across disk boundaries (in theory) and falls back to
wxCopy/wxRemove when it fails

Fixes https://gitlab.com/kicad/code/kicad/issues/10747
2022-03-08 10:05:04 -08:00
Mike Williams 2535237c31 Schematic: breaking wire needs different drag parameters
Our heuristics for determining when to append to the undo aren't
sufficient for the two segments of a broken wire. One is new and the
other is changed, but the drag should be appended to the current undo.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10865
2022-03-08 18:00:46 +00:00
Marco Ciampa 4c86a5ce64 Updated Italian translation 2022-03-08 16:04:39 +01:00
jean-pierre charras c75c7d084a plot_board_layers.cpp: Add missing layers (USer_x) in list
Fixes #11072
https://gitlab.com/kicad/code/kicad/issues/11072
2022-03-08 14:44:53 +01:00
jean-pierre charras dd154c155f pcbnew: Fix Bezier "Add Primitive" in Pad Creation Dialog (From master branch) 2022-03-08 14:44:05 +01:00
Seth Hillbrand 0838543745 Fix cherry-pick error 2022-03-07 19:53:01 -08:00
Seth Hillbrand bd1f01f7ee Update Translations 2022-03-07 16:52:14 -08:00
Henrik Kauhanen 8ab1d91f3c Translated using Weblate (Swedish)
Currently translated at 99.5% (7178 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-03-08 01:49:49 +01:00
Konstantin Baranovskiy 35a7490342 Translated using Weblate (Russian)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ru/
2022-03-08 01:49:49 +01:00
Henrik Kauhanen d0314aab88 Translated using Weblate (Finnish)
Currently translated at 87.3% (6296 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-03-08 01:49:49 +01:00
Ulices 812aba6065 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-03-08 01:49:49 +01:00
Mark Hämmerling 6abcfeeb0f Translated using Weblate (German)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-03-08 01:49:49 +01:00
Radek K 703b18519f Translated using Weblate (Czech)
Currently translated at 91.4% (6594 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-03-08 01:49:48 +01:00
Arnau Llovet Vidal 1199af0d52 Translated using Weblate (Catalan)
Currently translated at 65.2% (4706 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-03-08 01:49:48 +01:00
taotieren 2f1ebebba3 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.5% (7179 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hant/
2022-03-08 01:49:48 +01:00
taotieren 19f4852280 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (7209 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-03-08 01:49:48 +01:00
Tian Yunhao 0be07689a7 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (7209 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-03-08 01:49:48 +01:00
lê văn lập f227ccfd5d Translated using Weblate (Vietnamese)
Currently translated at 18.2% (1315 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/vi/
2022-03-08 01:49:48 +01:00
ZbeeGin fd9804a3dc Translated using Weblate (Polish)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-03-08 01:49:48 +01:00
김랑기 502f2dab11 Translated using Weblate (Korean)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-03-08 01:49:48 +01:00
Mark Hämmerling 8e46ae5ce8 Translated using Weblate (German)
Currently translated at 100.0% (7210 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-03-08 01:49:48 +01:00
Jan Straka 8a863cdf54 Translated using Weblate (Czech)
Currently translated at 91.4% (6590 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-03-08 01:49:48 +01:00
Arnau Llovet Vidal 493e733f0c Translated using Weblate (Catalan)
Currently translated at 64.9% (4685 of 7210 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-03-08 01:49:48 +01:00
Seth Hillbrand 38ac1b2f2d Fix the order of evaluation in the arc printing
MapAngles will adjust by small amounts the angles t1 and t2.  This
adjustment will determine the CW/CCW drawing.  Therefore, the MapAngles
needs to be called explicitly before the Normalize180() call.
Left-to-Right evaluation is not a given for MSVC

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

(cherry picked from commit c9fb95b888)
2022-03-07 16:48:09 -08:00
Jon Evans 1394509734 Settings: allow multiple project access from Python standalone
We can't handle this in the UI, but we can externally, so allow
it for Python scripting and eventually we'll use this in the UI
also...

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10540
2022-03-05 12:50:45 -05:00
Jeff Young 1ffe0da204 Improvements for pads/vias in zones which knockout other zones.
1) Drop tiny islands which might cause connection problems.
2) Cleanup some dead code in filler
3) Don't estabilish a connection to an island that is fully covered
by whatever its connecting to.

Fixes https://gitlab.com/kicad/code/kicad/issues/11036
2022-03-05 15:40:30 +00:00
Jeff Young 46d423a164 Must clear arcs before calling Clipper. 2022-03-05 15:40:30 +00:00
Seth Hillbrand 7aebc4b11f Change connectivity item group from set to vector
Reserve space for new items to speed construction of connectivity graph

Fixes https://gitlab.com/kicad/code/kicad/issues/10974
2022-03-05 13:14:52 +00:00
Seth Hillbrand c1dcfdffb1 Remove unneeded condition to rotate
The condition that the board must have elements on it before allowing
the rotate command is invalid as we allow rotating new elements before
placement

Fixes https://gitlab.com/kicad/code/kicad/issues/10581
2022-03-03 15:44:50 -08:00
Jeff Young 191558e2d7 Reimplementation of 513486b0ec.
(For https://gitlab.com/kicad/code/kicad/-/issues/11020.)
2022-03-03 23:29:22 +00:00
Jeff Young 912c2eac09 Make LIB_ITEM::COMPARE_FLAGS really a flags field, and add ERC.
Before they were 1/2 treated as flags and 1/2 treated as a mode enum.

The ERC flag relaxes constraints on data that is settable in the
schematic editor.

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

(cherry picked from commit 76535d8572)
2022-03-03 23:29:22 +00:00
Seth Hillbrand 802d20c409 Duplicate from selected or current
When double-clicking to open a symbol, it is no longer selected in the
tree.  We need to use the `GetTargetLibId()` to pick the correct symbol
(first selected, then current) when using the duplicate command

Fixes https://gitlab.com/kicad/code/kicad/issues/11034
2022-03-03 15:20:30 -08:00
Seth Hillbrand 8f75841c85 Check for additional connections between tracks
Prevents removal when a track is connected not just to other tracks but
also other connected items

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

(cherry picked from commit 9d927f3135)
2022-03-03 13:08:37 -08:00
jean-pierre charras c3f8d8b5a1 FP_TEXT::ViewGetLOD() fix incorrect test (LAYER_MOD_VALUES color has no matter)
Fixes #11026
https://gitlab.com/kicad/code/kicad/issues/11026
Fixes #11028
2022-03-03 11:59:03 +01:00
Seth Hillbrand 79b6991d7b Fix broken unit select context menu
The fix for https://gitlab.com/kicad/code/kicad/issues/10529 kicked the
subsequent IDs for unit selection off the maximum ID value for popup
menus.  This increases the maximum popup number (integers are free)
2022-03-02 16:32:04 -08:00
Seth Hillbrand 17dc324e85 Explicitly give unit values
Removes the ability to hide symbol units in file formats.  This was
mostly the case for a while but there remained corner cases where we
left a default/hidden option

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

(cherry picked from commit 8c36ba3653)
2022-03-02 16:04:03 -08:00
Seth Hillbrand 23479821e3 Fix issue with 9396735733
Need to select unconditionally target layer if not on copper
2022-03-02 10:46:59 -08:00
Seth Hillbrand 9396735733 Select the copper layer before processing
If we are converting to tracks, the copper layer needs to be selected
before any other elements are processed, otherwise, we end up with the
default undefined layer

Fixes https://gitlab.com/kicad/code/kicad/issues/11025
2022-03-02 10:17:16 -08:00
Seth Hillbrand 901c330478 Update end item before moving on track/via change
The move even dereferences m_enditem for logging and perhaps other
actions.  We need to ensure that the end item has not been invalidated
before taking this action

Fixes https://gitlab.com/kicad/code/kicad/issues/10732
2022-03-02 09:21:52 -08:00
Jeff Young 354c320329 Make sure Cleanup handles shapes other than segments.
Fixes https://gitlab.com/kicad/code/kicad/issues/10955
2022-03-02 15:26:02 +00:00
Jeff Young 0ea559e3b8 Reconcile two different printing bug fixes.
https://gitlab.com/kicad/code/kicad/-/commit/a9f092b3706d65ddcf1ecfb34ef1559877524862
https://gitlab.com/kicad/code/kicad/-/commit/6f5cb1f97d95ad893744cdcb47115ca0fb1db438

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

(cherry picked from commit c4143b0ff6)
2022-03-02 12:07:43 +00:00
Jeff Young 6fd898d1b3 Be more careful about non-visible elements in fields autoplacer.
Fixes https://gitlab.com/kicad/code/kicad/issues/10774

(cherry picked from commit f241617478)
2022-03-02 12:07:43 +00:00
Jeff Young d20c2fe5c5 High-contrast mode: don't render vias that don't cross high-contrast layer.
Fixes https://gitlab.com/kicad/code/kicad/issues/8740

(cherry picked from commit bbfbfc2cd2)
2022-03-02 12:07:43 +00:00
Jeff Young 3585c184cc Pull bug fixes back from master.
Fixes https://gitlab.com/kicad/code/kicad/issues/11007
2022-03-02 12:07:43 +00:00
Seth Hillbrand 429544c188 Handle locally-coded file names for sheets
Windows can accidentally create forward slash-coded files.  This simply
converts them to the proper unix-coded value when set

Fixes https://gitlab.com/kicad/code/kicad/issues/10964
2022-03-01 17:21:16 -08:00
Seth Hillbrand 8385ce3021 Ensure fields are properly ordered
When reading sheet fields, we need to maintain a consistent order for
the mandatory fields as they are dereferenced by place.  We force this
during the `SetFields()` call.
2022-03-01 17:08:54 -08:00
Seth Hillbrand 0b98acfe12 Freeze TEDIT in place
Avoids updating the TEDIT field, preventing merge conflicts and unneeded
VCS cruft
2022-03-01 15:53:07 -08:00
Seth Hillbrand acb5ce7108 Resolve text when requested
Getting resolved text for a symbol should always happen, even if we have
unresolved data in the instances

Fixes https://gitlab.com/kicad/code/kicad/issues/11003
2022-03-01 15:10:41 -08:00
Seth Hillbrand 63b06af6b1 Avoid resolving text vars without screen
We need to keep the screen blank while initially loading a sheet before
the hierarchy is developed.  Avoid resolving text variables during this
process

Fixes https://gitlab.com/kicad/code/kicad/issues/11000
2022-02-28 12:27:38 -08:00
jean-pierre charras e5a85b107f Gerber plotter: fix broken plot of SHAPE_LINE_CHAIN with arcs.
Also simplify SHAPE_T::POLY plot.
From Master branch.
2022-02-28 18:26:26 +01:00
jean-pierre charras e2982a0e47 svg importer: fix a crash when importing some files with no graphic item 2022-02-28 18:26:24 +01:00
Jeff Young 5396bb970f Don't rename archives when doing a project save-as.
Fixes https://gitlab.com/kicad/code/kicad/issues/10184
2022-02-27 20:15:27 +00:00
Jeff Young d4937f1b3e Don't allow break commands (or labelling cmds) on multiple wire selections.
Fixes https://gitlab.com/kicad/code/kicad/issues/10934
2022-02-27 20:14:56 +00:00
Jeff Young 1c6f3f8f0d Drop a knee between tracks to a single item when dragging.
This prevents the disambiguation menu from coming up when we don't
really care which element we start the drag on.

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

(cherry picked from commit ae85f57577)
2022-02-27 18:20:25 +00:00
Jeff Young 6341548939 Infobar warning if symbol loading was cancelled.
Also makes sure the progress dialog is closed when we're done reading
symbols (it used to stay up for much of the symbol editor initialization).

Also makes sure that any cancel in the preLoad step is honoured in the
sync step.  (The preload is done because it is multi-threaded and therefore
faster than the single-threaded sync.)

Also makes sure that individual threads pay attention to the cancellation,
not just the GUI thread.

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

(cherry picked from commit 1f16092e29)
2022-02-27 18:20:25 +00:00
jean-pierre charras a91dd68444 FP editor: fix crash when trying to export a footprint to the board editor.
From Master branch.
2022-02-27 08:41:36 +01:00
Jeff Young a8175f49a6 Repair tab order in Footprint Properties dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/10978

(cherry picked from commit 2c6a2c3479)
2022-02-26 17:42:02 +00:00
jean-pierre charras 05110b7bdc DIALOG_BOARD_STATISTICS: Reset the drill count list before recalculations.
Fixes #10984
https://gitlab.com/kicad/code/kicad/issues/10984
2022-02-26 17:11:45 +01:00
jean-pierre charras aadcc43dbb APPEARANCE_CONTROLS: fix missing update when toggling a layer view.
Fixes #10977
https://gitlab.com/kicad/code/kicad/issues/10977
2022-02-26 10:40:47 +01:00
Seth Hillbrand ff6f398607 Handle list double-click without shortcuts
The LIST_DCLICK event can be fired by spacebar or enter in GTK.  This
conflicts with using the spacebar to reset local coordinates.  Instead,
we capture the double-click event manually to add the footprint to the
board

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

Fixes https://gitlab.com/kicad/code/kicad/issues/10633
2022-02-25 16:53:03 -08:00
Seth Hillbrand a30ad0b54a Honor modifier keys in diambiguation
Needs to be reset for the new action before selecting elements at a
point.

Fixes https://gitlab.com/kicad/code/kicad/issues/9712
2022-02-25 16:15:56 -08:00
Steffen Mauch ab835937a7 Fixing Eagle refs that do not work with KiCad
KiCad has stricter requirements for what consititutes an annotated
symbol.  This checks for and corrects annotations that begin with '#',
do not begin with a non-numeric character or do not end with a number

(cherry picked from commit 78620347c8)

Fixes https://gitlab.com/kicad/code/kicad/issues/10760
2022-02-25 15:45:30 -08:00
Jeff Young b17eb3a584 Connectivity rebuild must be done after commit push.
Fixes https://gitlab.com/kicad/code/kicad/issues/10608
2022-02-25 23:15:44 +00:00
Jeff Young 9c2bc98fd3 On-the-fly translations for Grid and Zoom menus.
Fixes https://gitlab.com/kicad/code/kicad/issues/10961

(cherry picked from commit 107067ad05)
2022-02-25 22:02:51 +00:00
Jeff Young 96bd27ef0f Initial focus for Get and Place Footprint.
Fixes https://gitlab.com/kicad/code/kicad/issues/10230

(cherry picked from commit 714c65275c)
2022-02-25 22:02:43 +00:00
Seth Hillbrand 23351b2046 Add MRU to image placement tools
(cherry picked from commit faa3829ad4)
2022-02-25 13:21:25 -08:00
Seth Hillbrand 69bd4218f7 Update Translations 2022-02-25 11:59:49 -08:00
Benedikt Freisen f27f001fcb 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-02-25 20:58:02 +01:00
Axel Henriksson be772ecd18 Translated using Weblate (Swedish)
Currently translated at 99.5% (7175 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-02-25 20:58:01 +01:00
Henrik Kauhanen 48ba236851 Translated using Weblate (Swedish)
Currently translated at 99.5% (7175 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-02-25 20:58:01 +01:00
Arnau Llovet Vidal 5120566c77 Translated using Weblate (Catalan)
Currently translated at 64.8% (4678 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-02-25 20:58:01 +01:00
Jakub Janek 7789857e30 Translated using Weblate (Slovak)
Currently translated at 75.3% (5430 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sk/
2022-02-25 20:58:01 +01:00
ZbeeGin 89d85800ab 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-02-25 20:58:01 +01:00
Jan Straka 43dcf09747 Translated using Weblate (Czech)
Currently translated at 91.0% (6567 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-02-25 20:58:01 +01:00
Eric a372594dea Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (7210 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-02-25 20:58:01 +01:00
Henrik Kauhanen 414e6dc43e Translated using Weblate (Swedish)
Currently translated at 99.0% (7145 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-02-25 20:58:01 +01:00
Wellington Terumi Uemura f34d146c38 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-02-25 20:58:01 +01:00
Mark Hämmerling d9f5d1d865 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-02-25 20:58:01 +01:00
Arnau Llovet Vidal b15d6bd10a Translated using Weblate (Catalan)
Currently translated at 61.3% (4421 of 7211 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-02-25 20:58:01 +01:00
Seth Hillbrand 54f621c570 Use board polygon instead of bbox for size
Board BBox uses the visible size of the board, which includes edge cut
thickness.  This is not appropriate for the Board characteristics.
Using the outline polygon gives accurate results and falls back to a
bounding box in the case where the outline is invalid

Fixes https://gitlab.com/kicad/code/kicad/issues/10972
2022-02-25 11:13:01 -08:00
Seth Hillbrand d29d981784 Avoid overflow in textbox
Count() returns unsigned values.  Since, we subtract 1 from this value,
if the count is 0, we will underflow the unsigned value, creating an
extremely large value that we multiply by the interline spacing.
2022-02-25 11:11:29 -08:00
jean-pierre charras 3801a8adc0 Eeschema: ensure ERC exclusions list is up to date before saving it in *.kicad_pro
Fixes #10339
From master branch
2022-02-25 18:26:48 +01:00
Mike Williams 7d4cb91f39 Schematic: disallow center rotation, allow both endpoint rotations
Center rotation will often misalign lines to the grid, which is bad
until fix off grid items on the schematic.

We can rotate a connection end into a new connection or to become
collinear with an existing line, so we need to check for this at the end
of rotation.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10565
2022-02-25 16:27:55 +00:00
jean-pierre charras 0f497d1b7a Fix incorrect conversion from lines to rect in fp editor.
Fixes #10965
https://gitlab.com/kicad/code/kicad/issues/10965
2022-02-25 13:50:57 +01:00
Jeff Young 5f1976f341 fixup! Better DRC checking when placing vias. 2022-02-25 10:40:05 +00:00
Jeff Young 6036331b25 Debounce layer visibility buttons and fix issues with FP Editor.
(cherry picked from commit cb16ad7557)
2022-02-25 10:40:05 +00:00
Jeff Young 5129143bcb Layer visibilities aren't stored in project for footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/10953

(cherry picked from commit 5c54f40eae)
2022-02-25 10:40:05 +00:00
Jeff Young d7d31e4b76 Implement multi-layer stitching via logic.
(cherry picked from commit d65f9ad2d8)
2022-02-25 10:40:05 +00:00
Jeff Young b00f855c26 Better DRC checking when placing vias.
(cherry picked from commit 369f53bb19)
2022-02-25 10:40:05 +00:00
Jeff Young 4b0177c8fe Handle hidden layers in FP Editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/10946

(cherry picked from commit 08df5c0b01)
2022-02-25 10:40:05 +00:00
Jeff Young b11ec85706 Copy Pad_Master when copying BOARD_DESIGN_SETTINGS.
Fixes https://gitlab.com/kicad/code/kicad/issues/10932

(cherry picked from commit d2069e1548)
2022-02-25 10:40:05 +00:00
Seth Hillbrand de48f41184 Fix wxT commit
Fixes https://gitlab.com/kicad/code/kicad/issues/10967
2022-02-24 17:00:10 -08:00
Greg Davill 55bdef9bd2 action_plugin: Remove duplicated entry in UndoList
(cherry picked from commit 429c311ec3)
2022-02-24 14:46:13 -08:00
Jeff Young 5cc2bef954 Formatting. 2022-02-22 13:48:20 +00:00
aris-kimi 8ce9f08268 Update year
Fixes https://gitlab.com/kicad/code/kicad/issues/10842
2022-02-21 22:21:31 +00:00
Jeff Young 6ccaf5e27d Flip all layers of a zone.
Fixes https://gitlab.com/kicad/code/kicad/issues/10621
2022-02-21 22:02:19 +00:00
Jeff Young a24912d01d A bit of safety. 2022-02-21 22:02:19 +00:00
Marek Roszko 8ad0f24031 Simplify locale data path setting... 2022-02-21 13:13:37 -05:00
Jeff Young 2498655cc5 Respect ERROR_OUTSIDE when inflating polygons.
Fixes https://gitlab.com/kicad/code/kicad/issues/10896

(cherry picked from commit e6c617b74d)
2022-02-21 17:32:25 +00:00
Marek Roszko b2ac4b2c65 Simplify KICAD6_TEMPLATE_DIR default
The search_stack method is bugland

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


(cherry picked from commit ad251b7b8c)
2022-02-21 17:23:07 +00:00
Mike Williams 899c2d9080 Schematic: handle switching h/v mode better while drawing lines
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10859
(cherry picked from commit e35c3f2b99)
2022-02-21 12:06:12 -05:00
Jeff Young b4ac59d9d3 Don't crash on highight net during drag.
Fixes https://gitlab.com/kicad/code/kicad/issues/10866
2022-02-21 12:25:55 +00:00
Jeff Young a5305aa235 A more discerning un-flashed-connectivity test.
(cherry picked from commit aa2c8e9b0c)
2022-02-21 11:20:48 +00:00
Tomasz Wlostowski 680163f8a8 Cherry-pick commits from Master and about SVG import:
*Fixes in the SVG import polygon postprocessing:
- don't drop subsequent polys when a non-filled primitive is imported 'in between'
- fix missing holes (also related to the interleaving of stroke and filled shapes, depending on the software that wrote the SVG file)

*GRAPHICS_IMPORTER_BUFFER: forgot to store the indices of the paths belonging to a compound shape

*pcbnew: GRAPHICS_IMPORTER can now recognize multi-path shapes (and postprocess polygons with holes into Kicad-compatible fractured polysets)

*SHAPE_POLY_SET: polysets can now be built from a bunch of arbitraily ordered oriented outlines.
Used by the SVG hole support

*SVG_IMPORT_PLUGIN: enable postprocessing of polygons with degeneracy and holes

*pcbnew: SVG importer support for even-odd fill rule
2022-02-21 10:50:05 +01:00
Marek Roszko 0fdd1df208 Update Copyright on win32 manifests
(cherry picked from commit 46d719ed42)
2022-02-21 03:22:16 +00:00
Marek Roszko 9367b7f309 Fix double parsing solids from step models resulting in triangle z-fighting
Fix https://gitlab.com/kicad/code/kicad/-/issues/9416
Fix https://gitlab.com/kicad/code/kicad/-/issues/9835
Fix https://gitlab.com/kicad/code/kicad/-/issues/10554


(cherry picked from commit b438810b6b)
2022-02-20 23:52:29 +00:00
Jeff Young f8d15a641a Use only a physical connection to determine flashing of pads.
Checking for proper nets just confuses things when the nets are set
wrongly for some reason.  This way we generate clearer DRC errors.

Fixes https://gitlab.com/kicad/code/kicad/issues/10645
2022-02-20 20:52:39 +00:00
Jeff Young d56e488f2d Remove unnecessary validations.
Not sure if this will fix the bug or not as I can't reproduce it, but
I'd say odds are pretty good.

Fixes https://gitlab.com/kicad/code/kicad/issues/10467
2022-02-20 20:52:39 +00:00
Jeff Young cf9fafaba5 EEschema features need to process ~ for empty string; not EDA_TEXT.
Fixes https://gitlab.com/kicad/code/kicad/issues/10918
2022-02-20 20:52:39 +00:00
jean-pierre charras d5ca09dffc Optimize DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS: a time consuming call (OnModify())
was made for each item change.
It is now made only once.
Fixes #10905
https://gitlab.com/kicad/code/kicad/issues/10905
2022-02-20 20:12:36 +01:00
Jeff Young b24f51908b Fix nullptr error (no router tool in footprint editor).
(cherry picked from commit df3291c59d)
2022-02-20 16:57:54 +00:00
Jeff Young 15fd0aa989 Disable grid when ctrl/cmd key is down.
Fixes https://gitlab.com/kicad/code/kicad/issues/9995
2022-02-20 16:10:53 +00:00
Jeff Young 246b6fcdd6 Use router to update message panel when routing.
Fixes https://gitlab.com/kicad/code/kicad/issues/10068
2022-02-20 13:54:01 +00:00
Jeff Young 2b7c79541b While flags are in prefs, actual clearance values are in board setup.
Fixes https://gitlab.com/kicad/code/kicad/issues/10852

(cherry picked from commit 7ddd3137a3)
2022-02-20 01:03:08 +00:00
Jeff Young 7f40cac4b0 Fix collapsing name column in Net Inspector.
(cherry picked from commit 4966e2ebc2)
2022-02-20 01:03:08 +00:00
Jeff Young 7978c8c291 Allow Rule Areas on all physical layers.
Required to do things like modify silk_clearance rules.

(cherry picked from commit 8f670552a6)
2022-02-20 01:03:08 +00:00
Jeff Young fc6ec23ac1 On-the-fly language updating for appearance panel & selection filter.
Fixes https://gitlab.com/kicad/code/kicad/issues/10040

(cherry picked from commit 6ce63d66e8)
2022-02-20 01:03:08 +00:00
Jeff Young 02ec87b036 Cancel or commit pad edit mode when switching footprints.
Fixes https://gitlab.com/kicad/code/kicad/issues/10209

(cherry picked from commit 85805b95ba)
2022-02-20 01:03:08 +00:00
Jeff Young da82ba00e4 Resolve text variables before attempting to open datasheet.
(cherry picked from commit 510dc28a5c)
2022-02-20 01:03:08 +00:00
Jeff Young b041a77cfa Don't paste into hidden columns.
Fixes https://gitlab.com/kicad/code/kicad/issues/10168

(cherry picked from commit c27ec5cae1)
2022-02-20 01:03:08 +00:00
Jeff Young 9fcd4113b0 Fix crash bug when adding rows to pin table and then pasting to unit.
(cherry picked from commit 8a22dab83d)
2022-02-20 01:03:08 +00:00
Jeff Young 762258203c Add zone margin when subtracting other graphics and zones.
It was already added for pads and tracks, but not the other objects.

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

(cherry picked from commit 81bed9ab96)
2022-02-20 01:03:08 +00:00
Seth Hillbrand 75a4036e45 Trim wires based on how many pins they intersect
If a wire intersects more than 2 pins from the same symbol, we don't
trim connections.  If the wire intersects exactly two pins from a single
symbol, we remove the wire between the pins.

We avoided doing this before because we didn't have a good metric for
trimming vs. not.  But the per-symbol calculation feels like the least
surprising option.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/1857
2022-02-19 16:54:19 -08:00
Seth Hillbrand f0d7a09af9 Remove broken call to normalize outlines
We should never be editing the user's outlines for them.  This creates
broken zones that are hard to repair.  In this case, there was also a
secondary zone with no outline that would crash the system

Fixes https://gitlab.com/kicad/code/kicad/issues/10904
2022-02-18 09:30:26 -08:00
jean-pierre charras 7be3a6b3c5 pcbnew: fix incorrect calculation of the board thickness from board stackup.
dielectric sub layers were not taken in account.
Fixes #10899
https://gitlab.com/kicad/code/kicad/issues/10899
2022-02-18 18:10:49 +01:00
jean-pierre charras 08bc14ccf2 Gerbview: fix missing handling of ID_GRID_SETTINGS event.
Fixes #10885
https://gitlab.com/kicad/code/kicad/issues/10885
2022-02-18 12:30:44 +01:00
Marco Ciampa 5781cb0ce5 Updated Italian translation 2022-02-18 12:05:13 +01:00
Seth Hillbrand ed2148d634 Prevent merging tracks across pads
When merging co-linear tracks, we should maintain the existing break if
it exists on pads, vias and other connection points

(cherry picked from commit 3a29d94c0a)
2022-02-17 19:44:33 -08:00
Seth Hillbrand 8e9d44942f Maintain connectivity while cleaning tracks/vias
When merging segments that loop back on each other, we need to merge
them in such a way to to keep the resulting endpoints connected to the
original adjoining endpoints

Fixes https://gitlab.com/kicad/code/kicad/issues/10780
2022-02-17 15:24:23 -08:00
qu1ck 8b1f1c0296 Fix double loading plugins and sys.path entires multiplying
(cherry picked from commit b53b68c686)
2022-02-17 10:59:52 -08:00
Tomasz Wlostowski 4eb9440a42 router: include arc approximation tollerance in arc hull clearance calculation
fixes: https://gitlab.com/kicad/code/kicad/-/issues/10470
(cherry picked from commit ce28525172)
2022-02-17 09:22:19 -08:00
jean-pierre charras 7cf7270738 GERBER_JOBFILE_WRITER: allows all *_User layers to be listed in *gbrjob file. 2022-02-17 15:35:49 +01:00
Jeff Young 9c48707c88 For Coverity. 2022-02-17 14:30:47 +00:00
Jeff Young ff21a16f7d Formatting. 2022-02-17 14:30:47 +00:00
Jeff Young 3b072ca8b4 Sync all fields between units when symbol is edited.
Fixes https://gitlab.com/kicad/code/kicad/issues/10610

(cherry picked from commit d60ed70d54)
2022-02-17 14:30:47 +00:00
Jeff Young e56355fc17 Update alt pin assignments in other units.
Fixes https://gitlab.com/kicad/code/kicad/issues/10849

(cherry picked from commit e499793147)
2022-02-17 14:30:47 +00:00
Jeff Young cfae33e7a8 Fix Mac button-text grid control spacing.
(cherry picked from commit 9fb3032c77)
2022-02-17 14:30:47 +00:00
Wayne Stambaugh c6c4f9ae4b Eeschema: fix broken symbol library rescue.
Apparently at some point during V5 development, symbol cache library names
were saved by replacing the LIB_ID separator character ':' with '_'.  This
caused the cache look up to fail there by skipping the symbol rescue which
could result in broken schematics.

I have no idea where this happened during V5 development.  The video demo
in the HEAD of the 5.1 branch shows the issue.  All of the other demo cache
libraries are correct.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10488
2022-02-17 09:09:19 -05:00
Mikolaj Wielgus 46f7223dd9 Fix sizing of the two last columns in drill statistics table 2022-02-17 14:16:31 +01:00
Mikolaj Wielgus 75bba51b0b Fix board statistics drill grid column sizing
And remove the horizontal scrollbar.
2022-02-17 14:16:31 +01:00
jean-pierre charras 34ed850a23 GERBER_JOBFILE_WRITER: fix missing handling of User_1 to User_9 user layers.
Fixes #10878
https://gitlab.com/kicad/code/kicad/issues/10878
2022-02-17 11:48:40 +01:00
Seth Hillbrand 266ee381d5 Update Translations 2022-02-16 17:23:19 -08:00
Henrik Kauhanen 15a44d75fb Translated using Weblate (Swedish)
Currently translated at 99.0% (7145 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-02-17 02:22:39 +01:00
Mustafa Selçuk ÇAVDAR f93304b144 Translated using Weblate (Turkish)
Currently translated at 43.3% (3126 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/tr/
2022-02-17 02:22:39 +01:00
Henrik Kauhanen 5fe583e195 Translated using Weblate (Swedish)
Currently translated at 99.0% (7145 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-02-17 02:22:39 +01:00
Mark Hämmerling 9153fcd04a Translated using Weblate (German)
Currently translated at 99.9% (7209 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-02-17 02:22:39 +01:00
Henrik Kauhanen 0f5219ad92 Translated using Weblate (Swedish)
Currently translated at 99.0% (7145 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-02-17 02:22:39 +01:00
Eric 5b90195dfa Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7212 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-02-17 02:22:38 +01:00
Henrik Kauhanen 28c6ac53b7 Translated using Weblate (Swedish)
Currently translated at 99.0% (7145 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-02-17 02:22:38 +01:00
Wellington Terumi Uemura 79e8c8df67 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7212 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-02-17 02:22:38 +01:00
Tokita, Hiroshi f02722b7a7 Translated using Weblate (Japanese)
Currently translated at 99.8% (7200 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-02-17 02:22:38 +01:00
Henrik Kauhanen 34e116c18b Translated using Weblate (Finnish)
Currently translated at 87.3% (6298 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-02-17 02:22:38 +01:00
Ulices 1a5e00254d Translated using Weblate (Spanish (Mexico))
Currently translated at 99.5% (7182 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-02-17 02:22:38 +01:00
Henrik Kauhanen f36a0eeb95 Translated using Weblate (German)
Currently translated at 99.8% (7202 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-02-17 02:22:38 +01:00
Mark Hämmerling f8b3f5b02f Translated using Weblate (German)
Currently translated at 99.8% (7202 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-02-17 02:22:38 +01:00
Jan Straka dca9df1908 Translated using Weblate (Czech)
Currently translated at 90.6% (6536 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-02-17 02:22:38 +01:00
Arnau Llovet Vidal f2e1b8cc7a Translated using Weblate (Catalan)
Currently translated at 61.1% (4410 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-02-17 02:22:38 +01:00
ZbeeGin 9c4eab9677 Translated using Weblate (Polish)
Currently translated at 99.9% (7209 of 7212 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-02-17 02:22:38 +01:00
Seth Hillbrand 470d7d228d Fix wxT overzealous replacements
A couple of regex mistakes slipped through and need to be reverted here
2022-02-16 17:21:49 -08:00
Jeff Young 71eefc8322 Don't force user to be overly pedantic when writing diffpair rules.
(cherry picked from commit fe7e72538e)
2022-02-15 20:57:45 +00:00
jean-pierre charras ef96ee4a99 French translation update. 2022-02-15 10:20:56 +01:00
jean-pierre charras 35968dfe18 DIALOG_PLOT: use a short living quasimodal dialog instead of a long living window.
In this case, a quasimodal dialog is the right way.
From master branch, commit 43f5a7c74
2022-02-15 09:24:16 +01:00
Seth Hillbrand b3965c014c Update Translations 2022-02-14 09:20:24 -08:00
Eric c3cc615f37 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hans/
2022-02-14 18:19:04 +01:00
Mustafa Selçuk ÇAVDAR bc232a7b6b Translated using Weblate (Turkish)
Currently translated at 43.1% (3099 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/tr/
2022-02-14 18:19:04 +01:00
Henrik Kauhanen 880098d659 Translated using Weblate (Swedish)
Currently translated at 99.5% (7153 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-02-14 18:19:04 +01:00
Krzysztof Kawa 1640c27cd2 Translated using Weblate (Polish)
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-02-14 18:19:04 +01:00
ZbeeGin 96fc0feb4d Translated using Weblate (Polish)
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pl/
2022-02-14 18:19:04 +01:00
김랑기 fdae390c52 Translated using Weblate (Korean)
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ko/
2022-02-14 18:19:04 +01:00
Henrik Kauhanen 2cb5643556 Translated using Weblate (Finnish)
Currently translated at 87.8% (6313 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/fi/
2022-02-14 18:19:04 +01:00
Ulices d689d1a866 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es_MX/
2022-02-14 18:19:04 +01:00
Jan Straka 76c690c819 Translated using Weblate (Czech)
Currently translated at 90.5% (6509 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-02-14 18:19:04 +01:00
Arnau Llovet Vidal 3c601180c2 Translated using Weblate (Catalan)
Currently translated at 61.0% (4390 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-02-14 18:19:03 +01:00
Mark Hämmerling 3c83040c4b Translated using Weblate (German)
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/de/
2022-02-14 18:19:03 +01:00
Seth Hillbrand 6147e997ff Format string for translation 2022-02-14 09:17:53 -08:00
Seth Hillbrand e88bef0023 Fix PCM strings 2022-02-14 09:17:53 -08:00
jean-pierre charras 54a3ca06c0 Pcbnew, DIALOG_GRAPHIC_ITEM_PROPERTIES: fix incorrect test for arcs.
It was due to mixing decidegrees and degrees, and seen for 180 deg arcs
Fixes #10841
https://gitlab.com/kicad/code/kicad/issues/10841
2022-02-14 09:46:57 +01:00
jean-pierre charras 0cb82a0985 Import netlist: fix issues: do not read netlist before it is selected.
Now the netlist must be explicitly selected and read instead of beeing
read during dialog creation.
It also avoid a useless netlist read when closing the dialog or trying
to change the netlist filename.

From master branch
2022-02-14 08:37:53 +01:00
Roberto Fernandez Bautista b7f8f95725 Don't lock OpenGL context twice
Use GAL_DRAWING_CONTEXT as this unlocks the context in its destructor,
so that when an exception is thrown inside the `try` block, it should
automatically unlock before we switch backend.

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

(cherry picked from commit 1b6fe615e5)
2022-02-13 21:10:48 +00:00
Graham Keeth 30276fb5f7 update custom rule syntax help to make diff pair rule examples clearer
(cherry picked from commit 4442f76add)
2022-02-13 20:15:47 +00:00
Jeff Young f37531ed39 Fix repaints getting done after the wrong dialog.
(cherry picked from commit b7c9a1ad55)
2022-02-13 18:37:44 +00:00
Jeff Young fd4ac7c5df Error messages for zone merging.
Also fixes a bug where zones meeting at a point would get merged
resulting in a self-intersecting zone.

Also fixes a bug where undo would not be handled correctly when zones
could not be merged.

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

(cherry picked from commit d5a2059c21)
2022-02-13 18:30:32 +00:00
Jeff Young b8b9f646c6 Show pin dangling symbols in Symbol Editor.
Even though we don't have connections they're a still a good visual
indication of which end of the pin is which.

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

(cherry picked from commit aedfe08bad)
2022-02-13 18:29:12 +00:00
Jeff Young f561f85ebb Move CN_VISITOR from HitTest() to Collide().
The former isn't sufficiently aware of layer differences (such as for
pads with some layers unflashed).

(cherry picked from commit 6e063247e5)
2022-02-13 18:22:18 +00:00
Jeff Young 7cba8e847d Don't use bounding box cache during insideArea.
For starters we can't rely on it having been updated, but we also
cache the entire result so there's no huge cost-savings anyway.

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

(cherry picked from commit 8dcc933fc3)
2022-02-13 18:20:31 +00:00
Jeff Young f8ac6df0cd Implement undo for Eeschema find/replace.
Fixes https://gitlab.com/kicad/code/kicad/issues/10824

(cherry picked from commit 33e57930bc)
2022-02-13 18:19:59 +00:00
Mark Roszko 310e339c39 Remove jenkins badge 2022-02-12 14:23:43 +00:00
jean-pierre charras 6b6d97e726 Gerbview: fix a long standing issue: negative objects are now correctly printed. 2022-02-12 11:57:14 +01:00
木 王 7c910c2d0b fix-npth 2022-02-12 11:56:46 +01:00
Seth Hillbrand 1b8f25235c There is one source of truth in AC
Don't store default values in two separate places.  Passes the existing
by value as the default.

Issue identified by @axemagn

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

(cherry picked from commit 3b87ab630e)
2022-02-11 13:24:31 -08:00
Wayne Stambaugh f7133168c1 Begin version 6.0.3 development. 2022-02-10 19:34:34 -05:00
397 changed files with 109064 additions and 99125 deletions
+1 -1
View File
@@ -40,6 +40,6 @@ include:
- local: '/.gitlab/templates.yml'
- local: '/.gitlab/Fedora-Linux-CI.yml'
- local: '/.gitlab/Ubuntu-20.04-CI.yml'
- local: '/.gitlab/Windows-CI.yml'
# - local: '/.gitlab/Windows-CI.yml'
- local: '/.gitlab/coverity.yml'
- local: '/.gitlab/linux-metadata-validate.yml'
@@ -493,15 +493,10 @@ void BOARD_ADAPTER::addPadsWithClearance( const FOOTPRINT* aFootprint,
{
for( PAD* pad : aFootprint->Pads() )
{
if( !pad->IsOnLayer( aLayerId ) )
if( !pad->FlashLayer( aLayerId ) )
continue;
// Skip pad annulus when not connected on this layer (if removing is enabled)
if( !pad->FlashLayer( aLayerId ) && IsCopperLayer( aLayerId ) )
continue;
// NPTH pads are not drawn on layers if the
// shape size and pos is the same as their hole:
// NPTH pads are not drawn on layers if the shape size and pos is the same as their hole:
if( aSkipNPTHPadsWihNoCopper && ( pad->GetAttribute() == PAD_ATTRIB::NPTH ) )
{
if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) )
@@ -526,19 +521,28 @@ void BOARD_ADAPTER::addPadsWithClearance( const FOOTPRINT* aFootprint,
}
}
const bool isPlated = ( ( aLayerId == F_Cu ) && pad->FlashLayer( F_Mask ) ) ||
( ( aLayerId == B_Cu ) && pad->FlashLayer( B_Mask ) );
if( aSkipPlatedPads && isPlated )
continue;
if( aSkipNonPlatedPads && !isPlated )
continue;
wxSize margin( aInflateValue, aInflateValue );
switch( aLayerId )
{
case F_Cu:
if( aSkipPlatedPads && pad->FlashLayer( F_Mask ) )
continue;
if( aSkipNonPlatedPads && !pad->FlashLayer( F_Mask ) )
continue;
break;
case B_Cu:
if( aSkipPlatedPads && pad->FlashLayer( B_Mask ) )
continue;
if( aSkipNonPlatedPads && !pad->FlashLayer( B_Mask ) )
continue;
break;
case F_Mask:
case B_Mask:
margin.x += pad->GetSolderMaskMargin();
+2 -3
View File
@@ -549,7 +549,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
for( FOOTPRINT* footprint : m_board->Footprints() )
{
addPadsWithClearance( footprint, m_platedPadsFront, F_Cu, 0, true, false, true );
addPadsWithClearance( footprint, m_platedPadsBack, B_Cu, 0, true, false, true );
}
@@ -569,8 +568,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Add pads to polygon list
for( FOOTPRINT* footprint : m_board->Footprints() )
{
// Note: NPTH pads are not drawn on copper layers when the pad
// has same shape as its hole
// Note: NPTH pads are not drawn on copper layers when the pad has same shape as
// its hole
footprint->TransformPadsWithClearanceToPolygon( *layerPoly, curr_layer_id,
0, ARC_HIGH_DEF, ERROR_INSIDE,
true, renderPlatedPadsAsPlated,
+31 -9
View File
@@ -374,6 +374,22 @@ OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateLayerList( const BVH_CONTAINER_2D*
}
OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateEmptyLayerList( PCB_LAYER_ID aLayerId )
{
float layer_z_bot = 0.0f;
float layer_z_top = 0.0f;
getLayerZPos( aLayerId, layer_z_top, layer_z_bot );
TRIANGLE_DISPLAY_LIST* layerTriangles = new TRIANGLE_DISPLAY_LIST( 1 );
// store in a list so it will be latter deleted
m_triangles.push_back( layerTriangles );
return new OPENGL_RENDER_LIST( *layerTriangles, m_circleTexture, layer_z_bot, layer_z_top );
}
OPENGL_RENDER_LIST* RENDER_3D_OPENGL::createBoard( const SHAPE_POLY_SET& aBoardPoly,
const BVH_CONTAINER_2D* aThroughHoles )
{
@@ -388,9 +404,8 @@ OPENGL_RENDER_LIST* RENDER_3D_OPENGL::createBoard( const SHAPE_POLY_SET& aBoardP
if( listBoardObject2d.size() > 0 )
{
// We will set a unitary Z so it will in future used with transformations
// since the board poly will be used not only to draw itself but also the
// solder mask layers.
// We will set a unitary Z so it will in future used with transformations since the
// board poly will be used not only to draw itself but also the solder mask layers.
const float layer_z_top = 1.0f;
const float layer_z_bot = 0.0f;
@@ -563,7 +578,7 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
const BVH_CONTAINER_2D* container2d = ii.second;
SHAPE_POLY_SET polyListSubtracted;
SHAPE_POLY_SET* aPolyList = nullptr;
SHAPE_POLY_SET* polyList = nullptr;
// Load the vertical (Z axis) component of shapes
@@ -580,9 +595,8 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
{
polyListSubtracted.BooleanSubtract( m_boardAdapter.GetThroughHoleOdPolys(),
SHAPE_POLY_SET::PM_FAST );
polyListSubtracted.BooleanSubtract(
m_boardAdapter.GetOuterNonPlatedThroughHolePoly(),
SHAPE_POLY_SET::PM_FAST );
polyListSubtracted.BooleanSubtract( m_boardAdapter.GetOuterNonPlatedThroughHolePoly(),
SHAPE_POLY_SET::PM_FAST );
}
if( m_boardAdapter.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) )
@@ -600,10 +614,10 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
}
}
aPolyList = &polyListSubtracted;
polyList = &polyListSubtracted;
}
OPENGL_RENDER_LIST* oglList = generateLayerList( container2d, aPolyList, layer_id,
OPENGL_RENDER_LIST* oglList = generateLayerList( container2d, polyList, layer_id,
&m_boardAdapter.GetThroughHoleIds() );
if( oglList != nullptr )
@@ -626,6 +640,10 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
m_platedPadsFront = generateLayerList( m_boardAdapter.GetPlatedPadsFront(),
&polySubtracted, F_Cu );
// An entry for F_Cu must exist in m_layers or we'll never look at m_platedPadsFront
if( m_layers.count( F_Cu ) == 0 )
m_layers[F_Cu] = generateEmptyLayerList( F_Cu );
}
if( m_boardAdapter.GetBackPlatedPadPolys() )
@@ -640,6 +658,10 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
m_platedPadsBack = generateLayerList( m_boardAdapter.GetPlatedPadsBack(),
&polySubtracted, B_Cu );
// An entry for B_Cu must exist in m_layers or we'll never look at m_platedPadsBack
if( m_layers.count( B_Cu ) == 0 )
m_layers[B_Cu] = generateEmptyLayerList( B_Cu );
}
}
@@ -650,6 +650,7 @@ GLuint OPENGL_RENDER_LIST::generate_top_or_bot_seg_ends(
glDrawArrays( GL_TRIANGLES, 0, aTriangleContainer->GetVertexSize() );
glBindTexture( GL_TEXTURE_2D, 0 );
glDisable( GL_TEXTURE_2D );
glDisable( GL_ALPHA_TEST );
glDisable( GL_BLEND );
@@ -504,7 +504,7 @@ void RENDER_3D_OPENGL::setCopperMaterial()
void RENDER_3D_OPENGL::setPlatedCopperAndDepthOffset( PCB_LAYER_ID aLayer_id )
{
glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset(-0.1f, -2.0f );
glPolygonOffset( -0.1f, -2.0f );
setLayerMaterial( aLayer_id );
}
@@ -704,18 +704,16 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
{
pLayerDispList->DrawAllCameraCulled( m_camera.GetPos().z, drawMiddleSegments );
// Draw copper plated pads
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
( m_platedPadsFront || m_platedPadsBack ) )
setPlatedCopperAndDepthOffset( layer_id );
// Draw plated pads
if( layer_id == F_Cu && m_platedPadsFront )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsFront->DrawAllCameraCulled( m_camera.GetPos().z,
drawMiddleSegments );
}
else if( layer_id == B_Cu && m_platedPadsBack )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsBack->DrawAllCameraCulled( m_camera.GetPos().z,
drawMiddleSegments );
}
@@ -751,16 +749,10 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
viasHolesLayer,
m_antiBoard );
// Draw copper plated pads
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
( m_platedPadsFront || m_platedPadsBack ) )
{
setPlatedCopperAndDepthOffset( layer_id );
}
// Draw plated pads
if( layer_id == F_Cu && m_platedPadsFront )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsFront->DrawAllCameraCulledSubtractLayer(
drawMiddleSegments,
m_outerThroughHoles,
@@ -769,6 +761,7 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
}
else if( layer_id == B_Cu && m_platedPadsBack )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsBack->DrawAllCameraCulledSubtractLayer(
drawMiddleSegments,
m_outerThroughHoles,
@@ -785,21 +778,16 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
m_outerThroughHoles,
m_antiBoard );
// Draw copper plated pads
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
( m_platedPadsFront || m_platedPadsBack ) )
{
setPlatedCopperAndDepthOffset( layer_id );
}
if( layer_id == F_Cu && m_platedPadsFront )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsFront->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
m_outerThroughHoles,
m_antiBoard );
}
else if( layer_id == B_Cu && m_platedPadsBack )
{
setPlatedCopperAndDepthOffset( layer_id );
m_platedPadsBack->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
m_outerThroughHoles,
m_antiBoard );
@@ -84,6 +84,8 @@ private:
PCB_LAYER_ID aLayerId,
const BVH_CONTAINER_2D* aThroughHoles = nullptr );
OPENGL_RENDER_LIST* generateEmptyLayerList( PCB_LAYER_ID aLayerId );
void addTopAndBottomTriangles( TRIANGLE_DISPLAY_LIST* aDst, const SFVEC2F& v0,
const SFVEC2F& v1, const SFVEC2F& v2, float top, float bot );
@@ -29,6 +29,7 @@
#include <kiface_base.h>
#include <tools/eda_3d_controller.h>
#include "eda_3d_actions.h"
#include "dialogs/panel_preview_3d_model.h"
#include <3d_rendering/opengl/render_3d_opengl.h>
@@ -113,10 +114,36 @@ int EDA_3D_CONTROLLER::Main( const TOOL_EVENT& aEvent )
// Main loop: keep receiving events
while( TOOL_EVENT* evt = Wait() )
{
if( evt->IsClick( BUT_RIGHT ) )
if( evt->IsCancelInteractive() )
{
wxWindow* canvas = m_toolMgr->GetToolHolder()->GetToolCanvas();
wxWindow* topLevelParent = canvas->GetParent();
while( topLevelParent && !topLevelParent->IsTopLevel() )
topLevelParent = topLevelParent->GetParent();
if( topLevelParent && dynamic_cast<DIALOG_SHIM*>( topLevelParent ) )
{
DIALOG_SHIM* dialog = static_cast<DIALOG_SHIM*>( topLevelParent );
if( dialog->IsQuasiModal() )
dialog->EndQuasiModal( wxID_CANCEL );
else
dialog->EndModal( wxID_CANCEL );
}
else
{
evt->SetPassEvent();
}
}
else if( evt->IsClick( BUT_RIGHT ) )
{
m_menu.ShowContextMenu();
}
else
{
evt->SetPassEvent();
}
}
return 0;
+3 -1
View File
@@ -4,7 +4,7 @@
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015 Cirilo Bernardo <cirilo.bernardo@gmail.com>
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -124,8 +124,10 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
{
Connect( eventType, wxMenuEventHandler( PANEL_PREVIEW_3D_MODEL::OnMenuEvent ), nullptr,
this );
}
#ifdef __WXOSX__
// Call layout once to get the proper button sizes after the bitmaps have been set
+22 -7
View File
@@ -156,6 +156,11 @@ option( KICAD_STEP_EXPORT_LIB
"Build and use kicad2step as a library, meant for debugging"
OFF )
cmake_dependent_option( KICAD_WIN32_VERIFY_CODESIGN
"When enabled, verifies the code signing signature of certain DLLs loaded during runtime."
OFF "WIN32"
OFF )
# Global setting: exports are explicit
set( CMAKE_CXX_VISIBILITY_PRESET "hidden" )
set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
@@ -177,6 +182,10 @@ if( KICAD_GAL_PROFILE )
add_definitions( -DKICAD_GAL_PROFILE )
endif()
if( KICAD_WIN32_VERIFY_CODESIGN )
add_definitions( -DKICAD_WIN32_VERIFY_CODESIGN )
endif()
# Ensure DEBUG is defined for all platforms in Debug builds
# change to add_compile_definitions() after minimum required CMake version is 3.12
set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG> )
@@ -490,9 +499,10 @@ endif()
# KIFACE_SUFFIX is the file extension used for top level program modules which
# implement the KIFACE interface. A valid suffix starts with a period '.'.
if( false )
# This is the eventual situation near milestone C) of modular-kicad blueprint.
# Until then we use .kiface extension so we don't collide with python DSO.
if( WIN32 )
# We use .kiface extension so we don't collide with python DSO. (Linux/mac issue?)
# Windows works fine with the native dll extension
# which also resolves metadata issues because windows wants to see the dll extension
set( KIFACE_SUFFIX ${CMAKE_SHARED_MODULE_SUFFIX} )
else()
# Temporary situation until we can dovetail the python DSO into the kiface DSO.
@@ -838,9 +848,11 @@ if( UNIX AND NOT APPLE AND KICAD_SCRIPTING_WXPYTHON )
endif()
endif()
message( STATUS "Found ${WXPYTHON_FLAVOR} "
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
"(wxWidgets ${WXPYTHON_WXVERSION})" )
if( WXPYTHON_FLAVOR )
message( STATUS "Found wxPython ${WXPYTHON_FLAVOR} "
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
"(wxWidgets ${WXPYTHON_WXVERSION})" )
endif()
#
# Find wxWidgets library, required
@@ -1000,7 +1012,10 @@ add_subdirectory( cvpcb ) # must be after pcbnew
add_subdirectory( kicad ) # should follow pcbnew, eeschema
add_subdirectory( tools )
add_subdirectory( utils )
add_subdirectory( qa )
if( KICAD_BUILD_QA_TESTS )
add_subdirectory( qa )
endif()
# Demos
if( KICAD_INSTALL_DEMOS )
@@ -46,7 +46,7 @@ if( CMAKE_MATCH_COUNT EQUAL 3 )
set( KICAD_WIN32_RC_FILEVER_STR "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}.${KICAD_GIT_REV}\\0" )
set( KICAD_WIN32_RC_FILEVER "${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, ${CMAKE_MATCH_3}, ${KICAD_GIT_REV}" )
set( KICAD_WIN32_RC_PRODVER_STR "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}\\0" )
set( KICAD_WIN32_RC_PRODVER_STR "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}\\0" )
set( KICAD_WIN32_RC_PRODVER "${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, ${CMAKE_MATCH_3}, ${KICAD_GIT_REV}" )
else()
message( FATAL_ERROR "Unable to extract major, minor and patch version string" )
+26 -98
View File
@@ -231,11 +231,7 @@ endif()
#=====================================================================
if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Useful common wx libs needed by almost all components.
if(VCPKG_TOOLCHAIN)
set(wxWidgets_COMMON_LIBRARIES libpng16 tiff jpeg zlib libexpat)
else()
set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
endif()
set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
# DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead.
if(NOT wxWidgets_FIND_COMPONENTS)
@@ -258,22 +254,24 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
#-------------------------------------------------------------------
#
# Get filename components for a configuration. For example,
# if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d
# if _CONFIGURATION = mswu, then _UNV="", _UCD=u _DBG=""
# if _CONFIGURATION = mswunivud, then _PF="msw", _UNV=univ, _UCD=u _DBG=d
# if _CONFIGURATION = mswu, then _PF="msw", _UNV="", _UCD=u _DBG=""
#
macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG)
macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _PF _UNV _UCD _DBG)
DBG_MSG_V(${_CONFIGURATION})
string(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}")
string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
string(REGEX REPLACE "[msw|qt].*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
if(${_UCD} STREQUAL ${_CONFIGURATION})
set(${_UCD} "")
endif()
string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
string(REGEX MATCH "^[msw|qt]*" ${_PF} "${_CONFIGURATION}")
endmacro()
#
# Find libraries associated to a configuration.
#
macro(WX_FIND_LIBS _UNV _UCD _DBG)
macro(WX_FIND_LIBS _PF _UNV _UCD _DBG)
DBG_MSG_V("m_unv = ${_UNV}")
DBG_MSG_V("m_ucd = ${_UCD}")
DBG_MSG_V("m_dbg = ${_DBG}")
@@ -286,7 +284,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
NAMES
wx${LIB}${_UCD}${_DBG} # for regex
wx${LIB}${_DBG}
${LIB}${_DBG} # vcpkg libraries aren't specific to wx
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
@@ -326,13 +323,13 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets monolithic library.
find_library(WX_mono${_DBG}
NAMES
wxmsw${_UNV}31${_UCD}${_DBG}
wxmsw${_UNV}30${_UCD}${_DBG}
wxmsw${_UNV}29${_UCD}${_DBG}
wxmsw${_UNV}28${_UCD}${_DBG}
wxmsw${_UNV}27${_UCD}${_DBG}
wxmsw${_UNV}26${_UCD}${_DBG}
wxmsw${_UNV}25${_UCD}${_DBG}
wx${_PF}${_UNV}31${_UCD}${_DBG}
wx${_PF}${_UNV}30${_UCD}${_DBG}
wx${_PF}${_UNV}29${_UCD}${_DBG}
wx${_PF}${_UNV}28${_UCD}${_DBG}
wx${_PF}${_UNV}27${_UCD}${_DBG}
wx${_PF}${_UNV}26${_UCD}${_DBG}
wx${_PF}${_UNV}25${_UCD}${_DBG}
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
@@ -340,16 +337,16 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets multilib libraries.
foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
webview stc ribbon propgrid)
stc ribbon propgrid webview)
find_library(WX_${LIB}${_DBG}
NAMES
wxmsw${_UNV}31${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}30${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}28${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}27${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}26${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}25${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}31${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}30${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}29${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}28${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}27${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}26${_UCD}${_DBG}_${LIB}
wx${_PF}${_UNV}25${_UCD}${_DBG}_${LIB}
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
@@ -515,74 +512,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
set(WX_LIB_DIR_PREFIX vc)
endif()
if(VCPKG_TOOLCHAIN)
set(wxWidgets_FOUND TRUE)
find_path(wxWidgets_ROOT_DIR
NAMES include/wx/wx.h
PATHS
ENV wxWidgets_ROOT_DIR
DOC "wxWidgets base/installation directory"
)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/debug/lib)
set(wxWidgets_CONFIGURATION mswud)
else()
set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/lib)
set(wxWidgets_CONFIGURATION mswu)
endif()
set(wxWidgets_BIN_DIR ${wxWidgets_ROOT_DIR}/bin)
set(wxWidgets_INCLUDE_DIR ${wxWidgets_ROOT_DIR}/include)
file(GLOB DLL ${wxWidgets_BIN_DIR}/wxmsw*.dll)
if (DLL)
set(wxWidgets_DEFINITIONS WXUSINGDLL)
DBG_MSG_V("detected SHARED/DLL tree wxWidgets_LIB_DIR=${wxWidgets_LIB_DIR}")
endif ()
set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR})
set(WX_LIB_DIR ${wxWidgets_LIB_DIR}) # needed by macro
set(WX_CONFIGURATION_LIST ${wxWidgets_CONFIGURATION})
# Set wxWidgets lib setup include directory.
if (EXISTS ${wxWidgets_INCLUDE_DIR}/wx/setup.h)
set(wxWidgets_INCLUDE_DIRS ${wxWidgets_INCLUDE_DIR})
else ()
DBG_MSG("wxWidgets_FOUND FALSE because ${wxWidgets_INCLUDE_DIR}/wx/setup.h does not exists.")
set(wxWidgets_FOUND FALSE)
endif ()
# Set wxWidgets main include directory.
if (EXISTS ${wxWidgets_ROOT_DIR}/include/wx/wx.h)
list(APPEND wxWidgets_INCLUDE_DIRS ${wxWidgets_ROOT_DIR}/include)
else ()
DBG_MSG("wxWidgets_FOUND FALSE because wxWidgets_ROOT_DIR=${wxWidgets_ROOT_DIR} has no ${wxWidgets_ROOT_DIR}/include/wx/wx.h")
set(wxWidgets_FOUND FALSE)
endif ()
DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}")
# Get configuration parameters from the name.
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
# Find wxWidgets libraries.
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
if (WX_USE_REL_AND_DBG)
WX_FIND_LIBS("${UNV}" "${UCD}" "d")
endif ()
# Settings for requested libs (i.e., include dir, libraries, etc.).
WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}")
# Add necessary definitions for unicode builds
if ("${UCD}" STREQUAL "u")
list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
endif ()
# Add necessary definitions for debug builds
set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
else()
if(BUILD_SHARED_LIBS)
find_path(wxWidgets_LIB_DIR
NAMES
@@ -617,7 +546,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
DOC "Path to wxWidgets libraries"
NO_DEFAULT_PATH
)
endif()
endif()
# If wxWidgets_LIB_DIR changed, clear all libraries.
@@ -675,7 +603,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
endif()
# Get configuration parameters from the name.
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} PF UNV UCD DBG)
# Set wxWidgets lib setup include directory.
if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
@@ -695,9 +623,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
endif()
# Find wxWidgets libraries.
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
WX_FIND_LIBS("${PF}" "${UNV}" "${UCD}" "${DBG}")
if(WX_USE_REL_AND_DBG)
WX_FIND_LIBS("${UNV}" "${UCD}" "d")
WX_FIND_LIBS("${PF}" "${UNV}" "${UCD}" "d")
endif()
# Settings for requested libs (i.e., include dir, libraries, etc.).
+1 -1
View File
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "6.0.2" )
set( KICAD_SEMANTIC_VERSION "6.0.5" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
-3
View File
@@ -16,9 +16,6 @@ KiCad uses a host of CI resources.
GitLab CI pipeline status can be viewed for Linux and Windows builds of the latest commits.
Additional status is available for builds:
[<img alt="Jenkins" src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins.simonrichter.eu%2Fjob%2Fwindows-kicad-ps-pipeline%2F&label=Windows%2C%20MSVC%Nightly&style=plastic">](https://jenkins.simonrichter.eu/job/windows-kicad-ps-pipeline/)
## Release status
[![latest released version(s)](https://repology.org/badge/latest-versions/kicad.svg)](https://repology.org/project/kicad/versions)
[![Release status](https://repology.org/badge/tiny-repos/kicad.svg)](https://repology.org/metapackage/kicad/versions)
+28 -28
View File
@@ -266,12 +266,12 @@ ADVANCED_CFG::ADVANCED_CFG()
m_DrawArcAccuracy = 10.0;
m_DrawArcCenterMaxAngle = 50.0;
m_MaxTangentAngleDeviation = 1.0;
m_MaxTrackLengthToKeep = 0.0001;
m_MaxTrackLengthToKeep = 0.0005;
m_ExtraZoneDisplayModes = false;
m_DrawTriangulationOutlines = false;
m_ExtraClearance = 0.0001;
m_DRCEpsilon = 0.0001; // 0.1um is small enough not to materially violate
m_ExtraClearance = 0.0005;
m_DRCEpsilon = 0.0005; // 0.5um is small enough not to materially violate
// any constraints.
m_HoleWallThickness = 0.020; // IPC-6012 says 15-18um; Cadence says at least
@@ -334,83 +334,83 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
std::vector<PARAM_CFG*> configParams;
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity,
&m_RealTimeConnectivity, true ) );
&m_RealTimeConnectivity, m_RealTimeConnectivity ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin,
&m_ExtraClearance, 0.0005, 0.0, 1.0 ) );
&m_ExtraClearance, m_ExtraClearance, 0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCEpsilon,
&m_DRCEpsilon, 0.0005, 0.0, 1.0 ) );
&m_DRCEpsilon, m_DRCEpsilon, 0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::HoleWallThickness,
&m_HoleWallThickness, 0.020, 0.0, 1.0 ) );
&m_HoleWallThickness, m_HoleWallThickness, 0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::CoroutineStackSize,
&m_CoroutineStackSize, AC_STACK::default_stack,
AC_STACK::min_stack, AC_STACK::max_stack ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRouterDebugGraphics,
&m_ShowRouterDebugGraphics, false ) );
&m_ShowRouterDebugGraphics, m_ShowRouterDebugGraphics ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::CompactFileSave,
&m_CompactSave, false ) );
&m_CompactSave, m_CompactSave ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcAccuracy,
&m_DrawArcAccuracy, 10.0, 0.0, 100000.0 ) );
&m_DrawArcAccuracy, m_DrawArcAccuracy, 0.0, 100000.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcCenterStartEndMaxAngle,
&m_DrawArcCenterMaxAngle, 50.0, 0.0, 100000.0 ) );
&m_DrawArcCenterMaxAngle, m_DrawArcCenterMaxAngle, 0.0, 100000.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTangentTrackAngleDeviation,
&m_MaxTangentAngleDeviation, 1.0, 0.0, 90.0 ) );
&m_MaxTangentAngleDeviation, m_MaxTangentAngleDeviation, 0.0, 90.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTrackLengthToKeep,
&m_MaxTrackLengthToKeep, 0.0005, 0.0, 1.0 ) );
&m_MaxTrackLengthToKeep, m_MaxTrackLengthToKeep, 0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ExtraZoneDisplayModes,
&m_ExtraZoneDisplayModes, false ) );
&m_ExtraZoneDisplayModes, m_ExtraZoneDisplayModes ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::StrokeTriangulation,
&m_DrawTriangulationOutlines, false ) );
&m_DrawTriangulationOutlines, m_DrawTriangulationOutlines ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinPlotPenWidth,
&m_MinPlotPenWidth, 0.0212, 0.0, 1.0 ) );
&m_MinPlotPenWidth, m_MinPlotPenWidth, 0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugZoneFiller,
&m_DebugZoneFiller, false ) );
&m_DebugZoneFiller, m_DebugZoneFiller ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugPDFWriter,
&m_DebugPDFWriter, false ) );
&m_DebugPDFWriter, m_DebugPDFWriter ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::SmallDrillMarkSize,
&m_SmallDrillMarkSize, 0.35, 0.0, 3.0 ) );
&m_SmallDrillMarkSize, m_SmallDrillMarkSize, 0.0, 3.0 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HotkeysDumper,
&m_HotkeysDumper, false ) );
&m_HotkeysDumper, m_HotkeysDumper ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DrawBoundingBoxes,
&m_DrawBoundingBoxes, false ) );
&m_DrawBoundingBoxes, m_DrawBoundingBoxes ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowPcbnewExportNetlist,
&m_ShowPcbnewExportNetlist, false ) );
&m_ShowPcbnewExportNetlist, m_ShowPcbnewExportNetlist ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelFileCache,
&m_Skip3DModelFileCache, false ) );
&m_Skip3DModelFileCache, m_Skip3DModelFileCache ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelMemoryCache,
&m_Skip3DModelMemoryCache, false ) );
&m_Skip3DModelMemoryCache, m_Skip3DModelMemoryCache ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HideVersionFromTitle,
&m_HideVersionFromTitle, false ) );
&m_HideVersionFromTitle, m_HideVersionFromTitle ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRepairSchematic,
&m_ShowRepairSchematic, false ) );
&m_ShowRepairSchematic, m_ShowRepairSchematic ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowEventCounters,
&m_ShowEventCounters, false ) );
&m_ShowEventCounters, m_ShowEventCounters ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::AllowManualCanvasScale,
&m_AllowManualCanvasScale, false ) );
&m_AllowManualCanvasScale, m_AllowManualCanvasScale ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
-1
View File
@@ -158,7 +158,6 @@ wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight )
wxMemoryInputStream is( data, count );
wxImage image( is, wxBITMAP_TYPE_PNG );
wxBitmap bitmap( image );
return image;
}
+13 -7
View File
@@ -1,8 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018 CERN
* Author: Maciej Suminski <maciej.suminski@cern.ch>
*
@@ -70,6 +70,7 @@ BOARD_PRINTOUT::BOARD_PRINTOUT( const BOARD_PRINTOUT_SETTINGS& aParams,
m_settings( aParams )
{
m_view = aView;
m_gerbviewPrint = false;
}
@@ -85,12 +86,12 @@ void BOARD_PRINTOUT::GetPageInfo( int* minPage, int* maxPage, int* selPageFrom,
void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPageCount )
{
auto dc = GetDC();
wxDC* dc = GetDC();
KIGFX::GAL_DISPLAY_OPTIONS options;
auto galPrint = KIGFX::GAL_PRINT::Create( options, dc );
auto gal = galPrint->GetGAL();
auto printCtx = galPrint->GetPrintCtx();
auto painter = getPainter( gal );
std::unique_ptr<KIGFX::GAL_PRINT> galPrint = KIGFX::GAL_PRINT::Create( options, dc );
KIGFX::GAL* gal = galPrint->GetGAL();
KIGFX::PRINT_CONTEXT* printCtx = galPrint->GetPrintCtx();
std::unique_ptr<KIGFX::PAINTER> painter = getPainter( gal );
std::unique_ptr<KIGFX::VIEW> view( m_view->DataReference() );
// Target paper size
@@ -175,6 +176,11 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
gal->SetClearColor( dstSettings->GetBackgroundColor() );
gal->ClearScreen();
if( m_gerbviewPrint )
// Mandatory in Gerbview to use the same order for printing as for screen redraw
// due to negative objects that need a specific order
view->UseDrawPriority( true );
{
KIGFX::GAL_DRAWING_CONTEXT ctx( gal );
view->Redraw();
+2 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
* Copyright (C) 2010-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2010-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -64,7 +64,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
aInfo.SetAppName( Pgm().App().GetAppName() );
/* Copyright information */
aInfo.SetCopyright( "(C) 1992-2021 KiCad Developers Team" );
aInfo.SetCopyright( "(C) 1992-2022 KiCad Developers Team" );
/* KiCad build version */
wxString version;
+1 -1
View File
@@ -419,7 +419,7 @@ void DIALOG_ABOUT::createNotebookHtmlPage( wxNotebook* aParent, const wxString&
wxStaticText* DIALOG_ABOUT::wxStaticTextRef( wxScrolledWindow* aParent, const wxString& aReference )
{
wxStaticText* text = new wxStaticText( aParent, wxID_ANY,
wxT( "(wxT( " ) + aReference + wxT( " ))" ) );
wxT( "(" ) + aReference + wxT( ")" ) );
return text;
}
+5 -6
View File
@@ -213,6 +213,7 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
try
{
cntUpd.Start();
try
{
m_view->UpdateItems();
@@ -229,9 +230,7 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
cntUpd.Stop();
cntCtx.Start();
int cookie = rand();
m_gal->LockContext( cookie );
m_gal->BeginDrawing();
KIGFX::GAL_DRAWING_CONTEXT ctx( m_gal );
cntCtx.Stop();
if( m_view->IsTargetDirty( KIGFX::TARGET_OVERLAY )
@@ -273,9 +272,6 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
m_gal->DrawCursor( m_viewControls->GetCursorPosition() );
cntCtxDestroy.Start();
m_gal->EndDrawing();
m_gal->UnlockContext( cookie );
cntCtxDestroy.Stop();
}
catch( std::exception& err )
{
@@ -294,6 +290,9 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
}
}
// ctx goes out of scope here so destructor would be called
cntCtxDestroy.Stop();
if( isDirty )
{
+1 -2
View File
@@ -152,9 +152,8 @@ wxString DS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase )
}
else if( m_titleBlock )
{
m_titleBlock->TextVarResolver( token, m_project );
// no need for tokenUpdated; TextVarResolver() did a full resolve
return true;
return m_titleBlock->TextVarResolver( token, m_project );
}
if( tokenUpdated )
+1 -1
View File
@@ -694,7 +694,7 @@ void EDA_DRAW_FRAME::SetMsgPanel( EDA_ITEM* aItem )
void EDA_DRAW_FRAME::UpdateMsgPanel()
{
GetToolManager()->PostEvent( EVENTS::SelectedItemsModified );
GetToolManager()->ProcessEvent( EVENTS::SelectedItemsModified );
}
+1
View File
@@ -320,6 +320,7 @@ static struct EDA_ITEM_DESC
.Map( PCB_FP_SHAPE_T, _HKI( "Graphic" ) )
.Map( PCB_FP_ZONE_T, _HKI( "Zone" ) )
.Map( PCB_TRACE_T, _HKI( "Track" ) )
.Map( PCB_ARC_T, _HKI( "Track" ) )
.Map( PCB_VIA_T, _HKI( "Via" ) )
.Map( PCB_MARKER_T, _HKI( "Marker" ) )
.Map( PCB_DIM_ALIGNED_T, _HKI( "Dimension" ) )
+27 -5
View File
@@ -436,6 +436,12 @@ void EDA_SHAPE::SetCenter( const wxPoint& aCenter )
wxPoint EDA_SHAPE::GetArcMid() const
{
// If none of the input data have changed since we loaded the arc,
// keep the original mid point data to minimize churn
if( m_arcMidData.start == m_start && m_arcMidData.end == m_end
&& m_arcMidData.center == m_arcCenter )
return m_arcMidData.mid;
wxPoint mid = m_start;
RotatePoint( &mid, m_arcCenter, -GetArcAngle() / 2.0 );
return mid;
@@ -486,19 +492,35 @@ int EDA_SHAPE::GetRadius() const
}
void EDA_SHAPE::SetCachedArcData( const wxPoint& aStart, const wxPoint& aMid, const wxPoint& aEnd, const wxPoint& aCenter )
{
m_arcMidData.start = aStart;
m_arcMidData.end = aEnd;
m_arcMidData.center = aCenter;
m_arcMidData.mid = aMid;
}
void EDA_SHAPE::SetArcGeometry( const wxPoint& aStart, const wxPoint& aMid, const wxPoint& aEnd )
{
m_arcMidData = {};
m_start = aStart;
m_end = aEnd;
m_arcCenter = CalcArcCenter( aStart, aMid, aEnd );
wxPoint new_mid = GetArcMid();
m_endsSwapped = false;
/**
* If the input winding doesn't match our internal winding, the calculated midpoint will end up
* on the other side of the arc. In this case, we need to flip the start/end points and flag this
* change for the system
// Watch the ordering here. GetArcMid above needs to be called prior to initializing the
// m_arcMidData structure in order to ensure we get the calculated variant, not the cached
SetCachedArcData( aStart, aMid, aEnd, m_arcCenter );
/*
* If the input winding doesn't match our internal winding, the calculated midpoint will end
* up on the other side of the arc. In this case, we need to flip the start/end points and
* flag this change for the system.
*/
wxPoint new_mid = GetArcMid();
VECTOR2D dist( new_mid - aMid );
VECTOR2D dist2( new_mid - m_arcCenter );
+4 -2
View File
@@ -188,7 +188,7 @@ bool EDA_TEXT::Replace( const wxFindReplaceData& aSearchData )
void EDA_TEXT::cacheShownText()
{
if( m_text.IsEmpty() || m_text == wxT( "~" ) ) // ~ is legacy empty-string token
if( m_text.IsEmpty() )
{
m_shown_text = wxEmptyString;
m_shown_text_has_text_var_refs = false;
@@ -316,7 +316,9 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
// interline spacing is only *between* lines, so total height is the height of the first
// line plus the interline distance (with interline spacing) for all subsequent lines
textsize.y += KiROUND( ( strings.GetCount() - 1 ) * interline );
// Don't add interline spacing to empty textboxes
if( strings.GetCount() )
textsize.y += KiROUND( ( strings.GetCount() - 1 ) * interline );
}
rect.SetSize( textsize );
+13 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 Ian McInerney <Ian.S.McInerney@ieee.org>
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -165,6 +165,18 @@ void FILE_HISTORY::doAddClearItem( wxMenu* aMenu )
}
void FILE_HISTORY::UpdateClearText( wxMenu* aMenu, wxString aClearText )
{
size_t itemPos;
wxMenuItem* clearItem = aMenu->FindChildItem( m_clearId, &itemPos );
if( clearItem && itemPos > 1 ) // clearItem is the last menu, after a separator
{
clearItem->SetItemLabel( aClearText );
}
}
void FILE_HISTORY::ClearFileHistory()
{
while( GetCount() > 0 )
+2 -2
View File
@@ -465,10 +465,10 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath )
wxString msg = _( "Alias: " );
msg.append( tpath.m_Alias );
msg.append( wxT( "\n" ) );
msg.append( _( "This path:wxT( " ) + wxS( " ) " ) );
msg.append( _( "This path:" ) + wxS( " " ) );
msg.append( tpath.m_Pathvar );
msg.append( wxT( "\n" ) );
msg.append( _( "Existing path:wxT( " ) + wxS( " ) " ) );
msg.append( _( "Existing path:" ) + wxS( " " ) );
msg.append( sPL->m_Pathvar );
wxMessageBox( msg, _( "Bad alias (duplicate name)" ) );
+8 -6
View File
@@ -642,9 +642,8 @@ void GRID_TRICKS::paste_text( const wxString& cb_text )
for( int row = start_row; row < end_row; ++row )
{
// If number of selected rows bigger than count of rows in
// the clipboard, paste from the clipboard again and again
// while end of the selection is reached.
// If number of selected rows is larger than the count of rows on the clipboard, paste
// again and again until the end of the selection is reached.
if( !rows.HasMoreTokens() )
rows.SetString( cb_text, ROW_SEP, wxTOKEN_RET_EMPTY );
@@ -662,9 +661,12 @@ void GRID_TRICKS::paste_text( const wxString& cb_text )
for( int col = start_col; col < end_col; ++col )
{
// If number of selected columns bigger than count of columns in
// the clipboard, paste from the clipboard again and again while
// end of the selection is reached.
// Skip hidden columns
if( !m_grid->IsColShown( col ) )
continue;
// If number of selected cols is larger than the count of cols on the clipboard,
// paste again and again until the end of the selection is reached.
if( !cols.HasMoreTokens() )
cols.SetString( rowTxt, COL_SEP, wxTOKEN_RET_EMPTY );
+8 -2
View File
@@ -40,8 +40,14 @@
// boost:mt19937 is not thread-safe
static std::mutex rng_mutex;
// Create only once, as seeding is *very* expensive
static boost::mt19937 rng;
// Static rng and generators are used because the overhead of constant seeding is expensive
// We break out the rng separately from the generator because we want to control seeding in cases like unit tests
#if BOOST_VERSION >= 106700
static boost::uuids::detail::random_provider seeder; // required to ensure the rng has a random initial seed
#else
static boost::uuids::detail::seed_rng seeder; // required to ensure the rng has a random initial seed
#endif
static boost::mt19937 rng( seeder );
static boost::uuids::basic_random_generator<boost::mt19937> randomGenerator( rng );
// These don't have the same performance penalty, but we might as well be consistent
+10
View File
@@ -34,6 +34,7 @@
#include <core/arraydim.h>
#include <id.h>
#include <kiplatform/app.h>
#include <kiplatform/environment.h>
#include <settings/settings_manager.h>
#include <logging.h>
@@ -230,6 +231,15 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
}
}
#ifdef KICAD_WIN32_VERIFY_CODESIGN
bool codeSignOk = KIPLATFORM::ENV::VerifyFileSignature( dname );
if( !codeSignOk )
{
msg.Printf( _( "Failed to verify kiface library '%s' signature." ), dname );
THROW_IO_ERROR( msg );
}
#endif
wxDynamicLibrary dso;
void* addr = nullptr;
+20
View File
@@ -239,6 +239,26 @@ wxString PATHS::GetStockScriptingPath()
}
wxString PATHS::GetStockTemplatesPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/template" );
return path;
}
wxString PATHS::GetLocaleDataPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/internat" );
return path;
}
wxString PATHS::GetStockPluginsPath()
{
wxFileName fn;
+2 -42
View File
@@ -56,6 +56,7 @@
#include <settings/settings_manager.h>
#include <systemdirsappend.h>
#include <trace_helpers.h>
#include <paths.h>
/**
@@ -540,48 +541,7 @@ void PGM_BASE::SetLanguageIdentifier( int menu_id )
void PGM_BASE::SetLanguagePath()
{
SEARCH_STACK guesses;
SystemDirsAppend( &guesses );
// Add our internat dir to the wxLocale catalog of paths
for( unsigned i = 0; i < guesses.GetCount(); i++ )
{
wxFileName fn( guesses[i], wxEmptyString );
// Append path for Windows and unix KiCad package install
fn.AppendDir( wxT( "share" ) );
fn.AppendDir( wxT( "internat" ) );
if( fn.IsDirReadable() )
{
wxLogTrace( traceLocale, wxT( "Adding locale lookup path: " ) + fn.GetPath() );
wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() );
}
// Append path for unix standard install
fn.RemoveLastDir();
fn.AppendDir( wxT( "kicad" ) );
fn.AppendDir( wxT( "internat" ) );
if( fn.IsDirReadable() )
{
wxLogTrace( traceLocale, wxT( "Adding locale lookup path: " ) + fn.GetPath() );
wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() );
}
// Append path for macOS install
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.AppendDir( wxT( "internat" ) );
if( fn.IsDirReadable() )
{
wxLogTrace( traceLocale, wxT( "Adding locale lookup path: " ) + fn.GetPath() );
wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() );
}
}
wxLocale::AddCatalogLookupPathPrefix( PATHS::GetLocaleDataPath() );
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
+21 -8
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) 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
@@ -842,8 +842,6 @@ void GERBER_PLOTTER::plotArc( const SHAPE_ARC& aArc, bool aPlotInRegion )
wxPoint start( aArc.GetP0() );
wxPoint end( aArc.GetP1() );
wxPoint center( aArc.GetCenter() );
double start_angle = aArc.GetStartAngle();
double end_angle = aArc.GetEndAngle();
if( !aPlotInRegion )
MoveTo( start);
@@ -851,14 +849,20 @@ void GERBER_PLOTTER::plotArc( const SHAPE_ARC& aArc, bool aPlotInRegion )
LineTo( start );
DPOINT devEnd = userToDeviceCoordinates( end );
DPOINT devCenter = userToDeviceCoordinates( center ) - userToDeviceCoordinates( start );
DPOINT devCenter = userToDeviceCoordinates( center - start );
VECTOR2I arcMidPoint = aArc.GetArcMid();
// We need to know if the arc is CW or CCW in device coordinates, so build this arc.
SHAPE_ARC deviceArc( userToDeviceCoordinates( start ),
userToDeviceCoordinates( wxPoint( arcMidPoint.x, arcMidPoint.y ) ),
devEnd, 0 );
fprintf( m_outputFile, "G75*\n" ); // Multiquadrant (360 degrees) mode
if( start_angle < end_angle )
fprintf( m_outputFile, "G03*\n" ); // Active circular interpolation, CCW
else
if( deviceArc.IsClockwise() )
fprintf( m_outputFile, "G02*\n" ); // Active circular interpolation, CW
else
fprintf( m_outputFile, "G03*\n" ); // Active circular interpolation, CCW
fprintf( m_outputFile, "X%dY%dI%dJ%dD01*\n",
KiROUND( devEnd.x ), KiROUND( devEnd.y ),
@@ -1010,6 +1014,10 @@ void GERBER_PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aPoly, FILL_T aFill, int
const SHAPE_ARC& arc = aPoly.Arc( arcindex );
plotArc( arc, ii > 0 );
// skip points on arcs, since we plot the arc itself
while( ii+1 < aPoly.PointCount() && arcindex == aPoly.ArcIndex( ii+1 ) )
ii++;
}
}
@@ -1040,12 +1048,17 @@ void GERBER_PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aPoly, FILL_T aFill, int
const SHAPE_ARC& arc = aPoly.Arc( arcindex );
plotArc( arc, ii > 0 );
// skip points on arcs, since we plot the arc itself
while( ii+1 < aPoly.PointCount() && arcindex == aPoly.ArcIndex( ii+1 ) )
ii++;
}
}
// Ensure the thick outline is closed for filled polygons
// (if not filled, could be only a polyline)
if( aFill != FILL_T::NO_FILL && ( aPoly.CPoint( 0 ) != aPoly.CPoint( -1 ) ) )
if( ( aPoly.CPoint( 0 ) != aPoly.CPoint( -1 ) )
&& ( aPoly.IsClosed() || aFill != FILL_T::NO_FILL ) )
LineTo( wxPoint( aPoly.CPoint( 0 ) ) );
PenFinish();
-6
View File
@@ -93,12 +93,6 @@ DPOINT PLOTTER::userToDeviceCoordinates( const wxPoint& aCoordinate )
{
wxPoint pos = aCoordinate - m_plotOffset;
// Don't allow overflows; they can cause rendering failures in some file viewers
// (such as Acrobat)
int clampSize = MAX_PAGE_SIZE_MILS * m_IUsPerDecimil * 10 / 2;
pos.x = std::max( -clampSize, std::min( pos.x, clampSize ) );
pos.y = std::max( -clampSize, std::min( pos.y, clampSize ) );
double x = pos.x * m_plotScale;
double y = ( m_paperSize.y - pos.y * m_plotScale );
+9 -7
View File
@@ -538,18 +538,20 @@ EDIMENSION::EDIMENSION( wxXmlNode* aDimension )
y2 %Coord; #REQUIRED
x3 %Coord; #REQUIRED
y3 %Coord; #REQUIRED
textsize %Coord;
layer %Layer; #REQUIRED
dtype %DimensionType; "parallel"
>
*/
x1 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x1" ) );
y1 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y1" ) );
x2 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x2" ) );
y2 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y2" ) );
x3 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x3" ) );
y3 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y3" ) );
layer = parseRequiredAttribute<int>( aDimension, wxT( "layer" ) );
x1 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x1" ) );
y1 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y1" ) );
x2 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x2" ) );
y2 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y2" ) );
x3 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "x3" ) );
y3 = parseRequiredAttribute<ECOORD>( aDimension, wxT( "y3" ) );
textsize = parseOptionalAttribute<ECOORD>( aDimension, wxT( "textsize" ) );
layer = parseRequiredAttribute<int>( aDimension, wxT( "layer" ) );
dimensionType = parseOptionalAttribute<wxString>( aDimension, wxT( "dtype" ) );
}
+14 -14
View File
@@ -531,13 +531,13 @@ struct EJUNCTION
/// Eagle label
struct ELABEL
{
ECOORD x;
ECOORD y;
ECOORD size;
LAYER_NUM layer;
opt_erot rot;
ECOORD x;
ECOORD y;
ECOORD size;
LAYER_NUM layer;
opt_erot rot;
opt_wxString xref;
wxString netname;
wxString netname;
ELABEL( wxXmlNode* aLabel, const wxString& aNetName );
};
@@ -619,14 +619,14 @@ struct EATTR
/// Eagle dimension element
struct EDIMENSION
{
ECOORD x1;
ECOORD y1;
ECOORD x2;
ECOORD y2;
ECOORD x3;
ECOORD y3;
int layer;
ECOORD x1;
ECOORD y1;
ECOORD x2;
ECOORD y2;
ECOORD x3;
ECOORD y3;
opt_ecoord textsize;
int layer;
opt_wxString dimensionType;
EDIMENSION( wxXmlNode* aDimension );
@@ -83,7 +83,7 @@ void POLYGON_GEOM_MANAGER::SetLeaderMode( LEADER_MODE aMode )
bool POLYGON_GEOM_MANAGER::IsSelfIntersecting( bool aIncludeLeaderPts ) const
{
auto pts( m_lockedPoints );
SHAPE_LINE_CHAIN pts( m_lockedPoints );
if( aIncludeLeaderPts )
{
+7 -1
View File
@@ -37,6 +37,8 @@ SCINTILLA_TRICKS::SCINTILLA_TRICKS( wxStyledTextCtrl* aScintilla, const wxString
m_te( aScintilla ),
m_braces( aBraces ),
m_lastCaretPos( -1 ),
m_lastSelStart( -1 ),
m_lastSelEnd( -1 ),
m_suppressAutocomplete( false ),
m_singleLine( aSingleLine ),
m_returnCallback( aReturnCallback )
@@ -337,10 +339,14 @@ void SCINTILLA_TRICKS::onScintillaUpdateUI( wxStyledTextEvent& aEvent )
// Has the caret changed position?
int caretPos = m_te->GetCurrentPos();
int selStart = m_te->GetSelectionStart();
int selEnd = m_te->GetSelectionEnd();
if( m_lastCaretPos != caretPos )
if( m_lastCaretPos != caretPos || m_lastSelStart != selStart || m_lastSelEnd != selEnd )
{
m_lastCaretPos = caretPos;
m_lastSelStart = selStart;
m_lastSelEnd = selEnd;
int bracePos1 = -1;
int bracePos2 = -1;
+1 -38
View File
@@ -509,44 +509,7 @@ void COMMON_SETTINGS::InitializeEnvironment()
path.AppendDir( wxT( "3dmodels" ) );
addVar( wxT( "KICAD6_3DMODEL_DIR" ), path.GetFullPath() );
// We don't have just one default template path, so use this logic that originally was in
// PGM_BASE::InitPgm to determine the best default template path
{
// Attempt to find the best default template path.
SEARCH_STACK bases;
SEARCH_STACK templatePaths;
SystemDirsAppend( &bases );
for( unsigned i = 0; i < bases.GetCount(); ++i )
{
wxFileName fn( bases[i], wxEmptyString );
// Add KiCad template file path to search path list.
fn.AppendDir( "template" );
// Only add path if exists and can be read by the user.
if( fn.DirExists() && fn.IsDirReadable() )
{
wxLogTrace( tracePathsAndFiles, "Checking template path '%s' exists",
fn.GetPath() );
templatePaths.AddPaths( fn.GetPath() );
}
}
if( templatePaths.IsEmpty() )
{
path = basePath;
path.AppendDir( "template" );
}
else
{
// Take the first one. There may be more but this will likely be the best option.
path.AssignDir( templatePaths[0] );
}
addVar( wxT( "KICAD6_TEMPLATE_DIR" ), path.GetFullPath() );
}
addVar( wxT( "KICAD6_TEMPLATE_DIR" ), PATHS::GetStockTemplatesPath() );
addVar( wxT( "KICAD_USER_TEMPLATE_DIR" ), PATHS::GetUserTemplatesPath() );
+30 -18
View File
@@ -387,6 +387,7 @@ wxString SETTINGS_MANAGER::GetPathForSettingsFile( JSON_SETTINGS* aSettings )
return GetUserSettingsPath();
case SETTINGS_LOC::PROJECT:
// TODO: MDI support
return Prj().GetProjectPath();
case SETTINGS_LOC::COLORS:
@@ -954,42 +955,48 @@ std::vector<wxString> SETTINGS_MANAGER::GetOpenProjects() const
}
bool SETTINGS_MANAGER::SaveProject( const wxString& aFullPath )
bool SETTINGS_MANAGER::SaveProject( const wxString& aFullPath, PROJECT* aProject )
{
if( !aProject )
aProject = &Prj();
wxString path = aFullPath;
if( path.empty() )
path = Prj().GetProjectFullName();
path = aProject->GetProjectFullName();
// TODO: refactor for MDI
if( Prj().IsReadOnly() )
if( aProject->IsReadOnly() )
return false;
if( !m_project_files.count( path ) )
return false;
PROJECT_FILE* project = m_project_files.at( path );
wxString projectPath = GetPathForSettingsFile( project );
wxString projectPath = aProject->GetProjectPath();
project->SaveToFile( projectPath );
Prj().GetLocalSettings().SaveToFile( projectPath );
aProject->GetLocalSettings().SaveToFile( projectPath );
return true;
}
void SETTINGS_MANAGER::SaveProjectAs( const wxString& aFullPath )
void SETTINGS_MANAGER::SaveProjectAs( const wxString& aFullPath, PROJECT* aProject )
{
wxString oldName = Prj().GetProjectFullName();
if( !aProject )
aProject = &Prj();
wxString oldName = aProject->GetProjectFullName();
if( aFullPath.IsSameAs( oldName ) )
{
SaveProject( aFullPath );
SaveProject( aFullPath, aProject );
return;
}
// Changing this will cause UnloadProject to not save over the "old" project when loading below
Prj().setProjectFullName( aFullPath );
aProject->setProjectFullName( aFullPath );
wxFileName fn( aFullPath );
@@ -997,14 +1004,14 @@ void SETTINGS_MANAGER::SaveProjectAs( const wxString& aFullPath )
// Ensure read-only flags are copied; this allows doing a "Save As" on a standalong board/sch
// without creating project files if the checkbox is turned off
project->SetReadOnly( Prj().IsReadOnly() );
Prj().GetLocalSettings().SetReadOnly( Prj().IsReadOnly() );
project->SetReadOnly( aProject->IsReadOnly() );
aProject->GetLocalSettings().SetReadOnly( aProject->IsReadOnly() );
project->SetFilename( fn.GetName() );
project->SaveToFile( fn.GetPath() );
Prj().GetLocalSettings().SetFilename( fn.GetName() );
Prj().GetLocalSettings().SaveToFile( fn.GetPath() );
aProject->GetLocalSettings().SetFilename( fn.GetName() );
aProject->GetLocalSettings().SaveToFile( fn.GetPath() );
m_project_files[fn.GetFullPath()] = project;
m_project_files.erase( oldName );
@@ -1014,9 +1021,12 @@ void SETTINGS_MANAGER::SaveProjectAs( const wxString& aFullPath )
}
void SETTINGS_MANAGER::SaveProjectCopy( const wxString& aFullPath )
void SETTINGS_MANAGER::SaveProjectCopy( const wxString& aFullPath, PROJECT* aProject )
{
PROJECT_FILE* project = m_project_files.at( Prj().GetProjectFullName() );
if( !aProject )
aProject = &Prj();
PROJECT_FILE* project = m_project_files.at( aProject->GetProjectFullName() );
wxString oldName = project->GetFilename();
wxFileName fn( aFullPath );
@@ -1027,9 +1037,11 @@ void SETTINGS_MANAGER::SaveProjectCopy( const wxString& aFullPath )
project->SaveToFile( fn.GetPath() );
project->SetFilename( oldName );
Prj().GetLocalSettings().SetFilename( fn.GetName() );
Prj().GetLocalSettings().SaveToFile( fn.GetPath() );
Prj().GetLocalSettings().SetFilename( oldName );
PROJECT_LOCAL_SETTINGS& localSettings = aProject->GetLocalSettings();
localSettings.SetFilename( fn.GetName() );
localSettings.SaveToFile( fn.GetPath() );
localSettings.SetFilename( oldName );
project->SetReadOnly( readOnly );
}
+31 -3
View File
@@ -50,6 +50,8 @@ wxString ConvertToNewOverbarNotation( const wxString& aOldStr )
if( aOldStr == wxT( "~" ) )
return aOldStr;
newStr.reserve( aOldStr.length() );
for( wxString::const_iterator chIt = aOldStr.begin(); chIt != aOldStr.end(); ++chIt )
{
if( *chIt == '~' )
@@ -140,7 +142,17 @@ bool ConvertSmartQuotesAndDashes( wxString* aString )
wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
{
wxString converted;
wxString converted;
std::vector<bool> braceStack; // true == formatting construct
auto hasFormattingPrefix =
[&]()
{
static wxString prefixes = wxT( "~_^" );
return !converted.IsEmpty() && prefixes.Find( converted.Last() ) >= 0;
};
converted.reserve( aSource.length() );
for( wxUniChar c: aSource )
{
@@ -155,7 +167,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
}
else if( aContext == CTX_LIBID )
{
if( c == '{' )
if( c == '{' && !hasFormattingPrefix() )
converted += wxT( "{brace}" );
else if( c == '/' )
converted += wxT( "{slash}" );
@@ -223,7 +235,9 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
converted += c;
}
else
{
converted += c;
}
}
return converted;
@@ -232,8 +246,16 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
wxString UnescapeString( const wxString& aSource )
{
size_t sourceLen = aSource.length();
// smallest escape string is three characters, shortcut everything else
if( sourceLen <= 2 )
{
return aSource;
}
wxString newbuf;
size_t sourceLen = aSource.length();
newbuf.reserve( sourceLen );
for( size_t i = 0; i < sourceLen; ++i )
{
@@ -305,6 +327,8 @@ wxString TitleCaps( const wxString& aString )
wxStringSplit( aString, words, ' ' );
result.reserve( aString.length() );
for( const wxString& word : words )
{
if( !result.IsEmpty() )
@@ -423,6 +447,8 @@ std::string EscapedUTF8( const wxString& aString )
std::string ret;
ret.reserve( utf8.length() + 2 );
ret += '"';
for( std::string::const_iterator it = utf8.begin(); it!=utf8.end(); ++it )
@@ -454,6 +480,8 @@ wxString EscapeHTML( const wxString& aString )
{
wxString converted;
converted.reserve( aString.length() );
for( wxUniChar c : aString )
{
if( c == '\"' )
+5 -6
View File
@@ -183,21 +183,20 @@ wxMenuItem* ACTION_MENU::Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry
wxMenuItem* ACTION_MENU::Add( ACTION_MENU* aMenu )
{
ACTION_MENU* menuCopy = aMenu->Clone();
m_submenus.push_back( menuCopy );
m_submenus.push_back( aMenu );
wxASSERT_MSG( !menuCopy->m_title.IsEmpty(), wxT( "Set a title for ACTION_MENU using SetTitle()" ) );
wxASSERT_MSG( !aMenu->m_title.IsEmpty(), wxT( "Set a title for ACTION_MENU using SetTitle()" ) );
if( !!aMenu->m_icon )
{
wxMenuItem* newItem = new wxMenuItem( this, -1, menuCopy->m_title );
wxMenuItem* newItem = new wxMenuItem( this, -1, aMenu->m_title );
AddBitmapToMenuItem( newItem, KiBitmap( aMenu->m_icon ) );
newItem->SetSubMenu( menuCopy );
newItem->SetSubMenu( aMenu );
return Append( newItem );
}
else
{
return AppendSubMenu( menuCopy, menuCopy->m_title );
return AppendSubMenu( aMenu, aMenu->m_title );
}
}
+6 -5
View File
@@ -144,20 +144,21 @@ void CONDITIONAL_MENU::Evaluate( SELECTION& aSelection )
switch( entry.Type() )
{
case ENTRY::ACTION:
menuItem = Add( *entry.Action(), entry.IsCheckmarkEntry() );
Add( *entry.Action(), entry.IsCheckmarkEntry() );
menu_count++;
break;
case ENTRY::MENU:
menuItem = Add( entry.Menu() );
entry.Menu()->UpdateTitle();
Add( entry.Menu()->Clone() );
menu_count++;
break;
case ENTRY::WXITEM:
menuItem = new wxMenuItem( this,
entry.wxItem()->GetId(),
entry.wxItem()->GetItemLabel(),
entry.wxItem()->GetHelp(),
wxGetTranslation( entry.wxItem()->GetItemLabel() ),
wxGetTranslation( entry.wxItem()->GetHelp() ),
entry.wxItem()->GetKind() );
if( !!entry.GetIcon() )
@@ -171,7 +172,7 @@ void CONDITIONAL_MENU::Evaluate( SELECTION& aSelection )
case ENTRY::SEPARATOR:
if( menu_count )
menuItem = AppendSeparator();
AppendSeparator();
menu_count = 0;
break;
+7 -1
View File
@@ -37,7 +37,7 @@ GRID_MENU::GRID_MENU( EDA_DRAW_FRAME* aParent ) :
ACTION_MENU( true ),
m_parent( aParent )
{
SetTitle( _( "Grid" ) );
UpdateTitle();
SetIcon( BITMAPS::grid_select );
APP_SETTINGS_BASE* settings = m_parent->config();
@@ -59,6 +59,12 @@ OPT_TOOL_EVENT GRID_MENU::eventHandler( const wxMenuEvent& aEvent )
}
void GRID_MENU::UpdateTitle()
{
SetTitle( _( "Grid" ) );
}
void GRID_MENU::update()
{
APP_SETTINGS_BASE* settings = m_parent->config();
+17 -9
View File
@@ -40,13 +40,8 @@ ZOOM_MENU::ZOOM_MENU( EDA_DRAW_FRAME* aParent ) :
ACTION_MENU( true ),
m_parent( aParent )
{
SetTitle( _( "Zoom" ) );
UpdateTitle();
SetIcon( BITMAPS::zoom_selection );
int i = ID_POPUP_ZOOM_LEVEL_START + 1; // 0 reserved for menus which support auto-zoom
for( double factor : m_parent->config()->m_Window.zoom_factors )
Append( i++, wxString::Format( _( "Zoom: %.2f" ), factor ), wxEmptyString, wxITEM_CHECK );
}
@@ -58,17 +53,30 @@ OPT_TOOL_EVENT ZOOM_MENU::eventHandler( const wxMenuEvent& aEvent )
}
void ZOOM_MENU::UpdateTitle()
{
SetTitle( _( "Zoom" ) );
}
void ZOOM_MENU::update()
{
Clear();
int ii = ID_POPUP_ZOOM_LEVEL_START + 1; // 0 reserved for menus which support auto-zoom
for( double factor : m_parent->config()->m_Window.zoom_factors )
Append( ii++, wxString::Format( _( "Zoom: %.2f" ), factor ), wxEmptyString, wxITEM_CHECK );
double zoom = m_parent->GetCanvas()->GetGAL()->GetZoomFactor();
const std::vector<double>& zoomList = m_parent->config()->m_Window.zoom_factors;
for( size_t i = 0; i < zoomList.size(); ++i )
for( size_t jj = 0; jj < zoomList.size(); ++jj )
{
// Search for a value near the current zoom setting:
double rel_error = std::fabs( zoomList[i] - zoom ) / zoom;
double rel_error = std::fabs( zoomList[jj] - zoom ) / zoom;
// IDs start with 1 (leaving 0 for auto-zoom)
Check( ID_POPUP_ZOOM_LEVEL_START + i + 1, rel_error < 0.1 );
Check( ID_POPUP_ZOOM_LEVEL_START + jj + 1, rel_error < 0.1 );
}
}
+23 -15
View File
@@ -36,6 +36,7 @@
#include <trace_helpers.h>
#include <settings/common_settings.h>
#include <math/util.h> // for KiROUND
#include <geometry/geometry_utils.h>
#include <widgets/ui_common.h>
#include <class_draw_panel_gal.h>
#include <kiplatform/ui.h>
@@ -300,7 +301,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
}
if( m_updateCursor ) // do not update the cursor position if it was explicitly set
m_cursorPos = m_view->ToWorld( mousePos );
m_cursorPos = GetClampedCoords( m_view->ToWorld( mousePos ) );
else
m_updateCursor = true;
@@ -648,7 +649,7 @@ VECTOR2D WX_VIEW_CONTROLS::GetMousePosition( bool aWorldCoordinates ) const
wxPoint msp = getMouseScreenPosition();
VECTOR2D screenPos( msp.x, msp.y );
return aWorldCoordinates ? m_view->ToWorld( screenPos ) : screenPos;
return aWorldCoordinates ? GetClampedCoords( m_view->ToWorld( screenPos ) ) : screenPos;
}
@@ -675,7 +676,7 @@ VECTOR2D WX_VIEW_CONTROLS::GetCursorPosition( bool aEnableSnapping ) const
}
else
{
return GetRawCursorPosition( aEnableSnapping );
return GetClampedCoords( GetRawCursorPosition( aEnableSnapping ) );
}
}
@@ -685,10 +686,12 @@ void WX_VIEW_CONTROLS::SetCursorPosition( const VECTOR2D& aPosition, bool aWarpV
{
m_updateCursor = false;
VECTOR2D clampedPosition = GetClampedCoords( aPosition );
if( aTriggeredByArrows )
{
m_settings.m_lastKeyboardCursorPositionValid = true;
m_settings.m_lastKeyboardCursorPosition = aPosition;
m_settings.m_lastKeyboardCursorPosition = clampedPosition;
m_settings.m_lastKeyboardCursorCommand = aArrowCommand;
m_cursorWarped = false;
}
@@ -700,8 +703,8 @@ void WX_VIEW_CONTROLS::SetCursorPosition( const VECTOR2D& aPosition, bool aWarpV
m_cursorWarped = true;
}
WarpCursor( aPosition, true, aWarpView );
m_cursorPos = aPosition;
WarpCursor( clampedPosition, true, aWarpView );
m_cursorPos = clampedPosition;
}
@@ -710,14 +713,16 @@ void WX_VIEW_CONTROLS::SetCrossHairCursorPosition( const VECTOR2D& aPosition,
{
m_updateCursor = false;
VECTOR2D clampedPosition = GetClampedCoords( aPosition );
const VECTOR2I& screenSize = m_view->GetGAL()->GetScreenPixelSize();
BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
VECTOR2D screenPos = m_view->ToScreen( aPosition );
BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
VECTOR2D screenPos = m_view->ToScreen( clampedPosition );
if( aWarpView && !screen.Contains( screenPos ) )
m_view->SetCenter( aPosition );
m_view->SetCenter( clampedPosition );
m_cursorPos = aPosition;
m_cursorPos = clampedPosition;
}
@@ -727,14 +732,15 @@ void WX_VIEW_CONTROLS::WarpCursor( const VECTOR2D& aPosition, bool aWorldCoordin
if( aWorldCoordinates )
{
const VECTOR2I& screenSize = m_view->GetGAL()->GetScreenPixelSize();
BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
VECTOR2D screenPos = m_view->ToScreen( aPosition );
BOX2I screen( VECTOR2I( 0, 0 ), screenSize );
VECTOR2D clampedPosition = GetClampedCoords( aPosition );
VECTOR2D screenPos = m_view->ToScreen( clampedPosition );
if( !screen.Contains( screenPos ) )
{
if( aWarpView )
{
m_view->SetCenter( aPosition );
m_view->SetCenter( clampedPosition );
m_parentPanel->WarpPointer( screenSize.x / 2, screenSize.y / 2 );
}
}
@@ -889,7 +895,7 @@ void WX_VIEW_CONTROLS::refreshMouse()
moveEvent.SetShiftDown( wxGetKeyState( WXK_SHIFT ) );
moveEvent.SetAltDown( wxGetKeyState( WXK_ALT ) );
m_cursorPos = m_view->ToWorld( VECTOR2D( msp.x, msp.y ) );
m_cursorPos = GetClampedCoords( m_view->ToWorld( VECTOR2D( msp.x, msp.y ) ) );
wxPostEvent( m_parentPanel, moveEvent );
}
@@ -943,6 +949,8 @@ void WX_VIEW_CONTROLS::UpdateScrollbars()
void WX_VIEW_CONTROLS::ForceCursorPosition( bool aEnabled, const VECTOR2D& aPosition )
{
VECTOR2D clampedPosition = GetClampedCoords( aPosition );
m_settings.m_forceCursorPosition = aEnabled;
m_settings.m_forcedPosition = aPosition;
m_settings.m_forcedPosition = clampedPosition;
}
+17 -7
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) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
* @author Jon Evans <jon@craftyjon.com>
*
* This program is free software; you can redistribute it and/or
@@ -26,6 +26,7 @@
#include <wx/sizer.h>
#include <wx/statbmp.h>
#include <wx/timer.h>
wxDEFINE_EVENT( TOGGLE_CHANGED, wxCommandEvent );
@@ -35,7 +36,8 @@ BITMAP_TOGGLE::BITMAP_TOGGLE( wxWindow *aParent, wxWindowID aId, const wxBitmap&
wxPanel( aParent, aId ),
m_checked( aChecked ),
m_unchecked_bitmap( aUncheckedBitmap ),
m_checked_bitmap( aCheckedBitmap )
m_checked_bitmap( aCheckedBitmap ),
m_debounce( 0 )
{
wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL );
SetSizer( sizer );
@@ -47,13 +49,21 @@ BITMAP_TOGGLE::BITMAP_TOGGLE( wxWindow *aParent, wxWindowID aId, const wxBitmap&
sizer->Add( m_bitmap, 0, 0 );
m_bitmap->Bind( wxEVT_LEFT_UP,
[&]( wxMouseEvent& )
[&]( wxMouseEvent& event )
{
wxLongLong now = wxGetLocalTimeMillis();
if( now - m_debounce < 50 )
return;
else
m_debounce = now;
SetValue( !GetValue() );
wxCommandEvent event( TOGGLE_CHANGED );
event.SetInt( m_checked );
event.SetEventObject( this );
wxPostEvent( this, event );
wxCommandEvent command( TOGGLE_CHANGED );
command.SetInt( m_checked );
command.SetEventObject( this );
wxPostEvent( this, command );
} );
auto passOnEvent =
+9 -2
View File
@@ -59,10 +59,17 @@ wxString GRID_CELL_TEXT_BUTTON::GetValue() const
void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect )
{
wxRect rect( aRect );
rect.Inflate( -1 );
#if defined( __WXMAC__ )
rect.Inflate( 3 ); // no FOCUS_RING, even on Mac
rect.Inflate( 2 ); // ignore FOCUS_RING
#elif defined( __WXGTK__ )
rect.Inflate( -3 ); // The -3 is a very sad hack here. Some GTK themes overrun the
// default -1, preventing display. Unfortunately, we don't appear to
// have a good method of finding the current margin needed.
// Some GTK resize events seem to update the cell size but not all and
// not consistently.
#else
rect.Inflate( -1 );
#endif
Combo()->SetSize( rect, wxSIZE_ALLOW_MINUS_ONE );
+1 -1
View File
@@ -63,7 +63,7 @@ EDA_MSG_PANEL::~EDA_MSG_PANEL()
int EDA_MSG_PANEL::GetRequiredHeight( wxWindow* aWindow )
{
wxSize fontSizeInPixels;
wxScreenDC dc;
wxWindowDC dc( aWindow );
dc.SetFont( KIUI::GetControlFont( aWindow ) );
dc.GetTextExtent( wxT( "W" ), &fontSizeInPixels.x, &fontSizeInPixels.y );
+6 -1
View File
@@ -335,7 +335,12 @@ protected:
}
}
std::sort( netNames.begin(), netNames.end() );
std::sort( netNames.begin(), netNames.end(),
[]( const wxString& lhs, const wxString& rhs )
{
return StrNumCmp( lhs, rhs, true /* ignore case */ ) < 0;
} );
// Special handling for <no net>
if( filter.IsEmpty() || wxString( NO_NET ).MakeLower().Matches( filter ) )
+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 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
@@ -121,7 +121,7 @@ bool PROGRESS_REPORTER_BASE::KeepRefreshing( bool aWait )
return false;
}
wxMilliSleep( 20 );
wxMilliSleep( 33 /* 30 FPS refresh rate */ );
}
return true;
+21
View File
@@ -40,6 +40,11 @@ WX_GRID::WX_GRID( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxS
// Make sure the GUI font scales properly on GTK
SetDefaultCellFont( KIUI::GetControlFont( this ) );
#if wxCHECK_VERSION( 3, 1, 0 )
Connect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this );
#endif
}
@@ -47,9 +52,25 @@ WX_GRID::~WX_GRID()
{
if( m_weOwnTable )
DestroyTable( GetTable() );
#if wxCHECK_VERSION( 3, 1, 0 )
Disconnect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this );
#endif
}
#if wxCHECK_VERSION( 3, 1, 0 )
void WX_GRID::onDPIChanged(wxDPIChangedEvent& aEvt)
{
/// This terrible hack is a way to avoid the incredibly disruptive resizing of grids that happens on Macs
/// when moving a window between monitors of different DPIs.
#ifndef __WXMAC__
aEvt.Skip();
#endif
}
#endif
void WX_GRID::SetColLabelSize( int aHeight )
{
if( aHeight == 0 )
+6 -4
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -94,7 +94,10 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList,
{
fn = wxExpandEnvVars( equfile );
tmp = search.FindValidPath( fn.GetFullPath() );
if( fn.IsAbsolute() || fn.FileExists() )
tmp = fn.GetFullPath();
else
tmp = search.FindValidPath( fn.GetFullPath() );
if( !tmp )
{
@@ -102,8 +105,7 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList,
if( aErrorMessages )
{
error_msg.Printf( _( "Equivalence file '%s' could not be found in the "
"default search paths." ),
error_msg.Printf( _( "Equivalence file '%s' could not be found." ),
fn.GetFullName() );
if( ! aErrorMessages->IsEmpty() )
+1 -1
View File
@@ -175,7 +175,7 @@ set( EESCHEMA_SRCS
fields_grid_table.cpp
files-io.cpp
generate_alias_info.cpp
getpart.cpp
picksymbol.cpp
hierarch.cpp
lib_shape.cpp
lib_item.cpp
+23 -11
View File
@@ -144,14 +144,14 @@ public:
*/
void DoAutoplace( bool aManual )
{
bool force_wire_spacing = false;
bool forceWireSpacing = false;
SIDE_AND_NPINS sideandpins = chooseSideForFields( aManual );
SIDE field_side = sideandpins.side;
wxPoint fbox_pos = fieldBoxPlacement( sideandpins );
EDA_RECT field_box( fbox_pos, m_fbox_size );
if( aManual )
force_wire_spacing = fitFieldsBetweenWires( &field_box, field_side );
forceWireSpacing = fitFieldsBetweenWires( &field_box, field_side );
// Move the fields
int last_y_coord = field_box.GetTop();
@@ -160,6 +160,9 @@ public:
{
SCH_FIELD* field = m_fields[field_idx];
if( !field->IsVisible() )
continue;
if( m_allow_rejustify )
{
if( sideandpins.pins > 0 )
@@ -175,8 +178,8 @@ public:
}
}
wxPoint pos( fieldHorizPlacement( field, field_box ),
fieldVertPlacement( field, field_box, &last_y_coord, !force_wire_spacing ) );
wxPoint pos( fieldHPlacement( field, field_box ),
fieldVPlacement( field, field_box, &last_y_coord, !forceWireSpacing ) );
if( m_align_to_grid )
{
@@ -201,7 +204,15 @@ protected:
int max_field_width = 0;
int total_height = 0;
std::vector<SCH_FIELD*> visibleFields;
for( SCH_FIELD* field : m_fields )
{
if( field->IsVisible() )
visibleFields.push_back( field );
}
for( SCH_FIELD* field : visibleFields )
{
if( m_symbol->GetTransform().y1 )
field->SetTextAngle( TEXT_ANGLE_VERT );
@@ -215,7 +226,7 @@ protected:
max_field_width = std::max( max_field_width, field_width );
// Remove interline spacing from field_height for last line.
if( field == m_fields[ m_fields.size() - 1 ] )
if( field == visibleFields.back() )
field_height *= 0.62;
if( !aDynamic )
@@ -322,6 +333,7 @@ protected:
if( item_box.Intersects( aRect ) )
filtered.push_back( item );
}
return filtered;
}
@@ -642,7 +654,7 @@ protected:
*
* @return Correct field horizontal position
*/
int fieldHorizPlacement( SCH_FIELD *aField, const EDA_RECT &aFieldBox )
int fieldHPlacement( SCH_FIELD *aField, const EDA_RECT &aFieldBox )
{
int field_hjust;
int field_xcoord;
@@ -677,13 +689,13 @@ protected:
*
* @param aField - the field to place.
* @param aFieldBox - box in which fields will be placed.
* @param aPosAccum - pointer to a position accumulator
* @param aAccumulatedPosition - pointer to a position accumulator
* @param aDynamic - use dynamic spacing
*
* @return Correct field vertical position
*/
int fieldVertPlacement( SCH_FIELD *aField, const EDA_RECT &aFieldBox, int *aPosAccum,
bool aDynamic )
int fieldVPlacement( SCH_FIELD *aField, const EDA_RECT &aFieldBox, int *aAccumulatedPosition,
bool aDynamic )
{
int field_height;
int padding;
@@ -704,9 +716,9 @@ protected:
padding = FIELD_PADDING;
}
int placement = *aPosAccum + padding / 2 + field_height / 2;
int placement = *aAccumulatedPosition + padding / 2 + field_height / 2;
*aPosAccum += padding + field_height;
*aAccumulatedPosition += padding + field_height;
return placement;
}
+242 -150
View File
@@ -366,6 +366,9 @@ void CONNECTION_SUBGRAPH::UpdateItemConnections()
{
SCH_CONNECTION* item_conn = item->GetOrInitConnection( m_sheet, m_graph );
if( !item_conn )
continue;
if( ( m_driver_connection->IsBus() && item_conn->IsNet() ) ||
( m_driver_connection->IsNet() && item_conn->IsBus() ) )
{
@@ -585,142 +588,147 @@ void CONNECTION_GRAPH::updateItemConnectivity( const SCH_SHEET_PATH& aSheet,
// Pre-scan to see if we have a bus at this location
SCH_LINE* busLine = aSheet.LastScreen()->GetBus( it.first );
for( auto primary_it = connection_vec.begin(); primary_it != connection_vec.end(); primary_it++ )
// We don't want to spin up a new thread for fewer than 4 items (overhead costs)
size_t parallelThreadCount = std::min<size_t>( std::thread::hardware_concurrency(),
( connection_vec.size() + 3 ) / 4 );
std::atomic<size_t> nextItem( 0 );
std::mutex update_mutex;
std::vector<std::future<size_t>> returns( parallelThreadCount );
auto update_lambda = [&]() -> size_t
{
SCH_ITEM* connected_item = *primary_it;
// Bus entries are special: they can have connection points in the
// middle of a wire segment, because the junction algo doesn't split
// the segment in two where you place a bus entry. This means that
// bus entries that don't land on the end of a line segment need to
// have "virtual" connection points to the segments they graphically
// touch.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
for( size_t ii = nextItem++; ii < connection_vec.size(); ii = nextItem++ )
{
// If this location only has the connection point of the bus
// entry itself, this means that either the bus entry is not
// connected to anything graphically, or that it is connected to
// a segment at some point other than at one of the endpoints.
if( connection_vec.size() == 1 )
{
if( busLine )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
bus_entry->m_connected_bus_item = busLine;
}
}
}
// Bus-to-bus entries are treated just like bus wires
else if( connected_item->Type() == SCH_BUS_BUS_ENTRY_T )
{
if( connection_vec.size() < 2 )
{
if( busLine )
{
auto bus_entry = static_cast<SCH_BUS_BUS_ENTRY*>( connected_item );
if( it.first == bus_entry->GetPosition() )
bus_entry->m_connected_bus_items[0] = busLine;
else
bus_entry->m_connected_bus_items[1] = busLine;
bus_entry->ConnectedItems( aSheet ).insert( busLine );
busLine->ConnectedItems( aSheet ).insert( bus_entry );
}
}
}
// Change junctions to be on bus junction layer if they are touching a bus
else if( connected_item->Type() == SCH_JUNCTION_T )
{
connected_item->SetLayer( busLine ? LAYER_BUS_JUNCTION : LAYER_JUNCTION );
}
for( auto test_it = primary_it + 1; test_it != connection_vec.end(); test_it++ )
{
bool bus_connection_ok = true;
SCH_ITEM* test_item = *test_it;
wxASSERT( test_item != connected_item );
// Set up the link between the bus entry net and the bus
SCH_ITEM* connected_item = connection_vec[ii];
// Bus entries are special: they can have connection points in the
// middle of a wire segment, because the junction algo doesn't split
// the segment in two where you place a bus entry. This means that
// bus entries that don't land on the end of a line segment need to
// have "virtual" connection points to the segments they graphically
// touch.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
if( test_item->GetLayer() == LAYER_BUS )
// If this location only has the connection point of the bus
// entry itself, this means that either the bus entry is not
// connected to anything graphically, or that it is connected to
// a segment at some point other than at one of the endpoints.
if( connection_vec.size() == 1 )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
bus_entry->m_connected_bus_item = test_item;
if( busLine )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
bus_entry->m_connected_bus_item = busLine;
}
}
}
// Bus entries only connect to bus lines on the end that is touching a bus line.
// If the user has overlapped another net line with the endpoint of the bus entry
// where the entry connects to a bus, we don't want to short-circuit it.
// Bus-to-bus entries are treated just like bus wires
else if( connected_item->Type() == SCH_BUS_BUS_ENTRY_T )
{
if( connection_vec.size() < 2 )
{
if( busLine )
{
auto bus_entry = static_cast<SCH_BUS_BUS_ENTRY*>( connected_item );
if( it.first == bus_entry->GetPosition() )
bus_entry->m_connected_bus_items[0] = busLine;
else
bus_entry->m_connected_bus_items[1] = busLine;
std::lock_guard<std::mutex> lock( update_mutex );
bus_entry->AddConnectionTo( aSheet, busLine );
busLine->AddConnectionTo( aSheet, bus_entry );
}
}
}
// Change junctions to be on bus junction layer if they are touching a bus
else if( connected_item->Type() == SCH_JUNCTION_T )
{
connected_item->SetLayer( busLine ? LAYER_BUS_JUNCTION : LAYER_JUNCTION );
}
SCH_ITEM_SET& connected_set = connected_item->ConnectedItems( aSheet );
connected_set.reserve( connection_vec.size() );
for( SCH_ITEM* test_item : connection_vec )
{
bool bus_connection_ok = true;
if( test_item == connected_item )
continue;
// Set up the link between the bus entry net and the bus
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
if( test_item->GetLayer() == LAYER_BUS )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
bus_entry->m_connected_bus_item = test_item;
}
}
// Bus entries only connect to bus lines on the end that is touching a bus line.
// If the user has overlapped another net line with the endpoint of the bus entry
// where the entry connects to a bus, we don't want to short-circuit it.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
bus_connection_ok = !busLine || test_item->GetLayer() == LAYER_BUS;
}
else if( test_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
bus_connection_ok = !busLine || connected_item->GetLayer() == LAYER_BUS;
}
if( connected_item->ConnectionPropagatesTo( test_item ) &&
test_item->ConnectionPropagatesTo( connected_item ) &&
bus_connection_ok )
{
connected_set.push_back( test_item );
}
}
// If we got this far and did not find a connected bus item for a bus entry,
// we should do a manual scan in case there is a bus item on this connection
// point but we didn't pick it up earlier because there is *also* a net item here.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
bus_connection_ok = !busLine || test_item->GetLayer() == LAYER_BUS;
}
else if( test_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
bus_connection_ok = !busLine || connected_item->GetLayer() == LAYER_BUS;
}
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
if( connected_item->ConnectionPropagatesTo( test_item ) &&
test_item->ConnectionPropagatesTo( connected_item ) &&
bus_connection_ok )
{
connected_item->ConnectedItems( aSheet ).insert( test_item );
test_item->ConnectedItems( aSheet ).insert( connected_item );
if( !bus_entry->m_connected_bus_item )
{
SCH_SCREEN* screen = aSheet.LastScreen();
SCH_LINE* bus = screen->GetBus( it.first );
if( bus )
bus_entry->m_connected_bus_item = bus;
}
}
}
// If we got this far and did not find a connected bus item for a bus entry,
// we should do a manual scan in case there is a bus item on this connection
// point but we didn't pick it up earlier because there is *also* a net item here.
if( connected_item->Type() == SCH_BUS_WIRE_ENTRY_T )
{
auto bus_entry = static_cast<SCH_BUS_WIRE_ENTRY*>( connected_item );
return 1;
};
if( !bus_entry->m_connected_bus_item )
{
SCH_SCREEN* screen = aSheet.LastScreen();
SCH_LINE* bus = screen->GetBus( it.first );
if( bus )
bus_entry->m_connected_bus_item = bus;
}
}
if( parallelThreadCount == 1 )
update_lambda();
else
{
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
returns[ii] = std::async( std::launch::async, update_lambda );
// Finalize the threads
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
returns[ii].wait();
}
}
}
// TODO(JE) This won't give the same subgraph IDs (and eventually net/graph codes)
// to the same subgraph necessarily if it runs over and over again on the same
// sheet. We need:
//
// a) a cache of net/bus codes, like used before
// b) to persist the CONNECTION_GRAPH globally so the cache is persistent,
// c) some way of trying to avoid changing net names. so we should keep track
// of the previous driver of a net, and if it comes down to choosing between
// equally-prioritized drivers, choose the one that already exists as a driver
// on some portion of the items.
void CONNECTION_GRAPH::buildConnectionGraph()
void CONNECTION_GRAPH::buildItemSubGraphs()
{
// Recache all bus aliases for later use
wxCHECK_RET( m_schematic, wxT( "Connection graph cannot be built without schematic pointer" ) );
SCH_SHEET_LIST all_sheets = m_schematic->GetSheets();
for( unsigned i = 0; i < all_sheets.size(); i++ )
{
for( const auto& alias : all_sheets[i].LastScreen()->GetBusAliases() )
m_bus_alias_cache[ alias->GetName() ] = alias;
}
// Build subgraphs from items (on a per-sheet basis)
for( SCH_ITEM* item : m_items )
@@ -742,21 +750,25 @@ void CONNECTION_GRAPH::buildConnectionGraph()
connection->SetSubgraphCode( subgraph->m_code );
m_item_to_subgraph_map[item] = subgraph;
std::list<SCH_ITEM*> members;
std::list<SCH_ITEM*> memberlist;
auto get_items =
[&]( SCH_ITEM* aItem ) -> bool
{
SCH_CONNECTION* conn = aItem->GetOrInitConnection( sheet, this );
bool unique = !( aItem->GetFlags() & CANDIDATE );
return ( conn->SubgraphCode() == 0 );
if( conn && !conn->SubgraphCode() )
aItem->SetFlags( CANDIDATE );
return ( unique && conn && ( conn->SubgraphCode() == 0 ) );
};
std::copy_if( item->ConnectedItems( sheet ).begin(),
item->ConnectedItems( sheet ).end(),
std::back_inserter( members ), get_items );
std::back_inserter( memberlist ), get_items );
for( SCH_ITEM* connected_item : members )
for( SCH_ITEM* connected_item : memberlist )
{
if( connected_item->Type() == SCH_NO_CONNECT_T )
subgraph->m_no_connect = connected_item;
@@ -770,24 +782,32 @@ void CONNECTION_GRAPH::buildConnectionGraph()
connected_conn->SetSubgraphCode( subgraph->m_code );
m_item_to_subgraph_map[connected_item] = subgraph;
subgraph->AddItem( connected_item );
SCH_ITEM_SET& citemset = connected_item->ConnectedItems( sheet );
std::copy_if( connected_item->ConnectedItems( sheet ).begin(),
connected_item->ConnectedItems( sheet ).end(),
std::back_inserter( members ), get_items );
for( SCH_ITEM* citem : citemset )
{
if( citem->HasFlag( CANDIDATE ) )
continue;
if( get_items( citem ) )
memberlist.push_back( citem );
}
}
}
for( SCH_ITEM* connected_item : memberlist )
connected_item->ClearFlags( CANDIDATE );
subgraph->m_dirty = true;
m_subgraphs.push_back( subgraph );
}
}
}
/**
* TODO(JE): Net codes are non-deterministic. Fortunately, they are also not really used for
* anything. We should consider removing them entirely and just using net names everywhere.
*/
}
void CONNECTION_GRAPH::resolveAllDrivers()
{
// Resolve drivers for subgraphs and propagate connectivity info
// We don't want to spin up a new thread for fewer than 8 nets (overhead costs)
@@ -867,7 +887,11 @@ void CONNECTION_GRAPH::buildConnectionGraph()
{
return candidate->m_driver;
} );
}
void CONNECTION_GRAPH::collectAllDriverValues()
{
// Check for subgraphs with the same net name but only weak drivers.
// For example, two wires that are both connected to hierarchical
// sheet pins that happen to have the same name, but are not the same.
@@ -922,7 +946,11 @@ void CONNECTION_GRAPH::buildConnectionGraph()
}
}
}
}
void CONNECTION_GRAPH::generateInvisiblePinSubGraphs()
{
// Generate subgraphs for invisible power pins. These will be merged with other subgraphs
// on the same sheet in the next loop.
@@ -942,7 +970,7 @@ void CONNECTION_GRAPH::buildConnectionGraph()
SCH_CONNECTION* connection = pin->GetOrInitConnection( sheet, this );
// If this pin already has a subgraph, don't need to process
if( connection->SubgraphCode() > 0 )
if( !connection || connection->SubgraphCode() > 0 )
continue;
connection->SetName( pin->GetShownName() );
@@ -979,7 +1007,11 @@ void CONNECTION_GRAPH::buildConnectionGraph()
connection->SetSubgraphCode( subgraph->m_code );
}
}
void CONNECTION_GRAPH::processSubGraphs()
{
// Here we do all the local (sheet) processing of each subgraph, including assigning net
// codes, merging subgraphs together that use label connections, etc.
@@ -1306,6 +1338,58 @@ void CONNECTION_GRAPH::buildConnectionGraph()
subgraph->m_driver_connection->Name() );
}
}
// TODO(JE) This won't give the same subgraph IDs (and eventually net/graph codes)
// to the same subgraph necessarily if it runs over and over again on the same
// sheet. We need:
//
// a) a cache of net/bus codes, like used before
// b) to persist the CONNECTION_GRAPH globally so the cache is persistent,
// c) some way of trying to avoid changing net names. so we should keep track
// of the previous driver of a net, and if it comes down to choosing between
// equally-prioritized drivers, choose the one that already exists as a driver
// on some portion of the items.
void CONNECTION_GRAPH::buildConnectionGraph()
{
// Recache all bus aliases for later use
wxCHECK_RET( m_schematic, wxT( "Connection graph cannot be built without schematic pointer" ) );
SCH_SHEET_LIST all_sheets = m_schematic->GetSheets();
for( unsigned i = 0; i < all_sheets.size(); i++ )
{
for( const auto& alias : all_sheets[i].LastScreen()->GetBusAliases() )
m_bus_alias_cache[ alias->GetName() ] = alias;
}
PROF_TIMER sub_graph( "buildItemSubGraphs" );
buildItemSubGraphs();
if( wxLog::IsAllowedTraceMask( ConnProfileMask ) )
sub_graph.Show();
/**
* TODO(JE): Net codes are non-deterministic. Fortunately, they are also not really used for
* anything. We should consider removing them entirely and just using net names everywhere.
*/
resolveAllDrivers();
collectAllDriverValues();
generateInvisiblePinSubGraphs();
PROF_TIMER proc_sub_graph( "ProcessSubGraphs" );
processSubGraphs();
if( wxLog::IsAllowedTraceMask( ConnProfileMask ) )
proc_sub_graph.Show();
// Absorbed subgraphs should no longer be considered
alg::delete_if( m_driver_subgraphs, [&]( const CONNECTION_SUBGRAPH* candidate ) -> bool
{
@@ -1328,7 +1412,13 @@ void CONNECTION_GRAPH::buildConnectionGraph()
m_sheet_to_subgraphs_map[ subgraph->m_sheet ].emplace_back( subgraph );
// Update item connections at this point so that neighbor propagation works
nextSubgraph.store( 0 );
std::atomic<size_t> nextSubgraph( 0 );
// We don't want to spin up a new thread for fewer than 8 nets (overhead costs)
size_t parallelThreadCount = std::min<size_t>( std::thread::hardware_concurrency(),
( m_subgraphs.size() + 3 ) / 4 );
std::vector<std::future<size_t>> returns( parallelThreadCount );
auto preliminaryUpdateTask =
[&]() -> size_t
@@ -1901,7 +1991,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph )
// member to have the correct connection info
if( conn->IsBus() && !stale_bus_members.empty() )
{
for( auto stale_member : stale_bus_members )
for( SCH_CONNECTION* stale_member : stale_bus_members )
{
for( CONNECTION_SUBGRAPH* subgraph : visited )
{
@@ -1933,13 +2023,13 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph )
std::shared_ptr<SCH_CONNECTION> CONNECTION_GRAPH::getDefaultConnection( SCH_ITEM* aItem,
CONNECTION_SUBGRAPH* aSubgraph )
{
auto c = std::shared_ptr<SCH_CONNECTION>( nullptr );
std::shared_ptr<SCH_CONNECTION> c = std::shared_ptr<SCH_CONNECTION>( nullptr );
switch( aItem->Type() )
{
case SCH_PIN_T:
{
auto pin = static_cast<SCH_PIN*>( aItem );
SCH_PIN* pin = static_cast<SCH_PIN*>( aItem );
if( pin->IsPowerConnection() )
c = std::make_shared<SCH_CONNECTION>( aItem, aSubgraph->m_sheet );
@@ -1981,7 +2071,7 @@ SCH_CONNECTION* CONNECTION_GRAPH::matchBusMember( SCH_CONNECTION* aBusConnection
// Vector bus: compare against index, because we allow the name
// to be different
for( const auto& bus_member : aBusConnection->Members() )
for( const std::shared_ptr<SCH_CONNECTION>& bus_member : aBusConnection->Members() )
{
if( bus_member->VectorIndex() == aSearch->VectorIndex() )
{
@@ -1993,14 +2083,14 @@ SCH_CONNECTION* CONNECTION_GRAPH::matchBusMember( SCH_CONNECTION* aBusConnection
else
{
// Group bus
for( const auto& c : aBusConnection->Members() )
for( const std::shared_ptr<SCH_CONNECTION>& c : aBusConnection->Members() )
{
// Vector inside group: compare names, because for bus groups
// we expect the naming to be consistent across all usages
// TODO(JE) explain this in the docs
if( c->Type() == CONNECTION_TYPE::BUS )
{
for( const auto& bus_member : c->Members() )
for( const std::shared_ptr<SCH_CONNECTION>& bus_member : c->Members() )
{
if( bus_member->LocalName() == aSearch->LocalName() )
{
@@ -2051,7 +2141,7 @@ std::vector<const CONNECTION_SUBGRAPH*> CONNECTION_GRAPH::GetBusesNeedingMigrati
{
std::vector<const CONNECTION_SUBGRAPH*> ret;
for( auto&& subgraph : m_subgraphs )
for( CONNECTION_SUBGRAPH* subgraph : m_subgraphs )
{
// Graph is supposed to be up-to-date before calling this
wxASSERT( !subgraph->m_dirty );
@@ -2313,8 +2403,8 @@ bool CONNECTION_GRAPH::ercCheckMultipleDrivers( const CONNECTION_SUBGRAPH* aSubg
bool CONNECTION_GRAPH::ercCheckBusToNetConflicts( const CONNECTION_SUBGRAPH* aSubgraph )
{
auto sheet = aSubgraph->m_sheet;
auto screen = sheet.LastScreen();
const SCH_SHEET_PATH& sheet = aSubgraph->m_sheet;
SCH_SCREEN* screen = sheet.LastScreen();
SCH_ITEM* net_item = nullptr;
SCH_ITEM* bus_item = nullptr;
@@ -2371,8 +2461,8 @@ bool CONNECTION_GRAPH::ercCheckBusToNetConflicts( const CONNECTION_SUBGRAPH* aSu
bool CONNECTION_GRAPH::ercCheckBusToBusConflicts( const CONNECTION_SUBGRAPH* aSubgraph )
{
wxString msg;
auto sheet = aSubgraph->m_sheet;
auto screen = sheet.LastScreen();
const SCH_SHEET_PATH& sheet = aSubgraph->m_sheet;
SCH_SCREEN* screen = sheet.LastScreen();
SCH_ITEM* label = nullptr;
SCH_ITEM* port = nullptr;
@@ -2440,8 +2530,8 @@ bool CONNECTION_GRAPH::ercCheckBusToBusConflicts( const CONNECTION_SUBGRAPH* aSu
bool CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts( const CONNECTION_SUBGRAPH* aSubgraph )
{
bool conflict = false;
auto sheet = aSubgraph->m_sheet;
auto screen = sheet.LastScreen();
const SCH_SHEET_PATH& sheet = aSubgraph->m_sheet;
SCH_SCREEN* screen = sheet.LastScreen();
SCH_BUS_WIRE_ENTRY* bus_entry = nullptr;
SCH_ITEM* bus_wire = nullptr;
@@ -2453,7 +2543,7 @@ bool CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts( const CONNECTION_SUBGRAPH
return true;
}
for( auto item : aSubgraph->m_items )
for( SCH_ITEM* item : aSubgraph->m_items )
{
switch( item->Type() )
{
@@ -2509,7 +2599,9 @@ bool CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts( const CONNECTION_SUBGRAPH
// or global label
if( conflict && CONNECTION_SUBGRAPH::GetDriverPriority( aSubgraph->m_driver )
>= CONNECTION_SUBGRAPH::PRIORITY::POWER_PIN )
{
conflict = false;
}
if( conflict )
{
@@ -2653,8 +2745,8 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
wxString name = pin->Connection( &sheet )->Name();
wxString local_name = pin->Connection( &sheet )->Name( true );
if( m_global_label_cache.count( name ) ||
( m_local_label_cache.count( std::make_pair( sheet, local_name ) ) ) )
if( m_global_label_cache.count( name )
|| m_local_label_cache.count( std::make_pair( sheet, local_name ) ) )
{
has_other_connections = true;
}
@@ -2787,7 +2879,7 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
return false;
};
for( auto item : aSubgraph->m_items )
for( SCH_ITEM* item : aSubgraph->m_items )
{
switch( item->Type() )
{
@@ -2837,9 +2929,9 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
if( isGlobal )
{
// This will be set to true if the global is connected to a pin above, but we
// want to reset this to false so that globals get flagged if they only have a
// single instance connected to a single pin
// This will be set to true if the global is connected to a pin above, but we want to
// reset this to false so that globals get flagged if they only have a single instance
// connected to a single pin
hasOtherConnections = ( pinCount > 1 );
auto it = m_net_name_to_subgraphs_map.find( name );
@@ -2853,9 +2945,9 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
else if( text->Type() == SCH_HIER_LABEL_T )
{
// For a hier label, check if the parent pin is connected
if( aSubgraph->m_hier_parent &&
( aSubgraph->m_hier_parent->m_strong_driver ||
aSubgraph->m_hier_parent->m_drivers.size() > 1) )
if( aSubgraph->m_hier_parent
&& ( aSubgraph->m_hier_parent->m_strong_driver
|| aSubgraph->m_hier_parent->m_drivers.size() > 1) )
{
// For now, a simple check: if there is more than one driver, the parent is probably
// connected elsewhere (because at least one driver will be the hier pin itself)
+27
View File
@@ -370,6 +370,33 @@ private:
*/
void buildConnectionGraph();
/**
* Generates individual item subgraphs on a per-sheet basis
*/
void buildItemSubGraphs();
/**
* Finds all subgraphs in the connection graph and calls ResolveDrivers() in
* parallel
*/
void resolveAllDrivers();
/**
* Maps the driver values for each subgraph
*/
void collectAllDriverValues();
/**
* Iterate through the invisible power pins to collect the global labels
* as drivers
*/
void generateInvisiblePinSubGraphs();
/**
* Process all subgraphs to assign netcodes and merge subgraphs based on labels
*/
void processSubGraphs();
/**
* Helper to assign a new net code to a connection
*
+1 -1
View File
@@ -396,7 +396,7 @@ void DIALOG_ERC::testErc()
|| settings.IsTestEnabled( ERCE_POWERPIN_NOT_DRIVEN )
|| settings.IsTestEnabled( ERCE_PIN_NOT_DRIVEN ) )
{
tester.TestPinToPin();
tester.TestPinToPin();
}
// Test similar labels (i;e. labels which are identical when
@@ -30,6 +30,7 @@
#include <sch_line.h>
#include <sch_junction.h>
#include <sch_sheet.h>
#include <sch_sheet_pin.h>
#include <schematic.h>
#include <advanced_config.h>
#include <tool/tool_manager.h>
@@ -412,6 +413,12 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( const SCH_SHEET_PATH& aShe
if( m_setBgColor->GetValue() )
sheet->SetBackgroundColor( m_bgColorSwatch->GetSwatchColor() );
}
if( m_sheetPins->GetValue() )
{
for( SCH_SHEET_PIN* pin : sheet->GetPins() )
processItem( aSheetPath, pin );
}
}
else if( aItem->Type() == SCH_JUNCTION_T )
{
@@ -439,8 +446,6 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( const SCH_SHEET_PATH& aShe
processItem( aSheetPath, aItem );
else if( m_hierLabels->GetValue() && aItem->Type() == SCH_HIER_LABEL_T )
processItem( aSheetPath, aItem );
else if( m_sheetPins->GetValue() && aItem->Type() == SCH_SHEET_PIN_T )
processItem( aSheetPath, aItem );
else if( m_schTextAndGraphics->GetValue() && aItem->IsType( schTextAndGraphics ) )
processItem( aSheetPath, aItem );
}
@@ -621,6 +621,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow( wxCommandEvent& event )
newPin->SetOrientation( last->GetOrientation() );
newPin->SetType( last->GetType() );
newPin->SetShape( last->GetShape() );
newPin->SetParent( last->GetParent() );
wxPoint pos = last->GetPosition();
@@ -75,10 +75,10 @@ bool DIALOG_LIB_SHAPE_PROPERTIES::TransferDataToWindow()
bool enblConvOptStyle = symbol && symbol->HasConversion();
// if a symbol contains no graphic items, symbol->HasConversion() returns false.
// but when creating a new symbol, with DeMorgan option set, the ApplyToAllConversions
// must be enabled even if symbol->HasConversion() returns false in order to be able
// to create graphic items shared by all body styles
// If a symbol contains no conversion-specific pins or graphic items, symbol->HasConversion()
// will return false.
// But when creating a new symbol, with DeMorgan option set, the ApplyToAllConversions
// must be enabled in order to be able to create graphic items shared by all body styles.
if( m_frame->GetShowDeMorgan() )
enblConvOptStyle = true;
@@ -174,7 +174,13 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow()
m_SelNumberOfUnits->SetValue( m_libEntry->GetUnitCount() );
m_OptionPartsInterchangeable->SetValue( !m_libEntry->UnitsLocked() ||
m_libEntry->GetUnitCount() == 1 );
m_AsConvertButt->SetValue( m_libEntry->HasConversion() );
// If a symbol contains no conversion-specific pins or graphic items, symbol->HasConversion()
// will return false. But when editing a symbol with DeMorgan option set, we don't want to
// keep turning it off just because there aren't any conversion-specific items yet, so we force
// it to on if the parent frame has it enabled.
m_AsConvertButt->SetValue( m_Parent->GetShowDeMorgan() );
m_OptionPower->SetValue( m_libEntry->IsPower() );
m_excludeFromBomCheckBox->SetValue( !m_libEntry->GetIncludeInBom() );
m_excludeFromBoardCheckBox->SetValue( !m_libEntry->GetIncludeOnBoard() );
@@ -367,6 +373,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
m_libEntry->LockUnits( m_libEntry->GetUnitCount() > 1 &&
!m_OptionPartsInterchangeable->GetValue() );
m_libEntry->SetConversion( m_AsConvertButt->GetValue() );
m_Parent->SetShowDeMorgan( m_AsConvertButt->GetValue() );
if( m_OptionPower->GetValue() )
m_libEntry->SetPower();
@@ -448,17 +455,23 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging( wxGridEvent& event )
void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameText( wxCommandEvent& event )
{
if( !m_Parent->IsSymbolFromSchematic() )
if( !m_Parent->IsSymbolFromSchematic() || m_OptionPower->IsChecked() )
m_grid->SetCellValue( VALUE_FIELD, FDC_VALUE, m_SymbolNameCtrl->GetValue() );
}
void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameKillFocus( wxFocusEvent& event )
{
if( !m_delayedFocusCtrl && !m_SymbolNameCtrl->GetValidator()->Validate( m_SymbolNameCtrl ) )
if( !m_delayedFocusCtrl )
{
// If the validation fails and we throw up a dialog then GTK will give us another
// KillFocus event and we end up in infinite recursion. So we use m_delayedFocusCtrl
// as a re-entrancy block and then clear it again if validation passes.
m_delayedFocusCtrl = m_SymbolNameCtrl;
m_delayedFocusPage = 0;
if( m_SymbolNameCtrl->GetValidator()->Validate( m_SymbolNameCtrl ) )
m_delayedFocusCtrl = nullptr;
}
event.Skip();
@@ -593,7 +606,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnEditSpiceModel( wxCommandEvent& event )
{
#ifdef KICAD_SPICE
int diff = m_fields->size();
auto symbol = SCH_SYMBOL( *m_libEntry, m_libEntry->GetLibId(), nullptr );
auto symbol = SCH_SYMBOL( *m_libEntry, m_libEntry->GetLibId(), nullptr, 0 );
DIALOG_SPICE_MODEL dialog( this, symbol, m_fields );
+12 -23
View File
@@ -168,7 +168,6 @@ private:
public:
SCH_EDIT_FRAME* m_Parent;
wxString m_DefaultNetFmtName;
NETLIST_PAGE_DIALOG* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX];
};
@@ -217,11 +216,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& ti
m_TitleStringCtrl = nullptr;
m_AdjustPassiveValues = nullptr;
wxString netfmtName = static_cast<NETLIST_DIALOG*>( parent->GetParent() )->m_DefaultNetFmtName;
bool selected = m_pageNetFmtName == netfmtName;
parent->AddPage( this, title, selected );
parent->AddPage( this, title, false );
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxVERTICAL );
SetSizer( MainBoxSizer );
@@ -246,8 +241,6 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
SCHEMATIC_SETTINGS& settings = m_Parent->Schematic().Settings();
m_DefaultNetFmtName = settings.m_NetFormatName;
for( NETLIST_PAGE_DIALOG*& page : m_PanelNetType)
page = nullptr;
@@ -271,6 +264,15 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
m_sdbSizer2OK->SetDefault();
for( int ii = 0; m_PanelNetType[ii] && ii < 4 + CUSTOMPANEL_COUNTMAX; ++ii )
{
if( m_PanelNetType[ii]->GetPageNetFmtName() == settings.m_NetFormatName )
{
m_NoteBook->ChangeSelection( ii );
break;
}
}
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
@@ -416,8 +418,6 @@ void NETLIST_DIALOG::OnNetlistTypeSelection( wxNotebookEvent& event )
if( currPage == nullptr )
return;
m_DefaultNetFmtName = currPage->GetPageNetFmtName();
m_buttonDelGenerator->Enable( currPage->m_IdNetType >= NET_TYPE_CUSTOM1 );
}
@@ -431,8 +431,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt()
settings.m_SpiceAdjustPassiveValues = adjust;
settings.m_SpiceCommandString = spice_cmd_string;
settings.m_NetFormatName = wxEmptyString;
settings.m_NetFormatName = m_DefaultNetFmtName;
settings.m_NetFormatName = m_PanelNetType[m_NoteBook->GetSelection()]->GetPageNetFmtName();
}
@@ -591,7 +590,6 @@ void NETLIST_DIALOG::OnDelGenerator( wxCommandEvent& event )
currPage->m_CommandStringCtrl->SetValue( wxEmptyString );
currPage->m_TitleStringCtrl->SetValue( wxEmptyString );
m_DefaultNetFmtName = m_PanelNetType[PANELPCBNEW]->GetPageNetFmtName();
WriteCurrentNetlistSetup();
@@ -718,17 +716,8 @@ int InvokeDialogNetList( SCH_EDIT_FRAME* aCaller )
{
NETLIST_DIALOG dlg( aCaller );
SCHEMATIC_SETTINGS& settings = aCaller->Schematic().Settings();
wxString curr_default_netformat = settings.m_NetFormatName;
int ret = dlg.ShowModal();
// Update the default netlist and store it in prj config if it was explicitly changed.
settings.m_NetFormatName = dlg.m_DefaultNetFmtName; // can have temporary changed
if( curr_default_netformat != dlg.m_DefaultNetFmtName )
aCaller->SaveProjectSettings();
aCaller->SaveProjectSettings();
return ret;
}
+9 -1
View File
@@ -1250,7 +1250,15 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
wxStandardPaths::Get().GetDocumentsDir() );
// Build the absolute path of current output directory to preselect it in the file browser.
wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
std::function<bool( wxString* )> textResolver =
[&]( wxString* token ) -> bool
{
return m_parent->Schematic().ResolveTextVar( token, 0 );
};
wxString path = m_outputDirectoryName->GetValue();
path = ExpandTextVars( path, &textResolver, nullptr, &Prj() );
path = ExpandEnvVarSubstitutions( path, &Prj() );
fn.SetPath( path );
@@ -208,8 +208,17 @@ public:
for( unsigned i = 0; i < m_symbolsList.GetCount(); ++i )
{
SCH_SYMBOL* symbol = m_symbolsList[ i ].GetSymbol();
m_dataStore[ symbol->m_Uuid ][ aFieldName ] = symbol->GetFieldText( aFieldName,
m_frame );
wxCHECK( symbol && ( symbol->GetInstanceReferences().size() != 0 ), /* void */ );
wxString val = symbol->GetFieldText( aFieldName, m_frame );
if( aFieldName == wxT( "Value" ) )
val = symbol->GetInstanceReferences()[0].m_Value;
else if( aFieldName == wxT( "Footprint" ) )
val = symbol->GetInstanceReferences()[0].m_Footprint;
m_dataStore[ symbol->m_Uuid ][ aFieldName ] = val;
}
}
+49 -14
View File
@@ -700,8 +700,19 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
m_symbol->SetIncludeInBom( !m_cbExcludeFromBom->IsChecked() );
m_symbol->SetIncludeOnBoard( !m_cbExcludeFromBoard->IsChecked() );
// The value, footprint and datasheet fields and exclude from bill of materials setting
// should be kept in sync in multi-unit parts.
// Update any assignments
if( m_dataModel )
{
for( const SCH_PIN& model_pin : *m_dataModel )
{
// map from the edited copy back to the "real" pin in the symbol.
SCH_PIN* src_pin = m_symbol->GetPin( model_pin.GetLibPin() );
src_pin->SetAlt( model_pin.GetAlt() );
}
}
// Keep fields other than the reference, include/exclude flags, and alternate pin assignements
// in sync in multi-unit parts.
if( m_symbol->GetUnitCount() > 1 && m_symbol->IsAnnotated( &GetParent()->GetCurrentSheet() ) )
{
wxString ref = m_symbol->GetRef( &GetParent()->GetCurrentSheet() );
@@ -722,25 +733,49 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
appendUndo );
otherUnit->SetValue( m_fields->at( VALUE_FIELD ).GetText() );
otherUnit->SetFootprint( m_fields->at( FOOTPRINT_FIELD ).GetText() );
otherUnit->GetField( DATASHEET_FIELD )->SetText( m_fields->at( DATASHEET_FIELD ).GetText() );
for( size_t ii = DATASHEET_FIELD; ii < m_fields->size(); ++ii )
{
SCH_FIELD* otherField = otherUnit->FindField( m_fields->at( ii ).GetName() );
if( otherField )
{
otherField->SetText( m_fields->at( ii ).GetText() );
}
else
{
SCH_FIELD* newField = otherUnit->AddField( m_fields->at( ii ) );
const_cast<KIID&>( newField->m_Uuid ) = KIID();
}
}
for( size_t ii = otherUnit->GetFields().size() - 1; ii > DATASHEET_FIELD; ii-- )
{
SCH_FIELD& otherField = otherUnit->GetFields().at( ii );
if( !m_symbol->FindField( otherField.GetName() ) )
otherUnit->GetFields().erase( otherUnit->GetFields().begin() + ii );
}
otherUnit->SetIncludeInBom( !m_cbExcludeFromBom->IsChecked() );
otherUnit->SetIncludeOnBoard( !m_cbExcludeFromBoard->IsChecked() );
if( m_dataModel )
{
for( const SCH_PIN& model_pin : *m_dataModel )
{
SCH_PIN* src_pin = otherUnit->GetPin( model_pin.GetNumber() );
if( src_pin )
src_pin->SetAlt( model_pin.GetAlt() );
}
}
GetParent()->UpdateItem( otherUnit, false, true );
}
}
}
// Update any assignments
if( m_dataModel )
{
for( const SCH_PIN& model_pin : *m_dataModel )
{
// map from the edited copy back to the "real" pin in the symbol.
SCH_PIN* src_pin = m_symbol->GetPin( model_pin.GetLibPin() );
src_pin->SetAlt( model_pin.GetAlt() );
}
}
currentScreen->Append( m_symbol );
GetParent()->TestDanglingEnds();
GetParent()->UpdateItem( m_symbol, false, true );
+2 -42
View File
@@ -146,48 +146,8 @@ void EE_COLLECTOR::Collect( SCH_SCREEN* aScreen, const KICAD_T aFilterList[], co
if( aScreen )
{
// Symbols and sheets own their own children so have to be visited even if
// they're not in the filter list
bool symbolsVisited = false;
bool sheetsVisited = false;
bool globalLabelsVisited = false;
EE_RTREE& items = aScreen->Items();
for( const KICAD_T *filter = aFilterList; *filter != EOT; ++filter )
{
for( SCH_ITEM *item : items.Overlapping( *filter, aPos, m_Threshold ) )
{
if( *filter == SCH_SYMBOL_T || *filter == SCH_LOCATE_ANY_T )
symbolsVisited = true;
if( *filter == SCH_SHEET_T || *filter == SCH_LOCATE_ANY_T )
sheetsVisited = true;
if( *filter == SCH_GLOBAL_LABEL_T || *filter == SCH_LOCATE_ANY_T )
globalLabelsVisited = true;
item->Visit( m_inspector, nullptr, m_scanTypes );
}
}
if( !symbolsVisited )
{
for( SCH_ITEM *item : items.Overlapping( SCH_SYMBOL_T, aPos, m_Threshold ) )
item->Visit( m_inspector, nullptr, m_scanTypes );
}
if( !sheetsVisited )
{
for( SCH_ITEM *item : items.Overlapping( SCH_SHEET_T, aPos, m_Threshold ) )
item->Visit( m_inspector, nullptr, m_scanTypes );
}
if( !globalLabelsVisited )
{
for( SCH_ITEM *item : items.Overlapping( SCH_GLOBAL_LABEL_T, aPos, m_Threshold ) )
item->Visit( m_inspector, nullptr, m_scanTypes );
}
for( SCH_ITEM *item : aScreen->Items().Overlapping( SCH_LOCATE_ANY_T, aPos, m_Threshold ) )
item->Visit( m_inspector, nullptr, m_scanTypes );
}
}
+1 -1
View File
@@ -192,7 +192,7 @@ void SCH_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
void SCH_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
{
wxCHECK_RET( aCfg, wxT( "Call to SCH_BASE_FRAME::SaveSettings with null settings" ) );
wxCHECK_RET( aCfg, wxT( "Call to SCH_BASE_FRAME::LoadSettings with null settings" ) );
EDA_DRAW_FRAME::LoadSettings( aCfg );
+7 -6
View File
@@ -439,9 +439,13 @@ int ERC_TESTER::TestPinToPin()
{
std::vector<SCH_PIN*> pins;
std::unordered_map<EDA_ITEM*, SCH_SCREEN*> pinToScreenMap;
bool has_noconnect = false;
for( CONNECTION_SUBGRAPH* subgraph: net.second )
{
if( subgraph->m_no_connect )
has_noconnect = true;
for( EDA_ITEM* item : subgraph->m_items )
{
if( item->Type() == SCH_PIN_T )
@@ -452,10 +456,6 @@ int ERC_TESTER::TestPinToPin()
}
}
// Single-pin nets are handled elsewhere
if( pins.size() < 2 )
continue;
std::set<std::pair<SCH_PIN*, SCH_PIN*>> tested;
SCH_PIN* needsDriver = nullptr;
@@ -542,7 +542,7 @@ int ERC_TESTER::TestPinToPin()
}
}
if( needsDriver && !hasDriver )
if( needsDriver && !hasDriver && !has_noconnect )
{
int err_code = ispowerNet ? ERCE_POWERPIN_NOT_DRIVEN : ERCE_PIN_NOT_DRIVEN;
@@ -744,8 +744,9 @@ int ERC_TESTER::TestLibSymbolIssues()
}
std::unique_ptr<LIB_SYMBOL> flattenedSymbol = libSymbol->Flatten();
constexpr int flags = LIB_ITEM::COMPARE_FLAGS::EQUALITY | LIB_ITEM::COMPARE_FLAGS::ERC;
if( *flattenedSymbol != *libSymbolInSchematic )
if( flattenedSymbol->Compare( *libSymbolInSchematic, flags ) != 0 )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_LIB_SYMBOL_ISSUES );
ercItem->SetItems( symbol );
+1 -1
View File
@@ -502,7 +502,7 @@ void FIELDS_GRID_TABLE<T>::SetValue( int aRow, int aCol, const wxString &aValue
value = fn.GetFullPath();
}
}
else if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) && aRow == VALUE_FIELD )
else if( m_parentType == SCH_SYMBOL_T && aRow == VALUE_FIELD )
{
value = EscapeString( value, CTX_LIBID );
}
+15 -11
View File
@@ -62,6 +62,7 @@
#include <wx/ffile.h>
#include <wx/filedlg.h>
#include <wx/log.h>
#include <wx/stdpaths.h>
#include <tools/ee_inspection_tool.h>
#include <paths.h>
#include <wx_filename.h> // For ::ResolvePossibleSymlinks
@@ -631,6 +632,10 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
if( dlg.ShowModal() == wxID_CANCEL )
return;
// Don't leave dangling pointers to previously-opened document.
m_toolManager->GetTool<EE_SELECTION_TOOL>()->ClearSelection();
ClearUndoRedoList();
if( setProject )
{
Schematic().SetProject( nullptr );
@@ -664,8 +669,6 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
return;
}
m_toolManager->GetTool<EE_SELECTION_TOOL>()->ClearSelection();
importFile( dlg.GetPath(), pluginType );
RefreshCanvas();
@@ -693,9 +696,9 @@ bool SCH_EDIT_FRAME::saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSave
if( !IsWritable( schematicFileName ) )
return false;
wxFileName tempFile( schematicFileName );
tempFile.SetName( wxT( "." ) + tempFile.GetName() );
tempFile.SetExt( tempFile.GetExt() + wxT( "$" ) );
wxStandardPaths& paths = wxStandardPaths::Get();
wxString tempFile = wxFileName::CreateTempFileName(
paths.GetTempDir() + wxFileName::GetPathSeparator() + wxT( "eeschema" ) );
// Save
wxLogTrace( traceAutoSave, "Saving file " + schematicFileName.GetFullPath() );
@@ -706,7 +709,7 @@ bool SCH_EDIT_FRAME::saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSave
try
{
pi->Save( tempFile.GetFullPath(), aSheet, &Schematic() );
pi->Save( tempFile, aSheet, &Schematic() );
success = true;
}
catch( const IO_ERROR& ioe )
@@ -717,11 +720,11 @@ bool SCH_EDIT_FRAME::saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSave
DisplayError( this, msg );
msg.Printf( _( "Failed to create temporary file '%s'." ),
tempFile.GetFullPath() );
tempFile );
SetMsgPanel( wxEmptyString, msg );
// In case we started a file but didn't fully write it, clean up
wxRemoveFile( tempFile.GetFullPath() );
wxRemoveFile( tempFile );
success = false;
}
@@ -729,18 +732,18 @@ bool SCH_EDIT_FRAME::saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSave
if( success )
{
// Replace the original with the temporary file we just wrote
success = wxRenameFile( tempFile.GetFullPath(), schematicFileName.GetFullPath() );
success = wxRenameFile( tempFile, schematicFileName.GetFullPath() );
if( !success )
{
msg.Printf( _( "Error saving schematic file '%s'.\n"
"Failed to rename temporary file '%s'." ),
schematicFileName.GetFullPath(),
tempFile.GetFullPath() );
tempFile );
DisplayError( this, msg );
msg.Printf( _( "Failed to rename temporary file '%s'." ),
tempFile.GetFullPath() );
tempFile );
SetMsgPanel( wxEmptyString, msg );
}
}
@@ -1080,6 +1083,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
}
else
{
RecordERCExclusions(); // ensure ERC Exclusions list is up to date
GetSettingsManager()->SaveProject();
}
+1 -1
View File
@@ -179,7 +179,7 @@ void LIB_FIELD::Copy( LIB_FIELD* aTarget ) const
}
int LIB_FIELD::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
int LIB_FIELD::compare( const LIB_ITEM& aOther, int aCompareFlags ) const
{
wxASSERT( aOther.Type() == LIB_FIELD_T );
+1 -2
View File
@@ -185,8 +185,7 @@ private:
* - Field width.
* - Field height.
*/
int compare( const LIB_ITEM& aOther,
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const override;
/**
* Print the field.
+1 -1
View File
@@ -64,7 +64,7 @@ void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_IT
}
int LIB_ITEM::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
int LIB_ITEM::compare( const LIB_ITEM& aOther, int aCompareFlags ) const
{
if( Type() != aOther.Type() )
return Type() - aOther.Type();
+13 -6
View File
@@ -73,11 +73,19 @@ public:
/**
* The list of flags used by the #compare function.
*
* - NORMAL This compares everything between two #LIB_ITEM objects.
* - UNIT This compare flag ignores unit and convert and pin number information when
* comparing #LIB_ITEM objects for unit comparison.
* - UNIT This flag relaxes unit, conversion and pin number constraints. It is used for
* #LIB_ITEM object unit comparisons.
* - EQUALITY This flag relaxes ordering contstraints so that fields, etc. don't have to
* appear in the same order to be considered equal.
* - ERC This flag relaxes constraints on data that is settable in the schematic editor. It
* compares only symbol-editor-only data.
*/
enum COMPARE_FLAGS : int { NORMAL = 0x00, UNIT = 0x01, EQUALITY = 0x02 };
enum COMPARE_FLAGS : int
{
UNIT = 0x01,
EQUALITY = 0x02,
ERC = 0x04
};
/**
* Provide a user-consumable name of the object type. Perform localization when
@@ -285,8 +293,7 @@ protected:
* zero if the object is equal to \a aOther object, or greater than 0 if the
* object is greater than \a aOther object.
*/
virtual int compare( const LIB_ITEM& aOther,
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const;
virtual int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const;
/**
* Print the item to \a aDC.
+12 -1
View File
@@ -870,7 +870,7 @@ EDA_ITEM* LIB_PIN::Clone() const
}
int LIB_PIN::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
int LIB_PIN::compare( const LIB_ITEM& aOther, int aCompareFlags ) const
{
wxASSERT( aOther.Type() == LIB_PIN_T );
@@ -1061,6 +1061,17 @@ void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
}
void LIB_PIN::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 3;
aLayers[0] = LAYER_DANGLING; // We don't really show dangling vs non-dangling (since there
// are no connections in the symbol editor), but it's still
// a good visual indication of which end of the pin is which.
aLayers[1] = LAYER_DEVICE;
aLayers[2] = LAYER_SELECTION_SHADOWS;
}
const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly ) const
{
EDA_RECT bbox;
+3 -2
View File
@@ -170,6 +170,8 @@ public:
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
void ViewGetLayers( int aLayers[], int& aCount ) const override;
/* Cannot use a default parameter here as it will not be compatible with the virtual. */
const EDA_RECT GetBoundingBox() const override { return GetBoundingBox( false ); }
@@ -271,8 +273,7 @@ private:
* - Pin horizontal (X) position.
* - Pin vertical (Y) position.
*/
int compare( const LIB_ITEM& aOther,
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const override;
protected:
wxPoint m_position; // Position of the pin.
+7 -2
View File
@@ -66,7 +66,7 @@ EDA_ITEM* LIB_SHAPE::Clone() const
}
int LIB_SHAPE::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
int LIB_SHAPE::compare( const LIB_ITEM& aOther, int aCompareFlags ) const
{
int retv = LIB_ITEM::compare( aOther, aCompareFlags );
@@ -256,7 +256,12 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
CalcArcAngles( t1, t2 );
if( aTransform.MapAngles( &t1, &t2 ) == ( NormalizeAngle180( t1 - t2 ) > 0 ) )
// N.B. The order of evaluation is critical here as MapAngles will modify t1, t2
// and the Normalize routine depends on these modifications for the correct output
bool transformed = aTransform.MapAngles( &t1, &t2 );
bool transformed2 = ( NormalizeAngle180( t1 - t2 ) > 0 );
if( transformed == transformed2 )
std::swap( pt1, pt2 );
}
+1 -2
View File
@@ -113,8 +113,7 @@ private:
* - Circle vertical (Y) position.
* - Circle radius.
*/
int compare( const LIB_ITEM& aOther,
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const override;
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
const TRANSFORM& aTransform ) override;
+33 -18
View File
@@ -209,20 +209,25 @@ const LIB_SYMBOL& LIB_SYMBOL::operator=( const LIB_SYMBOL& aSymbol )
}
int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, int aCompareFlags ) const
{
if( m_me == aRhs.m_me )
return 0;
int retv = m_name.Cmp( aRhs.m_name );
int retv = 0;
if( retv )
return retv;
if( ( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::ERC ) == 0 )
{
retv = m_name.Cmp( aRhs.m_name );
retv = m_libId.compare( aRhs.m_libId );
if( retv )
return retv;
if( retv )
return retv;
retv = m_libId.compare( aRhs.m_libId );
if( retv )
return retv;
}
if( m_parent.lock() < aRhs.m_parent.lock() )
return -1;
@@ -258,8 +263,15 @@ int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, LIB_ITEM::COMPARE_FLAGS aCompar
{
const LIB_FIELD* lhsField = static_cast<const LIB_FIELD*>( lhsItem );
if( lhsField->IsMandatory() )
if( lhsField->GetId() == VALUE_FIELD )
{
if( ( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::ERC ) == 0 || IsPower() )
retv = lhsItem->compare( *rhsItem, aCompareFlags );
}
else if( lhsField->IsMandatory() )
{
retv = lhsItem->compare( *rhsItem, aCompareFlags );
}
}
else
{
@@ -322,17 +334,20 @@ int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, LIB_ITEM::COMPARE_FLAGS aCompar
if( m_unitsLocked != aRhs.m_unitsLocked )
return ( m_unitsLocked ) ? 1 : -1;
if( m_showPinNames != aRhs.m_showPinNames )
return ( m_showPinNames ) ? 1 : -1;
if( ( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::ERC ) == 0 )
{
if( m_showPinNames != aRhs.m_showPinNames )
return ( m_showPinNames ) ? 1 : -1;
if( m_showPinNumbers != aRhs.m_showPinNumbers )
return ( m_showPinNumbers ) ? 1 : -1;
if( m_showPinNumbers != aRhs.m_showPinNumbers )
return ( m_showPinNumbers ) ? 1 : -1;
if( m_includeInBom != aRhs.m_includeInBom )
return ( m_includeInBom ) ? 1 : -1;
if( m_includeInBom != aRhs.m_includeInBom )
return ( m_includeInBom ) ? 1 : -1;
if( m_includeOnBoard != aRhs.m_includeOnBoard )
return ( m_includeOnBoard ) ? 1 : -1;
if( m_includeOnBoard != aRhs.m_includeOnBoard )
return ( m_includeOnBoard ) ? 1 : -1;
}
return 0;
}
@@ -917,10 +932,10 @@ const EDA_RECT LIB_SYMBOL::GetBodyBoundingBox( int aUnit, int aConvert, bool aIn
{
const LIB_PIN& pin = static_cast<const LIB_PIN&>( item );
// Note: the roots of the pins are always inlcuded for symbols that don't have a
// Note: the roots of the pins are always included for symbols that don't have a
// well-defined body.
if( aIncludePins )
if( aIncludePins && pin.IsVisible() )
bbox.Merge( pin.GetBoundingBox( false, true ) );
else
bbox.Merge( pin.GetPinRoot() );
+1 -2
View File
@@ -612,8 +612,7 @@ public:
* 1 if this symbol is greater than \a aRhs
* 0 if this symbol is the same as \a aRhs
*/
int Compare( const LIB_SYMBOL& aRhs,
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const;
int Compare( const LIB_SYMBOL& aRhs, int aCompareFlags = 0 ) const;
bool operator==( const LIB_SYMBOL* aSymbol ) const { return this == aSymbol; }
bool operator==( const LIB_SYMBOL& aSymbol ) const
+1 -1
View File
@@ -84,7 +84,7 @@ EDA_ITEM* LIB_TEXT::Clone() const
}
int LIB_TEXT::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
int LIB_TEXT::compare( const LIB_ITEM& aOther, int aCompareFlags ) const
{
wxASSERT( aOther.Type() == LIB_TEXT_T );
+1 -2
View File
@@ -117,8 +117,7 @@ private:
* - Text width.
* - Text height.
*/
int compare( const LIB_ITEM& aOther,
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const override;
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
const TRANSFORM& aTransform ) override;
+5 -2
View File
@@ -62,17 +62,20 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
if( !openRecentMenu )
{
openRecentMenu = new ACTION_MENU( false, selTool );
openRecentMenu->SetTitle( _( "Open Recent" ) );
openRecentMenu->SetIcon( BITMAPS::recent );
fileHistory.UseMenu( openRecentMenu );
fileHistory.AddFilesToMenu( openRecentMenu );
}
// Ensure the title is up to date after changing language
openRecentMenu->SetTitle( _( "Open Recent" ) );
fileHistory.UpdateClearText( openRecentMenu, _( "Clear Recent Files" ) );
fileMenu->Add( ACTIONS::doNew );
fileMenu->Add( ACTIONS::open );
wxMenuItem* item = fileMenu->Add( openRecentMenu );
wxMenuItem* item = fileMenu->Add( openRecentMenu->Clone() );
// Add the file menu condition here since it needs the item ID for the submenu
ACTION_CONDITIONS cond;
@@ -209,12 +209,12 @@ wxString NETLIST_EXPORTER_PSPICE::GetSpiceFieldDefVal( SPICE_FIELD aField, SCH_S
wxString value = aSymbol->GetField( VALUE_FIELD )->GetShownText();
// Is it a passive component?
if( aCtl & NET_ADJUST_PASSIVE_VALS && ( prim == 'C' || prim == 'L' || prim == 'R' ) )
if( ( aCtl & NET_ADJUST_PASSIVE_VALS ) && ( prim == 'C' || prim == 'L' || prim == 'R' ) )
{
// Regular expression to match common formats used for passive parts description
// (e.g. 100k, 2k3, 1 uF)
wxRegEx passiveVal(
"^([0-9\\. ]+)([fFpPnNuUmMkKgGtT]|M(e|E)(g|G))?([fFhH]|ohm)?([-1-9 ]*)$" );
wxT( "^([0-9\\. ]+)([fFpPnNuUmMkKgGtTμµ𝛍𝜇𝝁 ]|M(e|E)(g|G))?([fFhHΩΩ𝛀𝛺𝝮]|ohm)?([-1-9 ]*)$" ) );
if( passiveVal.Matches( value ) )
{
@@ -105,7 +105,10 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibTree( const SCHLIB_FILTER* aFilte
Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
Pgm().GetSettingsManager().GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> adapter = SYMBOL_TREE_MODEL_ADAPTER::Create( this, libs );
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> dataPtr
= SYMBOL_TREE_MODEL_ADAPTER::Create( this, libs );
SYMBOL_TREE_MODEL_ADAPTER* modelAdapter
= static_cast<SYMBOL_TREE_MODEL_ADAPTER*>( dataPtr.get() );
bool loaded = false;
if( aFilter )
@@ -117,14 +120,14 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibTree( const SCHLIB_FILTER* aFilte
if( libs->HasLibrary( liblist[ii], true ) )
{
loaded = true;
static_cast<SYMBOL_TREE_MODEL_ADAPTER*>( adapter.get() )->AddLibrary( liblist[ii] );
modelAdapter->AddLibrary( liblist[ii] );
}
}
adapter->AssignIntrinsicRanks();
modelAdapter->AssignIntrinsicRanks();
if( aFilter->GetFilterPowerSymbols() )
adapter->SetFilter( SYMBOL_TREE_MODEL_ADAPTER::SYM_FILTER_POWER );
modelAdapter->SetFilter( SYMBOL_TREE_MODEL_ADAPTER::SYM_FILTER_POWER );
}
std::vector< LIB_TREE_ITEM* > history_list;
@@ -138,29 +141,34 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibTree( const SCHLIB_FILTER* aFilte
history_list.push_back( symbol );
}
adapter->DoAddLibrary( wxT( "-- " ) + _( "Recently Used" ) + " --", wxEmptyString, history_list,
true );
modelAdapter->DoAddLibrary( wxT( "-- " ) + _( "Recently Used" ) + wxT( " --" ), wxEmptyString,
history_list, true );
if( !aHistoryList.empty() )
adapter->SetPreselectNode( aHistoryList[0].LibId, aHistoryList[0].Unit );
modelAdapter->SetPreselectNode( aHistoryList[0].LibId, aHistoryList[0].Unit );
const std::vector< wxString > libNicknames = libs->GetLogicalLibs();
if( !loaded )
static_cast<SYMBOL_TREE_MODEL_ADAPTER*>( adapter.get() )->AddLibraries( libNicknames,
this );
{
if( !modelAdapter->AddLibraries( libNicknames, this ) )
{
// loading cancelled by user
return PICKED_SYMBOL();
}
}
if( aHighlight && aHighlight->IsValid() )
adapter->SetPreselectNode( *aHighlight, /* aUnit */ 0 );
modelAdapter->SetPreselectNode( *aHighlight, /* aUnit */ 0 );
wxString dialogTitle;
if( adapter->GetFilter() == SYMBOL_TREE_MODEL_ADAPTER::SYM_FILTER_POWER )
dialogTitle.Printf( _( "Choose Power Symbol (%d items loaded)" ), adapter->GetItemCount() );
if( modelAdapter->GetFilter() == SYMBOL_TREE_MODEL_ADAPTER::SYM_FILTER_POWER )
dialogTitle.Printf( _( "Choose Power Symbol (%d items loaded)" ), dataPtr->GetItemCount() );
else
dialogTitle.Printf( _( "Choose Symbol (%d items loaded)" ), adapter->GetItemCount() );
dialogTitle.Printf( _( "Choose Symbol (%d items loaded)" ), dataPtr->GetItemCount() );
DIALOG_CHOOSE_SYMBOL dlg( this, dialogTitle, adapter, aConvert, aAllowFields, aShowFootprints,
DIALOG_CHOOSE_SYMBOL dlg( this, dialogTitle, dataPtr, aConvert, aAllowFields, aShowFootprints,
aUseLibBrowser );
if( dlg.ShowModal() == wxID_CANCEL )
+11 -13
View File
@@ -25,9 +25,8 @@
#include "pin_numbers.h"
#include <wx/crt.h>
namespace {
wxString GetNextSymbol( const wxString& str, wxString::size_type& cursor )
wxString PIN_NUMBERS::getNextSymbol( const wxString& str, wxString::size_type& cursor )
{
if( str.size() <= cursor )
return wxEmptyString;
@@ -36,14 +35,15 @@ wxString GetNextSymbol( const wxString& str, wxString::size_type& cursor )
wxChar c = str[cursor];
if( wxIsdigit( c ) || c == '+' || c == '-' )
// Need to check that there is a digit in the string before we parse it as a numeric
if( ( wxIsdigit( c ) || ( ( c == '+' || c == '-' ) && ( cursor < str.size() - 1 ) && wxIsdigit( str[cursor + 1] ) ) ) )
{
// number, possibly with sign
while( ++cursor < str.size() )
{
c = str[cursor];
if( wxIsdigit( c ) || c == 'v' || c == 'V' )
if( wxIsdigit( c ) || c == 'v' || c == 'V' || c == '.' )
continue;
else
break;
@@ -65,8 +65,6 @@ wxString GetNextSymbol( const wxString& str, wxString::size_type& cursor )
return str.substr( begin, cursor - begin );
}
}
wxString PIN_NUMBERS::GetSummary() const
{
@@ -117,8 +115,8 @@ int PIN_NUMBERS::Compare( const wxString& lhs, const wxString& rhs )
for( ; ; )
{
symbol1 = GetNextSymbol( lhs, cursor1 );
symbol2 = GetNextSymbol( rhs, cursor2 );
symbol1 = getNextSymbol( lhs, cursor1 );
symbol2 = getNextSymbol( rhs, cursor2 );
if( symbol1.empty() && symbol2.empty() )
return 0;
@@ -129,12 +127,12 @@ int PIN_NUMBERS::Compare( const wxString& lhs, const wxString& rhs )
if( symbol2.empty() )
return 2;
wxChar c1 = symbol1[0];
wxChar c2 = symbol2[0];
bool sym1_isnumeric = symbol1.find_first_of( "0123456789" ) != wxString::npos;
bool sym2_isnumeric = symbol2.find_first_of( "0123456789" ) != wxString::npos;
if( wxIsdigit( c1 ) || c1 == '-' || c1 == '+' )
if( sym1_isnumeric )
{
if( wxIsdigit( c2 ) || c2 == '-' || c2 == '+' )
if( sym2_isnumeric )
{
// numeric comparison
wxString::size_type v1 = symbol1.find_first_of( wxT( "vV" ) );
@@ -173,7 +171,7 @@ int PIN_NUMBERS::Compare( const wxString& lhs, const wxString& rhs )
}
else
{
if( wxIsdigit( c2 ) || c2 == '-' || c2 == '+' )
if( sym2_isnumeric )
return 2;
int res = symbol1.Cmp( symbol2 );
+2
View File
@@ -47,6 +47,8 @@ private:
typedef std::set<wxString, less> container_type;
static wxString getNextSymbol( const wxString& str, wxString::size_type& cursor );
public:
typedef container_type::value_type value_type;
typedef container_type::iterator iterator;
+29 -8
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2021 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2022 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -26,6 +26,7 @@
#include <core/arraydim.h>
#include <lib_pin.h>
#include <pin_type.h>
#include "pgm_base.h"
// These are true singletons so it's OK for them to be globals.
@@ -46,8 +47,8 @@ struct pinTypeStruct
BITMAPS bitmap;
};
// clang-format off
const std::map<ELECTRICAL_PINTYPE, struct pinTypeStruct> pinTypes = {
std::map<ELECTRICAL_PINTYPE, struct pinTypeStruct> g_pinTypes = {
{ ELECTRICAL_PINTYPE::PT_INPUT, { _( "Input" ), BITMAPS::pintype_input } },
{ ELECTRICAL_PINTYPE::PT_OUTPUT, { _( "Output" ), BITMAPS::pintype_output } },
{ ELECTRICAL_PINTYPE::PT_BIDI, { _( "Bidirectional" ), BITMAPS::pintype_bidi } },
@@ -61,7 +62,9 @@ const std::map<ELECTRICAL_PINTYPE, struct pinTypeStruct> pinTypes = {
{ ELECTRICAL_PINTYPE::PT_OPENEMITTER, { _( "Open emitter" ), BITMAPS::pintype_openemit } },
{ ELECTRICAL_PINTYPE::PT_NC, { _( "Unconnected" ), BITMAPS::pintype_noconnect } },
};
// clang-format on
int g_pinTypesLanguage = wxLANGUAGE_UNKNOWN;
struct pinShapeStruct
@@ -236,9 +239,27 @@ const std::vector<BITMAPS>& PinOrientationIcons()
wxString ElectricalPinTypeGetText( ELECTRICAL_PINTYPE aType )
{
auto findIt = pinTypes.find( aType );
if( g_pinTypesLanguage != Pgm().GetSelectedLanguageIdentifier() )
{
g_pinTypes[ELECTRICAL_PINTYPE::PT_INPUT].name = _( "Input" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OUTPUT].name = _( "Output" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_BIDI].name = _( "Bidirectional" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_TRISTATE].name = _( "Tri-state" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_PASSIVE].name = _( "Passive" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_NIC].name = _( "Free" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_UNSPECIFIED].name = _( "Unspecified" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_POWER_IN].name = _( "Power input" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_POWER_OUT].name = _( "Power output" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OPENCOLLECTOR].name = _( "Open collector" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_OPENEMITTER].name = _( "Open emitter" );
g_pinTypes[ELECTRICAL_PINTYPE::PT_NC].name = _( "Unconnected" );
wxCHECK_MSG( findIt != pinTypes.end(), wxT( "???" ), "Could not find pin type in lookup map" );
g_pinTypesLanguage = Pgm().GetSelectedLanguageIdentifier();
}
auto findIt = g_pinTypes.find( aType );
wxCHECK_MSG( findIt != g_pinTypes.end(), wxT( "???" ), wxT( "Pin type not found!" ) );
return findIt->second.name;
}
@@ -246,9 +267,9 @@ wxString ElectricalPinTypeGetText( ELECTRICAL_PINTYPE aType )
BITMAPS ElectricalPinTypeGetBitmap( ELECTRICAL_PINTYPE aType )
{
auto findIt = pinTypes.find( aType );
auto findIt = g_pinTypes.find( aType );
wxCHECK_MSG( findIt != pinTypes.end(), BITMAPS::INVALID_BITMAP,
wxCHECK_MSG( findIt != g_pinTypes.end(), BITMAPS::INVALID_BITMAP,
wxT( "Could not find pin type in lookup map" ) );
return findIt->second.bitmap;
+12 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Chris Pavlina <pavlina.chris@gmail.com>
* Copyright (C) 2015-2021 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2015-2022 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -89,7 +89,6 @@ static void getSymbols( SCHEMATIC* aSchematic, std::vector<SCH_SYMBOL*>& aSymbol
static LIB_SYMBOL* findSymbol( const wxString& aName, SYMBOL_LIBS* aLibs, bool aCached )
{
LIB_SYMBOL *symbol = nullptr;
// wxString new_name = LIB_ID::FixIllegalChars( aName, false );
for( SYMBOL_LIB& each_lib : *aLibs )
{
@@ -101,6 +100,17 @@ 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;
}
+2 -2
View File
@@ -412,7 +412,7 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector<MSG_PANEL_ITEM>& aList )
// CONNECTION_GRAPH entirely in the future, as they are mostly only useful for netlist exports.
#if 0
if( !IsBus() )
aList.emplace_back( _( "Net CodewxT( " ), wxString::Format( " )%d", m_net_code ) );
aList.emplace_back( _( "Net Code" ), wxString::Format( "%d", m_net_code ) );
#endif
if( auto alias = m_graph->GetBusAlias( m_name ) )
@@ -474,7 +474,7 @@ bool SCH_CONNECTION::MightBeBusLabel( const wxString& aLabel )
// Weak heuristic for performance reasons. Stronger test will be used for connectivity
wxString label = UnescapeString( aLabel );
return label.Contains( wxT( "[wxT( " ) ) || label.Contains( wxT( " ){" ) );
return label.Contains( wxT( "[" ) ) || label.Contains( wxT( "{" ) );
}
+2
View File
@@ -1502,6 +1502,8 @@ void SCH_EDIT_FRAME::ShowChangedLanguage()
// status bar
UpdateMsgPanel();
UpdateTitle();
// This ugly hack is to fix an option(left) toolbar update bug that seems to only affect
// windows. See https://bugs.launchpad.net/kicad/+bug/1816492. For some reason, calling
// wxWindow::Refresh() does not resolve the issue. Only a resize event seems to force the
+11 -2
View File
@@ -140,7 +140,7 @@ SCH_CONNECTION* SCH_ITEM::Connection( const SCH_SHEET_PATH* aSheet ) const
if( !IsConnectable() )
return nullptr;
wxASSERT_MSG( !IsConnectivityDirty(),
wxCHECK_MSG( !IsConnectivityDirty(), nullptr,
wxT( "Shouldn't be asking for connection if connectivity is dirty!" ) );
if( !aSheet )
@@ -182,7 +182,13 @@ SCH_ITEM_SET& SCH_ITEM::ConnectedItems( const SCH_SHEET_PATH& aSheet )
void SCH_ITEM::AddConnectionTo( const SCH_SHEET_PATH& aSheet, SCH_ITEM* aItem )
{
m_connected_items[ aSheet ].insert( aItem );
SCH_ITEM_SET& set = m_connected_items[ aSheet ];
// The vector elements are small, so reserve 1k at a time to prevent re-allocations
if( set.size() == set.capacity() )
set.reserve( set.size() + 4096 );
set.emplace_back( aItem );
}
@@ -212,6 +218,9 @@ SCH_CONNECTION* SCH_ITEM::InitializeConnection( const SCH_SHEET_PATH& aSheet,
SCH_CONNECTION* SCH_ITEM::GetOrInitConnection( const SCH_SHEET_PATH& aSheet,
CONNECTION_GRAPH* aGraph )
{
if( !IsConnectable() )
return nullptr;
SetConnectivityDirty( false );
SCH_CONNECTION* connection = Connection( &aSheet );
+2 -2
View File
@@ -26,7 +26,7 @@
#define SCH_ITEM_H
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <eda_item.h>
#include <plotters/plotter.h> // for PLOT_DASH_TYPE definition
@@ -131,7 +131,7 @@ private:
};
typedef std::unordered_set<SCH_ITEM*> SCH_ITEM_SET;
typedef std::vector<SCH_ITEM*> SCH_ITEM_SET;
/**
+4 -2
View File
@@ -447,10 +447,12 @@ void SCH_LINE::MirrorHorizontally( int aCenter )
void SCH_LINE::Rotate( const wxPoint& aCenter )
{
// When we allow off grid items, the
// else if should become a plain if to allow
// rotation around the center of the line
if( m_flags & STARTPOINT )
RotatePoint( &m_start, aCenter, 900 );
if( m_flags & ENDPOINT )
else if( m_flags & ENDPOINT )
RotatePoint( &m_end, aCenter, 900 );
}
+4 -4
View File
@@ -1013,10 +1013,10 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
c = getRenderColor( aPin, LAYER_HIDDEN, drawingShadows );
}
float insideOffset = textOffset - thickness[INSIDE] / 2.0;
float outsideOffset = 2 * Mils2iu( PIN_TEXT_MARGIN ) - thickness[OUTSIDE] / 2.0;
float aboveOffset = Mils2iu( PIN_TEXT_MARGIN ) + ( thickness[ABOVE] + penWidth ) / 2.0;
float belowOffset = Mils2iu( PIN_TEXT_MARGIN ) + ( thickness[BELOW] + penWidth ) / 2.0;
float insideOffset = textOffset - thickness[INSIDE] / 2.0;
float outsideOffset = Mils2iu( PIN_TEXT_MARGIN ) + TARGET_PIN_RADIUS - thickness[OUTSIDE] / 2.0;
float aboveOffset = Mils2iu( PIN_TEXT_MARGIN ) + penWidth / 2.0 + thickness[ABOVE] / 2.0;
float belowOffset = Mils2iu( PIN_TEXT_MARGIN ) + penWidth / 2.0 + thickness[BELOW] / 2.0;
if( isDangling )
outsideOffset += TARGET_PIN_RADIUS / 2.0;
@@ -1308,6 +1308,13 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
SYMDEF_SCM symbol = Library.SymbolDefinitions.at( aSymdefID );
int gateNumber = getKiCadUnitNumberFromGate( aGateID );
// Ensure there are no items on this unit (e.g. if we already previously loaded the symbol from
// the part definition)
std::vector<LIB_ITEM*> drawItems = aSymbol->GetUnitDrawItems( gateNumber, 0 );
for( LIB_ITEM* item : drawItems )
aSymbol->RemoveDrawItem( item );
for( std::pair<FIGURE_ID, FIGURE> figPair : symbol.Figures )
{
FIGURE fig = figPair.second;
@@ -1352,11 +1352,20 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
// with a hash character to mute netlist updater complaints
wxString reference = package.IsEmpty() ? '#' + einstance.part : einstance.part;
// reference must end with a number but EAGLE does not enforce this
if( reference.find_last_not_of( "0123456789" ) == (reference.Length()-1) )
reference.Append( "0" );
// EAGLE allows references to be single digits. This breaks KiCad netlisting, which requires
// parts to have non-digit + digit annotation. If the reference begins with a number,
// we prepend 'UNK' (unknown) for the symbol designator
if( reference.find_first_not_of( wxT( "0123456789" ) ) == wxString::npos )
reference.Prepend( wxT( "UNK" ) );
if( reference.find_first_not_of( "0123456789" ) != 0 )
reference.Prepend( "UNK" );
// EAGLE allows designator to start with # but that is used in KiCad
// for symbols which do not have a footprint
if( einstance.part.find_first_not_of( "#" ) != 0 )
reference.Prepend( "UNK" );
SCH_SHEET_PATH sheetpath;
m_rootSheet->LocatePathOfScreen( screen, &sheetpath );
@@ -1013,15 +1013,15 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
}
}
arc->SetStart( startPoint );
arc->SetEnd( endPoint );
if( hasMidPoint )
{
arc->SetCenter( (wxPoint) CalcArcCenter( arc->GetStart(), midPoint, arc->GetEnd() ) );
arc->SetArcGeometry( startPoint, midPoint, endPoint);
}
else if( hasAngles )
{
arc->SetStart( startPoint );
arc->SetEnd( endPoint );
/**
* This accounts for an oddity in the old library format, where the symbol is overdefined.
* The previous draw (based on wxwidgets) used start point and end point and always drew
@@ -1035,6 +1035,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
arc->SetStart( arc->GetEnd() );
arc->SetEnd( temp );
}
arc->SetCenter( center );
}
else
@@ -1568,15 +1569,15 @@ void SCH_SEXPR_PARSER::parsePAGE_INFO( PAGE_INFO& aPageInfo )
// Perform some controls to avoid crashes if the size is edited by hands
if( width < MIN_PAGE_SIZE_MILS )
width = MIN_PAGE_SIZE_MILS;
else if( width > MAX_PAGE_SIZE_MILS )
width = MAX_PAGE_SIZE_MILS;
else if( width > MAX_PAGE_SIZE_EESCHEMA_MILS )
width = MAX_PAGE_SIZE_EESCHEMA_MILS;
int height = Mm2mils( parseDouble( "height" ) ); // height stored in mm so we convert to mils
if( height < MIN_PAGE_SIZE_MILS )
height = MIN_PAGE_SIZE_MILS;
else if( height > MAX_PAGE_SIZE_MILS )
height = MAX_PAGE_SIZE_MILS;
else if( height > MAX_PAGE_SIZE_EESCHEMA_MILS )
height = MAX_PAGE_SIZE_EESCHEMA_MILS;
aPageInfo.SetWidthMils( width );
aPageInfo.SetHeightMils( height );
@@ -1090,14 +1090,11 @@ void SCH_SEXPR_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol, SCH_SHEET_PATH* aSheetPa
m_out->Print( 0, ")" );
}
int unit = -1;
int unit = ( aSymbol->GetInstanceReferences().size() == 0 ) ?
aSymbol->GetUnit() :
aSymbol->GetInstanceReferences()[0].m_Unit;
if( !( aSymbol->GetInstanceReferences().size() > 1 ) )
unit = aSymbol->GetUnit();
else if( aSheetPath != nullptr )
unit = aSymbol->GetUnitSelection( aSheetPath );
if ( unit >= 0 )
m_out->Print( 0, " (unit %d)", unit );
m_out->Print( 0, " (unit %d)", unit );
if( aSymbol->GetConvert() == LIB_ITEM::LIB_CONVERT::DEMORGAN )
m_out->Print( 0, " (convert %d)", aSymbol->GetConvert() );
@@ -1118,10 +1115,49 @@ void SCH_SEXPR_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol, SCH_SHEET_PATH* aSheetPa
for( SCH_FIELD& field : aSymbol->GetFields() )
{
saveField( &field, aNestLevel + 1 );
int id = field.GetId();
wxString value = field.GetText();
// The instance fields are always set to the first sheet instance of the project to
// schematic file changes when switching sheet instances with the current project
// schematic. It does not solve the problem for schematics shared between projects.
if( id == REFERENCE_FIELD )
{
field.SetText( ( aSymbol->GetInstanceReferences().size() == 0 ) ?
value :
aSymbol->GetInstanceReferences()[0].m_Reference );
}
else if( id == VALUE_FIELD )
{
field.SetText( ( aSymbol->GetInstanceReferences().size() == 0 ) ?
value :
aSymbol->GetInstanceReferences()[0].m_Value );
}
else if( id == FOOTPRINT_FIELD )
{
field.SetText( ( aSymbol->GetInstanceReferences().size() == 0 ) ?
value :
aSymbol->GetInstanceReferences()[0].m_Footprint );
}
try
{
saveField( &field, aNestLevel + 1 );
}
catch( ... )
{
// Restore the changed field text on write error.
if( id == REFERENCE_FIELD || id == VALUE_FIELD || id == FOOTPRINT_FIELD )
field.SetText( value );
throw;
}
if( id == REFERENCE_FIELD || id == VALUE_FIELD || id == FOOTPRINT_FIELD )
field.SetText( value );
}
for( const SCH_PIN* pin : aSymbol->GetPins() )
for( const std::unique_ptr<SCH_PIN>& pin : aSymbol->GetRawPins() )
{
if( pin->GetAlt().IsEmpty() )
{

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