Gerber files: Enable net attributes options in plot Gerber dlg and fix net attribute for "no net" tracks and vias (netcode <= 0).

This commit is contained in:
jean-pierre charras 2016-10-23 19:43:31 +02:00
parent 1840c3c4c7
commit 4ee344e150
3 changed files with 14 additions and 2 deletions

View File

@ -551,7 +551,11 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
if( ( m_netAttributes.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_NET ) ) if( ( m_netAttributes.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_NET ) )
{ {
net_msg = _( "Net:" ); net_msg = _( "Net:" );
net_msg << " " << m_netAttributes.m_Netname; net_msg << " ";
if( m_netAttributes.m_Netname.IsEmpty() )
net_msg << "<no net name>";
else
net_msg << m_netAttributes.m_Netname;
} }
if( ( m_netAttributes.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_PAD ) ) if( ( m_netAttributes.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_PAD ) )

View File

@ -41,7 +41,7 @@
#include <wx_html_report_panel.h> #include <wx_html_report_panel.h>
// Uncomment this line to allow experimetal net attributes in Gerber files: // Uncomment this line to allow experimetal net attributes in Gerber files:
//#define KICAD_USE_GBR_NETATTRIBUTES #define KICAD_USE_GBR_NETATTRIBUTES
DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) : DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) :
DIALOG_PLOT_BASE( aParent ), m_parent( aParent ), DIALOG_PLOT_BASE( aParent ), m_parent( aParent ),

View File

@ -459,6 +459,10 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
if( diameter <= 0 ) if( diameter <= 0 )
continue; continue;
// Some vias can be not connected (no net).
// Set the m_NotInNet for these vias to force a empty net name in gerber file
gbr_metadata.m_NetlistMetadata.m_NotInNet = Via->GetNetname().IsEmpty();
gbr_metadata.SetNetName( Via->GetNetname() ); gbr_metadata.SetNetName( Via->GetNetname() );
EDA_COLOR_T color = aBoard->GetVisibleElementColor(VIAS_VISIBLE + Via->GetViaType()); EDA_COLOR_T color = aBoard->GetVisibleElementColor(VIAS_VISIBLE + Via->GetViaType());
@ -481,6 +485,10 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
if( !aLayerMask[track->GetLayer()] ) if( !aLayerMask[track->GetLayer()] )
continue; continue;
// Some track segments can be not connected (no net).
// Set the m_NotInNet for these segments to force a empty net name in gerber file
gbr_metadata.m_NetlistMetadata.m_NotInNet = track->GetNetname().IsEmpty();
gbr_metadata.SetNetName( track->GetNetname() ); gbr_metadata.SetNetName( track->GetNetname() );
int width = track->GetWidth() + itemplotter.getFineWidthAdj(); int width = track->GetWidth() + itemplotter.getFineWidthAdj();
aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) ); aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );