Compare commits

..

68 Commits

Author SHA1 Message Date
jean-pierre charras 9f35e384c1 Pcbnew: fix a few plot issues (from master branch) 2017-08-01 12:39:06 +02:00
Chris Pavlina 6b1b6d4ff7 Add several missing libraries 2017-07-31 12:50:45 -04:00
jean-pierre charras be070d95be Fix issues in plot functions, when used from python scripts. 2017-07-25 10:12:08 +02:00
jean-pierre charras 17f7921311 kicad: create zip archive: test for write file error (crashes when the folder was not writable) 2017-07-24 18:07:29 +02:00
Wayne Stambaugh 631f6d53d3 Tag stable release 4.0.7 2017-07-14 15:17:29 -04:00
Wayne Stambaugh aba04c6ec5 Remove leading/trailing white space error message from field validator.
The illegal white space testing for reference and value (library editor
only) fields are adequate to ensure the user cannot enter invalid white
space characters.  Leading and/or trailing white space should not be an
issue for field storage in the schematic file as they are quoted.  Rather
than silently removing the leading and/or trailing white space which is
frowned upon, let the user fix it.

Fixes lp:1659526

https://bugs.launchpad.net/kicad/+bug/1659526
2017-07-14 13:43:27 -04:00
Maciej Suminski 133cb01f79 Fix crash when dragging a track
Fixes: lp:1657226
* https://bugs.launchpad.net/kicad/+bug/1657226
2017-07-13 10:54:12 +02:00
jean-pierre charras 464175e995 Fix possible crash and issues when a incorrect fp lib table is loaded:
correct lines are loaded, and pcbnew is no longer aborted.
2017-07-12 20:27:18 +02:00
jean-pierre charras c0fab4b350 Cvpcb: fix incorrect automatic assignments when using .equ files and the automatic association.
Fix from master branch.
2017-06-10 20:12:02 +02:00
jean-pierre charras 17c8198c05 Better error messages when throwing an io error or parse error.
Only the name of the .cpp file throwing the error instead of its full path is printed, like in master branch.
2017-06-04 11:15:45 +02:00
Cirilo Bernardo 683da9acd1 Fix default line widths for non-mm units in DXF import 2017-05-29 09:51:28 +02:00
jean-pierre charras 5a67fc99d3 Fixes: pl-editor doesn't save text thickness when it is not the default value (from master) 2017-05-29 08:00:38 +02:00
jean-pierre charras a7223a95b9 Fix style of gost page layouts in accordance with GOST (from master) 2017-05-29 07:57:16 +02:00
jean-pierre charras 58f90b3adb Eeschema bom scripts: move python scripts to eeschema/plugins/python_scripts and xsl scripts to subdir xsl_scripts.
Python scripts are now installed (previously: were ignored by the make install command)
Better comments in python scripts.
2017-05-15 16:40:21 +02:00
Eldar Khayrullin a374f46b5e Pcbnew: add option to plot DXF editable text
Add option to plot DXF oneline ASCII text as editable text (in non-outline mode)

Fixes: lp:1423515
* https://bugs.launchpad.net/kicad/+bug/1423515
2017-05-08 08:24:22 -04:00
Eldar Khayrullin bfacf02360 Pcbnew: add option to plot DXF lines in outline mode
Add option to plot dialog to plot DXF layers *.Cu, *.Adhes, *.Paste, and
*.Mask in outline mode or line mode.

Fixes lp:1643330

https://bugs.launchpad.net/kicad/+bug/1643330
2017-05-08 08:24:10 -04:00
Wayne Stambaugh 4e8a35cb84 Don't apply last line width to text thickness in symbol library editor.
The symbol library header was setting the text thickness using the
last line thickness setting which is incorrect so use the default
thickness when creating new text objects.

Fixes lp:1635344

https://bugs.launchpad.net/kicad/+bug/1635344
2017-05-04 16:31:02 -04:00
Wayne Stambaugh 6a9f38ecc4 Pcbnew: continue loading footprints after first failure.
The footprint library cache handler would throw an exception on the
first error it encountered preventing all subsequent footprint files
from being parsed even if there was nothing wrong with them.  This
commit queues errors until all of the footprint files in the folder
have been parsed.

Fixes lp:1416736

https://bugs.launchpad.net/kicad/+bug/1416736
2017-05-04 16:25:14 -04:00
jean-pierre charras 593136aca3 Remove some useless or incorrect wxASSERT in plot functions.
Fixes: lp:1685188 Crash on export SVG file with mirrored option
https://bugs.launchpad.net/kicad/+bug/1685188
2017-04-26 09:10:05 +02:00
jean-pierre charras 1754b42ba3 Dialog copper zones: fix a tooltip error 2017-04-22 10:17:59 +02:00
jean-pierre charras 3ae069ed4f Fixes: lp:1684998 (append a board in GAL mode can crashes Pcbnew)
https://bugs.launchpad.net/kicad/+bug/1684998

The crash is due to the fact updating nets and netclasses was made too late, after use.
2017-04-22 09:09:31 +02:00
Wayne Stambaugh fc527f3cc1 Fix zone properties dialog level setting tooltip.
Fix a spelling error and improve the clarity of the zone priority level
tooltip information.

Fixes lp:1681024

https://bugs.launchpad.net/kicad/+bug/1681024
2017-04-10 14:31:11 -04:00
hauptmech 7a5e632455 Prevent segfault when aOutline has no vertices.
When attempting to read a pcad file exported from Altium, kicad was
segfaulting because it was trying to access an empty array. This patch
fixes that.

The reason the array was empty was the the board outline in the pcad
file was composed of only arcs and the plugin only processes lines in
the board outline. Adding this functionality is for another patch I
suppose.

Signed-off-by: Clemens Koller <cko@embeon.de>
2017-04-03 10:46:57 -04:00
Chris Pavlina 82d7a4e61e Highlight the first choice in rescue dialog
Fixes: lp:1455970
* https://bugs.launchpad.net/kicad/+bug/1455970
2017-03-27 09:20:28 -04:00
Wayne Stambaugh 63569551a4 Fix broken links and add correct links to about dialog.
Fixes lp:1670582

https://bugs.launchpad.net/kicad/+bug/1670582
2017-03-08 08:28:15 -05:00
jean-pierre charras 3b7aa48d16 Pcbnew: fix bug: files written when layers have numeric name (like +24)cannot be read
Remove a printf clearly for debug, certainly a very old bug.
2017-02-27 08:12:07 +01:00
Wayne Stambaugh 249b0a0ce5 Reset KiCad version for 4.0.7 stable release development. 2017-02-26 11:30:35 -05:00
Wayne Stambaugh 3c6959b7de Tag stable release 4.0.6 2017-02-17 15:11:08 -05:00
Oliver e5307ca1fb Fix for bug where rotating / editing a selected item would remove it from screen
- Added test to see if there was a currently-editing item

Fixes: lp:1661866

https://bugs.launchpad.net/kicad/+bug/1661866
2017-02-07 09:30:11 -05:00
Wayne Stambaugh d1f8dbb9de Fix rotate bug in symbol library editor.
The rotate hotkey was rotating individual items when a block was selected
which is invalid behavior.  Add check for block mode and disable rotating
items when block mode is active.

Fixes: lp:1660875

https://bugs.launchpad.net/kicad/+bug/1660875
2017-02-01 15:10:07 -05:00
Chris Pavlina 99d7a35797 Reorder eeschema toolbar slightly
- Put the output generation steps (annotation through pcbnew) in the
  correct order as expected by the user running through them.

- Add a Plot button to match pcbnew
2017-01-31 16:08:57 -05:00
jean-pierre charras 0145a03f79 In SetActiveLayer(): fix a potential bug, as a GAL method was called in Legacy mode.
This is a fix from commit b66cb871e6 in master branch.
2017-01-31 11:11:03 +01:00
jean-pierre charras df191606ab Fix a potential incompatibility (due to an old bug) with files which could be created by some recent pcbnew versions
It is unusual to fix an incompatibility with later versions, but it is due to a bug existing in this version,
and this is especially important for footprint files.
2017-01-28 09:00:54 +01:00
Wayne Stambaugh 556be7b431 Do not use default board solder mask clearance in footprint editor.
The footprint editor was displaying the default solder mask clearance
defined by the temporary BOARD object created a start up.  Change the
temporary BOARD default solder mask to 0 so the pad or footprint solder
mask clearance setting is displayed when editing the footprint.

fixes lp:1653980

https://bugs.launchpad.net/kicad/+bug/1653980
2017-01-27 07:52:12 -05:00
Simon Richter e15ba3bf32 Add missing include directory
The common library uses CURL.
2017-01-27 07:38:23 -05:00
jean-pierre charras c23c52834c cleanup a comment 2017-01-24 17:53:33 +01:00
jean-pierre charras 981fddc649 Try to replace avhttp by Curl 2017-01-24 17:44:06 +01:00
jean-pierre charras 5127a6bd09 Fix an issue (from a patch of the master branch): slashes are not translated from \ in windows to / on unix
(see https://bugs.launchpad.net/kicad/+bug/16585)
2017-01-24 17:41:03 +01:00
Wayne Stambaugh 136ba26896 Reset KiCad version for 4.0.6 stable release development. 2017-01-24 10:26:54 -05:00
Wayne Stambaugh 575b22d018 Stable 4.0.5 release.
Set version string to "4.0.5" in KiCadVersion.cmake
Add .gitignore from master branch.
2016-12-02 10:49:09 -05:00
jean-pierre charras 5f01ca8f88 Fixes: lp:1645430 (CSV BOM generation using bom2csv.xsl script with custom entries has wrong format)
https://bugs.launchpad.net/kicad/+bug/1645430
2016-12-02 09:31:04 -05:00
Maciej Suminski 5a3c944b2a Fix crashes when BOARD members are changed and PNS is active
PNS has its own data model with pointers to the BOARD members. If the
tool is active and pointers become stale, pcbnew crashes.

Currently there is a workaround that deactivates the current tool when a
dialog opens. This is the way it is done in the legacy canvas as well.

Fixes: lp:1553804
* https://bugs.launchpad.net/kicad/+bug/1553804
2016-12-01 15:11:26 +01:00
Wayne Stambaugh 50a4b5553a Version string improvements.
Define empty string variable KICAD_BRANCH_NAME that can be used as an
optional version string element.  When git is used to build the version
string, this variable is set to the git branch name.  It can also be
defined at configuration time as an optional string appended to the
$KICAD_VERSION variable.

Define empty string variable KICAD_VERSION_EXTRA that can be set by
the user at configuration.

The variables KICAD_BRANCH_NAME and KICAD_VERSION_EXTRA are only
appended to KICAD_VERSION if they are set.  Otherwise, only KICAD_VERSION
is uses as the version string.

Update the developer building from source document to reflect the changes.
2016-11-28 09:15:04 -05:00
Chris Pavlina 4cb084cd63 Bring back KICAD_REPO_NAME 2016-11-24 13:03:35 -05:00
Chris Pavlina a458342cfc Fix KICAD_BUILD_VERSION build option 2016-11-24 13:03:34 -05:00
jean-pierre charras 8023c7a794 Pcbnew: fix outdated environment vars settings for Kicad python on Windows (from master branch):
On Windows, previously, Pcbnew try to set env vars PYTHONPATH, if <kicad>/bin/python27_us folder is found.
Now, if python.exe is found in kicad bin folder (therefore if our python executable and libs are
installed in Kicad), PYTHONPATH and PYTHONHOME are set to an empty string.
( the default python path work fine with our standard python install )
2016-11-14 08:35:12 +01:00
jean-pierre charras 65fe561a4b Fix from master branch: lp:1635723 (pcbnew: allows sometimes to draw tracks in non copper layers in Gal Mode) 2016-11-13 19:03:52 +01:00
Jean-Noel Avila 18f77b894e Fix off-by-one in saving bitmaps 2016-11-09 09:53:47 +01:00
jean-pierre charras 94a3390544 * Pcbnew: in fill zones calculations, make polygons strictly simple before fracturing them. 2016-11-06 19:50:38 +01:00
jean-pierre charras cec3e300a8 fix incorrect indentation which generates compil warnings 2016-11-06 19:42:10 +01:00
jean-pierre charras a262445047 Fixes: lp:1638499 (footprint editor, footprint transform: incorrect mirror for pads (noticeable only for pads with offset)
https://bugs.launchpad.net/kicad/+bug/1638499
2016-11-05 15:53:01 -04:00
Henner Zeller 0fbdec4c08 Pcbnew: prevent reversal of pad loading order when loading board.
When opening a board file and storing it again, the pads in all
embedded modules get reversed.  This is generally not really nice
if the PCB is managed by version control as it creates churn and
could make merges hard.
2016-10-17 10:17:37 -04:00
Wayne Stambaugh de52ae6c70 Allow the contents of KiCadVersion.cmake to override git version.
When the version string in KiCadVersion.cmake is set to something other
than the default "no-vcs-found", it ignores the git version even if a
.git folder exists in the source folder.
2016-10-14 14:41:36 -04:00
Wayne Stambaugh 9ca6405bcb Minor version string generation improvements.
Remove the KICAD_REPO_NAME option from the main cmake file and the
generated config.h file since it is no longer used.

Set the default branch name to "undefined" in CreateGitVersionHeader.cmake
instead of the KICAD_REPO_NAME option.

Remove generating KICAD_FULL_VERSION from CreateGitVersionHeader.cmake
and add it to WriteVersionHeader.cmake so that the default settings and
the new KiCadVersion.cmake definitions can be used to generate the full
version string as well.

Check to see if the branch name is set and only use the version to
generate the full version string.  This allows the use of the KiCad
version cmake file to create a version only string like "4.0.4" with
no trailing branch name.

Change build_version.cpp to use the full version string rather than
concatenating the version and branch strings.
2016-10-14 08:09:13 -04:00
Wayne Stambaugh 1dc747c0ae Improve version string generation for stable release source archives.
Add KiCadVersion.cmake to set the build version and branch name.

Update WriteVersionHeader.cmake to include KiCadVersion.cmake to set
the defaults in case no .git directory is found.
2016-10-12 21:05:48 -04:00
Chris Pavlina 183835ee67 cmake: rewrite version header when branch changes
Before, only KICAD_BUILD_VERSION, which includes the hash but not the
branch, was compared when deciding whether to regenerate
kicad_build_version.h. This header also contains the branch name though,
so we should compare both to address the case of two branches pointing
at the same commit.
2016-10-12 20:57:10 -04:00
Chris Pavlina 6dbe262b53 Update version string formatting after git migration
It is no longer necessary (or sensible) to include a simulated bzr
revision number, and we can reliably get a branch name now. Therefore,
the new version strings look like:

(2016-08-26 revision 67230ac)-master
 |                   |        |
 |                   |        branch name, "HEAD" if not on a branch,
 |                   |          or "unknown" if no .git present
 |                   |
 |                   abbreviated commit hash, or no-git if no .git
 |                     present
 |
 date of commit, or date of build if no .git present

Signed-off-by: Chris Pavlina <pavlina.chris@gmail.com>
2016-10-12 20:32:38 -04:00
Wayne Stambaugh e074c798bf CvPcb: remove broken footprint documentation feature.
At one point, all of the footprints provided by the KiCad footprint
libraries were merged into a single pdf file. The link to open this
file was provided on the toolbar. Since the footprint libraries have
been split out into individual repositories, this file is no longer
created so the toolbar button and the underlying code to open this
file were removed.

Improve a few CvPcb menu strings.

Fixes lp:702785

https://bugs.launchpad.net/ubuntu/+source/kicad/+bug/702785
2016-10-11 20:14:06 -04:00
Maciej Suminski bd1aae9071 Fixed a crash when a negative (although invalid) net code occurs in legacy plugin 2016-10-11 21:24:37 +02:00
Wayne Stambaugh 6382db4ebf Pcbnew: fix epic footprint editor DXF import fail.
The unfortunate combination of using static_cast to promote board items
to module items then using the assignment operator without any thought as
to what would happen in MODULE::Add() caused the board objects to not be
added to the module.  This is expected because board items cannot be in
modules.  Did this ever work or did someone have a colossal brain cramp?
If it did work, who ever changed it did not test it because in debug
builds, you would have gotten and assertion on every object imported.  On
release builds nothing is imported silently.

Add module object types to the DXF importer and code to choose which type
of object to import.

Remove offending static casts and assignment operator and pass the correct
object directly to the MODULE::Add() function when importing DXF in the
footprint editor.

The usual coding policy fixes.
2016-10-07 22:06:09 -04:00
Wayne Stambaugh 8151ec387c Pcbnew: fix drill file naming issue.
On windows when the project path include a remote volume name (\\NAME),
the volume name does not get cleared by calling wxFileName.SetDir( "" ).
This caused the volume name to be prepended to the file name when
calling wxFileName::GetFullPath().  Use wxFileName::GetFullName()
which resolves the issue.

Fixes lp:1606240

https://bugs.launchpad.net/kicad/+bug/1606240
2016-10-07 15:05:32 -04:00
jean-pierre charras 6e1d45c79e Gerbview: Fix a compil issue I created when copying a fix from the master branch 2016-10-07 19:23:45 +02:00
jean-pierre charras 1d05076761 Eeschema: remove a line which uses a non existing enum value. 2016-10-04 10:26:58 +02:00
jean-pierre charras 89e7d89223 Fix from master branch (lp:1630105 Gerbview print dialog does not display graphic layers list on some windows managers like Unity) 2016-10-04 10:25:35 +02:00
Maciej Suminski 115d70e060 Fixed a crash when drawing a single point polyline 2016-09-29 09:55:42 -04:00
Wayne Stambaugh 1a89a0601a Eeschema: fix assertion on delete node hot key while busy.
Performing a delete node hot key operation while Eeschema is busy performing
another operation causes an assertion in the delete node command event
handler in debug builds.  It also causes the operation in progress to be
cleared if the assertion is ignored or in release builds.

Fix a similar issue when the leave current sheet hot key is called while
busing performing another operation which causes rather interesting behavior
in the sheet that was exited.

Fixes lp:1627434

https://bugs.launchpad.net/kicad/+bug/1627434
2016-09-28 19:26:35 -04:00
Wayne Stambaugh ca0aa6c971 Pcbnew: fix several auto save file issues.
* When Pcbnew is launched in the stand alone mode with no board file command
  line option, the project path is set to the current working directory.  The
  user may not have write access to the current working directory which would
  cause the auto save to generate an error.  If the user does not have write
  access to the current working directory, set the path to a platform specific
  temporary path that the user has write permission.

* When Pcbnew is launched in the stand alone mode with no board file command
  line option, the default BOARD object has no file name.  Set the file name
  to "noname.kicad_pcb" to fix incorrect auto save file name and set the path
  to the user's platform specific document folder.

* Delete orphaned auto save files when closing without saving due to broken
  auto save file generation logic which prepended the file name with "$" rather
  than "_autosave-".

* Fixes: lp:1596382
2016-09-27 20:55:24 -04:00
jp charras 5b4542231e KiCad: fix crash when attempting to view ERC log with text editor.
Fixes lp:1619436

https://bugs.launchpad.net/kicad/+bug/1619436
2016-09-27 15:03:26 -04:00
111 changed files with 6097 additions and 5115 deletions
+55
View File
@@ -0,0 +1,55 @@
boost_root
.downloads-by-cmake
Build*
build*
common/netlist_keywords.*
common/netlist_lexer.h
common/pcb_plot_params_lexer.h
common/page_layout/page_layout_reader_keywords.cpp
common/lib_table_keywords.*
common/gal/opengl/shader_src.h
include/lib_table_lexer.h
include/netlist_lexer.h
include/page_layout_reader_lexer.h
eeschema/cmp_library_lexer.h
eeschema/cmp_library_keywords.*
eeschema/dialogs/dialog_bom_cfg_keywords.cpp
eeschema/dialogs/dialog_bom_cfg_lexer.h
eeschema/dialogs/dialog_bom_help_html.h
eeschema/template_fieldnames_keywords.*
eeschema/template_fieldnames_lexer.h
pcbnew/dialogs/dialog_freeroute_exchange_help_html.h
pcbnew/pcb_plot_params_keywords.cpp
pcbnew/pcb_plot_params_lexer.h
pcb_calculator/attenuators/bridget_tee_formula.h
pcb_calculator/attenuators/pi_formula.h
pcb_calculator/attenuators/splitter_formula.h
pcb_calculator/attenuators/tee_formula.h
Makefile
CMakeCache.txt
auto_renamed_to_cpp
Testing
version.h
config.h
install_manifest.txt
Documentation/doxygen
Documentation/development/doxygen
*.bak
*.pyc
.*.swp
*~
common/pcb_plot_params_keywords.cpp
include/pcb_plot_params_lexer.h
pcbnew/specctra_keywords.cpp
pcbnew/specctra_lexer.h
pcb_calculator/pcb_calculator_datafile_keywords.cpp
pcb_calculator/pcb_calculator_datafile_lexer.h
new/html
new/sch_lib_table_keywords.cpp
new/sch_lib_table_lexer.h
new/sweet_keywords.cpp
new/sweet_lexer.h
bitmaps_png/png*
bitmaps_png/tmp
common/pcb_keywords.cpp
include/pcb_lexer.h
+26 -3
View File
@@ -1,3 +1,25 @@
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2007-2016 Kicad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html
@@ -83,9 +105,6 @@ mark_as_advanced( KICAD_SKIP_BOOST ) # Normal builders should build Boost.
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." ON )
# This can be set to a custom name to brag about a particular branch in the "About" dialog:
set( KICAD_REPO_NAME "product" CACHE STRING "Name of the tree from which this build came." )
# All CMake downloads go here. Suggested is up in the source tree, not in the build dir where they
# would have to be downloaded over and over again. The default is to choose a directory that is
@@ -550,6 +569,10 @@ if( NOT GLEW_FOUND )
check_find_package_result( GLEW_FOUND "GLEW" )
endif()
# Find CURL library
find_package( CURL REQUIRED )
######################
# Find Cairo library #
######################
+10 -10
View File
@@ -2,7 +2,7 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2010 Wayne Stambaugh <stambaughw@verizon.net>
# Copyright (C) 2010-2015 Kicad Developers, see AUTHORS.txt for contributors.
# Copyright (C) 2010-2016 Kicad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -23,9 +23,9 @@
#
macro( create_git_version_header _git_src_path )
# If bzr is not found or an error occurs using the git commands to determine the repo
# version, set the build version string to "no-git"
set( KICAD_BUILD_VERSION "no-git" )
# If an error occurs using the git commands to determine the repo
# version, set the build version string to "git-error".
set( KICAD_GIT_BUILD_VERSION "git-error" )
# Include Git support to automagically create version header file.
find_package( Git )
@@ -72,17 +72,17 @@ macro( create_git_version_header _git_src_path )
execute_process(
COMMAND
${GIT_EXECUTABLE} rev-list HEAD --count
--first-parent
${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_SERIAL
OUTPUT_VARIABLE _git_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Git hash: ${_git_LONG_HASH}")
message(STATUS "Git branch: ${_git_BRANCH}")
if( ${_git_log_result} EQUAL 0 )
string( REGEX REPLACE "^(.*\n)?revno: ([^ \n]+).*"
"\\2" Kicad_REPO_REVISION "BZR ${_git_SERIAL}, Git ${_git_SHORT_HASH}" )
"\\2" Kicad_REPO_REVISION "revision ${_git_SHORT_HASH}" )
string( REGEX REPLACE "^(.*\n)?committer: ([^\n]+).*"
"\\2" Kicad_REPO_LAST_CHANGED_AUTHOR "${_git_LAST_COMITTER}")
string( REGEX REPLACE "^(.*\n)?timestamp: [a-zA-Z]+ ([^ \n]+).*"
@@ -98,8 +98,8 @@ macro( create_git_version_header _git_src_path )
if( Kicad_REPO_LAST_CHANGED_DATE )
string( REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+)" "\\1-\\2-\\3"
_kicad_git_date ${Kicad_REPO_LAST_CHANGED_DATE} )
set( KICAD_BUILD_VERSION "(${_kicad_git_date} ${Kicad_REPO_REVISION})" )
set( KICAD_VERSION "(${_kicad_git_date} ${Kicad_REPO_REVISION})" )
set( KICAD_BRANCH_NAME ${_git_BRANCH} )
endif()
set( KICAD_BUILD_VERSION ${KICAD_BUILD_VERSION} )
endmacro()
+37
View File
@@ -0,0 +1,37 @@
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2016 Wayne Stambaugh <stambaughw@verizon.net>
# Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Note: unless you are the person responsible for creating releases,
# do *not* change these variables. This way the KiCad project
# can maintain control over what is an official KiCad build and
# what is not. Setting these variable that conflict with KiCad
# releases is a shooting offense.
#
# This file gets included in the WriteVersionHeader.cmake file to set
# the KiCad version when the source is provided in an archive file.
# When KiCad is cloned using git, the git version is used. The only
# time this should be set to a value other than "no-vcs-found" is when
# a source archive is created. This eliminates the need to set
# KICAD_VERSION during the build configuration step.
set( KICAD_VERSION "4.0.7" )
+41 -40
View File
@@ -2,7 +2,7 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
# Copyright (C) 2015 KiCad Developers, see AUTHORS.txt for contributors.
# Copyright (C) 2015-2016 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -22,49 +22,35 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Automagically create version header file if the version string was not defined during
# the build configuration. If CreateBzrVersionHeader or CreateGitVersionHeader cannot
# determine the current repo version, a version.h file is still created with
# KICAD_BUILD_VERSION set to "no-vcs-found".
if( NOT KICAD_BUILD_VERSION )
set( _wvh_version_str "no-vcs-found" )
# Automagically create version header file if the version string was
# not defined during the build configuration. If
# CreateGitVersionHeader cannot determine the current repo version, a
# version.h file is still created with KICAD_VERSION set to "no-vcs-found".
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
# Detect the appropiate VCS and set the version string.
if( EXISTS "${SRC_PATH}/.bzr" )
message( STATUS "Using Bazaar to determine build version string." )
include( ${CMAKE_MODULE_PATH}/CreateBzrVersionHeader.cmake )
create_bzr_version_header( ${SRC_PATH} )
set( _wvh_version_str ${KICAD_BUILD_VERSION} )
elseif( EXISTS "${SRC_PATH}/.git" )
message( STATUS "Using Git to determine build version string." )
include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
create_git_version_header( ${SRC_PATH} )
set( _wvh_version_str ${KICAD_BUILD_VERSION} )
endif()
else()
set( _wvh_version_str ${KICAD_BUILD_VERSION} )
# Attempt to detect if we have a git repo and set the version string if
# the version wasn't set to something other than the default value in
# KiCadVersion.cmake.
if( KICAD_VERSION STREQUAL "no-vcs-found" AND EXISTS "${SRC_PATH}/.git" )
message( STATUS "Using Git to determine build version string." )
include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
create_git_version_header( ${SRC_PATH} )
endif()
set( _wvh_write_version_file ON )
# $KICAD_VERSION_FULL will always be set to something. Even if it is "no-vcs-found".
set( KICAD_VERSION_FULL "${KICAD_VERSION}" )
# Compare the version argument against the version in the existing header file for a mismatch.
if( EXISTS ${OUTPUT_FILE} )
file( STRINGS ${OUTPUT_FILE} _current_version_str
REGEX "^#define[\t ]+KICAD_BUILD_VERSION[\t ]+.*" )
string( REGEX REPLACE "^#define KICAD_BUILD_VERSION \"([()a-zA-Z0-9 -.]+)\".*"
"\\1" _wvh_last_version "${_current_version_str}" )
# No change, do not write version.h
if( _wvh_version_str STREQUAL _wvh_last_version )
message( STATUS "Not updating ${OUTPUT_FILE}" )
set( _wvh_write_version_file OFF )
endif()
# Optional branch name detected by git or configuration defined option.
if( KICAD_BRANCH_NAME )
set( KICAD_VERSION_FULL "${KICAD_VERSION_FULL}-${KICAD_BRANCH_NAME}" )
endif()
if( _wvh_write_version_file )
message( STATUS "Writing ${OUTPUT_FILE} file with version: ${_wvh_version_str}" )
# Optional user version information defined at configuration.
if( KICAD_VERSION_EXTRA )
set( KICAD_VERSION_FULL "${KICAD_VERSION_FULL}-${KICAD_VERSION_EXTRA}" )
endif()
file( WRITE ${OUTPUT_FILE}
set( _wvh_new_version_text
"/* Do not modify this file, it was automatically generated by CMake. */
/*
@@ -73,11 +59,26 @@ if( _wvh_write_version_file )
#ifndef __KICAD_VERSION_H__
#define __KICAD_VERSION_H__
#define KICAD_BUILD_VERSION \"${_wvh_version_str}\"
#define KICAD_VERSION_FULL \"${KICAD_VERSION_FULL}\"
#endif /* __KICAD_VERSION_H__ */
"
)
" )
set( _wvh_write_version_file ON )
# Only write the header if it has changed, to avoid rebuilds
if( EXISTS ${OUTPUT_FILE} )
file( READ ${OUTPUT_FILE} _wvh_old_version_text )
if( _wvh_old_version_text STREQUAL _wvh_new_version_text )
message( STATUS "Not updating ${OUTPUT_FILE}" )
set( _wvh_write_version_file OFF )
endif()
endif()
if( _wvh_write_version_file )
message( STATUS "Writing ${OUTPUT_FILE} file with version: ${KICAD_VERSION_FULL}" )
file( WRITE ${OUTPUT_FILE} ${_wvh_new_version_text} )
endif()
-3
View File
@@ -77,7 +77,4 @@
#define KIFACE_SUFFIX wxT( "@KIFACE_SUFFIX@" )
#define KIFACE_PREFIX wxT( "@KIFACE_PREFIX@" )
/// Name of repo from which this build came.
#define KICAD_REPO_NAME "@KICAD_REPO_NAME@"
#endif // CONFIG_H_
-65
View File
@@ -1,65 +0,0 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
# Download av_http and install into ${PREFIX}, typically in our KiCad source tree.
# Assumes include( ExternalProject ) was done inline previous to this file
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
#-----<configure>-------------------------------------------------------------------------------------
# soon cmake will have https support, switch to a true download then:
#set( AVHTTP_RELEASE ??? )
#set( AVHTTP_MD5 ???? ) # re-calc this on every RELEASE change
#-----</configure>-----------------------------------------------------------------------------------
# Where the library is to be installed.
set( PREFIX ${DOWNLOAD_DIR}/avhttp )
if( KICAD_SKIP_BOOST )
set( AVHTTP_DEPEND "" )
else()
set( AVHTTP_DEPEND "boost" )
endif()
# Install the AVHTTP header only library ${PREFIX}
ExternalProject_Add( avhttp
PREFIX ${PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_DIR} # no true download yet
# grab it from a local zip file for now, cmake caller's source dir
URL ${CMAKE_CURRENT_SOURCE_DIR}/avhttp-master.zip
DEPENDS ${AVHTTP_DEPEND}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR> <INSTALL_DIR>
)
set( AVHTTP_INCLUDE_DIR "${PREFIX}/include" CACHE FILEPATH "AVHTTP include directory" )
mark_as_advanced( AVHTTP_INCLUDE_DIR )
+29 -14
View File
@@ -78,14 +78,6 @@ specific patches required to build a working Boost library. These patches can b
[patches folder][] in the KiCad source. These patches are named by the platform name they should
be applied against.
## OpenSSL Secure Socket Layer Library ## {#openssl}
The [OpenSSL][] library is only required when the KiCad build is configured with the Github plugin
enabled. See the [KiCad Build Configuration Options](#build_opts)` section for more information.
Please note that KiCad will download and build version 1.0.1e of OpenSSL by default. You should
probably use the version of OpenSSL installed on your system as it will most likely be more up to
date and contain the latest security fixes.
## GLEW OpenGL Extension Wrangler Library ## {#glew}
The [OpenGL Extension Wrangler][GLEW] is an OpenGL helper library used by the KiCad graphics
@@ -151,6 +143,11 @@ supplied by KiCad. This option is disabled by default.
The KICAD_SCRIPTING_WXPYTHON option is used to enable building the wxPython interface into
Pcbnew including the wxPython console. This option is disabled by default.
## Github Plugin ## {#github_opt}
The BUILD_GITHUB_PLUGIN option is used to control if the Github plugin is built. This option is
enabled by default.
## Build with Static Libraries ## {#static_lib_opt}
The KICAD_BUILD_STATIC option is used to build KiCad with static libraries. This option is
@@ -175,10 +172,30 @@ The USE_OSX_DEPS_BUILDER option forces the build configuration to download and b
required dependencies to build KiCad on OSX. This option is not longer maintained and most
likely is broken. Use it at your own peril.
## Github Plugin ## {#github_opt}
## Setting the Build Version and Repository Name ## {#build_version_opt}
The BUILD_GITHUB_PLUGIN option is used to control if the Github plugin is built. This option is
enabled by default.
The KiCad version string is defined by the three CMake variables KICAD_VERSION, KICAD_BRANCH_NAME,
and KICAD_VERSION_EXTRA. Variables KICAD_BRANCH_NAME and KICAD_VERSION_EXTRA are defined as empty
strings and can be set at configuration. Unless the source branch is a stable release archive,
KICAD_VERSION is set to "no-vcs-found". If an optional variable is not define, it is not appended
to the full version string. If an optional variable is defined it is appended along with a leading
'-' to the full version string as follows:
KICAD_VERSION[-KICAD_BRANCH_NAME][-KICAD_VERSION_EXTRA]
When the version string is set to "no-vcs-found", the build script automatically creates the
version string information from the [git][] repository information as follows:
(2016-08-26 revision 67230ac)-master
| | |
| | branch name, "HEAD" if not on a branch,
| | or "unknown" if no .git present
| |
| abbreviated commit hash, or no-git if no .git
| present
|
date of commit, or date of build if no .git present
# Getting the KiCad Source Code ## {#getting_src}
@@ -274,7 +291,7 @@ the following commands:
mingw-w64-x86_64-boost \
mingw-w64-x86_64-cairo \
mingw-w64-x86_64-glew \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-curl \
mingw-w64-x86_64-wxPython \
mingw-w64-x86_64-wxWidgets
cd kicad-source
@@ -286,7 +303,6 @@ the following commands:
-DCMAKE_PREFIX_PATH=/mingw64 \
-DCMAKE_INSTALL_PREFIX=/mingw64 \
-DDEFAULT_INSTALL_PATH=/mingw64 \
-DOPENSSL_ROOT_DIR=/mingw64 \
-DKICAD_SKIP_BOOST=ON \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
@@ -383,7 +399,6 @@ Boost patches in the KiCad source [patch folder][].
[wxWidgets]: http://wxwidgets.org/
[patches folder]: http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/files/head:/patches/
[Boost]: http://www.boost.org/
[OpenSSL]: https://www.openssl.org/
[GLEW]: http://glew.sourceforge.net/
[GLUT]: https://www.opengl.org/resources/libraries/glut/
[Cairo]: http://cairographics.org/
+24 -5
View File
@@ -4,12 +4,19 @@ include_directories(
./dialog_about
${CAIRO_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
${CURL_INCLUDE_DIRS}
../3d-viewer
../pcbnew
../polygon
${INC_AFTER}
)
if( NOT APPLE ) # windows and linux use openssl under curl
find_package( OpenSSL REQUIRED )
endif()
# Generate header files containing shader programs
# Order of input files is significant
add_custom_command(
@@ -115,15 +122,20 @@ install( TARGETS lib_kicad
endif()
# KiCad build version string defaults to undefined which forces the build version header
# command to look for Bazaar to create the version string header.
set( KICAD_BUILD_VERSION "" CACHE STRING "Version string defined at configuration time." )
# KiCad build version string defaults to "no-vcs-found" which forces the build version header
# command to look for git to create the version string header when the .git path is found in
# the source path.
set( KICAD_BRANCH_NAME "" CACHE STRING "KiCad repository name." )
set( KICAD_VERSION_EXTRA "" CACHE STRING
"User defined configuration string to append to KiCad version." )
# Generate version header file.
add_custom_target(
version_header ALL
COMMAND ${CMAKE_COMMAND}
-DKICAD_BUILD_VERSION=${KICAD_BUILD_VERSION}
-DKICAD_VERSION=${KICAD_VERSION}
-DKICAD_BRANCH_NAME=${KICAD_BRANCH_NAME}
-DKICAD_VERSION_EXTRA=${KICAD_VERSION_EXTRA}
-DOUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.h
-DSRC_PATH=${PROJECT_SOURCE_DIR}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
@@ -252,6 +264,9 @@ endif()
set( COMMON_SRCS
${COMMON_SRCS}
kicad_curl/kicad_curl.cpp
kicad_curl/kicad_curl_easy.cpp
view/view.cpp
view/view_item.cpp
view/view_group.cpp
@@ -277,7 +292,11 @@ set( COMMON_SRCS
add_library( common STATIC ${COMMON_SRCS} )
add_dependencies( common lib-dependencies )
add_dependencies( common version_header )
target_link_libraries( common ${Boost_LIBRARIES} )
target_link_libraries( common
${Boost_LIBRARIES}
${CURL_LIBRARIES}
${OPENSSL_LIBRARIES} # empty on Apple
)
set( PCB_COMMON_SRCS
+13
View File
@@ -27,6 +27,14 @@
* @file basicframe.cpp
* @brief EDA_BASE_FRAME class implementation.
*/
#include <config.h>
// kicad_curl.h must be included before wx headers, to avoid
// conflicts for some defines, at least on Windows
#ifdef BUILD_GITHUB_PLUGIN
#include <curl/curlver.h>
#include <kicad_curl/kicad_curl.h>
#endif
#include <wx/aboutdlg.h>
#include <wx/fontdlg.h>
@@ -580,6 +588,11 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event )
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
<< ( BOOST_VERSION % 100 ) << wxT( "\n" );
#ifdef BUILD_GITHUB_PLUGIN
// Shows the Curl library version in use:
msg_version << "Curl version: " << KICAD_CURL::GetVersion() << "\n";
#endif
msg_version << wxT( " USE_WX_GRAPHICS_CONTEXT=" );
#ifdef USE_WX_GRAPHICS_CONTEXT
msg_version << wxT( "ON\n" );
+3 -4
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2015-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -37,9 +37,8 @@
wxString GetBuildVersion()
{
wxString msg = wxString::Format(
wxT( "%s-%s" ),
wxT( KICAD_BUILD_VERSION ),
wxT( KICAD_REPO_NAME )
wxT( "%s" ),
wxT( KICAD_VERSION_FULL )
);
return msg;
+2 -3
View File
@@ -107,9 +107,8 @@ bool BITMAP_BASE::SaveData( FILE* aFile ) const
// Write binary data in hexadecimal form (ASCII)
wxStreamBuffer* buffer = stream.GetOutputStreamBuffer();
char* begin = (char*) buffer->GetBufferStart();
int ii;
for( ii = 0; begin <= buffer->GetBufferEnd(); begin++, ii++ )
for( int ii = 0; begin < buffer->GetBufferEnd(); begin++, ii++ )
{
if( ii >= 32 )
{
@@ -140,7 +139,7 @@ void BITMAP_BASE::SaveData( wxArrayString& aPngStrings ) const
char* begin = (char*) buffer->GetBufferStart();
wxString line;
for( int ii = 0; begin <= buffer->GetBufferEnd(); begin++, ii++ )
for( int ii = 0; begin < buffer->GetBufferEnd(); begin++, ii++ )
{
if( ii >= 32 )
{
-1
View File
@@ -515,6 +515,5 @@ void PLOTTER::ThickCircle( const wxPoint& pos, int diametre, int width, EDA_DRAW
void PLOTTER::SetPageSettings( const PAGE_INFO& aPageSettings )
{
wxASSERT( !outputFile );
pageInfo = aPageSettings;
}
+4 -9
View File
@@ -49,7 +49,6 @@ static const double DXF_OBLIQUE_ANGLE = 15;
void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
wxASSERT( !outputFile );
plotOffset = aOffset;
plotScale = aScale;
@@ -277,7 +276,6 @@ bool DXF_PLOTTER::EndPlot()
*/
void DXF_PLOTTER::SetColor( EDA_COLOR_T color )
{
wxASSERT( outputFile );
if( ( color >= 0 && colorMode )
|| ( color == BLACK )
|| ( color == WHITE ) )
@@ -293,7 +291,6 @@ void DXF_PLOTTER::SetColor( EDA_COLOR_T color )
*/
void DXF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width )
{
wxASSERT( outputFile );
MoveTo( p1 );
LineTo( wxPoint( p1.x, p2.y ) );
LineTo( wxPoint( p2.x, p2.y ) );
@@ -427,7 +424,7 @@ void DXF_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList,
// Now, output the final polygon to DXF file:
last = path.PointCount() - 1;
VECTOR2I point = path.CPoint( 0 );
VECTOR2I point = path.CPoint( 0 );
wxPoint startPoint( point.x, point.y );
MoveTo( startPoint );
@@ -483,7 +480,8 @@ void DXF_PLOTTER::SetDash( bool dashed )
void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int aWidth,
EDA_DRAW_MODE_T aPlotMode )
{
segmentAsOval( aStart, aEnd, aWidth, aPlotMode );
MoveTo( aStart );
FinishTo( aEnd );
}
/* Plot an arc in DXF format
@@ -523,7 +521,6 @@ void DXF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i
void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double orient,
EDA_DRAW_MODE_T trace_mode )
{
wxASSERT( outputFile );
wxSize size( aSize );
/* The chip is reduced to an oval tablet with size.y > size.x
@@ -545,7 +542,6 @@ void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double
void DXF_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
EDA_DRAW_MODE_T trace_mode )
{
wxASSERT( outputFile );
Circle( pos, diametre, NO_FILL );
}
@@ -624,7 +620,6 @@ void DXF_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize,
void DXF_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{
wxASSERT( outputFile );
wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */
for( int ii = 0; ii < 4; ii++ )
@@ -680,7 +675,7 @@ void DXF_PLOTTER::Text( const wxPoint& aPos,
if( textAsLines || containsNonAsciiChars( aText ) || aMultilineAllowed )
{
// output text as graphics.
// Perhaps miltiline texts could be handled as DXF text entity
// Perhaps multiline texts could be handled as DXF text entity
// but I do not want spend time about this (JPC)
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
aWidth, aItalic, aBold, aMultilineAllowed );
-5
View File
@@ -61,7 +61,6 @@ GERBER_PLOTTER::GERBER_PLOTTER()
void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
wxASSERT( !outputFile );
wxASSERT( aMirror == false );
m_plotMirror = false;
plotOffset = aOffset;
@@ -318,7 +317,6 @@ void GERBER_PLOTTER::writeApertureList()
void GERBER_PLOTTER::PenTo( const wxPoint& aPos, char plume )
{
wxASSERT( outputFile );
DPOINT pos_dev = userToDeviceCoordinates( aPos );
switch( plume )
@@ -434,7 +432,6 @@ void GERBER_PLOTTER:: PlotPoly( const std::vector< wxPoint >& aCornerList,
void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, EDA_DRAW_MODE_T trace_mode )
{
wxASSERT( outputFile );
wxSize size( diametre, diametre );
if( trace_mode == SKETCH )
@@ -454,7 +451,6 @@ void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, EDA_DRAW_
void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double orient,
EDA_DRAW_MODE_T trace_mode )
{
wxASSERT( outputFile );
int x0, y0, x1, y1, delta;
wxSize size( aSize );
@@ -508,7 +504,6 @@ void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
double orient, EDA_DRAW_MODE_T trace_mode )
{
wxASSERT( outputFile );
wxSize size( aSize );
// Plot as an aperture flash
-4
View File
@@ -212,7 +212,6 @@ HPGL_PLOTTER::HPGL_PLOTTER()
void HPGL_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
wxASSERT( !outputFile );
plotOffset = aOffset;
plotScale = aScale;
m_IUsPerDecimil = aIusPerDecimil;
@@ -386,7 +385,6 @@ void HPGL_PLOTTER::SetDash( bool dashed )
void HPGL_PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end,
int width, EDA_DRAW_MODE_T tracemode )
{
wxASSERT( outputFile );
wxPoint center;
wxSize size;
@@ -449,7 +447,6 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle,
void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double orient,
EDA_DRAW_MODE_T trace_mode )
{
wxASSERT( outputFile );
int deltaxy, cx, cy;
wxSize size( aSize );
@@ -635,7 +632,6 @@ void HPGL_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize,
void HPGL_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCorners,
double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{
wxASSERT( outputFile );
wxPoint polygone[4]; // coordinates of corners relatives to the pad
wxPoint coord[4]; // absolute coordinates of corners (coordinates in plotter space)
int move;
+6 -4
View File
@@ -7,7 +7,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 Lorenzo Marcantonio, l.marcantonio@logossrl.com
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -70,7 +70,6 @@ void PDF_PLOTTER::SetPageSettings( const PAGE_INFO& aPageSettings )
void PDF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
wxASSERT( !workFile );
m_plotMirror = aMirror;
plotOffset = aOffset;
plotScale = aScale;
@@ -767,7 +766,10 @@ void PDF_PLOTTER::Text( const wxPoint& aPos,
aMultilineAllowed = false; // the text has only one line.
// Emit native PDF text (if requested)
if( m_textMode != PLOTTEXTMODE_STROKE && !aMultilineAllowed )
// Currently: does not work: disable it
bool use_native = false; // = m_textMode != PLOTTEXTMODE_STROKE && !aMultilineAllowed;
if( use_native )
{
const char *fontname = aItalic ? (aBold ? "/KicadFontBI" : "/KicadFontI")
: (aBold ? "/KicadFontB" : "/KicadFont");
@@ -823,7 +825,7 @@ void PDF_PLOTTER::Text( const wxPoint& aPos,
}
// Plot the stroked text (if requested)
if( m_textMode != PLOTTEXTMODE_NATIVE || aMultilineAllowed )
if( !use_native )
{
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
aWidth, aItalic, aBold, aMultilineAllowed );
+7 -6
View File
@@ -1,8 +1,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2017 KiCad Developers, see CHANGELOG.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
@@ -91,7 +91,6 @@ void PSLIKE_PLOTTER::SetColor( EDA_COLOR_T color )
void PSLIKE_PLOTTER::FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize,
double aPadOrient, EDA_DRAW_MODE_T aTraceMode )
{
wxASSERT( outputFile );
int x0, y0, x1, y1, delta;
wxSize size( aSize );
@@ -339,7 +338,6 @@ void PSLIKE_PLOTTER::postscriptOverlinePositions( const wxString& aText, int aXS
void PS_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
wxASSERT( !outputFile );
m_plotMirror = aMirror;
plotOffset = aOffset;
plotScale = aScale;
@@ -875,7 +873,10 @@ void PS_PLOTTER::Text( const wxPoint& aPos,
aMultilineAllowed = false; // the text has only one line.
// Draw the native postscript text (if requested)
if( m_textMode == PLOTTEXTMODE_NATIVE && !aMultilineAllowed )
// Currently: does not work: disable it
bool use_native = false; // = m_textMode == PLOTTEXTMODE_NATIVE && !aMultilineAllowed;
if( use_native )
{
const char *fontname = aItalic ? (aBold ? "/KicadFont-BoldOblique"
: "/KicadFont-Oblique")
@@ -928,7 +929,7 @@ void PS_PLOTTER::Text( const wxPoint& aPos,
}
// Draw the stroked text (if requested)
if( m_textMode != PLOTTEXTMODE_NATIVE || aMultilineAllowed )
if( !use_native )
{
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
aWidth, aItalic, aBold, aMultilineAllowed );
-1
View File
@@ -172,7 +172,6 @@ SVG_PLOTTER::SVG_PLOTTER()
void SVG_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
wxASSERT( !outputFile );
m_plotMirror = aMirror;
m_yaxisReversed = true; // unlike other plotters, SVG has Y axis reversed
plotOffset = aOffset;
+24 -22
View File
@@ -148,45 +148,47 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
description << wxT( "<ul>" );
description << wxT( "<li>" )
<< HtmlHyperlink( wxT( "http://www.kicad-pcb.org" ),
_( "The official KiCad site" ) )
<< wxT( "</li>" );
description << wxT( "<li>" )
<< HtmlHyperlink( wxT( "http://iut-tice.ujf-grenoble.fr/kicad" ),
_( "The original site of the KiCad project founder" ) )
_( "The official KiCad website" ) )
<< wxT( "</li>" );
description << wxT( "<li>" )
<< HtmlHyperlink( wxT( "https://launchpad.net/kicad" ),
_( "Developer's website on Launchpad" ) )
<< wxT("</li>" );
description << wxT( "<li>" )
<< HtmlHyperlink( wxT( "http://www.kicadlib.org" ),
_( "Repository with additional component libraries" ) )
<< HtmlHyperlink( wxT( "https://github.com/KiCad/" ),
_( "Official repository for component and footprint libraries" ) )
<< wxT( "</li>" );
description << wxT( "</ul>" );
description << wxT( "</p>" );
description << wxT( "<p>" );
description << wxT( "<b><u>" )
<< _( "Contribute to KiCad" )
description << wxT( "<p><b><u>" )
<< _( "Bug tracker" )
<< wxT( "</u></b>" ); // bold & underlined font caption
// bullet-ed list with some http links
description << wxT( "<ul>" );
description << wxT( "<li>" )
<<HtmlHyperlink( wxT( "https://bugs.launchpad.net/kicad" ),
_( "Report bugs if you found any" ) )
<< HtmlHyperlink( wxT( "https://bugs.launchpad.net/kicad/+bugs?orderby=-id&start=0" ),
_( "Report or examine bugs" ) )
<< wxT( "</li>" );
description << wxT( "<li>" )
<< HtmlHyperlink( wxT( "https://blueprints.launchpad.net/kicad" ),
_( "File an idea for improvement" ) )
<< wxT( "</li>" );
description << wxT( "<li>" )
<< HtmlHyperlink( wxT( "http://www.kicadlib.org/Kicad_related_links.html" ),
_( "KiCad links to user groups, tutorials and much more" ) )
<< wxT( "</li>" );
description << wxT( "</ul>" );
description << wxT( "</ul></p>" );
description << wxT( "</p>" );
description << wxT( "<p><b><u>" )
<< _( "KiCad user's groups and community" )
<< wxT( "</u></b>" ); // bold & underlined font caption
description << wxT( "<ul>" );
description << wxT( "<li>" )
<< HtmlHyperlink( wxT( "https://groups.yahoo.com/neo/groups/kicad-users/info" ),
_( "KiCad user's group" ) )
<< wxT( "</li>" );
description << wxT( "<li>" )
<< HtmlHyperlink( wxT( "https://forum.kicad.info" ),
_( "KiCad forum" ) )
<< wxT( "</li>" );
description << wxT( "</ul></p>" );
info.SetDescription( description );
+15 -19
View File
@@ -2,8 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2011 Jean-Pierre Charras, <jp.charras@wanadoo.fr>
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013-2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -28,7 +28,12 @@
*/
#define USE_WORKER_THREADS 1 // 1:yes, 0:no. use worker thread to load libraries
/**
No. concurrent threads doing "http(s) GET". More than 6 is not significantly
faster, less than 6 is likely slower. Main thread is in this count, so if
set to 1 then no temp threads are created.
*/
#define READER_THREADS 6
/*
* Functions to read footprint libraries and fill m_footprints by available footprints names
@@ -120,13 +125,6 @@ void FOOTPRINT_INFO::load()
}
#define JOBZ 6 // no. libraries per worker thread. It takes about
// a second to load a GITHUB library, so assigning
// this no. libraries to each thread should give a little
// over this no. seconds total time if the original delay
// were caused by latencies alone.
// (If https://github.com does not mind.)
void FOOTPRINT_LIST::loader_job( const wxString* aNicknameList, int aJobZ )
{
for( int i=0; i<aJobZ; ++i )
@@ -204,8 +202,6 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* a
// do all of them
nicknames = aTable->GetLogicalLibs();
#if USE_WORKER_THREADS
// Even though the PLUGIN API implementation is the place for the
// locale toggling, in order to keep LOCAL_IO::C_count at 1 or greater
// for the duration of all helper threads, we increment by one here via instantiation.
@@ -221,22 +217,23 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* a
MYTHREADS threads;
unsigned jobz = (nicknames.size() + READER_THREADS - 1) / READER_THREADS;
// Give each thread JOBZ nicknames to process. The last portion of, or if the entire
// size() is small, I'll do myself.
for( unsigned i=0; i<nicknames.size(); )
{
int jobz = JOBZ;
if( i + jobz >= nicknames.size() ) // on the last iteration of this for(;;)
{
jobz = nicknames.size() - i;
// Only a little bit to do, I'll do it myself, on current thread.
// Only a little bit to do, I'll do it myself on current thread.
// I am part of the READER_THREADS count.
loader_job( &nicknames[i], jobz );
}
else
{
// Delegate the job to a worker thread created here.
// Delegate the job to a temporary thread created here.
threads.push_back( new boost::thread( &FOOTPRINT_LIST::loader_job,
this, &nicknames[i], jobz ) );
}
@@ -251,9 +248,6 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* a
{
threads[i].join();
}
#else
loader_job( &nicknames[0], nicknames.size() );
#endif
m_list.sort();
}
@@ -315,6 +309,8 @@ void FOOTPRINT_LIST::DisplayErrors( wxTopLevelWindow* aWindow )
msg += wxT( "<p>" ) + m_errors[i].errorText + wxT( "</p>" );
}
// Preserve new lines in error messages so queued errors don't run together.
msg.Replace( "\n", "<BR>" );
dlg.AddHTML_Text( msg );
dlg.ShowModal();
+25 -7
View File
@@ -260,6 +260,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
*/
T tok;
wxString errMsg; // to collect error messages
// This table may be nested within a larger s-expression, or not.
// Allow for parser of that optional containing s-epression to have looked ahead.
@@ -280,10 +281,6 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
if( tok != T_LEFT )
in->Expecting( T_LEFT );
// in case there is a "row integrity" error, tell where later.
int lineNum = in->CurLineNumber();
int offset = in->CurOffset();
if( ( tok = in->NextTok() ) != T_lib )
in->Expecting( T_lib );
@@ -323,7 +320,17 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
in->Duplicate( tok );
sawUri = true;
in->NeedSYMBOLorNUMBER();
row.SetFullURI( in->FromUTF8() );
// Saved path and file names use the Unix notation (separator = '/')
// However old files, and files edited by hand can use the windows
// separator. Force the unix notation.
// (It works on windows, and moreover, wxFileName and wxDir takes care to that
// on windows)
// moreover, URLs use the '/' as separator
{
wxString uri = in->FromUTF8();
uri.Replace( '\\', '/' );
row.SetFullURI( uri );
}
break;
case T_type:
@@ -372,9 +379,15 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
wxString msg = wxString::Format(
_( "'%s' is a duplicate footprint library nickName" ),
GetChars( row.nickName ) );
THROW_PARSE_ERROR( msg, in->CurSource(), in->CurLine(), lineNum, offset );
if( !errMsg.IsEmpty() )
errMsg << '\n';
errMsg << msg;
}
}
if( !errMsg.IsEmpty() )
THROW_IO_ERROR( errMsg );
}
@@ -393,10 +406,15 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
void FP_LIB_TABLE::ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const
throw( IO_ERROR, boost::interprocess::lock_exception )
{
// In Kicad, we save path and file names using the Unix notation (separator = '/')
// So ensure separator is always '/' is saved URI string
wxString uri = GetFullURI();
uri.Replace( '\\', '/' );
out->Print( nestLevel, "(lib (name %s)(type %s)(uri %s)(options %s)(descr %s))\n",
out->Quotew( GetNickName() ).c_str(),
out->Quotew( GetType() ).c_str(),
out->Quotew( GetFullURI() ).c_str(),
out->Quotew( uri ).c_str(),
out->Quotew( GetOptions() ).c_str(),
out->Quotew( GetDescr() ).c_str()
);
+4 -1
View File
@@ -450,7 +450,7 @@ void OPENGL_GAL::DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEn
void OPENGL_GAL::DrawPolyline( const std::deque<VECTOR2D>& aPointList )
{
if( aPointList.empty() )
if( aPointList.size() < 2 )
return;
currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a );
@@ -478,6 +478,9 @@ void OPENGL_GAL::DrawPolyline( const std::deque<VECTOR2D>& aPointList )
void OPENGL_GAL::DrawPolyline( const VECTOR2D aPointList[], int aListSize )
{
if( aListSize < 2 )
return;
currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a );
// Start from the second point
+224
View File
@@ -0,0 +1,224 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
// kicad_curl.h must be included before wx headers, to avoid
// conflicts for some defines, at least on Windows
#include <kicad_curl/kicad_curl.h>
#include <wx/log.h>
#include <wx/dynlib.h>
#include <macros.h>
#include <fctsys.h>
#include <ki_mutex.h> // MUTEX and MUTLOCK
#include <richio.h>
// These are even more private than class members, and since there is only
// one instance of KICAD_CURL ever, these statics are hidden here to simplify the
// client (API) header file.
static volatile bool s_initialized;
static MUTEX s_lock; // for s_initialized
// Assume that on these platforms libcurl uses OpenSSL
#if defined(__linux__) || defined(__MINGW32__)
#include <openssl/crypto.h>
static MUTEX* s_crypto_locks;
static void lock_callback( int mode, int type, const char* file, int line )
{
(void)file;
(void)line;
wxASSERT( s_crypto_locks && unsigned( type ) < unsigned( CRYPTO_num_locks() ) );
//DBG( printf( "%s: mode=0x%x type=%d file=%s line=%d\n", __func__, mode, type, file, line );)
if( mode & CRYPTO_LOCK )
{
s_crypto_locks[ type ].lock();
}
else
{
s_crypto_locks[ type ].unlock();
}
}
static void init_locks()
{
s_crypto_locks = new MUTEX[ CRYPTO_num_locks() ];
// From http://linux.die.net/man/3/crypto_set_id_callback:
/*
OpenSSL can safely be used in multi-threaded applications provided that at
least two callback functions are set, locking_function and threadid_func.
locking_function(int mode, int n, const char *file, int line) is needed to
perform locking on shared data structures. (Note that OpenSSL uses a number
of global data structures that will be implicitly shared whenever multiple
threads use OpenSSL.) Multi-threaded applications will crash at random if it
is not set.
threadid_func( CRYPTO_THREADID *id) is needed to record the
currently-executing thread's identifier into id. The implementation of this
callback should not fill in id directly, but should use
CRYPTO_THREADID_set_numeric() if thread IDs are numeric, or
CRYPTO_THREADID_set_pointer() if they are pointer-based. If the application
does not register such a callback using CRYPTO_THREADID_set_callback(), then
a default implementation is used - on Windows and BeOS this uses the
system's default thread identifying APIs, and on all other platforms it uses
the address of errno. The latter is satisfactory for thread-safety if and
only if the platform has a thread-local error number facility.
Dick: "sounds like CRYPTO_THREADID_set_callback() is not mandatory on our
2 OpenSSL platforms."
*/
CRYPTO_set_locking_callback( &lock_callback );
}
static void kill_locks()
{
CRYPTO_set_locking_callback( NULL );
delete[] s_crypto_locks;
s_crypto_locks = NULL;
}
#else
inline void init_locks() { /* dummy */ }
inline void kill_locks() { /* dummy */ }
#endif
/// At process termination, using atexit() keeps the CURL stuff out of the
/// singletops and PGM_BASE.
static void at_terminate()
{
KICAD_CURL::Cleanup();
}
void KICAD_CURL::Init()
{
// We test s_initialized twice in an effort to avoid
// unnecessarily locking s_lock. This understands that the common case
// will not need to lock.
if( !s_initialized )
{
MUTLOCK lock( s_lock );
if( !s_initialized )
{
if( curl_global_init( CURL_GLOBAL_ALL ) != CURLE_OK )
{
THROW_IO_ERROR( "curl_global_init() failed." );
}
init_locks();
wxLogDebug( "Using %s", GetVersion() );
s_initialized = true;
}
}
}
void KICAD_CURL::Cleanup()
{
/*
Calling MUTLOCK() from a static destructor will typically be bad, since the
s_lock may already have been statically destroyed itself leading to a boost
exception. (Remember C++ does not provide certain sequencing of static
destructor invocation.)
To prevent this we test s_initialized twice, which ensures that the MUTLOCK
is only instantiated on the first call, which should be from
PGM_BASE::destroy() which is first called earlier than static destruction.
Then when called again from the actual PGM_BASE::~PGM_BASE() function,
MUTLOCK will not be instantiated because s_initialized will be false.
*/
if( s_initialized )
{
MUTLOCK lock( s_lock );
if( s_initialized )
{
curl_global_cleanup();
kill_locks();
atexit( &at_terminate );
s_initialized = false;
}
}
}
std::string KICAD_CURL::GetSimpleVersion()
{
if( !s_initialized )
Init();
curl_version_info_data* info = curl_version_info( CURLVERSION_NOW );
std::string res;
if( info->version )
{
res += "libcurl version: " + std::string( info->version );
}
res += " (";
if( info->features & CURL_VERSION_SSL )
{
res += "with SSL - ";
res += std::string( info->ssl_version );
}
else
{
res += "without SSL";
}
res += ")";
return res;
}
+94
View File
@@ -0,0 +1,94 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <kicad_curl/kicad_curl_easy.h>
#include <cstddef>
#include <exception>
#include <stdarg.h>
#include <sstream>
#include <richio.h>
static size_t write_callback( void* contents, size_t size, size_t nmemb, void* userp )
{
size_t realsize = size * nmemb;
std::string* p = (std::string*) userp;
p->append( (const char*) contents, realsize );
return realsize;
}
KICAD_CURL_EASY::KICAD_CURL_EASY() :
m_headers( NULL )
{
// Call KICAD_CURL::Init() from in here everytime, but only the first time
// will incur any overhead. This strategy ensures that libcurl is never loaded
// unless it is needed.
KICAD_CURL::Init();
m_CURL = curl_easy_init();
if( !m_CURL )
{
THROW_IO_ERROR( "Unable to initialize CURL session" );
}
curl_easy_setopt( m_CURL, CURLOPT_WRITEFUNCTION, write_callback );
curl_easy_setopt( m_CURL, CURLOPT_WRITEDATA, (void*) &m_buffer );
}
KICAD_CURL_EASY::~KICAD_CURL_EASY()
{
if( m_headers )
curl_slist_free_all( m_headers );
curl_easy_cleanup( m_CURL );
}
void KICAD_CURL_EASY::Perform()
{
if( m_headers )
{
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
}
// bonus: retain worst case memory allocation, should re-use occur
m_buffer.clear();
CURLcode res = curl_easy_perform( m_CURL );
if( res != CURLE_OK )
{
std::string msg = StrPrintf( "curl_easy_perform()=%d: %s",
res, GetErrorText( res ).c_str() );
THROW_IO_ERROR( msg );
}
}
+2 -2
View File
@@ -100,7 +100,7 @@ std::string StrPrintf( const char* format, ... )
void IO_ERROR::init( const char* aThrowersFile, const char* aThrowersLoc, const wxString& aMsg )
{
errorText.Printf( IO_FORMAT, aMsg.GetData(),
wxString::FromUTF8( aThrowersFile ).GetData(),
wxString::FromUTF8( aThrowersFile ).AfterLast( '/' ).GetData(),
wxString::FromUTF8( aThrowersLoc ).GetData() );
}
@@ -117,7 +117,7 @@ void PARSE_ERROR::init( const char* aThrowersFile, const char* aThrowersLoc,
errorText.Printf( PARSE_FORMAT, aMsg.GetData(), aSource.GetData(),
aLineNumber, aByteIndex,
wxString::FromUTF8( aThrowersFile ).GetData(),
wxString::FromUTF8( aThrowersFile ).AfterLast( '/' ).GetData(),
wxString::FromUTF8( aThrowersLoc ).GetData() );
}
+31 -18
View File
@@ -53,7 +53,7 @@
* put text in aTarget
* return a pointer to the last read char (the second quote if OK)
*/
wxString GetQuotedText( wxString & text )
wxString GetQuotedText( wxString& text )
{
int i = text.Find( QUOTE );
@@ -82,7 +82,7 @@ bool sortListbyCmpValue( const FOOTPRINT_EQUIVALENCE& ref, const FOOTPRINT_EQUIV
// read the .equ files and populate the list of equivalents
int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wxString * aErrorMessages )
{
char Line[1024];
char line[1024];
int error_count = 0;
FILE* file;
wxFileName fn;
@@ -136,17 +136,18 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wx
continue;
}
while( GetLine( file, Line, NULL, sizeof(Line) ) != NULL )
while( GetLine( file, line, NULL, sizeof( line ) ) != NULL )
{
char* text = Line;
wxString value, footprint, wtext = FROM_UTF8( Line );
value = GetQuotedText( wtext );
if( text == NULL || ( *text == 0 ) || value.IsEmpty() )
if( *line == 0 )
continue;
footprint = GetQuotedText( wtext );
wxString wtext = FROM_UTF8( line );
wxString value = GetQuotedText( wtext );
if( value.IsEmpty() )
continue;
wxString footprint = GetQuotedText( wtext );
if( footprint.IsEmpty() )
continue;
@@ -169,9 +170,7 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wx
void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
{
FOOTPRINT_EQUIVALENCE_LIST equiv_List;
COMPONENT* component;
wxString msg, error_msg;
size_t ii;
if( m_netlist.IsEmpty() )
return;
@@ -191,15 +190,13 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
// Now, associate each free component with a footprint, when the association
// is found in list
m_skipComponentSelect = true;
ii = 0;
error_msg.Empty();
for( unsigned kk = 0; kk < m_netlist.GetCount(); kk++ )
{
component = m_netlist.GetComponent( kk );
COMPONENT* component = m_netlist.GetComponent( kk );
bool found = false;
m_compListBox->SetSelection( ii++, true );
if( !component->GetFPID().empty() ) // the component has already a footprint
continue;
@@ -208,6 +205,8 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
// When happens, using the footprint filter of components can remove the ambiguity by
// filtering equivItem so one can use multiple equiv_List (for polar and
// non-polar caps for example)
wxString fpid_candidate;
for( unsigned idx = 0; idx < equiv_List.size(); idx++ )
{
FOOTPRINT_EQUIVALENCE& equivItem = equiv_List[idx];
@@ -232,13 +231,19 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
// If the equivalence is unique, no ambiguity: use the association
if( module && equ_is_unique )
{
SetNewPkg( equivItem.m_FootprintFPID );
SetNewPkg( equivItem.m_FootprintFPID, kk );
found = true;
break;
}
// Store the first candidate found in list, when equivalence is not unique
// We use it later.
if( module && fpid_candidate.IsEmpty() )
fpid_candidate = equivItem.m_FootprintFPID;
// The equivalence is not unique: use the footprint filter to try to remove
// ambiguity
// if the footprint filter does not remove ambiguity, we will use fpid_candidate
if( module )
{
size_t filtercount = component->GetFootprintFilters().GetCount();
@@ -264,13 +269,18 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
if( found )
{
SetNewPkg( equivItem.m_FootprintFPID );
SetNewPkg( equivItem.m_FootprintFPID, kk );
break;
}
}
if( found )
continue;
else if( !fpid_candidate.IsEmpty() )
{
SetNewPkg( fpid_candidate, kk );
continue;
}
// obviously the last chance: there's only one filter matching one footprint
if( 1 == component->GetFootprintFilters().GetCount() )
@@ -280,7 +290,9 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
const FOOTPRINT_INFO* module = m_footprints.GetModuleInfo( component->GetFootprintFilters()[0] );
if( module )
SetNewPkg( component->GetFootprintFilters()[0] );
{
SetNewPkg( component->GetFootprintFilters()[0], kk );
}
}
}
@@ -288,4 +300,5 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
wxMessageBox( error_msg, _( "CvPcb Warning" ), wxOK | wxICON_WARNING, this );
m_skipComponentSelect = false;
m_compListBox->Refresh();
}
-7
View File
@@ -80,7 +80,6 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER )
EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA, CVPCB_MAINFRAME::ToPreviousNA )
EVT_TOOL( ID_CVPCB_DEL_ASSOCIATIONS, CVPCB_MAINFRAME::DelAssociations )
EVT_TOOL( ID_CVPCB_AUTO_ASSOCIE, CVPCB_MAINFRAME::AutomaticFootprintMatching )
EVT_TOOL( ID_PCB_DISPLAY_FOOTPRINT_DOC, CVPCB_MAINFRAME::DisplayDocFile )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
@@ -500,12 +499,6 @@ void CVPCB_MAINFRAME::DisplayModule( wxCommandEvent& event )
}
void CVPCB_MAINFRAME::DisplayDocFile( wxCommandEvent& event )
{
GetAssociatedDocument( this, m_DocModulesFileName, &Kiface().KifaceSearch() );
}
void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
{
if( m_skipComponentSelect )
+11 -4
View File
@@ -164,8 +164,6 @@ public:
*/
void AutomaticFootprintMatching( wxCommandEvent& event );
void DisplayDocFile( wxCommandEvent& event );
/**
* Function OnSelectFilteringFootprint
* is the command event handler for enabling and disabling footprint filtering.
@@ -176,12 +174,21 @@ public:
/**
* Function SetNewPkg
* links the footprint to the current selected component
* set the footprint name for all selected components in component list
* and selects the next component.
* @param aFootprintName = the selected footprint
* @param aFootprintName = the new footprint name
*/
void SetNewPkg( const wxString& aFootprintName );
/**
* Function SetNewPkg
* Set the footprint name for the component of position aIndex in the component list
*
* @param aFootprintName = the new footprint name
* @param aIndex = the index of the component to modify in the component list
*/
void SetNewPkg( const wxString& aFootprintName, int aIndex );
void BuildCmpListBox();
void BuildFOOTPRINTS_LISTBOX();
void BuildLIBRARY_LISTBOX();
+5 -4
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, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2016 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
@@ -91,9 +91,10 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
KiBitmap( editor_xpm ) );
AddMenuItem( preferencesMenu, ID_CVPCB_EQUFILES_LIST_EDIT,
_( "Edit &Equ Files List" ),
_( "Setup equ files list (.equ files)\n"
"They are files which give the footprint name from the component value"),
_( "Footprint &Association Files" ),
_( "Configure footprint association file (.equ) list."
"These files are used to automatically assign"
"the footprint name from the component value" ),
KiBitmap( library_table_xpm ) );
// Language submenu
+50 -28
View File
@@ -48,7 +48,6 @@
void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
{
COMPONENT* component;
bool hasFootprint = false;
int componentIndex;
if( m_netlist.IsEmpty() )
@@ -71,34 +70,8 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
if( component == NULL )
return;
// Check to see if the component has already a footprint set.
hasFootprint = !component->GetFPID().empty();
SetNewPkg( aFootprintName, componentIndex );
FPID fpid;
if( !aFootprintName.IsEmpty() )
{
wxCHECK_RET( fpid.Parse( aFootprintName ) < 0,
wxString::Format( wxT( "<%s> is not a valid FPID." ),
GetChars( aFootprintName ) ) );
}
component->SetFPID( fpid );
// create the new component description
wxString description = wxString::Format( CMP_FORMAT, componentIndex + 1,
GetChars( component->GetReference() ),
GetChars( component->GetValue() ),
GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) );
// If the component hasn't had a footprint associated with it
// it now has, so we decrement the count of components without
// a footprint assigned.
if( !hasFootprint )
m_undefinedComponentCnt -= 1;
// Set the new description and deselect the processed component
m_compListBox->SetString( componentIndex, description );
m_compListBox->SetSelection( componentIndex, false );
}
@@ -116,6 +89,55 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
}
void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName, int aIndex )
{
COMPONENT* component;
if( m_netlist.IsEmpty() )
return;
component = m_netlist.GetComponent( aIndex );
if( component == NULL )
return;
// Check to see if the component has already a footprint set.
bool hasFootprint = !component->GetFPID().empty();
FPID fpid;
if( !aFootprintName.IsEmpty() )
{
wxCHECK_RET( fpid.Parse( aFootprintName ) < 0,
wxString::Format( wxT( "<%s> is not a valid FPID." ),
GetChars( aFootprintName ) ) );
}
component->SetFPID( fpid );
// create the new component description
wxString description = wxString::Format( CMP_FORMAT, aIndex + 1,
GetChars( component->GetReference() ),
GetChars( component->GetValue() ),
GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) );
// If the component hasn't had a footprint associated with it
// it now has, so we decrement the count of components without
// a footprint assigned.
if( !hasFootprint )
m_undefinedComponentCnt -= 1;
// Set the new description and deselect the processed component
m_compListBox->SetString( aIndex, description );
// Mark this "session" as modified
m_modified = true;
// update the statusbar
DisplayStatus();
}
/// Return true if the resultant FPID has a certain nickname. The guess
/// is only made if this footprint resides in only one library.
/// @return int - 0 on success, 1 on not found, 2 on ambiguous i.e. multiple matches
+2 -7
View File
@@ -2,8 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2007-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2007-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -79,11 +79,6 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
KiBitmap( delete_association_xpm ),
_( "Delete all associations (links)" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
KiBitmap( datasheet_xpm ),
_( "Display footprint documentation" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
KiBitmap( module_filtered_list_xpm ),
@@ -36,11 +36,11 @@ popt = pctl.GetPlotOptions()
popt.SetOutputDirectory(plotDir)
# Set some important plot options:
popt.SetPlotFrameRef(False)
popt.SetPlotFrameRef(False) #do not change it
popt.SetLineWidth(FromMM(0.35))
popt.SetAutoScale(False)
popt.SetScale(1)
popt.SetAutoScale(False) #do not change it
popt.SetScale(1) #do not change it
popt.SetMirror(False)
popt.SetUseGerberAttributes(True)
popt.SetUseGerberProtelExtensions(False)
@@ -100,7 +100,10 @@ drlwriter.SetMapFileFormat( PLOT_FORMAT_PDF )
mirror = False
minimalHeader = False
offset = wxPoint(0,0)
drlwriter.SetOptions( mirror, minimalHeader, offset )
# False to generate 2 separate drill files (one for plated holes, one for non plated holes)
# True to generate only one drill file
mergeNPTH = False
drlwriter.SetOptions( mirror, minimalHeader, offset, mergeNPTH )
metricFmt = True
drlwriter.SetFormat( metricFmt )
-3
View File
@@ -563,10 +563,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
return;
if( WriteDiagnosticERC( dlg.GetPath() ) )
{
Close( true );
ExecuteFile( this, Pgm().GetEditorName(), QuoteFullPath( fn ) );
}
}
}
+6
View File
@@ -136,6 +136,12 @@ void DIALOG_RESCUE_EACH::PopulateConflictList()
m_ListOfConflicts->AppendItem( data );
}
if( !m_Rescuer->m_all_candidates.empty() )
{
// Select the first choice
m_ListOfConflicts->SelectRow( 0 );
}
}
+27 -17
View File
@@ -2,8 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2008-2017 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -444,8 +444,7 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case HK_ZOOM_REDRAW:
case HK_ZOOM_CENTER:
case HK_ZOOM_AUTO:
case HK_LEAVE_SHEET:
case HK_DELETE_NODE:
// case HK_ZOOM_SELECTION:
case HK_MOVEBLOCK_TO_DRAGBLOCK: // Switch to drag mode, when block moving
case HK_SAVE_BLOCK: // Copy block to paste buffer.
cmd.SetId( hotKey->m_IdMenuEvent );
@@ -472,10 +471,12 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
}
break;
case HK_UNDO:
case HK_REDO:
case HK_UNDO: // Hot keys that map to command IDs that cannot be called
case HK_REDO: // while busy performing another command.
case HK_FIND_ITEM:
case HK_FIND_REPLACE:
case HK_DELETE_NODE:
case HK_LEAVE_SHEET:
if( notBusy )
{
cmd.SetId( hotKey->m_IdMenuEvent );
@@ -620,8 +621,6 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
cmd.SetEventObject( this );
bool itemInEdit = m_drawItem && m_drawItem->InEditMode();
/* Convert lower to upper case (the usual toupper function has problem
* with non ascii codes like function keys */
if( (aHotKey >= 'a') && (aHotKey <= 'z') )
@@ -635,6 +634,10 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
if( hotKey == NULL )
return false;
bool itemInEdit = m_drawItem && m_drawItem->InEditMode();
bool blocInProgress = GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK;
switch( hotKey->m_Idcommand )
{
default:
@@ -686,7 +689,7 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
break;
case HK_EDIT:
if( ! itemInEdit )
if( !itemInEdit )
m_drawItem = LocateItemUsingCursor( aPosition );
if( m_drawItem )
@@ -719,13 +722,21 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
break;
case HK_ROTATE:
if( ! itemInEdit )
m_drawItem = LocateItemUsingCursor( aPosition );
if( m_drawItem )
if( blocInProgress )
{
cmd.SetId( ID_LIBEDIT_ROTATE_ITEM );
GetEventHandler()->ProcessEvent( cmd );
GetScreen()->m_BlockLocate.SetCommand( BLOCK_ROTATE );
HandleBlockPlace( aDC );
}
else
{
if( !itemInEdit )
m_drawItem = LocateItemUsingCursor( aPosition );
if( m_drawItem )
{
cmd.SetId( ID_LIBEDIT_ROTATE_ITEM );
GetEventHandler()->ProcessEvent( cmd );
}
}
break;
@@ -791,8 +802,7 @@ EDA_HOTKEY* LIB_VIEW_FRAME::GetHotKeyDescription( int aCommand ) const
}
bool LIB_VIEW_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
EDA_ITEM* aItem )
bool LIB_VIEW_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem )
{
if( aHotKey == 0 )
return false;
+20 -9
View File
@@ -3,17 +3,28 @@
# See chapter 14 of eeschema.pdf
set( xsl_lst
bom2csv.xsl
bom_cvs.xsl
netlist_form_cadstar-RINF.xsl
netlist_form_cadstar.xsl
netlist_form_OrcadPcb2.xsl
netlist_form_pads-pcb.xsl
bom_with_title_block_2_csv.xsl
set( XSL_SCRIPTS_LIST
xsl_scripts/bom_with_title_block_2_csv.xsl
xsl_scripts/bom2csv.xsl
xsl_scripts/bom2grouped_csv.xsl
xsl_scripts/netlist_form_cadstar-RINF.xsl
xsl_scripts/netlist_form_cadstar.xsl
xsl_scripts/netlist_form_OrcadPcb2.xsl
xsl_scripts/netlist_form_pads-pcb.xsl
)
install( FILES ${xsl_lst}
set( PYTHON_SCRIPTS_LIST
python_scripts/README-bom.txt
python_scripts/kicad_netlist_reader.py
python_scripts/bom_csv_grouped_by_value.py
python_scripts/bom_csv_grouped_by_value_with_fp.py
python_scripts/bom_csv_sorted_by_ref.py
python_scripts/bom_html_grouped_by_value.py
python_scripts/bom_html_with_advanced_grouping.py
python_scripts/bom_sorted_by_ref.py
)
install( FILES ${XSL_SCRIPTS_LIST} ${PYTHON_SCRIPTS_LIST}
DESTINATION ${KICAD_PLUGINS}
COMPONENT binary
)
-45
View File
@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--XSL style sheet that takes EESCHEMA's Generic Netlist Format as input and
outputs a simple BOM in CSV format. Feel free to enhance this and submit
patches.
How to use:
Eeschema.pdf: chapter 14
-->
<!--
@package
Generate a comma separated value BOM list (csv file type).
Components are sorted by value
One component per line
Fields are
Quantity, 'Part name', Description, lib
-->
<!DOCTYPE xsl:stylesheet [
<!ENTITY nl "&#xd;&#xa;"> <!--new line CR, LF -->
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<!-- for each component -->
<xsl:template match="libpart">
<!-- -->
<xsl:value-of select="count(//comp/libsource/@part[@part])"/><xsl:text>,"</xsl:text>
<xsl:value-of select="@part"/><xsl:text>","</xsl:text>
<xsl:value-of select="description"/><xsl:text>","</xsl:text>
<xsl:value-of select="@lib"/>
<xsl:text>"&nl;</xsl:text>
</xsl:template>
<xsl:template match="/export">
<xsl:text>Qty,partname,description,lib&nl;</xsl:text>
<xsl:apply-templates select="libparts/libpart"/>
</xsl:template>
</xsl:stylesheet>
@@ -9,6 +9,9 @@
Components are sorted by ref and grouped by value
Fields are (if exist)
Item, Qty, Reference(s), Value, LibPart, Footprint, Datasheet
Command line:
python "pathToFile/bom_csv_grouped_by_value.py" "%I" "%O.csv"
"""
from __future__ import print_function
@@ -25,7 +28,6 @@ def myEqu(self, other):
In this example of a custom equivalency operator we compare the
value, the part name and the footprint.
"""
result = True
if self.getValue() != other.getValue():
@@ -76,7 +78,7 @@ columnset = compfields | partfields # union
columns = ['Item', 'Qty', 'Reference(s)', 'Value', 'LibPart', 'Footprint', 'Datasheet'] + sorted(list(columnset))
# Create a new csv writer object to use as the output formatter
out = csv.writer( f, lineterminator='\n', delimiter=',', quotechar='\"', quoting=csv.QUOTE_MINIMAL )
out = csv.writer( f, lineterminator='\n', delimiter=',', quotechar='\"', quoting=csv.QUOTE_ALL )
# override csv.writer's writerow() to support encoding conversion (initial encoding is utf8):
def writerow( acsvwriter, columns ):
@@ -10,6 +10,9 @@
Components are sorted by ref and grouped by value with same footprint
Fields are (if exist)
'Ref', 'Qnty', 'Value', 'Cmp name', 'Footprint', 'Description', 'Vendor'
Command line:
python "pathToFile/bom_csv_grouped_by_value_with_fp.py" "%I" "%O.csv"
"""
# Import the KiCad python helper module and the csv formatter
@@ -11,6 +11,9 @@
One component per line
Fields are (if exist)
Ref, value, Part, footprint, Datasheet, Manufacturer, Vendor
Command line:
python "pathToFile/bom_csv_sorted_by_ref.py" "%I" "%O.csv"
"""
from __future__ import print_function
@@ -9,6 +9,9 @@
Components are sorted by ref and grouped by value
Fields are (if exist)
Ref, Quantity, Value, Part, Datasheet, Description, Vendor
Command line:
python "pathToFile/bom_html_grouped_by_value.py" "%I" "%O.html"
"""
from __future__ import print_function
@@ -10,6 +10,9 @@
Components are sorted and grouped by value
Fields are (if exist)
Ref, Quantity, Value, Part, Footprint, Description, Vendor
Command line:
python "pathToFile/bom_with_advanced_grouping.py" "%I" "%O.html"
"""
@@ -3,12 +3,15 @@
#
"""
@package
Generate a BOM list file.
Generate a BOM list file (a simple text).
Components are sorted by ref
One component per line
Fields are (if exist)
Ref, Quantity, value, Part, footprint, Description, Vendor
Fields are separated by tabs
Command line:
python "pathToFile/bom_sorted_by_ref.py" "%I" "%O.txt"
"""
from __future__ import print_function
@@ -25,6 +25,9 @@
One component per line
Fields are
Ref,Value, Footprint, Datasheet, Field5, Field4, price
Command line
xsltproc -o "%O.csv" "pathToFile/bom2csv.xsl" "%I"
-->
<!DOCTYPE xsl:stylesheet [
@@ -55,10 +58,11 @@
<!-- the table entries -->
<xsl:template match="components/comp">
<xsl:value-of select="@ref"/><xsl:text>,</xsl:text>
<xsl:value-of select="value"/><xsl:text>,</xsl:text>
<xsl:value-of select="footprint"/><xsl:text>,</xsl:text>
<xsl:value-of select="datasheet"/>
<xsl:text>"</xsl:text>
<xsl:value-of select="@ref"/><xsl:text>","</xsl:text>
<xsl:value-of select="value"/><xsl:text>","</xsl:text>
<xsl:value-of select="footprint"/><xsl:text>","</xsl:text>
<xsl:value-of select="datasheet"/><xsl:text>"</xsl:text>
<xsl:apply-templates select="fields"/>
<xsl:text>&nl;</xsl:text>
</xsl:template>
@@ -72,7 +76,7 @@
<!-- for all existing head entries -->
<xsl:for-each select="/export/components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
<xsl:variable name="allnames" select="@name"/>
<xsl:text>,</xsl:text>
<xsl:text>,"</xsl:text>
<!-- for all field entries in the remembered fields section -->
<xsl:for-each select="$fieldvar">
@@ -87,6 +91,8 @@
Every non-blank entry is assigned to its proper column.
-->
</xsl:for-each>
<xsl:text>"</xsl:text>
</xsl:for-each>
</xsl:template>
@@ -0,0 +1,104 @@
<!--XSL style sheet to convert EESCHEMA XML Partlist Format to grouped CSV BOM Format
Copyright (C) 2014, Wolf Walter.
Copyright (C) 2013, Stefan Helmert.
GPL v2.
Functionality:
Generation of Digi-Key ordering system compatible BOM
How to use this is explained in eeschema.pdf chapter 14. You enter a command line into the
netlist exporter using a new (custom) tab in the netlist export dialog.
The command line is
xsltproc -o "%O.csv" "FullPathToFile/bom2groupedCsv.xsl" "%I"
-->
<!--
@package
Functionality:
* Generate a comma separated value BOM list (csv file type).
* Components are sorted by ref and grouped by same value+footprint
One value per line
Fields are
Reference, Quantity, Value, Footprint, Datasheet
The command line is
xsltproc -o "%O.csv" "FullPathToFile/bom2groupedCsv.xsl" "%I"
-->
<!DOCTYPE xsl:stylesheet [
<!ENTITY nl "&#xd;&#xa;"> <!--new line CR, LF, or LF, your choice -->
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<!-- for Muenchian grouping of footprint and value combination -->
<xsl:key name="partTypeByValueAndFootprint" match="comp" use="concat(footprint, '-', value)" />
<!-- for table head and empty table fields-->
<xsl:key name="headentr" match="field" use="@name"/>
<!-- main part -->
<xsl:template match="/export">
<xsl:text>Reference, Quantity, Value, Footprint, Datasheet</xsl:text>
<!-- find all existing table head entries and list each one once -->
<xsl:for-each select="components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
<xsl:text>, </xsl:text>
<xsl:value-of select="@name"/>
</xsl:for-each>
<!-- all table entries -->
<xsl:apply-templates select="components"/>
</xsl:template>
<xsl:template match="components">
<!-- for Muenchian grouping of footprint and value combination -->
<xsl:for-each select="comp[count(. | key('partTypeByValueAndFootprint', concat(footprint, '-', value))[1]) = 1]">
<xsl:sort select="@ref" />
<xsl:text>&nl;</xsl:text>
<!-- list of all references -->
<xsl:for-each select="key('partTypeByValueAndFootprint', concat(footprint, '-', value))">
<xsl:sort select="@ref" />
<xsl:value-of select="@ref"/><xsl:text> </xsl:text>
</xsl:for-each><xsl:text>,</xsl:text>
<!-- quantity of parts with same footprint and value -->
<xsl:value-of select="count(key('partTypeByValueAndFootprint', concat(footprint, '-', value)))"/><xsl:text>,</xsl:text>
<xsl:text>"</xsl:text>
<xsl:value-of select="value"/><xsl:text>","</xsl:text>
<xsl:value-of select="footprint"/><xsl:text>","</xsl:text>
<xsl:value-of select="datasheet"/><xsl:text>"</xsl:text>
<xsl:apply-templates select="fields"/>
</xsl:for-each>
</xsl:template>
<!-- table entries with dynamic table head -->
<xsl:template match="fields">
<!-- remember current fields section -->
<xsl:variable name="fieldvar" select="field"/>
<!-- for all existing head entries -->
<xsl:for-each select="/export/components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
<xsl:variable name="allnames" select="@name"/>
<xsl:text>,"</xsl:text>
<!-- for all field entries in the remembered fields section -->
<xsl:for-each select="$fieldvar">
<!-- only if this field entry exists in this fields section -->
<xsl:if test="@name=$allnames">
<!-- content of the field -->
<xsl:value-of select="."/>
<xsl:text>"</xsl:text>
</xsl:if>
<!--
If it does not exist, use an empty cell in output for this row.
Every non-blank entry is assigned to its proper column.
-->
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
@@ -1,26 +1,19 @@
<!--
@package
EESCHEMA BOM plugin. Creates BOM CSV files from the project net file.
Based on Stefan Helmert bom2csv.xsl
Note:
The project infomation (i.e title, company and revision) is taken from and the root sheet.
The project infomation (i.e title, company and revision) is taken from the root sheet.
Arthur:
Ronald Sousa HashDefineElectronics.com
Usage:
on Windows:
xsltproc -o "%O.csv" "C:\Program Files (x86)\KiCad\bin\plugins\bom2csv.xsl" "%I"
on Linux:
xsltproc -o "%O.csv" /usr/local/lib/kicad/plugins/bom2csv.xsl "%I"
Ouput Example:
Source,
Kicad Rev, working director and file source
Generated Date, date this file was generated
Title, the project's tile
Title, the project's title
Company, the project's company
Rev, the project's revision
Date Source, project's issue date
@@ -28,9 +21,15 @@
Comment, This is comment 2
Comment, This is comment 3
Comment, This is comment 4
-->
<!--
@package
Output format
Reference, Value, Fields[n], Library, Library Ref
U1, PIC32MX, Fields[n], KicadLib, PIC
Command line:
xsltproc -o "%O.csv" "pathToFile/bom2csv.xsl" "%I"
-->
<!DOCTYPE xsl:stylesheet [
-3
View File
@@ -206,9 +206,6 @@ void SCH_SHEET_PIN::ConstrainOnEdge( wxPoint Pos )
if( m_Pos.x > (sheet->m_pos.x + sheet->m_size.x) )
m_Pos.x = sheet->m_pos.x + sheet->m_size.x;
}
printf( "centre %d %d, pos %d %d, pinpos %d %d, edge %d\n",
center.x, center.y, Pos.x, Pos.y, m_Pos.x, m_Pos.y, m_edge);
}
+1 -6
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 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2016-2017 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
@@ -126,11 +126,6 @@ bool SCH_FIELD_VALIDATOR::Validate( wxWindow *aParent )
errorMsg.Printf( _( "The %s field cannot contain %s characters." ), fieldName, badChars );
}
else if( (tmp.Trim().Length() != val.Length()) || (tmp.Trim( false ).Length() != val.Length()) )
{
errorMsg.Printf( _( "The %s field cannot contain leading and/or trailing white space." ),
fieldName );
}
if ( !errorMsg.empty() )
{
+14 -7
View File
@@ -2,8 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2009-2017 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2017 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
@@ -115,6 +115,7 @@ void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem )
if( component )
component->GetDrawItemList().sort();
OnModify( );
MSG_PANEL_ITEMS items;
@@ -206,11 +207,17 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_PART* LibEntry, wxDC* DC )
if( m_drawItem )
{
m_drawItem->BeginEdit( IS_NEW, drawPos );
m_drawItem->SetWidth( m_drawLineWidth );
m_drawItem->SetFillMode( m_drawFillStyle );
// Don't set line parameters for text objects.
if( m_drawItem->Type() != LIB_TEXT_T )
{
m_drawItem->SetWidth( m_drawLineWidth );
m_drawItem->SetFillMode( m_drawFillStyle );
}
if( m_drawSpecificUnit )
m_drawItem->SetUnit( m_unit );
if( m_drawSpecificConvert )
m_drawItem->SetConvert( m_convert );
@@ -322,14 +329,14 @@ static void SymbolDisplayDraw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
return;
item->SetEraseLastDrawItem( aErase );
item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ), UNSPECIFIED_COLOR, g_XorMode, NULL,
DefaultTransform );
item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ), UNSPECIFIED_COLOR,
g_XorMode, NULL, DefaultTransform );
}
void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
{
if( LIB_PART* part = GetCurPart() )
if( LIB_PART* part = GetCurPart() )
{
if( !m_drawItem )
return;
+10 -9
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -74,6 +74,8 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
_( "Print schematic" ) );
m_mainToolBar->AddTool( ID_GEN_PLOT_SCHEMATIC, wxEmptyString, KiBitmap( plot_xpm ),
_( "Plot schematic" ) );
m_mainToolBar->AddSeparator();
@@ -138,6 +140,10 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->AddTool( ID_TO_LIBVIEW, wxEmptyString, KiBitmap( library_browse_xpm ),
HELP_RUN_LIB_VIEWER );
// modedit is with libedit in a "library section" because the user must have footprints before
// they can be assigned.
m_mainToolBar->AddTool( ID_RUN_PCB_MODULE_EDITOR, wxEmptyString, KiBitmap( module_editor_xpm ),
_( "Footprint Editor" ) );
m_mainToolBar->AddSeparator();
@@ -147,6 +153,9 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->AddTool( ID_GET_ERC, wxEmptyString, KiBitmap( erc_xpm ),
_( "Perform electrical rules check" ) );
m_mainToolBar->AddTool( ID_RUN_CVPCB, wxEmptyString, KiBitmap( cvpcb_xpm ),
_( "Run CvPcb to associate components and footprints" ) );
m_mainToolBar->AddTool( ID_GET_NETLIST, wxEmptyString, KiBitmap( netlist_xpm ),
_( "Generate netlist" ) );
@@ -156,14 +165,6 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->AddSeparator();
// The user must have footprints before he can assign them. So put this before CvPcb.
m_mainToolBar->AddTool( ID_RUN_PCB_MODULE_EDITOR, wxEmptyString, KiBitmap( module_editor_xpm ),
_( "Footprint Editor" ) );
m_mainToolBar->AddTool( ID_RUN_CVPCB, wxEmptyString, KiBitmap( cvpcb_xpm ),
_( "Run CvPcb to associate components and footprints" ) );
m_mainToolBar->AddTool( ID_RUN_PCB, wxEmptyString, KiBitmap( pcbnew_xpm ),
_( "Run Pcbnew to layout printed circuit board" ) );
@@ -162,17 +162,17 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
{
msg = _( "Layer" );
msg << wxT( " " ) << ii + 1;
m_BoxSelectLayer[ii] = new wxCheckBox( this, -1, msg );
if( g_GERBER_List.GetGbrImage( ii ) == NULL ) // Nothing loaded on this draw layer
wxStaticBoxSizer* boxSizer = ( ii < 16 ) ? m_leftLayersBoxSizer
: m_rightLayersBoxSizer;
m_BoxSelectLayer[ii] = new wxCheckBox( boxSizer->GetStaticBox(),
wxID_ANY, msg );
boxSizer->Add( m_BoxSelectLayer[ii], wxGROW | wxLEFT | wxRIGHT | wxTOP );
if( g_GERBER_List.GetGbrImage( ii ) == NULL )
// Nothing loaded on this draw layer
m_BoxSelectLayer[ii]->Enable( false );
if( ii < 16 )
m_leftLayersBoxSizer->Add( m_BoxSelectLayer[ii],
wxGROW | wxLEFT | wxRIGHT | wxTOP );
else
m_rightLayersBoxSizer->Add( m_BoxSelectLayer[ii],
wxGROW | wxLEFT | wxRIGHT | wxTOP );
}
// Read the scale adjust option
+2 -5
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) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2009-2016 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -255,9 +255,6 @@ enum main_id
ID_EDA_SOCKET_EVENT_SERV,
ID_EDA_SOCKET_EVENT,
// Command IDs common to Pcbnew and CvPcb.
ID_PCB_DISPLAY_FOOTPRINT_DOC,
// Common to all
ID_TB_OPTIONS_SELECT_UNIT_MM,
ID_TB_OPTIONS_SELECT_UNIT_INCH,
+108
View File
@@ -0,0 +1,108 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef KICAD_CURL_H_
#define KICAD_CURL_H_
/*
* KICAD_CURL.h must be included before wxWidgets because on Windows,
* wxWidgets ends up including windows.h before winsocks2.h inside curl
* this causes build warnings
* Because we are before wx, we must explicitly define we are building with unicode.
* wxWidgets defaults to supporting unicode now, so this should be safe.
*/
#if defined(WIN32)
#ifndef UNICODE
# define UNICODE
#endif
#ifndef _UNICODE
# define _UNICODE
#endif
#endif
#include <curl/curl.h>
#include <string>
// CURL_EXTERN expands to dllimport on MinGW which causes gcc warnings. This really should
// expand to nothing on MinGW.
#if defined( __MINGW32__)
# if defined( CURL_EXTERN )
# undef CURL_EXTERN
# define CURL_EXTERN
# endif
#endif
struct DYN_LOOKUP;
/**
* Class KICAD_CURL
* simple wrapper class to call curl_global_init and curl_global_cleanup for KiCad.
*/
class KICAD_CURL
{
friend class KICAD_CURL_EASY;
public:
/**
* Function Init
* calls curl_global_init for the application. It must be used only once
* and before any curl functions that perform requests.
*
* @return bool - True if successful, false if CURL returned an error
* @throw IO_ERROR on failure, hopefully with helpful text in it.
*/
static void Init();
/**
* Function Cleanup
* calls curl_global_cleanup for the application. It must be used only after
* curl_global_init was called.
*/
static void Cleanup();
/**
* Function GetVersion
* wrapper for curl_version(). Reports back a short string of loaded libraries.
*
* @return const char* - String reported by libcurl and owned by it.
* @throw IO_ERROR on failure, hopefully with helpful text in it.
*/
static const char* GetVersion()
{
return curl_version();
}
/**
* Function GetSimpleVersion
* Reports back curl version only and SSL library support
*
* @return std::string - Generated version string
*/
static std::string GetSimpleVersion();
};
#endif // KICAD_CURL_H_
+184
View File
@@ -0,0 +1,184 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef KICAD_CURL_EASY_H_
#define KICAD_CURL_EASY_H_
/*
* KICAD_CURL_EASY.h must included before wxWidgets because on Windows,
* wxWidgets ends up including windows.h before winsocks2.h inside curl
* this causes build warnings
* Because we are before wx, we must explicitly define we are building with unicode
* wxWidgets defaults to supporting unicode now, so this should be safe.
*/
#if defined(WIN32)
#ifndef UNICODE
# define UNICODE
#endif
#ifndef _UNICODE
# define _UNICODE
#endif
#endif
#include <string>
#include <curl/curl.h>
#include <kicad_curl/kicad_curl.h>
/**
* Class KICAD_CURL_EASY
* wrapper interface around the curl_easy API
*
* Handling of using the curl_easy API to make a request and save the response to
* a memory buffer
*
* Here is a small example usage:
* @code
* KICAD_CURL_EASY curl;
*
* curl.SetURL( "http://github.com" );
* curl.SetUserAgent( <http-client-indentifier> );
* curl.SetHeader( "Accept", "application/json" );
* curl.Perform();
* @endcode
*/
class KICAD_CURL_EASY
{
public:
KICAD_CURL_EASY();
~KICAD_CURL_EASY();
/**
* Function perform
* equivalent to curl_easy_perform. Executes the request
* that was previously setup.
*
* @throw IO_ERROR, if there is a CURL request error
*/
void Perform();
/**
* Function SetHeader
* sets an arbitrary header for the HTTP(s) request.
*
* @param aName is the left hand side of the header, i.e. Accept without the colon
* @param aValue is the right hand side of the header, i.e. application/json
*/
void SetHeader( const std::string& aName, const std::string& aValue )
{
std::string header = aName + ':' + aValue;
m_headers = curl_slist_append( m_headers, header.c_str() );
}
/**
* Function SetUserAgent
* sets the request user agent
*
* @param aAgent is the string to set for the user agent
* @return bool - True if successful, false if not
*/
bool SetUserAgent( const std::string& aAgent )
{
if( SetOption<const char*>( CURLOPT_USERAGENT, aAgent.c_str() ) == CURLE_OK )
{
return true;
}
return false;
}
/**
* Function SetURL
* sets the request URL
*
* @param aURL is the URL
* @return bool - True if successful, false if not
*/
bool SetURL( const std::string& aURL )
{
if( SetOption<const char *>( CURLOPT_URL, aURL.c_str() ) == CURLE_OK )
{
return true;
}
return false;
}
/**
* Function SetFollowRedirects
* enables the following of HTTP(s) and other redirects, by default curl
* does not follow redirects.
*
* @param aFollow is a boolean where true will enable following redirects
* @return bool - True if successful, false if not
*/
bool SetFollowRedirects( bool aFollow )
{
if( SetOption<long>( CURLOPT_FOLLOWLOCATION , (aFollow ? 1 : 0) ) == CURLE_OK )
{
return true;
}
return false;
}
/**
* Function GetErrorText
* fetches CURL's "friendly" error string for a given error code
*
* @param aCode is CURL error code
* @return const std::string - the corresponding error string for the given code
*/
const std::string GetErrorText( CURLcode aCode )
{
return curl_easy_strerror( aCode );
}
/**
* Function SetOption
* sets a curl option, only supports single parameter curl options
*
* @param aOption is CURL option, see CURL manual for options
* @param aArg is the argument being passed to CURL, ensure it is the right type per manual
* @return CURLcode - CURL error code, will return CURLE_OK unless a problem was encountered
*/
template <typename T> CURLcode SetOption( CURLoption aOption, T aArg )
{
return curl_easy_setopt( m_CURL, aOption, aArg );
}
/**
* Function GetBuffer
* returns a const reference to the recevied data buffer
*/
const std::string& GetBuffer()
{
return m_buffer;
}
private:
CURL* m_CURL;
curl_slist* m_headers;
std::string m_buffer;
};
#endif // KICAD_CURL_EASY_H_
+8
View File
@@ -75,6 +75,7 @@ namespace PCB { struct IFACE; } // KIFACE_I is in pcbnew.cpp
*/
#define PCB_EDIT_FRAME_NAME wxT( "PcbFrame" )
class PCB_EDIT_FRAME : public PCB_BASE_EDIT_FRAME
{
friend struct PCB::IFACE;
@@ -227,6 +228,13 @@ public:
void OnQuit( wxCommandEvent& event );
/**
* Function GetAutoSaveFilePrefix
*
* @return the string to prepend to a file name for automatic save.
*/
static wxString GetAutoSaveFilePrefix();
/**
* Execute a remote command send by Eeschema via a socket,
* port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242)
+10 -3
View File
@@ -5,8 +5,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2015 Jean-Pierre Charras
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2017 Jean-Pierre Charras
* Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -168,7 +168,7 @@ void KICAD_MANAGER_FRAME::OnArchiveFiles( wxCommandEvent& event )
wxString currdirname = fileName.GetPathWithSep();
wxDir dir( currdirname );
if( !dir.IsOpened() )
if( !dir.IsOpened() ) // wxWidgets display a error message on issue.
return;
wxSetWorkingDirectory( currdirname );
@@ -177,6 +177,13 @@ void KICAD_MANAGER_FRAME::OnArchiveFiles( wxCommandEvent& event )
wxString zipfilename = zip.GetFullPath();
wxFFileOutputStream ostream( zipfilename );
if( !ostream.IsOk() ) // issue to create the file. Perhaps not writable dir
{
wxMessageBox( wxString::Format( _( "Unable to create zip archive file '%s'" ), zipfilename ) );
return;
}
wxZipOutputStream zipstream( ostream );
// Build list of filenames to put in zip archive
+8 -1
View File
@@ -239,11 +239,18 @@ void WORKSHEET_LAYOUT_IO::format( WORKSHEET_DATAITEM_TEXT* aItem, int aNestLevel
// Write font info, only if it is not the default setup
bool write_size = aItem->m_TextSize.x != 0.0 || aItem->m_TextSize.y != 0.0;
bool write_thickness = aItem->m_LineWidth != 0.0;
if( write_size || aItem->IsBold() || aItem->IsItalic() )
if( write_thickness || write_size || aItem->IsBold() || aItem->IsItalic() )
{
m_out->Print( 0, " (%s", getTokenName( T_font ) );
if( write_thickness )
{
m_out->Print( 0, " (%s %s)", getTokenName( T_linewidth ),
double2Str(aItem->m_LineWidth ).c_str() );
}
if( write_size )
{
m_out->Print( 0, " (%s %s %s)", getTokenName( T_size ),
+2 -2
View File
@@ -424,11 +424,11 @@ if( KICAD_SCRIPTING_MODULES )
pcad2kicadpcb
lib_dxf
idf3
${GITHUB_PLUGIN_LIBRARIES}
polygon
bitmaps
gal
${wxWidgets_LIBRARIES}
${GITHUB_PLUGIN_LIBRARIES}
${GDI_PLUS_LIBRARIES}
${PYTHON_LIBRARIES}
${PCBNEW_EXTRA_LIBS}
@@ -594,8 +594,8 @@ target_link_libraries( pcbnew_kiface
gal
lib_dxf
idf3
${GITHUB_PLUGIN_LIBRARIES}
${wxWidgets_LIBRARIES}
${GITHUB_PLUGIN_LIBRARIES}
${GDI_PLUS_LIBRARIES}
${PYTHON_LIBRARIES}
${Boost_LIBRARIES} # must follow GITHUB
+1 -1
View File
@@ -612,7 +612,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset, bool force_all )
tmpz.x = -tmpz.x;
pad->SetDelta( tmpz );
pad->SetOrientation( 1800 - pad->GetOrientation() );
pad->SetOrientation( - pad->GetOrientation() );
}
for( EDA_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
@@ -230,14 +230,15 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet(
if( outline->GetLayer() != aLayer )
break;
outline->TransformShapeWithClearanceToPolygon( aCornerBuffer,
0,
aCircleToSegmentsCount,
aCorrectionFactor );
break;
default:
break;
outline->TransformShapeWithClearanceToPolygon( aCornerBuffer,
0,
aCircleToSegmentsCount,
aCorrectionFactor );
break;
default:
break;
}
}
-5
View File
@@ -337,11 +337,6 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName, bool aOnlyO
plot_opts.SetMirror( m_printMirror );
plot_opts.SetFormat( PLOT_FORMAT_SVG );
EDA_COLOR_T color = UNSPECIFIED_COLOR; // Used layer color to plot ref and value
plot_opts.SetReferenceColor( color );
plot_opts.SetValueColor( color );
PAGE_INFO pageInfo = m_board->GetPageSettings();
wxPoint axisorigin = m_board->GetAuxOrigin();
+273 -280
View File
@@ -1,280 +1,273 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_copper_zones_base.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DIALOG_COPPER_ZONE_BASE, DIALOG_SHIM )
EVT_CLOSE( DIALOG_COPPER_ZONE_BASE::_wxFB_OnClose )
EVT_CHOICE( ID_M_NETDISPLAYOPTION, DIALOG_COPPER_ZONE_BASE::_wxFB_OnNetSortingOptionSelected )
EVT_TEXT_ENTER( ID_TEXTCTRL_NETNAMES_FILTER, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
EVT_TEXT_ENTER( ID_TEXTCTRL_NETNAMES_FILTER, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
EVT_BUTTON( wxID_APPLY_FILTERS, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
EVT_CHOICE( ID_CORNER_SMOOTHING, DIALOG_COPPER_ZONE_BASE::_wxFB_OnCornerSmoothingModeChoice )
EVT_CHOICE( ID_M_PADINZONEOPT, DIALOG_COPPER_ZONE_BASE::_wxFB_OnPadsInZoneClick )
EVT_BUTTON( wxID_BUTTON_EXPORT, DIALOG_COPPER_ZONE_BASE::_wxFB_ExportSetupToOtherCopperZones )
EVT_BUTTON( wxID_CANCEL, DIALOG_COPPER_ZONE_BASE::_wxFB_OnButtonCancelClick )
EVT_BUTTON( wxID_OK, DIALOG_COPPER_ZONE_BASE::_wxFB_OnButtonOkClick )
END_EVENT_TABLE()
DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
m_MainBoxSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_OptionsBoxSizer;
m_OptionsBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_layerSizer;
m_layerSizer = new wxBoxSizer( wxVERTICAL );
m_staticText17 = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText17->Wrap( -1 );
m_layerSizer->Add( m_staticText17, 0, wxTOP|wxRIGHT, 5 );
m_LayerSelectionCtrl = new wxListView( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ALIGN_LEFT|wxLC_NO_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL );
m_layerSizer->Add( m_LayerSelectionCtrl, 1, wxRIGHT, 5 );
m_OptionsBoxSizer->Add( m_layerSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerNets;
bSizerNets = new wxBoxSizer( wxVERTICAL );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
bSizerNets->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
bSizerNets->Add( m_ListNetNameSelection, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( bSizerNets, 1, wxEXPAND, 5 );
wxStaticBoxSizer* m_NetSortOptSizer;
m_NetSortOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Filtering") ), wxVERTICAL );
m_staticText16 = new wxStaticText( m_NetSortOptSizer->GetStaticBox(), wxID_ANY, _("Display:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText16->Wrap( -1 );
m_NetSortOptSizer->Add( m_staticText16, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_NetDisplayOptionChoices[] = { _("Show all (alphabetical)"), _("Show all (pad count)"), _("Filtered (alphabetical)"), _("Filtered (pad count)") };
int m_NetDisplayOptionNChoices = sizeof( m_NetDisplayOptionChoices ) / sizeof( wxString );
m_NetDisplayOption = new wxChoice( m_NetSortOptSizer->GetStaticBox(), ID_M_NETDISPLAYOPTION, wxDefaultPosition, wxDefaultSize, m_NetDisplayOptionNChoices, m_NetDisplayOptionChoices, 0 );
m_NetDisplayOption->SetSelection( 0 );
m_NetSortOptSizer->Add( m_NetDisplayOption, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_staticText5 = new wxStaticText( m_NetSortOptSizer->GetStaticBox(), wxID_ANY, _("Hidden net filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
m_NetSortOptSizer->Add( m_staticText5, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_DoNotShowNetNameFilter = new wxTextCtrl( m_NetSortOptSizer->GetStaticBox(), ID_TEXTCTRL_NETNAMES_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_DoNotShowNetNameFilter->SetMaxLength( 0 );
m_DoNotShowNetNameFilter->SetToolTip( _("Pattern to filter net names in filtered list.\nNet names matching this pattern are not displayed.") );
m_NetSortOptSizer->Add( m_DoNotShowNetNameFilter, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText51 = new wxStaticText( m_NetSortOptSizer->GetStaticBox(), wxID_ANY, _("Visible net filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText51->Wrap( -1 );
m_NetSortOptSizer->Add( m_staticText51, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ShowNetNameFilter = new wxTextCtrl( m_NetSortOptSizer->GetStaticBox(), ID_TEXTCTRL_NETNAMES_FILTER, _("*"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_ShowNetNameFilter->SetMaxLength( 0 );
m_ShowNetNameFilter->SetToolTip( _("Pattern to filter net names in filtered list.\nOnly net names matching this pattern are displayed.") );
m_NetSortOptSizer->Add( m_ShowNetNameFilter, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_buttonRunFilter = new wxButton( m_NetSortOptSizer->GetStaticBox(), wxID_APPLY_FILTERS, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
m_NetSortOptSizer->Add( m_buttonRunFilter, 0, wxALL|wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_NetSortOptSizer, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_MainBoxSizer->Add( m_OptionsBoxSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* m_ExportableSetupSizer;
m_ExportableSetupSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Settings") ), wxHORIZONTAL );
wxBoxSizer* bSizerSettings;
bSizerSettings = new wxBoxSizer( wxVERTICAL );
m_ClearanceValueTitle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Clearance"), wxDefaultPosition, wxDefaultSize, 0 );
m_ClearanceValueTitle->Wrap( -1 );
bSizerSettings->Add( m_ClearanceValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ZoneClearanceCtrl = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_ZoneClearanceCtrl->SetMaxLength( 0 );
bSizerSettings->Add( m_ZoneClearanceCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_MinThicknessValueTitle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Minimum width"), wxDefaultPosition, wxDefaultSize, 0 );
m_MinThicknessValueTitle->Wrap( -1 );
m_MinThicknessValueTitle->SetToolTip( _("Minimum thickness of filled areas.") );
bSizerSettings->Add( m_MinThicknessValueTitle, 0, wxRIGHT|wxLEFT, 5 );
m_ZoneMinThicknessCtrl = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_ZoneMinThicknessCtrl->SetMaxLength( 0 );
bSizerSettings->Add( m_ZoneMinThicknessCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText151 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Corner smoothing:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText151->Wrap( -1 );
bSizerSettings->Add( m_staticText151, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_cornerSmoothingChoiceChoices[] = { _("None"), _("Chamfer"), _("Fillet") };
int m_cornerSmoothingChoiceNChoices = sizeof( m_cornerSmoothingChoiceChoices ) / sizeof( wxString );
m_cornerSmoothingChoice = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_CORNER_SMOOTHING, wxDefaultPosition, wxDefaultSize, m_cornerSmoothingChoiceNChoices, m_cornerSmoothingChoiceChoices, 0 );
m_cornerSmoothingChoice->SetSelection( 0 );
bSizerSettings->Add( m_cornerSmoothingChoice, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_cornerSmoothingTitle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Chamfer distance (mm):"), wxDefaultPosition, wxDefaultSize, 0 );
m_cornerSmoothingTitle->Wrap( -1 );
bSizerSettings->Add( m_cornerSmoothingTitle, 0, wxRIGHT|wxLEFT, 5 );
m_cornerSmoothingCtrl = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), ID_M_CORNERSMOOTHINGCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_cornerSmoothingCtrl->SetMaxLength( 0 );
bSizerSettings->Add( m_cornerSmoothingCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( bSizerSettings, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerPadsConnection;
bSizerPadsConnection = new wxBoxSizer( wxVERTICAL );
m_staticText13 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Pad connection:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText13->Wrap( -1 );
bSizerPadsConnection->Add( m_staticText13, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_PadInZoneOptChoices[] = { _("Solid"), _("Thermal relief"), _("THT thermal"), _("None") };
int m_PadInZoneOptNChoices = sizeof( m_PadInZoneOptChoices ) / sizeof( wxString );
m_PadInZoneOpt = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_PADINZONEOPT, wxDefaultPosition, wxDefaultSize, m_PadInZoneOptNChoices, m_PadInZoneOptChoices, 0 );
m_PadInZoneOpt->SetSelection( 0 );
bSizerPadsConnection->Add( m_PadInZoneOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
wxStaticBoxSizer* m_ThermalShapesParamsSizer;
m_ThermalShapesParamsSizer = new wxStaticBoxSizer( new wxStaticBox( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Thermal Reliefs") ), wxVERTICAL );
m_AntipadSizeText = new wxStaticText( m_ThermalShapesParamsSizer->GetStaticBox(), wxID_ANY, _("Antipad clearance"), wxDefaultPosition, wxDefaultSize, 0 );
m_AntipadSizeText->Wrap( -1 );
m_ThermalShapesParamsSizer->Add( m_AntipadSizeText, 0, wxTOP|wxRIGHT, 5 );
m_AntipadSizeValue = new wxTextCtrl( m_ThermalShapesParamsSizer->GetStaticBox(), wxID_ANTIPAD_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_AntipadSizeValue->SetMaxLength( 0 );
m_AntipadSizeValue->SetToolTip( _("Clearance between pads in the same net and filled areas.") );
m_ThermalShapesParamsSizer->Add( m_AntipadSizeValue, 0, wxEXPAND|wxBOTTOM, 5 );
m_CopperBridgeWidthText = new wxStaticText( m_ThermalShapesParamsSizer->GetStaticBox(), wxID_ANY, _("Spoke width"), wxDefaultPosition, wxDefaultSize, 0 );
m_CopperBridgeWidthText->Wrap( -1 );
m_ThermalShapesParamsSizer->Add( m_CopperBridgeWidthText, 0, wxTOP|wxRIGHT, 5 );
m_CopperWidthValue = new wxTextCtrl( m_ThermalShapesParamsSizer->GetStaticBox(), wxID_COPPER_BRIDGE_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_CopperWidthValue->SetMaxLength( 0 );
m_CopperWidthValue->SetToolTip( _("Width of copper in thermal reliefs.") );
m_ThermalShapesParamsSizer->Add( m_CopperWidthValue, 0, wxEXPAND|wxBOTTOM, 5 );
bSizerPadsConnection->Add( m_ThermalShapesParamsSizer, 0, wxALL|wxEXPAND, 5 );
m_ExportableSetupSizer->Add( bSizerPadsConnection, 0, wxEXPAND, 5 );
wxBoxSizer* m_MiddleBox;
m_MiddleBox = new wxBoxSizer( wxVERTICAL );
m_staticText171 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Priority level:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText171->Wrap( -1 );
m_staticText171->SetToolTip( _("On each copper layer, zones are filled by priority order.\nSo when a zone is inside an other zone:\n* If its priority is highter: its outlines are removed from the other layer.\n* If its priority is equal: a DRC error is set.") );
m_MiddleBox->Add( m_staticText171, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_PriorityLevelCtrl = new wxSpinCtrl( m_ExportableSetupSizer->GetStaticBox(), ID_M_PRIORITYLEVELCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0 );
m_MiddleBox->Add( m_PriorityLevelCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText11 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Fill mode:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
m_MiddleBox->Add( m_staticText11, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_FillModeCtrlChoices[] = { _("Polygon"), _("Segment") };
int m_FillModeCtrlNChoices = sizeof( m_FillModeCtrlChoices ) / sizeof( wxString );
m_FillModeCtrl = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_FILLMODECTRL, wxDefaultPosition, wxDefaultSize, m_FillModeCtrlNChoices, m_FillModeCtrlChoices, 0 );
m_FillModeCtrl->SetSelection( 0 );
m_MiddleBox->Add( m_FillModeCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_staticText12 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Segments / 360 deg:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
m_MiddleBox->Add( m_staticText12, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_ArcApproximationOptChoices[] = { _("16"), _("32") };
int m_ArcApproximationOptNChoices = sizeof( m_ArcApproximationOptChoices ) / sizeof( wxString );
m_ArcApproximationOpt = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_ARCAPPROXIMATIONOPT, wxDefaultPosition, wxDefaultSize, m_ArcApproximationOptNChoices, m_ArcApproximationOptChoices, 0 );
m_ArcApproximationOpt->SetSelection( 0 );
m_MiddleBox->Add( m_ArcApproximationOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( m_MiddleBox, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerLowerRight;
bSizerLowerRight = new wxBoxSizer( wxVERTICAL );
m_staticText14 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Outline slope:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
bSizerLowerRight->Add( m_staticText14, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_OrientEdgesOptChoices[] = { _("Arbitrary"), _("H, V, and 45 deg only") };
int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
m_OrientEdgesOpt = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_ORIENTEDGESOPT, wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 0 );
m_OrientEdgesOpt->SetSelection( 0 );
bSizerLowerRight->Add( m_OrientEdgesOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_staticText15 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Outline style:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText15->Wrap( -1 );
bSizerLowerRight->Add( m_staticText15, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched"), _("Fully hatched") };
int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
m_OutlineAppearanceCtrl = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_OUTLINEAPPEARANCECTRL, wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 0 );
m_OutlineAppearanceCtrl->SetSelection( 0 );
bSizerLowerRight->Add( m_OutlineAppearanceCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( bSizerLowerRight, 0, wxEXPAND, 5 );
m_MainBoxSizer->Add( m_ExportableSetupSizer, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerbottom;
bSizerbottom = new wxBoxSizer( wxHORIZONTAL );
m_ExportSetupButton = new wxButton( this, wxID_BUTTON_EXPORT, _("Export Settings to Other Zones"), wxDefaultPosition, wxDefaultSize, 0 );
m_ExportSetupButton->SetToolTip( _("Export this zone setup (excluding layer and net selection) to all other copper zones.") );
bSizerbottom->Add( m_ExportSetupButton, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizerbottom->Add( m_sdbSizer, 1, wxEXPAND, 5 );
m_MainBoxSizer->Add( bSizerbottom, 0, wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( m_MainBoxSizer );
this->Layout();
}
DIALOG_COPPER_ZONE_BASE::~DIALOG_COPPER_ZONE_BASE()
{
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 6 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_copper_zones_base.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DIALOG_COPPER_ZONE_BASE, DIALOG_SHIM )
EVT_CLOSE( DIALOG_COPPER_ZONE_BASE::_wxFB_OnClose )
EVT_CHOICE( ID_M_NETDISPLAYOPTION, DIALOG_COPPER_ZONE_BASE::_wxFB_OnNetSortingOptionSelected )
EVT_TEXT_ENTER( ID_TEXTCTRL_NETNAMES_FILTER, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
EVT_TEXT_ENTER( ID_TEXTCTRL_NETNAMES_FILTER, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
EVT_BUTTON( wxID_APPLY_FILTERS, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
EVT_CHOICE( ID_CORNER_SMOOTHING, DIALOG_COPPER_ZONE_BASE::_wxFB_OnCornerSmoothingModeChoice )
EVT_CHOICE( ID_M_PADINZONEOPT, DIALOG_COPPER_ZONE_BASE::_wxFB_OnPadsInZoneClick )
EVT_BUTTON( wxID_BUTTON_EXPORT, DIALOG_COPPER_ZONE_BASE::_wxFB_ExportSetupToOtherCopperZones )
EVT_BUTTON( wxID_CANCEL, DIALOG_COPPER_ZONE_BASE::_wxFB_OnButtonCancelClick )
EVT_BUTTON( wxID_OK, DIALOG_COPPER_ZONE_BASE::_wxFB_OnButtonOkClick )
END_EVENT_TABLE()
DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
m_MainBoxSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_OptionsBoxSizer;
m_OptionsBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_layerSizer;
m_layerSizer = new wxBoxSizer( wxVERTICAL );
m_staticText17 = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText17->Wrap( -1 );
m_layerSizer->Add( m_staticText17, 0, wxTOP|wxRIGHT, 5 );
m_LayerSelectionCtrl = new wxListView( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ALIGN_LEFT|wxLC_NO_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL );
m_layerSizer->Add( m_LayerSelectionCtrl, 1, wxRIGHT, 5 );
m_OptionsBoxSizer->Add( m_layerSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerNets;
bSizerNets = new wxBoxSizer( wxVERTICAL );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
bSizerNets->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
bSizerNets->Add( m_ListNetNameSelection, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( bSizerNets, 1, wxEXPAND, 5 );
wxStaticBoxSizer* m_NetSortOptSizer;
m_NetSortOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Filtering") ), wxVERTICAL );
m_staticText16 = new wxStaticText( m_NetSortOptSizer->GetStaticBox(), wxID_ANY, _("Display:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText16->Wrap( -1 );
m_NetSortOptSizer->Add( m_staticText16, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_NetDisplayOptionChoices[] = { _("Show all (alphabetical)"), _("Show all (pad count)"), _("Filtered (alphabetical)"), _("Filtered (pad count)") };
int m_NetDisplayOptionNChoices = sizeof( m_NetDisplayOptionChoices ) / sizeof( wxString );
m_NetDisplayOption = new wxChoice( m_NetSortOptSizer->GetStaticBox(), ID_M_NETDISPLAYOPTION, wxDefaultPosition, wxDefaultSize, m_NetDisplayOptionNChoices, m_NetDisplayOptionChoices, 0 );
m_NetDisplayOption->SetSelection( 0 );
m_NetSortOptSizer->Add( m_NetDisplayOption, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_staticText5 = new wxStaticText( m_NetSortOptSizer->GetStaticBox(), wxID_ANY, _("Hidden net filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
m_NetSortOptSizer->Add( m_staticText5, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_DoNotShowNetNameFilter = new wxTextCtrl( m_NetSortOptSizer->GetStaticBox(), ID_TEXTCTRL_NETNAMES_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_DoNotShowNetNameFilter->SetToolTip( _("Pattern to filter net names in filtered list.\nNet names matching this pattern are not displayed.") );
m_NetSortOptSizer->Add( m_DoNotShowNetNameFilter, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText51 = new wxStaticText( m_NetSortOptSizer->GetStaticBox(), wxID_ANY, _("Visible net filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText51->Wrap( -1 );
m_NetSortOptSizer->Add( m_staticText51, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ShowNetNameFilter = new wxTextCtrl( m_NetSortOptSizer->GetStaticBox(), ID_TEXTCTRL_NETNAMES_FILTER, _("*"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_ShowNetNameFilter->SetToolTip( _("Pattern to filter net names in filtered list.\nOnly net names matching this pattern are displayed.") );
m_NetSortOptSizer->Add( m_ShowNetNameFilter, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_buttonRunFilter = new wxButton( m_NetSortOptSizer->GetStaticBox(), wxID_APPLY_FILTERS, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
m_NetSortOptSizer->Add( m_buttonRunFilter, 0, wxALL|wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_NetSortOptSizer, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_MainBoxSizer->Add( m_OptionsBoxSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* m_ExportableSetupSizer;
m_ExportableSetupSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Settings") ), wxHORIZONTAL );
wxBoxSizer* bSizerSettings;
bSizerSettings = new wxBoxSizer( wxVERTICAL );
m_ClearanceValueTitle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Clearance"), wxDefaultPosition, wxDefaultSize, 0 );
m_ClearanceValueTitle->Wrap( -1 );
bSizerSettings->Add( m_ClearanceValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ZoneClearanceCtrl = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerSettings->Add( m_ZoneClearanceCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_MinThicknessValueTitle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Minimum width"), wxDefaultPosition, wxDefaultSize, 0 );
m_MinThicknessValueTitle->Wrap( -1 );
m_MinThicknessValueTitle->SetToolTip( _("Minimum thickness of filled areas.") );
bSizerSettings->Add( m_MinThicknessValueTitle, 0, wxRIGHT|wxLEFT, 5 );
m_ZoneMinThicknessCtrl = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerSettings->Add( m_ZoneMinThicknessCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText151 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Corner smoothing:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText151->Wrap( -1 );
bSizerSettings->Add( m_staticText151, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_cornerSmoothingChoiceChoices[] = { _("None"), _("Chamfer"), _("Fillet") };
int m_cornerSmoothingChoiceNChoices = sizeof( m_cornerSmoothingChoiceChoices ) / sizeof( wxString );
m_cornerSmoothingChoice = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_CORNER_SMOOTHING, wxDefaultPosition, wxDefaultSize, m_cornerSmoothingChoiceNChoices, m_cornerSmoothingChoiceChoices, 0 );
m_cornerSmoothingChoice->SetSelection( 0 );
bSizerSettings->Add( m_cornerSmoothingChoice, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_cornerSmoothingTitle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Chamfer distance (mm):"), wxDefaultPosition, wxDefaultSize, 0 );
m_cornerSmoothingTitle->Wrap( -1 );
bSizerSettings->Add( m_cornerSmoothingTitle, 0, wxRIGHT|wxLEFT, 5 );
m_cornerSmoothingCtrl = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), ID_M_CORNERSMOOTHINGCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerSettings->Add( m_cornerSmoothingCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( bSizerSettings, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerPadsConnection;
bSizerPadsConnection = new wxBoxSizer( wxVERTICAL );
m_staticText13 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Pad connection:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText13->Wrap( -1 );
bSizerPadsConnection->Add( m_staticText13, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_PadInZoneOptChoices[] = { _("Solid"), _("Thermal relief"), _("THT thermal"), _("None") };
int m_PadInZoneOptNChoices = sizeof( m_PadInZoneOptChoices ) / sizeof( wxString );
m_PadInZoneOpt = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_PADINZONEOPT, wxDefaultPosition, wxDefaultSize, m_PadInZoneOptNChoices, m_PadInZoneOptChoices, 0 );
m_PadInZoneOpt->SetSelection( 0 );
bSizerPadsConnection->Add( m_PadInZoneOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
wxStaticBoxSizer* m_ThermalShapesParamsSizer;
m_ThermalShapesParamsSizer = new wxStaticBoxSizer( new wxStaticBox( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Thermal Reliefs") ), wxVERTICAL );
m_AntipadSizeText = new wxStaticText( m_ThermalShapesParamsSizer->GetStaticBox(), wxID_ANY, _("Antipad clearance"), wxDefaultPosition, wxDefaultSize, 0 );
m_AntipadSizeText->Wrap( -1 );
m_ThermalShapesParamsSizer->Add( m_AntipadSizeText, 0, wxTOP|wxRIGHT, 5 );
m_AntipadSizeValue = new wxTextCtrl( m_ThermalShapesParamsSizer->GetStaticBox(), wxID_ANTIPAD_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_AntipadSizeValue->SetToolTip( _("Clearance between pads in the same net and filled areas.") );
m_ThermalShapesParamsSizer->Add( m_AntipadSizeValue, 0, wxEXPAND|wxBOTTOM, 5 );
m_CopperBridgeWidthText = new wxStaticText( m_ThermalShapesParamsSizer->GetStaticBox(), wxID_ANY, _("Spoke width"), wxDefaultPosition, wxDefaultSize, 0 );
m_CopperBridgeWidthText->Wrap( -1 );
m_ThermalShapesParamsSizer->Add( m_CopperBridgeWidthText, 0, wxTOP|wxRIGHT, 5 );
m_CopperWidthValue = new wxTextCtrl( m_ThermalShapesParamsSizer->GetStaticBox(), wxID_COPPER_BRIDGE_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_CopperWidthValue->SetToolTip( _("Width of copper in thermal reliefs.") );
m_ThermalShapesParamsSizer->Add( m_CopperWidthValue, 0, wxEXPAND|wxBOTTOM, 5 );
bSizerPadsConnection->Add( m_ThermalShapesParamsSizer, 0, wxALL|wxEXPAND, 5 );
m_ExportableSetupSizer->Add( bSizerPadsConnection, 0, wxEXPAND, 5 );
wxBoxSizer* m_MiddleBox;
m_MiddleBox = new wxBoxSizer( wxVERTICAL );
m_staticText171 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Priority level:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText171->Wrap( -1 );
m_staticText171->SetToolTip( _("Zones are filled by priority level, level 3 has higher priority than level 2.\nWhen a zone is inside an other zone:\n* If its priority is higher, its outlines are removed from the other zone.\n* If its priority is equal, a DRC error is set.") );
m_MiddleBox->Add( m_staticText171, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_PriorityLevelCtrl = new wxSpinCtrl( m_ExportableSetupSizer->GetStaticBox(), ID_M_PRIORITYLEVELCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0 );
m_MiddleBox->Add( m_PriorityLevelCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText11 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Fill mode:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
m_MiddleBox->Add( m_staticText11, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_FillModeCtrlChoices[] = { _("Polygon"), _("Segment") };
int m_FillModeCtrlNChoices = sizeof( m_FillModeCtrlChoices ) / sizeof( wxString );
m_FillModeCtrl = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_FILLMODECTRL, wxDefaultPosition, wxDefaultSize, m_FillModeCtrlNChoices, m_FillModeCtrlChoices, 0 );
m_FillModeCtrl->SetSelection( 0 );
m_MiddleBox->Add( m_FillModeCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_staticText12 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Segments / 360 deg:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
m_MiddleBox->Add( m_staticText12, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_ArcApproximationOptChoices[] = { _("16"), _("32") };
int m_ArcApproximationOptNChoices = sizeof( m_ArcApproximationOptChoices ) / sizeof( wxString );
m_ArcApproximationOpt = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_ARCAPPROXIMATIONOPT, wxDefaultPosition, wxDefaultSize, m_ArcApproximationOptNChoices, m_ArcApproximationOptChoices, 0 );
m_ArcApproximationOpt->SetSelection( 0 );
m_MiddleBox->Add( m_ArcApproximationOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( m_MiddleBox, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerLowerRight;
bSizerLowerRight = new wxBoxSizer( wxVERTICAL );
m_staticText14 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Outline slope:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
bSizerLowerRight->Add( m_staticText14, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_OrientEdgesOptChoices[] = { _("Arbitrary"), _("H, V, and 45 deg only") };
int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
m_OrientEdgesOpt = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_ORIENTEDGESOPT, wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 0 );
m_OrientEdgesOpt->SetSelection( 0 );
bSizerLowerRight->Add( m_OrientEdgesOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_staticText15 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Outline style:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText15->Wrap( -1 );
bSizerLowerRight->Add( m_staticText15, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched"), _("Fully hatched") };
int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
m_OutlineAppearanceCtrl = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_OUTLINEAPPEARANCECTRL, wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 0 );
m_OutlineAppearanceCtrl->SetSelection( 0 );
bSizerLowerRight->Add( m_OutlineAppearanceCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( bSizerLowerRight, 0, wxEXPAND, 5 );
m_MainBoxSizer->Add( m_ExportableSetupSizer, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerbottom;
bSizerbottom = new wxBoxSizer( wxHORIZONTAL );
m_ExportSetupButton = new wxButton( this, wxID_BUTTON_EXPORT, _("Export Settings to Other Zones"), wxDefaultPosition, wxDefaultSize, 0 );
m_ExportSetupButton->SetToolTip( _("Export this zone setup (excluding layer and net selection) to all other copper zones.") );
bSizerbottom->Add( m_ExportSetupButton, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizerbottom->Add( m_sdbSizer, 1, wxEXPAND, 5 );
m_MainBoxSizer->Add( bSizerbottom, 0, wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( m_MainBoxSizer );
this->Layout();
}
DIALOG_COPPER_ZONE_BASE::~DIALOG_COPPER_ZONE_BASE()
{
}
File diff suppressed because it is too large Load Diff
+135 -135
View File
@@ -1,135 +1,135 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_COPPER_ZONES_BASE_H__
#define __DIALOG_COPPER_ZONES_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
class wxListView;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/listctrl.h>
#include <wx/sizer.h>
#include <wx/listbox.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/spinctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_COPPER_ZONE_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnClose( wxCloseEvent& event ){ OnClose( event ); }
void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
void _wxFB_OnRunFiltersButtonClick( wxCommandEvent& event ){ OnRunFiltersButtonClick( event ); }
void _wxFB_OnCornerSmoothingModeChoice( wxCommandEvent& event ){ OnCornerSmoothingModeChoice( event ); }
void _wxFB_OnPadsInZoneClick( wxCommandEvent& event ){ OnPadsInZoneClick( event ); }
void _wxFB_ExportSetupToOtherCopperZones( wxCommandEvent& event ){ ExportSetupToOtherCopperZones( event ); }
void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); }
void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); }
protected:
enum
{
ID_DIALOG_COPPER_ZONE_BASE = 1000,
ID_NETNAME_SELECTION,
ID_M_NETDISPLAYOPTION,
ID_TEXTCTRL_NETNAMES_FILTER,
wxID_APPLY_FILTERS,
ID_CORNER_SMOOTHING,
ID_M_CORNERSMOOTHINGCTRL,
ID_M_PADINZONEOPT,
wxID_ANTIPAD_SIZE,
wxID_COPPER_BRIDGE_VALUE,
ID_M_PRIORITYLEVELCTRL,
ID_M_FILLMODECTRL,
ID_M_ARCAPPROXIMATIONOPT,
ID_M_ORIENTEDGESOPT,
ID_M_OUTLINEAPPEARANCECTRL,
wxID_BUTTON_EXPORT
};
wxBoxSizer* m_MainBoxSizer;
wxStaticText* m_staticText17;
wxListView* m_LayerSelectionCtrl;
wxStaticText* m_staticText2;
wxListBox* m_ListNetNameSelection;
wxStaticText* m_staticText16;
wxChoice* m_NetDisplayOption;
wxStaticText* m_staticText5;
wxTextCtrl* m_DoNotShowNetNameFilter;
wxStaticText* m_staticText51;
wxTextCtrl* m_ShowNetNameFilter;
wxButton* m_buttonRunFilter;
wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl;
wxStaticText* m_MinThicknessValueTitle;
wxTextCtrl* m_ZoneMinThicknessCtrl;
wxStaticText* m_staticText151;
wxChoice* m_cornerSmoothingChoice;
wxStaticText* m_cornerSmoothingTitle;
wxTextCtrl* m_cornerSmoothingCtrl;
wxStaticText* m_staticText13;
wxChoice* m_PadInZoneOpt;
wxStaticText* m_AntipadSizeText;
wxTextCtrl* m_AntipadSizeValue;
wxStaticText* m_CopperBridgeWidthText;
wxTextCtrl* m_CopperWidthValue;
wxStaticText* m_staticText171;
wxSpinCtrl* m_PriorityLevelCtrl;
wxStaticText* m_staticText11;
wxChoice* m_FillModeCtrl;
wxStaticText* m_staticText12;
wxChoice* m_ArcApproximationOpt;
wxStaticText* m_staticText14;
wxChoice* m_OrientEdgesOpt;
wxStaticText* m_staticText15;
wxChoice* m_OutlineAppearanceCtrl;
wxButton* m_ExportSetupButton;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnNetSortingOptionSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRunFiltersButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCornerSmoothingModeChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPadsInZoneClick( wxCommandEvent& event ) { event.Skip(); }
virtual void ExportSetupToOtherCopperZones( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonOkClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Copper Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 567,507 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_COPPER_ZONE_BASE();
};
#endif //__DIALOG_COPPER_ZONES_BASE_H__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 6 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_COPPER_ZONES_BASE_H__
#define __DIALOG_COPPER_ZONES_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
class wxListView;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/listctrl.h>
#include <wx/sizer.h>
#include <wx/listbox.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/spinctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_COPPER_ZONE_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnClose( wxCloseEvent& event ){ OnClose( event ); }
void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
void _wxFB_OnRunFiltersButtonClick( wxCommandEvent& event ){ OnRunFiltersButtonClick( event ); }
void _wxFB_OnCornerSmoothingModeChoice( wxCommandEvent& event ){ OnCornerSmoothingModeChoice( event ); }
void _wxFB_OnPadsInZoneClick( wxCommandEvent& event ){ OnPadsInZoneClick( event ); }
void _wxFB_ExportSetupToOtherCopperZones( wxCommandEvent& event ){ ExportSetupToOtherCopperZones( event ); }
void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); }
void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); }
protected:
enum
{
ID_DIALOG_COPPER_ZONE_BASE = 1000,
ID_NETNAME_SELECTION,
ID_M_NETDISPLAYOPTION,
ID_TEXTCTRL_NETNAMES_FILTER,
wxID_APPLY_FILTERS,
ID_CORNER_SMOOTHING,
ID_M_CORNERSMOOTHINGCTRL,
ID_M_PADINZONEOPT,
wxID_ANTIPAD_SIZE,
wxID_COPPER_BRIDGE_VALUE,
ID_M_PRIORITYLEVELCTRL,
ID_M_FILLMODECTRL,
ID_M_ARCAPPROXIMATIONOPT,
ID_M_ORIENTEDGESOPT,
ID_M_OUTLINEAPPEARANCECTRL,
wxID_BUTTON_EXPORT
};
wxBoxSizer* m_MainBoxSizer;
wxStaticText* m_staticText17;
wxListView* m_LayerSelectionCtrl;
wxStaticText* m_staticText2;
wxListBox* m_ListNetNameSelection;
wxStaticText* m_staticText16;
wxChoice* m_NetDisplayOption;
wxStaticText* m_staticText5;
wxTextCtrl* m_DoNotShowNetNameFilter;
wxStaticText* m_staticText51;
wxTextCtrl* m_ShowNetNameFilter;
wxButton* m_buttonRunFilter;
wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl;
wxStaticText* m_MinThicknessValueTitle;
wxTextCtrl* m_ZoneMinThicknessCtrl;
wxStaticText* m_staticText151;
wxChoice* m_cornerSmoothingChoice;
wxStaticText* m_cornerSmoothingTitle;
wxTextCtrl* m_cornerSmoothingCtrl;
wxStaticText* m_staticText13;
wxChoice* m_PadInZoneOpt;
wxStaticText* m_AntipadSizeText;
wxTextCtrl* m_AntipadSizeValue;
wxStaticText* m_CopperBridgeWidthText;
wxTextCtrl* m_CopperWidthValue;
wxStaticText* m_staticText171;
wxSpinCtrl* m_PriorityLevelCtrl;
wxStaticText* m_staticText11;
wxChoice* m_FillModeCtrl;
wxStaticText* m_staticText12;
wxChoice* m_ArcApproximationOpt;
wxStaticText* m_staticText14;
wxChoice* m_OrientEdgesOpt;
wxStaticText* m_staticText15;
wxChoice* m_OutlineAppearanceCtrl;
wxButton* m_ExportSetupButton;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnNetSortingOptionSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRunFiltersButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCornerSmoothingModeChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPadsInZoneClick( wxCommandEvent& event ) { event.Skip(); }
virtual void ExportSetupToOtherCopperZones( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonOkClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Copper Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 567,507 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_COPPER_ZONE_BASE();
};
#endif //__DIALOG_COPPER_ZONES_BASE_H__
+46 -5
View File
@@ -5,7 +5,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -46,14 +46,14 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) :
m_plotOpts( aParent->GetPlotSettings() )
{
m_config = Kiface().KifaceSettings();
Init_Dialog();
init_Dialog();
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
}
void DIALOG_PLOT::Init_Dialog()
void DIALOG_PLOT::init_Dialog()
{
wxString msg;
wxFileName fileName;
@@ -194,6 +194,12 @@ void DIALOG_PLOT::Init_Dialog()
// Plot mode
setPlotModeChoiceSelection( m_plotOpts.GetPlotMode() );
// Plot outline mode
m_DXF_plotModeOpt->SetValue( m_plotOpts.GetDXFPlotPolygonMode() );
// Plot text mode
m_DXF_plotTextStrokeFontOpt->SetValue( m_plotOpts.GetTextMode() == PLOTTEXTMODE_DEFAULT );
// Plot mirror option
m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() );
@@ -288,6 +294,19 @@ void DIALOG_PLOT::CreateDrillFile( wxCommandEvent& event )
}
void DIALOG_PLOT::OnChangeDXFPlotMode( wxCommandEvent& event )
{
// m_DXF_plotTextStrokeFontOpt is disabled if m_DXF_plotModeOpt
// is checked (plot in DXF polygon mode)
m_DXF_plotTextStrokeFontOpt->Enable( !m_DXF_plotModeOpt->GetValue() );
// if m_DXF_plotTextStrokeFontOpt option is disabled (plot DXF in polygon mode),
// force m_DXF_plotTextStrokeFontOpt to true to use Pcbnew stroke font
if( !m_DXF_plotTextStrokeFontOpt->IsEnabled() )
m_DXF_plotTextStrokeFontOpt->SetValue( true );
}
void DIALOG_PLOT::OnSetScaleOpt( wxCommandEvent& event )
{
/* Disable sheet reference for scale != 1:1 */
@@ -355,6 +374,9 @@ PlotFormat DIALOG_PLOT::getPlotFormat()
// and clear also some optional values
void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
{
// this option exist only in DXF format:
m_DXF_plotModeOpt->Enable( getPlotFormat() == PLOT_FORMAT_DXF );
switch( getPlotFormat() )
{
case PLOT_FORMAT_PDF:
@@ -387,6 +409,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
m_PlotOptionsSizer->Hide( m_SizerDXF_options );
break;
case PLOT_FORMAT_POST:
@@ -415,6 +438,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
m_PlotOptionsSizer->Show( m_PSOptionsSizer );
m_PlotOptionsSizer->Hide( m_SizerDXF_options );
break;
case PLOT_FORMAT_GERBER:
@@ -445,6 +469,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_PlotOptionsSizer->Show( m_GerberOptionsSizer );
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
m_PlotOptionsSizer->Hide( m_SizerDXF_options );
break;
case PLOT_FORMAT_HPGL:
@@ -474,11 +499,13 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
m_PlotOptionsSizer->Show( m_HPGLOptionsSizer );
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
m_PlotOptionsSizer->Hide( m_SizerDXF_options );
break;
case PLOT_FORMAT_DXF:
m_drillShapeOpt->Enable( true );
m_plotModeOpt->Enable( false );
setPlotModeChoiceSelection( FILLED );
m_plotMirrorOpt->Enable( false );
m_plotMirrorOpt->SetValue( false );
m_useAuxOriginCheckBox->Enable( true );
@@ -505,6 +532,9 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
m_PlotOptionsSizer->Show( m_SizerDXF_options );
OnChangeDXFPlotMode( event );
break;
default:
@@ -578,8 +608,15 @@ void DIALOG_PLOT::applyPlotSettings()
( m_drillShapeOpt->GetSelection() ) );
tempOptions.SetMirror( m_plotMirrorOpt->GetValue() );
tempOptions.SetPlotMode( m_plotModeOpt->GetSelection() == 1 ? SKETCH : FILLED );
tempOptions.SetDXFPlotPolygonMode( m_DXF_plotModeOpt->GetValue() );
tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );
if( !m_DXF_plotTextStrokeFontOpt->IsEnabled() ) // Currently, only DXF supports this option
tempOptions.SetTextMode( PLOTTEXTMODE_DEFAULT );
else
tempOptions.SetTextMode( m_DXF_plotTextStrokeFontOpt->GetValue() ?
PLOTTEXTMODE_DEFAULT : PLOTTEXTMODE_NATIVE );
// Update settings from text fields. Rewrite values back to the fields,
// since the values may have been constrained by the setters.
@@ -694,11 +731,15 @@ void DIALOG_PLOT::applyPlotSettings()
dirStr.Replace( wxT( "\\" ), wxT( "/" ) );
tempOptions.SetOutputDirectory( dirStr );
if( m_plotOpts != tempOptions )
if( !m_plotOpts.IsSameAs( tempOptions, false ) )
{
// First, mark board as modified only for parameters saved in file
if( !m_plotOpts.IsSameAs( tempOptions, true ) )
m_parent->OnModify();
// Now, save any change, for the session
m_parent->SetPlotSettings( tempOptions );
m_plotOpts = tempOptions;
m_parent->OnModify();
}
}
+14 -13
View File
@@ -5,7 +5,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -31,8 +31,8 @@
#include <pcb_plot_params.h>
/**
* Class DIALOG_PLOT
*
* Class DIALOG_PLOT is the dialog to set the plot options, and create plot files
* in various formats.
*/
class DIALOG_PLOT : public DIALOG_PLOT_BASE
{
@@ -58,18 +58,19 @@ private:
PCB_PLOT_PARAMS m_plotOpts;
// Event called functions
void Init_Dialog();
void Plot( wxCommandEvent& event );
void OnQuit( wxCommandEvent& event );
void OnClose( wxCloseEvent& event );
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event );
void OnRightClick( wxMouseEvent& event );
void OnPopUpLayers( wxCommandEvent& event );
void SetPlotFormat( wxCommandEvent& event );
void OnSetScaleOpt( wxCommandEvent& event );
void CreateDrillFile( wxCommandEvent& event );
void Plot( wxCommandEvent& event ) override;
void OnQuit( wxCommandEvent& event ) override;
void OnClose( wxCloseEvent& event ) override;
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
void OnRightClick( wxMouseEvent& event ) override;
void OnPopUpLayers( wxCommandEvent& event ) override;
void SetPlotFormat( wxCommandEvent& event ) override;
void OnChangeDXFPlotMode( wxCommandEvent& event ) override;
void OnSetScaleOpt( wxCommandEvent& event ) override;
void CreateDrillFile( wxCommandEvent& event ) override;
// orther functions
void init_Dialog(); // main initialization
void applyPlotSettings();
PlotFormat getPlotFormat();
+20 -8
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// C++ code generated with wxFormBuilder (version Jul 2 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -47,7 +47,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizer29 = new wxBoxSizer( wxHORIZONTAL );
m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_outputDirectoryName->SetMaxLength( 0 );
m_outputDirectoryName->SetToolTip( _("Target directory for plot files. Can be absolute or relative to the board file location.") );
bSizer29->Add( m_outputDirectoryName, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
@@ -171,7 +170,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizer14->Add( m_textDefaultPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_linesWidth = new wxTextCtrl( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_linesWidth->SetMaxLength( 0 );
m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") );
bSizer14->Add( m_linesWidth, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 );
@@ -266,7 +264,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizer20->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 );
m_HPGLPenSizeOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenSizeOpt->SetMaxLength( 0 );
bSizer20->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@@ -280,7 +277,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizer21->Add( m_textPenOvr, 0, wxRIGHT|wxLEFT, 5 );
m_HPGLPenOverlayOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenOverlayOpt->SetMaxLength( 0 );
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") );
bSizer21->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
@@ -307,7 +303,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizer18->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 );
m_fineAdjustXscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fineAdjustXscaleOpt->SetMaxLength( 0 );
m_fineAdjustXscaleOpt->SetToolTip( _("Set global X scale adjust for exact scale postscript output.") );
bSizer18->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@@ -323,7 +318,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizer19->Add( m_staticText8, 0, wxRIGHT|wxLEFT, 5 );
m_fineAdjustYscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fineAdjustYscaleOpt->SetMaxLength( 0 );
m_fineAdjustYscaleOpt->SetToolTip( _("Set global Y scale adjust for exact scale postscript output.") );
bSizer19->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@@ -339,7 +333,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizer191->Add( m_textPSFineAdjustWidth, 0, wxRIGHT|wxLEFT, 5 );
m_PSFineAdjustWidthOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_PSFineAdjustWidthOpt->SetMaxLength( 0 );
m_PSFineAdjustWidthOpt->SetToolTip( _("Set global width correction for exact width postscript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)] in decimils.") );
bSizer191->Add( m_PSFineAdjustWidthOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
@@ -356,6 +349,23 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_PlotOptionsSizer->Add( m_PSOptionsSizer, 0, wxALL|wxEXPAND, 3 );
m_SizerDXF_options = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF options") ), wxVERTICAL );
m_DXF_plotModeOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Plot all layers in outline (polygon) mode"), wxDefaultPosition, wxDefaultSize, 0 );
m_DXF_plotModeOpt->SetValue(true);
m_DXF_plotModeOpt->SetToolTip( _("DXF only:\nCheck to plot all layers in polygon mode.\nUncheck to plot in sketch mode layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab)\nand plot in polygon mode other layers (*.Cu, *.Adhes, *.Paste, *.Mask)") );
m_SizerDXF_options->Add( m_DXF_plotModeOpt, 0, wxALL, 2 );
m_DXF_plotTextStrokeFontOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Use Pcbnew font to plot texts"), wxDefaultPosition, wxDefaultSize, 0 );
m_DXF_plotTextStrokeFontOpt->SetValue(true);
m_DXF_plotTextStrokeFontOpt->SetToolTip( _("Check to use Pcbnew stroke font\nUncheck to plot oneline ASCII texts as editable text (using DXF font)") );
m_SizerDXF_options->Add( m_DXF_plotTextStrokeFontOpt, 0, wxALL, 2 );
m_PlotOptionsSizer->Add( m_SizerDXF_options, 0, wxEXPAND, 5 );
bmiddleSizer->Add( m_PlotOptionsSizer, 0, 0, 5 );
@@ -426,6 +436,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
m_layerCheckListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this );
m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this );
m_DXF_plotModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this );
m_plotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
@@ -446,6 +457,7 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
m_layerCheckListBox->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this );
m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this );
m_DXF_plotModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this );
m_plotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
+201 -4
View File
@@ -44,7 +44,7 @@
<property name="minimum_size">-1,-1</property>
<property name="name">DIALOG_PLOT_BASE</property>
<property name="pos"></property>
<property name="size">566,711</property>
<property name="size">733,809</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Plot</property>
@@ -106,7 +106,7 @@
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizerPlotFmt</property>
<property name="orient">wxVERTICAL</property>
@@ -589,6 +589,7 @@
<property name="minimum_size"></property>
<property name="name">m_LayersSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -701,6 +702,7 @@
<property name="minimum_size"></property>
<property name="name">sbOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
@@ -2315,6 +2317,7 @@
<property name="minimum_size"></property>
<property name="name">sbSizerSoldMaskLayerOpt</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -2679,6 +2682,7 @@
<property name="minimum_size"></property>
<property name="name">m_GerberOptionsSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -3058,6 +3062,7 @@
<property name="minimum_size"></property>
<property name="name">m_HPGLOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -3453,6 +3458,7 @@
<property name="minimum_size"></property>
<property name="name">m_PSOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -4111,11 +4117,202 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">DXF options</property>
<property name="minimum_size"></property>
<property name="name">m_SizerDXF_options</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
<property name="border">2</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Plot all layers in outline (polygon) mode</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_DXF_plotModeOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">DXF only:&#x0A;Check to plot all layers in polygon mode.&#x0A;Uncheck to plot in sketch mode layers that don&apos;t support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab)&#x0A;and plot in polygon mode other layers (*.Cu, *.Adhes, *.Paste, *.Mask)</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">OnChangeDXFPlotMode</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">2</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Use Pcbnew font to plot texts</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_DXF_plotTextStrokeFontOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Check to use Pcbnew stroke font&#x0A;Uncheck to plot oneline ASCII texts as editable text (using DXF font)</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
@@ -4206,7 +4403,7 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
+6 -2
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// C++ code generated with wxFormBuilder (version Jul 2 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -108,6 +108,9 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
wxStaticText* m_textPSFineAdjustWidth;
wxTextCtrl* m_PSFineAdjustWidthOpt;
wxCheckBox* m_forcePSA4OutputOpt;
wxStaticBoxSizer* m_SizerDXF_options;
wxCheckBox* m_DXF_plotModeOpt;
wxCheckBox* m_DXF_plotTextStrokeFontOpt;
WX_HTML_REPORT_PANEL* m_messagesPanel;
wxButton* m_plotButton;
wxButton* m_buttonDrill;
@@ -121,6 +124,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); }
virtual void OnChangeDXFPlotMode( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
@@ -129,7 +133,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
public:
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 566,711 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 733,809 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_BASE();
void DIALOG_PLOT_BASEOnContextMenu( wxMouseEvent &event )
+4
View File
@@ -188,6 +188,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
}
if( TOOL_MANAGER* toolMgr = GetToolManager() )
toolMgr->DeactivateTool();
break;
}
+2 -2
View File
@@ -1385,8 +1385,8 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt
export_vrml_module( model3d, pcb, module, output_file, wrml_3D_models_scaling_factor,
aExport3DFiles, aUseRelativePaths, a3D_Subdir );
// write out the board and all layers
write_layers( model3d, output_file, pcb );
// write out the board and all layers
write_layers( model3d, output_file, pcb );
// Close the outer 'transform' node
output_file << "]\n}\n";
@@ -7,7 +7,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 Jean_Pierre Charras <jp.charras at wanadoo.fr>
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 1992-2016 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
@@ -772,10 +772,9 @@ const wxString EXCELLON_WRITER::drillFileName( LAYER_PAIR aPair, bool aNPTH ) co
wxFileName fn = m_pcb->GetFileName();
fn.SetName( fn.GetName() + extend );
fn.SetPath( "" );
fn.SetExt( DrillFileExtension );
wxString ret = fn.GetFullPath(); // show me in debugger
wxString ret = fn.GetFullName(); // show me in debugger
return ret;
}
+38 -11
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011-2015 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
@@ -64,6 +64,12 @@ static const wxChar backupSuffix[] = wxT( "-bak" );
static const wxChar autosavePrefix[] = wxT( "_autosave-" );
wxString PCB_EDIT_FRAME::GetAutoSaveFilePrefix()
{
return wxString( autosavePrefix );
}
/**
* Function AskLoadBoardFileName
* puts up a wxFileDialog asking for a BOARD filename to open.
@@ -807,7 +813,7 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName )
}
DisplayInfoMessage( this, wxString::Format( _( "Board copied to:\n'%s'" ),
GetChars( pcbFileName.GetFullPath() ) ) );
GetChars( pcbFileName.GetFullPath() ) ) );
return true;
}
@@ -815,19 +821,40 @@ bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName )
bool PCB_EDIT_FRAME::doAutoSave()
{
wxFileName tmpFileName = Prj().AbsolutePath( GetBoard()->GetFileName() );
wxFileName fn = tmpFileName;
wxFileName tmpFileName;
// Auto save file name is the normal file name prepended with
// autosaveFilePrefix string.
fn.SetName( wxString( autosavePrefix ) + fn.GetName() );
if( GetBoard()->GetFileName().IsEmpty() )
{
tmpFileName = wxFileName( wxStandardPaths::Get().GetDocumentsDir(), wxT( "noname" ),
KiCadPcbFileExtension );
GetBoard()->SetFileName( tmpFileName.GetFullPath() );
}
else
{
tmpFileName = Prj().AbsolutePath( GetBoard()->GetFileName() );
}
wxLogTrace( traceAutoSave,
wxT( "Creating auto save file <" + fn.GetFullPath() ) + wxT( ">" ) );
wxFileName autoSaveFileName = tmpFileName;
if( !fn.IsOk() )
// Auto save file name is the board file name prepended with autosaveFilePrefix string.
autoSaveFileName.SetName( wxString( autosavePrefix ) + autoSaveFileName.GetName() );
if( !autoSaveFileName.IsOk() )
return false;
else if( SavePcbFile( fn.GetFullPath(), NO_BACKUP_FILE ) )
// If the board file path is not writable, try writing to a platform specific temp file
// path. If that path isn't writabe, give up.
if( !autoSaveFileName.IsDirWritable() )
{
autoSaveFileName.SetPath( wxFileName::GetTempDir() );
if( !autoSaveFileName.IsOk() || !autoSaveFileName.IsDirWritable() )
return false;
}
wxLogTrace( traceAutoSave, "Creating auto save file <" + autoSaveFileName.GetFullPath() + ">" );
if( SavePcbFile( autoSaveFileName.GetFullPath(), NO_BACKUP_FILE ) )
{
GetScreen()->SetModify();
GetBoard()->SetFileName( tmpFileName.GetFullPath() );
+6 -34
View File
@@ -22,44 +22,21 @@
# Download avhttp and install the headers, not actually compiled
#################################################
include( download_avhttp )
if( MINGW AND NOT OPENSSL_ROOT_DIR )
# download, compile and install to scratch dir a recent OPENSSL library and headers
include( download_openssl )
else()
find_package( OpenSSL REQUIRED )
#message( STATUS "OPENSSL_FOUND:${OPENSSL_FOUND} OPENSSL_LIBRARIES:${OPENSSL_LIBRARIES}" )
# FindOpenSSL.cmake does not set this var into cache, so is not globally visible,
# do it here incase some other link image needs these libraries
set( OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES}" CACHE FILEPATH "OpenSSL link libraries" )
set( OPENSSL_INCLUDE_DIR "${OPENSSL_INCLUDE_DIR}" CACHE FILEPATH "OpenSSL include dir" )
endif()
# These are additions to any inherited from pcbnew dir:
include_directories( . ${OPENSSL_INCLUDE_DIR} ${AVHTTP_INCLUDE_DIR} )
include_directories( . )
# Tell AVHTTP we have SSL.
add_definitions( -DAVHTTP_ENABLE_OPENSSL )
# tone down the compiler warnings for avhttp header library:
set( CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing" )
include_directories( ${CURL_INCLUDE_DIRS} )
set( GITHUB_PLUGIN_SRCS
github_plugin.cpp github_getliblist.cpp html_link_parser.cpp
github_plugin.cpp
github_getliblist.cpp
html_link_parser.cpp
)
add_library( github_plugin STATIC ${GITHUB_PLUGIN_SRCS} )
# No, you don't get github without boost and openssl. Boost_LIBRARIES now moved up
# into CMakeLists.txt for pcbnew and cvpcb:
target_link_libraries( github_plugin
${OPENSSL_LIBRARIES}
common
)
if( MINGW )
@@ -70,9 +47,4 @@ if( MINGW )
endif()
add_dependencies( github_plugin boost )
add_dependencies( github_plugin avhttp )
if( MINGW AND NOT OPENSSL_ROOT_DIR )
add_dependencies( github_plugin openssl )
endif()
+39 -34
View File
@@ -35,41 +35,10 @@
*
* This gets just information on the repo in JSON format.
*
* I used avhttp, already used in the pcbnew Github plugin to download
* the json file.
*
* JP Charras.
*/
#if 0
/*
* FIX ME
* I do not include avhttp.hpp here, because it is already included in
* github_plugin.cpp
* and if it is also included in this file, the link fails (double definiton of modules)
* therefore, the GITHUB_GETLIBLIST method which uses avhttp to download dats from gitub
* is in github_plugin.cpp
*/
#ifndef WIN32_LEAN_AND_MEAN
// when WIN32_LEAN_AND_MEAN is defined, some useless includes in <window.h>
// are skipped, and this avoid some compil issues
#define WIN32_LEAN_AND_MEAN
#endif
#ifdef WIN32
// defines needed by avhttp
// Minimal Windows version is XP: Google for _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501
#endif
#include <wx/wx.h>
#include <avhttp.hpp>
#endif
#include <kicad_curl/kicad_curl_easy.h> // Include before any wx file
#include <wx/uri.h>
#include <github_getliblist.h>
@@ -90,6 +59,7 @@ bool GITHUB_GETLIBLIST::Get3DshapesLibsList( wxArrayString* aList,
bool (*aFilter)( const wxString& aData ) )
{
std::string fullURLCommand;
strcpy( m_option_string, "text/html" );
wxString repoURL = m_repoURL;
@@ -97,7 +67,7 @@ bool GITHUB_GETLIBLIST::Get3DshapesLibsList( wxArrayString* aList,
wxString errorMsg;
fullURLCommand = repoURL.utf8_str();
bool success = remote_get_json( &fullURLCommand, &errorMsg );
bool success = remoteGetJSON( fullURLCommand, &errorMsg );
if( !success )
{
@@ -123,6 +93,7 @@ bool GITHUB_GETLIBLIST::GetFootprintLibraryList( wxArrayString& aList )
std::string fullURLCommand;
int page = 1;
int itemCountMax = 99; // Do not use a valu > 100, it does not work
strcpy( m_option_string, "application/json" );
// Github max items returned is 100 per page
@@ -147,7 +118,7 @@ bool GITHUB_GETLIBLIST::GetFootprintLibraryList( wxArrayString& aList )
while( 1 )
{
bool success = remote_get_json( &fullURLCommand, &errorMsg );
bool success = remoteGetJSON( fullURLCommand, &errorMsg );
if( !success )
{
@@ -235,3 +206,37 @@ bool GITHUB_GETLIBLIST::repoURL2listURL( const wxString& aRepoURL,
return false;
}
bool GITHUB_GETLIBLIST::remoteGetJSON( const std::string& aFullURLCommand, wxString* aMsgError )
{
KICAD_CURL_EASY kcurl;
wxLogDebug( wxT( "Attempting to download: " ) + aFullURLCommand );
kcurl.SetURL( aFullURLCommand );
kcurl.SetUserAgent( "http://kicad-pcb.org" );
kcurl.SetHeader( "Accept", m_option_string );
kcurl.SetFollowRedirects( true );
try
{
kcurl.Perform();
m_image = kcurl.GetBuffer();
return true;
}
catch( const IO_ERROR& ioe )
{
if( aMsgError )
{
UTF8 fmt( _( "Error fetching JSON data from URL '%s'.\nReason: '%s'" ) );
std::string msg = StrPrintf( fmt.c_str(),
aFullURLCommand.c_str(),
TO_UTF8( ioe.errorText ) );
*aMsgError = FROM_UTF8( msg.c_str() );
}
return false;
}
}
+2 -2
View File
@@ -103,7 +103,7 @@ protected:
int aItemCountMax, int aPage = 1 );
/**
* Function remote_get_json
* Function remoteGetJSON
* Download a json text from a github repo. The text image
* is received into the m_input_stream.
* @param aFullURLCommand the full command, i.e. the url with options like
@@ -111,7 +111,7 @@ protected:
* @param aMsgError a pointer to a wxString which can store an error message
* @return true if OK, false if error (which an error message in *aMsgError
*/
bool remote_get_json( std::string* aFullURLCommand, wxString* aMsgError );
bool remoteGetJSON( const std::string& aFullURLCommand, wxString* aMsgError );
wxString m_github_path; ///< Something like https://api.github.com/orgs/KiCad
std::string m_image; ///< image of the downloaded data in its entirety.
+53 -133
View File
@@ -38,8 +38,7 @@ I have lost my enthusiasm for local caching until a faster time stamp retrieval
mechanism can be found, or github gets more servers. But note that the occasionally
slow response is the exception rather than the norm. Normally the response is
down around a 1/3 of a second. The information we would use is in the header
named "Last-Modified" as seen below. This would need parsing, but avhttp may
offer some help there, if not, then boost async probably does.
named "Last-Modified" as seen below.
HTTP/1.1 200 OK
@@ -62,23 +61,9 @@ Access-Control-Expose-Headers: ETag, Link, X-RateLimit-Limit, X-RateLimit-Remain
Access-Control-Allow-Origin: *
X-GitHub-Request-Id: 411087C2:659E:50FD6E6:52E67F66
Vary: Accept-Encoding
*/
#ifndef WIN32_LEAN_AND_MEAN
// when WIN32_LEAN_AND_MEAN is defined, some useless includes in <window.h>
// are skipped, and this avoid some compil issues
#define WIN32_LEAN_AND_MEAN
#endif
#ifdef WIN32
// defines needed by avhttp
// Minimal Windows version is XP: Google for _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501
#endif
#include <kicad_curl/kicad_curl_easy.h> // Include before any wx file
#include <sstream>
#include <boost/ptr_container/ptr_map.hpp>
#include <set>
@@ -88,10 +73,6 @@ Vary: Accept-Encoding
#include <wx/uri.h>
#include <fctsys.h>
// Under Windows Mingw/msys, avhttp.hpp should be included after fctsys.h
// in fact after wx/wx.h, included by fctsys.h,
// to avoid issues (perhaps due to incompatible defines)
#include <avhttp.hpp> // chinese SSL magic
#include <io_mgr.h>
#include <richio.h>
@@ -103,6 +84,7 @@ Vary: Accept-Encoding
#include <fp_lib_table.h> // ExpandSubstitutions()
#include <github_getliblist.h>
using namespace std;
@@ -139,7 +121,7 @@ GITHUB_PLUGIN::~GITHUB_PLUGIN()
const wxString GITHUB_PLUGIN::PluginName() const
{
return wxT( "Github" );
return "Github";
}
@@ -212,7 +194,8 @@ MODULE* GITHUB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
if( it != m_gh_cache->end() ) // fp_name is present
{
wxMemoryInputStream mis( &m_zip_image[0], m_zip_image.size() );
//std::string::data() ensures that the referenced data block is contiguous.
wxMemoryInputStream mis( m_zip_image.data(), m_zip_image.size() );
// This decoder should always be UTF8, since it was saved that way by git.
// That is, since pretty footprints are UTF8, and they were pushed to the
@@ -223,21 +206,17 @@ MODULE* GITHUB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
if( zis.OpenEntry( *entry ) )
{
INPUTSTREAM_LINE_READER reader( &zis, aLibraryPath );
#if 1
// I am a PCB_IO derivative with my own PCB_PARSER
m_parser->SetLineReader( &reader ); // ownership not passed
MODULE* ret = (MODULE*) m_parser->Parse();
#else
PCB_PARSER parser( &reader );
MODULE* ret = (MODULE*) parser.Parse();
#endif
// Dude, the footprint name comes from the file name in
// a github library. Zero out the library name, we don't know it here.
// Some caller may set the library nickname, one such instance is
// FP_LIB_TABLE::FootprintLoad().
// In a github library, (as well as in a "KiCad" library) the name of
// the pretty file defines the footprint name. That filename trumps
// any name found in the pretty file; any name in the pretty file
// must be ignored here. Also, the library nickname is unknown in
// this context so clear it just in case.
ret->SetFPID( fp_name );
return ret;
@@ -408,7 +387,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
if( !wx_pretty_fn.IsOk() ||
!wx_pretty_fn.IsDirWritable() ||
wx_pretty_fn.GetExt() != wxT( "pretty" )
wx_pretty_fn.GetExt() != "pretty"
)
{
wxString msg = wxString::Format(
@@ -425,13 +404,13 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
}
// operator==( wxString, wxChar* ) does not exist, construct wxString once here.
const wxString kicad_mod( wxT( "kicad_mod" ) );
const wxString kicad_mod( "kicad_mod" );
//D(printf("%s: this:%p m_lib_path:'%s' aLibraryPath:'%s'\n", __func__, this, TO_UTF8( m_lib_path), TO_UTF8(aLibraryPath) );)
m_gh_cache = new GH_CACHE();
// INIT_LOGGER( "/tmp", "test.log" );
remote_get_zip( aLibraryPath );
remoteGetZip( aLibraryPath );
// UNINIT_LOGGER();
m_lib_path = aLibraryPath;
@@ -460,7 +439,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
}
bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL )
bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, std::string* aZipURL )
{
// e.g. "https://github.com/liftoff-sr/pretty_footprints"
//D(printf("aRepoURL:%s\n", TO_UTF8( aRepoURL ) );)
@@ -470,12 +449,12 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL )
if( repo.HasServer() && repo.HasPath() )
{
// scheme might be "http" or if truly github.com then "https".
wxString zip_url = repo.GetScheme();
zip_url += "://";
wxString zip_url;
if( repo.GetServer() == "github.com" )
{
//codeload.github.com only supports https
zip_url = "https://";
#if 0 // A proper code path would be this one, but it is not the fastest.
zip_url += repo.GetServer();
zip_url += repo.GetPath(); // path comes with a leading '/'
@@ -488,8 +467,6 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL )
// In order to bypass this redirect, saving time, we use the
// redirected URL on first attempt to save one HTTP GET hit.
// avhttp would do the redirect behind the scenes normally, but that would
// be slower than doing this bypass.
zip_url += "codeload.github.com";
zip_url += repo.GetPath(); // path comes with a leading '/'
zip_url += "/zip/master";
@@ -498,9 +475,11 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL )
else
{
zip_url = repo.GetScheme();
zip_url += "://";
// This is the generic code path for any server which can serve
// up zip files. The schemes tested include: http and https.
// (I don't know what the avhttp library supports beyond that.)
// zip_url goal: "<scheme>://<server>[:<port>]/<path>"
@@ -533,9 +512,9 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL )
}
void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR )
void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL ) throw( IO_ERROR )
{
string zip_url;
std::string zip_url;
if( !repoURL_zipURL( aRepoURL, &zip_url ) )
{
@@ -543,107 +522,48 @@ void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR )
THROW_IO_ERROR( msg );
}
boost::asio::io_service io;
avhttp::http_stream h( io );
avhttp::request_opts options;
wxLogDebug( wxT( "Attempting to download: " ) + zip_url );
options.insert( "Accept", "application/zip" );
options.insert( "User-Agent", "http://kicad-pcb.org" ); // THAT WOULD BE ME.
h.request_options( options );
KICAD_CURL_EASY kcurl; // this can THROW_IO_ERROR
kcurl.SetURL( zip_url.c_str() );
kcurl.SetUserAgent( "http://kicad-pcb.org" );
kcurl.SetHeader( "Accept", "application/zip" );
kcurl.SetFollowRedirects( true );
try
{
ostringstream os;
h.open( zip_url ); // only one file, therefore do it synchronously.
os << &h;
// Keep zip file byte image in RAM. That plus the MODULE_MAP will constitute
// the cache. We don't cache the MODULEs per se, we parse those as needed from
// this zip file image.
m_zip_image = os.str();
// 4 lines, using SSL, top that.
kcurl.Perform();
m_zip_image = kcurl.GetBuffer();
}
catch( const boost::system::system_error& e )
catch( const IO_ERROR& ioe )
{
// https "GET" has faild, report this to API caller.
// https "GET" has failed, report this to API caller.
// Note: kcurl.Perform() does not return an error if the file to download is not found
static const char errorcmd[] = "http GET command failed"; // Do not translate this message
UTF8 fmt( _( "%s\nCannot get/download Zip archive: '%s'\nfor library path: '%s'.\nReason: '%s'" ) );
string msg = StrPrintf( fmt.c_str(),
errorcmd,
// Report both secret zip_url and Lib Path, to user. The secret
// zip_url may go bad at some point in future if github changes
// their server architecture. Then fix repoURL_zipURL() to reflect
// new architecture.
zip_url.c_str(), TO_UTF8( aRepoURL ),
e.what() );
THROW_IO_ERROR( msg );
}
catch( const exception& exc )
{
UTF8 error( _( "Exception '%s' in avhttp while open()-ing URI:'%s'" ) );
string msg = StrPrintf( error.c_str(), exc.what(), zip_url.c_str() );
THROW_IO_ERROR( msg );
}
}
// This GITHUB_GETLIBLIST method should not be here, but in github_getliblist.cpp !
// However it is here just because we need to include <avhttp.hpp> to compile it.
// and when we include avhttp in two .cpp files, the link fails because it detects duplicate
// avhttp functions.
// So until it is fixed, this code is here.
bool GITHUB_GETLIBLIST::remote_get_json( std::string* aFullURLCommand, wxString* aMsgError )
{
boost::asio::io_service io;
avhttp::http_stream h( io );
avhttp::request_opts options;
options.insert( "Accept", m_option_string );
options.insert( "User-Agent", "http://kicad-pcb.org" ); // THAT WOULD BE ME.
h.request_options( options );
try
{
std::ostringstream os;
h.open( *aFullURLCommand ); // only one file, therefore do it synchronously.
os << &h;
// Keep downloaded text file image in RAM.
m_image = os.str();
// 4 lines, using SSL, top that.
}
catch( boost::system::system_error& e )
{
// https "GET" has faild, report this to API caller.
static const char errorcmd[] = "https GET command failed"; // Do not translate this message
UTF8 fmt( _( "%s\nCannot get/download data from: '%s'\nReason: '%s'" ) );
std::string msg = StrPrintf( fmt.c_str(),
errorcmd,
// Report secret list_url to user. The secret
// list_url may go bad at some point in future if github changes
// their server architecture. Then fix repoURL_zipURL() to reflect
// new architecture.
aFullURLCommand->c_str(), e.what() );
errorcmd,
zip_url.c_str(),
TO_UTF8( aRepoURL ),
TO_UTF8( ioe.errorText )
);
if( aMsgError )
{
*aMsgError = FROM_UTF8( msg.c_str() );
return false;
}
THROW_IO_ERROR( msg );
}
return true;
// If the zip archive is not existing, the received data is "Not Found" or "404: Not Found",
// and no error is returned by kcurl.Perform().
if( ( m_zip_image.compare( 0, 9, "Not Found", 9 ) == 0 ) ||
( m_zip_image.compare( 0, 14, "404: Not Found", 14 ) == 0 ) )
{
UTF8 fmt( _( "Cannot download library '%s'.\nThe library does not exist on the server" ) );
std::string msg = StrPrintf( fmt.c_str(), TO_UTF8( aRepoURL ) );
THROW_IO_ERROR( msg );
}
}
#if 0 && defined(STANDALONE)
@@ -657,7 +577,7 @@ int main( int argc, char** argv )
try
{
wxArrayString fps = gh.FootprintEnumerate(
wxT( "https://github.com/liftoff-sr/pretty_footprints" ),
"https://github.com/liftoff-sr/pretty_footprints",
NULL
);
+2 -2
View File
@@ -213,11 +213,11 @@ protected:
static bool repoURL_zipURL( const wxString& aRepoURL, std::string* aZipURL );
/**
* Function remote_get_zip
* Function remoteGetZip
* fetches a zip file image from a github repo synchronously. The byte image
* is received into the m_input_stream.
*/
void remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR );
void remoteGetZip( const wxString& aRepoURL ) throw( IO_ERROR );
wxString m_lib_path; ///< from aLibraryPath, something like https://github.com/liftoff-sr/pretty_footprints
std::string m_zip_image; ///< byte image of the zip file in its entirety.
+14 -42
View File
@@ -7,7 +7,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -39,12 +39,12 @@
#include <class_pcb_text.h>
// Keys to store setup in config
#define DXF_IMPORT_LAYER_OPTION_KEY wxT("DxfImportBrdLayer")
#define DXF_IMPORT_COORD_ORIGIN_KEY wxT("DxfImportCoordOrigin")
#define DXF_IMPORT_LAST_FILE_KEY wxT("DxfImportLastFile")
#define DXF_IMPORT_GRID_UNITS_KEY wxT("DxfImportGridUnits")
#define DXF_IMPORT_GRID_OFFSET_X_KEY wxT("DxfImportGridOffsetX")
#define DXF_IMPORT_GRID_OFFSET_Y_KEY wxT("DxfImportGridOffsetY")
#define DXF_IMPORT_LAYER_OPTION_KEY "DxfImportBrdLayer"
#define DXF_IMPORT_COORD_ORIGIN_KEY "DxfImportCoordOrigin"
#define DXF_IMPORT_LAST_FILE_KEY "DxfImportLastFile"
#define DXF_IMPORT_GRID_UNITS_KEY "DxfImportGridUnits"
#define DXF_IMPORT_GRID_OFFSET_X_KEY "DxfImportGridOffsetX"
#define DXF_IMPORT_GRID_OFFSET_Y_KEY "DxfImportGridOffsetY"
// Static members of DIALOG_DXF_IMPORT, to remember
@@ -54,10 +54,11 @@ int DIALOG_DXF_IMPORT::m_offsetSelection = 0;
LAYER_NUM DIALOG_DXF_IMPORT::m_layer = Dwgs_User;
DIALOG_DXF_IMPORT::DIALOG_DXF_IMPORT( PCB_BASE_FRAME* aParent )
DIALOG_DXF_IMPORT::DIALOG_DXF_IMPORT( PCB_BASE_FRAME* aParent, bool aUseModuleItems )
: DIALOG_DXF_IMPORT_BASE( aParent )
{
m_parent = aParent;
m_dxfImporter.UseModuleItems( aUseModuleItems );
m_config = Kiface().KifaceSettings();
m_PCBGridUnits = 0;
m_PCBGridOffsetX = 0.0;
@@ -77,7 +78,7 @@ DIALOG_DXF_IMPORT::DIALOG_DXF_IMPORT( PCB_BASE_FRAME* aParent )
wxString tmpStr;
tmpStr << m_PCBGridOffsetX;
m_DXFPCBXCoord->SetValue( tmpStr );
tmpStr = wxT( "" );
tmpStr = "";
tmpStr << m_PCBGridOffsetY;
m_DXFPCBYCoord->SetValue( tmpStr );
@@ -136,7 +137,7 @@ void DIALOG_DXF_IMPORT::OnBrowseDxfFiles( wxCommandEvent& event )
wxFileDialog dlg( m_parent,
_( "Open File" ),
path, filename,
wxT( "DXF Files (*.dxf)|*.dxf" ),
"DXF Files (*.dxf)|*.dxf",
wxFD_OPEN|wxFD_FILE_MUST_EXIST );
if( dlg.ShowModal() != wxID_OK )
@@ -238,7 +239,7 @@ bool InvokeDXFDialogModuleImport( PCB_BASE_FRAME* aCaller, MODULE* aModule )
{
wxASSERT( aModule );
DIALOG_DXF_IMPORT dlg( aCaller );
DIALOG_DXF_IMPORT dlg( aCaller, true );
bool success = ( dlg.ShowModal() == wxID_OK );
if( success )
@@ -252,37 +253,7 @@ bool InvokeDXFDialogModuleImport( PCB_BASE_FRAME* aCaller, MODULE* aModule )
for( it = list.begin(), itEnd = list.end(); it != itEnd; ++it )
{
BOARD_ITEM* item = *it;
BOARD_ITEM* converted = NULL;
// Modules use different types for the same things,
// so we need to convert imported items to appropriate classes.
switch( item->Type() )
{
case PCB_LINE_T:
{
converted = new EDGE_MODULE( aModule );
*static_cast<DRAWSEGMENT*>( converted ) = *static_cast<DRAWSEGMENT*>( item );
aModule->Add( converted );
static_cast<EDGE_MODULE*>( converted )->SetLocalCoord();
delete item;
break;
}
case PCB_TEXT_T:
{
converted = new TEXTE_MODULE( aModule );
*static_cast<TEXTE_PCB*>( converted ) = *static_cast<TEXTE_PCB*>( item );
aModule->Add( converted );
static_cast<TEXTE_MODULE*>( converted )->SetLocalCoord();
delete item;
break;
}
default:
wxLogDebug( wxT( "type %d currently not handled" ), item->Type() );
break;
}
aModule->Add( *it );
}
}
@@ -305,6 +276,7 @@ int DIALOG_DXF_IMPORT::GetPCBGridUnits( void )
return m_DXFPCBGridUnits->GetSelection();
}
void DIALOG_DXF_IMPORT::GetPCBGridOffsets( double &aXOffset, double &aYOffset )
{
aXOffset = DoubleValueFromString( UNSCALED_UNITS, m_DXFPCBXCoord->GetValue() );
+2 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -29,7 +29,7 @@
class DIALOG_DXF_IMPORT : public DIALOG_DXF_IMPORT_BASE
{
public:
DIALOG_DXF_IMPORT( PCB_BASE_FRAME* aParent );
DIALOG_DXF_IMPORT( PCB_BASE_FRAME* aParent, bool aUseModuleItems = false );
~DIALOG_DXF_IMPORT();
/**
+177 -154
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -44,8 +44,10 @@
#include <macros.h>
#include <class_board.h>
#include <class_drawsegment.h>
#include <class_edge_mod.h>
#include <class_pcb_text.h>
#include <convert_from_iu.h>
#include <class_text_mod.h>
#include <drw_base.h>
// minimum bulge value before resorting to a line segment;
@@ -98,9 +100,6 @@ bool DXF2BRD_CONVERTER::ImportDxfFile( const wxString& aFile )
}
/*
* Implementation of the method which handles layers.
*/
void DXF2BRD_CONVERTER::addLayer( const DRW_Layer& aData )
{
// Not yet useful in Pcbnew.
@@ -111,19 +110,18 @@ void DXF2BRD_CONVERTER::addLayer( const DRW_Layer& aData )
}
/*
* Import line entities.
*/
void DXF2BRD_CONVERTER::addLine( const DRW_Line& aData )
{
DRAWSEGMENT* segm = new DRAWSEGMENT;
DRAWSEGMENT* segm = ( m_useModuleItems ) ?
static_cast< DRAWSEGMENT* >( new EDGE_MODULE( NULL ) ) : new DRAWSEGMENT;
segm->SetLayer( ToLAYER_ID( m_brdLayer ) );
wxPoint start( mapX( aData.basePoint.x ), mapY( aData.basePoint.y ) );
segm->SetStart( start );
wxPoint end( mapX( aData.secPoint.x ), mapY( aData.secPoint.y ) );
segm->SetEnd( end );
segm->SetWidth( mapDim( aData.thickness == 0 ? m_defaultThickness : aData.thickness ) );
segm->SetWidth( mapDim( aData.thickness == 0 ? m_defaultThickness / m_DXF2mm
: aData.thickness ) );
m_newItemsList.push_back( segm );
}
@@ -148,13 +146,15 @@ void DXF2BRD_CONVERTER::addPolyline(const DRW_Polyline& aData )
continue;
}
DRAWSEGMENT* segm = new DRAWSEGMENT( NULL );
DRAWSEGMENT* segm = ( m_useModuleItems ) ?
static_cast< DRAWSEGMENT* >( new EDGE_MODULE( NULL ) ) :
new DRAWSEGMENT;
segm->SetLayer( ToLAYER_ID( m_brdLayer ) );
segm->SetStart( segment_startpoint );
wxPoint segment_endpoint( mapX( vertex->basePoint.x ), mapY( vertex->basePoint.y ) );
segm->SetEnd( segment_endpoint );
segm->SetWidth( mapDim( aData.thickness == 0 ? m_defaultThickness
segm->SetWidth( mapDim( aData.thickness == 0 ? m_defaultThickness / m_DXF2mm
: aData.thickness ) );
m_newItemsList.push_back( segm );
segment_startpoint = segment_endpoint;
@@ -163,17 +163,20 @@ void DXF2BRD_CONVERTER::addPolyline(const DRW_Polyline& aData )
// Polyline flags bit 0 indicates closed (1) or open (0) polyline
if( aData.flags & 1 )
{
DRAWSEGMENT* closing_segm = new DRAWSEGMENT( NULL );
DRAWSEGMENT* closing_segm = ( m_useModuleItems ) ?
static_cast< DRAWSEGMENT* >( new EDGE_MODULE( NULL ) ) :
new DRAWSEGMENT;
closing_segm->SetLayer( ToLAYER_ID( m_brdLayer ) );
closing_segm->SetStart( segment_startpoint );
closing_segm->SetEnd( polyline_startpoint );
closing_segm->SetWidth( mapDim( aData.thickness == 0 ? m_defaultThickness
closing_segm->SetWidth( mapDim( aData.thickness == 0 ? m_defaultThickness / m_DXF2mm
: aData.thickness ) );
m_newItemsList.push_back( closing_segm );
}
}
void DXF2BRD_CONVERTER::addLWPolyline(const DRW_LWPolyline& aData )
{
// Currently, Pcbnew does not know polylines, for boards.
@@ -184,7 +187,7 @@ void DXF2BRD_CONVERTER::addLWPolyline(const DRW_LWPolyline& aData )
wxRealPoint seg_start;
wxRealPoint poly_start;
double bulge = 0.0;
int lineWidth = mapDim( aData.thickness == 0 ? m_defaultThickness
int lineWidth = mapDim( aData.thickness == 0 ? m_defaultThickness / m_DXF2mm
: aData.thickness );
for( unsigned ii = 0; ii < aData.vertlist.size(); ii++ )
@@ -221,12 +224,11 @@ void DXF2BRD_CONVERTER::addLWPolyline(const DRW_LWPolyline& aData )
}
}
/*
* Import Circle entities.
*/
void DXF2BRD_CONVERTER::addCircle( const DRW_Circle& aData )
{
DRAWSEGMENT* segm = new DRAWSEGMENT;
DRAWSEGMENT* segm = ( m_useModuleItems ) ?
static_cast< DRAWSEGMENT* >( new EDGE_MODULE( NULL ) ) : new DRAWSEGMENT;
segm->SetLayer( ToLAYER_ID( m_brdLayer ) );
segm->SetShape( S_CIRCLE );
@@ -234,7 +236,8 @@ void DXF2BRD_CONVERTER::addCircle( const DRW_Circle& aData )
segm->SetCenter( center );
wxPoint circle_start( mapX( aData.basePoint.x + aData.radious ), mapY( aData.basePoint.y ) );
segm->SetArcStart( circle_start );
segm->SetWidth( mapDim( aData.thickness == 0 ? m_defaultThickness : aData.thickness ) );
segm->SetWidth( mapDim( aData.thickness == 0 ? m_defaultThickness / m_DXF2mm
: aData.thickness ) );
m_newItemsList.push_back( segm );
}
@@ -244,7 +247,8 @@ void DXF2BRD_CONVERTER::addCircle( const DRW_Circle& aData )
*/
void DXF2BRD_CONVERTER::addArc( const DRW_Arc& data )
{
DRAWSEGMENT* segm = new DRAWSEGMENT;
DRAWSEGMENT* segm = ( m_useModuleItems ) ?
static_cast< DRAWSEGMENT* >( new EDGE_MODULE( NULL ) ) : new DRAWSEGMENT;
segm->SetLayer( ToLAYER_ID( m_brdLayer ) );
segm->SetShape( S_ARC );
@@ -272,17 +276,31 @@ void DXF2BRD_CONVERTER::addArc( const DRW_Arc& data )
segm->SetAngle( angle );
segm->SetWidth( mapDim( data.thickness == 0 ? m_defaultThickness : data.thickness ) );
segm->SetWidth( mapDim( data.thickness == 0 ? m_defaultThickness / m_DXF2mm
: data.thickness ) );
m_newItemsList.push_back( segm );
}
/**
* Import texts (TEXT).
*/
void DXF2BRD_CONVERTER::addText( const DRW_Text& aData )
{
TEXTE_PCB* pcb_text = new TEXTE_PCB( NULL );
pcb_text->SetLayer( ToLAYER_ID( m_brdLayer ) );
BOARD_ITEM* brdItem;
EDA_TEXT* textItem;
if( m_useModuleItems )
{
TEXTE_MODULE* modText = new TEXTE_MODULE( NULL );
brdItem = static_cast< BOARD_ITEM* >( modText );
textItem = static_cast< EDA_TEXT* >( modText );
}
else
{
TEXTE_PCB* pcbText = new TEXTE_PCB( NULL );
brdItem = static_cast< BOARD_ITEM* >( pcbText );
textItem = static_cast< EDA_TEXT* >( pcbText );
}
brdItem->SetLayer( ToLAYER_ID( m_brdLayer ) );
wxPoint refPoint( mapX( aData.basePoint.x ), mapY( aData.basePoint.y ) );
wxPoint secPoint( mapX( aData.secPoint.x ), mapY( aData.secPoint.y ) );
@@ -299,63 +317,63 @@ void DXF2BRD_CONVERTER::addText( const DRW_Text& aData )
switch( aData.alignV )
{
case DRW_Text::VBaseLine:
pcb_text->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
break;
case DRW_Text::VBaseLine:
textItem->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
break;
case DRW_Text::VBottom:
pcb_text->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
break;
case DRW_Text::VBottom:
textItem->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
break;
case DRW_Text::VMiddle:
pcb_text->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
break;
case DRW_Text::VMiddle:
textItem->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
break;
case DRW_Text::VTop:
pcb_text->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
break;
case DRW_Text::VTop:
textItem->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
break;
}
switch( aData.alignH )
{
case DRW_Text::HLeft:
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
break;
case DRW_Text::HLeft:
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
break;
case DRW_Text::HCenter:
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
break;
case DRW_Text::HCenter:
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
break;
case DRW_Text::HRight:
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
break;
case DRW_Text::HRight:
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
break;
case DRW_Text::HAligned:
// no equivalent options in text pcb.
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
break;
case DRW_Text::HAligned:
// no equivalent options in text pcb.
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
break;
case DRW_Text::HMiddle:
// no equivalent options in text pcb.
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
break;
case DRW_Text::HMiddle:
// no equivalent options in text pcb.
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
break;
case DRW_Text::HFit:
// no equivalent options in text pcb.
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
break;
case DRW_Text::HFit:
// no equivalent options in text pcb.
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
break;
}
#if 0
wxString sty = wxString::FromUTF8(aData.style.c_str());
sty=sty.ToLower();
wxString sty = wxString::FromUTF8( aData.style.c_str() );
sty = sty.ToLower();
if (aData.textgen==2)
if( aData.textgen == 2 )
{
// Text dir = left to right;
} else if (aData.textgen==4)
} else if( aData.textgen == 4 )
{
/ Text dir = top to bottom;
// Text dir = top to bottom;
} else
{
}
@@ -363,21 +381,20 @@ void DXF2BRD_CONVERTER::addText( const DRW_Text& aData )
wxString text = toNativeString( wxString::FromUTF8( aData.text.c_str() ) );
pcb_text->SetTextPosition( refPoint );
pcb_text->SetOrientation( aData.angle * 10 );
// The 0.8 factor gives a better height/width ratio with our font
pcb_text->SetWidth( mapDim( aData.height * 0.8 ) );
pcb_text->SetHeight( mapDim( aData.height ) );
pcb_text->SetThickness( mapDim( aData.thickness == 0 ? m_defaultThickness : aData.thickness ) );
pcb_text->SetText( text );
textItem->SetTextPosition( refPoint );
textItem->SetOrientation( aData.angle * 10 );
m_newItemsList.push_back( pcb_text );
// The 0.8 factor gives a better height/width ratio with our font
textItem->SetWidth( mapDim( aData.height * 0.8 ) );
textItem->SetHeight( mapDim( aData.height ) );
textItem->SetThickness( mapDim( aData.thickness == 0 ? m_defaultThickness / m_DXF2mm
: aData.thickness ) );
textItem->SetText( text );
m_newItemsList.push_back( static_cast< BOARD_ITEM* >( brdItem ) );
}
/**
* Import multi line texts (MTEXT).
*/
void DXF2BRD_CONVERTER::addMText( const DRW_MText& aData )
{
wxString text = toNativeString( wxString::FromUTF8( aData.text.c_str() ) );
@@ -408,46 +425,64 @@ void DXF2BRD_CONVERTER::addMText( const DRW_MText& aData )
text = tmp;
}
TEXTE_PCB* pcb_text = new TEXTE_PCB( NULL );
pcb_text->SetLayer( ToLAYER_ID( m_brdLayer ) );
BOARD_ITEM* brdItem;
EDA_TEXT* textItem;
if( m_useModuleItems )
{
TEXTE_MODULE* modText = new TEXTE_MODULE( NULL );
brdItem = static_cast< BOARD_ITEM* >( modText );
textItem = static_cast< EDA_TEXT* >( modText );
}
else
{
TEXTE_PCB* pcbText = new TEXTE_PCB( NULL );
brdItem = static_cast< BOARD_ITEM* >( pcbText );
textItem = static_cast< EDA_TEXT* >( pcbText );
}
brdItem->SetLayer( ToLAYER_ID( m_brdLayer ) );
wxPoint textpos( mapX( aData.basePoint.x ), mapY( aData.basePoint.y ) );
pcb_text->SetTextPosition( textpos );
pcb_text->SetOrientation( aData.angle * 10 );
textItem->SetTextPosition( textpos );
textItem->SetOrientation( aData.angle * 10 );
// The 0.8 factor gives a better height/width ratio with our font
pcb_text->SetWidth( mapDim( aData.height * 0.8 ) );
pcb_text->SetHeight( mapDim( aData.height ) );
pcb_text->SetThickness( mapDim( aData.thickness == 0 ? m_defaultThickness : aData.thickness ) );
pcb_text->SetText( text );
textItem->SetWidth( mapDim( aData.height * 0.8 ) );
textItem->SetHeight( mapDim( aData.height ) );
textItem->SetThickness( mapDim( aData.thickness == 0 ? m_defaultThickness / m_DXF2mm
: aData.thickness ) );
textItem->SetText( text );
// Initialize text justifications:
if( aData.textgen <= 3 )
{
pcb_text->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
textItem->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
}
else if( aData.textgen <= 6 )
{
pcb_text->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
textItem->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
}
else
{
pcb_text->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
textItem->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
}
if( aData.textgen % 3 == 1 )
{
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
}
else if( aData.textgen % 3 == 2 )
{
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
}
else
{
pcb_text->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
textItem->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
}
#if 0 // These setting have no mening in Pcbnew
if( data.alignH==1 )
if( data.alignH == 1 )
{
// Text is left to right;
}
@@ -460,7 +495,7 @@ void DXF2BRD_CONVERTER::addMText( const DRW_MText& aData )
// use ByStyle;
}
if( aData.alignV==1 )
if( aData.alignV == 1 )
{
// use AtLeast;
}
@@ -470,13 +505,10 @@ void DXF2BRD_CONVERTER::addMText( const DRW_MText& aData )
}
#endif
m_newItemsList.push_back( pcb_text );
m_newItemsList.push_back( static_cast< BOARD_ITEM* >( brdItem ) );
}
/**
* Sets the header variables from the DXF file.
*/
void DXF2BRD_CONVERTER::addHeader( const DRW_Header* data )
{
std::map<std::string, DRW_Variant*>::const_iterator it;
@@ -497,77 +529,69 @@ void DXF2BRD_CONVERTER::addHeader( const DRW_Header* data )
switch( var->content.i )
{
case 1: // inches
m_DXF2mm = 25.4;
break;
case 1: // inches
m_DXF2mm = 25.4;
break;
case 2: // feet
m_DXF2mm = 304.8;
break;
case 2: // feet
m_DXF2mm = 304.8;
break;
case 5: // centimeters
m_DXF2mm = 10.0;
break;
case 5: // centimeters
m_DXF2mm = 10.0;
break;
case 6: // meters
m_DXF2mm = 1000.0;
break;
case 6: // meters
m_DXF2mm = 1000.0;
break;
case 8: // microinches
m_DXF2mm = 2.54e-5;
break;
case 8: // microinches
m_DXF2mm = 2.54e-5;
break;
case 9: // mils
m_DXF2mm = 0.0254;
break;
case 9: // mils
m_DXF2mm = 0.0254;
break;
case 10: // yards
m_DXF2mm = 914.4;
break;
case 10: // yards
m_DXF2mm = 914.4;
break;
case 11: // Angstroms
m_DXF2mm = 1.0e-7;
break;
case 11: // Angstroms
m_DXF2mm = 1.0e-7;
break;
case 12: // nanometers
m_DXF2mm = 1.0e-6;
break;
case 12: // nanometers
m_DXF2mm = 1.0e-6;
break;
case 13: // micrometers
m_DXF2mm = 1.0e-3;
break;
case 13: // micrometers
m_DXF2mm = 1.0e-3;
break;
case 14: // decimeters
m_DXF2mm = 100.0;
break;
case 14: // decimeters
m_DXF2mm = 100.0;
break;
default:
// use the default of 1.0 for:
// 0: Unspecified Units
// 4: mm
// 3: miles
// 7: kilometers
// 15: decameters
// 16: hectometers
// 17: gigameters
// 18: AU
// 19: lightyears
// 20: parsecs
break;
default:
// use the default of 1.0 for:
// 0: Unspecified Units
// 4: mm
// 3: miles
// 7: kilometers
// 15: decameters
// 16: hectometers
// 17: gigameters
// 18: AU
// 19: lightyears
// 20: parsecs
break;
}
}
}
}
/**
* Converts a native unicode string into a DXF encoded string.
*
* DXF endoding includes the following special sequences:
* - %%%c for a diameter sign
* - %%%d for a degree sign
* - %%%p for a plus/minus sign
*/
wxString DXF2BRD_CONVERTER::toDxfString( const wxString& aStr )
{
wxString res;
@@ -622,9 +646,6 @@ wxString DXF2BRD_CONVERTER::toDxfString( const wxString& aStr )
}
/**
* Converts a DXF encoded string into a native Unicode string.
*/
wxString DXF2BRD_CONVERTER::toNativeString( const wxString& aData )
{
wxString res;
@@ -708,7 +729,8 @@ void DXF2BRD_CONVERTER::addTextStyle( const DRW_Textstyle& aData )
void DXF2BRD_CONVERTER::insertLine( const wxRealPoint& aSegStart,
const wxRealPoint& aSegEnd, int aWidth )
{
DRAWSEGMENT* segm = new DRAWSEGMENT( NULL );
DRAWSEGMENT* segm = ( m_useModuleItems ) ?
static_cast< DRAWSEGMENT* >( new EDGE_MODULE( NULL ) ) : new DRAWSEGMENT;
wxPoint segment_startpoint( Millimeter2iu( aSegStart.x ), Millimeter2iu( aSegStart.y ) );
wxPoint segment_endpoint( Millimeter2iu( aSegEnd.x ), Millimeter2iu( aSegEnd.y ) );
@@ -725,7 +747,8 @@ void DXF2BRD_CONVERTER::insertLine( const wxRealPoint& aSegStart,
void DXF2BRD_CONVERTER::insertArc( const wxRealPoint& aSegStart, const wxRealPoint& aSegEnd,
double aBulge, int aWidth )
{
DRAWSEGMENT* segm = new DRAWSEGMENT( NULL );
DRAWSEGMENT* segm = ( m_useModuleItems ) ?
static_cast< DRAWSEGMENT* >( new EDGE_MODULE( NULL ) ) : new DRAWSEGMENT;
wxPoint segment_startpoint( Millimeter2iu( aSegStart.x ), Millimeter2iu( aSegStart.y ) );
wxPoint segment_endpoint( Millimeter2iu( aSegEnd.x ), Millimeter2iu( aSegEnd.y ) );
+16
View File
@@ -50,11 +50,15 @@ private:
int m_brdLayer; // The board layer to place imported DXF items
int m_version; // the dxf version, not used here
std::string m_codePage; // The code page, not used here
bool m_useModuleItems; // Use module items instead of board items when true.
public:
DXF2BRD_CONVERTER();
~DXF2BRD_CONVERTER();
bool IsUsingModuleItems() const { return m_useModuleItems; }
void UseModuleItems( bool aUseModuleItems = true ) { m_useModuleItems = aUseModuleItems; }
/**
* Set the coordinate offset between the importede dxf items
* and Pcbnew.
@@ -151,7 +155,19 @@ private:
virtual void setBlock( const int aHandle ) {}
/**
* Converts a native unicode string into a DXF encoded string.
*
* DXF endoding includes the following special sequences:
* - %%%c for a diameter sign
* - %%%d for a degree sign
* - %%%p for a plus/minus sign
*/
static wxString toDxfString( const wxString& aStr );
/**
* Converts a DXF encoded string into a native Unicode string.
*/
static wxString toNativeString( const wxString& aData );
// These functions are not used in Kicad.
+23 -8
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 CERN
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -288,28 +288,43 @@ void FP_CACHE::Load()
if( dir.GetFirst( &fpFileName, wildcard, wxDIR_FILES ) )
{
wxString cacheError;
do
{
// prepend the libpath into fullPath
wxFileName fullPath( m_lib_path.GetPath(), fpFileName );
FILE_LINE_READER reader( fullPath.GetFullPath() );
// Queue I/O errors so only files that fail to parse don't get loaded.
try
{
FILE_LINE_READER reader( fullPath.GetFullPath() );
m_owner->m_parser->SetLineReader( &reader );
m_owner->m_parser->SetLineReader( &reader );
std::string name = TO_UTF8( fullPath.GetName() );
MODULE* footprint = (MODULE*) m_owner->m_parser->Parse();
std::string name = TO_UTF8( fullPath.GetName() );
MODULE* footprint = (MODULE*) m_owner->m_parser->Parse();
// The footprint name is the file name without the extension.
footprint->SetFPID( FPID( fullPath.GetName() ) );
m_modules.insert( name, new FP_CACHE_ITEM( footprint, fullPath ) );
// The footprint name is the file name without the extension.
footprint->SetFPID( FPID( fullPath.GetName() ) );
m_modules.insert( name, new FP_CACHE_ITEM( footprint, fullPath ) );
}
catch( const IO_ERROR& ioe )
{
if( !cacheError.IsEmpty() )
cacheError += "\n\n";
cacheError += ioe.errorText;
}
} while( dir.GetNext( &fpFileName ) );
// Remember the file modification time of library file when the
// cache snapshot was made, so that in a networked environment we will
// reload the cache as needed.
m_mod_time = GetLibModificationTime();
if( !cacheError.IsEmpty() )
THROW_IO_ERROR( cacheError );
}
}
+1 -1
View File
@@ -151,7 +151,7 @@ protected:
///> otherwise returns unchanged net code
inline int getNetCode( int aNetCode )
{
if( aNetCode < (int) m_netCodes.size() )
if( (unsigned int) aNetCode < m_netCodes.size() )
return m_netCodes[aNetCode];
return aNetCode;
+3 -2
View File
@@ -993,12 +993,13 @@ void FOOTPRINT_EDIT_FRAME::SetActiveLayer( LAYER_ID aLayer )
{
PCB_BASE_FRAME::SetActiveLayer( aLayer );
GetGalCanvas()->SetHighContrastLayer( aLayer );
m_Layers->SelectLayer( GetActiveLayer() );
m_Layers->OnLayerSelected();
if( IsGalCanvasActive() )
{
GetGalCanvas()->SetHighContrastLayer( aLayer );
GetGalCanvas()->Refresh();
}
}
+6 -1
View File
@@ -233,7 +233,11 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
// (it depends on the actual board)
// So we do not show the default clearance, by setting it to 0
// The footprint or pad specific clearance will be shown
GetBoard()->GetDesignSettings().GetDefault()->SetClearance(0);
GetBoard()->GetDesignSettings().GetDefault()->SetClearance( 0 );
// Don't show the default board solder mask clearance in the footprint editor. Only the
// footprint or pad clearance setting should be shown if it is not 0.
GetBoard()->GetDesignSettings().m_SolderMaskMargin = 0;
// restore the last footprint from the project, if any
restoreLastFootprint();
@@ -551,6 +555,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
aEvent.Check( GetToolId() == aEvent.GetId() );
}
void FOOTPRINT_EDIT_FRAME::OnUpdateOptionsToolbar( wxUpdateUIEvent& aEvent )
{
int id = aEvent.GetId();
+6 -3
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2007, 2008 Lubo Racko <developer@lura.sk>
* Copyright (C) 2007, 2008, 2012-2013 Alexander Lunev <al.lunev@yahoo.com>
* Copyright (C) 2012 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -94,8 +94,11 @@ void PCB_POLYGON::SetOutline( VERTICES_ARRAY* aOutline )
for( i = 0; i < (int) aOutline->GetCount(); i++ )
m_outline.Add( new wxRealPoint( (*aOutline)[i]->x, (*aOutline)[i]->y ) );
m_positionX = m_outline[0]->x;
m_positionY = m_outline[0]->y;
if( m_outline.Count() > 0 )
{
m_positionX = m_outline[0]->x;
m_positionY = m_outline[0]->y;
}
}
void PCB_POLYGON::FormPolygon( XNODE* aNode, VERTICES_ARRAY* aPolygon,
+28 -13
View File
@@ -248,10 +248,8 @@ void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR, IO_ERROR )
for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{
if( token != T_LEFT )
Expecting( T_LEFT );
token = NextTok();
if( token == T_LEFT )
token = NextTok();
switch( token )
{
@@ -264,14 +262,14 @@ void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR, IO_ERROR )
switch( token )
{
case T_size:
{
wxSize sz;
sz.SetHeight( parseBoardUnits( "text height" ) );
sz.SetWidth( parseBoardUnits( "text width" ) );
aText->SetSize( sz );
NeedRIGHT();
{
wxSize sz;
sz.SetHeight( parseBoardUnits( "text height" ) );
sz.SetWidth( parseBoardUnits( "text width" ) );
aText->SetSize( sz );
NeedRIGHT();
}
break;
}
case T_thickness:
aText->SetThickness( parseBoardUnits( "text thickness" ) );
@@ -792,7 +790,7 @@ void PCB_PARSER::parseLayer( LAYER* aLayer ) throw( IO_ERROR, PARSE_ERROR )
// this layer_num is not used, we DO depend on LAYER_T however.
LAYER_NUM layer_num = parseInt( "layer index" );
NeedSYMBOL();
NeedSYMBOLorNUMBER();
name = CurText();
NeedSYMBOL();
@@ -1960,7 +1958,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
RotatePoint( &pt, module->GetOrientation() );
pad->SetPosition( pt + module->GetPosition() );
module->Add( pad );
module->Add( pad, ADD_APPEND );
}
break;
@@ -2058,6 +2056,23 @@ TEXTE_MODULE* PCB_PARSER::parseTEXTE_MODULE() throw( IO_ERROR, PARSE_ERROR )
case T_effects:
parseEDA_TEXT( (EDA_TEXT*) text.get() );
// Due to a double definition (a bug) of SetVisible (one in EDA_TEXT and
// one in TEXTE_MODULE), verify if the EDA_TEXT is set to invisible
// This allows compatibility with files which could be created
// by pcbnew version janv 25, 2017, which fix a old bug (this one)
// This compatibility is especially important for footprint files.
if( !text->EDA_TEXT::IsVisible() )
{
// Only if the EDA_TEXT visibility is false, set the
// TEXTE_MODULE visibility to false.
// in files created by 4.05 version and older, the EDA_TEXT
// visibility is always true (the default), due to this bug
text->SetVisible( false );
// If we want a full compatibiliy with previous stable version,
// this ugly workaround avoids writing "hide" token
// in "effects" section, when the file comes from some recent pcbnew version
text->EDA_TEXT::SetVisible( true );
}
break;
default:
+17 -16
View File
@@ -2,7 +2,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -90,6 +90,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() :
m_plotFrameRef = false;
m_plotViaOnMaskLayer = false;
m_plotMode = FILLED;
m_DXFplotPolygonMode = true;
m_useAuxOrigin = false;
m_HPGLPenNum = 1;
m_HPGLPenSpeed = 20; // this param is always in cm/s
@@ -113,8 +114,6 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() :
m_widthAdjust = 0.;
m_outputDirectory.clear();
m_color = BLACK;
m_referenceColor = BLACK;
m_valueColor = BLACK;
m_textMode = PLOTTEXTMODE_DEFAULT;
// This parameter controls if the NPTH pads will be plotted or not
@@ -219,7 +218,7 @@ void PCB_PLOT_PARAMS::Parse( PCB_PLOT_PARAMS_PARSER* aParser )
}
bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms ) const
{
if( m_layerSelection != aPcbPlotParams.m_layerSelection )
return false;
@@ -239,6 +238,13 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
return false;
if( m_plotMode != aPcbPlotParams.m_plotMode )
return false;
if( !aCompareOnlySavedPrms )
{
if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode )
return false;
}
if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
return false;
if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
@@ -281,12 +287,13 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
return false;
if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
return false;
if( m_color != aPcbPlotParams.m_color )
return false;
if( m_referenceColor != aPcbPlotParams.m_referenceColor )
return false;
if( m_valueColor != aPcbPlotParams.m_valueColor )
return false;
if( !aCompareOnlySavedPrms )
{
if( m_color != aPcbPlotParams.m_color )
return false;
}
if( m_textMode != aPcbPlotParams.m_textMode )
return false;
if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
@@ -295,12 +302,6 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
}
bool PCB_PLOT_PARAMS::operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
{
return !( *this == aPcbPlotParams );
}
bool PCB_PLOT_PARAMS::SetHPGLPenDiameter( int aValue )
{
return setInt( &m_HPGLPenDiam, aValue, HPGL_PEN_DIAMETER_MIN, HPGL_PEN_DIAMETER_MAX );
+25 -16
View File
@@ -54,6 +54,12 @@ private:
*/
EDA_DRAW_MODE_T m_plotMode;
/** DXF format: Plot items in outline (polygon) mode
* In polygon mode, each item to plot is converted to a polygon, and all
* polygons are merged.
*/
bool m_DXFplotPolygonMode;
/// Plot format type (chooses the driver to be used)
PlotFormat m_format;
@@ -63,7 +69,7 @@ private:
/// Choose how represent text with PS, PDF and DXF drivers
PlotTextMode m_textMode;
/// The default line width (used for the frame and in LINE mode)
/// The default line width (used to draw items having no defined width)
int m_lineWidth;
/// When true set the scale to fit the board in the page
@@ -90,8 +96,10 @@ private:
/// Set of layers to plot
LSET m_layerSelection;
/** When plotting gerbers use a conventional set of Protel extensions
* instead of appending a suffix to the board name */
/** When plotting gerber files, use a conventional set of Protel extensions
* instead of .gbr, that is now the offical gerber file extension
* this is a deprecated feature
*/
bool m_useGerberProtelExtensions;
/// Include attributes from the Gerber X2 format (chapter 5 in revision J2)
@@ -103,7 +111,7 @@ private:
/// 5 is the minimal value for professional boards.
int m_gerberPrecision;
/// Plot gerbers using auxiliary (drill) origin instead of page coordinates
/// Plot gerbers using auxiliary (drill) origin instead of absolute coordinates
bool m_useAuxOrigin;
/// On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
@@ -136,8 +144,8 @@ private:
* near 1.0; only X and Y dimensions are adjusted: circles are plotted as
* circles, even if X and Y fine scale differ; because of this it is mostly
* useful for printers: postscript plots would be best adjusted using
* the prologue (that would change the whole output matrix */
* the prologue (that would change the whole output matrix
*/
double m_fineScaleAdjustX; ///< fine scale adjust X axis
double m_fineScaleAdjustY; ///< fine scale adjust Y axis
@@ -151,8 +159,6 @@ private:
int m_HPGLPenDiam; ///< HPGL only: pen diameter in MILS, useful to fill areas
int m_HPGLPenOvr; ///< HPGL only: pen overlay in MILS, useful only to fill areas
EDA_COLOR_T m_color; ///< Color for plotting the current layer
EDA_COLOR_T m_referenceColor; ///< Color for plotting references
EDA_COLOR_T m_valueColor; ///< Color for plotting values
public:
PCB_PLOT_PARAMS();
@@ -164,24 +170,27 @@ public:
const throw( IO_ERROR );
void Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( PARSE_ERROR, IO_ERROR );
bool operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
bool operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
/**
* Compare current settings to aPcbPlotParams, including not saved parameters in brd file
* @param aPcbPlotParams = the PCB_PLOT_PARAMS to compare
* @param aCompareOnlySavedPrms = true to compare only saved in file parameters,
* and false to compare the full set of parameters.
* @return true is parameters are same, false if one (or more) parameter does not match
*/
bool IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms ) const;
void SetColor( EDA_COLOR_T aVal ) { m_color = aVal; }
EDA_COLOR_T GetColor() const { return m_color; }
void SetReferenceColor( EDA_COLOR_T aVal ) { m_referenceColor = aVal; }
EDA_COLOR_T GetReferenceColor() const { return m_referenceColor; }
void SetValueColor( EDA_COLOR_T aVal ) { m_valueColor = aVal; }
EDA_COLOR_T GetValueColor() const { return m_valueColor; }
void SetTextMode( PlotTextMode aVal ) { m_textMode = aVal; }
PlotTextMode GetTextMode() const { return m_textMode; }
void SetPlotMode( EDA_DRAW_MODE_T aPlotMode ) { m_plotMode = aPlotMode; }
EDA_DRAW_MODE_T GetPlotMode() const { return m_plotMode; }
void SetDXFPlotPolygonMode( bool aFlag ) { m_DXFplotPolygonMode = aFlag; }
bool GetDXFPlotPolygonMode() const { return m_DXFplotPolygonMode; }
void SetDrillMarksType( DrillMarksType aVal ) { m_drillMarks = aVal; }
DrillMarksType GetDrillMarksType() const { return m_drillMarks; }
+19 -9
View File
@@ -609,8 +609,15 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
// Delete the auto save file if it exists.
wxFileName fn = GetBoard()->GetFileName();
// Auto save file name is the normal file name prefixed with a '$'.
fn.SetName( wxT( "$" ) + fn.GetName() );
// Auto save file name is the normal file name prefixed with '_autosave'.
fn.SetName( GetAutoSaveFilePrefix() + fn.GetName() );
// When the auto save feature does not have write access to the board file path, it falls
// back to a platform specific user temporary file path.
if( !fn.IsOk() || !fn.IsDirWritable() )
fn.SetPath( wxFileName::GetTempDir() );
wxLogTrace( traceAutoSave, "Deleting auto save file <" + fn.GetFullPath() + ">" );
// Remove the auto save file on a normal close of Pcbnew.
if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
@@ -838,14 +845,13 @@ void PCB_EDIT_FRAME::SetActiveLayer( LAYER_ID aLayer )
{
PCB_BASE_FRAME::SetActiveLayer( aLayer );
GetGalCanvas()->SetHighContrastLayer( aLayer );
syncLayerWidgetLayer();
if( IsGalCanvasActive() )
{
m_toolManager->RunAction( COMMON_ACTIONS::layerChanged ); // notify other tools
GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
GetGalCanvas()->SetHighContrastLayer( aLayer );
GetGalCanvas()->Refresh();
}
}
@@ -956,16 +962,20 @@ void PCB_EDIT_FRAME::OnModify( )
void PCB_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
{
PCB_PLOT_PARAMS tmp = GetPlotSettings();
PCB_PLOT_PARAMS plot_prms = GetPlotSettings();
// we don't want dialogs knowing about complex wxFrame functions so
// pass everything the dialog needs without reference to *this frame's class.
if( InvokeSVGPrint( this, GetBoard(), &tmp ) )
if( InvokeSVGPrint( this, GetBoard(), &plot_prms ) )
{
if( tmp != GetPlotSettings() )
if( !plot_prms.IsSameAs( GetPlotSettings(), false ) )
{
SetPlotSettings( tmp );
OnModify();
// First, mark board as modified only for parameters saved in file
if( !plot_prms.IsSameAs( GetPlotSettings(), true ) )
OnModify();
// Now, save any change, for the session
SetPlotSettings( plot_prms );
}
}
}

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