Commit fe5694f9 authored by charras's avatar charras

Eeschema: better ERC diags (work in progress)

parent e80d0750
......@@ -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
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////
// 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()
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
......
This diff is collapsed.
#include "wx/msw/wx.rc"
///////////////////////////////////////////////////////////////////////////
// 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()
{
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// 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__
This diff is collapsed.
#include "wx/msw/wx.rc"
This diff is collapsed.
......@@ -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();
......
......@@ -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[];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment