Smoother progress reporting for DRC checks.
Also moves Messages tab out to an overlay, and restores the longer messages now that messages are no longer a textbox in the upper right.
This commit is contained in:
parent
6ec6baf401
commit
a3d65a2b43
|
@ -129,9 +129,9 @@ void DIALOG_DRC::OnActivateDlg( wxActivateEvent& aEvent )
|
|||
|
||||
void DIALOG_DRC::initValues()
|
||||
{
|
||||
m_markersTitleTemplate = m_Notebook->GetPageText( 1 );
|
||||
m_unconnectedTitleTemplate = m_Notebook->GetPageText( 2 );
|
||||
m_footprintsTitleTemplate = m_Notebook->GetPageText( 3 );
|
||||
m_markersTitleTemplate = m_Notebook->GetPageText( 0 );
|
||||
m_unconnectedTitleTemplate = m_Notebook->GetPageText( 1 );
|
||||
m_footprintsTitleTemplate = m_Notebook->GetPageText( 2 );
|
||||
|
||||
auto cfg = m_brdEditor->GetPcbNewSettings();
|
||||
|
||||
|
@ -216,9 +216,9 @@ void DIALOG_DRC::OnRunDRCClick( wxCommandEvent& aEvent )
|
|||
|
||||
Raise();
|
||||
|
||||
m_Notebook->ChangeSelection( 0 ); // Display the "Messages" tab
|
||||
m_runningResultsBook->ChangeSelection( 0 ); // Display the "Tests Running..." tab
|
||||
m_Messages->Clear();
|
||||
wxYield(); // Allows time slice to refresh Messages
|
||||
wxYield(); // Allows time slice to refresh Messages
|
||||
|
||||
drcTool->RunTests( this, testTracksAgainstZones, refillZones, reportAllTrackErrors,
|
||||
testFootprints );
|
||||
|
@ -228,8 +228,7 @@ void DIALOG_DRC::OnRunDRCClick( wxCommandEvent& aEvent )
|
|||
wxYield();
|
||||
Raise();
|
||||
|
||||
if( m_markerTreeModel->GetDRCItemCount() > 0 )
|
||||
m_Notebook->ChangeSelection( 1 ); // display the "Problems/Markers" tab
|
||||
m_runningResultsBook->ChangeSelection( 1 ); // display the results tabs
|
||||
|
||||
m_Notebook->GetPage( m_Notebook->GetSelection() )->SetFocus();
|
||||
}
|
||||
|
@ -645,7 +644,7 @@ bool DIALOG_DRC::writeReport( const wxString& aFullFileName )
|
|||
|
||||
void DIALOG_DRC::OnDeleteOneClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
if( m_Notebook->GetSelection() == 1 )
|
||||
if( m_Notebook->GetSelection() == 0 )
|
||||
{
|
||||
// Clear the selection. It may be the selected DRC marker.
|
||||
m_brdEditor->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
|
@ -655,11 +654,11 @@ void DIALOG_DRC::OnDeleteOneClick( wxCommandEvent& aEvent )
|
|||
// redraw the pcb
|
||||
refreshBoardEditor();
|
||||
}
|
||||
else if( m_Notebook->GetSelection() == 2 )
|
||||
else if( m_Notebook->GetSelection() == 1 )
|
||||
{
|
||||
m_unconnectedTreeModel->DeleteCurrentItem( true );
|
||||
}
|
||||
else if( m_Notebook->GetSelection() == 3 )
|
||||
else if( m_Notebook->GetSelection() == 2 )
|
||||
{
|
||||
m_footprintWarningsTreeModel->DeleteCurrentItem( true );
|
||||
}
|
||||
|
@ -715,10 +714,10 @@ void DIALOG_DRC::updateDisplayedCounts()
|
|||
if( m_drcRun )
|
||||
{
|
||||
msg.sprintf( m_markersTitleTemplate, m_markerTreeModel->GetDRCItemCount() );
|
||||
m_Notebook->SetPageText( 1, msg );
|
||||
m_Notebook->SetPageText( 0, msg );
|
||||
|
||||
msg.sprintf( m_unconnectedTitleTemplate, m_unconnectedTreeModel->GetDRCItemCount() );
|
||||
m_Notebook->SetPageText( 2, msg );
|
||||
m_Notebook->SetPageText( 1, msg );
|
||||
|
||||
if( m_footprintTestsRun )
|
||||
msg.sprintf( m_footprintsTitleTemplate, m_footprintWarningsTreeModel->GetDRCItemCount() );
|
||||
|
@ -727,21 +726,21 @@ void DIALOG_DRC::updateDisplayedCounts()
|
|||
msg = m_footprintsTitleTemplate;
|
||||
msg.Replace( wxT( "%d" ), _( "not run" ) );
|
||||
}
|
||||
m_Notebook->SetPageText( 3, msg );
|
||||
m_Notebook->SetPageText( 2, msg );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = m_markersTitleTemplate;
|
||||
msg.Replace( wxT( "(%d)" ), wxEmptyString );
|
||||
m_Notebook->SetPageText( 1, msg );
|
||||
m_Notebook->SetPageText( 0, msg );
|
||||
|
||||
msg = m_unconnectedTitleTemplate;
|
||||
msg.Replace( wxT( "(%d)" ), wxEmptyString );
|
||||
m_Notebook->SetPageText( 2, msg );
|
||||
m_Notebook->SetPageText( 1, msg );
|
||||
|
||||
msg = m_footprintsTitleTemplate;
|
||||
msg.Replace( wxT( "(%d)" ), wxEmptyString );
|
||||
m_Notebook->SetPageText( 3, msg );
|
||||
m_Notebook->SetPageText( 2, msg );
|
||||
}
|
||||
|
||||
// And now the badges:
|
||||
|
|
|
@ -50,8 +50,13 @@ DIALOG_DRC_BASE::DIALOG_DRC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
|||
|
||||
m_MainSizer->Add( bSizerOptions, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 3 );
|
||||
|
||||
m_Notebook = new wxNotebook( this, ID_NOTEBOOK1, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_panelMessages = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_runningResultsBook = new wxSimplebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
running = new wxPanel( m_runningResultsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer14;
|
||||
bSizer14 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_runningNotebook = new wxNotebook( running, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_panelMessages = new wxPanel( m_runningNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer10;
|
||||
bSizer10 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
@ -72,12 +77,25 @@ DIALOG_DRC_BASE::DIALOG_DRC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
|||
m_panelMessages->SetSizer( bSizer10 );
|
||||
m_panelMessages->Layout();
|
||||
bSizer10->Fit( m_panelMessages );
|
||||
m_Notebook->AddPage( m_panelMessages, _("Messages"), true );
|
||||
m_runningNotebook->AddPage( m_panelMessages, _("Tests Running..."), true );
|
||||
|
||||
bSizer14->Add( m_runningNotebook, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
running->SetSizer( bSizer14 );
|
||||
running->Layout();
|
||||
bSizer14->Fit( running );
|
||||
m_runningResultsBook->AddPage( running, _("a page"), false );
|
||||
results = new wxPanel( m_runningResultsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer13;
|
||||
bSizer13 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_Notebook = new wxNotebook( results, ID_NOTEBOOK1, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_panelViolations = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizerViolationsBox;
|
||||
bSizerViolationsBox = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
bSizerViolationsBox->SetMinSize( wxSize( 580,320 ) );
|
||||
bSizerViolationsBox->SetMinSize( wxSize( -1,320 ) );
|
||||
m_markerDataView = new wxDataViewCtrl( m_panelViolations, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER );
|
||||
m_markerDataView->SetToolTip( _("Click on items to highlight them on the board.") );
|
||||
|
||||
|
@ -113,7 +131,15 @@ DIALOG_DRC_BASE::DIALOG_DRC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
|||
bSizerFootprintsBox->Fit( m_panelFootprintWarnings );
|
||||
m_Notebook->AddPage( m_panelFootprintWarnings, _("Schematic Parity (%d)"), false );
|
||||
|
||||
m_MainSizer->Add( m_Notebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
bSizer13->Add( m_Notebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
results->SetSizer( bSizer13 );
|
||||
results->Layout();
|
||||
bSizer13->Fit( results );
|
||||
m_runningResultsBook->AddPage( results, _("a page"), true );
|
||||
|
||||
m_MainSizer->Add( m_runningResultsBook, 1, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizer9;
|
||||
bSizer9 = new wxBoxSizer( wxVERTICAL );
|
||||
|
@ -129,7 +155,7 @@ DIALOG_DRC_BASE::DIALOG_DRC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
|||
bSeveritySizer->Add( m_showAll, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSeveritySizer->Add( 25, 0, 0, wxEXPAND, 5 );
|
||||
bSeveritySizer->Add( 35, 0, 0, wxEXPAND, 5 );
|
||||
|
||||
m_showErrors = new wxCheckBox( this, wxID_ANY, _("Errors"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSeveritySizer->Add( m_showErrors, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
@ -137,7 +163,7 @@ DIALOG_DRC_BASE::DIALOG_DRC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
|||
m_errorsBadge = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_errorsBadge->SetMinSize( wxSize( 20,20 ) );
|
||||
|
||||
bSeveritySizer->Add( m_errorsBadge, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
bSeveritySizer->Add( m_errorsBadge, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 25 );
|
||||
|
||||
m_showWarnings = new wxCheckBox( this, wxID_ANY, _("Warnings"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSeveritySizer->Add( m_showWarnings, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
@ -145,13 +171,13 @@ DIALOG_DRC_BASE::DIALOG_DRC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
|||
m_warningsBadge = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_warningsBadge->SetMinSize( wxSize( 20,20 ) );
|
||||
|
||||
bSeveritySizer->Add( m_warningsBadge, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
bSeveritySizer->Add( m_warningsBadge, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 25 );
|
||||
|
||||
m_showExclusions = new wxCheckBox( this, wxID_ANY, _("Exclusions"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSeveritySizer->Add( m_showExclusions, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_exclusionsBadge = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSeveritySizer->Add( m_exclusionsBadge, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 20 );
|
||||
bSeveritySizer->Add( m_exclusionsBadge, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 25 );
|
||||
|
||||
|
||||
bSeveritySizer->Add( 5, 0, 1, wxEXPAND, 5 );
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -24,8 +24,9 @@
|
|||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/dataview.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/dataview.h>
|
||||
#include <wx/simplebook.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/statbmp.h>
|
||||
#include <wx/button.h>
|
||||
|
@ -49,10 +50,14 @@ class DIALOG_DRC_BASE : public DIALOG_SHIM
|
|||
wxCheckBox* m_cbReportTracksToZonesErrors;
|
||||
wxCheckBox* m_cbRefillZones;
|
||||
wxCheckBox* m_cbTestFootprints;
|
||||
wxNotebook* m_Notebook;
|
||||
wxSimplebook* m_runningResultsBook;
|
||||
wxPanel* running;
|
||||
wxNotebook* m_runningNotebook;
|
||||
wxPanel* m_panelMessages;
|
||||
wxTextCtrl* m_Messages;
|
||||
wxGauge* m_gauge;
|
||||
wxPanel* results;
|
||||
wxNotebook* m_Notebook;
|
||||
wxPanel* m_panelViolations;
|
||||
wxDataViewCtrl* m_markerDataView;
|
||||
wxDataViewCtrl* m_unconnectedDataView;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include <common.h>
|
||||
#include <class_track.h>
|
||||
#include <drc/drc_engine.h>
|
||||
#include <drc/drc_item.h>
|
||||
#include <drc/drc_rule.h>
|
||||
#include <drc/drc_test_provider.h>
|
||||
|
@ -77,7 +76,7 @@ bool DRC_TEST_PROVIDER_ANNULUS::Run()
|
|||
return false;
|
||||
}
|
||||
|
||||
reportPhase( _( "Via annular rings..." ));
|
||||
reportPhase( _( "Checking via annular rings..." ));
|
||||
|
||||
auto checkAnnulus =
|
||||
[&]( BOARD_ITEM* item ) -> bool
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
|
||||
bool DRC_TEST_PROVIDER_CONNECTIVITY::Run()
|
||||
{
|
||||
reportPhase( _( "Dangling pads/vias..." ));
|
||||
reportPhase( _( "Checking dangling pads & vias..." ));
|
||||
|
||||
BOARD* board = m_drcEngine->GetBoard();
|
||||
|
||||
|
@ -105,7 +105,7 @@ bool DRC_TEST_PROVIDER_CONNECTIVITY::Run()
|
|||
}
|
||||
}
|
||||
|
||||
reportPhase( _( "Starved zones..." ));
|
||||
reportPhase( _( "Checking starved zones..." ));
|
||||
|
||||
/* test starved zones */
|
||||
for( ZONE_CONTAINER* zone : board->Zones() )
|
||||
|
@ -130,7 +130,7 @@ bool DRC_TEST_PROVIDER_CONNECTIVITY::Run()
|
|||
}
|
||||
}
|
||||
|
||||
reportPhase( _( "Unconnected nets..." ));
|
||||
reportPhase( _( "Checking net connections..." ));
|
||||
|
||||
connectivity->RecalculateRatsnest();
|
||||
std::vector<CN_EDGE> edges;
|
||||
|
|
|
@ -122,16 +122,16 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
|
|||
|
||||
reportAux( "Worst clearance : %d nm", m_largestClearance );
|
||||
|
||||
reportPhase( _( "Pad clearances..." ));
|
||||
reportPhase( _( "Checking pad clearances..." ));
|
||||
testPadClearances();
|
||||
|
||||
reportPhase( _( "Track/via clearances..." ));
|
||||
reportPhase( _( "Checking track & via clearances..." ));
|
||||
testTrackClearances();
|
||||
|
||||
reportPhase( _( "Copper drawing/text clearances..." ));
|
||||
reportPhase( _( "Checking copper graphic & text clearances..." ));
|
||||
testCopperTextAndGraphics();
|
||||
|
||||
reportPhase( _( "Zone clearances..." ));
|
||||
reportPhase( _( "Checking copper zone clearances..." ));
|
||||
testZones();
|
||||
|
||||
reportRuleStatistics();
|
||||
|
@ -514,7 +514,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::doTrackDrc( TRACK* aRefSeg, PCB_LAYER_I
|
|||
|
||||
void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances( )
|
||||
{
|
||||
const int delta = 100; // This is the number of tests between 2 calls to the progress bar
|
||||
const int delta = 25; // This is the number of tests between 2 calls to the progress bar
|
||||
std::vector<D_PAD*> sortedPads;
|
||||
|
||||
m_board->GetSortedPadListByXthenYCoord( sortedPads );
|
||||
|
@ -541,12 +541,12 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances( )
|
|||
max_size += m_largestClearance;
|
||||
|
||||
// Test the pads
|
||||
for( int idx = 0; idx < (int)sortedPads.size(); idx++ )
|
||||
for( int idx = 0; idx < (int) sortedPads.size(); idx++ )
|
||||
{
|
||||
D_PAD* pad = sortedPads[idx];
|
||||
|
||||
if( idx % delta == 0 )
|
||||
reportProgress((double) idx / (double) sortedPads.size());
|
||||
if( idx % delta == 0 || idx == (int) sortedPads.size() - 1 )
|
||||
reportProgress( (double) idx / (double) sortedPads.size() );
|
||||
|
||||
int x_limit = pad->GetPosition().x + pad->GetBoundingRadius() + max_size;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ void DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions()
|
|||
const int delta = 100; // This is the number of tests between 2 calls to the progress bar
|
||||
|
||||
// Detects missing (or malformed) footprint courtyards
|
||||
reportPhase( _( "Footprint courtyard definitions..." ));
|
||||
reportPhase( _( "Checking footprint courtyard definitions..." ));
|
||||
|
||||
int ii = 0;
|
||||
|
||||
|
@ -128,7 +128,7 @@ void DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testOverlappingComponentCourtyards()
|
|||
{
|
||||
const int delta = 100; // This is the number of tests between 2 calls to the progress bar
|
||||
|
||||
reportPhase( _( "Footprint courtyard overlap..." ));
|
||||
reportPhase( _( "Checking footprint courtyard overlap..." ));
|
||||
|
||||
int ii = 0;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ bool DRC_TEST_PROVIDER_DISALLOW::Run()
|
|||
return false;
|
||||
}
|
||||
|
||||
reportPhase( _( "Keepouts & disallow constraints..." ));
|
||||
reportPhase( _( "Checking keepouts & disallow constraints..." ));
|
||||
|
||||
auto checkItem = [&]( BOARD_ITEM *item ) -> bool
|
||||
{
|
||||
|
|
|
@ -89,7 +89,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
|
|||
|
||||
reportAux( "Worst clearance : %d nm", m_largestClearance );
|
||||
|
||||
reportPhase( _( "Board edge clearances..." ));
|
||||
reportPhase( _( "Checking board edge clearances..." ));
|
||||
|
||||
std::vector<DRAWSEGMENT*> boardOutline;
|
||||
std::vector<BOARD_ITEM*> boardItems;
|
||||
|
|
|
@ -124,10 +124,10 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run()
|
|||
|
||||
buildDrilledHoleList();
|
||||
|
||||
reportPhase( _( "Hole to pad clearances..." ));
|
||||
reportPhase( _( "Checking hole to pad clearances..." ));
|
||||
testPads2Holes();
|
||||
|
||||
reportPhase( _( "Hole to hole clearances..." ));
|
||||
reportPhase( _( "Checking hole to hole clearances..." ));
|
||||
testHoles2Holes();
|
||||
|
||||
reportRuleStatistics();
|
||||
|
@ -170,6 +170,7 @@ void DRC_TEST_PROVIDER_HOLE_CLEARANCE::buildDrilledHoleList()
|
|||
|
||||
void DRC_TEST_PROVIDER_HOLE_CLEARANCE::testPads2Holes()
|
||||
{
|
||||
const int delta = 25; // This is the number of tests between 2 calls to the progress bar
|
||||
std::vector<D_PAD*> sortedPads;
|
||||
|
||||
m_board->GetSortedPadListByXthenYCoord( sortedPads );
|
||||
|
@ -194,13 +195,16 @@ void DRC_TEST_PROVIDER_HOLE_CLEARANCE::testPads2Holes()
|
|||
max_size += m_largestClearance;
|
||||
|
||||
// Test the pads
|
||||
for( int idx = 0; idx < (int)sortedPads.size(); idx++ )
|
||||
for( int idx = 0; idx < (int) sortedPads.size(); idx++ )
|
||||
{
|
||||
D_PAD* pad = sortedPads[idx];
|
||||
int x_limit = pad->GetPosition().x + pad->GetBoundingRadius() + max_size;
|
||||
|
||||
drc_dbg( 10,"-> %p\n", pad );
|
||||
|
||||
if( idx % delta == 0 || idx == (int) sortedPads.size() - 1 )
|
||||
reportProgress( (double) idx / (double) sortedPads.size() );
|
||||
|
||||
doPadToPadHoleDrc( idx, sortedPads, x_limit );
|
||||
}
|
||||
}
|
||||
|
@ -348,6 +352,8 @@ void DRC_TEST_PROVIDER_HOLE_CLEARANCE::addHole( const VECTOR2I& aLocation, int a
|
|||
|
||||
void DRC_TEST_PROVIDER_HOLE_CLEARANCE::testHoles2Holes()
|
||||
{
|
||||
const int delta = 50; // This is the number of tests between 2 calls to the progress bar
|
||||
|
||||
// Sort holes by X for performance. In the nested iteration we then need to look at
|
||||
// following holes only while they are within the refHole's neighborhood as defined by
|
||||
// the refHole radius + the minimum hole-to-hole clearance + the largest radius any of
|
||||
|
@ -363,6 +369,9 @@ void DRC_TEST_PROVIDER_HOLE_CLEARANCE::testHoles2Holes()
|
|||
|
||||
for( size_t ii = 0; ii < m_drilledHoles.size(); ++ii )
|
||||
{
|
||||
if( ii % delta == 0 || ii == m_drilledHoles.size() - 1 )
|
||||
reportProgress( (double) ii / (double) m_drilledHoles.size() );
|
||||
|
||||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_DRILLED_HOLES_TOO_CLOSE ) )
|
||||
break;
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ private:
|
|||
|
||||
bool DRC_TEST_PROVIDER_HOLE_SIZE::Run()
|
||||
{
|
||||
reportPhase( _( "Pad holes..." ));
|
||||
reportPhase( _( "Checking pad holes..." ));
|
||||
|
||||
m_board = m_drcEngine->GetBoard();
|
||||
|
||||
|
@ -94,7 +94,7 @@ bool DRC_TEST_PROVIDER_HOLE_SIZE::Run()
|
|||
}
|
||||
}
|
||||
|
||||
reportPhase( _( "Via holes..." ));
|
||||
reportPhase( _( "Checking via holes..." ));
|
||||
|
||||
std::vector<VIA*> vias;
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ bool DRC_TEST_PROVIDER_LVS::Run()
|
|||
{
|
||||
if( m_drcEngine->GetTestFootprints() )
|
||||
{
|
||||
reportPhase( _( "Layout-vs-Schematic checks..." ));
|
||||
reportPhase( _( "Checking PCB to schematic parity..." ));
|
||||
|
||||
if( m_drcEngine->GetSchematicNetlist() )
|
||||
testFootprints( *m_drcEngine->GetSchematicNetlist() );
|
||||
|
|
|
@ -190,13 +190,13 @@ bool DRC_TEST_PROVIDER_MISC::Run()
|
|||
{
|
||||
m_board = m_drcEngine->GetBoard();
|
||||
|
||||
reportPhase( _( "Board outline..." ));
|
||||
reportPhase( _( "Checking board outline..." ));
|
||||
testOutline();
|
||||
|
||||
reportPhase( _( "Disabled layers..." ));
|
||||
reportPhase( _( "Checking disabled layers..." ));
|
||||
testDisabledLayers();
|
||||
|
||||
reportPhase( _( "Text variables..." ));
|
||||
reportPhase( _( "Checking text variables..." ));
|
||||
testTextVars();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -66,13 +66,15 @@ public:
|
|||
|
||||
bool DRC_TEST_PROVIDER_TRACK_WIDTH::Run()
|
||||
{
|
||||
const int delta = 100; // This is the number of tests between 2 calls to the progress bar
|
||||
|
||||
if( !m_drcEngine->HasRulesForConstraintType( DRC_CONSTRAINT_TYPE_T::DRC_CONSTRAINT_TYPE_TRACK_WIDTH ) )
|
||||
{
|
||||
reportAux( "No track width constraints found. Skipping check." );
|
||||
return false;
|
||||
}
|
||||
|
||||
reportPhase( _( "Track widths..." ));
|
||||
reportPhase( _( "Checking track widths..." ));
|
||||
|
||||
auto checkTrackWidth =
|
||||
[&]( BOARD_ITEM* item ) -> bool
|
||||
|
@ -93,6 +95,10 @@ bool DRC_TEST_PROVIDER_TRACK_WIDTH::Run()
|
|||
actual = trk->GetWidth();
|
||||
p0 = ( trk->GetStart() + trk->GetEnd() ) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
auto constraint = m_drcEngine->EvalRulesForItems( DRC_CONSTRAINT_TYPE_TRACK_WIDTH,
|
||||
item );
|
||||
|
@ -132,7 +138,18 @@ bool DRC_TEST_PROVIDER_TRACK_WIDTH::Run()
|
|||
return true;
|
||||
};
|
||||
|
||||
forEachGeometryItem( { PCB_TRACE_T, PCB_ARC_T }, LSET::AllCuMask(), checkTrackWidth );
|
||||
int ii = 0;
|
||||
|
||||
for( TRACK* item : m_drcEngine->GetBoard()->Tracks() )
|
||||
{
|
||||
if( (ii % delta) == 0 || ii >= (int) m_drcEngine->GetBoard()->Tracks().size() - 1 )
|
||||
reportProgress( (double) ii / (double) m_drcEngine->GetBoard()->Tracks().size() );
|
||||
|
||||
ii++;
|
||||
|
||||
if( !checkTrackWidth( item ) )
|
||||
break;
|
||||
}
|
||||
|
||||
reportRuleStatistics();
|
||||
|
||||
|
|
|
@ -22,12 +22,10 @@
|
|||
*/
|
||||
|
||||
#include <class_track.h>
|
||||
#include <drc/drc_engine.h>
|
||||
#include <drc/drc_item.h>
|
||||
#include <drc/drc_rule.h>
|
||||
#include <drc/drc_test_provider.h>
|
||||
|
||||
|
||||
/*
|
||||
Via diameter test.
|
||||
|
||||
|
@ -67,13 +65,15 @@ public:
|
|||
|
||||
bool DRC_TEST_PROVIDER_VIA_DIAMETER::Run()
|
||||
{
|
||||
const int delta = 100; // This is the number of tests between 2 calls to the progress bar
|
||||
|
||||
if( !m_drcEngine->HasRulesForConstraintType( DRC_CONSTRAINT_TYPE_VIA_DIAMETER ) )
|
||||
{
|
||||
reportAux( "No diameter constraints found. Skipping check." );
|
||||
return false;
|
||||
}
|
||||
|
||||
reportPhase(( "Via diameters..." ));
|
||||
reportPhase( _( "Checking via diameters..." ) );
|
||||
|
||||
auto checkViaDiameter =
|
||||
[&]( BOARD_ITEM* item ) -> bool
|
||||
|
@ -91,7 +91,7 @@ bool DRC_TEST_PROVIDER_VIA_DIAMETER::Run()
|
|||
item );
|
||||
bool fail_min = false;
|
||||
bool fail_max = false;
|
||||
int constraintDiameter;
|
||||
int constraintDiameter = 0;
|
||||
int actual = via->GetWidth();
|
||||
|
||||
if( constraint.Value().HasMin() && actual < constraint.Value().Min() )
|
||||
|
@ -126,7 +126,18 @@ bool DRC_TEST_PROVIDER_VIA_DIAMETER::Run()
|
|||
return true;
|
||||
};
|
||||
|
||||
forEachGeometryItem( { PCB_VIA_T }, LSET::AllCuMask(), checkViaDiameter );
|
||||
int ii = 0;
|
||||
|
||||
for( TRACK* item : m_drcEngine->GetBoard()->Tracks() )
|
||||
{
|
||||
if( (ii % delta) == 0 || ii >= (int) m_drcEngine->GetBoard()->Tracks().size() - 1 )
|
||||
reportProgress( (double) ii / (double) m_drcEngine->GetBoard()->Tracks().size() );
|
||||
|
||||
ii++;
|
||||
|
||||
if( !checkViaDiameter( item ) )
|
||||
break;
|
||||
}
|
||||
|
||||
reportRuleStatistics();
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ bool test::DRC_TEST_PROVIDER_SILK_TO_PAD::Run()
|
|||
}
|
||||
|
||||
reportAux( "Worst clearance : %d nm", m_largestClearance );
|
||||
reportPhase(( "Pad to silkscreen clearances..." ));
|
||||
reportPhase( _( "Checking pad to silkscreen clearances..." ) );
|
||||
|
||||
std::vector<DRAWSEGMENT*> boardOutline;
|
||||
std::vector<BOARD_ITEM*> boardItems;
|
||||
|
|
Loading…
Reference in New Issue