KiCad PCB EDA Suite
advanced_config.cpp File Reference
#include <advanced_config.h>
#include <config_params.h>
#include <settings/settings_manager.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 &aParam)
 
static void dumpCfg (const std::vector< PARAM_CFG * > &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::ExtraFillMargin [] = wxT( "ExtraFillMargin" )
 When filling zones, we add an extra amount of clearance to each zone to ensure that rounding errors do not overrun minimum clearance distances. More...
 
static const wxChar AC_KEYS::DRCEpsilon [] = wxT( "DRCEpsilon" )
 A fudge factor for DRC. More...
 
static const wxChar AC_KEYS::HoleWallThickness [] = wxT( "HoleWallPlatingThickness" )
 Used to calculate the actual hole size from the finish hole size. More...
 
static const wxChar AC_KEYS::RealtimeConnectivity [] = wxT( "RealtimeConnectivity" )
 Testing mode for new connectivity algorithm. More...
 
static const wxChar AC_KEYS::CoroutineStackSize [] = wxT( "CoroutineStackSize" )
 Configure the coroutine stack size in bytes. More...
 
static const wxChar AC_KEYS::ShowRouterDebugGraphics [] = wxT( "ShowRouterDebugGraphics" )
 Show PNS router debug graphics while routing. More...
 
static const wxChar AC_KEYS::CompactFileSave [] = wxT( "CompactSave" )
 When set to true, this will wrap polygon point sets at 4 points per line rather than a single point per line. More...
 
static const wxChar AC_KEYS::DrawArcAccuracy [] = wxT( "DrawArcAccuracy" )
 For drawsegments - arcs. More...
 
static const wxChar AC_KEYS::DrawArcCenterStartEndMaxAngle [] = wxT( "DrawArcCenterStartEndMaxAngle" )
 For drawsegments - arcs. More...
 
static const wxChar AC_KEYS::StrokeTriangulation [] = wxT( "StrokeTriangulation" )
 When true, GAL will stroke the triangulations (only used in OpenGL) with a visible color. More...
 
static const wxChar AC_KEYS::PluginAltiumSch [] = wxT( "PluginAltiumSch" )
 When true, enable Altium Schematic import (*.SchDoc) More...
 
static const wxChar AC_KEYS::MinPlotPenWidth [] = wxT( "MinPlotPenWidth" )
 Absolute minimum pen width to send to the plotter. More...
 
static const wxChar AC_KEYS::DebugZoneFiller [] = wxT( "DebugZoneFiller" )
 
static const wxChar AC_KEYS::DebugPDFWriter [] = wxT( "DebugPDFWriter" )
 
static const wxChar AC_KEYS::SkipBoundingBoxFpLoad [] = wxT( "SkipBoundingBoxFpLoad" )
 
static const wxChar AC_KEYS::SmallDrillMarkSize [] = wxT( "SmallDrillMarkSize" )
 The diameter of the drill marks on print and plot outputs (in mm), when the "Drill marks" option is set to "Small mark". More...
 

Function Documentation

◆ dumpCfg()

static void dumpCfg ( const std::vector< PARAM_CFG * > &  aArray)
static

Dump the configs in the given array to trace.

Definition at line 199 of file advanced_config.cpp.

200 {
201  // only dump if we need to
202  if( !wxLog::IsAllowedTraceMask( AdvancedConfigMask ) )
203  return;
204 
205  for( const PARAM_CFG* param : aArray )
206  {
207  wxLogTrace( AdvancedConfigMask, dumpParamCfg( *param ) );
208  }
209 }
wxString dumpParamCfg(const PARAM_CFG &aParam)
A base class which establishes the interface functions ReadParam and SaveParam, which are implemented...
Definition: config_params.h:81
static const wxChar AdvancedConfigMask[]

References AdvancedConfigMask, and dumpParamCfg().

Referenced by ADVANCED_CFG::loadSettings().

◆ dumpParamCfg()

wxString dumpParamCfg ( const PARAM_CFG aParam)

Definition at line 162 of file advanced_config.cpp.

163 {
164  wxString s = aParam.m_Ident + ": ";
165 
166  /*
167  * This implementation is rather simplistic, but it is
168  * effective enough for simple uses. A better implementation would be
169  * some kind of visitor, but that's somewhat more work.
170  */
171  switch( aParam.m_Type )
172  {
175  s << *static_cast<const PARAM_CFG_INT&>( aParam ).m_Pt_param;
176  break;
178  s << *static_cast<const PARAM_CFG_DOUBLE&>( aParam ).m_Pt_param;
179  break;
181  s << *static_cast<const PARAM_CFG_WXSTRING&>( aParam ).m_Pt_param;
182  break;
184  s << *static_cast<const PARAM_CFG_FILENAME&>( aParam ).m_Pt_param;
185  break;
187  s << ( *static_cast<const PARAM_CFG_BOOL&>( aParam ).m_Pt_param ? "true" : "false" );
188  break;
189  default: s << "Unsupported PARAM_CFG variant: " << aParam.m_Type;
190  }
191 
192  return s;
193 }
wxString m_Ident
Keyword in config data.
paramcfg_id m_Type
Type of parameter.

References PARAM_CFG::m_Ident, PARAM_CFG::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 217 of file advanced_config.cpp.

218 {
219  const static wxString cfg_filename{ "kicad_advanced" };
220  return wxFileName( SETTINGS_MANAGER::GetUserSettingsPath(), cfg_filename );
221 }
static wxString GetUserSettingsPath()
Return the user configuration path used to store KiCad's configuration files.

References SETTINGS_MANAGER::GetUserSettingsPath().

Referenced by ADVANCED_CFG::loadFromConfigFile().

Variable Documentation

◆ AdvancedConfigMask

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