Compare commits

...

77 Commits

Author SHA1 Message Date
jean-pierre charras 2758acfd42 Fix compatibility with some old V4 schematic files.
From master branch, commit #bfe59581
2021-12-01 13:45:05 +01:00
jean-pierre charras 54c3031d74 Zone fill: When using the fillet outline option, in some cases the shape is strange.
Due to some bug in Fillet() incorrect zone outline happens in (rare) polygon shapes.
So clip it with the initial polygon (aSmoothedPoly must be contained in m_Poly)
Fixes #9692
https://gitlab.com/kicad/code/kicad/issues/9692
2021-11-19 13:55:05 +01:00
Christoph Moench-Tegeder 9a9c7856b3 Adapt OCE 3D plugin to OpenCascade 7.6.0 (for KiCad 5.1)
In line with
https://dev.opencascade.org/doc/overview/html/occt__upgrade.html#upgrade_occt760_poly
the Poly_Triangulation does not provide direct access to the internal
arrays anymore - use the accessor functions instead.
To keep changes minimal, switch only builds with a new (7.6+)
OpenCascade to the new API and keep everything else the same.

Related: !1013
2021-11-17 23:41:56 +01:00
Wayne Stambaugh 401b2fb524 Fix broken search stack behavior.
The overload of wxFilePath::FindValidPath() broke the normal behavior
when the file searched for existed in the current working directory.
This was causing the initial library table file to be copied from the
current working directory instead of from the list of search paths.

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

(cherry picked from commit f4b97eca63)
2021-11-13 08:43:25 -05:00
Wayne Stambaugh 0a0a2da680 Begin version 5.1.13 development. 2021-11-04 17:24:40 -04:00
Wayne Stambaugh e4df76d986 Tag release version 5.1.12. 2021-11-04 16:41:52 -04:00
jean-pierre charras 79028f1627 Handle mandatory fields name translated and not translated in SCH_COMPONENT::GetFieldText.
Fixes #9520
https://gitlab.com/kicad/code/kicad/issues/9520
2021-11-04 18:17:51 +01:00
jean-pierre charras d87e5cb809 Revert "Revert "Apply WX_LOCALE change from master branch.""
This reverts commit 3484334d15.
2021-11-04 16:47:10 +01:00
Seth Hillbrand 3484334d15 Revert "Apply WX_LOCALE change from master branch."
This reverts commit 8e9e1a618b.
2021-11-03 15:12:37 -07:00
Wayne Stambaugh 9ab6571b3f Begin version 5.1.12 development. 2021-10-27 21:33:13 -04:00
Wayne Stambaugh dad5600e7e Tag release version 5.1.11. 2021-10-27 13:53:49 -04:00
Seth Hillbrand ee56d58173 Don't raise an error for valid microvias
When the layers are adjacent, the microvia is _probably_ valid.  This is
not the case when trying to run a microvia through the core material but
without stackup information, we cannot be certain.

Note that microvias are not required in current manufacturing techniques
to be blind.

KSC Issue '400'
2021-10-27 10:52:25 -07:00
Wayne Stambaugh 9f8f2a2449 Revert "Tag release version 5.1.11."
This reverts commit f591534a0f.
2021-10-27 13:50:01 -04:00
Wayne Stambaugh f591534a0f Tag release version 5.1.11. 2021-10-26 14:51:40 -04:00
Wayne Stambaugh 7a2e0c6632 Remove old domain name from developer documentation. 2021-10-26 14:49:50 -04:00
Wayne Stambaugh 29519c5fda Revert "Tag release version 5.1.11."
This reverts commit 4c58397949.
2021-10-26 14:45:17 -04:00
Wayne Stambaugh 4b996f6bbe Revert "Begin version 5.1.12 development."
This reverts commit e4a5bfc788.
2021-10-26 14:44:41 -04:00
Wayne Stambaugh e4a5bfc788 Begin version 5.1.12 development. 2021-10-26 07:55:07 -04:00
Wayne Stambaugh 4c58397949 Tag release version 5.1.11. 2021-10-26 07:23:58 -04:00
Mark Roszko 011b4027db Add vertexIndex bounds check 2021-10-23 15:46:58 +00:00
Seth Hillbrand a1adc59cb8 Remove all references to old website
The kicad-pcb.org website is no longer valid
2021-10-18 15:47:01 -07:00
Johannes Maibaum ee4a8fc05a kicad-pcb.org->kicad.org in kicad.appdata.xml.in
kicad-pcb.org seems to cause TLS handshake errors recently.
As kicad.org is now the official domain, switch all uses of
kicad-pcb.org to kicad.org in kicad.appdata.xml.in.
2021-10-18 22:19:34 +02:00
Adam Wolf 420a3ce498 On macOS, copy libngspice dylibs and symlinks
Now that ngspice creates soversion'ed libraries, we need to tweak
how we copy the dylibs around.

This is meant to address
https://gitlab.com/kicad/code/kicad/-/issues/9143.

(cherry picked from commit ec10b12c6a)
2021-10-15 10:40:13 -07:00
Wayne Stambaugh 9b6798c479 Eeschema: yet another attempt to fix network share editing performance.
Root out a few other areas where the hierarchy integrity test was being
performed while editing where it wasn't required.
2021-10-07 07:22:50 -04:00
Wayne Stambaugh 765816ccb1 Eeschema: fix lag on network shares when duplicating and copying objects.
The delay was due to recursion checks being performed every time a new
SCH_SHEET_LIST object was created.  The fix was to back port the optional
integrity check flag added from master.  It's similar to commit 63a0f537
by Jeff Young but it could not be cherry-picked due to the changes in
master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9278
2021-10-04 16:34:30 -04:00
Seth Hillbrand f3e9e3497b Cherry-picking some external run routines
Mostly from c6bcb85562 but trees have
diverged sufficiently that there are others mixed in.  This removes the
system() call on MacOS when opening a directory
2021-09-29 11:32:25 -07:00
jean-pierre charras 8e9e1a618b Apply WX_LOCALE change from master branch.
See master branch, commits 0cf81b6 and b065ff3
2021-09-29 16:54:07 +02:00
jean-pierre charras 7272020cd3 fix use of a non const method in a const method ( from master branch) 2021-09-14 14:33:40 +02:00
jean-pierre charras 16fff71c31 Gerbview: fix incorrect bounding box of lines drawn with a rectangular aperture.
See master, commit 5abe25
2021-09-14 10:50:51 +02:00
jean-pierre charras 190223949c Gerber files: fix incorrect FileFunction attribute value for F.Fab and B.Fab layers. 2021-09-01 11:17:05 +02:00
jean-pierre charras 38d463ae49 Apply commit ddba9e2 from master: fix of not updating spice primitive field 2021-08-31 11:07:37 +02:00
jean-pierre charras 73193196d2 Cvpcb: fix possible crash when pressing the ESC key during some calculations.
From master branch, commit b1c67d9
2021-08-28 15:58:04 +02:00
Jeff Young 2975e85950 Add (a somewhat hacked) future format error for page layout files. 2021-08-27 13:16:22 +01:00
Seth Hillbrand b2fbf982a8 Don't use REALPATH to find shared/dynamic libraries
We require API compatibility in the ngspice library because we
dynamically load the library and assign function pointers to specific
names/signatures.  This should be consistent for all versions of the the
library until the soversion changes.

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

(cherry picked from commit 17a17586a6)
2021-08-24 11:46:03 -07:00
Jeff Young 0843fbf904 Fix nullptr dereference.
Fixes: lp:8996
* https://bugs.launchpad.net/kicad/+bug/8996
2021-08-19 11:59:07 +01:00
jean-pierre charras 8dab9041e4 Gerbview, Excellon reader: use Leading Zeros format when not specified in file.
Some very poor files do not specify the coordinates format.
In this case, the default is INCH,LZ that looks like the more usual.
From master branch, commit b1fd462
2021-08-01 16:08:28 +02:00
jean-pierre charras 6aed98f795 Gerbview, Excellon reader: fix incorrect size of tools when the size is embedded.
From master branch, commit 70b5e26.
2021-08-01 10:26:23 +02:00
jean-pierre charras c20a76f3e2 Fix Python consoles cannot be created.
Fixes #8899
https://gitlab.com/kicad/code/kicad/issues/8899
2021-07-31 16:46:27 +02:00
Seth Hillbrand 435b1720c3 Prevent help() from blocking terminal
Ensures that the pydoc pager gets re-directed to the PyShell.  Also
keeps a copy of stdin to prevent closure in case of re-assignment

Fixes https://gitlab.com/kicad/code/kicad/issues/8047
2021-07-12 16:52:52 -07:00
Wayne Stambaugh 22bdf37fc2 Fix SPICE simulator plot bug.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1944
2021-07-09 16:44:23 -04:00
Ian McInerney 9e3ac0eafb Don't install the import library for the 3dsg library
No one on Windows should be linking to it outside of
the build process, so there is no need for it in the
installer

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


(cherry picked from commit 3bb44f3804)
2021-07-01 19:31:46 +00:00
Wayne Stambaugh 5c1c24cdab Pcbnew: fix footprint selection bug.
Do not remove footprint objects from list of selected objects when there
are no drawable objects other than the reference and value text.

Increase the minimum size rectangle for footprints from 0.025mm to 1mm
when the footprint has no drawing objects so that it is easier to select
the footprint in this case.

Add debugging code to show the footprint bounding box and polygon outline
so that it's possible to tell the difference between selection areas.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8379
2021-06-24 14:13:30 -04:00
jean-pierre charras c9cc824761 Footprint editor: fix broken mirroring of custom pad shapes.
Fixes #8649
https://gitlab.com/kicad/code/kicad/issues/8649
2021-06-23 16:31:18 +02:00
Eeli Kaikkonen b3c1e0330a OCC is the default cmake flag instead of OCE.
(cherry picked from commit 168a21bb43)
2021-06-16 12:47:58 -04:00
jean-pierre charras 4506fb2022 Fix not initialized var (m_HoleToHoleMin) in DRC when starting Pcbnew in stand-alone. 2021-06-16 11:44:02 +02:00
jean-pierre charras ecec324121 Fix a link issue created by fix 959b33c, on Linux.
Fixes #8475
2021-05-25 08:59:44 +02:00
jean-pierre charras 959b33c59b Footprint editor: fix incorrect "Zoom to Fit" when the F.Cu layer is not shown.
Fixes #8420
2021-05-14 15:30:38 +02:00
Wayne Stambaugh d6646c34ef Eeschema: fix BOM path bug in stand alone mode.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8180
2021-05-07 15:44:21 -04:00
Wayne Stambaugh b56ac54cb2 KiCad: don't rename page description file on new project from template.
Doing so will break the link in the schematic and/or board file so copy
page description file(s) verbatim to the new project folder.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6524
2021-05-05 07:39:22 -04:00
Mark Roszko 5bc47a0c3b Write xml netlists explicitly via wxFFileOutputStream for performance
Fix #6944
2021-05-03 23:13:38 +00:00
Wayne Stambaugh f2db83008a Begin version 5.1.11 development. 2021-04-23 13:47:08 -04:00
Wayne Stambaugh 9a01cf1b35 Tag release version 5.1.10. 2021-04-23 13:42:36 -04:00
Seth Hillbrand 0f6f30b26e Ensure collapsed tree before update
We had been maintaining the tree collapse state for "clear" actions
where the user went back to no object search.  This was helpful in the
case where we had previous items (e.g. last placed element)

But this causes isses when a sub element was previously select on GTK.
Now we choose safety for GTK over the pretty display

Fixes https://gitlab.com/kicad/code/kicad/issues/8198
2021-04-20 11:50:08 -07:00
Marek Roszko 8219334806 Fix wrong offset in msys2 x64 libcontext implementation not saving fiber data pointer
This should have/may have been causing random crashes on calls into win32 api.
fiber data is located at offset 0x20 of the stack not 0x18.
2021-04-12 19:11:44 -04:00
Wayne Stambaugh e6997d87b3 Eeschema: fix zero length line segfault.
Clear the current draw item when line segment clean up results in no lines.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8175
2021-04-12 14:41:52 -04:00
jean-pierre charras 13b453c21e PDT plotter: fix incorrect header (from Master branch) 2021-04-06 11:34:52 +02:00
Seth Hillbrand 4ec3f18fda Return wxString for gfx importer messages
Returning a reference to a temporary value crashes when the value is
deallocated before use.  Passing a full string fixes the crash and
allows NVRO on the temporary value.
2021-04-04 06:20:14 -07:00
Jon Evans fc8ffd8421 Disable Cairo canvas for Mac
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7052
2021-04-02 18:50:21 -04:00
Seth Hillbrand 4551651777 Fix empty translated string 2021-04-02 11:12:39 -07:00
Marek Roszko 82f2e8c344 More gracefully handle tinyspline not liking a spline definition
Partial fix for #6634

(cherry picked from commit e409b04538)
2021-04-02 09:41:22 -07:00
jean-pierre charras b76c5c9433 Drill map report: use more digits in float values for diameters. 2021-03-29 11:21:24 +02:00
Jon Evans 1737927814 Fix cherry-pick error 2021-02-17 08:12:05 -05:00
Graham Keeth 38d7ac6d9c Add BOM file extension to BOM plugin command line
Attempt to parse BOM output file extension from BOM plugin header, and
append it to the "%O" argument in the BOM plugin command line.

Fixes #6943

(cherry picked from commit f54ab830f6)
2021-02-11 21:19:31 -05:00
Seth Hillbrand db1bf4351b Fix GTK crash when multiple libraries are expanded
Once more into the gtk_tree_view breach.

This may also be related to https://gitlab.com/kicad/code/kicad/-/issues/7344

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

