Gerbview: displays aperture attribute value (TA.attribute) for Regions (polygons) having no dcode

This commit is contained in:
jean-pierre charras 2019-10-12 13:56:59 +02:00
parent a18d3cca6e
commit 337244d423
3 changed files with 29 additions and 11 deletions

View File

@ -662,14 +662,26 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PAN
msg = ShowGBRShape();
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, DARKCYAN ) );
// Display D_Code value with its attributes:
msg.Printf( _( "D Code %d" ), m_DCode );
D_CODE* apertDescr = GetDcodeDescr();
// Display D_Code value with its attributes for items using a DCode:
if( m_Shape == GBR_POLYGON ) // Has no DCode, but can have an attribute
{
msg = _( "Attribut" );
if( !apertDescr || apertDescr->m_AperFunction.IsEmpty() )
text = _( "No attribute" );
if( m_AperFunction.IsEmpty() )
text = _( "No attribute" );
else
text = m_AperFunction;
}
else
text = apertDescr->m_AperFunction;
{
msg.Printf( _( "D Code %d" ), m_DCode );
D_CODE* apertDescr = GetDcodeDescr();
if( !apertDescr || apertDescr->m_AperFunction.IsEmpty() )
text = _( "No attribute" );
else
text = apertDescr->m_AperFunction;
}
aList.push_back( MSG_PANEL_ITEM( msg, text, RED ) );

View File

@ -89,8 +89,14 @@ public:
// Lines : m_Size.x = m_Size.y = line width
bool m_Flashed; // True for flashed items
int m_DCode; // DCode used to draw this item.
// Allowed values are 10 to 999. 0 when unknown
// Allowed values are >= 10. 0 when unknown
// values 0 to 9 can be used for special purposes
// Regions (polygons) doo not use DCode,
// so it is set to 0
wxString m_AperFunction; // the aperture function set by a %TA.AperFunction, xxx
// (stores thre xxx value).
// used for regions that do not have a attached DCode, but
// have a TA.AperFunction defined
GERBER_FILE_IMAGE* m_GerberImageFile; /* Gerber file image source of this item
* Note: some params stored in this class are common
* to the whole gerber file (i.e) the whole graphic

View File

@ -619,14 +619,14 @@ bool GERBER_FILE_IMAGE::Execute_DCODE_Command( char*& text, int D_commande )
m_Drawings.Append( gbritem );
gbritem->m_Shape = GBR_POLYGON;
gbritem->m_Flashed = false;
gbritem->m_DCode = 0; // No DCode for a Polygon (Region in Gerber dialect)
tool = GetDCODE( m_Current_Tool );
if( tool )
gbritem->m_DCode = tool->m_Num_Dcode;
if( gbritem->m_GerberImageFile )
{
gbritem->SetNetAttributes( gbritem->m_GerberImageFile->m_NetAttributeDict );
gbritem->m_AperFunction = gbritem->m_GerberImageFile->m_AperFunction;
}
}
switch( m_Iterpolation )