Do not update schematic editor net navigator when it's not shown.

Since the addition of all nets to the net navigator, performance on very
complex designs is unacceptable.  Not updating the net navigator is a
cheap and dirty short term fix.  Users with complex designs will not be
able to use the net navigator.  A better fix to resolve the performance
issues needs to be implemented.
This commit is contained in:
Wayne Stambaugh 2024-06-05 11:46:19 -04:00
parent 9fb07d886e
commit 82b310f666
2 changed files with 31 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2023 Rivos * Copyright (C) 2023 Rivos
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
* *
* @author Wayne Stambaugh <stambaughw@gmail.com> * @author Wayne Stambaugh <stambaughw@gmail.com>
* *
@ -263,6 +263,9 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
{ {
wxCHECK( m_netNavigator, /* void */ ); wxCHECK( m_netNavigator, /* void */ );
if( !m_netNavigator->IsShown() )
return;
size_t nodeCnt = 0; size_t nodeCnt = 0;
m_netNavigator->Freeze(); m_netNavigator->Freeze();
@ -457,6 +460,8 @@ void SCH_EDIT_FRAME::onNetNavigatorSelection( wxTreeEvent& aEvent )
void SCH_EDIT_FRAME::onNetNavigatorSelChanging( wxTreeEvent& aEvent ) void SCH_EDIT_FRAME::onNetNavigatorSelChanging( wxTreeEvent& aEvent )
{ {
wxCHECK( m_netNavigator, /* void */ ); wxCHECK( m_netNavigator, /* void */ );
aEvent.Skip();
} }
@ -489,6 +494,15 @@ void SCH_EDIT_FRAME::ToggleNetNavigator()
} }
else else
{ {
NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
wxTreeItemId selection = m_netNavigator->GetSelection();
if( selection.IsOk() )
itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( selection ) );
RefreshNetNavigator( itemData );
if( netNavigatorPane.IsFloating() ) if( netNavigatorPane.IsFloating() )
{ {
cfg->m_AuiPanels.net_nav_panel_float_size = netNavigatorPane.floating_size; cfg->m_AuiPanels.net_nav_panel_float_size = netNavigatorPane.floating_size;

View File

@ -117,11 +117,11 @@ public:
if( cnt < 1e3 ) if( cnt < 1e3 )
aStream << cnt << "ns"; aStream << cnt << "ns";
else if( cnt < 1e6 ) else if( cnt < 1e6 )
aStream << cnt / 1e3 << "µs"; aStream << ( cnt / 1e3 ) << "µs";
else if( cnt < 1e9 ) else if( cnt < 1e9 )
aStream << cnt / 1e6 << "ms"; aStream << ( cnt / 1e6 ) << "ms";
else else
aStream << cnt / 1e9 << "s"; aStream << ( cnt / 1e9 ) << "s";
aStream << std::endl; aStream << std::endl;
} }
@ -154,6 +154,10 @@ public:
std::string to_string() std::string to_string()
{ {
using DURATION = std::chrono::duration<double, std::nano>;
const auto duration = SinceStart<DURATION>();
const double cnt = duration.count();
std::string retv; std::string retv;
if( !m_name.empty() ) if( !m_name.empty() )
@ -161,9 +165,16 @@ public:
std::stringstream time; std::stringstream time;
Show( time ); if( cnt < 1e3 )
time << cnt << "ns";
else if( cnt < 1e6 )
time << ( cnt / 1e3 ) << "µs";
else if( cnt < 1e9 )
time << ( cnt / 1e6 ) << "ms";
else
time << ( cnt / 1e9 ) << "s";
retv += time.get(); retv += time.str();
return retv; return retv;
} }