2018-12-10 10:56:28 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2022-01-08 15:56:41 +00:00
|
|
|
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2018-12-10 10:56:28 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ADVANCED_CFG__H
|
|
|
|
#define ADVANCED_CFG__H
|
|
|
|
|
|
|
|
class wxConfigBase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class containing "advanced" configuration options.
|
|
|
|
*
|
|
|
|
* Options set here are for developer or advanced users only. If a general user
|
|
|
|
* needs to set one of these for normal KiCad use, either:
|
|
|
|
* * They are working around some bug that should be fixed, or
|
|
|
|
* * The parameter they are setting is of general interest and should be in the
|
|
|
|
* main application config, with UI provided.
|
|
|
|
*
|
|
|
|
* Options in this class are, in general, preferable to #defines, as they
|
|
|
|
* allow more flexible configuration by developers, and don't hide code from
|
|
|
|
* the compiler on other configurations, which can result in broken builds.
|
|
|
|
*
|
|
|
|
* Never use advanced configs in an untestable way. If a function depends on
|
|
|
|
* advanced config such that you cannot test it without changing the config,
|
|
|
|
* "lift" the config to a higher level and make pass it as parameter of the code
|
|
|
|
* under test. The tests can pass their own values as needed.
|
|
|
|
*
|
|
|
|
* This also applies to code that does not depend on "common" - it cannot
|
|
|
|
* use this class, so you must pass configuration in as proper parameters.
|
|
|
|
*
|
|
|
|
* Sometimes you can just use values directly, and sometimes helper functions
|
|
|
|
* might be provided to allow extra logic (for example when a advanced config
|
|
|
|
* applies only on certain platforms).
|
|
|
|
*
|
|
|
|
* For more information on what config keys set these parameters in the
|
|
|
|
* config files, and why you might want to set them, see #AC_KEYS
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class ADVANCED_CFG
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2020-11-16 11:16:44 +00:00
|
|
|
* Get the singleton instance's config, which is shared by all consumers.
|
2018-12-10 10:56:28 +00:00
|
|
|
*
|
2020-09-23 09:35:13 +00:00
|
|
|
* This configuration is read-only - to set options, users should add the parameters to
|
|
|
|
* their config files at ~/.config/kicad/advanced, or the platform equivalent.
|
2018-12-10 10:56:28 +00:00
|
|
|
*/
|
|
|
|
static const ADVANCED_CFG& GetCfg();
|
|
|
|
|
2020-08-09 23:03:31 +00:00
|
|
|
/**
|
2020-09-23 09:35:13 +00:00
|
|
|
* Distance from an arc end point and the estimated end point, when rotating from the
|
|
|
|
* start point to the end point.
|
2020-08-09 23:03:31 +00:00
|
|
|
*/
|
2020-11-16 11:16:44 +00:00
|
|
|
double m_DrawArcAccuracy;
|
2020-08-09 23:03:31 +00:00
|
|
|
|
|
|
|
/**
|
2020-11-16 11:16:44 +00:00
|
|
|
* When drawing an arc, the angle ( center - start ) - ( start - end ) can be limited to
|
|
|
|
* avoid extremely high radii.
|
2020-08-09 23:03:31 +00:00
|
|
|
*/
|
2020-11-16 11:16:44 +00:00
|
|
|
double m_DrawArcCenterMaxAngle;
|
2020-08-09 23:03:31 +00:00
|
|
|
|
2021-03-31 20:13:08 +00:00
|
|
|
/**
|
|
|
|
* Maximum angle between the tangent line of an arc track and a connected straight track
|
|
|
|
* in order to commence arc dragging. Units are degrees.
|
|
|
|
*/
|
|
|
|
double m_MaxTangentAngleDeviation;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maximum track length to keep after doing an arc track resizing operation. Units are mm.
|
|
|
|
*/
|
|
|
|
double m_MaxTrackLengthToKeep;
|
|
|
|
|
2020-07-26 14:20:24 +00:00
|
|
|
/**
|
2020-09-02 22:15:30 +00:00
|
|
|
* Extra fill clearance for zone fills. Note that for zone tests this is essentially
|
2020-09-08 19:18:50 +00:00
|
|
|
* additive with m_DRCEpsilon. Units are mm.
|
2020-07-26 14:20:24 +00:00
|
|
|
*/
|
2020-09-08 19:18:50 +00:00
|
|
|
double m_ExtraClearance;
|
2020-07-26 14:20:24 +00:00
|
|
|
|
2020-09-02 22:15:30 +00:00
|
|
|
/**
|
|
|
|
* Epsilon for DRC tests. Note that for zone tests this is essentially additive with
|
2021-04-22 12:43:05 +00:00
|
|
|
* m_ExtraClearance. Units are mm.
|
2020-09-02 22:15:30 +00:00
|
|
|
*/
|
|
|
|
double m_DRCEpsilon;
|
|
|
|
|
2021-08-11 13:01:30 +00:00
|
|
|
/**
|
|
|
|
* Sliver tolerances for DRC. Units are mm and deg.
|
|
|
|
*/
|
|
|
|
double m_SliverWidthTolerance;
|
|
|
|
double m_SliverAngleTolerance;
|
|
|
|
|
2020-09-03 14:58:49 +00:00
|
|
|
/**
|
|
|
|
* Hole wall plating thickness. Used to determine actual hole size from finish hole size.
|
2020-09-08 19:18:50 +00:00
|
|
|
* Units are mm.
|
2020-09-03 14:58:49 +00:00
|
|
|
*/
|
2020-09-08 19:18:50 +00:00
|
|
|
double m_HoleWallThickness;
|
2020-09-03 14:58:49 +00:00
|
|
|
|
2019-04-11 05:07:45 +00:00
|
|
|
/**
|
|
|
|
* Do real-time connectivity
|
|
|
|
*/
|
2020-11-16 11:16:44 +00:00
|
|
|
bool m_RealTimeConnectivity;
|
2019-04-11 05:07:45 +00:00
|
|
|
|
2019-08-15 04:25:05 +00:00
|
|
|
/**
|
|
|
|
* Set the stack size for coroutines
|
|
|
|
*/
|
2020-11-16 11:16:44 +00:00
|
|
|
int m_CoroutineStackSize;
|
2019-08-15 04:25:05 +00:00
|
|
|
|
2021-12-28 23:17:53 +00:00
|
|
|
/**
|
|
|
|
* The update interval the wxWidgets sends wxUpdateUIEvents to windows.
|
|
|
|
*
|
|
|
|
* The default is 0. Setting this to -1 will disable all automatic UI events. Any other
|
|
|
|
* value is the number of milliseconds between events.
|
|
|
|
*
|
|
|
|
* @see https://docs.wxwidgets.org/3.0/classwx_update_u_i_event.html#a24daac56f682b866baac592e761ccede.
|
|
|
|
*/
|
|
|
|
int m_UpdateUIEventInterval;
|
|
|
|
|
2020-07-03 23:33:36 +00:00
|
|
|
/**
|
|
|
|
* Show PNS router debug graphics
|
|
|
|
*/
|
|
|
|
bool m_ShowRouterDebugGraphics;
|
|
|
|
|
2020-07-25 21:53:58 +00:00
|
|
|
/**
|
|
|
|
* Save files in compact display mode
|
|
|
|
* When is is not specified, points are written one per line
|
|
|
|
*/
|
|
|
|
bool m_CompactSave;
|
|
|
|
|
2020-08-12 13:16:57 +00:00
|
|
|
/**
|
|
|
|
* When true, strokes the triangulations with visible color
|
|
|
|
*/
|
|
|
|
bool m_DrawTriangulationOutlines;
|
2020-01-13 01:44:19 +00:00
|
|
|
|
2021-07-26 17:56:11 +00:00
|
|
|
/**
|
|
|
|
* When true, adds zone-diaplay-modes for stroking the zone fracture boundaries and the zone
|
|
|
|
* triangulation.
|
|
|
|
*/
|
|
|
|
bool m_ExtraZoneDisplayModes;
|
|
|
|
|
2020-09-08 19:18:50 +00:00
|
|
|
/**
|
|
|
|
* Sets an absolute minimum pen width for plotting. Some formats (PDF, for example) don't
|
|
|
|
* like ultra-thin lines. Units are mm.
|
|
|
|
*/
|
|
|
|
double m_MinPlotPenWidth;
|
|
|
|
|
2020-09-23 09:35:13 +00:00
|
|
|
/**
|
|
|
|
* A mode that dumps the various stages of a F_Cu fill into In1_Cu through In9_Cu.
|
|
|
|
*/
|
|
|
|
bool m_DebugZoneFiller;
|
|
|
|
|
2020-11-06 10:32:14 +00:00
|
|
|
/**
|
2020-11-16 11:16:44 +00:00
|
|
|
* A mode that writes PDFs without compression.
|
2020-11-06 10:32:14 +00:00
|
|
|
*/
|
|
|
|
bool m_DebugPDFWriter;
|
|
|
|
|
2021-01-04 22:26:23 +00:00
|
|
|
/**
|
2021-03-28 12:37:54 +00:00
|
|
|
* The diameter of the drill marks on print and plot outputs (in mm),
|
2021-01-04 22:26:23 +00:00
|
|
|
* when the "Drill marks" option is set to "Small mark"
|
|
|
|
*/
|
|
|
|
double m_SmallDrillMarkSize;
|
|
|
|
|
2021-02-20 18:41:42 +00:00
|
|
|
/**
|
|
|
|
* Enable the hotkeys dumper feature, used for generating documentation
|
|
|
|
*/
|
|
|
|
bool m_HotkeysDumper;
|
|
|
|
|
2021-02-24 22:14:39 +00:00
|
|
|
/**
|
|
|
|
* Draw GAL bounding boxes in painters
|
|
|
|
*/
|
|
|
|
bool m_DrawBoundingBoxes;
|
|
|
|
|
2021-03-28 12:37:54 +00:00
|
|
|
/**
|
|
|
|
* Enable exporting board editor netlist to a file for troubleshooting purposes.
|
|
|
|
*/
|
|
|
|
bool m_ShowPcbnewExportNetlist;
|
|
|
|
|
2021-07-11 03:59:54 +00:00
|
|
|
/**
|
|
|
|
* Skip reading/writing 3d model file caches
|
2021-07-11 04:35:38 +00:00
|
|
|
* This does not prevent the models from being cached in memory meaning reopening the 3d viewer
|
|
|
|
* in the same project session will not reload model data from disk again.
|
2021-07-11 03:59:54 +00:00
|
|
|
*/
|
2021-07-11 04:35:38 +00:00
|
|
|
bool m_Skip3DModelFileCache;
|
2021-07-11 03:59:54 +00:00
|
|
|
|
2021-07-11 04:31:06 +00:00
|
|
|
/**
|
|
|
|
* Skip reading/writing 3d model memory caches
|
2021-07-11 04:35:38 +00:00
|
|
|
* This ensures 3d models are always reloaded from disk even if we previously opened the 3d viewer.
|
2021-07-11 04:31:06 +00:00
|
|
|
*/
|
2021-07-11 04:35:38 +00:00
|
|
|
bool m_Skip3DModelMemoryCache;
|
2021-07-11 04:31:06 +00:00
|
|
|
|
2021-07-14 22:24:21 +00:00
|
|
|
/**
|
|
|
|
* Hides the build version from the KiCad manager frame title.
|
|
|
|
* Useful for making screenshots/videos of KiCad without pinning to a specific version.
|
|
|
|
*/
|
|
|
|
bool m_HideVersionFromTitle;
|
|
|
|
|
2021-11-25 12:16:42 +00:00
|
|
|
bool m_ShowRepairSchematic;
|
|
|
|
|
2021-12-05 20:15:18 +00:00
|
|
|
/**
|
|
|
|
* Shows debugging event counters in various places.
|
|
|
|
*/
|
|
|
|
bool m_ShowEventCounters;
|
|
|
|
|
2021-12-09 23:36:44 +00:00
|
|
|
bool m_AllowManualCanvasScale;
|
|
|
|
|
2022-01-08 15:56:41 +00:00
|
|
|
/**
|
|
|
|
* Allows creating / deleting teardrops
|
|
|
|
*/
|
|
|
|
bool m_AllowTeardrops;
|
|
|
|
|
2018-12-10 10:56:28 +00:00
|
|
|
private:
|
|
|
|
ADVANCED_CFG();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load the config from the normal config file
|
|
|
|
*/
|
|
|
|
void loadFromConfigFile();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Load config from the given config base
|
|
|
|
*/
|
|
|
|
void loadSettings( wxConfigBase& aCfg );
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ADVANCED_CFG__H
|