Drc dialog: make track to copper zones test optional, because it can be really very time consuming

This commit is contained in:
jean-pierre charras 2019-03-19 17:46:46 +01:00
parent aa5a2225e7
commit b1c5afd72f
7 changed files with 882 additions and 1413 deletions

View File

@ -51,7 +51,8 @@
*/
// Keywords for read and write config
#define RefillZonesBeforeDrc wxT( "RefillZonesBeforeDrc" )
#define RefillZonesBeforeDrcKey wxT( "RefillZonesBeforeDrc" )
#define DrcTrackToZoneTestKey wxT( "DrcTrackToZoneTest" )
DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame,
@ -100,7 +101,8 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFra
DIALOG_DRC_CONTROL::~DIALOG_DRC_CONTROL()
{
m_config->Write( RefillZonesBeforeDrc, m_cbRefillZones->GetValue() );
m_config->Write( RefillZonesBeforeDrcKey, m_cbRefillZones->GetValue() );
m_config->Write( DrcTrackToZoneTestKey, m_cbReportTracksToZonesErrors->GetValue() );
// Disconnect events
m_ClearanceListBox->Disconnect( ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK,
@ -154,8 +156,10 @@ void DIALOG_DRC_CONTROL::InitValues()
// read options
bool value;
m_config->Read( RefillZonesBeforeDrc, &value, false );
m_config->Read( RefillZonesBeforeDrcKey, &value, false );
m_cbRefillZones->SetValue( value );
m_config->Read( DrcTrackToZoneTestKey, &value, false );
m_cbReportTracksToZonesErrors->SetValue( value );
Layout(); // adding the units above expanded Clearance text, now resize.
@ -211,7 +215,8 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
SetDrcParmeters();
m_tester->SetSettings( true, // Pad to pad DRC test enabled
true, // unconnected pads DRC test enabled
true, // DRC test for zones enabled
// DRC test for zones enabled/disabled:
m_cbReportTracksToZonesErrors->GetValue(),
true, // DRC test for keepout areas enabled
m_cbRefillZones->GetValue(),
m_cbReportAllTrackErrors->GetValue(),

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Dec 1 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -14,161 +14,166 @@
DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* m_MainSizer;
m_MainSizer = new wxBoxSizer( wxVERTICAL );
wxGridBagSizer* gbSizer1;
gbSizer1 = new wxGridBagSizer( 0, 10 );
gbSizer1->SetFlexibleDirection( wxBOTH );
gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxBoxSizer* bSizerOptions;
bSizerOptions = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgMinValuesSizer;
fgMinValuesSizer = new wxFlexGridSizer( 4, 3, 0, 0 );
fgMinValuesSizer->AddGrowableCol( 1 );
fgMinValuesSizer->SetFlexibleDirection( wxHORIZONTAL );
fgMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_ClearanceTitle = new wxStaticText( this, wxID_ANY, _("Clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ClearanceTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_ClearanceTitle, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_SetClearance = new wxTextCtrl( this, wxID_ANY, _("by Netclass"), wxDefaultPosition, wxDefaultSize, 0 );
m_SetClearance->Enable( false );
fgMinValuesSizer->Add( m_SetClearance, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
fgMinValuesSizer->Add( 0, 0, 0, 0, 5 );
m_TrackMinWidthTitle = new wxStaticText( this, wxID_ANY, _("Minimum track width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackMinWidthTitle->Wrap( -1 );
m_TrackMinWidthTitle->SetToolTip( _("Enter the minimum acceptable value for a track width") );
fgMinValuesSizer->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_SetTrackMinWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMinValuesSizer->Add( m_SetTrackMinWidthCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_TrackMinWidthUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackMinWidthUnit->Wrap( -1 );
m_TrackMinWidthUnit->SetToolTip( _("Enter the minimum acceptable value for a track width") );
fgMinValuesSizer->Add( m_TrackMinWidthUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_ViaMinTitle = new wxStaticText( this, wxID_ANY, _("Minimum via size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinTitle->Wrap( -1 );
m_ViaMinTitle->SetHelpText( _("Enter the minimum acceptable diameter for a standard via") );
fgMinValuesSizer->Add( m_ViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_SetViaMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMinValuesSizer->Add( m_SetViaMinSizeCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 3 );
m_ViaMinUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinUnit->Wrap( -1 );
m_ViaMinUnit->SetHelpText( _("Enter the minimum acceptable diameter for a standard via") );
fgMinValuesSizer->Add( m_ViaMinUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_MicroViaMinTitle = new wxStaticText( this, wxID_ANY, _("Minimum uVia size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinTitle->Wrap( -1 );
m_MicroViaMinTitle->SetToolTip( _("Enter the minimum acceptable diameter for a micro via") );
fgMinValuesSizer->Add( m_MicroViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_SetMicroViakMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMinValuesSizer->Add( m_SetMicroViakMinSizeCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_MicroViaMinUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinUnit->Wrap( -1 );
m_MicroViaMinUnit->SetToolTip( _("Enter the minimum acceptable diameter for a micro via") );
fgMinValuesSizer->Add( m_MicroViaMinUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
bSizerOptions->Add( fgMinValuesSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
wxBoxSizer* bSizerOptSettings;
bSizerOptSettings = new wxBoxSizer( wxVERTICAL );
m_cbRefillZones = new wxCheckBox( this, wxID_ANY, _("Refill all zones before performing DRC"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerOptSettings->Add( m_cbRefillZones, 0, wxALL, 5 );
m_cbReportAllTrackErrors = new wxCheckBox( this, wxID_ANY, _("Report all errors for tracks (slower)"), wxDefaultPosition, wxDefaultSize, 0 );
m_cbReportAllTrackErrors->SetToolTip( _("If selected, all DRC violations for tracks will be reported. This can be slow for complicated designs.\n\nIf unselected, only the first DRC violation will be reported for each track connection.") );
bSizerOptSettings->Add( m_cbReportAllTrackErrors, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_cbReportTracksToZonesErrors = new wxCheckBox( this, wxID_ANY, _("Test tracks against filled copper areas (very slow)"), wxDefaultPosition, wxDefaultSize, 0 );
m_cbReportTracksToZonesErrors->SetToolTip( _("If selected, tracks will be tested against copper zones. \nIf copper zones are up to date, this test should be not needed.\n\nThis test can be *very slow* for complicated designs.") );
bSizerOptSettings->Add( m_cbReportTracksToZonesErrors, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerOptions->Add( bSizerOptSettings, 1, wxEXPAND, 5 );
gbSizer1->Add( bSizerOptions, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerMessages;
bSizerMessages = new wxBoxSizer( wxVERTICAL );
m_messagesLabel = new wxStaticText( this, wxID_ANY, _("Messages"), wxDefaultPosition, wxDefaultSize, 0 );
m_messagesLabel->Wrap( -1 );
bSizerMessages->Add( m_messagesLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_Messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY );
m_Messages->SetMinSize( wxSize( 280,-1 ) );
bSizerMessages->Add( m_Messages, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 2 );
gbSizer1->Add( bSizerMessages, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizerRpt;
fgSizerRpt = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizerRpt->AddGrowableCol( 1 );
fgSizerRpt->SetFlexibleDirection( wxBOTH );
fgSizerRpt->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_CreateRptCtrl = new wxCheckBox( this, ID_CHECKBOX_RPT_FILE, _("Create report file:"), wxDefaultPosition, wxDefaultSize, 0 );
m_CreateRptCtrl->SetToolTip( _("Enable writing report to this file") );
fgSizerRpt->Add( m_CreateRptCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
m_RptFilenameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_RptFilenameCtrl->SetToolTip( _("Enter the report filename") );
m_RptFilenameCtrl->SetMinSize( wxSize( 180,-1 ) );
fgSizerRpt->Add( m_RptFilenameCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 3 );
m_BrowseButton = new wxBitmapButton( this, ID_BUTTON_BROWSE_RPT_FILE, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
m_BrowseButton = new wxBitmapButton( this, ID_BUTTON_BROWSE_RPT_FILE, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_BrowseButton->SetMinSize( wxSize( 30,28 ) );
fgSizerRpt->Add( m_BrowseButton, 0, wxALIGN_CENTER_VERTICAL, 2 );
gbSizer1->Add( fgSizerRpt, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxEXPAND|wxTOP|wxRIGHT, 7 );
gbSizer1->AddGrowableCol( 0 );
gbSizer1->AddGrowableCol( 1 );
m_MainSizer->Add( gbSizer1, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_Notebook = new wxNotebook( this, ID_NOTEBOOK1, wxDefaultPosition, wxDefaultSize, 0 );
m_Notebook->SetMinSize( wxSize( 640,280 ) );
m_panelClearanceListBox = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizeClearanceBox;
bSizeClearanceBox = new wxBoxSizer( wxVERTICAL );
m_ClearanceListBox = new DRCLISTBOX( m_panelClearanceListBox, ID_CLEARANCE_LIST, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_ClearanceListBox = new DRCLISTBOX( m_panelClearanceListBox, ID_CLEARANCE_LIST, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_ClearanceListBox->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
m_ClearanceListBox->SetToolTip( _("Left-click to center on problem marker. Right-click to highlight items.") );
bSizeClearanceBox->Add( m_ClearanceListBox, 1, wxEXPAND|wxALL, 5 );
m_panelClearanceListBox->SetSizer( bSizeClearanceBox );
m_panelClearanceListBox->Layout();
bSizeClearanceBox->Fit( m_panelClearanceListBox );
@ -176,28 +181,28 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_panelUnconnectedBox = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerUnconnectedBox;
bSizerUnconnectedBox = new wxBoxSizer( wxVERTICAL );
m_UnconnectedListBox = new DRCLISTBOX( m_panelUnconnectedBox, ID_UNCONNECTED_LIST, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_UnconnectedListBox = new DRCLISTBOX( m_panelUnconnectedBox, ID_UNCONNECTED_LIST, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_UnconnectedListBox->SetToolTip( _("Left-click to center on unconnected pair. Right-click to highlight unconnected items.") );
bSizerUnconnectedBox->Add( m_UnconnectedListBox, 1, wxALL|wxEXPAND, 5 );
m_panelUnconnectedBox->SetSizer( bSizerUnconnectedBox );
m_panelUnconnectedBox->Layout();
bSizerUnconnectedBox->Fit( m_panelUnconnectedBox );
m_Notebook->AddPage( m_panelUnconnectedBox, _("Unconnected Items (%d)"), false );
m_MainSizer->Add( m_Notebook, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_sizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_DeleteCurrentMarkerButton = new wxButton( this, wxID_ANY, _("Delete Marker"), wxDefaultPosition, wxDefaultSize, 0 );
m_sizerButtons->Add( m_DeleteCurrentMarkerButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
m_DeleteAllMarkersButton = new wxButton( this, wxID_ANY, _("Delete All Markers"), wxDefaultPosition, wxDefaultSize, 0 );
m_sizerButtons->Add( m_DeleteAllMarkersButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
@ -206,17 +211,17 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
m_sizerButtons->Add( m_sdbSizer1, 1, wxEXPAND|wxALL, 5 );
m_MainSizer->Add( m_sizerButtons, 0, wxEXPAND|wxLEFT, 5 );
this->SetSizer( m_MainSizer );
this->Layout();
m_MainSizer->Fit( this );
// Connect Events
this->Connect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_DRC_CONTROL_BASE::OnActivateDlg ) );
m_CreateRptCtrl->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnReportCheckBoxClicked ), NULL, this );
@ -255,5 +260,5 @@ DIALOG_DRC_CONTROL_BASE::~DIALOG_DRC_CONTROL_BASE()
m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnListUnconnectedClick ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnStartdrcClick ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Dec 1 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_DRC_BASE_H__
#define __DIALOG_DRC_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@ -23,10 +22,10 @@ class DRCLISTBOX;
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/bmpbuttn.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/gbsizer.h>
#include <wx/listbox.h>
@ -49,7 +48,7 @@ class DIALOG_DRC_CONTROL_BASE : public DIALOG_SHIM
{
private:
wxPanel* m_panelUnconnectedBox;
protected:
wxStaticText* m_ClearanceTitle;
wxStaticText* m_TrackMinWidthTitle;
@ -60,6 +59,7 @@ class DIALOG_DRC_CONTROL_BASE : public DIALOG_SHIM
wxStaticText* m_MicroViaMinUnit;
wxCheckBox* m_cbRefillZones;
wxCheckBox* m_cbReportAllTrackErrors;
wxCheckBox* m_cbReportTracksToZonesErrors;
wxStaticText* m_messagesLabel;
wxTextCtrl* m_Messages;
wxCheckBox* m_CreateRptCtrl;
@ -74,7 +74,7 @@ class DIALOG_DRC_CONTROL_BASE : public DIALOG_SHIM
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Apply;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnActivateDlg( wxActivateEvent& event ) { event.Skip(); }
virtual void OnReportCheckBoxClicked( wxCommandEvent& event ) { event.Skip(); }
@ -92,8 +92,8 @@ class DIALOG_DRC_CONTROL_BASE : public DIALOG_SHIM
virtual void OnListUnconnectedClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnStartdrcClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxTextCtrl* m_SetClearance;
wxTextCtrl* m_SetTrackMinWidthCtrl;
@ -101,10 +101,9 @@ class DIALOG_DRC_CONTROL_BASE : public DIALOG_SHIM
wxTextCtrl* m_SetMicroViakMinSizeCtrl;
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( -1,-1 ), 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( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DRC_CONTROL_BASE();
};
#endif //__DIALOG_DRC_BASE_H__

View File

@ -138,11 +138,11 @@ DRC::DRC( PCB_EDIT_FRAME* aPcbWindow )
// establish initial values for everything:
m_drcInLegacyRoutingMode = 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_doKeepoutTest = true; // enable keepout areas to items clearance tests
m_refillZones = false; // Only fill zones if requested by user.
m_doPad2PadTest = true; // enable pad to pad clearance tests
m_doUnconnectedTest = true; // enable unconnected tests
m_doZonesTest = false; // disable zone to items clearance tests
m_doKeepoutTest = true; // enable keepout areas to items clearance tests
m_refillZones = false; // Only fill zones if requested by user.
m_reportAllTrackErrors = false;
m_doCreateRptFile = false;
@ -180,7 +180,8 @@ int DRC::DrcOnCreatingTrack( TRACK* aRefSegm, TRACK* aList )
int rpt_state = m_reportAllTrackErrors;
m_reportAllTrackErrors = false;
if( !doTrackDrc( aRefSegm, aList, true ) )
// Test new segment against tracks and pads, not against copper zones
if( !doTrackDrc( aRefSegm, aList, true, false ) )
{
if( m_currentMarker )
{
@ -843,7 +844,8 @@ void DRC::testTracks( wxWindow *aActiveWindow, bool aShowProgressBar )
}
}
if( !doTrackDrc( segm, segm->Next(), true ) )
// Test new segment against tracks and pads, optionally against copper zones
if( !doTrackDrc( segm, segm->Next(), true, m_doZonesTest ) )
{
if( m_currentMarker )
{

View File

@ -180,13 +180,14 @@ class DRC
private:
// protected or private functions() are lowercase first character.
bool m_doPad2PadTest;
bool m_doUnconnectedTest;
bool m_doZonesTest;
bool m_doKeepoutTest;
bool m_doCreateRptFile;
bool m_refillZones;
bool m_reportAllTrackErrors;
bool m_doPad2PadTest; // enable pad to pad clearance tests
bool m_doUnconnectedTest; // enable unconnected tests
bool m_doZonesTest; // enable zone to items clearance tests
bool m_doKeepoutTest; // enable keepout areas to items clearance tests
bool m_doCreateRptFile; // enable creating a report file
bool m_refillZones; // refill zones if requested (by user).
bool m_reportAllTrackErrors; // Report all tracks errors (or only 4 first errors)
bool m_do;
wxString m_rptFilename;
@ -313,11 +314,13 @@ private:
*
* @param aRefSeg The segment to test
* @param aStart the first item of track list to test against (usually BOARD::m_Track)
* @param doPads true if should do pads test
* @param aTestPads true if should do pads test
* @param aTestZones true if should do copper zones test. This can be very time consumming
* @return bool - true if no problems, else false and m_currentMarker is
* filled in with the problem information.
*/
bool doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool doPads = true );
bool doTrackDrc( TRACK* aRefSeg, TRACK* aStart,
bool aTestPads, bool aTestZones );
/**
* Test the current segment or via.

View File

@ -135,7 +135,7 @@ bool convex2pointDRC( wxPoint* aTref, int aTrefCount, wxPoint aPcompare, int aDi
}
bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool aTestPads, bool aTestZones )
{
TRACK* track;
wxPoint delta; // length on X and Y axis of segments
@ -354,7 +354,7 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
dummypad.SetLayerSet( LSET::AllCuMask() ); // Ensure the hole is on all layers
// Compute the min distance to pads
if( testPads )
if( aTestPads )
{
unsigned pad_count = m_pcb->GetPadCount();
@ -704,28 +704,31 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
}
}
/***********************************************/
/* Phase 3: test DRC with zones */
/***********************************************/
SEG refSeg( aRefSeg->GetStart(), aRefSeg->GetEnd() );
for( ZONE_CONTAINER* zone : m_pcb->Zones() )
/***************************************/
/* Phase 3: test DRC with copper zones */
/***************************************/
// Can be *very* time consumming.
if( aTestZones )
{
if( zone->GetFilledPolysList().IsEmpty() || zone->GetIsKeepout() )
continue;
SEG refSeg( aRefSeg->GetStart(), aRefSeg->GetEnd() );
if( !( layerMask & zone->GetLayerSet() ).any() )
continue;
for( ZONE_CONTAINER* zone : m_pcb->Zones() )
{
if( zone->GetFilledPolysList().IsEmpty() || zone->GetIsKeepout() )
continue;
if( zone->GetNetCode() && zone->GetNetCode() == net_code_ref )
continue;
if( !( layerMask & zone->GetLayerSet() ).any() )
continue;
int clearance = zone->GetClearance( aRefSeg );
SHAPE_POLY_SET* outline = const_cast<SHAPE_POLY_SET*>( &zone->GetFilledPolysList() );
if( zone->GetNetCode() && zone->GetNetCode() == net_code_ref )
continue;
if( outline->Distance( refSeg, aRefSeg->GetWidth() ) < clearance )
addMarkerToPcb( m_markerFactory.NewMarker( aRefSeg, zone, DRCE_TRACK_NEAR_ZONE ) );
int clearance = zone->GetClearance( aRefSeg );
SHAPE_POLY_SET* outline = const_cast<SHAPE_POLY_SET*>( &zone->GetFilledPolysList() );
if( outline->Distance( refSeg, aRefSeg->GetWidth() ) < clearance )
addMarkerToPcb( m_markerFactory.NewMarker( aRefSeg, zone, DRCE_TRACK_NEAR_ZONE ) );
}
}
/***********************************************/