(cherry picked from commit 4657ca5d4f)
2021-02-08 14:36:08 -08:00
Seth Hillbrand 2d491f9cbd Update multi-unit symbols uniquely
This updates multi unit symbols uniquely even when the schematic is
unannotated (and therefore there are multiple symbols with the same
reference).  We attempt to enfore a single unit update per symbol and
test for both value and reference commonality before assuming that the
unit is part of the larger multi-unit symbol

Fixes https://gitlab.com/kicad/code/kicad/issues/7117
2021-01-14 14:52:55 -08:00
Johannes Maibaum a58d0f8a67 Add diode model to rectifier demo (ngspice-32 fix)
Patch by Holger Vogt

Fixes https://gitlab.com/kicad/code/kicad/issues/4453
2021-01-14 20:24:36 +01:00
Johannes Maibaum 42cd6ca4ca Fix screenshot sizes in kicad.appdata.xml.in 2021-01-13 18:14:33 +01:00
jean-pierre charras f292f1628b Spice sim: fix incorrect (very large) dialog size displaying the netlist.
It was previously fixed to 1500x900 pixels, that can be too large.
The window size and position is also now retained during a session.
From master branch, commit 60152bc
2021-01-11 10:55:51 +01:00
Seth Hillbrand 20909d4948 Fix crash when deleting symbol in GTK
So many things can go wrong with this control in GTK.  We have to
collapse the tree when updating the search string to avoid a crash when
referencing a child object but collapsing the tree will iterate over
elements and crash when we have deleted a symbol.

The temporary fix for this nonsense is to carefully order the calls.
We only need to collapse the search tree if we are not keeping our state
(in other words if we are fully re-building the tree)

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

(cherry picked from commit 8af4cf88a0)
2021-01-04 09:38:51 -08:00
Jeff Young 1f6ff4a519 Fix access into empty container.
Fixes https://gitlab.com/kicad/code/kicad/issues/6840

(cherry picked from commit 359c29639f)
2021-01-04 09:26:01 -08:00
jean-pierre charras 07568f87c3 Step exporter: better values for min distance between 2 points to merge them.
- The default value is 0.01 mm (according to comments and similar to the 3D viewer
 settings that uses 0.02 mm)
- The export dialog  has now 3 values 1 micron, 0.01mm (default) and 0.1 mm

From Master branch, commits a9feb1c and 5db7580
2021-01-03 14:52:42 +01:00
Mikołaj Wielgus 267e510071 Update PCBMODEL::SetMinDistance to set BRepBuilderAPI precision
Fixes #3818
2021-01-03 13:39:38 +01:00
Marek Roszko 73b921d591 Correct assembly opcode 2021-01-02 16:20:50 -05:00
Marek Roszko 8677035989 libcontext: Call exit instead of random memory address on MSW x86_64
cherrypick of 580293c7fa

See #6820
2021-01-02 16:18:10 -05:00
jean-pierre charras a179893d70 specctra_export: fix an issue with custom pads.
From Master, commit 686254.
In some cases a created pad stack name had the same name as an other pad stack
having a slightly different shape, thus creating pads with a incorrect shape on board.

