diff --git a/common/gbr_metadata.cpp b/common/gbr_metadata.cpp index d7c6b28b3d..0f49fe494d 100644 --- a/common/gbr_metadata.cpp +++ b/common/gbr_metadata.cpp @@ -226,17 +226,30 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu attribute_string = "TA.AperFunction,ViaDrill"; break; - case GBR_APERTURE_ATTRIB_COMPONENTDRILL: // print info associated to a component - // round pad hole in drill files + case GBR_APERTURE_ATTRIB_CMP_DRILL: // print info associated to a component + // round pad hole in drill files attribute_string = "TA.AperFunction,ComponentDrill"; 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: + case GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL: comment_string = "aperture for slot hole"; attribute_string = "TA.AperFunction,ComponentDrill"; + break; + + case GBR_APERTURE_ATTRIB_CMP_POSITION: // print info associated to a component + // flashed shape at the component position + // in placement files + attribute_string = "TA.AperFunction,ComponentMain"; + break; + + case GBR_APERTURE_ATTRIB_CMP_COURTYARD: // print info associated to a component + // print the component courtyard polygon + // in placement files + attribute_string = "TA.AperFunction,ComponentOutline,Courtyard"; + break; break; } diff --git a/common/plotters/GERBER_plotter.cpp b/common/plotters/GERBER_plotter.cpp index 9f2c456d0a..a0eab168f3 100644 --- a/common/plotters/GERBER_plotter.cpp +++ b/common/plotters/GERBER_plotter.cpp @@ -161,6 +161,12 @@ void GERBER_PLOTTER::formatNetAttribute( GBR_NETLIST_METADATA* aData ) if( !short_attribute_string.empty() ) fputs( short_attribute_string.c_str(), outputFile ); + + if( m_useX2format && !aData->m_ExtraData.IsEmpty() ) + { + std::string extra_data = TO_UTF8( aData->m_ExtraData ); + fputs( extra_data.c_str(), outputFile ); + } } @@ -500,7 +506,7 @@ void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAn } -void GERBER_PLOTTER:: PlotPoly( const std::vector< wxPoint >& aCornerList, +void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_T aFill, int aWidth, void * aData ) { if( aCornerList.size() <= 1 ) diff --git a/include/gbr_metadata.h b/include/gbr_metadata.h index ef0a0c4fce..4147673b38 100644 --- a/include/gbr_metadata.h +++ b/include/gbr_metadata.h @@ -94,8 +94,11 @@ public: GBR_APERTURE_ATTRIB_WASHERPAD, ///< aperture used for mechanical pads (NPTH) 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_COMPONENTOBLONGDRILL, ///< aperture used for pads oblong holes in drill files + GBR_APERTURE_ATTRIB_CMP_DRILL, ///< aperture used for pad holes in drill files + GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL, ///< aperture used for pads oblong holes in drill files + GBR_APERTURE_ATTRIB_CMP_POSITION, ///< aperture used for flashed shape in placement files + GBR_APERTURE_ATTRIB_CMP_COURTYARD, ///< aperture used to draw component outline courtyard + ///< in placement files GBR_APERTURE_ATTRIB_END ///< sentinel: max value }; diff --git a/include/gbr_netlist_metadata.h b/include/gbr_netlist_metadata.h index 728e4bdceb..ade6d412e5 100644 --- a/include/gbr_netlist_metadata.h +++ b/include/gbr_netlist_metadata.h @@ -62,10 +62,28 @@ public: wxString m_Cmpref; ///< the component reference parent of the data wxString m_Netname; ///< for items associated to a net: the netname + wxString m_ExtraData; ///< a string to print after %TO object attributes, if not empty + ///< it is printed "as this" + + GBR_NETLIST_METADATA(): m_NetAttribType( GBR_NETINFO_UNSPECIFIED ), m_NotInNet( false ) { } + /** Clear the extra data string printed at end of net attributes + */ + void ClearExtraData() + { + m_ExtraData.Clear(); + } + + /** Set the extra data string printed at end of net attributes + */ + void SetExtraData( const wxString& aExtraData) + { + m_ExtraData = aExtraData; + } + /** * remove the net attribute specified by aName * If aName == NULL or empty, remove all attributes diff --git a/include/plotter.h b/include/plotter.h index 3f7517416e..142a678cba 100644 --- a/include/plotter.h +++ b/include/plotter.h @@ -277,7 +277,8 @@ public: /** * Function PlotPoly * @brief Draw a polygon ( filled or not ) - * @param aCornerList = corners list (a SHAPE_LINE_CHAIN) + * @param aCornerList = corners list (a SHAPE_LINE_CHAIN). + * must be closed (IsClosed() == true) for a polygon. Otherwise this is a polyline * @param aFill = type of fill * @param aWidth = line width * @param aData an auxiliary info (mainly for gerber format) diff --git a/pcbnew/exporters/gendrill_gerber_writer.cpp b/pcbnew/exporters/gendrill_gerber_writer.cpp index e8c1dd75c3..54b73c76a4 100644 --- a/pcbnew/exporters/gendrill_gerber_writer.cpp +++ b/pcbnew/exporters/gendrill_gerber_writer.cpp @@ -195,18 +195,14 @@ int GERBER_WRITER::createDrillFile( wxString& aFullFilename, bool aIsNpth, // 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_COMPONENTOBLONGDRILL ); + gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL ); else - gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTDRILL ); + gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_DRILL ); // Add object attribute: component reference to pads (mainly usefull for users) const D_PAD* pad = dyn_cast( hole_descr.m_ItemParent ); wxString ref = pad->GetParent()->GetReference(); -#if 0 // Set to 1 to force a dummy reference for the parent pad. - if( ref.IsEmpty() ) - ref = ""; -#endif gbr_metadata.SetCmpReference( ref ); gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP ); }