Highlight net tool in GAL now cross-probes to EEschema if clicked on a pad
Fixes: lp:1663767 * https://bugs.launchpad.net/kicad/+bug/1663767
This commit is contained in:
parent
e67882f0a3
commit
4a911e0790
|
@ -991,9 +991,9 @@ int PCB_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent )
|
||||||
*/
|
*/
|
||||||
static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
|
static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
|
||||||
{
|
{
|
||||||
KIGFX::RENDER_SETTINGS* render = aToolMgr->GetView()->GetPainter()->GetSettings();
|
auto render = aToolMgr->GetView()->GetPainter()->GetSettings();
|
||||||
GENERAL_COLLECTORS_GUIDE guide =
|
auto frame = static_cast<PCB_EDIT_FRAME*>( aToolMgr->GetEditFrame() );
|
||||||
static_cast<PCB_BASE_FRAME*>( aToolMgr->GetEditFrame() )->GetCollectorsGuide();
|
auto guide = frame->GetCollectorsGuide();
|
||||||
BOARD* board = static_cast<BOARD*>( aToolMgr->GetModel() );
|
BOARD* board = static_cast<BOARD*>( aToolMgr->GetModel() );
|
||||||
GENERAL_COLLECTOR collector;
|
GENERAL_COLLECTOR collector;
|
||||||
int net = -1;
|
int net = -1;
|
||||||
|
@ -1001,6 +1001,16 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
|
||||||
// Find a connected item for which we are going to highlight a net
|
// Find a connected item for which we are going to highlight a net
|
||||||
collector.Collect( board, GENERAL_COLLECTOR::PadsTracksOrZones,
|
collector.Collect( board, GENERAL_COLLECTOR::PadsTracksOrZones,
|
||||||
wxPoint( aPosition.x, aPosition.y ), guide );
|
wxPoint( aPosition.x, aPosition.y ), guide );
|
||||||
|
|
||||||
|
for( unsigned int i = 0; i < collector.GetCount(); i++ )
|
||||||
|
{
|
||||||
|
if( collector[i]->Type() == PCB_PAD_T )
|
||||||
|
{
|
||||||
|
frame->SendMessageToEESCHEMA( static_cast<BOARD_CONNECTED_ITEM*>( collector[i] ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool enableHighlight = ( collector.GetCount() > 0 );
|
bool enableHighlight = ( collector.GetCount() > 0 );
|
||||||
|
|
||||||
// Obtain net code for the clicked item
|
// Obtain net code for the clicked item
|
||||||
|
|
Loading…
Reference in New Issue