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

Go to the source code of this file.

Namespaces

namespace  AC_STACK
 Limits and default settings for the coroutine stack size allowed.
 
namespace  AC_KEYS
 List of known keys for advanced configuration options.
 
namespace  AC_GROUPS
 List of known groups 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::DRCSliverWidthTolerance [] = wxT( "DRCSliverWidthTolerance" )
 Angle and width tolerances for copper and solder mask sliver detection. More...
 
static const wxChar AC_KEYS::DRCSliverMinimumLength [] = wxT( "DRCSliverMinimumLength" )
 
static const wxChar AC_KEYS::DRCSliverAngleTolerance [] = wxT( "DRCSliverAngleTolerance" )
 
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::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::MaxTangentTrackAngleDeviation [] = wxT( "MaxTangentTrackAngleDeviation" )
 For arc track interactive drag-resizing Maximum angle between the tangent line of an arc track and a connected straight track in order to commence arc dragging. More...
 
static const wxChar AC_KEYS::MaxTrackLengthToKeep [] = wxT( "MaxTrackLengthToKeep" )
 For arc track interactive drag-resizing Maximum track length to keep after doing an arc track resizing operation. 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::ExtraZoneDisplayModes [] = wxT( "ExtraZoneDisplayModes" )
 When true, a third zone-display-mode is included which strokes the filled areas and fracture boundaries. 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::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...
 
static const wxChar AC_KEYS::HotkeysDumper [] = wxT( "HotkeysDumper" )
 
static const wxChar AC_KEYS::DrawBoundingBoxes [] = wxT( "DrawBoundingBoxes" )
 
static const wxChar AC_KEYS::ShowPcbnewExportNetlist [] = wxT( "ShowPcbnewExportNetlist" )
 
static const wxChar AC_KEYS::Skip3DModelFileCache [] = wxT( "Skip3DModelFileCache" )
 
static const wxChar AC_KEYS::Skip3DModelMemoryCache [] = wxT( "Skip3DModelMemoryCache" )
 
static const wxChar AC_KEYS::HideVersionFromTitle [] = wxT( "HideVersionFromTitle" )
 
static const wxChar AC_KEYS::TraceMasks [] = wxT( "TraceMasks" )
 
static const wxChar AC_KEYS::ShowRepairSchematic [] = wxT( "ShowRepairSchematic" )
 
static const wxChar AC_KEYS::ShowEventCounters [] = wxT( "ShowEventCounters" )
 
static const wxChar AC_KEYS::AllowManualCanvasScale [] = wxT( "AllowManualCanvasScale" )
 
static const wxChar AC_KEYS::UpdateUIEventInterval [] = wxT( "UpdateUIEventInterval" )
 
static const wxChar AC_KEYS::ShowPropertiesPanel [] = wxT( "ShowPropertiesPanel" )
 
static const wxChar AC_KEYS::V3DRT_BevelHeight_um [] = wxT( "V3DRT_BevelHeight_um" )
 
static const wxChar AC_KEYS::V3DRT_BevelExtentFactor [] = wxT( "V3DRT_BevelExtentFactor" )
 
static const wxChar AC_KEYS::UseClipper2 [] = wxT( "UseClipper2" )
 
static const wxChar AC_GROUPS::V3D_RayTracing [] = wxT( "G_3DV_RayTracing" )
 

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 250 of file advanced_config.cpp.

251{
252 // only dump if we need to
253 if( !wxLog::IsAllowedTraceMask( AdvancedConfigMask ) )
254 return;
255
256 for( const PARAM_CFG* param : aArray )
257 {
258 wxLogTrace( AdvancedConfigMask, dumpParamCfg( *param ) );
259 }
260}
wxString dumpParamCfg(const PARAM_CFG &aParam)
static const wxChar AdvancedConfigMask[]
A base class which establishes the interface functions ReadParam and SaveParam, which are implemented...
Definition: config_params.h:82

References AdvancedConfigMask, and dumpParamCfg().

Referenced by ADVANCED_CFG::loadSettings().

◆ dumpParamCfg()

wxString dumpParamCfg ( const PARAM_CFG aParam)

Definition at line 213 of file advanced_config.cpp.

214{
215 wxString s = aParam.m_Ident + wxS( ": " );
216
217 /*
218 * This implementation is rather simplistic, but it is
219 * effective enough for simple uses. A better implementation would be
220 * some kind of visitor, but that's somewhat more work.
221 */
222 switch( aParam.m_Type )
223 {
226 s << *static_cast<const PARAM_CFG_INT&>( aParam ).m_Pt_param;
227 break;
229 s << *static_cast<const PARAM_CFG_DOUBLE&>( aParam ).m_Pt_param;
230 break;
232 s << *static_cast<const PARAM_CFG_WXSTRING&>( aParam ).m_Pt_param;
233 break;
235 s << *static_cast<const PARAM_CFG_FILENAME&>( aParam ).m_Pt_param;
236 break;
238 s << ( *static_cast<const PARAM_CFG_BOOL&>( aParam ).m_Pt_param ? wxS( "true" ) : wxS( "false" ) );
239 break;
240 default: s << wxS( "Unsupported PARAM_CFG variant: " ) << aParam.m_Type;
241 }
242
243 return s;
244}
paramcfg_id m_Type
Type of parameter.
wxString m_Ident
Keyword in config data.
@ PARAM_WXSTRING
Definition: config_params.h:60
@ PARAM_INT_WITH_SCALE
Definition: config_params.h:56
@ PARAM_INT
Definition: config_params.h:55
@ PARAM_FILENAME
Definition: config_params.h:62
@ PARAM_DOUBLE
Definition: config_params.h:57
@ PARAM_BOOL
Definition: config_params.h:58

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 268 of file advanced_config.cpp.

269{
270 const static wxString cfg_filename{ wxS( "kicad_advanced" ) };
271 return wxFileName( SETTINGS_MANAGER::GetUserSettingsPath(), cfg_filename );
272}
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