KiCad PCB EDA Suite
advanced_config.cpp File Reference
#include <advanced_config.h>
#include <common.h>
#include <config_params.h>
#include <wx/config.h>
#include <wx/filename.h>
#include <wx/log.h>

Go to the source code of this file.

Namespaces

 AC_STACK
 Limits and default settings for the coroutine stack size allowed.
 
 AC_KEYS
 List of known keys for advanced configuration options.
 

Functions

wxString dumpParamCfg (const PARAM_CFG_BASE &aParam)
 
static void dumpCfg (const PARAM_CFG_ARRAY &aArray)
 Dump the configs in the given array to trace. More...
 
static wxFileName getAdvancedCfgFilename ()
 Get the filename for the advanced config file. More...
 

Variables

static const wxChar AdvancedConfigMask [] = wxT( "KICAD_ADVANCED_CONFIG" )
 
static constexpr int AC_STACK::min_stack = 32 * 4096
 
static constexpr int AC_STACK::default_stack = 256 * 4096
 
static constexpr int AC_STACK::max_stack = 4096 * 4096
 
static const wxChar AC_KEYS::EnableSvgImport [] = wxT( "EnableSvgImport" )
 SVG needs some enhancements. More...
 
static const wxChar AC_KEYS::RealtimeConnectivity [] = wxT( "RealtimeConnectivity" )
 Testing mode for new connectivity algorithm. More...
 
static const wxChar AC_KEYS::AllowLegacyCanvasInGtk3 [] = wxT( "AllowLegacyCanvasInGtk3" )
 Allow legacy canvas to be shown in GTK3. More...
 
static const wxChar AC_KEYS::CoroutineStackSize [] = wxT( "CoroutineStackSize" )
 Configure the coroutine stack size in bytes. More...
 
static const wxChar AC_KEYS::ForceThickZones [] = wxT( "ForceThickZones" )
 Draw zones in pcbnew with the stroked outline. More...
 

Function Documentation

◆ dumpCfg()

static void dumpCfg ( const PARAM_CFG_ARRAY aArray)
static

Dump the configs in the given array to trace.

Definition at line 144 of file advanced_config.cpp.

145 {
146  // only dump if we need to
147  if( !wxLog::IsAllowedTraceMask( AdvancedConfigMask ) )
148  return;
149 
150  for( const auto& param : aArray )
151  {
152  wxLogTrace( AdvancedConfigMask, dumpParamCfg( param ) );
153  }
154 }
wxString dumpParamCfg(const PARAM_CFG_BASE &aParam)
static const wxChar AdvancedConfigMask[]

References AdvancedConfigMask, and dumpParamCfg().

Referenced by ADVANCED_CFG::loadSettings().

◆ dumpParamCfg()

wxString dumpParamCfg ( const PARAM_CFG_BASE aParam)

Definition at line 107 of file advanced_config.cpp.

108 {
109  wxString s = aParam.m_Ident + ": ";
110 
111  /*
112  * This implementation is rather simplistic, but it is
113  * effective enough for simple uses. A better implementation would be
114  * some kind of visitor, but that's somewhat more work.
115  */
116  switch( aParam.m_Type )
117  {
120  s << *static_cast<const PARAM_CFG_INT&>( aParam ).m_Pt_param;
121  break;
123  s << *static_cast<const PARAM_CFG_DOUBLE&>( aParam ).m_Pt_param;
124  break;
126  s << *static_cast<const PARAM_CFG_WXSTRING&>( aParam ).m_Pt_param;
127  break;
129  s << *static_cast<const PARAM_CFG_FILENAME&>( aParam ).m_Pt_param;
130  break;
132  s << ( *static_cast<const PARAM_CFG_BOOL&>( aParam ).m_Pt_param ? "true" : "false" );
133  break;
134  default: s << "Unsupported PARAM_CFG variant: " << aParam.m_Type;
135  }
136 
137  return s;
138 }
paramcfg_id m_Type
Type of parameter.
wxString m_Ident
Keyword in config data.

References PARAM_CFG_BASE::m_Ident, PARAM_CFG_BASE::m_Type, PARAM_BOOL, PARAM_DOUBLE, PARAM_FILENAME, PARAM_INT, PARAM_INT_WITH_SCALE, and PARAM_WXSTRING.

Referenced by dumpCfg().

◆ getAdvancedCfgFilename()

static wxFileName getAdvancedCfgFilename ( )
static

Get the filename for the advanced config file.

The user must check the file exists if they care.

Definition at line 162 of file advanced_config.cpp.

163 {
164  const static wxString cfg_filename{ "kicad_advanced" };
165  return wxFileName( GetKicadConfigPath(), cfg_filename );
166 }
wxString GetKicadConfigPath()
Return the user configuration path used to store KiCad's configuration files.
Definition: common.cpp:267

References GetKicadConfigPath().

Referenced by ADVANCED_CFG::loadFromConfigFile().

Variable Documentation

◆ AdvancedConfigMask

const wxChar AdvancedConfigMask[] = wxT( "KICAD_ADVANCED_CONFIG" )
static