41 m_parentFrame( aParentFrame ),
81 catch(
const std::runtime_error& e )
83 wxFAIL_MSG( e.what() );
111 wxArrayString netclassNames;
114 netclassNames.push_back( settings->GetDefaultNetclass()->GetName() );
116 for(
const auto& [
name, netclass] : settings->GetNetclasses() )
117 netclassNames.push_back(
name );
196 if( !aItem->IsSelected() )
198 PCB_GROUP* group = aItem->GetParentGroup();
200 while( group && !group->IsSelected() )
201 group = group->GetParentGroup();
210 if( aItem->GetNetCode() != m_netFilter->GetSelectedNetcode() )
217 wxString filterNetclass = m_netclassFilter->GetStringSelection();
218 NETCLASS* netclass = aItem->GetEffectiveNetClass();
220 if( !netclass->ContainsNetclassWithName( filterNetclass ) )
227 if( aItem->GetLayer() != m_layerFilter->GetLayerSelection() )
234 m_outputBook->SetSelection( 1 );
249 if( m_cbRefillZones->GetValue() )
251 m_reporter->Report(
_(
"Checking zones..." ) );
253 m_parentFrame->GetToolManager()->GetTool<
ZONE_FILLER_TOOL>()->CheckAllZones(
this );
261 m_reporter->Report(
_(
"Rebuilding connectivity..." ) );
263 m_parentFrame->Compile_Ratsnest(
false );
265 cleaner.CleanupBoard( aDryRun, &m_items, m_cleanShortCircuitOpt->GetValue(),
266 m_cleanViasOpt->GetValue(),
267 m_mergeSegmOpt->GetValue(),
268 m_deleteUnconnectedOpt->GetValue(),
269 m_deleteTracksInPadsOpt->GetValue(),
270 m_deleteDanglingViasOpt->GetValue(),
273 if( m_cbRefillZones->GetValue() == wxCHK_CHECKED && !aDryRun )
275 m_reporter->Report(
_(
"Refilling all zones..." ) );
277 m_parentFrame->GetToolManager()->GetTool<
ZONE_FILLER_TOOL>()->FillAllZones(
this );
283 m_changesTreeModel->Update( std::make_shared<VECTOR_CLEANUP_ITEMS_PROVIDER>( &m_items ),
286 else if( !commit.Empty() )
289 commit.Push(
_(
"Board Cleanup" ) );
290 m_parentFrame->GetCanvas()->Refresh(
true );
293 m_outputBook->SetSelection( 0 );
294 setupOKButtonLabel();
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
std::shared_ptr< NET_SETTINGS > m_NetSettings
const wxString & GetCurrentNetClassName() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
const NETINFO_LIST & GetNetInfo() const
const std::set< int > & GetHighLightNetCodes() const
BOARD_ITEM * GetItem(const KIID &aID) const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Class DIALOG_CLEANUP_TRACKS_AND_VIAS_BASE.
wxCheckBox * m_cbRefillZones
wxChoice * m_netclassFilter
PCB_LAYER_BOX_SELECTOR * m_layerFilter
wxCheckBox * m_layerFilterOpt
wxDataViewCtrl * m_changesDataView
wxCheckBox * m_netclassFilterOpt
NET_SELECTOR * m_netFilter
wxCheckBox * m_deleteTracksInPadsOpt
wxCheckBox * m_selectedItemsFilter
wxCheckBox * m_deleteDanglingViasOpt
wxCheckBox * m_deleteUnconnectedOpt
wxCheckBox * m_cleanViasOpt
wxCheckBox * m_netFilterOpt
wxCheckBox * m_cleanShortCircuitOpt
wxCheckBox * m_mergeSegmOpt
wxStdDialogButtonSizer * m_sdbSizer
RC_TREE_MODEL * m_changesTreeModel
void OnNetclassFilterSelect(wxCommandEvent &aEvent) override
void OnSelectItem(wxDataViewEvent &event) override
void OnCheckBox(wxCommandEvent &aEvent) override
WX_TEXT_CTRL_REPORTER * m_reporter
PCB_EDIT_FRAME * m_parentFrame
~DIALOG_CLEANUP_TRACKS_AND_VIAS()
void OnLeftDClickItem(wxMouseEvent &event) override
bool TransferDataFromWindow() override
void doCleanup(bool aDryRun)
bool TransferDataToWindow() override
void setupOKButtonLabel()
DIALOG_CLEANUP_TRACKS_AND_VIAS(PCB_EDIT_FRAME *parent)
void OnNetFilterSelect(wxCommandEvent &aEvent)
void OnLayerFilterSelect(wxCommandEvent &aEvent) override
bool Show(bool show) override
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
int GetLayerSelection() const
int SetLayerSelection(int layer)
bool SetLayersHotkeys(bool value)
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
void SetNetInfo(const NETINFO_LIST *aNetInfoList)
void SetBoard(BOARD *aBoard)
void SetSelectedNetcode(int aNetcode)
static TOOL_ACTION selectionClear
Clear the current selection.
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual PCB_LAYER_ID GetActiveLayer() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void FocusOnItem(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
The main frame for Pcbnew.
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void SetNotAllowedLayerSet(LSET aMask)
void Update(std::shared_ptr< RC_ITEMS_PROVIDER > aProvider, int aSeverities)
static KIID ToUUID(wxDataViewItem aItem)
void SetFilter(const std::function< bool(BOARD_CONNECTED_ITEM *aItem)> &aFilter)
A wrapper for reporting to a wxTextCtrl object.
Class to handle a set of BOARD_ITEMs.
bool cleanup_tracks_in_pad
bool delete_dangling_vias
bool cleanup_refill_zones
bool cleanup_short_circuits