Pcbnew: in DRC dialog: removed options, that are no more useful with the new zone handling.

(all test are now always performed)
This commit is contained in:
charras 2009-06-27 06:26:41 +00:00
parent 17bf24354e
commit dfffee8281
9 changed files with 936 additions and 911 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,11 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_drc.cpp
// Author: jean-pierre Charras
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
#include "fctsys.h"
#include "wxstruct.h"
#include "dialog_drc.h"
@ -15,17 +14,17 @@
/* class DIALOG_DRC_CONTROL: a dialog to set DRC parameters (clearance, min cooper size)
* and run DRC tests
*/
DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, WinEDA_PcbFrame* parent ) :
DIALOG_DRC_CONTROL_BASE(parent)
DIALOG_DRC_CONTROL_BASE( parent )
{
m_tester = aTester;
m_Parent = parent;
Init( );
if (GetSizer())
Init();
if( GetSizer() )
{
GetSizer()->SetSizeHints(this);
GetSizer()->SetSizeHints( this );
}
}
@ -33,15 +32,23 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, WinEDA_PcbFrame* parent )
void DIALOG_DRC_CONTROL::Init()
{
// Connect events and objects
m_ClearanceListBox->Connect(ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK, wxMouseEventHandler(DIALOG_DRC_CONTROL::OnLeftDClickClearance), NULL, this);
m_ClearanceListBox->Connect(ID_CLEARANCE_LIST, wxEVT_RIGHT_UP, wxMouseEventHandler(DIALOG_DRC_CONTROL::OnRightUpClearance), NULL, this);
m_UnconnectedListBox->Connect(ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK, wxMouseEventHandler(DIALOG_DRC_CONTROL::OnLeftDClickUnconnected), NULL, this);
m_UnconnectedListBox->Connect(ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP, wxMouseEventHandler(DIALOG_DRC_CONTROL::OnRightUpUnconnected), NULL, this);
m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK,
wxMouseEventHandler(
DIALOG_DRC_CONTROL::OnLeftDClickClearance ), NULL, this );
m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_RIGHT_UP,
wxMouseEventHandler(
DIALOG_DRC_CONTROL::OnRightUpClearance ), NULL, this );
m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK,
wxMouseEventHandler( DIALOG_DRC_CONTROL::
OnLeftDClickUnconnected ), NULL, this );
m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP,
wxMouseEventHandler(
DIALOG_DRC_CONTROL::OnRightUpUnconnected ), NULL, this );
AddUnitSymbol(*m_ClearenceTitle);
AddUnitSymbol(*m_TrackMinWidthTitle);
AddUnitSymbol(*m_ViaMinTitle);
AddUnitSymbol(*m_MicroViaMinTitle);
AddUnitSymbol( *m_ClearenceTitle );
AddUnitSymbol( *m_TrackMinWidthTitle );
AddUnitSymbol( *m_ViaMinTitle );
AddUnitSymbol( *m_MicroViaMinTitle );
Layout(); // adding the units above expanded Clearance text, now resize.
@ -88,22 +95,26 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
g_DesignSettings.m_MicroViasMinSize =
ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->m_InternalUnits );
m_tester->SetSettings( m_Pad2PadTestCtrl->IsChecked(),
m_UnconnectedTestCtrl->IsChecked(),
m_ZonesTestCtrl->IsChecked(),
reportName, m_CreateRptCtrl->IsChecked() );
m_tester->SetSettings( true, // Pad to pad DRC test enabled
true, // unconnected pdas DRC test enabled
true, // DRC test for zones enabled
reportName, m_CreateRptCtrl->IsChecked() );
DelDRCMarkers();
wxBeginBusyCursor();
// run all the tests, with no UI at this time.
m_tester->RunTests();
m_Messages->Clear();
wxSafeYield(); // Allows time slice to refresh the m_Messages window
m_tester->m_pcb->m_Status_Pcb = 0; // Force full connectivity and ratsnest recalculations
m_tester->RunTests(m_Messages);
#if wxCHECK_VERSION( 2, 8, 0 )
m_Notebook->ChangeSelection(0); // display the 1at tab "...Markers ..."
m_Notebook->ChangeSelection( 0 ); // display the 1at tab "...Markers ..."
#else
m_Notebook->SetSelection(0); // display the 1at tab "... Markers..."
m_Notebook->SetSelection( 0 ); // display the 1at tab "... Markers..."
#endif
@ -112,12 +123,12 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
{
FILE* fp = wxFopen( reportName, wxT( "w" ) );
writeReport( fp );
fclose(fp);
fclose( fp );
wxString msg;
wxString msg;
msg.Printf( _( "Report file \"%s\" created" ), reportName.GetData() );
wxString caption( _("Disk File Report Completed") );
wxString caption( _( "Disk File Report Completed" ) );
wxMessageDialog popupWindow( this, msg, caption );
popupWindow.ShowModal();
@ -170,21 +181,22 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
g_DesignSettings.m_MicroViasMinSize =
ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->m_InternalUnits );
m_tester->SetSettings( m_Pad2PadTestCtrl->IsChecked(),
m_UnconnectedTestCtrl->IsChecked(),
m_ZonesTestCtrl->IsChecked(),
reportName, m_CreateRptCtrl->IsChecked() );
m_tester->SetSettings( true, // Pad to pad DRC test enabled
true, // unconnected pdas DRC test enabled
true, // DRC test for zones enabled
reportName, m_CreateRptCtrl->IsChecked() );
DelDRCMarkers();
wxBeginBusyCursor();
m_Messages->Clear();
m_tester->ListUnconnectedPads();
#if wxCHECK_VERSION( 2, 8, 0 )
m_Notebook->ChangeSelection(1); // display the 2nd tab "Unconnected..."
m_Notebook->ChangeSelection( 1 ); // display the 2nd tab "Unconnected..."
#else
m_Notebook->SetSelection(1); // display the 2nd tab "Unconnected..."
m_Notebook->SetSelection( 1 ); // display the 2nd tab "Unconnected..."
#endif
// Generate the report
@ -192,11 +204,11 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
{
FILE* fp = wxFopen( reportName, wxT( "w" ) );
writeReport( fp );
fclose(fp);
fclose( fp );
wxString msg;
wxString msg;
msg.Printf( _( "Report file \"%s\" created" ), reportName.GetData() );
wxString caption( _("Disk File Report Completed") );
wxString caption( _( "Disk File Report Completed" ) );
wxMessageDialog popupWindow( this, msg, caption );
popupWindow.ShowModal();
}
@ -204,21 +216,22 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
wxEndBusyCursor();
/* there is currently nothing visible on the DrawPanel for unconnected pads
RedrawDrawPanel();
*/
* RedrawDrawPanel();
*/
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
*/
void DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick( wxCommandEvent& event )
{
wxFileName fn;
wxString wildcard( _( "DRC report files (.rpt)|*.rpt" ) );
wxString Ext( wxT( "rpt" ) );
wxFileName fn;
wxString wildcard( _( "DRC report files (.rpt)|*.rpt" ) );
wxString Ext( wxT( "rpt" ) );
fn = m_Parent->GetScreen()->m_FileName + wxT("-drc");
fn = m_Parent->GetScreen()->m_FileName + wxT( "-drc" );
fn.SetExt( Ext );
wxFileDialog dlg( this, _( "Save DRC Report File" ), wxEmptyString,
@ -228,7 +241,7 @@ void DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick( wxCommandEvent& event )
if( dlg.ShowModal() == wxID_CANCEL )
return;
m_RptFilenameCtrl->SetValue(dlg.GetPath());
m_RptFilenameCtrl->SetValue( dlg.GetPath() );
}
@ -262,19 +275,19 @@ void DIALOG_DRC_CONTROL::OnReportCheckBoxClicked( wxCommandEvent& event )
{
if( m_CreateRptCtrl->IsChecked() )
{
m_RptFilenameCtrl->Enable(true);
m_BrowseButton->Enable(true);
m_RptFilenameCtrl->Enable( true );
m_BrowseButton->Enable( true );
}
else
{
m_RptFilenameCtrl->Enable(false);
m_BrowseButton->Enable(false);
m_RptFilenameCtrl->Enable( false );
m_BrowseButton->Enable( false );
}
// event.Skip();
}
/*!
* wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
*/
@ -295,10 +308,10 @@ void DIALOG_DRC_CONTROL::OnLeftDClickClearance( wxMouseEvent& event )
if( item )
{
/*
// after the goto, process a button OK command later.
wxCommandEvent cmd( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK );
::wxPostEvent( GetEventHandler(), cmd );
*/
* // after the goto, process a button OK command later.
* wxCommandEvent cmd( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK );
* ::wxPostEvent( GetEventHandler(), cmd );
*/
m_Parent->CursorGoto( item->GetPosition() );
@ -314,12 +327,12 @@ void DIALOG_DRC_CONTROL::OnLeftDClickClearance( wxMouseEvent& event )
void DIALOG_DRC_CONTROL::OnPopupMenu( wxCommandEvent& event )
{
int source = event.GetId();
int source = event.GetId();
const DRC_ITEM* item = 0;
wxPoint pos;
int selection;
int selection;
switch( source )
{
@ -328,16 +341,19 @@ void DIALOG_DRC_CONTROL::OnPopupMenu( wxCommandEvent& event )
item = m_UnconnectedListBox->GetItem( selection );
pos = item->GetPointA();
break;
case ID_POPUP_UNCONNECTED_B:
selection = m_UnconnectedListBox->GetSelection();
item = m_UnconnectedListBox->GetItem( selection );
pos = item->GetPointB();
break;
case ID_POPUP_MARKERS_A:
selection = m_ClearanceListBox->GetSelection();
item = m_ClearanceListBox->GetItem( selection );
pos = item->GetPointA();
break;
case ID_POPUP_MARKERS_B:
selection = m_ClearanceListBox->GetSelection();
item = m_ClearanceListBox->GetItem( selection );
@ -353,7 +369,6 @@ void DIALOG_DRC_CONTROL::OnPopupMenu( wxCommandEvent& event )
}
/*!
* wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
*/
@ -372,12 +387,12 @@ void DIALOG_DRC_CONTROL::OnRightUpUnconnected( wxMouseEvent& event )
wxMenuItem* mItem;
const DRC_ITEM* dItem = m_UnconnectedListBox->GetItem( selection );
mItem = new wxMenuItem( &menu, ID_POPUP_UNCONNECTED_A, dItem->GetTextA() );
mItem = new wxMenuItem( &menu, ID_POPUP_UNCONNECTED_A, dItem->GetTextA() );
menu.Append( mItem );
if( dItem->HasSecondItem() )
{
mItem = new wxMenuItem( &menu, ID_POPUP_UNCONNECTED_B, dItem->GetTextB() );
mItem = new wxMenuItem( &menu, ID_POPUP_UNCONNECTED_B, dItem->GetTextB() );
menu.Append( mItem );
}
@ -404,12 +419,12 @@ void DIALOG_DRC_CONTROL::OnRightUpClearance( wxMouseEvent& event )
wxMenuItem* mItem;
const DRC_ITEM* dItem = m_ClearanceListBox->GetItem( selection );
mItem = new wxMenuItem( &menu, ID_POPUP_MARKERS_A, dItem->GetTextA() );
mItem = new wxMenuItem( &menu, ID_POPUP_MARKERS_A, dItem->GetTextA() );
menu.Append( mItem );
if( dItem->HasSecondItem() )
{
mItem = new wxMenuItem( &menu, ID_POPUP_MARKERS_B, dItem->GetTextB() );
mItem = new wxMenuItem( &menu, ID_POPUP_MARKERS_B, dItem->GetTextB() );
menu.Append( mItem );
}
@ -456,12 +471,13 @@ void DIALOG_DRC_CONTROL::OnMarkerSelectionEvent( wxCommandEvent& event )
if( selection != wxNOT_FOUND )
{
// until a MARKER is selected, this button is not enabled.
m_DeleteCurrentMarkerButton->Enable(true);
m_DeleteCurrentMarkerButton->Enable( true );
}
event.Skip();
}
void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent( wxCommandEvent& event )
{
int selection = event.GetSelection();
@ -469,7 +485,7 @@ void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent( wxCommandEvent& event )
if( selection != wxNOT_FOUND )
{
// until a MARKER is selected, this button is not enabled.
m_DeleteCurrentMarkerButton->Enable(true);
m_DeleteCurrentMarkerButton->Enable( true );
}
event.Skip();
@ -500,21 +516,21 @@ void DIALOG_DRC_CONTROL::writeReport( FILE* fp )
wxDateTime now = wxDateTime::Now();
fprintf( fp, "** Created on %s **\n", CONV_TO_UTF8(now.Format( wxT("%F %T"))) );
fprintf( fp, "** Created on %s **\n", CONV_TO_UTF8( now.Format( wxT( "%F %T" ) ) ) );
count = m_ClearanceListBox->GetItemCount();
fprintf( fp, "\n** Found %d DRC errors **\n", count );
for( int i=0; i<count; ++i )
fprintf( fp, m_ClearanceListBox->GetItem(i)->ShowReport().mb_str() );
for( int i = 0; i<count; ++i )
fprintf( fp, m_ClearanceListBox->GetItem( i )->ShowReport().mb_str() );
count = m_UnconnectedListBox->GetItemCount();
fprintf( fp, "\n** Found %d unconnected pads **\n", count );
for( int i=0; i<count; ++i )
fprintf( fp, m_UnconnectedListBox->GetItem(i)->ShowReport().mb_str() );
for( int i = 0; i<count; ++i )
fprintf( fp, m_UnconnectedListBox->GetItem( i )->ShowReport().mb_str() );
fprintf( fp, "\n** End of Report **\n" );
}
@ -527,7 +543,7 @@ void DIALOG_DRC_CONTROL::writeReport( FILE* fp )
void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
{
int selectedIndex;
int curTab = m_Notebook->GetSelection();
int curTab = m_Notebook->GetSelection();
if( curTab == 0 )
{
@ -540,7 +556,6 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
RedrawDrawPanel();
}
}
else if( curTab == 1 )
{
selectedIndex = m_UnconnectedListBox->GetSelection();
@ -549,9 +564,8 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
m_UnconnectedListBox->DeleteItem( selectedIndex );
/* these unconnected DRC_ITEMs are not currently visible on the pcb
RedrawDrawPanel();
*/
* RedrawDrawPanel();
*/
}
}
}

View File

@ -84,7 +84,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_RptFilenameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_RptFilenameCtrl->SetToolTip( _("Enter the report filename") );
m_RptFilenameCtrl->SetMinSize( wxSize( 200,-1 ) );
m_RptFilenameCtrl->SetMinSize( wxSize( 250,-1 ) );
ReportFileSizer->Add( m_RptFilenameCtrl, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
@ -95,33 +95,21 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
sbSizerOptions->Add( bSizer7, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer3;
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Include Tests For:") ), wxVERTICAL );
m_CommandSizer->Add( sbSizerOptions, 0, 0, 5 );
m_Pad2PadTestCtrl = new wxCheckBox( this, wxID_ANY, _("Pad to pad"), wxDefaultPosition, wxDefaultSize, 0 );
m_Pad2PadTestCtrl->SetValue(true);
wxBoxSizer* bSizerMessages;
bSizerMessages = new wxBoxSizer( wxVERTICAL );
m_Pad2PadTestCtrl->SetToolTip( _("Include tests for clearances between pad to pads") );
m_Pad2PadTestCtrl->SetHelpText( _("Include tests for clearances between pad to pads") );
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 );
bSizerMessages->Add( m_staticText6, 0, wxRIGHT|wxLEFT, 5 );
sbSizer3->Add( m_Pad2PadTestCtrl, 0, wxALL, 5 );
m_Messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY );
m_Messages->SetMinSize( wxSize( 160,-1 ) );
m_ZonesTestCtrl = new wxCheckBox( this, wxID_ANY, _("Zones"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerMessages->Add( m_Messages, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_ZonesTestCtrl->SetToolTip( _("Include zones in clearance or unconnected tests") );
sbSizer3->Add( m_ZonesTestCtrl, 0, wxALL, 5 );
m_UnconnectedTestCtrl = new wxCheckBox( this, wxID_ANY, _("Unconnected pads"), wxDefaultPosition, wxDefaultSize, 0 );
m_UnconnectedTestCtrl->SetValue(true);
m_UnconnectedTestCtrl->SetToolTip( _("Find unconnected pads") );
sbSizer3->Add( m_UnconnectedTestCtrl, 0, wxALL, 5 );
sbSizerOptions->Add( sbSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_CommandSizer->Add( sbSizerOptions, 1, 0, 5 );
m_CommandSizer->Add( bSizerMessages, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer11;
bSizer11 = new wxBoxSizer( wxVERTICAL );

View File

@ -32,7 +32,7 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_DRC_CONTROL_BASE</property>
<property name="pos"></property>
<property name="size">678,508</property>
<property name="size">683,508</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="title">DRC Control</property>
@ -87,7 +87,7 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">1</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Options</property>
@ -625,7 +625,7 @@
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="minimum_size">200,-1</property>
<property name="minimum_size">250,-1</property>
<property name="name">m_RptFilenameCtrl</property>
<property name="permission">public</property>
<property name="pos"></property>
@ -722,174 +722,121 @@
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMessages</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></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="label">Include Tests For:</property>
<property name="label">Messages:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">sbSizer3</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<property name="name">m_staticText6</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></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="maxlength">0</property>
<property name="minimum_size">160,-1</property>
<property name="name">m_Messages</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">1</property>
<property name="context_help">Include tests for clearances between pad to pads</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="label">Pad to pad</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Pad2PadTestCtrl</property>
<property name="permission">public</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Include tests for clearances between pad to pads</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></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="label">Zones</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_ZonesTestCtrl</property>
<property name="permission">public</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Include zones in clearance or unconnected tests</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">1</property>
<property name="context_help"></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="label">Unconnected pads</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_UnconnectedTestCtrl</property>
<property name="permission">public</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Find unconnected pads</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>

View File

@ -56,6 +56,8 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog
;
wxStaticText* m_MicroViaMinTitle;
wxButton* m_BrowseButton;
wxStaticText* m_staticText6;
wxTextCtrl* m_Messages;
wxButton* m_buttonRunDRC;
wxButton* m_buttonListUnconnected;
wxButton* m_DeleteAllButton;
@ -90,12 +92,9 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog
wxTextCtrl* m_SetMicroViakMinSizeCtrl;
wxCheckBox* m_CreateRptCtrl;
wxTextCtrl* m_RptFilenameCtrl;
wxCheckBox* m_Pad2PadTestCtrl;
wxCheckBox* m_ZonesTestCtrl;
wxCheckBox* m_UnconnectedTestCtrl;
DRCLISTBOX* m_ClearanceListBox;
DRCLISTBOX* m_UnconnectedListBox;
DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("DRC Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 678,508 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("DRC Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 683,508 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DRC_CONTROL_BASE();
};

View File

@ -70,10 +70,6 @@ void DRC::ShowDialog()
PutValueInLocalUnits( *m_ui->m_SetMicroViakMinSizeCtrl, g_DesignSettings.m_MicroViasMinSize,
m_mainWindow->m_InternalUnits );;
m_ui->m_Pad2PadTestCtrl->SetValue( m_doPad2PadTest );
m_ui->m_ZonesTestCtrl->SetValue( m_doZonesTest );
m_ui->m_UnconnectedTestCtrl->SetValue( m_doUnconnectedTest );
m_ui->m_CreateRptCtrl->SetValue( m_doCreateRptFile );
m_ui->m_RptFilenameCtrl->SetValue( m_rptFilename );
}
@ -92,9 +88,6 @@ void DRC::DestroyDialog( int aReason )
{
// if user clicked OK, save his choices in this DRC object.
m_doCreateRptFile = m_ui->m_CreateRptCtrl->GetValue();
m_doPad2PadTest = m_ui->m_Pad2PadTestCtrl->GetValue();
m_doZonesTest = m_ui->m_ZonesTestCtrl->GetValue();
m_doUnconnectedTest = m_ui->m_UnconnectedTestCtrl->GetValue();
m_rptFilename = m_ui->m_RptFilenameCtrl->GetValue();
}
@ -112,9 +105,9 @@ DRC::DRC( WinEDA_PcbFrame* aPcbWindow )
m_ui = 0;
// establish initial values for everything:
m_doPad2PadTest = true;
m_doUnconnectedTest = true;
m_doZonesTest = false;
m_doPad2PadTest = true; // enable pad to pad clearance tests
m_doUnconnectedTest = true; // enable unconnected tests
m_doZonesTest = true; // enable zone to items clearance tests
m_doCreateRptFile = false;
@ -198,34 +191,62 @@ int DRC::Drc( ZONE_CONTAINER* aArea, int CornerIndex )
* will actually run all the tests specified with a previous call to
* SetSettings()
*/
void DRC::RunTests()
void DRC::RunTests(wxTextCtrl * aMessages)
{
// Ensure ratsnest is up to date:
if( (m_pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK) == 0 )
{
if ( aMessages )
aMessages->AppendText( _("Compile Ratsnest") );
m_mainWindow->Compile_Ratsnest( NULL, true );
if ( aMessages )
aMessages->AppendText( _(" Ok\n"));
}
// someone should have cleared the two lists before calling this.
// test pad to pad clearances, nothing to do with tracks, vias or zones.
if( m_doPad2PadTest )
{
if ( aMessages )
aMessages->AppendText( _("Test pads to pads clearance") );
testPad2Pad();
if ( aMessages )
aMessages->AppendText( _("\n"));
}
// test track and via clearances to other tracks, pads, and vias
testTracks();
// Before testing segments and unconnected, refill all zones:
// this is a good caution, because filled areas can be outdated.
if ( aMessages )
aMessages->AppendText( _("Fill zones") );
m_mainWindow->Fill_All_Zones( false );
if ( aMessages )
aMessages->AppendText( _(" Ok\n"));
// test zone clearances to other zones, pads, tracks, and vias
if ( aMessages && m_doZonesTest)
aMessages->AppendText( _("Test zones") );
testZones( m_doZonesTest );
if ( aMessages && m_doZonesTest)
aMessages->AppendText( _("\n"));
// find and gather unconnected pads.
if( m_doUnconnectedTest )
{
if ( aMessages )
aMessages->AppendText( _("List unconnected pads") );
testUnconnected();
if ( aMessages )
aMessages->AppendText( _("\n"));
}
// update the m_ui listboxes
updatePointers();
if ( aMessages )
aMessages->AppendText( _("Finished\n") );
}

View File

@ -593,8 +593,9 @@ public:
* Function RunTests
* will actually run all the tests specified with a previous call to
* SetSettings()
* @param aMessages = a wxTextControl where to display some activity messages. Can be NULL
*/
void RunTests();
void RunTests(wxTextCtrl * aMessages = NULL);
/**

View File

@ -102,7 +102,6 @@ void WinEDA_BasePcbFrame::Compile_Ratsnest( wxDC* DC, bool display_status_pcb )
/** Function Compile_Ratsnest
* Create the entire board ratsnesr.
* Msut be called AFTER the connectivity computation
* Must be called after a board change (changes for
* pads, footprints or a read netlist ).
*