diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 0977c67348..51561fbb39 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -51,6 +51,7 @@ set(EESCHEMA_SRCS dialog_eeschema_config.cpp dialog_eeschema_config_fbp.cpp dialog_erc.cpp + dialog_erc_base.cpp # dialog_find.cpp dialog_options.cpp dialog_print_using_printer_base.cpp diff --git a/eeschema/dialog_erc.cpp b/eeschema/dialog_erc.cpp index f1c7758e22..04a4986c06 100644 --- a/eeschema/dialog_erc.cpp +++ b/eeschema/dialog_erc.cpp @@ -3,86 +3,53 @@ // Purpose: // Author: jean-pierre Charras // Modified by: -// Created: 12/02/2006 17:08:38 -// RCS-ID: -// Copyright: License GNU -// Licence: +// Created: 02/07/2000 +// Licence: GPL ///////////////////////////////////////////////////////////////////////////// - -// Generated by DialogBlocks (unregistered), 12/02/2006 17:08:38 - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "dialog_erc.h" -#endif - -////@begin includes -////@end includes #include "fctsys.h" #include "common.h" +#include "class_drawpanel.h" #include "program.h" #include "libcmp.h" #include "general.h" #include "netlist.h" +#include "bitmaps.h" #include "protos.h" #include "dialog_erc.h" -////@begin XPM images -////@end XPM images - -/*! - * WinEDA_ErcFrame type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( WinEDA_ErcFrame, wxDialog ) - -/*! - * WinEDA_ErcFrame event table definition - */ - -BEGIN_EVENT_TABLE( WinEDA_ErcFrame, wxDialog ) - -////@begin WinEDA_ErcFrame event table entries - EVT_BUTTON( ID_ERC_CMP, WinEDA_ErcFrame::OnErcCmpClick ) - - EVT_BUTTON( ID_ERASE_DRC_MARKERS, WinEDA_ErcFrame::OnEraseDrcMarkersClick ) - - EVT_BUTTON( wxID_CANCEL, WinEDA_ErcFrame::OnCancelClick ) - - EVT_BUTTON( ID_RESET_MATRIX, WinEDA_ErcFrame::OnResetMatrixClick ) - -////@end WinEDA_ErcFrame event table entries +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, - WinEDA_ErcFrame::ChangeErrorLevel) - + DIALOG_ERC::ChangeErrorLevel) END_EVENT_TABLE() -/*! - * WinEDA_ErcFrame constructors - */ -WinEDA_ErcFrame::WinEDA_ErcFrame( ) +DIALOG_ERC::DIALOG_ERC( WinEDA_SchematicFrame* parent ) + : DIALOG_ERC_BASE(parent) { -} - -WinEDA_ErcFrame::WinEDA_ErcFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ -int ii, jj; - m_Parent = parent; - m_Initialized = FALSE; - for( ii = 0; ii < PIN_NMAX; ii++ ) - for( jj = 0; jj < PIN_NMAX; jj++ ) - m_ButtonList[ii][jj] = NULL; - Create(parent, id, caption, pos, size, style); + Init(); GetSizer()->SetSizeHints(this); +} + +void DIALOG_ERC::Init() +{ + SetFocus(); + + m_Initialized = FALSE; + for( int ii = 0; ii < PIN_NMAX; ii++ ) + for( int jj = 0; jj < PIN_NMAX; jj++ ) + m_ButtonList[ii][jj] = NULL; + + m_WriteResultOpt->SetValue( WriteFichierERC ); + wxString num; num.Printf(wxT("%d"), g_EESchemaVar.NbErrorErc); m_TotalErrCount->SetLabel(num); @@ -93,201 +60,38 @@ int ii, jj; num.Printf(wxT("%d"), g_EESchemaVar.NbWarningErc); m_LastWarningCount->SetLabel(num); -} - -/*! - * WinEDA_ErcFrame creator - */ - -bool WinEDA_ErcFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin WinEDA_ErcFrame member initialisation - m_NoteBook = NULL; - m_PanelERC = NULL; - m_PanelERCSizer = NULL; - ErcTotalErrors = NULL; - WarnErcErrors = NULL; - ErcErrors = NULL; - m_TotalErrCount = NULL; - m_LastWarningCount = NULL; - m_LastErrCount = NULL; - m_WriteResultOpt = NULL; - m_btClose = NULL; - m_PanelERCOptions = NULL; - m_PanelMatrixSizer = NULL; - m_ResetOptButton = NULL; - m_SeparatorLine = NULL; - m_MatrixSizer = NULL; -////@end WinEDA_ErcFrame member initialisation - -////@begin WinEDA_ErcFrame creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS); - wxDialog::Create( parent, id, caption, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end WinEDA_ErcFrame creation - return true; -} - -/*! - * Control creation for WinEDA_ErcFrame - */ - -void WinEDA_ErcFrame::CreateControls() -{ -////@begin WinEDA_ErcFrame content construction - // Generated by DialogBlocks, 24/04/2009 14:22:48 (unregistered) - - WinEDA_ErcFrame* itemDialog1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemDialog1->SetSizer(itemBoxSizer2); - - m_NoteBook = new wxNotebook( itemDialog1, ID_ERC_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT|wxNB_TOP ); - - m_PanelERC = new wxPanel( m_NoteBook, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); - m_PanelERCSizer = new wxBoxSizer(wxHORIZONTAL); - m_PanelERC->SetSizer(m_PanelERCSizer); - - wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL); - m_PanelERCSizer->Add(itemBoxSizer6, 0, wxGROW|wxALL, 5); - wxStaticBox* itemStaticBoxSizer7Static = new wxStaticBox(m_PanelERC, wxID_ANY, _("Erc File Report:")); - wxStaticBoxSizer* itemStaticBoxSizer7 = new wxStaticBoxSizer(itemStaticBoxSizer7Static, wxHORIZONTAL); - itemBoxSizer6->Add(itemStaticBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5); - wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL); - itemStaticBoxSizer7->Add(itemBoxSizer8, 0, wxGROW|wxLEFT|wxTOP|wxBOTTOM, 5); - ErcTotalErrors = new wxStaticText( m_PanelERC, wxID_STATIC, _("Total Errors: "), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer8->Add(ErcTotalErrors, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); - - WarnErcErrors = new wxStaticText( m_PanelERC, wxID_STATIC, _("Last Warnings: "), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer8->Add(WarnErcErrors, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); - - ErcErrors = new wxStaticText( m_PanelERC, wxID_STATIC, _("Last Errors: "), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); - itemBoxSizer8->Add(ErcErrors, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxVERTICAL); - itemStaticBoxSizer7->Add(itemBoxSizer12, 0, wxGROW|wxRIGHT|wxTOP|wxBOTTOM, 5); - m_TotalErrCount = new wxStaticText( m_PanelERC, wxID_STATIC, _("0000"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer12->Add(m_TotalErrCount, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); - - m_LastWarningCount = new wxStaticText( m_PanelERC, wxID_STATIC, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer12->Add(m_LastWarningCount, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); - - m_LastErrCount = new wxStaticText( m_PanelERC, wxID_STATIC, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer12->Add(m_LastErrCount, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); - - itemBoxSizer6->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - wxStaticBox* itemStaticBoxSizer17Static = new wxStaticBox(m_PanelERC, wxID_ANY, _("Erc File Report:")); - wxStaticBoxSizer* itemStaticBoxSizer17 = new wxStaticBoxSizer(itemStaticBoxSizer17Static, wxHORIZONTAL); - itemBoxSizer6->Add(itemStaticBoxSizer17, 0, wxGROW|wxALL, 5); - m_WriteResultOpt = new wxCheckBox( m_PanelERC, ID_CHECKBOX, _("Write erc report"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); - m_WriteResultOpt->SetValue(false); - itemStaticBoxSizer17->Add(m_WriteResultOpt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL); - m_PanelERCSizer->Add(itemBoxSizer19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxButton* itemButton20 = new wxButton( m_PanelERC, ID_ERC_CMP, _("&Test Erc"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer19->Add(itemButton20, 0, wxGROW|wxALL, 5); - - wxButton* itemButton21 = new wxButton( m_PanelERC, ID_ERASE_DRC_MARKERS, _("&Del Markers"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer19->Add(itemButton21, 0, wxGROW|wxALL, 5); - - m_btClose = new wxButton( m_PanelERC, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); - m_btClose->SetDefault(); - itemBoxSizer19->Add(m_btClose, 0, wxGROW|wxALL, 5); - - m_NoteBook->AddPage(m_PanelERC, _("erc")); - - m_PanelERCOptions = new wxPanel( m_NoteBook, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); - m_PanelMatrixSizer = new wxBoxSizer(wxVERTICAL); - m_PanelERCOptions->SetSizer(m_PanelMatrixSizer); - - m_ResetOptButton = new wxButton( m_PanelERCOptions, ID_RESET_MATRIX, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PanelMatrixSizer->Add(m_ResetOptButton, 0, wxALIGN_LEFT|wxALL, 5); - - m_SeparatorLine = new wxStaticLine( m_PanelERCOptions, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_PanelMatrixSizer->Add(m_SeparatorLine, 0, wxGROW|wxALL, 5); - - m_MatrixSizer = new wxBoxSizer(wxVERTICAL); - m_PanelMatrixSizer->Add(m_MatrixSizer, 0, wxGROW|wxALL, 5); - - m_NoteBook->AddPage(m_PanelERCOptions, _("Options")); - - itemBoxSizer2->Add(m_NoteBook, 0, wxGROW|wxALL, 5); - - // Set validators - m_WriteResultOpt->SetValidator( wxGenericValidator(& WriteFichierERC) ); -////@end WinEDA_ErcFrame content construction - - m_btClose->SetFocus(); - // Init Panel Matrix ReBuildMatrixPanel(); } -/*! - * Should we show tooltips? - */ - -bool WinEDA_ErcFrame::ShowToolTips() -{ - return true; -} - -/*! - * Get bitmap resources - */ - -wxBitmap WinEDA_ErcFrame::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin WinEDA_ErcFrame bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end WinEDA_ErcFrame bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon WinEDA_ErcFrame::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin WinEDA_ErcFrame icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end WinEDA_ErcFrame icon retrieval -} /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERASE_DRC_MARKERS */ -void WinEDA_ErcFrame::OnEraseDrcMarkersClick( wxCommandEvent& event ) +void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event ) +/* Delete the old ERC markers, over the whole hierarchy + */ { - DelERCMarkers(event); + DeleteAllMarkers( MARQ_ERC ); + m_MessagesList->Clear(); + m_Parent->DrawPanel->Refresh(); } /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL */ -void WinEDA_ErcFrame::OnCancelClick( wxCommandEvent& event ) +void DIALOG_ERC::OnCancelClick( wxCommandEvent& event ) { - EndModal(0); + EndModal(0); } + /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX */ -void WinEDA_ErcFrame::OnResetMatrixClick( wxCommandEvent& event ) +void DIALOG_ERC::OnResetMatrixClick( wxCommandEvent& event ) { ResetDefaultERCDiag(event); } @@ -297,7 +101,128 @@ void WinEDA_ErcFrame::OnResetMatrixClick( wxCommandEvent& event ) * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERC_CMP */ -void WinEDA_ErcFrame::OnErcCmpClick( wxCommandEvent& event ) +void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event ) { - TestErc(event); + m_MessagesList->Clear(); + wxSafeYield(); // m_MessagesList must be redraw + TestErc( m_MessagesList); } + + +/*********************************************/ +void DIALOG_ERC::ReBuildMatrixPanel() +/*********************************************/ + +/* Build or rebuild the panel showing the ERC matrix + */ +{ + int ii, jj, event_id, text_height; + wxPoint pos, BoxMatrixPosition; + +#define BITMAP_SIZE 19 + int bitmap_size = BITMAP_SIZE; + wxStaticText* text; + int x, y; + wxSize BoxMatrixMinSize; + + if( !DiagErcTableInit ) + { + memcpy( DiagErc, DefaultDiagErc, sizeof(DefaultDiagErc) ); + DiagErcTableInit = TRUE; + } + + // Get the current text size : + text = new wxStaticText( m_PanelERCOptions, -1, wxT( "W" ), pos ); // this is a dummy text + + text_height = text->GetRect().GetHeight(); + bitmap_size = MAX( bitmap_size, text_height ); + SAFE_DELETE( text ); + + // compute the Y pos interval: + BoxMatrixMinSize.y = ( bitmap_size * (PIN_NMAX + 1) ) + 5; + GetSizer()->Fit( this ); + GetSizer()->SetSizeHints( this ); + pos = m_MatrixSizer->GetPosition(); + + // Size computation is not made in constructor, in some wxWidgets version, + // and m_BoxSizerForERC_Opt position is always 0,0. and we can't use it + pos.x = MAX( pos.x, 5 ); + pos.y = MAX( pos.y, m_ResetOptButton->GetRect().GetHeight() + 30 ); + + BoxMatrixPosition = pos; + + pos.y += text_height; + + if( m_Initialized == FALSE ) + { + for( ii = 0; ii < PIN_NMAX; ii++ ) + { + y = pos.y + (ii * bitmap_size); + text = new wxStaticText( m_PanelERCOptions, -1, CommentERC_H[ii], wxPoint( 5, y ) ); + + x = text->GetRect().GetRight(); + pos.x = MAX( pos.x, x ); + } + + pos.x += 5; + } + else + pos = m_ButtonList[0][0]->GetPosition(); + + for( ii = 0; ii < PIN_NMAX; ii++ ) + { + y = pos.y + (ii * bitmap_size); + for( jj = 0; jj <= ii; jj++ ) + { + int diag = DiagErc[ii][jj]; + x = pos.x + (jj * bitmap_size); + if( (ii == jj) && !m_Initialized ) + { + wxPoint txtpos; + txtpos.x = x + 6; txtpos.y = y - bitmap_size; + text = new wxStaticText( m_PanelERCOptions, -1, CommentERC_V[ii], txtpos ); + + BoxMatrixMinSize.x = MAX( BoxMatrixMinSize.x, text->GetRect().GetRight() ); + } + event_id = ID_MATRIX_0 + ii + (jj * PIN_NMAX); + delete m_ButtonList[ii][jj]; + + switch( diag ) + { + case OK: + m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, + event_id, + wxBitmap( erc_green_xpm ), + wxPoint( x, y ) ); + + break; + + case WAR: + m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, + event_id, + wxBitmap( warning_xpm ), + wxPoint( x, y ) ); + + break; + + case ERR: + m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, + event_id, + wxBitmap( error_xpm ), + wxPoint( x, y ) ); + + break; + } + } + } + + if( !m_Initialized ) + { + BoxMatrixMinSize.x += 5; + m_MatrixSizer->SetMinSize( BoxMatrixMinSize ); + BoxMatrixMinSize.y += BoxMatrixPosition.y; + m_PanelMatrixSizer->SetMinSize( BoxMatrixMinSize ); + } + m_Initialized = TRUE; +} + diff --git a/eeschema/dialog_erc.h b/eeschema/dialog_erc.h index 8518f4a442..d5b5b00cb3 100644 --- a/eeschema/dialog_erc.h +++ b/eeschema/dialog_erc.h @@ -1,95 +1,49 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dialog_erc.h -// Purpose: // Author: jean-pierre Charras -// Modified by: -// Created: 12/02/2006 17:08:38 -// RCS-ID: -// Copyright: License GNU -// Licence: +// Licence: GPL ///////////////////////////////////////////////////////////////////////////// -// Generated by DialogBlocks (unregistered), 12/02/2006 17:08:38 - #ifndef _DIALOG_ERC_H_ #define _DIALOG_ERC_H_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dialog_erc.h" -#endif - -/*! - * Includes - */ - -////@begin includes -#include "wx/notebook.h" -#include "wx/valgen.h" -#include "wx/statline.h" -////@end includes +#include "dialog_erc_base.h" /* Variable locales */ extern int WriteFichierERC; -/*! - * Forward declarations - */ +extern int DiagErc[PIN_NMAX][PIN_NMAX]; +extern bool DiagErcTableInit; // go to TRUE after DiagErc init +extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX]; +extern const wxChar* CommentERC_H[]; +extern const wxChar* CommentERC_V[]; -////@begin forward declarations -class wxNotebook; -class wxBoxSizer; -class wxStaticLine; -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define ID_DIALOG 10000 -#define ID_ERC_NOTEBOOK 10001 -#define ID_PANEL 10004 -#define ID_CHECKBOX 10006 -#define ID_ERC_CMP 10002 -#define ID_ERASE_DRC_MARKERS 10003 -#define ID_PANEL1 10005 -#define ID_RESET_MATRIX 10007 -#define SYMBOL_WINEDA_ERCFRAME_STYLE wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER -#define SYMBOL_WINEDA_ERCFRAME_TITLE _("EESchema Erc") -#define SYMBOL_WINEDA_ERCFRAME_IDNAME ID_DIALOG -#define SYMBOL_WINEDA_ERCFRAME_SIZE wxDefaultSize -#define SYMBOL_WINEDA_ERCFRAME_POSITION wxDefaultPosition -////@end control identifiers +/* Control identifiers */ #define ID_MATRIX_0 1800 -/*! - * Compatibility - */ +#define OK 0 +#define WAR 1 +#define ERR 2 +#define UNC 3 -#ifndef wxCLOSE_BOX -#define wxCLOSE_BOX 0x1000 -#endif /*! - * WinEDA_ErcFrame class declaration + * DIALOG_ERC class declaration */ -class WinEDA_ErcFrame: public wxDialog +class DIALOG_ERC: public DIALOG_ERC_BASE { - DECLARE_DYNAMIC_CLASS( WinEDA_ErcFrame ) - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() + +private: + WinEDA_SchematicFrame * m_Parent; + wxBitmapButton * m_ButtonList[PIN_NMAX][PIN_NMAX]; + bool m_Initialized; public: /// Constructors - WinEDA_ErcFrame( ); - WinEDA_ErcFrame( WinEDA_SchematicFrame* parent, wxWindowID id = SYMBOL_WINEDA_ERCFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ERCFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ERCFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ERCFRAME_SIZE, long style = SYMBOL_WINEDA_ERCFRAME_STYLE ); + DIALOG_ERC( WinEDA_SchematicFrame* parent ); - /// Creation - bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_ERCFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ERCFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ERCFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ERCFRAME_SIZE, long style = SYMBOL_WINEDA_ERCFRAME_STYLE ); - - /// Creates the controls and sizers - void CreateControls(); - -////@begin WinEDA_ErcFrame event handler declarations + void Init(); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERC_CMP void OnErcCmpClick( wxCommandEvent& event ); @@ -103,50 +57,13 @@ public: /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX void OnResetMatrixClick( wxCommandEvent& event ); -////@end WinEDA_ErcFrame event handler declarations - -////@begin WinEDA_ErcFrame member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end WinEDA_ErcFrame member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - - void DelERCMarkers(wxCommandEvent& event); - void TestErc(wxCommandEvent& event); + void TestErc( wxTextCtrl* aMessagesList ); void SelLocal(wxCommandEvent& event); void SelNewCmp(wxCommandEvent& event); void ResetDefaultERCDiag(wxCommandEvent& event); void ChangeErrorLevel(wxCommandEvent& event); void ReBuildMatrixPanel(); -////@begin WinEDA_ErcFrame member variables - wxNotebook* m_NoteBook; - wxPanel* m_PanelERC; - wxBoxSizer* m_PanelERCSizer; - wxStaticText* ErcTotalErrors; - wxStaticText* WarnErcErrors; - wxStaticText* ErcErrors; - wxStaticText* m_TotalErrCount; - wxStaticText* m_LastWarningCount; - wxStaticText* m_LastErrCount; - wxCheckBox* m_WriteResultOpt; - wxButton* m_btClose; - wxPanel* m_PanelERCOptions; - wxBoxSizer* m_PanelMatrixSizer; - wxButton* m_ResetOptButton; - wxStaticLine* m_SeparatorLine; - wxBoxSizer* m_MatrixSizer; -////@end WinEDA_ErcFrame member variables - - WinEDA_SchematicFrame * m_Parent; - wxBitmapButton * m_ButtonList[PIN_NMAX][PIN_NMAX]; - bool m_Initialized; }; #endif diff --git a/eeschema/dialog_erc.pjd b/eeschema/dialog_erc.pjd deleted file mode 100644 index 638c27cce1..0000000000 --- a/eeschema/dialog_erc.pjd +++ /dev/null @@ -1,1656 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - "" - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - "jean-pierre Charras" - "License GNU" - "" - 0 - 0 - 0 - "<All platforms>" - "<Any>" - "///////////////////////////////////////////////////////////////////////////// -// Name: %HEADER-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SOURCE-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SYMBOLS-FILENAME% -// Purpose: Symbols file -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "%HEADER-FILENAME%" -#endif - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "%HEADER-FILENAME%" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -" - " /// %BODY% -" - " -/*! - * %BODY% - */ - -" - "app_resources.h" - "app_resources.cpp" - "AppResources" - "app.h" - "app.cpp" - "Application" - 0 - "" - "<None>" - "<System>" - "utf-8" - "<System>" - "" - 0 - 0 - 4 - " " - "" - 0 - 0 - 1 - 0 - 1 - 1 - 0 - 1 - 0 - 0 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - -8519680 - "" - "Debug" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Dynamic" - "Yes" - "No" - "No" - "%WXVERSION%" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - 0 - 1 - "" - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 1 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "EESchema Erc" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "" - 0 - 0 - "ID_DIALOG" - 10000 - "WinEDA_ErcFrame" - "wxDialog" - "wxDialog" - "dialog_erc.cpp" - "dialog_erc.h" - "" - "EESchema Erc" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "MAYBE_RESIZE_BORDER" - 0 - 1 - -1 - -1 - -1 - -1 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxNotebook: ID_ERC_NOTEBOOK" - "dialog-control-document" - "" - "notebook" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbNotebookProxy" - "ID_ERC_NOTEBOOK" - 10001 - "" - "wxNotebook" - "wxNotebook" - 1 - 0 - "" - "" - "m_NoteBook" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - "wxPanel: ID_PANEL" - "dialog-control-document" - "" - "panel" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbPanelProxy" - "ID_PANEL" - 10004 - "" - "wxPanel" - "wxPanel" - 0 - 0 - "" - "" - "m_PanelERC" - "erc" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 0 - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - 0 - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbBoxSizerProxy" - "Horizontal" - "m_PanelERCSizer" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Erc File Report:" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Horizontal" - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/9/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 1 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "14/9/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "ErcTotalErrors" - "Total Errors: " - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "14/9/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "WarnErcErrors" - "Last Warnings: " - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "14/9/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "ErcErrors" - "Last Errors: " - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/9/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "14/9/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "m_TotalErrCount" - "0000" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "14/9/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "m_LastWarningCount" - "0" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "14/9/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "m_LastErrCount" - "0" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "14/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/10/2006" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Erc File Report:" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Horizontal" - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_CHECKBOX" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "14/10/2006" - "wbCheckBoxProxy" - "ID_CHECKBOX" - 10006 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_WriteResultOpt" - "Write erc report" - 0 - "" - "" - "WriteFichierERC" - "wxGenericValidator(& %VARIABLE%)" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: ID_ERC_CMP" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnErcCmpClick" - "ID_ERC_CMP" - 10002 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "&Test Erc" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_ERASE_DRC_MARKERS" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnEraseDrcMarkersClick" - "ID_ERASE_DRC_MARKERS" - 10003 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "&Del Markers" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|||WinEDA_ErcFrame" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_btClose" - "&Close" - 1 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - "wxPanel: ID_PANEL1" - "dialog-control-document" - "" - "panel" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbPanelProxy" - "ID_PANEL1" - 10005 - "" - "wxPanel" - "wxPanel" - 0 - 0 - "" - "" - "m_PanelERCOptions" - "Options" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 0 - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - 0 - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbBoxSizerProxy" - "Vertical" - "m_PanelMatrixSizer" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: ID_RESET_MATRIX" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "12/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnResetMatrixClick" - "ID_RESET_MATRIX" - 10007 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_ResetOptButton" - "Reset" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "14/10/2006" - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "m_SeparatorLine" - "" - "" - "" - 0 - 1 - "<Any platform>" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "14/4/2006" - "wbBoxSizerProxy" - "Vertical" - "m_MatrixSizer" - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - - - - - - - "Sources" - "html-document" - "" - "sourcesfolder" - 1 - 1 - 0 - 1 - - "dialog_erc.rc" - "source-editor-document" - "dialog_erc.rc" - "source-editor" - 0 - 0 - 1 - 0 - "12/3/2006" - "" - - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/eeschema/dialog_erc.rc b/eeschema/dialog_erc.rc deleted file mode 100644 index b86c4e2265..0000000000 --- a/eeschema/dialog_erc.rc +++ /dev/null @@ -1 +0,0 @@ -#include "wx/msw/wx.rc" diff --git a/eeschema/dialog_erc_base.cpp b/eeschema/dialog_erc_base.cpp new file mode 100644 index 0000000000..3116884fd2 --- /dev/null +++ b/eeschema/dialog_erc_base.cpp @@ -0,0 +1,133 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_erc_base.h" + +/////////////////////////////////////////////////////////////////////////// + +BEGIN_EVENT_TABLE( DIALOG_ERC_BASE, wxDialog ) + EVT_BUTTON( ID_ERC_CMP, DIALOG_ERC_BASE::_wxFB_OnErcCmpClick ) + EVT_BUTTON( ID_ERASE_DRC_MARKERS, DIALOG_ERC_BASE::_wxFB_OnEraseDrcMarkersClick ) + EVT_BUTTON( wxID_CANCEL, DIALOG_ERC_BASE::_wxFB_OnCancelClick ) + EVT_BUTTON( ID_RESET_MATRIX, DIALOG_ERC_BASE::_wxFB_OnResetMatrixClick ) +END_EVENT_TABLE() + +DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer1; + bSizer1 = new wxBoxSizer( wxVERTICAL ); + + m_NoteBook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_PanelERC = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bercSizer; + bercSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bupperSizer; + bupperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBoxSizer* sdiagSizer; + sdiagSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelERC, wxID_ANY, _("Erc File Report:") ), wxVERTICAL ); + + wxGridSizer* gSizer1; + gSizer1 = new wxGridSizer( 3, 2, 0, 0 ); + + m_ErcTotalErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Total Errors Count: "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); + m_ErcTotalErrorsText->Wrap( -1 ); + gSizer1->Add( m_ErcTotalErrorsText, 0, wxALL, 5 ); + + m_TotalErrCount = new wxStaticText( m_PanelERC, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TotalErrCount->Wrap( -1 ); + gSizer1->Add( m_TotalErrCount, 0, wxALL, 5 ); + + m_WarnErcErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Warnings Count:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); + m_WarnErcErrorsText->Wrap( -1 ); + gSizer1->Add( m_WarnErcErrorsText, 0, wxALL, 5 ); + + m_LastWarningCount = new wxStaticText( m_PanelERC, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 ); + m_LastWarningCount->Wrap( -1 ); + gSizer1->Add( m_LastWarningCount, 0, wxALL, 5 ); + + m_LastErrCountText = new wxStaticText( m_PanelERC, wxID_ANY, _("Errors Count:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); + m_LastErrCountText->Wrap( -1 ); + gSizer1->Add( m_LastErrCountText, 0, wxALL, 5 ); + + m_LastErrCount = new wxStaticText( m_PanelERC, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 ); + m_LastErrCount->Wrap( -1 ); + gSizer1->Add( m_LastErrCount, 0, wxALL, 5 ); + + sdiagSizer->Add( gSizer1, 0, 0, 5 ); + + bupperSizer->Add( sdiagSizer, 0, 0, 5 ); + + + bupperSizer->Add( 10, 10, 1, wxEXPAND, 5 ); + + wxBoxSizer* bbuttonsSizer; + bbuttonsSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonERC = new wxButton( m_PanelERC, ID_ERC_CMP, _("&Test Erc"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonERC, 0, wxALL|wxEXPAND, 5 ); + + m_buttondelmarkers = new wxButton( m_PanelERC, ID_ERASE_DRC_MARKERS, _("&Del Markers"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttondelmarkers, 0, wxALL|wxEXPAND, 5 ); + + m_buttonClose = new wxButton( m_PanelERC, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 ); + + bupperSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bercSizer->Add( bupperSizer, 0, wxEXPAND, 5 ); + + m_WriteResultOpt = new wxCheckBox( m_PanelERC, wxID_ANY, _("Write ERC report"), wxDefaultPosition, wxDefaultSize, 0 ); + + bercSizer->Add( m_WriteResultOpt, 0, wxALL, 5 ); + + m_staticline2 = new wxStaticLine( m_PanelERC, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bercSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); + + m_textMessage = new wxStaticText( m_PanelERC, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textMessage->Wrap( -1 ); + bercSizer->Add( m_textMessage, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_MessagesList = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); + m_MessagesList->SetMinSize( wxSize( 580,300 ) ); + + bercSizer->Add( m_MessagesList, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_PanelERC->SetSizer( bercSizer ); + m_PanelERC->Layout(); + bercSizer->Fit( m_PanelERC ); + m_NoteBook->AddPage( m_PanelERC, _("ERC"), true ); + m_PanelERCOptions = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_PanelMatrixSizer = new wxBoxSizer( wxVERTICAL ); + + m_ResetOptButton = new wxButton( m_PanelERCOptions, ID_RESET_MATRIX, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PanelMatrixSizer->Add( m_ResetOptButton, 0, wxALL, 5 ); + + m_staticline1 = new wxStaticLine( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + m_PanelMatrixSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_MatrixSizer = new wxBoxSizer( wxVERTICAL ); + + m_PanelMatrixSizer->Add( m_MatrixSizer, 1, wxEXPAND, 5 ); + + m_PanelERCOptions->SetSizer( m_PanelMatrixSizer ); + m_PanelERCOptions->Layout(); + m_PanelMatrixSizer->Fit( m_PanelERCOptions ); + m_NoteBook->AddPage( m_PanelERCOptions, _("Options"), false ); + + bSizer1->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 ); + + this->SetSizer( bSizer1 ); + this->Layout(); +} + +DIALOG_ERC_BASE::~DIALOG_ERC_BASE() +{ +} diff --git a/eeschema/dialog_erc_base.fbp b/eeschema/dialog_erc_base.fbp new file mode 100644 index 0000000000..c603754cbb --- /dev/null +++ b/eeschema/dialog_erc_base.fbp @@ -0,0 +1,1082 @@ + + + + + + C++ + 1 + UTF-8 + table + dialog_erc_base + 1000 + none + 1 + dialog_ERC_base + + . + + 0 + 1 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + + DIALOG_ERC_BASE + + 438,407 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + EESchema Erc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer1 + wxVERTICAL + none + + 5 + wxEXPAND | wxALL + 1 + + + + + 1 + + + 0 + wxID_ANY + + + m_NoteBook + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ERC + 1 + + + + 1 + + + 0 + wxID_ANY + + + m_PanelERC + protected + + + + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + bercSizer + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + + bupperSizer + wxHORIZONTAL + none + + 5 + + 0 + + wxID_ANY + Erc File Report: + + sdiagSizer + wxVERTICAL + none + + + 5 + + 0 + + 2 + 0 + + gSizer1 + none + 3 + 0 + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + Total Errors Count: + + + m_ErcTotalErrorsText + protected + + + wxALIGN_RIGHT + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + 0000 + + + m_TotalErrCount + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + Warnings Count: + + + m_WarnErcErrorsText + protected + + + wxALIGN_RIGHT + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + 0000 + + + m_LastWarningCount + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + Errors Count: + + + m_LastErrCountText + protected + + + wxALIGN_RIGHT + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + 0000 + + + m_LastErrCount + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 10 + protected + 10 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bbuttonsSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_ERC_CMP + &Test Erc + + + m_buttonERC + protected + + + + + + + + + OnErcCmpClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_ERASE_DRC_MARKERS + &Del Markers + + + m_buttondelmarkers + protected + + + + + + + + + OnEraseDrcMarkersClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_CANCEL + &Close + + + m_buttonClose + protected + + + + + + + + + OnCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Write ERC report + + + m_WriteResultOpt + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline2 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Messages: + + + m_textMessage + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + + + 1 + + + 0 + wxID_ANY + + 0 + 580,300 + m_MessagesList + protected + + + wxTE_MULTILINE|wxTE_READONLY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Options + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_PanelERCOptions + protected + + + + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + m_PanelMatrixSizer + wxVERTICAL + protected + + 5 + wxALL + 0 + + + + 0 + 1 + + + 0 + ID_RESET_MATRIX + Reset + + + m_ResetOptButton + protected + + + + + + + + + OnResetMatrixClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + m_MatrixSizer + wxVERTICAL + protected + + + + + + + + + + + diff --git a/eeschema/dialog_erc_base.h b/eeschema/dialog_erc_base.h new file mode 100644 index 0000000000..97b811fb39 --- /dev/null +++ b/eeschema/dialog_erc_base.h @@ -0,0 +1,92 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_erc_base__ +#define __dialog_erc_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_ERC_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_ERC_BASE : public wxDialog +{ + DECLARE_EVENT_TABLE() + private: + + // Private event handlers + void _wxFB_OnErcCmpClick( wxCommandEvent& event ){ OnErcCmpClick( event ); } + void _wxFB_OnEraseDrcMarkersClick( wxCommandEvent& event ){ OnEraseDrcMarkersClick( event ); } + void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } + void _wxFB_OnResetMatrixClick( wxCommandEvent& event ){ OnResetMatrixClick( event ); } + + + protected: + enum + { + ID_ERC_CMP = 1000, + ID_ERASE_DRC_MARKERS, + ID_RESET_MATRIX, + }; + + wxNotebook* m_NoteBook; + wxPanel* m_PanelERC; + wxStaticText* m_ErcTotalErrorsText; + wxStaticText* m_TotalErrCount; + wxStaticText* m_WarnErcErrorsText; + wxStaticText* m_LastWarningCount; + wxStaticText* m_LastErrCountText; + wxStaticText* m_LastErrCount; + + wxButton* m_buttonERC; + wxButton* m_buttondelmarkers; + wxButton* m_buttonClose; + wxCheckBox* m_WriteResultOpt; + wxStaticLine* m_staticline2; + wxStaticText* m_textMessage; + wxTextCtrl* m_MessagesList; + wxPanel* m_PanelERCOptions; + wxBoxSizer* m_PanelMatrixSizer; + wxButton* m_ResetOptButton; + wxStaticLine* m_staticline1; + wxBoxSizer* m_MatrixSizer; + + // Virtual event handlers, overide them in your derived class + virtual void OnErcCmpClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnEraseDrcMarkersClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnResetMatrixClick( wxCommandEvent& event ){ event.Skip(); } + + + public: + DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EESchema Erc"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 438,407 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_ERC_BASE(); + +}; + +#endif //__dialog_erc_base__ diff --git a/eeschema/dialog_find.pjd b/eeschema/dialog_find.pjd deleted file mode 100644 index 562979ec74..0000000000 --- a/eeschema/dialog_find.pjd +++ /dev/null @@ -1,1002 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - "" - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - "jean-pierre Charras" - "License GNU" - "" - 0 - 0 - 0 - "<All platforms>" - "<Any>" - "///////////////////////////////////////////////////////////////////////////// -// Name: %HEADER-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SOURCE-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SYMBOLS-FILENAME% -// Purpose: Symbols file -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "%HEADER-FILENAME%" -#endif - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "%HEADER-FILENAME%" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -" - " /// %BODY% -" - " -/*! - * %BODY% - */ - -" - "app_resources.h" - "app_resources.cpp" - "AppResources" - "app.h" - "app.cpp" - "Application" - 0 - "" - "<None>" - "<System>" - "utf-8" - "<System>" - "" - 0 - 0 - 4 - " " - "" - 0 - 0 - 1 - 0 - 1 - 1 - 0 - 1 - 0 - 0 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - 0 - "" - "Debug" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Dynamic" - "Yes" - "No" - "No" - "%WXVERSION%" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - 0 - 1 - "" - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 1 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "EESchema Locate" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "" - 0 - 0 - "ID_DIALOG" - 10000 - "WinEDA_FindFrame" - "wxDialog" - "wxDialog" - "dialog_find.cpp" - "dialog_find.h" - "" - "EESchema Locate" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 1 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "MAYBE_RESIZE_BORDER" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Expand" - 0 - 5 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Item to find:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Top" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_TEXTCTRL1" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL1" - 10008 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_NewTextCtrl" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "s_OldStringFound" - "wxTextValidator(wxFILTER_NONE, & %VARIABLE%)" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: FIND_SHEET" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindSheetClick" - "FIND_SHEET" - 10001 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Item in &Sheet" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "" - "" - - - "wxButton: FIND_HIERARCHY" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindHierarchyClick" - "FIND_HIERARCHY" - 10002 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Item in &Hierarchy" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - "" - "" - - - "wxButton: FIND_NEXT" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "3/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindNextClick" - "FIND_NEXT" - 10005 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Find &Next Item (F5)" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 1 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 1 - "<Any platform>" - - "wxButton: FIND_MARKERS" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindMarkersClick" - "FIND_MARKERS" - 10003 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Find Markers" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - "" - "" - - - "wxButton: FIND_NEXT_MARKER" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "3/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindNextMarkerClick" - "FIND_NEXT_MARKER" - 10006 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Next Marker (F5)" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "" - "" - - - "wxButton: LOCATE_IN_LIBRARIES" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "16/11/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnLocateInLibrariesClick" - "LOCATE_IN_LIBRARIES" - 10004 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Find Cmp in &Lib" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 1 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - - "Sources" - "html-document" - "" - "sourcesfolder" - 1 - 1 - 0 - 1 - - "dialog_find.rc" - "source-editor-document" - "dialog_find.rc" - "source-editor" - 0 - 0 - 1 - 0 - "16/11/2006" - "" - - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/eeschema/dialog_find.rc b/eeschema/dialog_find.rc deleted file mode 100644 index b86c4e2265..0000000000 --- a/eeschema/dialog_find.rc +++ /dev/null @@ -1 +0,0 @@ -#include "wx/msw/wx.rc" diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index b7f5e29e69..6bd400c300 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -16,7 +16,6 @@ #include "general.h" #include "netlist.h" #include "protos.h" - #include "bitmaps.h" #include "dialog_erc.h" @@ -33,14 +32,14 @@ /* fonctions locales */ static bool WriteDiagnosticERC( const wxString& FullFileName ); -static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, +static void Diagnose( WinEDA_DrawPanel* panel, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* NetItemTst, int MinConnexion, int Diag ); static void TestOthersItems( WinEDA_DrawPanel* panel, - wxDC* DC, ObjetNetListStruct* NetItemRef, + ObjetNetListStruct* NetItemRef, ObjetNetListStruct* NetStart, int* NetNbItems, int* MinConnexion ); -static void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, +static void TestLabel( WinEDA_DrawPanel* panel, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* StartNet ); @@ -52,12 +51,8 @@ int WriteFichierERC = FALSE; * PIN_UNSPECIFIED, PIN_POWER_IN, PIN_POWER_OUT, PIN_OPENCOLLECTOR, * PIN_OPENEMITTER, PIN_NC */ -#define OK 0 -#define WAR 1 // utilis� aussi dans eeredraw -#define ERR 2 -#define UNC 3 -static const wxChar* CommentERC_H[] = +const wxChar* CommentERC_H[] = { wxT( "Input Pin...." ), wxT( "Output Pin..." ), @@ -72,7 +67,7 @@ static const wxChar* CommentERC_H[] = wxT( "No Conn......" ), NULL }; -static const wxChar* CommentERC_V[] = +const wxChar* CommentERC_V[] = { wxT( "Input Pin" ), wxT( "Output Pin" ), @@ -93,27 +88,26 @@ static const wxChar* CommentERC_V[] = * Can be modified by ERC options. * at start up: must be loaded by DefaultDiagErc */ -static int DiagErc[PIN_NMAX][PIN_NMAX]; +int DiagErc[PIN_NMAX][PIN_NMAX]; bool DiagErcTableInit; // go to TRUE after DiagErc init /* Default Look up table which gives the diag for a pair of connected pins * Same as DiagErc, but cannot be modified * Used to init or reset DiagErc */ -static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = -{ /* I, O, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ -/* I */ - { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, -/* O */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, ERR, ERR, WAR }, -/* Bi*/ { OK, OK, OK, OK, OK, WAR, OK, WAR, OK, WAR, WAR }, -/* 3S*/ { OK, WAR, OK, OK, OK, WAR, WAR, ERR, WAR, WAR, WAR }, -/*Pas*/ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, -/*UnS */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR }, -/*PwrI*/ { OK, OK, OK, WAR, OK, WAR, OK, OK, OK, OK, ERR }, -/*PwrO*/ { OK, ERR, WAR, ERR, OK, WAR, OK, ERR, ERR, ERR, WAR }, -/* OC */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, OK, OK, WAR }, -/* OE */ { OK, ERR, WAR, WAR, OK, WAR, OK, ERR, OK, OK, WAR }, -/* NC */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR } +int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = +{ /* I, O, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ +/* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, +/* O */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, ERR, ERR, WAR }, +/* Bi*/ { OK, OK, OK, OK, OK, WAR, OK, WAR, OK, WAR, WAR }, +/* 3S*/ { OK, WAR, OK, OK, OK, WAR, WAR, ERR, WAR, WAR, WAR }, +/*Pas*/ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, +/*UnS */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR }, +/*PwrI*/ { OK, OK, OK, WAR, OK, WAR, OK, OK, OK, OK, ERR }, +/*PwrO*/ { OK, ERR, WAR, ERR, OK, WAR, OK, ERR, ERR, ERR, WAR }, +/* OC */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, OK, OK, WAR }, +/* OE */ { OK, ERR, WAR, WAR, OK, WAR, OK, ERR, OK, OK, WAR }, +/* NC */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR } }; @@ -134,141 +128,22 @@ static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = */ static int MinimalReq[PIN_NMAX][PIN_NMAX] = { /* In, Out, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ -/* In*/ - { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, -/*Out*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NOC }, -/* Bi*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, -/* 3S*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, -/*Pas*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, -/*UnS*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, +/* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, +/*Out*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NOC }, +/* Bi*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, +/* 3S*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, +/*Pas*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, +/*UnS*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /*PwrI*/ { NOD, DRV, NOD, NOD, NOD, NOD, NOD, DRV, NOD, NOD, NOC }, /*PwrO*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NOC }, -/* OC*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, -/* OE*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, -/* NC*/ { NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC } +/* OC*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, +/* OE*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, +/* NC*/ { NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC } }; -/*********************************************/ -void WinEDA_ErcFrame::ReBuildMatrixPanel() -/*********************************************/ - -/* Build or rebuild the panel showing the ERC matrix - */ -{ - int ii, jj, event_id, text_height; - wxPoint pos, BoxMatrixPosition; - -#define BITMAP_SIZE 19 - int bitmap_size = BITMAP_SIZE; - wxStaticText* text; - int x, y; - wxSize BoxMatrixMinSize; - - if( !DiagErcTableInit ) - { - memcpy( DiagErc, DefaultDiagErc, sizeof(DefaultDiagErc) ); - DiagErcTableInit = TRUE; - } - - // Get the current text size : - text = new wxStaticText( m_PanelERCOptions, -1, wxT( "W" ), pos ); // this is a dummy text - - text_height = text->GetRect().GetHeight(); - bitmap_size = MAX( bitmap_size, text_height ); - SAFE_DELETE( text ); - - // compute the Y pos interval: - BoxMatrixMinSize.y = ( bitmap_size * (PIN_NMAX + 1) ) + 5; - GetSizer()->Fit( this ); - GetSizer()->SetSizeHints( this ); - pos = m_MatrixSizer->GetPosition(); - - // Size computation is not made in constructor, in some wxWidgets version, - // and m_BoxSizerForERC_Opt position is always 0,0. and we can't use it - pos.x = MAX( pos.x, 5 ); - pos.y = MAX( pos.y, m_ResetOptButton->GetRect().GetHeight() + 30 ); - - BoxMatrixPosition = pos; - - pos.y += text_height; - - if( m_Initialized == FALSE ) - { - for( ii = 0; ii < PIN_NMAX; ii++ ) - { - y = pos.y + (ii * bitmap_size); - text = new wxStaticText( m_PanelERCOptions, -1, CommentERC_H[ii], wxPoint( 5, y ) ); - - x = text->GetRect().GetRight(); - pos.x = MAX( pos.x, x ); - } - - pos.x += 5; - } - else - pos = m_ButtonList[0][0]->GetPosition(); - - for( ii = 0; ii < PIN_NMAX; ii++ ) - { - y = pos.y + (ii * bitmap_size); - for( jj = 0; jj <= ii; jj++ ) - { - int diag = DiagErc[ii][jj]; - x = pos.x + (jj * bitmap_size); - if( (ii == jj) && !m_Initialized ) - { - wxPoint txtpos; - txtpos.x = x + 4; txtpos.y = y - bitmap_size; - text = new wxStaticText( m_PanelERCOptions, -1, CommentERC_V[ii], txtpos ); - - BoxMatrixMinSize.x = MAX( BoxMatrixMinSize.x, text->GetRect().GetRight() ); - } - event_id = ID_MATRIX_0 + ii + (jj * PIN_NMAX); - delete m_ButtonList[ii][jj]; - - switch( diag ) - { - case OK: - m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, - event_id, - wxBitmap (green_xpm), - wxPoint (x, y) ); - - break; - - case WAR: - m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, - event_id, - wxBitmap (warning_xpm), - wxPoint (x, y) ); - - break; - - case ERR: - m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, - event_id, - wxBitmap (error_xpm), - wxPoint (x, y) ); - - break; - } - } - } - - if( !m_Initialized ) - { - BoxMatrixMinSize.x += 5; - m_MatrixSizer->SetMinSize( BoxMatrixMinSize ); - BoxMatrixMinSize.y += BoxMatrixPosition.y; - m_PanelMatrixSizer->SetMinSize( BoxMatrixMinSize ); - } - m_Initialized = TRUE; -} - - /**************************************************/ -void WinEDA_ErcFrame::TestErc( wxCommandEvent& event ) +void DIALOG_ERC::TestErc( wxTextCtrl* aMessagesList ) /**************************************************/ { wxFileName fn; @@ -290,16 +165,16 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event ) ReAnnotatePowerSymbolsOnly(); if( CheckAnnotate( m_Parent, 0 ) ) { - DisplayError( this, _( "Annotation Required!" ) ); + if ( aMessagesList ) + { + aMessagesList->AppendText( _( "Annotation Required!" ) ); + aMessagesList->AppendText( wxT("\n") ); + } return; } /* Effacement des anciens marqueurs DRC */ - DelERCMarkers( event ); - - wxClientDC dc( m_Parent->DrawPanel ); - - m_Parent->DrawPanel->PrepareGraphicContext( &dc ); + DeleteAllMarkers( MARQ_ERC ); g_EESchemaVar.NbErrorErc = 0; g_EESchemaVar.NbWarningErc = 0; @@ -318,6 +193,45 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event ) Screen->ClearUndoRedoList(); } + /* Test duplicate sheet names + * inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated). + * Test screens is enought + */ + for( SCH_SCREEN* Screen = ScreenList.GetFirst(); Screen != NULL; Screen = ScreenList.GetNext() ) + { + for( SCH_ITEM* ref_item = Screen->EEDrawList; ref_item != NULL; ref_item = ref_item->Next() ) + { + // serach for a scheet; + if( ref_item->Type() != DRAW_SHEET_STRUCT_TYPE ) + continue; + for( SCH_ITEM* item_to_test = ref_item->Next(); + item_to_test != NULL; + item_to_test = item_to_test->Next() ) + { + if( item_to_test->Type() != DRAW_SHEET_STRUCT_TYPE ) + continue; + + // We have found a second sheet: compare names + if( ( (DrawSheetStruct*) ref_item )->m_SheetName.CmpNoCase( ( (DrawSheetStruct*) + item_to_test )-> + m_SheetName ) == 0 ) + { + /* Create a new marker type ERC error*/ + DrawMarkerStruct* Marker = + new DrawMarkerStruct( ( (DrawSheetStruct*) item_to_test )->m_Pos, + _( "Duplicate Sheet name" ) ); + + Marker->m_Type = MARQ_ERC; + Marker->m_MarkFlags = ERR; + Marker->SetNext( Screen->EEDrawList ); + Screen->EEDrawList = Marker; + g_EESchemaVar.NbErrorErc++; + g_EESchemaVar.NbWarningErc++; + } + } + } + } + m_Parent->BuildNetListBase(); /* Analyse de la table des connexions : */ @@ -358,18 +272,18 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event ) case NET_HIERBUSLABELMEMBER: case NET_SHEETLABEL: case NET_SHEETBUSLABELMEMBER: - TestLabel( m_Parent->DrawPanel, &dc, NetItemRef, StartNet ); + TestLabel( m_Parent->DrawPanel, NetItemRef, StartNet ); break; case NET_NOCONNECT: MinConn = NET_NC; if( NetNbItems != 0 ) - Diagnose( m_Parent->DrawPanel, &dc, NetItemRef, NULL, MinConn, UNC ); + Diagnose( m_Parent->DrawPanel,NetItemRef, NULL, MinConn, UNC ); break; case NET_PIN: - TestOthersItems( m_Parent->DrawPanel, &dc, - NetItemRef, StartNet, &NetNbItems, &MinConn ); + TestOthersItems( m_Parent->DrawPanel, + NetItemRef, StartNet, &NetNbItems, &MinConn ); break; } @@ -388,6 +302,33 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event ) num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc ); m_LastWarningCount->SetLabel( num ); + // Display diags: + EDA_SheetList SheetList; + for( DrawSheetPath * Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() ) + { + SCH_ITEM * DrawStruct = Sheet->LastDrawList(); + for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() ) + { + if( DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE ) + continue; + + /* Marqueur trouve */ + DrawMarkerStruct* Marker = (DrawMarkerStruct*) DrawStruct; + if( Marker->m_Type != MARQ_ERC ) + continue; + + /* Display diag */ + wxString msg; + msg.Printf(_("sheet %s: %s\n"), + Sheet->PathHumanReadable().GetData(), + Marker->GetComment().GetData() ); + m_MessagesList->AppendText( msg ); + } + } + + + m_Parent->DrawPanel->Refresh(); + /* Generation ouverture fichier diag */ if( WriteFichierERC == TRUE ) { @@ -405,46 +346,15 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event ) { Close( TRUE ); ExecuteFile( this, wxGetApp().GetEditorName(), - QuoteFullPath( fn ) ); + QuoteFullPath( fn ) ); } } } -/***********************************************************/ -void WinEDA_ErcFrame::DelERCMarkers( wxCommandEvent& event ) -/***********************************************************/ - -/* Delete the old ERC markers, over the whole hierarchy - */ -{ - EDA_BaseStruct* DrawStruct; - DrawMarkerStruct* Marker; - - wxClientDC dc( m_Parent->DrawPanel ); - - m_Parent->DrawPanel->PrepareGraphicContext( &dc ); - - // Delete markers for the current screen - DrawStruct = m_Parent->GetScreen()->EEDrawList; - for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() ) - { - if( DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE ) - continue; - - /* Marqueur trouve */ - Marker = (DrawMarkerStruct*) DrawStruct; - if( Marker->m_Type == MARQ_ERC ) - RedrawOneStruct( m_Parent->DrawPanel, &dc, Marker, g_XorMode ); - } - - /* Suppression en memoire des marqueurs ERC */ - DeleteAllMarkers( MARQ_ERC ); -} - /**************************************************************/ -void WinEDA_ErcFrame::ResetDefaultERCDiag( wxCommandEvent& event ) +void DIALOG_ERC::ResetDefaultERCDiag( wxCommandEvent& event ) /**************************************************************/ /* Remet aux valeurs par defaut la matrice de diagnostic @@ -456,7 +366,7 @@ void WinEDA_ErcFrame::ResetDefaultERCDiag( wxCommandEvent& event ) /************************************************************/ -void WinEDA_ErcFrame::ChangeErrorLevel( wxCommandEvent& event ) +void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event ) /************************************************************/ /* Change the error level for the pressed button, on the matrix table @@ -490,7 +400,7 @@ void WinEDA_ErcFrame::ChangeErrorLevel( wxCommandEvent& event ) case ERR: level = OK; - new_bitmap_xpm = green_xpm; + new_bitmap_xpm = erc_green_xpm; break; } @@ -498,7 +408,7 @@ void WinEDA_ErcFrame::ChangeErrorLevel( wxCommandEvent& event ) { delete Butt; Butt = new wxBitmapButton( m_PanelERCOptions, id, - wxBitmap (new_bitmap_xpm), pos ); + wxBitmap( new_bitmap_xpm ), pos ); m_ButtonList[y][x] = Butt; DiagErc[y][x] = DiagErc[x][y] = level; @@ -507,15 +417,14 @@ void WinEDA_ErcFrame::ChangeErrorLevel( wxCommandEvent& event ) /********************************************************/ -static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, +static void Diagnose( WinEDA_DrawPanel* panel, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* NetItemTst, int MinConn, int Diag ) /********************************************************/ -/* Routine de creation du marqueur ERC correspondant au conflit electrique - * entre NetItemRef et NetItemTst - * si MinConn < 0: Traitement des erreurs sur labels +/* Creates an ERC marker to show the ERC problem between NetItemRef and NetItemTst + * if MinConn < 0: this is an error on labels */ { DrawMarkerStruct* Marker = NULL; @@ -529,7 +438,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, /* Creation du nouveau marqueur type Erreur ERC */ Marker = new DrawMarkerStruct( NetItemRef->m_Start, wxEmptyString ); - Marker->m_Type = MARQ_ERC; + Marker->m_Type = MARQ_ERC; Marker->m_MarkFlags = WAR; screen = NetItemRef->m_SheetList.LastScreen(); Marker->SetNext( screen->EEDrawList ); @@ -543,37 +452,42 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, || (NetItemRef->m_Type == NET_HIERBUSLABELMEMBER) ) { Marker->m_Comment.Printf( _( "Warning HLabel %s not connected to SheetLabel" ), - NetItemRef->m_Label->GetData() ); + NetItemRef->m_Label->GetData() ); } else Marker->m_Comment.Printf( _( "Warning SheetLabel %s not connected to HLabel" ), - NetItemRef->m_Label->GetData() ); - - if( screen == panel->GetScreen() ) - RedrawOneStruct( panel, DC, Marker, GR_COPY ); + NetItemRef->m_Label->GetData() ); return; } ii = NetItemRef->m_ElectricalType; + wxString string_pinnum, cmp_ref; + char ascii_buf[5]; + ascii_buf[4] = 0; + memcpy( ascii_buf, &NetItemRef->m_PinNum, 4 ); + string_pinnum = CONV_FROM_UTF8( ascii_buf ); + cmp_ref = wxT("?"); + if( NetItemTst == NULL ) { if( MinConn == NOC ) /* 1 seul element dans le net */ { - Marker->m_Comment.Printf( _( "Warning Pin %s Unconnected" ), MsgPinElectricType[ii] ); - if( screen == panel->GetScreen() ) - RedrawOneStruct( panel, DC, Marker, GR_COPY ); + if ( NetItemRef->m_Type == NET_PIN && NetItemRef->m_Link ) + cmp_ref = ((SCH_COMPONENT*)NetItemRef->m_Link)->GetRef( &NetItemRef->m_SheetList ); + Marker->m_Comment.Printf( _( "Warning Cmp %s, Pin %s (%s) Unconnected" ), + cmp_ref.GetData(), string_pinnum.GetData(), MsgPinElectricType[ii] ); return; } if( MinConn == NOD ) /* pas de pilotage du net */ { + if ( NetItemRef->m_Type == NET_PIN && NetItemRef->m_Link ) + cmp_ref = ((SCH_COMPONENT*)NetItemRef->m_Link)->GetRef( &NetItemRef->m_SheetList ); Marker->m_Comment.Printf( - _( "Warning Pin %s not driven (Net %d)" ), + _( "Warning Cmp %s, Pin %s (%s) not driven (Net %d)" ), + cmp_ref.GetData(), string_pinnum.GetData(), MsgPinElectricType[ii], NetItemRef->GetNet() ); - - if( screen == panel->GetScreen() ) - RedrawOneStruct( panel, DC, Marker, GR_COPY ); return; } @@ -581,9 +495,6 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, { Marker->m_Comment.Printf( _( "Warning More than 1 Pin connected to UnConnect symbol" ) ); - - if( screen == panel->GetScreen() ) - RedrawOneStruct( panel, DC, Marker, GR_COPY ); return; } } @@ -599,20 +510,22 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, g_EESchemaVar.NbWarningErc--; } - Marker->m_Comment.Printf( _( - "%s: Pin %s connected to Pin %s (net %d)" ), - DiagLevel.GetData(), - MsgPinElectricType[ii], - MsgPinElectricType[jj], NetItemRef->GetNet() ); - - if( screen == panel->GetScreen() ) - RedrawOneStruct( panel, DC, Marker, GR_COPY ); + wxString alt_string_pinnum, alt_cmp; + memcpy( ascii_buf, &NetItemTst->m_PinNum, 4 ); + alt_string_pinnum = CONV_FROM_UTF8( ascii_buf ); + alt_cmp = wxT("?"); + if ( NetItemTst->m_Type == NET_PIN && NetItemTst->m_Link ) + alt_cmp = ((SCH_COMPONENT*)NetItemTst->m_Link)->GetRef( &NetItemTst->m_SheetList ); + Marker->m_Comment.Printf( _("%s: Cmp %s, Pin %s (%s) connected to Cmp %s, Pin %s (%s) (net %d)" ), + DiagLevel.GetData(), + cmp_ref.GetData(), string_pinnum.GetData(), MsgPinElectricType[ii], + alt_cmp.GetData(), alt_string_pinnum.GetData(),MsgPinElectricType[jj], NetItemRef->GetNet() ); } } /********************************************************************/ -static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC, +static void TestOthersItems( WinEDA_DrawPanel* panel, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* netstart, int* NetNbItems, int* MinConnexion ) @@ -647,9 +560,9 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC, || ( NetItemRef->GetNet() != NetItemTst->GetNet() ) ) // fin de net { /* Fin de netcode trouve: Tst connexion minimum */ if( (*MinConnexion < NET_NC ) - && (local_minconn < NET_NC ) ) /* pin non connect�e ou non pilotee */ + && (local_minconn < NET_NC ) ) /* Not connected or not driven pin */ { - Diagnose( panel, DC, NetItemRef, NULL, local_minconn, WAR ); + Diagnose( panel, NetItemRef, NULL, local_minconn, WAR ); *MinConnexion = DRV; // inhibition autres messages de ce type pour ce net } return; @@ -690,7 +603,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC, { if( NetItemTst->m_FlagOfConnection == 0 ) { - Diagnose( panel, DC, NetItemRef, NetItemTst, 0, erc ); + Diagnose( panel, NetItemRef, NetItemTst, 0, erc ); NetItemTst->m_FlagOfConnection = NOCONNECT; } } @@ -752,9 +665,9 @@ static bool WriteDiagnosticERC( const wxString& FullFileName ) /* Write diag marqueur */ msg.Printf( _( "ERC: %s (X= %2.3f inches, Y= %2.3f inches\n" ), - Marker->GetComment().GetData(), - (float) Marker->m_Pos.x / 1000, - (float) Marker->m_Pos.y / 1000 ); + Marker->GetComment().GetData(), + (float) Marker->m_Pos.x / 1000, + (float) Marker->m_Pos.y / 1000 ); fprintf( OutErc, "%s", CONV_TO_UTF8( msg ) ); } @@ -786,8 +699,7 @@ bool TestLabel_( ObjetNetListStruct* a, ObjetNetListStruct* b ) /***********************************************************************/ -void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, - ObjetNetListStruct* NetItemRef, ObjetNetListStruct* StartNet ) +void TestLabel( WinEDA_DrawPanel* panel, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* StartNet ) /***********************************************************************/ /* Routine controlant qu'un sheetLabel est bien connecte a un Glabel de la @@ -816,7 +728,7 @@ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, if( erc ) { /* GLabel ou SheetLabel orphelin */ - Diagnose( panel, DC, NetItemRef, NULL, -1, WAR ); + Diagnose( panel, NetItemRef, NULL, -1, WAR ); } return; } diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 4194e50c84..b802a4fe10 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -25,6 +25,7 @@ #include "dialog_erc.h" #include "dialog_find.h" #include "netlist_control.h" +#include "dialog_erc.h" /*******************************/ @@ -493,7 +494,7 @@ void WinEDA_SchematicFrame::OnAnnotate( wxCommandEvent& event ) void WinEDA_SchematicFrame::OnErc( wxCommandEvent& event ) /*********************************************************/ { - WinEDA_ErcFrame* dlg = new WinEDA_ErcFrame( this ); + DIALOG_ERC* dlg = new DIALOG_ERC( this ); dlg->ShowModal(); dlg->Destroy(); diff --git a/include/bitmaps.h b/include/bitmaps.h index 0e33c30a89..e192e74f0d 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -114,6 +114,7 @@ extern const char* edit_xpm[]; extern const char* eeschema_xpm[]; extern const char* enter_sheet_xpm[]; extern const char* erc_xpm[]; +extern const char* erc_green_xpm[]; extern const char* error_xpm[]; extern const char* exit_xpm[]; extern const char* export_module_xpm[];