Make small drill marks size configurable via advanced config for both printing and plotting

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1972
This commit is contained in:
Zoltan Gyarmati 2021-01-04 23:26:23 +01:00 committed by Jeff Young
parent 1c7a5c46e5
commit 5676117d0b
6 changed files with 25 additions and 5 deletions

View File

@ -143,6 +143,13 @@ static const wxChar DebugPDFWriter[] = wxT( "DebugPDFWriter" );
static const wxChar SkipBoundingBoxFpLoad[] = wxT( "SkipBoundingBoxFpLoad" );
/**
* 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" );
} // namespace KEYS
@ -243,6 +250,8 @@ ADVANCED_CFG::ADVANCED_CFG()
m_SkipBoundingBoxOnFpLoad = false;
m_SmallDrillMarkSize = 0.35;
loadFromConfigFile();
}
@ -325,6 +334,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::SkipBoundingBoxFpLoad,
&m_SkipBoundingBoxOnFpLoad, false ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::SmallDrillMarkSize,
&m_SmallDrillMarkSize, 0.35, 0.0, 3.0 ) );
wxConfigLoadSetups( &aCfg, configParams );

View File

@ -149,6 +149,12 @@ public:
*/
bool m_SkipBoundingBoxOnFpLoad;
/**
* The diameter of the drill marks on print and plot outputs (in mm),
* when the "Drill marks" option is set to "Small mark"
*/
double m_SmallDrillMarkSize;
private:
ADVANCED_CFG();

View File

@ -32,6 +32,7 @@
#include <pcbnew_settings.h>
#include <view/view.h>
#include <pcbplot.h>
#include <advanced_config.h>
PCBNEW_PRINTOUT_SETTINGS::PCBNEW_PRINTOUT_SETTINGS( const PAGE_INFO& aPageInfo )
: BOARD_PRINTOUT_SETTINGS( aPageInfo )
@ -238,7 +239,7 @@ void PCBNEW_PRINTOUT::setupPainter( KIGFX::PAINTER& aPainter )
break;
case PCBNEW_PRINTOUT_SETTINGS::SMALL_DRILL_SHAPE:
painter.SetDrillMarks( false, Millimeter2iu( 0.3 ) );
painter.SetDrillMarks( false, Millimeter2iu( ADVANCED_CFG::GetCfg().m_SmallDrillMarkSize ) );
painter.GetSettings()->SetLayerColor( LAYER_PADS_PLATEDHOLES, COLOR4D::BLACK );
painter.GetSettings()->SetLayerColor( LAYER_NON_PLATEDHOLES, COLOR4D::BLACK );

View File

@ -56,8 +56,6 @@ class wxFileName;
#define PLOT_MIN_SCALE 0.01
#define PLOT_MAX_SCALE 100.0
// Small drill marks (small pad holes) diameter value
#define SMALL_DRILL KiROUND( 0.35 * IU_PER_MM )
// A helper class to plot board items

View File

@ -50,6 +50,7 @@
#include <plotters_specific.h>
#include <pcb_painter.h>
#include <gbr_metadata.h>
#include <advanced_config.h>
/*
* Plot a solder mask layer. Solder mask layers have a minimum thickness value and cannot be
@ -632,7 +633,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
if( aPlotOpt.GetDrillMarksType() != PCB_PLOT_PARAMS::NO_DRILL_SHAPE )
{
int smallDrill = (aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE)
? SMALL_DRILL : INT_MAX;
? ADVANCED_CFG::GetCfg().m_SmallDrillMarkSize : INT_MAX;
for( FOOTPRINT* footprint : aBoard->Footprints() )
{

View File

@ -50,6 +50,7 @@
#include <pad_shapes.h> // for PAD_ATTRIB_NPTH
#include <pcbplot.h>
#include <pcb_plot_params.h> // for PCB_PLOT_PARAMS, PCB_PL...
#include <advanced_config.h>
#include <board.h>
#include <board_item.h> // for BOARD_ITEM, S_CIRCLE
@ -1014,7 +1015,8 @@ void BRDITEMS_PLOTTER::PlotDrillMarks()
{
/* If small drills marks were requested prepare a clamp value to pass
to the helper function */
int smallDrill = GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE ? SMALL_DRILL : 0;
int smallDrill = GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE
? Millimeter2iu( ADVANCED_CFG::GetCfg().m_SmallDrillMarkSize ) : 0;
/* In the filled trace mode drill marks are drawn white-on-black to scrape
the underlying pad. This works only for drivers supporting color change,