From e6dbca051c330586b738bd27fec72760c1cf4d51 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 20 Jan 2023 15:17:57 -0800 Subject: [PATCH] Force realtime connectivity on The pressure relief valve was not useful for common work patterns as it forced the recalculation on many common actions such as bus expansion. This caused it to actually feel slower than with the pressure relief valve off. For most schematics, realtime is now fast enough to not need the valve and for those that are extremely complex, removing the valve helps this run more predictably --- common/advanced_config.cpp | 11 ----------- eeschema/connection_graph.cpp | 14 -------------- eeschema/connection_graph.h | 3 --- eeschema/cross-probing.cpp | 5 ----- .../dialog_global_edit_text_and_graphics.cpp | 4 ---- eeschema/files-io.cpp | 1 - .../netlist_exporters/netlist_generator.cpp | 3 --- eeschema/sch_connection.cpp | 3 --- eeschema/sch_edit_frame.cpp | 5 +---- eeschema/tools/sch_editor_control.cpp | 17 +---------------- eeschema/tools/sch_line_wire_bus_tool.cpp | 13 +++---------- include/advanced_config.h | 5 ----- 12 files changed, 5 insertions(+), 79 deletions(-) diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index 3dea95840c..0ffac5c418 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -89,13 +89,6 @@ static const wxChar DRCSliverAngleTolerance[] = wxT( "DRCSliverAngleTolerance" ) */ static const wxChar HoleWallThickness[] = wxT( "HoleWallPlatingThickness" ); -/** - * Testing mode for new connectivity algorithm. Setting this to on will cause all modifications - * to the netlist to be recalculated on the fly. This may be slower than the standard process - * at the moment - */ -static const wxChar RealtimeConnectivity[] = wxT( "RealtimeConnectivity" ); - /** * Configure the coroutine stack size in bytes. This should be allocated in multiples of * the system page size (n*4096 is generally safe) @@ -285,7 +278,6 @@ ADVANCED_CFG::ADVANCED_CFG() // Init defaults - this is done in case the config doesn't exist, // then the values will remain as set here. - m_RealTimeConnectivity = true; m_CoroutineStackSize = AC_STACK::default_stack; m_ShowRouterDebugGraphics = false; m_DrawArcAccuracy = 10.0; @@ -370,9 +362,6 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) { std::vector configParams; - configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity, - &m_RealTimeConnectivity, m_RealTimeConnectivity ) ); - configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin, &m_ExtraClearance, m_ExtraClearance, 0.0, 1.0 ) ); diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 174acd9dc8..7f41483f1d 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -444,9 +444,6 @@ CONNECTION_SUBGRAPH::PRIORITY CONNECTION_SUBGRAPH::GetDriverPriority( SCH_ITEM* } -bool CONNECTION_GRAPH::m_allowRealTime = true; - - void CONNECTION_GRAPH::Reset() { for( auto& subgraph : m_subgraphs ) @@ -540,17 +537,6 @@ void CONNECTION_GRAPH::Recalculate( const SCH_SHEET_LIST& aSheetList, bool aUnco if( wxLog::IsAllowedTraceMask( ConnProfileMask ) ) recalc_time.Show(); - -#ifndef DEBUG - // Pressure relief valve for release builds - const double max_recalc_time_msecs = 250.; - - if( m_allowRealTime && ADVANCED_CFG::GetCfg().m_RealTimeConnectivity && - recalc_time.msecs() > max_recalc_time_msecs ) - { - m_allowRealTime = false; - } -#endif } diff --git a/eeschema/connection_graph.h b/eeschema/connection_graph.h index a2dc9c8e27..c683130a03 100644 --- a/eeschema/connection_graph.h +++ b/eeschema/connection_graph.h @@ -573,9 +573,6 @@ private: */ size_t hasPins( const CONNECTION_SUBGRAPH* aLocSubgraph ); -public: - // TODO(JE) Remove this when pressure valve is removed - static bool m_allowRealTime; private: // All the sheets in the schematic (as long as we don't have partial updates) diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 3452cf05ca..52e5662b5b 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -886,11 +886,6 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) NETLIST_EXPORTER_KICAD exporter( &Schematic() ); STRING_FORMATTER formatter; - // TODO remove once real-time connectivity is a given - if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) - // Ensure the netlist data is up to date: - RecalculateConnections( NO_CLEANUP ); - exporter.Format( &formatter, GNL_ALL | GNL_OPT_KICAD ); payload = formatter.GetString(); diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp index 6bf814a075..7b5d3c939b 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -118,10 +118,6 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS( SCH_ m_parent = parent; m_appendUndo = false; - // TODO(JE) remove once real-time connectivity is a given - if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) - m_parent->RecalculateConnections( NO_CLEANUP ); - m_lineStyle->Append( DEFAULT_STYLE ); m_lineStyle->Append( INDETERMINATE_ACTION ); diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index cbc4a4fb53..6db913297a 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -470,7 +470,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in { DIALOG_MIGRATE_BUSES dlg( this ); dlg.ShowQuasiModal(); - RecalculateConnections( NO_CLEANUP ); OnModify(); } diff --git a/eeschema/netlist_exporters/netlist_generator.cpp b/eeschema/netlist_exporters/netlist_generator.cpp index bc6d55d584..047b952eb1 100644 --- a/eeschema/netlist_exporters/netlist_generator.cpp +++ b/eeschema/netlist_exporters/netlist_generator.cpp @@ -49,9 +49,6 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam // Ensure all power symbols have a valid reference Schematic().GetSheets().AnnotatePowerSymbols(); - // Ensure the netlist data is up to date: - RecalculateConnections( NO_CLEANUP ); - if( !ReadyToNetlist( _( "Exporting netlist requires a fully annotated schematic." ) ) ) return false; diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index 1e898f4b6c..dc08548090 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -429,9 +429,6 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector& aList ) #if defined(DEBUG) // These messages are not flagged as translatable, because they are only debug messages - if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) - return; - if( IsBus() ) aList.emplace_back( wxT( "Bus Code" ), wxString::Format( "%d", m_bus_code ) ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index df5b77f66a..cd20971232 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -936,10 +936,7 @@ void SCH_EDIT_FRAME::OnModify() GetScreen()->SetContentModified(); m_autoSaveRequired = true; - if( ADVANCED_CFG::GetCfg().m_RealTimeConnectivity && CONNECTION_GRAPH::m_allowRealTime ) - RecalculateConnections( NO_CLEANUP ); - else - GetScreen()->SetConnectivityDirty(); + RecalculateConnections( NO_CLEANUP ); GetCanvas()->Refresh(); UpdateHierarchyNavigator(); diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index a54809c10d..51bfe41aad 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -276,9 +276,6 @@ int SCH_EDITOR_CONTROL::RemapSymbols( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::Print( const TOOL_EVENT& aEvent ) { - if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) - m_frame->RecalculateConnections( NO_CLEANUP ); - InvokeDialogPrintUsingPrinter( m_frame ); wxFileName fn = m_frame->Prj().AbsolutePath( m_frame->Schematic().RootScreen()->GetFileName() ); @@ -292,9 +289,6 @@ int SCH_EDITOR_CONTROL::Print( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent ) { - if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) - m_frame->RecalculateConnections( NO_CLEANUP ); - DIALOG_PLOT_SCHEMATIC dlg( m_frame ); dlg.ShowModal(); @@ -799,13 +793,6 @@ int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent ) SCHEMATIC& schematic = m_frame->Schematic(); SCH_SCREEN* screen = m_frame->GetCurrentSheet().LastScreen(); - // TODO remove once real-time connectivity is a given - if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) - { - // Ensure the netlist data is up to date: - m_frame->RecalculateConnections( NO_CLEANUP ); - } - const SCH_CONNECTION* conn = nullptr; VECTOR2D connPos; @@ -2012,9 +1999,7 @@ int SCH_EDITOR_CONTROL::GenerateBOM( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::DrawSheetOnClipboard( const TOOL_EVENT& aEvent ) { - if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) - m_frame->RecalculateConnections( LOCAL_CLEANUP ); - + m_frame->RecalculateConnections( LOCAL_CLEANUP ); m_frame->DrawCurrentSheetToClipboard(); return 0; } diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index d79dfbaf2b..35042add79 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -92,22 +92,15 @@ protected: private: void update() override { - SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) getToolManager()->GetToolHolder(); EE_SELECTION_TOOL* selTool = getToolManager()->GetTool(); EE_SELECTION& selection = selTool->RequestSelection( { SCH_ITEM_LOCATE_BUS_T } ); SCH_LINE* bus = (SCH_LINE*) selection.Front(); Clear(); - // TODO(JE) remove once real-time is enabled - if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) - { - frame->RecalculateConnections( NO_CLEANUP ); - - // Pick up the pointer again because it may have been changed by SchematicCleanUp - selection = selTool->RequestSelection( { SCH_ITEM_LOCATE_BUS_T } ); - bus = (SCH_LINE*) selection.Front(); - } + // Pick up the pointer again because it may have been changed by SchematicCleanUp + selection = selTool->RequestSelection( { SCH_ITEM_LOCATE_BUS_T } ); + bus = (SCH_LINE*) selection.Front(); if( !bus ) { diff --git a/include/advanced_config.h b/include/advanced_config.h index 6ebcb1ec10..84e3cc1763 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -114,11 +114,6 @@ public: */ double m_HoleWallThickness; - /** - * Do real-time connectivity - */ - bool m_RealTimeConnectivity; - /** * Set the stack size for coroutines */