eeschema: Move realtime connectivity to adv config

This allows realtime connectivity testing by modifying the
kicad_advanced setting rather than recompiling
This commit is contained in:
Seth Hillbrand 2019-04-10 22:07:45 -07:00
parent ab2281d26f
commit d70ae19cb8
5 changed files with 29 additions and 12 deletions

View File

@ -58,6 +58,13 @@ namespace AC_KEYS
*/ */
static const wxChar EnableSvgImport[] = wxT( "EnableSvgImport" ); 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 * 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 * 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( configParams.push_back( new PARAM_CFG_BOOL(
true, AC_KEYS::AllowLegacyCanvasInGtk3, &m_allowLegacyCanvasInGtk3, false ) ); true, AC_KEYS::AllowLegacyCanvasInGtk3, &m_allowLegacyCanvasInGtk3, false ) );
configParams.push_back(
new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity, &m_realTimeConnectivity, false ) );
wxConfigLoadSetups( &aCfg, configParams ); wxConfigLoadSetups( &aCfg, configParams );
dumpCfg( configParams ); dumpCfg( configParams );
@ -200,4 +210,4 @@ bool ADVANCED_CFG::AllowLegacyCanvas() const
#endif #endif
return allow; return allow;
} }

View File

@ -21,6 +21,7 @@
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <wx/tokenzr.h> #include <wx/tokenzr.h>
#include <advanced_config.h>
#include <connection_graph.h> #include <connection_graph.h>
#include <sch_screen.h> #include <sch_screen.h>
@ -281,7 +282,8 @@ wxString SCH_CONNECTION::Name( bool aIgnoreSheet ) const
void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) 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; wxString msg, group_name;
std::vector<wxString> group_members; std::vector<wxString> 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 void SCH_CONNECTION::AppendDebugInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const
{ {
#ifdef CONNECTIVITY_REAL_TIME if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity )
return;
wxString msg; wxString msg;
AppendInfoToMsgPanel( aList ); AppendInfoToMsgPanel( aList );
@ -345,7 +347,6 @@ void SCH_CONNECTION::AppendDebugInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const
msg.Printf( "%s at %p", Parent()->GetSelectMenuText( MILLIMETRES ), Parent() ); msg.Printf( "%s at %p", Parent()->GetSelectMenuText( MILLIMETRES ), Parent() );
aList.push_back( MSG_PANEL_ITEM( _( "Attached To" ), msg, RED ) ); aList.push_back( MSG_PANEL_ITEM( _( "Attached To" ), msg, RED ) );
#endif
} }

View File

@ -40,6 +40,7 @@
#include <eda_dockart.h> #include <eda_dockart.h>
#include <profile.h> #include <profile.h>
#include <advanced_config.h>
#include <general.h> #include <general.h>
#include <eeschema_id.h> #include <eeschema_id.h>
#include <netlist.h> #include <netlist.h>
@ -795,9 +796,9 @@ void SCH_EDIT_FRAME::OnModify()
m_foundItems.SetForceSearch(); m_foundItems.SetForceSearch();
#ifdef CONNECTIVITY_REAL_TIME
RecalculateConnections(); if( ADVANCED_CFG::GetCfg().m_realTimeConnectivity )
#endif RecalculateConnections();
m_canvas->Refresh(); m_canvas->Refresh();
} }

View File

@ -38,6 +38,7 @@
#include <kicad_device_context.h> #include <kicad_device_context.h>
#include <hotkeys_basic.h> #include <hotkeys_basic.h>
#include <advanced_config.h>
#include <general.h> #include <general.h>
#include <eeschema_id.h> #include <eeschema_id.h>
#include <list_operations.h> #include <list_operations.h>
@ -563,9 +564,8 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
case ID_HIGHLIGHT: case ID_HIGHLIGHT:
// TODO(JE) remove once real-time connectivity is a given // TODO(JE) remove once real-time connectivity is a given
#ifndef CONNECTIVITY_REAL_TIME if( ADVANCED_CFG::GetCfg().m_realTimeConnectivity )
RecalculateConnections(); RecalculateConnections();
#endif
SetToolID( ID_HIGHLIGHT, wxCURSOR_HAND, _("Highlight specific net") ); SetToolID( ID_HIGHLIGHT, wxCURSOR_HAND, _("Highlight specific net") );
break; break;

View File

@ -73,6 +73,11 @@ public:
*/ */
bool m_enableSvgImport; bool m_enableSvgImport;
/**
* Do real-time connectivity
*/
bool m_realTimeConnectivity;
/** /**
* Helper to determine if legacy canvas is allowed (according to platform * Helper to determine if legacy canvas is allowed (according to platform
* and config) * and config)