From 25c03da5a55cfb3543d01550d773199e86efeb94 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Mon, 18 Dec 2023 08:32:41 -0500 Subject: [PATCH] Coding policy and Doxygen comment fixes. --- common/advanced_config.cpp | 195 +++++--------------- include/advanced_config.h | 274 ++++++++++++++++++++++++---- pcbnew/tools/pcb_selection_tool.cpp | 36 ++-- pcbnew/tools/pcb_selection_tool.h | 8 +- 4 files changed, 315 insertions(+), 198 deletions(-) diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index 65e47a71c8..a104016648 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -56,172 +56,52 @@ namespace AC_STACK /** * List of known keys for advanced configuration options. * - * Set these options in the file `kicad_advanced` in the - * KiCad config directory. + * Set these options in the file `kicad_advanced` in the KiCad configuration directory. */ namespace AC_KEYS { -/** - * Should the schematic use the new incremental connectivity algorithm - */ static const wxChar IncrementalConnectivity[] = wxT( "IncrementalConnectivity" ); - -/** - * Decide whether to attempt usage of the 3DConnexion mouse - */ static const wxChar Use3DConnexionDriver[] = wxT( "3DConnexionDriver" ); - -/** - * When filling zones, we add an extra amount of clearance to each zone to ensure that rounding - * errors do not overrun minimum clearance distances. This is the extra in mm. - */ static const wxChar ExtraFillMargin[] = wxT( "ExtraFillMargin" ); - -/** - * A fudge factor for DRC. Required to prevent false positives due to rounding errors, errors - * in polygonalization, etc. - * Previous versions hard-coded various values from 0.000005mm to 0.002mm. - */ static const wxChar DRCEpsilon[] = wxT( "DRCEpsilon" ); - -/** - * Angle and width tolerances for copper and solder mask sliver detection. - */ static const wxChar DRCSliverWidthTolerance[] = wxT( "DRCSliverWidthTolerance" ); static const wxChar DRCSliverMinimumLength[] = wxT( "DRCSliverMinimumLength" ); static const wxChar DRCSliverAngleTolerance[] = wxT( "DRCSliverAngleTolerance" ); - -/** - * Used to calculate the actual hole size from the finish hole size. - * IPC-6012 says 0.015-0.018mm; Cadence says at least 0.020mm for a Class 2 board and at least - * 0.025mm for Class 3. - */ static const wxChar HoleWallThickness[] = wxT( "HoleWallPlatingThickness" ); - -/** - * Configure the coroutine stack size in bytes. This should be allocated in multiples of - * the system page size (n*4096 is generally safe) - */ static const wxChar CoroutineStackSize[] = wxT( "CoroutineStackSize" ); - -/** - * Show PNS router debug graphics while routing - */ static const wxChar ShowRouterDebugGraphics[] = wxT( "ShowRouterDebugGraphics" ); - -/** - * Enable PNS router to dump state information for debug purpose (press `0` while routing) - */ static const wxChar EnableRouterDump[] = wxT( "EnableRouterDump" ); - -/** - * Slide the zoom steps over for debugging things "up close". - */ static const wxChar HyperZoom[] = wxT( "HyperZoom" ); - -/** - * When set to true, this will wrap polygon point sets at 4 points per line rather - * than a single point per line. Single point per line helps with version control systems - */ static const wxChar CompactFileSave[] = wxT( "CompactSave" ); - -/** - * For drawsegments - arcs. - * Distance from an arc end point and the estimated end point, - * when rotating from the start point to the end point. - * 0 will not allow any approximate result, and the arc will not show. - * Squared value for performances, in system unit. - */ static const wxChar DrawArcAccuracy[] = wxT( "DrawArcAccuracy" ); - -/** - * For drawsegments - arcs. - * When drawing an arc, the angle ( center - start ) - ( start - end ), - * can be limited to avoid extremely high radii. - * The value is the tan( angle ) - */ static const wxChar DrawArcCenterStartEndMaxAngle[] = wxT( "DrawArcCenterStartEndMaxAngle" ); - -/** - * 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. Units are degrees. - */ static const wxChar MaxTangentTrackAngleDeviation[] = wxT( "MaxTangentTrackAngleDeviation" ); - -/** - * For arc track interactive drag-resizing - * Maximum track length to keep after doing an arc track resizing operation. Units are mm. - */ static const wxChar MaxTrackLengthToKeep[] = wxT( "MaxTrackLengthToKeep" ); - -/** - * When true, GAL will stroke the triangulations (only used in OpenGL) with a visible color - */ static const wxChar StrokeTriangulation[] = wxT( "StrokeTriangulation" ); - -/** - * When true, a third zone-display-mode is included which strokes the filled areas and fracture - * boundaries. - */ static const wxChar ExtraZoneDisplayModes[] = wxT( "ExtraZoneDisplayModes" ); - -/** - * Absolute minimum pen width to send to the plotter. PDF seems happy enough with 0.0212mm - * (which equates to 1px @ 1200dpi). - */ static const wxChar MinPlotPenWidth[] = wxT( "MinPlotPenWidth" ); - static const wxChar DebugZoneFiller[] = wxT( "DebugZoneFiller" ); - static const wxChar DebugPDFWriter[] = wxT( "DebugPDFWriter" ); - -/** - * The diameter of the drill marks on print and plot outputs (in mm), - * when the "Drill marks" option is set to "Small mark" - */ static const wxChar SmallDrillMarkSize[] = wxT( "SmallDrillMarkSize" ); - static const wxChar HotkeysDumper[] = wxT( "HotkeysDumper" ); - static const wxChar DrawBoundingBoxes[] = wxT( "DrawBoundingBoxes" ); - static const wxChar ShowPcbnewExportNetlist[] = wxT( "ShowPcbnewExportNetlist" ); - static const wxChar Skip3DModelFileCache[] = wxT( "Skip3DModelFileCache" ); - static const wxChar Skip3DModelMemoryCache[] = wxT( "Skip3DModelMemoryCache" ); - static const wxChar HideVersionFromTitle[] = wxT( "HideVersionFromTitle" ); - static const wxChar TraceMasks[] = wxT( "TraceMasks" ); - static const wxChar ShowRepairSchematic[] = wxT( "ShowRepairSchematic" ); - static const wxChar ShowEventCounters[] = wxT( "ShowEventCounters" ); - static const wxChar AllowManualCanvasScale[] = wxT( "AllowManualCanvasScale" ); - static const wxChar UpdateUIEventInterval[] = wxT( "UpdateUIEventInterval" ); - static const wxChar V3DRT_BevelHeight_um[] = wxT( "V3DRT_BevelHeight_um" ); - static const wxChar V3DRT_BevelExtentFactor[] = wxT( "V3DRT_BevelExtentFactor" ); - static const wxChar UseClipper2[] = wxT( "UseClipper2" ); - static const wxChar EnableGenerators[] = wxT( "EnableGenerators" ); - static const wxChar EnableGit[] = wxT( "EnableGit" ); - static const wxChar EnableEeschemaPrintCairo[] = wxT( "EnableEeschemaPrintCairo" ); - -/** - * The time in milliseconds to wait before displaying a disambiguation menu. - */ static const wxChar DisambiguationTime[] = wxT( "DisambiguationTime" ); - static const wxChar PcbSelectionVisibilityRatio[] = wxT( "PcbSelectionVisibilityRatio" ); } // namespace KEYS @@ -394,7 +274,8 @@ void ADVANCED_CFG::loadFromConfigFile() return; } - wxLogTrace( AdvancedConfigMask, wxS( "Loading advanced config from: %s" ), k_advanced.GetFullPath() ); + wxLogTrace( AdvancedConfigMask, wxS( "Loading advanced config from: %s" ), + k_advanced.GetFullPath() ); wxFileConfig file_cfg( wxS( "" ), wxS( "" ), k_advanced.GetFullPath() ); loadSettings( file_cfg ); @@ -406,32 +287,39 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) std::vector configParams; configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin, - &m_ExtraClearance, m_ExtraClearance, 0.0, 1.0 ) ); + &m_ExtraClearance, + m_ExtraClearance, 0.0, 1.0 ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCEpsilon, &m_DRCEpsilon, m_DRCEpsilon, 0.0, 1.0 ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverWidthTolerance, - &m_SliverWidthTolerance, m_SliverWidthTolerance, 0.01, 0.25 ) ); + &m_SliverWidthTolerance, m_SliverWidthTolerance, + 0.01, 0.25 ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverMinimumLength, - &m_SliverMinimumLength, m_SliverMinimumLength, 1e-9, 10 ) ); + &m_SliverMinimumLength, m_SliverMinimumLength, + 1e-9, 10 ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverAngleTolerance, - &m_SliverAngleTolerance, m_SliverAngleTolerance, 1.0, 90.0 ) ); + &m_SliverAngleTolerance, m_SliverAngleTolerance, + 1.0, 90.0 ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::HoleWallThickness, - &m_HoleWallThickness, m_HoleWallThickness, 0.0, 1.0 ) ); + &m_HoleWallThickness, m_HoleWallThickness, + 0.0, 1.0 ) ); configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::CoroutineStackSize, &m_CoroutineStackSize, AC_STACK::default_stack, AC_STACK::min_stack, AC_STACK::max_stack ) ); configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::UpdateUIEventInterval, - &m_UpdateUIEventInterval, m_UpdateUIEventInterval, -1, 100000 ) ); + &m_UpdateUIEventInterval, m_UpdateUIEventInterval, + -1, 100000 ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRouterDebugGraphics, - &m_ShowRouterDebugGraphics, m_ShowRouterDebugGraphics ) ); + &m_ShowRouterDebugGraphics, + m_ShowRouterDebugGraphics ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableRouterDump, &m_EnableRouterDump, m_EnableRouterDump ) ); @@ -443,25 +331,32 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) &m_CompactSave, m_CompactSave ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcAccuracy, - &m_DrawArcAccuracy, m_DrawArcAccuracy, 0.0, 100000.0 ) ); + &m_DrawArcAccuracy, m_DrawArcAccuracy, + 0.0, 100000.0 ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcCenterStartEndMaxAngle, - &m_DrawArcCenterMaxAngle, m_DrawArcCenterMaxAngle, 0.0, 100000.0 ) ); + &m_DrawArcCenterMaxAngle, + m_DrawArcCenterMaxAngle, 0.0, 100000.0 ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTangentTrackAngleDeviation, - &m_MaxTangentAngleDeviation, m_MaxTangentAngleDeviation, 0.0, 90.0 ) ); + &m_MaxTangentAngleDeviation, + m_MaxTangentAngleDeviation, 0.0, 90.0 ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTrackLengthToKeep, - &m_MaxTrackLengthToKeep, m_MaxTrackLengthToKeep, 0.0, 1.0 ) ); + &m_MaxTrackLengthToKeep, m_MaxTrackLengthToKeep, + 0.0, 1.0 ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ExtraZoneDisplayModes, - &m_ExtraZoneDisplayModes, m_ExtraZoneDisplayModes ) ); + &m_ExtraZoneDisplayModes, + m_ExtraZoneDisplayModes ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::StrokeTriangulation, - &m_DrawTriangulationOutlines, m_DrawTriangulationOutlines ) ); + &m_DrawTriangulationOutlines, + m_DrawTriangulationOutlines ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinPlotPenWidth, - &m_MinPlotPenWidth, m_MinPlotPenWidth, 0.0, 1.0 ) ); + &m_MinPlotPenWidth, m_MinPlotPenWidth, + 0.0, 1.0 ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugZoneFiller, &m_DebugZoneFiller, m_DebugZoneFiller ) ); @@ -470,7 +365,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) &m_DebugPDFWriter, m_DebugPDFWriter ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::SmallDrillMarkSize, - &m_SmallDrillMarkSize, m_SmallDrillMarkSize, 0.0, 3.0 ) ); + &m_SmallDrillMarkSize, m_SmallDrillMarkSize, + 0.0, 3.0 ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HotkeysDumper, &m_HotkeysDumper, m_HotkeysDumper ) ); @@ -479,7 +375,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) &m_DrawBoundingBoxes, m_DrawBoundingBoxes ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowPcbnewExportNetlist, - &m_ShowPcbnewExportNetlist, m_ShowPcbnewExportNetlist ) ); + &m_ShowPcbnewExportNetlist, + m_ShowPcbnewExportNetlist ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelFileCache, &m_Skip3DModelFileCache, m_Skip3DModelFileCache ) ); @@ -497,7 +394,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) &m_ShowEventCounters, m_ShowEventCounters ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::AllowManualCanvasScale, - &m_AllowManualCanvasScale, m_AllowManualCanvasScale ) ); + &m_AllowManualCanvasScale, + m_AllowManualCanvasScale ) ); configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::V3DRT_BevelHeight_um, &m_3DRT_BevelHeight_um, m_3DRT_BevelHeight_um, @@ -505,8 +403,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) AC_GROUPS::V3D_RayTracing ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::V3DRT_BevelExtentFactor, - &m_3DRT_BevelExtentFactor, m_3DRT_BevelExtentFactor, - 0.0, 100.0, + &m_3DRT_BevelExtentFactor, + m_3DRT_BevelExtentFactor, 0.0, 100.0, AC_GROUPS::V3D_RayTracing ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::UseClipper2, @@ -516,11 +414,13 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) &m_Use3DConnexionDriver, m_Use3DConnexionDriver ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::IncrementalConnectivity, - &m_IncrementalConnectivity, m_IncrementalConnectivity ) ); + &m_IncrementalConnectivity, + m_IncrementalConnectivity ) ); configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::DisambiguationTime, - &m_DisambiguationMenuDelay, m_DisambiguationMenuDelay, - 50, 10000 ) ); + &m_DisambiguationMenuDelay, + m_DisambiguationMenuDelay, + 50, 10000 ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGenerators, &m_EnableGenerators, m_EnableGenerators ) ); @@ -529,8 +429,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) &m_EnableGit, m_EnableGit ) ); configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaPrintCairo, - &m_EnableEeschemaPrintCairo, m_EnableEeschemaPrintCairo ) ); - + &m_EnableEeschemaPrintCairo, + m_EnableEeschemaPrintCairo ) ); configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::PcbSelectionVisibilityRatio, &m_PcbSelectionVisibilityRatio, @@ -539,7 +439,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) // Special case for trace mask setting...we just grab them and set them immediately // Because we even use wxLogTrace inside of advanced config wxString traceMasks; - configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, wxS( "" ) ) ); + configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, + wxS( "" ) ) ); // Load the config from file wxConfigLoadSetups( &aCfg, configParams ); diff --git a/include/advanced_config.h b/include/advanced_config.h index afd246fb0d..caf0ddf43d 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -77,210 +77,410 @@ public: /** * Distance from an arc end point and the estimated end point, when rotating from the * start point to the end point. + * + * Setting name: "DrawArcAccuracy" + * Valid values: 0 to 100000 + * Default value: 10 */ double m_DrawArcAccuracy; /** * When drawing an arc, the angle ( center - start ) - ( start - end ) can be limited to * avoid extremely high radii. + * + * Setting name: "DrawArcCenterStartEndMaxAngle" + * Valid values: 0 to 100000 + * Default value: 50 */ double m_DrawArcCenterMaxAngle; /** * Maximum angle between the tangent line of an arc track and a connected straight track * in order to commence arc dragging. Units are degrees. + * + * Setting name: "MaxTangentTrackAngleDeviation" + * Valid values: 0 to 90 + * Default value: 1 */ double m_MaxTangentAngleDeviation; /** * Maximum track length to keep after doing an arc track resizing operation. Units are mm. + * + * Setting name: "MaxTrackLengthToKeep" + * Valid values: 0 to 1 + * Default value: 0.0005 */ double m_MaxTrackLengthToKeep; /** - * Extra fill clearance for zone fills. Note that for zone tests this is essentially - * additive with m_DRCEpsilon. Units are mm. + * When filling zones, we add an extra amount of clearance to each zone to ensure that + * rounding errors do not overrun minimum clearance distances. + * + * This is the extra clearance in mm. + * + * Setting name: "ExtraFillMargin" + * Valid values: 0 to 1 + * Default value: 0.0005 */ double m_ExtraClearance; /** - * Epsilon for DRC tests. Note that for zone tests this is essentially additive with - * m_ExtraClearance. Units are mm. + * Epsilon for DRC tests. + * + * @note Fo zone tests this is essentially additive with #m_ExtraClearance. Units are mm. + * + * Setting name: "DRCEpsilon" + * Valid values: 0 to 1 + * Default value: 0.0005 */ double m_DRCEpsilon; /** - * Sliver tolerances for DRC. Units are mm and deg. + * Sliver width tolerance for DRC. + * + * Units are mm. + * + * Setting name: "DRCSliverWidthTolerance" + * Valid values: 0.01 to 0.25 + * Default value: 0.08 */ double m_SliverWidthTolerance; - double m_SliverMinimumLength; - double m_SliverAngleTolerance; /** - * Hole wall plating thickness. Used to determine actual hole size from finish hole size. + * Sliver length tolerance for DRC. + * * Units are mm. + * + * Setting name: "DRCSliverMinimumLength" + * Valid values: 1e-9 to 10 + * Default value: 0.0008 + */ + double m_SliverMinimumLength; + + /** + * Sliver angle to tolerance for DRC. + * + * Units are mm. + * + * Setting name: "DRCSliverAngleTolerance" + * Valid values: 1 to 90 + * Default value: 20 + */ + double m_SliverAngleTolerance; + + + /** + * Dimension used to calculate the actual hole size from the finish hole size. + * + * @note IPC-6012 says 0.015-0.018mm; Cadence says at least 0.020mm for a Class 2 board and + * at least 0.025mm for Class 3. Units are mm. + * + * Setting name: "HoleWallPlatingThickness" + * Valid values: 1 to 90 + * Default value: 0.02 */ double m_HoleWallThickness; + /** - * Set the stack size for coroutines + * Configure the coroutine stack size in bytes. + * + * @note This should be allocated in multiples of the system page size (n*4096 is generally + * safe) + * + * Setting name: "CoroutineStackSize" + * Valid values: 32 * 4096 to 4096 * 4096 + * Default value: 256 * 4096 */ int m_CoroutineStackSize; /** * 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 + * 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. + * + * Setting name: "UpdateUIEventInterval" + * Valid values: -1 to 100000 + * Default value: 0 */ int m_UpdateUIEventInterval; /** - * Show PNS router debug graphics + * Show PNS router debug graphics while routing + * + * Setting name: "ShowRouterDebugGraphics" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_ShowRouterDebugGraphics; /** * Enable PNS router to dump state information for debug purpose (press `0` while routing) + * + * Setting name: "EnableRouterDump" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_EnableRouterDump; /** * Slide the zoom steps over for debugging things "up close". + * + * Setting name: "EnableRouterDump" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_HyperZoom; /** * Save files in compact display mode - * When is is not specified, points are written one per line + * + * When set to true, this will wrap polygon point sets at 4 points per line rather + * than a single point per line. Single point per line helps with version control systems. + * + * Setting name: "CompactSave" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_CompactSave; /** - * When true, strokes the triangulations with visible color + * Enable drawing the triangulation outlines with a visible color. + * + * @note This only affects the OpenGL GAL. + * + * Setting name: "StrokeTriangulation" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_DrawTriangulationOutlines; /** * When true, adds zone-display-modes for stroking the zone fracture boundaries and the zone * triangulation. + * + * Setting name: "ExtraZoneDisplayModes" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_ExtraZoneDisplayModes; /** - * Sets an absolute minimum pen width for plotting. Some formats (PDF, for example) don't - * like ultra-thin lines. Units are mm. + * Absolute minimum pen width for plotting. + * + * @note Some formats (PDF, for example) don't like ultra-thin lines. PDF seems happy + * enough with 0.0212mm which equates to 1px @ 1200dpi. Units are mm. + * + * Setting name: "MinPlotPenWidth" + * Valid values: 0 to 1 + * Default value: 0.0212 */ double m_MinPlotPenWidth; /** * A mode that dumps the various stages of a F_Cu fill into In1_Cu through In9_Cu. + * + * Setting name: "DebugZoneFiller" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_DebugZoneFiller; /** * A mode that writes PDFs without compression. + * + * Setting name: "DebugPDFWriter" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_DebugPDFWriter; /** - * The diameter of the drill marks on print and plot outputs (in mm), - * when the "Drill marks" option is set to "Small mark" + * The diameter of the drill marks on print and plot outputs (in mm) when the "Drill marks" + * option is set to "Small mark". + * + * Setting name: "SmallDrillMarkSize" + * Valid values: 0 to 3 + * Default value: 0.35 */ double m_SmallDrillMarkSize; /** - * Enable the hotkeys dumper feature, used for generating documentation + * Enable the hotkeys dumper feature for generating documentation. + * + * Setting name: "HotkeysDumper" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_HotkeysDumper; /** - * Draw GAL bounding boxes in painters + * Draw GAL bounding boxes in painters. + * + * Setting name: "DrawBoundingBoxes" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_DrawBoundingBoxes; /** * Enable exporting board editor netlist to a file for troubleshooting purposes. + * + * Setting name: "ShowPcbnewExportNetlist" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_ShowPcbnewExportNetlist; /** - * Skip reading/writing 3d model file caches - * 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. + * Skip reading/writing 3D model file caches. + * + * 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. + * + * Setting name: "Skip3DModelFileCache" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_Skip3DModelFileCache; /** - * Skip reading/writing 3d model memory caches - * This ensures 3d models are always reloaded from disk even if we previously opened the 3d + * Skip reading/writing 3D model memory caches. + & + * This ensures 3D models are always reloaded from disk even if we previously opened the 3D * viewer. + * + * Setting name: "Skip3DModelMemoryCache" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_Skip3DModelMemoryCache; /** - * Hides the build version from the KiCad manager frame title. + * Hide the build version from the KiCad manager frame title. + * * Useful for making screenshots/videos of KiCad without pinning to a specific version. + * + * Setting name: "HideVersionFromTitle" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_HideVersionFromTitle; + /** + * Enable showing schematic repair output. + * + * Setting name: "ShowRepairSchematic" + * Valid values: 0 or 1 + * Default value: 0 + */ bool m_ShowRepairSchematic; /** * Shows debugging event counters in various places. + * + * Setting name: "ShowEventCounters" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_ShowEventCounters; + /** + * Allow manual scaling of canvas. + * + * Setting name: "AllowManualCanvasScale" + * Valid values: 0 or 1 + * Default value: 0 + */ bool m_AllowManualCanvasScale; /** - * 3D-Viewer, Raytracing - * Bevel height of layer items. Controls the start of curvature normal on the edge. - * Value is in micrometer. Good values should be around or less than the copper thickness. + * Set the bevel height of layer items in 3D viewer when ray tracing. + * + * Controls the start of curvature normal on the edge. The value is in micrometer. Good + * values should be around or less than the copper thickness. + * + * Setting name: "V3DRT_BevelHeight_um" + * Valid values: 0 to std::numeric_limits::max() + * Default value: 30 */ int m_3DRT_BevelHeight_um; /** * 3D-Viewer raytracing factor applied to Extent.z of the item layer. * - * This is used on calculation of the bevel's height. + * This is used for calculating the bevel's height. + * + * Setting name: "V3DRT_BevelHeight_um" + * Valid values: 0 to 100 + * Default value: 1/16 */ double m_3DRT_BevelExtentFactor; /** - * Use Clipper2 instead of Clipper1 + * Use Clipper2 instead of Clipper1. + * + * Setting name: "UseClipper2" + * Valid values: 0 or 1 + * Default value: 1 */ bool m_UseClipper2; /** - * Use the 3DConnexion Driver + * Use the 3DConnexion Driver. + * + * Setting name: "3DConnexionDriver" + * Valid values: 0 or 1 + * Default value: 1 */ bool m_Use3DConnexionDriver; /** - * Use the new incremental netlister for realtime jobs + * Use the new incremental netlister for realtime jobs. + * + * Setting name: "IncrementalConnectivity" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_IncrementalConnectivity; /** * The number of milliseconds to wait in a click before showing a disambiguation menu. + * + * Setting name: "DisambiguationTime" + * Valid values: 50 or 10000 + * Default value: 300 */ int m_DisambiguationMenuDelay; /** - * When true, enable support for generators + * Enable support for generators. + * + * Setting name: "EnableGenerators" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_EnableGenerators; /** - * When true, enable git integration + * Enable git integration. + * + * Setting name: "EnableGit" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_EnableGit; /** - * When true, enable Eeschema printing using Cairo + * Enable Eeschema printing using Cairo. + * + * Setting name: "EnableEeschemaPrintCairo" + * Valid values: 0 or 1 + * Default value: 0 */ bool m_EnableEeschemaPrintCairo; @@ -293,7 +493,9 @@ public: * between 0 and less than 1. A value of 1 disables this feature. Reasonable values * are between 0.01 and 0.03 depending on the layer colors. * - * The setting name is "PcbSelectionVisibilityRatio". + * Setting name: "PcbSelectionVisibilityRatio" + * Valid values: 0.0 to 1.0 + * Default value: 1 */ double m_PcbSelectionVisibilityRatio; ///@} diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index e68557e6b4..9480da0d5d 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -151,7 +151,8 @@ PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL() getView()->Remove( &m_selection ); getView()->Remove( &m_enteredGroupOverlay ); - Disconnect( wxEVT_TIMER, wxTimerEventHandler( PCB_SELECTION_TOOL::onDisambiguationExpire ), nullptr, this ); + Disconnect( wxEVT_TIMER, wxTimerEventHandler( PCB_SELECTION_TOOL::onDisambiguationExpire ), + nullptr, this ); } @@ -212,7 +213,8 @@ bool PCB_SELECTION_TOOL::Init() frame->AddStandardSubMenus( m_menu ); m_disambiguateTimer.SetOwner( this ); - Connect( wxEVT_TIMER, wxTimerEventHandler( PCB_SELECTION_TOOL::onDisambiguationExpire ), nullptr, this ); + Connect( wxEVT_TIMER, wxTimerEventHandler( PCB_SELECTION_TOOL::onDisambiguationExpire ), + nullptr, this ); return true; } @@ -781,7 +783,7 @@ bool PCB_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag, } catch( const std::exception& exc ) { - wxLogWarning( wxS( "Exception \"%s\" occurred attemption to guess selection " + wxLogWarning( wxS( "Exception \"%s\" occurred attempting to guess selection " "candidates." ), exc.what() ); return false; } @@ -878,7 +880,7 @@ const TOOL_ACTION* allowedActions[] = { &ACTIONS::panUp, &ACTIONS::panD bool PCB_SELECTION_TOOL::selectMultiple() { - bool cancelled = false; // Was the tool cancelled while it was running? + bool cancelled = false; // Was the tool canceled while it was running? m_multiple = true; // Multiple selection mode is active KIGFX::VIEW* view = getView(); @@ -1132,6 +1134,7 @@ int PCB_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) return 0; } + int PCB_SELECTION_TOOL::UnselectAll( const TOOL_EVENT& aEvent ) { KIGFX::VIEW* view = getView(); @@ -1909,7 +1912,8 @@ void PCB_SELECTION_TOOL::selectConnections( const std::vector& aIte for( int netCode : netcodeList ) { - for( BOARD_ITEM* item : conn->GetNetItems( netCode, { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T } ) ) + for( BOARD_ITEM* item : conn->GetNetItems( netCode, + { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T } ) ) localConnectionList.insert( item ); } @@ -2029,7 +2033,8 @@ void PCB_SELECTION_TOOL::zoomFitSelection() BOX2I selectionBox = m_selection.GetBoundingBox(); KIGFX::VIEW* view = getView(); - VECTOR2D screenSize = view->ToWorld( ToVECTOR2D( m_frame->GetCanvas()->GetClientSize() ), false ); + VECTOR2D screenSize = view->ToWorld( ToVECTOR2D( m_frame->GetCanvas()->GetClientSize() ), + false ); screenSize.x = std::max( 10.0, screenSize.x ); screenSize.y = std::max( 10.0, screenSize.y ); @@ -2075,7 +2080,8 @@ void PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox( const BOX2I& aBBox ) #ifndef DEFAULT_PCBNEW_CODE // Do the scaled zoom auto bbSize = bbox.Inflate( KiROUND( bbox.GetWidth() * 0.2 ) ).GetSize(); - VECTOR2D screenSize = view->ToWorld( ToVECTOR2D( m_frame->GetCanvas()->GetClientSize() ), false ); + VECTOR2D screenSize = view->ToWorld( ToVECTOR2D( m_frame->GetCanvas()->GetClientSize() ), + false ); // This code tries to come up with a zoom factor that doesn't simply zoom in // to the cross probed component, but instead shows a reasonable amount of the @@ -2224,8 +2230,10 @@ void PCB_SELECTION_TOOL::FindItem( BOARD_ITEM* aItem ) if( !screenRect.Contains( aItem->GetBoundingBox() ) ) { - double scaleX = screenSize.x / static_cast( aItem->GetBoundingBox().GetWidth() ); - double scaleY = screenSize.y / static_cast( aItem->GetBoundingBox().GetHeight() ); + double scaleX = screenSize.x / + static_cast( aItem->GetBoundingBox().GetWidth() ); + double scaleY = screenSize.y / + static_cast( aItem->GetBoundingBox().GetHeight() ); scaleX /= marginFactor; scaleY /= marginFactor; @@ -3269,7 +3277,8 @@ void PCB_SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector { BOARD_ITEM* item = aCollector[i]; - if( item->IsType( { PCB_FIELD_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_SHAPE_T, PCB_FOOTPRINT_T } ) + if( item->IsType( { PCB_FIELD_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_SHAPE_T, + PCB_FOOTPRINT_T } ) && item->IsOnLayer( activeLayer ) ) { preferred.insert( item ); @@ -3470,7 +3479,8 @@ void PCB_SELECTION_TOOL::FilterCollectorForHierarchy( GENERAL_COLLECTOR& aCollec // If any element is a member of a group, replace those elements with the top containing // group. - if( PCB_GROUP* top = PCB_GROUP::TopLevelGroup( start, m_enteredGroup, m_isFootprintEditor ) ) + if( PCB_GROUP* top = PCB_GROUP::TopLevelGroup( start, m_enteredGroup, + m_isFootprintEditor ) ) { if( top != item ) { @@ -3538,7 +3548,9 @@ void PCB_SELECTION_TOOL::FilterCollectorForMarkers( GENERAL_COLLECTOR& aCollecto } } -void PCB_SELECTION_TOOL::FilterCollectorForFootprints( GENERAL_COLLECTOR& aCollector, const VECTOR2I& aWhere ) const + +void PCB_SELECTION_TOOL::FilterCollectorForFootprints( GENERAL_COLLECTOR& aCollector, + const VECTOR2I& aWhere ) const { const RENDER_SETTINGS* settings = getView()->GetPainter()->GetSettings(); BOX2D viewport = getView()->GetViewport(); diff --git a/pcbnew/tools/pcb_selection_tool.h b/pcbnew/tools/pcb_selection_tool.h index 87d38a2069..c9efce4cf1 100644 --- a/pcbnew/tools/pcb_selection_tool.h +++ b/pcbnew/tools/pcb_selection_tool.h @@ -218,7 +218,8 @@ public: /** * Drop footprints that are not directly selected */ - void FilterCollectorForFootprints( GENERAL_COLLECTOR& aCollector, const VECTOR2I& aWhere ) const; + void FilterCollectorForFootprints( GENERAL_COLLECTOR& aCollector, + const VECTOR2I& aWhere ) const; protected: KIGFX::PCB_VIEW* view() const @@ -341,7 +342,8 @@ private: STOP_CONDITION aStopCondition ); /** - * Selects all non-closed shapes that are graphically connected to the given start items. + * Select all non-closed shapes that are graphically connected to the given start items. + * * @param aStartItems is a list of one or more non-closed shapes */ void selectAllConnectedShapes( const std::vector& aStartItems ); @@ -413,7 +415,7 @@ private: bool selectionContains( const VECTOR2I& aPoint ) const; /** - * @return the distance from \a wWhere to \a aItem, up to and including \a aMaxDistance. + * @return the distance from \a aWhere to \a aItem, up to and including \a aMaxDistance. */ int hitTestDistance( const VECTOR2I& aWhere, BOARD_ITEM* aItem, int aMaxDistance ) const;