Gerbview: remove analysis of fully outdated (and never used) gerber commands

This commit is contained in:
jean-pierre charras 2017-08-11 11:21:33 +02:00
parent 6bdc9cd25e
commit b0bfbd4f41
4 changed files with 1 additions and 63 deletions

View File

@ -206,15 +206,11 @@ void GERBER_FILE_IMAGE::ResetDefaultValues()
m_IJPos.x = m_IJPos.y = 0; // current centre coord for m_IJPos.x = m_IJPos.y = 0; // current centre coord for
// plot arcs & circles // plot arcs & circles
m_Current_File = NULL; // Gerber file to read m_Current_File = NULL; // Gerber file to read
m_FilesPtr = 0;
m_PolygonFillMode = false; m_PolygonFillMode = false;
m_PolygonFillModeState = 0; m_PolygonFillModeState = 0;
m_Selected_Tool = 0; m_Selected_Tool = 0;
m_Last_Pen_Command = 0; m_Last_Pen_Command = 0;
m_Exposure = false; m_Exposure = false;
for( unsigned ii = 0; ii < DIM( m_FilesList ); ii++ )
m_FilesList[ii] = NULL;
} }

View File

@ -148,9 +148,6 @@ public:
wxPoint m_IJPos; // IJ coord (for arcs & circles ) wxPoint m_IJPos; // IJ coord (for arcs & circles )
FILE* m_Current_File; // Current file to read FILE* m_Current_File; // Current file to read
#define INCLUDE_FILES_CNT_MAX 10
FILE* m_FilesList[INCLUDE_FILES_CNT_MAX + 2]; // Included files list
int m_FilesPtr; // Stack pointer for files list
int m_Selected_Tool; // For hightlight: current selected Dcode int m_Selected_Tool; // For hightlight: current selected Dcode
bool m_Has_DCode; // true = DCodes in file bool m_Has_DCode; // true = DCodes in file

View File

@ -114,17 +114,7 @@ bool GERBER_FILE_IMAGE::LoadGerberFile( const wxString& aFullFileName )
while( true ) while( true )
{ {
if( fgets( line, sizeof(line), m_Current_File ) == NULL ) if( fgets( line, sizeof(line), m_Current_File ) == NULL )
{ break;
if( m_FilesPtr == 0 )
break;
fclose( m_Current_File );
m_FilesPtr--;
m_Current_File = m_FilesList[m_FilesPtr];
continue;
}
text = StrPurge( line ); text = StrPurge( line );

View File

@ -72,7 +72,6 @@ enum RS274X_PARAMETERS {
IMAGE_OFFSET = CODE( 'I', 'O' ), // Default: A = 0, B = 0 IMAGE_OFFSET = CODE( 'I', 'O' ), // Default: A = 0, B = 0
IMAGE_POLARITY = CODE( 'I', 'P' ), // Default: Positive IMAGE_POLARITY = CODE( 'I', 'P' ), // Default: Positive
IMAGE_ROTATION = CODE( 'I', 'R' ), // Default: 0 IMAGE_ROTATION = CODE( 'I', 'R' ), // Default: 0
PLOTTER_FILM = CODE( 'P', 'M' ),
// Aperture parameters: // Aperture parameters:
// Usually for the whole file // Usually for the whole file
@ -109,9 +108,6 @@ enum RS274X_PARAMETERS {
KNOCKOUT = CODE( 'K', 'O' ), // Default: off KNOCKOUT = CODE( 'K', 'O' ), // Default: off
STEP_AND_REPEAT = CODE( 'S', 'R' ), // Default: A = 1, B = 1 STEP_AND_REPEAT = CODE( 'S', 'R' ), // Default: A = 1, B = 1
ROTATE = CODE( 'R', 'O' ), // Default: 0 ROTATE = CODE( 'R', 'O' ), // Default: 0
// Miscellaneous parameters:
INCLUDE_FILE = CODE( 'I', 'F' )
}; };
@ -252,7 +248,6 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int command, char* buff, char*& te
int seq_len; // not used, just provided int seq_len; // not used, just provided
int seq_char; int seq_char;
bool ok = true; bool ok = true;
char line[GERBER_BUFZ];
wxString msg; wxString msg;
double fcoord; double fcoord;
bool x_fmt_known = false; bool x_fmt_known = false;
@ -649,17 +644,6 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int command, char* buff, char*& te
AddMessageToList( msg ); AddMessageToList( msg );
break; break;
case PLOTTER_FILM: // Command PF <string>
// This is an info about film that must be used to plot this file
// Has no meaning here. We just display this string
msg = wxT( "Plotter Film info:<br>" );
while( *text != '*' )
{
msg.Append( *text++ );
}
AddMessageToList( msg );
break;
case ROTATE: // Layer rotation: command like %RO45*% case ROTATE: // Layer rotation: command like %RO45*%
m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // Start a new Gerber layer m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // Start a new Gerber layer
m_LocalRotation =ReadDouble( text ); // Store layer rotation in degrees m_LocalRotation =ReadDouble( text ); // Store layer rotation in degrees
@ -696,38 +680,9 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int command, char* buff, char*& te
case LAYER_POLARITY: case LAYER_POLARITY:
if( *text == 'C' ) if( *text == 'C' )
GetLayerParams().m_LayerNegative = true; GetLayerParams().m_LayerNegative = true;
else else
GetLayerParams().m_LayerNegative = false; GetLayerParams().m_LayerNegative = false;
// DBG( printf( "%22s: LAYER_POLARITY m_LayerNegative=%s\n", __func__,
// GetLayerParams().m_LayerNegative ? "true" : "false" ); )
break;
case INCLUDE_FILE:
if( m_FilesPtr >= INCLUDE_FILES_CNT_MAX )
{
ok = false;
AddMessageToList( _( "Too many include files!!" ) );
break;
}
strncpy( line, text, sizeof(line)-1 );
line[sizeof(line)-1] = '\0';
strtok( line, "*%%\n\r" );
m_FilesList[m_FilesPtr] = m_Current_File;
m_Current_File = fopen( line, "rt" );
if( m_Current_File == 0 )
{
msg.Printf( wxT( "include file <%s> not found." ), line );
AddMessageToList( msg );
ok = false;
m_Current_File = m_FilesList[m_FilesPtr];
break;
}
m_FilesPtr++;
break; break;
case AP_MACRO: // lines like %AMMYMACRO* case AP_MACRO: // lines like %AMMYMACRO*