Compare commits

...

246 Commits
master ... 5.0

Author SHA1 Message Date
jean-pierre charras 24ab8141ae Gerber output: fix a potential minor issue in a G04 line comment.
In gbr files only ASCII7 chars are allowed.
However, in a comment line a UTF8 string is used. It should not create issues, but it is incorrect.
2019-01-27 10:11:03 +01:00
jean-pierre charras 7848c3acf3 Fix cross-probing issue (not working) when a net name or a pin name contains a space. 2019-01-24 16:59:34 +01:00
jean-pierre charras 752cc43fb8 Fix 2 minor wxWidgets alerts. 2019-01-21 19:53:40 +01:00
jean-pierre charras cf5d3ae43f Pcbnew: fix missing initialization in PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
the stroke mode was always activated, even in fill mode. creating incorrect size shape for null length track segments.
2019-01-20 10:10:18 +01:00
jean-pierre charras e22113ccef * Toolbars with wxChoice: Fix incorrect ReCreate Toolbar methods: they recreated these wxChoice without deleting the previously created.
This issue created memory leak and not working wxChoice (for instance after modifying the language selection).
Now, they are created only once, never recreated.
2019-01-20 10:07:23 +01:00
joel-bertrand-JKB 35dc387fc6 Fix duplicate directives in Spice netlist inside .control ... .endc
Fixes: lp:1812082
https://bugs.launchpad.net/kicad/+bug/1812082
2019-01-16 19:54:55 +01:00
Wayne Stambaugh 025578fee7 Do not set wxSetAssertHandler on non-debug builds.
Fixes lp:1809622

https://bugs.launchpad.net/kicad/+bug/1809622
2019-01-15 09:34:32 -05:00
Wayne Stambaugh 45a3d86d36 Eeschema: fix schematic symbol parsing bug.
Schematic symbol library link names are unquoted strings that can
contain non-ascii characters which breaks the parser.  Converting
the line to uft-8 before breaking the string into tokens resolves
the issue.

(cherry picked from commit b8de4e73bf)
2019-01-08 12:26:21 -05:00
Wayne Stambaugh 9f1b6680a2 Eeschema: fix library symbol pin definition parsing bug.
Pin names are unquoted strings that can contain non-ascii characters
which breaks the parser.  Converting the line to uft-8 before breaking
the string into tokens resolves the issue.

(cherry picked from commit 742961119d)
2019-01-08 12:25:24 -05:00
Wayne Stambaugh 385eb49cb2 Fix schematic append clear annotation bug.
Clear the annotation of only the appended schematic and any sheets in it's
hierarchy.  Do not clear the annotation of the symbols in the target sheet.

Fixes lp:1805695

https://bugs.launchpad.net/kicad/+bug/1805695

(cherry picked from commit 07ebc4df14)
2019-01-08 11:55:05 -05:00
Wayne Stambaugh 61b94c8c2c Eeschema: fix UTF8 character handling bug in legacy parser.
Iterating over unquoted strings as ASCII8 fails when ' ' character is
not the LSB of a UTF8 string with wide characters.  Change parsing method
for unquoted strings to convert the entire line as UTF8 and then use
wxStringTokenizer to break the line into tokens at the ' ' characters.

Fixes lp:1806206

https://bugs.launchpad.net/kicad/+bug/1806206

(cherry picked from commit a61a51f26e)
2019-01-08 11:54:48 -05:00
Seth Hillbrand 4aeef1e09e pcbnew: Check for valid pointer before deref
In legacy toolkit, we do not keep the corner pointers, so dereferencing
causes crashes.

Fixes: lp:1808852
* https://bugs.launchpad.net/kicad/+bug/1808852
2018-12-19 16:53:40 -08:00
jean-pierre charras 93caff0ac1 Remove overzealous assert. 2018-12-16 09:30:30 +01:00
jean-pierre charras 4e3fe6c55d Make DRC markers always selectable.
Fixes: lp:1808181
https://bugs.launchpad.net/kicad/+bug/1808181
2018-12-16 09:30:29 +01:00
Jeff Young 9240a54f4a Allow marker selection in high-contrast mode.
Fixes: lp:1793357
* https://bugs.launchpad.net/kicad/+bug/1793357

(cherry picked from commit 04534c83e0)
2018-12-12 12:15:25 -08:00
jean-pierre charras 4e04468e47 Eagle(.lbr) footprints not listed in Library Browser
Fixes: lp:1807629
https://bugs.launchpad.net/kicad/+bug/1807629
2018-12-11 16:07:26 +01:00
jean-pierre charras 857d038b5d Gerber viewer: Ensure arc interpolation is used only after a arc command. Remove also non existing G command codes. 2018-12-09 18:21:54 +01:00
jean-pierre charras ec1eaf5d2d Gerbview small fix to speed up opengl canvas switch 2018-12-09 18:21:27 +01:00
jean-pierre charras 7134b1c83f Gerber plotter: remove a G01 useless command, and ensure this command exists in plot polygon. 2018-12-09 18:17:47 +01:00
jean-pierre charras bc8739f930 Eeschema: fix incorrect parsing of line color (r v b values). Only the R and V were read, the parsing was stopping before reading the B value. 2018-12-09 18:16:50 +01:00
Maciej Suminski 805bb3160f Fix for dark mode on macOS Mojave
Thanks to Scott Rapson and Justace Clutter for the solution.

Fixes: lp:1797989
* https://bugs.launchpad.net/kicad/+bug/1797989

(cherry picked from commit 766156ed87)
2018-12-07 14:29:22 +01:00
Jeff Young 187d7729ff Don't go to '-' numbering till the range reaches 3.
(cherry picked from commit c4ff17d3ec)
2018-12-03 18:49:03 +00:00
Jeff Young 940b08ab85 Sort references before removing duplicates.
std::unique only works within consecutive blocks, so the list must
be sorted first.  (We need it sorted in the end anyway, so no
big deal.)

(cherry picked from commit 90df7a8b22)
2018-12-03 18:48:37 +00:00
Jeff Young e8c8bf8d11 Fix range-based reference formatter.
Fixes: lp:1792483
* https://bugs.launchpad.net/kicad/+bug/1792483

(cherry picked from commit 243b05b2c3)
2018-12-03 18:48:06 +00:00
Wayne Stambaugh 5d8c3e5033 Start release version 5.0.3 development. 2018-11-26 18:09:49 -05:00
Wayne Stambaugh ec5ed68af8 Tag release version 5.0.2. 2018-11-26 17:59:28 -05:00
jean-pierre charras f66ccfb64f 3D viewer: Fix hanging when a board is displayed in non realistic mode and the body is not shown. 2018-11-26 15:59:54 +01:00
jean-pierre charras 7eac7dcdcb dialog_3D_view_option_base.cpp: fix a minor wxWidgets alert. 2018-11-26 15:59:54 +01:00
Maciej Suminski 1b1a3763d2 PNS: validate SHAPE_LINE_CHAIN before accessing its segments
(cherry picked from commit 4d73cfb8a1)
2018-11-26 08:27:27 +01:00
Seth Hillbrand 50eedcf0b3 MSW Ratsnest: Force marking ratsnest dirty
When updating the status of the ratsnest, we mark its target layer as
dirty to ensure the revised data are used to draw/clear the ratsnest

Fixes: lp:1800301
* https://bugs.launchpad.net/kicad/+bug/1800301
2018-11-23 11:44:33 -08:00
Seth Hillbrand 62561292e9 clipboard: re-add limited LOCALE_IO to SaveSelection
JP notes that there is an issue with comma-based decimal locales and the
SaveSelection that is addressed by having a LOCALE_IO call in a limited
block.

This changed the copy timing of the clipboard and the interaction with
KDE Klipper again.  To address this, we isolate the clipboard open call
to the end of the routine and force a round-trip of the clipboard data
before exiting.

(cherry picked from commit 36a69a7d5d)
2018-11-22 08:17:38 -08:00
Jeff Young 03132cabee Make sure original part record always has the write library nickname.
Fixes: lp:1804293
* https://bugs.launchpad.net/kicad/+bug/1804293

(cherry picked from commit 023a445e9f)
2018-11-21 23:24:13 +00:00
Seth Hillbrand 82c9e54735 pcbnew: Set clipboard locale to avoid Klipper crash
Klipper seems to poll at odd times.  When we copy to wxTheClipboard
in one locale and Klipper extracts data in a different locale, it throws
an XError.  We don't need the extra LOCALE_IO calls as Format() uses its
own LOCALE_IO setting.

Fixes: lp:1800648
* https://bugs.launchpad.net/kicad/+bug/1800648

(cherry picked from commit 964d6ebc06)
2018-11-21 12:03:11 -08:00
Seth Hillbrand c0d9b9ab81 ratsnest: Fix state issue switching in local tool
The ratsnest layer needs to be always enabled in GAL rather than taken
from the board settings.  This also adds a finalize handler to the
picker tool that allows a picker-caller to perform a specific action
when the picker tool exits.  In this case, we use it to clear the local
ratsnest selections back to the default.

Fixes: lp:1800301
* https://bugs.launchpad.net/kicad/+bug/1800301
2018-11-20 20:13:15 -08:00
Jeff Young daf4985a60 Don't trim entire wires.
Fixes: lp:1804297
* https://bugs.launchpad.net/kicad/+bug/1804297

(cherry picked from commit ae6989f3a1)
2018-11-20 22:03:04 +00:00
Seth Hillbrand b1805dd254 Ratsnest: Force update after modifying visible nets
After adjusting the ratsnest, we force the view update to re-draw the
ratsnest to the screen.  This is not required for Linux but seems to
have no ill effects and may help MSW show local ratsnest changes.

Possibly related to lp:1800301
2018-11-19 21:12:47 -08:00
Jeff Young 66b0aca696 Don't leave a selection with a deleted item in it.
Fixes: lp:1803730
* https://bugs.launchpad.net/kicad/+bug/1803730

(cherry picked from commit 5bb5aea936)
2018-11-19 16:07:41 +00:00
Seth Hillbrand 22fbf30f22 Ratsnest: Improve show heuristics
When the local ratsnest tool is used, it should toggle the state based
on the global ratsnest visibility.  After changing state, the layer
cache is marked as well.

Possibly related to lp:1800301
2018-11-18 19:57:37 -08:00
Mario Luzeiro f3d1f31e1d Fixes 3D Viewer: Raytracing line artifact, lp:1680530 2018-11-14 09:53:39 -05:00
jean-pierre charras 9610f8f208 NC drill (Excellon) exporter: remove useless M71 / M72 lines. They are probably incorrect in V2 format, and the format is already specified. 2018-11-11 20:29:48 +01:00
jean-pierre charras 76adf7dbe8 Gerbview: NC drill file reader: add support for routing mode, used by latest Kicad version.
From master branch commit 4136aca221
2018-11-10 10:28:37 +01:00
jean-pierre charras 3f32f0be9e Gerbview: minor fixes from master branch. 2018-11-10 09:29:21 +01:00
Seth Hillbrand a77caa6baa pcbnew: Connectivity threads update
This is a melded cherry-pick of the following commits from 5.1

59fb6d8851
ed1c8eee9e
4a730e6c54

This implements the std::async connecitivty and locking for the 5.0
branch
2018-11-07 12:33:30 -08:00
Seth Hillbrand 0b5ca1a883 ratsnest: Move ratsnest connectivity to async
This a partial pick of 59fb6d8851 but
revised for the 5.0.x branch.
2018-11-07 12:21:26 -08:00
jean-pierre charras 839ade2c05 Gerber job file: fix incorrect GUID.
Fixes: lp:1801696
https://bugs.launchpad.net/kicad/+bug/1801696
2018-11-06 08:17:22 +01:00
jean-pierre charras 922ce89643 3D viewer: ensure 0 sized circles (that crash the viewer) are skipped. 2018-11-05 08:39:00 +01:00
Seth Hillbrand 78f7ba10ef pcbnew: Prevent degenerate values in Eagle import
Importing Eagle files allowed for invalid zone values for clearance and
minimum width that triggered asserts in the 3d-viewer.

Fixes: lp:1801188
* https://bugs.launchpad.net/kicad/+bug/1801188

(cherry picked from commit df562b7ec0)
2018-11-04 11:03:00 -08:00
Maciej Suminski dd39599903 Link eeschema with ngspice DLL
Adds a link-time dependency for libngspice, so that other tools may
detect ngspice as a KiCad dependency.

The library is still loaded with dlopen() as it gives a way to reload it
in case of problems. The DLL name is recognized during CMake
configuration and used to load the library at runtime.
2018-10-30 08:40:29 +01:00
jean-pierre charras dba32717b1 DIALOG_PLOT_BASE: Fix a minor wxWidgets alert. 2018-10-29 20:46:00 +01:00
jean-pierre charras 57800b934e Kicad, Windows specific: disable a overzealous wxWidgets assert when reading a file.
When reading (and writing) a file, we must switch the current locale to "C" for LC_NUMERIC.
Unfortunately, on Windows, a wxWidgets assert was shown when reading some items (bitmaps images).
This wxWidgets assert (related to decimal separator) is overzealous and is now hidden only when reading/writing files.
2018-10-29 20:34:48 +01:00
jean-pierre charras 4daaaa373c Pcbnew, Gerber output: fix incorrect UUID format in %TF.ProjectId attribute.
Fixes: lp:1800459
https://bugs.launchpad.net/kicad/+bug/1800459
2018-10-29 18:57:39 +01:00
Stefan Brüns 36bb92f844 Use fixed version for libngspice.so.0
CanonicalizeName only adds the lib prefix and .so suffix, so loading
libngspice.so fails until the development package is installed.
MAC/Windows code paths lookup soversion 0 of ngspice as well, as this
is the only compatible version.
2018-10-27 10:57:08 +02:00
Wayne Stambaugh d95ab28db9 Update appdata license fields to reflect the latest license changes. 2018-10-24 11:06:01 -04:00
Wayne Stambaugh 09616fff7a Update license to AGPL due to TTL license.
The decision to include the TTL library make KiCad a derivative work
under the terms of the AGPL version 3 or later license.

Add both the GPL3 and AGPL3 license text files and add a readme file
about the KiCad licensing.  Contributing to KiCad still falls under
the GPL3+ license.

Fixes lp:1797095

https://bugs.launchpad.net/kicad/+bug/1797095
2018-10-24 10:00:10 -04:00
Jeff Young f87a22fefb Add missing radio button to group.
Fixes: lp:1799654
* https://bugs.launchpad.net/kicad/+bug/1799654
2018-10-24 13:35:55 +01:00
Seth Hillbrand 2701bdbbac Prevent excess precision errors on 32-bit builds
The compile flag -ffloat-store requires floating point values to be
stored in memory rather than in registers to prevent errors when two
numbers are compared that were stored in different locations.

(cherry picked from commit 40c70dd008)
2018-10-23 19:25:50 -07:00
Michael Kavanagh 49753d9dad Update Eeschema BOM dialog html help text
Now links to relevant section in stable eeschema docs.

Fixes: lp:1798248
https://bugs.launchpad.net/kicad/+bug/1798248
2018-10-22 13:21:38 -04:00
jean-pierre charras 272b477e91 Opengl: avoid useless wxASSERT when a char is not found in font used to display netnames/padnames
They are replaced by '?'
It happens for some esoteric unicode chars.
2018-10-20 18:50:15 +02:00
jean-pierre charras e453b5b87b Page layout bitmap size wrong in modern/GAL canvases.
The image scale set by pl_editor was not taken in account when drawing the page layout.
2018-10-20 18:31:19 +02:00
jean-pierre charras c08d3baf8c Gerber file generation: remove a optional info in .FileFunction: the layer type. TF.FileFunction,Copper,L1,Top,Signal is now TF.FileFunction,Copper,L1,Top
This param is not useful, and probably never correctly set by users, because is is not used by Pcbnew.
(It is used only for dsn export)
2018-10-19 18:47:23 +02:00
Maciej Suminski 3d9e6867cf Spice netlist exporter: handle multiline directives
Fixes: lp:1797937
* https://bugs.launchpad.net/kicad/+bug/1797937

(cherry-picked from 9757107b)
2018-10-19 17:34:14 +02:00
jean-pierre charras bd1b15ded7 Eeschema, spice netlist exporter: fix an issue that converted spice string commands to lowercase.
Therefore, it can breaks some commands, especially filenames.

Partial fix of bug 1797937.

(cherry-picked from 8f9b0f02)
2018-10-19 17:00:11 +02:00
jean-pierre charras 8f87aae99e Page layout editor: fix a bug in GUI: the PPi setting was not displayed for bitmap items 2018-10-19 13:51:41 +02:00
Seth Hillbrand 43987cc50c UTF8: Fix MSVC builds
MSVC does not support variable length arrays.  Substitute a std::vector
instead.

(cherry picked from commit 6d8a759c75)
2018-10-18 11:50:04 -07:00
Seth Hillbrand 6106210c87 UTF8: Correct MSW issue with previous commit
Linux does not handle the resize command with wide-character extended
table UTF-8.  The solution did not work for W7-32bit.  This is a
compromise, attempting first the preferred, previous solution and
falling back to the secondary solution.
2018-10-17 12:12:49 -07:00
Seth Hillbrand b37bc69476 UTF8: Utilize the safe conversion from wchar
Invalid wchar characters would throw an exception.  We need a defined
output from the += operator, even for unknown character.

Fixes: lp:1798144
* https://bugs.launchpad.net/kicad/+bug/1798144
2018-10-16 16:36:42 -07:00
Seth Hillbrand cccf4cf20b pcbnew: Fix crash when removing polygon corners
GetSelectedRows() returns -1 when no rows are selected.

Fixes: lp:1798095
* https://bugs.launchpad.net/kicad/+bug/1798095
2018-10-16 09:08:03 -07:00
John Beard 99549f816f QA: Remove obsolete fillet refactor tests
These tests are fundamentally broken as they test two fillet
implementations against each other, but the two implementations
no longer have the same interface or meaning (one has a fixed
segment count, one has a fixed error).

This also allows the tests to run on Boost <1.59, which do not
provide the !-syntax for excluding tests. Ubuntu 16 uses
Boost 1.58, so this causes build failures.

Fixes: 1785377
https://bugs.launchpad.net/kicad/+bug/1785377
2018-10-16 09:40:06 -04:00
Seth Hillbrand e34dc4abb1 Revert "pcbnew: Fix memory leak in Eagle importer"
This reverts commit a5bdee747a.
2018-10-14 06:47:20 -07:00
jean-pierre charras 82b37a5cbe Fix an issue (items inside FOOTPRINT_WIZARD_FRAME not displayed) when a more recent Kicad version was run.
This is due to use  of LoadPerspective() that creates many issues when a frame structure changes.
The call to this useless method is just removed.
2018-10-13 10:10:15 +02:00
jean-pierre charras 561dc052ff Update FootprintWizardBase.py according to recent changes in API 2018-10-13 09:39:49 +02:00
jean-pierre charras 553b529fd4 Gerbview: fix a overzealous wxASSERT
Fixes: lp:1796744
https://bugs.launchpad.net/kicad/+bug/1796744
2018-10-09 08:47:16 +02:00
Wayne Stambaugh 7573c6a4e4 Start release version 5.0.2 development 2018-10-08 17:45:02 -04:00
Wayne Stambaugh c000d70a51 Tag release version 5.0.1 2018-10-08 17:14:38 -04:00
Seth Hillbrand 234b01905d eeschema: fix mistaken wire removal bug
The wire between two points should not be trimmed if it starts or ends
on one of the component's connection points.

(cherry picked from commit d2906f7975)
2018-10-08 11:35:12 -07:00
Seth Hillbrand a5bdee747a pcbnew: Fix memory leak in Eagle importer
unqiue_ptr release creates a memory leak unless the returned pointer is
freed.

(cherry picked from commit 45d438cd13)
2018-10-08 11:35:05 -07:00
Seth Hillbrand 9977d0d737 pcbnew: fix pad distance calc in gateways
The pad distance was fixed to 0, making the gateway priority set
artificially to 1

(cherry picked from commit 77eeda4191)
2018-10-08 11:34:46 -07:00
Seth Hillbrand 46f7011463 pcbnew: Zone selection heuristic continuity for edge
If the user is carefully selecting the zone edge, we do not filter the
zone preemptively from our disambiguation list in the same manner as we
do for selecting on zone copper.

Fixes: lp:1796719
* https://bugs.launchpad.net/kicad/+bug/1796719

(cherry picked from commit f11cb736e5)
2018-10-08 11:34:38 -07:00
Wayne Stambaugh 876232aa7a Fix LIB_ID illegal character tests.
The '/' and ':' are reserved and cannot be used in symbol or footprint
names.  They will cause the LIB_ID parser and formatter to fail.  While
it seems like they should be legal in symbol alias names, they will
trigger a symbol rescue the next time the schematic is loaded.

Use ID_SCH as in the Eagle schematic plugin rather than ID_ALIAS to
ensure symbol names do not need rescued the next time the schematic is
opened.

Remove ID_ALIAS since the rules for alias names are the same as the
rules for symbol names.  Otherwise, allowing '/' and ':' in alias names
will force a symbol rescue on the next schematic load.

Fixes lp:1795600

https://bugs.launchpad.net/kicad/+bug/1795600
2018-10-07 15:35:16 -04:00
jean-pierre charras 39c38fb386 Fix a side effect of our LOCALE_IO by using setlocale( LC_NUMERIC, "C" ) instead of setlocale( LC_ALL, "C" ) LC_NUMERIC is the right option to use in LOCALE_IO because only the floating point separator must be modified When using LC_ALL, the Env var expansion wxGetEnv() was not working when the env var contains non ascii7 codes after a call to LOCALE_IO. When using setlocale( LC_NUMERIC, "C" ) in LOCALE_IO, wxGetEnv() works fine.
Fixes: lp:1795990
https://bugs.launchpad.net/kicad/+bug/1795990
2018-10-07 16:27:47 +02:00
jean-pierre charras 99f25b0895 Opengl fix: bitmaps having a width not multiple of 4 were incorrectly drawn.
This fix draws a "sub bitmap" having a width multiple of 4.
(The loss of 1 to 3 pixels in horizontal size should be not really noticeable)

(cherry picked from commit 3a02e54411)
2018-10-06 07:22:38 -07:00
Tomasz Wlostowski a43ec3e3f0 OPENGL_GAL: optimized JP's bitmap drawing function to use textures
(cherry picked from commit 516cf47946)
2018-10-06 07:22:38 -07:00
jean-pierre charras 7b596f0365 GAL canvases: add DrawBitmap(), using a basic brute force algo for OpenGL, and a optimized code for Cairo. In this fix the brute force means draw each pixel as a rectangle. It works fine, but could be optimized.
(cherry picked from commit fefc7b8172)
2018-10-06 07:22:38 -07:00
Seth Hillbrand dd22c73666 pcbnew: Allow deselection when clicking on zone
Deselection by clicking on a zone makes working with plane zones easier
by allowing the selected item to de-selected by clicking on a zone.
Once the selection is cleared, the zone may be re-selected as normal.
Clicking on non-zone items while a separate item is selected will still
select the new non-zone item without requiring a second click.
2018-10-06 07:22:35 -07:00
Seth Hillbrand d15b34988d pcbnew: Adjust selection behavior in highlight net
Prefer non-zones in highlight net in the same way we do for the
selection tool.  Highlight net just has separate logic and was missed
previously.
2018-10-05 19:58:25 -07:00
Seth Hillbrand 5e0ef36719 pcbnew: Improve zone/polygon selection
Allows selection of polygons and zones by their visible area.  Will only
select polygons/filled areas when they are unobstructed by other
elements in the footprint/pcb.  Also adds a "skip heuristics" modifier
key for clicking (ALT) that allows the full disambiguation list to be
displayed without removing less-likely elements.  This dovetails the
zone/polygon selection as it allows selecting even when areas a fully
overlapped.

Fixes: lp:1753153
* https://bugs.launchpad.net/kicad/+bug/1753153

(cherry picked from commit 6a6d580a1c)
2018-10-03 07:22:16 -07:00
jean-pierre charras 6994291997 Re activate Zone Unfill All command, accidentally removed by a previous commit.
Fixes: lp:1795293
https://bugs.launchpad.net/kicad/+bug/1795293
2018-10-01 09:05:08 +02:00
Seth Hillbrand 9837d1624f pcbnew: Force at least one connectivity thread
We want to keep at most 1 thread per 2 connectivity updates but we need
to force that floor to be at least 1 for when there is only 1
connectivity update.

Fixes: lp:1795245
* https://bugs.launchpad.net/kicad/+bug/1795245

(cherry picked from commit 89a3d2b451)
2018-09-30 12:14:26 -07:00
Jeff Young 13a41f11eb Don't deselected items that have been deleted.
De-referencing freed memory is never a good idea.

Fixes: lp:1795195
* https://bugs.launchpad.net/kicad/+bug/1795195
2018-09-30 15:46:58 +01:00
Seth Hillbrand 59723ce3ab pcbnew: Handle SEGZONE in GAL
SEGZONEs are no longer created by pcbnew but may exist in older boards.
This allows deleting the old fills in a manner similar to the deletion
in Legacy canvas.

Fixes: lp:1794571
* https://bugs.launchpad.net/kicad/+bug/1794571

(cherry picked from commit ef6f7e96f3)
2018-09-29 15:12:24 -07:00
Seth Hillbrand 79d19d9055 pcbnew: Rename PCB_ZONE_T and remove from connectivity
SEGZONE types were confusingly named PCB_ZONE_T.  Zones in pcbnew are
now _only_ PCB_ZONE_AREA_T, so we name segzone types PCB_SEGZONE_T to be
clear.

This also removes processing of the SEGZONEs from connectivity
calculations.

(cherry picked from commit b3a5e08c2f)
2018-09-29 15:12:21 -07:00
Seth Hillbrand 115f318976 pcbnew: Avoid double-separators in context menu
(cherry picked from commit a81e3c2b13)
2018-09-29 15:10:10 -07:00
jean-pierre charras 51a74b53cb Pcbnew: Crash after running external plugin Happens only in Opengl mode. So enforce controls in 3 group function: DrawGroup, ChangeGroupColor, ChangeGroupDepth.
Fixes: lp:1795044
https://bugs.launchpad.net/kicad/+bug/1795044
2018-09-29 14:19:07 +02:00
John Beard f591f8741a Prevent segfault when undoing or resetting non-hotkey rows
This is caused by:

* Not checking the hotkey data is not null when performing a
  hotkey action
* Allowing hotkey actions on non-hotkey rows.

