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
This commit is contained in:
Seth Hillbrand 2023-01-20 15:17:57 -08:00
parent 6fa2eedb4b
commit e6dbca051c
12 changed files with 5 additions and 79 deletions

View File

@ -89,13 +89,6 @@ static const wxChar DRCSliverAngleTolerance[] = wxT( "DRCSliverAngleTolerance" )
*/ */
static const wxChar HoleWallThickness[] = wxT( "HoleWallPlatingThickness" ); 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 * Configure the coroutine stack size in bytes. This should be allocated in multiples of
* the system page size (n*4096 is generally safe) * 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, // Init defaults - this is done in case the config doesn't exist,
// then the values will remain as set here. // then the values will remain as set here.
m_RealTimeConnectivity = true;
m_CoroutineStackSize = AC_STACK::default_stack; m_CoroutineStackSize = AC_STACK::default_stack;
m_ShowRouterDebugGraphics = false; m_ShowRouterDebugGraphics = false;
m_DrawArcAccuracy = 10.0; m_DrawArcAccuracy = 10.0;
@ -370,9 +362,6 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
{ {
std::vector<PARAM_CFG*> configParams; std::vector<PARAM_CFG*> 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, configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin,
&m_ExtraClearance, m_ExtraClearance, 0.0, 1.0 ) ); &m_ExtraClearance, m_ExtraClearance, 0.0, 1.0 ) );

View File

@ -444,9 +444,6 @@ CONNECTION_SUBGRAPH::PRIORITY CONNECTION_SUBGRAPH::GetDriverPriority( SCH_ITEM*
} }
bool CONNECTION_GRAPH::m_allowRealTime = true;
void CONNECTION_GRAPH::Reset() void CONNECTION_GRAPH::Reset()
{ {
for( auto& subgraph : m_subgraphs ) for( auto& subgraph : m_subgraphs )
@ -540,17 +537,6 @@ void CONNECTION_GRAPH::Recalculate( const SCH_SHEET_LIST& aSheetList, bool aUnco
if( wxLog::IsAllowedTraceMask( ConnProfileMask ) ) if( wxLog::IsAllowedTraceMask( ConnProfileMask ) )
recalc_time.Show(); 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
} }

View File

@ -573,9 +573,6 @@ private:
*/ */
size_t hasPins( const CONNECTION_SUBGRAPH* aLocSubgraph ); size_t hasPins( const CONNECTION_SUBGRAPH* aLocSubgraph );
public:
// TODO(JE) Remove this when pressure valve is removed
static bool m_allowRealTime;
private: private:
// All the sheets in the schematic (as long as we don't have partial updates) // All the sheets in the schematic (as long as we don't have partial updates)

View File

@ -886,11 +886,6 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
NETLIST_EXPORTER_KICAD exporter( &Schematic() ); NETLIST_EXPORTER_KICAD exporter( &Schematic() );
STRING_FORMATTER formatter; 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 ); exporter.Format( &formatter, GNL_ALL | GNL_OPT_KICAD );
payload = formatter.GetString(); payload = formatter.GetString();

View File

@ -118,10 +118,6 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS( SCH_
m_parent = parent; m_parent = parent;
m_appendUndo = false; 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( DEFAULT_STYLE );
m_lineStyle->Append( INDETERMINATE_ACTION ); m_lineStyle->Append( INDETERMINATE_ACTION );

View File

@ -470,7 +470,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
{ {
DIALOG_MIGRATE_BUSES dlg( this ); DIALOG_MIGRATE_BUSES dlg( this );
dlg.ShowQuasiModal(); dlg.ShowQuasiModal();
RecalculateConnections( NO_CLEANUP );
OnModify(); OnModify();
} }

View File

@ -49,9 +49,6 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam
// Ensure all power symbols have a valid reference // Ensure all power symbols have a valid reference
Schematic().GetSheets().AnnotatePowerSymbols(); Schematic().GetSheets().AnnotatePowerSymbols();
// Ensure the netlist data is up to date:
RecalculateConnections( NO_CLEANUP );
if( !ReadyToNetlist( _( "Exporting netlist requires a fully annotated schematic." ) ) ) if( !ReadyToNetlist( _( "Exporting netlist requires a fully annotated schematic." ) ) )
return false; return false;

View File

@ -429,9 +429,6 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector<MSG_PANEL_ITEM>& aList )
#if defined(DEBUG) #if defined(DEBUG)
// These messages are not flagged as translatable, because they are only debug messages // 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() ) if( IsBus() )
aList.emplace_back( wxT( "Bus Code" ), wxString::Format( "%d", m_bus_code ) ); aList.emplace_back( wxT( "Bus Code" ), wxString::Format( "%d", m_bus_code ) );

View File

@ -936,10 +936,7 @@ void SCH_EDIT_FRAME::OnModify()
GetScreen()->SetContentModified(); GetScreen()->SetContentModified();
m_autoSaveRequired = true; m_autoSaveRequired = true;
if( ADVANCED_CFG::GetCfg().m_RealTimeConnectivity && CONNECTION_GRAPH::m_allowRealTime ) RecalculateConnections( NO_CLEANUP );
RecalculateConnections( NO_CLEANUP );
else
GetScreen()->SetConnectivityDirty();
GetCanvas()->Refresh(); GetCanvas()->Refresh();
UpdateHierarchyNavigator(); UpdateHierarchyNavigator();

View File

@ -276,9 +276,6 @@ int SCH_EDITOR_CONTROL::RemapSymbols( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::Print( 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 ); InvokeDialogPrintUsingPrinter( m_frame );
wxFileName fn = m_frame->Prj().AbsolutePath( m_frame->Schematic().RootScreen()->GetFileName() ); 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 ) 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 ); DIALOG_PLOT_SCHEMATIC dlg( m_frame );
dlg.ShowModal(); dlg.ShowModal();
@ -799,13 +793,6 @@ int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
SCHEMATIC& schematic = m_frame->Schematic(); SCHEMATIC& schematic = m_frame->Schematic();
SCH_SCREEN* screen = m_frame->GetCurrentSheet().LastScreen(); 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; const SCH_CONNECTION* conn = nullptr;
VECTOR2D connPos; VECTOR2D connPos;
@ -2012,9 +1999,7 @@ int SCH_EDITOR_CONTROL::GenerateBOM( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::DrawSheetOnClipboard( 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(); m_frame->DrawCurrentSheetToClipboard();
return 0; return 0;
} }

View File

@ -92,22 +92,15 @@ protected:
private: private:
void update() override void update() override
{ {
SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) getToolManager()->GetToolHolder();
EE_SELECTION_TOOL* selTool = getToolManager()->GetTool<EE_SELECTION_TOOL>(); EE_SELECTION_TOOL* selTool = getToolManager()->GetTool<EE_SELECTION_TOOL>();
EE_SELECTION& selection = selTool->RequestSelection( { SCH_ITEM_LOCATE_BUS_T } ); EE_SELECTION& selection = selTool->RequestSelection( { SCH_ITEM_LOCATE_BUS_T } );
SCH_LINE* bus = (SCH_LINE*) selection.Front(); SCH_LINE* bus = (SCH_LINE*) selection.Front();
Clear(); Clear();
// TODO(JE) remove once real-time is enabled // Pick up the pointer again because it may have been changed by SchematicCleanUp
if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime ) selection = selTool->RequestSelection( { SCH_ITEM_LOCATE_BUS_T } );
{ bus = (SCH_LINE*) selection.Front();
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();
}
if( !bus ) if( !bus )
{ {

View File

@ -114,11 +114,6 @@ public:
*/ */
double m_HoleWallThickness; double m_HoleWallThickness;
/**
* Do real-time connectivity
*/
bool m_RealTimeConnectivity;
/** /**
* Set the stack size for coroutines * Set the stack size for coroutines
*/ */