Eeschema: better ERC diags (work in progress)

This commit is contained in:
charras 2009-07-03 18:25:06 +00:00
parent e80d075078
commit fe5694f970
13 changed files with 1639 additions and 3235 deletions

View File

@ -51,6 +51,7 @@ set(EESCHEMA_SRCS
dialog_eeschema_config.cpp dialog_eeschema_config.cpp
dialog_eeschema_config_fbp.cpp dialog_eeschema_config_fbp.cpp
dialog_erc.cpp dialog_erc.cpp
dialog_erc_base.cpp
# dialog_find.cpp # dialog_find.cpp
dialog_options.cpp dialog_options.cpp
dialog_print_using_printer_base.cpp dialog_print_using_printer_base.cpp

View File

@ -3,86 +3,53 @@
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 12/02/2006 17:08:38 // Created: 02/07/2000
// RCS-ID: // Licence: GPL
// Copyright: License GNU
// Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// 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 "fctsys.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "netlist.h" #include "netlist.h"
#include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "dialog_erc.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, EVT_COMMAND_RANGE(ID_MATRIX_0,
ID_MATRIX_0 + (PIN_NMAX * PIN_NMAX) - 1, ID_MATRIX_0 + (PIN_NMAX * PIN_NMAX) - 1,
wxEVT_COMMAND_BUTTON_CLICKED, wxEVT_COMMAND_BUTTON_CLICKED,
WinEDA_ErcFrame::ChangeErrorLevel) DIALOG_ERC::ChangeErrorLevel)
END_EVENT_TABLE() 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_Parent = parent;
m_Initialized = FALSE; Init();
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);
GetSizer()->SetSizeHints(this); 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; wxString num;
num.Printf(wxT("%d"), g_EESchemaVar.NbErrorErc); num.Printf(wxT("%d"), g_EESchemaVar.NbErrorErc);
m_TotalErrCount->SetLabel(num); m_TotalErrCount->SetLabel(num);
@ -93,201 +60,38 @@ int ii, jj;
num.Printf(wxT("%d"), g_EESchemaVar.NbWarningErc); num.Printf(wxT("%d"), g_EESchemaVar.NbWarningErc);
m_LastWarningCount->SetLabel(num); 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 // Init Panel Matrix
ReBuildMatrixPanel(); 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 * 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 * 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 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX
*/ */
void WinEDA_ErcFrame::OnResetMatrixClick( wxCommandEvent& event ) void DIALOG_ERC::OnResetMatrixClick( wxCommandEvent& event )
{ {
ResetDefaultERCDiag(event); ResetDefaultERCDiag(event);
} }
@ -297,7 +101,128 @@ void WinEDA_ErcFrame::OnResetMatrixClick( wxCommandEvent& event )
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERC_CMP * 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;
}

View File

@ -1,95 +1,49 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_erc.h // Name: dialog_erc.h
// Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Licence: GPL
// Created: 12/02/2006 17:08:38
// RCS-ID:
// Copyright: License GNU
// Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 12/02/2006 17:08:38
#ifndef _DIALOG_ERC_H_ #ifndef _DIALOG_ERC_H_
#define _DIALOG_ERC_H_ #define _DIALOG_ERC_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #include "dialog_erc_base.h"
#pragma interface "dialog_erc.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/notebook.h"
#include "wx/valgen.h"
#include "wx/statline.h"
////@end includes
/* Variable locales */ /* Variable locales */
extern int WriteFichierERC; extern int WriteFichierERC;
/*! extern int DiagErc[PIN_NMAX][PIN_NMAX];
* Forward declarations 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 /* Control identifiers */
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
#define ID_MATRIX_0 1800 #define ID_MATRIX_0 1800
/*! #define OK 0
* Compatibility #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: public:
/// Constructors /// Constructors
WinEDA_ErcFrame( ); DIALOG_ERC( WinEDA_SchematicFrame* parent );
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 );
/// Creation void Init();
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
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERC_CMP /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERC_CMP
void OnErcCmpClick( wxCommandEvent& event ); void OnErcCmpClick( wxCommandEvent& event );
@ -103,50 +57,13 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX
void OnResetMatrixClick( wxCommandEvent& event ); void OnResetMatrixClick( wxCommandEvent& event );
////@end WinEDA_ErcFrame event handler declarations void TestErc( wxTextCtrl* aMessagesList );
////@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 SelLocal(wxCommandEvent& event); void SelLocal(wxCommandEvent& event);
void SelNewCmp(wxCommandEvent& event); void SelNewCmp(wxCommandEvent& event);
void ResetDefaultERCDiag(wxCommandEvent& event); void ResetDefaultERCDiag(wxCommandEvent& event);
void ChangeErrorLevel(wxCommandEvent& event); void ChangeErrorLevel(wxCommandEvent& event);
void ReBuildMatrixPanel(); 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 #endif

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
#include "wx/msw/wx.rc"

View File

@ -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()
{
}

1082
eeschema/dialog_erc_base.fbp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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 <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/statline.h>
#include <wx/textctrl.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
#include "wx/msw/wx.rc"

View File

@ -16,7 +16,6 @@
#include "general.h" #include "general.h"
#include "netlist.h" #include "netlist.h"
#include "protos.h" #include "protos.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "dialog_erc.h" #include "dialog_erc.h"
@ -33,14 +32,14 @@
/* fonctions locales */ /* fonctions locales */
static bool WriteDiagnosticERC( const wxString& FullFileName ); static bool WriteDiagnosticERC( const wxString& FullFileName );
static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, static void Diagnose( WinEDA_DrawPanel* panel,
ObjetNetListStruct* NetItemRef, ObjetNetListStruct* NetItemRef,
ObjetNetListStruct* NetItemTst, int MinConnexion, int Diag ); ObjetNetListStruct* NetItemTst, int MinConnexion, int Diag );
static void TestOthersItems( WinEDA_DrawPanel* panel, static void TestOthersItems( WinEDA_DrawPanel* panel,
wxDC* DC, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* NetItemRef,
ObjetNetListStruct* NetStart, ObjetNetListStruct* NetStart,
int* NetNbItems, int* MinConnexion ); int* NetNbItems, int* MinConnexion );
static void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, static void TestLabel( WinEDA_DrawPanel* panel,
ObjetNetListStruct* NetItemRef, ObjetNetListStruct* NetItemRef,
ObjetNetListStruct* StartNet ); ObjetNetListStruct* StartNet );
@ -52,12 +51,8 @@ int WriteFichierERC = FALSE;
* PIN_UNSPECIFIED, PIN_POWER_IN, PIN_POWER_OUT, PIN_OPENCOLLECTOR, * PIN_UNSPECIFIED, PIN_POWER_IN, PIN_POWER_OUT, PIN_OPENCOLLECTOR,
* PIN_OPENEMITTER, PIN_NC * PIN_OPENEMITTER, PIN_NC
*/ */
#define OK 0
#define WAR 1 // utilis<69> aussi dans eeredraw
#define ERR 2
#define UNC 3
static const wxChar* CommentERC_H[] = const wxChar* CommentERC_H[] =
{ {
wxT( "Input Pin...." ), wxT( "Input Pin...." ),
wxT( "Output Pin..." ), wxT( "Output Pin..." ),
@ -72,7 +67,7 @@ static const wxChar* CommentERC_H[] =
wxT( "No Conn......" ), wxT( "No Conn......" ),
NULL NULL
}; };
static const wxChar* CommentERC_V[] = const wxChar* CommentERC_V[] =
{ {
wxT( "Input Pin" ), wxT( "Input Pin" ),
wxT( "Output Pin" ), wxT( "Output Pin" ),
@ -93,27 +88,26 @@ static const wxChar* CommentERC_V[] =
* Can be modified by ERC options. * Can be modified by ERC options.
* at start up: must be loaded by DefaultDiagErc * 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 bool DiagErcTableInit; // go to TRUE after DiagErc init
/* Default Look up table which gives the diag for a pair of connected pins /* Default Look up table which gives the diag for a pair of connected pins
* Same as DiagErc, but cannot be modified * Same as DiagErc, but cannot be modified
* Used to init or reset DiagErc * Used to init or reset DiagErc
*/ */
static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = int DefaultDiagErc[PIN_NMAX][PIN_NMAX] =
{ /* I, O, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ { /* I, O, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */
/* I */ /* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR },
{ OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, /* O */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, ERR, ERR, 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 },
/* Bi*/ { OK, OK, OK, OK, OK, WAR, OK, WAR, OK, WAR, WAR }, /* 3S*/ { OK, WAR, OK, OK, OK, WAR, WAR, ERR, WAR, 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 },
/*Pas*/ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, /*UnS */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, 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 },
/*PwrI*/ { OK, OK, OK, WAR, OK, WAR, OK, OK, OK, OK, ERR }, /*PwrO*/ { OK, ERR, WAR, ERR, OK, WAR, OK, ERR, ERR, ERR, WAR },
/*PwrO*/ { OK, ERR, WAR, ERR, OK, WAR, OK, ERR, ERR, ERR, WAR }, /* OC */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, OK, OK, 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 },
/* OE */ { OK, ERR, WAR, WAR, OK, WAR, OK, ERR, OK, OK, WAR }, /* NC */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, 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] = static int MinimalReq[PIN_NMAX][PIN_NMAX] =
{ /* In, Out, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ { /* In, Out, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */
/* In*/ /* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC },
{ NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /*Out*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, 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 },
/* Bi*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* 3S*/ { 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 },
/*Pas*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /*UnS*/ { 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 }, /*PwrI*/ { NOD, DRV, NOD, NOD, NOD, NOD, NOD, DRV, NOD, NOD, NOC },
/*PwrO*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, 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 }, /* OC*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC },
/* OE*/ { 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 } /* 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; wxFileName fn;
@ -290,16 +165,16 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
ReAnnotatePowerSymbolsOnly(); ReAnnotatePowerSymbolsOnly();
if( CheckAnnotate( m_Parent, 0 ) ) if( CheckAnnotate( m_Parent, 0 ) )
{ {
DisplayError( this, _( "Annotation Required!" ) ); if ( aMessagesList )
{
aMessagesList->AppendText( _( "Annotation Required!" ) );
aMessagesList->AppendText( wxT("\n") );
}
return; return;
} }
/* Effacement des anciens marqueurs DRC */ /* Effacement des anciens marqueurs DRC */
DelERCMarkers( event ); DeleteAllMarkers( MARQ_ERC );
wxClientDC dc( m_Parent->DrawPanel );
m_Parent->DrawPanel->PrepareGraphicContext( &dc );
g_EESchemaVar.NbErrorErc = 0; g_EESchemaVar.NbErrorErc = 0;
g_EESchemaVar.NbWarningErc = 0; g_EESchemaVar.NbWarningErc = 0;
@ -318,6 +193,45 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
Screen->ClearUndoRedoList(); 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(); m_Parent->BuildNetListBase();
/* Analyse de la table des connexions : */ /* Analyse de la table des connexions : */
@ -358,18 +272,18 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
case NET_HIERBUSLABELMEMBER: case NET_HIERBUSLABELMEMBER:
case NET_SHEETLABEL: case NET_SHEETLABEL:
case NET_SHEETBUSLABELMEMBER: case NET_SHEETBUSLABELMEMBER:
TestLabel( m_Parent->DrawPanel, &dc, NetItemRef, StartNet ); TestLabel( m_Parent->DrawPanel, NetItemRef, StartNet );
break; break;
case NET_NOCONNECT: case NET_NOCONNECT:
MinConn = NET_NC; MinConn = NET_NC;
if( NetNbItems != 0 ) if( NetNbItems != 0 )
Diagnose( m_Parent->DrawPanel, &dc, NetItemRef, NULL, MinConn, UNC ); Diagnose( m_Parent->DrawPanel,NetItemRef, NULL, MinConn, UNC );
break; break;
case NET_PIN: case NET_PIN:
TestOthersItems( m_Parent->DrawPanel, &dc, TestOthersItems( m_Parent->DrawPanel,
NetItemRef, StartNet, &NetNbItems, &MinConn ); NetItemRef, StartNet, &NetNbItems, &MinConn );
break; break;
} }
@ -388,6 +302,33 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc ); num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc );
m_LastWarningCount->SetLabel( num ); 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 */ /* Generation ouverture fichier diag */
if( WriteFichierERC == TRUE ) if( WriteFichierERC == TRUE )
{ {
@ -405,46 +346,15 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
{ {
Close( TRUE ); Close( TRUE );
ExecuteFile( this, wxGetApp().GetEditorName(), 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 /* 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 /* Change the error level for the pressed button, on the matrix table
@ -490,7 +400,7 @@ void WinEDA_ErcFrame::ChangeErrorLevel( wxCommandEvent& event )
case ERR: case ERR:
level = OK; level = OK;
new_bitmap_xpm = green_xpm; new_bitmap_xpm = erc_green_xpm;
break; break;
} }
@ -498,7 +408,7 @@ void WinEDA_ErcFrame::ChangeErrorLevel( wxCommandEvent& event )
{ {
delete Butt; delete Butt;
Butt = new wxBitmapButton( m_PanelERCOptions, id, Butt = new wxBitmapButton( m_PanelERCOptions, id,
wxBitmap (new_bitmap_xpm), pos ); wxBitmap( new_bitmap_xpm ), pos );
m_ButtonList[y][x] = Butt; m_ButtonList[y][x] = Butt;
DiagErc[y][x] = DiagErc[x][y] = level; 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* NetItemRef,
ObjetNetListStruct* NetItemTst, ObjetNetListStruct* NetItemTst,
int MinConn, int Diag ) int MinConn, int Diag )
/********************************************************/ /********************************************************/
/* Routine de creation du marqueur ERC correspondant au conflit electrique /* Creates an ERC marker to show the ERC problem between NetItemRef and NetItemTst
* entre NetItemRef et NetItemTst * if MinConn < 0: this is an error on labels
* si MinConn < 0: Traitement des erreurs sur labels
*/ */
{ {
DrawMarkerStruct* Marker = NULL; DrawMarkerStruct* Marker = NULL;
@ -529,7 +438,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
/* Creation du nouveau marqueur type Erreur ERC */ /* Creation du nouveau marqueur type Erreur ERC */
Marker = new DrawMarkerStruct( NetItemRef->m_Start, wxEmptyString ); Marker = new DrawMarkerStruct( NetItemRef->m_Start, wxEmptyString );
Marker->m_Type = MARQ_ERC; Marker->m_Type = MARQ_ERC;
Marker->m_MarkFlags = WAR; Marker->m_MarkFlags = WAR;
screen = NetItemRef->m_SheetList.LastScreen(); screen = NetItemRef->m_SheetList.LastScreen();
Marker->SetNext( screen->EEDrawList ); Marker->SetNext( screen->EEDrawList );
@ -543,37 +452,42 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
|| (NetItemRef->m_Type == NET_HIERBUSLABELMEMBER) ) || (NetItemRef->m_Type == NET_HIERBUSLABELMEMBER) )
{ {
Marker->m_Comment.Printf( _( "Warning HLabel %s not connected to SheetLabel" ), Marker->m_Comment.Printf( _( "Warning HLabel %s not connected to SheetLabel" ),
NetItemRef->m_Label->GetData() ); NetItemRef->m_Label->GetData() );
} }
else else
Marker->m_Comment.Printf( _( "Warning SheetLabel %s not connected to HLabel" ), Marker->m_Comment.Printf( _( "Warning SheetLabel %s not connected to HLabel" ),
NetItemRef->m_Label->GetData() ); NetItemRef->m_Label->GetData() );
if( screen == panel->GetScreen() )
RedrawOneStruct( panel, DC, Marker, GR_COPY );
return; return;
} }
ii = NetItemRef->m_ElectricalType; 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( NetItemTst == NULL )
{ {
if( MinConn == NOC ) /* 1 seul element dans le net */ if( MinConn == NOC ) /* 1 seul element dans le net */
{ {
Marker->m_Comment.Printf( _( "Warning Pin %s Unconnected" ), MsgPinElectricType[ii] ); if ( NetItemRef->m_Type == NET_PIN && NetItemRef->m_Link )
if( screen == panel->GetScreen() ) cmp_ref = ((SCH_COMPONENT*)NetItemRef->m_Link)->GetRef( &NetItemRef->m_SheetList );
RedrawOneStruct( panel, DC, Marker, GR_COPY ); Marker->m_Comment.Printf( _( "Warning Cmp %s, Pin %s (%s) Unconnected" ),
cmp_ref.GetData(), string_pinnum.GetData(), MsgPinElectricType[ii] );
return; return;
} }
if( MinConn == NOD ) /* pas de pilotage du net */ 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( 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() ); MsgPinElectricType[ii], NetItemRef->GetNet() );
if( screen == panel->GetScreen() )
RedrawOneStruct( panel, DC, Marker, GR_COPY );
return; return;
} }
@ -581,9 +495,6 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
Marker->m_Comment.Printf( Marker->m_Comment.Printf(
_( "Warning More than 1 Pin connected to UnConnect symbol" ) ); _( "Warning More than 1 Pin connected to UnConnect symbol" ) );
if( screen == panel->GetScreen() )
RedrawOneStruct( panel, DC, Marker, GR_COPY );
return; return;
} }
} }
@ -599,20 +510,22 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
g_EESchemaVar.NbWarningErc--; g_EESchemaVar.NbWarningErc--;
} }
Marker->m_Comment.Printf( _( wxString alt_string_pinnum, alt_cmp;
"%s: Pin %s connected to Pin %s (net %d)" ), memcpy( ascii_buf, &NetItemTst->m_PinNum, 4 );
DiagLevel.GetData(), alt_string_pinnum = CONV_FROM_UTF8( ascii_buf );
MsgPinElectricType[ii], alt_cmp = wxT("?");
MsgPinElectricType[jj], NetItemRef->GetNet() ); if ( NetItemTst->m_Type == NET_PIN && NetItemTst->m_Link )
alt_cmp = ((SCH_COMPONENT*)NetItemTst->m_Link)->GetRef( &NetItemTst->m_SheetList );
if( screen == panel->GetScreen() ) Marker->m_Comment.Printf( _("%s: Cmp %s, Pin %s (%s) connected to Cmp %s, Pin %s (%s) (net %d)" ),
RedrawOneStruct( panel, DC, Marker, GR_COPY ); 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* NetItemRef,
ObjetNetListStruct* netstart, ObjetNetListStruct* netstart,
int* NetNbItems, int* MinConnexion ) int* NetNbItems, int* MinConnexion )
@ -647,9 +560,9 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC,
|| ( NetItemRef->GetNet() != NetItemTst->GetNet() ) ) // fin de net || ( NetItemRef->GetNet() != NetItemTst->GetNet() ) ) // fin de net
{ /* Fin de netcode trouve: Tst connexion minimum */ { /* Fin de netcode trouve: Tst connexion minimum */
if( (*MinConnexion < NET_NC ) if( (*MinConnexion < NET_NC )
&& (local_minconn < NET_NC ) ) /* pin non connect<63>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 *MinConnexion = DRV; // inhibition autres messages de ce type pour ce net
} }
return; return;
@ -690,7 +603,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
if( NetItemTst->m_FlagOfConnection == 0 ) if( NetItemTst->m_FlagOfConnection == 0 )
{ {
Diagnose( panel, DC, NetItemRef, NetItemTst, 0, erc ); Diagnose( panel, NetItemRef, NetItemTst, 0, erc );
NetItemTst->m_FlagOfConnection = NOCONNECT; NetItemTst->m_FlagOfConnection = NOCONNECT;
} }
} }
@ -752,9 +665,9 @@ static bool WriteDiagnosticERC( const wxString& FullFileName )
/* Write diag marqueur */ /* Write diag marqueur */
msg.Printf( _( "ERC: %s (X= %2.3f inches, Y= %2.3f inches\n" ), msg.Printf( _( "ERC: %s (X= %2.3f inches, Y= %2.3f inches\n" ),
Marker->GetComment().GetData(), Marker->GetComment().GetData(),
(float) Marker->m_Pos.x / 1000, (float) Marker->m_Pos.x / 1000,
(float) Marker->m_Pos.y / 1000 ); (float) Marker->m_Pos.y / 1000 );
fprintf( OutErc, "%s", CONV_TO_UTF8( msg ) ); fprintf( OutErc, "%s", CONV_TO_UTF8( msg ) );
} }
@ -786,8 +699,7 @@ bool TestLabel_( ObjetNetListStruct* a, ObjetNetListStruct* b )
/***********************************************************************/ /***********************************************************************/
void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, void TestLabel( WinEDA_DrawPanel* panel, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* StartNet )
ObjetNetListStruct* NetItemRef, ObjetNetListStruct* StartNet )
/***********************************************************************/ /***********************************************************************/
/* Routine controlant qu'un sheetLabel est bien connecte a un Glabel de la /* 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 ) if( erc )
{ {
/* GLabel ou SheetLabel orphelin */ /* GLabel ou SheetLabel orphelin */
Diagnose( panel, DC, NetItemRef, NULL, -1, WAR ); Diagnose( panel, NetItemRef, NULL, -1, WAR );
} }
return; return;
} }

View File

@ -25,6 +25,7 @@
#include "dialog_erc.h" #include "dialog_erc.h"
#include "dialog_find.h" #include "dialog_find.h"
#include "netlist_control.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 ) void WinEDA_SchematicFrame::OnErc( wxCommandEvent& event )
/*********************************************************/ /*********************************************************/
{ {
WinEDA_ErcFrame* dlg = new WinEDA_ErcFrame( this ); DIALOG_ERC* dlg = new DIALOG_ERC( this );
dlg->ShowModal(); dlg->ShowModal();
dlg->Destroy(); dlg->Destroy();

View File

@ -114,6 +114,7 @@ extern const char* edit_xpm[];
extern const char* eeschema_xpm[]; extern const char* eeschema_xpm[];
extern const char* enter_sheet_xpm[]; extern const char* enter_sheet_xpm[];
extern const char* erc_xpm[]; extern const char* erc_xpm[];
extern const char* erc_green_xpm[];
extern const char* error_xpm[]; extern const char* error_xpm[];
extern const char* exit_xpm[]; extern const char* exit_xpm[];
extern const char* export_module_xpm[]; extern const char* export_module_xpm[];