This fixes both of these, and adds an assert to warn if someone
does manage to fire a hotkey action on a non-hotkey row (but it
won't crash).

This is a ported version of commit 704615721 on the master branch.

Fixes: lp:1794756
* https://bugs.launchpad.net/kicad/+bug/1794756
2018-09-28 10:20:53 -04:00
Jeff Young f56ea6bf3c Don't assume GetFlags() != 0 means it's being edited.
It could just mean it's selected, highlighted or brightened.

Fixes: lp:1794624
* https://bugs.launchpad.net/kicad/+bug/1794624
2018-09-27 22:17:32 +01:00
Seth Hillbrand e3f12ec0d9 pcbnew: Do not allow drag to violate DRC without permission
m_dragstatus is set to true when a valid route is created given the
user's constraints.  We need to check this before committing the route
to the board.

Fixes: lp:1794810
* https://bugs.launchpad.net/kicad/+bug/1794810

(cherry picked from commit 317ca8e64d)
2018-09-27 13:09:40 -07:00
Seth Hillbrand c26311918e pcbnew: Deselect all items in a delete commit at once
Deselecting each individually had the side-effect of possibly re-drawing
the view in between actions, leading to visible artifacts in the router
(where invisible items are set visible before committing a change)

(cherry-picked from commit 491098af35)
(cherry picked from commit 65678b223a)
2018-09-26 09:06:48 -07:00
Jeff Young 1f19903e7e Backport text nanny limits by hand (as other commit was mixed up).
Fixes: lp:1794345
* https://bugs.launchpad.net/kicad/+bug/1794345
2018-09-25 21:13:13 +01:00
Jeff Young 1e223b9027 Don't use nullprt for a dialog's parent.
Fixes: lp:1791561
* https://bugs.launchpad.net/kicad/+bug/1791561

(cherry picked from commit 3f23e9ac46)
2018-09-25 04:41:42 -07:00
Seth Hillbrand 036288d18f pcbnew: Fixup for edde02481 to enable aux axis
Correcting edde02481 which had side effects to
efdbc91e42 while dragging a line but not a
zone.

(cherry picked from commit ee465fb23c)
2018-09-24 14:33:28 -07:00
Seth Hillbrand 8efdcbfaf1 pcbnew: Fix alignment with off-grid drag
Commit efdbc91e42 broken the primary
alignment mechanism for maintaining the current point as an auxilliary
grid reference.  This reverts that commit and fixes both the initial
issue and the associated bug by applying the primary constraint after
the secondary.  In this way, we consider the secondary constraint as an
additive rather than alternative constraint.

Fixes: lp:1793888
* https://bugs.launchpad.net/kicad/+bug/1793888

(cherry picked from commit edde02481e)
2018-09-24 14:08:49 -07:00
Wayne Stambaugh 6c3b4e5824 Pcbnew: change step export dialog action button text.
Change "OK" to "Export" so user is not surprised by the fact that the
dialog does not close after the step file is created..

Fixes lp:1784260

https://bugs.launchpad.net/kicad/+bug/1784260
2018-09-24 14:58:24 -04:00
Seth Hillbrand 9831a14ef3 eeschema: Re-add auto-wire removal
Somewhere during v5 rc cycle, the trimming of wires laid over simple
components was removed.  The wires were still removed as soon as the
user moved the component again.  This corrects the first behavior to
intended action for simple components.

Fixes: lp:1794019
* https://bugs.launchpad.net/kicad/+bug/1794019
2018-09-24 06:38:52 -07:00
Seth Hillbrand f3400e03c6 pcbnew: fix temp var type 2018-09-24 06:38:52 -07:00
Jeff Young 04e699f789 Show pads when parent footprint is selected.
Fixes: lp:1670090
* https://bugs.launchpad.net/kicad/+bug/1670090

(cherry picked from commit 66848b9334)
2018-09-24 06:38:52 -07:00
Seth Hillbrand 9e61ebfb0b pcbnew: Standardize zone fills threading
This is a boyscouting commit to standardize the threading of zone fills.
We do not need to join threads after their completion, instead we simply
allow them to clean up their memory without blocking the user.  This
also sets the maximum number of threads that may be created to the
number of zones being filled.  More than this will only leave un-used
threads being created and immediately killed.

We also include the connectivity search as a phase in the fill progress
reporter.  This was the case before but did not utilize the correct
maxsize, leading to stalled progress bar.

(cherry picked from commit 969e85daa3)
2018-09-24 06:38:52 -07:00
Seth Hillbrand 9e355c29f1 Removing OpenMP
This commit finishes the removal of OpenMP from the KiCad codebase.
Removed in this commit are the OpenMP calls in 3d-viewer and
qa/polygon_triangulation as well as all references in CMakeLists.txt

std::thread is used instead for multithreaded computation
(cherry picked from commit f8784f30a8)
2018-09-24 06:38:52 -07:00
Seth Hillbrand 5ce0c2065c pcbnew: Cancel highlight with ESC
When editing the pcb, Ctrl-Click will highlight a net.  This allows
de-highlight with the ESC/cancel action from the selection tool.  Inside
the highlight tool, ESC reverts to the selection tool while keeping the
net highlighted.

Fixes: lp:1793842
* https://bugs.launchpad.net/kicad/+bug/1793842

(cherry picked from commit 518b53f78c)
2018-09-24 06:38:52 -07:00
Wayne Stambaugh 3f58dce1de Eeschema: fix yet another lock file issues.
Reset lock file when saving a schematic sheet to a different file name.
This prevents a file is already open error from being displayed when
opening the original file.

Fixes lp:1788507

https://bugs.launchpad.net/kicad/+bug/1788507
2018-09-24 09:00:11 -04:00
Seth Hillbrand c5c89fd216 pcbnew: Prevent redo while moving items
Fixes: lp:1793948
* https://bugs.launchpad.net/kicad/+bug/1793948
2018-09-23 06:02:50 -07:00
Jeff Young 1820e81f5e Don't allow drawing to a zero-height or zero-width GAL canvas.
Fixes: lp:1793913
* https://bugs.launchpad.net/kicad/+bug/1793913

(cherry picked from commit 0309228276)
2018-09-22 22:10:49 +01:00
Maciej Suminski 4fcd80eda1 Spice simulator: change gain units to dBV
(cherry-picked from commit 85ef0584)
2018-09-22 20:08:13 +02:00
Seth Hillbrand e7a9643b37 kicad2step: Provide floats separated
Clang++ seems to be in left-field here as it processes a stringstream
1.0X1.0 >> double as a hexadecimal floating point ('X' character) and
throws an error rather than converting 1.0 and stopping when it reaches
a non-numeric character.  This causes errors when exporting step on Mac,
which uses clang++ by default.

Adding spaces to the string is more explicit and doesn't break gcc.  It
will be sufficient until we get rid of kicad2step as an external
utility.

Fixes: lp:1778564
* https://bugs.launchpad.net/kicad/+bug/1778564
2018-09-22 08:52:05 -07:00
Wayne Stambaugh 3e28ac9c7c Pcbnew: fix lock file bug.
The lock file code would reset the lock file every other time the same
board file was opened in Pcbnew in the stand alone mode.  This created
the perfect toggle switch causing the board to be reloaded every other
time the same board was selected.

Fixes lp:1777599

https://bugs.launchpad.net/kicad/+bug/1777599
2018-09-22 09:12:16 -04:00
Seth Hillbrand 4c37defd35 pcbnew: Remove OpenMP
OpenMP is not available for macos, so moving to a std::threads
implementation brings platforms into shared code.

This also reduces the OpenMP overhead when computing connectivity and
ratsnests.

Fixes: lp:1780130
* https://bugs.launchpad.net/kicad/+bug/1780130

(cherry picked from commit c0f067bf90)
2018-09-20 16:48:08 -07:00
Seth Hillbrand a4564db082 Removing some unused code
(cherry picked from commit 47fac8a259)
2018-09-20 16:47:59 -07:00
Martin Aberg dd3c24faf8 Generate PYTHONPATH from CMake information
The CMake scripts calculate the install path for python scripts by
  distutils.sysconfig.get_python_lib(
    plat_specific=0,
    standard_lib=0,
    prefix=''
  )
which generates a string in line with
  lib/python2.7/site-packages

This string ends up in the CMake variable PYTHON_DEST and is used by the
install step as destination directory for pcbnew.py.

There has been a hard-coded assumption on the content of that string in
PcbNew which is not compatible with FreeBSD 11.1.

This commit eliminates the hard-coded assumption in PcbNew and reuses
the install path as known by CMake.

Fixes: lp:1777921
* https://bugs.launchpad.net/kicad/+bug/1777921
2018-09-20 12:03:25 -07:00
Seth Hillbrand 0a9aedda8b 3d-viewer: Require simplified polygons
3d viewer requires simplified polygons not just for triangulation but
also for its own internal routines.

Fixes: lp:1793085
* https://bugs.launchpad.net/kicad/+bug/1793085

(cherry picked from commit 8999f4604f)
2018-09-20 10:12:30 -07:00
Seth Hillbrand 48b4a897af pcbnew: Limit zone simplification
Commit 73c229714 was a bit of a sledgehammer for the associated problem
of degenerate points.  This commit replaces that one by only performing
additional simplification of the zone polygons on those polygons that
fail our initial triangulation attempt.

(cherry picked from commit 3ebba6cbe1)
2018-09-20 10:12:30 -07:00
Seth Hillbrand 4c409fbac9 triangulation: Fracture/Simplify all polygons
Calls the simplify/fracture polygon code on any polygon prior to
tesselation.  This avoids issues with degenerate polygons where the
degenerate points are not sequential.

Fixes: lp:1790534
* https://bugs.launchpad.net/kicad/+bug/1790534

(cherry picked from commit 73c2297144)
2018-09-20 10:12:30 -07:00
Seth Hillbrand b4fc7575a5 pcbnew: Parallelize initial board triangulation
Triangulation of zones can be time consuming for large boards.  This
adds a std::thread implementation of parallel zone loading to speed this
process on multi-core machines.

(cherry picked from commit a04ef37d67)
2018-09-20 10:12:30 -07:00
Seth Hillbrand 4560d4ef69 Replacing Tesselation
Replaces Poly2Tri with updated code to process polygons faster and more
robustly.  Notably, we can now handle overlapping holes in the polygons,
allowing us to cache the triangulation of complex boards

(cherry picked from commit a6325aab29)
2018-09-20 10:12:30 -07:00
Jeff Young 3a03c79255 Double opening speed of PCBs with ground and/or power planes.
(Or any other boards with complicated zones.)

(cherry picked from commit 7c04d8be1c)
2018-09-20 09:49:48 -07:00
Seth Hillbrand fca0785754 pcbnew: remove duplicate rebuild in GAL
When running GAL, the connectivity is built when the board loads, so the
extra call to rebuild connectivity is not needed.

(cherry picked from commit 13b96799ea)
2018-09-20 09:32:15 -07:00
Seth Hillbrand 30d398b108 pcbnew: Unify connected lists between items/zones
Keep the zoneitems in the same list as the rest of the items.

(cherry picked from commit 284c39acac)
2018-09-20 09:32:14 -07:00
Seth Hillbrand dd7ce9f00a pcbnew: Ensure connectivity layers are respected
This prevents non-copper layers from being included in the connectivity
search.  It also limits the layer search in the connectivity RTree to
just the copper layer range.

(cherry picked from commit f87cb64d65)
2018-09-20 09:32:14 -07:00
Seth Hillbrand 4f2f8e7f67 rtree: Updating to use functional
(cherry picked from commit 2cf38f68fe)
2018-09-20 09:32:14 -07:00
Seth Hillbrand c7e511c919 Remove connectivity debug statements
(cherry picked from commit 589e5b9ad7)
2018-09-20 09:32:14 -07:00
Seth Hillbrand d769d1649a pcbnew: Split Layers in connectivity
Splits the connectivity search RTree by layers to avoid large penalty on
zone searches.

(cherry picked from commit dc1736eb87)
2018-09-20 09:32:14 -07:00
Seth Hillbrand 2ae8f6337d 3d-viewer: corrected rrect zero-length radius
Previous commit mistakenly included the full clearance for the rounded
rectangle circle.  The CFILLEDCIRCLE2d takes the radius rather than the
diameter.

( cherry-picked from d139a4969 )
2018-09-20 08:54:33 -07:00
Seth Hillbrand 97c5e0a835 3d-viewer: Approximate 0-length element is rrect
Apply same logic of using a filled circle to represent a zero-length
element as a filled circle with radius of the line.

(cherry-picked from 8efcf81cf)

Fixes: lp:1785823
* https://bugs.launchpad.net/kicad/+bug/1785823
2018-09-19 21:38:13 -07:00
Wayne Stambaugh c722ea7a0c Eeschema: fix minor bug in block handler.
Under certain conditions, it was possible for the block handler to be
entered with no mouse capture callback which would raise a rather
cryptic error message to the user.  This should have always been an
assertion so users will not see this issue in release builds.

Fixes lp:1791839

https://bugs.launchpad.net/kicad/+bug/1791839
2018-09-19 15:34:34 -04:00
Jeff Young 5c600e992a Don't allow SELECTED flag to make us think item is already edited.
Fixes: lp:1793289
* https://bugs.launchpad.net/kicad/+bug/1793289
2018-09-19 19:37:28 +01:00
Wayne Stambaugh a055916f92 Pcbnew: fix minor bug in find dialog.
Repeating find with the same search string would result in a not found
error for absolute search strings.  Don't clear the found item if the
search string did not change from the previous search..

Fix another minor bug where the do not warp mouse pointer option was
always checked when the find dialog was called from one of the gal
canvases.

Fixes lp:1793300

https://bugs.launchpad.net/kicad/+bug/1793300
2018-09-19 12:44:25 -04:00
Jeff Young e3d5734f76 Don't use diff-pair gap as a clearance.
Fixes: lp:1789690
* https://bugs.launchpad.net/kicad/+bug/1789690

(cherry picked from commit 9f068d66a8)
2018-09-18 20:40:44 +01:00
Seth Hillbrand 3d0915a33e pcbnew: Don't merge zones with different params
Zones can be explicitly merged even if they do not have the same
parameters.  Automatic merging should only occur when all of the zone
parameters are exactly identical to allow for area-specific zone
parameters.

Fixes: lp:1695761
* https://bugs.launchpad.net/kicad/+bug/1695761
2018-09-17 12:15:48 -07:00
Seth Hillbrand a67bfa6207 pcbnew: prevent different keepout zones from merging
Keepout zones can have different layer sets and different restrictions
that should not be combined unless they are identical.

Fixes: lp:1789062
* https://bugs.launchpad.net/kicad/+bug/1789062
2018-09-17 11:53:12 -07:00
Seth Hillbrand a454adb3ba rename lang_chinese -> lang_zh
This is a 5.0 fix only.  Can't cherry pick from 5.1 as this was part of a
larger commit to unify preferences dialog
(7841f8a466)
2018-09-17 10:39:38 -07:00
John Beard 5019fd0aab Update CA and ZH source svg filename
These were updated in 7841f8a466, but the source
files seem to have not been changed.

(cherry-picked from c0615c5ef8 )
2018-09-17 10:39:38 -07:00
Seth Hillbrand 2c6d0ffe27 pcbnew: retain selection between edits
We had been deselecting items after calling edits to be safe in case the
item was deleted/exchanged by the edit.  The item pointer itself remains
valid even when deleting as it is assigned to the undo stack.  But it
should not remain visible or selected on the schematic if it is removed.

This tests for removed items by checking whether it (in the case of
first-level BOARD_ITEMS) or its parent (in the case of footprint item
components) remain in the view list after editing.  If they are still in
the view list, then we re-select them.

Fixes: lp:1765774
* https://bugs.launchpad.net/kicad/+bug/1765774

Fixes: lp:1775946
* https://bugs.launchpad.net/kicad/+bug/1775946
2018-09-17 10:39:31 -07:00
Wayne Stambaugh 0ff84865ca Update translators list to include simplified Chinese translator. 2018-09-17 11:53:55 -04:00
jean-pierre charras 36746a0941 Grid settings do not accept "." and "," as decimal separator unlike many other dialogs.
Fixes: lp:1792871
https://bugs.launchpad.net/kicad/+bug/1792871
2018-09-17 17:04:42 +02:00
Seth Hillbrand 22df4e301b pcbnew: Allow removing corners from graphical polygons
Fixes: lp:1792712
* https://bugs.launchpad.net/kicad/+bug/1792712
2018-09-16 10:26:00 -07:00
jean-pierre charras ac0c7441b4 pcb_parser.cpp: allows 0 width line thickness for circles in custom shaped pads.
the commit 1100ccb032 broke DRAWSEGMENT filled circles (line width = 0) used only in custom pads.

Fixes: lp:1792791
https://bugs.launchpad.net/kicad/+bug/1792791
2018-09-16 15:22:59 +02:00
Seth Hillbrand 2196959539 pcbnew: Fix dragging snap to items
Snapping while dragging depends on the current net being assigned during
dragging.  This initializes the placer to hold the current net while
performing inline dragging.  The placer is reset along with the dragger
in StopRouting().  This fixes the difference in snap between drag and
create new route.
2018-09-15 20:21:38 -07:00
Seth Hillbrand 06ac172c27 pcbnew: Add corners in polygons
Allow corner adding to polygons in both module editor and board editor.
The board editor was already allowed but only through special types.
The module editor is now sychronized to the same process and both
recognize standard context menus

Fixes: lp:1782966
* https://bugs.launchpad.net/kicad/+bug/1782966
2018-09-15 09:53:31 -07:00
Seth Hillbrand e7c51a6a6c pcbnew: snap final points to grid
When constraining moves, the cursor snaps to grid but does not
represent the position of the final edited point.  The point is rotated
to the nearest snap angle, while the vector length remains unchanged
resulting in a line longer than intended and off-grid.

This adds a grid-snap after the constraint is applied.

Fixes: lp:1792655
* https://bugs.launchpad.net/kicad/+bug/1792655
2018-09-15 07:52:17 -07:00
Wayne Stambaugh 079d6b2009 Eeschema, fix broken instances of symbols in rescue dialog.
The symbol library table rescue candidate was only using the item name
of the library ID object which was being compared to the fully formatted
library ID causing a comparison failure so no instances of any rescued
symbols was shown in the dialog.

Fixes lp:1791805

https://bugs.launchpad.net/kicad/+bug/1791805
2018-09-14 17:43:22 -04:00
jean-pierre charras 8cbe5c2184 3D viewer: Better axis rotation when selecting "Bottom view" It allows keeping texts on bottom side readable (rotation similar to the Flip board view in board editor) 2018-09-14 08:05:45 +02:00
Jeff Young a7d7ab32c6 Fix 5.0 regression on typing units into some dialog fields.
Fixes: lp:1792066
* https://bugs.launchpad.net/kicad/+bug/1792066
2018-09-13 19:14:32 +01:00
Seth Hillbrand 61715a8df5 pcbnew: Control cursor capture in microwave tool
Turns off cursor capture when the microwave tool is not actively drawing
a new inductor.

Fixes: lp:1792128
* https://bugs.launchpad.net/kicad/+bug/1792128
2018-09-12 09:10:58 -07:00
Maciej Suminski a149960faa Eagle SCH importer: fix slash characters when fixing symbol names
Even though slash is a valid character in symbol names, it is a revision
separator, but is not the case with Eagle symbol names.

Fixes: lp:1791653
* https://bugs.launchpad.net/kicad/+bug/1791653

(cherry-picked from commit 2c217499)
2018-09-12 10:54:58 +02:00
Maciej Suminski 650ff5e5fe kicad2step: Implement overwrite protection, handle 'force overwrite' flag
Fixes: lp:1791826
* https://bugs.launchpad.net/kicad/+bug/1791826

(cherry-picked from commit c120ae9e)
2018-09-11 09:26:55 +02:00
Maciej Suminski 0c42d988f7 kicad2step: Set correct file extension if no output file is specified
(cherry-picked from commit 7037e422)
2018-09-11 09:25:09 +02:00
Alexey Chernov a84de7cccf Adding OpenSSL include directory explicitly
Fixes: lp:1791164
* https://bugs.launchpad.net/kicad/+bug/1791164

( cherry-picked from 3ad1cd8d5 )
2018-09-10 07:18:18 -07:00
Maciej Suminski e9b1552b16 Spice netlist exporter: make directives case insensitive, extra comments
(cherry-picked from commit 4a57541b)
2018-09-10 14:21:27 +02:00
Joël Bertrand 27b88be61f Spice netlist exporter: handle .control .. .endc blocks
Spice may include a list of directives that are wrapped with
.control and .endc. Such directives do not have a dot prefix, so
they need to be handled in a special way.

Fixes: lp:1787902
* https://bugs.launchpad.net/kicad/+bug/1787902

(cherry-picked from commit 36f2eb11)
2018-09-10 14:21:27 +02:00
Maciej Suminski 280573e9af Relax selection discard rules for footprints with area larger than the viewport
Normally working at a zoom level when a footprint is not fully displayed
indicates that the user modifies other components. Selection Tool used
to discard footprints that had area larger than the viewport area, but
it may make sense to select them if there are no other candidates.

Fixes: lp:1789578
* https://bugs.launchpad.net/kicad/+bug/1789578

(cherry-picked from commit 5993b330)
2018-09-10 14:21:27 +02:00
Maciej Suminski 14e42fec7e Changed the OpenGL CMake preference to LEGACY
Certain distribution does not handle GLVND well, as the result the
accelerated canvas is not enabled. For the time being it is better to
keep using the legacy preference.

Thanks to Aurelio Lucchesi for investigating the cause.

Fixes: lp:1781581
* https://bugs.launchpad.net/kicad/+bug/1781581

(cherry-picked from commit 01925fd6)
2018-09-10 14:21:27 +02:00
jean-pierre charras 7e8c5b9574 Eeschema: fix incorrect/incomplete annotation clearing in duplicate and paste block (happens in complex hierarchy) 2018-09-09 09:19:22 +02:00
jean-pierre charras 500abd0ac4 Eeschema: fix incorrect references clearing for shared sheet paths.
Previously, when creating a new instance of a sheet, the full set of references
was cleared.
Moreover, if this sheet has sub-sheets, the annotation was incorrectly handled

Now only (and all) new sheet path(s) created have a reference cleared, as expected.
(new sheet paths can be more than one, if the new instance of the sheet has sub-sheets)

Fixes: lp:1789048
https://bugs.launchpad.net/kicad/+bug/1789048
2018-09-09 09:19:22 +02:00
Seth Hillbrand e29e7ff95d pcbnew: Fix Eagle import hole offset
Unplated holes in Ealge can either be free floating or part of a larger
footprint.  We handle both in the same packageHole routine by either
offsetting the hole in a centered footprint or offsetting the footprint
in a centered hole.

Fixes: lp:1791287
* https://bugs.launchpad.net/kicad/+bug/1791287
2018-09-08 20:41:53 -07:00
Seth Hillbrand fb580d3694 pcbnew: center the zone fill confirmation dialog
The zone fill confirmation should follow the parent dialog.  In the case
of plotting, this is the plot window.
2018-09-08 20:18:14 -07:00
Seth Hillbrand b987126b7d pcbnew: Keep Yes/No dialogs above the windows
Modal yes/no questions should not be allowed to fall behind other
windows.  They need to be answered before the program continues and
clicking outside of the dialog should not hide dialog itself.

Fixes: lp:1790640
* https://bugs.launchpad.net/kicad/+bug/1790640
2018-09-08 20:18:02 -07:00
Seth Hillbrand 3919345003 pcbnew: Allow selection of back pads
Pads should be selectable when the respective copper layer is enabled.

Fixes: lp:1789084
* https://bugs.launchpad.net/kicad/+bug/1789084
2018-09-08 17:24:44 -07:00
Seth Hillbrand 1df99c264f pcbnew: Add Eagle milling layer to edge_cuts
The Eagle milling layer (46) is valid for cutouts on the board.

Fixes: lp:1791284
* https://bugs.launchpad.net/kicad/+bug/1791284
2018-09-08 06:59:36 -07:00
Seth Hillbrand 4d094da2fa Correct previous (2c5154c63) default value 0.1->0.051 2018-09-08 06:45:23 -07:00
Seth Hillbrand 2c5154c630 pcbnew: adjust default soldermask/dam clearance
The previous clearance values were equivalent to the default copper
clearance, which could cause issues for users who didn't adjust the
values and had alignment errors at the board house.  New values default
to typical dry film minimums.
2018-09-08 06:33:07 -07:00
Tomasz Wlostowski f85dc57642 POLY_GRID_PARTITION: fixed incorrect point-in-polygon test in some corner cases
Fixes: lp:1787236
* https://bugs.launchpad.net/kicad/+bug/1787236
2018-09-06 20:55:40 -07:00
Seth Hillbrand 3da86dc24b kicad2step: limit small segment add/remove
The addition of very small segments in OCE triggers sliver
removal/cleanup in the BREP generation that can get stuck in a very long
loop during STEP export of boards.  These were introduced to ensure
closure of boards with small gaps that were too big for OCE to consider
joined.

Removing the small segments allows STEP export to proceed in a
reasonable time.  This also decreases the default minimum gap size that
kicad2step uses to determine curve matching.  This prevents mis-matching
small curves

Fixes: lp:1784626
* https://bugs.launchpad.net/kicad/+bug/1784626
2018-09-06 18:43:26 -07:00
Seth Hillbrand 5e9b4dd6a5 eeschema: Set images to draw first in eeschema
Bitmaps in eeschema are mainly used for referencing and data.  Having
them between functional items obscures the elements.  This places the
images in the background for eeschema as a partial fix for lp:1787404

This commit should not be picked into 5.1 as the canvas changes.
2018-09-06 14:10:11 -07:00
Seth Hillbrand 1f60d8fdbf eeschema: Only allow dragging of draggable items
When expanding the drag item to allow corners, we accidentally picked up
other items in the list.  This limits the items that can be dragged to
only those that are explicitly in the draggable list.

A side effect of this commit is that when converting from move to drag
(with tab), items not in the draggable list will be left in place.

Fixes: lp:1787966
* https://bugs.launchpad.net/kicad/+bug/1787966
2018-09-06 13:42:01 -07:00
Seth Hillbrand 7012226284 pcbnew: Set soldermask on NPTH imported from Eagle
Fixes: lp:1773253
* https://bugs.launchpad.net/kicad/+bug/1773253
2018-09-06 08:57:40 -07:00
Seth Hillbrand 48bbde65b3 pcbnew: Set default line width for invalids
Invalid graphical items that cannot be created in pcbnew may still be
created by external tools.  This synchronizes the pcbnew view display
with the gerber output and 3d viewer line widths for these types of
lines.  Only filled polygons are permitted 0-width lines.

Fixes: lp:1790534
* https://bugs.launchpad.net/kicad/+bug/1790534
2018-09-05 16:43:15 -07:00
Damian Wrobel bdcae5f593 Fix setting default cmake build type
Changes: Sets default cmake build type before
calling project(). Current version seems to follow
https://cmake.org/pipermail/cmake/2008-September/023808.html
however, it seems to miss the comment that:
"definition of CMAKE_BUILD_TYPE occurs in the PROJECT() command"
which means that setting cmake build type should happend prior
to calling PROJECT().

Fixes: lp:1785719
* https://bugs.launchpad.net/kicad/+bug/1785719
2018-09-05 08:12:54 -04:00
jean-pierre charras b7b125d83c Eeschema: Fix incorrect parsing of old schematic files (version 2) for HLabels and GLabels 2018-09-03 19:52:22 +02:00
Seth Hillbrand 9eec296b0a pcbnew: Select copper through THT connections
This allows full copper connections even when THT changes a trace layer.
It avoides selecting the actual pad to prevent actions on the copper
connections from affecting the footprints as well.

Fixes: lp:1789807
* https://bugs.launchpad.net/kicad/+bug/1789807
2018-09-03 07:43:59 -07:00
Seth Hillbrand ec81f3267f pcbnew: Only regenerate BBox if the item is valid
Items removed from the connectivity list will not have valid parents, so
we cannot update the BBox, thus we will only use the cached value.

Fixes: lp:1785605
* https://bugs.launchpad.net/kicad/+bug/1785605
2018-08-31 18:45:26 -07:00
qu1ck f0e9e3b9d5 Extend swig definitions to contain SHAPE_LINE_CHAIN and VECTOR2I 2018-08-31 13:16:13 -04:00
Seth Hillbrand ee12fe6eff modview: Re-instate the try/catch block when loading
Setting up the footprint viewer will attempt to load the current
footprint.  If the library does not exist, the loader will throw an
IO_ERROR that needs to be caught.

Fixes: lp:1789626
* https://bugs.launchpad.net/kicad/+bug/1789626
2018-08-31 08:45:34 -07:00
Seth Hillbrand d6b95236a4 gal: correct layer ordering
Net labels need to be rendered under the selected item.

Fixes: lp:1790016
* https://bugs.launchpad.net/kicad/+bug/1790016
2018-08-30 16:55:00 -07:00
Seth Hillbrand fbe677e46e pcbnew: Correcting commit f84bd0d83 for 5.0/release
Previous commit only functioned correctly in debug mode.  Also cleanup a
left-over debug printf() and revert a changed translated string.
2018-08-30 13:25:18 -07:00
Seth Hillbrand f84bd0d836 pcbnew: Fix Eagle UTF8 import error
Implicit convertion from wxString to std::string will use narrow strings
and drop UTF-8.

Fixes: lp:1789311
* https://bugs.launchpad.net/kicad/+bug/1789311
2018-08-30 13:07:33 -07:00
Seth Hillbrand 25b6604fc5 pcbnew: Swap all types of zones when swapping layers
This is a 5.0-only commit to implement correct layer swapping.

Fixes: lp:1789390
* https://bugs.launchpad.net/kicad/+bug/1789390
2018-08-30 09:45:39 -07:00
Ronnie Gaensli fbd6654f9a pcbnew: fix pan while moving mouse after cancelling selection box
Fixes: lp:1776648
* https://bugs.launchpad.net/kicad/+bug/1776648
2018-08-29 16:48:55 -07:00
Seth Hillbrand b8ae4e0195 pcbnew: Only dp clearance matrix when routing dp
Fixes: lp:1787766
* https://bugs.launchpad.net/kicad/+bug/1787766
2018-08-29 10:25:51 -07:00
Seth Hillbrand 9527034e0f cvpcb: don't show board-level soldermask
Only show soldermask in cvpcb if it was defined in the footprint or pad,
not the board defaults.
2018-08-28 17:00:27 -07:00
Seth Hillbrand 6754aa8a74 eeschema: Close ERC before placing components
We have a dialog shim that raises the ERC dialog in front of the
schematic frame, which is useful for keeping the ERC dialog visible
during debugging.  But mouse move events do not pass through to the
schematic, resulting in a captured mouse pointer but no drawing updates.

As a work-around we close the ERC dialog while placing new components.
Previous ERC data still exist when the window is launched again.

Fixes: lp:1779851
* https://bugs.launchpad.net/kicad/+bug/1779851
2018-08-28 16:03:02 -07:00
Seth Hillbrand 0c659eda78 gerbview: Add LAYER_SELECT_OVERLAY to GAL
Ensure selected gerbview layers plotted on newly created SELECT layer
2018-08-28 15:12:02 -07:00
Seth Hillbrand 20ea486378 GAL: Add a selected item layer
The selected items should be displayed above the rest of the items but
below informational overlays.

Fixes: lp:1789505
* https://bugs.launchpad.net/kicad/+bug/1789505
2018-08-28 14:58:37 -07:00
Seth Hillbrand 0c94b3239d pcbnew: keep selected zone highlighted when moding
When adding a cutout to a zone, it helps to have the zone highlighted so
that you can see when zone you are operating on.
2018-08-28 14:49:48 -07:00
Seth Hillbrand d8e276bc4f pcbnew: Adding some missing TypeOf() functions
Missing types were handled by the superclass (in the case of zones)
PCB_CONNECTED_ITEM, which incorrectly returned "true" when testing lines
against zones.

Fixes: lp:1789195
* https://bugs.launchpad.net/kicad/+bug/1789195
2018-08-28 13:16:34 -07:00
Seth Hillbrand b7a321d143 modedit: clear the pcb when closing the window
Before closing the window in the footprint editor, we clear the existing
pcb, undo/redo stack and associated memory to prevent callbacks
double-freeing on destruction.

Fixes: lp:1784504
* https://bugs.launchpad.net/kicad/+bug/1784504
2018-08-28 12:35:17 -07:00
Seth Hillbrand f6d9c3a733 pcbnew: set default soldermask clearance for footprint viewer
The default board soldermask clearance should not be used in the
footprint viewer.  Setting the board's solder mask margin to 0 will
leave the footprint displayed with only the soldermask defined by
the pads or the footprint.

Thanks to Fabian Inostroza for pointing out the missing line.

Fixes: lp:1779979
* https://bugs.launchpad.net/kicad/+bug/1779979
2018-08-28 10:03:25 -07:00
jean-pierre charras 7ed07cae70 Pcbnew, Plot: fix incorrect plot of custom shapes, when the shape has holes (missing holes).
Fixes: lp:1789404
https://bugs.launchpad.net/kicad/+bug/1789404
2018-08-28 17:51:52 +02:00
Wayne Stambaugh 8bb0fabcba Fix build error with Boost 1.68.
The Boost folks kindly decided to move the sha1.hpp header file location
so check the Boost version to include the proper header path.

Clean up debug trace code.
2018-08-28 10:30:49 -04:00
jean-pierre charras da4d9ee392 Footprint viewer: ensure all panes are always visible, regardless m_auimgr.LoadPerspective() has read.
Perspective is overzealous: it stores everything, so we need to be sure these panes are not hidden,
regardless what the perspective has stored.

Fixes: lp:1789254
https://bugs.launchpad.net/kicad/+bug/1789254
2018-08-27 20:32:45 +02:00
jean-pierre charras a4ddbff321 Kicad archive project: add missing file extensions (.kicad_mod, .gbrjob) in files to archive filter.
From master.
2018-08-27 15:53:16 +02:00
Jeff Young 3c87ab94a2 Fix fast grid switching for OSX and Footprint Editor.
Fixes: lp:1787066
* https://bugs.launchpad.net/kicad/+bug/1787066
2018-08-26 19:01:40 +01:00
Jeff Young e424f29bbb Don't inadvertantly strip hotkey off Save All Libraries.
Fixes: lp:1786066
* https://bugs.launchpad.net/kicad/+bug/1786066
2018-08-26 00:32:38 +01:00
Jeff Young 3587789ae2 Update canvas after changing netclass settings.
Fixes: lp:1786937
* https://bugs.launchpad.net/kicad/+bug/1786937
2018-08-25 23:20:46 +01:00
Jeff Young 8cb389d95c Use actual parent for dialogs; don't pass nullptr.
Fixes: lp:1788962
* https://bugs.launchpad.net/kicad/+bug/1788962
2018-08-25 11:12:58 +01:00
jean-pierre charras 0f78fe5a5a Fix a minor wxWidget alert. 2018-08-25 10:38:13 +02:00
jean-pierre charras 333ba4b9a2 Eeschema: fix an assert ( "meOwner" failed in DeleteAll() ) when appending a sheet from an other project to the schematic.
It was only a overzealous (in this case) assert, with no issue.
The fix avoid calling DeleteAll() when there is nothing to delete.

Fixes: lp:1787810
https://bugs.launchpad.net/kicad/+bug/1787810
2018-08-25 10:38:13 +02:00
Jeff Young 7e2e39ce30 Handle separate parsing rules for ID_SCH and ID_PCB.
This removes the existing constructors so that all parsing must
be explicit and callers are made aware that they need to think
about illegal characters, malformed ids, etc.

Fixes: lp:1783474
* https://bugs.launchpad.net/kicad/+bug/1783474

Fixes: lp:1786819
* https://bugs.launchpad.net/kicad/+bug/1786819
2018-08-24 23:57:19 +01:00
Wayne Stambaugh b167c41d1b Pcbnew: enable scripting action menu build option by default.
Fixes lp:1783690

https://bugs.launchpad.net/kicad/+bug/1783690
2018-08-21 13:06:27 -04:00
jean-pierre charras dc022dcdae key event in draw_panel.cpp: fix incorrect behavior for the escape key (the key was handled but the evnent was skipped). This create an incorrect behavior because the event key was resend because the primary event was seen as not handled by the drawpanel. 2018-08-21 18:49:08 +02:00
jean-pierre charras e2c6422838 Better fix for accelerator menus using "Back" (previously named "BkSp") key
Use the wxWidgets official accelerator key string for WXK_BACK (this is "Back") in menuitems instead of "BkSp"
Also when reading the hotkey config file, avoid to set a hotkey to unassigned when its name is not found in list.
The default value is used.
Unassigned hotkey use <unassigned> as key name (and 0 as key code) in file.
2018-08-21 18:49:08 +02:00
Ronnie Gaensli 182b8a32df eeschema: fix dangling pin marker after adding NoConnect
Fixes: lp:1787858
* https://bugs.launchpad.net/kicad/+bug/1787858
2018-08-19 19:47:21 -07:00
jean-pierre charras 831978293f Fix ASCII code used in accelerator menus for BkSp key (Linux only)
On Linux (GTK?) the accelerator key BkSp, when used in menus must be coded as "\t\b" and not "\tBkSp".
However, On Windows, it must be "\tBkSp".
Joys of multi-platform development.
2018-08-15 21:19:41 +02:00
John Beard 64f46448ea Fix -Wcatch-value in kicad2step.cpp 2018-08-15 12:51:36 -04:00
Maciej Suminski ca1f50a023 Spice simulator: search each line of a text field for a Spice directive
Fixes: lp:1786119
* https://bugs.launchpad.net/kicad/+bug/1786119

(cherry-picked from commit d5ee3296)
2018-08-14 10:27:07 +02:00
Maciej Suminski 626f5ac45a Spice simulator: prevent double quoting library file names
Fixes: lp:1786559
* https://bugs.launchpad.net/kicad/+bug/1786559

(cherry-picked from commit f82b839d)
2018-08-14 09:47:24 +02:00
Jeff Young a45a8e8797 Warn before replacing edited footprint in footprint editor.
Fixes: lp:1786570
* https://bugs.launchpad.net/kicad/+bug/1786570
2018-08-11 20:36:51 +01:00
jean-pierre charras c7d39d22db FOOTPRINT_WIZARD_FRAME: ensure the draw panel is always visible, even if the config file is incorrect. 2018-08-10 13:44:21 +02:00
jean-pierre charras b764bb1d6d Fix a minor wxWidgets alert 2018-08-10 13:43:12 +02:00
jean-pierre charras 64eaaa4f58 Fix incorrect parent of a separator in a toolbar 2018-08-10 11:53:49 +02:00
Seth Hillbrand 0e946dad1a Eagle: Fix NULL-dereference on malformed Eagle files
Eagle files that are edited may be missing required data.  While we do
not need to handle these files, we do need to prevent segfaults in KiCad
when reading them.
2018-08-09 14:57:50 -07:00
Seth Hillbrand 1c2f06106d PCBNEW: Re-add missing SWIG zone filler
Zone filler was factored out into a separate header.  To allow python
access to zone filling, we need to include the revised signatures.
2018-08-08 12:23:32 -07:00
Seth Hillbrand edbf34c2b2 Adjust RTree default floating point to use double
This reverts the previous work-around 7d62f14dd for the RTree splitting
degeneracy that was placed prior to v5.  It appears not to have worked
for all systems.  In its place, we use doubles instead of floats to
calculate the bounding box when filling the RTree.  This keeps maximum
volume items from overlapping with the system boundary in test cases.

(cherry-picked from 539ca5aa3)
2018-08-06 17:01:59 -07:00
Jeff Young 26cbdbf103 Add Edit context menu item for EEschema graphic lines.
Fixes: lp:1779554
* https://bugs.launchpad.net/kicad/+bug/1779554

(cherry picked from commit 02b29ba)

(cherry picked from commit 7dcc8e346f)
2018-08-06 13:56:56 +01:00
Jeff Young f163d9ff2a Fix bug with duplicate columns in Edit Symbol Fields.
(cherry picked from commit 01c5bdf)
2018-08-06 13:55:59 +01:00
Jeff Young 9230189f62 Fix thread-safety issue with some global wxStrings.
These cause intermittent crashes in footprint loading.  See
comments in code.

(cherry picked from commit 5e8e2570ba)
2018-08-06 13:52:23 +01:00
Ronnie Gaensli 9d241ba812 Cancel Add dimension leaves auto panning on
Fixes: lp:178551
* https://bugs.launchpad.net/kicad/+bug/178551

(cherry picked from commit 3ca84dca)
2018-08-06 11:27:56 +02:00
jean-pierre charras 57c3e98f8c Fix a wxWidgets minor alert 2018-08-03 09:28:30 +02:00
jean-pierre charras 349d1562af fix a few wxWidgets alerts, to avoid useless bug reports when kicad is compiled in Debug mode 2018-08-02 16:58:30 +02:00
jean-pierre charras d81bcee10d CMakeLists.txt: add a option (BUILD_SMALL_DEBUG_FILES, default off) to create smaller binaries in debug mode. It forces link option -g1 instead og -g3 which allows basic debug.
This is especially useful on Mingw because binaries in debug build are very large:
_pcbnew.kiface: 1.25 Gb, small file option: 65Mb
2018-08-02 16:58:30 +02:00
Seth Hillbrand 016c02a42d modedit: Store single copy of the footprint in undo
When changing elements in the module editor, each element shares the
same parent.  Undo commits store a copy of the parent as it existed
before the change.  For footprints with many elements, this creates
large, slow undo commits as a copy of the full footprint is stored for
each element being edited.

This keeps a single copy of the footprint in the undo stack per edit.

Fixes: lp:1780526
* https://bugs.launchpad.net/kicad/+bug/1780526
2018-08-01 11:00:49 -07:00
Jeff Young 80e7a83fb0 Generalize OSX &Cancel fix to work for other languages.
Fixes: lp:1784350
* https://bugs.launchpad.net/kicad/+bug/1784350

(cherry picked from commit 98849bde96)
2018-08-01 11:50:04 +01:00
jean-pierre charras d2aa976017 Fix many wxWidgets alerts, to avoid useless bug reports when kicad is compiled in Debug mode 2018-07-31 11:41:47 +02:00
John Beard 9476b53533 Use M_PI for Pi, not constexpr calculation
Constexpr evaluation breaks Clang compilation.

Use math.h M_PI, as elsewhere.
2018-07-30 12:46:27 -04:00
jean-pierre charras 5e19ed29b8 Fix D_PAD::BuildPadShapePolygon() incorrect calculation for custom pad shapes.
Fixes: lp:1784340
https://bugs.launchpad.net/kicad/+bug/1784340
2018-07-30 16:58:20 +02:00
John Beard aa340e6b85 QA Geometry: New test suite for generic geometric tests
This is the first test for a generic test suite for geometric functions.

The tests run are for fillet corners of SHAPE_POLY_SETS.

Previously, SHAPE_POLY_SET::Fillet was tested against CPolyLine::Fillet
to ensure compatibility. However, thse two functions now have different
interfaces and are not directly comparable. Also, this depended on
CPolyLine::Fillet being correct, which was not tested.

Instead, test SHAPE_POLY_SET::Fillet using tests against geometric
constraints, independent of any other fillet implementation.
2018-07-27 14:41:24 -04:00
John Beard 9a80ebf387 QA: Rename geometry to shape_poly_set_refactor
This test is not really concerned with generic geometric code testing,
but rather the correctness of a refactoring effort.

Rename it make this clearer, and also to make way for generic geometry tests.
2018-07-27 14:41:11 -04:00
John Beard df1fa37fd8 QA: Add python test as a Ctest test rather than build target 2018-07-27 14:41:04 -04:00
John Beard 370a412f49 Enable CTest tests and add qa_geometry as a test
This allows the use of `make test` or `ctest` to run all registered
tests.

The ChamferFillet/Fillet test is disabled for now as it fails.
2018-07-27 14:40:57 -04:00
Maciej Suminski d63c1a2118 Use quoted file name when opening a PDF file
Fixes: lp:1783667
* https://bugs.launchpad.net/kicad/+bug/1783667

(cherry-picked from bbfc1eb1)
2018-07-26 12:07:46 +02:00
Maciej Suminski 35576adb73 Converted PNS Length Tuning dialog to use TransferData{From,To}Window()
Fixes: lp:1783694
* https://bugs.launchpad.net/kicad/+bug/1783694

(cherry-picked from commit dbf4bcdb)
2018-07-26 10:36:21 +02:00
Maciej Suminski 4ff426275f Fixed KIDIALOG freeze
wxDialog calls Show(false) when the dialog is about to be closed, but
KIDIALOG::Show() implementation did not forward the show parameter to
wxRichMessageDialog::Show() invocation. As the parameter was not
specified, the mentioned Show() call always used 'true' as the default
parameter, preventing the dialog from being closed.

Fixes: lp:1782999
* https://bugs.launchpad.net/kicad/+bug/1782999

(cherry-picked from commit 39d8d143)
2018-07-25 12:10:54 +02:00
John Beard 7dc9f99165 Fix -Wcatch-value in sexpr.cpp
This is fixed by catching bty const-ref, rather than by value.

Also a few trailing space deletions.
2018-07-23 14:57:52 -04:00
Maciej Suminski 30da1a3b02 pcbnew: Disabled UI update for pcbnew console menu item
UI update event handler updates toolbar button state for the scripting
console, but for the associated menu item it displays an assert saying that
the menu item that cannot be checked. To avoid that, the UI update event
handler returns early if event does not come from the toolbar.

(cherry picked from commit 45c1742a)
2018-07-22 19:52:55 +02:00
Wayne Stambaugh 3dcf04fdb8 Apply footprint editor options when dialog OK button is clicked.
Fixes lp:1781977

https://bugs.launchpad.net/kicad/+bug/1781977
2018-07-18 08:45:43 -04:00
jean-pierre charras 6fbc7bb4ce Gerbview, read Excellon files: fix a few issues.
The main issue is the fact Excellon files have no coordinate fine format definition.
Only the units are defined.
Units are floating point numbers or integer numbers.
Integer numbers can be defined as 3.3 or 2.4 numbers (mm/inches)
However some files (altium drill files for instance) use an other notation.
This fix is a workaround to accept 2.x (inch) or 3.x (mm) notations.

Fixes: lp:1754121
https://bugs.launchpad.net/kicad/+bug/1754121

Fixes: lp:1782053
https://bugs.launchpad.net/kicad/+bug/1782053
2018-07-17 17:41:33 +02:00
jean-pierre charras 3af2026061 Revert "Perform coordinate format detection on Excellon drill files"
This reverts commit 3e033aee0c.
2018-07-17 17:41:32 +02:00
Maciej Suminski 6bd8cb9b8f eeschema: fix alias names in .dcm files
Fixes: lp:1781761
* https://bugs.launchpad.net/kicad/+bug/1781761
2018-07-17 14:27:25 +02:00
Wayne Stambaugh b23b48b9a7 Tag version 5.0.1-dev. 2018-07-13 16:33:17 -04:00
343 changed files with 11106 additions and 10497 deletions

View File

@ -2,6 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -34,7 +35,13 @@
#include <wx/log.h>
#include <wx/stdpaths.h>
#include <boost/version.hpp>
#if BOOST_VERSION >= 106800
#include <boost/uuid/detail/sha1.hpp>
#else
#include <boost/uuid/sha1.hpp>
#endif
#include <glm/glm.hpp>
#include <glm/ext.hpp>
@ -52,6 +59,7 @@
static wxCriticalSection lock3D_cache;
static bool isSHA1Same( const unsigned char* shaA, const unsigned char* shaB )
{
for( int i = 0; i < 20; ++i )
@ -61,6 +69,7 @@ static bool isSHA1Same( const unsigned char* shaA, const unsigned char* shaB )
return true;
}
static bool checkTag( const char* aTag, void* aPluginMgrPtr )
{
if( NULL == aTag || NULL == aPluginMgrPtr )
@ -71,6 +80,7 @@ static bool checkTag( const char* aTag, void* aPluginMgrPtr )
return pp->CheckTag( aTag );
}
static const wxString sha1ToWXString( const unsigned char* aSHA1Sum )
{
unsigned char uc;
@ -151,14 +161,8 @@ void S3D_CACHE_ENTRY::SetSHA1( const unsigned char* aSHA1Sum )
{
if( NULL == aSHA1Sum )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [BUG] NULL passed for aSHA1Sum";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] NULL passed for aSHA1Sum",
__FILE__, __FUNCTION__, __LINE__ );
return;
}
@ -186,6 +190,7 @@ S3D_CACHE::S3D_CACHE()
return;
}
S3D_CACHE::~S3D_CACHE()
{
FlushCache();
@ -210,8 +215,8 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, S3D_CACHE_ENTRY** aCach
if( full3Dpath.empty() )
{
// the model cannot be found; we cannot proceed
wxLogTrace( MASK_3D_CACHE, " * [3D model] could not find model '%s'\n",
aModelFile.GetData() );
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [3D model] could not find model '%s'\n",
__FILE__, __FUNCTION__, __LINE__, aModelFile );
return NULL;
}
@ -294,15 +299,8 @@ SCENEGRAPH* S3D_CACHE::checkCache( const wxString& aFileName, S3D_CACHE_ENTRY**
if( m_CacheMap.insert( std::pair< wxString, S3D_CACHE_ENTRY* >
( aFileName, ep ) ).second == false )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [BUG] duplicate entry in map file; key = '";
ostr << aFileName.ToUTF8() << "'";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] duplicate entry in map file; key = '%s'",
__FILE__, __FUNCTION__, __LINE__, aFileName );
m_CacheList.pop_back();
delete ep;
@ -325,15 +323,8 @@ SCENEGRAPH* S3D_CACHE::checkCache( const wxString& aFileName, S3D_CACHE_ENTRY**
if( m_CacheMap.insert( std::pair< wxString, S3D_CACHE_ENTRY* >
( aFileName, ep ) ).second == false )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [BUG] duplicate entry in map file; key = '";
ostr << aFileName.ToUTF8() << "'";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] duplicate entry in map file; key = '%s'",
__FILE__, __FUNCTION__, __LINE__, aFileName );
m_CacheList.pop_back();
delete ep;
@ -364,28 +355,16 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
{
if( aFileName.empty() )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [BUG] empty filename";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] empty filename",
__FILE__, __FUNCTION__, __LINE__ );
return false;
}
if( NULL == aSHA1Sum )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [BUG] NULL pointer passed for aMD5Sum";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE, "%s\n * [BUG] NULL pointer passed for aMD5Sum",
__FILE__, __FUNCTION__, __LINE__ );
return false;
}
@ -434,17 +413,16 @@ bool S3D_CACHE::loadCacheData( S3D_CACHE_ENTRY* aCacheItem )
if( bname.empty() )
{
#ifdef DEBUG
wxLogTrace( MASK_3D_CACHE, " * [3D model] cannot load cached model; no file hash available\n" );
#endif
wxLogTrace( MASK_3D_CACHE,
" * [3D model] cannot load cached model; no file hash available" );
return false;
}
if( m_CacheDir.empty() )
{
wxString errmsg = "cannot load cached model; config directory unknown";
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s\n", errmsg.GetData() );
wxLogTrace( MASK_3D_CACHE,
" * [3D model] cannot load cached model; config directory unknown" );
return false;
}
@ -454,8 +432,7 @@ bool S3D_CACHE::loadCacheData( S3D_CACHE_ENTRY* aCacheItem )
if( !wxFileName::FileExists( fname ) )
{
wxString errmsg = "cannot open file";
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s '%s'\n",
errmsg.GetData(), fname.GetData() );
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s '%s'", errmsg.GetData(), fname.GetData() );
return false;
}
@ -475,28 +452,16 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
{
if( NULL == aCacheItem )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * NULL passed for aCacheItem";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * NULL passed for aCacheItem",
__FILE__, __FUNCTION__, __LINE__ );
return false;
}
if( NULL == aCacheItem->sceneData )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * aCacheItem has no valid scene data";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * aCacheItem has no valid scene data",
__FILE__, __FUNCTION__, __LINE__ );
return false;
}
@ -505,17 +470,16 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
if( bname.empty() )
{
#ifdef DEBUG
wxLogTrace( MASK_3D_CACHE, " * [3D model] cannot load cached model; no file hash available\n" );
#endif
wxLogTrace( MASK_3D_CACHE,
" * [3D model] cannot load cached model; no file hash available" );
return false;
}
if( m_CacheDir.empty() )
{
wxString errmsg = "cannot load cached model; config directory unknown";
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s\n", errmsg.GetData() );
wxLogTrace( MASK_3D_CACHE,
" * [3D model] cannot load cached model; config directory unknown" );
return false;
}
@ -526,9 +490,8 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
{
if( !wxFileName::FileExists( fname ) )
{
wxString errmsg = _( "path exists but is not a regular file" );
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s '%s'\n", errmsg.GetData(),
fname.ToUTF8() );
wxLogTrace( MASK_3D_CACHE, " * [3D model] path exists but is not a regular file '%s'",
fname );
return false;
}
@ -559,14 +522,9 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
if( !cfgdir.DirExists() )
{
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
wxString errmsg = _( "failed to create 3D configuration directory" );
ostr << " * " << errmsg.ToUTF8() << "\n";
errmsg = _( "config directory" );
ostr << " * " << errmsg.ToUTF8() << " '";
ostr << cfgdir.GetPath().ToUTF8() << "'";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
wxLogTrace( MASK_3D_CACHE,
"%s:%s:%d\n * failed to create 3D configuration directory '%s'",
__FILE__, __FUNCTION__, __LINE__, cfgdir.GetPath() );
return false;
}
@ -577,15 +535,10 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
// inform the file resolver of the config directory
if( !m_FNResolver->Set3DConfigDir( m_ConfigDir ) )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * could not set 3D Config Directory on filename resolver\n";
ostr << " * config directory: '" << m_ConfigDir.ToUTF8() << "'";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE,
"%s:%s:%d\n * could not set 3D Config Directory on filename resolver\n"
" * config directory: '%s'",
__FILE__, __FUNCTION__, __LINE__, m_ConfigDir );
}
// 3D cache data must go to a user's cache directory;
@ -597,20 +550,20 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
// 3. MSWin: AppData\Local\kicad\3d
wxString cacheDir;
#if defined(_WIN32)
#if defined(_WIN32)
wxStandardPaths::Get().UseAppInfo( wxStandardPaths::AppInfo_None );
cacheDir = wxStandardPaths::Get().GetUserLocalDataDir();
cacheDir.append( "\\kicad\\3d" );
#elif defined(__APPLE)
#elif defined(__APPLE)
cacheDir = "${HOME}/Library/Caches/kicad/3d";
#else // assume Linux
#else // assume Linux
cacheDir = ExpandEnvVarSubstitutions( "${XDG_CACHE_HOME}" );
if( cacheDir.empty() || cacheDir == "${XDG_CACHE_HOME}" )
cacheDir = "${HOME}/.cache";
cacheDir.append( "/kicad/3d" );
#endif
#endif
cacheDir = ExpandEnvVarSubstitutions( cacheDir );
cfgdir.Assign( cacheDir, "" );
@ -621,14 +574,8 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
if( !cfgdir.DirExists() )
{
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
wxString errmsg = "failed to create 3D cache directory";
ostr << " * " << errmsg.ToUTF8() << "\n";
errmsg = "cache directory";
ostr << " * " << errmsg.ToUTF8() << " '";
ostr << cfgdir.GetPath().ToUTF8() << "'";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * failed to create 3D cache directory '%s'",
__FILE__, __FUNCTION__, __LINE__, cfgdir.GetPath() );
return false;
}
@ -681,11 +628,8 @@ wxString S3D_CACHE::Get3DConfigDir( bool createDefault )
if( !cfgpath.DirExists() )
{
std::ostringstream ostr;
wxString errmsg = "failed to create 3D configuration directory";
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * " << errmsg.ToUTF8();
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * failed to create 3D configuration directory '%s'",
__FILE__, __FUNCTION__, __LINE__, cfgpath.GetPath() );
return wxT( "" );
}
@ -788,14 +732,9 @@ S3DMODEL* S3D_CACHE::GetModel( const wxString& aModelFileName )
if( !cp )
{
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [BUG] model loaded with no associated S3D_CACHE_ENTRY";
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
wxLogTrace( MASK_3D_CACHE,
"%s:%s:%d\n * [BUG] model loaded with no associated S3D_CACHE_ENTRY",
__FILE__, __FUNCTION__, __LINE__ );
return NULL;
}

View File

@ -40,7 +40,7 @@
#include "../3d_rendering/3d_render_raytracing/accelerators/ccontainer2d.h"
#include "../3d_rendering/3d_render_raytracing/shapes3D/ccylinder.h"
#include "../3d_rendering/3d_render_raytracing/shapes3D/clayeritem.h"
#include <openmp_mutex.h>
#include <class_board.h>
#include <class_module.h>
#include <class_pad.h>
@ -418,27 +418,24 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad,
*aPad ) );
// Add the PAD contours
// !TODO: check the corners because it cannot add
// roundsegments that are in the same start and end position
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[0],
corners3DU[1],
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
*aPad ) );
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[1],
corners3DU[2],
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
*aPad ) );
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[2],
corners3DU[3],
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
*aPad ) );
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[3],
corners3DU[0],
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
*aPad ) );
// Round segments cannot have 0-length elements, so we approximate them
// as a small circle
for( int i = 1; i <= 4; i++ )
{
if( Is_segment_a_circle( corners3DU[i - 1], corners3DU[i & 3] ) )
{
aDstContainer->Add( new CFILLEDCIRCLE2D( corners3DU[i - 1],
aClearanceValue.x * m_biuTo3Dunits,
*aPad ) );
}
else
{
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[i - 1],
corners3DU[i & 3],
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
*aPad ) );
}
}
}
break;
@ -473,27 +470,24 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad,
*aPad ) );
// Add the PAD contours
// !TODO: check the corners because it cannot add
// roundsegments that are in the same start and end position
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[0],
corners3DU[1],
rounding_radius * 2.0f * m_biuTo3Dunits,
*aPad ) );
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[1],
corners3DU[2],
rounding_radius * 2.0f * m_biuTo3Dunits,
*aPad ) );
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[2],
corners3DU[3],
rounding_radius * 2.0f * m_biuTo3Dunits,
*aPad ) );
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[3],
corners3DU[0],
rounding_radius * 2.0f * m_biuTo3Dunits,
*aPad ) );
// Round segments cannot have 0-length elements, so we approximate them
// as a small circle
for( int i = 1; i <= 4; i++ )
{
if( Is_segment_a_circle( corners3DU[i - 1], corners3DU[i & 3] ) )
{
aDstContainer->Add( new CFILLEDCIRCLE2D( corners3DU[i - 1],
rounding_radius * m_biuTo3Dunits,
*aPad ) );
}
else
{
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[i - 1],
corners3DU[i & 3],
rounding_radius * 2.0f * m_biuTo3Dunits,
*aPad ) );
}
}
}
break;
@ -506,10 +500,6 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad,
if( aClearanceValue.x )
polyList.Inflate( aClearanceValue.x, 32 );
// This convert the poly in outline and holes
polyList.Simplify( SHAPE_POLY_SET::PM_FAST );
polyList.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
// Add the PAD polygon
Convert_shape_line_polygon_to_triangles( polyList, *aDstContainer, m_biuTo3Dunits, *aPad );
@ -762,8 +752,9 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSeg
PCB_LAYER_ID aLayerId,
int aClearanceValue )
{
// The full width of the lines to create:
const int linewidth = aDrawSegment->GetWidth() + (2 * aClearanceValue);
// The full width of the lines to create
// The extra 1 protects the inner/outer radius values from degeneracy
const int linewidth = aDrawSegment->GetWidth() + (2 * aClearanceValue) + 1;
switch( aDrawSegment->GetShape() )
{
@ -829,11 +820,8 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSeg
aDrawSegment->TransformShapeWithClearanceToPolygon( polyList, aClearanceValue,
segcountforcircle, correctionFactor );
// This convert the poly in outline and holes
// Note: This two sequencial calls are need in order to get
// the triangulation function to work properly.
polyList.Simplify( SHAPE_POLY_SET::PM_FAST );
polyList.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
if( polyList.IsEmpty() ) // Just for caution
break;
@ -860,24 +848,14 @@ void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneCo
PCB_LAYER_ID aLayerId )
{
// Copy the polys list because we have to simplify it
SHAPE_POLY_SET polyList = SHAPE_POLY_SET(aZoneContainer->GetFilledPolysList());
SHAPE_POLY_SET polyList = SHAPE_POLY_SET( aZoneContainer->GetFilledPolysList(), true );
// This convert the poly in outline and holes
// Note: This two sequencial calls are need in order to get
// the triangulation function to work properly.
polyList.Simplify( SHAPE_POLY_SET::PM_FAST );
polyList.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
if( polyList.IsEmpty() )
return;
Convert_shape_line_polygon_to_triangles( polyList,
*aDstContainer,
m_biuTo3Dunits,
*aZoneContainer );
// add filled areas outlines, which are drawn with thick lines segments
// /////////////////////////////////////////////////////////////////////////
for( int i = 0; i < polyList.OutlineCount(); ++i )
@ -895,10 +873,11 @@ void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneCo
if( Is_segment_a_circle( start3DU, end3DU ) )
{
aDstContainer->Add( new CFILLEDCIRCLE2D( start3DU,
(aZoneContainer->GetMinThickness() / 2) *
m_biuTo3Dunits,
*aZoneContainer ) );
float radius = (aZoneContainer->GetMinThickness() / 2) * m_biuTo3Dunits;
if( radius > 0.0 ) // degenerated circles crash 3D viewer
aDstContainer->Add( new CFILLEDCIRCLE2D( start3DU, radius ,
*aZoneContainer ) );
}
else
{
@ -924,11 +903,12 @@ void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneCo
if( Is_segment_a_circle( start3DU, end3DU ) )
{
aDstContainer->Add(
new CFILLEDCIRCLE2D( start3DU,
(aZoneContainer->GetMinThickness() / 2) *
m_biuTo3Dunits,
*aZoneContainer ) );
float radius = (aZoneContainer->GetMinThickness() / 2) * m_biuTo3Dunits;
if( radius > 0.0 ) // degenerated circles crash 3D viewer
aDstContainer->Add(
new CFILLEDCIRCLE2D( start3DU, radius,
*aZoneContainer ) );
}
else
{

View File

@ -40,7 +40,7 @@
#include "../3d_rendering/3d_render_raytracing/accelerators/ccontainer2d.h"
#include "../3d_rendering/3d_render_raytracing/shapes3D/ccylinder.h"
#include "../3d_rendering/3d_render_raytracing/shapes3D/clayeritem.h"
#include <openmp_mutex.h>
#include <class_board.h>
#include <class_module.h>
#include <class_pad.h>
@ -52,6 +52,9 @@
#include <trigo.h>
#include <utility>
#include <vector>
#include <thread>
#include <algorithm>
#include <atomic>
#include <profile.h>
@ -788,36 +791,43 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// Add zones objects
// /////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
std::atomic<size_t> nextZone( 0 );
std::atomic<size_t> threadsFinished( 0 );
size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
{
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
if( aStatusTextReporter )
aStatusTextReporter->Report( wxString::Format( _( "Create zones of layer %s" ),
LSET::Name( curr_layer_id ) ) );
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
CBVHCONTAINER2D *layerContainer = m_layers_container2D[curr_layer_id];
// ADD COPPER ZONES
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
std::thread t = std::thread( [&]()
{
const ZONE_CONTAINER* zone = m_board->GetArea( ii );
const PCB_LAYER_ID zonelayer = zone->GetLayer();
if( zonelayer == curr_layer_id )
for( size_t areaId = nextZone.fetch_add( 1 );
areaId < static_cast<size_t>( m_board->GetAreaCount() );
areaId = nextZone.fetch_add( 1 ) )
{
AddSolidAreasShapesToContainer( zone,
layerContainer,
curr_layer_id );
const ZONE_CONTAINER* zone = m_board->GetArea( areaId );
if( zone == nullptr )
break;
auto layerContainer = m_layers_container2D.find( zone->GetLayer() );
if( layerContainer != m_layers_container2D.end() )
AddSolidAreasShapesToContainer( zone, layerContainer->second,
zone->GetLayer() );
}
}
threadsFinished++;
} );
t.detach();
}
while( threadsFinished < parallelThreadCount )
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
}
#ifdef PRINT_STATISTICS_3D_VIEWER
printf( "T13: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
printf( "fill zones T13: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
start_Time = GetRunningMicroSecs();
#endif
@ -825,29 +835,18 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) &&
(m_render_engine == RENDER_ENGINE_OPENGL_LEGACY) )
{
// Add zones poly contourns
// /////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
// ADD COPPER ZONES
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
{
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
const ZONE_CONTAINER* zone = m_board->GetArea( ii );
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
if( zone == nullptr )
break;
SHAPE_POLY_SET *layerPoly = m_layers_poly[curr_layer_id];
auto layerContainer = m_layers_poly.find( zone->GetLayer() );
// ADD COPPER ZONES
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
{
const ZONE_CONTAINER* zone = m_board->GetArea( ii );
const LAYER_NUM zonelayer = zone->GetLayer();
if( zonelayer == curr_layer_id )
{
zone->TransformSolidAreasShapesToPolygonSet( *layerPoly,
segcountforcircle,
correctionFactor );
}
}
if( layerContainer != m_layers_poly.end() )
zone->TransformSolidAreasShapesToPolygonSet( *layerContainer->second, segcountforcircle, correctionFactor );
}
}
@ -865,22 +864,35 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) &&
(m_render_engine == RENDER_ENGINE_OPENGL_LEGACY) )
{
const int nLayers = layer_id.size();
std::atomic<size_t> nextItem( 0 );
std::atomic<size_t> threadsFinished( 0 );
#pragma omp parallel for
for( signed int lIdx = 0; lIdx < nLayers; ++lIdx )
size_t parallelThreadCount = std::min<size_t>(
std::max<size_t>( std::thread::hardware_concurrency(), 2 ),
layer_id.size() );
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
{
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
std::thread t = std::thread( [&nextItem, &threadsFinished, &layer_id, this]()
{
for( size_t i = nextItem.fetch_add( 1 );
i < layer_id.size();
i = nextItem.fetch_add( 1 ) )
{
auto layerPoly = m_layers_poly.find( layer_id[i] );
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
if( layerPoly != m_layers_poly.end() )
// This will make a union of all added contours
layerPoly->second->Simplify( SHAPE_POLY_SET::PM_FAST );
}
SHAPE_POLY_SET *layerPoly = m_layers_poly[curr_layer_id];
threadsFinished++;
} );
wxASSERT( layerPoly != NULL );
// This will make a union of all added contourns
layerPoly->Simplify( SHAPE_POLY_SET::PM_FAST );
t.detach();
}
while( threadsFinished < parallelThreadCount )
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
}
#ifdef PRINT_STATISTICS_3D_VIEWER

View File

@ -1052,7 +1052,7 @@ bool EDA_3D_CANVAS::SetView3D( int aKeycode )
m_settings.CameraGet().SetInterpolateMode( INTERPOLATION_BEZIER );
m_settings.CameraGet().SetT0_and_T1_current_T();
m_settings.CameraGet().Reset_T1();
m_settings.CameraGet().RotateX_T1( glm::radians( -180.0f ) );
m_settings.CameraGet().RotateY_T1( glm::radians( 180.0f ) );
request_start_moving_camera(
glm::min( glm::max( m_settings.CameraGet().ZoomGet(), 0.5f ), 1.125f ) );
return true;

View File

@ -369,7 +369,8 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////////
CCONTAINER2D boardContainer;
Convert_shape_line_polygon_to_triangles( m_settings.GetBoardPoly(),
SHAPE_POLY_SET tmpBoard = m_settings.GetBoardPoly();
Convert_shape_line_polygon_to_triangles( tmpBoard,
boardContainer,
m_settings.BiuTo3Dunits(),
(const BOARD_ITEM &)*m_settings.GetBoard() );
@ -614,11 +615,9 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER *aStatusTextReporter )
{
const SHAPE_POLY_SET *polyList = map_poly.at( layer_id );
layerTriangles->AddToMiddleContourns( *polyList,
layer_z_bot,
layer_z_top,
m_settings.BiuTo3Dunits(),
false );
if( polyList->OutlineCount() > 0 )
layerTriangles->AddToMiddleContourns( *polyList, layer_z_bot, layer_z_top,
m_settings.BiuTo3Dunits(), false );
}
// Create display list

View File

@ -30,6 +30,9 @@
#include "clayer_triangles.h"
#include <wx/debug.h> // For the wxASSERT
#include <mutex>
#include <thread>
#include <atomic>
CLAYER_TRIANGLE_CONTAINER::CLAYER_TRIANGLE_CONTAINER( unsigned int aNrReservedTriangles,
@ -219,8 +222,8 @@ void CLAYER_TRIANGLES::AddToMiddleContourns( const std::vector< SFVEC2F > &aCont
const SFVEC2F &v0 = aContournPoints[i + 0];
const SFVEC2F &v1 = aContournPoints[i + 1];
#pragma omp critical
{
std::lock_guard<std::mutex> lock( m_middle_layer_lock );
m_layer_middle_contourns_quads->AddQuad( SFVEC3F( v0.x, v0.y, zTop ),
SFVEC3F( v1.x, v1.y, zTop ),
SFVEC3F( v1.x, v1.y, zBot ),
@ -279,8 +282,6 @@ void CLAYER_TRIANGLES::AddToMiddleContourns( const SHAPE_POLY_SET &aPolySet,
double aBiuTo3Du,
bool aInvertFaceDirection )
{
wxASSERT( aPolySet.OutlineCount() > 0 );
if( aPolySet.OutlineCount() == 0 )
return;
@ -305,21 +306,41 @@ void CLAYER_TRIANGLES::AddToMiddleContourns( const SHAPE_POLY_SET &aPolySet,
m_layer_middle_contourns_quads->Reserve_More( nrContournPointsToReserve * 2,
true );
#pragma omp parallel for
for( signed int i = 0; i < aPolySet.OutlineCount(); ++i )
std::atomic<int> nextItem( 0 );
std::atomic<size_t> threadsFinished( 0 );
size_t parallelThreadCount = std::min<size_t>(
std::max<size_t>( std::thread::hardware_concurrency(), 2 ),
static_cast<size_t>( aPolySet.OutlineCount() ) );
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
{
// Add outline
const SHAPE_LINE_CHAIN& pathOutline = aPolySet.COutline( i );
AddToMiddleContourns( pathOutline, zBot, zTop, aBiuTo3Du, aInvertFaceDirection );
// Add holes for this outline
for( int h = 0; h < aPolySet.HoleCount( i ); ++h )
std::thread t = std::thread( [&]()
{
const SHAPE_LINE_CHAIN &hole = aPolySet.CHole( i, h );
AddToMiddleContourns( hole, zBot, zTop, aBiuTo3Du, aInvertFaceDirection );
}
for( int i = nextItem.fetch_add( 1 );
i < aPolySet.OutlineCount();
i = nextItem.fetch_add( 1 ) )
{
// Add outline
const SHAPE_LINE_CHAIN& pathOutline = aPolySet.COutline( i );
AddToMiddleContourns( pathOutline, zBot, zTop, aBiuTo3Du, aInvertFaceDirection );
// Add holes for this outline
for( int h = 0; h < aPolySet.HoleCount( i ); ++h )
{
const SHAPE_LINE_CHAIN &hole = aPolySet.CHole( i, h );
AddToMiddleContourns( hole, zBot, zTop, aBiuTo3Du, aInvertFaceDirection );
}
}
threadsFinished++;
} );
t.detach();
}
while( threadsFinished < parallelThreadCount )
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
}

View File

@ -35,6 +35,7 @@
#include <geometry/shape_line_chain.h>
#include <geometry/shape_poly_set.h>
#include <vector>
#include <mutex>
typedef std::vector< SFVEC3F > SFVEC3F_VECTOR;
@ -174,6 +175,8 @@ public:
float zTop,
bool aInvertFaceDirection );
std::mutex m_middle_layer_lock;
CLAYER_TRIANGLE_CONTAINER *m_layer_top_segment_ends;
CLAYER_TRIANGLE_CONTAINER *m_layer_top_triangles;
CLAYER_TRIANGLE_CONTAINER *m_layer_middle_contourns_quads;

View File

@ -29,6 +29,7 @@
#include "ccontainer2d.h"
#include <vector>
#include <mutex>
#include <boost/range/algorithm/partition.hpp>
#include <boost/range/algorithm/nth_element.hpp>
#include <wx/debug.h>
@ -46,6 +47,7 @@ CGENERICCONTAINER2D::CGENERICCONTAINER2D( OBJECT2D_TYPE aObjType )
void CGENERICCONTAINER2D::Clear()
{
std::lock_guard<std::mutex> lock( m_lock );
m_bbox.Reset();
for( LIST_OBJECT2D::iterator ii = m_objects.begin();

View File

@ -32,6 +32,7 @@
#include "../shapes2D/cobject2d.h"
#include <list>
#include <mutex>
typedef std::list<COBJECT2D *> LIST_OBJECT2D;
typedef std::list<const COBJECT2D *> CONST_LIST_OBJECT2D;
@ -52,6 +53,7 @@ public:
{
if( aObject ) // Only add if it is a valid pointer
{
std::lock_guard<std::mutex> lock( m_lock );
m_objects.push_back( aObject );
m_bbox.Union( aObject->GetBBox() );
}
@ -70,6 +72,7 @@ public:
CONST_LIST_OBJECT2D &aOutList ) const = 0;
private:
std::mutex m_lock;
};

View File

@ -918,7 +918,6 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
}
m_accelerator = 0;
//m_accelerator = new CGRID( m_object_container );
m_accelerator = new CBVH_PBRT( m_object_container );
#ifdef PRINT_STATISTICS_3D_VIEWER

View File

@ -131,7 +131,7 @@ private:
unsigned long int m_stats_start_rendering_time;
/// Save the number of blocks progress of the render
long m_nrBlocksRenderProgress;
size_t m_nrBlocksRenderProgress;
CPOSTSHADER_SSAO m_postshader_ssao;
@ -165,7 +165,7 @@ private:
std::vector< SFVEC2UI > m_blockPositions;
/// this flags if a position was already processed (cleared each new render)
std::vector< bool > m_blockPositionsWasProcessed;
std::vector< int > m_blockPositionsWasProcessed;
/// this encodes the Morton code positions (on fast preview mode)
std::vector< SFVEC2UI > m_blockPositionsFast;

View File

@ -50,9 +50,9 @@ void RAY::Init( const SFVEC3F& o, const SFVEC3F& d )
// Amy Williams Steve Barrus R. Keith Morley Peter Shirley
// University of Utah
// http://people.csail.mit.edu/amy/papers/box-jgt.pdf
m_dirIsNeg[0] = m_Dir.x <= 0.0f;
m_dirIsNeg[1] = m_Dir.y <= 0.0f;
m_dirIsNeg[2] = m_Dir.z <= 0.0f;
m_dirIsNeg[0] = m_Dir.x < 0.0f;
m_dirIsNeg[1] = m_Dir.y < 0.0f;
m_dirIsNeg[2] = m_Dir.z < 0.0f;
// ray slope

View File

@ -35,9 +35,9 @@
#include <wx/glcanvas.h> // CALLBACK definition, needed on Windows
// alse needed on OSX to define __DARWIN__
#include <geometry/polygon_triangulation.h>
#include "../../../3d_fastmath.h"
#include <poly2tri/poly2tri.h>
CTRIANGLE2D::CTRIANGLE2D ( const SFVEC2F &aV1,
@ -126,172 +126,28 @@ bool CTRIANGLE2D::IsPointInside( const SFVEC2F &aPoint ) const
const float c = 1.0f - a - b;
return 0.0f <= c && c <= 1.0f;
/*
return 0.0f <= a && a <= 1.0f &&
0.0f <= b && b <= 1.0f &&
0.0f <= c && c <= 1.0f;*/
}
template <class C> void FreeClear( C & cntr )
{
for( typename C::iterator it = cntr.begin();
it != cntr.end();
++it )
{
delete * it;
}
cntr.clear();
}
// Note: Please check edgeshrink.cpp in order to learn the EdgeShrink propose
#define APPLY_EDGE_SHRINK
#ifdef APPLY_EDGE_SHRINK
extern void EdgeShrink( std::vector<SFVEC2I64> &aPath );
#define POLY_SCALE_FACT 256
#define POLY_SCALE_FACT_INVERSE (1.0 / (double)(POLY_SCALE_FACT))
#endif
void Convert_shape_line_polygon_to_triangles( const SHAPE_POLY_SET &aPolyList,
void Convert_shape_line_polygon_to_triangles( SHAPE_POLY_SET &aPolyList,
CGENERICCONTAINER2D &aDstContainer,
float aBiuTo3DunitsScale ,
const BOARD_ITEM &aBoardItem )
{
unsigned int nOutlines = aPolyList.OutlineCount();
aPolyList.CacheTriangulation();
const double conver_d = (double)aBiuTo3DunitsScale;
for( unsigned int idx = 0; idx < nOutlines; ++idx )
for( unsigned int i = 0; i < aPolyList.TriangulatedPolyCount(); i++ )
{
const SHAPE_LINE_CHAIN &outlinePath = aPolyList.COutline( idx );
auto triPoly = aPolyList.TriangulatedPolygon( i );
wxASSERT( outlinePath.PointCount() >= 3 );
std::vector<SFVEC2I64> scaledOutline;
scaledOutline.resize( outlinePath.PointCount() );
// printf("\nidx: %u\n", idx);
// Apply a scale to the points
for( unsigned int i = 0;
i < (unsigned int)outlinePath.PointCount();
++i )
for( size_t i = 0; i < triPoly->GetTriangleCount(); i++ )
{
const VECTOR2I& a = outlinePath.CPoint( i );
#ifdef APPLY_EDGE_SHRINK
scaledOutline[i] = SFVEC2I64( (glm::int64)a.x * POLY_SCALE_FACT,
(glm::int64)a.y * POLY_SCALE_FACT );
#else
scaledOutline[i] = SFVEC2I64( (glm::int64)a.x,
(glm::int64)a.y );
#endif
}
#ifdef APPLY_EDGE_SHRINK
// Apply a modification to the points
EdgeShrink( scaledOutline );
#endif
// Copy to a array of pointers
std::vector<p2t::Point*> polyline;
polyline.resize( outlinePath.PointCount() );
for( unsigned int i = 0;
i < (unsigned int)scaledOutline.size();
++i )
{
const SFVEC2I64 &a = scaledOutline[i];
//printf("%lu %lu\n", a.x, a.y);
polyline[i] = new p2t::Point( (double)a.x,
(double)a.y );
}
// Start creating the structured to be triangulated
p2t::CDT* cdt = new p2t::CDT( polyline );
// Add holes for this outline
unsigned int nHoles = aPolyList.HoleCount( idx );
std::vector< std::vector<p2t::Point*> > polylineHoles;
polylineHoles.resize( nHoles );
for( unsigned int idxHole = 0; idxHole < nHoles; ++idxHole )
{
const SHAPE_LINE_CHAIN &outlineHoles = aPolyList.CHole( idx,
idxHole );
wxASSERT( outlineHoles.PointCount() >= 3 );
std::vector<SFVEC2I64> scaledHole;
scaledHole.resize( outlineHoles.PointCount() );
// Apply a scale to the points
for( unsigned int i = 0;
i < (unsigned int)outlineHoles.PointCount();
++i )
{
const VECTOR2I &h = outlineHoles.CPoint( i );
#ifdef APPLY_EDGE_SHRINK
scaledHole[i] = SFVEC2I64( (glm::int64)h.x * POLY_SCALE_FACT,
(glm::int64)h.y * POLY_SCALE_FACT );
#else
scaledHole[i] = SFVEC2I64( (glm::int64)h.x,
(glm::int64)h.y );
#endif
}
#ifdef APPLY_EDGE_SHRINK
// Apply a modification to the points
EdgeShrink( scaledHole );
#endif
// Resize and reserve space
polylineHoles[idxHole].resize( outlineHoles.PointCount() );
for( unsigned int i = 0;
i < (unsigned int)outlineHoles.PointCount();
++i )
{
const SFVEC2I64 &h = scaledHole[i];
polylineHoles[idxHole][i] = new p2t::Point( h.x, h.y );
}
cdt->AddHole( polylineHoles[idxHole] );
}
// Triangulate
cdt->Triangulate();
// Hint: if you find any crashes on the triangulation poly2tri library,
// you can use the following site to debug the points and it will mark
// the errors in the polygon:
// http://r3mi.github.io/poly2tri.js/
// Get and add triangles
std::vector<p2t::Triangle*> triangles;
triangles = cdt->GetTriangles();
#ifdef APPLY_EDGE_SHRINK
const double conver_d = (double)aBiuTo3DunitsScale *
POLY_SCALE_FACT_INVERSE;
#else
const double conver_d = (double)aBiuTo3DunitsScale;
#endif
for( unsigned int i = 0; i < triangles.size(); ++i )
{
p2t::Triangle& t = *triangles[i];
p2t::Point& a = *t.GetPoint( 0 );
p2t::Point& b = *t.GetPoint( 1 );
p2t::Point& c = *t.GetPoint( 2 );
VECTOR2I a;
VECTOR2I b;
VECTOR2I c;
triPoly->GetTriangle( i, a, b, c );
aDstContainer.Add( new CTRIANGLE2D( SFVEC2F( a.x * conver_d,
-a.y * conver_d ),
@ -302,15 +158,5 @@ void Convert_shape_line_polygon_to_triangles( const SHAPE_POLY_SET &aPolyList,
aBoardItem ) );
}
// Delete created data
delete cdt;
// Free points
FreeClear(polyline);
for( unsigned int idxHole = 0; idxHole < nHoles; ++idxHole )
{
FreeClear( polylineHoles[idxHole] );
}
}
}

View File

@ -68,7 +68,7 @@ public:
};
void Convert_shape_line_polygon_to_triangles( const SHAPE_POLY_SET &aPolyList,
void Convert_shape_line_polygon_to_triangles( SHAPE_POLY_SET &aPolyList,
CGENERICCONTAINER2D &aDstContainer,
float aBiuTo3DunitsScale,
const BOARD_ITEM &aBoardItem );

View File

@ -1,89 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 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 2
* 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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file edgeshrink.cpp
* @brief The edgeShrink function was found in the project clip2tri by the:
* Bitfighter project (http://bitfighter.org)
* https://github.com/raptor/clip2tri
* https://github.com/raptor/clip2tri/blob/f62a734d22733814b8a970ed8a68a4d94c24fa5f/clip2tri/clip2tri.cpp#L150
*/
#include <plugins/3dapi/xv3d_types.h>
#include <vector>
// clip2tri is Licenced under:
// The MIT License (MIT)
// Copyright (c) 2014 Bitfighter developers
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// Shrink large polygons by reducing each coordinate by 1 in the
// general direction of the last point as we wind around
//
// This normally wouldn't work in every case, but our upscaled-by-1000 polygons
// have little chance to create new duplicate points with this method.
//
// For information on why this was needed, see:
//
// https://github.com/greenm01/poly2tri/issues/90
//
#define S_INC 1
void EdgeShrink( std::vector<SFVEC2I64> &aPath )
{
unsigned int prev = aPath.size() - 1;
for( unsigned int i = 0; i < aPath.size(); i++ )
{
// Adjust coordinate by 1 depending on the direction
(aPath[i].x - aPath[prev].x) > 0 ? aPath[i].x -= S_INC :
aPath[i].x += S_INC;
(aPath[i].y - aPath[prev].y) > 0 ? aPath[i].y -= S_INC :
aPath[i].y += S_INC;
prev = i;
}
}

View File

@ -271,7 +271,7 @@ SFVEC3F CBBOX::Offset( const SFVEC3F &p ) const
// https://github.com/mmp/pbrt-v2/blob/master/src/core/geometry.cpp#L68
// /////////////////////////////////////////////////////////////////////////
#if 0
bool CBBOX::Intersect( const RAY &aRay, float *aOutHitt0, float *aOutHitt1 )
bool CBBOX::Intersect( const RAY &aRay, float *aOutHitt0, float *aOutHitt1 ) const
{
float t0 = 0.0f;
float t1 = FLT_MAX;

View File

@ -31,6 +31,10 @@
#include "buffers_debug.h"
#include <string.h> // For memcpy
#include <atomic>
#include <thread>
#include <chrono>
#ifndef CLAMP
#define CLAMP(n, min, max) {if( n < min ) n=min; else if( n > max ) n = max;}
#endif
@ -469,34 +473,51 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType )
aInImg->m_wraping = WRAP_CLAMP;
m_wraping = WRAP_CLAMP;
#pragma omp parallel for
for( int iy = 0; iy < (int)m_height; iy++)
std::atomic<size_t> nextRow( 0 );
std::atomic<size_t> threadsFinished( 0 );
size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
{
for( int ix = 0; ix < (int)m_width; ix++ )
std::thread t = std::thread( [&]()
{
int v = 0;
for( int sy = 0; sy < 5; sy++ )
for( size_t iy = nextRow.fetch_add( 1 );
iy < m_height;
iy = nextRow.fetch_add( 1 ) )
{
for( int sx = 0; sx < 5; sx++ )
for( size_t ix = 0; ix < m_width; ix++ )
{
int factor = filter.kernel[sx][sy];
unsigned char pixelv = aInImg->Getpixel( ix + sx - 2,
iy + sy - 2 );
int v = 0;
v += pixelv * factor;
for( size_t sy = 0; sy < 5; sy++ )
{
for( size_t sx = 0; sx < 5; sx++ )
{
int factor = filter.kernel[sx][sy];
unsigned char pixelv = aInImg->Getpixel( ix + sx - 2,
iy + sy - 2 );
v += pixelv * factor;
}
}
v /= filter.div;
v += filter.offset;
CLAMP(v, 0, 255);
//TODO: This needs to write to a separate buffer
m_pixels[ix + iy * m_width] = v;
}
}
v /= filter.div;
threadsFinished++;
} );
v += filter.offset;
CLAMP(v, 0, 255);
m_pixels[ix + iy * m_width] = v;
}
t.detach();
}
while( threadsFinished < parallelThreadCount )
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
}

View File

@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 2 2017)
// C++ code generated with wxFormBuilder (version Jul 11 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_3D_view_option_base.h"
@ -134,7 +134,7 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
bSizeLeft->Add( fgSizer3DVisibility, 0, wxEXPAND, 5 );
bSizerUpper->Add( bSizeLeft, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
bSizerUpper->Add( bSizeLeft, 1, wxEXPAND, 5 );
m_staticlineVertical = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
bSizerUpper->Add( m_staticlineVertical, 0, wxEXPAND | wxALL, 5 );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<FileVersion major="1" minor="14" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">dialog_3D_view_option_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_3D_view_option_base</property>
<property name="namespace"></property>
@ -54,13 +55,20 @@
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneActivated"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -75,17 +83,23 @@
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMaximize"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnMove"></event>
<event name="OnMoveEnd"></event>
<event name="OnMoveStart"></event>
<event name="OnMoving"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnShow"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
@ -104,7 +118,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
@ -144,6 +158,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Render options:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -169,7 +184,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -276,7 +298,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -363,7 +392,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox">OnCheckRealisticMode</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -455,7 +491,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -542,7 +585,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -634,7 +684,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -721,7 +778,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -813,7 +877,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -900,7 +971,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -992,7 +1070,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1079,7 +1164,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -1168,6 +1260,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">3D model visibility:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1193,7 +1286,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1300,7 +1400,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1387,7 +1494,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -1479,7 +1593,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1566,7 +1687,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -1658,7 +1786,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1745,7 +1880,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -1831,7 +1973,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1907,6 +2056,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Board layers:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1932,7 +2082,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2039,7 +2196,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2126,7 +2290,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -2218,7 +2389,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2305,7 +2483,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -2397,7 +2582,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2484,7 +2676,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -2576,7 +2775,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2663,7 +2869,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -2734,6 +2947,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">User layers (not shown in realistic mode):</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2759,7 +2973,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2866,7 +3087,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2953,7 +3181,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -3045,7 +3280,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -3132,7 +3374,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -3222,7 +3471,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>

View File

@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 2 2017)
// C++ code generated with wxFormBuilder (version Jul 11 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_3D_VIEW_OPTION_BASE_H__
@ -11,8 +11,6 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>

View File

@ -40,11 +40,6 @@ set(3D-VIEWER_SRCS
${DIR_DLG}/dlg_select_3dmodel.cpp
${DIR_DLG}/panel_prev_3d_base.cpp
${DIR_DLG}/panel_prev_model.cpp
../polygon/poly2tri/common/shapes.cc
../polygon/poly2tri/sweep/advancing_front.cc
../polygon/poly2tri/sweep/cdt.cc
../polygon/poly2tri/sweep/sweep.cc
../polygon/poly2tri/sweep/sweep_context.cc
3d_canvas/cinfo3d_visu.cpp
3d_canvas/create_layer_items.cpp
3d_canvas/create_3Dgraphic_brd_items.cpp
@ -79,7 +74,6 @@ set(3D-VIEWER_SRCS
${DIR_RAY_2D}/cring2d.cpp
${DIR_RAY_2D}/croundsegment2d.cpp
${DIR_RAY_2D}/ctriangle2d.cpp
${DIR_RAY_2D}/edgeshrink.cpp
${DIR_RAY_3D}/cbbox.cpp
${DIR_RAY_3D}/cbbox_ray.cpp
${DIR_RAY_3D}/ccylinder.cpp

View File

@ -1,81 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 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 2
* 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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file openmp_mutex.h
* @brief a mutex for openmp got from the website:
* http://bisqwit.iki.fi/story/howto/openmp/
* by Joel Yliluoma <bisqwit@iki.fi>
*/
#ifndef _OPENMP_MUTEX_H
#define _OPENMP_MUTEX_H
#ifdef _OPENMP
# include <omp.h>
struct MutexType
{
MutexType() { omp_init_lock( &lock ); }
~MutexType() { omp_destroy_lock( &lock ); }
void Lock() { omp_set_lock( &lock ); }
void Unlock() { omp_unset_lock( &lock ); }
MutexType( const MutexType& ) { omp_init_lock( &lock ); }
MutexType& operator= ( const MutexType& ) { return *this; }
public:
omp_lock_t lock;
};
#else
/// A dummy mutex that doesn't actually exclude anything,
/// but as there is no parallelism either, no worries.
struct MutexType
{
void Lock() {}
void Unlock() {}
};
#endif
/// An exception-safe scoped lock-keeper.
struct ScopedLock
{
explicit ScopedLock( MutexType& m ) : mut( m ), locked( true ) { mut.Lock(); }
~ScopedLock() { Unlock(); }
void Unlock() { if( !locked ) return; locked = false; mut.Unlock(); }
void LockAgain() { if( locked ) return; mut.Lock(); locked = true; }
private:
MutexType& mut;
bool locked;
private: // prevent copying the scoped lock.
void operator=(const ScopedLock&);
ScopedLock(const ScopedLock&);
};
#endif // _OPENMP_MUTEX_H

View File

@ -30,8 +30,6 @@ if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW) # CMake 3.0
endif()
project( kicad )
# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html
if( DEFINED CMAKE_BUILD_TYPE )
@ -40,11 +38,20 @@ else()
set( CMAKE_BUILD_TYPE Release CACHE STRING "Set to either \"Release\" or \"Debug\"" )
endif()
project( kicad )
include( GNUInstallDirs )
# Path to local CMake modules.
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
# On Windows, binaries created by link option -g3 are very large (more than 1Gb for pcbnew,
# and more than 3Gb for the full kicad suite)
# This option create binaries using link option -g1 that create much smaller files, but
# there are less info in debug (but the file names and line numbers are available)
option( BUILD_SMALL_DEBUG_FILES "In debug build: create smaller binaries." OFF )
#
# KiCad build options should be added below.
#
@ -72,8 +79,8 @@ option( KICAD_SCRIPTING_WXPYTHON
ON )
option( KICAD_SCRIPTING_ACTION_MENU
"Build a tools menu with registred python plugins: actions plugins (default OFF)."
)
"Build a tools menu with registered python plugins: actions plugins (default ON)."
ON )
option( KICAD_USE_OCE
"Build tools and plugins related to OpenCascade Community Edition (default ON)"
@ -267,6 +274,10 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set( TO_LINKER -XLinker )
else()
set( TO_LINKER -Wl )
# Set 32-bit flag for GCC to prevent excess precision
if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set( CMAKE_CXX_FLAGS "-ffloat-store ${CMAKE_CXX_FLAGS}" )
endif()
endif()
# Establish -Wall early, so specialized relaxations of this may come
@ -274,8 +285,18 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set( CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}" )
set( CMAKE_C_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG" )
set( CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG -Wno-deprecated-declarations" )
# Link flags in Debug: -g1 and -ggdb1 or -g1 and -ggdb3 can be used.
# Level 1 produces minimal information, enough for making basic backtraces.
# This includes descriptions of functions and external variables, and line number tables,
# but no information about local variables.
# Level 3 includes full information, but binaries are much larger.
if( BUILD_SMALL_DEBUG_FILES )
set( CMAKE_C_FLAGS_DEBUG "-g1 -ggdb1 -DDEBUG" )
set( CMAKE_CXX_FLAGS_DEBUG "-g1 -ggdb1 -DDEBUG -Wno-deprecated-declarations" )
else()
set( CMAKE_C_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG" )
set( CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG -Wno-deprecated-declarations" )
endif()
if( MINGW )
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
@ -526,24 +547,6 @@ include( ExternalProject )
#================================================
include( CheckFindPackageResult )
#
# Find OpenMP support, optional
#
find_package( OpenMP )
if( OPENMP_FOUND )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
add_definitions( -DUSE_OPENMP )
# MinGW does not include the OpenMP link library and FindOpenMP.cmake does not
# set it either. Not sure this is the most elegant solution but it works.
if( MINGW )
set( OPENMP_LIBRARIES gomp )
endif()
endif()
#
# Find wxWidgets library, required
#
@ -579,7 +582,7 @@ endif()
#
# Find OpenGL library, required
#
set( OpenGL_GL_PREFERENCE "GLVND" ) # CMake 3.11+ setting; see 'cmake --help-policy CMP0072'
set( OpenGL_GL_PREFERENCE "LEGACY" ) # CMake 3.11+ setting; see 'cmake --help-policy CMP0072'
find_package( OpenGL REQUIRED )
#
@ -912,6 +915,7 @@ if( UNIX AND NOT APPLE )
endif()
#include( CTest )
enable_testing()
if( UNIX AND NOT APPLE )

View File

@ -12,6 +12,15 @@ find_library( NGSPICE_LIBRARY ngspice
PATH_SUFFIXES src/.libs lib
)
if( WIN32 AND MSYS )
# NGSPICE_LIBRARY points to libngspice.dll.a on Windows,
# but the goal is to find out the DLL name.
find_library( NGSPICE_DLL NAMES libngspice-0.dll libngspice-1.dll )
else()
set( NGSPICE_DLL "${NGSPICE_LIBRARY}" )
endif()
include( FindPackageHandleStandardArgs )
if( ${NGSPICE_INCLUDE_DIR} STREQUAL "NGSPICE_INCLUDE_DIR-NOTFOUND" OR ${NGSPICE_LIBRARY} STREQUAL "NGSPICE_LIBRARY-NOTFOUND" )
@ -28,12 +37,10 @@ if( ${NGSPICE_INCLUDE_DIR} STREQUAL "NGSPICE_INCLUDE_DIR-NOTFOUND" OR ${NGSPICE_
endif()
find_package_handle_standard_args( ngspice
REQUIRED_VARS
NGSPICE_INCLUDE_DIR
NGSPICE_LIBRARY
)
REQUIRED_VARS NGSPICE_INCLUDE_DIR NGSPICE_LIBRARY NGSPICE_DLL )
mark_as_advanced(
NGSPICE_INCLUDE_DIR
NGSPICE_LIBRARY
NGSPICE_DLL
)

View File

@ -35,4 +35,4 @@
# be set after each version tag is added to the git repo. This will
# give developers a reasonable idea where which branch was used to build
# KiCad.
set( KICAD_VERSION "5.0.0" )
set( KICAD_VERSION "5.0.2-unknown" )

View File

@ -72,4 +72,7 @@
#define KIFACE_SUFFIX "@KIFACE_SUFFIX@"
#define KIFACE_PREFIX "@KIFACE_PREFIX@"
/// Allows scripts install directory to be referenced by the program code.
#define PYTHON_DEST "@PYTHON_DEST@"
#endif // CONFIG_H_

661
LICENSE.AGPLv3 Normal file
View File

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

674
LICENSE.GPLv3 Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

13
LICENSE.README Normal file
View File

@ -0,0 +1,13 @@
The majority of KiCad's source code is developed and distributed under the terms
of the GPLv3 or later. However, It does include some third-party code licensed
under AGPLv3 or later.
Both licenses are compatible, but a combined works as is will be governed under
the terms of the AGPLv3 (or later). This includes any binary distribution of the
KiCad EDA suite by the KiCad project or any third party, e.g. Linux distributor.
You are free to use the *sources* under the terms of their respective licenses.
Licensed under AGPLv3 (or later):
- TTL [https://www.sintef.no/projectweb/geometry-toolkits/ttl/], sources in include/ttl/*
Licensed under GPLv3 (or later):

View File

@ -32,6 +32,8 @@
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -119,12 +119,12 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
brightSizer->Add( sbSizerInfo, 0, wxEXPAND|wxALL, 5 );
m_buttonLoad = new wxButton( m_panelRight, wxID_ANY, _("Load Bitmap"), wxDefaultPosition, wxDefaultSize, 0 );
brightSizer->Add( m_buttonLoad, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
brightSizer->Add( m_buttonLoad, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_buttonExport = new wxButton( m_panelRight, wxID_ANY, _("Export"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonExport->SetToolTip( _("Create a library file for Eeschema\nThis library contains only one component: logo") );
brightSizer->Add( m_buttonExport, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
brightSizer->Add( m_buttonExport, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
wxString m_radioBoxFormatChoices[] = { _("Eeschema (.lib file)"), _("Pcbnew (.kicad_mod file)"), _("Postscript (.ps file)"), _("Logo for title block (.kicad_wks file)") };
int m_radioBoxFormatNChoices = sizeof( m_radioBoxFormatChoices ) / sizeof( wxString );
@ -142,7 +142,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
m_sliderThreshold = new wxSlider( sbSizer2->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
m_sliderThreshold->SetToolTip( _("Adjust the level to convert the greyscale picture to a black and white picture.") );
sbSizer2->Add( m_sliderThreshold, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizer2->Add( m_sliderThreshold, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_checkNegative = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Negative"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer2->Add( m_checkNegative, 0, wxBOTTOM|wxTOP, 10 );
@ -153,7 +153,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
wxString m_radio_PCBLayerChoices[] = { _("Front silk screen"), _("Front solder mask"), _("User layer Eco1"), _("User layer Eco2") };
int m_radio_PCBLayerNChoices = sizeof( m_radio_PCBLayerChoices ) / sizeof( wxString );
m_radio_PCBLayer = new wxRadioBox( m_panelRight, wxID_ANY, _("Board Layer for Outline:"), wxDefaultPosition, wxDefaultSize, m_radio_PCBLayerNChoices, m_radio_PCBLayerChoices, 1, wxRA_SPECIFY_COLS );
m_radio_PCBLayer->SetSelection( 3 );
m_radio_PCBLayer->SetSelection( 0 );
m_radio_PCBLayer->SetToolTip( _("Choose the board layer to place the outline.\nThe 2 invisible fields reference and value are always placed on the silk screen layer.") );
brightSizer->Add( m_radio_PCBLayer, 0, wxALL|wxEXPAND, 5 );

View File

@ -1813,7 +1813,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@ -1901,7 +1901,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@ -2175,7 +2175,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxSlider" expanded="1">
<property name="BottomDockable">1</property>
@ -2421,7 +2421,7 @@
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">3</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!

View File

@ -305,8 +305,7 @@ set( BMAPS_MID
label2glabel
label2text
label
lang_catalan
lang_chinese
lang_ca
lang_bg
lang_cs
lang_def
@ -327,6 +326,7 @@ set( BMAPS_MID
lang_sk
lang_sl
lang_lt
lang_zh
language
layers_manager
leave_sheet

View File

@ -25,6 +25,6 @@ static const unsigned char png[] = {
0x2b, 0xeb, 0x17, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE lang_chinese_xpm[1] = {{ png, sizeof( png ), "lang_chinese_xpm" }};
const BITMAP_OPAQUE lang_zh_xpm[1] = {{ png, sizeof( png ), "lang_zh_xpm" }};
//EOF

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -13,7 +13,7 @@
version="1.1"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="lang_chinese.svg">
sodipodi:docname="lang_zh.svg">
<metadata
id="metadata21">
<rdf:RDF>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -19,6 +19,7 @@ include_directories(
${INC_AFTER}
${OCE_INCLUDE_DIRS}
${OCC_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
)

View File

@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2014-2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2019 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
@ -58,7 +58,27 @@ EDA_UNITS_T g_UserUnit;
COLOR4D g_GhostColor;
std::atomic<unsigned int> LOCALE_IO::m_c_count(0);
#if defined( _WIN32 ) && defined( DEBUG )
// a wxAssertHandler_t function to filter wxWidgets alert messages when reading/writing a file
// when switching the locale to LC_NUMERIC, "C"
// It is used in class LOCALE_IO to hide a useless (in kicad) wxWidgets alert message
void KiAssertFilter( const wxString &file, int line,
const wxString &func, const wxString &cond,
const wxString &msg)
{
if( !msg.Contains( "Decimal separator mismatch" ) )
wxTheApp->OnAssertFailure( file, line, func, cond, msg );
}
#endif
std::atomic<unsigned int> LOCALE_IO::m_c_count( 0 );
// Note on Windows, setlocale( LC_NUMERIC, "C" ) works fine to read/write
// files with floating point numbers, but generates a overzealous wx alert
// in some cases (reading a bitmap for instance)
// So we disable alerts during the time a file is read or written
LOCALE_IO::LOCALE_IO()
{
@ -66,9 +86,13 @@ LOCALE_IO::LOCALE_IO()
if( m_c_count++ == 0 )
{
// Store the user locale name, to restore this locale later, in dtor
m_user_locale = setlocale( LC_ALL, 0 );
m_user_locale = setlocale( LC_NUMERIC, nullptr );
#if defined( _WIN32 ) && defined( DEBUG )
// Disable wxWidgets alerts
wxSetAssertHandler( KiAssertFilter );
#endif
// Switch the locale to C locale, to read/write files with fp numbers
setlocale( LC_ALL, "C" );
setlocale( LC_NUMERIC, "C" );
}
}
@ -79,7 +103,11 @@ LOCALE_IO::~LOCALE_IO()
if( --m_c_count == 0 )
{
// revert to the user locale
setlocale( LC_ALL, m_user_locale.c_str() );
setlocale( LC_NUMERIC, m_user_locale.c_str() );
#if defined( _WIN32 ) && defined( DEBUG )
// Enaable wxWidgets alerts
wxSetDefaultAssertHandler();
#endif
}
}

View File

@ -72,13 +72,17 @@ void KIDIALOG::ForceShowAgain()
bool KIDIALOG::Show( bool aShow )
{
// Check if this dialog should be shown to the user
auto it = doNotShowAgainDlgs.find( m_hash );
// We should check the do-not-show-again setting only when the dialog is displayed
if( aShow )
{
// Check if this dialog should be shown to the user
auto it = doNotShowAgainDlgs.find( m_hash );
if( it != doNotShowAgainDlgs.end() )
return it->second;
if( it != doNotShowAgainDlgs.end() )
return it->second;
}
bool ret = wxRichMessageDialog::Show();
bool ret = wxRichMessageDialog::Show( aShow );
// Has the user asked not to show the dialog again
if( IsCheckBoxChecked() )
@ -233,7 +237,7 @@ void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxSt
bool IsOK( wxWindow* aParent, const wxString& aMessage )
{
wxMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
wxYES_NO | wxCENTRE | wxICON_QUESTION );
wxYES_NO | wxCENTRE | wxICON_QUESTION | wxSTAY_ON_TOP );
return dlg.ShowModal() == wxID_YES;
}

View File

@ -184,7 +184,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
<< HtmlNewline( 4 )
<< _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 )
<< HtmlHyperlink( "http://www.gnu.org/licenses",
_( "GNU General Public License (GPL) version 3 or any later version" ) )
_( "GNU Affero General Public License (AGPL) version 3 or any later version" ) )
<< "</div>";
aInfo.SetLicense( license );
@ -369,6 +369,11 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
wxEmptyString,
"Bulgarian (BG)",
aInfo.CreateKiBitmap( lang_bg_xpm ) ) );
aInfo.AddTranslator( new CONTRIBUTOR( "Liu Guang",
wxEmptyString,
wxEmptyString,
"Simplified Chinese (zh_CN)",
aInfo.CreateKiBitmap( lang_zh_xpm ) ) );
// Maintainer who helper in translations, but not in a specific translation
#define OTHERS_IN_TRANSLATION _( "Others" )

View File

@ -255,13 +255,18 @@ static void fixOSXCancelButtonIssue( wxWindow *aWindow )
// copying the text if a button with wxID_CANCEL is used in a
// wxStdDialogButtonSizer created by wxFormBuilder: the label is &Cancel, and
// this accelerator key has priority over the standard copy accelerator.
// Note: problem also exists in other languages; for instance cmd+a closes
// dialogs in German because the button is &Abbrechen.
wxButton* button = dynamic_cast<wxButton*>( wxWindow::FindWindowById( wxID_CANCEL, aWindow ) );
if( button )
{
static const wxString placeholder = wxT( "{amp}" );
wxString buttonLabel = button->GetLabel();
buttonLabel.Replace( wxT( "&C" ), wxT( "C" ) );
buttonLabel.Replace( wxT( "&c" ), wxT( "c" ) );
buttonLabel.Replace( wxT( "&&" ), placeholder );
buttonLabel.Replace( wxT( "&" ), wxEmptyString );
buttonLabel.Replace( placeholder, wxT( "&" ) );
button->SetLabel( buttonLabel );
}
}

View File

@ -193,7 +193,7 @@ bool DIALOG_ENV_VAR_CONFIG::GetPathAtIndex( unsigned int aIndex, wxString& aEnvV
void DIALOG_ENV_VAR_CONFIG::OnAddButton( wxCommandEvent& event )
{
DIALOG_ENV_VAR_SINGLE dlg( nullptr, wxEmptyString, wxEmptyString );
DIALOG_ENV_VAR_SINGLE dlg( this, wxEmptyString, wxEmptyString );
if( dlg.ShowModal() == wxID_OK )
{
@ -230,7 +230,7 @@ void DIALOG_ENV_VAR_CONFIG::EditSelectedEntry()
if( GetPathAtIndex( m_pathIndex, envName, envPath ) )
{
auto dlg = new DIALOG_ENV_VAR_SINGLE( nullptr, envName, envPath );
auto dlg = new DIALOG_ENV_VAR_SINGLE( this, envName, envPath );
if( IsEnvVarImmutable( envName ) )
{
@ -432,7 +432,7 @@ void DIALOG_ENV_VAR_SINGLE::OnSelectPath( wxCommandEvent& event )
wxString title = _( "Select Path for Environment Variable" );
wxString path; // Currently the first opened path is not initialized
wxDirDialog dlg( nullptr, title, path, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
wxDirDialog dlg( this, title, path, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
if( dlg.ShowModal() == wxID_OK )
m_envVarPath->SetValue( dlg.GetPath() );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 22 2017)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -43,15 +43,14 @@ HOTKEYS_EDITOR_DIALOG_BASE::HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWind
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
b_buttonsSizer->Add( m_sdbSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
b_buttonsSizer->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
m_mainSizer->Add( b_buttonsSizer, 0, wxALIGN_RIGHT|wxEXPAND, 5 );
m_mainSizer->Add( b_buttonsSizer, 0, wxEXPAND, 5 );
this->SetSizer( m_mainSizer );
this->Layout();
m_mainSizer->Fit( this );
// Connect Events
m_resetButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::ResetClicked ), NULL, this );

View File

@ -14,6 +14,7 @@
<property name="file">dialog_hotkeys_editor_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_hotkeys_editor_base</property>
<property name="namespace"></property>
@ -44,7 +45,7 @@
<property name="minimum_size"></property>
<property name="name">HOTKEYS_EDITOR_DIALOG_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="size">513,445</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Hotkeys Editor</property>
@ -88,7 +89,7 @@
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_mainSizer</property>
<property name="orient">wxVERTICAL</property>
@ -256,11 +257,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxEXPAND</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">b_buttonsSizer</property>
<property name="orient">wxHORIZONTAL</property>
@ -453,7 +454,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="0">
<property name="Apply">0</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 22 2017)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -50,7 +50,7 @@ class HOTKEYS_EDITOR_DIALOG_BASE : public DIALOG_SHIM
public:
HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hotkeys Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hotkeys Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 513,445 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~HOTKEYS_EDITOR_DIALOG_BASE();
};

View File

@ -1395,6 +1395,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
wxLogTrace( kicadTraceKeyEvent, "EDA_DRAW_PANEL::OnKeyEvent %s", dump( event ) );
localkey = event.GetKeyCode();
bool keyWasHandled = false;
switch( localkey )
{
@ -1408,6 +1409,8 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
EndMouseCapture();
else
EndMouseCapture( ID_NO_TOOL_SELECTED, m_defaultCursor, wxEmptyString );
keyWasHandled = true; // The key is captured: the key event must not be skipped
break;
}
@ -1446,8 +1449,8 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
GetParent()->SetMousePosition( pos );
if( !GetParent()->GeneralControl( &DC, pos, localkey ) )
event.Skip();
if( !GetParent()->GeneralControl( &DC, pos, localkey ) && !keyWasHandled )
event.Skip(); // Skip this event only when the key was not handled
}

View File

@ -147,6 +147,12 @@ void EDA_DRAW_PANEL_GAL::SetFocus()
void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
{
m_viewControls->UpdateScrollbars();
// Drawing to a zero-width or zero-height GAL is fraught with peril.
if( GetClientRect().IsEmpty() )
return;
m_pendingRefresh = false;
if( m_drawing )
@ -161,8 +167,6 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
m_drawing = true;
KIGFX::RENDER_SETTINGS* settings = static_cast<KIGFX::RENDER_SETTINGS*>( m_painter->GetSettings() );
m_viewControls->UpdateScrollbars();
try
{
m_view->UpdateItems();

View File

@ -56,17 +56,16 @@ FOOTPRINT_INFO* FOOTPRINT_LIST::GetModuleInfo( const wxString& aFootprintName )
if( aFootprintName.IsEmpty() )
return NULL;
LIB_ID fpid;
wxCHECK_MSG( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) < 0, NULL,
wxString::Format( wxT( "\"%s\" is not a valid LIB_ID." ), aFootprintName ) );
wxString libNickname = fpid.GetLibNickname();
wxString footprintName = fpid.GetLibItemName();
for( auto& fp : m_list )
{
LIB_ID fpid;
wxCHECK_MSG( fpid.Parse( aFootprintName ) < 0, NULL,
wxString::Format(
wxT( "\"%s\" is not a valid LIB_ID." ), GetChars( aFootprintName ) ) );
wxString libNickname = fpid.GetLibNickname();
wxString footprintName = fpid.GetLibItemName();
if( libNickname == fp->GetNickname() && footprintName == fp->GetFootprintName() )
return &*fp;
}

View File

@ -33,6 +33,7 @@
#include <gal/cairo/cairo_compositor.h>
#include <gal/definitions.h>
#include <geometry/shape_poly_set.h>
#include <bitmap_base.h>
#include <limits>
@ -347,6 +348,61 @@ void CAIRO_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aControl
}
void CAIRO_GAL::DrawBitmap( const BITMAP_BASE& aBitmap )
{
int ppi = aBitmap.GetPPI();
double worldIU_per_mm = 1/(worldUnitLength/2.54)/1000;
double pix_size_iu = worldIU_per_mm * ( 25.4 / ppi );
int w = aBitmap.GetSizePixels().x;
int h = aBitmap.GetSizePixels().y;
cairo_save( currentContext );
// Set the pixel scaling factor:
cairo_scale( currentContext, pix_size_iu, pix_size_iu );
// The position of the bitmap is the bitmap center.
// move the draw origin to the top left bitmap corner:
cairo_translate( currentContext, -w/2, -h/2 );
cairo_new_path( currentContext );
cairo_surface_t *image;
image = cairo_image_surface_create( CAIRO_FORMAT_RGB24, w, h );
cairo_surface_flush( image );
unsigned char* pix_buffer = cairo_image_surface_get_data( image );
// The pixel buffer of the initial bitmap:
auto bm_pix_buffer = (( BITMAP_BASE&)aBitmap).GetImageData();
// Copy the source bitmap to the cairo bitmap buffer.
// In cairo bitmap buffer, a RGB24 bitmap is a RGB pixel packed into a uint_32
// 24 low bits only are used.
for( int row = 0; row < h; row++ )
{
for( int col = 0; col < w; col++ )
{
// Build the RGB24 pixel:
uint32_t pixel = bm_pix_buffer->GetRed( col, row ) << 16;
pixel += bm_pix_buffer->GetGreen( col, row ) << 8;
pixel += bm_pix_buffer->GetBlue( col, row );
// Write the pixel to the cairo image buffer:
uint32_t* pix_ptr = (uint32_t*) pix_buffer;
*pix_ptr = pixel;
pix_buffer += 4;
}
}
cairo_surface_mark_dirty( image );
cairo_set_source_surface( currentContext, image, 0, 0 );
cairo_paint( currentContext );
cairo_surface_destroy( image );
isElementAdded = true;
cairo_restore( currentContext );
}
void CAIRO_GAL::ResizeScreen( int aWidth, int aHeight )
{
screenSize = VECTOR2I( aWidth, aHeight );

View File

@ -32,6 +32,7 @@
#include <gl_context_mgr.h>
#include <geometry/shape_poly_set.h>
#include <text_utils.h>
#include <bitmap_base.h>
#include <macros.h>
@ -63,6 +64,101 @@ GLuint OPENGL_GAL::fontTexture = 0;
bool OPENGL_GAL::isBitmapFontLoaded = false;
SHADER* OPENGL_GAL::shader = NULL;
namespace KIGFX {
class GL_BITMAP_CACHE
{
public:
GL_BITMAP_CACHE()
{
}
~GL_BITMAP_CACHE();
GLuint RequestBitmap( const BITMAP_BASE* aBitmap );
private:
struct CACHED_BITMAP
{
GLuint id;
int w, h;
};
GLuint cacheBitmap( const BITMAP_BASE* aBitmap );
std::map<const BITMAP_BASE*, CACHED_BITMAP> m_bitmaps;
};
};
GL_BITMAP_CACHE::~GL_BITMAP_CACHE()
{
for ( auto b = m_bitmaps.begin(); b != m_bitmaps.end(); ++b )
{
glDeleteTextures( 1, &b->second.id );
}
}
GLuint GL_BITMAP_CACHE::RequestBitmap( const BITMAP_BASE* aBitmap )
{
auto it = m_bitmaps.find( aBitmap) ;
if ( it != m_bitmaps.end() )
{
return it->second.id;
}
else
{
return cacheBitmap( aBitmap );
}
}
GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap )
{
CACHED_BITMAP bmp;
bmp.w = aBitmap->GetSizePixels().x;
bmp.h = aBitmap->GetSizePixels().y;
// There are draw issues (incorrect rendering) with some w values.
// It happens when the w value is not a multiple of 4
// so we use only a sub image with a modified width
bmp.w -= bmp.w % 4;
GLuint textureID;
glGenTextures(1, &textureID);
uint8_t *buf = new uint8_t [ bmp.w * bmp.h * 3];
auto imgData = const_cast<BITMAP_BASE*>( aBitmap )->GetImageData();
for( int y = 0; y < bmp.h; y++ )
{
for( int x = 0; x < bmp.w; x++ )
{
uint8_t *p = buf + ( bmp.w * y + x ) * 3;
p[0] = imgData->GetRed( x, y );
p[1] = imgData->GetGreen( x, y );
p[2] = imgData->GetBlue( x, y );
}
}
glBindTexture( GL_TEXTURE_2D, textureID );
glTexImage2D( GL_TEXTURE_2D, 0,GL_RGB, bmp.w, bmp.h, 0, GL_RGB, GL_UNSIGNED_BYTE, buf );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
delete [] buf;
bmp.id = textureID;
m_bitmaps[ aBitmap ] = bmp;
return textureID;
}
OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
wxEvtHandler* aMouseListener, wxEvtHandler* aPaintListener,
@ -102,6 +198,8 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
++instanceCounter;
bitmapCache.reset( new GL_BITMAP_CACHE );
compositor = new OPENGL_COMPOSITOR;
compositor->SetAntialiasingMode( options.gl_antialiasing_mode );
@ -222,7 +320,7 @@ bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
void OPENGL_GAL::BeginDrawing()
{
if( !IsShownOnScreen() )
if( !IsShownOnScreen() || GetClientRect().IsEmpty() )
return;
#ifdef __WXDEBUG__
@ -393,7 +491,7 @@ void OPENGL_GAL::EndDrawing()
void OPENGL_GAL::BeginUpdate()
{
if( !IsShownOnScreen() )
if( !IsShownOnScreen() || GetClientRect().IsEmpty() )
return;
if( !isInitialized )
@ -809,10 +907,10 @@ void OPENGL_GAL::drawTriangulatedPolyset( const SHAPE_POLY_SET& aPolySet )
{
auto triPoly = aPolySet.TriangulatedPolygon( j );
for( int i = 0; i < triPoly->GetTriangleCount(); i++ )
for( size_t i = 0; i < triPoly->GetTriangleCount(); i++ )
{
VECTOR2I a, b, c;
triPoly->GetTriangle( i ,a,b,c);
triPoly->GetTriangle( i, a, b, c );
currentManager->Vertex( a.x, a.y, layerDepth );
currentManager->Vertex( b.x, b.y, layerDepth );
currentManager->Vertex( c.x, c.y, layerDepth );
@ -899,6 +997,55 @@ void OPENGL_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aContro
}
void OPENGL_GAL::DrawBitmap( const BITMAP_BASE& aBitmap )
{
int ppi = aBitmap.GetPPI();
double worldIU_per_mm = 1.0 / ( worldUnitLength / 2.54 )/ 1000;
double pix_size_iu = worldIU_per_mm * ( 25.4 / ppi );
double w = aBitmap.GetSizePixels().x * pix_size_iu;
double h = aBitmap.GetSizePixels().y * pix_size_iu;
auto xform = currentManager->GetTransformation();
glm::vec4 v0 = xform * glm::vec4( -w/2, -h/2, 0.0, 0.0 );
glm::vec4 v1 = xform * glm::vec4( w/2, h/2, 0.0, 0.0 );
glm::vec4 trans = xform[3];
auto id = bitmapCache->RequestBitmap( &aBitmap );
auto oldTarget = GetTarget();
glPushMatrix();
glTranslated( trans.x, trans.y, trans.z );
SetTarget( TARGET_NONCACHED );
glEnable(GL_TEXTURE_2D);
glActiveTexture( GL_TEXTURE0 );
glBindTexture( GL_TEXTURE_2D, id );
glBegin( GL_QUADS );
glColor4f(1.0, 1.0, 1.0, 1.0);
glTexCoord2f(0.0, 0.0);
glVertex3f( v0.x, v0.y, layerDepth );
glColor4f(1.0, 1.0, 1.0, 1.0);
glTexCoord2f(1.0, 0.0);
glVertex3f( v1.x, v0.y, layerDepth );
glColor4f(1.0, 1.0, 1.0, 1.0);
glTexCoord2f(1.0, 1.0);
glVertex3f( v1.x, v1.y, layerDepth );
glColor4f(1.0, 1.0, 1.0, 1.0);
glTexCoord2f(0.0, 1.0);
glVertex3f( v0.x, v1.y, layerDepth );
glEnd();
SetTarget( oldTarget );
glBindTexture( GL_TEXTURE_2D, 0 );
glPopMatrix();
}
void OPENGL_GAL::BitmapText( const wxString& aText, const VECTOR2D& aPosition,
double aRotationAngle )
{
@ -1288,19 +1435,22 @@ void OPENGL_GAL::EndGroup()
void OPENGL_GAL::DrawGroup( int aGroupNumber )
{
cachedManager->DrawItem( *groups[aGroupNumber] );
if( groups[aGroupNumber] )
cachedManager->DrawItem( *groups[aGroupNumber] );
}
void OPENGL_GAL::ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor )
{
cachedManager->ChangeItemColor( *groups[aGroupNumber], aNewColor );
if( groups[aGroupNumber] )
cachedManager->ChangeItemColor( *groups[aGroupNumber], aNewColor );
}
void OPENGL_GAL::ChangeGroupDepth( int aGroupNumber, int aDepth )
{
cachedManager->ChangeItemDepth( *groups[aGroupNumber], aDepth );
if( groups[aGroupNumber] )
cachedManager->ChangeItemDepth( *groups[aGroupNumber], aDepth );
}
@ -1313,6 +1463,8 @@ void OPENGL_GAL::DeleteGroup( int aGroupNumber )
void OPENGL_GAL::ClearCache()
{
bitmapCache.reset( new GL_BITMAP_CACHE );
groups.clear();
if( isInitialized )
@ -1614,9 +1766,11 @@ int OPENGL_GAL::drawBitmapChar( unsigned long aChar )
}
const FONT_GLYPH_TYPE* glyph = LookupGlyph( aChar );
wxASSERT( glyph );
if( !glyph )
if( !glyph ) // Replace any non existing char shape by '?'
glyph = LookupGlyph( '?' );
if( !glyph ) // Should not occur
return 0;
const float X = glyph->atlas_x + font_information.smooth_pixels;
@ -1707,9 +1861,12 @@ std::pair<VECTOR2D, float> OPENGL_GAL::computeBitmapTextSize( const UTF8& aText
unsigned int c = *chIt;
const FONT_GLYPH_TYPE* glyph = LookupGlyph( c );
wxASSERT( c == ' ' || glyph ); // space is not in the atlas
// Debug: show not coded char in the atlas
// Be carefull before allowing the assert: it usually crash kicad
// when the assert is made during a paint event.
//wxASSERT( c == ' ' || glyph ); // space is not in the atlas, so not found
// a few chars
// a few chars are strange in font
if( !glyph || // Not coded in font
c == '-' || c == '_' ) // Strange size of these 2 chars
{

View File

@ -32,6 +32,80 @@
#include <gbr_metadata.h>
wxString GbrMakeProjectGUIDfromString( wxString& aText )
{
/* Gerber GUID format should be RFC4122 Version 1 or 4.
* See en.wikipedia.org/wiki/Universally_unique_identifier
* The format is:
* xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
* with
* x = hexDigit lower/upper case
* and
* M = '1' or '4' (UUID version: 1 (basic) or 4 (random)) (we use 4: UUID random)
* and
* N = '8' or '9' or 'A|a' or 'B|b' : UUID variant 1: 2 MSB bits have meaning) (we use N = 9)
* N = 1000 or 1001 or 1010 or 1011 : 10xx means Variant 1 (Variant2: 110x and 111x are reserved)
*/
wxString guid;
// Build a 32 digits GUID from the board name:
// guid has 32 digits, so add chars in name to be sure we can build a 32 digits guid
// (i.e. from a 16 char string name)
// In fact only 30 digits are used, and 2 UID id
wxString bname = aText;
int cnt = 16 - bname.Len();
if( cnt > 0 )
bname.Append( 'X', cnt );
int chr_idx = 0;
// Output the 8 first hex digits:
for( unsigned ii = 0; ii < 4; ii++ )
{
int cc = int( bname[chr_idx++] ) & 0xFF;
guid << wxString::Format( "%2.2x", cc );
}
// Output the 4 next hex digits:
guid << '-';
for( unsigned ii = 0; ii < 2; ii++ )
{
int cc = int( bname[chr_idx++] ) & 0xFF;
guid << wxString::Format( "%2.2x", cc );
}
// Output the 4 next hex digits (UUID version and 3 digits):
guid << "-4"; // first digit: UUID version 4 (M = 4)
{
int cc = int( bname[chr_idx++] ) << 4 & 0xFF0;
cc += int( bname[chr_idx] ) >> 4 & 0x0F;
guid << wxString::Format( "%3.3x", cc );
}
// Output the 4 next hex digits (UUID variant and 3 digits):
guid << "-9"; // first digit: UUID variant 1 (N = 9)
{
int cc = (int( bname[chr_idx++] ) & 0x0F) << 8;
cc += int( bname[chr_idx++] ) & 0xFF;
guid << wxString::Format( "%3.3x", cc );
}
// Output the 12 last hex digits:
guid << '-';
for( unsigned ii = 0; ii < 6; ii++ )
{
int cc = int( bname[chr_idx++] ) & 0xFF;
guid << wxString::Format( "%2.2x", cc );
}
return guid;
}
std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribute,
bool aUseX1StructuredComment )
{

View File

@ -27,6 +27,25 @@
#include <common.h>
#include <geometry/shape_line_chain.h>
#include <geometry/shape_circle.h>
#include "clipper.hpp"
ClipperLib::Path SHAPE_LINE_CHAIN::convertToClipper( bool aRequiredOrientation ) const
{
ClipperLib::Path c_path;
for( int i = 0; i < PointCount(); i++ )
{
const VECTOR2I& vertex = CPoint( i );
c_path.push_back( ClipperLib::IntPoint( vertex.x, vertex.y ) );
}
if( Orientation( c_path ) != aRequiredOrientation )
ReversePath( c_path );
return c_path;
}
bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const
{

View File

@ -42,8 +42,7 @@
#include <geometry/shape.h>
#include <geometry/shape_line_chain.h>
#include <geometry/shape_poly_set.h>
#include "poly2tri/poly2tri.h"
#include <geometry/polygon_triangulation.h>
using namespace ClipperLib;
@ -53,9 +52,18 @@ SHAPE_POLY_SET::SHAPE_POLY_SET() :
}
SHAPE_POLY_SET::SHAPE_POLY_SET( const SHAPE_POLY_SET& aOther ) :
SHAPE_POLY_SET::SHAPE_POLY_SET( const SHAPE_POLY_SET& aOther, bool aDeepCopy ) :
SHAPE( SH_POLY_SET ), m_polys( aOther.m_polys )
{
if( aOther.IsTriangulationUpToDate() )
{
for( unsigned i = 0; i < aOther.TriangulatedPolyCount(); i++ )
m_triangulatedPolys.push_back(
std::make_unique<TRIANGULATED_POLYGON>( *aOther.TriangulatedPolygon( i ) ) );
m_hash = aOther.GetHash();
m_triangulationValid = true;
}
}
@ -456,62 +464,10 @@ int SHAPE_POLY_SET::AddHole( const SHAPE_LINE_CHAIN& aHole, int aOutline )
}
const Path SHAPE_POLY_SET::convertToClipper( const SHAPE_LINE_CHAIN& aPath,
bool aRequiredOrientation )
{
Path c_path;
for( int i = 0; i < aPath.PointCount(); i++ )
{
const VECTOR2I& vertex = aPath.CPoint( i );
c_path.push_back( IntPoint( vertex.x, vertex.y ) );
}
if( Orientation( c_path ) != aRequiredOrientation )
ReversePath( c_path );
return c_path;
}
const SHAPE_LINE_CHAIN SHAPE_POLY_SET::convertFromClipper( const Path& aPath )
{
SHAPE_LINE_CHAIN lc;
for( unsigned int i = 0; i < aPath.size(); i++ )
lc.Append( aPath[i].X, aPath[i].Y );
lc.SetClosed( true );
return lc;
}
void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET& aOtherShape,
POLYGON_MODE aFastMode )
{
Clipper c;
if( aFastMode == PM_STRICTLY_SIMPLE )
c.StrictlySimple( true );
for( const POLYGON& poly : m_polys )
{
for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptSubject, true );
}
for( const POLYGON& poly : aOtherShape.m_polys )
{
for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptClip, true );
}
PolyTree solution;
c.Execute( aType, solution, pftNonZero, pftNonZero );
importTree( &solution );
booleanOp( aType, *this, aOtherShape, aFastMode );
}
@ -522,19 +478,18 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType,
{
Clipper c;
if( aFastMode == PM_STRICTLY_SIMPLE )
c.StrictlySimple( true );
c.StrictlySimple( aFastMode == PM_STRICTLY_SIMPLE );
for( const POLYGON& poly : aShape.m_polys )
for( auto poly : aShape.m_polys )
{
for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptSubject, true );
for( size_t i = 0 ; i < poly.size(); i++ )
c.AddPath( poly[i].convertToClipper( i == 0 ), ptSubject, true );
}
for( const POLYGON& poly : aOtherShape.m_polys )
for( auto poly : aOtherShape.m_polys )
{
for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptClip, true );
for( size_t i = 0; i < poly.size(); i++ )
c.AddPath( poly[i].convertToClipper( i == 0 ), ptClip, true );
}
PolyTree solution;
@ -599,9 +554,8 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
for( const POLYGON& poly : m_polys )
{
for( unsigned int i = 0; i < poly.size(); i++ )
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), jtRound,
etClosedPolygon );
for( size_t i = 0; i < poly.size(); i++ )
c.AddPath( poly[i].convertToClipper( i == 0 ), jtRound, etClosedPolygon );
}
PolyTree solution;
@ -644,10 +598,10 @@ void SHAPE_POLY_SET::importTree( PolyTree* tree )
{
POLYGON paths;
paths.reserve( n->Childs.size() + 1 );
paths.push_back( convertFromClipper( n->Contour ) );
paths.push_back( n->Contour );
for( unsigned int i = 0; i < n->Childs.size(); i++ )
paths.push_back( convertFromClipper( n->Childs[i]->Contour ) );
paths.push_back( n->Childs[i]->Contour );
m_polys.push_back( paths );
}
@ -1862,164 +1816,6 @@ SHAPE_POLY_SET &SHAPE_POLY_SET::operator=( const SHAPE_POLY_SET& aOther )
return *this;
}
class SHAPE_POLY_SET::TRIANGULATION_CONTEXT
{
public:
TRIANGULATION_CONTEXT( TRIANGULATED_POLYGON* aResultPoly ) :
m_triPoly( aResultPoly )
{
}
void AddOutline( const SHAPE_LINE_CHAIN& outl, bool aIsHole = false )
{
m_points.reserve( outl.PointCount() );
m_points.clear();
for( int i = 0; i < outl.PointCount(); i++ )
{
m_points.push_back( addPoint( outl.CPoint( i ) ) );
}
if ( aIsHole )
m_cdt->AddHole( m_points );
else
m_cdt.reset( new p2t::CDT( m_points ) );
}
void Triangulate()
{
m_cdt->Triangulate();
m_triPoly->AllocateTriangles( m_cdt->GetTriangles().size() );
int i = 0;
for( auto tri : m_cdt->GetTriangles() )
{
TRIANGULATED_POLYGON::TRI t;
t.a = tri->GetPoint( 0 )->id;
t.b = tri->GetPoint( 1 )->id;
t.c = tri->GetPoint( 2 )->id;
m_triPoly->SetTriangle(i, t);
i++;
}
for( auto p : m_uniquePoints )
delete p;
}
private:
class comparePoints
{
public:
bool operator()( p2t::Point* a, p2t::Point* b ) const
{
if (a->x < b->x)
return true;
if( a->x == b->x )
return ( a->y > b->y );
return false;
}
};
p2t::Point* addPoint( const VECTOR2I& aP )
{
p2t::Point check( aP.x, aP.y );
auto it = m_uniquePoints.find( &check );
if( it != m_uniquePoints.end() )
{
return *it;
}
else
{
auto lastId = m_triPoly->GetVertexCount();
auto p = new p2t::Point( aP.x, aP.y, lastId );
m_triPoly->AddVertex( aP );
m_uniquePoints.insert ( p );
return p;
}
}
typedef std::set<p2t::Point*, comparePoints> P2T_SET;
typedef std::vector<p2t::Point*> P2T_VEC;
P2T_VEC m_points;
P2T_SET m_uniquePoints;
TRIANGULATED_POLYGON *m_triPoly;
std::unique_ptr<p2t::CDT> m_cdt;
};
SHAPE_POLY_SET::TRIANGULATED_POLYGON::~TRIANGULATED_POLYGON()
{
Clear();
}
void SHAPE_POLY_SET::TRIANGULATED_POLYGON::Clear()
{
if( m_vertices )
delete[] m_vertices;
if( m_triangles )
delete[] m_triangles;
}
void SHAPE_POLY_SET::TRIANGULATED_POLYGON::AllocateVertices( int aSize )
{
m_vertices = new VECTOR2I[aSize];
}
void SHAPE_POLY_SET::TRIANGULATED_POLYGON::AllocateTriangles( int aSize )
{
m_triangles = new TRI[aSize];
m_triangleCount = aSize;
}
static int totalVertexCount( const SHAPE_POLY_SET::POLYGON& aPoly )
{
int cnt = 0;
for( const auto& outl : aPoly )
{
cnt += outl.PointCount();
}
return cnt;
}
void SHAPE_POLY_SET::triangulateSingle( const POLYGON& aPoly,
SHAPE_POLY_SET::TRIANGULATED_POLYGON& aResult )
{
if( aPoly.size() == 0 )
return;
TRIANGULATION_CONTEXT ctx ( &aResult );
aResult.AllocateVertices( totalVertexCount( aPoly ) );
ctx.AddOutline( aPoly[0], false );
for( unsigned i = 1; i < aPoly.size(); i++ )
{
ctx.AddOutline( aPoly[i], true ); // add holes
}
ctx.Triangulate();
}
MD5_HASH SHAPE_POLY_SET::GetHash() const
{
if( !m_hash.IsValid() )
@ -2067,22 +1863,17 @@ void SHAPE_POLY_SET::CacheTriangulation()
SHAPE_POLY_SET tmpSet = *this;
if( !tmpSet.HasHoles() )
tmpSet.Unfracture( PM_FAST );
if( tmpSet.HasHoles() )
tmpSet.Fracture( PM_FAST );
m_triangulatedPolys.clear();
if( tmpSet.HasTouchingHoles() )
{
// temporary workaround for overlapping hole vertices that poly2tri doesn't handle
m_triangulationValid = false;
return;
}
for( int i = 0; i < tmpSet.OutlineCount(); i++ )
{
m_triangulatedPolys.push_back( std::make_unique<TRIANGULATED_POLYGON>() );
triangulateSingle( tmpSet.Polygon( i ), *m_triangulatedPolys.back() );
PolygonTriangulation tess( *m_triangulatedPolys.back() );
tess.TesselatePolygon( tmpSet.Polygon( i ).front() );
}
m_triangulationValid = true;
@ -2134,20 +1925,20 @@ bool SHAPE_POLY_SET::HasTouchingHoles() const
bool SHAPE_POLY_SET::hasTouchingHoles( const POLYGON& aPoly ) const
{
std::vector< VECTOR2I > pts;
std::set< long long > ptHashes;
for( const auto& lc : aPoly )
{
for( int i = 0; i < lc.PointCount(); i++ )
for( const VECTOR2I& pt : lc.CPoints() )
{
const auto p = lc.CPoint( i );
const long long ptHash = (long long) pt.x << 32 | pt.y;
if( std::find( pts.begin(), pts.end(), p ) != pts.end() )
if( ptHashes.count( ptHash ) > 0 )
{
return true;
}
pts.push_back( p );
ptHashes.insert( ptHash );
}
}

View File

@ -358,7 +358,7 @@ bool OpenPDF( const wxString& file )
}
else
{
if( wxLaunchDefaultApplication( file ) )
if( wxLaunchDefaultApplication( filename ) )
return true;
// If launching the system default PDF viewer fails, fall through with empty command

View File

@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, j-p.charras at wanadoo.fr
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2010-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -94,6 +94,7 @@ struct hotkey_name_descr
* "Space","Ctrl+Space","Alt+Space" or
* "Alt+A","Ctrl+F1", ...
*/
#define KEY_NON_FOUND -1
static struct hotkey_name_descr hotkeyNameList[] =
{
{ wxT( "F1" ), WXK_F1 },
@ -112,7 +113,7 @@ static struct hotkey_name_descr hotkeyNameList[] =
{ wxT( "Esc" ), WXK_ESCAPE },
{ wxT( "Del" ), WXK_DELETE },
{ wxT( "Tab" ), WXK_TAB },
{ wxT( "BkSp" ), WXK_BACK },
{ wxT( "Back" ), WXK_BACK },
{ wxT( "Ins" ), WXK_INSERT },
{ wxT( "Home" ), WXK_HOME },
@ -129,8 +130,10 @@ static struct hotkey_name_descr hotkeyNameList[] =
{ wxT( "Space" ), WXK_SPACE },
{ wxT( "<unassigned>" ), 0 },
// Do not change this line: end of list
{ wxT( "" ), 0 }
{ wxT( "" ), KEY_NON_FOUND }
};
// name of modifier keys.
@ -169,9 +172,6 @@ wxString KeyNameFromKeyCode( int aKeycode, bool* aIsFound )
bool found = false;
// Assume keycode of 0 is "unassigned"
if( aKeycode == 0 )
return wxT( "<unassigned>");
if( (aKeycode & GR_KB_CTRL) != 0 )
modifier << MODIFIER_CTRL;
@ -192,7 +192,7 @@ wxString KeyNameFromKeyCode( int aKeycode, bool* aIsFound )
{
for( ii = 0; ; ii++ )
{
if( hotkeyNameList[ii].m_KeyCode == 0 ) // End of list
if( hotkeyNameList[ii].m_KeyCode == KEY_NON_FOUND ) // End of list
{
keyname = wxT( "<unknown>" );
break;
@ -377,7 +377,7 @@ wxString KeyNameFromCommandId( EDA_HOTKEY** aList, int aCommandId )
*/
int KeyCodeFromKeyName( const wxString& keyname )
{
int ii, keycode = 0;
int ii, keycode = KEY_NON_FOUND;
// Search for modifiers: Ctrl+ Alt+ and Shift+
// Note: on Mac OSX, the Cmd key is equiv here to Ctrl
@ -425,7 +425,7 @@ int KeyCodeFromKeyName( const wxString& keyname )
return keycode;
}
for( ii = 0; hotkeyNameList[ii].m_KeyCode != 0; ii++ )
for( ii = 0; hotkeyNameList[ii].m_KeyCode != KEY_NON_FOUND; ii++ )
{
if( key.CmpNoCase( hotkeyNameList[ii].m_Name ) == 0 )
{
@ -734,7 +734,11 @@ void ParseHotkeyConfig( const wxString& data,
if( hk_decr->m_InfoMsg == fctname )
{
hk_decr->m_KeyCode = KeyCodeFromKeyName( keyname );
int keycode = KeyCodeFromKeyName( keyname );
if( keycode != KEY_NON_FOUND ) // means the key name is found in list or unassigned
hk_decr->m_KeyCode = keycode;
break;
}
}

View File

@ -119,7 +119,7 @@ void LIB_ID::clear()
}
int LIB_ID::Parse( const UTF8& aId )
int LIB_ID::Parse( const UTF8& aId, LIB_ID_TYPE aType, bool aFix )
{
clear();
@ -127,7 +127,7 @@ int LIB_ID::Parse( const UTF8& aId )
const char* rev = EndsWithRev( buffer, buffer+aId.length(), '/' );
size_t revNdx;
size_t partNdx;
int offset;
int offset = -1;
//=====<revision>=========================================
// in a LIB_ID like discret:R3/rev4
@ -150,9 +150,7 @@ int LIB_ID::Parse( const UTF8& aId )
offset = SetLibNickname( aId.substr( 0, partNdx ) );
if( offset > -1 )
{
return offset;
}
++partNdx; // skip ':'
}
@ -165,48 +163,24 @@ int LIB_ID::Parse( const UTF8& aId )
if( partNdx >= revNdx )
return partNdx; // Error: no library item name.
UTF8 fpname = aId.substr( partNdx, revNdx-partNdx );
// Be sure the item name is valid.
// Some chars can be found in legacy files converted files from other EDA tools.
std::string fpname = aId.substr( partNdx, revNdx-partNdx );
ReplaceIllegalFileNameChars( &fpname, '_' );
SetLibItemName( UTF8( fpname ) );
if( aFix )
fpname = FixIllegalChars( fpname, aType, false );
else
offset = HasIllegalChars( fpname, aType );
if( offset > -1 )
return offset;
SetLibItemName( fpname );
return -1;
}
LIB_ID::LIB_ID( const UTF8& aId )
{
int offset = Parse( aId );
if( offset != -1 )
{
THROW_PARSE_ERROR( _( "Illegal character found in LIB_ID string" ),
wxString::FromUTF8( aId.c_str() ),
aId.c_str(),
0,
offset );
}
}
LIB_ID::LIB_ID( const wxString& aId )
{
UTF8 id = aId;
int offset = Parse( id );
if( offset != -1 )
{
THROW_PARSE_ERROR( _( "Illegal character found in LIB_ID string" ),
aId,
id.c_str(),
0,
offset );
}
}
LIB_ID::LIB_ID( const wxString& aLibName, const wxString& aLibItemName,
const wxString& aRevision ) :
nickname( aLibName ),
@ -359,15 +333,19 @@ int LIB_ID::compare( const LIB_ID& aLibId ) const
}
bool LIB_ID::HasIllegalChars( const UTF8& aLibItemName, LIB_ID_TYPE aType )
int LIB_ID::HasIllegalChars( const UTF8& aLibItemName, LIB_ID_TYPE aType )
{
int offset = 0;
for( auto ch : aLibItemName )
{
if( !isLegalChar( ch, aType ) )
return true;
return offset;
else
++offset;
}
return false;
return -1;
}
@ -390,20 +368,23 @@ UTF8 LIB_ID::FixIllegalChars( const UTF8& aLibItemName, LIB_ID_TYPE aType, bool
bool LIB_ID::isLegalChar( unsigned aUniChar, LIB_ID_TYPE aType )
{
bool const colon_allowed = ( aType == ID_ALIAS );
bool const space_allowed = ( aType != ID_SCH );
bool const space_allowed = ( aType == ID_PCB );
bool const illegal_filename_chars_allowed = ( aType == ID_SCH );
if( aUniChar < ' ' )
return false;
switch( aUniChar )
{
case ':':
case '/':
case '\\':
return false;
case ':':
return colon_allowed;
case '\\':
case '<':
case '>':
case '"':
return illegal_filename_chars_allowed;
case ' ':
return space_allowed;

View File

@ -53,15 +53,7 @@ ORIGIN_VIEWITEM* ORIGIN_VIEWITEM::Clone() const
const BOX2I ORIGIN_VIEWITEM::ViewBBox() const
{
BOX2I bbox;
// The origin item doesn't have a fixed size. It is constant on the screen but
// changes the effective BBox size based on the zoom level.
// But we can't simply set it to the maximum size as this causes a splitting degeneracy
// when compiling for Debian i386. By modestly adjusting the bbox, we avoid the degeneracy
// while keeping the origin visible at all zoom levels
bbox.SetSize( VECTOR2I( INT_MAX - 2, INT_MAX - 2 ) );
bbox.SetOrigin( VECTOR2I( INT_MIN / 2 + 1, INT_MIN / 2 + 1 ) );
bbox.SetMaximum();
return bbox;
}

View File

@ -237,7 +237,7 @@ static LANGUAGE_DESCR s_Languages[] =
{
wxLANGUAGE_CHINESE_SIMPLIFIED,
ID_LANGUAGE_CHINESE_SIMPLIFIED,
lang_chinese_xpm,
lang_zh_xpm,
_( "Chinese simplified" )
},
@ -831,7 +831,7 @@ bool PGM_BASE::SetLanguage( bool first_time )
if( result != dtst )
// string to double encode/decode does not work! Bug detected:
// Disable floating point localization:
setlocale( LC_ALL, "C" );
setlocale( LC_NUMERIC, "C" );
if( !m_locale->IsLoaded( dictionaryName ) )
m_locale->AddCatalog( dictionaryName );

View File

@ -1,8 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2019 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
@ -203,8 +203,12 @@ bool GERBER_PLOTTER::StartPlot()
m_gerberUnitInch ? "inch" : "mm" );
wxString Title = creator + wxT( " " ) + GetBuildVersion();
// In gerber files, ASCII7 chars only are allowed.
// So use a ISO date format (using a space as separator between date and time),
// not a localized date format
wxDateTime date = wxDateTime::Now();
fprintf( outputFile, "G04 Created by KiCad (%s) date %s*\n",
TO_UTF8( Title ), TO_UTF8( DateAndTime() ) );
TO_UTF8( Title ), TO_UTF8( date.FormatISOCombined( ' ') ) );
/* Mass parameter: unit = INCHES/MM */
if( m_gerberUnitInch )
@ -215,9 +219,6 @@ bool GERBER_PLOTTER::StartPlot()
// Be sure the usual dark polarity is selected:
fputs( "%LPD*%\n", outputFile );
// Specify linear interpol (G01):
fputs( "G01*\n", outputFile );
fputs( "G04 APERTURE LIST*\n", outputFile );
return true;
@ -484,7 +485,7 @@ void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAn
DPOINT devEnd = userToDeviceCoordinates( end );
DPOINT devCenter = userToDeviceCoordinates( aCenter ) - userToDeviceCoordinates( start );
fprintf( outputFile, "G75*\n" ); // Multiquadrant mode
fprintf( outputFile, "G75*\n" ); // Multiquadrant (360 degrees) mode
if( aStAngle < aEndAngle )
fprintf( outputFile, "G03" );
@ -494,7 +495,8 @@ void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAn
fprintf( outputFile, "X%dY%dI%dJ%dD01*\n",
KiROUND( devEnd.x ), KiROUND( devEnd.y ),
KiROUND( devCenter.x ), KiROUND( devCenter.y ) );
fprintf( outputFile, "G01*\n" ); // Back to linear interp.
fprintf( outputFile, "G01*\n" ); // Back to linear interpol (perhaps useless here).
}
@ -519,6 +521,7 @@ void GERBER_PLOTTER:: PlotPoly( const std::vector< wxPoint >& aCornerList,
fputs( "G36*\n", outputFile );
MoveTo( aCornerList[0] );
fputs( "G01*\n", outputFile ); // Set linear interpolation.
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
LineTo( aCornerList[ii] );

View File

@ -135,6 +135,13 @@ typedef long time_t;
#include <geometry/shape.h>
%include <geometry/shape.h>
// Contains VECTOR2I
%include math.i
%ignore SHAPE_LINE_CHAIN::convertFromClipper;
#include <geometry/shape_line_chain.h>
%include <geometry/shape_line_chain.h>
#include <geometry/shape_poly_set.h>
%include <geometry/shape_poly_set.h>

34
common/swig/math.i Normal file
View File

@ -0,0 +1,34 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2017 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 2
* 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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file math.i
* @brief wrappers for math helper classes
*/
%ignore VECTOR2<int>::ECOORD_MAX;
%ignore VECTOR2<int>::ECOORD_MIN;
#include <math/vector2d.h>
%include <math/vector2d.h>
%template(VECTOR2I) VECTOR2<int>;

View File

@ -399,6 +399,32 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
key += 'A' - 1;
}
#ifdef __APPLE__
if( mods & MD_ALT )
{
// OSX maps a bunch of commonly used extended-ASCII characters onto the keyboard
// using the ALT key. Since we use ALT for some of our hotkeys, we need to map back
// to the underlying keys. The kVK_ANSI_* values come from Apple and are said to be
// hardware independant.
switch( ke->GetRawKeyCode() )
{
case /* kVK_ANSI_1 */ 0x12: key = '1'; break;
case /* kVK_ANSI_2 */ 0x13: key = '2'; break;
case /* kVK_ANSI_3 */ 0x14: key = '3'; break;
case /* kVK_ANSI_4 */ 0x15: key = '4'; break;
case /* kVK_ANSI_6 */ 0x16: key = '6'; break;
case /* kVK_ANSI_5 */ 0x17: key = '5'; break;
case /* kVK_ANSI_Equal */ 0x18: key = '='; break;
case /* kVK_ANSI_9 */ 0x19: key = '9'; break;
case /* kVK_ANSI_7 */ 0x1A: key = '7'; break;
case /* kVK_ANSI_Minus */ 0x1B: key = '-'; break;
case /* kVK_ANSI_8 */ 0x1C: key = '8'; break;
case /* kVK_ANSI_0 */ 0x1D: key = '0'; break;
default: ;
}
}
#endif
if( key == WXK_ESCAPE ) // ESC is the special key for canceling tools
evt = TOOL_EVENT( TC_COMMAND, TA_CANCEL_TOOL );
else

View File

@ -24,6 +24,9 @@
#include <utf8.h>
#include <ki_exception.h>
#include <wx/strconv.h>
#include <wx/buffer.h>
#include <vector>
/* THROW_IO_ERROR needs this, but it includes this file, so until some
factoring of THROW_IO_ERROR into a separate header, defer and use the asserts.
@ -197,24 +200,21 @@ bool IsUTF8( const char* aString )
}
UTF8::UTF8( const wchar_t* txt ) :
// size initial string safely large enough, then shrink to known size later.
m_s( wcslen( txt ) * 4, 0 )
UTF8::UTF8( const wchar_t* txt )
{
/*
try
{
std::vector< char > temp( wcslen( txt ) * 4 + 1 );
wxConvUTF8.WC2MB( temp.data(), txt, temp.size() );
m_s.assign( temp.data() );
}
catch(...)
{
auto string = wxSafeConvertWX2MB( txt );
m_s.assign( string );
}
"this" string was sized to hold the worst case UTF8 encoded byte
sequence, and was initialized with all nul bytes. Overwrite some of
those nuls, then resize, shrinking down to actual size.
Use the wx 2.8 function, not new FromWChar(). It knows about wchar_t
possibly being 16 bits wide on Windows and holding UTF16 input.
*/
int sz = wxConvUTF8.WC2MB( (char*) m_s.data(), txt, m_s.size() );
m_s.resize( sz );
m_s.shrink_to_fit();
}
@ -224,6 +224,7 @@ UTF8& UTF8::operator+=( unsigned w_ch )
m_s.operator+=( char( w_ch ) );
else
{
//TODO: Remove wchar use. Replace with std::byte*
wchar_t wide_chr[2]; // buffer to store wide chars (UTF16) read from aText
wide_chr[1] = 0;
wide_chr[0] = w_ch;

View File

@ -41,7 +41,7 @@
using namespace KIGFX;
VIEW_GROUP::VIEW_GROUP( VIEW* aView ) :
m_layer( LAYER_GP_OVERLAY )
m_layer( LAYER_SELECT_OVERLAY )
{
}
@ -100,10 +100,10 @@ const BOX2I VIEW_GROUP::ViewBBox() const
void VIEW_GROUP::ViewDraw( int aLayer, VIEW* aView ) const
{
auto gal = aView->GetGAL();
PAINTER* painter = aView->GetPainter();
const auto drawList = updateDrawList();
KIGFX::GAL* gal = aView->GetGAL();
PAINTER* painter = aView->GetPainter();
bool isSelection = m_layer == LAYER_SELECT_OVERLAY;
const auto drawList = updateDrawList();
std::unordered_map<int, std::vector<VIEW_ITEM*>> layer_item_map;
@ -140,7 +140,25 @@ void VIEW_GROUP::ViewDraw( int aLayer, VIEW* aView ) const
for( int i = 0; i < layers_count; i++ )
{
if( aView->IsLayerVisible( layers[i] ) )
int layer = layers[i];
bool draw = aView->IsLayerVisible( layer );
if( isSelection )
{
switch( layer )
{
case LAYER_PADS_TH:
case LAYER_PADS_PLATEDHOLES:
case LAYER_PAD_FR:
case LAYER_PAD_BK:
draw = true;
break;
default:
break;
}
}
if( draw )
{
gal->AdvanceDepth();

View File

@ -253,6 +253,18 @@ WIDGET_HOTKEY_CLIENT_DATA* WIDGET_HOTKEY_LIST::GetSelHKClientData()
}
WIDGET_HOTKEY_CLIENT_DATA* WIDGET_HOTKEY_LIST::getExpectedHkClientData( wxTreeListItem aItem )
{
const auto hkdata = GetHKClientData( aItem );
// This probably means a hotkey-only action is being attempted on
// a row that is not a hotkey (like a section heading)
wxASSERT_MSG( hkdata != nullptr, "No hotkey data found for list item" );
return hkdata;
}
void WIDGET_HOTKEY_LIST::UpdateFromClientData()
{
for( wxTreeListItem i = GetFirstItem(); i.IsOk(); i = GetNextItem( i ) )
@ -285,13 +297,10 @@ void WIDGET_HOTKEY_LIST::LoadSection( EDA_HOTKEY_CONFIG* aSection )
void WIDGET_HOTKEY_LIST::EditItem( wxTreeListItem aItem )
{
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( aItem );
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem );
if( !hkdata )
{
// Activated item was not a hotkey row
return;
}
wxString name = GetItemText( aItem, 0 );
wxString current_key = GetItemText( aItem, 1 );
@ -299,7 +308,7 @@ void WIDGET_HOTKEY_LIST::EditItem( wxTreeListItem aItem )
wxKeyEvent key_event = HK_PROMPT_DIALOG::PromptForKey( GetParent(), name, current_key );
long key = MapKeypressToKeycode( key_event );
if( hkdata && key )
if( key )
{
// See if this key code is handled in hotkeys names list
bool exists;
@ -327,7 +336,11 @@ void WIDGET_HOTKEY_LIST::EditItem( wxTreeListItem aItem )
void WIDGET_HOTKEY_LIST::ResetItem( wxTreeListItem aItem )
{
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( aItem );
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem );
if( !hkdata )
return;
EDA_HOTKEY* hk = &hkdata->GetHotkey();
for( size_t sec_index = 0; sec_index < m_sections.size(); ++sec_index )
@ -356,9 +369,14 @@ void WIDGET_HOTKEY_LIST::ResetItem( wxTreeListItem aItem )
void WIDGET_HOTKEY_LIST::ResetItemToDefault( wxTreeListItem aItem )
{
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( aItem );
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem );
if( !hkdata )
return;
EDA_HOTKEY* hk = &hkdata->GetHotkey();
hk->ResetKeyCodeToDefault();
UpdateFromClientData();
}
@ -376,10 +394,17 @@ void WIDGET_HOTKEY_LIST::OnContextMenu( wxTreeListEvent& aEvent )
wxMenu menu;
menu.Append( ID_EDIT, _( "Edit..." ) );
menu.Append( ID_RESET, _( "Undo Changes" ) );
menu.Append( ID_DEFAULT, _( "Restore Default" ) );
menu.Append( wxID_SEPARATOR );
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( m_context_menu_item );
// Some actions only apply if the row is hotkey data
if( hkdata )
{
menu.Append( ID_EDIT, _( "Edit..." ) );
menu.Append( ID_RESET, _( "Undo Changes" ) );
menu.Append( ID_DEFAULT, _( "Restore Default" ) );
menu.Append( wxID_SEPARATOR );
}
menu.Append( ID_RESET_ALL, _( "Undo All Changes" ) );
menu.Append( ID_DEFAULT_ALL, _( "Restore All to Default" ) );

View File

@ -68,40 +68,40 @@ static wxString FormatWildcardExt( const wxString& aWildcard )
}
const wxString SchematicSymbolFileExtension( "sym" );
const wxString SchematicLibraryFileExtension( "lib" );
const wxString SchematicBackupFileExtension( "bak" );
const std::string SchematicSymbolFileExtension( "sym" );
const std::string SchematicLibraryFileExtension( "lib" );
const std::string SchematicBackupFileExtension( "bak" );
const wxString VrmlFileExtension( "wrl" );
const std::string VrmlFileExtension( "wrl" );
const wxString ProjectFileExtension( "pro" );
const wxString SchematicFileExtension( "sch" );
const wxString NetlistFileExtension( "net" );
const wxString ComponentFileExtension( "cmp" );
const wxString GerberFileExtension( "gbr" );
const wxString GerberJobFileExtension( "gbrjob" );
const wxString HtmlFileExtension( wxT( "html" ) );
const std::string ProjectFileExtension( "pro" );
const std::string SchematicFileExtension( "sch" );
const std::string NetlistFileExtension( "net" );
const std::string ComponentFileExtension( "cmp" );
const std::string GerberFileExtension( "gbr" );
const std::string GerberJobFileExtension( "gbrjob" );
const std::string HtmlFileExtension( "html" );
const wxString LegacyPcbFileExtension( "brd" );
const wxString KiCadPcbFileExtension( "kicad_pcb" );
const wxString PageLayoutDescrFileExtension( "kicad_wks" );
const std::string LegacyPcbFileExtension( "brd" );
const std::string KiCadPcbFileExtension( "kicad_pcb" );
const std::string PageLayoutDescrFileExtension( "kicad_wks" );
const wxString PdfFileExtension( "pdf" );
const wxString MacrosFileExtension( "mcr" );
const wxString DrillFileExtension( "drl" );
const wxString SVGFileExtension( "svg" );
const wxString ReportFileExtension( "rpt" );
const wxString FootprintPlaceFileExtension( "pos" );
const wxString KiCadLib3DShapesPathExtension( "3dshapes" ); ///< 3D shapes default libpath
const std::string PdfFileExtension( "pdf" );
const std::string MacrosFileExtension( "mcr" );
const std::string DrillFileExtension( "drl" );
const std::string SVGFileExtension( "svg" );
const std::string ReportFileExtension( "rpt" );
const std::string FootprintPlaceFileExtension( "pos" );
const std::string KiCadLib3DShapesPathExtension( "3dshapes" ); ///< 3D shapes default libpath
const wxString KiCadFootprintLibPathExtension( "pretty" ); ///< KICAD PLUGIN libpath
const wxString LegacyFootprintLibPathExtension( "mod" );
const wxString EagleFootprintLibPathExtension( "lbr" );
const std::string KiCadFootprintLibPathExtension( "pretty" ); ///< KICAD PLUGIN libpath
const std::string LegacyFootprintLibPathExtension( "mod" );
const std::string EagleFootprintLibPathExtension( "lbr" );
const wxString KiCadFootprintFileExtension( "kicad_mod" );
const wxString GedaPcbFootprintLibFileExtension( "fp" );
const wxString SpecctraDsnFileExtension( "dsn" );
const wxString IpcD356FileExtension( "d356" );
const std::string KiCadFootprintFileExtension( "kicad_mod" );
const std::string GedaPcbFootprintLibFileExtension( "fp" );
const std::string SpecctraDsnFileExtension( "dsn" );
const std::string IpcD356FileExtension( "d356" );
const wxString AllFilesWildcard( _( "All files (*)|*" ) );

View File

@ -29,6 +29,7 @@
#include <worksheet_viewitem.h>
#include <worksheet_shape_builder.h>
#include <worksheet_dataitem.h>
#include <gal/graphics_abstraction_layer.h>
#include <painter.h>
#include <layers_id_colors_and_visibility.h>
@ -119,6 +120,7 @@ void WORKSHEET_VIEWITEM::ViewDraw( int aLayer, VIEW* aView ) const
break;
case WS_DRAW_ITEM_BASE::wsg_bitmap:
draw( static_cast<const WS_DRAW_ITEM_BITMAP*>( item ), gal );
break;
}
@ -198,6 +200,25 @@ void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_TEXT* aItem, GAL* aGal ) const
}
void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_BITMAP* aItem, GAL* aGal ) const
{
aGal->Save();
VECTOR2D position = aItem->GetPosition();
aGal->Translate( position );
WORKSHEET_DATAITEM_BITMAP* parent = static_cast<WORKSHEET_DATAITEM_BITMAP*>( aItem->GetParent() );
// When the image scale factor is not 1.0, we need to modify the actual scale
// as the image scale factor is similar to a local zoom
double img_scale = parent->m_ImageBitmap->GetScale();
if( img_scale != 1.0 )
aGal->Scale( VECTOR2D( img_scale, img_scale ) );
aGal->DrawBitmap( *parent->m_ImageBitmap );
aGal->Restore();
}
void WORKSHEET_VIEWITEM::drawBorder( GAL* aGal ) const
{
VECTOR2D origin = VECTOR2D( 0.0, 0.0 );

View File

@ -149,7 +149,6 @@ target_link_libraries( cvpcb_kiface
gal
${wxWidgets_LIBRARIES}
${GDI_PLUS_LIBRARIES}
${OPENMP_LIBRARIES} # used by 3d viewer
)
if( BUILD_GITHUB_PLUGIN )

View File

@ -46,6 +46,8 @@
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 22 2017)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -34,16 +34,16 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi
bSizerButtons = new wxBoxSizer( wxVERTICAL );
m_buttonAddEqu = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonAddEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerButtons->Add( m_buttonAddEqu, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_buttonRemoveEqu = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerButtons->Add( m_buttonRemoveEqu, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_buttonMoveUp = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_EQU_UP, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonMoveUp, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerButtons->Add( m_buttonMoveUp, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_buttonMoveDown = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_EQU_DOWN, _("Move Down"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonMoveDown, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerButtons->Add( m_buttonMoveDown, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_buttonEdit = new wxButton( sbEquivChoiceSizer->GetStaticBox(), wxID_ANY, _("Edit File"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonEdit, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );

View File

@ -14,6 +14,7 @@
<property name="file">dialog_config_equfiles_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_cvpcb_config_equfile_base</property>
<property name="namespace"></property>
@ -216,7 +217,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@ -304,7 +305,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@ -392,7 +393,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@ -480,7 +481,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 22 2017)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!

View File

@ -87,6 +87,10 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, CVPCB_MAINFRA
SetBoard( new BOARD() );
SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
// Don't show the default board solder mask clearance. Only the
// footprint or pad clearance setting should be shown if it is not 0.
GetBoard()->GetDesignSettings().m_SolderMaskMargin = 0;
LoadSettings( config() );
// Initialize grid id to a default value if not found in config or incorrect:
@ -430,7 +434,7 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
{
LIB_ID fpid;
if( fpid.Parse( aFootprintName ) >= 0 )
if( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) >= 0 )
{
DisplayInfoMessage( this, wxString::Format( _( "Footprint ID \"%s\" is not valid." ),
GetChars( aFootprintName ) ) );

View File

@ -99,9 +99,8 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName, int aIndex )
if( !aFootprintName.IsEmpty() )
{
wxCHECK_RET( fpid.Parse( aFootprintName ) < 0,
wxString::Format( _( "\"%s\" is not a valid LIB_ID." ),
GetChars( aFootprintName ) ) );
wxCHECK_RET( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) < 0,
wxString::Format( _( "\"%s\" is not a valid LIB_ID." ), aFootprintName ) );
}
component->SetFPID( fpid );

View File

@ -7,6 +7,15 @@ add_definitions( -DEESCHEMA )
if( KICAD_SPICE )
set( INC_AFTER ${INC_AFTER} ${NGSPICE_INCLUDE_DIR} )
# Find out the exact libngspice file name
get_filename_component( NGSPICE_DLL_REALPATH "${NGSPICE_DLL}" REALPATH )
get_filename_component( NGSPICE_DLL_FILE "${NGSPICE_DLL_REALPATH}" NAME )
set_property( SOURCE sim/ngspice.cpp
APPEND PROPERTY COMPILE_DEFINITIONS
NGSPICE_DLL_FILE="${NGSPICE_DLL_FILE}"
)
endif()
include_directories( BEFORE ${INC_BEFORE} )
@ -315,6 +324,13 @@ target_link_libraries( eeschema_kiface
${wxWidgets_LIBRARIES}
${GDI_PLUS_LIBRARIES}
)
if( KICAD_SPICE )
target_link_libraries( eeschema_kiface
${NGSPICE_LIBRARY}
)
endif()
set_target_properties( eeschema_kiface PROPERTIES
# Decorate OUTPUT_NAME with PREFIX and SUFFIX, creating something like
# _eeschema.so, _eeschema.dll, or _eeschema.kiface

View File

@ -29,6 +29,7 @@
<key>CFBundleVersion</key> <string></string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string></string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>

View File

@ -2,8 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2009-2016 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -104,10 +104,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
if( !m_canvas->IsMouseCaptured() )
{
DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
}
wxCHECK_RET( m_canvas->IsMouseCaptured(), "No block mouse capture callback is set" );
if( block->GetCount() == 0 )
{
@ -478,7 +475,12 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
destFn.MakeAbsolute( Prj().GetProjectPath() );
// Make sure any sheets in the block to be pasted will not cause recursion in
// the destination sheet.
// the destination sheet. Moreover new sheets create new sheetpaths, and component
// alternante references must be created and cleared
bool hasSheetPasted = false;
// Keep trace of existing sheet paths. Paste block can modify this list
SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
for( i = 0; i < m_blockItems.GetCount(); i++ )
{
item = (SCH_ITEM*) m_blockItems.GetItem( i );
@ -512,6 +514,7 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
sheet->SetName( wxString::Format( wxT( "sheet%8.8lX" ), (unsigned long)timeStamp ) );
sheet->SetTimeStamp( timeStamp );
hasSheetPasted = true;
}
}
@ -550,6 +553,14 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
MoveItemsInList( picklist, GetScreen()->m_BlockLocate.GetMoveVector() );
if( hasSheetPasted )
{
// We clear annotation of new sheet paths.
// Annotation of new components added in current sheet is already cleared.
SCH_SCREENS screensList( g_RootSheet );
screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
}
// Clear flags for all items.
GetScreen()->ClearDrawingState();

View File

@ -332,6 +332,23 @@ void SCH_EDIT_FRAME::EndSegment()
// Correct and remove segments that need to be merged.
SchematicCleanUp( true );
for( auto item = GetScreen()->GetDrawItems(); item; item = item->Next() )
{
if( item->Type() != SCH_COMPONENT_T )
continue;
std::vector< wxPoint > pts;
item->GetConnectionPoints( pts );
if( pts.size() > 2 )
continue;
for( auto i = pts.begin(); i != pts.end(); i++ )
for( auto j = i + 1; j != pts.end(); j++ )
TrimWire( *i, *j, true );
}
for( auto i : new_ends )
{
if( screen->IsJunctionNeeded( i, true ) )
@ -486,10 +503,8 @@ bool SCH_EDIT_FRAME::TrimWire( const wxPoint& aStart, const wxPoint& aEnd, bool
{
next_item = item->Next();
// Don't remove wires that are already deleted, are currently being
// dragged or are just created
if( item->GetFlags() &
( STRUCT_DELETED | IS_DRAGGED | IS_NEW | IS_MOVED | SKIP_STRUCT ) )
// Don't remove wires that are already deleted or are currently being dragged
if( item->GetFlags() & ( STRUCT_DELETED | IS_DRAGGED | IS_MOVED | SKIP_STRUCT ) )
continue;
if( item->Type() != SCH_LINE_T || item->GetLayer() != LAYER_WIRE )
@ -498,7 +513,16 @@ bool SCH_EDIT_FRAME::TrimWire( const wxPoint& aStart, const wxPoint& aEnd, bool
line = (SCH_LINE*) item;
if( !IsPointOnSegment( line->GetStartPoint(), line->GetEndPoint(), aStart ) ||
!IsPointOnSegment( line->GetStartPoint(), line->GetEndPoint(), aEnd ) )
{
continue;
}
// Don't remove entire wires
if( ( line->GetStartPoint() == aStart && line->GetEndPoint() == aEnd )
|| ( line->GetStartPoint() == aEnd && line->GetEndPoint() == aStart ) )
{
continue;
}
// Step 1: break the segment on one end. return_line remains line if not broken.
// Ensure that *line points to the segment containing aEnd
@ -777,6 +801,7 @@ SCH_NO_CONNECT* SCH_EDIT_FRAME::AddNoConnect( const wxPoint& aPosition )
SetRepeatItem( no_connect );
GetScreen()->Append( no_connect );
SchematicCleanUp();
GetScreen()->TestDanglingEnds();
OnModify();
m_canvas->Refresh();
SaveCopyInUndoList( no_connect, UR_NEW );

View File

@ -119,7 +119,7 @@ PART_LIB* LIB_ALIAS::GetLib()
void LIB_ALIAS::SetName( const wxString& aName )
{
name = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_ALIAS );
name = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
}
@ -287,8 +287,7 @@ void LIB_PART::SetName( const wxString& aName )
else
m_aliases[0]->SetName( aName );
// LIB_ALIAS validates the name, reuse it instead of validating the name again
wxString validatedName( m_aliases[0]->GetName() );
wxString validatedName = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
m_libId.SetLibItemName( validatedName, false );
LIB_FIELD& valueField = GetValueField();

View File

@ -718,7 +718,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
SCH_REFERENCE::SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_PART* aLibPart,
SCH_SHEET_PATH& aSheetPath )
{
wxASSERT( aComponent != NULL && aLibPart != NULL );
wxASSERT( aComponent != NULL );
m_RootCmp = aComponent;
m_Entry = aLibPart;
@ -815,47 +815,43 @@ void SCH_REFERENCE::Split()
wxString SCH_REFERENCE_LIST::Shorthand( std::vector<SCH_REFERENCE> aList )
{
wxString retVal;
std::sort( aList.begin(), aList.end(),
[]( const SCH_REFERENCE& lhs, const SCH_REFERENCE& rhs ) -> bool
{
wxString lhRef( lhs.GetRef() << lhs.GetRefNumber() );
wxString rhRef( rhs.GetRef() << rhs.GetRefNumber() );
return RefDesStringCompare( lhRef, rhRef ) < 0;
} );
size_t i = 0;
size_t i = 0;
while( i < aList.size() )
{
wxString ref = aList[ i ].GetRef();
int numRef = aList[ i ].m_NumRef;
size_t j = i;
size_t range = 1;
while( j + 1 < aList.size() && aList[ j + 1 ].GetRef() == ref )
j = j + 1;
while( i + range < aList.size()
&& aList[ i + range ].GetRef() == ref
&& aList[ i + range ].m_NumRef == numRef + range )
{
range++;
}
if( !retVal.IsEmpty() )
retVal << wxT( ", " );
if( j == i )
if( range == 1 )
{
retVal << ref << aList[ i ].GetRefNumber();
}
else if( j == i + 1 )
else if( range == 2 )
{
retVal << ref << aList[ i ].GetRefNumber();
retVal << wxT( ", " );
retVal << ref << aList[ j ].GetRefNumber();
retVal << ref << aList[ i + 1 ].GetRefNumber();
}
else
{
retVal << ref << aList[ i ].GetRefNumber();
retVal << wxT( " - " );
retVal << ref << aList[ j ].GetRefNumber();
retVal << wxT( "-" );
retVal << ref << aList[ i + ( range - 1 ) ].GetRefNumber();
}
i = j + 1;
i+= range;
}
return retVal;

View File

@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2019 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
@ -58,6 +58,7 @@
* \li \c \$PART: \c "reference" \c \$PAD: \c "pin name" Put cursor on the component pin.
* \li \c \$NET: \c "netname" Highlight a specified net
* <p>
* They are a keyword followed by a quoted string.
* @param cmdline = received command from Pcbnew
*/
void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
@ -132,24 +133,26 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
std::string FormatProbeItem( EDA_ITEM* aItem, SCH_COMPONENT* aPart )
{
// This is a keyword followed by a quoted string.
// Cross probing to Pcbnew if a pin or a component is found
switch( aItem->Type() )
{
case SCH_FIELD_T:
case LIB_FIELD_T:
if( aPart )
return StrPrintf( "$PART: %s",
return StrPrintf( "$PART: \"%s\"",
TO_UTF8( aPart->GetField( REFERENCE )->GetText() ) );
break;
case SCH_COMPONENT_T:
aPart = (SCH_COMPONENT*) aItem;
return StrPrintf( "$PART: %s", TO_UTF8( aPart->GetField( REFERENCE )->GetText() ) );
return StrPrintf( "$PART: \"%s\"", TO_UTF8( aPart->GetField( REFERENCE )->GetText() ) );
case SCH_SHEET_T:
{
SCH_SHEET* sheet = (SCH_SHEET*)aItem;
return StrPrintf( "$SHEET: %8.8lX", (unsigned long) sheet->GetTimeStamp() );
return StrPrintf( "$SHEET: \"%8.8lX\"", (unsigned long) sheet->GetTimeStamp() );
}
case LIB_PIN_T:
@ -161,12 +164,12 @@ std::string FormatProbeItem( EDA_ITEM* aItem, SCH_COMPONENT* aPart )
if( !pin->GetNumber().IsEmpty() )
{
return StrPrintf( "$PIN: %s $PART: %s", TO_UTF8( pin->GetNumber() ),
return StrPrintf( "$PIN: \"%s\" $PART: \"%s\"", TO_UTF8( pin->GetNumber() ),
TO_UTF8( aPart->GetField( REFERENCE )->GetText() ) );
}
else
{
return StrPrintf( "$PART: %s", TO_UTF8( aPart->GetField( REFERENCE )->GetText() ) );
return StrPrintf( "$PART: \"%s\"", TO_UTF8( aPart->GetField( REFERENCE )->GetText() ) );
}
}
break;
@ -205,7 +208,9 @@ void SCH_EDIT_FRAME::SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_COMPONENT
void SCH_EDIT_FRAME::SendCrossProbeNetName( const wxString& aNetName )
{
std::string packet = StrPrintf( "$NET: %s", TO_UTF8( aNetName ) );
// The command is a keyword followed by a quoted string.
std::string packet = StrPrintf( "$NET: \"%s\"", TO_UTF8( aNetName ) );
if( packet.size() )
{

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -159,7 +159,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
bButtonsSizer->Add( m_btnClose, 0, wxALL|wxEXPAND, 5 );
bSizerDldOptions->Add( bButtonsSizer, 0, wxALIGN_RIGHT, 5 );
bSizerDldOptions->Add( bButtonsSizer, 0, 0, 5 );
bupperSizer->Add( bSizerDldOptions, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );

View File

@ -1418,7 +1418,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size">160,-1</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!

View File

@ -43,8 +43,8 @@ Full documentation:</h1>
<p lang="en-US" class="western" style="margin-bottom: 0cm; widows: 0; orphans: 0">
<font face="Times New Roman, serif"><font size="3" style="font-size: 12pt"><span style="font-weight: normal">The
</span><i><b>Eeschema documentation</b></i> <span style="font-weight: normal">describes
this </span><b>intermediate netlist and gives examples<br></b><span style="font-weight: normal">See
also </span><i><b>https://answers.launchpad.net/kicad/+faq/2265</b></i></font></font></p>
this </span><b>intermediate netlist and gives examples<br></b><span style="font-weight: normal">See </span>
<i><b>http://docs.kicad-pcb.org/stable/en/eeschema.html#creating-customized-netlists-and-bom-files</b></i></font></font></p>
<h1 class="western"><i>2 - </i>The intermediate Netlist File</h1>
<p lang="en-US" class="western" style="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<font face="Times New Roman, serif"><font size="3" style="font-size: 12pt">BOM

View File

@ -301,7 +301,7 @@ void DIALOG_CHOOSE_COMPONENT::ShowFootprint( wxString const& aName )
{
LIB_ID lib_id;
if( lib_id.Parse( aName ) == -1 && lib_id.IsValid() )
if( lib_id.Parse( aName, LIB_ID::ID_PCB ) == -1 && lib_id.IsValid() )
{
m_fp_view_ctrl->ClearStatus();
m_fp_view_ctrl->CacheFootprint( lib_id );

View File

@ -258,7 +258,9 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName( wxCommandEvent& event )
wxString msg;
wxString partname = chipnameTextCtrl->GetValue();
if( id.Parse( partname ) != -1 || !id.IsValid() )
id.Parse( partname, LIB_ID::ID_SCH );
if( !id.IsValid() )
{
msg.Printf( _( "\"%s\" is not a valid library symbol identifier." ), partname );
DisplayError( this, msg );
@ -363,7 +365,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
tmp.Replace( wxT( " " ), wxT( "_" ) );
id.Parse( tmp );
id.Parse( tmp, LIB_ID::ID_SCH );
// Save current flags which could be modified by next change settings
STATUS_FLAGS flags = m_cmp->GetFlags();

View File

@ -358,7 +358,7 @@ bool DIALOG_EDIT_COMPONENTS_LIBID::validateLibIds()
// a new lib id is found. validate this new value
LIB_ID id;
id.Parse( new_libid );
id.Parse( new_libid, LIB_ID::ID_SCH );
if( !id.IsValid() )
{
@ -430,7 +430,8 @@ void DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton( wxCommandEvent& event )
wxString orphanLibid = m_grid->GetCellValue( m_OrphansRowIndexes[ii], COL_CURR_LIBID );
int grid_row_idx = m_OrphansRowIndexes[ii]; //row index in m_grid for the current item
LIB_ID curr_libid( orphanLibid );
LIB_ID curr_libid;
curr_libid.Parse( orphanLibid, LIB_ID::ID_SCH, true );
wxString symbName = curr_libid.GetLibItemName();
// number of full LIB_ID candidates (because we search for a symbol name
// inside all avaiable libraries, perhaps the same symbol name can be found
@ -438,7 +439,7 @@ void DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton( wxCommandEvent& event )
int libIdCandidateCount = 0;
candidateSymbNames.Clear();
// now try to fin a candidate
// now try to find a candidate
for( auto &lib : libs )
{
aliasNames.Clear();
@ -555,7 +556,7 @@ bool DIALOG_EDIT_COMPONENTS_LIBID::TransferDataFromWindow()
// a new lib id is found and was already validated.
// set this new value
LIB_ID id;
id.Parse( new_libid );
id.Parse( new_libid, LIB_ID::ID_SCH, true );
for( CMP_CANDIDATE& cmp : m_components )
{
@ -592,7 +593,7 @@ void DIALOG_EDIT_COMPONENTS_LIBID::revertChanges()
continue;
LIB_ID id;
id.Parse( cmp.m_InitialLibId );
id.Parse( cmp.m_InitialLibId, LIB_ID::ID_SCH, true );
if( cmp.m_Component->GetLibId() != id )
{

View File

@ -174,13 +174,14 @@ void DIALOG_LABEL_EDITOR::InitDialog()
{
m_textLabel = m_textLabelMultiLine;
m_textLabelSingleLine->Show( false );
m_textControlSizer->AddGrowableRow( 0 );
m_staticTextLabel->Show( false );
multiLine = true;
}
else
{
m_textLabel = m_textLabelSingleLine;
m_textLabelMultiLine->Show( false );
m_staticTextText->Show( false );
wxTextValidator* validator = (wxTextValidator*) m_textLabel->GetValidator();
// Add invalid label characters to this list.

View File

@ -16,32 +16,33 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_textControlSizer = new wxFlexGridSizer( 2, 2, 3, 3 );
m_textControlSizer = new wxFlexGridSizer( 3, 2, 3, 3 );
m_textControlSizer->AddGrowableCol( 1 );
m_textControlSizer->AddGrowableRow( 1 );
m_textControlSizer->SetFlexibleDirection( wxBOTH );
m_textControlSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("&Text:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
m_staticText1->SetToolTip( _("Enter the text to be used within the schematic") );
m_staticTextLabel = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextLabel->Wrap( -1 );
m_staticTextLabel->SetToolTip( _("Enter the text to be used within the schematic") );
m_textControlSizer->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 );
wxBoxSizer* bSizeText;
bSizeText = new wxBoxSizer( wxVERTICAL );
m_textControlSizer->Add( m_staticTextLabel, 0, wxRIGHT, 3 );
m_textLabelSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RICH );
m_textLabelSingleLine->SetValidator( wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, &m_labelText ) );
bSizeText->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 );
m_textControlSizer->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 );
m_staticTextText = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextText->Wrap( -1 );
m_staticTextText->SetToolTip( _("Enter the text to be used within the schematic") );
m_textControlSizer->Add( m_staticTextText, 0, wxRIGHT, 5 );
m_textLabelMultiLine = new wxTextCtrl( this, wxID_VALUEMULTI, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_textLabelMultiLine->SetMinSize( wxSize( -1,60 ) );
bSizeText->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 );
m_textControlSizer->Add( bSizeText, 1, wxEXPAND, 3 );
m_textControlSizer->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 );
m_SizeTitle = new wxStaticText( this, wxID_ANY, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_SizeTitle->Wrap( -1 );
@ -51,7 +52,7 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID
bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
m_TextSize = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizeCtrlSizer->Add( m_TextSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 3 );
bSizeCtrlSizer->Add( m_TextSize, 0, wxLEFT|wxRIGHT|wxEXPAND, 3 );
m_staticSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticSizeUnits->Wrap( -1 );

View File

@ -102,17 +102,17 @@
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
<property name="growablerows"></property>
<property name="growablerows">1</property>
<property name="hgap">3</property>
<property name="minimum_size"></property>
<property name="name">m_textControlSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">protected</property>
<property name="rows">2</property>
<property name="rows">3</property>
<property name="vgap">3</property>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="flag">wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -142,7 +142,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Text:</property>
<property name="label">Text:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -150,7 +150,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText1</property>
<property name="name">m_staticTextLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -195,195 +195,267 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_VALUESINGLE</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_textLabelSingleLine</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxTE_PROCESS_ENTER|wxTE_RICH</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type">wxString</property>
<property name="validator_style">wxFILTER_EXCLUDE_CHAR_LIST</property>
<property name="validator_type">wxTextValidator</property>
<property name="validator_variable">m_labelText</property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter">OnEnterKey</event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Text:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextText</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Enter the text to be used within the schematic</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size">-1,-1</property>
<property name="name">bSizeText</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_VALUESINGLE</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_textLabelSingleLine</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxTE_PROCESS_ENTER|wxTE_RICH</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type">wxString</property>
<property name="validator_style">wxFILTER_EXCLUDE_CHAR_LIST</property>
<property name="validator_type">wxTextValidator</property>
<property name="validator_variable">m_labelText</property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter">OnEnterKey</event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_VALUEMULTI</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,60</property>
<property name="moveable">1</property>
<property name="name">m_textLabelMultiLine</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxTE_MULTILINE</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_VALUEMULTI</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,60</property>
<property name="moveable">1</property>
<property name="name">m_textLabelMultiLine</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxTE_MULTILINE</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
@ -480,7 +552,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="flag">wxLEFT|wxRIGHT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>

View File

@ -43,8 +43,9 @@ class DIALOG_LABEL_EDITOR_BASE : public DIALOG_SHIM
};
wxFlexGridSizer* m_textControlSizer;
wxStaticText* m_staticText1;
wxStaticText* m_staticTextLabel;
wxTextCtrl* m_textLabelSingleLine;
wxStaticText* m_staticTextText;
wxTextCtrl* m_textLabelMultiLine;
wxStaticText* m_SizeTitle;
wxTextCtrl* m_TextSize;

View File

@ -203,16 +203,26 @@ public:
if( aCol == REFERENCE || aCol == QUANTITY_COLUMN )
{
// Remove duplicates (other units of multi-unit parts)
auto logicalEnd = std::unique( references.begin(), references.end(),
[]( const SCH_REFERENCE& l, const SCH_REFERENCE& r )
{
// If unannotated then we can't tell what units belong together
// so we have to leave them all
if( l.GetRefNumber() == wxT( "?" ) )
return false;
std::sort( references.begin(), references.end(),
[]( const SCH_REFERENCE& l, const SCH_REFERENCE& r ) -> bool
{
wxString l_ref( l.GetRef() << l.GetRefNumber() );
wxString r_ref( r.GetRef() << r.GetRefNumber() );
return RefDesStringCompare( l_ref, r_ref ) < 0;
} );
return( l.GetRef() == r.GetRef() && l.GetRefNumber() == r.GetRefNumber() );
} );
auto logicalEnd = std::unique( references.begin(), references.end(),
[]( const SCH_REFERENCE& l, const SCH_REFERENCE& r ) -> bool
{
// If unannotated then we can't tell what units belong together
// so we have to leave them all
if( l.GetRefNumber() == wxT( "?" ) )
return false;
wxString l_ref( l.GetRef() << l.GetRefNumber() );
wxString r_ref( r.GetRef() << r.GetRefNumber() );
return l_ref == r_ref;
} );
references.erase( logicalEnd, references.end() );
}
@ -699,8 +709,10 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::LoadFieldNames()
for( auto fieldName : userFieldNames )
AddField( fieldName, true, false );
// Add any templateFieldNames which aren't already present in the userFieldNames
for( auto templateFieldName : m_parent->GetTemplateFieldNames() )
AddField( templateFieldName.m_Name, false, false );
if( userFieldNames.count( templateFieldName.m_Name ) == 0 )
AddField( templateFieldName.m_Name, false, false );
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Jul 11 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -81,10 +81,10 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
sbSizerPinSharing = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Sharing:") ), wxVERTICAL );
m_checkApplyToAllParts = new wxCheckBox( sbSizerPinSharing->GetStaticBox(), wxID_ANY, _("Common to all &units in symbol"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerPinSharing->Add( m_checkApplyToAllParts, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
sbSizerPinSharing->Add( m_checkApplyToAllParts, 0, wxALL, 3 );
m_checkApplyToAllConversions = new wxCheckBox( sbSizerPinSharing->GetStaticBox(), wxID_ANY, _("Common to all body &styles (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerPinSharing->Add( m_checkApplyToAllConversions, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
sbSizerPinSharing->Add( m_checkApplyToAllConversions, 0, wxALL, 3 );
boarderSizer->Add( sbSizerPinSharing, 0, wxEXPAND|wxALL, 5 );
@ -172,7 +172,7 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
bRightSizer->Add( fgSizerTextsSizes, 0, wxALL|wxEXPAND, 5 );
m_panelShowPin = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
m_panelShowPin = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL|wxBORDER_SUNKEN );
m_panelShowPin->SetMinSize( wxSize( 150,150 ) );
bRightSizer->Add( m_panelShowPin, 1, wxEXPAND | wxALL, 5 );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<FileVersion major="1" minor="14" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -55,13 +55,20 @@
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneActivated"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnClose">OnCloseDialog</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -76,17 +83,23 @@
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMaximize"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnMove"></event>
<event name="OnMoveEnd"></event>
<event name="OnMoveStart"></event>
<event name="OnMoving"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnShow"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
@ -161,6 +174,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Pin &amp;name:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -186,7 +200,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -273,7 +294,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -335,6 +363,7 @@
<property name="hidden">0</property>
<property name="id">ID_M_STATICTEXTPADNAME</property>
<property name="label">Pin n&amp;umber:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -360,7 +389,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -447,7 +483,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -509,6 +552,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Orientation:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -534,7 +578,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -622,7 +673,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCombobox">OnPropertiesChange</event>
<event name="OnComboboxCloseup"></event>
<event name="OnComboboxDropdown"></event>
@ -685,6 +743,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Electrical type:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -710,7 +769,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -798,7 +864,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCombobox">OnPropertiesChange</event>
<event name="OnComboboxCloseup"></event>
<event name="OnComboboxDropdown"></event>
@ -861,6 +934,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Graphic &amp;Style:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -886,7 +960,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -974,7 +1055,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCombobox">OnPropertiesChange</event>
<event name="OnComboboxCloseup"></event>
<event name="OnComboboxDropdown"></event>
@ -1030,7 +1118,7 @@
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@ -1090,7 +1178,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox">OnPropertiesChange</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -1118,7 +1213,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@ -1178,7 +1273,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox">OnPropertiesChange</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -1281,7 +1383,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox">OnPropertiesChange</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -1371,6 +1480,7 @@
<property name="hidden">0</property>
<property name="id">ID_M_STATICTEXTNAMESIZE</property>
<property name="label">N&amp;ame text size:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1396,7 +1506,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1483,7 +1600,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1545,6 +1669,7 @@
<property name="hidden">0</property>
<property name="id">ID_M_STATICNAMETEXTSIZEUNITS</property>
<property name="label">units</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1570,7 +1695,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1628,6 +1760,7 @@
<property name="hidden">0</property>
<property name="id">ID_M_STATICTEXTPADNAMESIZE</property>
<property name="label">Number te&amp;xt size:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1653,7 +1786,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1740,7 +1880,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1802,6 +1949,7 @@
<property name="hidden">0</property>
<property name="id">ID_M_STATICNUMBERTEXTSIZEUNITS</property>
<property name="label">units</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1827,7 +1975,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1885,6 +2040,7 @@
<property name="hidden">0</property>
<property name="id">ID_M_STATICTEXTPINLEN</property>
<property name="label">&amp;Length:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1910,7 +2066,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -1997,7 +2160,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2059,6 +2229,7 @@
<property name="hidden">0</property>
<property name="id">ID_M_STATICLENGTHUNITS</property>
<property name="label">units</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2084,7 +2255,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2142,6 +2320,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Pin Pos X:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2167,7 +2346,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2254,7 +2440,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2316,6 +2509,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">units</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2341,7 +2535,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2399,6 +2600,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Pin Pos Y:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2424,7 +2626,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2511,7 +2720,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2573,6 +2789,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">units</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2598,7 +2815,14 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2679,8 +2903,15 @@
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property>
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL|wxBORDER_SUNKEN</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -2765,7 +2996,14 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Jul 11 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Jun 5 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -84,7 +84,7 @@ DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindow
sOptionsSizer->Add( m_CommonUnit, 0, wxALL, 5 );
m_CommonConvert = new wxCheckBox( sOptionsSizer->GetStaticBox(), wxID_ANY, _("Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_CommonConvert, 0, wxALIGN_RIGHT|wxBOTTOM|wxEXPAND|wxLEFT, 5 );
sOptionsSizer->Add( m_CommonConvert, 0, wxBOTTOM|wxLEFT, 5 );
m_Invisible = new wxCheckBox( sOptionsSizer->GetStaticBox(), wxID_ANY, _("Invisible"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_Invisible, 0, wxALIGN_LEFT|wxBOTTOM|wxLEFT, 5 );
@ -123,7 +123,7 @@ DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindow
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
m_sdbSizerButtons->Realize();
bMainSizer->Add( m_sdbSizerButtons, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
bMainSizer->Add( m_sdbSizerButtons, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_RIGHT, 5 );
this->SetSizer( bMainSizer );

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