Gerber drill file: Modify a aperture attribute for oblong holes (slots).
Oblong holes (slots) use now a aperture attribute similar to round holes. (The previous attribute "slot" is now deprecated) However they have a specific aperture, and a comment is added in drill files for these apertures.
This commit is contained in:
parent
70ff2e14a5
commit
29ca96cfe7
|
@ -150,7 +150,8 @@ wxString GbrMakeProjectGUIDfromString( wxString& aText )
|
|||
std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribute,
|
||||
bool aUseX1StructuredComment )
|
||||
{
|
||||
std::string attribute_string;
|
||||
std::string attribute_string; // the specific aperture attribute (TA.xxx)
|
||||
std::string comment_string; // a optional G04 comment line to write before the TA. line
|
||||
|
||||
// generate a string to print a Gerber Aperture attribute
|
||||
switch( aAttribute )
|
||||
|
@ -226,13 +227,18 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
|
|||
break;
|
||||
|
||||
case GBR_APERTURE_ATTRIB_COMPONENTDRILL: // print info associated to a component
|
||||
// round hole in drill files
|
||||
// round pad hole in drill files
|
||||
attribute_string = "TA.AperFunction,ComponentDrill";
|
||||
break;
|
||||
|
||||
case GBR_APERTURE_ATTRIB_SLOTDRILL: // print info associated to a oblong hole in drill files
|
||||
attribute_string = "TA.AperFunction,Slot";
|
||||
break;
|
||||
// print info associated to a component oblong pad hole in drill files
|
||||
// Same as a round pad hole, but is a specific aperture in drill file and
|
||||
// a G04 comment is added to the aperture function
|
||||
case GBR_APERTURE_ATTRIB_COMPONENTOBLONGDRILL:
|
||||
comment_string = "aperture for slot hole";
|
||||
attribute_string = "TA.AperFunction,ComponentDrill";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
std::string full_attribute_string;
|
||||
|
@ -240,14 +246,19 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
|
|||
|
||||
if( !attribute_string.empty() )
|
||||
{
|
||||
if( !comment_string.empty() )
|
||||
{
|
||||
full_attribute_string = "G04 " + comment_string + "*\n";
|
||||
}
|
||||
|
||||
if( aUseX1StructuredComment )
|
||||
{
|
||||
full_attribute_string = "G04 #@! ";
|
||||
full_attribute_string += "G04 #@! ";
|
||||
eol_string = "*\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
full_attribute_string = "%";
|
||||
full_attribute_string += "%";
|
||||
eol_string = "*%\n";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
GBR_APERTURE_ATTRIB_HEATSINKPAD, ///< aperture used for heat sink pad (typically for SMDs)
|
||||
GBR_APERTURE_ATTRIB_VIADRILL, ///< aperture used for via holes in drill files
|
||||
GBR_APERTURE_ATTRIB_COMPONENTDRILL, ///< aperture used for pad holes in drill files
|
||||
GBR_APERTURE_ATTRIB_SLOTDRILL, ///< aperture used for oblong holes in drill files
|
||||
GBR_APERTURE_ATTRIB_COMPONENTOBLONGDRILL, ///< aperture used for pads oblong holes in drill files
|
||||
GBR_APERTURE_ATTRIB_END ///< sentinel: max value
|
||||
};
|
||||
|
||||
|
|
|
@ -192,8 +192,10 @@ int GERBER_WRITER::createDrillFile( wxString& aFullFilename, bool aIsNpth,
|
|||
{
|
||||
last_item_is_via = false;
|
||||
|
||||
// Good practice of oblong pad holes (slots) is to use a specific aperture for routing, not used
|
||||
// in drill commands
|
||||
if( hole_descr.m_Hole_Shape )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SLOTDRILL );
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTOBLONGDRILL );
|
||||
else
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTDRILL );
|
||||
|
||||
|
|
Loading…
Reference in New Issue