Gerber place files: do not quote strings (fields, pad name, pad function ...)

Double quotes have no special meaning, so adding them modify the texts
Fixes #15944
https://gitlab.com/kicad/code/kicad/-/issues/15944
This commit is contained in:
jean-pierre charras 2023-10-25 09:13:59 +02:00
parent 2263535d3a
commit dbd4af16c6
1 changed files with 10 additions and 9 deletions

View File

@ -132,6 +132,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
brd_plotter.SetLayerSet( LSET( aLayer ) ); brd_plotter.SetLayerSet( LSET( aLayer ) );
int cmp_count = 0; int cmp_count = 0;
bool allowUtf8 = true; bool allowUtf8 = true;
const bool quoteOption = false;
// Plot components data: position, outlines, pad1 and other pads. // Plot components data: position, outlines, pad1 and other pads.
for( FOOTPRINT* footprint : fp_list ) for( FOOTPRINT* footprint : fp_list )
@ -141,9 +142,9 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_POSITION ); gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_POSITION );
// Add object attribute: component reference to flash (mainly useful for users) // Add object attribute: component reference to flash (mainly useful for users)
// using quoted UTF8 string // using not quoted UTF8 string
wxString ref = ConvertNotAllowedCharsInGerber( footprint->Reference().GetShownText( false ), wxString ref = ConvertNotAllowedCharsInGerber( footprint->Reference().GetShownText( false ),
allowUtf8, true ); allowUtf8, quoteOption );
gbr_metadata.SetCmpReference( ref ); gbr_metadata.SetCmpReference( ref );
gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP ); gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
@ -164,15 +165,15 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
// Add component value info: // Add component value info:
pnpAttrib.m_Value = ConvertNotAllowedCharsInGerber( footprint->Value().GetShownText( false ), pnpAttrib.m_Value = ConvertNotAllowedCharsInGerber( footprint->Value().GetShownText( false ),
allowUtf8, true ); allowUtf8, quoteOption );
// Add component footprint info: // Add component footprint info:
wxString fp_info = FROM_UTF8( footprint->GetFPID().GetLibItemName().c_str() ); wxString fp_info = FROM_UTF8( footprint->GetFPID().GetLibItemName().c_str() );
pnpAttrib.m_Footprint = ConvertNotAllowedCharsInGerber( fp_info, allowUtf8, true ); pnpAttrib.m_Footprint = ConvertNotAllowedCharsInGerber( fp_info, allowUtf8, quoteOption );
// Add footprint lib name: // Add footprint lib name:
fp_info = FROM_UTF8( footprint->GetFPID().GetLibNickname().c_str() ); fp_info = FROM_UTF8( footprint->GetFPID().GetLibNickname().c_str() );
pnpAttrib.m_LibraryName = ConvertNotAllowedCharsInGerber( fp_info, allowUtf8, true ); pnpAttrib.m_LibraryName = ConvertNotAllowedCharsInGerber( fp_info, allowUtf8, quoteOption );
gbr_metadata.m_NetlistMetadata.SetExtraData( pnpAttrib.FormatCmpPnPMetadata() ); gbr_metadata.m_NetlistMetadata.SetExtraData( pnpAttrib.FormatCmpPnPMetadata() );
@ -247,9 +248,9 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
gbr_metadata.SetApertureAttrib( gbr_metadata.SetApertureAttrib(
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PAD1_POSITION ); GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PAD1_POSITION );
gbr_metadata.SetPadName( pad1->GetNumber(), allowUtf8, true ); gbr_metadata.SetPadName( pad1->GetNumber(), allowUtf8, quoteOption );
gbr_metadata.SetPadPinFunction( pad1->GetPinFunction(), allowUtf8, true ); gbr_metadata.SetPadPinFunction( pad1->GetPinFunction(), allowUtf8, quoteOption );
gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_PAD ); gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_PAD );
@ -286,9 +287,9 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
if( !pad->IsOnLayer( aLayer ) ) if( !pad->IsOnLayer( aLayer ) )
continue; continue;
gbr_metadata.SetPadName( pad->GetNumber(), allowUtf8, true ); gbr_metadata.SetPadName( pad->GetNumber(), allowUtf8, quoteOption );
gbr_metadata.SetPadPinFunction( pad->GetPinFunction(), allowUtf8, true ); gbr_metadata.SetPadPinFunction( pad->GetPinFunction(), allowUtf8, quoteOption );
// Flashes a round, 0 sized round shape at pad position // Flashes a round, 0 sized round shape at pad position
plotter.FlashPadCircle( pad->GetPosition(), other_pads_mark_size, FILLED, plotter.FlashPadCircle( pad->GetPosition(), other_pads_mark_size, FILLED,