Commit 53f69ece authored by charras's avatar charras

gerbview: add french translation, G55 command (a do nothing command) and...

gerbview: add french translation, G55 command (a do nothing command) and solved a bug that can crashes gerbview with files without any DCODE tools info.
parent 6e6098a0
...@@ -379,6 +379,8 @@ void WinEDA_GerberFrame::CopyDCodesSizeToItems() ...@@ -379,6 +379,8 @@ void WinEDA_GerberFrame::CopyDCodesSizeToItems()
/* Set Size Items (Lines, Flashes) from DCodes List /* Set Size Items (Lines, Flashes) from DCodes List
*/ */
{ {
static D_CODE dummy(999); //Used if D_CODE not found in list
for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() ) for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() )
{ {
GERBER* gerber = g_GERBER_List[track->GetLayer()]; GERBER* gerber = g_GERBER_List[track->GetLayer()];
...@@ -386,6 +388,8 @@ void WinEDA_GerberFrame::CopyDCodesSizeToItems() ...@@ -386,6 +388,8 @@ void WinEDA_GerberFrame::CopyDCodesSizeToItems()
D_CODE* dcode = gerber->GetDCODE( track->GetNet(), false ); D_CODE* dcode = gerber->GetDCODE( track->GetNet(), false );
wxASSERT( dcode ); wxASSERT( dcode );
if ( dcode == NULL )
dcode = &dummy;
dcode->m_InUse = TRUE; dcode->m_InUse = TRUE;
...@@ -415,7 +419,7 @@ void WinEDA_GerberFrame::CopyDCodesSizeToItems() ...@@ -415,7 +419,7 @@ void WinEDA_GerberFrame::CopyDCodesSizeToItems()
switch( dcode->m_Shape ) switch( dcode->m_Shape )
{ {
case APT_LINE: // ne devrait pas etre utilis� ici case APT_LINE: // might not appears here, but some broken gerber files use it
case APT_CIRCLE: /* spot round (for GERBER)*/ case APT_CIRCLE: /* spot round (for GERBER)*/
track->m_Shape = S_SPOT_CIRCLE; track->m_Shape = S_SPOT_CIRCLE;
break; break;
......
...@@ -83,6 +83,7 @@ enum Gerb_GCommand { ...@@ -83,6 +83,7 @@ enum Gerb_GCommand {
GC_TURN_ON_POLY_FILL = 36, GC_TURN_ON_POLY_FILL = 36,
GC_TURN_OFF_POLY_FILL = 37, GC_TURN_OFF_POLY_FILL = 37,
GC_SELECT_TOOL = 54, GC_SELECT_TOOL = 54,
GC_PHOTO_MODE = 55, // can starts a D03 flash command: redundant with D03
GC_SPECIFY_INCHES = 70, GC_SPECIFY_INCHES = 70,
GC_SPECIFY_MILLIMETERS = 71, GC_SPECIFY_MILLIMETERS = 71,
GC_TURN_OFF_360_INTERPOL = 74, GC_TURN_OFF_360_INTERPOL = 74,
...@@ -292,7 +293,7 @@ inline double DCODE_PARAM::GetValue( const D_CODE* aDcode ) const ...@@ -292,7 +293,7 @@ inline double DCODE_PARAM::GetValue( const D_CODE* aDcode ) const
{ {
// the first one was numbered 1, not zero, as in $1, see page 19 of spec. // the first one was numbered 1, not zero, as in $1, see page 19 of spec.
unsigned ndx = GetIndex() - 1; unsigned ndx = GetIndex() - 1;
wxASSERT(aDcode);
// get the parameter from the aDcode // get the parameter from the aDcode
if( ndx < aDcode->m_am_params.size() ) if( ndx < aDcode->m_am_params.size() )
return aDcode->m_am_params[ndx].GetValue( NULL ); return aDcode->m_am_params[ndx].GetValue( NULL );
......
...@@ -198,7 +198,7 @@ static void fillLineTRACK( TRACK* aTrack, int Dcode_index, int aLayer, ...@@ -198,7 +198,7 @@ static void fillLineTRACK( TRACK* aTrack, int Dcode_index, int aLayer,
} }
#if 0 // @todo finish translating comment and get it into the doxygen function comment for fillArcTRACK below #if 0 // @todo get it into the doxygen function comment for fillArcTRACK below
/*****************************************************************/ /*****************************************************************/
static void Append_1_SEG_ARC_GERBER( int Dcode_index, static void Append_1_SEG_ARC_GERBER( int Dcode_index,
WinEDA_GerberFrame* frame, wxDC* DC, WinEDA_GerberFrame* frame, wxDC* DC,
...@@ -208,15 +208,20 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index, ...@@ -208,15 +208,20 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index,
/*****************************************************************/ /*****************************************************************/
/* /*
creation d'un arc: * Creates an arc:
si multiquadrant == true arc de 0 a 360 degres * if multiquadrant == true : arc can be 0 to 360 degres
et rel_center est la coordonn�e du centre relativement au startpoint * and rel_center is the center coordiante relative to startpoint.
*
si multiquadrant == false arc de 0 � 90 entierement contenu dans le meme quadrant * if multiquadrant == false arc can be only 0 to 90 deg,
et rel_center est la coordonn�e du centre relativement au startpoint, * and only in the same quadrant :
mais en VALEUR ABSOLUE et le signe des valeurs x et y de rel_center doit * absolute angle 0 to 90 (quadrant 1) or
etre deduit de cette limite de 90 degres * absolute angle 90 to 180 (quadrant 2) or
*/ * absolute angle 180 to 270 (quadrant 3) or
* absolute angle 270 to 0 (quadrant 4)
* rel_center is the center coordiante relative to startpoint,
* given in ABSOLUE VALUE and the signe of values x et y de rel_center
* must be calculated from the previously given constraint: arc only in the same quadrant
*/
#endif #endif
...@@ -641,6 +646,9 @@ bool GERBER::Execute_G_Command( char*& text, int G_commande ) ...@@ -641,6 +646,9 @@ bool GERBER::Execute_G_Command( char*& text, int G_commande )
{ {
switch( G_commande ) switch( G_commande )
{ {
case GC_PHOTO_MODE: // can starts a D03 flash command: redundant, can be safely ignored
break;
case GC_LINEAR_INTERPOL_1X: case GC_LINEAR_INTERPOL_1X:
m_Iterpolation = GERB_INTERPOL_LINEAR_1X; m_Iterpolation = GERB_INTERPOL_LINEAR_1X;
break; break;
......
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