Hide PNS debug graphics behind an AC key

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4061
This commit is contained in:
Jon Evans 2020-07-03 19:33:36 -04:00
parent a9e97848dd
commit 3d7610d6b9
3 changed files with 25 additions and 5 deletions

View File

@ -80,6 +80,11 @@ static const wxChar RealtimeConnectivity[] = wxT( "RealtimeConnectivity" );
*/ */
static const wxChar CoroutineStackSize[] = wxT( "CoroutineStackSize" ); static const wxChar CoroutineStackSize[] = wxT( "CoroutineStackSize" );
/**
* Show PNS router debug graphics while routing
*/
static const wxChar ShowRouterDebugGraphics[] = wxT( "ShowRouterDebugGraphics" );
} // namespace KEYS } // namespace KEYS
@ -160,6 +165,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_EnableUsePadProperty = false; m_EnableUsePadProperty = false;
m_realTimeConnectivity = true; m_realTimeConnectivity = true;
m_coroutineStackSize = AC_STACK::default_stack; m_coroutineStackSize = AC_STACK::default_stack;
m_ShowRouterDebugGraphics = false;
loadFromConfigFile(); loadFromConfigFile();
} }
@ -203,6 +209,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_coroutineStackSize, AC_STACK::default_stack, &m_coroutineStackSize, AC_STACK::default_stack,
AC_STACK::min_stack, AC_STACK::max_stack ) ); AC_STACK::min_stack, AC_STACK::max_stack ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRouterDebugGraphics,
&m_ShowRouterDebugGraphics, false ) );
wxConfigLoadSetups( &aCfg, configParams ); wxConfigLoadSetups( &aCfg, configParams );
for( auto param : configParams ) for( auto param : configParams )

View File

@ -83,6 +83,11 @@ public:
*/ */
int m_coroutineStackSize; int m_coroutineStackSize;
/**
* Show PNS router debug graphics
*/
bool m_ShowRouterDebugGraphics;
private: private:
ADVANCED_CFG(); ADVANCED_CFG();

View File

@ -50,6 +50,8 @@
#include <memory> #include <memory>
#include <advanced_config.h>
#include "tools/pcb_tool_base.h" #include "tools/pcb_tool_base.h"
#include "pns_kicad_iface.h" #include "pns_kicad_iface.h"
@ -498,6 +500,9 @@ public:
void AddLine( const SHAPE_LINE_CHAIN& aLine, int aType, int aWidth, const std::string aName = "" ) override void AddLine( const SHAPE_LINE_CHAIN& aLine, int aType, int aWidth, const std::string aName = "" ) override
{ {
if( !m_view )
return;
ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( NULL, m_view ); ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( NULL, m_view );
pitem->Line( aLine, aWidth, aType ); pitem->Line( aLine, aWidth, aType );
@ -1237,9 +1242,10 @@ void PNS_KICAD_IFACE::SetView( KIGFX::VIEW* aView )
delete m_debugDecorator; delete m_debugDecorator;
auto dec = new PNS_PCBNEW_DEBUG_DECORATOR(); auto dec = new PNS_PCBNEW_DEBUG_DECORATOR();
dec->SetView( m_view );
m_debugDecorator = dec; m_debugDecorator = dec;
if( ADVANCED_CFG::GetCfg().m_ShowRouterDebugGraphics )
dec->SetView( m_view );
} }