KiCad PCB EDA Suite
Loading...
Searching...
No Matches
advanced_config.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <advanced_config.h>
25#include <trace_helpers.h>
26#include <config_params.h>
27#include <paths.h>
28
29#include <wx/app.h>
30#include <wx/config.h>
31#include <wx/filename.h>
32#include <wx/log.h>
33#include <wx/tokenzr.h>
34
35/*
36 * Flag to enable advanced config debugging
37 *
38 * Use "KICAD_ADVANCED_CONFIG" to enable.
39 *
40 * @ingroup trace_env_vars
41 */
42static const wxChar AdvancedConfigMask[] = wxT( "KICAD_ADVANCED_CONFIG" );
43
49namespace AC_STACK
50{
51static constexpr int min_stack = 32 * 4096;
52static constexpr int default_stack = 256 * 4096;
53static constexpr int max_stack = 4096 * 4096;
54} // namespace AC_STACK
55
61namespace AC_KEYS
62{
63
64static const wxChar IncrementalConnectivity[] = wxT( "IncrementalConnectivity" );
65static const wxChar Use3DConnexionDriver[] = wxT( "3DConnexionDriver" );
66static const wxChar ExtraFillMargin[] = wxT( "ExtraFillMargin" );
67static const wxChar EnableCreepageSlot[] = wxT( "EnableCreepageSlot" );
68static const wxChar DRCEpsilon[] = wxT( "DRCEpsilon" );
69static const wxChar DRCSliverWidthTolerance[] = wxT( "DRCSliverWidthTolerance" );
70static const wxChar DRCSliverMinimumLength[] = wxT( "DRCSliverMinimumLength" );
71static const wxChar DRCSliverAngleTolerance[] = wxT( "DRCSliverAngleTolerance" );
72static const wxChar HoleWallThickness[] = wxT( "HoleWallPlatingThickness" );
73static const wxChar CoroutineStackSize[] = wxT( "CoroutineStackSize" );
74static const wxChar ShowRouterDebugGraphics[] = wxT( "ShowRouterDebugGraphics" );
75static const wxChar EnableRouterDump[] = wxT( "EnableRouterDump" );
76static const wxChar HyperZoom[] = wxT( "HyperZoom" );
77static const wxChar CompactFileSave[] = wxT( "CompactSave" );
78static const wxChar DrawArcAccuracy[] = wxT( "DrawArcAccuracy" );
79static const wxChar DrawArcCenterStartEndMaxAngle[] = wxT( "DrawArcCenterStartEndMaxAngle" );
80static const wxChar MaxTangentTrackAngleDeviation[] = wxT( "MaxTangentTrackAngleDeviation" );
81static const wxChar MaxTrackLengthToKeep[] = wxT( "MaxTrackLengthToKeep" );
82static const wxChar StrokeTriangulation[] = wxT( "StrokeTriangulation" );
83static const wxChar ExtraZoneDisplayModes[] = wxT( "ExtraZoneDisplayModes" );
84static const wxChar MinPlotPenWidth[] = wxT( "MinPlotPenWidth" );
85static const wxChar DebugZoneFiller[] = wxT( "DebugZoneFiller" );
86static const wxChar DebugPDFWriter[] = wxT( "DebugPDFWriter" );
87static const wxChar PDFStrokeFontWidthFactor[] = wxT( "PDFStrokeFontWidthFactor" );
88static const wxChar PDFStrokeFontXOffset[] = wxT( "PDFStrokeFontXOffset" );
89static const wxChar PDFStrokeFontYOffset[] = wxT( "PDFStrokeFontYOffset" );
90static const wxChar PDFStrokeFontBoldMultiplier[] = wxT( "PDFStrokeFontBoldMultiplier" );
91static const wxChar PDFStrokeFontKerningFactor[] = wxT( "PDFStrokeFontKerningFactor" );
92static const wxChar UsePdfPrint[] = wxT( "UsePdfPrint" );
93static const wxChar SmallDrillMarkSize[] = wxT( "SmallDrillMarkSize" );
94static const wxChar HotkeysDumper[] = wxT( "HotkeysDumper" );
95static const wxChar DrawBoundingBoxes[] = wxT( "DrawBoundingBoxes" );
96static const wxChar ShowPcbnewExportNetlist[] = wxT( "ShowPcbnewExportNetlist" );
97static const wxChar Skip3DModelFileCache[] = wxT( "Skip3DModelFileCache" );
98static const wxChar Skip3DModelMemoryCache[] = wxT( "Skip3DModelMemoryCache" );
99static const wxChar HideVersionFromTitle[] = wxT( "HideVersionFromTitle" );
100static const wxChar TraceMasks[] = wxT( "TraceMasks" );
101static const wxChar ShowRepairSchematic[] = wxT( "ShowRepairSchematic" );
102static const wxChar ShowEventCounters[] = wxT( "ShowEventCounters" );
103static const wxChar AllowManualCanvasScale[] = wxT( "AllowManualCanvasScale" );
104static const wxChar UpdateUIEventInterval[] = wxT( "UpdateUIEventInterval" );
105static const wxChar V3DRT_BevelHeight_um[] = wxT( "V3DRT_BevelHeight_um" );
106static const wxChar V3DRT_BevelExtentFactor[] = wxT( "V3DRT_BevelExtentFactor" );
107static const wxChar EnablePcbDesignBlocks[] = wxT( "EnablePcbDesignBlocks" );
108static const wxChar EnableGenerators[] = wxT( "EnableGenerators" );
109static const wxChar EnableLibWithText[] = wxT( "EnableLibWithText" );
110static const wxChar EnableLibDir[] = wxT( "EnableLibDir" );
111static const wxChar DisambiguationTime[] = wxT( "DisambiguationTime" );
112static const wxChar PcbSelectionVisibilityRatio[] = wxT( "PcbSelectionVisibilityRatio" );
113static const wxChar FontErrorSize[] = wxT( "FontErrorSize" );
114static const wxChar OcePluginLinearDeflection[] = wxT( "OcePluginLinearDeflection" );
115static const wxChar OcePluginAngularDeflection[] = wxT( "OcePluginAngularDeflection" );
116static const wxChar TriangulateSimplificationLevel[] = wxT( "TriangulateSimplificationLevel" );
117static const wxChar TriangulateMinimumArea[] = wxT( "TriangulateMinimumArea" );
118static const wxChar EnableCacheFriendlyFracture[] = wxT( "EnableCacheFriendlyFracture" );
119static const wxChar EnableAPILogging[] = wxT( "EnableAPILogging" );
120static const wxChar MaxFileSystemWatchers[] = wxT( "MaxFileSystemWatchers" );
121static const wxChar MinorSchematicGraphSize[] = wxT( "MinorSchematicGraphSize" );
122static const wxChar ResolveTextRecursionDepth[] = wxT( "ResolveTextRecursionDepth" );
123static const wxChar EnableExtensionSnaps[] = wxT( "EnableExtensionSnaps" );
124static const wxChar ExtensionSnapTimeoutMs[] = wxT( "ExtensionSnapTimeoutMs" );
125static const wxChar ExtensionSnapActivateOnHover[] = wxT( "ExtensionSnapActivateOnHover" );
126static const wxChar EnableSnapAnchorsDebug[] = wxT( "EnableSnapAnchorsDebug" );
127static const wxChar SnapHysteresis[] = wxT( "SnapHysteresis" );
128static const wxChar SnapToAnchorMargin[] = wxT( "SnapToAnchorMargin" );
129static const wxChar MinParallelAngle[] = wxT( "MinParallelAngle" );
130static const wxChar HoleWallPaintingMultiplier[] = wxT( "HoleWallPaintingMultiplier" );
131static const wxChar MsgPanelShowUuids[] = wxT( "MsgPanelShowUuids" );
132static const wxChar MaximumThreads[] = wxT( "MaximumThreads" );
134 wxT( "NetInspectorBulkUpdateOptimisationThreshold" );
135static const wxChar ExcludeFromSimulationLineWidth[] = wxT( "ExcludeFromSimulationLineWidth" );
136static const wxChar SimulatorMultiRunCombinationLimit[] = wxT( "SimulatorMultiRunCombinationLimit" );
137static const wxChar GitIconRefreshInterval[] = wxT( "GitIconRefreshInterval" );
138static const wxChar ConfigurableToolbars[] = wxT( "ConfigurableToolbars" );
139static const wxChar MaxPastedTextLength[] = wxT( "MaxPastedTextLength" );
140static const wxChar PNSProcessClusterTimeout[] = wxT( "PNSProcessClusterTimeout" );
141static const wxChar ImportSkipComponentBodies[] = wxT( "ImportSkipComponentBodies" );
142static const wxChar ScreenDPI[] = wxT( "ScreenDPI" );
143static const wxChar EnableVariantsUI[] = wxT( "EnableVariantsUI" );
144static const wxChar EnableUseAuiPerspective[] = wxT( "EnableUseAuiPerspective" );
145static const wxChar HistoryLockStaleTimeout[] = wxT( "HistoryLockStaleTimeout" );
146
147} // namespace AC_KEYS
148
149
154namespace AC_GROUPS
155{
156static const wxChar V3D_RayTracing[] = wxT( "G_3DV_RayTracing" );
157}
158
159/*
160 * Get a simple string for common parameters.
161 *
162 * This isn't exhaustive, but it covers most common types that might be
163 * used in the advance config
164 */
165wxString dumpParamCfg( const PARAM_CFG& aParam )
166{
167 wxString s = aParam.m_Ident + wxS( ": " );
168
169 /*
170 * This implementation is rather simplistic, but it is
171 * effective enough for simple uses. A better implementation would be
172 * some kind of visitor, but that's somewhat more work.
173 */
174 switch( aParam.m_Type )
175 {
177 case paramcfg_id::PARAM_INT_WITH_SCALE: s << *static_cast<const PARAM_CFG_INT&>( aParam ).m_Pt_param; break;
178 case paramcfg_id::PARAM_DOUBLE: s << *static_cast<const PARAM_CFG_DOUBLE&>( aParam ).m_Pt_param; break;
179 case paramcfg_id::PARAM_WXSTRING: s << *static_cast<const PARAM_CFG_WXSTRING&>( aParam ).m_Pt_param; break;
180 case paramcfg_id::PARAM_FILENAME: s << *static_cast<const PARAM_CFG_FILENAME&>( aParam ).m_Pt_param; break;
182 s << ( *static_cast<const PARAM_CFG_BOOL&>( aParam ).m_Pt_param ? wxS( "true" ) : wxS( "false" ) );
183 break;
184 default: s << wxS( "Unsupported PARAM_CFG variant: " ) << aParam.m_Type;
185 }
186
187 return s;
188}
189
190
194static void dumpCfg( const std::vector<std::unique_ptr<PARAM_CFG>>& aArray )
195{
196 // only dump if we need to
197 if( !wxLog::IsAllowedTraceMask( AdvancedConfigMask ) )
198 return;
199
200 for( const auto& param : aArray )
201 {
202 wxLogTrace( AdvancedConfigMask, dumpParamCfg( *param ) );
203 }
204}
205
206
212static wxFileName getAdvancedCfgFilename()
213{
214 const static wxString cfg_filename{ wxS( "kicad_advanced" ) };
215 return wxFileName( PATHS::GetUserSettingsPath(), cfg_filename );
216}
217
218
220{
221 wxLogTrace( AdvancedConfigMask, wxS( "Init advanced config" ) );
222
223 // Init defaults - this is done in case the config doesn't exist,
224 // then the values will remain as set here.
227 m_EnableRouterDump = false;
228 m_HyperZoom = false;
229 m_DrawArcAccuracy = 10.0;
232 m_MaxTrackLengthToKeep = 0.0005;
235
236 m_ExtraClearance = 0.0005;
237 m_EnableCreepageSlot = false;
238 m_DRCEpsilon = 0.0005; // 0.5um is small enough not to materially violate
239 // any constraints.
241 m_SliverMinimumLength = 0.0008;
243
244 m_HoleWallThickness = 0.020; // IPC-6012 says 15-18um; Cadence says at least
245 // 0.020 for a Class 2 board and at least 0.025
246 // for Class 3.
247
248 m_MinPlotPenWidth = 0.0212; // 1 pixel at 1200dpi.
249
250 m_DebugZoneFiller = false;
251 m_DebugPDFWriter = false;
252 m_PDFStrokeFontWidthFactor = .12; // default 12% of EM
257 m_UsePdfPrint = false;
259 m_HotkeysDumper = false;
260 m_DrawBoundingBoxes = false;
266 m_ShowEventCounters = false;
268 m_CompactSave = false;
270 m_ShowRepairSchematic = false;
272 m_EnableGenerators = false;
273 m_EnableLibWithText = false;
274 m_EnableLibDir = false;
275
277 m_3DRT_BevelExtentFactor = 1.0 / 16.0;
278
279 m_EnableAPILogging = false;
280
282
284
286
288
289 m_FontErrorSize = 2;
290
293
296
298
300
302
304
311
312 m_MinParallelAngle = 0.001;
314
316
318
321
323
325
327
328 m_PNSProcessClusterTimeout = 100; // Default: 100 ms
329
331
332 m_ScreenDPI = 91;
333
334 m_EnableVariantsUI = false;
335
337 m_HistoryLockStaleTimeout = 300; // 5 minutes default
338
340}
341
342
344{
345 static ADVANCED_CFG instance;
346 return instance;
347}
348
349
354
355
357{
358 wxFileName k_advanced = getAdvancedCfgFilename();
359 wxFileConfig file_cfg( wxS( "" ), wxS( "" ), k_advanced.GetFullPath() );
360
361 wxConfigSaveSetups( &file_cfg, m_entries );
362}
363
364
366{
367 const wxFileName k_advanced = getAdvancedCfgFilename();
368
369 // If we are running headless, use the class defaults because we cannot instantiate wxConfig
370 if( !wxTheApp )
371 return;
372
373 if( !k_advanced.FileExists() )
374 {
375 wxLogTrace( AdvancedConfigMask, wxS( "File does not exist %s" ), k_advanced.GetFullPath() );
376
377 // load the defaults
378 wxConfig emptyConfig;
379 loadSettings( emptyConfig );
380
381 return;
382 }
383
384 wxLogTrace( AdvancedConfigMask, wxS( "Loading advanced config from: %s" ), k_advanced.GetFullPath() );
385
386 wxFileConfig file_cfg( wxS( "" ), wxS( "" ), k_advanced.GetFullPath() );
387 loadSettings( file_cfg );
388}
389
390
391void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
392{
393 m_entries.clear();
394
395 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::ExtraFillMargin, &m_ExtraClearance,
396 m_ExtraClearance, 0.0, 1.0 ) );
397
398 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableCreepageSlot, &m_EnableCreepageSlot,
400
401 m_entries.push_back(
402 std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCEpsilon, &m_DRCEpsilon, m_DRCEpsilon, 0.0, 1.0 ) );
403
404 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>(
406
407 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>(
409
410 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>(
412
413 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::HoleWallThickness, &m_HoleWallThickness,
414 m_HoleWallThickness, 0.0, 1.0 ) );
415
416 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::CoroutineStackSize, &m_CoroutineStackSize,
419
420 m_entries.push_back( std::make_unique<PARAM_CFG_INT>(
422
423 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowRouterDebugGraphics,
425
426 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableRouterDump, &m_EnableRouterDump,
428
429 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HyperZoom, &m_HyperZoom, m_HyperZoom ) );
430
431 m_entries.push_back(
432 std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::CompactFileSave, &m_CompactSave, m_CompactSave ) );
433
434 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DrawArcAccuracy, &m_DrawArcAccuracy,
435 m_DrawArcAccuracy, 0.0, 100000.0 ) );
436
437 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DrawArcCenterStartEndMaxAngle,
439 100000.0 ) );
440
441 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MaxTangentTrackAngleDeviation,
443 0.0, 90.0 ) );
444
445 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>(
447
448 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ExtraZoneDisplayModes,
450
451 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>(
453
454 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MinPlotPenWidth, &m_MinPlotPenWidth,
455 m_MinPlotPenWidth, 0.0, 1.0 ) );
456
457 m_entries.push_back(
458 std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DebugZoneFiller, &m_DebugZoneFiller, m_DebugZoneFiller ) );
459
460 m_entries.push_back(
461 std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DebugPDFWriter, &m_DebugPDFWriter, m_DebugPDFWriter ) );
462
463 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>(
465
466 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::PDFStrokeFontXOffset,
468
469 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::PDFStrokeFontYOffset,
471
472 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::PDFStrokeFontBoldMultiplier,
475
476 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>(
478
479 m_entries.push_back(
480 std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::UsePdfPrint, &m_UsePdfPrint, m_UsePdfPrint ) );
481
482 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::SmallDrillMarkSize, &m_SmallDrillMarkSize,
483 m_SmallDrillMarkSize, 0.0, 3.0 ) );
484
485 m_entries.push_back(
486 std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HotkeysDumper, &m_HotkeysDumper, m_HotkeysDumper ) );
487
488 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DrawBoundingBoxes, &m_DrawBoundingBoxes,
490
491 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowPcbnewExportNetlist,
493
494 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Skip3DModelFileCache, &m_Skip3DModelFileCache,
496
497 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Skip3DModelMemoryCache,
499
500 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HideVersionFromTitle, &m_HideVersionFromTitle,
502
503 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowRepairSchematic, &m_ShowRepairSchematic,
505
506 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowEventCounters, &m_ShowEventCounters,
508
509 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::AllowManualCanvasScale,
511
512 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::V3DRT_BevelHeight_um, &m_3DRT_BevelHeight_um,
513 m_3DRT_BevelHeight_um, 0, std::numeric_limits<int>::max(),
515
516 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::V3DRT_BevelExtentFactor,
518 100.0, AC_GROUPS::V3D_RayTracing ) );
519
520 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Use3DConnexionDriver, &m_Use3DConnexionDriver,
522
523 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::IncrementalConnectivity,
525
526 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::DisambiguationTime, &m_DisambiguationMenuDelay,
527 m_DisambiguationMenuDelay, 50, 10000 ) );
528
529 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnablePcbDesignBlocks,
531
532 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableGenerators, &m_EnableGenerators,
534
535 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableAPILogging, &m_EnableAPILogging,
537
538 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableLibWithText, &m_EnableLibWithText,
540
541 m_entries.push_back(
542 std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableLibDir, &m_EnableLibDir, m_EnableLibDir ) );
543
544 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::PcbSelectionVisibilityRatio,
546 m_PcbSelectionVisibilityRatio, 0.0, 1.0 ) );
547
548 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::FontErrorSize, &m_FontErrorSize,
549 m_FontErrorSize, 0.01, 100 ) );
550
551 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::OcePluginLinearDeflection,
553 0.01, 1.0 ) );
554
555 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::OcePluginAngularDeflection,
557 m_OcePluginAngularDeflection, 0.01, 360.0 ) );
558
559 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::TriangulateSimplificationLevel,
562
563 m_entries.push_back( std::make_unique<PARAM_CFG_INT>(
565
566 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableCacheFriendlyFracture,
569
570 m_entries.push_back( std::make_unique<PARAM_CFG_INT>(
572
573 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MinorSchematicGraphSize,
575 2147483647 ) );
576
577 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ResolveTextRecursionDepth,
579 10 ) );
580
581 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableExtensionSnaps, &m_EnableExtensionSnaps,
583
584 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ExtensionSnapTimeoutMs,
586
587 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ExtensionSnapActivateOnHover,
590
591 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableSnapAnchorsDebug,
593
594 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::SnapHysteresis, &m_SnapHysteresis,
595 m_SnapHysteresis, 0, 100 ) );
596
597 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::SnapToAnchorMargin, &m_SnapToAnchorMargin,
598 m_SnapToAnchorMargin, 1.0, 2.0 ) );
599
600 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MinParallelAngle, &m_MinParallelAngle,
601 m_MinParallelAngle, 0.0, 45.0 ) );
602
603 m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::HoleWallPaintingMultiplier,
605 m_HoleWallPaintingMultiplier, 0.1, 100.0 ) );
606
607 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MsgPanelShowUuids, &m_MsgPanelShowUuids,
609
610 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MaximumThreads, &m_MaximumThreads,
611 m_MaximumThreads, 0, 500 ) );
612
613 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::NetInspectorBulkUpdateOptimisationThreshold,
616
617 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ExcludeFromSimulationLineWidth,
620
621 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::SimulatorMultiRunCombinationLimit,
624
625 m_entries.push_back( std::make_unique<PARAM_CFG_INT>(
627
628 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ConfigurableToolbars, &m_ConfigurableToolbars,
630
631 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MaxPastedTextLength, &m_MaxPastedTextLength,
632 m_MaxPastedTextLength, 0, 100000 ) );
633
634 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::PNSProcessClusterTimeout,
635 &m_PNSProcessClusterTimeout, 100, 10, 10000 ) );
636
637 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>(
639
640 m_entries.push_back(
641 std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ScreenDPI, &m_ScreenDPI, m_ScreenDPI, 50, 500 ) );
642
643 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableVariantsUI, &m_EnableVariantsUI,
645
646 m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableUseAuiPerspective,
648
649 m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::HistoryLockStaleTimeout,
651 86400 ) ); // 10 seconds to 24 hours
652
653 // Special case for trace mask setting...we just grab them and set them immediately
654 // Because we even use wxLogTrace inside of advanced config
655 m_entries.push_back( std::make_unique<PARAM_CFG_WXSTRING>( true, AC_KEYS::TraceMasks, &m_traceMasks, wxS( "" ) ) );
656
657 // Load the config from file
659
660 // Now actually set the trace masks
661 wxStringTokenizer traceMaskTokenizer( m_traceMasks, ", ", wxTOKEN_STRTOK );
662
663 while( traceMaskTokenizer.HasMoreTokens() )
664 {
665 wxString mask = traceMaskTokenizer.GetNextToken();
666 wxLog::AddTraceMask( mask );
667 }
668
670
671 wxLogTrace( kicadTraceCoroutineStack, wxT( "Using coroutine stack size %d" ), m_CoroutineStackSize );
672}
wxString dumpParamCfg(const PARAM_CFG &aParam)
static const wxChar AdvancedConfigMask[]
static void dumpCfg(const std::vector< std::unique_ptr< PARAM_CFG > > &aArray)
Dump the configs in the given array to trace.
static wxFileName getAdvancedCfgFilename()
Get the filename for the advanced config file.
void loadFromConfigFile()
Load the config from the normal configuration file.
void Save()
Save the configuration to the configuration file.
std::vector< std::unique_ptr< PARAM_CFG > > m_entries
void Reload()
Reload the configuration from the configuration file.
void loadSettings(wxConfigBase &aCfg)
Load config from the given configuration base.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
A base class which establishes the interface functions ReadParam and SaveParam, which are implemented...
paramcfg_id m_Type
Type of parameter.
wxString m_Ident
Keyword in config data.
static wxString GetUserSettingsPath()
Return the user configuration path used to store KiCad's configuration files.
Definition paths.cpp:612
void wxConfigLoadSetups(wxConfigBase *aCfg, const std::vector< std::unique_ptr< PARAM_CFG > > &aList)
Use aList of PARAM_CFG object to load configuration values from aCfg.
void wxConfigSaveSetups(wxConfigBase *aCfg, const std::vector< std::unique_ptr< PARAM_CFG > > &aList)
Writes aList of PARAM_CFG objects to aCfg.
@ PARAM_WXSTRING
@ PARAM_INT_WITH_SCALE
@ PARAM_INT
@ PARAM_FILENAME
@ PARAM_DOUBLE
@ PARAM_BOOL
bool m_Skip3DModelFileCache
Skip reading/writing 3D model file caches.
bool m_EnableUseAuiPerspective
Enable use Aui Perspective to store/load geometry of main editor frames.
bool m_ShowRepairSchematic
Enable showing schematic repair output.
double m_DrawArcCenterMaxAngle
When drawing an arc, the angle ( center - start ) - ( start - end ) can be limited to avoid extremely...
int m_DisambiguationMenuDelay
The number of milliseconds to wait in a click before showing a disambiguation menu.
int m_ScreenDPI
Screen DPI setting for display calculations.
bool m_EnableLibDir
Enable option to open lib file directory.
double m_MaxTangentAngleDeviation
Maximum angle between the tangent line of an arc track and a connected straight track in order to com...
bool m_Use3DConnexionDriver
Use the 3DConnexion Driver.
int m_TriangulateSimplificationLevel
The number of internal units that will be allowed to deflect from the base segment when creating a ne...
bool m_EnableCacheFriendlyFracture
Enable the use of a cache-friendlier and therefore faster version of the polygon fracture algorithm.
bool m_EnableVariantsUI
Enable access to the variants user interface.
bool m_ShowRouterDebugGraphics
Show PNS router debug graphics while routing.
bool m_Skip3DModelMemoryCache
Skip reading/writing 3D model memory caches.
double m_HoleWallPaintingMultiplier
What factor to use when painting via and PTH pad hole walls, so that the painted hole wall can be ove...
bool m_EnableLibWithText
Enable option to load lib files with text editor.
double m_PDFStrokeFontKerningFactor
Kerning (spacing) factor applied to glyph advance (width).
int m_MaximumThreads
Default value for the maximum number of threads to use for parallel processing.
double m_HoleWallThickness
Dimension used to calculate the actual hole size from the finish hole size.
double m_PDFStrokeFontXOffset
Horizontal offset factor applied to stroke font glyph coordinates (in EM units) after to compensate m...
int m_CoroutineStackSize
Configure the coroutine stack size in bytes.
double m_PDFStrokeFontYOffset
Vertical offset factor applied to stroke font glyph coordinates (in EM units) after Y inversion to co...
double m_SmallDrillMarkSize
The diameter of the drill marks on print and plot outputs (in mm) when the "Drill marks" option is se...
bool m_ConfigurableToolbars
Enable the UI to configure toolbars.
wxString m_traceMasks
Trace masks for wxLogTrace, loaded from the config file.
bool m_EnableGenerators
Enable support for generators.
bool m_IncrementalConnectivity
Use the new incremental netlister for realtime jobs.
double m_ExtraClearance
When filling zones, we add an extra amount of clearance to each zone to ensure that rounding errors d...
int m_TriangulateMinimumArea
The minimum area of a polygon that can be left over after triangulation and still consider the triang...
bool m_DrawBoundingBoxes
Draw GAL bounding boxes in painters.
bool m_EnableRouterDump
Enable PNS router to dump state information for debug purpose (press 0 while routing)
double m_PDFStrokeFontBoldMultiplier
Multiplier applied to stroke width factor when rendering bold stroke font subsets.
double m_DRCEpsilon
Epsilon for DRC tests.
double m_PDFStrokeFontWidthFactor
Stroke font line width factor relative to EM size for PDF stroke fonts.
int m_GitIconRefreshInterval
The interval in milliseconds to refresh the git icons in the project tree.
double m_SliverAngleTolerance
Sliver angle to tolerance for DRC.
bool m_AllowManualCanvasScale
Allow manual scaling of canvas.
double m_SliverWidthTolerance
Sliver width tolerance for DRC.
double m_OcePluginLinearDeflection
OCE (STEP/IGES) 3D Plugin Tesselation Linear Deflection.
bool m_EnablePcbDesignBlocks
Enable the new PCB Design Blocks feature.
double m_MinParallelAngle
Minimum overlapping angle for which an arc is considered to be parallel to its paired arc.
int m_ExcludeFromSimulationLineWidth
The line width in mils for the exclude from simulation outline.
int m_MinorSchematicGraphSize
Set the number of items in a schematic graph for it to be considered "minor".
int m_NetInspectorBulkUpdateOptimisationThreshold
When updating the net inspector, it either recalculates all nets or iterates through items one-by-one...
bool m_ExtraZoneDisplayModes
When true, adds zone-display-modes for stroking the zone fracture boundaries and the zone triangulati...
double m_MinPlotPenWidth
Absolute minimum pen width for plotting.
double m_SliverMinimumLength
Sliver length tolerance for DRC.
double m_MaxTrackLengthToKeep
Maximum track length to keep after doing an arc track resizing operation.
double m_DrawArcAccuracy
Distance from an arc end point and the estimated end point, when rotating from the start point to the...
bool m_HotkeysDumper
Enable the hotkeys dumper feature for generating documentation.
double m_FontErrorSize
Deviation between font's bezier curve ideal and the poligonized curve.
int m_UpdateUIEventInterval
The update interval the wxWidgets sends wxUpdateUIEvents to windows.
double m_3DRT_BevelExtentFactor
3D-Viewer raytracing factor applied to Extent.z of the item layer.
double m_OcePluginAngularDeflection
OCE (STEP/IGES) 3D Plugin Tesselation Angular Deflection.
bool m_EnableSnapAnchorsDebug
Enable snap anchors debug visualization.
bool m_ShowPcbnewExportNetlist
Enable exporting board editor netlist to a file for troubleshooting purposes.
int m_ResolveTextRecursionDepth
The number of recursions to resolve text variables.
int m_MaxFilesystemWatchers
Maximum number of filesystem watchers to use.
int m_SnapHysteresis
Hysteresis in pixels used for snap activation and deactivation.
bool m_DebugPDFWriter
A mode that writes PDFs without compression.
int m_SimulatorMultiRunCombinationLimit
Maximum number of tuner combinations simulated when using multi-run mode.
int m_MsgPanelShowUuids
Show UUIDs of items in the message panel.
int m_PNSProcessClusterTimeout
Timeout for the PNS router's processCluster wallclock timeout, in milliseconds.
bool m_EnableCreepageSlot
Enable the minimum slot width check for creepage.
bool m_EnableAPILogging
Log IPC API requests and responses.
bool m_ShowEventCounters
Shows debugging event counters in various places.
int m_HistoryLockStaleTimeout
Stale lock timeout for local history repository locks, in seconds.
int m_MaxPastedTextLength
Set the maximum number of characters that can be pasted without warning.
bool m_HyperZoom
Slide the zoom steps over for debugging things "up close".
double m_SnapToAnchorMargin
Margin multiplier for preferring anchors over construction line snaps.
bool m_DrawTriangulationOutlines
Enable drawing the triangulation outlines with a visible color.
bool m_ExtensionSnapActivateOnHover
If extension snaps are enabled, 'activate' items on hover, even if not near a snap point.
double m_PcbSelectionVisibilityRatio
Board object selection visibility limit.
int m_3DRT_BevelHeight_um
Set the bevel height of layer items in 3D viewer when ray tracing.
bool m_EnableExtensionSnaps
Enable snap anchors based on item line extensions.
bool m_UsePdfPrint
Use legacy wxWidgets-based printing.
bool m_CompactSave
Save files in compact display mode.
bool m_ImportSkipComponentBodies
Skip importing component bodies when importing some format files, such as Altium.
bool m_HideVersionFromTitle
Hide the build version from the KiCad manager frame title.
int m_ExtensionSnapTimeoutMs
If extension snaps are enabled, this is the timeout in milliseconds before a hovered item gets extens...
bool m_DebugZoneFiller
A mode that dumps the various stages of a F_Cu fill into In1_Cu through In9_Cu.
const wxChar *const kicadTraceCoroutineStack
Flag to enable tracing of the coroutine call stack.
List of known groups for advanced configuration options.
static const wxChar V3D_RayTracing[]
List of known keys for advanced configuration options.
static const wxChar DebugPDFWriter[]
static const wxChar SimulatorMultiRunCombinationLimit[]
static const wxChar HotkeysDumper[]
static const wxChar EnableAPILogging[]
static const wxChar ExtensionSnapActivateOnHover[]
static const wxChar ShowRepairSchematic[]
static const wxChar HideVersionFromTitle[]
static const wxChar PNSProcessClusterTimeout[]
static const wxChar AllowManualCanvasScale[]
static const wxChar SnapHysteresis[]
static const wxChar NetInspectorBulkUpdateOptimisationThreshold[]
static const wxChar MaxTangentTrackAngleDeviation[]
static const wxChar MaxTrackLengthToKeep[]
static const wxChar EnableLibDir[]
static const wxChar ShowPcbnewExportNetlist[]
static const wxChar PDFStrokeFontWidthFactor[]
static const wxChar EnablePcbDesignBlocks[]
static const wxChar EnableLibWithText[]
static const wxChar DrawBoundingBoxes[]
static const wxChar MaxPastedTextLength[]
static const wxChar EnableGenerators[]
static const wxChar MinPlotPenWidth[]
static const wxChar CoroutineStackSize[]
static const wxChar EnableVariantsUI[]
static const wxChar SnapToAnchorMargin[]
static const wxChar HoleWallThickness[]
static const wxChar DRCSliverWidthTolerance[]
static const wxChar DisambiguationTime[]
static const wxChar HyperZoom[]
static const wxChar IncrementalConnectivity[]
static const wxChar MinParallelAngle[]
static const wxChar DebugZoneFiller[]
static const wxChar OcePluginLinearDeflection[]
static const wxChar StrokeTriangulation[]
static const wxChar CompactFileSave[]
static const wxChar EnableExtensionSnaps[]
static const wxChar DRCSliverAngleTolerance[]
static const wxChar UpdateUIEventInterval[]
static const wxChar V3DRT_BevelHeight_um[]
static const wxChar MinorSchematicGraphSize[]
static const wxChar ShowRouterDebugGraphics[]
static const wxChar FontErrorSize[]
static const wxChar DRCEpsilon[]
static const wxChar HistoryLockStaleTimeout[]
static const wxChar EnableSnapAnchorsDebug[]
static const wxChar V3DRT_BevelExtentFactor[]
static const wxChar EnableRouterDump[]
static const wxChar DrawArcAccuracy[]
static const wxChar Skip3DModelMemoryCache[]
static const wxChar TriangulateSimplificationLevel[]
static const wxChar ExtraZoneDisplayModes[]
static const wxChar MaxFileSystemWatchers[]
static const wxChar ExcludeFromSimulationLineWidth[]
static const wxChar Skip3DModelFileCache[]
static const wxChar ImportSkipComponentBodies[]
static const wxChar EnableCacheFriendlyFracture[]
static const wxChar HoleWallPaintingMultiplier[]
static const wxChar ResolveTextRecursionDepth[]
static const wxChar SmallDrillMarkSize[]
static const wxChar EnableCreepageSlot[]
static const wxChar EnableUseAuiPerspective[]
static const wxChar PDFStrokeFontYOffset[]
static const wxChar DrawArcCenterStartEndMaxAngle[]
static const wxChar ExtraFillMargin[]
static const wxChar PcbSelectionVisibilityRatio[]
static const wxChar TriangulateMinimumArea[]
static const wxChar PDFStrokeFontKerningFactor[]
static const wxChar OcePluginAngularDeflection[]
static const wxChar ExtensionSnapTimeoutMs[]
static const wxChar DRCSliverMinimumLength[]
static const wxChar ShowEventCounters[]
static const wxChar UsePdfPrint[]
static const wxChar ScreenDPI[]
static const wxChar PDFStrokeFontXOffset[]
static const wxChar PDFStrokeFontBoldMultiplier[]
static const wxChar MaximumThreads[]
static const wxChar GitIconRefreshInterval[]
static const wxChar TraceMasks[]
static const wxChar Use3DConnexionDriver[]
static const wxChar MsgPanelShowUuids[]
static const wxChar ConfigurableToolbars[]
Limits and default settings for the coroutine stack size allowed.
static constexpr int min_stack
static constexpr int max_stack
static constexpr int default_stack
wxLogTrace helper definitions.