Fixes #6495 for the 5.1.10 branch.
2020-12-29 17:41:36 +01:00
Jan Mrázek 540fb91d34 Backport 93466fa1: Fix crash when adding 3D Models via Python 2020-12-28 23:22:16 +01:00
Wayne Stambaugh 591a07d2d9 Begin version 5.1.10 development. 2020-12-22 15:09:32 -05:00
117 changed files with 1012 additions and 513 deletions
+19 -1
View File
@@ -1,5 +1,6 @@
boost_root
.downloads-by-cmake
.gdb_history
boost_root
Build*
build*
common/fp_lib_table_keywords.cpp
@@ -95,3 +96,20 @@ pcbnew/Info.plist
.cproject
.pydevproject
__pycache__
# Visual Studio
.vs/
.editorconfig
CMakeSettings.json
# Sublime Text
*.sublime-*
# KDevelop
.kdev4/
*.kdev4
# Translations
*.mo
i18n_status.svg
i18n_status.csv
+5 -1
View File
@@ -95,8 +95,12 @@ target_compile_definitions( kicad_3dsg PRIVATE -DCOMPILE_SGLIB )
target_link_libraries( kicad_3dsg ${wxWidgets_LIBRARIES} )
# Don't specify the ARCHIVE DESTINATION parameter to prevent
# the install of the import library on Windows
# https://cmake.org/pipermail/cmake/2011-November/047746.html
install( TARGETS
kicad_3dsg
DESTINATION ${KICAD_LIB}
RUNTIME DESTINATION ${KICAD_LIB}
LIBRARY DESTINATION ${KICAD_LIB}
COMPONENT binary
)
@@ -449,6 +449,10 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
++ii )
{
PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
const CBVHCONTAINER2D *container2d = static_cast<const CBVHCONTAINER2D *>(ii->second);
if( !container2d )
continue;
// Mask kayers are not processed here because they are a special case
if( (layer_id == B_Mask) || (layer_id == F_Mask) )
@@ -509,7 +513,6 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
break;
}
const CBVHCONTAINER2D *container2d = static_cast<const CBVHCONTAINER2D *>(ii->second);
const LIST_OBJECT2D &listObject2d = container2d->GetList();
for( LIST_OBJECT2D::const_iterator itemOnLayer = listObject2d.begin();
@@ -655,6 +658,9 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
const CBVHCONTAINER2D *containerLayer2d =
static_cast<const CBVHCONTAINER2D *>(ii->second);
if( !containerLayer2d )
continue;
// Only get the Solder mask layers
if( !((layer_id == B_Mask) || (layer_id == F_Mask)) )
continue;
+4 -4
View File
@@ -84,12 +84,12 @@ option( KICAD_SCRIPTING_ACTION_MENU
ON )
option( KICAD_USE_OCE
"Build tools and plugins related to OpenCascade Community Edition (default ON)"
ON )
"Build tools and plugins related to OpenCascade Community Edition (default OFF)"
OFF )
option( KICAD_USE_OCC
"Build tools and plugins related to OpenCascade Technology (overrides KICAD_USE_OCE, default OFF)"
OFF )
"Build tools and plugins related to OpenCascade Technology (overrides KICAD_USE_OCE, default ON)"
ON )
option( KICAD_INSTALL_DEMOS
"Install KiCad demos and examples (default ON)"
+8 -3
View File
@@ -51,7 +51,6 @@ if( PKG_CONFIG_FOUND )
endif()
endif()
find_path( NGSPICE_INCLUDE_DIR ngspice/sharedspice.h
PATHS
${NGSPICE_ROOT_DIR}
@@ -65,7 +64,13 @@ find_path( NGSPICE_INCLUDE_DIR ngspice/sharedspice.h
share/ngspice/include/ngspice
)
find_library( NGSPICE_LIBRARY ngspice
if( UNIX )
set( NGSPICE_LIB_NAME libngspice.so.0 CACHE STRING "Optionally versioned name of the shared library" )
else()
set( NGSPICE_LIB_NAME ngspice CACHE STRING "Optionally versioned name of the shared library" )
endif()
find_library( NGSPICE_LIBRARY ${NGSPICE_LIB_NAME}
PATHS
${NGSPICE_ROOT_DIR}
$ENV{NGSPICE_ROOT_DIR}
@@ -147,5 +152,5 @@ mark_as_advanced(
NGSPICE_LIBRARY
NGSPICE_DLL
NGSPICE_BUILD_VERSION
NGSPIC_HAVE_CONFIG_H
NGSPICE_HAVE_CONFIG_H
)
+2 -2
View File
@@ -2,7 +2,7 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2016 Wayne Stambaugh <stambaughw@gmail.com>
# Copyright (C) 2016 - 2020 KiCad Developers, see AUTHORS.txt for contributors.
# Copyright (C) 2016 - 2021 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
@@ -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.1.9" )
set( KICAD_VERSION "5.1.12-unknown" )
+2 -2
View File
@@ -471,8 +471,8 @@ to download and [build Boost][] from source. If you are building Boost on windo
you will have to apply the Boost patches in the KiCad source [patches folder][].
[download]: http://kicad-pcb.org/download/
[KiCad website]: http://kicad-pcb.org/
[download]: http://kicad.org/download/
[KiCad website]: http://kicad.org/
[KiCad Launchpad]: https://launchpad.net/kicad
[GNU GCC]: https://gcc.gnu.org/
[Clang]: http://clang.llvm.org/
+2 -2
View File
@@ -19,11 +19,11 @@ interpreter installed on the system.
The Pcbnew Python API can be used stand-alone, i.e. no instance of Pcbnew is
running and the board project to be manipulated is loaded and saved from and to
file. This approach is shown with some examples in the [user's
documentation](http://docs.kicad-pcb.org/stable/en/pcbnew.html#_kicad_scripting_reference).
documentation](http://docs.kicad.org/stable/en/pcbnew.html#_kicad_scripting_reference).
Another documentation source is the auto-generated Doxygen reference of the
API. It can be found
[here](http://docs.kicad-pcb.org/doxygen-python/namespacepcbnew.html).
[here](http://docs.kicad.org/doxygen-python/namespacepcbnew.html).
# `Action Plugin` Support # {#ppi_action_pi}
Besides the stand-alone usage of the generated Python plugin interface,
+2 -2
View File
@@ -101,5 +101,5 @@ capabilities.
- In progress.
[kicad-website]:http://kicad-pcb.org/
[kicad-docs]:http://ci.kicad-pcb.org/job/kicad-doxygen/ws/Documentation/doxygen/html/index.html
[kicad-website]:http://kicad.org/
[kicad-docs]:http://ci.kicad.org/job/kicad-doxygen/ws/Documentation/doxygen/html/index.html
@@ -71,7 +71,7 @@ GitHub plugin.
To provide a convenient method for system packagers to build KiCad from known stable sources,
source archives in the most common formats along with the resulting md5sum checksum will be
added to either the KiCad developer's site on Launchpad or the main website at www.kicad-pcb.org.
added to either the KiCad developer's site on Launchpad or the main website at www.kicad.org.
# Stable Release Announcement # {#announcement}
+3 -3
View File
@@ -304,6 +304,6 @@ Issues are still welcome for defects discovered.
[Boost Unit Test framework]: https://www.boost.org/doc/libs/1_68_0/libs/test/doc/html/index.html
[boost-test-functions]: https://www.boost.org/doc/libs/1_68_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref.html
[AFL fuzzing tool]: http://lcamtuf.coredump.cx/afl/
[trace mask documentation]: http://docs.kicad-pcb.org/doxygen/group__trace__env__vars.html
[trace mask documentation]: http://docs.kicad-pcb.org/doxygen/group__trace__env__vars.html
[advanced config documentation]: http://docs.kicad-pcb.org/doxygen/namespaceAC__KEYS.html
[trace mask documentation]: http://docs.kicad.org/doxygen/group__trace__env__vars.html
[trace mask documentation]: http://docs.kicad.org/doxygen/group__trace__env__vars.html
[advanced config documentation]: http://docs.kicad.org/doxygen/namespaceAC__KEYS.html
+1 -1
View File
@@ -37,7 +37,7 @@ if( APPLE )
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE bitmap2component.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad )
set( MACOSX_BUNDLE_NAME bitmap2component )
endif()
+1
View File
@@ -327,6 +327,7 @@ set( COMMON_SRCS
kiway_express.cpp
kiway_holder.cpp
kiway_player.cpp
launch_ext.cpp
lib_id.cpp
lib_table_base.cpp
lib_table_keywords.cpp
+24 -6
View File
@@ -42,6 +42,7 @@
#include <wx/url.h>
#include <pgm_base.h>
#include <clocale>
using KIGFX::COLOR4D;
@@ -59,16 +60,33 @@ COLOR4D g_GhostColor;
// When reading/writing files, we need to swtich to setlocale( LC_NUMERIC, "C" ).
// Works fine to read/write files with floating point numbers.
// We can call setlocale( LC_NUMERIC, "C" ) of wxLocale( "C", "C", "C", false )
// We can call setlocale( LC_NUMERIC, "C" ) or wxLocale( "C", "C", "C", false )
// wxWidgets discourage a direct call to setlocale
// However, for us, calling wxLocale( "C", "C", "C", false ) has a unwanted effect:
// The I18N translations are no longer active, because the English dixtionary is selected.
// The I18N translations are no longer active, because the English dictionary is selected.
// To read files, this is not a major issues, but the resul can differ
// from using setlocale(xx, "C").
// Previouly, we called setlocale( LC_NUMERIC, "C" )
// The old code will be removed when calling wxLocale( "C", "C", "C", false )
// is fully tested, and all issues fixed
#define USE_WXLOCALE 1 /* 0 to call setlocale, 1 to call wxLocale */
// Previouly, we used only setlocale( LC_NUMERIC, "C" )
//
// Known issues are
// on MSW
// using setlocale( LC_NUMERIC, "C" ) generates an alert message in debug mode,
// and this message ("Decimal separator mismatch") must be disabled.
// But calling wxLocale( "C", "C", "C", false ) works fine
// On unix:
// calling wxLocale( "C", "C", "C", false ) breaks env vars containing non ASCII7 chars.
// these env vars return a empty string from wxGetEnv() in many cases, and if such a
// var must be read after calling wxLocale( "C", "C", "C", false ), it looks like empty
//
// So use wxLocale on Windows and setlocale on unix
// set USE_WXLOCALE 0 to use setlocale, 1 to use wxLocale:
#if defined( _WIN32 )
#define USE_WXLOCALE 1
#else
#define USE_WXLOCALE 0
#endif
// On Windows, when using setlocale, a wx alert is generated
// in some cases (reading a bitmap for instance)
+2 -6
View File
@@ -130,11 +130,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
description << "<ul>";
description << "<li>"
<< _( "The official KiCad website - " )
<< HtmlHyperlink( "http://www.kicad-pcb.org" )
<< "</li>";
description << "<li>"
<< _( "Developer website on Launchpad - " )
<< HtmlHyperlink( "https://launchpad.net/kicad" )
<< HtmlHyperlink( "https://www.kicad.org" )
<< "</li>";
description << "<li>"
@@ -163,7 +159,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
description << "<ul>";
description << "<li>"
<< _( "KiCad forum - " )
<< HtmlHyperlink( "https://forum.kicad.info" )
<< HtmlHyperlink( "https://go.kicad.org/forum" )
<< "</li>";
description << "</ul></p>";
+1 -1
View File
@@ -47,7 +47,7 @@
/// The default auto save interval is 10 minutes.
#define DEFAULT_AUTO_SAVE_INTERVAL 600
#define URL_GET_INVOLVED "http://kicad-pcb.org/contribute/"
#define URL_GET_INVOLVED "https://www.kicad.org/contribute/"
///@{
/// \ingroup config
+42
View File
@@ -0,0 +1,42 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gestfich.h>
#include <launch_ext.h>
void LaunchExternal( const wxString& aPath )
{
#ifdef __WXMAC__
wxExecute( wxString::Format( "open \"%s\"", aPath ) );
#else
wxString path( aPath );
#if !wxCHECK_VERSION( 3, 1, 0 )
// Quote in case there are spaces in the path.
// Not needed on 3.1.4, but needed in 3.0 versions
// Moreover, on Linux, on 3.1.4 wx version, adding quotes breaks
// wxLaunchDefaultApplication
AddDelimiterString( path );
#endif
wxLaunchDefaultApplication( path );
#endif
}
+11
View File
@@ -1091,6 +1091,11 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
bool EDA_DRAW_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
{
#ifdef __WXMAC__
// Cairo is unsupported on Mac
if( aCanvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO )
aCanvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
#endif
auto galCanvas = GetGalCanvas();
wxCHECK( galCanvas, false );
bool use_gal = galCanvas->SwitchBackend( aCanvasType );
@@ -1120,6 +1125,12 @@ EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting()
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
}
#ifdef __WXMAC__
// Did Cairo get saved on Mac? Force OpenGL; Cairo doesn't work on Retina displays
if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO )
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
#endif
// Coerce the value into a GAL type when Legacy is not available
// Default to Cairo, and on the first, user will be prompted for OpenGL
if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
+18 -11
View File
@@ -136,24 +136,31 @@ void LIB_TREE_MODEL_ADAPTER::DoAddLibrary( wxString const& aNodeName, wxString c
}
void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( wxString const& aSearch )
void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( wxString const& aSearch, bool aState )
{
{
wxWindowUpdateLocker updateLock( m_widget );
// This collapse is required before the call to "Freeze()" below. Once Freeze()
// is called, GetParent() will return nullptr. While this works for some calls, it
// segfaults when we have our first library expanded.
// The tree will be expanded again below when we get our matches
if( !aSearch.IsNull() )
m_widget->Collapse( wxDataViewItem( &*m_tree.Children[0] ) );
// Even with the updateLock, wxWidgets sometimes ties its knickers in
// a knot when trying to run a wxdataview_selection_changed_callback()
// on a row that has been deleted.
// Even with the updateLock, wxWidgets sometimes ties its knickers in a knot trying to
// run a wxdataview_selection_changed_callback() on a row that has been deleted.
// https://bugs.launchpad.net/kicad/+bug/1756255
m_widget->UnselectAll();
// This collapse is required before the call to "Freeze()" below. Once Freeze()
// is called, GetParent() will return nullptr. While this works for some calls, it
// segfaults when we have any expanded elements b/c the sub units in the tree don't
// have explicit references that are maintained over a search
// The tree will be expanded again below when we get our matches
//
// Also note that this cannot happen when we have deleted a symbol as GTK will also
// iterate over the tree in this case and find a symbol that has an invalid link
// and crash https://gitlab.com/kicad/code/kicad/-/issues/6910
if( !aState && m_tree.Children.size() )
{
for( std::unique_ptr<LIB_TREE_NODE>& child: m_tree.Children )
m_widget->Collapse( wxDataViewItem( &*child ) );
}
// DO NOT REMOVE THE FREEZE/THAW. This freeze/thaw is a flag for this model adapter
// that tells it when it shouldn't trust any of the data in the model. When set, it will
// not return invalid data to the UI, since this invalid data can cause crashes.
+2 -1
View File
@@ -171,8 +171,9 @@ public:
* Set the search string provided by the user.
*
* @param aSearch full, unprocessed search text
* @param aState Are we keeping the selection/search state?
*/
void UpdateSearchString( wxString const& aSearch );
void UpdateSearchString( wxString const& aSearch, bool aState );
/**
* Attach to a wxDataViewCtrl and initialize it. This will set up columns
+28
View File
@@ -92,6 +92,34 @@ bool MD5_HASH::operator!=( const MD5_HASH& aOther ) const
}
std::string MD5_HASH::Format( bool aCompactForm )
{
std::string data;
// Build a hexadecimal string from the 16 bytes of MD5_HASH:
for( int ii = 0; ii < 16; ++ii )
{
char lsb = ( m_hash[ii] & 0x0F ) + '0';
if( lsb > '9' )
lsb += 'A'-'9';
char msb = ( ( m_hash[ii] >> 4 ) & 0x0F ) + '0';
if( msb > '9' )
msb += 'A'-'9';
data += msb;
data += lsb;
if( !aCompactForm )
data += ' ';
}
return data;
}
void MD5_HASH::md5_transform(MD5_CTX *ctx, uint8_t data[])
{
uint32_t a,b,c,d,m[16],i,j;
@@ -128,6 +128,14 @@ void PAGE_LAYOUT_READER_PARSER::Parse( WORKSHEET_LAYOUT* aLayout )
if( token == T_LEFT )
token = NextTok();
if( token == T_kicad_wks || token == T_drawing_sheet )
{
THROW_PARSE_ERROR( _( "KiCad was unable to open this file because it was created with "
"a more recent version than the one you are running.\n\n"
"To open it you will need to upgrade KiCad to 5.99 or later." ),
CurSource(), CurLine(), CurLineNumber(), CurOffset() );
}
if( token == T_page_layout )
continue;
@@ -1,3 +1,5 @@
drawing_sheet
kicad_wks
page_layout
setup
left_margin
+1 -2
View File
@@ -755,8 +755,7 @@ bool PDF_PLOTTER::EndPlot()
"/Producer (KiCAD PDF)\n"
"/CreationDate (%s)\n"
"/Creator (%s)\n"
"/Title (%s)\n"
"/Trapped false\n",
"/Title (%s)\n",
date_buf,
TO_UTF8( creator ),
TO_UTF8( title ) );
+3 -3
View File
@@ -151,7 +151,7 @@ __asm (
" push %rax\n"
" mov 0x1478(%r10),%rax\n"
" push %rax\n"
" mov 0x18(%r10),%rax\n"
" mov 0x20(%r10),%rax\n"
" push %rax\n"
" lea -0xa8(%rsp),%rsp\n"
" test %r9,%r9\n"
@@ -197,7 +197,7 @@ __asm (
" lea (%rsp,%rcx,1),%rsp\n"
" mov %gs:0x30,%r10\n"
" pop %rax\n"
" mov %rax,0x18(%r10)\n"
" mov %rax,0x20(%r10)\n"
" pop %rax\n"
" mov %rax,0x1478(%r10)\n"
" pop %rax\n"
@@ -249,7 +249,7 @@ __asm (
"retq\n"
"finish:\n"
"xor %rcx,%rcx\n"
"callq 0x63\n"
"call _exit\n"
"hlt\n"
" .seh_endproc\n"
".def _exit; .scl 2; .type 32; .endef \n"
+1 -1
View File
@@ -196,7 +196,7 @@ void LIB_TREE::Regenerate( bool aKeepState )
m_unfilteredState = getState();
wxString filter = m_query_ctrl->GetValue();
m_adapter->UpdateSearchString( filter );
m_adapter->UpdateSearchString( filter, aKeepState );
postPreselectEvent();
// Restore the state
+9
View File
@@ -125,6 +125,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_libListBox = NULL;
m_mainToolBar = NULL;
m_modified = false;
m_cannotClose = false;
m_skipComponentSelect = false;
m_filteringOptions = 0;
m_tcFilterString = NULL;
@@ -307,6 +308,10 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event )
// clear highlight symbol in schematic:
SendMessageToEESCHEMA( true );
if( m_cannotClose )
return;
// Delete window
Destroy();
}
@@ -1117,7 +1122,11 @@ void CVPCB_MAINFRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
switch( mail.Command() )
{
case MAIL_EESCHEMA_NETLIST:
// Disable Close events during ReadNetListAndFpFiles() to avoid crash when updating
// widgets:
m_cannotClose = true;
ReadNetListAndFpFiles( payload );
m_cannotClose = false;
/* @todo
Go into SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event ) and trim GNL_ALL down.
*/
+4 -2
View File
@@ -80,11 +80,13 @@ public:
protected:
bool m_modified;
bool m_skipComponentSelect; // true to skip OnSelectComponent event
// (in automatic selection/deletion of associations)
bool m_skipComponentSelect; // true to skip OnSelectComponent event
// (in automatic selection/deletion of associations)
PARAM_CFG_ARRAY m_projectFileParams;
bool m_initialized;
bool m_cannotClose; // true when the cvpcb frame cannot be closed
// (mainly during reading a netlist sent by Eeschema)
CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent );
+2
View File
@@ -0,0 +1,2 @@
*generic diode model
.model 1N4148 D
+101 -101
View File
@@ -1,101 +1,101 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# C
#
DEF C C 0 10 N Y 1 F N
F0 "C" 25 100 50 H V L CNN
F1 "C" 25 -100 50 H V L CNN
F2 "" 38 -150 50 H V C CNN
F3 "" 0 0 50 H V C CNN
$FPLIST
C?
C_????_*
C_????
SMD*_c
Capacitor*
Capacitors_ThroughHole:C_Radial_D10_L13_P5
Capacitors_SMD:C_0805
Capacitors_SMD:C_1206
$ENDFPLIST
DRAW
P 2 0 1 20 -80 -30 80 -30 N
P 2 0 1 20 -80 30 80 30 N
X ~ 1 0 150 110 D 40 40 1 1 P
X ~ 2 0 -150 110 U 40 40 1 1 P
ENDDRAW
ENDDEF
#
# D
#
DEF D D 0 40 N N 1 F N
F0 "D" 0 100 50 H V C CNN
F1 "D" 0 -100 50 H V C CNN
F2 "" 0 0 50 H V C CNN
F3 "" 0 0 50 H V C CNN
$FPLIST
Diode_*
D-Pak_TO252AA
*SingleDiode
*_Diode_*
*SingleDiode*
$ENDFPLIST
DRAW
P 2 0 1 6 -50 50 -50 -50 N
P 3 0 1 0 50 50 -50 0 50 -50 F
X K 1 -150 0 100 R 50 50 1 1 P
X A 2 150 0 100 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# GND
#
DEF GND #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "GND" 0 -123 30 H V C CNN
F2 "" 0 0 60 H V C CNN
F3 "" 0 0 60 H V C CNN
DRAW
P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
X GND 1 0 0 0 D 20 30 1 1 W N
ENDDRAW
ENDDEF
#
# R
#
DEF R R 0 0 N Y 1 F N
F0 "R" 80 0 50 V V C CNN
F1 "R" 0 0 50 V V C CNN
F2 "" -70 0 50 V V C CNN
F3 "" 0 0 50 H V C CNN
$FPLIST
R_*
Resistor_*
$ENDFPLIST
DRAW
S -40 -100 40 100 0 1 10 N
X ~ 1 0 150 50 D 50 50 1 1 P
X ~ 2 0 -150 50 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# VSOURCE
#
DEF ~VSOURCE V 0 40 Y Y 1 F N
F0 "V" 200 200 50 H V C CNN
F1 "VSOURCE" 250 100 50 H I C CNN
F2 "" 0 0 50 H V C CNN
F3 "" 0 0 50 H V C CNN
F4 "Value" 0 0 60 H I C CNN "Fieldname"
F5 "V" 0 0 60 H I C CNN "Spice_Primitive"
F6 "1 2" -300 200 60 H I C CNN "Spice_Node_Sequence"
DRAW
C 0 0 100 0 1 0 N
P 2 0 1 0 0 -75 0 75 N
P 4 0 1 0 0 75 -25 25 25 25 0 75 F
X ~ 1 0 200 100 D 50 50 1 1 I
X ~ 2 0 -200 100 U 50 50 1 1 I
ENDDRAW
ENDDEF
#
#End Library
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# rectifier_schlib_C
#
DEF rectifier_schlib_C C 0 10 N Y 1 F N
F0 "C" 25 100 50 H V L CNN
F1 "rectifier_schlib_C" 25 -100 50 H V L CNN
F2 "" 38 -150 50 H V C CNN
F3 "" 0 0 50 H V C CNN
$FPLIST
C?
C_????_*
C_????
SMD*_c
Capacitor*
Capacitors_ThroughHole:C_Radial_D10_L13_P5
Capacitors_SMD:C_0805
Capacitors_SMD:C_1206
$ENDFPLIST
DRAW
P 2 0 1 20 -80 -30 80 -30 N
P 2 0 1 20 -80 30 80 30 N
X ~ 1 0 150 110 D 40 40 1 1 P
X ~ 2 0 -150 110 U 40 40 1 1 P
ENDDRAW
ENDDEF
#
# rectifier_schlib_D
#
DEF rectifier_schlib_D D 0 40 N N 1 F N
F0 "D" 0 100 50 H V C CNN
F1 "rectifier_schlib_D" 0 -100 50 H V C CNN
F2 "" 0 0 50 H V C CNN
F3 "" 0 0 50 H V C CNN
$FPLIST
Diode_*
D-Pak_TO252AA
*SingleDiode
*_Diode_*
*SingleDiode*
$ENDFPLIST
DRAW
P 2 0 1 6 -50 50 -50 -50 N
P 3 0 1 0 50 50 -50 0 50 -50 F
X K 1 -150 0 100 R 50 50 1 1 P
X A 2 150 0 100 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# rectifier_schlib_GND
#
DEF rectifier_schlib_GND #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "rectifier_schlib_GND" 0 -123 30 H V C CNN
F2 "" 0 0 60 H V C CNN
F3 "" 0 0 60 H V C CNN
DRAW
P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
X GND 1 0 0 0 D 20 30 1 1 W N
ENDDRAW
ENDDEF
#
# rectifier_schlib_R
#
DEF rectifier_schlib_R R 0 0 N Y 1 F N
F0 "R" 80 0 50 V V C CNN
F1 "rectifier_schlib_R" 0 0 50 V V C CNN
F2 "" -70 0 50 V V C CNN
F3 "" 0 0 50 H V C CNN
$FPLIST
R_*
Resistor_*
$ENDFPLIST
DRAW
S -40 -100 40 100 0 1 10 N
X ~ 1 0 150 50 D 50 50 1 1 P
X ~ 2 0 -150 50 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# rectifier_schlib_VSOURCE
#
DEF rectifier_schlib_VSOURCE V 0 40 Y Y 1 F N
F0 "V" 200 200 50 H V C CNN
F1 "rectifier_schlib_VSOURCE" 250 100 50 H I C CNN
F2 "" 0 0 50 H V C CNN
F3 "" 0 0 50 H V C CNN
F4 "Value" 0 0 60 H I C CNN "Fieldname"
F5 "V" 0 0 60 H I C CNN "Spice_Primitive"
F6 "1 2" -300 200 60 H I C CNN "Spice_Node_Sequence"
DRAW
C 0 0 100 0 1 0 N
P 2 0 1 0 0 -75 0 75 N
P 4 0 1 0 0 75 -25 25 25 25 0 75 F
X ~ 1 0 200 100 D 50 50 1 1 I
X ~ 2 0 -200 100 U 50 50 1 1 I
ENDDRAW
ENDDEF
#
#End Library
+137 -129
View File
@@ -1,129 +1,137 @@
EESchema Schematic File Version 4
LIBS:rectifier-cache
EELAYER 26 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 1
Title ""
Date ""
Rev ""
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L rectifier_schlib:VSOURCE V1
U 1 1 57336052
P 4400 4050
F 0 "V1" H 4528 4096 50 0000 L CNN
F 1 "SINE(0 1.5 1k 0 0 0 0)" H 4528 4005 50 0000 L CNN
F 2 "" H 4400 4050 50 0000 C CNN
F 3 "" H 4400 4050 50 0000 C CNN
F 4 "Value" H 4400 4050 60 0001 C CNN "Fieldname"
F 5 "V" H 4400 4050 60 0001 C CNN "Spice_Primitive"
F 6 "1 2" H 4100 4250 60 0001 C CNN "Spice_Node_Sequence"
1 4400 4050
-1 0 0 1
$EndComp
$Comp
L rectifier_schlib:GND #PWR01
U 1 1 573360D3
P 4400 4350
F 0 "#PWR01" H 4400 4100 50 0001 C CNN
F 1 "GND" H 4405 4177 50 0000 C CNN
F 2 "" H 4400 4350 50 0000 C CNN
F 3 "" H 4400 4350 50 0000 C CNN
1 4400 4350
1 0 0 -1
$EndComp
$Comp
L rectifier_schlib:R R1
U 1 1 573360F5
P 4650 3700
F 0 "R1" V 4443 3700 50 0000 C CNN
F 1 "1k" V 4534 3700 50 0000 C CNN
F 2 "" V 4580 3700 50 0000 C CNN
F 3 "" H 4650 3700 50 0000 C CNN
F 4 "Value" H 4650 3700 60 0001 C CNN "Fieldname"
F 5 "1 2" H 4650 3700 60 0001 C CNN "SpiceMapping"
F 6 "R" V 4650 3700 60 0001 C CNN "Spice_Primitive"
1 4650 3700
0 1 1 0
$EndComp
$Comp
L rectifier_schlib:D D1
U 1 1 573361B8
P 5100 3700
F 0 "D1" H 5100 3485 50 0000 C CNN
F 1 "1N4148" H 5100 3576 50 0000 C CNN
F 2 "" H 5100 3700 50 0000 C CNN
F 3 "" H 5100 3700 50 0000 C CNN
F 4 "Value" H 5100 3700 60 0001 C CNN "Fieldname"
F 5 "D" H 5100 3700 60 0001 C CNN "Spice_Primitive"
F 6 "2 1" H 5100 3700 60 0001 C CNN "Spice_Node_Sequence"
1 5100 3700
-1 0 0 1
$EndComp
$Comp
L rectifier_schlib:C C1
U 1 1 5733628F
P 5400 4000
F 0 "C1" H 5515 4046 50 0000 L CNN
F 1 "100n" H 5515 3955 50 0000 L CNN
F 2 "" H 5438 3850 50 0000 C CNN
F 3 "" H 5400 4000 50 0000 C CNN
F 4 "Value" H 5400 4000 60 0001 C CNN "Fieldname"
F 5 "C" H 5400 4000 60 0001 C CNN "Spice_Primitive"
F 6 "1 2" H 5400 4000 60 0001 C CNN "SpiceMapping"
1 5400 4000
1 0 0 -1
$EndComp
$Comp
L rectifier_schlib:R R2
U 1 1 573362F7
P 5750 4000
F 0 "R2" H 5680 3954 50 0000 R CNN
F 1 "100k" H 5680 4045 50 0000 R CNN
F 2 "" V 5680 4000 50 0000 C CNN
F 3 "" H 5750 4000 50 0000 C CNN
F 4 "Value" H 5750 4000 60 0001 C CNN "Fieldname"
F 5 "1 2" H 5750 4000 60 0001 C CNN "SpiceMapping"
F 6 "R" V 5750 4000 60 0001 C CNN "Spice_Primitive"
1 5750 4000
-1 0 0 1
$EndComp
Text Notes 4300 4900 0 60 ~ 0
.tran 1u 10m\n
Wire Wire Line
4400 4350 4400 4250
Wire Wire Line
4400 4300 5750 4300
Connection ~ 4400 4300
Wire Wire Line
5250 3700 5750 3700
Wire Wire Line
5750 3700 5750 3850
Wire Wire Line
5400 3850 5400 3700
Connection ~ 5400 3700
Wire Wire Line
5400 4300 5400 4150
Wire Wire Line
5750 4300 5750 4150
Connection ~ 5400 4300
Wire Wire Line
4800 3700 4950 3700
Wire Wire Line
4400 3850 4400 3700
Wire Wire Line
4400 3700 4500 3700
Text Label 4400 3700 2 60 ~ 0
signal_in
Text Label 5750 3700 0 60 ~ 0
rect_out
Text Notes 4300 5000 0 60 ~ 0
*.ac dec 10 1 1Meg\n
$EndSCHEMATC
EESchema Schematic File Version 4
EELAYER 30 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 1
Title ""
Date ""
Rev ""
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L rectifier_schlib:VSOURCE V1
U 1 1 57336052
P 4400 4050
F 0 "V1" H 4528 4096 50 0000 L CNN
F 1 "SINE(0 1.5 1k 0 0 0 0)" H 4528 4005 50 0000 L CNN
F 2 "" H 4400 4050 50 0000 C CNN
F 3 "" H 4400 4050 50 0000 C CNN
F 4 "Value" H 4400 4050 60 0001 C CNN "Fieldname"
F 5 "V" H 4400 4050 60 0001 C CNN "Spice_Primitive"
F 6 "1 2" H 4100 4250 60 0001 C CNN "Spice_Node_Sequence"
1 4400 4050
-1 0 0 1
$EndComp
$Comp
L rectifier_schlib:GND #PWR01
U 1 1 573360D3
P 4400 4350
F 0 "#PWR01" H 4400 4100 50 0001 C CNN
F 1 "GND" H 4405 4177 50 0000 C CNN
F 2 "" H 4400 4350 50 0000 C CNN
F 3 "" H 4400 4350 50 0000 C CNN
1 4400 4350
1 0 0 -1
$EndComp
$Comp
L rectifier_schlib:R R1
U 1 1 573360F5
P 4650 3700
F 0 "R1" V 4443 3700 50 0000 C CNN
F 1 "1k" V 4534 3700 50 0000 C CNN
F 2 "" V 4580 3700 50 0000 C CNN
F 3 "" H 4650 3700 50 0000 C CNN
F 4 "Value" H 4650 3700 60 0001 C CNN "Fieldname"
F 5 "1 2" H 4650 3700 60 0001 C CNN "SpiceMapping"
F 6 "R" V 4650 3700 60 0001 C CNN "Spice_Primitive"
1 4650 3700
0 1 1 0
$EndComp
$Comp
L rectifier_schlib:D D1
U 1 1 573361B8
P 5100 3700
F 0 "D1" H 5100 3485 50 0000 C CNN
F 1 "1N4148" H 5100 3576 50 0000 C CNN
F 2 "" H 5100 3700 50 0000 C CNN
F 3 "" H 5100 3700 50 0000 C CNN
F 4 "Value" H 5100 3700 60 0001 C CNN "Fieldname"
F 5 "D" H 5100 3700 60 0001 C CNN "Spice_Primitive"
F 6 "2 1" H 5100 3700 60 0001 C CNN "Spice_Node_Sequence"
F 7 "1N4148" H 5100 3700 50 0001 C CNN "Spice_Model"
F 8 "Y" H 5100 3700 50 0001 C CNN "Spice_Netlist_Enabled"
F 9 "diode.mod" H 5100 3700 50 0001 C CNN "Spice_Lib_File"
1 5100 3700
-1 0 0 1
$EndComp
$Comp
L rectifier_schlib:C C1
U 1 1 5733628F
P 5400 4000
F 0 "C1" H 5515 4046 50 0000 L CNN
F 1 "100n" H 5515 3955 50 0000 L CNN
F 2 "" H 5438 3850 50 0000 C CNN
F 3 "" H 5400 4000 50 0000 C CNN
F 4 "Value" H 5400 4000 60 0001 C CNN "Fieldname"
F 5 "C" H 5400 4000 60 0001 C CNN "Spice_Primitive"
F 6 "1 2" H 5400 4000 60 0001 C CNN "SpiceMapping"
1 5400 4000
1 0 0 -1
$EndComp
$Comp
L rectifier_schlib:R R2
U 1 1 573362F7
P 5750 4000
F 0 "R2" H 5680 3954 50 0000 R CNN
F 1 "100k" H 5680 4045 50 0000 R CNN
F 2 "" V 5680 4000 50 0000 C CNN
F 3 "" H 5750 4000 50 0000 C CNN
F 4 "Value" H 5750 4000 60 0001 C CNN "Fieldname"
F 5 "1 2" H 5750 4000 60 0001 C CNN "SpiceMapping"
F 6 "R" V 5750 4000 60 0001 C CNN "Spice_Primitive"
1 5750 4000
-1 0 0 1
$EndComp
Text Notes 4300 4900 0 60 ~ 0
.tran 1u 10m\n
Wire Wire Line
4400 4350 4400 4300
Wire Wire Line
4400 4300 5400 4300
Connection ~ 4400 4300
Wire Wire Line
5250 3700 5400 3700
Wire Wire Line
5750 3700 5750 3850
Wire Wire Line
5400 3850 5400 3700
Connection ~ 5400 3700
Wire Wire Line
5400 4300 5400 4150
Wire Wire Line
5750 4300 5750 4150
Connection ~ 5400 4300
Wire Wire Line
4800 3700 4950 3700
Wire Wire Line
4400 3850 4400 3700
Wire Wire Line
4400 3700 4500 3700
Text Label 4400 3700 2 60 ~ 0
signal_in
Text Label 5750 3700 0 60 ~ 0
rect_out
Text Notes 4300 5000 0 60 ~ 0
*.ac dec 10 1 1Meg\n
Wire Wire Line
4400 4300 4400 4250
Wire Wire Line
5400 3700 5750 3700
Wire Wire Line
5400 4300 5750 4300
$EndSCHEMATC
+1 -1
View File
@@ -1714,7 +1714,7 @@ bool DL_Dxf::handleLWPolylineData( DL_CreationInterface* /*creationInterface*
vertices[4 * vertexIndex + (groupCode / 10 - 1)] = toReal( groupValue );
}
}
else if( groupCode==42 && vertexIndex<maxVertices )
else if( groupCode==42 && vertexIndex<maxVertices && vertexIndex >= 0 )
{
vertices[4 * vertexIndex + 3] = toReal( groupValue );
}
+10 -8
View File
@@ -9,8 +9,8 @@ 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 )
get_filename_component( NGSPICE_DLL_ABSPATH "${NGSPICE_DLL}" ABSOLUTE )
get_filename_component( NGSPICE_DLL_FILE "${NGSPICE_DLL_ABSPATH}" NAME )
set_property( SOURCE sim/ngspice.cpp
APPEND PROPERTY COMPILE_DEFINITIONS
@@ -304,7 +304,7 @@ if( APPLE )
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE eeschema.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad )
set( MACOSX_BUNDLE_NAME eeschema )
endif()
@@ -423,11 +423,13 @@ if( APPLE )
)
if( KICAD_SPICE )
# bundle libngspice, codemodels and scripts
get_filename_component( REAL_LIBNGSPICE ${NGSPICE_LIBRARY} REALPATH )
get_filename_component( LIBNGSPICE_PATH ${REAL_LIBNGSPICE} DIRECTORY )
install( FILES "${REAL_LIBNGSPICE}"
DESTINATION "${OSX_BUNDLE_INSTALL_PLUGIN_DIR}/sim" )
# bundle libngspice and codemodels
get_filename_component( ABS_LIBNGSPICE ${NGSPICE_LIBRARY} ABSOLUTE )
get_filename_component( LIBNGSPICE_PATH ${ABS_LIBNGSPICE} DIRECTORY )
install( DIRECTORY "${LIBNGSPICE_PATH}/"
DESTINATION "${OSX_BUNDLE_INSTALL_PLUGIN_DIR}/sim"
FILES_MATCHING PATTERN "*.dylib")
install( DIRECTORY "${LIBNGSPICE_PATH}/ngspice"
DESTINATION "${OSX_BUNDLE_INSTALL_PLUGIN_DIR}/sim" )
install( DIRECTORY "${LIBNGSPICE_PATH}/../share/ngspice/scripts"
+4 -3
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2021 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
@@ -451,7 +451,7 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
{
unsigned i;
SCH_ITEM* item;
SCH_SHEET_LIST hierarchy( g_RootSheet ); // This is the entire schematic hierarcy.
SCH_SHEET_LIST hierarchy( g_RootSheet, false ); // This is the entire schematic hierarcy.
if( m_blockItems.GetCount() == 0 )
{
@@ -468,8 +468,9 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
// 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 );
SCH_SHEET_LIST initial_sheetpathList( g_RootSheet, false );
for( i = 0; i < m_blockItems.GetCount(); i++ )
{
+33 -7
View File
@@ -2,6 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@@ -48,24 +49,28 @@ BOM_PLUGIN::BOM_PLUGIN( const wxString& aFile )
if( extension == "xsl" )
{
m_info = readHeader( "-->" );
m_cmd = wxString::Format( "xsltproc -o \"%%O\" \"%s\" \"%%I\"", m_file.GetFullPath() );
m_cmd = wxString::Format( "xsltproc -o \"%%O%s\" \"%s\" \"%%I\"",
getOutputExtension( m_info ), m_file.GetFullPath() );
}
else if( extension == "py" )
{
m_info = readHeader( "\"\"\"" );
#ifdef __WINDOWS__
m_cmd = wxString::Format( "python \"%s/%s\" \"%%I\" \"%%O\"",
m_file.GetPath(), m_file.GetFullName() );
m_cmd = wxString::Format( "python \"%s/%s\" \"%%I\" \"%%O%s\"",
m_file.GetPath(), m_file.GetFullName(),
getOutputExtension( m_info ) );
#else
m_cmd = wxString::Format( "python \"%s\" \"%%I\" \"%%O\"", m_file.GetFullPath() );
m_cmd = wxString::Format( "python \"%s\" \"%%I\" \"%%O%s\"", m_file.GetFullPath(),
getOutputExtension( m_info ) );
#endif
}
#ifdef __WINDOWS__
else if( extension == "pyw" )
{
m_info = readHeader( "\"\"\"" );
m_cmd = wxString::Format( "pythonw \"%s/%s\" \"%%I\" \"%%O\"",
m_file.GetPath(),m_file.GetFullName() );
m_cmd = wxString::Format( "pythonw \"%s/%s\" \"%%I\" \"%%O%s\"",
m_file.GetPath(), m_file.GetFullName(),
getOutputExtension( m_info ) );
}
#endif /* __WINDOWS__ */
else // fallback
@@ -112,7 +117,7 @@ wxString BOM_PLUGIN::readHeader( const wxString& aEndSection )
strstart += header.Length();
int strend = data.find( aEndSection, strstart );
if( strend == wxNOT_FOUND)
if( strend == wxNOT_FOUND )
return wxEmptyString;
// Remove empty line if any
@@ -121,3 +126,24 @@ wxString BOM_PLUGIN::readHeader( const wxString& aEndSection )
return data.SubString( strstart, strend - 1 );
}
wxString BOM_PLUGIN::getOutputExtension( const wxString& aHeader )
{
// search header for extension after %O (extension includes '.')
// looks for output argument of the form `"%O.extension"`
const wxString outputarg( "\"%O" );
int strstart = aHeader.Find( outputarg );
if( strstart == wxNOT_FOUND )
return wxEmptyString;
strstart += outputarg.Length();
int strend = aHeader.find( "\"", strstart );
if( strend == wxNOT_FOUND )
return wxEmptyString;
return aHeader.SubString( strstart, strend - 1 );
}
+8
View File
@@ -121,6 +121,14 @@ protected:
*/
wxString readHeader( const wxString& aEndSection );
/**
* Extracts the output BOM file's extension, including the '.', from the
* plugin file header. If the output extension cannot be determined from
* the plugin header, returns wxEmptyString.
* @param aHeader is the plugin file's header, as returned by readHeader()
**/
static wxString getOutputExtension( const wxString& aHeader );
///> true if the plugin is working (i.e. if the plugin file exists and was read
bool m_isOk;
+6 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
* Copyright (C) 2004-2019 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2021 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
@@ -298,11 +298,15 @@ void SCH_EDIT_FRAME::EndSegment()
if( segment == NULL || segment->Type() != SCH_LINE_T || !segment->IsNew() )
return;
// Remove segments backtracking over others
// Remove zero length segments and segments backtracking over other segments.
RemoveBacktracks( s_wires );
if( s_wires.GetCount() == 0 )
{
screen->ClearDrawingState();
screen->SetCurItem( NULL );
return;
}
// Collect the possible connection points for the new lines
std::vector< wxPoint > connections;
-1
View File
@@ -457,7 +457,6 @@ void DIALOG_BOM::OnRunPlugin( wxCommandEvent& event )
// Calculate the xml netlist filename
wxFileName fn = g_RootSheet->GetScreen()->GetFileName();
fn.SetPath( wxPathOnly( Prj().GetProjectFullName() ) );
fn.ClearExt();
wxString fullfilename = fn.GetFullPath();
+1 -1
View File
@@ -44,7 +44,7 @@ Full documentation:</h1>
<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 </span>
<i><b>http://docs.kicad-pcb.org/stable/en/eeschema.html#creating-customized-netlists-and-bom-files</b></i></font></font></p>
<i><b>https://go.kicad.org/docs/5.1/en/eeschema/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
@@ -441,6 +441,9 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow()
m_cmp->ClearFlags();
m_cmp->SetFlags( flags );
wxString originalRef = m_cmp->GetField( REFERENCE )->GetText();
wxString originalValue = m_cmp->GetField( VALUE )->GetText();
// change all field positions from relative to absolute
for( unsigned i = 0; i < m_fields->size(); ++i )
m_fields->at( i ).Offset( m_cmp->GetPosition() );
@@ -490,17 +493,31 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow()
SCH_REFERENCE_LIST components;
GetParent()->GetCurrentSheet().GetComponents( components );
for( unsigned i = 0; i < components.GetCount(); i++ )
// Handle each unit only once
for( int unit = 1; unit <= m_cmp->GetUnitCount(); unit++)
{
SCH_REFERENCE component = components[i];
// Don't attempt to change the current unit; this was already changed above
if( unit == thisUnit )
continue;
if( component.GetRef() == thisRef && component.GetUnit() != thisUnit )
for( unsigned i = 0; i < components.GetCount(); i++ )
{
SCH_COMPONENT* otherUnit = component.GetComp();
GetParent()->SaveCopyInUndoList( otherUnit, UR_CHANGED, true /* append */);
otherUnit->GetField( VALUE )->SetText( m_fields->at( VALUE ).GetText() );
otherUnit->GetField( FOOTPRINT )->SetText( m_fields->at( FOOTPRINT ).GetText() );
otherUnit->GetField( DATASHEET )->SetText( m_fields->at( DATASHEET ).GetText() );
SCH_REFERENCE otherComp = components[i];
SCH_COMPONENT* otherUnit = otherComp.GetComp();
// Match a single unit instance although in an unannotated schematic, there may be many
if( otherComp.GetUnit() != unit )
continue;
if( otherUnit->GetField( REFERENCE )->GetText() == originalRef
&& otherUnit->GetField( VALUE )->GetText() == originalValue )
{
GetParent()->SaveCopyInUndoList( otherUnit, UR_CHANGED, true /* append */);
otherUnit->GetField( VALUE )->SetText( m_fields->at( VALUE ).GetText() );
otherUnit->GetField( FOOTPRINT )->SetText( m_fields->at( FOOTPRINT ).GetText() );
otherUnit->GetField( DATASHEET )->SetText( m_fields->at( DATASHEET ).GetText() );
break;
}
}
}
}
+1 -1
View File
@@ -193,7 +193,7 @@ bool DIALOG_SPICE_MODEL::TransferDataFromWindow()
int modelIdx = m_modelType->GetSelection();
if( modelIdx > 0 && modelIdx < (int)modelTypes.size() )
if( modelIdx >= 0 && modelIdx < (int)modelTypes.size() )
m_fieldsTmp[SF_PRIMITIVE] = static_cast<char>( modelTypes[modelIdx].type );
m_fieldsTmp[SF_MODEL] = m_modelName->GetValue();
+2 -2
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2021 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
@@ -124,7 +124,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
if( !aSearchHierarchy )
sheetList.push_back( *m_CurrentSheet );
else
sheetList.BuildSheetList( g_RootSheet );
sheetList.BuildSheetList( g_RootSheet, false );
for( SCH_SHEET_PATHS_ITER it = sheetList.begin(); it != sheetList.end(); ++it )
{
+2 -1
View File
@@ -337,6 +337,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Language submenu
Pgm().AddMenuLanguageList( preferencesMenu );
#ifndef __WXMAC__
preferencesMenu->AppendSeparator();
text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Libedit_Hotkeys_Descr,
@@ -350,7 +351,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
AddMenuItem( preferencesMenu, ID_MENU_CANVAS_CAIRO, text,
_( "Use Modern Toolset with software graphics (fall-back)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
#endif
// Menu Help:
+2
View File
@@ -638,6 +638,7 @@ static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu
// Language submenu
Pgm().AddMenuLanguageList( aParentMenu );
#ifndef __WXMAC__
aParentMenu->AppendSeparator();
text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Eeschema_Hotkeys_Descr,
@@ -651,6 +652,7 @@ static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu
AddMenuItem( aParentMenu, ID_MENU_CANVAS_CAIRO, text,
_( "Use Modern Toolset with software graphics (fall-back)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
#endif
aParentMenu->AppendSeparator();
@@ -31,6 +31,7 @@
#include <class_library.h>
#include <sch_base_frame.h>
#include <symbol_lib_table.h>
#include <wx/wfstream.h>
static bool sortPinsByNumber( LIB_PIN* aPin1, LIB_PIN* aPin2 );
@@ -41,12 +42,19 @@ bool NETLIST_EXPORTER_GENERIC::WriteNetlist( const wxString& aOutFileName, unsig
for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
m_masterList->GetItem( ii )->m_Flag = 0;
// declare the stream ourselves to use the buffered FILE api
// instead of letting wx use the syscall variant
wxFFileOutputStream stream( aOutFileName );
if( !stream.IsOk() )
return false;
// output the XML format netlist.
wxXmlDocument xdoc;
xdoc.SetRoot( makeRoot( GNL_ALL ) );
return xdoc.Save( aOutFileName, 2 /* indent bug, today was ignored by wxXml lib */ );
return xdoc.Save( stream, 2 /* indent bug, today was ignored by wxXml lib */ );
}
+2 -2
View File
@@ -5,7 +5,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2010 Lorenzo Marcantonio
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -50,7 +50,7 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
SCH_SHEET_LIST sheetList;
if( aPlotAll )
sheetList.BuildSheetList( g_RootSheet );
sheetList.BuildSheetList( g_RootSheet, false );
else
sheetList.push_back( schframe->GetCurrentSheet() );
+2 -2
View File
@@ -5,7 +5,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2010 Jean-Pierre Charras jp.charras at wanadoo.fr
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -96,7 +96,7 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
SCH_SHEET_LIST sheetList;
if( aPlotAll )
sheetList.BuildSheetList( g_RootSheet );
sheetList.BuildSheetList( g_RootSheet, false );
else
sheetList.push_back( m_parent->GetCurrentSheet() );
+2 -2
View File
@@ -5,7 +5,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2010 Jean-Pierre Charras jp.charras at wanadoo.fr
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -53,7 +53,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
SCH_SHEET_LIST sheetList;
if( aPlotAll )
sheetList.BuildSheetList( g_RootSheet );
sheetList.BuildSheetList( g_RootSheet, false );
else
sheetList.push_back( m_parent->GetCurrentSheet() );
+2 -2
View File
@@ -4,7 +4,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2016 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -51,7 +51,7 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
SCH_SHEET_LIST sheetList;
if( aPlotAll )
sheetList.BuildSheetList( g_RootSheet );
sheetList.BuildSheetList( g_RootSheet, false );
else
sheetList.push_back( m_parent->GetCurrentSheet() );
+3 -3
View File
@@ -2,8 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2021 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
@@ -48,7 +48,7 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
SCH_SHEET_LIST sheetList;
if( aPrintAll )
sheetList.BuildSheetList( g_RootSheet );
sheetList.BuildSheetList( g_RootSheet, false );
else
sheetList.push_back( m_parent->GetCurrentSheet() );
+2
View File
@@ -139,8 +139,10 @@ void SCH_BASE_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent )
{
auto new_type = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
#ifndef __WXMAC__
if( aEvent.GetId() == ID_MENU_CANVAS_CAIRO )
new_type = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
#endif
if( m_canvasType == new_type )
return;
+5
View File
@@ -922,6 +922,11 @@ wxString SCH_COMPONENT::GetFieldText( const wxString& aFieldName, SCH_EDIT_FRAME
{
if( aFieldName == m_Fields[ii].GetName() )
return m_Fields[ii].GetText();
if( ii < MANDATORY_FIELDS && aFieldName == TEMPLATE_FIELDNAME::GetCanonicalFieldName( ii ) )
{
return m_Fields[ii].GetText();
}
}
return wxEmptyString;
+8 -6
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -507,7 +507,7 @@ void SCH_EDIT_FRAME::SetSheetNumberAndCount()
int sheet_count = g_RootSheet->CountSheets();
int SheetNumber = 1;
wxString current_sheetpath = m_CurrentSheet->Path();
SCH_SHEET_LIST sheetList( g_RootSheet );
SCH_SHEET_LIST sheetList( g_RootSheet, false );
// Examine all sheets path to find the current sheets path,
// and count them from root to the current sheet path:
@@ -642,7 +642,8 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
{
if( Kiface().IsSingle() )
{
LIB_EDIT_FRAME* libeditFrame = (LIB_EDIT_FRAME*) Kiway().Player( FRAME_SCH_LIB_EDITOR, false );
LIB_EDIT_FRAME* libeditFrame = (LIB_EDIT_FRAME*) Kiway().Player( FRAME_SCH_LIB_EDITOR,
false );
if( libeditFrame && !libeditFrame->Close() ) // Can close component editor?
return;
@@ -661,7 +662,7 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
if( simFrame && !simFrame->Close() ) // Can close the simulator?
return;
SCH_SHEET_LIST sheetList( g_RootSheet );
SCH_SHEET_LIST sheetList( g_RootSheet, false );
if( sheetList.IsModified() )
{
@@ -1377,7 +1378,6 @@ void SCH_EDIT_FRAME::addCurrentItemToScreen()
undoItem = parentSheet;
}
else if( item->Type() == SCH_FIELD_T )
{
parentComponent = (SCH_COMPONENT*) item->GetParent();
@@ -1394,7 +1394,7 @@ void SCH_EDIT_FRAME::addCurrentItemToScreen()
// for all new sheet paths added by the new sheet (if this sheet is loaded from
// and existing sheet or a existing file, it can also contain subsheets)
bool doClearAnnotation = false;
SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
SCH_SHEET_LIST initial_sheetpathList( g_RootSheet, false );
if( item->Type() == SCH_SHEET_T )
{
@@ -1506,7 +1506,9 @@ void SCH_EDIT_FRAME::UpdateTitle()
title += _( " [Read Only]" );
}
else
{
title += _( " [no file]" );
}
}
SetTitle( title );
+6 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 CERN
* Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Wayne Stambaugh <stambaughw@gmail.com>
*
@@ -1112,9 +1112,13 @@ SCH_BITMAP* SCH_LEGACY_PLUGIN::loadBitmap( FILE_LINE_READER& aReader )
// Read PNG data, stored in hexadecimal,
// each byte = 2 hexadecimal digits and a space between 2 bytes
// and put it in memory stream buffer
// Note:
// Some old files created by the V4 schematic versions have a extra
// "$EndBitmap" at the end of the hexadecimal data. (Probably due to
// a bug). So discard it
int len = strlen( line );
for( ; len > 0 && !isspace( *line ); len -= 3, line += 3 )
for( ; len > 0 && !isspace( *line ) && '$' != *line; len -= 3, line += 3 )
{
int value = 0;
+22 -16
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -180,7 +180,6 @@ void SCH_SHEET_PATH::UpdateAllScreenReferences()
}
void SCH_SHEET_PATH::GetComponents( SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols,
bool aForceIncludeOrphanComponents )
{
@@ -423,15 +422,12 @@ SCH_SHEET* SCH_SHEET_PATH::FindSheetByName( const wxString& aSheetName )
}
/********************************************************************/
/* Class SCH_SHEET_LIST to handle the list of Sheets in a hierarchy */
/********************************************************************/
SCH_SHEET_LIST::SCH_SHEET_LIST( SCH_SHEET* aSheet )
SCH_SHEET_LIST::SCH_SHEET_LIST( SCH_SHEET* aSheet, bool aCheckIntegrity )
{
m_isRootSheet = false;
if( aSheet != NULL )
BuildSheetList( aSheet );
BuildSheetList( aSheet, aCheckIntegrity );
}
@@ -451,7 +447,7 @@ SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheetByPath( const wxString& aPath, bool aHum
}
void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet, bool aCheckIntegrity )
{
wxCHECK_RET( aSheet != NULL, wxT( "Cannot build sheet list from undefined sheet." ) );
@@ -480,21 +476,30 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
{
SCH_SHEET* sheet = (SCH_SHEET*) item;
if( !m_currentSheetPath.TestForRecursion(
sheet->GetFileName(), aSheet->GetFileName() ) )
BuildSheetList( sheet );
if( aCheckIntegrity )
{
if( !m_currentSheetPath.TestForRecursion( sheet->GetFileName(),
aSheet->GetFileName() ) )
BuildSheetList( sheet, true );
else
badSheets.push_back( sheet );
}
else
badSheets.push_back( sheet );
{
BuildSheetList( sheet, false );
}
}
item = item->Next();
}
for( auto sheet : badSheets )
if( aCheckIntegrity )
{
aSheet->GetScreen()->Remove( sheet );
aSheet->GetScreen()->SetModify();
for( auto sheet : badSheets )
{
aSheet->GetScreen()->Remove( sheet );
aSheet->GetScreen()->SetModify();
}
}
}
@@ -609,6 +614,7 @@ void SCH_SHEET_LIST::GetComponents( SCH_REFERENCE_LIST& aReferences, bool aInclu
(*it).GetComponents( aReferences, aIncludePowerSymbols, aForceIncludeOrphanComponents );
}
void SCH_SHEET_LIST::GetMultiUnitComponents( SCH_MULTI_UNIT_REFERENCE_MAP &aRefList,
bool aIncludePowerSymbols )
{
+9 -8
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -330,12 +330,11 @@ private:
public:
/**
* Constructor
* build a flattened list of SCH_SHEET_PATH objects from \a aSheet.
* Build a flattened list of SCH_SHEET_PATH objects from \a aSheet.
*
* If aSheet == NULL, then this is an empty hierarchy which the user can populate.
* If aSheet == NULL, then this is the full hierarchy built from the root sheet.
*/
SCH_SHEET_LIST( SCH_SHEET* aSheet = NULL );
SCH_SHEET_LIST( SCH_SHEET* aSheet = nullptr, bool aCheckIntegrity = true );
~SCH_SHEET_LIST() {}
@@ -470,15 +469,17 @@ public:
SCH_SHEET* FindSheetByName( const wxString& aSheetName );
/**
* Function BuildSheetList
* builds the list of sheets and their sheet path from \a aSheet.
* Build the list of sheets and their sheet path from \a aSheet.
*
* If \a aSheet is the root sheet, the full sheet path and sheet list are built.
*
* @param aSheet is the starting sheet from which the list is built, or NULL
* indicating that g_RootSheet should be used.
* @param aIntegrityCheck set to true to test for sheet recursion while building the
* hierarchy.
* @throw std::bad_alloc if the memory for the sheet path list could not be allocated.
*/
void BuildSheetList( SCH_SHEET* aSheet );
void BuildSheetList( SCH_SHEET* aSheet, bool aCheckIntegrity );
};
#endif // CLASS_DRAWSHEET_PATH_H
+10 -6
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 CERN
* Copyright (C) 2016-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@@ -44,6 +44,7 @@
#include "spice_reporter.h"
#include <menus_helpers.h>
#include <dialog_shim.h>
SIM_PLOT_TYPE operator|( SIM_PLOT_TYPE aFirst, SIM_PLOT_TYPE aSecond )
{
@@ -1134,7 +1135,7 @@ void SIM_PLOT_FRAME::onTune( wxCommandEvent& event )
void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event )
{
class NETLIST_VIEW_DIALOG : public wxDialog
class NETLIST_VIEW_DIALOG : public DIALOG_SHIM
{
public:
enum
@@ -1147,12 +1148,13 @@ void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event )
EndModal( GetReturnCode() );
}
NETLIST_VIEW_DIALOG(wxWindow* parent, wxString source) :
wxDialog(parent, wxID_ANY, "SPICE Netlist",
wxDefaultPosition, wxSize(1500,900),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
NETLIST_VIEW_DIALOG( wxWindow* parent, wxString source ) :
DIALOG_SHIM( parent, wxID_ANY, "SPICE Netlist",
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
wxStyledTextCtrl* text = new wxStyledTextCtrl( this, wxID_ANY );
text->SetMinSize( wxSize( 600, 400 ) );
text->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
text->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) );
@@ -1172,6 +1174,8 @@ void SIM_PLOT_FRAME::onShowNetlist( wxCommandEvent& event )
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ), NULL,
this );
FinishDialogSettings();
}
};
+7 -1
View File
@@ -2,6 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@@ -522,7 +524,11 @@ bool SIM_PLOT_PANEL::AddTrace( const wxString& aName, int aPoints,
else
{
for( int i = 0; i < aPoints; i++ )
tmp[i] = 20 * log( tmp[i] ) / log( 10.0 ); // convert to dB
{
// log( 0 ) is not valid.
if( tmp[i] != 0.0 )
tmp[i] = 20 * log( tmp[i] ) / log( 10.0 ); // convert to dB
}
}
}
+33
View File
@@ -31,6 +31,36 @@
using namespace TFIELD_T;
const wxString TEMPLATE_FIELDNAME::GetCanonicalFieldName( int aFieldNdx )
{
// Fixed values for the first few default fields used by EESCHEMA
// (mandatory fields)
switch( aFieldNdx )
{
case REFERENCE:
return wxT( "Reference" ); // The component reference, R1, C1, etc.
case VALUE:
return wxT( "Value" ); // The component value + name
case FOOTPRINT:
return wxT( "Footprint" ); // The footprint for use with Pcbnew
case DATASHEET:
return wxT( "Datasheet" ); // Link to a datasheet for component
default:
break;
}
// Other fields are use fields, give a default name:
wxString fieldName = wxT( "Field" );
fieldName << aFieldNdx;
return fieldName;
}
const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx )
{
static void* locale = nullptr;
@@ -52,6 +82,8 @@ const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx )
locale = Pgm().GetLocale();
}
// Fixed values for the first few default fields used by EESCHEMA
// Fixed values for the first few default fields used by EESCHEMA
// (mandatory fields)
switch( aFieldNdx )
@@ -78,6 +110,7 @@ const wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx )
return fieldName;
}
void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const
{
out->Print( nestLevel, "(field (name %s)", out->Quotew( m_Name ).c_str() );
+8
View File
@@ -122,6 +122,14 @@ struct TEMPLATE_FIELDNAME
* @param aFieldNdx The field number index, > 0
*/
static const wxString GetDefaultFieldName( int aFieldNdx );
/**
* returns a not translated default symbol field name for field \a aFieldNdx
* for all components.
* These fieldnames are not modifiable, but template fieldnames are.
* @param aFieldNdx The field number index, > 0
*/
static const wxString GetCanonicalFieldName( int aFieldNdx );
};
typedef std::vector< TEMPLATE_FIELDNAME > TEMPLATE_FIELDNAMES;
+1 -1
View File
@@ -102,7 +102,7 @@ if( APPLE )
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE gerbview.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad )
set( MACOSX_BUNDLE_NAME gerbview )
endif()
+4 -5
View File
@@ -155,11 +155,10 @@ public: EXCELLON_IMAGE( int layer ) :
~EXCELLON_IMAGE() {};
virtual void ResetDefaultValues() override
{
GERBER_FILE_IMAGE::ResetDefaultValues();
SelectUnits( false );
}
/**
* Set all parameters to a default value, before reading a file
*/
virtual void ResetDefaultValues() override;
/**
+24 -7
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2016 Jean-Pierre Charras <jp.charras at wanadoo.fr>
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -300,6 +300,19 @@ bool GERBVIEW_FRAME::Read_EXCELLON_File( const wxString& aFullFileName )
return success;
}
void EXCELLON_IMAGE::ResetDefaultValues()
{
GERBER_FILE_IMAGE::ResetDefaultValues();
SelectUnits( false ); // Default unit = inch
// Files using non decimal can use No Trailing zeros or No leading Zeros
// Unfortunately, the identifier (INCH,TZ or INCH,LZ for instance) is not
// always set in drill files.
// The option leading zeros looks like more frequent, so use this default
m_NoTrailingZeros = true;
}
/*
* Read a EXCELLON file.
* Gerber classes are used because there is likeness between Gerber files
@@ -312,7 +325,6 @@ bool GERBVIEW_FRAME::Read_EXCELLON_File( const wxString& aFullFileName )
* integer 2.4 format in imperial units,
* integer 3.2 or 3.3 format (metric units).
*/
bool EXCELLON_IMAGE::LoadFile( const wxString & aFullFileName )
{
// Set the default parmeter values:
@@ -373,7 +385,8 @@ bool EXCELLON_IMAGE::LoadFile( const wxString & aFullFileName )
}
break;
case 'T': // Tool command
case 'T': // Select Tool command (can also create
// the tool with an embedded definition)
Select_Tool( text );
break;
@@ -479,8 +492,7 @@ bool EXCELLON_IMAGE::Execute_HEADER_And_M_Command( char*& text )
if( *text != ',' )
{
// No TZ or LZ specified. Should be a decimal format
// but this is not always the case. Use default TZ setting as default
m_NoTrailingZeros = false;
// but this is not always the case. Use our default setting
break;
}
@@ -724,15 +736,20 @@ bool EXCELLON_IMAGE::Select_Tool( char*& text )
dcode_id = TOOLS_MAX_COUNT - 1;
m_Current_Tool = dcode_id;
D_CODE* currDcode = GetDCODEOrCreate( dcode_id, true );
D_CODE* currDcode = GetDCODE( dcode_id );
if( currDcode == NULL && tool_id > 0 ) // if the definition is embedded, enter it
// if nopt existing, and the definition is embedded, create it
if( currDcode == NULL && tool_id > 0 )
{
text = startline; // text starts at the beginning of the command
readToolInformation( text );
currDcode = GetDCODE( dcode_id );
}
// If the Tool is really not existing, create a dummy tool
if( !currDcode )
currDcode = GetDCODEOrCreate( dcode_id, true );
if( currDcode )
currDcode->m_InUse = true;
}
+31 -14
View File
@@ -371,10 +371,21 @@ const EDA_RECT GERBER_DRAW_ITEM::GetBoundingBox() const
{
if( code && code->m_Shape == APT_RECT )
{
if( m_Polygon.OutlineCount() > 0 )
if( m_Polygon.OutlineCount() == 0 )
{
auto bb = m_Polygon.BBox();
bbox.Inflate( bb.GetWidth() / 2, bb.GetHeight() / 2 );
// We cannot initialize m_Polygon, because we are in a const function.
// So use a temporary polygon
SHAPE_POLY_SET poly_shape;
ConvertSegmentToPolygon( &poly_shape );
BOX2I bb = poly_shape.BBox();
bbox.SetSize( bb.GetWidth(), bb.GetHeight() );
bbox.SetOrigin( bb.GetOrigin().x, bb.GetOrigin().y );
}
else
{
BOX2I bb = m_Polygon.BBox();
bbox.SetSize( bb.GetWidth(), bb.GetHeight() );
bbox.SetOrigin( bb.GetOrigin().x, bb.GetOrigin().y );
}
}
@@ -593,10 +604,10 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDra
}
void GERBER_DRAW_ITEM::ConvertSegmentToPolygon()
void GERBER_DRAW_ITEM::ConvertSegmentToPolygon( SHAPE_POLY_SET* aPolygon ) const
{
m_Polygon.RemoveAllContours();
m_Polygon.NewOutline();
aPolygon->RemoveAllContours();
aPolygon->NewOutline();
wxPoint start = m_Start;
wxPoint end = m_End;
@@ -626,31 +637,31 @@ void GERBER_DRAW_ITEM::ConvertSegmentToPolygon()
corner.x -= m_Size.x/2;
corner.y -= m_Size.y/2;
wxPoint close = corner;
m_Polygon.Append( VECTOR2I( corner ) ); // Lower left corner, start point (1)
aPolygon->Append( VECTOR2I( corner ) ); // Lower left corner, start point (1)
corner.y += m_Size.y;
m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, start point (2)
aPolygon->Append( VECTOR2I( corner ) ); // upper left corner, start point (2)
if( delta.x || delta.y)
{
corner += delta;
m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, end point (3)
aPolygon->Append( VECTOR2I( corner ) ); // upper left corner, end point (3)
}
corner.x += m_Size.x;
m_Polygon.Append( VECTOR2I( corner ) ); // upper right corner, end point (4)
aPolygon->Append( VECTOR2I( corner ) ); // upper right corner, end point (4)
corner.y -= m_Size.y;
m_Polygon.Append( VECTOR2I( corner ) ); // lower right corner, end point (5)
aPolygon->Append( VECTOR2I( corner ) ); // lower right corner, end point (5)
if( delta.x || delta.y )
{
corner -= delta;
m_Polygon.Append( VECTOR2I( corner ) ); // lower left corner, start point (6)
aPolygon->Append( VECTOR2I( corner ) ); // lower left corner, start point (6)
}
m_Polygon.Append( VECTOR2I( close ) ); // close the shape
aPolygon->Append( VECTOR2I( close ) ); // close the shape
// Create final polygon:
for( auto it = m_Polygon.Iterate( 0 ); it; ++it )
for( auto it = aPolygon->Iterate( 0 ); it; ++it )
{
if( change )
( *it ).y = -( *it ).y;
@@ -660,6 +671,12 @@ void GERBER_DRAW_ITEM::ConvertSegmentToPolygon()
}
void GERBER_DRAW_ITEM::ConvertSegmentToPolygon()
{
ConvertSegmentToPolygon( &m_Polygon );
}
void GERBER_DRAW_ITEM::DrawGbrPoly( EDA_RECT* aClipBox,
wxDC* aDC,
COLOR4D aColor,
+5 -2
View File
@@ -245,8 +245,11 @@ public:
* convert a line to an equivalent polygon.
* Useful when a line is plotted using a rectangular pen.
* In this case, the usual segment plot function cannot be used
*/
void ConvertSegmentToPolygon();
* @param aPolygon is the SHAPE_POLY_SET to fill. If null (usual case),
* m_Polygon will be used
*/
void ConvertSegmentToPolygon();
void ConvertSegmentToPolygon( SHAPE_POLY_SET* aPolygon ) const;
/**
* Function DrawGbrPoly
+3
View File
@@ -267,6 +267,9 @@ public:
*/
int GetDcodesCount();
/**
* Set all parameters to a default value, before reading a file
*/
virtual void ResetDefaultValues();
COLOR4D GetPositiveDrawColor() const { return m_PositiveDrawColor; }
+2
View File
@@ -323,10 +323,12 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
_( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
#ifndef __WXMAC__
text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), GerbviewHotkeysDescr, HK_CANVAS_CAIRO );
AddMenuItem( configMenu, ID_MENU_CANVAS_CAIRO, text,
_( "Use Modern Toolset with software graphics (fall-back)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
#endif
configMenu->AppendSeparator();
+32
View File
@@ -0,0 +1,32 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LAUNCH_EXT_H
#define LAUNCH_EXT_H
class wxString;
/**
* Launches the given file or folder in the host OS
* @param aPath is a path to a file or folder
*/
void LaunchExternal( const wxString& aPath );
#endif
+8
View File
@@ -6,6 +6,7 @@
#define __MD5_HASH_H
#include <cstdint>
#include <string>
class MD5_HASH
{
@@ -29,6 +30,13 @@ public:
bool operator==( const MD5_HASH& aOther ) const;
bool operator!=( const MD5_HASH& aOther ) const;
/** @return a hexadecimal string from the 16 bytes of MD5_HASH
* Mainly for debug purposes.
* @param aCompactForm = false to generate a string with spaces between each byte (2 chars)
* = true to generate a string filled with 32 hexadecimal chars
*/
std::string Format( bool aCompactForm = false );
private:
struct MD5_CTX {
uint8_t data[64];
+1 -12
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 CERN
* Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@@ -70,17 +70,6 @@ public:
wxString FilenameWithRelativePathInSearchList(
const wxString& aFullFilename, const wxString& aBaseDir );
wxString FindValidPath( const wxString& aFileName ) const
{
#if 1 // might not be needed
if( wxFileName::FileExists( aFileName ) )
return aFileName;
else
#endif
return wxPathList::FindValidPath( aFileName );
}
/**
* Function AddPaths
* insert or append path(s)
+1 -1
View File
@@ -45,7 +45,7 @@ if( APPLE )
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE kicad.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad )
set( MACOSX_BUNDLE_NAME kicad )
endif()
+2 -15
View File
@@ -40,6 +40,7 @@
#include <build_version.h>
#include <dialog_configure_paths.h>
#include <dialog_edit_library_tables.h>
#include <launch_ext.h>
#include "pgm_kicad.h"
#include "tree_project_frame.h"
@@ -536,21 +537,7 @@ void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnBrowseInFileExplorer( wxCommandEvent& event )
{
// open project directory in host OS's file explorer
wxString project_dir = Prj().GetProjectPath();
#ifdef __WXMAC__
wxString msg;
// Quote in case there are spaces in the path.
msg.Printf( "open \"%s\"", project_dir );
system( msg.c_str() );
#else
// Quote in case there are spaces in the path.
AddDelimiterString( project_dir );
wxLaunchDefaultApplication( project_dir );
#endif
LaunchExternal( Prj().GetProjectPath() );
}
+7 -3
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Brian Sidebotham <brian.sidebotham@gmail.com>
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -29,6 +29,8 @@
#include <wx/wfstream.h>
#include <wx/log.h>
#include <wildcards_and_files_ext.h>
#include "project_template.h"
@@ -183,8 +185,10 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr
// Do not rename project specific symbol libraries. This will break the symbol library
// table which will cause broken symbol library links in the schematic.
if( !( destination.GetExt() == "dcm"
|| ( destination.GetExt() == "lib" && !destination.GetName().EndsWith( "-cache" ) ) ) )
if( !( destination.GetExt() == PageLayoutDescrFileExtension )
&& !( destination.GetExt() == "dcm"
|| ( destination.GetExt() == "lib"
&& !destination.GetName().EndsWith( "-cache" ) ) ) )
currname.Replace( basename, aNewProjectPath.GetName() );
destination.SetName( currname );
+1 -1
View File
@@ -1083,7 +1083,7 @@ void TREE_PROJECT_FRAME::FileWatcherReset()
}
else
{
m_Parent->SetStatusText( _( "" ), 0 );
m_Parent->SetStatusText( wxT( "" ), 0 );
}
#endif
+1 -1
View File
@@ -64,7 +64,7 @@ if( APPLE )
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE pl_editor.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad )
set( MACOSX_BUNDLE_NAME pl_editor )
endif()
+1 -1
View File
@@ -50,7 +50,7 @@ if( APPLE )
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE pcb_calculator.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad )
set( MACOSX_BUNDLE_NAME pcb_calculator )
endif()
+1 -1
View File
@@ -592,7 +592,7 @@ if( APPLE )
MACOSX_PACKAGE_LOCATION Resources
)
set( MACOSX_BUNDLE_ICON_FILE pcbnew.icns )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad )
set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad.kicad )
set( MACOSX_BUNDLE_NAME pcbnew )
endif()
+4 -1
View File
@@ -377,7 +377,7 @@ public:
wxString oldPath = aConfig->GetPath();
NETCLASSES::const_iterator nc = m_Pt_param->begin();
for( int index = 0; index <= m_Pt_param->GetCount(); ++index )
for( size_t index = 0; index <= m_Pt_param->GetCount(); ++index )
{
wxString path = "";
NETCLASSPTR netclass;
@@ -495,6 +495,8 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_MicroViasMinSize = Millimeter2iu( DEFAULT_MICROVIASMINSIZE );
m_MicroViasMinDrill = Millimeter2iu( DEFAULT_MICROVIASMINDRILL );
m_HoleToHoleMin = Millimeter2iu( DEFAULT_HOLETOHOLEMIN );
// Global mask margins:
m_SolderMaskMargin = Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE );
m_SolderMaskMinWidth = Millimeter2iu( DEFAULT_SOLDERMASK_MIN_WIDTH );
@@ -502,6 +504,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_SolderPasteMarginRatio = 0.0; // Solder paste margin as a ratio of pad size
// The final margin is the sum of these 2 values
// Usually < 0 because the mask is smaller than pad
// Layer thickness for 3D viewer
m_boardThickness = Millimeter2iu( DEFAULT_BOARD_THICKNESS_MM );
+12 -11
View File
@@ -4,7 +4,7 @@
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@@ -460,7 +460,9 @@ EDA_RECT MODULE::GetFootprintRect() const
area.SetOrigin( m_Pos );
area.SetEnd( m_Pos );
area.Inflate( Millimeter2iu( 0.25 ) ); // Give a min size to the area
// Give a minimum size to the area in case footprint has no drawing or pad objects.
area.Inflate( Millimeter2iu( 0.5 ) );
for( const BOARD_ITEM* item = m_Drawings.GetFirst(); item; item = item->Next() )
{
@@ -479,13 +481,6 @@ const EDA_RECT MODULE::GetBoundingBox() const
{
EDA_RECT area = GetFootprintRect();
// Add in items not collected by GetFootprintRect():
for( const BOARD_ITEM* item = m_Drawings.GetFirst(); item; item = item->Next() )
{
if( item->Type() != PCB_MODULE_EDGE_T )
area.Merge( item->GetBoundingBox() );
}
area.Merge( m_Value->GetBoundingBox() );
area.Merge( m_Reference->GetBoundingBox() );
@@ -529,6 +524,7 @@ SHAPE_POLY_SET MODULE::GetBoundingPoly() const
poly.Append( p );
BOARD* board = GetBoard();
if( board )
{
int biggest_clearance = board->GetDesignSettings().GetBiggestClearanceValue();
@@ -650,13 +646,20 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co
arect.Inflate( aAccuracy );
if( aContained )
{
return arect.Contains( m_BoundaryBox );
}
else
{
// If the rect does not intersect the bounding box, skip any tests
if( !aRect.Intersects( GetBoundingBox() ) )
return false;
// If there are no drawing objects, there was still an intersection with the reference
// and/or value text.
if( m_Pads.GetCount() == 0 && m_Drawings.GetCount() == 0 )
return true;
// Determine if any elements in the MODULE intersect the rect
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
{
@@ -783,8 +786,6 @@ void MODULE::Add3DModel( MODULE_3D_SETTINGS* a3DModel )
if( !a3DModel->m_Filename.empty() )
m_3D_Drawings.push_back( *a3DModel );
delete a3DModel;
}
+3 -3
View File
@@ -481,15 +481,15 @@ void D_PAD::FlipPrimitives()
}
void D_PAD::MirrorXPrimitives( int aX )
void D_PAD::MirrorXPrimitives()
{
// Mirror custom shapes
for( unsigned ii = 0; ii < m_basicShapes.size(); ++ii )
{
PAD_CS_PRIMITIVE& primitive = m_basicShapes[ii];
MIRROR( primitive.m_Start.x, aX );
MIRROR( primitive.m_End.x, aX );
MIRROR( primitive.m_Start.x, 0 );
MIRROR( primitive.m_End.x, 0 );
primitive.m_ArcAngle = -primitive.m_ArcAngle;
switch( primitive.m_Shape )
+3 -4
View File
@@ -336,11 +336,10 @@ public:
void FlipPrimitives();
/**
* Mirror the primitives about a coordinate
*
* @param aX the x coordinate about which to mirror
* Mirror the primitives around the vertical axis. Primitive coordinates are
* relative to the pad, and are not absolute
*/
void MirrorXPrimitives( int aX );
void MirrorXPrimitives();
/**
* Import to the basic shape list
+5
View File
@@ -1307,6 +1307,11 @@ bool ZONE_CONTAINER::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly ) const
aSmoothedPoly = m_Poly->Fillet( m_cornerRadius, ARC_HIGH_DEF );
else
aSmoothedPoly = m_Poly->Fillet( m_cornerRadius, ARC_LOW_DEF );
// In some cases the resulting polygon is strange... due to some bug in Fillet()
// that happens in (rare) polygon shapes. So clip it with the
// initial polygon (in all cases aSmoothedPoly must be contained by m_Poly)
aSmoothedPoly.BooleanIntersection( *m_Poly, SHAPE_POLY_SET::PM_FAST );
break;
default:
+17 -3
View File
@@ -315,11 +315,25 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
break;
}
if( m_tolerance->GetSelection() != 1 )
double tolerance = 0.01; // default value in mm
switch( m_tolerance->GetSelection() )
{
case 0: // small
tolerance = 0.001;
break;
default:
case 1: break; // Normal
case 2: // large
tolerance = 0.1;
break;
}
{
LOCALE_IO dummy;
double tolerance = 0.001 * std::pow<double>( 10.0, m_tolerance->GetSelection() - 1 );
cmdK2S.Append( wxString::Format( " --min-distance=\"%.4f mm\"", tolerance ) );
cmdK2S.Append( wxString::Format( " --min-distance=\"%.3f mm\"", tolerance ) );
}
cmdK2S.Append( " -f -o " );
+3 -3
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jan 17 2019)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -163,11 +163,11 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
m_staticText8->Wrap( -1 );
fgSizer4->Add( m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxString m_toleranceChoices[] = { _("Tight"), _("Standard"), _("Loose"), _("Very loose") };
wxString m_toleranceChoices[] = { _("Tight (0.001 mm)"), _("Standard (0.01 mm)"), _("Loose (0.1 mm)") };
int m_toleranceNChoices = sizeof( m_toleranceChoices ) / sizeof( wxString );
m_tolerance = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_toleranceNChoices, m_toleranceChoices, 0 );
m_tolerance->SetSelection( 1 );
m_tolerance->SetToolTip( _("Tolerance sets the distance between two points that are considered joined. Standard is 0.001mm.") );
m_tolerance->SetToolTip( _("Tolerance sets the distance between two points that are considered joined.") );
fgSizer4->Add( m_tolerance, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+2 -2
View File
@@ -1353,7 +1353,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Tight&quot; &quot;Standard&quot; &quot;Loose&quot; &quot;Very loose&quot;</property>
<property name="choices">&quot;Tight (0.001 mm)&quot; &quot;Standard (0.01 mm)&quot; &quot;Loose (0.1 mm)&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@@ -1389,7 +1389,7 @@
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Tolerance sets the distance between two points that are considered joined. Standard is 0.001mm.</property>
<property name="tooltip">Tolerance sets the distance between two points that are considered joined.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
+1 -1
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jan 17 2019)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
+2
View File
@@ -296,6 +296,8 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool aTestPads, bool aTestZ
err = false;
else if( layer1 == F_Cu && layer2 == In1_Cu )
err = false;
else if( static_cast<int>( layer2 ) - static_cast<int>( layer1 ) == 1 )
err = false;
if( err )
{
+2 -2
View File
@@ -250,7 +250,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName,
plotter->Marker( wxPoint( x, y ), plot_diam, ii );
// List the diameter of each drill in mm and inches.
sprintf( line, "%2.2fmm / %2.3f\" ",
sprintf( line, "%3.3fmm / %2.4f\" ",
diameter_in_mm( tool.m_Diameter ),
diameter_in_inches( tool.m_Diameter ) );
@@ -440,7 +440,7 @@ unsigned GENDRILL_WRITER_BASE::printToolSummary( OUTPUTFORMATTER& out, bool aSum
// List the tool number assigned to each drill,
// in mm then in inches.
int tool_number = ii+1;
out.Print( 0, " T%d %2.2fmm %2.3f\" ", tool_number,
out.Print( 0, " T%d %2.3fmm %2.4f\" ", tool_number,
diameter_in_mm( tool.m_Diameter ),
diameter_in_inches( tool.m_Diameter ) );
+1 -1
View File
@@ -217,7 +217,7 @@ bool GITHUB_GETLIBLIST::remoteGetJSON( const std::string& aFullURLCommand, wxStr
wxLogDebug( wxT( "Attempting to download: " ) + aFullURLCommand );
kcurl.SetURL( aFullURLCommand );
kcurl.SetUserAgent( "http://kicad-pcb.org" );
kcurl.SetUserAgent( "https://www.kicad.org" );
kcurl.SetHeader( "Accept", m_option_string );
kcurl.SetFollowRedirects( true );
+1 -1
View File
@@ -582,7 +582,7 @@ void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL )
KICAD_CURL_EASY kcurl; // this can THROW_IO_ERROR
kcurl.SetURL( zip_url.c_str() );
kcurl.SetUserAgent( "http://kicad-pcb.org" );
kcurl.SetUserAgent( "https://www.kicad.org" );
kcurl.SetHeader( "Accept", "application/zip" );
kcurl.SetFollowRedirects( true );
+25 -7
View File
@@ -161,7 +161,7 @@ bool DXF_IMPORT_PLUGIN::ImportDxfFile( const wxString& aFile )
}
void DXF_IMPORT_PLUGIN::reportMsg( const char* aMessage )
void DXF_IMPORT_PLUGIN::reportMsg( const wxString& aMessage )
{
// Add message to keep trace of not handled dxf entities
m_messages += aMessage;
@@ -1050,8 +1050,6 @@ void DXF_IMPORT_PLUGIN::insertSpline( int aWidth )
}
}
#else // Use bezier curves, supported by pcbnew, to approximate the spline
tinyspline::BSpline dxfspline( m_curr_entity.m_SplineControlPointList.size(),
/* coord dim */ 2, m_curr_entity.m_SplineDegree );
std::vector<double> ctrlp;
for( unsigned ii = 0; ii < imax; ++ii )
@@ -1060,11 +1058,31 @@ void DXF_IMPORT_PLUGIN::insertSpline( int aWidth )
ctrlp.push_back( m_curr_entity.m_SplineControlPointList[ii].m_y );
}
dxfspline.setCtrlp( ctrlp );
dxfspline.setKnots( m_curr_entity.m_SplineKnotsList );
tinyspline::BSpline beziers( dxfspline.toBeziers() );
std::vector<double> coords;
try
{
tinyspline::BSpline dxfspline( m_curr_entity.m_SplineControlPointList.size(),
/* coord dim */ 2, m_curr_entity.m_SplineDegree );
std::vector<double> coords = beziers.ctrlp();
dxfspline.setCtrlp( ctrlp );
dxfspline.setKnots( m_curr_entity.m_SplineKnotsList );
tinyspline::BSpline beziers( dxfspline.toBeziers() );
coords = beziers.ctrlp();
}
catch( const std::runtime_error& ) //tinyspline throws everything including data validation as runtime errors
{
// invalid spline definition, drop this block
reportMsg( _( "Invalid spline definition encountered" ) );
return;
}
if( coords.size() % 8 != 0 )
{
// somehow we generated a bad Bezier curve
reportMsg( _( "Invalid Bezier curve created" ) );
return;
}
// Each Bezier curve uses 4 vertices (a start point, 2 control points and a end point).
// So we can have more than one Bezier curve ( there are one curve each four vertices)
+2 -2
View File
@@ -217,14 +217,14 @@ public:
/**
* @return the list of messages in one string. Each message ends by '\n'
*/
const std::string& GetMessages() const override
wxString GetMessages() const override
{
return m_messages;
}
private:
// report message to keep trace of not supported dxf entities:
void reportMsg( const char* aMessage );
void reportMsg( const wxString& aMessage );
// coordinate conversions from dxf file to mm
double mapX( double aDxfCoordX );
+1 -1
View File
@@ -118,7 +118,7 @@ public:
*
* @return the list of messages in one string. Each message ends by '\n'
*/
const virtual std::string& GetMessages() const = 0;
virtual wxString GetMessages() const = 0;
protected:
///> Importer used to create objects representing the imported shapes.
+1 -1
View File
@@ -83,7 +83,7 @@ public:
*
* @return the list of messages in one string. Each message ends by '\n'
*/
const std::string& GetMessages() const
wxString GetMessages() const
{
return m_plugin->GetMessages();
}
+2 -2
View File
@@ -52,7 +52,7 @@ public:
/**
* @return the list of messages in one string. Each message ends by '\n'
*/
const std::string& GetMessages() const override
wxString GetMessages() const override
{
return m_messages;
}
@@ -77,7 +77,7 @@ private:
struct NSVGimage* m_parsedImage;
std::string m_messages; // messages generated during svg file parsing.
wxString m_messages; // messages generated during svg file parsing.
// Each message ends by '\n'
};
+2
View File
@@ -446,10 +446,12 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
_( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
#ifndef __WXMAC__
text = AddHotkeyName( _( "Modern Toolset (&Fallback)" ), m_hotkeysDescrList, HK_CANVAS_CAIRO );
AddMenuItem( prefs_menu, ID_MENU_CANVAS_CAIRO, text,
_( "Use Modern Toolset with software graphics (fall-back)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
#endif
prefs_menu->AppendSeparator();
+2
View File
@@ -173,11 +173,13 @@ void preparePreferencesMenu( PCB_EDIT_FRAME* aFrame, wxMenu* aParentMenu )
_( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
#ifndef __WXMAC__
text = AddHotkeyName( _( "Modern Toolset (Fallbac&k)" ), g_Board_Editor_Hotkeys_Descr,
HK_CANVAS_CAIRO );
AddMenuItem( aParentMenu, ID_MENU_CANVAS_CAIRO, text,
_( "Use Modern Toolset with software graphics (fall-back)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
#endif
aParentMenu->AppendSeparator();
+15
View File
@@ -37,6 +37,7 @@
#include <class_track.h>
#include <class_marker_pcb.h>
#include <pcb_base_frame.h>
#include "footprint_edit_frame.h"
#include <confirm.h>
#include <gal/graphics_abstraction_layer.h>
@@ -439,6 +440,20 @@ BOX2I PCB_DRAW_PANEL_GAL::GetDefaultViewBBox() const
if( m_worksheet && m_view->IsLayerVisible( LAYER_WORKSHEET ) )
return m_worksheet->ViewBBox();
// The footprint editor frame has no worksheet, but the best default view box is the
// view box able to show the current footprint, even if some layers are not shown
if( m_edaFrame->IsType( FRAME_PCB_MODULE_EDITOR ) )
{
PCB_BASE_FRAME* fp_frame = static_cast<PCB_BASE_FRAME*>( m_edaFrame );
MODULE* footprint = fp_frame->GetBoard()->m_Modules;
if( footprint )
{
EDA_RECT bbox = footprint->GetBoundingBox();
return bbox;
}
}
return BOX2I();
}
+36 -1
View File
@@ -2,6 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2019 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@@ -383,7 +385,40 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
return false;
}
return true;
// Draw bounding boxes after drawing objects so they can be seen.
#if 0
// Show bounding boxes of painted objects for debugging.
EDA_RECT box = item->GetBoundingBox();
m_gal->SetIsFill( false );
m_gal->SetIsStroke( true );
if( item->Type() == PCB_MODULE_T )
m_gal->SetStrokeColor( item->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 ) :
COLOR4D( MAGENTA ) );
else
m_gal->SetStrokeColor( item->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 ) :
COLOR4D( 0.2, 0.2, 0.2, 1 ) );
m_gal->SetLineWidth( 1.5 / m_gal->GetWorldScale() );
m_gal->DrawRectangle( box.GetOrigin(), box.GetEnd() );
if( item->Type() == PCB_MODULE_T )
{
m_gal->SetStrokeColor( item->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 ) :
COLOR4D( CYAN ) );
const MODULE* fp = static_cast<const MODULE*>( item );
if( fp )
{
SHAPE_POLY_SET convex = fp->GetBoundingPoly();
m_gal->DrawPolyline( convex.COutline( 0 ) );
}
}
#endif
return true;
}
+5 -1
View File
@@ -2182,7 +2182,11 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
break;
case T_model:
module->Add3DModel( parse3DModel() );
{
MODULE_3D_SETTINGS* model = parse3DModel();
module->Add3DModel( model );
delete model;
}
break;
default:

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