diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 80c5332228..28dcb6b93a 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -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: diff --git a/pcbnew/dialogs/dialog_drc_base.cpp b/pcbnew/dialogs/dialog_drc_base.cpp index 89c3f63d9e..41e300bf75 100644 --- a/pcbnew/dialogs/dialog_drc_base.cpp +++ b/pcbnew/dialogs/dialog_drc_base.cpp @@ -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 ); diff --git a/pcbnew/dialogs/dialog_drc_base.fbp b/pcbnew/dialogs/dialog_drc_base.fbp index fcb6687f59..9b1aa579a5 100644 --- a/pcbnew/dialogs/dialog_drc_base.fbp +++ b/pcbnew/dialogs/dialog_drc_base.fbp @@ -350,9 +350,9 @@ 5 - wxEXPAND|wxRIGHT|wxLEFT + wxEXPAND 1 - + 1 1 1 @@ -363,7 +363,6 @@ - 1 0 @@ -380,15 +379,15 @@ 0 0 - ID_NOTEBOOK1 + wxID_ANY 0 0 - -1,-1 + 1 - m_Notebook + m_runningResultsBook 1 @@ -398,17 +397,337 @@ Resizable 1 - - + ; ; forward_declare 0 - OnChangingNotebookPage - - - Messages + + a page + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + running + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + bSizer14 + wxVERTICAL + none + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_runningNotebook + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + + + Tests Running... + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panelMessages + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + bSizer10 + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + -1,-1 + 1 + m_Messages + 1 + + + protected + 1 + + Resizable + 1 + + wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + + bGaugeMargins + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gauge + 1 + + + protected + 1 + + 10000 + Resizable + 1 + + wxGA_HORIZONTAL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + a page 1 1 @@ -445,7 +764,7 @@ 0 1 - m_panelMessages + results 1 @@ -461,16 +780,16 @@ wxTAB_TRAVERSAL - + - bSizer10 + bSizer13 wxVERTICAL none - + 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT + wxEXPAND|wxRIGHT|wxLEFT 1 - + 1 1 1 @@ -481,6 +800,7 @@ + 1 0 @@ -497,16 +817,15 @@ 0 0 - wxID_ANY + ID_NOTEBOOK1 0 - 0 0 -1,-1 1 - m_Messages + m_Notebook 1 @@ -516,34 +835,19 @@ Resizable 1 - wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY + 0 - - wxFILTER_NONE - wxDefaultValidator - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - - bGaugeMargins - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - + OnChangingNotebookPage + + + Violations (%d) + 0 + 1 1 1 @@ -578,308 +882,244 @@ 0 1 - m_gauge + m_panelViolations 1 protected 1 - 10000 Resizable 1 - wxGA_HORIZONTAL - ; ; forward_declare + ; 0 - - wxFILTER_NONE - wxDefaultValidator - - 0 - + wxTAB_TRAVERSAL + + -1,320 + bSizerViolationsBox + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_markerDataView + protected + + + wxDV_NO_HEADER + ; ; forward_declare + Click on items to highlight them on the board. + + + + OnDRCItemDClick + OnDRCItemRClick + OnDRCItemSelected + + + + + + + + Unconnected Items (%d) + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panelUnconnectedItems + 1 + + + private + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + bSizerUnconnectedBox + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_unconnectedDataView + protected + + + wxDV_NO_HEADER + ; ; forward_declare + + + + + OnDRCItemDClick + OnDRCItemSelected + + + + + + + + Schematic Parity (%d) + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panelFootprintWarnings + 1 + + + protected + 1 + + Resizable + 1 + + ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + bSizerFootprintsBox + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_footprintsDataView + protected + + + wxDV_NO_HEADER + ; ; forward_declare + + + + + OnDRCItemDClick + OnDRCItemSelected + + + - - - - - - - - Violations (%d) - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panelViolations - 1 - - - protected - 1 - - Resizable - 1 - - ; - 0 - - - - wxTAB_TRAVERSAL - - 580,320 - bSizerViolationsBox - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - - - 1 - 1 - - - 0 - wxID_ANY - - - m_markerDataView - protected - - - wxDV_NO_HEADER - ; ; forward_declare - Click on items to highlight them on the board. - - - - OnDRCItemDClick - OnDRCItemRClick - OnDRCItemSelected - - - - - - - - Unconnected Items (%d) - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panelUnconnectedItems - 1 - - - private - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - bSizerUnconnectedBox - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - - - 1 - 1 - - - 0 - wxID_ANY - - - m_unconnectedDataView - protected - - - wxDV_NO_HEADER - ; ; forward_declare - - - - - OnDRCItemDClick - OnDRCItemSelected - - - - - - - - Schematic Parity (%d) - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panelFootprintWarnings - 1 - - - protected - 1 - - Resizable - 1 - - ; forward_declare - 0 - - - - wxTAB_TRAVERSAL - - - bSizerFootprintsBox - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - - - 1 - 1 - - - 0 - wxID_ANY - - - m_footprintsDataView - protected - - - wxDV_NO_HEADER - ; ; forward_declare - - - - - OnDRCItemDClick - OnDRCItemSelected @@ -1038,7 +1278,7 @@ 0 protected - 25 + 35 @@ -1107,7 +1347,7 @@ - 20 + 25 wxRIGHT|wxALIGN_CENTER_VERTICAL 0 @@ -1230,7 +1470,7 @@ - 20 + 25 wxRIGHT|wxALIGN_CENTER_VERTICAL 0 @@ -1353,7 +1593,7 @@ - 20 + 25 wxRIGHT|wxALIGN_CENTER_VERTICAL 0 diff --git a/pcbnew/dialogs/dialog_drc_base.h b/pcbnew/dialogs/dialog_drc_base.h index 468d33329a..f9becdc00b 100644 --- a/pcbnew/dialogs/dialog_drc_base.h +++ b/pcbnew/dialogs/dialog_drc_base.h @@ -24,8 +24,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -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; diff --git a/pcbnew/drc/drc_test_provider_annulus.cpp b/pcbnew/drc/drc_test_provider_annulus.cpp index e5203e9bcd..eeea45cf27 100644 --- a/pcbnew/drc/drc_test_provider_annulus.cpp +++ b/pcbnew/drc/drc_test_provider_annulus.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -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 diff --git a/pcbnew/drc/drc_test_provider_connectivity.cpp b/pcbnew/drc/drc_test_provider_connectivity.cpp index 9db9d79ce1..5dd9bc7e0e 100644 --- a/pcbnew/drc/drc_test_provider_connectivity.cpp +++ b/pcbnew/drc/drc_test_provider_connectivity.cpp @@ -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 edges; diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index d3528323a1..8079d30877 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -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 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; diff --git a/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp b/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp index eef31afde6..8c5ed193d5 100644 --- a/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp @@ -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; diff --git a/pcbnew/drc/drc_test_provider_disallow.cpp b/pcbnew/drc/drc_test_provider_disallow.cpp index e6481983cc..2c6b3dba52 100644 --- a/pcbnew/drc/drc_test_provider_disallow.cpp +++ b/pcbnew/drc/drc_test_provider_disallow.cpp @@ -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 { diff --git a/pcbnew/drc/drc_test_provider_edge_clearance.cpp b/pcbnew/drc/drc_test_provider_edge_clearance.cpp index dee28089d6..c9d51843e4 100644 --- a/pcbnew/drc/drc_test_provider_edge_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_edge_clearance.cpp @@ -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 boardOutline; std::vector boardItems; diff --git a/pcbnew/drc/drc_test_provider_hole_clearance.cpp b/pcbnew/drc/drc_test_provider_hole_clearance.cpp index 714f5208d3..e212678d21 100644 --- a/pcbnew/drc/drc_test_provider_hole_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_hole_clearance.cpp @@ -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 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; diff --git a/pcbnew/drc/drc_test_provider_hole_size.cpp b/pcbnew/drc/drc_test_provider_hole_size.cpp index f8c42ed1f0..340af30578 100644 --- a/pcbnew/drc/drc_test_provider_hole_size.cpp +++ b/pcbnew/drc/drc_test_provider_hole_size.cpp @@ -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 vias; diff --git a/pcbnew/drc/drc_test_provider_lvs.cpp b/pcbnew/drc/drc_test_provider_lvs.cpp index 51dd64d941..02035e09d1 100644 --- a/pcbnew/drc/drc_test_provider_lvs.cpp +++ b/pcbnew/drc/drc_test_provider_lvs.cpp @@ -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() ); diff --git a/pcbnew/drc/drc_test_provider_misc.cpp b/pcbnew/drc/drc_test_provider_misc.cpp index c300ef6e6b..62d7eb811f 100644 --- a/pcbnew/drc/drc_test_provider_misc.cpp +++ b/pcbnew/drc/drc_test_provider_misc.cpp @@ -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; diff --git a/pcbnew/drc/drc_test_provider_track_width.cpp b/pcbnew/drc/drc_test_provider_track_width.cpp index fb2cab3e52..0272391079 100644 --- a/pcbnew/drc/drc_test_provider_track_width.cpp +++ b/pcbnew/drc/drc_test_provider_track_width.cpp @@ -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(); diff --git a/pcbnew/drc/drc_test_provider_via_diameter.cpp b/pcbnew/drc/drc_test_provider_via_diameter.cpp index 9ae8552246..a437e59a73 100644 --- a/pcbnew/drc/drc_test_provider_via_diameter.cpp +++ b/pcbnew/drc/drc_test_provider_via_diameter.cpp @@ -22,12 +22,10 @@ */ #include -#include #include #include #include - /* 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(); diff --git a/qa/drc_proto/drc_test_provider_silk_to_pad.cpp b/qa/drc_proto/drc_test_provider_silk_to_pad.cpp index 39cbd9c8ff..5d9cbd42ec 100644 --- a/qa/drc_proto/drc_test_provider_silk_to_pad.cpp +++ b/qa/drc_proto/drc_test_provider_silk_to_pad.cpp @@ -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 boardOutline; std::vector boardItems;