net navigator: show all nets when none are highlighted
This commit is contained in:
parent
ec310ac3ed
commit
faca7ee05b
|
@ -240,12 +240,23 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
|
|||
{
|
||||
wxCHECK( m_netNavigator, /* void */ );
|
||||
|
||||
if( m_netNavigator->IsEmpty() && m_highlightedConn.IsEmpty() )
|
||||
return;
|
||||
|
||||
if( !m_netNavigator->IsEmpty() && m_highlightedConn.IsEmpty() )
|
||||
if( m_highlightedConn.IsEmpty() )
|
||||
{
|
||||
m_netNavigator->DeleteAllItems();
|
||||
|
||||
// Create a tree of all nets in the schematic.
|
||||
wxTreeItemId rootId = m_netNavigator->AddRoot( _( "Nets" ), 0 );
|
||||
|
||||
const NET_MAP& netMap = m_schematic->ConnectionGraph()->GetNetMap();
|
||||
|
||||
for( const auto& net : netMap )
|
||||
{
|
||||
wxTreeItemId netId = m_netNavigator->AppendItem( rootId, UnescapeString( net.first.Name ) );
|
||||
MakeNetNavigatorNode( net.first.Name, netId, aSelection );
|
||||
}
|
||||
|
||||
m_netNavigator->Expand( rootId );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -365,7 +376,9 @@ void SCH_EDIT_FRAME::onNetNavigatorSelection( wxTreeEvent& aEvent )
|
|||
NET_NAVIGATOR_ITEM_DATA* itemData =
|
||||
dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( id ) );
|
||||
|
||||
wxCHECK( itemData, /* void */ );
|
||||
// Just a net name when we have all nets displayed.
|
||||
if( !itemData )
|
||||
return;
|
||||
|
||||
if( GetCurrentSheet() != itemData->GetSheetPath() )
|
||||
{
|
||||
|
|
|
@ -1176,6 +1176,7 @@ void SCH_EDIT_FRAME::UpdateHierarchyNavigator()
|
|||
{
|
||||
m_toolManager->GetTool<SCH_NAVIGATE_TOOL>()->CleanHistory();
|
||||
m_hierarchy->UpdateHierarchyTree();
|
||||
RefreshNetNavigator();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1702,6 +1703,7 @@ void SCH_EDIT_FRAME::initScreenZoom()
|
|||
void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FLAGS aCleanupFlags )
|
||||
{
|
||||
wxString highlightedConn = GetHighlightedConnection();
|
||||
bool hasHighlightedConn = !highlightedConn.IsEmpty();
|
||||
SCHEMATIC_SETTINGS& settings = Schematic().Settings();
|
||||
SCH_SHEET_LIST list = Schematic().GetSheets();
|
||||
SCH_COMMIT localCommit( m_toolManager );
|
||||
|
@ -1739,9 +1741,17 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FL
|
|||
|
||||
SCH_CONNECTION* connection = aChangedItem->Connection();
|
||||
|
||||
if( connection
|
||||
&& ( connection->Name() == highlightedConn || connection->HasDriverChanged() ) )
|
||||
if( m_highlightedConnChanged )
|
||||
return;
|
||||
else if( !hasHighlightedConn )
|
||||
// No highlighted connection, but connectivity has changed, so refresh the list of all nets
|
||||
m_highlightedConnChanged = true;
|
||||
else if( connection
|
||||
&& ( connection->Name() == highlightedConn
|
||||
|| connection->HasDriverChanged() ) )
|
||||
{
|
||||
m_highlightedConnChanged = true;
|
||||
}
|
||||
};
|
||||
|
||||
if( !ADVANCED_CFG::GetCfg().m_IncrementalConnectivity || aCleanupFlags == GLOBAL_CLEANUP
|
||||
|
@ -1875,15 +1885,11 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FL
|
|||
return flags;
|
||||
} );
|
||||
|
||||
if( !highlightedConn.IsEmpty() )
|
||||
if( m_highlightedConnChanged
|
||||
|| !Schematic().ConnectionGraph()->FindFirstSubgraphByName( highlightedConn ) )
|
||||
{
|
||||
if( m_highlightedConnChanged
|
||||
|| !Schematic().ConnectionGraph()->FindFirstSubgraphByName( highlightedConn ) )
|
||||
{
|
||||
GetToolManager()->RunAction( EE_ACTIONS::updateNetHighlighting );
|
||||
RefreshNetNavigator();
|
||||
}
|
||||
|
||||
GetToolManager()->RunAction( EE_ACTIONS::updateNetHighlighting );
|
||||
RefreshNetNavigator();
|
||||
m_highlightedConnChanged = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -2189,6 +2189,9 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
|
|||
|
||||
if( sheetsPasted )
|
||||
m_frame->UpdateHierarchyNavigator();
|
||||
// UpdateHierarchyNavigator() will call RefreshNetNavigator()
|
||||
else
|
||||
m_frame->RefreshNetNavigator();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue