Commit 399ab4ba authored by jean-pierre charras's avatar jean-pierre charras

Footprint editor: set the default footprint text size to 1 mm. Minor cleaning...

Footprint editor: set the default footprint text size to 1 mm. Minor cleaning code. Very minor other fixes.
parent 4bab8dde
...@@ -31,6 +31,23 @@ ...@@ -31,6 +31,23 @@
#include <class_netclass.h> #include <class_netclass.h>
#include <config_params.h> #include <config_params.h>
// Some default values for the board editor and the fp editor (given in mm)
#define DEFAULT_TEXT_MODULE_SIZE 1.0
#define DEFAULT_GR_MODULE_THICKNESS 0.15 // given in mm
// Board thickness, mainly for 3D view:
#define DEFAULT_BOARD_THICKNESS_MM 1.6
// Default values for some board items (given in mm)
#define DEFAULT_TEXT_PCB_SIZE 1.5
#define DEFAULT_TEXT_PCB_THICKNESS 0.3
#define DEFAULT_PCB_EDGE_THICKNESS 0.15
#define DEFAULT_GRAPHIC_THICKNESS 0.2
#define DEFAULT_SOLDERMASK_CLEARANCE 0.2
#define DEFAULT_SOLDERMASK_MIN_WIDTH Millimeter2iu( 0.0 )
/** /**
* Struct VIA_DIMENSION * Struct VIA_DIMENSION
* is a small helper container to handle a stock of specific vias each with * is a small helper container to handle a stock of specific vias each with
......
...@@ -36,20 +36,6 @@ ...@@ -36,20 +36,6 @@
#include <class_track.h> #include <class_track.h>
#include <convert_from_iu.h> #include <convert_from_iu.h>
// Board thickness, mainly for 3D view:
#define DEFAULT_BOARD_THICKNESS_MM 1.6
// Default values for some board items
#define DEFAULT_TEXT_PCB_SIZE Millimeter2iu( 1.5 )
#define DEFAULT_TEXT_PCB_THICKNESS Millimeter2iu( 0.3 )
#define DEFAULT_PCB_EDGE_THICKNESS Millimeter2iu( 0.15 )
#define DEFAULT_GRAPHIC_THICKNESS Millimeter2iu( 0.2 )
#define DEFAULT_TEXT_MODULE_SIZE Millimeter2iu( 1.5 )
#define DEFAULT_GR_MODULE_THICKNESS Millimeter2iu( 0.15 )
#define DEFAULT_SOLDERMASK_CLEARANCE Millimeter2iu( 0.2 )
#define DEFAULT_SOLDERMASK_MIN_WIDTH Millimeter2iu( 0.0 )
BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() : BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_Pad_Master( NULL ) m_Pad_Master( NULL )
...@@ -74,13 +60,13 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() : ...@@ -74,13 +60,13 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_BlindBuriedViaAllowed = false; // true to allow blind/buried vias m_BlindBuriedViaAllowed = false; // true to allow blind/buried vias
m_MicroViasAllowed = false; // true to allow micro vias m_MicroViasAllowed = false; // true to allow micro vias
m_DrawSegmentWidth = DEFAULT_GRAPHIC_THICKNESS; // current graphic line width (not EDGE layer) m_DrawSegmentWidth = Millimeter2iu( DEFAULT_GRAPHIC_THICKNESS ); // current graphic line width (not EDGE layer)
m_EdgeSegmentWidth = DEFAULT_PCB_EDGE_THICKNESS; // current graphic line width (EDGE layer only) m_EdgeSegmentWidth = Millimeter2iu( DEFAULT_PCB_EDGE_THICKNESS ); // current graphic line width (EDGE layer only)
m_PcbTextWidth = DEFAULT_TEXT_PCB_THICKNESS; // current Pcb (not module) Text width m_PcbTextWidth = Millimeter2iu(DEFAULT_TEXT_PCB_THICKNESS ); // current Pcb (not module) Text width
m_PcbTextSize = wxSize( DEFAULT_TEXT_PCB_SIZE, m_PcbTextSize = wxSize( Millimeter2iu( DEFAULT_TEXT_PCB_SIZE ),
DEFAULT_TEXT_PCB_SIZE ); // current Pcb (not module) Text size Millimeter2iu( DEFAULT_TEXT_PCB_SIZE ) ); // current Pcb (not module) Text size
m_useCustomTrackVia = false; m_useCustomTrackVia = false;
m_customTrackWidth = DMils2iu( 100 ); m_customTrackWidth = DMils2iu( 100 );
...@@ -91,8 +77,8 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() : ...@@ -91,8 +77,8 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_MicroViasMinDrill = DMils2iu( 50 ); // micro vias (not vias) min drill diameter m_MicroViasMinDrill = DMils2iu( 50 ); // micro vias (not vias) min drill diameter
// Global mask margins: // Global mask margins:
m_SolderMaskMargin = DEFAULT_SOLDERMASK_CLEARANCE; // Solder mask margin m_SolderMaskMargin = Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE ); // Solder mask margin
m_SolderMaskMinWidth = DEFAULT_SOLDERMASK_MIN_WIDTH; // Solder mask min width m_SolderMaskMinWidth = Millimeter2iu( DEFAULT_SOLDERMASK_MIN_WIDTH ); // Solder mask min width
m_SolderPasteMargin = 0; // Solder paste margin absolute value m_SolderPasteMargin = 0; // Solder paste margin absolute value
m_SolderPasteMarginRatio = 0.0; // Solder pask margin ratio value of pad size m_SolderPasteMarginRatio = 0.0; // Solder pask margin ratio value of pad size
// The final margin is the sum of these 2 values // The final margin is the sum of these 2 values
...@@ -106,10 +92,10 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() : ...@@ -106,10 +92,10 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
// Default values for the footprint editor and fp creation // Default values for the footprint editor and fp creation
// (also covers footprints created on the fly by micor-waves tools) // (also covers footprints created on the fly by micor-waves tools)
m_ModuleTextSize = wxSize( DEFAULT_TEXT_MODULE_SIZE, m_ModuleTextSize = wxSize( Millimeter2iu( DEFAULT_TEXT_MODULE_SIZE ),
DEFAULT_TEXT_MODULE_SIZE ); Millimeter2iu( DEFAULT_TEXT_MODULE_SIZE ) );
m_ModuleTextWidth = DEFAULT_GR_MODULE_THICKNESS; m_ModuleTextWidth = Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS );
m_ModuleSegmentWidth = DEFAULT_GR_MODULE_THICKNESS; m_ModuleSegmentWidth = Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS );
// These values will be overriden by config values after reading the config // These values will be overriden by config values after reading the config
// Default ref text on fp creation. if empty, use footprint name as default // Default ref text on fp creation. if empty, use footprint name as default
...@@ -130,17 +116,17 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( PARAM_CFG_ARRAY* aResult ) ...@@ -130,17 +116,17 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( PARAM_CFG_ARRAY* aResult )
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextSizeV" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextSizeV" ),
&m_PcbTextSize.y, &m_PcbTextSize.y,
DEFAULT_TEXT_PCB_SIZE, TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, Millimeter2iu( DEFAULT_TEXT_PCB_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextSizeH" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextSizeH" ),
&m_PcbTextSize.x, &m_PcbTextSize.x,
DEFAULT_TEXT_PCB_SIZE, TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, Millimeter2iu( DEFAULT_TEXT_PCB_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextThickness" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextThickness" ),
&m_PcbTextWidth, &m_PcbTextWidth,
DEFAULT_TEXT_PCB_THICKNESS, Millimeter2iu(DEFAULT_TEXT_PCB_THICKNESS ),
Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
...@@ -156,34 +142,34 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( PARAM_CFG_ARRAY* aResult ) ...@@ -156,34 +142,34 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( PARAM_CFG_ARRAY* aResult )
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "ModuleTextSizeThickness" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "ModuleTextSizeThickness" ),
&m_ModuleTextWidth, &m_ModuleTextWidth,
DEFAULT_GR_MODULE_THICKNESS, 1, TEXTS_MAX_WIDTH, Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS ), 1, TEXTS_MAX_WIDTH,
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskClearance" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskClearance" ),
&m_SolderMaskMargin, &m_SolderMaskMargin,
DEFAULT_SOLDERMASK_CLEARANCE, 0, Millimeter2iu( 1.0 ), Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE ), 0, Millimeter2iu( 1.0 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskMinWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskMinWidth" ),
&m_SolderMaskMinWidth, &m_SolderMaskMinWidth,
DEFAULT_SOLDERMASK_MIN_WIDTH, 0, Millimeter2iu( 0.5 ), Millimeter2iu( DEFAULT_SOLDERMASK_MIN_WIDTH ), 0, Millimeter2iu( 0.5 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "DrawSegmentWidth" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "DrawSegmentWidth" ),
&m_DrawSegmentWidth, &m_DrawSegmentWidth,
DEFAULT_GRAPHIC_THICKNESS, Millimeter2iu( DEFAULT_GRAPHIC_THICKNESS ),
Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "BoardOutlineThickness" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "BoardOutlineThickness" ),
&m_EdgeSegmentWidth, &m_EdgeSegmentWidth,
DEFAULT_PCB_EDGE_THICKNESS, Millimeter2iu( DEFAULT_PCB_EDGE_THICKNESS ),
Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "ModuleOutlineThickness" ), aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "ModuleOutlineThickness" ),
&m_ModuleSegmentWidth, &m_ModuleSegmentWidth,
DEFAULT_GR_MODULE_THICKNESS, Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS ),
Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
NULL, MM_PER_IU ) ); NULL, MM_PER_IU ) );
} }
......
...@@ -1549,7 +1549,7 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule ) ...@@ -1549,7 +1549,7 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
else else
attribute = PAD_STANDARD; attribute = PAD_STANDARD;
data = strtok_r( NULL, delims, &saveptr ); // skip BufCar strtok_r( NULL, delims, &saveptr ); // skip BufCar
data = strtok_r( NULL, delims, &saveptr ); data = strtok_r( NULL, delims, &saveptr );
LEG_MASK layer_mask = hexParse( data ); LEG_MASK layer_mask = hexParse( data );
......
...@@ -107,22 +107,22 @@ PARAM_CFG_ARRAY& FOOTPRINT_EDIT_FRAME::GetConfigurationSettings() ...@@ -107,22 +107,22 @@ PARAM_CFG_ARRAY& FOOTPRINT_EDIT_FRAME::GetConfigurationSettings()
// design settings // design settings
m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorGrlineWidth" ), m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorGrlineWidth" ),
&settings.m_ModuleSegmentWidth, &settings.m_ModuleSegmentWidth,
Millimeter2iu( 0.15 ), Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS ),
Millimeter2iu( 0.01 ), Millimeter2iu( 100.0 ), Millimeter2iu( 0.01 ), Millimeter2iu( 100.0 ),
NULL, 1/IU_PER_MM ) ); NULL, 1/IU_PER_MM ) );
m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultSizeH" ), m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultSizeH" ),
&settings.m_ModuleTextSize.x, &settings.m_ModuleTextSize.x,
Millimeter2iu( 1.5 ), Millimeter2iu( DEFAULT_TEXT_MODULE_SIZE ),
Millimeter2iu( 0.01 ), Millimeter2iu( 100.0 ), Millimeter2iu( 0.01 ), Millimeter2iu( 100.0 ),
NULL, 1/IU_PER_MM ) ); NULL, 1/IU_PER_MM ) );
m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultSizeV" ), m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultSizeV" ),
&settings.m_ModuleTextSize.y, &settings.m_ModuleTextSize.y,
Millimeter2iu( 1.5 ), Millimeter2iu( DEFAULT_TEXT_MODULE_SIZE ),
Millimeter2iu(0.01), Millimeter2iu( 100.0 ), Millimeter2iu(0.01), Millimeter2iu( 100.0 ),
NULL, 1/IU_PER_MM ) ); NULL, 1/IU_PER_MM ) );
m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultThickness" ), m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultThickness" ),
&settings.m_ModuleTextWidth, &settings.m_ModuleTextWidth,
Millimeter2iu( 0.15 ), Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS ),
Millimeter2iu( 0.01 ), Millimeter2iu( 20.0 ), Millimeter2iu( 0.01 ), Millimeter2iu( 20.0 ),
NULL, 1/IU_PER_MM ) ); NULL, 1/IU_PER_MM ) );
......
...@@ -894,7 +894,7 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone ) ...@@ -894,7 +894,7 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone )
} }
std::vector<CPolyPt>::const_iterator polyIterator; std::vector<CPolyPt>::const_iterator polyIterator;
for( polyIterator = polyPoints.begin(); polyIterator != polyPoints.end(); polyIterator++ ) for( polyIterator = polyPoints.begin(); polyIterator != polyPoints.end(); ++polyIterator )
{ {
// Find out all of polygons and then draw them // Find out all of polygons and then draw them
corners.push_back( VECTOR2D( *polyIterator ) ); corners.push_back( VECTOR2D( *polyIterator ) );
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
Components are sorted by ref Components are sorted by ref
One component per line One component per line
Fields are (if exist) Fields are (if exist)
Ref, Quantity, value, Part, footprint, 'Description', 'Vendor' Ref, Quantity, value, Part, footprint, Description, Vendor
Fields are separated by tabs Fields are separated by tabs
""" """
...@@ -50,9 +50,9 @@ writerow( out, ['Source:', net.getSource()] ) ...@@ -50,9 +50,9 @@ writerow( out, ['Source:', net.getSource()] )
writerow( out, ['Date:', net.getDate()] ) writerow( out, ['Date:', net.getDate()] )
writerow( out, ['Tool:', net.getTool()] ) writerow( out, ['Tool:', net.getTool()] )
writerow( out, ['Component Count:', len(components)] ) writerow( out, ['Component Count:', len(components)] )
writerow( out, ['Ref', 'Value', 'Part', 'Documentation', 'Description', 'Vendor'] ) writerow( out, ['Ref', 'Value', 'Part', 'Footprint', 'Description', 'Vendor'] )
# Output all of the component information # Output all of the component information
for c in components: for c in components:
writerow( out, [c.getRef(), c.getValue(), c.getLibName() + ":" + c.getPartName(), writerow( out, [c.getRef(), c.getValue(), c.getLibName() + ":" + c.getPartName(),
c.getDatasheet(), c.getDescription(), c.getField("Vendor")]) c.getFootprint(), c.getDescription(), c.getField("Vendor")])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment