Gerbview: code refactor: change name of a D_CODE member:
D_CODE::m_Shape -> m_ApertType (it is not a shape, it is a aperture type) Fix also an outdated/incorrect comment No actual code change.
This commit is contained in:
parent
0d0c9aee3a
commit
fa1591d021
|
@ -71,7 +71,7 @@ void D_CODE::Clear_D_CODE_Data()
|
||||||
{
|
{
|
||||||
m_Size.x = DCODE_DEFAULT_SIZE;
|
m_Size.x = DCODE_DEFAULT_SIZE;
|
||||||
m_Size.y = DCODE_DEFAULT_SIZE;
|
m_Size.y = DCODE_DEFAULT_SIZE;
|
||||||
m_Shape = APT_CIRCLE;
|
m_ApertType = APT_CIRCLE;
|
||||||
m_Drill.x = m_Drill.y = 0;
|
m_Drill.x = m_Drill.y = 0;
|
||||||
m_DrillShape = APT_DEF_NO_HOLE;
|
m_DrillShape = APT_DEF_NO_HOLE;
|
||||||
m_InUse = false;
|
m_InUse = false;
|
||||||
|
@ -116,7 +116,7 @@ int D_CODE::GetShapeDim( GERBER_DRAW_ITEM* aParent )
|
||||||
{
|
{
|
||||||
int dim = 0;
|
int dim = 0;
|
||||||
|
|
||||||
switch( m_Shape )
|
switch( m_ApertType )
|
||||||
{
|
{
|
||||||
case APT_CIRCLE:
|
case APT_CIRCLE:
|
||||||
dim = m_Size.x;
|
dim = m_Size.x;
|
||||||
|
@ -155,7 +155,7 @@ void D_CODE::DrawFlashedShape( const GERBER_DRAW_ITEM* aParent, wxDC* aDC, const
|
||||||
{
|
{
|
||||||
int radius;
|
int radius;
|
||||||
|
|
||||||
switch( m_Shape )
|
switch( m_ApertType )
|
||||||
{
|
{
|
||||||
case APT_CIRCLE:
|
case APT_CIRCLE:
|
||||||
radius = m_Size.x >> 1;
|
radius = m_Size.x >> 1;
|
||||||
|
@ -301,7 +301,7 @@ void D_CODE::ConvertShapeToPolygon( const GERBER_DRAW_ITEM* aParent )
|
||||||
|
|
||||||
m_Polygon.RemoveAllContours();
|
m_Polygon.RemoveAllContours();
|
||||||
|
|
||||||
switch( m_Shape )
|
switch( m_ApertType )
|
||||||
{
|
{
|
||||||
case APT_CIRCLE: // creates only a circle with rectangular hole
|
case APT_CIRCLE: // creates only a circle with rectangular hole
|
||||||
TransformCircleToPolygon( m_Polygon, initialpos, m_Size.x >> 1, ARC_HIGH_DEF,
|
TransformCircleToPolygon( m_Polygon, initialpos, m_Size.x >> 1, ARC_HIGH_DEF,
|
||||||
|
|
|
@ -42,8 +42,8 @@ class GERBER_DRAW_ITEM;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of all gerber aperture types allowed, according to page 16 of
|
* The set of all gerber aperture types allowed
|
||||||
* http://gerbv.sourceforge.net/docs/rs274xrevd_e.pdf
|
* from ADD dcode command, like %ADD11C,0.304800*% to add a DCode number 11, circle shape
|
||||||
*/
|
*/
|
||||||
enum APERTURE_T {
|
enum APERTURE_T {
|
||||||
APT_CIRCLE = 'C', // Flashed shape: Circle with or without hole
|
APT_CIRCLE = 'C', // Flashed shape: Circle with or without hole
|
||||||
|
@ -187,7 +187,8 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxSize m_Size; ///< Horizontal and vertical dimensions.
|
wxSize m_Size; ///< Horizontal and vertical dimensions.
|
||||||
APERTURE_T m_Shape; ///< shape ( Line, rectangle, circle , oval .. )
|
APERTURE_T m_ApertType; ///< Aperture type ( Line, rectangle, circle,
|
||||||
|
///< oval poly, macro )
|
||||||
int m_Num_Dcode; ///< D code value ( >= 10 )
|
int m_Num_Dcode; ///< D code value ( >= 10 )
|
||||||
wxSize m_Drill; ///< dimension of the hole (if any) (drill file)
|
wxSize m_Drill; ///< dimension of the hole (if any) (drill file)
|
||||||
APERTURE_DEF_HOLETYPE m_DrillShape; ///< shape of the hole (0 = no hole, round = 1,
|
APERTURE_DEF_HOLETYPE m_DrillShape; ///< shape of the hole (0 = no hole, round = 1,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2016 Jean-Pierre Charras <jp.charras at wanadoo.fr>
|
* Copyright (C) 1992-2016 Jean-Pierre Charras <jp.charras at wanadoo.fr>
|
||||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -799,7 +799,7 @@ bool EXCELLON_IMAGE::readToolInformation( char*& aText )
|
||||||
conv_scale /= 25.4;
|
conv_scale /= 25.4;
|
||||||
|
|
||||||
dcode->m_Size.x = dcode->m_Size.y = KiROUND( dprm * conv_scale );
|
dcode->m_Size.x = dcode->m_Size.y = KiROUND( dprm * conv_scale );
|
||||||
dcode->m_Shape = APT_CIRCLE;
|
dcode->m_ApertType = APT_CIRCLE;
|
||||||
dcode->m_Defined = true;
|
dcode->m_Defined = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -877,7 +877,7 @@ bool EXCELLON_IMAGE::Execute_Drill_Command( char*& text )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fillFlashedGBRITEM( gbritem, tool->m_Shape, tool->m_Num_Dcode,
|
fillFlashedGBRITEM( gbritem, tool->m_ApertType, tool->m_Num_Dcode,
|
||||||
m_CurrentPos, tool->m_Size, false );
|
m_CurrentPos, tool->m_Size, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -335,7 +335,7 @@ const BOX2I GERBER_DRAW_ITEM::GetBoundingBox() const
|
||||||
|
|
||||||
case GBR_SEGMENT:
|
case GBR_SEGMENT:
|
||||||
{
|
{
|
||||||
if( code && code->m_Shape == APT_RECT )
|
if( code && code->m_ApertType == APT_RECT )
|
||||||
{
|
{
|
||||||
if( m_Polygon.OutlineCount() == 0 )
|
if( m_Polygon.OutlineCount() == 0 )
|
||||||
{
|
{
|
||||||
|
@ -492,7 +492,7 @@ void GERBER_DRAW_ITEM::Print( wxDC* aDC, const VECTOR2I& aOffset, GBR_DISPLAY_OP
|
||||||
* In fact, any aperture can be used to plot a line.
|
* In fact, any aperture can be used to plot a line.
|
||||||
* currently: only a square pen is handled (I believe using a polygon gives a strange plot).
|
* currently: only a square pen is handled (I believe using a polygon gives a strange plot).
|
||||||
*/
|
*/
|
||||||
if( d_codeDescr->m_Shape == APT_RECT )
|
if( d_codeDescr->m_ApertType == APT_RECT )
|
||||||
{
|
{
|
||||||
if( m_Polygon.OutlineCount() == 0 )
|
if( m_Polygon.OutlineCount() == 0 )
|
||||||
ConvertSegmentToPolygon();
|
ConvertSegmentToPolygon();
|
||||||
|
|
|
@ -57,7 +57,7 @@ enum GBR_BASIC_SHAPE_TYPE
|
||||||
GBR_SPOT_RECT, // flashed shape: rectangular shape can have hole)
|
GBR_SPOT_RECT, // flashed shape: rectangular shape can have hole)
|
||||||
GBR_SPOT_OVAL, // flashed shape: oval shape
|
GBR_SPOT_OVAL, // flashed shape: oval shape
|
||||||
GBR_SPOT_POLY, // flashed shape: regular polygon, 3 to 12 edges
|
GBR_SPOT_POLY, // flashed shape: regular polygon, 3 to 12 edges
|
||||||
GBR_SPOT_MACRO // complex shape described by a macro
|
GBR_SPOT_MACRO // complex shape described by a macro
|
||||||
};
|
};
|
||||||
|
|
||||||
class GERBER_DRAW_ITEM : public EDA_ITEM
|
class GERBER_DRAW_ITEM : public EDA_ITEM
|
||||||
|
|
|
@ -384,7 +384,7 @@ void GERBVIEW_PAINTER::draw( /*const*/ GERBER_DRAW_ITEM* aItem, int aLayer )
|
||||||
|
|
||||||
// TODO(JE) Refactor this to allow const aItem
|
// TODO(JE) Refactor this to allow const aItem
|
||||||
D_CODE* code = aItem->GetDcodeDescr();
|
D_CODE* code = aItem->GetDcodeDescr();
|
||||||
if( code && code->m_Shape == APT_RECT )
|
if( code && code->m_ApertType == APT_RECT )
|
||||||
{
|
{
|
||||||
if( aItem->m_Polygon.OutlineCount() == 0 )
|
if( aItem->m_Polygon.OutlineCount() == 0 )
|
||||||
aItem->ConvertSegmentToPolygon();
|
aItem->ConvertSegmentToPolygon();
|
||||||
|
|
|
@ -682,7 +682,7 @@ bool GERBER_FILE_IMAGE::Execute_DCODE_Command( char*& text, int D_commande )
|
||||||
{
|
{
|
||||||
size = tool->m_Size;
|
size = tool->m_Size;
|
||||||
dcode = tool->m_Num_Dcode;
|
dcode = tool->m_Num_Dcode;
|
||||||
aperture = tool->m_Shape;
|
aperture = tool->m_ApertType;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( m_Iterpolation )
|
switch( m_Iterpolation )
|
||||||
|
@ -741,7 +741,7 @@ bool GERBER_FILE_IMAGE::Execute_DCODE_Command( char*& text, int D_commande )
|
||||||
{
|
{
|
||||||
size = tool->m_Size;
|
size = tool->m_Size;
|
||||||
dcode = tool->m_Num_Dcode;
|
dcode = tool->m_Num_Dcode;
|
||||||
aperture = tool->m_Shape;
|
aperture = tool->m_ApertType;
|
||||||
}
|
}
|
||||||
|
|
||||||
gbritem = new GERBER_DRAW_ITEM( this );
|
gbritem = new GERBER_DRAW_ITEM( this );
|
||||||
|
|
|
@ -735,7 +735,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
|
||||||
switch( stdAperture ) // Aperture desceiption has optional parameters. Read them
|
switch( stdAperture ) // Aperture desceiption has optional parameters. Read them
|
||||||
{
|
{
|
||||||
case 'C': // Circle
|
case 'C': // Circle
|
||||||
dcode->m_Shape = APT_CIRCLE;
|
dcode->m_ApertType = APT_CIRCLE;
|
||||||
while( *aText == ' ' )
|
while( *aText == ' ' )
|
||||||
aText++;
|
aText++;
|
||||||
|
|
||||||
|
@ -763,7 +763,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
|
||||||
|
|
||||||
case 'O': // oval
|
case 'O': // oval
|
||||||
case 'R': // rect
|
case 'R': // rect
|
||||||
dcode->m_Shape = (stdAperture == 'O') ? APT_OVAL : APT_RECT;
|
dcode->m_ApertType = (stdAperture == 'O') ? APT_OVAL : APT_RECT;
|
||||||
|
|
||||||
while( *aText == ' ' )
|
while( *aText == ' ' )
|
||||||
aText++;
|
aText++;
|
||||||
|
@ -805,7 +805,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
|
||||||
/* Regular polygon: a command line like %ADD12P,0.040X10X25X0.025X0.025X0.0150*%
|
/* Regular polygon: a command line like %ADD12P,0.040X10X25X0.025X0.025X0.0150*%
|
||||||
* params are: <diameter>, X<edge count>, X<Rotation>, X<X hole dim>, X<Y hole dim>
|
* params are: <diameter>, X<edge count>, X<Rotation>, X<X hole dim>, X<Y hole dim>
|
||||||
*/
|
*/
|
||||||
dcode->m_Shape = APT_POLYGON;
|
dcode->m_ApertType = APT_POLYGON;
|
||||||
while( *aText == ' ' )
|
while( *aText == ' ' )
|
||||||
aText++;
|
aText++;
|
||||||
|
|
||||||
|
@ -897,7 +897,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dcode->m_Shape = APT_MACRO;
|
dcode->m_ApertType = APT_MACRO;
|
||||||
dcode->SetMacro( pam );
|
dcode->SetMacro( pam );
|
||||||
dcode->m_Defined = true;
|
dcode->m_Defined = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
||||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* 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
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
@ -352,7 +352,7 @@ void GERBVIEW_FRAME::updateDCodeSelectBox()
|
||||||
dcode->m_Num_Dcode,
|
dcode->m_Num_Dcode,
|
||||||
dcode->m_Size.x / scale, dcode->m_Size.y / scale,
|
dcode->m_Size.x / scale, dcode->m_Size.y / scale,
|
||||||
units,
|
units,
|
||||||
D_CODE::ShowApertureType( dcode->m_Shape ) );
|
D_CODE::ShowApertureType( dcode->m_ApertType ) );
|
||||||
|
|
||||||
if( !dcode->m_AperFunction.IsEmpty() )
|
if( !dcode->m_AperFunction.IsEmpty() )
|
||||||
msg << wxT( ", " ) << dcode->m_AperFunction;
|
msg << wxT( ", " ) << dcode->m_AperFunction;
|
||||||
|
|
|
@ -129,7 +129,7 @@ int GERBVIEW_INSPECTION_TOOL::ShowDCodes( const TOOL_EVENT& aEvent )
|
||||||
pt_D_code->m_Num_Dcode,
|
pt_D_code->m_Num_Dcode,
|
||||||
pt_D_code->m_Size.y / scale, units,
|
pt_D_code->m_Size.y / scale, units,
|
||||||
pt_D_code->m_Size.x / scale, units,
|
pt_D_code->m_Size.x / scale, units,
|
||||||
D_CODE::ShowApertureType( pt_D_code->m_Shape ),
|
D_CODE::ShowApertureType( pt_D_code->m_ApertType ),
|
||||||
pt_D_code->m_AperFunction.IsEmpty()? wxT( "none" ) : pt_D_code->m_AperFunction
|
pt_D_code->m_AperFunction.IsEmpty()? wxT( "none" ) : pt_D_code->m_AperFunction
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue