Move ERC dialog to DRC architecture.

This is mainly to remove the annotation nag dialogs in favour of the
HTML links.  But it also allows you to see more than a few messages,
and implements a progress reporter architecture if the ERC checks ever
get slow enough to benefit from it.
This commit is contained in:
Jeff Young 2020-10-19 15:17:49 +01:00
parent b12937af65
commit 725082786e
7 changed files with 429 additions and 286 deletions

View File

@ -28,7 +28,6 @@
#include <sch_screen.h>
#include <sch_edit_frame.h>
#include <schematic.h>
#include <invoke_sch_dialog.h>
#include <project.h>
#include <kiface_i.h>
#include <bitmaps.h>
@ -36,7 +35,6 @@
#include <wildcards_and_files_ext.h>
#include <sch_view.h>
#include <sch_marker.h>
#include <sch_component.h>
#include <connection_graph.h>
#include <tools/ee_actions.h>
#include <tool/tool_manager.h>
@ -45,29 +43,31 @@
#include <id.h>
#include <confirm.h>
#include <widgets/infobar.h>
#include <dialogs/wx_html_report_box.h>
#include <wx/ffile.h>
#include <wx/hyperlink.h>
#include <erc_item.h>
#include <eeschema_settings.h>
#include <kicad_string.h>
#include <kiplatform/ui.h>
DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
DIALOG_ERC_BASE( parent, ID_DIALOG_ERC ), // parent looks for this ID explicitly
PROGRESS_REPORTER( 1 ),
m_parent( parent ),
m_running( false ),
m_ercRun( false ),
m_severities( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING )
{
EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
m_severities = settings->m_Appearance.erc_severities;
m_messages->SetImmediateMode();
m_markerProvider = new SHEETLIST_ERC_ITEMS_PROVIDER( &m_parent->Schematic() );
m_markerTreeModel = new RC_TREE_MODEL( parent, m_markerDataView );
m_markerDataView->AssociateModel( m_markerTreeModel );
wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
m_textMarkers->SetFont( infoFont );
m_titleMessages->SetFont( infoFont );
m_markerTreeModel->SetSeverities( m_severities );
m_markerTreeModel->SetProvider( m_markerProvider );
syncCheckboxes();
@ -75,14 +75,30 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but
// that requires us to correct the button labels here.
m_sdbSizer1OK->SetLabel( _( "Run" ) );
m_sdbSizer1OK->SetLabel( _( "Run ERC" ) );
m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
m_sdbSizer1->Layout();
m_sdbSizer1OK->SetDefault();
if( m_parent->CheckAnnotate( NULL_REPORTER::GetInstance(), false ) )
m_infoBar->ShowMessage( _( "Some components are not annotated. ERC cannot be run." ) );
{
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( m_infoBar, wxID_ANY,
_("Show Annotation dialog"),
wxEmptyString );
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
[&]( wxHyperlinkEvent& aEvent )
{
wxHtmlLinkEvent htmlEvent( aEvent.GetId(),
wxHtmlLinkInfo( aEvent.GetURL() ) );
OnLinkClicked( htmlEvent );
} ) );
m_infoBar->RemoveAllButtons();
m_infoBar->AddButton( button );
m_infoBar->ShowMessage( _( "Annotation not complete. ERC cannot be run." ) );
}
// Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();
@ -101,6 +117,37 @@ DIALOG_ERC::~DIALOG_ERC()
}
// PROGRESS_REPORTER calls
bool DIALOG_ERC::updateUI()
{
// If ERC checks ever get slow enough we'll want a progress indicator...
//
// double cur = (double) m_progress.load() / m_maxProgress;
// cur = std::max( 0.0, std::min( cur, 1.0 ) );
//
// m_gauge->SetValue( KiROUND( cur * 1000.0 ) );
// wxSafeYield( this );
return !m_cancelled;
}
void DIALOG_ERC::AdvancePhase( const wxString& aMessage )
{
PROGRESS_REPORTER::AdvancePhase( aMessage );
SetCurrentProgress( 0.0 );
m_messages->Report( aMessage );
}
void DIALOG_ERC::Report( const wxString& aMessage )
{
m_messages->Report( aMessage );
}
void DIALOG_ERC::updateDisplayedCounts()
{
int numErrors = 0;
@ -159,8 +206,14 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
// This is a modeless dialog so we have to handle these ourselves.
void DIALOG_ERC::OnButtonCloseClick( wxCommandEvent& event )
void DIALOG_ERC::OnCancelClick( wxCommandEvent& aEvent )
{
if( m_running )
{
m_cancelled = true;
return;
}
m_parent->FocusOnItem( nullptr );
Close();
@ -187,16 +240,78 @@ void DIALOG_ERC::syncCheckboxes()
}
void DIALOG_ERC::OnLinkClicked( wxHtmlLinkEvent& event )
{
wxCommandEvent dummy;
m_parent->OnAnnotate( dummy );
// We don't actually get notified when the annotation error is resolved, but we can assume
// that the user will take corrective action. If they don't, we can just show the infobar
// again.
m_infoBar->Hide();
}
void DIALOG_ERC::OnRunERCClick( wxCommandEvent& event )
{
wxBusyCursor busy;
SCHEMATIC* sch = &m_parent->Schematic();
// Build the whole sheet list in hierarchy (sheet, not screen)
sch->GetSheets().AnnotatePowerSymbols();
if( m_parent->CheckAnnotate( NULL_REPORTER::GetInstance(), false ) )
{
m_notebook->ChangeSelection( 0 ); // Display the "Tests Running..." tab
m_messages->Clear();
m_messages->Report( _( "Annotation not complete. ERC cannot be run. " )
+ wxT( "<a href='annotate'>" )
+ _( "Show Annotation dialog." )
+ wxT( "</a>" ) );
m_messages->Flush();
m_infoBar->Hide(); // No need for duplicated error messages
return;
}
m_infoBar->Hide();
deleteAllMarkers( true );
m_MessagesList->Clear();
wxSafeYield(); // m_MarkersList must be redraw
m_notebook->ChangeSelection( 0 ); // Display the "Tests Running..." tab
m_messages->Clear();
wxYield(); // Allow time slice to refresh Messages
WX_TEXT_CTRL_REPORTER reporter( m_MessagesList );
testErc( reporter );
m_running = true;
m_sdbSizer1Cancel->SetLabel( _( "Cancel" ) );
m_sdbSizer1OK->Enable( false );
m_buttondelmarkers->Enable( false );
m_saveReport->Enable( false );
testErc();
if( m_cancelled )
m_messages->Report( _( "-------- ERC cancelled by user.<br><br>" ) );
else
m_messages->Report( _( "Done.<br><br>" ) );
Raise();
wxYield(); // Allow time slice to refresh Messages
m_running = false;
m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
m_sdbSizer1OK->Enable( true );
m_buttondelmarkers->Enable( true );
m_saveReport->Enable( true );
if( !m_cancelled )
{
wxMilliSleep( 500 );
m_notebook->ChangeSelection( 1 );
KIPLATFORM::UI::ForceFocus( m_markerDataView );
}
m_ercRun = true;
updateDisplayedCounts();
@ -211,7 +326,7 @@ void DIALOG_ERC::redrawDrawPanel()
}
void DIALOG_ERC::testErc( REPORTER& aReporter )
void DIALOG_ERC::testErc()
{
wxFileName fn;
@ -220,27 +335,14 @@ void DIALOG_ERC::testErc( REPORTER& aReporter )
// Build the whole sheet list in hierarchy (sheet, not screen)
sch->GetSheets().AnnotatePowerSymbols();
if( m_parent->CheckAnnotate( aReporter, false ) )
if( m_parent->CheckAnnotate( NULL_REPORTER::GetInstance(), false ) )
{
if( aReporter.HasMessage() )
aReporter.ReportTail( _( "Some components are not annotated. ERC cannot be run." ),
RPT_SEVERITY_ERROR );
if( IsOK( m_parent, _( "Some components are not annotated. Open annotation dialog?" ) ) )
{
wxCommandEvent dummy;
m_parent->OnAnnotate( dummy );
// We don't actually get notified when the annotation error is resolved, but we can
// assume that the user will take corrective action. If they don't, we can just show
// the dialog again.
m_infoBar->Hide();
}
else
{
m_infoBar->ShowMessage( _( "Some components are not annotated. ERC cannot be run." ) );
}
Report( _( "Annotation not complete. ERC cannot be run. " )
+ wxT( "<a href='annotate'>" )
+ _( "Show Annotation dialog." )
+ wxT( "</a>" ) );
m_infoBar->Hide(); // No need for duplicated error messages
return;
}
@ -254,29 +356,29 @@ void DIALOG_ERC::testErc( REPORTER& aReporter )
// to the same file, each must have a unique name.
if( settings.IsTestEnabled( ERCE_DUPLICATE_SHEET_NAME ) )
{
aReporter.ReportTail( _( "Checking sheet names...\n" ), RPT_SEVERITY_INFO );
AdvancePhase( _( "Checking sheet names..." ) );
tester.TestDuplicateSheetNames( true );
}
if( settings.IsTestEnabled( ERCE_BUS_ALIAS_CONFLICT ) )
{
aReporter.ReportTail( _( "Checking bus conflicts...\n" ), RPT_SEVERITY_INFO );
AdvancePhase( _( "Checking bus conflicts..." ) );
tester.TestConflictingBusAliases();
}
// The connection graph has a whole set of ERC checks it can run
aReporter.ReportTail( _( "Checking conflicts...\n" ) );
AdvancePhase( _( "Checking conflicts..." ) );
m_parent->RecalculateConnections( NO_CLEANUP );
sch->ConnectionGraph()->RunERC();
// Test is all units of each multiunit component have the same footprint assigned.
if( settings.IsTestEnabled( ERCE_DIFFERENT_UNIT_FP ) )
{
aReporter.ReportTail( _( "Checking footprints...\n" ), RPT_SEVERITY_INFO );
AdvancePhase( _( "Checking footprints..." ) );
tester.TestMultiunitFootprints();
}
aReporter.ReportTail( _( "Checking pins...\n" ), RPT_SEVERITY_INFO );
AdvancePhase( _( "Checking pins..." ) );
if( settings.IsTestEnabled( ERCE_DIFFERENT_UNIT_NET ) )
tester.TestMultUnitPinConflicts();
@ -289,25 +391,25 @@ void DIALOG_ERC::testErc( REPORTER& aReporter )
// using case insensitive comparisons)
if( settings.IsTestEnabled( ERCE_SIMILAR_LABELS ) )
{
aReporter.ReportTail( _( "Checking labels...\n" ), RPT_SEVERITY_INFO );
AdvancePhase( _( "Checking labels..." ) );
tester.TestSimilarLabels();
}
if( settings.IsTestEnabled( ERCE_UNRESOLVED_VARIABLE ) )
{
aReporter.ReportTail( _( "Checking for unresolved variables...\n" ) );
AdvancePhase( _( "Checking for unresolved variables..." ) );
tester.TestTextVars( m_parent->GetCanvas()->GetView()->GetWorksheet() );
}
if( settings.IsTestEnabled( ERCE_NOCONNECT_CONNECTED ) )
{
aReporter.ReportTail( _( "Checking no connect pins for connections...\n" ) );
AdvancePhase( _( "Checking no connect pins for connections..." ) );
tester.TestNoConnectPins();
}
if( settings.IsTestEnabled( ERCE_LIB_SYMBOL_ISSUES ) )
{
aReporter.ReportTail( _( "Checking for library symbol issues...\n" ) );
AdvancePhase( _( "Checking for library symbol issues..." ) );
tester.TestLibSymbolIssues();
}
@ -323,7 +425,7 @@ void DIALOG_ERC::testErc( REPORTER& aReporter )
m_parent->GetCanvas()->Refresh();
// Display message
aReporter.ReportTail( _( "Finished.\n" ), RPT_SEVERITY_INFO );
Report( _( "Done.<br><br>" ) );
}
@ -568,8 +670,8 @@ void DIALOG_ERC::OnSaveReport( wxCommandEvent& aEvent )
if( writeReport( fn.GetFullPath() ) )
{
m_MessagesList->AppendText( wxString::Format( _( "Report file '%s' created\n" ),
fn.GetFullPath() ) );
m_messages->Report( wxString::Format( _( "Report file '%s' created\n" ),
fn.GetFullPath() ) );
}
else
{

View File

@ -30,11 +30,12 @@
#include <lib_pin.h> // For PINTYPE_COUNT definition
#include <dialog_erc_base.h>
#include <widgets/progress_reporter.h>
#include <erc_settings.h>
// DIALOG_ERC class declaration
class DIALOG_ERC : public DIALOG_ERC_BASE
class DIALOG_ERC : public DIALOG_ERC_BASE, PROGRESS_REPORTER
{
private:
SCH_EDIT_FRAME* m_parent;
@ -42,6 +43,7 @@ private:
RC_ITEMS_PROVIDER* m_markerProvider;
RC_TREE_MODEL* m_markerTreeModel;
bool m_running;
bool m_ercRun;
int m_severities;
@ -50,6 +52,11 @@ public:
DIALOG_ERC( SCH_EDIT_FRAME* parent );
~DIALOG_ERC();
// PROGRESS_REPORTER calls
bool updateUI() override;
void AdvancePhase( const wxString& aMessage ) override;
void Report( const wxString& aMessage ) override;
private:
// from DIALOG_ERC_BASE:
void OnCloseErcDialog( wxCloseEvent& event ) override;
@ -58,14 +65,15 @@ private:
void OnERCItemSelected( wxDataViewEvent& aEvent ) override;
void OnERCItemDClick( wxDataViewEvent& aEvent ) override;
void OnERCItemRClick( wxDataViewEvent& aEvent ) override;
void OnLinkClicked( wxHtmlLinkEvent& event ) override;
void OnSeverity( wxCommandEvent& aEvent ) override;
void OnSaveReport( wxCommandEvent& aEvent ) override;
void OnButtonCloseClick( wxCommandEvent& event ) override;
void OnCancelClick( wxCommandEvent& event ) override;
void redrawDrawPanel();
void testErc( REPORTER& aReporter );
void testErc();
bool writeReport( const wxString& aFullFileName );

View File

@ -5,6 +5,7 @@
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialogs/wx_html_report_box.h"
#include "widgets/infobar.h"
#include "dialog_erc_base.h"
@ -23,43 +24,39 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
m_infoBar->SetEffectDuration( 500 );
bSizer1->Add( m_infoBar, 0, wxEXPAND, 5 );
wxBoxSizer* bercSizer;
bercSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxHORIZONTAL );
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
messagesPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bMessagesSizer;
bMessagesSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerMessages;
bSizerMessages = new wxBoxSizer( wxVERTICAL );
m_titleMessages = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_titleMessages->Wrap( -1 );
m_titleMessages->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
bSizerMessages->Add( m_titleMessages, 0, wxRIGHT|wxLEFT, 10 );
m_MessagesList = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_MessagesList->SetMinSize( wxSize( 180,110 ) );
bSizerMessages->Add( m_MessagesList, 1, wxEXPAND|wxLEFT, 5 );
m_messages = new WX_HTML_REPORT_BOX( messagesPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
bMessagesSizer->Add( m_messages, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
bupperSizer->Add( bSizerMessages, 1, wxEXPAND|wxBOTTOM, 5 );
messagesPanel->SetSizer( bMessagesSizer );
messagesPanel->Layout();
bMessagesSizer->Fit( messagesPanel );
m_notebook->AddPage( messagesPanel, _("Messages"), false );
violationsPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bViolationsSizer;
bViolationsSizer = new wxBoxSizer( wxVERTICAL );
bercSizer->Add( bupperSizer, 1, wxEXPAND|wxTOP|wxRIGHT, 5 );
m_textMarkers = new wxStaticText( this, wxID_ANY, _("Violations:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textMarkers->Wrap( -1 );
m_textMarkers->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
bercSizer->Add( m_textMarkers, 0, wxTOP|wxRIGHT|wxLEFT, 10 );
m_markerDataView = new wxDataViewCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER );
m_markerDataView = new wxDataViewCtrl( violationsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER );
m_markerDataView->SetToolTip( _("Click on items to highlight them on the board.") );
m_markerDataView->SetMinSize( wxSize( -1,200 ) );
m_markerDataView->SetMinSize( wxSize( 640,260 ) );
bercSizer->Add( m_markerDataView, 2, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bViolationsSizer->Add( m_markerDataView, 2, wxEXPAND|wxRIGHT|wxLEFT, 5 );
violationsPanel->SetSizer( bViolationsSizer );
violationsPanel->Layout();
bViolationsSizer->Fit( violationsPanel );
m_notebook->AddPage( violationsPanel, _("Violations"), false );
bMainSizer->Add( m_notebook, 1, wxEXPAND, 5 );
wxBoxSizer* bSeveritySizer;
bSeveritySizer = new wxBoxSizer( wxHORIZONTAL );
@ -103,10 +100,10 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
bSeveritySizer->Add( m_saveReport, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
bercSizer->Add( bSeveritySizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
bMainSizer->Add( bSeveritySizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizer1->Add( bercSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 8 );
bSizer1->Add( bMainSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 8 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer1->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
@ -138,6 +135,7 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_ERC_BASE::OnCloseErcDialog ) );
m_messages->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_ERC_BASE::OnLinkClicked ), NULL, this );
m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemDClick ), NULL, this );
m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemRClick ), NULL, this );
m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemSelected ), NULL, this );
@ -147,7 +145,7 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
m_showExclusions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
m_saveReport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSaveReport ), NULL, this );
m_buttondelmarkers->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnEraseDrcMarkersClick ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnButtonCloseClick ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnRunERCClick ), NULL, this );
}
@ -155,6 +153,7 @@ DIALOG_ERC_BASE::~DIALOG_ERC_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_ERC_BASE::OnCloseErcDialog ) );
m_messages->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_ERC_BASE::OnLinkClicked ), NULL, this );
m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemDClick ), NULL, this );
m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemRClick ), NULL, this );
m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemSelected ), NULL, this );
@ -164,7 +163,7 @@ DIALOG_ERC_BASE::~DIALOG_ERC_BASE()
m_showExclusions->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
m_saveReport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSaveReport ), NULL, this );
m_buttondelmarkers->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnEraseDrcMarkersClick ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnButtonCloseClick ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnRunERCClick ), NULL, this );
}

View File

@ -125,161 +125,14 @@
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bercSizer</property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bupperSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizerMessages</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">10</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font">,90,90,-1,70,0</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Messages:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_titleMessages</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">180,110</property>
<property name="moveable">1</property>
<property name="name">m_MessagesList</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxTE_MULTILINE|wxTE_READONLY</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxNotebook" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -290,6 +143,7 @@
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmapsize"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
@ -303,12 +157,10 @@
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font">,90,90,-1,70,0</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Violations:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -316,7 +168,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_textMarkers</property>
<property name="name">m_notebook</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -327,48 +179,232 @@
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Messages</property>
<property name="select">0</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">messagesPanel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMessagesSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_messages</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxHW_SCROLLBAR_AUTO</property>
<property name="subclass">WX_HTML_REPORT_BOX; dialogs/wx_html_report_box.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnHtmlLinkClicked">OnLinkClicked</event>
</object>
</object>
</object>
</object>
</object>
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Violations</property>
<property name="select">0</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">violationsPanel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bViolationsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">2</property>
<object class="wxDataViewCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">640,260</property>
<property name="name">m_markerDataView</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxDV_NO_HEADER</property>
<property name="subclass">; ; forward_declare</property>
<property name="tooltip">Click on items to highlight them on the board.</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnDataViewCtrlItemActivated">OnERCItemDClick</event>
<event name="OnDataViewCtrlItemContextMenu">OnERCItemRClick</event>
<event name="OnDataViewCtrlSelectionChanged">OnERCItemSelected</event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">2</property>
<object class="wxDataViewCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">-1,200</property>
<property name="name">m_markerDataView</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxDV_NO_HEADER</property>
<property name="subclass">; ; forward_declare</property>
<property name="tooltip">Click on items to highlight them on the board.</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnDataViewCtrlItemActivated">OnERCItemDClick</event>
<event name="OnDataViewCtrlItemContextMenu">OnERCItemRClick</event>
<event name="OnDataViewCtrlSelectionChanged">OnERCItemSelected</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
@ -1133,7 +1169,7 @@
<property name="minimum_size"></property>
<property name="name">m_sdbSizer1</property>
<property name="permission">protected</property>
<event name="OnCancelButtonClick">OnButtonCloseClick</event>
<event name="OnCancelButtonClick">OnCancelClick</event>
<event name="OnOKButtonClick">OnRunERCClick</event>
</object>
</object>

View File

@ -10,6 +10,7 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class WX_HTML_REPORT_BOX;
class WX_INFOBAR;
#include "dialog_shim.h"
@ -19,14 +20,16 @@ class WX_INFOBAR;
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/html/htmlwin.h>
#include <wx/sizer.h>
#include <wx/dataview.h>
#include <wx/checkbox.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/dataview.h>
#include <wx/notebook.h>
#include <wx/stattext.h>
#include <wx/checkbox.h>
#include <wx/statbmp.h>
#include <wx/button.h>
#include <wx/statline.h>
@ -45,9 +48,10 @@ class DIALOG_ERC_BASE : public DIALOG_SHIM
protected:
WX_INFOBAR* m_infoBar;
wxStaticText* m_titleMessages;
wxTextCtrl* m_MessagesList;
wxStaticText* m_textMarkers;
wxNotebook* m_notebook;
wxPanel* messagesPanel;
WX_HTML_REPORT_BOX* m_messages;
wxPanel* violationsPanel;
wxDataViewCtrl* m_markerDataView;
wxStaticText* m_showLabel;
wxCheckBox* m_showAll;
@ -67,13 +71,14 @@ class DIALOG_ERC_BASE : public DIALOG_SHIM
// Virtual event handlers, overide them in your derived class
virtual void OnCloseErcDialog( wxCloseEvent& event ) { event.Skip(); }
virtual void OnLinkClicked( wxHtmlLinkEvent& event ) { event.Skip(); }
virtual void OnERCItemDClick( wxDataViewEvent& event ) { event.Skip(); }
virtual void OnERCItemRClick( wxDataViewEvent& event ) { event.Skip(); }
virtual void OnERCItemSelected( wxDataViewEvent& event ) { event.Skip(); }
virtual void OnSeverity( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSaveReport( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEraseDrcMarkersClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCloseClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRunERCClick( wxCommandEvent& event ) { event.Skip(); }

View File

@ -173,12 +173,6 @@ void DIALOG_DRC::AdvancePhase( const wxString& aMessage )
}
void DIALOG_DRC::SetCurrentProgress( double aProgress )
{
PROGRESS_REPORTER::SetCurrentProgress( aProgress );
}
// Don't globally define this; different facilities use different definitions of "ALL"
static int RPT_SEVERITY_ALL = RPT_SEVERITY_WARNING | RPT_SEVERITY_ERROR | RPT_SEVERITY_EXCLUSION;

View File

@ -97,7 +97,6 @@ private:
// PROGRESS_REPORTER calls
bool updateUI() override;
void AdvancePhase( const wxString& aMessage ) override;
void SetCurrentProgress( double aProgress ) override;
BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }