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

Double quotes have no special meaning, so adding them modify the texts
This commit is contained in:
jean-pierre charras 2023-10-25 08:59:37 +02:00
parent fefb3d96dd
commit 71475a4b56
1 changed files with 11 additions and 10 deletions

View File

@ -126,7 +126,8 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
brd_plotter.SetLayerSet( LSET( aLayer ) );
int cmp_count = 0;
bool allowUtf8 = true;
const bool allowUtf8 = true;
const bool quoteOption = false;
// Plot components data: position, outlines, pad1 and other pads.
for( FOOTPRINT* footprint : fp_list )
@ -136,9 +137,9 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_POSITION );
// 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 ),
allowUtf8, true );
allowUtf8, quoteOption );
metadata.SetCmpReference( ref );
metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
@ -159,15 +160,15 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
// Add component value info:
pnpAttrib.m_Value = ConvertNotAllowedCharsInGerber( footprint->Value().GetShownText( false ),
allowUtf8, true );
allowUtf8, quoteOption );
// Add component footprint info:
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:
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 );
metadata.m_NetlistMetadata.SetExtraData( pnpAttrib.FormatCmpPnPMetadata() );
@ -238,8 +239,8 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
for( PAD* pad1 : pad_key_list )
{
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PAD1_POS );
metadata.SetPadName( pad1->GetNumber(), allowUtf8, true );
metadata.SetPadPinFunction( pad1->GetPinFunction(), allowUtf8, true );
metadata.SetPadName( pad1->GetNumber(), allowUtf8, quoteOption );
metadata.SetPadPinFunction( pad1->GetPinFunction(), allowUtf8, quoteOption );
metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_PAD );
// Flashes a diamond at pad position:
@ -274,8 +275,8 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
if( !pad->IsOnLayer( aLayer ) )
continue;
metadata.SetPadName( pad->GetNumber(), allowUtf8, true );
metadata.SetPadPinFunction( pad->GetPinFunction(), allowUtf8, true );
metadata.SetPadName( pad->GetNumber(), allowUtf8, quoteOption );
metadata.SetPadPinFunction( pad->GetPinFunction(), allowUtf8, quoteOption );
// Flashes a round, 0 sized round shape at pad position
plotter.FlashPadCircle( pad->GetPosition(), other_pads_mark_size, FILLED, &metadata );