mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Add cross-probing between PCB (markers) and DRC marker list.
Fixes https://gitlab.com/kicad/code/kicad/issues/7246
This commit is contained in:
parent
da79a3dd69
commit
e2baacec21
@ -594,6 +594,19 @@ void RC_TREE_MODEL::NextMarker()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RC_TREE_MODEL::SelectMarker( MARKER_BASE* aMarker )
|
||||||
|
{
|
||||||
|
for( RC_TREE_NODE* candidate : m_tree )
|
||||||
|
{
|
||||||
|
if( candidate->m_RcItem->GetParent() == aMarker )
|
||||||
|
{
|
||||||
|
m_view->Select( ToItem( candidate ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void RC_TREE_MODEL::onSizeView( wxSizeEvent& aEvent )
|
void RC_TREE_MODEL::onSizeView( wxSizeEvent& aEvent )
|
||||||
{
|
{
|
||||||
int width = m_view->GetMainWindow()->GetRect().GetWidth() - WX_DATAVIEW_WINDOW_PADDING;
|
int width = m_view->GetMainWindow()->GetRect().GetWidth() - WX_DATAVIEW_WINDOW_PADDING;
|
||||||
|
@ -227,6 +227,7 @@ public:
|
|||||||
|
|
||||||
void PrevMarker();
|
void PrevMarker();
|
||||||
void NextMarker();
|
void NextMarker();
|
||||||
|
void SelectMarker( MARKER_BASE* aMarker );
|
||||||
|
|
||||||
bool IsContainer( wxDataViewItem const& aItem ) const override;
|
bool IsContainer( wxDataViewItem const& aItem ) const override;
|
||||||
|
|
||||||
|
@ -743,6 +743,16 @@ void DIALOG_DRC::NextMarker()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DIALOG_DRC::SelectMarker( PCB_MARKER* aMarker )
|
||||||
|
{
|
||||||
|
if( m_Notebook->IsShown() )
|
||||||
|
{
|
||||||
|
m_Notebook->SetSelection( 0 );
|
||||||
|
m_markersTreeModel->SelectMarker( aMarker );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_DRC::ExcludeMarker()
|
void DIALOG_DRC::ExcludeMarker()
|
||||||
{
|
{
|
||||||
if( !m_Notebook->IsShown() || m_Notebook->GetSelection() != 0 )
|
if( !m_Notebook->IsShown() || m_Notebook->GetSelection() != 0 )
|
||||||
|
@ -57,6 +57,8 @@ public:
|
|||||||
|
|
||||||
void PrevMarker();
|
void PrevMarker();
|
||||||
void NextMarker();
|
void NextMarker();
|
||||||
|
void SelectMarker( PCB_MARKER* aMarker );
|
||||||
|
|
||||||
void ExcludeMarker();
|
void ExcludeMarker();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <tools/pcb_actions.h>
|
#include <tools/pcb_actions.h>
|
||||||
#include <tools/pcb_tool_base.h>
|
#include <tools/pcb_tool_base.h>
|
||||||
#include <tools/zone_filler_tool.h>
|
#include <tools/zone_filler_tool.h>
|
||||||
|
#include <tools/pcb_selection_tool.h>
|
||||||
#include <tools/drc_tool.h>
|
#include <tools/drc_tool.h>
|
||||||
#include <kiface_base.h>
|
#include <kiface_base.h>
|
||||||
#include <dialog_drc.h>
|
#include <dialog_drc.h>
|
||||||
@ -265,6 +266,25 @@ int DRC_TOOL::NextMarker( const TOOL_EVENT& aEvent )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int DRC_TOOL::CrossProbe( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
if( m_drcDialog )
|
||||||
|
{
|
||||||
|
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
||||||
|
PCB_SELECTION& selection = selectionTool->GetSelection();
|
||||||
|
|
||||||
|
if( selection.GetSize() == 1 && selection.Front()->Type() == PCB_MARKER_T )
|
||||||
|
{
|
||||||
|
m_drcDialog->Show( true );
|
||||||
|
m_drcDialog->Raise();
|
||||||
|
m_drcDialog->SelectMarker( static_cast<PCB_MARKER*>( selection.Front() ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRC_TOOL::ExcludeMarker( const TOOL_EVENT& aEvent )
|
int DRC_TOOL::ExcludeMarker( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( m_drcDialog )
|
if( m_drcDialog )
|
||||||
@ -280,6 +300,7 @@ void DRC_TOOL::setTransitions()
|
|||||||
Go( &DRC_TOOL::PrevMarker, ACTIONS::prevMarker.MakeEvent() );
|
Go( &DRC_TOOL::PrevMarker, ACTIONS::prevMarker.MakeEvent() );
|
||||||
Go( &DRC_TOOL::NextMarker, ACTIONS::nextMarker.MakeEvent() );
|
Go( &DRC_TOOL::NextMarker, ACTIONS::nextMarker.MakeEvent() );
|
||||||
Go( &DRC_TOOL::ExcludeMarker, ACTIONS::excludeMarker.MakeEvent() );
|
Go( &DRC_TOOL::ExcludeMarker, ACTIONS::excludeMarker.MakeEvent() );
|
||||||
|
Go( &DRC_TOOL::CrossProbe, EVENTS::SelectedEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,6 +96,8 @@ public:
|
|||||||
|
|
||||||
int PrevMarker( const TOOL_EVENT& aEvent );
|
int PrevMarker( const TOOL_EVENT& aEvent );
|
||||||
int NextMarker( const TOOL_EVENT& aEvent );
|
int NextMarker( const TOOL_EVENT& aEvent );
|
||||||
|
int CrossProbe( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
int ExcludeMarker( const TOOL_EVENT& aEvent );
|
int ExcludeMarker( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user