diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index 8908652a3c..121a2d225a 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -58,6 +58,13 @@ namespace AC_KEYS */ static const wxChar EnableSvgImport[] = wxT( "EnableSvgImport" ); +/** + * 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" ); + /** * Allow legacy canvas to be shown in GTK3. Legacy canvas is generally pretty * broken, but this avoids code in an ifdef where it could become broken @@ -183,6 +190,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::AllowLegacyCanvasInGtk3, &m_allowLegacyCanvasInGtk3, false ) ); + configParams.push_back( + new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity, &m_realTimeConnectivity, false ) ); + wxConfigLoadSetups( &aCfg, configParams ); dumpCfg( configParams ); @@ -200,4 +210,4 @@ bool ADVANCED_CFG::AllowLegacyCanvas() const #endif return allow; -} \ No newline at end of file +} diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index bf2acf5e68..4592471a6f 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -281,7 +282,8 @@ wxString SCH_CONNECTION::Name( bool aIgnoreSheet ) const void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const { -#ifdef CONNECTIVITY_REAL_TIME + if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity ) + return; wxString msg, group_name; std::vector group_members; @@ -319,14 +321,14 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const } } } - -#endif } void SCH_CONNECTION::AppendDebugInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const { -#ifdef CONNECTIVITY_REAL_TIME + if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity ) + return; + wxString msg; AppendInfoToMsgPanel( aList ); @@ -345,7 +347,6 @@ void SCH_CONNECTION::AppendDebugInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const msg.Printf( "%s at %p", Parent()->GetSelectMenuText( MILLIMETRES ), Parent() ); aList.push_back( MSG_PANEL_ITEM( _( "Attached To" ), msg, RED ) ); -#endif } diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 564a8fd41e..06cf445a89 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -795,9 +796,9 @@ void SCH_EDIT_FRAME::OnModify() m_foundItems.SetForceSearch(); -#ifdef CONNECTIVITY_REAL_TIME - RecalculateConnections(); -#endif + + if( ADVANCED_CFG::GetCfg().m_realTimeConnectivity ) + RecalculateConnections(); m_canvas->Refresh(); } diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index c02929785a..794e2c4871 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -563,9 +564,8 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) case ID_HIGHLIGHT: // TODO(JE) remove once real-time connectivity is a given - #ifndef CONNECTIVITY_REAL_TIME - RecalculateConnections(); - #endif + if( ADVANCED_CFG::GetCfg().m_realTimeConnectivity ) + RecalculateConnections(); SetToolID( ID_HIGHLIGHT, wxCURSOR_HAND, _("Highlight specific net") ); break; diff --git a/include/advanced_config.h b/include/advanced_config.h index a69669ebd6..86c532a31e 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -73,6 +73,11 @@ public: */ bool m_enableSvgImport; + /** + * Do real-time connectivity + */ + bool m_realTimeConnectivity; + /** * Helper to determine if legacy canvas is allowed (according to platform * and config)