Commit 7b5318ff authored by jean-pierre charras's avatar jean-pierre charras

Fix minor issues about translated strings and coding style. Add comment...

Fix minor issues about translated strings and coding style. Add comment relative to file function info  in X1 gerber file format.
parent db31daff
...@@ -119,8 +119,7 @@ bool GERBER_PLOTTER::StartPlot() ...@@ -119,8 +119,7 @@ bool GERBER_PLOTTER::StartPlot()
if( ! m_attribFunction.IsEmpty() ) if( ! m_attribFunction.IsEmpty() )
{ {
fprintf( outputFile, "%%TF.FileFunction,%s*%%\n", fprintf( outputFile, "%s\n", TO_UTF8( m_attribFunction ) );
TO_UTF8( m_attribFunction ) );
} }
// Set coordinate format to 3.6 or 4.5 absolute, leading zero omitted // Set coordinate format to 3.6 or 4.5 absolute, leading zero omitted
......
...@@ -98,9 +98,9 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef ) ...@@ -98,9 +98,9 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
} }
catch (IO_ERROR& e) catch( IO_ERROR& e )
{ {
msg.Printf( _( "DXF Plotter Exception : '%s'"), wxString(e.errorText ) ); msg.Printf( wxT( "DXF Plotter Exception : '%s'"), GetChars( e.errorText ) );
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
schframe->SetCurrentSheet( oldsheetpath ); schframe->SetCurrentSheet( oldsheetpath );
schframe->GetCurrentSheet().UpdateAllScreenReferences(); schframe->GetCurrentSheet().UpdateAllScreenReferences();
......
...@@ -195,9 +195,9 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef ) ...@@ -195,9 +195,9 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
if( !aPlotAll ) if( !aPlotAll )
break; break;
} }
catch (IO_ERROR& e) catch( IO_ERROR& e )
{ {
msg.Printf( _( "HPGL Plotter Exception : '%s'"), wxString(e.errorText ) ); msg.Printf( wxT( "HPGL Plotter Exception : '%s'"), GetChars( e.errorText ) );
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
} }
......
...@@ -110,10 +110,10 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef ) ...@@ -110,10 +110,10 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
first_page = false; first_page = false;
} }
catch (const IO_ERROR& e) catch( const IO_ERROR& e )
{ {
// Cannot plot PDF file // Cannot plot PDF file
msg.Printf( _( "PDF Plotter Exception : <%s>"), wxString(e.errorText ) ); msg.Printf( wxT( "PDF Plotter Exception : <%s>"), GetChars( e.errorText ) );
restoreEnvironment(plotter, oldsheetpath, msg); restoreEnvironment(plotter, oldsheetpath, msg);
return; return;
} }
......
...@@ -129,9 +129,9 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef ) ...@@ -129,9 +129,9 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
} }
catch (IO_ERROR& e) catch( IO_ERROR& e )
{ {
msg.Printf( _( "PS Plotter Exception : '%s'"), wxString(e.errorText ) ); msg.Printf( wxT( "PS Plotter Exception : '%s'"), GetChars( e.errorText ) );
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
} }
......
...@@ -101,10 +101,10 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef ) ...@@ -101,10 +101,10 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
} }
catch (const IO_ERROR& e) catch( const IO_ERROR& e )
{ {
// Cannot plot SVG file // Cannot plot SVG file
msg.Printf( _( "SVG Plotter Exception : '%s'" ), wxString( e.errorText ) ); msg.Printf( wxT( "SVG Plotter Exception : '%s'" ), GetChars( e.errorText ) );
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
m_parent->SetCurrentSheet( oldsheetpath ); m_parent->SetCurrentSheet( oldsheetpath );
...@@ -143,10 +143,10 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef ) ...@@ -143,10 +143,10 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
} }
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
} }
catch (const IO_ERROR& e) catch( const IO_ERROR& e )
{ {
// Cannot plot SVG file // Cannot plot SVG file
msg.Printf( _( "SVG Plotter Exception : <%s>"), wxString(e.errorText ) ); msg.Printf( wxT( "SVG Plotter Exception : <%s>"), GetChars( e.errorText ) );
m_MessagesBox->AppendText( msg ); m_MessagesBox->AppendText( msg );
return; return;
} }
......
...@@ -84,9 +84,10 @@ const wxString GetGerberExtension( LAYER_NUM aLayer ) ...@@ -84,9 +84,10 @@ const wxString GetGerberExtension( LAYER_NUM aLayer )
} }
wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer ) wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer,
bool aUseX1CompatibilityMode )
{ {
wxString attrib = wxEmptyString; wxString attrib;
switch( aLayer ) switch( aLayer )
{ {
...@@ -178,11 +179,18 @@ wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer ) ...@@ -178,11 +179,18 @@ wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer )
attrib += wxString( wxT( ",Mixed" ) ); attrib += wxString( wxT( ",Mixed" ) );
break; break;
default: default:
; // do nothing (but avoid a warning for unhandled LAYER_T values from GCC) break; // do nothing (but avoid a warning for unhandled LAYER_T values from GCC)
} }
} }
return attrib; wxString fileFct;
if( aUseX1CompatibilityMode )
fileFct.Printf( "G04 #@! TF.FileFunction,%s*", GetChars( attrib ) );
else
fileFct.Printf( "%%TF.FileFunction,%s*%%", GetChars( attrib ) );
return fileFct;
} }
......
...@@ -258,9 +258,12 @@ const wxString GetGerberExtension( LAYER_NUM aLayer ); ...@@ -258,9 +258,12 @@ const wxString GetGerberExtension( LAYER_NUM aLayer );
* the "%TF.FileFunction" attribute prefix and the "*%" suffix. * the "%TF.FileFunction" attribute prefix and the "*%" suffix.
* @param aBoard = the board, needed to get the total count of copper layers * @param aBoard = the board, needed to get the total count of copper layers
* @param aLayer = the layer number to create the attribute for * @param aLayer = the layer number to create the attribute for
* @param aUseX1CompatibilityMode = true to use a file function attribute like G04 comment
* , compatible with X1 (rx274) notation (G04#@!TF.FileFunction)
* @return The attribute, as a text string * @return The attribute, as a text string
*/ */
extern wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer ); extern wxString GetGerberFileFunction( const BOARD *aBoard, LAYER_NUM aLayer,
bool aUseX1CompatibilityMode );
// PLOTGERB.CPP // PLOTGERB.CPP
void SelectD_CODE_For_LineDraw( PLOTTER* plotter, int aSize ); void SelectD_CODE_For_LineDraw( PLOTTER* plotter, int aSize );
......
...@@ -1005,8 +1005,12 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, ...@@ -1005,8 +1005,12 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
if( plotter->OpenFile( aFullFileName ) ) if( plotter->OpenFile( aFullFileName ) )
{ {
// For the Gerber "file function" attribute, set the layer number // For the Gerber "file function" attribute, set the layer number
if( plotter->GetPlotterType() == PLOT_FORMAT_GERBER && plotOpts.GetUseGerberAttributes() ) if( plotter->GetPlotterType() == PLOT_FORMAT_GERBER )
plotter->SetLayerAttribFunction( GetGerberFileFunction( aBoard, aLayer ) ); {
bool useX2mode = plotOpts.GetUseGerberAttributes();
plotter->SetLayerAttribFunction( GetGerberFileFunction( aBoard, aLayer,
useX2mode ? false : true ) );
}
plotter->StartPlot(); plotter->StartPlot();
......
...@@ -631,7 +631,7 @@ void PCB_EDIT_FRAME::updateTraceWidthSelectBox() ...@@ -631,7 +631,7 @@ void PCB_EDIT_FRAME::updateTraceWidthSelectBox()
msg = _( "Track " ) + CoordinateToString( GetDesignSettings().m_TrackWidthList[ii], true ); msg = _( "Track " ) + CoordinateToString( GetDesignSettings().m_TrackWidthList[ii], true );
if( ii == 0 ) if( ii == 0 )
msg << _( " *" ); msg << wxT( " *" );
m_SelTrackWidthBox->Append( msg ); m_SelTrackWidthBox->Append( msg );
} }
...@@ -662,7 +662,7 @@ void PCB_EDIT_FRAME::updateViaSizeSelectBox() ...@@ -662,7 +662,7 @@ void PCB_EDIT_FRAME::updateViaSizeSelectBox()
<< CoordinateToString( GetDesignSettings().m_ViasDimensionsList[ii].m_Drill, true ); << CoordinateToString( GetDesignSettings().m_ViasDimensionsList[ii].m_Drill, true );
if( ii == 0 ) if( ii == 0 )
msg << _( " *" ); msg << wxT( " *" );
m_SelViaSizeBox->Append( msg ); m_SelViaSizeBox->Append( msg );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment