From cfdf818878b53c6310a200fd9cd1f9bd00e142a2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 31 Aug 2020 16:50:24 +0100 Subject: [PATCH] Remove long-dead vestiges of DRC checks on Edit Tracks and Vias. --- .../dialog_global_edit_tracks_and_vias.cpp | 22 +++++-------------- pcbnew/edit_track_width.cpp | 12 +++------- pcbnew/pcb_edit_frame.h | 15 +------------ 3 files changed, 9 insertions(+), 40 deletions(-) diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp index cd2c74bf3d..64827fa2a5 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp @@ -67,7 +67,6 @@ private: PCB_EDIT_FRAME* m_parent; BOARD* m_brd; int* m_originalColWidths; - bool m_failedDRC; public: DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( PCB_EDIT_FRAME* aParent ); @@ -113,8 +112,6 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( PCB_EDIT for( int i = 0; i < m_netclassGrid->GetNumberCols(); ++i ) m_originalColWidths[ i ] = m_netclassGrid->GetColSize( i ); - m_failedDRC = false; - buildFilterLists(); m_parent->UpdateTrackWidthSelectBox( m_trackWidthSelectBox, false ); @@ -263,12 +260,6 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnUpdateUI( wxUpdateUIEvent& ) { m_trackWidthSelectBox->Enable( m_setToSpecifiedValues->GetValue() ); m_viaSizesSelectBox->Enable( m_setToSpecifiedValues->GetValue() ); - - if( m_failedDRC ) - { - m_failedDRC = false; - DisplayError( this, _( "Some items failed DRC and were not modified." ) ); - } } @@ -285,8 +276,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem( PICKED_ITEMS_LIST* aUndoLi unsigned int prevTrackWidthIndex = brdSettings.GetTrackWidthIndex(); brdSettings.SetTrackWidthIndex( (unsigned) m_trackWidthSelectBox->GetSelection() ); - if( m_parent->SetTrackSegmentWidth( aItem, aUndoList, false ) == TRACK_ACTION_DRC_ERROR ) - m_failedDRC = true; + m_parent->SetTrackSegmentWidth( aItem, aUndoList, false ); brdSettings.SetTrackWidthIndex( prevTrackWidthIndex ); } @@ -295,8 +285,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem( PICKED_ITEMS_LIST* aUndoLi unsigned int prevViaSizeIndex = brdSettings.GetViaSizeIndex(); brdSettings.SetViaSizeIndex( (unsigned) m_viaSizesSelectBox->GetSelection() ); - if( m_parent->SetTrackSegmentWidth( aItem, aUndoList, false ) == TRACK_ACTION_DRC_ERROR ) - m_failedDRC = true; + m_parent->SetTrackSegmentWidth( aItem, aUndoList, false ); brdSettings.SetViaSizeIndex( prevViaSizeIndex ); } @@ -316,8 +305,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem( PICKED_ITEMS_LIST* aUndoLi } else { - if( m_parent->SetTrackSegmentWidth( aItem, aUndoList, true ) == TRACK_ACTION_DRC_ERROR ) - m_failedDRC = true; + m_parent->SetTrackSegmentWidth( aItem, aUndoList, true ); } m_brd->OnItemChanged( aItem ); @@ -351,7 +339,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem( PICKED_ITEMS_LIST* aUndoList bool DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow() { PICKED_ITEMS_LIST itemsListPicker; - wxBusyCursor dummy; + wxBusyCursor dummy; // Examine segments for( auto segment : m_brd->Tracks() ) @@ -370,7 +358,7 @@ bool DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow() m_parent->GetCanvas()->GetView()->Update( segment ); } - return !m_failedDRC; + return true; } diff --git a/pcbnew/edit_track_width.cpp b/pcbnew/edit_track_width.cpp index fcbf7c7e39..817cdbe5ee 100644 --- a/pcbnew/edit_track_width.cpp +++ b/pcbnew/edit_track_width.cpp @@ -30,9 +30,9 @@ #include -int PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem, - PICKED_ITEMS_LIST* aItemsListPicker, - bool aUseNetclassValue ) +void PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem, + PICKED_ITEMS_LIST* aItemsListPicker, + bool aUseNetclassValue ) { int initial_width; int new_width; @@ -119,12 +119,6 @@ int PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem, via->SetDrillDefault(); } } - - return TRACK_ACTION_SUCCESS; - } - else - { - return TRACK_ACTION_NONE; } } diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index 6d74828aa4..a0e8878e41 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -67,16 +67,6 @@ enum LAST_PATH_TYPE : unsigned int; namespace PCB { struct IFACE; } // KIFACE_I is in pcbnew.cpp -/** - * Enum to signify the result of editing tracks and vias - */ -enum TRACK_ACTION_RESULT -{ - TRACK_ACTION_DRC_ERROR = -1,//!< TRACK_ACTION_DRC_ERROR - Track not changed to to DRC - TRACK_ACTION_SUCCESS, //!< TRACK_ACTION_SUCCESS - Track changed successfully - TRACK_ACTION_NONE //!< TRACK_ACTION_NONE - Nothing to change -}; - /** * PCB_EDIT_FRAME * is the main frame for Pcbnew. @@ -810,11 +800,8 @@ public: * (can be NULL) * @param aUseNetclassValue = true to use NetClass value, false to use * current designSettings value - * @return 0 if items successfully changed, - * -1 if there was a DRC error, - * 1 if items were changed successfully */ - int SetTrackSegmentWidth( TRACK* aTrackItem, + void SetTrackSegmentWidth( TRACK* aTrackItem, PICKED_ITEMS_LIST* aItemsListPicker, bool aUseNetclassValue );