diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index 89edb9c972..77aa2643fe 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -1059,32 +1059,35 @@ std::vector EDA_DRAW_FRAME::findDialogs() } -void EDA_DRAW_FRAME::FocusOnLocation( const VECTOR2I& aPos ) +void EDA_DRAW_FRAME::FocusOnLocation( const VECTOR2I& aPos, bool aAllowScroll ) { - bool centerView = false; - BOX2D r = GetCanvas()->GetView()->GetViewport(); - - // Center if we're off the current view, or within 10% of its edge - r.Inflate( - r.GetWidth() / 10.0 ); - - if( !r.Contains( aPos ) ) - centerView = true; - + bool centerView = false; std::vector dialogScreenRects; - for( wxWindow* dialog : findDialogs() ) + if( aAllowScroll ) { - dialogScreenRects.emplace_back( ToVECTOR2D( GetCanvas()->ScreenToClient( dialog->GetScreenPosition() ) ), - ToVECTOR2D( dialog->GetSize() ) ); - } + BOX2D r = GetCanvas()->GetView()->GetViewport(); - // Center if we're behind an obscuring dialog, or within 10% of its edge - for( BOX2D rect : dialogScreenRects ) - { - rect.Inflate( rect.GetWidth() / 10 ); + // Center if we're off the current view, or within 10% of its edge + r.Inflate( - r.GetWidth() / 10.0 ); - if( rect.Contains( GetCanvas()->GetView()->ToScreen( aPos ) ) ) + if( !r.Contains( aPos ) ) centerView = true; + + for( wxWindow* dialog : findDialogs() ) + { + dialogScreenRects.emplace_back( ToVECTOR2D( GetCanvas()->ScreenToClient( dialog->GetScreenPosition() ) ), + ToVECTOR2D( dialog->GetSize() ) ); + } + + // Center if we're behind an obscuring dialog, or within 10% of its edge + for( BOX2D rect : dialogScreenRects ) + { + rect.Inflate( rect.GetWidth() / 10 ); + + if( rect.Contains( GetCanvas()->GetView()->ToScreen( aPos ) ) ) + centerView = true; + } } if( centerView ) diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 89f082a78d..8590ff59d8 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -921,16 +921,28 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnMenu( wxCommandEvent& event ) // Build a pop menu: wxMenu menu; - menu.Append( 4204, _( "Include 'DNP' Symbols" ), wxEmptyString, wxITEM_CHECK ); - menu.Append( 4205, _( "Include 'Exclude from BOM' Symbols" ), wxEmptyString, wxITEM_CHECK ); - menu.AppendSeparator(); - menu.Append( 4206, _( "Highlight on Cross Probe" ), wxEmptyString, wxITEM_CHECK ); - menu.Append( 4207, _( "Select on Cross Probe" ), wxEmptyString, wxITEM_CHECK ); - + menu.Append( 4204, _( "Include 'DNP' Symbols" ), + _( "Show symbols marked 'DNP' in the table. This setting also controls whether or not 'DNP' " + "symbols are included on export." ), + wxITEM_CHECK ); menu.Check( 4204, !m_dataModel->GetExcludeDNP() ); + + menu.Append( 4205, _( "Include 'Exclude from BOM' Symbols" ), + _( "Show symbols marked 'Exclude from BOM' in the table. Symbols marked 'Exclude from BOM' " + "are never included on export." ), + wxITEM_CHECK ); menu.Check( 4205, m_dataModel->GetIncludeExcludedFromBOM() ); + menu.AppendSeparator(); + + menu.Append( 4206, _( "Highlight on Cross-probe" ), + _( "Highlight corresponding item on canvas when it is selected in the table" ), + wxITEM_CHECK ); menu.Check( 4206, cfg.selection_mode == 0 ); + + menu.Append( 4207, _( "Select on Cross-probe" ), + _( "Select corresponding item on canvas when it is selected in the table" ), + wxITEM_CHECK ); menu.Check( 4207, cfg.selection_mode == 1 ); // menu_id is the selected submenu id from the popup menu or wxID_NONE diff --git a/include/eda_draw_frame.h b/include/eda_draw_frame.h index c40ba8cef7..d797a2777c 100644 --- a/include/eda_draw_frame.h +++ b/include/eda_draw_frame.h @@ -306,7 +306,7 @@ public: * * @param aPos is the point to go to. */ - void FocusOnLocation( const VECTOR2I& aPos ); + void FocusOnLocation( const VECTOR2I& aPos, bool aAllowScroll = true ); /** * Focus on a particular canvas item. diff --git a/include/pcb_base_frame.h b/include/pcb_base_frame.h index a21833ef8e..53e65c4a5c 100644 --- a/include/pcb_base_frame.h +++ b/include/pcb_base_frame.h @@ -221,8 +221,9 @@ public: EDA_ITEM* ResolveItem( const KIID& aId, bool aAllowNullptrReturn = false ) const override; void FocusOnItem( EDA_ITEM* aItem ) override; - void FocusOnItem( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer = UNDEFINED_LAYER ); - void FocusOnItems( std::vector aItems, PCB_LAYER_ID aLayer = UNDEFINED_LAYER ); + void FocusOnItem( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer = UNDEFINED_LAYER, bool aAllowScroll = true ); + void FocusOnItems( std::vector aItems, PCB_LAYER_ID aLayer = UNDEFINED_LAYER, + bool aAllowScroll = true ); void HideSolderMask(); void ShowSolderMask(); diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index e0297edcd1..3f6e708c7e 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -46,8 +46,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -74,6 +76,9 @@ DIALOG_DRC::DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent ) : m_running( false ), m_drcRun( false ), m_footprintTestsRun( false ), + m_report_all_track_errors( false ), + m_crossprobe( true ), + m_scroll_on_crossprobe( true ), m_markersTreeModel( nullptr ), m_unconnectedTreeModel( nullptr ), m_fpWarningsTreeModel( nullptr ), @@ -85,6 +90,15 @@ DIALOG_DRC::DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent ) : m_frame = aEditorFrame; m_currentBoard = m_frame->GetBoard(); + m_bMenu->SetBitmap( KiBitmapBundle( BITMAPS::config ) ); + + if( PCBNEW_SETTINGS* cfg = m_frame->GetPcbNewSettings() ) + { + m_report_all_track_errors = cfg->m_DRCDialog.report_all_track_errors; + m_crossprobe = cfg->m_DRCDialog.crossprobe; + m_scroll_on_crossprobe = cfg->m_DRCDialog.scroll_on_crossprobe; + } + m_messages->SetImmediateMode(); m_markersProvider = std::make_shared( m_currentBoard, @@ -147,6 +161,13 @@ DIALOG_DRC::DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent ) : DIALOG_DRC::~DIALOG_DRC() { + if( PCBNEW_SETTINGS* cfg = m_frame->GetPcbNewSettings() ) + { + cfg->m_DRCDialog.report_all_track_errors = m_report_all_track_errors; + cfg->m_DRCDialog.crossprobe = m_crossprobe; + cfg->m_DRCDialog.scroll_on_crossprobe = m_scroll_on_crossprobe; + } + m_frame->ClearFocus(); g_lastDRCBoard = m_currentBoard; @@ -240,6 +261,46 @@ int DIALOG_DRC::getSeverities() } +void DIALOG_DRC::OnMenu( wxCommandEvent& event ) +{ + // Build a pop menu: + wxMenu menu; + + menu.Append( 4205, _( "Report All Errors for Each Track" ), + _( "If unchecked, only the first error will be reported for each track" ), + wxITEM_CHECK ); + menu.Check( 4205, m_report_all_track_errors ); + + menu.AppendSeparator(); + + menu.Append( 4206, _( "Cross-probe Selected Items" ), + _( "Highlight corresponding items on canvas when selected in the DRC list" ), + wxITEM_CHECK ); + menu.Check( 4206, m_crossprobe ); + + menu.Append( 4207, _( "Center on Cross-probe" ), + _( "When cross-probing, scroll the canvas so that the item is visible" ), + wxITEM_CHECK ); + menu.Check( 4207, m_scroll_on_crossprobe ); + + // menu_id is the selected submenu id from the popup menu or wxID_NONE + int menu_id = m_bMenu->GetPopupMenuSelectionFromUser( menu ); + + if( menu_id == 0 || menu_id == 4205 ) + { + m_report_all_track_errors = !m_report_all_track_errors; + } + else if( menu_id == 2 || menu_id == 4206 ) + { + m_crossprobe = !m_crossprobe; + } + else if( menu_id == 3 || menu_id == 4207 ) + { + m_scroll_on_crossprobe = !m_scroll_on_crossprobe; + } +} + + void DIALOG_DRC::OnErrorLinkClicked( wxHtmlLinkEvent& event ) { m_frame->ShowBoardSetupDialog( _( "Custom Rules" ) ); @@ -252,7 +313,6 @@ void DIALOG_DRC::OnRunDRCClick( wxCommandEvent& aEvent ) DRC_TOOL* drcTool = toolMgr->GetTool(); ZONE_FILLER_TOOL* zoneFillerTool = toolMgr->GetTool(); bool refillZones = m_cbRefillZones->GetValue(); - bool reportAllTrackErrors = m_cbReportAllTrackErrors->GetValue(); bool testFootprints = m_cbTestFootprints->GetValue(); if( zoneFillerTool->IsBusy() ) @@ -326,7 +386,7 @@ void DIALOG_DRC::OnRunDRCClick( wxCommandEvent& aEvent ) { wxBusyCursor dummy; - drcTool->RunTests( this, refillZones, reportAllTrackErrors, testFootprints ); + drcTool->RunTests( this, refillZones, m_report_all_track_errors, testFootprints ); } if( m_cancelled ) @@ -378,6 +438,12 @@ void DIALOG_DRC::UpdateData() void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) { + if( !m_crossprobe ) + { + aEvent.Skip(); + return; + } + BOARD* board = m_frame->GetBoard(); RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() ); @@ -408,11 +474,8 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) { VECTOR2D selectedItemPos = aSelectedMarkerItem->GetPosition() / PCB_IU_PER_MM; VECTOR2D unSelectedItemPos = aUnSelectedMarkerItem->GetPosition() / PCB_IU_PER_MM; - - double dist = selectedItemPos.Distance( unSelectedItemPos ); - - double minimumMarkerSeparationDistance = - ADVANCED_CFG::GetCfg().m_MinimumMarkerSeparationDistance; + double dist = selectedItemPos.Distance( unSelectedItemPos ); + double minimumMarkerSeparationDistance = ADVANCED_CFG::GetCfg().m_MinimumMarkerSeparationDistance; return dist <= minimumMarkerSeparationDistance; }; @@ -430,7 +493,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) if( rc_item->GetErrorCode() == DRCE_UNRESOLVED_VARIABLE && rc_item->GetParent()->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET ) { - m_frame->FocusOnLocation( node->m_RcItem->GetParent()->GetPos() ); + m_frame->FocusOnLocation( node->m_RcItem->GetParent()->GetPos(), m_scroll_on_crossprobe ); aEvent.Skip(); return; @@ -512,7 +575,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) if( item->Type() == PCB_ZONE_T ) { - m_frame->FocusOnItem( item, principalLayer ); + m_frame->FocusOnItem( item, principalLayer, m_scroll_on_crossprobe ); m_frame->GetBoard()->GetConnectivity()->RunOnUnconnectedEdges( [&]( CN_EDGE& edge ) @@ -541,7 +604,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) : edge.GetTargetPos(); } - m_frame->FocusOnLocation( focusPos ); + m_frame->FocusOnLocation( focusPos, m_scroll_on_crossprobe ); m_frame->RefreshCanvas(); return false; @@ -552,7 +615,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) } else { - m_frame->FocusOnItem( item, principalLayer ); + m_frame->FocusOnItem( item, principalLayer, m_scroll_on_crossprobe ); } } else if( rc_item->GetErrorCode() == DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG ) @@ -579,7 +642,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) items.push_back( item ); } - m_frame->FocusOnItems( items, principalLayer ); + m_frame->FocusOnItems( items, principalLayer, m_scroll_on_crossprobe ); } else { @@ -594,11 +657,11 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) } items.push_back( item ); - m_frame->FocusOnItems( items, principalLayer ); + m_frame->FocusOnItems( items, principalLayer, m_scroll_on_crossprobe ); } else { - m_frame->FocusOnItem( item, principalLayer ); + m_frame->FocusOnItem( item, principalLayer, m_scroll_on_crossprobe ); } } diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index 3477d1dfce..eef114da39 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -77,6 +77,7 @@ private: bool TransferDataToWindow() override; + void OnMenu( wxCommandEvent& aEvent ) override; void OnDRCItemSelected( wxDataViewEvent& aEvent ) override; void OnDRCItemDClick( wxDataViewEvent& aEvent ) override; void OnDRCItemRClick( wxDataViewEvent& aEvent ) override; @@ -117,6 +118,10 @@ private: bool m_drcRun; bool m_footprintTestsRun; + bool m_report_all_track_errors; + bool m_crossprobe; + bool m_scroll_on_crossprobe; + wxString m_markersTitleTemplate; wxString m_unconnectedTitleTemplate; wxString m_footprintsTitleTemplate; diff --git a/pcbnew/dialogs/dialog_drc_base.cpp b/pcbnew/dialogs/dialog_drc_base.cpp index 4194c88d50..ba19776bc6 100644 --- a/pcbnew/dialogs/dialog_drc_base.cpp +++ b/pcbnew/dialogs/dialog_drc_base.cpp @@ -5,6 +5,7 @@ // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// +#include "widgets/std_bitmap_button.h" #include "widgets/wx_html_report_box.h" #include "dialog_drc_base.h" @@ -24,30 +25,43 @@ DIALOG_DRC_BASE::DIALOG_DRC_BASE( wxWindow* parent, wxWindowID id, const wxStrin wxBoxSizer* bSizer12; bSizer12 = new wxBoxSizer( wxVERTICAL ); - m_cbRefillZones = new wxCheckBox( this, wxID_ANY, _("Refill all zones before performing DRC"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbRefillZones->SetValue(true); - bSizer12->Add( m_cbRefillZones, 0, wxALL, 5 ); - - m_cbReportAllTrackErrors = new wxCheckBox( this, wxID_ANY, _("Report all errors for each track"), 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.") ); - - bSizer12->Add( m_cbReportAllTrackErrors, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - bSizerOptions->Add( bSizer12, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizerOptSettings; bSizerOptSettings = new wxBoxSizer( wxVERTICAL ); - m_cbTestFootprints = new wxCheckBox( this, wxID_ANY, _("Test for parity between PCB and schematic"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerOptSettings->Add( m_cbTestFootprints, 0, wxALL, 5 ); - bSizerOptions->Add( bSizerOptSettings, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); m_MainSizer->Add( bSizerOptions, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 3 ); + wxGridBagSizer* gbSizerOptions; + gbSizerOptions = new wxGridBagSizer( 0, 0 ); + gbSizerOptions->SetFlexibleDirection( wxBOTH ); + gbSizerOptions->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_cbRefillZones = new wxCheckBox( this, wxID_ANY, _("Refill all zones before performing DRC"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbRefillZones->SetValue(true); + gbSizerOptions->Add( m_cbRefillZones, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_cbTestFootprints = new wxCheckBox( this, wxID_ANY, _("Test for parity between PCB and schematic"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizerOptions->Add( m_cbTestFootprints, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_bMenu = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + m_bMenu->SetMinSize( wxSize( 30,30 ) ); + + gbSizerOptions->Add( m_bMenu, wxGBPosition( 0, 2 ), wxGBSpan( 2, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + + + gbSizerOptions->AddGrowableCol( 0 ); + gbSizerOptions->AddGrowableCol( 1 ); + gbSizerOptions->AddGrowableRow( 0 ); + gbSizerOptions->AddGrowableRow( 1 ); + + m_MainSizer->Add( gbSizerOptions, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); + m_runningResultsBook = new wxSimplebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); running = new wxPanel( m_runningResultsBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer14; @@ -242,6 +256,7 @@ DIALOG_DRC_BASE::DIALOG_DRC_BASE( wxWindow* parent, wxWindowID id, const wxStrin // Connect Events this->Connect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_DRC_BASE::OnActivateDlg ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_DRC_BASE::OnClose ) ); + m_bMenu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_BASE::OnMenu ), NULL, this ); m_messages->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DRC_BASE::OnErrorLinkClicked ), NULL, this ); m_Notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_DRC_BASE::OnChangingNotebookPage ), NULL, this ); m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_DRC_BASE::OnDRCItemDClick ), NULL, this ); @@ -271,6 +286,7 @@ DIALOG_DRC_BASE::~DIALOG_DRC_BASE() // Disconnect Events this->Disconnect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_DRC_BASE::OnActivateDlg ) ); this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_DRC_BASE::OnClose ) ); + m_bMenu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_BASE::OnMenu ), NULL, this ); m_messages->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DRC_BASE::OnErrorLinkClicked ), NULL, this ); m_Notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_DRC_BASE::OnChangingNotebookPage ), NULL, this ); m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_DRC_BASE::OnDRCItemDClick ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_drc_base.fbp b/pcbnew/dialogs/dialog_drc_base.fbp index 8ca062b6d6..e7cde1d88a 100644 --- a/pcbnew/dialogs/dialog_drc_base.fbp +++ b/pcbnew/dialogs/dialog_drc_base.fbp @@ -84,136 +84,6 @@ bSizer12 wxVERTICAL none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Refill all zones before performing DRC - - 0 - - - 0 - - 1 - m_cbRefillZones - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Report all errors for each track - - 0 - - - 0 - - 1 - m_cbReportAllTrackErrors - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - If selected, all DRC violations for tracks will be reported. This can be slow for complicated designs. If unselected, only the first DRC violation will be reported for each track connection. - - wxFILTER_NONE - wxDefaultValidator - - - - - - @@ -225,71 +95,237 @@ bSizerOptSettings wxVERTICAL none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Test for parity between PCB and schematic - - 0 - - - 0 - - 1 - m_cbTestFootprints - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - + + + + + + 10 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + + wxBOTH + 0,1 + 0,1 + 0 + + gbSizerOptions + wxFLEX_GROWMODE_SPECIFIED + none + 0 + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Refill all zones before performing DRC + + 0 + + + 0 + + 1 + m_cbRefillZones + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 1 + 1 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Test for parity between PCB and schematic + + 0 + + + 0 + + 1 + m_cbTestFootprints + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL + 0 + 2 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Refresh Grouping + + 0 + + 0 + + + 0 + 30,30 + 1 + m_bMenu + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnMenu diff --git a/pcbnew/dialogs/dialog_drc_base.h b/pcbnew/dialogs/dialog_drc_base.h index 041ec73b24..f2a883085e 100644 --- a/pcbnew/dialogs/dialog_drc_base.h +++ b/pcbnew/dialogs/dialog_drc_base.h @@ -10,22 +10,26 @@ #include #include #include +class STD_BITMAP_BUTTON; class WX_HTML_REPORT_BOX; #include "dialog_shim.h" +#include +#include #include #include -#include #include #include #include -#include -#include -#include -#include +#include #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -33,7 +37,6 @@ class WX_HTML_REPORT_BOX; #include #include #include -#include #include /////////////////////////////////////////////////////////////////////////// @@ -48,8 +51,8 @@ class DIALOG_DRC_BASE : public DIALOG_SHIM protected: wxCheckBox* m_cbRefillZones; - wxCheckBox* m_cbReportAllTrackErrors; wxCheckBox* m_cbTestFootprints; + STD_BITMAP_BUTTON* m_bMenu; wxSimplebook* m_runningResultsBook; wxPanel* running; wxNotebook* m_runningNotebook; @@ -85,6 +88,7 @@ class DIALOG_DRC_BASE : public DIALOG_SHIM // Virtual event handlers, override them in your derived class virtual void OnActivateDlg( wxActivateEvent& event ) { event.Skip(); } virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnMenu( wxCommandEvent& event ) { event.Skip(); } virtual void OnErrorLinkClicked( wxHtmlLinkEvent& event ) { event.Skip(); } virtual void OnChangingNotebookPage( wxNotebookEvent& event ) { event.Skip(); } virtual void OnDRCItemDClick( wxDataViewEvent& event ) { event.Skip(); } diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index cd3a9329d0..39d69e861f 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -262,18 +262,18 @@ void PCB_BASE_FRAME::FocusOnItem( EDA_ITEM* aItem ) FocusOnItem( static_cast( aItem ), UNDEFINED_LAYER ); } -void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer ) +void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, bool aAllowScroll ) { std::vector items; if( aItem ) items.push_back( aItem ); - FocusOnItems( items, aLayer ); + FocusOnItems( items, aLayer, aAllowScroll ); } -void PCB_BASE_FRAME::FocusOnItems( std::vector aItems, PCB_LAYER_ID aLayer ) +void PCB_BASE_FRAME::FocusOnItems( std::vector aItems, PCB_LAYER_ID aLayer, bool aAllowScroll ) { static std::vector lastBrightenedItemIDs; @@ -361,7 +361,7 @@ void PCB_BASE_FRAME::FocusOnItems( std::vector aItems, PCB_LAYER_ID case PCB_PAD_T: case PCB_MARKER_T: case PCB_VIA_T: - FocusOnLocation( item->GetFocusPosition() ); + FocusOnLocation( item->GetFocusPosition(), aAllowScroll ); GetCanvas()->Refresh(); return; @@ -449,7 +449,7 @@ void PCB_BASE_FRAME::FocusOnItems( std::vector aItems, PCB_LAYER_ID } } - FocusOnLocation( focusPt ); + FocusOnLocation( focusPt, aAllowScroll ); GetCanvas()->Refresh(); } diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 92c54fb44b..69da14f92b 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -349,6 +349,15 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "system.last_footprint3d_dir", &m_LastFootprint3dDir, "" ) ); + m_params.emplace_back( new PARAM( "DRC.report_all_track_errors", + &m_DRCDialog.report_all_track_errors, false ) ); + + m_params.emplace_back( new PARAM( "DRC.crossprobe", + &m_DRCDialog.crossprobe, true ) ); + + m_params.emplace_back( new PARAM( "DRC.scroll_on_crossprobe", + &m_DRCDialog.scroll_on_crossprobe, true ) ); + registerMigration( 0, 1, [&]() { diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 135a47e91e..6ab7e533b2 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -168,6 +168,13 @@ public: bool doNotExportUnconnectedPads; }; + struct DIALOG_DRC + { + bool report_all_track_errors; + bool crossprobe; + bool scroll_on_crossprobe; + }; + struct FOOTPRINT_CHOOSER { // Footprint chooser is a FRAME, so there's no DIALOG_SHIM to save/restore control state @@ -227,6 +234,7 @@ public: AUI_PANELS m_AuiPanels; DIALOG_EXPORT_D356 m_ExportD356; + DIALOG_DRC m_DRCDialog; FOOTPRINT_CHOOSER m_FootprintChooser; ZONES m_Zones;