Compare commits

...

125 Commits

Author SHA1 Message Date
Wayne Stambaugh 0a9271f98e Tag release version 6.0.2. 2022-01-11 21:18:26 -05:00
prometheus 3c91b0c693 Translated using Weblate (Turkish)
Currently translated at 10.2% (737 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/tr/
2022-01-12 01:42:50 +01:00
Arnau Llovet Vidal 562bd7d564 Translated using Weblate (Catalan)
Currently translated at 46.6% (3353 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ca/
2022-01-12 01:42:49 +01:00
Seth Hillbrand ad726dc6e4 Rework cd8d6ba0 for 6.0.1
Addresses https://gitlab.com/kicad/code/kicad/-/issues/10357 as well as
a few additional rounding points in 3d viewer based on master commit
2022-01-11 13:49:57 -08:00
Roberto Fernandez Bautista b2ecf097ed Include Footprints within Groups when re annotating duplicates
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10329

(cherry picked from commit de7158b80e)
2022-01-11 20:52:01 +00:00
Seth Hillbrand 8dca61ce9c Fix copy-paste error 2022-01-11 06:08:15 -08:00
Steven A. Falco e8e25fd732 Launchers must specify WM_CLASS
On some Linux desktops, we get extra icons in the application dock.
This happens because the dock doesn't know the "class" of the
application.  We need to add StartupWMClass=xxx lines, where xxx is
the name associated with the application.

This patch addresses the following issue:

https://gitlab.com/kicad/packaging/kicad-ubuntu-builder/kicad-daily-package/-/issues/30

While it was written against Ubuntu, it also affects Fedora, and
probably other Linux systems too.
2022-01-11 01:25:16 +00:00
Seth Hillbrand bd7841bf96 Handle arcs in global track width changes
Also add defensive code against invalid indices

Fixes https://gitlab.com/kicad/code/kicad/issues/10325
2022-01-10 17:19:49 -08:00
Seth Hillbrand 55020c2b89 Better fix for missing end segment
Rather than skipping our endEdit() call in libedit, we need to
parameterize whether we want the shape open/closed.  Closed will remove
the last segment if it lands on the first point.  We don't want that
but we do want to remove the last point if it duplicates the second to
last (in the case of double-clicking)

Fixes https://gitlab.com/kicad/code/kicad/issues/10334
2022-01-10 13:37:47 -08:00
Seth Hillbrand a74d1d9962 Keep ratsnest setting when pasting
Paste items should copy the global ratsnest visibility setting

Fixes https://gitlab.com/kicad/code/kicad/issues/10346
2022-01-10 12:48:03 -08:00
Seth Hillbrand 4d899d7820 Remove default hotkey for toggle zone display
It is too easy to accidentally hide your zones and the 'A' hotkey is
intuitively mapped to Add Footprint, to match Add Symbol in eeschema.

This won't change current hotkey customizations but will help prevent
future user error.  Users can still map the action to a hotkey if the
new toggle is useful to their workflow
2022-01-10 11:48:26 -08:00
Seth Hillbrand 4907b90215 Fix FP circle validity check
Radius is encoded by m_endX

Fixes https://gitlab.com/kicad/code/kicad/issues/10337
2022-01-10 10:54:23 -08:00
Jan Straka a399f799ad Translated using Weblate (Czech)
Currently translated at 90.5% (6507 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-01-10 18:58:11 +01:00
Jan Straka 55cd2da432 Translated using Weblate (Czech)
Currently translated at 89.5% (6432 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-01-10 18:58:11 +01:00
obit 096600ffc4 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-01-10 18:58:11 +01:00
Axel Henriksson b4bae29c02 Translated using Weblate (Swedish)
Currently translated at 98.3% (7066 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/sv/
2022-01-10 18:58:11 +01:00
Mark Hämmerling e4a5ce78aa 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-01-10 18:58:11 +01:00
Mark Hämmerling 522738284d 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-01-10 18:58:11 +01:00
pondahai cc0d5ec46a Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/zh_Hant/
2022-01-10 18:58:11 +01:00
Tian Yunhao f2018a09d8 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-01-10 18:58:11 +01:00
김랑기 54952ca97e 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-01-10 18:58:10 +01:00
Tokita, Hiroshi a8543b1122 Translated using Weblate (Japanese)
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/ja/
2022-01-10 18:58:10 +01:00
Tian Yunhao 790ca19445 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-01-10 18:58:10 +01:00
Wellington Terumi Uemura f56b3bdd07 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt_BR/
2022-01-10 18:58:10 +01:00
Rafael Silva 7d635d3d43 Translated using Weblate (Portuguese)
Currently translated at 100.0% (7186 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/pt/
2022-01-10 18:58:10 +01:00
Jose Perez 37f62e539b Translated using Weblate (Spanish)
Currently translated at 99.9% (7185 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/es/
2022-01-10 18:58:10 +01:00
Jan Straka 3196f4adb6 Translated using Weblate (Czech)
Currently translated at 88.9% (6395 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/cs/
2022-01-10 18:58:10 +01:00
Gökhan Koçmarlı b4d67b6b29 Translated using Weblate (Turkish)
Currently translated at 9.9% (712 of 7186 strings)

Translation: KiCad EDA/v6
Translate-URL: https://hosted.weblate.org/projects/kicad/v6/tr/
2022-01-10 18:58:10 +01:00
Eric f7d790598b 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-01-10 18:58:10 +01:00
Wayne Stambaugh bbf00e0461 Pcbnew: honor footprint exclude from BOM setting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10297

(cherry picked from commit f379c49084)
2022-01-09 11:30:06 -05:00
Mikolaj Wielgus a91f807e13 Update contributor name 2022-01-09 09:29:54 +01:00
Seth Hillbrand 100cf757fe Force Mesa to use its own call
Mesa does not support adaptive swapping but will sometimes report that
it does.  This prevents Mesa drivers from testing (and segfaulting) the
limits of their call

Fixes https://gitlab.com/kicad/code/kicad/issues/10069
2022-01-08 17:13:25 -08:00
Jon Evans 76f21d950d Ensure LIB_TREE cleans up while frame still exists
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10266
2022-01-08 17:32:17 -05:00
Seth Hillbrand 69469b254a Printing multiple bitmaps
A long-standing issue with multiple workarounds
(https://gitlab.com/kicad/code/kicad/-/issues/1877) prevented eeschema
printouts with multiple images or images in both the worksheet and the
schematic.

We worked around this by ordering the bitmap printing to be the first
step in the printing process.  This partially worked but didn't get
everything correct.  The primary difficulty in debugging this was that
the wxPrintPreview that we generate looked correct.  Only the actual
printout was incorrect.

The fix is to explicitly clip bitmap drawing to the bitmap area,
regardless of how large the bitmap is.
2022-01-07 17:15:59 -08:00
Seth Hillbrand bfca928900 Plot pads in layer color
v6 pads are not allowed to be a different color from the rest of the
copper layer, so don't query the GAL layer for a color

Fixes https://gitlab.com/kicad/code/kicad/issues/10293
2022-01-07 08:55:59 -08:00
Seth Hillbrand 62f8603353 Don't deduplicate symbol polygons
SHAPE_LINE_CHAIN will, by default, remove duplicate points when
appending.  We don't want to do this when constructing our polygons in
symbol editor, so we need to explicitly call the routine without
deduplication

Fixes https://gitlab.com/kicad/code/kicad/issues/10289
2022-01-07 08:25:09 -08:00
Seth Hillbrand 9a2332dfcf Clear edited point when exiting tool
When leaving the main point editor loop, we need to ensure that the edit
point is cleared as well.  This is usually cleared by a ClearEvent call
but in case this is missed, we need to ensure that other tools are not
caught out

Fixes https://gitlab.com/kicad/code/kicad/issues/10288
2022-01-07 08:23:31 -08:00
qu1ck 4bcfa8df1f Template for vector<VECTOR2I> in swig 2022-01-06 23:48:52 -05:00
Seth Hillbrand a0e424c2ac Forgot to build ninja files 2022-01-06 20:09:44 -08:00
Seth Hillbrand f4b9a92b94 Swap make for ninja in Fedora CI
Take advantage of extra cores on hetzner machine
2022-01-06 20:09:44 -08:00
Seth Hillbrand 184a592f82 Use KiCad builders for Fedora 2022-01-06 20:09:44 -08:00
Seth Hillbrand 3e6bf7814b Safely sort view layers
Changing view order of only some layers can cause overwriting of the
original layer if not pre-staged

Fixes https://gitlab.com/kicad/code/kicad/issues/10283
2022-01-06 14:41:10 -08:00
Seth Hillbrand 9864337914 Do not call SafeYield on close
wxSafeYield() is not "safe".  Pending actions may include deletion of
the currently active class.  This will cause crashes when exiting.  If
needed for specific behaviors, we should use wxSafeYieldFor( flag ) with
the appropriate events specified rather than a general yield which can
cause more problems
2022-01-06 12:31:59 -08:00
Seth Hillbrand 78e737b9d8 DRC scripting: load project from board if possible
s_SettingsManager is not always initialized when the WriteDRCReport is
run.  We should first attempt to extract the project from the actual
board being checked.  Failing that, we fall back to the static settings manager and then exit if we don't have a project associated.

Fixes https://gitlab.com/kicad/code/kicad/issues/10221
2022-01-06 11:50:21 -08:00
Brian Mayton d014f0307b Add ORANGE to DXF output
Matches the schematic color options to DXF layers

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

Signed-off-by: Seth Hillbrand <seth@kipro-pcb.com>
2022-01-06 11:02:57 -08:00
Seth Hillbrand 7c9340f855 Fix swap interval checking
Checking for the existence of the call only validated that our header
defined the value, not that the video card/driver supported the call.
We query the extensions string directly to check for support.  This
should fix both the X11 and virtualization issues (potentially other
crashes with older video cards as well)

Fixes https://gitlab.com/kicad/code/kicad/issues/8944
2022-01-06 10:53:13 -08:00
jean-pierre charras 3069b198b1 PANEL_TEMPLATE_FIELDNAMES: fix incorrect management of boolean options
(it was impossible to disable them)
From Master branch.
Fixes https://gitlab.com/kicad/code/kicad/issues/10280
2022-01-06 19:44:23 +01:00
Seth Hillbrand 05d3dc533b Prevent cvpcb from losing text focus on filter
Refresh event changes focus (on GTK).  We fix this by storing the
existing insertion point in the text box, refocusing and restoring the
text position

Fixes https://gitlab.com/kicad/code/kicad/issues/10029
2022-01-06 09:16:34 -08:00
Marek Roszko 1e05732f55 Add std::hash specialization for VECTOR2I
(cherry picked from commit 589a03afcd)

Fixes https://gitlab.com/kicad/code/kicad/issues/10275
2022-01-05 20:32:46 -08:00
Seth Hillbrand 71e7b4b77b Use 'special' escaping for certain fields
Most fields are escaped using the `\` notation.  But the VALUE field and
the symbol name need to be escaped using braces notation.

Fixes https://gitlab.com/kicad/code/kicad/issues/10097
2022-01-05 17:18:39 -08:00
Seth Hillbrand b8a7a66a0a Keep symbol synced with edit tool
Undo/Redo can change the symbol referenced by the symbol drawing tool.
This updates the current symbol before important steps to keep the
system synced

Fixes https://gitlab.com/kicad/code/kicad/issues/10125
2022-01-05 16:51:41 -08:00
Seth Hillbrand 55087a9e82 Don't remove last point in libedit
SHAPE_LINE_CHAIN in libedit doesn't make a polygon, so we always need
the last point and it shouldn't be closed

Fixes https://gitlab.com/kicad/code/kicad/issues/9934
2022-01-05 16:02:50 -08:00
Seth Hillbrand 444801ada6 Prevent unneeded fallback
Starting in be8327bd54, we assume that all
exceptions in DoRePaint() are caused by OpenGL.  But many calls in
UpdateItems() will throw if there are internal errors such as
std::out_of_range.  Here, we catch those errors and simply skip ahead
rather than falling back to Cairo
2022-01-05 13:46:15 -08:00
Steffen Mauch 7afe188a29 eeschema: automatic generated symbol library from EAGLE plugin does not include footprint reference
Fixes https://gitlab.com/kicad/code/kicad/issues/10262

(cherry picked from commit 3ced3afa68)
2022-01-05 15:28:05 -05:00
Ian McInerney 1ad1cf8374 Fix compile error with UTF8 unicode wxWidgets build
Fixes https://gitlab.com/kicad/code/kicad/issues/10210

(Cherry-picked from bd828f598c)
2022-01-05 19:45:27 +00:00
Ian McInerney abaee94109 Revert caf406943e and don't install the kicad2step lib
This fixes https://gitlab.com/kicad/code/kicad/-/issues/9944 and reverts
caf406943e. The original fix caused issues
with some CMake versions because it tried to give library dependencies
to an object library, which can't have any library dependencies.
Instead, we need it as a static library, and since there is no need to
actually have it as an end-user library, it shouldn't be in the install
command.

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

(Cherry-picked from commit fb36e1b582)
2022-01-05 19:45:27 +00:00
Steffen Mauch d60e77176f eeschema: EAGLE plugin does not reference footprint with library suffix
Fixes https://gitlab.com/kicad/code/kicad/issues/10261

(cherry picked from commit 502e34349e)
2022-01-05 14:39:43 -05:00
Seth Hillbrand 7f1648934f Update pin cache when undoing
The pin cache is invalidated by swap, so we need to ensure that it is
reset when we undo a change to the pins in schematic editor

Fixes https://gitlab.com/kicad/code/kicad/issues/10272
2022-01-05 11:33:03 -08:00
Seth Hillbrand bef762e652 Don't strip extensions twice in BOM export
Exporting the Bill of Materials uses the netlist exporter.  Both of
these routines were stripping the extension, leading to projects like
"test.project.kicad_pro" having the project name stripped.  We separate
the BOM netlist export from generic plugin netlist export to allow the
correct behavior when exporting netlists and generating BOMs

Fixes https://gitlab.com/kicad/code/kicad/issues/10270
2022-01-05 11:07:23 -08:00
Seth Hillbrand a05ec04ee8 Set readable flags correctly on open
Missing files may be thrown during open.  These should have existence
and readable flags set correctly
2022-01-05 09:54:10 -08:00
Steffen Mauch 362eedc510 pcbnew: EAGLE plugin is case sensitive to >VALUE / >NAME
Fixes https://gitlab.com/kicad/code/kicad/issues/10253

(cherry picked from commit 82f147ecef)
2022-01-05 08:07:41 -05:00
Steffen Mauch 11402e2db1 pcbnew: fixing eagle_plugin with empty class names
Fixes #10229
https://gitlab.com/kicad/code/kicad/issues/10229

(cherry picked from commit a5307c6f59)
2022-01-05 07:22:01 -05:00
Seth Hillbrand b1658fdf9a Don't rename existing schematic file
We should never leave a situation where the schematic file may no longer
exist (if the first rename succeeds and the second fails).  So, make a
backup copy of the original schematic file and then attempt to rename
the autosave over the first file.  In this case, if either attempt
fails, we do not lose the original file

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/10219
2022-01-04 20:27:43 -08:00
Jon Evans f9d8ec6137 Handle footprint shapes in polygon creation
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10259
2022-01-04 21:31:22 -05:00
Jon Evans e9b91b6fab Fix creating polygons from footprint rule areas
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10257
2022-01-04 21:28:04 -05:00
Seth Hillbrand 873353d8d7 Prevent clipping by default
The text bbox inflation from fb4343bc clips dimensions by default.  This
restores the default size to not clip the dimension line.  It is still a
bit larger than I'd like it to be but is usable

Fixes https://gitlab.com/kicad/code/kicad/issues/10033
2022-01-04 12:11:23 -08:00
Seth Hillbrand a326d777f0 Don't split legacy paths
The '.' is a valid character in the legacy preferences, not a separator.
Also adds fail-safe catch for JSON throws

Fixes https://gitlab.com/kicad/code/kicad/issues/10211
2022-01-04 19:08:12 +00:00
Thomas Pointhuber dec310f7f8 altium: Fix board outline import with arcs using SHAPE_LINE_CHAIN instead of a hack 2022-01-04 19:57:26 +01:00
Seth Hillbrand ca8cf14dff Fix missing FOOTPRINT cast in swig
Fixes https://gitlab.com/kicad/code/kicad/issues/10236
2022-01-04 10:49:29 -08:00
Seth Hillbrand ed9a3deb57 Fix pad snapping in renumber pads
Snap shouldn't be looking for other items in this routine or using the
grid

Fixes https://gitlab.com/kicad/code/kicad/issues/10238
2022-01-03 17:18:03 -08:00
Wayne Stambaugh 58b07efd99 Make footprint and symbol editors use MRU path for new libraries.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10216

(cherry picked from commit ff38853886)
2022-01-03 18:36:46 -05:00
Seth Hillbrand 1874ad2f7e Catch errors from load()
Loading footprints may throw in some cases.  We need to catch these
nicely without breaking out of the full loading process

Fixes https://gitlab.com/kicad/code/kicad/issues/10213
2022-01-03 15:30:20 -08:00
Marco Ciampa b115aec42b Updated Italian translation 2022-01-03 12:02:20 +01:00
Roberto Fernandez Bautista 5e884d14c7 Rename ComparePageNumAndName -> ComparePageNum 2022-01-02 23:27:15 +00:00
Mike Williams e36381bdd2 Gerbview: Fix diff mode issues with OpenGL transparency
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10121
(cherry picked from commit 404659d275)
2022-01-02 18:18:00 -05:00
Jon Evans 45182febaf Exit router and invoke edit tool when attempting to drag an arc track
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10208
2022-01-02 16:10:26 -05:00
Jon Evans ea99c42df6 Move duplicate field handling into field parser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10130
2022-01-02 13:19:31 -05:00
Jon Evans 0065036899 Load local settings even when not setting project active
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10179
2022-01-02 12:40:25 -05:00
Jon Evans bb388d47fc Fix undo/redo sample action plugin for latest API
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10212
2022-01-02 12:26:27 -05:00
Jon Evans 134b09004b Fix highlighting color logic when net colors are active
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10157
2022-01-02 12:11:24 -05:00
Jon Evans c52421869a Fix saving of existing appearance presets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10166
2022-01-02 11:59:19 -05:00
Seth Hillbrand addc5574b4 Ensure merged line gets selected if either parent is
We were only checking for the selection of a single line that gets
merged.  This prevents the merged line from being highlighted but not
selected after merging

Fixes https://gitlab.com/kicad/code/kicad/issues/10202
2022-01-01 16:53:31 -08:00
Seth Hillbrand bd75cffff3 Prevent ops on empty selection
Fixes https://gitlab.com/kicad/code/kicad/issues/10164
2022-01-01 15:28:47 -08:00
Marco Ciampa 3453bf3f88 Updated Italian translation 2022-01-01 22:06:16 +01:00
Marek Roszko f139cc2d9f Add kicad_3dsg copy for qa_pcbnew to run out of build dir
Mirror of the pcbnew step for the same reason


(cherry picked from commit b85fb9137f)
2022-01-01 19:54:30 +00:00
Marek Roszko 6fd93eaa1e Silence MSVC warnings about type mismatch and unused var
(cherry picked from commit 34e90e5045)
2022-01-01 19:50:11 +00:00
Roberto Fernandez Bautista cf8c614a02 Use virtual page number when real page numbers are blank
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10158

(cherry picked from commit a0d708e04d)
2022-01-01 18:39:49 +00:00
Marco Ciampa 9fd1ad9b7b Updated Italian translation 2022-01-01 17:10:10 +01:00
jean-pierre charras d45472adcd French translation update 2021-12-31 13:23:17 +01:00
jean-pierre charras f67c0ea8c7 fix missing line breaks and non printable html char on Windows 2021-12-31 13:21:43 +01:00
jean-pierre charras 3c2bb97eae PANEL_PREVIEW_3D_MODEL: fix incorrect values of offset for unit inch and mil.
From master commit 49cb9586
2021-12-31 10:05:56 +01:00
Marek Roszko cbdfb5d396 Remove the unused updateui in the selection filter base
(cherry picked from commit e75d283007)
2021-12-30 17:18:38 +00:00
Roberto Fernandez Bautista e19acb4632 Correctly handle excluding an ERC marker in eeschema when right clicking
In addition, hide the option to exclude a marker if the selected marker
is already excluded.

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

(cherry picked from commit 701e256b3f)
2021-12-30 17:16:04 +00:00
Erwan Rouault 11c967b259 pcbnew: Add via height support in drc length
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10135
2021-12-30 14:34:44 +00:00
Jon Evans 517e44e917 3D viewer: Disable copper thickness in OpenGL mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10153
2021-12-30 09:20:09 -05:00
Jon Evans 0ec440805d Tune connectivity progress reporter
We don't need quite as many updates, this helps speed a little

See https://gitlab.com/kicad/code/kicad/-/issues/10154
2021-12-30 09:16:19 -05:00
Marek Roszko 67fe8904c0 Add win32 VERSION_INFO resource blocks for the DLLs
(cherry picked from commit 3f711b8958)
2021-12-29 04:56:26 +00:00
Marek Roszko da850036e3 Append product version to task manager titlebar (effectively)
(cherry picked from commit 426f6dd485)
2021-12-29 01:27:40 +00:00
Mike Williams b80595903c Eeschema: draw dangling end shadows
(cherry picked from commit bf2c4c1584)
2021-12-28 16:10:40 -08:00
Steven A. Falco c83880428c Add python 3.11 support
(Cherry-picked from commit 40589d2c33)
2021-12-28 14:53:31 +00:00
Jacob Mealey cc84344499 fix in pcbnew/python/swig/units.i ... added error handling
Added error handling in unit conversions for the pcbnew python bindings.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10081
2021-12-28 07:21:35 +00:00
Marek Roszko 32be48222a Fix parent of schematic setup parent nodes
(cherry picked from commit 705aa64c24)
2021-12-28 01:16:18 +00:00
Marek Roszko b7ec594c0a Use the correct parent for the root node placeholders of board setup
(cherry picked from commit 38842647b8)
2021-12-28 01:16:05 +00:00
Wayne Stambaugh 2481b21d80 Don't treat project Save As path as a path and file name.
The single string ctor of wxFileName treats the string as a path and file
name.  If there is a dot in the last path name, it assumes that the last
path is actually a file name and extension.

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

(cherry picked from commit fcc497509a)
2021-12-26 17:04:45 -05:00
Marek Roszko ceb4d08ce9 Fix race condition with ShowEventCounters on Windows
(cherry picked from commit 3dd8c57bdd)
2021-12-26 13:33:18 +00:00
Steven A. Falco 6edc605cab Several scripting options are no longer valid
Remove invalid scripting options from the yml file.
2021-12-25 11:14:26 -05:00
Mikolaj Wielgus d913e6a8f7 Restore Translators-Other section in credits 2021-12-24 20:36:10 +01:00
jean-pierre charras bde0c3e879 DIALOG_TEMPLATE_SELECTOR: Force display refresh after selecting a path
For some reason the panel showing the templates did not show the new selection
Fixes #10106
From Master branch
2021-12-24 11:51:26 +01:00
jean-pierre charras b95032901e pcbnew print: minor fix: option edge.cut on all layers not stored. Fixes #10046 https://gitlab.com/kicad/code/kicad/issues/10046 2021-12-23 18:36:42 +01:00
jean-pierre charras 753e08a944 Use ChangeValue() instead of SetValue() in some wxTextCtrl (It avoids generating unused events) 2021-12-23 18:36:42 +01:00
jean-pierre charras ee1b327162 3D viewer: fix a minor cosmetic issue. Fixes #10002 https://gitlab.com/kicad/code/kicad/issues/10002 2021-12-23 18:36:24 +01:00
jean-pierre charras da5f2366f9 PANEL_SETUP_BOARD_STACKUP: fix a typo that prevent displaying a color swatch. Fixes #10027 https://gitlab.com/kicad/code/kicad/issues/10027 2021-12-23 18:36:24 +01:00
Jeff Young e7cc177d94 Allow a 0 pin-symbol-size.
This is particularly important when reading legacy projects as 0 is
what signals the painter to use the old algorithm (1/2 pin name/number
size).

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

(cherry picked from commit f089cf44a7)
2021-12-23 17:01:48 +00:00
Jeff Young 93c48b9d46 Hot-update units in track editing dialogs.
Fixes https://gitlab.com/kicad/code/kicad/issues/10099

(cherry picked from commit 4e8a7fc911)
2021-12-23 17:01:44 +00:00
Jeff Young 1b033d56a7 Improve clean up tracks & vias algorithm for neck-downs.
Fixes https://gitlab.com/kicad/code/kicad/issues/10098

(cherry picked from commit d5a5928e5a)
2021-12-23 17:01:39 +00:00
Jeff Young ad583eab13 Add hot-updating of units in common wxGrids.
Fixes https://gitlab.com/kicad/code/kicad/issues/10020

(cherry picked from commit 6e2460ad37)
2021-12-23 17:01:34 +00:00
Jeff Young 0d3246e3ab Don't commit zone refill if there were no changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/10085

(cherry picked from commit 77239591c0)
2021-12-23 17:01:31 +00:00
Jeff Young 76fd029cd6 Don't leave stranded symbols/footprints in editors when doc closes.
Fixes https://gitlab.com/kicad/code/kicad/issues/10026

(cherry picked from commit 9af33cdfe8)
2021-12-23 17:01:25 +00:00
Jeff Young 2efa878287 Use a bigger hammer to update adjacent segments.
Fixes https://gitlab.com/kicad/code/kicad/issues/9927

(cherry picked from commit ee5db73113)
2021-12-23 17:01:22 +00:00
Jeff Young 1dc78c4adc Tidy up pad & parent footprint selection corner cases.
Fixes https://gitlab.com/kicad/code/kicad/issues/9923

(cherry picked from commit d9dba2edb2)
2021-12-23 17:01:19 +00:00
Jeff Young 34d855cd53 Make sure undo/redo of pagesetup is done to correct sheet.
Fixes https://gitlab.com/kicad/code/kicad/issues/9999

(cherry picked from commit aa4dcb2bf1)
2021-12-23 17:01:15 +00:00
Jeff Young 9cb36e5bc5 Restore units to a bunch of wxGrids.
Fixes https://gitlab.com/kicad/code/kicad/issues/10063

(cherry picked from commit 8b52e969d6)
2021-12-23 17:01:10 +00:00
Jeff Young b6ff44cccf Fix failure to remove hover selection after rotate operation.
Fixes https://gitlab.com/kicad/code/kicad/issues/10058

(cherry picked from commit f696c4ddfc)
2021-12-23 17:01:06 +00:00
Jeff Young e9e742816d Scale markers somewhat proportionally to zoom.
Fixes https://gitlab.com/kicad/code/kicad/issues/10048

(cherry picked from commit a1c8e36c99)
2021-12-23 17:01:01 +00:00
Wayne Stambaugh b403930601 Begin version 6.0.1 development. 2021-12-22 08:44:30 -05:00
184 changed files with 3570 additions and 12562 deletions
+5 -2
View File
@@ -3,6 +3,9 @@
##########################################################################
fedora_build_linux:
stage: build
tags:
- kicad-fedora
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:34
extends: .only_code
interruptible: false
cache:
@@ -18,14 +21,14 @@ fedora_build_linux:
- mkdir -p build/linux
- cd build/linux
- cmake
-G Ninja
-DCMAKE_BUILD_TYPE=Debug
-DKICAD_STDLIB_LIGHT_DEBUG=ON
-DKICAD_USE_OCC=ON
-DKICAD_SPICE=ON
-DKICAD_BUILD_I18N=ON
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON
../../
- make 2>&1 | tee compilation_log.txt
- ninja 2>&1 | tee compilation_log.txt
- cd ../../
artifacts:
# Only save the artifacts that are needed for running the tests in the next stage
-5
View File
@@ -30,12 +30,7 @@ ubuntu20.04_build:
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=Debug
-DKICAD_STDLIB_LIGHT_DEBUG=ON
-DKICAD_SCRIPTING=ON
-DKICAD_SCRIPTING_MODULES=ON
-DKICAD_SCRIPTING_PYTHON3=ON
-DKICAD_SCRIPTING_WXPYTHON=ON
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
-DKICAD_SCRIPTING_ACTION_MENU=ON
-DKICAD_USE_OCC=ON
-DKICAD_SPICE=ON
-DKICAD_BUILD_I18N=ON
-5
View File
@@ -18,12 +18,7 @@ win64_build:
-G "Ninja" `
-DCMAKE_TOOLCHAIN_FILE=C:\build\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DCMAKE_BUILD_TYPE=Debug `
-DKICAD_SCRIPTING=OFF `
-DKICAD_SCRIPTING_MODULES=OFF `
-DKICAD_SCRIPTING_PYTHON3=OFF `
-DKICAD_SCRIPTING_WXPYTHON=OFF `
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF `
-DKICAD_SCRIPTING_ACTION_MENU=OFF `
-DKICAD_USE_OCC=ON `
-DKICAD_SPICE=ON `
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON `
-5
View File
@@ -59,12 +59,7 @@ Coverity:
- cmake
-DCMAKE_BUILD_TYPE=Debug
-DKICAD_STDLIB_LIGHT_DEBUG=ON
-DKICAD_SCRIPTING=ON
-DKICAD_SCRIPTING_MODULES=ON
-DKICAD_SCRIPTING_PYTHON3=ON
-DKICAD_SCRIPTING_WXPYTHON=ON
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
-DKICAD_SCRIPTING_ACTION_MENU=ON
-DKICAD_USE_OCC=ON
-DKICAD_SPICE=ON
- coverity/bin/cov-build --dir cov-int make -j8
-5
View File
@@ -30,12 +30,7 @@ validate_linux_metadata:
- cmake
-DCMAKE_BUILD_TYPE=Debug
-DKICAD_STDLIB_LIGHT_DEBUG=ON
-DKICAD_SCRIPTING=ON
-DKICAD_SCRIPTING_MODULES=ON
-DKICAD_SCRIPTING_PYTHON3=ON
-DKICAD_SCRIPTING_WXPYTHON=ON
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
-DKICAD_SCRIPTING_ACTION_MENU=ON
-DKICAD_USE_OCC=ON
-DKICAD_SPICE=ON
-DKICAD_BUILD_I18N=ON
@@ -347,7 +347,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
-seg->GetSeg().A.y * m_biuTo3Dunits );
const SFVEC2F end3DU ( seg->GetSeg().B.x * m_biuTo3Dunits,
-seg->GetSeg().B.y * m_biuTo3Dunits );
const int width = seg->GetWidth() + clearance.x * 2;
const double width = seg->GetWidth() + clearance.x * 2;
// Cannot add segments that have the same start and end point
if( Is_segment_a_circle( start3DU, end3DU ) )
@@ -368,7 +368,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
case SH_CIRCLE:
{
const SHAPE_CIRCLE* circle = (SHAPE_CIRCLE*) shape;
const int radius = circle->GetRadius() + clearance.x;
const double radius = circle->GetRadius() + clearance.x;
const SFVEC2F center( circle->GetCenter().x * m_biuTo3Dunits,
-circle->GetCenter().y * m_biuTo3Dunits );
@@ -409,7 +409,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
-seg.GetSeg().A.y * m_biuTo3Dunits );
const SFVEC2F end3DU( seg.GetSeg().B.x * m_biuTo3Dunits,
-seg.GetSeg().B.y * m_biuTo3Dunits );
const int width = arc->GetWidth() + clearance.x * 2;
const double width = arc->GetWidth() + clearance.x * 2;
// Cannot add segments that have the same start and end point
if( Is_segment_a_circle( start3DU, end3DU ) )
@@ -459,7 +459,7 @@ OBJECT_2D* BOARD_ADAPTER::createPadWithDrill( const PAD* aPad, int aInflateValue
if( drillSize.x == drillSize.y ) // usual round hole
{
const int radius = ( drillSize.x / 2 ) + aInflateValue;
const double radius = ( drillSize.x / 2.0 ) + aInflateValue;
const SFVEC2F center( aPad->GetPosition().x * m_biuTo3Dunits,
-aPad->GetPosition().y * m_biuTo3Dunits );
@@ -470,7 +470,7 @@ OBJECT_2D* BOARD_ADAPTER::createPadWithDrill( const PAD* aPad, int aInflateValue
else // Oblong hole
{
const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape();
float width = seg->GetWidth() + aInflateValue * 2;
double width = seg->GetWidth() + aInflateValue * 2;
SFVEC2F start3DU( seg->GetSeg().A.x * m_biuTo3Dunits,
-seg->GetSeg().A.y * m_biuTo3Dunits );
@@ -567,7 +567,7 @@ void BOARD_ADAPTER::transformArcToSegments( const wxPoint& aCentre, const wxPoin
const BOARD_ITEM& aBoardItem )
{
wxPoint arc_start, arc_end;
int delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
double delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
arc_end = arc_start = aStart;
@@ -586,7 +586,7 @@ void BOARD_ADAPTER::transformArcToSegments( const wxPoint& aCentre, const wxPoin
wxPoint curr_end = arc_start;
wxPoint curr_start = arc_start;
for( int ii = delta; ii < aArcAngle; ii += delta )
for( double ii = delta; ii < aArcAngle; ii += delta )
{
curr_end = arc_start;
RotatePoint( &curr_end, aCentre, -ii );
@@ -636,7 +636,7 @@ void BOARD_ADAPTER::addShapeWithClearance( const PCB_SHAPE* aShape,
{
// The full width of the lines to create
// The extra 1 protects the inner/outer radius values from degeneracy
const int linewidth = aShape->GetWidth() + ( 2 * aClearanceValue ) + 1;
const double linewidth = aShape->GetWidth() + ( 2 * aClearanceValue ) + 1;
switch( aShape->GetShape() )
{
@@ -831,9 +831,9 @@ void BOARD_ADAPTER::buildPadOutlineAsSegments( const PAD* aPad, CONTAINER_2D_BAS
const SFVEC2F center3DU( aPad->ShapePos().x * m_biuTo3Dunits,
-aPad->ShapePos().y * m_biuTo3Dunits );
const int radius = aPad->GetSize().x / 2;
const float inner_radius = ( radius - aWidth / 2 ) * m_biuTo3Dunits;
const float outer_radius = ( radius + aWidth / 2 ) * m_biuTo3Dunits;
const double radius = aPad->GetSize().x / 2.0;
const float inner_radius = ( radius - aWidth / 2.0 ) * m_biuTo3Dunits;
const float outer_radius = ( radius + aWidth / 2.0 ) * m_biuTo3Dunits;
aDstContainer->Add( new RING_2D( center3DU, inner_radius, outer_radius, *aPad ) );
+1 -1
View File
@@ -518,7 +518,7 @@ void EDA_3D_CANVAS::DoRePaint()
if( m_render_pivot )
{
const float scale = glm::min( m_camera.GetZoom(), 1.0f );
render_pivot( curtime_delta_s, scale * scale );
render_pivot( curtime_delta_s, scale );
}
// "Swaps the double-buffer of this window, making the back-buffer the
@@ -102,7 +102,6 @@ void EDA_3D_CANVAS::render_pivot( float t , float aScale )
glTranslatef( lookAtPos.x, lookAtPos.y, lookAtPos.z );
glScalef( aScale, aScale, aScale );
pivot_render_triangles( t * 0.5f );
t = t * 0.80f;
@@ -29,7 +29,7 @@
using KIGFX::COLOR4D;
///! Update the schema version whenever a migration is required
const int viewer3dSchemaVersion = 1;
const int viewer3dSchemaVersion = 2;
EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
@@ -63,7 +63,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
// OpenGL options
m_params.emplace_back( new PARAM<bool>( "render.opengl_copper_thickness",
&m_Render.opengl_copper_thickness, true ) );
&m_Render.opengl_copper_thickness, false ) );
m_params.emplace_back( new PARAM<bool>( "render.opengl_show_model_bbox",
&m_Render.opengl_show_model_bbox, false ) );
m_params.emplace_back( new PARAM<bool>( "render.opengl_highlight_on_rollover",
@@ -202,6 +202,12 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
&m_Camera.projection_mode, 1 ) );
registerMigration( 0, 1, std::bind( &EDA_3D_VIEWER_SETTINGS::migrateSchema0to1, this ) );
registerMigration( 1, 2, [&]() -> bool
{
Set( "render.opengl_copper_thickness", false );
return true;
} );
}
+25 -22
View File
@@ -255,9 +255,11 @@ wxString PANEL_PREVIEW_3D_MODEL::formatOffsetValue( double aValue )
{
// Convert from internal units (mm) to user units
if( m_userUnits == EDA_UNITS::INCHES )
aValue /= 25.4f;
aValue /= 25.4;
else if( m_userUnits == EDA_UNITS::MILS )
aValue /= 25.4 / 1e3;
return wxString::Format( "%.4f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
return wxString::Format( "%.6f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
}
@@ -397,18 +399,19 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign
else if( spinCtrl == m_spinZoffset )
textCtrl = zoff;
double step = OFFSET_INCREMENT_MM;
double step_mm = OFFSET_INCREMENT_MM;
double curr_value_mm = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
if( m_userUnits == EDA_UNITS::INCHES )
step = OFFSET_INCREMENT_MIL/1000.0;
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
{
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
}
double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
curr_value_mm += ( step_mm * aSign );
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
curr_value += ( step * aSign );
curr_value = std::max( -MAX_OFFSET, curr_value );
curr_value = std::min( curr_value, MAX_OFFSET );
textCtrl->SetValue( formatOffsetValue( curr_value ) );
textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
}
@@ -460,29 +463,29 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelOffset( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
double step = OFFSET_INCREMENT_MM;
double step_mm = OFFSET_INCREMENT_MM;
if( event.ShiftDown( ) )
step = OFFSET_INCREMENT_MM_FINE;
step_mm = OFFSET_INCREMENT_MM_FINE;
if( m_userUnits == EDA_UNITS::INCHES )
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
{
step = OFFSET_INCREMENT_MIL/1000.0;
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000.0;
if( event.ShiftDown( ) )
step = OFFSET_INCREMENT_MIL_FINE/1000.0;
step_mm = 25.4*OFFSET_INCREMENT_MIL_FINE/1000.0;
}
if( event.GetWheelRotation() >= 0 )
step = -step;
step_mm = -step_mm;
double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
double curr_value_mm = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
curr_value += step;
curr_value = std::max( -MAX_OFFSET, curr_value );
curr_value = std::min( curr_value, MAX_OFFSET );
curr_value_mm += step_mm;
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
textCtrl->SetValue( formatOffsetValue( curr_value ) );
textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
}
+1 -1
View File
@@ -81,7 +81,7 @@ German (DE) Rafael Sokolowski <Rafael.Sokolowski[at]web-dot-de
Japanese (JA) Kenta Yonekura <yoneken[at]kicad-dot-jp>
Simplified Chinese (zh_CN) taotieren <admin[at]taotieren-dot-com>
Remy Halvick, David Briscoe, Dominique Laigle, Paul Burke
Remy Halvick, David J S Briscoe, Dominique Laigle, Paul Burke
== Programm credits for icons and others
+1 -1
View File
@@ -37,7 +37,7 @@ unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
set(_PYTHON3_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
# Disabling the "search every possible place" code for now
# see https://gitlab.com/kicad/code/kicad/-/issues/8553
+1 -1
View File
@@ -44,7 +44,7 @@ cmake_find_frameworks(Python)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
set(_PYTHON3_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
if(PythonLibs_FIND_VERSION)
if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+1 -1
View File
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "6.0.0" )
set( KICAD_SEMANTIC_VERSION "6.0.1" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+7 -5
View File
@@ -26,11 +26,13 @@ set_source_files_properties( bitmap2cmp_gui.cpp PROPERTIES
COMPILE_DEFINITIONS "COMPILING_DLL"
)
if( MINGW )
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
mingw_resource_compiler( bitmap2component )
else()
set( BITMAP2COMPONENT_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/bitmap2component.rc )
if( WIN32 )
if( MINGW )
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
mingw_resource_compiler( bitmap2component )
else()
set( BITMAP2COMPONENT_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/bitmap2component.rc )
endif()
endif()
if( APPLE )
+7
View File
@@ -269,8 +269,13 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
pos.x = KiROUND( pos.x / GetScalingFactor() );
pos.y = KiROUND( pos.y / GetScalingFactor() );
size.x = KiROUND( size.x / GetScalingFactor() );
size.y = KiROUND( size.y / GetScalingFactor() );
}
aDC->DestroyClippingRegion();
aDC->SetClippingRegion( pos, size );
if( GetGRForceBlackPenState() )
{
wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() );
@@ -288,6 +293,8 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
aDC->SetUserScale( scale, scale );
aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );
}
aDC->DestroyClippingRegion();
}
+20
View File
@@ -861,6 +861,26 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
wxEmptyString,
"Traditional Chinese (zh_TW)" ) );
aInfo.AddTranslator( new CONTRIBUTOR( "Remy Halvick",
wxEmptyString,
wxEmptyString,
"Other" ) );
aInfo.AddTranslator( new CONTRIBUTOR( "David J S Briscoe",
wxEmptyString,
wxEmptyString,
"Other" ) );
aInfo.AddTranslator( new CONTRIBUTOR( "Dominique Laigle",
wxEmptyString,
wxEmptyString,
"Other" ) );
aInfo.AddTranslator( new CONTRIBUTOR( "Paul Burke",
wxEmptyString,
wxEmptyString,
"Other" ) );
// Program credits for 3d models
#define LIBRARIANS _( "KiCad Librarian Team" )
+31 -8
View File
@@ -27,6 +27,7 @@
#include <pgm_base.h>
#include <base_units.h>
#include <eda_draw_frame.h>
#include <bitmaps.h>
#include <netclass.h>
#include <confirm.h>
@@ -69,11 +70,13 @@ std::vector<BITMAPS> g_lineStyleIcons;
wxArrayString g_lineStyleNames;
PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSES* aNetclasses,
PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_FRAME* aFrame,
NETCLASSES* aNetclasses,
const std::vector<wxString>& aNetNames,
bool aIsEEschema ) :
PANEL_SETUP_NETCLASSES_BASE( aParent->GetTreebook() ),
m_Parent( aParent ),
m_frame( aFrame ),
m_parent( aParent ),
m_netclasses( aNetclasses ),
m_netNames( aNetNames ),
m_hoveredCol( -1 )
@@ -185,6 +188,8 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSE
&PANEL_SETUP_NETCLASSES::OnNetclassGridMouseEvent,
this );
m_frame->Bind( UNITS_CHANGED, &PANEL_SETUP_NETCLASSES::onUnitsChanged, this );
m_netclassGrid->EndBatch();
m_membershipGrid->EndBatch();
Thaw();
@@ -205,6 +210,24 @@ PANEL_SETUP_NETCLASSES::~PANEL_SETUP_NETCLASSES()
m_netclassGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging ),
nullptr, this );
m_frame->Unbind( UNITS_CHANGED, &PANEL_SETUP_NETCLASSES::onUnitsChanged, this );
}
void PANEL_SETUP_NETCLASSES::onUnitsChanged( wxCommandEvent& aEvent )
{
NETCLASSES tempNetClasses;
NETCLASSES* saveNetClasses = m_netclasses;
m_netclasses = &tempNetClasses; // No, address of stack var does not escape function
TransferDataFromWindow();
TransferDataToWindow();
m_netclasses = saveNetClasses;
aEvent.Skip();
}
@@ -251,7 +274,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
m_netclassGrid->AppendRows((int) m_netclasses->GetCount() + 1 ); // + 1 for default netclass
// enter the Default NETCLASS.
netclassToGridRow( m_Parent->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
netclassToGridRow( m_frame->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
// make the Default NETCLASS name read-only
wxGridCellAttr* cellAttr = m_netclassGrid->GetOrCreateCellAttr( 0, GRID_NAME );
@@ -265,7 +288,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
{
NETCLASSPTR netclass = i->second;
netclassToGridRow( m_Parent->GetUserUnits(), m_netclassGrid, row, netclass );
netclassToGridRow( m_frame->GetUserUnits(), m_netclassGrid, row, netclass );
for( const wxString& net : *netclass )
{
@@ -373,7 +396,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
m_netclasses->Clear();
// Copy the default NetClass:
gridRowToNetclass( m_Parent->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
gridRowToNetclass( m_frame->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
// Copy other NetClasses:
for( int row = 1; row < m_netclassGrid->GetNumberRows(); ++row )
@@ -382,7 +405,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
GRID_NAME ) );
if( m_netclasses->Add( nc ) )
gridRowToNetclass( m_Parent->GetUserUnits(), m_netclassGrid, row, nc );
gridRowToNetclass( m_frame->GetUserUnits(), m_netclassGrid, row, nc );
}
// Now read all nets and push them in the corresponding netclass net buffer
@@ -415,7 +438,7 @@ bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, const wxString& aNa
if( tmp.IsEmpty() )
{
wxString msg = _( "Netclass must have a name." );
m_Parent->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME );
m_parent->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME );
return false;
}
@@ -424,7 +447,7 @@ bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, const wxString& aNa
if( ii != aRow && m_netclassGrid->GetCellValue( ii, GRID_NAME ).CmpNoCase( tmp ) == 0 )
{
wxString msg = _( "Netclass name already in use." );
m_Parent->SetError( msg, this, m_netclassGrid, focusFirst ? aRow : ii, GRID_NAME );
m_parent->SetError( msg, this, m_netclassGrid, focusFirst ? aRow : ii, GRID_NAME );
return false;
}
}
+13 -1
View File
@@ -212,7 +212,19 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
try
{
cntUpd.Start();
m_view->UpdateItems();
try
{
m_view->UpdateItems();
}
catch( std::out_of_range& err )
{
// Don't do anything here but don't fail
// This can happen when we don't catch `at()` calls
wxString msg;
msg.Printf( wxT( "Out of Range error: %s" ), err.what() );
wxLogDebug( msg );
}
cntUpd.Stop();
cntCtx.Start();
+25 -10
View File
@@ -267,11 +267,20 @@ void EDA_DRAW_FRAME::unitsChangeRefresh()
void EDA_DRAW_FRAME::ToggleUserUnits()
{
SetUserUnits( m_userUnits == EDA_UNITS::INCHES ? EDA_UNITS::MILLIMETRES : EDA_UNITS::INCHES );
unitsChangeRefresh();
if( m_toolManager->GetTool<COMMON_TOOLS>() )
{
TOOL_EVENT dummy;
m_toolManager->GetTool<COMMON_TOOLS>()->ToggleUnits( dummy );
}
else
{
SetUserUnits( m_userUnits == EDA_UNITS::INCHES ? EDA_UNITS::MILLIMETRES
: EDA_UNITS::INCHES );
unitsChangeRefresh();
wxCommandEvent e( UNITS_CHANGED );
ProcessEventLocally( e );
wxCommandEvent e( UNITS_CHANGED );
ProcessEventLocally( e );
}
}
@@ -514,7 +523,7 @@ void EDA_DRAW_FRAME::AddStandardSubMenus( TOOL_MENU& aToolMenu )
gridMenu->SetTool( commonTools );
aToolMenu.AddSubMenu( gridMenu );
aMenu.AddMenu( zoomMenu.get(), SELECTION_CONDITIONS::ShowAlways, 1000 );
aMenu.AddMenu( zoomMenu.get(), SELECTION_CONDITIONS::ShowAlways, 1000 );
aMenu.AddMenu( gridMenu.get(), SELECTION_CONDITIONS::ShowAlways, 1000 );
}
@@ -979,18 +988,22 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
wxString prompt = doOpen ? _( "Select Library" ) : _( "New Library" );
aFilename.SetExt( ext );
wxString dir = aGlobalPath;
wxString dir;
if( GetMruPath().IsEmpty() )
dir = aGlobalPath;
else
dir = GetMruPath();
if( isDirectory && doOpen )
{
if( !aIsGlobal )
if( !aIsGlobal && GetMruPath().IsEmpty() )
{
dir = Prj().GetProjectPath();
}
wxDirDialog dlg( this, prompt, dir,
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
wxDirDialog dlg( this, prompt, dir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
if( dlg.ShowModal() == wxID_CANCEL )
return false;
@@ -1004,7 +1017,7 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
if( aFilename.GetName().empty() )
aFilename.SetName( "Library" );
if( !aIsGlobal )
if( !aIsGlobal && GetMruPath().IsEmpty() )
{
dir = Prj().IsNullProject() ? aFilename.GetFullPath() : Prj().GetProjectPath();
}
@@ -1020,6 +1033,8 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
aFilename.SetExt( ext );
}
SetMruPath( aFilename.GetPath() );
return true;
}
+2 -2
View File
@@ -1388,7 +1388,7 @@ void EDA_SHAPE::calcEdit( const wxPoint& aPosition )
}
void EDA_SHAPE::endEdit()
void EDA_SHAPE::endEdit( bool aClosed )
{
switch( GetShape() )
{
@@ -1407,7 +1407,7 @@ void EDA_SHAPE::endEdit()
{
if( poly.CPoint( poly.GetPointCount() - 2 ) == poly.CLastPoint() )
{
poly.SetClosed( true );
poly.SetClosed( aClosed );
poly.Remove( poly.GetPointCount() - 1 );
}
}
+2 -2
View File
@@ -204,6 +204,8 @@ wxColour COLOR4D::ToColour() const
return colour;
}
#endif
COLOR4D COLOR4D::LegacyMix( const COLOR4D& aColor ) const
{
@@ -237,8 +239,6 @@ void COLOR4D::FromU32( unsigned int aPackedColor )
a = c.Alpha() / 255.0;
}
#endif
namespace KIGFX {
+20 -2
View File
@@ -204,8 +204,10 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
m_cachedManager( nullptr ),
m_nonCachedManager( nullptr ),
m_overlayManager( nullptr ),
m_tempManager( nullptr ),
m_mainBuffer( 0 ),
m_overlayBuffer( 0 ),
m_tempBuffer( 0 ),
m_isContextLocked( false ),
m_lockClientCookie( 0 )
{
@@ -300,6 +302,7 @@ OPENGL_GAL::~OPENGL_GAL()
delete m_cachedManager;
delete m_nonCachedManager;
delete m_overlayManager;
delete m_tempManager;
}
GL_CONTEXT_MANAGER::Get().UnlockCtx( m_glPrivContext );
@@ -442,6 +445,7 @@ void OPENGL_GAL::BeginDrawing()
// Prepare rendering target buffers
m_compositor->Initialize();
m_mainBuffer = m_compositor->CreateBuffer();
m_tempBuffer = m_compositor->CreateBuffer();
try
{
m_overlayBuffer = m_compositor->CreateBuffer();
@@ -493,10 +497,12 @@ void OPENGL_GAL::BeginDrawing()
// Remove all previously stored items
m_nonCachedManager->Clear();
m_overlayManager->Clear();
m_tempManager->Clear();
m_cachedManager->BeginDrawing();
m_nonCachedManager->BeginDrawing();
m_overlayManager->BeginDrawing();
m_tempManager->BeginDrawing();
if( !m_isBitmapFontInitialized )
{
@@ -1705,6 +1711,7 @@ void OPENGL_GAL::SetTarget( RENDER_TARGET aTarget )
case TARGET_CACHED: m_currentManager = m_cachedManager; break;
case TARGET_NONCACHED: m_currentManager = m_nonCachedManager; break;
case TARGET_OVERLAY: m_currentManager = m_overlayManager; break;
case TARGET_TEMP: m_currentManager = m_tempManager; break;
}
m_currentTarget = aTarget;
@@ -1731,6 +1738,10 @@ void OPENGL_GAL::ClearTarget( RENDER_TARGET aTarget )
m_compositor->SetBuffer( m_mainBuffer );
break;
case TARGET_TEMP:
m_compositor->SetBuffer( m_tempBuffer );
break;
case TARGET_OVERLAY:
if( m_overlayBuffer )
m_compositor->SetBuffer( m_overlayBuffer );
@@ -1752,6 +1763,7 @@ bool OPENGL_GAL::HasTarget( RENDER_TARGET aTarget )
switch( aTarget )
{
default:
case TARGET_TEMP:
case TARGET_CACHED:
case TARGET_NONCACHED: return true;
case TARGET_OVERLAY: return ( m_overlayBuffer != 0 );
@@ -1762,14 +1774,18 @@ bool OPENGL_GAL::HasTarget( RENDER_TARGET aTarget )
void OPENGL_GAL::StartDiffLayer()
{
m_currentManager->EndDrawing();
SetTarget( TARGET_TEMP );
ClearTarget( TARGET_TEMP );
}
void OPENGL_GAL::EndDiffLayer()
{
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
glBlendEquation( GL_MAX );
m_currentManager->EndDrawing();
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glBlendEquation( GL_FUNC_ADD );
m_compositor->DrawBuffer( m_tempBuffer, m_mainBuffer );
}
@@ -2296,11 +2312,13 @@ void OPENGL_GAL::init()
m_cachedManager = new VERTEX_MANAGER( true );
m_nonCachedManager = new VERTEX_MANAGER( false );
m_overlayManager = new VERTEX_MANAGER( false );
m_tempManager = new VERTEX_MANAGER( false );
// Make VBOs use shaders
m_cachedManager->SetShader( *m_shader );
m_nonCachedManager->SetShader( *m_shader );
m_overlayManager->SetShader( *m_shader );
m_tempManager->SetShader( *m_shader );
m_isInitialized = true;
}
+6 -1
View File
@@ -63,30 +63,35 @@ static const struct
{ "GRAY3", 9 },
{ "WHITE", 7 },
{ "LYELLOW", 51 },
{ "LORANGE", 41 },
{ "BLUE1", 178 },
{ "GREEN1", 98 },
{ "CYAN1", 138 },
{ "RED1", 18 },
{ "MAGENTA1", 228 },
{ "BROWN1", 58 },
{ "ORANGE1", 34 },
{ "BLUE2", 5 },
{ "GREEN2", 3 },
{ "CYAN2", 4 },
{ "RED2", 1 },
{ "MAGENTA2", 6 },
{ "BROWN2", 54 },
{ "ORANGE2", 42 },
{ "BLUE3", 171 },
{ "GREEN3", 91 },
{ "CYAN3", 131 },
{ "RED3", 11 },
{ "MAGENTA3", 221 },
{ "YELLOW3", 2 },
{ "ORANGE3", 32 },
{ "BLUE4", 5 },
{ "GREEN4", 3 },
{ "CYAN4", 4 },
{ "RED4", 1 },
{ "MAGENTA4", 6 },
{ "YELLOW4", 2 }
{ "YELLOW4", 2 },
{ "ORANGE4", 40 }
};
+14 -8
View File
@@ -235,16 +235,22 @@ bool PROJECT_FILE::MigrateFromLegacy( wxConfigBase* aCfg )
fromLegacy<int>( aCfg, "SubpartIdSeparator", "schematic.subpart_id_separator" );
fromLegacy<int>( aCfg, "SubpartFirstId", "schematic.subpart_first_id" );
fromLegacy<int>( aCfg, "LineThickness", "schematic.drawing.default_line_thickness" );
fromLegacy<int>( aCfg, "WireThickness", "schematic.drawing.default_wire_thickness" );
fromLegacy<int>( aCfg, "BusThickness", "schematic.drawing.default_bus_thickness" );
fromLegacy<int>( aCfg, "LabSize", "schematic.drawing.default_text_size" );
fromLegacy<int>( aCfg, "PinSymbolSize", "schematic.drawing.pin_symbol_size" );
fromLegacy<int>( aCfg, "JunctionSize", "schematic.drawing.default_junction_size" );
fromLegacy<int>( aCfg, "LineThickness", "schematic.drawing.default_line_thickness" );
fromLegacy<int>( aCfg, "WireThickness", "schematic.drawing.default_wire_thickness" );
fromLegacy<int>( aCfg, "BusThickness", "schematic.drawing.default_bus_thickness" );
fromLegacy<int>( aCfg, "LabSize", "schematic.drawing.default_text_size" );
fromLegacyString( aCfg, "FieldNameTemplates", "schematic.drawing.field_names" );
if( !fromLegacy<int>( aCfg, "PinSymbolSize", "schematic.drawing.pin_symbol_size" ) )
{
// Use the default symbol size algorithm of Eeschema V5 (based on pin name/number size)
Set( "schematic.drawing.pin_symbol_size", 0 );
}
if( !fromLegacy<double>( aCfg, "TextOffsetRatio", "schematic.drawing.text_offset_ratio" ) )
fromLegacy<int>( aCfg, "JunctionSize", "schematic.drawing.default_junction_size" );
fromLegacyString( aCfg, "FieldNameTemplates", "schematic.drawing.field_names" );
if( !fromLegacy<double>( aCfg, "TextOffsetRatio", "schematic.drawing.text_offset_ratio" ) )
{
// Use the spacing of Eeschema V5
Set( "schematic.drawing.text_offset_ratio", 0.08 );
+2
View File
@@ -867,6 +867,8 @@ bool SETTINGS_MANAGER::LoadProject( const wxString& aFullPath, bool aSetActive )
if( aSetActive )
settings = RegisterSettings( settings );
else
settings->LoadFromFile( path.GetPath() );
m_projects[fullPath]->setLocalSettings( settings );
+2
View File
@@ -154,6 +154,7 @@ typedef long time_t;
// Contains VECTOR2I
%include math.i
%template(VECTOR_VECTOR2I) std::vector<VECTOR2I>;
// ignore warning from nested classes
#pragma SWIG nowarn=325
@@ -174,6 +175,7 @@ typedef long time_t;
#include <utf8.h>
%include <utf8.h>
%extend UTF8
{
const char* Cast_to_CChar() { return (self->c_str()); }
+32
View File
@@ -34,3 +34,35 @@
#include <math/vector2d.h>
%include <math/vector2d.h>
%template(VECTOR2I) VECTOR2<int>;
%extend VECTOR2<int>
{
void Set(long x, long y) { self->x = x; self->y = y; }
PyObject* Get()
{
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
return tup;
}
%pythoncode
%{
def __eq__(self,other): return (self.x==other.x and self.y==other.y)
def __ne__(self,other): return not (self==other)
def __str__(self): return str(self.Get())
def __repr__(self): return 'VECTOR2I'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0:
self.x = val
elif index == 1:
self.y = val
else:
raise IndexError
def __nonzero__(self): return self.Get() != (0,0)
%}
}
+5 -11
View File
@@ -679,19 +679,13 @@ void VIEW::ReorderLayerData( std::unordered_map<int, int> aReorderMap )
std::vector<VIEW_LAYER> new_map;
new_map.reserve( m_layers.size() );
for( int ii = 0; ii < VIEW_MAX_LAYERS; ++ii )
new_map.emplace_back();
for( const VIEW_LAYER& layer : m_layers )
new_map.push_back( layer );
for( auto& pair : aReorderMap )
{
int orig_idx = layer.id;
int new_idx = orig_idx;
if( aReorderMap.count( orig_idx ) )
new_idx = aReorderMap.at( orig_idx );
new_map[new_idx] = layer;
new_map[new_idx].id = new_idx;
new_map[pair.second] = m_layers[pair.first];
new_map[pair.second].id = pair.second;
}
m_layers = new_map;
+8 -6
View File
@@ -46,12 +46,13 @@ set( CVPCB_SRCS
tools/cvpcb_fpviewer_selection_tool.cpp
)
if( MINGW )
# CVPCB_RESOURCES variable is set by the macro.
mingw_resource_compiler( cvpcb )
else()
set( CVPCB_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/cvpcb.rc )
if( WIN32 )
if( MINGW )
# CVPCB_RESOURCES variable is set by the macro.
mingw_resource_compiler( cvpcb-dll )
else()
set( CVPCB_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/cvpcb-dll.rc )
endif()
endif()
@@ -60,6 +61,7 @@ add_library( cvpcb_kiface MODULE
cvpcb.cpp
${CVPCB_SRCS}
${CVPCB_DIALOGS}
${CVPCB_RESOURCES}
)
set_target_properties( cvpcb_kiface PROPERTIES
+3
View File
@@ -419,8 +419,11 @@ void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
// of available footprints which match the filter
long pos = m_tcFilterString->GetInsertionPoint();
wxListEvent l_event;
OnSelectComponent( l_event );
m_tcFilterString->SetFocus();
m_tcFilterString->SetInsertionPoint( pos );
}
@@ -38,7 +38,7 @@ class testundoredo1(ActionPlugin):
for track in pcb.GetTracks():
pcb.RemoveNative(track)
for draw in pcb.m_Drawings:
for draw in pcb.GetDrawings():
pcb.RemoveNative(draw)
@@ -83,15 +83,15 @@ class testundoredo2(ActionPlugin):
footprint.Add(pad_s0)
footprint.Add(pad_s1)
e = EDGE_MODULE(footprint)
e = FP_SHAPE(footprint)
e.SetStart0(wxPointMM(-1,0))
e.SetEnd0(wxPointMM(0,0))
e.SetWidth(FromMM(0.2))
e.SetLayer(F_SilkS)
e.SetShape(S_SEGMENT)
module.Add(e)
module.SetPosition(wxPointMM(random.randint(20,200),random.randint(20,150)))
return module
footprint.Add(e)
footprint.SetPosition(wxPointMM(random.randint(20,200),random.randint(20,150)))
return footprint
@@ -100,7 +100,7 @@ class testundoredo2(ActionPlugin):
random.seed()
for i in range(10):
seg = DRAWSEGMENT()
seg = PCB_SHAPE()
seg.SetLayer( random.choice([Edge_Cuts,Cmts_User,Eco1_User,Eco2_User]) )
seg.SetStart( wxPointMM( random.randint(10,100),
random.randint(10,100) ) )
@@ -109,11 +109,11 @@ class testundoredo2(ActionPlugin):
self.pcb.Add( seg )
if i%2 == 0:
t = TRACK(None)
t = PCB_TRACK(None)
else:
t = VIA(None)
t = PCB_VIA(None)
#t.SetLayerPair(segments['layerPair'][0],segments['layerPair'][1])
t.SetViaType(VIA_THROUGH)
t.SetViaType(VIATYPE_THROUGH)
t.SetDrill(FromMM(random.randint(1,20)/10.0))
t.SetStart(wxPointMM(random.randint(100,150),random.randint(100,150)))
t.SetEnd(wxPointMM(random.randint(100,150),random.randint(100,150)))
@@ -121,7 +121,7 @@ class testundoredo2(ActionPlugin):
t.SetLayer(random.choice([F_Cu,B_Cu]))
self.pcb.Add(t)
self.createFPCXModule(random.randint(2,40))
self.createFPCXFootprint(random.randint(2,40))
class testundoredo3(ActionPlugin):
@@ -138,15 +138,15 @@ class testundoredo3(ActionPlugin):
area = pcb.GetArea(i)
area.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
for module in pcb.GetFootprints():
module.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
for footprint in pcb.GetFootprints():
footprint.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
if random.randint(0,10) > 5:
module.Flip(module.GetPosition())
footprint.Flip(footprint.GetPosition(), True)
for track in pcb.GetTracks():
track.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
for draw in pcb.m_Drawings:
for draw in pcb.GetDrawings():
draw.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
+3 -1
View File
@@ -119,7 +119,9 @@
"use_height_for_length_calcs": true
},
"track_widths": [
0.0
0.0,
0.2,
0.5
],
"via_dimensions": [
{
+11 -6
View File
@@ -299,12 +299,13 @@ if( KICAD_SPICE )
)
endif()
if( MINGW )
# EESCHEMA_RESOURCES variable is set by the macro.
mingw_resource_compiler( eeschema )
else()
set( EESCHEMA_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/eeschema.rc )
if( WIN32 )
if( MINGW )
# EESCHEMA_RESOURCES variable is set by the macro.
mingw_resource_compiler( eeschema )
else()
set( EESCHEMA_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/eeschema.rc )
endif()
endif()
# Create a C++ compilable string initializer containing markdown text into a *.h file:
@@ -481,6 +482,10 @@ if( APPLE )
DESTINATION "${OSX_BUNDLE_INSTALL_PLUGIN_DIR}/sim" )
endif()
else()
if( MSVC )
target_sources( eeschema_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/eeschema-dll.rc )
endif()
install( TARGETS eeschema
DESTINATION ${KICAD_BIN}
COMPONENT binary
+1 -1
View File
@@ -268,7 +268,7 @@ bool SCH_EDIT_FRAME::SchematicCleanUp( SCH_SCREEN* aScreen )
AddToScreen( mergedLine, aScreen );
if( firstLine->IsSelected() )
if( firstLine->IsSelected() || secondLine->IsSelected() )
selectionTool->AddItemToSel( mergedLine, true /*quiet mode*/ );
break;
+5 -4
View File
@@ -32,18 +32,19 @@
#include <bom_plugins.h>
#include <confirm.h>
#include <dialog_bom_base.h>
#include <string_utils.h>
#include <dialogs/html_message_box.h>
#include <eeschema_settings.h>
#include <gestfich.h>
#include <dialogs/html_message_box.h>
#include <i18n_utility.h> // for _HKI definition used in dialog_bom_help_md.h
#include <invoke_sch_dialog.h>
#include <kiface_base.h>
#include <netlist.h>
#include <netlist_exporter_xml.h>
#include <paths.h>
#include <pgm_base.h>
#include <reporter.h>
#include <sch_edit_frame.h>
#include <paths.h>
#include <string_utils.h>
#include <wx/filedlg.h>
#include <wx/log.h>
@@ -343,7 +344,7 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event )
#endif
if( m_parent->ReadyToNetlist( _( "Generating BOM requires a fully annotated schematic." ) ) )
m_parent->WriteNetListFile( -1, fullfilename, GNL_OPT_BOM, &reporter );
m_parent->WriteNetListFile( NET_TYPE_BOM, fullfilename, GNL_OPT_BOM, &reporter );
m_Messages->SetValue( reportmsg );
+10 -3
View File
@@ -675,15 +675,22 @@ void DIALOG_ERC::NextMarker()
}
void DIALOG_ERC::ExcludeMarker()
void DIALOG_ERC::ExcludeMarker( SCH_MARKER* aMarker )
{
SCH_MARKER* marker = aMarker;
if( marker != nullptr )
m_markerTreeModel->SelectMarker( marker );
if( m_notebook->GetSelection() != 1 )
return;
RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( m_markerDataView->GetCurrentItem() );
SCH_MARKER* marker = dynamic_cast<SCH_MARKER*>( node->m_RcItem->GetParent() );
if( marker && !marker->IsExcluded() )
if( node && node->m_RcItem )
marker = dynamic_cast<SCH_MARKER*>( node->m_RcItem->GetParent() );
if( node && marker && !marker->IsExcluded() )
{
marker->SetExcluded( true );
m_parent->GetCanvas()->GetView()->Update( marker );
+11 -1
View File
@@ -37,6 +37,9 @@
#define DIALOG_ERC_WINDOW_NAME "DialogErcWindowName"
class SCH_MARKER;
class DIALOG_ERC : public DIALOG_ERC_BASE, PROGRESS_REPORTER_BASE
{
public:
@@ -50,7 +53,14 @@ public:
void PrevMarker();
void NextMarker();
void ExcludeMarker();
/**
* Exclude aMarker from the ERC list. If aMarker is nullptr, exclude the selected marker
* in this dialog.
*
* @param aMarker aMarker to exclude
*/
void ExcludeMarker( SCH_MARKER* aMarker = nullptr );
void UpdateAnnotationWarning();
+33 -14
View File
@@ -37,10 +37,27 @@
class PIN_TABLE_DATA_MODEL : public wxGridTableBase
{
public:
PIN_TABLE_DATA_MODEL( EDA_UNITS aUserUnits ) : m_userUnits( aUserUnits ), m_edited( false )
PIN_TABLE_DATA_MODEL( SYMBOL_EDIT_FRAME* aFrame ) :
m_frame( aFrame ),
m_edited( false )
{
m_frame->Bind( UNITS_CHANGED, &PIN_TABLE_DATA_MODEL::onUnitsChanged, this );
}
~PIN_TABLE_DATA_MODEL()
{
m_frame->Unbind( UNITS_CHANGED, &PIN_TABLE_DATA_MODEL::onUnitsChanged, this );
}
void onUnitsChanged( wxCommandEvent& aEvent )
{
if( GetView() )
GetView()->ForceRefresh();
aEvent.Skip();
}
int GetNumberRows() override { return (int) m_rows.size(); }
int GetNumberCols() override { return COL_COUNT; }
@@ -70,7 +87,7 @@ public:
wxString GetValue( int aRow, int aCol ) override
{
return GetValue( m_rows[ aRow ], aCol, m_userUnits );
return GetValue( m_rows[ aRow ], aCol, m_frame->GetUserUnits() );
}
static wxString GetValue( const LIB_PINS& pins, int aCol, EDA_UNITS aUserUnits )
@@ -109,13 +126,13 @@ public:
val = StringFromValue( aUserUnits, pin->GetNameTextSize(), true );
break;
case COL_LENGTH:
val = StringFromValue( aUserUnits, pin->GetLength() );
val = StringFromValue( aUserUnits, pin->GetLength(), true );
break;
case COL_POSX:
val = StringFromValue( aUserUnits, pin->GetPosition().x );
val = StringFromValue( aUserUnits, pin->GetPosition().x, true );
break;
case COL_POSY:
val = StringFromValue( aUserUnits, pin->GetPosition().y );
val = StringFromValue( aUserUnits, pin->GetPosition().y, true );
break;
case COL_VISIBLE:
val = StringFromBool( pin->IsVisible() );
@@ -181,25 +198,25 @@ public:
break;
case COL_NUMBER_SIZE:
pin->SetNumberTextSize( ValueFromString( m_userUnits, aValue ) );
pin->SetNumberTextSize( ValueFromString( m_frame->GetUserUnits(), aValue ) );
break;
case COL_NAME_SIZE:
pin->SetNameTextSize( ValueFromString( m_userUnits, aValue ) );
pin->SetNameTextSize( ValueFromString( m_frame->GetUserUnits(), aValue ) );
break;
case COL_LENGTH:
pin->SetLength( ValueFromString( m_userUnits, aValue ) );
pin->SetLength( ValueFromString( m_frame->GetUserUnits(), aValue ) );
break;
case COL_POSX:
pin->SetPosition( wxPoint( ValueFromString( m_userUnits, aValue ),
pin->SetPosition( wxPoint( ValueFromString( m_frame->GetUserUnits(), aValue ),
pin->GetPosition().y ) );
break;
case COL_POSY:
pin->SetPosition( wxPoint( pin->GetPosition().x,
ValueFromString( m_userUnits, aValue ) ) );
ValueFromString( m_frame->GetUserUnits(), aValue ) ) );
break;
case COL_VISIBLE:
@@ -332,7 +349,7 @@ public:
std::sort( m_rows.begin(), m_rows.end(),
[ aSortCol, ascending, this ]( const LIB_PINS& lhs, const LIB_PINS& rhs ) -> bool
{
return compare( lhs, rhs, aSortCol, ascending, m_userUnits );
return compare( lhs, rhs, aSortCol, ascending, m_frame->GetUserUnits() );
} );
}
@@ -406,13 +423,15 @@ private:
}
}
private:
SYMBOL_EDIT_FRAME* m_frame;
// Because the rows of the grid can either be a single pin or a group of pins, the
// data model is a 2D vector. If we're in the single pin case, each row's LIB_PINS
// contains only a single pin.
std::vector<LIB_PINS> m_rows;
EDA_UNITS m_userUnits;
bool m_edited;
bool m_edited;
};
@@ -422,7 +441,7 @@ DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE( SYMBOL_EDIT_FRAME* parent,
m_editFrame( parent ),
m_part( aSymbol )
{
m_dataModel = new PIN_TABLE_DATA_MODEL( GetUserUnits() );
m_dataModel = new PIN_TABLE_DATA_MODEL( m_editFrame );
// Save original columns widths so we can do proportional sizing.
for( int i = 0; i < COL_COUNT; ++i )
+4 -4
View File
@@ -56,22 +56,22 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
m_textVars = new PANEL_TEXT_VARIABLES( m_treebook, &Prj() );
m_netclasses = new PANEL_SETUP_NETCLASSES( this, &project.NetSettings().m_NetClasses,
m_netclasses = new PANEL_SETUP_NETCLASSES( this, aFrame, &project.NetSettings().m_NetClasses,
schematic.GetNetClassAssignmentCandidates(), true );
/*
* WARNING: If you change page names you MUST update calls to ShowSchematicSetupDialog().
*/
m_treebook->AddPage( new wxPanel( this ), _( "General" ) );
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "General" ) );
m_treebook->AddSubPage( m_formatting, _( "Formatting" ) );
m_treebook->AddSubPage( m_fieldNameTemplates, _( "Field Name Templates" ) );
m_treebook->AddPage( new wxPanel( this ), _( "Electrical Rules" ) );
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Electrical Rules" ) );
m_treebook->AddSubPage( m_severities, _( "Violation Severity" ) );
m_treebook->AddSubPage( m_pinMap, _( "Pin Conflicts Map" ) );
m_treebook->AddPage( new wxPanel( this ), _( "Project" ) );
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Project" ) );
m_treebook->AddSubPage( m_netclasses, _( "Net Classes" ) );
m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) );
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2020 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
@@ -123,8 +123,9 @@ bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataToGrid()
for( int row = 0; row < m_grid->GetNumberRows(); ++row )
{
m_grid->SetCellValue( row, 0, m_fields[row].m_Name );
m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? wxT( "1" ) : wxEmptyString );
m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? wxT( "1" ) : wxEmptyString );
// columns 1 and 2 show a boolean value (in a check box):
m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? "1" : "0" );
m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? "1" : "0" );
// Set cell properties
m_grid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
@@ -153,8 +154,8 @@ bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataFromGrid()
for( int row = 0; row < m_grid->GetNumberRows(); ++row )
{
m_fields[row].m_Name = m_grid->GetCellValue( row, 0 );
m_fields[row].m_Visible = m_grid->GetCellValue( row, 1 ) != wxEmptyString;
m_fields[row].m_URL = m_grid->GetCellValue( row, 2 ) != wxEmptyString;
m_fields[row].m_Visible = m_grid->GetCellValue( row, 1 ) == "1";
m_fields[row].m_URL = m_grid->GetCellValue( row, 2 ) == "1";
}
return true;
+18 -2
View File
@@ -534,7 +534,15 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
if( aCfg->Read( key, &value ) )
{
std::string key_utf( key.ToUTF8() );
js[JSON_SETTINGS_INTERNALS::PointerFromString( key_utf )] = value;
try
{
js[key_utf] = value;
}
catch(...)
{
continue;
}
}
}
@@ -547,7 +555,15 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
if( aCfg->Read( key, &value ) )
{
std::string key_utf( key.ToUTF8() );
js[JSON_SETTINGS_INTERNALS::PointerFromString( key_utf )] = value;
try
{
js[key_utf] = value;
}
catch(...)
{
continue;
}
}
}
+21 -9
View File
@@ -51,7 +51,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
WX_GRID* aGrid, LIB_SYMBOL* aSymbol ) :
m_frame( aFrame ),
m_dialog( aDialog ),
m_userUnits( aDialog->GetUserUnits() ),
m_grid( aGrid ),
m_parentType( SCH_SYMBOL_T ),
m_mandatoryFieldCount( MANDATORY_FIELDS ),
@@ -73,7 +72,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
WX_GRID* aGrid, SCH_SHEET* aSheet ) :
m_frame( aFrame ),
m_dialog( aDialog ),
m_userUnits( aDialog->GetUserUnits() ),
m_grid( aGrid ),
m_parentType( SCH_SHEET_T ),
m_mandatoryFieldCount( SHEET_MANDATORY_FIELDS ),
@@ -170,6 +168,8 @@ void FIELDS_GRID_TABLE<T>::initGrid( WX_GRID* aGrid )
m_orientationAttr = new wxGridCellAttr;
m_orientationAttr->SetEditor( new wxGridCellChoiceEditor( orientationNames ) );
m_orientationAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
m_frame->Bind( UNITS_CHANGED, &FIELDS_GRID_TABLE<T>::onUnitsChanged, this );
}
@@ -188,6 +188,18 @@ FIELDS_GRID_TABLE<T>::~FIELDS_GRID_TABLE()
m_vAlignAttr->DecRef();
m_hAlignAttr->DecRef();
m_orientationAttr->DecRef();
m_frame->Unbind( UNITS_CHANGED, &FIELDS_GRID_TABLE<T>::onUnitsChanged, this );
}
template <class T>
void FIELDS_GRID_TABLE<T>::onUnitsChanged( wxCommandEvent& aEvent )
{
if( GetView() )
GetView()->ForceRefresh();
aEvent.Skip();
}
@@ -416,7 +428,7 @@ wxString FIELDS_GRID_TABLE<T>::GetValue( int aRow, int aCol )
return StringFromBool( field.IsBold() );
case FDC_TEXT_SIZE:
return StringFromValue( m_userUnits, field.GetTextSize().GetHeight() );
return StringFromValue( m_frame->GetUserUnits(), field.GetTextSize().GetHeight(), true );
case FDC_ORIENTATION:
switch ( (int) field.GetTextAngle() )
@@ -428,10 +440,10 @@ wxString FIELDS_GRID_TABLE<T>::GetValue( int aRow, int aCol )
break;
case FDC_POSX:
return StringFromValue( m_userUnits, field.GetTextPos().x );
return StringFromValue( m_frame->GetUserUnits(), field.GetTextPos().x, true );
case FDC_POSY:
return StringFromValue( m_userUnits, field.GetTextPos().y );
return StringFromValue( m_frame->GetUserUnits(), field.GetTextPos().y, true );
default:
// we can't assert here because wxWidgets sometimes calls this without checking
@@ -534,8 +546,8 @@ void FIELDS_GRID_TABLE<T>::SetValue( int aRow, int aCol, const wxString &aValue
break;
case FDC_TEXT_SIZE:
field.SetTextSize( wxSize( ValueFromString( m_userUnits, aValue ),
ValueFromString( m_userUnits, aValue ) ) );
field.SetTextSize( wxSize( ValueFromString( m_frame->GetUserUnits(), aValue ),
ValueFromString( m_frame->GetUserUnits(), aValue ) ) );
break;
case FDC_ORIENTATION:
@@ -551,9 +563,9 @@ void FIELDS_GRID_TABLE<T>::SetValue( int aRow, int aCol, const wxString &aValue
case FDC_POSY:
pos = field.GetTextPos();
if( aCol == FDC_POSX )
pos.x = ValueFromString( m_userUnits, aValue );
pos.x = ValueFromString( m_frame->GetUserUnits(), aValue );
else
pos.y = ValueFromString( m_userUnits, aValue );
pos.y = ValueFromString( m_frame->GetUserUnits(), aValue );
field.SetTextPos( pos );
break;
+2 -1
View File
@@ -104,10 +104,11 @@ public:
protected:
void initGrid( WX_GRID* aGrid );
void onUnitsChanged( wxCommandEvent& aEvent );
private:
SCH_BASE_FRAME* m_frame;
DIALOG_SHIM* m_dialog;
EDA_UNITS m_userUnits;
WX_GRID* m_grid;
KICAD_T m_parentType;
int m_mandatoryFieldCount;
+1 -1
View File
@@ -1417,7 +1417,7 @@ void SCH_EDIT_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName )
// Attempt to back up the last schematic file before overwriting it with the auto
// save file.
if( !wxRenameFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
if( !wxCopyFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
{
unrecoveredFiles.Add( recoveredFn.GetFullPath() );
}
+1 -1
View File
@@ -165,7 +165,7 @@ int HIERARCHY_TREE::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemI
SCH_SHEET_PATH* item1Path = &static_cast<TreeItemData*>( GetItemData( item1 ) )->m_SheetPath;
SCH_SHEET_PATH* item2Path = &static_cast<TreeItemData*>( GetItemData( item2 ) )->m_SheetPath;
return item1Path->ComparePageNumAndName( *item2Path );
return item1Path->ComparePageNum( *item2Path );
}
+5 -3
View File
@@ -1036,6 +1036,8 @@ void LIB_PIN::Plot( PLOTTER* aPlotter, const wxPoint& aPffset, bool aFill,
void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
EDA_UNITS units = aFrame->GetUserUnits();
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
aList.emplace_back( _( "Name" ), UnescapeString( GetShownName() ) );
@@ -1046,7 +1048,7 @@ void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
aList.emplace_back( _( "Style" ), IsVisible() ? _( "Yes" ) : _( "No" ) );
// Display pin length
aList.emplace_back( _( "Length" ), StringFromValue( aFrame->GetUserUnits(), m_length ) );
aList.emplace_back( _( "Length" ), MessageTextFromValue( units, m_length, true ) );
int i = PinOrientationIndex( m_orientation );
aList.emplace_back( _( "Orientation" ), PinOrientationName( (unsigned) i ) );
@@ -1054,8 +1056,8 @@ void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
wxPoint pinpos = GetPosition();
pinpos.y = -pinpos.y; // Display coords are top to bottom; lib item coords are bottom to top
aList.emplace_back( _( "Pos X" ), MessageTextFromValue( aFrame->GetUserUnits(), pinpos.x ) );
aList.emplace_back( _( "Pos Y" ), MessageTextFromValue( aFrame->GetUserUnits(), pinpos.y ) );
aList.emplace_back( _( "Pos X" ), MessageTextFromValue( units, pinpos.x, true ) );
aList.emplace_back( _( "Pos Y" ), MessageTextFromValue( units, pinpos.y, true ) );
}
+2 -1
View File
@@ -74,7 +74,8 @@ public:
void BeginEdit( const wxPoint& aStartPoint ) override { beginEdit( aStartPoint ); }
bool ContinueEdit( const wxPoint& aPosition ) override { return continueEdit( aPosition ); }
void CalcEdit( const wxPoint& aPosition ) override { calcEdit( aPosition ); }
void EndEdit() override { endEdit(); }
void EndEdit() override { endEdit( false ); }
void SetEditState( int aState ) { setEditState( aState ); }
void AddPoint( const wxPoint& aPosition );
+1
View File
@@ -34,6 +34,7 @@
/// netlist types
enum NETLIST_TYPE_ID {
NET_TYPE_UNINIT = 0,
NET_TYPE_BOM, // Used by the BOM generator
NET_TYPE_PCBNEW,
NET_TYPE_ORCADPCB2,
NET_TYPE_CADSTAR,
@@ -81,6 +81,15 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam
helper = new NETLIST_EXPORTER_PSPICE( sch );
break;
case NET_TYPE_BOM:
// When generating the BOM, we have a bare filename so don't strip
// the extension or you might string a '.' from the middle of the filename
fileName += wxT( "." GENERIC_INTERMEDIATE_NETLIST_EXT );
helper = new NETLIST_EXPORTER_XML( sch );
executeCommandLine = true;
break;
default:
{
wxFileName tmpFile = fileName;
+10
View File
@@ -655,6 +655,16 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
if( symbolViewer && !symbolViewer->Close() ) // Can close modal symbol viewer?
return false;
}
else
{
auto* symbolEditor = (SYMBOL_EDIT_FRAME*) Kiway().Player( FRAME_SCH_SYMBOL_EDITOR, false );
if( symbolEditor && symbolEditor->IsSymbolFromSchematic() )
{
if( !symbolEditor->CanCloseSymbolFromSchematic( true ) )
return false;
}
}
SIM_PLOT_FRAME* simFrame = (SIM_PLOT_FRAME*) Kiway().Player( FRAME_SIMULATOR, false );
+3 -2
View File
@@ -1251,7 +1251,7 @@ void SCH_PAINTER::draw( const SCH_LINE *aLine, int aLayer )
float width = getLineWidth( aLine, drawingShadows );
PLOT_DASH_TYPE lineStyle = aLine->GetEffectiveLineStyle();
if( drawingDangling )
if( drawingDangling || drawingShadows )
{
if( aLine->IsStartDangling() && aLine->IsWire() )
{
@@ -1265,7 +1265,8 @@ void SCH_PAINTER::draw( const SCH_LINE *aLine, int aLayer )
getLineWidth( aLine, drawingShadows ), drawingShadows );
}
return;
if( drawingDangling )
return;
}
m_gal->SetIsStroke( true );
+3 -2
View File
@@ -188,7 +188,8 @@ wxString SCH_PIN::GetSelectMenuText( EDA_UNITS aUnits ) const
void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
wxString msg;
EDA_UNITS units = aFrame->GetUserUnits();
wxString msg;
aList.emplace_back( _( "Type" ), _( "Pin" ) );
@@ -215,7 +216,7 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
aList.emplace_back( _( "Visible" ), IsVisible() ? _( "Yes" ) : _( "No" ) );
aList.emplace_back( _( "Length" ), StringFromValue( aFrame->GetUserUnits(), GetLength() ) );
aList.emplace_back( _( "Length" ), MessageTextFromValue( units, GetLength() ), true );
int i = PinOrientationIndex( GetOrientation() );
aList.emplace_back( _( "Orientation" ), PinOrientationName( (unsigned) i ) );
@@ -1325,7 +1325,10 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
symbol->SetLibId( libId );
symbol->SetUnit( unit );
symbol->SetPosition( wxPoint( einstance.x.ToSchUnits(), -einstance.y.ToSchUnits() ) );
symbol->GetField( FOOTPRINT_FIELD )->SetText( package );
// assume that footprint library is identical to project name
wxString packageString = m_schematic->Prj().GetProjectName() + wxT( ":" ) + package;
symbol->GetField( FOOTPRINT_FIELD )->SetText( packageString );
if( einstance.rot )
{
@@ -1579,6 +1582,10 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode,
if( gates_count == 1 && ispower )
libSymbol->SetPower();
// assume that footprint library is identical to project name
wxString packageString = m_schematic->Prj().GetProjectName() + wxT( ":" ) + aEagleLibrary->package[symbolName];
libSymbol->GetFootprintField().SetText( packageString );
wxString name = libSymbol->GetName();
libSymbol->SetName( name );
m_pi->SaveSymbol( getLibFileName().GetFullPath(), new LIB_SYMBOL( *libSymbol.get() ),
+17 -25
View File
@@ -162,14 +162,13 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aF
wxString name;
wxString error;
LIB_ITEM* item;
LIB_FIELD* field;
std::unique_ptr<LIB_SYMBOL> symbol = std::make_unique<LIB_SYMBOL>( wxEmptyString );
std::set<int> fieldIDsRead;
m_requiredVersion = aFileVersion;
symbol->SetUnitCount( 1 );
m_fieldId = MANDATORY_FIELDS;
m_fieldIDsRead.clear();
token = NextTok();
@@ -232,29 +231,7 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aF
break;
case T_property:
field = parseProperty( symbol );
if( field )
{
// Due to an bug when in #LIB_SYMBOL::Flatten, duplicate ids slipped through
// when writing files. This section replaces duplicate #LIB_FIELD indices on
// load.
if( fieldIDsRead.count( field->GetId() ) )
{
int nextAvailableId = field->GetId() + 1;
while( fieldIDsRead.count( nextAvailableId ) )
nextAvailableId += 1;
fieldIDsRead.insert( nextAvailableId );
field->SetId( nextAvailableId );
}
else if( field )
{
fieldIDsRead.insert( field->GetId() );
}
}
parseProperty( symbol );
break;
case T_extends:
@@ -836,6 +813,19 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
}
}
// Due to an bug when in #LIB_SYMBOL::Flatten, duplicate ids slipped through
// when writing files. This section replaces duplicate #LIB_FIELD indices on
// load.
if( m_fieldIDsRead.count( field->GetId() ) )
{
int nextAvailableId = field->GetId() + 1;
while( m_fieldIDsRead.count( nextAvailableId ) )
nextAvailableId += 1;
field->SetId( nextAvailableId );
}
LIB_FIELD* existingField;
if( field->GetId() < MANDATORY_FIELDS )
@@ -843,6 +833,7 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
existingField = aSymbol->GetFieldById( field->GetId() );
*existingField = *field;
m_fieldIDsRead.insert( field->GetId() );
return existingField;
}
else if( name == "ki_keywords" )
@@ -908,6 +899,7 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
if( !existingField )
{
aSymbol->AddDrawItem( field.get(), false );
m_fieldIDsRead.insert( field->GetId() );
return field.release();
}
else
@@ -81,6 +81,9 @@ class SCH_SEXPR_PARSER : public SCHEMATIC_LEXER
int m_convert; ///< The current body style being parsed.
wxString m_symbolName; ///< The current symbol name.
/// Field IDs that have been read so far for the current symbol.
std::set<int> m_fieldIDsRead;
std::set<KIID> m_uuids;
PROGRESS_REPORTER* m_progressReporter; // optional; may be nullptr
@@ -648,8 +648,16 @@ void SCH_SEXPR_PLUGIN::loadHierarchy( SCH_SHEET* aSheet )
m_error += ioe.What();
}
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsFileWritable() );
aSheet->GetScreen()->SetFileExists( true );
if( fileName.FileExists() )
{
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsFileWritable() );
aSheet->GetScreen()->SetFileExists( true );
}
else
{
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsDirWritable() );
aSheet->GetScreen()->SetFileExists( false );
}
// This was moved out of the try{} block so that any sheets definitionsthat
// the plugin fully parsed before the exception was raised will be loaded.
@@ -2727,7 +2727,6 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
aliasName = wxString::FromUTF8( line );
aliasName.Trim();
// aliasName = EscapeString( aliasName, CTX_LIBID );
LIB_SYMBOL_MAP::iterator it = m_symbols.find( aliasName );
@@ -2834,6 +2833,7 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN_CACHE::LoadPart( LINE_READER& aReader, int aMajorV
wxString name, prefix, tmp;
name = tokens.GetNextToken();
name = EscapeString( name, CTX_LIBID );
pos += name.size() + 1;
prefix = tokens.GetNextToken();
@@ -3071,6 +3071,11 @@ void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSymbol,
parseQuotedString( text, aReader, line, &line, true );
// The value field needs to be "special" escaped. The other fields are
// escaped normally and don't need special handling
if( id == VALUE_FIELD )
text = EscapeString( text, CTX_QUOTED_STR );
// Doctor the *.lib file field which has a "~" in blank fields. New saves will
// not save like this.
if( text.size() == 1 && text[0] == '~' )
+5 -5
View File
@@ -163,7 +163,7 @@ int SCH_SHEET_PATH::Cmp( const SCH_SHEET_PATH& aSheetPathToTest ) const
}
int SCH_SHEET_PATH::ComparePageNumAndName( const SCH_SHEET_PATH& aSheetPathToTest ) const
int SCH_SHEET_PATH::ComparePageNum( const SCH_SHEET_PATH& aSheetPathToTest ) const
{
wxString pageA = GetPageNumber();
wxString pageB = aSheetPathToTest.GetPageNumber();
@@ -172,10 +172,10 @@ int SCH_SHEET_PATH::ComparePageNumAndName( const SCH_SHEET_PATH& aSheetPathToTes
if( pageNumComp == 0 )
{
wxString nameA = Last()->GetName();
wxString nameB = aSheetPathToTest.Last()->GetName();
int virtualPageA = GetVirtualPageNumber();
int virtualPageB = aSheetPathToTest.GetVirtualPageNumber();
return nameA.Cmp( nameB );
return virtualPageA > virtualPageB ? 1 : -1;
}
else
{
@@ -588,7 +588,7 @@ void SCH_SHEET_LIST::SortByPageNumbers( bool aUpdateVirtualPageNums )
std::sort( begin(), end(),
[]( SCH_SHEET_PATH a, SCH_SHEET_PATH b ) -> bool
{
return a.ComparePageNumAndName( b ) < 0;
return a.ComparePageNum( b ) < 0;
} );
if( aUpdateVirtualPageNums )
+3 -3
View File
@@ -215,14 +215,14 @@ public:
int Cmp( const SCH_SHEET_PATH& aSheetPathToTest ) const;
/**
* Compare sheets by their page number and then by their name. Finally
* compare using #Cmp()
* Compare sheets by their page number. If the actual page number is equal, use virtual page numbers
* to compare.
*
* @return -1 if aSheetPathToTest is greater than this (should appear later in the sort order)
* 0 if aSheetPathToTest is equal to this
* 1 if aSheetPathToTest is less than this (should appear earlier in the sort order)
*/
int ComparePageNumAndName( const SCH_SHEET_PATH& aSheetPathToTest ) const;
int ComparePageNum( const SCH_SHEET_PATH& aSheetPathToTest ) const;
/**
* Check if this path is contained inside aSheetPathToTest.
+1 -1
View File
@@ -104,7 +104,7 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
&m_LabelSizeRatio, DEFAULT_LABEL_SIZE_RATIO, 0.0, 2.0 ) );
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.pin_symbol_size",
&m_PinSymbolSize, Mils2iu( defaultPinSymbolSize ), Mils2iu( 5 ), Mils2iu( 1000 ),
&m_PinSymbolSize, Mils2iu( defaultPinSymbolSize ), Mils2iu( 0 ), Mils2iu( 1000 ),
1 / IU_PER_MILS ) );
// m_JunctionSize is only a run-time cache of the calculated size. Do not save it.
+22 -14
View File
@@ -264,16 +264,16 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
{
// Undo in the reverse order of list creation: (this can allow stacked changes like the
// same item can be changed and deleted in the same complex command).
for( int ii = aList->GetCount() - 1; ii >= 0; ii-- )
// After hitting 0, subtracting 1 will roll the value over to its max representation
for( unsigned ii = aList->GetCount() - 1; ii < std::numeric_limits<unsigned>::max(); ii-- )
{
UNDO_REDO status = aList->GetPickedItemStatus((unsigned) ii );
EDA_ITEM* eda_item = aList->GetPickedItem( (unsigned) ii );
SCH_SCREEN* screen =
dynamic_cast< SCH_SCREEN* >( aList->GetScreenForItem( (unsigned) ii ) );
UNDO_REDO status = aList->GetPickedItemStatus( ii );
EDA_ITEM* eda_item = aList->GetPickedItem( ii );
SCH_SCREEN* screen = dynamic_cast<SCH_SCREEN*>( aList->GetScreenForItem( ii ) );
wxCHECK( screen, /* void */ );
eda_item->SetFlags( aList->GetPickerFlags( (unsigned) ii ) );
eda_item->SetFlags( aList->GetPickerFlags( ii ) );
eda_item->ClearEditFlags();
eda_item->ClearTempFlags();
@@ -285,27 +285,29 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
{
// new items are deleted on undo
RemoveFromScreen( eda_item, screen );
aList->SetPickedItemStatus( UNDO_REDO::DELETED, (unsigned) ii );
aList->SetPickedItemStatus( UNDO_REDO::DELETED, ii );
}
else if( status == UNDO_REDO::DELETED )
{
// deleted items are re-inserted on undo
AddToScreen( eda_item, screen );
aList->SetPickedItemStatus( UNDO_REDO::NEWITEM, (unsigned) ii );
aList->SetPickedItemStatus( UNDO_REDO::NEWITEM, ii );
}
else if( status == UNDO_REDO::PAGESETTINGS )
{
SetCurrentSheet( *m_schematic->GetSheets().FindSheetForScreen( screen ) );
DisplayCurrentSheet();
// swap current settings with stored settings
DS_PROXY_UNDO_ITEM alt_item( this );
DS_PROXY_UNDO_ITEM* item = static_cast<DS_PROXY_UNDO_ITEM*>( eda_item );
item->Restore( this );
*item = alt_item;
}
else if( dynamic_cast<SCH_ITEM*>( eda_item ) )
else if( SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( eda_item ) )
{
// everything else is modified in place
SCH_ITEM* item = (SCH_ITEM*) eda_item;
SCH_ITEM* alt_item = (SCH_ITEM*) aList->GetPickedItemLink( (unsigned) ii );
SCH_ITEM* alt_item = static_cast<SCH_ITEM*>( aList->GetPickedItemLink( ii ) );
// The root sheet is a pseudo object that owns the root screen object but is not on
// the root screen so do not attempt to remove it from the screen it owns.
@@ -319,17 +321,23 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
break;
case UNDO_REDO::EXCHANGE_T:
aList->SetPickedItem( alt_item, (unsigned) ii );
aList->SetPickedItemLink( item, (unsigned) ii );
aList->SetPickedItem( alt_item, ii );
aList->SetPickedItemLink( item, ii );
item = alt_item;
break;
default:
wxFAIL_MSG( wxString::Format( wxT( "Unknown undo/redo command %d" ),
aList->GetPickedItemStatus( (unsigned) ii ) ) );
aList->GetPickedItemStatus( ii ) ) );
break;
}
if( item->Type() == SCH_SYMBOL_T )
{
SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
sym->UpdatePins();
}
if( item != &Schematic().Root() )
AddToScreen( item, screen );
}
+32 -16
View File
@@ -502,41 +502,57 @@ void SYMBOL_EDIT_FRAME::setupUIConditions()
}
bool SYMBOL_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
bool SYMBOL_EDIT_FRAME::CanCloseSymbolFromSchematic( bool doClose )
{
// Shutdown blocks must be determined and vetoed as early as possible
if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION
&& IsContentModified() )
{
return false;
}
if( m_isSymbolFromSchematic && IsContentModified() )
if( IsContentModified() )
{
SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) Kiway().Player( FRAME_SCH, false );
wxString msg = _( "Save changes to '%s' before closing?" );
switch( UnsavedChangesDialog( this,
_( "Save changes to schematic before closing?" ),
nullptr ) )
switch( UnsavedChangesDialog( this, wxString::Format( msg, m_reference ), nullptr ) )
{
case wxID_YES:
if( schframe && GetCurSymbol() ) // Should be always the case
schframe->SaveSymbolToSchematic( *GetCurSymbol(), m_schematicSymbolUUID );
return true;
break;
case wxID_NO: return true;
case wxID_NO:
break;
default:
case wxID_CANCEL: return false;
case wxID_CANCEL:
return false;
}
}
if( !saveAllLibraries( true ) )
if( doClose )
{
GetInfoBar()->ShowMessageFor( wxEmptyString, 1 );
SetCurSymbol( nullptr, false );
updateTitle();
}
return true;
}
bool SYMBOL_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
{
// Shutdown blocks must be determined and vetoed as early as possible
if( KIPLATFORM::APP::SupportsShutdownBlockReason()
&& aEvent.GetId() == wxEVT_QUERY_END_SESSION
&& IsContentModified() )
{
return false;
}
if( m_isSymbolFromSchematic && !CanCloseSymbolFromSchematic( false ) )
return false;
if( !saveAllLibraries( true ) )
return false;
return true;
}
@@ -78,6 +78,8 @@ public:
*/
bool HasLibModifications() const;
bool CanCloseSymbolFromSchematic( bool doClose );
/**
* The nickname of the current library being edited and empty string if none.
*/
+3 -1
View File
@@ -137,7 +137,7 @@ void SYMBOL_EDIT_FRAME::updateTitle()
wxString lib = GetCurLib();
wxString title;
if( IsSymbolFromSchematic() )
if( GetCurSymbol() && IsSymbolFromSchematic() )
{
if( GetScreen() && GetScreen()->IsContentModified() )
title = wxT( "*" );
@@ -385,6 +385,8 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux( LIB_SYMBOL* aEntry, const wxStr
RebuildSymbolUnitsList();
SetShowDeMorgan( GetCurSymbol()->HasConversion() );
ClearUndoRedoList();
// Display the document information based on the entry selected just in
// case the entry is an alias.
UpdateMsgPanel();
+16 -18
View File
@@ -70,14 +70,11 @@ bool EE_INSPECTION_TOOL::Init()
{
EE_TOOL_BASE::Init();
auto singleMarkerCondition = SELECTION_CONDITIONS::OnlyType( SCH_MARKER_T )
&& SELECTION_CONDITIONS::Count( 1 );
// Add inspection actions to the selection tool menu
//
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
selToolMenu.AddItem( EE_ACTIONS::excludeMarker, singleMarkerCondition, 100 );
selToolMenu.AddItem( EE_ACTIONS::excludeMarker, EE_CONDITIONS::SingleNonExcludedMarker, 100 );
selToolMenu.AddItem( EE_ACTIONS::showDatasheet,
EE_CONDITIONS::SingleSymbol && EE_CONDITIONS::Idle, 220 );
@@ -171,25 +168,26 @@ int EE_INSPECTION_TOOL::NextMarker( const TOOL_EVENT& aEvent )
int EE_INSPECTION_TOOL::ExcludeMarker( const TOOL_EVENT& aEvent )
{
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
EE_SELECTION& selection = selTool->GetSelection();
SCH_MARKER* marker = nullptr;
if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
marker = static_cast<SCH_MARKER*>( selection.Front() );
if( m_ercDialog )
{
// Let the ERC dialog handle it since it has more update hassles to worry about
m_ercDialog->ExcludeMarker();
// Note that if marker is nullptr the dialog will exclude whichever marker is selected
// in the dialog itself
m_ercDialog->ExcludeMarker( marker );
}
else
else if( marker != nullptr )
{
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
EE_SELECTION& selection = selTool->GetSelection();
if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
{
SCH_MARKER* marker = static_cast<SCH_MARKER*>( selection.Front() );
marker->SetExcluded( true );
m_frame->GetCanvas()->GetView()->Update( marker );
m_frame->GetCanvas()->Refresh();
m_frame->OnModify();
}
marker->SetExcluded( true );
m_frame->GetCanvas()->GetView()->Update( marker );
m_frame->GetCanvas()->Refresh();
m_frame->OnModify();
}
return 0;
+7 -3
View File
@@ -385,6 +385,7 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
controls->SetAutoPan( false );
controls->CaptureCursor( false );
setEditedPoint( nullptr );
if( m_editPoints )
{
@@ -515,7 +516,10 @@ void EE_POINT_EDITOR::updateParentItem() const
shape->GetPolyShape().NewOutline();
for( unsigned i = 0; i < m_editPoints->PointsSize(); ++i )
shape->GetPolyShape().Append( mapCoords( m_editPoints->Point( i ).GetPosition() ) );
{
wxPoint pt = mapCoords( m_editPoints->Point( i ).GetPosition() );
shape->GetPolyShape().Append( pt.x, pt.y, -1, -1, true );
}
break;
@@ -633,7 +637,7 @@ void EE_POINT_EDITOR::updateParentItem() const
else if( connected.second == ENDPOINT )
static_cast<SCH_LINE*>( connected.first )->SetEndPoint( line->GetPosition() );
getView()->Update( connected.first, KIGFX::GEOMETRY );
updateItem( connected.first, true );
}
connected = m_editPoints->Point( LINE_END ).GetConnected();
@@ -645,7 +649,7 @@ void EE_POINT_EDITOR::updateParentItem() const
else if( connected.second == ENDPOINT )
static_cast<SCH_LINE*>( connected.first )->SetEndPoint( line->GetEndPoint() );
getView()->Update( connected.first, KIGFX::GEOMETRY );
updateItem( connected.first, true );
}
}
break;
+1 -1
View File
@@ -75,7 +75,7 @@ EDA_RECT EE_SELECTION::GetBoundingBox() const
{
bbox.Merge( static_cast<SCH_SYMBOL*>( item )->GetBoundingBox() );
}
catch( const boost::bad_pointer& exc )
catch( const boost::bad_pointer& )
{
wxFAIL_MSG( "Invalid pointer." );
}
+10
View File
@@ -45,6 +45,7 @@
#include <sch_item.h>
#include <sch_line.h>
#include <sch_junction.h>
#include <sch_marker.h>
#include <sch_sheet.h>
#include <sch_sheet_pin.h>
#include <lib_shape.h>
@@ -107,6 +108,15 @@ SELECTION_CONDITION EE_CONDITIONS::SingleMultiUnitSymbol = []( const SELECTION&
};
SELECTION_CONDITION EE_CONDITIONS::SingleNonExcludedMarker = []( const SELECTION& aSel )
{
if( aSel.CountType( SCH_MARKER_T ) != 1 )
return false;
return !static_cast<SCH_MARKER*>( aSel.Front() )->IsExcluded();
};
#define HITTEST_THRESHOLD_PIXELS 5
+1
View File
@@ -49,6 +49,7 @@ public:
static SELECTION_CONDITION SingleSymbolOrPower;
static SELECTION_CONDITION SingleDeMorganSymbol;
static SELECTION_CONDITION SingleMultiUnitSymbol;
static SELECTION_CONDITION SingleNonExcludedMarker;
};
+2 -2
View File
@@ -469,13 +469,13 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
std::sort( paths.begin(), paths.end(), [] ( const SCH_SHEET_PATH* lhs,
const SCH_SHEET_PATH* rhs ) -> bool
{
int retval = lhs->ComparePageNumAndName( *rhs );
int retval = lhs->ComparePageNum( *rhs );
if( retval < 0 )
return true;
else if( retval > 0 )
return false;
else /// Enforce strict ordering. If the name and number are the same, we use UUIDs
else /// Enforce strict ordering. If the page numbers are the same, use UUIDs
return lhs->GetCurrentHash() < rhs->GetCurrentHash();
} );
+1 -1
View File
@@ -305,7 +305,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
moveItem( item, delta );
updateItem( item, false );
isPasted |= item->GetFlags() & IS_PASTED;
isPasted |= ( item->GetFlags() & IS_PASTED ) != 0;
item->ClearFlags( IS_PASTED );
}
@@ -339,6 +339,9 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
}
else if( evt->IsClick( BUT_LEFT ) && !item )
{
// Update in case the symbol was changed while the tool was running
symbol = m_frame->GetCurSymbol();
if( !symbol )
continue;
@@ -361,6 +364,12 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
else if( item && ( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT )
|| evt->IsAction( &EE_ACTIONS::finishDrawing ) ) )
{
if( symbol != m_frame->GetCurSymbol() )
{
symbol = m_frame->GetCurSymbol();
item->SetParent( symbol );
}
if( evt->IsDblClick( BUT_LEFT ) || evt->IsAction( &EE_ACTIONS::finishDrawing )
|| !item->ContinueEdit( wxPoint( cursorPos.x, -cursorPos.y ) ) )
{
+11 -5
View File
@@ -82,11 +82,13 @@ set( GERBVIEW_EXTRA_SRCS
${CMAKE_SOURCE_DIR}/common/page_info.cpp
)
if( MINGW )
# GERBVIEW_RESOURCES variable is set by the macro.
mingw_resource_compiler( gerbview )
else()
set( GERBVIEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/gerbview.rc )
if( WIN32 )
if( MINGW )
# GERBVIEW_RESOURCES variable is set by the macro.
mingw_resource_compiler( gerbview )
else()
set( GERBVIEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/gerbview.rc )
endif()
endif()
if( APPLE )
@@ -205,6 +207,10 @@ if( APPLE )
" COMPONENT Runtime
)
else()
if( MSVC )
target_sources( gerbview_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/gerbview-dll.rc )
endif()
install( TARGETS gerbview
DESTINATION ${KICAD_BIN}
COMPONENT binary
+5 -2
View File
@@ -35,7 +35,7 @@ class NETCLASSES;
class PANEL_SETUP_NETCLASSES : public PANEL_SETUP_NETCLASSES_BASE
{
public:
PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSES* aNetclasses,
PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_FRAME* aFrame, NETCLASSES* aNetclasses,
const std::vector<wxString>& aNetNames, bool isEEschema );
~PANEL_SETUP_NETCLASSES( ) override;
@@ -60,6 +60,8 @@ private:
void OnAssignAll( wxCommandEvent& event ) override { doAssignments( true ); }
void OnAssignSelected( wxCommandEvent& event ) override { doAssignments( false ); }
void onUnitsChanged( wxCommandEvent& aEvent );
bool validateNetclassName( int aRow, const wxString& aName, bool focusFirst = true );
void rebuildNetclassDropdowns();
@@ -71,7 +73,8 @@ private:
void AdjustNetclassGridColumns( int aWidth );
void AdjustMembershipGridColumns( int aWidth );
PAGED_DIALOG* m_Parent;
EDA_DRAW_FRAME* m_frame;
PAGED_DIALOG* m_parent;
NETCLASSES* m_netclasses;
std::vector<wxString> m_netNames;
+6 -1
View File
@@ -288,7 +288,12 @@ protected:
void beginEdit( const wxPoint& aStartPoint );
bool continueEdit( const wxPoint& aPosition );
void calcEdit( const wxPoint& aPosition );
void endEdit();
/**
* Finishes editing the shape.
* @param aClosed Should polygon shapes be closed (yes for pcbnew/fpeditor, no for libedit)
*/
void endEdit( bool aClosed = true );
void setEditState( int aState ) { m_editState = aState; }
protected:
+2
View File
@@ -331,11 +331,13 @@ private:
VERTEX_MANAGER* m_cachedManager; ///< Container for storing cached VERTEX_ITEMs
VERTEX_MANAGER* m_nonCachedManager; ///< Container for storing non-cached VERTEX_ITEMs
VERTEX_MANAGER* m_overlayManager; ///< Container for storing overlaid VERTEX_ITEMs
VERTEX_MANAGER* m_tempManager; ///< Container for storing temp (diff mode) VERTEX_ITEMs
// Framebuffer & compositing
OPENGL_COMPOSITOR* m_compositor; ///< Handles multiple rendering targets
unsigned int m_mainBuffer; ///< Main rendering target
unsigned int m_overlayBuffer; ///< Auxiliary rendering target (for menus etc.)
unsigned int m_tempBuffer; ///< Temporary rendering target (for diffing etc.)
RENDER_TARGET m_currentTarget; ///< Current rendering target
// Shader
+8 -8
View File
@@ -25,6 +25,7 @@
#define GL_UTILS_H
#include <gal/opengl/kiglew.h> // Must be included first
#include <wx/glcanvas.h>
#include <wx/utils.h>
#include <limits>
@@ -44,19 +45,18 @@ public:
/// Windows would include <wglext.h> and call wglSwapIntervalEXT
#if defined( __linux__ ) && !defined( KICAD_USE_EGL )
/// Do not try to set the swapping over remote connections
/// Video drivers lie and then crash when they can't handle the adaptive swapping
if( wxGetEnv( wxT( "SSH_CONNECTION"), nullptr ) )
return 0;
Display *dpy = glXGetCurrentDisplay();
GLXDrawable drawable = glXGetCurrentDrawable();
std::string vendor( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) );
bool is_mesa = ( vendor.find( "Mesa" ) != std::string::npos );
if( glXSwapIntervalEXT && glXQueryDrawable && dpy && drawable )
if( !is_mesa && glXSwapIntervalEXT && glXQueryDrawable && dpy && drawable )
{
std::string exts( glXQueryExtensionsString( dpy, DefaultScreen( dpy ) ) );
if( aVal < 0 )
{
if( !GLX_EXT_swap_control_tear )
if( exts.find( "GLX_EXT_swap_control_tear" ) == std::string::npos )
{
aVal = 0;
}
@@ -66,7 +66,7 @@ public:
// we need to be sure that late/adaptive swaps are
// enabled on the drawable.
unsigned lateSwapsEnabled;
unsigned lateSwapsEnabled = 0;
glXQueryDrawable( dpy, drawable, GLX_LATE_SWAPS_TEAR_EXT, &lateSwapsEnabled );
if( !lateSwapsEnabled )
+1
View File
@@ -64,6 +64,7 @@ public:
* The scaling factor to convert polygonal shape coordinates to internal units.
*/
int MarkerScale() const { return m_scalingFactor; }
void SetMarkerScale( int aScale ) { m_scalingFactor = aScale; }
/**
* Return the shape polygon in internal units in a #SHAPE_LINE_CHAIN the coordinates
+1 -1
View File
@@ -242,7 +242,7 @@ public:
void DoTraceUtf8( const wxString aWhat, const wxChar* aFmt, ... )
{
va_list argptr;
va_start( argptr, format );
va_start( argptr, aFmt );
traceV( aWhat, aFmt, argptr );
va_end( argptr );
}
+7 -5
View File
@@ -38,11 +38,13 @@ set( KICAD_SRCS
tools/kicad_manager_control.cpp
)
if( MINGW )
# KICAD_RESOURCES variable is set by the macro.
mingw_resource_compiler( kicad )
else()
set( KICAD_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/kicad.rc )
if( WIN32 )
if( MINGW )
# KICAD_RESOURCES variable is set by the macro.
mingw_resource_compiler( kicad )
else()
set( KICAD_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/kicad.rc )
endif()
endif()
if( APPLE )
@@ -297,6 +297,7 @@ void DIALOG_TEMPLATE_SELECTOR::replaceCurrentPage()
buildPageContent( m_tcTemplatePath->GetValue(), page );
m_selectedWidget = nullptr;
PostSizeEvent(); // A easy way to froce refresh displays
}
-3
View File
@@ -415,9 +415,6 @@ bool KICAD_MANAGER_FRAME::CloseProject( bool aSave )
if( !Kiway().PlayersClose( false ) )
return false;
// Give a timeslice for the save-changes? dialog (and for the project to actually close)
wxSafeYield();
// Save the project file for the currently loaded project.
if( m_active_project )
{
+2 -2
View File
@@ -561,7 +561,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent )
if( dlg.ShowModal() == wxID_CANCEL )
return -1;
wxFileName newProjectDir( dlg.GetPath() );
wxFileName newProjectDir( dlg.GetPath(), wxEmptyString );
if( !newProjectDir.IsAbsolute() )
newProjectDir.MakeAbsolute();
@@ -592,7 +592,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent )
}
const wxString& newProjectDirPath = newProjectDir.GetFullPath();
const wxString& newProjectName = newProjectDir.GetName();
const wxString& newProjectName = newProjectDir.GetDirs().Last();
wxDir currentProjectDir( currentProjectDirPath );
SAVE_AS_TRAVERSER traverser( m_frame, currentProjectDirPath, currentProjectName,
+1
View File
@@ -21,6 +21,7 @@ set( KIMATH_SRCS
src/geometry/shape_segment.cpp
src/math/vector2.cpp
src/math/util.cpp
)
+1 -1
View File
@@ -287,7 +287,7 @@ public:
return std::abs( dist1 ) <= 1 && std::abs( dist2 ) <= 1;
}
bool ApproxParallel ( const SEG& aSeg, int aDistanceThreshold = 1 ) const
bool ApproxParallel( const SEG& aSeg, int aDistanceThreshold = 1 ) const
{
ecoord p, q, r;
CanonicalCoefs( p, q, r );
+18 -1
View File
@@ -617,12 +617,29 @@ std::ostream& operator<<( std::ostream& aStream, const VECTOR2<T>& aVector )
return aStream;
}
/* Default specializations */
typedef VECTOR2<double> VECTOR2D;
typedef VECTOR2<int> VECTOR2I;
typedef VECTOR2<unsigned int> VECTOR2U;
/* STL specializations */
namespace std
{
// Required to enable correct use in std::map/unordered_map
template <>
struct hash<VECTOR2I>
{
size_t operator()( const VECTOR2I& k ) const;
};
// Required to enable use of std::hash with maps
template <>
struct less<VECTOR2I>
{
bool operator()( const VECTOR2I& aA, const VECTOR2I& aB ) const;
};
}
/* Compatibility typedefs */
// FIXME should be removed to avoid multiple typedefs for the same type
typedef VECTOR2<double> DPOINT;
+40
View File
@@ -0,0 +1,40 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* 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
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <math/vector2d.h>
size_t std::hash<VECTOR2I>::operator()( const VECTOR2I& k ) const
{
auto xhash = std::hash<int>()( k.x );
// 0x9e3779b9 is 2^33 / ( 1 + sqrt(5) )
// Adding this value ensures that consecutive bits of y will not be close to each other
// decreasing the likelihood of hash collision in similar values of x and y
return xhash ^ ( std::hash<int>()( k.y ) + 0x9e3779b9 + ( xhash << 6 ) + ( xhash >> 2 ) );
}
bool std::less<VECTOR2I>::operator()( const VECTOR2I& aA, const VECTOR2I& aB ) const
{
if( aA.x == aB.x )
return aA.y < aB.y;
return aA.x < aB.x;
}
+11 -6
View File
@@ -51,12 +51,13 @@ set( PL_EDITOR_EXTRA_SRCS
${CMAKE_SOURCE_DIR}/common/page_info.cpp
)
if( MINGW )
# PL_EDITOR_RESOURCES variable is set by the macro.
mingw_resource_compiler( pl_editor )
else()
set( PL_EDITOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor.rc )
if( WIN32 )
if( MINGW )
# PL_EDITOR_RESOURCES variable is set by the macro.
mingw_resource_compiler( pl_editor )
else()
set( PL_EDITOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor.rc )
endif()
endif()
@@ -157,6 +158,10 @@ if( APPLE )
" COMPONENT Runtime
)
else()
if( MSVC )
target_sources( pl_editor_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor-dll.rc )
endif()
install( TARGETS pl_editor
DESTINATION ${KICAD_BIN}
COMPONENT binary
+12 -5
View File
@@ -49,11 +49,13 @@ set( PCB_CALCULATOR_SRCS
../common/env_vars.cpp # needed on MSW to avoid a link issue (a symbol not found)
)
if( MINGW )
# PCB_CALCULATOR_RESOURCES variable is set by the macro.
mingw_resource_compiler( pcb_calculator )
else()
set( PCB_CALCULATOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator.rc )
if( WIN32 )
if( MINGW )
# PCB_CALCULATOR_RESOURCES variable is set by the macro.
mingw_resource_compiler( pcb_calculator )
else()
set( PCB_CALCULATOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator.rc )
endif()
endif()
if( APPLE )
@@ -92,6 +94,7 @@ add_library( pcb_calculator_kiface MODULE
pcb_calculator.cpp
${PCB_CALCULATOR_SRCS}
)
set_target_properties( pcb_calculator_kiface PROPERTIES
OUTPUT_NAME pcb_calculator
PREFIX ${KIFACE_PREFIX}
@@ -145,6 +148,10 @@ if( APPLE )
" COMPONENT Runtime
)
else()
if( MSVC )
target_sources( pcb_calculator_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator-dll.rc )
endif()
install( TARGETS pcb_calculator
DESTINATION ${KICAD_BIN}
COMPONENT binary
@@ -7,12 +7,12 @@ _HKI( "If you specify the maximum current, then the trace widths will be calcula
"\n"
"The calculations are valid for currents up to 35 A (external) or 17.5 A (internal), temperature rises up to 100 °C, and widths of up to 400 mils (10 mm).\n"
"\n"
"The formula, from IPC 2221, is \n"
"<center>___I = K &sdot; &Delta;T<sup>0.44</sup> &sdot; (W &sdot; H)<sup>0.725</sup>___</center> \n"
"where: \n"
"___I___ is maximum current in A \n"
"___&Delta;T___ is temperature rise above ambient in &deg;C \n"
"___W___ is width in mils \n"
"___H___ is thickness (height) in mils \n"
"___K___ is 0.024 for internal traces or 0.048 for external traces \n"
"The formula, from IPC 2221, is\n"
"<center>___I = K &middot; &Delta;T<sup>0.44</sup> &middot; (W &middot; H)<sup>0.725</sup>___</center>\n"
"where:<br>\n"
"___I___ is maximum current in A<br>\n"
"___&Delta;T___ is temperature rise above ambient in &deg;C<br>\n"
"___W___ is width in mils<br>\n"
"___H___ is thickness (height) in mils<br>\n"
"___K___ is 0.024 for internal traces or 0.048 for external traces\n"
"" );
@@ -6,11 +6,11 @@ The controlling value is shown in bold.
The calculations are valid for currents up to 35 A (external) or 17.5 A (internal), temperature rises up to 100 °C, and widths of up to 400 mils (10 mm).
The formula, from IPC 2221, is
<center>___I = K &sdot; &Delta;T<sup>0.44</sup> &sdot; (W &sdot; H)<sup>0.725</sup>___</center>
where:
___I___ is maximum current in A
___&Delta;T___ is temperature rise above ambient in &deg;C
___W___ is width in mils
___H___ is thickness (height) in mils
___K___ is 0.024 for internal traces or 0.048 for external traces
The formula, from IPC 2221, is
<center>___I = K &middot; &Delta;T<sup>0.44</sup> &middot; (W &middot; H)<sup>0.725</sup>___</center>
where:<br>
___I___ is maximum current in A<br>
___&Delta;T___ is temperature rise above ambient in &deg;C<br>
___W___ is width in mils<br>
___H___ is thickness (height) in mils<br>
___K___ is 0.024 for internal traces or 0.048 for external traces
+11 -6
View File
@@ -547,12 +547,13 @@ if( DOXYGEN_FOUND )
)
endif()
if( MINGW )
# PCBNEW_RESOURCES variable is set by the macro.
mingw_resource_compiler( pcbnew )
else()
set( PCBNEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew.rc )
if( WIN32 )
if( MINGW )
# PCBNEW_RESOURCES variable is set by the macro.
mingw_resource_compiler( pcbnew )
else()
set( PCBNEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew.rc )
endif()
endif()
@@ -766,6 +767,10 @@ if( APPLE )
" COMPONENT Runtime
)
else()
if( MSVC )
target_sources( pcbnew_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew-dll.rc )
endif()
install( TARGETS pcbnew
DESTINATION ${KICAD_BIN}
COMPONENT binary
+5
View File
@@ -119,12 +119,17 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
int changeFlags = ent.m_type & CHT_FLAGS;
BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( ent.m_item );
wxASSERT( ent.m_item );
// Module items need to be saved in the undo buffer before modification
if( m_isFootprintEditor )
{
// Be sure that we are storing a footprint
if( ent.m_item->Type() != PCB_FOOTPRINT_T )
{
ent.m_item = ent.m_item->GetParent();
wxASSERT( ent.m_item );
}
// We have not saved the footprint yet, so let's create an entry
if( savedModules.count( ent.m_item ) == 0 )
@@ -215,12 +215,12 @@ void PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness( wxCommandEvent& eve
if( items_candidate.size() )
{
int thickness_layer = ( iu_thickness - min_thickness ) / items_candidate.size();
wxString txt = StringFromValue( m_frame->GetUserUnits(), thickness_layer );
wxString txt = StringFromValue( m_frame->GetUserUnits(), thickness_layer, true );
for( BOARD_STACKUP_ROW_UI_ITEM* ui_item : items_candidate )
{
wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item->m_ThicknessCtrl );
textCtrl->SetValue( txt );
textCtrl->ChangeValue( txt );
}
}
else
@@ -461,7 +461,7 @@ void PANEL_SETUP_BOARD_STACKUP::computeBoardThickness()
// The text in the event will translate to the value for the text control
// and is only updated if it changed
m_tcCTValue->SetValue( thicknessStr );
m_tcCTValue->ChangeValue( thicknessStr );
}
@@ -516,9 +516,9 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
if( matName )
{
if( IsPrmSpecified( item->GetMaterial( sub_item ) ) )
matName->SetValue( item->GetMaterial( sub_item ) );
matName->ChangeValue( item->GetMaterial( sub_item ) );
else
matName->SetValue( wxGetTranslation( NotSpecifiedPrm() ) );
matName->ChangeValue( wxGetTranslation( NotSpecifiedPrm() ) );
}
}
@@ -527,7 +527,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_ThicknessCtrl );
if( textCtrl )
textCtrl->SetValue( StringFromValue( m_units,
textCtrl->ChangeValue( StringFromValue( m_units,
item->GetThickness( sub_item ), true ) );
if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
@@ -582,7 +582,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_EpsilonCtrl );
if( textCtrl )
textCtrl->SetValue( txt );
textCtrl->ChangeValue( txt );
}
if( item->HasLossTangentValue() )
@@ -591,7 +591,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_LossTgCtrl );
if( textCtrl )
textCtrl->SetValue( txt );
textCtrl->ChangeValue( txt );
}
}
@@ -655,9 +655,9 @@ void PANEL_SETUP_BOARD_STACKUP::addMaterialChooser( wxWindowID aId, const wxStri
if( aMaterialName )
{
if( IsPrmSpecified( *aMaterialName ) )
textCtrl->SetValue( *aMaterialName );
textCtrl->ChangeValue( *aMaterialName );
else
textCtrl->SetValue( wxGetTranslation( NotSpecifiedPrm() ) );
textCtrl->ChangeValue( wxGetTranslation( NotSpecifiedPrm() ) );
}
textCtrl->SetMinSize( m_numericTextCtrlSize );
@@ -769,7 +769,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
{
wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, ID_ITEM_THICKNESS+row );
textCtrl->SetMinSize( m_numericTextCtrlSize );
textCtrl->SetValue( StringFromValue( m_units, item->GetThickness( aSublayerIdx ), true ) );
textCtrl->ChangeValue( StringFromValue( m_units, item->GetThickness( aSublayerIdx ), true ) );
m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
m_controlItemsList.push_back( textCtrl );
textCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED,
@@ -838,7 +838,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
wxString txt = Double2Str( item->GetEpsilonR( aSublayerIdx ) );
wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY, wxEmptyString,
wxDefaultPosition, m_numericFieldsSize );
textCtrl->SetValue( txt );
textCtrl->ChangeValue( txt );
m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
ui_row_item.m_EpsilonCtrl = textCtrl;
}
@@ -852,7 +852,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
wxString txt = Double2Str( item->GetLossTangent( aSublayerIdx ) );;
wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY, wxEmptyString,
wxDefaultPosition, m_numericFieldsSize );
textCtrl->SetValue( txt );
textCtrl->ChangeValue( txt );
m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
ui_row_item.m_LossTgCtrl = textCtrl;
}
@@ -1358,7 +1358,7 @@ void PANEL_SETUP_BOARD_STACKUP::onMaterialChange( wxCommandEvent& event )
wxTextCtrl* textCtrl;
textCtrl = static_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_MaterialCtrl );
textCtrl->SetValue( item->GetMaterial( sub_item ) );
textCtrl->ChangeValue( item->GetMaterial( sub_item ) );
// some layers have a material choice but not EpsilonR ctrl
if( item->HasEpsilonRValue() )
@@ -1366,7 +1366,7 @@ void PANEL_SETUP_BOARD_STACKUP::onMaterialChange( wxCommandEvent& event )
textCtrl = dynamic_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_EpsilonCtrl );
if( textCtrl )
textCtrl->SetValue( item->FormatEpsilonR( sub_item ) );
textCtrl->ChangeValue( item->FormatEpsilonR( sub_item ) );
}
// some layers have a material choice but not loss tg ctrl
@@ -1375,7 +1375,7 @@ void PANEL_SETUP_BOARD_STACKUP::onMaterialChange( wxCommandEvent& event )
textCtrl = dynamic_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_LossTgCtrl );
if( textCtrl )
textCtrl->SetValue( item->FormatLossTangent( sub_item ) );
textCtrl->ChangeValue( item->FormatLossTangent( sub_item ) );
}
}
@@ -1438,12 +1438,14 @@ wxColor PANEL_SETUP_BOARD_STACKUP::getColorIconItem( int aRow )
void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow )
{
// explicit depth important under MSW. We use R,V,B 24 bits/pixel bitmap
const int bitmap_depth = 24;
if( aRow >= 0 )
{
wxStaticBitmap* st_bitmap = m_rowUiItemsList[aRow].m_Icon;
// explicit depth important under MSW
wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, 28 );
wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, bitmap_depth );
drawBitmap( bmp, getColorIconItem( aRow ) );
st_bitmap->SetBitmap( bmp );
return;
@@ -1451,8 +1453,7 @@ void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow )
for( unsigned row = 0; row < m_rowUiItemsList.size(); row++ )
{
// explicit depth important under MSW
wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, 28 );
wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, bitmap_depth );
drawBitmap( bmp, getColorIconItem( row ) );
m_rowUiItemsList[row].m_Icon->SetBitmap( bmp );
}
+3
View File
@@ -121,6 +121,9 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
for( FOOTPRINT* footprint : GetBoard()->Footprints() )
{
if( footprint->GetAttributes() & FP_EXCLUDE_FROM_BOM )
continue;
bool valExist = false;
// try to find component in existing list
+2 -2
View File
@@ -431,7 +431,7 @@ void reportProgress( PROGRESS_REPORTER* aReporter, int aCount, int aSize, int aD
void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
{
int delta = 100; // Number of additions between 2 calls to the progress bar
int delta = 200; // Number of additions between 2 calls to the progress bar
int ii = 0;
int size = 0;
@@ -443,7 +443,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
size *= 2; // Our caller us gets the other half of the progress bar
delta = std::max( delta, size / 50 );
delta = std::max( delta, size / 10 );
for( ZONE* zone : aBoard->Zones() )
{
+13
View File
@@ -36,6 +36,7 @@
#include <connectivity/from_to_cache.h>
#include <ratsnest/ratsnest_data.h>
#include <progress_reporter.h>
#include <trigo.h>
CONNECTIVITY_DATA::CONNECTIVITY_DATA()
@@ -99,7 +100,19 @@ void CONNECTIVITY_DATA::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
if( net->GetNetClass()->GetName() != NETCLASS::Default )
m_netclassMap[ net->GetNetCode() ] = net->GetNetClass()->GetName();
if( aReporter )
{
aReporter->SetCurrentProgress( 0.75 );
aReporter->KeepRefreshing( false );
}
RecalculateRatsnest();
if( aReporter )
{
aReporter->SetCurrentProgress( 1.0 );
aReporter->KeepRefreshing( false );
}
}
+4 -4
View File
@@ -68,7 +68,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
m_severities = new PANEL_SETUP_SEVERITIES( this, DRC_ITEM::GetItemsWithSeverities(),
bds.m_DRCSeverities );
m_netclasses = new PANEL_SETUP_NETCLASSES( this, &bds.GetNetClasses(),
m_netclasses = new PANEL_SETUP_NETCLASSES( this, aFrame, &bds.GetNetClasses(),
board->GetNetClassAssignmentCandidates(), false );
m_textVars = new PANEL_TEXT_VARIABLES( m_treebook, &Prj() );
@@ -77,7 +77,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
* WARNING: If you change page names you MUST update calls to ShowBoardSetupDialog().
*/
m_treebook->AddPage( new wxPanel( this ), _( "Board Stackup" ) );
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Board Stackup" ) );
m_currentPage = -1;
@@ -97,11 +97,11 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
m_treebook->AddSubPage( m_boardFinish, _( "Board Finish" ) );
m_treebook->AddSubPage( m_maskAndPaste, _( "Solder Mask/Paste" ) );
m_treebook->AddPage( new wxPanel( this ), _( "Text & Graphics" ) );
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Text & Graphics" ) );
m_treebook->AddSubPage( m_textAndGraphics, _( "Defaults" ) );
m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) );
m_treebook->AddPage( new wxPanel( this ), _( "Design Rules" ) );
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Design Rules" ) );
m_treebook->AddSubPage( m_constraints, _( "Constraints" ) );
m_treebook->AddSubPage( m_tracksAndVias, _( "Pre-defined Sizes" ) );
m_treebook->AddSubPage( m_netclasses, _( "Net Classes" ) );
@@ -81,7 +81,7 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
for( size_t i = 0; i < m_NoteBook->GetPageCount(); ++i )
m_macHack.push_back( true );
m_texts = new FP_TEXT_GRID_TABLE( m_units, m_frame );
m_texts = new FP_TEXT_GRID_TABLE( m_frame );
m_delayedErrorMessage = wxEmptyString;
m_delayedFocusGrid = nullptr;

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