pcbnew: Use Default width define instead of nums

The board design settings file keeps our default values for various
thicknesses.  We use this to replace a number of magic numbers with the
defined value to help self-document the code.
This commit is contained in:
Seth Hillbrand 2018-10-07 15:22:54 -07:00
parent ecc80c00a5
commit 1828e8cb0f
4 changed files with 8 additions and 7 deletions

View File

@ -50,7 +50,7 @@ PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) :
{
m_Shape = 0;
m_Size = Millimeter2iu( 5 ); // Gives a decent size
m_Width = Millimeter2iu( 0.15 ); // Gives a decent width
m_Width = Millimeter2iu( DEFAULT_COPPER_LINE_WIDTH );
m_Layer = Edge_Cuts; // a target is on all layers
}

View File

@ -59,7 +59,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type ) :
m_keepUpright = true;
// Set text thickness to a default value
SetThickness( Millimeter2iu( 0.15 ) );
SetThickness( Millimeter2iu( DEFAULT_TEXT_WIDTH ) );
SetLayer( F_SilkS );
// Set position and give a default layer if a valid parent footprint exists

View File

@ -427,7 +427,7 @@ void DXF2BRD_CONVERTER::addText( const DL_TextData& aData )
// The 0.8 factor gives a better height/width ratio with our font
textItem->SetTextWidth( mapDim( aData.height * 0.8 ) );
textItem->SetTextHeight( mapDim( aData.height ) );
textItem->SetThickness( mapWidth( aData.height * 0.15 ) ); // Gives a reasonable text thickness
textItem->SetThickness( mapWidth( aData.height * DEFAULT_TEXT_WIDTH ) ); // Gives a reasonable text thickness
textItem->SetText( text );
m_newItemsList.push_back( static_cast< BOARD_ITEM* >( brdItem ) );
@ -489,7 +489,7 @@ void DXF2BRD_CONVERTER::addMText( const DL_MTextData& aData )
// The 0.8 factor gives a better height/width ratio with our font
textItem->SetTextWidth( mapDim( aData.height * 0.8 ) );
textItem->SetTextHeight( mapDim( aData.height ) );
textItem->SetThickness( mapWidth( aData.height * 0.15 ) ); // Gives a reasonable text thickness
textItem->SetThickness( mapWidth( aData.height * DEFAULT_TEXT_WIDTH ) ); // Gives a reasonable text thickness
textItem->SetText( text );
// Initialize text justifications:

View File

@ -27,11 +27,12 @@
#include <plotter.h>
#include <macros.h>
#include <convert_to_biu.h>
#include <board_design_settings.h>
#define PLOT_LINEWIDTH_MIN (0.02*IU_PER_MM) // min value for default line thickness
#define PLOT_LINEWIDTH_MAX (2*IU_PER_MM) // max value for default line thickness
#define PLOT_LINEWIDTH_DEFAULT (0.15*IU_PER_MM) // def. value for default line thickness
#define PLOT_LINEWIDTH_MIN ( 0.02 * IU_PER_MM ) // min value for default line thickness
#define PLOT_LINEWIDTH_MAX ( 2 * IU_PER_MM ) // max value for default line thickness
#define PLOT_LINEWIDTH_DEFAULT ( DEFAULT_TEXT_WIDTH * IU_PER_MM )
#define HPGL_PEN_DIAMETER_MIN 0
#define HPGL_PEN_DIAMETER_MAX 100.0 // Unit = mil
#define HPGL_PEN_SPEED_MIN 1 // this param is always in cm/s