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