mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-18 18:29:17 +00:00
+ Resync with main r6397
+ Work in progress: VRML parser
This commit is contained in:
commit
07bd4cbc04
3d-viewer
CMakeLists.txtREADME.txtcommon
cvpcb
eeschema
class_drc_erc_item.cppclass_libentry.cppclass_netlist_object.hcomponent_tree_search_container.cpp
dialogs
dialog_erc.cppdialog_erc.hdialog_erc_base.cppdialog_erc_base.fbpdialog_erc_base.hdialog_plot_schematic_base.cppdialog_plot_schematic_base.fbpdialog_plot_schematic_base.h
eeschema_config.cpperc.cpperc.hnetlist.cppsch_sheet.cppsch_sheet.hsch_sheet_path.cppsch_sheet_path.hschframe.cppinclude
pcbnew
CMakeLists.txtbasepcbframe.cppclass_pad_draw_functions.cpp
dialogs
dialog_copper_zones.cppdialog_find_base.fbpdialog_get_footprint_by_name.hdialog_get_footprint_by_name_base.cppdialog_get_footprint_by_name_base.fbpdialog_get_footprint_by_name_base.h
edit.cppfiles.cppfootprint_wizard_frame.cppgithub
modedit.cppmoduleframe.cppmodules.cppmodview_frame.cpppcbframe.cpppcbnew.cppscripting/kicad_pyshell
toolbars_update_user_interface.cpptools
plugins/3d/vrml/v2
scripting
@ -116,7 +116,7 @@ END_EVENT_TABLE()
|
||||
EDA_3D_FRAME::EDA_3D_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent,
|
||||
const wxString& aTitle, long style ) :
|
||||
KIWAY_PLAYER( aKiway, aParent, FRAME_PCB_DISPLAY3D, aTitle,
|
||||
wxDefaultPosition, wxDefaultSize, style, wxT( "Frame3D" ) )
|
||||
wxDefaultPosition, wxDefaultSize, style, VIEWER3D_FRAMENAME )
|
||||
{
|
||||
m_canvas = NULL;
|
||||
m_reloadRequest = false;
|
||||
@ -227,6 +227,7 @@ EDA_3D_FRAME::~EDA_3D_FRAME()
|
||||
m_auimgr.UnInit();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::Exit3DFrame( wxCommandEvent& event )
|
||||
{
|
||||
Close( true );
|
||||
@ -235,9 +236,6 @@ void EDA_3D_FRAME::Exit3DFrame( wxCommandEvent& event )
|
||||
|
||||
void EDA_3D_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||
{
|
||||
if( Parent() )
|
||||
Parent()->m_Draw3DFrame = NULL;
|
||||
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,8 @@ class wxColourData;
|
||||
|
||||
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE (wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS)
|
||||
|
||||
#define VIEWER3D_FRAMENAME wxT( "Viewer3DFrameName" )
|
||||
|
||||
|
||||
class EDA_3D_FRAME : public KIWAY_PLAYER
|
||||
{
|
||||
|
@ -478,6 +478,9 @@ endif()
|
||||
# Find GLM library
|
||||
find_package( GLM 0.9.5.4 REQUIRED )
|
||||
|
||||
# Find CURL library
|
||||
find_package( CURL REQUIRED )
|
||||
|
||||
# Find Cairo library
|
||||
if( NOT CAIRO_FOUND )
|
||||
find_package( Cairo 1.8.1 QUIET )
|
||||
|
@ -11,9 +11,9 @@ CMakeList.txt - CMAKE build tool script
|
||||
COPYRIGHT.txt - A copy of the GNU General Public License Version 2
|
||||
CTestConfig.cmake - Support for CTest and CDash testing tools
|
||||
Doxyfile - Doxygen config file for Kicad
|
||||
INSTALL.txt - The release (binairy) installation instructions
|
||||
INSTALL.txt - The release (binary) installation instructions
|
||||
TODO.txt - Todo list
|
||||
uncrustify.cfg - Uncrustify config file for uncrustify sorces formatting tool
|
||||
uncrustify.cfg - Uncrustify config file for uncrustify sources formatting tool
|
||||
|
||||
Subdirectories
|
||||
--------------
|
||||
|
@ -5,6 +5,7 @@ include_directories(
|
||||
${CAIRO_INCLUDE_DIR}
|
||||
${GLEW_INCLUDE_DIR}
|
||||
${GLM_INCLUDE_DIR}
|
||||
${CURL_INCLUDE_DIRS}
|
||||
../3d-viewer
|
||||
../pcbnew
|
||||
../polygon
|
||||
@ -201,6 +202,7 @@ set( COMMON_SRCS
|
||||
dsnlexer.cpp
|
||||
eda_dde.cpp
|
||||
eda_doc.cpp
|
||||
eda_pattern_match.cpp
|
||||
filter_reader.cpp
|
||||
# findkicadhelppath.cpp.notused deprecated, use searchhelpfilefullpath.cpp
|
||||
gestfich.cpp
|
||||
@ -253,6 +255,9 @@ endif()
|
||||
|
||||
set( COMMON_SRCS
|
||||
${COMMON_SRCS}
|
||||
kicad_curl/kicad_curl.cpp
|
||||
kicad_curl/kicad_curl_easy.cpp
|
||||
|
||||
view/view.cpp
|
||||
view/view_item.cpp
|
||||
view/view_group.cpp
|
||||
@ -278,7 +283,7 @@ set( COMMON_SRCS
|
||||
add_library( common STATIC ${COMMON_SRCS} )
|
||||
add_dependencies( common lib-dependencies )
|
||||
add_dependencies( common version_header )
|
||||
target_link_libraries( common ${Boost_LIBRARIES} )
|
||||
target_link_libraries( common ${Boost_LIBRARIES} ${CURL_LIBRARIES} )
|
||||
|
||||
|
||||
set( PCB_COMMON_SRCS
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 5 2013)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
@ -14,7 +14,10 @@ DIALOG_GET_COMPONENT_BASE::DIALOG_GET_COMPONENT_BASE( wxWindow* parent, wxWindow
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizerUpper;
|
||||
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bSizerLeft;
|
||||
bSizerLeft = new wxBoxSizer( wxVERTICAL );
|
||||
@ -34,24 +37,17 @@ DIALOG_GET_COMPONENT_BASE::DIALOG_GET_COMPONENT_BASE( wxWindow* parent, wxWindow
|
||||
m_historyList = new wxListBox( this, ID_SEL_BY_LISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
|
||||
m_historyList->SetMinSize( wxSize( 200,100 ) );
|
||||
|
||||
bSizerLeft->Add( m_historyList, 1, wxALL|wxEXPAND, 5 );
|
||||
bSizerLeft->Add( m_historyList, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerLeft, 1, wxEXPAND, 5 );
|
||||
bSizerUpper->Add( bSizerLeft, 1, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerRight;
|
||||
bSizerRight = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonOK->SetDefault();
|
||||
bSizerRight->Add( m_buttonOK, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonKW = new wxButton( this, ID_ACCEPT_KEYWORD, _("Search by Keyword"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonKW, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonList = new wxButton( this, ID_LIST_ALL, _("List All"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonList, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
@ -59,32 +55,46 @@ DIALOG_GET_COMPONENT_BASE::DIALOG_GET_COMPONENT_BASE( wxWindow* parent, wxWindow
|
||||
bSizerRight->Add( m_buttonBrowse, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizerUpper->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
bSizerMain->Fit( this );
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
m_historyList->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonKW->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::OnCancel ), NULL, this );
|
||||
m_buttonList->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::GetExtraSelection ), NULL, this );
|
||||
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::OnCancel ), NULL, this );
|
||||
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_GET_COMPONENT_BASE::~DIALOG_GET_COMPONENT_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_historyList->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonKW->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::OnCancel ), NULL, this );
|
||||
m_buttonList->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::GetExtraSelection ), NULL, this );
|
||||
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::OnCancel ), NULL, this );
|
||||
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_COMPONENT_BASE::Accept ), NULL, this );
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 5 2013)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
@ -24,6 +24,7 @@ class DIALOG_SHIM;
|
||||
#include <wx/listbox.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -45,21 +46,23 @@ class DIALOG_GET_COMPONENT_BASE : public DIALOG_SHIM
|
||||
wxTextCtrl* m_textCmpNameCtrl;
|
||||
wxStaticText* m_staticTextHistory;
|
||||
wxListBox* m_historyList;
|
||||
wxButton* m_buttonOK;
|
||||
wxButton* m_buttonKW;
|
||||
wxButton* m_buttonCancel;
|
||||
wxButton* m_buttonList;
|
||||
wxButton* m_buttonBrowse;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void Accept( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void GetExtraSelection( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_GET_COMPONENT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_GET_COMPONENT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 361,285 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_GET_COMPONENT_BASE();
|
||||
|
||||
};
|
||||
|
137
common/eda_pattern_match.cpp
Normal file
137
common/eda_pattern_match.cpp
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Chris Pavlina <pavlina.chris@gmail.com>
|
||||
* Copyright (C) 2015 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
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <eda_pattern_match.h>
|
||||
#include <wx/log.h>
|
||||
#include <climits>
|
||||
|
||||
bool EDA_PATTERN_MATCH_SUBSTR::SetPattern( const wxString& aPattern )
|
||||
{
|
||||
m_pattern = aPattern;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int EDA_PATTERN_MATCH_SUBSTR::Find( const wxString& aCandidate ) const
|
||||
{
|
||||
int loc = aCandidate.Find( m_pattern );
|
||||
|
||||
return ( loc == wxNOT_FOUND ) ? EDA_PATTERN_NOT_FOUND : loc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Context class to set wx loglevel for a block, and always restore it at the end.
|
||||
*/
|
||||
class WX_LOGLEVEL_CONTEXT
|
||||
{
|
||||
wxLogLevel m_old_level;
|
||||
|
||||
public:
|
||||
WX_LOGLEVEL_CONTEXT( wxLogLevel level )
|
||||
{
|
||||
m_old_level = wxLog::GetLogLevel();
|
||||
wxLog::SetLogLevel( level );
|
||||
}
|
||||
|
||||
~WX_LOGLEVEL_CONTEXT()
|
||||
{
|
||||
wxLog::SetLogLevel( m_old_level );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
bool EDA_PATTERN_MATCH_REGEX::SetPattern( const wxString& aPattern )
|
||||
{
|
||||
m_pattern = aPattern;
|
||||
|
||||
// Evil and undocumented: wxRegEx::Compile calls wxLogError on error, even
|
||||
// though it promises to just return false. Silence the error.
|
||||
WX_LOGLEVEL_CONTEXT ctx( wxLOG_FatalError );
|
||||
|
||||
return m_regex.Compile( aPattern, wxRE_ADVANCED );
|
||||
}
|
||||
|
||||
|
||||
int EDA_PATTERN_MATCH_REGEX::Find( const wxString& aCandidate ) const
|
||||
{
|
||||
if( m_regex.IsValid() )
|
||||
{
|
||||
if( m_regex.Matches( aCandidate ) )
|
||||
{
|
||||
size_t start, len;
|
||||
m_regex.GetMatch( &start, &len, 0 );
|
||||
return ( start > INT_MAX ) ? INT_MAX : start;
|
||||
}
|
||||
else
|
||||
{
|
||||
return EDA_PATTERN_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int loc = aCandidate.Find( m_pattern );
|
||||
return ( loc == wxNOT_FOUND ) ? EDA_PATTERN_NOT_FOUND : loc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool EDA_PATTERN_MATCH_WILDCARD::SetPattern( const wxString& aPattern )
|
||||
{
|
||||
// Compile the wildcard string to a regular expression
|
||||
wxString regex;
|
||||
regex.Alloc( 2 * aPattern.Length() ); // no need to keep resizing, we know the size roughly
|
||||
|
||||
const wxString to_replace = wxT( ".*+?^${}()|[]/\\" );
|
||||
|
||||
for( wxString::const_iterator it = aPattern.begin(); it < aPattern.end(); ++it )
|
||||
{
|
||||
wxUniChar c = *it;
|
||||
if( c == '?' )
|
||||
{
|
||||
regex += wxT( "." );
|
||||
}
|
||||
else if( c == '*' )
|
||||
{
|
||||
regex += wxT( ".*" );
|
||||
}
|
||||
else if( to_replace.Find( c ) != wxNOT_FOUND )
|
||||
{
|
||||
regex += "\\";
|
||||
regex += c;
|
||||
}
|
||||
else
|
||||
{
|
||||
regex += c;
|
||||
}
|
||||
}
|
||||
|
||||
return EDA_PATTERN_MATCH_REGEX::SetPattern( regex );
|
||||
}
|
||||
|
||||
|
||||
int EDA_PATTERN_MATCH_WILDCARD::Find( const wxString& aCandidate ) const
|
||||
{
|
||||
return EDA_PATTERN_MATCH_REGEX::Find( aCandidate );
|
||||
}
|
54
common/kicad_curl/kicad_curl.cpp
Normal file
54
common/kicad_curl/kicad_curl.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
|
||||
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <kicad_curl/kicad_curl.h>
|
||||
|
||||
bool KICAD_CURL::Init()
|
||||
{
|
||||
if ( curl_global_init( CURL_GLOBAL_ALL ) != CURLE_OK )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_initialized = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KICAD_CURL::Cleanup()
|
||||
{
|
||||
if( m_initialized )
|
||||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
|
||||
std::string KICAD_CURL::GetVersion()
|
||||
{
|
||||
return std::string( curl_version() );
|
||||
}
|
||||
|
||||
|
||||
bool KICAD_CURL::m_initialized = false;
|
163
common/kicad_curl/kicad_curl_easy.cpp
Normal file
163
common/kicad_curl/kicad_curl_easy.cpp
Normal file
@ -0,0 +1,163 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
|
||||
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <kicad_curl/kicad_curl_easy.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <stdarg.h>
|
||||
#include <sstream>
|
||||
#include <richio.h>
|
||||
|
||||
static size_t write_callback (void *contents, size_t size, size_t nmemb, void *userp);
|
||||
|
||||
|
||||
KICAD_CURL_EASY::KICAD_CURL_EASY()
|
||||
: m_headers( NULL )
|
||||
{
|
||||
m_CURL = curl_easy_init();
|
||||
|
||||
if( m_CURL == NULL )
|
||||
{
|
||||
THROW_IO_ERROR( "Unable to initialize CURL session" );
|
||||
}
|
||||
|
||||
m_Buffer.payload = (char*)malloc( 1 );
|
||||
m_Buffer.size = 0;
|
||||
|
||||
curl_easy_setopt( m_CURL, CURLOPT_WRITEFUNCTION, write_callback );
|
||||
curl_easy_setopt( m_CURL, CURLOPT_WRITEDATA, (void *)&m_Buffer );
|
||||
}
|
||||
|
||||
|
||||
KICAD_CURL_EASY::~KICAD_CURL_EASY()
|
||||
{
|
||||
free(m_Buffer.payload);
|
||||
curl_easy_cleanup(m_CURL);
|
||||
}
|
||||
|
||||
|
||||
bool KICAD_CURL_EASY::SetURL( const std::string& aURL )
|
||||
{
|
||||
if( SetOption<const char *>( CURLOPT_URL, aURL.c_str() ) == CURLE_OK )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool KICAD_CURL_EASY::SetUserAgent( const std::string& aAgent )
|
||||
{
|
||||
if( SetOption<const char *>( CURLOPT_USERAGENT, aAgent.c_str() ) == CURLE_OK )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool KICAD_CURL_EASY::SetFollowRedirects( bool aFollow )
|
||||
{
|
||||
if( SetOption<long>( CURLOPT_FOLLOWLOCATION , (aFollow ? 1 : 0) ) == CURLE_OK )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void KICAD_CURL_EASY::SetHeader( const std::string& aName, const std::string& aValue )
|
||||
{
|
||||
std::string header = aName + ':' + aValue;
|
||||
m_headers = curl_slist_append( m_headers, header.c_str() );
|
||||
}
|
||||
|
||||
|
||||
std::string KICAD_CURL_EASY::GetErrorText(CURLcode code)
|
||||
{
|
||||
return curl_easy_strerror(code);
|
||||
}
|
||||
|
||||
|
||||
static size_t write_callback( void *contents, size_t size, size_t nmemb, void *userp )
|
||||
{
|
||||
/* calculate buffer size */
|
||||
size_t realsize = size * nmemb;
|
||||
|
||||
/* cast pointer to fetch struct */
|
||||
struct KICAD_EASY_CURL_BUFFER *p = ( struct KICAD_EASY_CURL_BUFFER * ) userp;
|
||||
|
||||
/* expand buffer */
|
||||
p->payload = (char *) realloc( p->payload, p->size + realsize + 1 );
|
||||
|
||||
/* check buffer */
|
||||
if ( p->payload == NULL )
|
||||
{
|
||||
wxLogError( wxT( "Failed to expand buffer in curl_callback" ) );
|
||||
|
||||
/* free buffer */
|
||||
free( p->payload );
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* copy contents to buffer */
|
||||
memcpy( &(p->payload[p->size]), contents, realsize );
|
||||
|
||||
/* set new buffer size */
|
||||
p->size += realsize;
|
||||
|
||||
/* ensure null termination */
|
||||
p->payload[p->size] = 0;
|
||||
|
||||
/* return size */
|
||||
return realsize;
|
||||
}
|
||||
|
||||
|
||||
void KICAD_CURL_EASY::Perform()
|
||||
{
|
||||
if( m_headers != NULL )
|
||||
{
|
||||
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
|
||||
}
|
||||
|
||||
if( m_Buffer.size > 0 )
|
||||
{
|
||||
free( m_Buffer.payload );
|
||||
m_Buffer.payload = (char*)malloc( 1 );
|
||||
m_Buffer.size = 0;
|
||||
}
|
||||
|
||||
CURLcode res = curl_easy_perform( m_CURL );
|
||||
if( res != CURLE_OK )
|
||||
{
|
||||
wxString msg = wxString::Format(
|
||||
_( "CURL Request Failed: %s" ),
|
||||
GetErrorText( res ) );
|
||||
|
||||
THROW_IO_ERROR( msg );
|
||||
}
|
||||
}
|
@ -212,7 +212,7 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
|
||||
if( ! wxFileExists( dname ) )
|
||||
msg << wxT( "It is missing.\n" );
|
||||
else
|
||||
msg << wxT( "Perhaps a wxWidgets shared (.dll or .so) file is missing.\n" );
|
||||
msg << wxT( "Perhaps a shared library (.dll or .so) file is missing.\n" );
|
||||
|
||||
msg << wxT( "From command line: argv[0]:\n'" );
|
||||
msg << wxStandardPaths::Get().GetExecutablePath() << wxT( "'\n" );
|
||||
|
@ -119,7 +119,6 @@ bool KIWAY_PLAYER::ShowModal( wxString* aResult, wxWindow* aResultantFocusWindow
|
||||
if( wlist[ii]->IsTopLevel() && wlist[ii]->IsEnabled() )
|
||||
enabledTopLevelWindows.push_back( wlist[ii] );
|
||||
|
||||
|
||||
// exception safe way to disable all top level windows except the modal one,
|
||||
// re-enables only those that were disabled on exit
|
||||
wxWindowDisabler toggle( this );
|
||||
|
@ -30,6 +30,7 @@
|
||||
* (locale handling)
|
||||
*/
|
||||
|
||||
#include <kicad_curl/kicad_curl.h> /* Include before any wx file */
|
||||
#include <fctsys.h>
|
||||
#include <wx/html/htmlwin.h>
|
||||
#include <wx/fs_zip.h>
|
||||
@ -282,6 +283,7 @@ PGM_BASE::PGM_BASE()
|
||||
PGM_BASE::~PGM_BASE()
|
||||
{
|
||||
destroy();
|
||||
KICAD_CURL::Cleanup();
|
||||
}
|
||||
|
||||
|
||||
@ -493,6 +495,13 @@ bool PGM_BASE::initPgm()
|
||||
wxSystemOptions::SetOption( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES, 1 );
|
||||
#endif
|
||||
|
||||
// Initialize CURL
|
||||
wxLogDebug( wxT( "Using %s" ), KICAD_CURL::GetVersion() );
|
||||
if( !KICAD_CURL::Init() )
|
||||
{
|
||||
wxLogDebug( wxT( "Error initializing libcurl" ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -149,8 +149,10 @@ DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME()
|
||||
|
||||
void DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow( wxCloseEvent& event )
|
||||
{
|
||||
if( m_Draw3DFrame )
|
||||
m_Draw3DFrame->Close( true );
|
||||
EDA_3D_FRAME* draw3DFrame = Get3DViewerFrame();
|
||||
|
||||
if( draw3DFrame )
|
||||
draw3DFrame->Close( true );
|
||||
|
||||
Destroy();
|
||||
}
|
||||
@ -382,25 +384,27 @@ bool DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
|
||||
|
||||
void DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame( wxCommandEvent& event )
|
||||
{
|
||||
if( m_Draw3DFrame )
|
||||
EDA_3D_FRAME* draw3DFrame = Get3DViewerFrame();
|
||||
|
||||
if( draw3DFrame )
|
||||
{
|
||||
// Raising the window does not show the window on Windows if iconized.
|
||||
// This should work on any platform.
|
||||
if( m_Draw3DFrame->IsIconized() )
|
||||
m_Draw3DFrame->Iconize( false );
|
||||
if( draw3DFrame->IsIconized() )
|
||||
draw3DFrame->Iconize( false );
|
||||
|
||||
m_Draw3DFrame->Raise();
|
||||
draw3DFrame->Raise();
|
||||
|
||||
// Raising the window does not set the focus on Linux. This should work on any platform.
|
||||
if( wxWindow::FindFocus() != m_Draw3DFrame )
|
||||
m_Draw3DFrame->SetFocus();
|
||||
if( wxWindow::FindFocus() != draw3DFrame )
|
||||
draw3DFrame->SetFocus();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_Draw3DFrame = new EDA_3D_FRAME( &Kiway(), this, _( "3D Viewer" ) );
|
||||
m_Draw3DFrame->Raise(); // Needed with some Window Managers
|
||||
m_Draw3DFrame->Show( true );
|
||||
draw3DFrame = new EDA_3D_FRAME( &Kiway(), this, _( "3D Viewer" ) );
|
||||
draw3DFrame->Raise(); // Needed with some Window Managers
|
||||
draw3DFrame->Show( true );
|
||||
}
|
||||
|
||||
|
||||
@ -489,7 +493,8 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
||||
msg.Printf( _( "Footprint: %s" ), GetChars( footprintName ) );
|
||||
|
||||
SetTitle( msg );
|
||||
const FOOTPRINT_INFO* module_info = parentframe->m_footprints.GetModuleInfo( footprintName );
|
||||
const FOOTPRINT_INFO* module_info =
|
||||
parentframe->m_footprints.GetModuleInfo( footprintName );
|
||||
|
||||
const wxChar* libname;
|
||||
|
||||
@ -530,8 +535,10 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
||||
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
if( m_Draw3DFrame )
|
||||
m_Draw3DFrame->NewDisplay();
|
||||
EDA_3D_FRAME* draw3DFrame = Get3DViewerFrame();
|
||||
|
||||
if( draw3DFrame )
|
||||
draw3DFrame->NewDisplay();
|
||||
}
|
||||
|
||||
|
||||
|
@ -910,7 +910,8 @@ COMPONENT* CVPCB_MAINFRAME::GetSelectedComponent()
|
||||
DISPLAY_FOOTPRINTS_FRAME* CVPCB_MAINFRAME::GetFpViewerFrame()
|
||||
{
|
||||
// returns the Footprint Viewer frame, if exists, or NULL
|
||||
return (DISPLAY_FOOTPRINTS_FRAME*) wxWindow::FindWindowByName( FOOTPRINTVIEWER_FRAME_NAME );
|
||||
return dynamic_cast<DISPLAY_FOOTPRINTS_FRAME*>
|
||||
( wxWindow::FindWindowByName( FOOTPRINTVIEWER_FRAME_NAME ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,6 +54,10 @@ wxString DRC_ITEM::GetErrorText() const
|
||||
return wxString( _("A no connect symbol is connected to more than 1 pin"));
|
||||
case ERCE_GLOBLABEL:
|
||||
return wxString( _("Global label not connected to any other global label") );
|
||||
case ERCE_SIMILAR_LABELS:
|
||||
return wxString( _("Labels are similar (lower/upper case difference only)") );
|
||||
case ERCE_SIMILAR_GLBL_LABELS:
|
||||
return wxString( _("Global labels are similar (lower/upper case difference only)") );
|
||||
|
||||
default:
|
||||
return wxString( wxT("Unkown.") );
|
||||
|
@ -886,7 +886,7 @@ bool LIB_PART::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||
{
|
||||
p = strtok( line, " \t\n" );
|
||||
|
||||
if( stricmp( p, "ENDDEF" ) == 0 )
|
||||
if( p && stricmp( p, "ENDDEF" ) == 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
@ -948,6 +948,9 @@ bool LIB_PART::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||
if( *line == '#' ) // a comment
|
||||
continue;
|
||||
|
||||
if( p == NULL ) // empty line
|
||||
continue;
|
||||
|
||||
if( line[0] == 'T' && line[1] == 'i' )
|
||||
result = LoadDateAndTime( aLineReader );
|
||||
else if( *line == 'F' )
|
||||
@ -1036,7 +1039,12 @@ bool LIB_PART::LoadDrawEntries( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||
break;
|
||||
|
||||
case '#': // Comment
|
||||
continue;
|
||||
continue;
|
||||
|
||||
case '\n':
|
||||
case '\r':
|
||||
case 0: // empty line
|
||||
continue;
|
||||
|
||||
default:
|
||||
aErrorMsg.Printf( wxT( "undefined DRAW command %c" ), line[0] );
|
||||
|
@ -369,6 +369,32 @@ public:
|
||||
*/
|
||||
void SortListbySheet();
|
||||
|
||||
/**
|
||||
* Counts number of pins connected on the same net.
|
||||
* Used to count all pins connected to a no connect symbol
|
||||
* @return the pin count of the net starting at aNetStart
|
||||
* @param aNetStart = index in list of net objects of the first item
|
||||
*/
|
||||
int CountPinsInNet( unsigned aNetStart );
|
||||
|
||||
/**
|
||||
* Function TestforNonOrphanLabel
|
||||
* Sheet labels are expected to be connected to a hierarchical label.
|
||||
* Hierarchical labels are expected to be connected to a sheet label.
|
||||
* Global labels are expected to be not orphan (connected to at least one other global label.
|
||||
* this function tests the connection to an other suitable label
|
||||
*/
|
||||
void TestforNonOrphanLabel( unsigned aNetItemRef, unsigned aStartNet );
|
||||
|
||||
/**
|
||||
* Function TestforSimilarLabels
|
||||
* detects labels which are different when using case sensitive comparisons
|
||||
* but are equal when using case insensitive comparisons
|
||||
* It can be due to a mistake from designer, so this kind of labels
|
||||
* is reported by TestforSimilarLabels
|
||||
*/
|
||||
void TestforSimilarLabels();
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
void DumpNetTable()
|
||||
@ -403,7 +429,7 @@ private:
|
||||
return Objet1->GetNet() < Objet2->GetNet();
|
||||
}
|
||||
|
||||
/* Comparison routine to sort items by Sheet Number
|
||||
/* Comparison routine to sort items by Sheet path
|
||||
*/
|
||||
static bool sortItemsBySheet( const NETLIST_OBJECT* Objet1, const NETLIST_OBJECT* Objet2 )
|
||||
{
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include <class_library.h>
|
||||
#include <macros.h>
|
||||
|
||||
#include <eda_pattern_match.h>
|
||||
|
||||
// Each node gets this lowest score initially, without any matches applied. Matches
|
||||
// will then increase this score depending on match quality.
|
||||
// This way, an empty search string will result in all components being displayed as they
|
||||
@ -113,6 +115,7 @@ COMPONENT_TREE_SEARCH_CONTAINER::~COMPONENT_TREE_SEARCH_CONTAINER()
|
||||
{
|
||||
BOOST_FOREACH( TREE_NODE* node, m_nodes )
|
||||
delete node;
|
||||
|
||||
m_nodes.clear();
|
||||
}
|
||||
|
||||
@ -225,12 +228,15 @@ LIB_ALIAS* COMPONENT_TREE_SEARCH_CONTAINER::GetSelectedAlias( int* aUnit )
|
||||
|
||||
BOOST_FOREACH( TREE_NODE* node, m_nodes )
|
||||
{
|
||||
if( node->MatchScore > 0 && node->TreeId == select_id ) {
|
||||
if( node->MatchScore > 0 && node->TreeId == select_id )
|
||||
{
|
||||
if( aUnit && node->Unit > 0 )
|
||||
*aUnit = node->Unit;
|
||||
|
||||
return node->Alias;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -249,6 +255,72 @@ static int matchPosScore(int aPosition, int aMaximum)
|
||||
}
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
class EDA_COMBINED_MATCHER
|
||||
{
|
||||
public:
|
||||
EDA_COMBINED_MATCHER( const wxString &aPattern )
|
||||
{
|
||||
// Whatever syntax users prefer, it shall be matched.
|
||||
AddMatcher( aPattern, new EDA_PATTERN_MATCH_REGEX() );
|
||||
AddMatcher( aPattern, new EDA_PATTERN_MATCH_WILDCARD() );
|
||||
// If any of the above matchers couldn't be created because the pattern
|
||||
// syntax does not match, the substring will try its best.
|
||||
AddMatcher( aPattern, new EDA_PATTERN_MATCH_SUBSTR() );
|
||||
}
|
||||
|
||||
~EDA_COMBINED_MATCHER()
|
||||
{
|
||||
BOOST_FOREACH( const EDA_PATTERN_MATCH* matcher, m_matchers )
|
||||
delete matcher;
|
||||
}
|
||||
|
||||
/*
|
||||
* Look in all existing matchers, return the earliest match of any of
|
||||
* the existing. Returns EDA_PATTERN_NOT_FOUND if no luck.
|
||||
*/
|
||||
int Find( const wxString &aTerm, int *aMatchersTriggered )
|
||||
{
|
||||
int result = EDA_PATTERN_NOT_FOUND;
|
||||
|
||||
BOOST_FOREACH( const EDA_PATTERN_MATCH* matcher, m_matchers )
|
||||
{
|
||||
int local_find = matcher->Find( aTerm );
|
||||
|
||||
if ( local_find != EDA_PATTERN_NOT_FOUND )
|
||||
{
|
||||
*aMatchersTriggered += 1;
|
||||
|
||||
if ( local_find < result )
|
||||
{
|
||||
result = local_find;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
// Add matcher if it can compile the pattern.
|
||||
void AddMatcher( const wxString &aPattern, EDA_PATTERN_MATCH *aMatcher )
|
||||
{
|
||||
if ( aMatcher->SetPattern( aPattern ) )
|
||||
{
|
||||
m_matchers.push_back( aMatcher );
|
||||
}
|
||||
else
|
||||
{
|
||||
delete aMatcher;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<const EDA_PATTERN_MATCH*> m_matchers;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch )
|
||||
{
|
||||
if( m_tree == NULL )
|
||||
@ -286,6 +358,7 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
|
||||
while ( tokenizer.HasMoreTokens() )
|
||||
{
|
||||
const wxString term = tokenizer.GetNextToken().Lower();
|
||||
EDA_COMBINED_MATCHER matcher( term );
|
||||
|
||||
BOOST_FOREACH( TREE_NODE* node, m_nodes )
|
||||
{
|
||||
@ -299,17 +372,18 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
|
||||
// least two characters long. That avoids spurious, low quality
|
||||
// matches. Most abbreviations are at three characters long.
|
||||
int found_pos;
|
||||
int matcher_fired = 0;
|
||||
|
||||
if( term == node->MatchName )
|
||||
node->MatchScore += 1000; // exact match. High score :)
|
||||
else if( (found_pos = node->MatchName.Find( term ) ) != wxNOT_FOUND )
|
||||
else if( (found_pos = matcher.Find( node->MatchName, &matcher_fired ) ) != EDA_PATTERN_NOT_FOUND )
|
||||
{
|
||||
// Substring match. The earlier in the string the better. score += 20..40
|
||||
node->MatchScore += matchPosScore( found_pos, 20 ) + 20;
|
||||
}
|
||||
else if( node->Parent->MatchName.Find( term ) != wxNOT_FOUND )
|
||||
else if( matcher.Find( node->Parent->MatchName, &matcher_fired ) != EDA_PATTERN_NOT_FOUND )
|
||||
node->MatchScore += 19; // parent name matches. score += 19
|
||||
else if( ( found_pos = node->SearchText.Find( term ) ) != wxNOT_FOUND )
|
||||
else if( ( found_pos = matcher.Find( node->SearchText, &matcher_fired ) ) != EDA_PATTERN_NOT_FOUND )
|
||||
{
|
||||
// If we have a very short search term (like one or two letters), we don't want
|
||||
// to accumulate scores if they just happen to be in keywords or description as
|
||||
@ -322,6 +396,8 @@ void COMPONENT_TREE_SEARCH_CONTAINER::UpdateSearchTerm( const wxString& aSearch
|
||||
}
|
||||
else
|
||||
node->MatchScore = 0; // No match. That's it for this item.
|
||||
|
||||
node->MatchScore += 2 * matcher_fired;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
@ -37,6 +37,7 @@
|
||||
#include <schframe.h>
|
||||
#include <invoke_sch_dialog.h>
|
||||
#include <project.h>
|
||||
#include <kiface_i.h>
|
||||
|
||||
#include <netlist.h>
|
||||
#include <class_netlist_object.h>
|
||||
@ -48,10 +49,19 @@
|
||||
#include <erc.h>
|
||||
#include <id.h>
|
||||
|
||||
extern int DiagErc[PIN_NMAX][PIN_NMAX];
|
||||
extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX];
|
||||
|
||||
bool DIALOG_ERC::m_writeErcFile = false;
|
||||
|
||||
|
||||
bool DIALOG_ERC::m_writeErcFile = false; // saved only for the current session
|
||||
bool DIALOG_ERC::m_TestSimilarLabels = true; // Save in project config
|
||||
bool DIALOG_ERC::m_diagErcTableInit = false; // saved only for the current session
|
||||
bool DIALOG_ERC::m_tstUniqueGlobalLabels = true; // saved only for the current session
|
||||
|
||||
// Control identifiers for events
|
||||
#define ID_MATRIX_0 1800
|
||||
|
||||
BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
|
||||
EVT_COMMAND_RANGE( ID_MATRIX_0, ID_MATRIX_0 + ( PIN_NMAX * PIN_NMAX ) - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED, DIALOG_ERC::ChangeErrorLevel )
|
||||
@ -72,6 +82,8 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
|
||||
|
||||
DIALOG_ERC::~DIALOG_ERC()
|
||||
{
|
||||
m_TestSimilarLabels = m_cbTestSimilarLabels->GetValue();
|
||||
m_tstUniqueGlobalLabels = m_cbTestUniqueGlbLabels->GetValue();
|
||||
}
|
||||
|
||||
|
||||
@ -86,6 +98,8 @@ void DIALOG_ERC::Init()
|
||||
}
|
||||
|
||||
m_WriteResultOpt->SetValue( m_writeErcFile );
|
||||
m_cbTestSimilarLabels->SetValue( m_TestSimilarLabels );
|
||||
m_cbTestUniqueGlbLabels->SetValue( m_tstUniqueGlobalLabels );
|
||||
|
||||
SCH_SCREENS screens;
|
||||
updateMarkerCounts( &screens );
|
||||
@ -232,7 +246,7 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
|
||||
|
||||
void DIALOG_ERC::OnLeftDblClickMarkersList( wxMouseEvent& event )
|
||||
{
|
||||
// Remember: OnLeftClickMarkersList was called just berfore
|
||||
// Remember: OnLeftClickMarkersList was called just before
|
||||
// and therefore m_lastMarkerFound was initialized.
|
||||
// (NULL if not found)
|
||||
if( m_lastMarkerFound )
|
||||
@ -257,10 +271,10 @@ void DIALOG_ERC::ReBuildMatrixPanel()
|
||||
wxSize bitmap_size = dummy->GetSize();
|
||||
delete dummy;
|
||||
|
||||
if( !DiagErcTableInit )
|
||||
if( !m_diagErcTableInit )
|
||||
{
|
||||
memcpy( DiagErc, DefaultDiagErc, sizeof(DefaultDiagErc) );
|
||||
DiagErcTableInit = true;
|
||||
m_diagErcTableInit = true;
|
||||
}
|
||||
|
||||
wxPoint pos;
|
||||
@ -389,6 +403,10 @@ void DIALOG_ERC::ResetDefaultERCDiag( wxCommandEvent& event )
|
||||
{
|
||||
memcpy( DiagErc, DefaultDiagErc, sizeof( DiagErc ) );
|
||||
ReBuildMatrixPanel();
|
||||
m_TestSimilarLabels = true;
|
||||
m_cbTestSimilarLabels->SetValue( m_TestSimilarLabels );
|
||||
m_tstUniqueGlobalLabels = true;
|
||||
m_cbTestUniqueGlbLabels->SetValue( m_tstUniqueGlobalLabels );
|
||||
}
|
||||
|
||||
|
||||
@ -432,13 +450,9 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
||||
{
|
||||
wxFileName fn;
|
||||
|
||||
if( !DiagErcTableInit )
|
||||
{
|
||||
memcpy( DiagErc, DefaultDiagErc, sizeof( DefaultDiagErc ) );
|
||||
DiagErcTableInit = true;
|
||||
}
|
||||
|
||||
m_writeErcFile = m_WriteResultOpt->GetValue();
|
||||
m_TestSimilarLabels = m_cbTestSimilarLabels->GetValue();
|
||||
m_tstUniqueGlobalLabels = m_cbTestUniqueGlbLabels->GetValue();
|
||||
|
||||
// Build the whole sheet list in hierarchy (sheet, not screen)
|
||||
SCH_SHEET_LIST sheets;
|
||||
@ -511,12 +525,14 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
||||
case NET_HIERBUSLABELMEMBER:
|
||||
case NET_SHEETLABEL:
|
||||
case NET_SHEETBUSLABELMEMBER:
|
||||
case NET_GLOBLABEL:
|
||||
|
||||
// ERC problems when pin sheets do not match hierarchical labels.
|
||||
// Each pin sheet must match a hierarchical label
|
||||
// Each hierarchical label must match a pin sheet
|
||||
TestLabel( objectsConnectedList.get(), net, nextNet );
|
||||
objectsConnectedList->TestforNonOrphanLabel( net, nextNet );
|
||||
break;
|
||||
case NET_GLOBLABEL:
|
||||
if( m_tstUniqueGlobalLabels )
|
||||
objectsConnectedList->TestforNonOrphanLabel( net, nextNet );
|
||||
break;
|
||||
|
||||
case NET_NOCONNECT:
|
||||
@ -524,7 +540,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
||||
// ERC problems when a noconnect symbol is connected to more than one pin.
|
||||
MinConn = NET_NC;
|
||||
|
||||
if( CountPinsInNet( objectsConnectedList.get(), nextNet ) > 1 )
|
||||
if( objectsConnectedList->CountPinsInNet( nextNet ) > 1 )
|
||||
Diagnose( objectsConnectedList->GetItem( net ), NULL, MinConn, UNC );
|
||||
|
||||
break;
|
||||
@ -539,6 +555,11 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
||||
lastNet = net;
|
||||
}
|
||||
|
||||
// Test similar labels (i;e. labels which are identical when
|
||||
// using case insensitive comparisons)
|
||||
if( m_TestSimilarLabels )
|
||||
objectsConnectedList->TestforSimilarLabels();
|
||||
|
||||
// Displays global results:
|
||||
updateMarkerCounts( &screens );
|
||||
|
||||
|
@ -27,22 +27,12 @@
|
||||
|
||||
#include <wx/htmllbox.h>
|
||||
#include <vector>
|
||||
|
||||
#include <lib_pin.h> // For PIN_NMAX definition
|
||||
|
||||
#include <dialog_erc_base.h>
|
||||
#include "dialog_erc_listbox.h"
|
||||
|
||||
/* Variable locales */
|
||||
extern int DiagErc[PIN_NMAX][PIN_NMAX];
|
||||
extern bool DiagErcTableInit; // go to true after DiagErc init
|
||||
extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX];
|
||||
|
||||
/* Control identifiers */
|
||||
#define ID_MATRIX_0 1800
|
||||
|
||||
/*!
|
||||
* DIALOG_ERC class declaration
|
||||
*/
|
||||
// DIALOG_ERC class declaration
|
||||
|
||||
class DIALOG_ERC : public DIALOG_ERC_BASE
|
||||
{
|
||||
@ -54,6 +44,11 @@ private:
|
||||
bool m_initialized;
|
||||
const SCH_MARKER* m_lastMarkerFound;
|
||||
static bool m_writeErcFile;
|
||||
static bool m_diagErcTableInit; // go to true after DiagErc init
|
||||
static bool m_tstUniqueGlobalLabels;
|
||||
|
||||
public:
|
||||
static bool m_TestSimilarLabels;
|
||||
|
||||
public:
|
||||
DIALOG_ERC( SCH_EDIT_FRAME* parent );
|
||||
|
@ -56,6 +56,9 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
||||
|
||||
sdiagSizer->Add( gSizeDiag, 0, wxEXPAND, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( sdiagSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
sdiagSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
m_WriteResultOpt = new wxCheckBox( sdiagSizer->GetStaticBox(), wxID_ANY, _("Create ERC file report"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sdiagSizer->Add( m_WriteResultOpt, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
@ -83,7 +86,7 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
||||
bercSizer->Add( m_textMarkers, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_MarkersList = new ERC_HTML_LISTFRAME( m_PanelERC, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER );
|
||||
bercSizer->Add( m_MarkersList, 1, wxALL|wxEXPAND, 5 );
|
||||
bercSizer->Add( m_MarkersList, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
wxBoxSizer* bbuttonsSizer;
|
||||
bbuttonsSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
@ -113,9 +116,30 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
||||
m_ResetOptButton = new wxButton( m_PanelERCOptions, ID_RESET_MATRIX, _("Initialize to Default"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_panelMatrixSizer->Add( m_ResetOptButton, 0, wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticText8 = new wxStaticText( m_PanelERCOptions, wxID_ANY, _("Pin to pin connections"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
|
||||
m_staticText8->Wrap( -1 );
|
||||
m_panelMatrixSizer->Add( m_staticText8, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_matrixPanel = new wxPanel( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panelMatrixSizer->Add( m_matrixPanel, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_staticline2 = new wxStaticLine( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
m_panelMatrixSizer->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
m_staticText9 = new wxStaticText( m_PanelERCOptions, wxID_ANY, _("Label to label connections"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
|
||||
m_staticText9->Wrap( -1 );
|
||||
m_panelMatrixSizer->Add( m_staticText9, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_cbTestSimilarLabels = new wxCheckBox( m_PanelERCOptions, wxID_ANY, _("Test similar labels"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbTestSimilarLabels->SetToolTip( _("Similar labels are labels (inside a sheet) which differs only by upper/lower case") );
|
||||
|
||||
m_panelMatrixSizer->Add( m_cbTestSimilarLabels, 0, wxALL, 5 );
|
||||
|
||||
m_cbTestUniqueGlbLabels = new wxCheckBox( m_PanelERCOptions, wxID_ANY, _("Test unique global labels"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbTestUniqueGlbLabels->SetToolTip( _("Global labels are used to connect signals across the full hierarchy.\nThey are expected to be at least two labels with the same name.") );
|
||||
|
||||
m_panelMatrixSizer->Add( m_cbTestUniqueGlbLabels, 0, wxALL, 5 );
|
||||
|
||||
|
||||
m_PanelERCOptions->SetSizer( m_panelMatrixSizer );
|
||||
m_PanelERCOptions->Layout();
|
||||
|
@ -44,7 +44,7 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_ERC_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">519,457</property>
|
||||
<property name="size">519,464</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Electrical Rules Checker</property>
|
||||
@ -815,6 +815,87 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticline1</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxLI_HORIZONTAL</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
@ -1177,7 +1258,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxHtmlWindow" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -1708,6 +1789,89 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Pin to pin connections</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticText8</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxALIGN_CENTRE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
@ -1788,6 +1952,346 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticline2</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxLI_HORIZONTAL</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Label to label connections</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticText9</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxALIGN_CENTRE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Test similar labels</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbTestSimilarLabels</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Similar labels are labels (inside a sheet) which differs only by upper/lower case</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Test unique global labels</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbTestUniqueGlbLabels</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Global labels are used to connect signals across the full hierarchy.
They are expected to be at least two labels with the same name.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -23,6 +23,7 @@ class ERC_HTML_LISTFRAME;
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/html/htmlwin.h>
|
||||
@ -56,6 +57,7 @@ class DIALOG_ERC_BASE : public DIALOG_SHIM
|
||||
wxTextCtrl* m_LastWarningCount;
|
||||
wxStaticText* m_LastErrCountText;
|
||||
wxTextCtrl* m_LastErrCount;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxCheckBox* m_WriteResultOpt;
|
||||
wxStaticText* m_titleMessages;
|
||||
wxTextCtrl* m_MessagesList;
|
||||
@ -66,7 +68,12 @@ class DIALOG_ERC_BASE : public DIALOG_SHIM
|
||||
wxButton* m_buttonClose;
|
||||
wxPanel* m_PanelERCOptions;
|
||||
wxButton* m_ResetOptButton;
|
||||
wxStaticText* m_staticText8;
|
||||
wxPanel* m_matrixPanel;
|
||||
wxStaticLine* m_staticline2;
|
||||
wxStaticText* m_staticText9;
|
||||
wxCheckBox* m_cbTestSimilarLabels;
|
||||
wxCheckBox* m_cbTestUniqueGlbLabels;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnCloseErcDialog( wxCloseEvent& event ) { event.Skip(); }
|
||||
@ -80,7 +87,7 @@ class DIALOG_ERC_BASE : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Electrical Rules Checker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 519,457 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Electrical Rules Checker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 519,464 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_ERC_BASE();
|
||||
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user