dodge seg fault, caused by a bad layer number
This commit is contained in:
parent
af80a3cb7e
commit
86885a7aef
|
@ -23,7 +23,6 @@ static void Plot_Edges_Modules(BOARD * pcb, int format_plot, int masque_layer);
|
||||||
static void PlotTextModule( TEXTE_MODULE* pt_texte );
|
static void PlotTextModule( TEXTE_MODULE* pt_texte );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************/
|
/**********************************************************/
|
||||||
void WinEDA_BasePcbFrame::Plot_Serigraphie( int format_plot,
|
void WinEDA_BasePcbFrame::Plot_Serigraphie( int format_plot,
|
||||||
FILE* File, int masque_layer )
|
FILE* File, int masque_layer )
|
||||||
|
@ -48,22 +47,26 @@ wxString msg;
|
||||||
{
|
{
|
||||||
case TYPEDRAWSEGMENT:
|
case TYPEDRAWSEGMENT:
|
||||||
PlotDrawSegment( (DRAWSEGMENT*) PtStruct, format_plot, masque_layer );
|
PlotDrawSegment( (DRAWSEGMENT*) PtStruct, format_plot, masque_layer );
|
||||||
|
|
||||||
// (Following line has been superceded by new commands elsewhere.)
|
// (Following line has been superceded by new commands elsewhere.)
|
||||||
// EDGE_LAYER | masque_layer );
|
// EDGE_LAYER | masque_layer );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPETEXTE:
|
case TYPETEXTE:
|
||||||
PlotTextePcb( (TEXTE_PCB*) PtStruct, format_plot, masque_layer );
|
PlotTextePcb( (TEXTE_PCB*) PtStruct, format_plot, masque_layer );
|
||||||
|
|
||||||
// EDGE_LAYER | masque_layer );
|
// EDGE_LAYER | masque_layer );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPECOTATION:
|
case TYPECOTATION:
|
||||||
PlotCotation( (COTATION*) PtStruct, format_plot, masque_layer );
|
PlotCotation( (COTATION*) PtStruct, format_plot, masque_layer );
|
||||||
|
|
||||||
// EDGE_LAYER | masque_layer );
|
// EDGE_LAYER | masque_layer );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPEMIRE:
|
case TYPEMIRE:
|
||||||
PlotMirePcb( (MIREPCB*) PtStruct, format_plot, masque_layer );
|
PlotMirePcb( (MIREPCB*) PtStruct, format_plot, masque_layer );
|
||||||
|
|
||||||
// EDGE_LAYER | masque_layer );
|
// EDGE_LAYER | masque_layer );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -93,7 +96,8 @@ wxString msg;
|
||||||
/* Tst si layer OK */
|
/* Tst si layer OK */
|
||||||
if( (pt_pad->m_Masque_Layer & masque_layer) == 0 )
|
if( (pt_pad->m_Masque_Layer & masque_layer) == 0 )
|
||||||
{
|
{
|
||||||
if( ! Plot_Pads_All_Layers ) continue;
|
if( !Plot_Pads_All_Layers )
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
shape_pos = pt_pad->ReturnShapePos();
|
shape_pos = pt_pad->ReturnShapePos();
|
||||||
pos = shape_pos; size = pt_pad->m_Size;
|
pos = shape_pos; size = pt_pad->m_Size;
|
||||||
|
@ -101,6 +105,7 @@ wxString msg;
|
||||||
switch( pt_pad->m_PadShape & 0x7F )
|
switch( pt_pad->m_PadShape & 0x7F )
|
||||||
{
|
{
|
||||||
case CIRCLE:
|
case CIRCLE:
|
||||||
|
|
||||||
switch( format_plot )
|
switch( format_plot )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
|
@ -116,9 +121,11 @@ wxString msg;
|
||||||
trace_1_pastille_RONDE_POST( pos, size.x, FILAIRE );
|
trace_1_pastille_RONDE_POST( pos, size.x, FILAIRE );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OVALE:
|
case OVALE:
|
||||||
|
|
||||||
switch( format_plot )
|
switch( format_plot )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
|
@ -137,6 +144,7 @@ wxString msg;
|
||||||
pt_pad->m_Orient, FILAIRE );
|
pt_pad->m_Orient, FILAIRE );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TRAPEZE:
|
case TRAPEZE:
|
||||||
|
@ -164,11 +172,13 @@ wxString msg;
|
||||||
FILAIRE );
|
FILAIRE );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case RECT:
|
case RECT:
|
||||||
default:
|
default:
|
||||||
|
|
||||||
switch( format_plot )
|
switch( format_plot )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
|
@ -186,8 +196,10 @@ wxString msg;
|
||||||
(int) pt_pad->m_Orient, FILAIRE );
|
(int) pt_pad->m_Orient, FILAIRE );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nb_items++; msg.Printf( wxT( "%d" ), nb_items );
|
nb_items++; msg.Printf( wxT( "%d" ), nb_items );
|
||||||
Affiche_1_Parametre( this, 56, wxEmptyString, msg, GREEN );
|
Affiche_1_Parametre( this, 56, wxEmptyString, msg, GREEN );
|
||||||
}
|
}
|
||||||
|
@ -204,14 +216,26 @@ wxString msg;
|
||||||
trace_val = Sel_Texte_Valeur;
|
trace_val = Sel_Texte_Valeur;
|
||||||
trace_ref = Sel_Texte_Reference; // les 2 autorisations de tracer sont donnees
|
trace_ref = Sel_Texte_Reference; // les 2 autorisations de tracer sont donnees
|
||||||
|
|
||||||
if( (g_TabOneLayerMask[Module->m_Reference->GetLayer()] & masque_layer) == 0)
|
TEXTE_MODULE* text = Module->m_Reference;
|
||||||
trace_ref = FALSE;
|
int textLayer = text->GetLayer();
|
||||||
if(Module->m_Reference->m_NoShow && !Sel_Texte_Invisible)
|
|
||||||
|
wxASSERT( (unsigned) textLayer < 32 );
|
||||||
|
|
||||||
|
if( ( (1 << textLayer) & masque_layer ) == 0 )
|
||||||
trace_ref = FALSE;
|
trace_ref = FALSE;
|
||||||
|
|
||||||
if( (g_TabOneLayerMask[Module->m_Value->GetLayer()] & masque_layer) == 0)
|
if( text->m_NoShow && !Sel_Texte_Invisible )
|
||||||
|
trace_ref = FALSE;
|
||||||
|
|
||||||
|
text = Module->m_Value;
|
||||||
|
textLayer = text->GetLayer();
|
||||||
|
|
||||||
|
wxASSERT( (unsigned) textLayer < 32 );
|
||||||
|
|
||||||
|
if( ( (1 << textLayer) & masque_layer ) == 0 )
|
||||||
trace_val = FALSE;
|
trace_val = FALSE;
|
||||||
if(Module->m_Value->m_NoShow && !Sel_Texte_Invisible)
|
|
||||||
|
if( text->m_NoShow && !Sel_Texte_Invisible )
|
||||||
trace_val = FALSE;
|
trace_val = FALSE;
|
||||||
|
|
||||||
/* Trace effectif des textes */
|
/* Trace effectif des textes */
|
||||||
|
@ -234,9 +258,11 @@ wxString msg;
|
||||||
pt_texte = (TEXTE_MODULE*) Module->m_Drawings;
|
pt_texte = (TEXTE_MODULE*) Module->m_Drawings;
|
||||||
for( ; pt_texte != NULL; pt_texte = (TEXTE_MODULE*) pt_texte->Pnext )
|
for( ; pt_texte != NULL; pt_texte = (TEXTE_MODULE*) pt_texte->Pnext )
|
||||||
{
|
{
|
||||||
if(pt_texte->Type() != TYPETEXTEMODULE ) continue;
|
if( pt_texte->Type() != TYPETEXTEMODULE )
|
||||||
|
continue;
|
||||||
|
|
||||||
if( !Sel_Texte_Divers ) continue;
|
if( !Sel_Texte_Divers )
|
||||||
|
continue;
|
||||||
if( (pt_texte->m_NoShow) && !Sel_Texte_Invisible )
|
if( (pt_texte->m_NoShow) && !Sel_Texte_Invisible )
|
||||||
continue;
|
continue;
|
||||||
if( (g_TabOneLayerMask[pt_texte->GetLayer()] & masque_layer) == 0 )
|
if( (g_TabOneLayerMask[pt_texte->GetLayer()] & masque_layer) == 0 )
|
||||||
|
@ -249,6 +275,7 @@ wxString msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
static void PlotTextModule( TEXTE_MODULE* pt_texte )
|
static void PlotTextModule( TEXTE_MODULE* pt_texte )
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
|
@ -265,9 +292,11 @@ int orient, epaisseur, no_miroir;
|
||||||
|
|
||||||
no_miroir = pt_texte->m_Miroir & 1;
|
no_miroir = pt_texte->m_Miroir & 1;
|
||||||
epaisseur = pt_texte->m_Width;
|
epaisseur = pt_texte->m_Width;
|
||||||
if ( Plot_Mode == FILAIRE ) epaisseur = g_PlotLine_Width;
|
if( Plot_Mode == FILAIRE )
|
||||||
|
epaisseur = g_PlotLine_Width;
|
||||||
|
|
||||||
if ( no_miroir == 0 ) size.y = -size.y; // Text is mirrored
|
if( no_miroir == 0 )
|
||||||
|
size.y = -size.y; // Text is mirrored
|
||||||
|
|
||||||
Plot_1_texte( format_plot, pt_texte->m_Text,
|
Plot_1_texte( format_plot, pt_texte->m_Text,
|
||||||
orient, epaisseur,
|
orient, epaisseur,
|
||||||
|
@ -275,14 +304,14 @@ int orient, epaisseur, no_miroir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************/
|
/*******************************************************************************/
|
||||||
void PlotCotation( COTATION* Cotation, int format_plot, int masque_layer )
|
void PlotCotation( COTATION* Cotation, int format_plot, int masque_layer )
|
||||||
/*******************************************************************************/
|
/*******************************************************************************/
|
||||||
{
|
{
|
||||||
DRAWSEGMENT* DrawTmp;
|
DRAWSEGMENT* DrawTmp;
|
||||||
|
|
||||||
if( (g_TabOneLayerMask[Cotation->GetLayer()] & masque_layer) == 0) return;
|
if( (g_TabOneLayerMask[Cotation->GetLayer()] & masque_layer) == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
DrawTmp = new DRAWSEGMENT( NULL );
|
DrawTmp = new DRAWSEGMENT( NULL );
|
||||||
|
|
||||||
|
@ -332,7 +361,8 @@ void PlotMirePcb( MIREPCB* Mire, int format_plot,int masque_layer)
|
||||||
DRAWSEGMENT* DrawTmp;
|
DRAWSEGMENT* DrawTmp;
|
||||||
int dx1, dx2, dy1, dy2, rayon;
|
int dx1, dx2, dy1, dy2, rayon;
|
||||||
|
|
||||||
if( (g_TabOneLayerMask[Mire->GetLayer()] & masque_layer) == 0) return;
|
if( (g_TabOneLayerMask[Mire->GetLayer()] & masque_layer) == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
DrawTmp = new DRAWSEGMENT( NULL );
|
DrawTmp = new DRAWSEGMENT( NULL );
|
||||||
|
|
||||||
|
@ -386,16 +416,20 @@ wxString msg;
|
||||||
PtEdge = (EDGE_MODULE*) Module->m_Drawings;
|
PtEdge = (EDGE_MODULE*) Module->m_Drawings;
|
||||||
for( ; PtEdge != NULL; PtEdge = (EDGE_MODULE*) PtEdge->Pnext )
|
for( ; PtEdge != NULL; PtEdge = (EDGE_MODULE*) PtEdge->Pnext )
|
||||||
{
|
{
|
||||||
if(PtEdge->Type() != TYPEEDGEMODULE) continue;
|
if( PtEdge->Type() != TYPEEDGEMODULE )
|
||||||
if( (g_TabOneLayerMask[PtEdge->GetLayer()] & masque_layer) == 0) continue;
|
continue;
|
||||||
|
if( (g_TabOneLayerMask[PtEdge->GetLayer()] & masque_layer) == 0 )
|
||||||
|
continue;
|
||||||
Plot_1_EdgeModule( format_plot, PtEdge );
|
Plot_1_EdgeModule( format_plot, PtEdge );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Affichage du nombre de modules traites */
|
/* Affichage du nombre de modules traites */
|
||||||
nb_items++;
|
nb_items++;
|
||||||
msg.Printf( wxT( "%d" ), nb_items );
|
msg.Printf( wxT( "%d" ), nb_items );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
void Plot_1_EdgeModule( int format_plot, EDGE_MODULE* PtEdge )
|
void Plot_1_EdgeModule( int format_plot, EDGE_MODULE* PtEdge )
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
@ -407,17 +441,21 @@ int rayon; /* rayon des cercles a tracer */
|
||||||
int StAngle, EndAngle;
|
int StAngle, EndAngle;
|
||||||
wxPoint pos, end; /* Coord des segments a tracer */
|
wxPoint pos, end; /* Coord des segments a tracer */
|
||||||
|
|
||||||
if(PtEdge->Type() != TYPEEDGEMODULE) return;
|
if( PtEdge->Type() != TYPEEDGEMODULE )
|
||||||
|
return;
|
||||||
type_trace = PtEdge->m_Shape;
|
type_trace = PtEdge->m_Shape;
|
||||||
epaisseur = PtEdge->m_Width;
|
epaisseur = PtEdge->m_Width;
|
||||||
if ( Plot_Mode == FILAIRE ) epaisseur = g_PlotLine_Width;
|
if( Plot_Mode == FILAIRE )
|
||||||
|
epaisseur = g_PlotLine_Width;
|
||||||
|
|
||||||
pos = PtEdge->m_Start;
|
pos = PtEdge->m_Start;
|
||||||
end = PtEdge->m_End;
|
end = PtEdge->m_End;
|
||||||
|
|
||||||
switch( type_trace )
|
switch( type_trace )
|
||||||
{
|
{
|
||||||
case S_SEGMENT: /* segment simple */
|
case S_SEGMENT:
|
||||||
|
|
||||||
|
/* segment simple */
|
||||||
switch( format_plot )
|
switch( format_plot )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
|
@ -432,6 +470,7 @@ wxPoint pos, end; /* Coord des segments a tracer */
|
||||||
PlotFilledSegmentPS( pos, end, epaisseur );
|
PlotFilledSegmentPS( pos, end, epaisseur );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break; /* Fin trace segment simple */
|
break; /* Fin trace segment simple */
|
||||||
|
|
||||||
case S_CIRCLE:
|
case S_CIRCLE:
|
||||||
|
@ -443,7 +482,8 @@ wxPoint pos, end; /* Coord des segments a tracer */
|
||||||
rayon = (int) hypot( (double) (end.x - pos.x), (double) (end.y - pos.y) );
|
rayon = (int) hypot( (double) (end.x - pos.x), (double) (end.y - pos.y) );
|
||||||
StAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
|
StAngle = ArcTangente( end.y - pos.y, end.x - pos.x );
|
||||||
EndAngle = StAngle + PtEdge->m_Angle;
|
EndAngle = StAngle + PtEdge->m_Angle;
|
||||||
if ( StAngle > EndAngle) EXCHG (StAngle, EndAngle);
|
if( StAngle > EndAngle )
|
||||||
|
EXCHG( StAngle, EndAngle );
|
||||||
PlotArc( format_plot, pos, StAngle, EndAngle, rayon, epaisseur );
|
PlotArc( format_plot, pos, StAngle, EndAngle, rayon, epaisseur );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -471,16 +511,15 @@ wxPoint pos, end; /* Coord des segments a tracer */
|
||||||
y += PtEdge->m_Start0.y;
|
y += PtEdge->m_Start0.y;
|
||||||
*ptr = x; ptr++; *ptr = y; ptr++;
|
*ptr = x; ptr++; *ptr = y; ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlotPolygon( format_plot, TRUE, PtEdge->m_PolyCount, ptr_base );
|
PlotPolygon( format_plot, TRUE, PtEdge->m_PolyCount, ptr_base );
|
||||||
free( ptr_base );
|
free( ptr_base );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
void PlotTextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer )
|
void PlotTextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer )
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
@ -490,8 +529,10 @@ int no_miroir, orient, epaisseur;
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
wxSize size;
|
wxSize size;
|
||||||
|
|
||||||
if( pt_texte->m_Text.IsEmpty() ) return;
|
if( pt_texte->m_Text.IsEmpty() )
|
||||||
if( (g_TabOneLayerMask[pt_texte->GetLayer()] & masque_layer) == 0 ) return ;
|
return;
|
||||||
|
if( (g_TabOneLayerMask[pt_texte->GetLayer()] & masque_layer) == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
/* calcul des parametres du texte :*/
|
/* calcul des parametres du texte :*/
|
||||||
size = pt_texte->m_Size;
|
size = pt_texte->m_Size;
|
||||||
|
@ -500,23 +541,26 @@ wxSize size;
|
||||||
no_miroir = pt_texte->m_Miroir & 1;
|
no_miroir = pt_texte->m_Miroir & 1;
|
||||||
epaisseur = pt_texte->m_Width;
|
epaisseur = pt_texte->m_Width;
|
||||||
|
|
||||||
if ( no_miroir == FALSE) size.x = - size.x;
|
if( no_miroir == FALSE )
|
||||||
|
size.x = -size.x;
|
||||||
|
|
||||||
Plot_1_texte( format_plot, pt_texte->m_Text, orient,
|
Plot_1_texte( format_plot, pt_texte->m_Text, orient,
|
||||||
epaisseur, pos.x, pos.y, size.x, size.y );
|
epaisseur, pos.x, pos.y, size.x, size.y );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
void Plot_1_texte( int format_plot, const wxString& Text, int angle,
|
void Plot_1_texte( int format_plot, const wxString& Text, int angle,
|
||||||
int epaisseur, int cX, int cY, int size_h, int size_v,
|
int epaisseur, int cX, int cY, int size_h, int size_v,
|
||||||
bool centreX, bool centreY )
|
bool centreX, bool centreY )
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Trace de 1 texte:
|
* Trace de 1 texte:
|
||||||
ptr = pointeur sur le texte
|
* ptr = pointeur sur le texte
|
||||||
angle = angle d'orientation, dependant aussi du mode de trace (miroir..)
|
* angle = angle d'orientation, dependant aussi du mode de trace (miroir..)
|
||||||
cX, cY = position du centre du texte
|
* cX, cY = position du centre du texte
|
||||||
size_h , size_v = dimensions ( algebriques );
|
* size_h , size_v = dimensions ( algebriques );
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int kk = 0, k1, k2, end;
|
int kk = 0, k1, k2, end;
|
||||||
|
@ -530,17 +574,21 @@ int nbcodes = Text.Len();
|
||||||
espacement = ( (10 * size_h) / 9 ) + ( (size_h >= 0 ) ? epaisseur : -epaisseur );
|
espacement = ( (10 * size_h) / 9 ) + ( (size_h >= 0 ) ? epaisseur : -epaisseur );
|
||||||
|
|
||||||
/* calcul de la position du debut du texte */
|
/* calcul de la position du debut du texte */
|
||||||
if ( centreX ) sx = cX - ((espacement * nbcodes) / 2 ) + (espacement /9);
|
if( centreX )
|
||||||
else sx = cX;
|
sx = cX - ( (espacement * nbcodes) / 2 ) + (espacement / 9);
|
||||||
if ( centreY ) sy = cY + (size_v / 2);
|
else
|
||||||
else sy = cY;
|
sx = cX;
|
||||||
|
if( centreY )
|
||||||
|
sy = cY + (size_v / 2);
|
||||||
|
else
|
||||||
|
sy = cY;
|
||||||
|
|
||||||
/* trace du texte */
|
/* trace du texte */
|
||||||
for( ; kk < nbcodes; kk++ )
|
for( ; kk < nbcodes; kk++ )
|
||||||
{
|
{
|
||||||
int code = Text.GetChar( kk ) & 0xFF;
|
int code = Text.GetChar( kk ) & 0xFF;
|
||||||
ptcar = graphic_fonte_shape[code]; /* ptcar pointe la description
|
ptcar = graphic_fonte_shape[code]; /* ptcar pointe la description
|
||||||
du caractere a dessiner */
|
* du caractere a dessiner */
|
||||||
|
|
||||||
plume = 'U'; ox = sx; oy = sy;
|
plume = 'U'; ox = sx; oy = sy;
|
||||||
RotatePoint( &ox, &oy, cX, cY, angle );
|
RotatePoint( &ox, &oy, cX, cY, angle );
|
||||||
|
@ -548,14 +596,18 @@ int nbcodes = Text.Len();
|
||||||
|
|
||||||
for( end = 0; end == 0; ptcar++ )
|
for( end = 0; end == 0; ptcar++ )
|
||||||
{
|
{
|
||||||
f_cod = * ptcar; /* get code n de la forme selectionnee */
|
f_cod = *ptcar;
|
||||||
|
|
||||||
|
/* get code n de la forme selectionnee */
|
||||||
switch( f_cod )
|
switch( f_cod )
|
||||||
{
|
{
|
||||||
case 'X' : end = 1;/* fin du caractere */
|
case 'X':
|
||||||
|
end = 1; /* fin du caractere */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'U':
|
case 'U':
|
||||||
case 'D' : plume = f_cod ; break ;
|
case 'D':
|
||||||
|
plume = f_cod; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
k1 = f_cod; // Coord X
|
k1 = f_cod; // Coord X
|
||||||
|
@ -583,24 +635,29 @@ int nbcodes = Text.Len();
|
||||||
case PLOT_FORMAT_POST:
|
case PLOT_FORMAT_POST:
|
||||||
PlotFilledSegmentPS( wxPoint( ox, oy ), wxPoint( fx, fy ), epaisseur );
|
PlotFilledSegmentPS( wxPoint( ox, oy ), wxPoint( fx, fy ), epaisseur );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ox = fx; oy = fy;
|
ox = fx; oy = fy;
|
||||||
} /* fin switch decodade matrice de forme */
|
}
|
||||||
|
|
||||||
} /* end boucle for = end trace de 1 caractere */
|
/* fin switch decodade matrice de forme */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* end boucle for = end trace de 1 caractere */
|
||||||
|
|
||||||
sx += espacement;
|
sx += espacement;
|
||||||
} /* end trace du texte */
|
}
|
||||||
|
|
||||||
|
/* end trace du texte */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************/
|
/***********************************/
|
||||||
void Affiche_erreur( int nb_err )
|
void Affiche_erreur( int nb_err )
|
||||||
/***********************************/
|
/***********************************/
|
||||||
|
|
||||||
/* Affiche le nombre d'erreurs commises ( segments traces avec plume trop grosse
|
/* Affiche le nombre d'erreurs commises ( segments traces avec plume trop grosse
|
||||||
ou autres */
|
* ou autres */
|
||||||
{
|
{
|
||||||
// sprintf(msg,"%d",nb_err) ;
|
// sprintf(msg,"%d",nb_err) ;
|
||||||
// Affiche_1_Parametre(this, 30,"Err",msg,GREEN) ;
|
// Affiche_1_Parametre(this, 30,"Err",msg,GREEN) ;
|
||||||
|
@ -610,18 +667,21 @@ void Affiche_erreur( int nb_err)
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
void PlotDrawSegment( DRAWSEGMENT* pt_segm, int Format, int masque_layer )
|
void PlotDrawSegment( DRAWSEGMENT* pt_segm, int Format, int masque_layer )
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
/* Trace un element du type DRAWSEGMENT draw appartenant
|
/* Trace un element du type DRAWSEGMENT draw appartenant
|
||||||
aux couches specifiees par masque_layer
|
* aux couches specifiees par masque_layer
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
wxPoint start, end;
|
wxPoint start, end;
|
||||||
int epaisseur;
|
int epaisseur;
|
||||||
int rayon = 0, StAngle = 0, EndAngle = 0;
|
int rayon = 0, StAngle = 0, EndAngle = 0;
|
||||||
|
|
||||||
if( (g_TabOneLayerMask[pt_segm->GetLayer()] & masque_layer) == 0) return;
|
if( (g_TabOneLayerMask[pt_segm->GetLayer()] & masque_layer) == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
epaisseur = pt_segm->m_Width;
|
epaisseur = pt_segm->m_Width;
|
||||||
if ( Plot_Mode == FILAIRE) epaisseur = g_PlotLine_Width;
|
if( Plot_Mode == FILAIRE )
|
||||||
|
epaisseur = g_PlotLine_Width;
|
||||||
|
|
||||||
start = pt_segm->m_Start; end = pt_segm->m_End;
|
start = pt_segm->m_Start; end = pt_segm->m_End;
|
||||||
|
|
||||||
|
@ -635,7 +695,8 @@ int rayon = 0, StAngle = 0, EndAngle = 0;
|
||||||
rayon = (int) hypot( (double) (end.x - start.x), (double) (end.y - start.y) );
|
rayon = (int) hypot( (double) (end.x - start.x), (double) (end.y - start.y) );
|
||||||
StAngle = ArcTangente( end.y - start.y, end.x - start.x );
|
StAngle = ArcTangente( end.y - start.y, end.x - start.x );
|
||||||
EndAngle = StAngle + pt_segm->m_Angle;
|
EndAngle = StAngle + pt_segm->m_Angle;
|
||||||
if ( StAngle > EndAngle) EXCHG (StAngle, EndAngle);
|
if( StAngle > EndAngle )
|
||||||
|
EXCHG( StAngle, EndAngle );
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( Format )
|
switch( Format )
|
||||||
|
@ -646,7 +707,8 @@ int rayon = 0, StAngle = 0, EndAngle = 0;
|
||||||
else if( pt_segm->m_Shape == S_ARC )
|
else if( pt_segm->m_Shape == S_ARC )
|
||||||
PlotArc( PLOT_FORMAT_GERBER, start,
|
PlotArc( PLOT_FORMAT_GERBER, start,
|
||||||
StAngle, EndAngle, rayon, epaisseur );
|
StAngle, EndAngle, rayon, epaisseur );
|
||||||
else PlotGERBERLine(start, end, epaisseur) ;
|
else
|
||||||
|
PlotGERBERLine( start, end, epaisseur );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_HPGL:
|
case PLOT_FORMAT_HPGL:
|
||||||
|
@ -654,7 +716,8 @@ int rayon = 0, StAngle = 0, EndAngle = 0;
|
||||||
PlotCircle( PLOT_FORMAT_HPGL, epaisseur, start, rayon );
|
PlotCircle( PLOT_FORMAT_HPGL, epaisseur, start, rayon );
|
||||||
else if( pt_segm->m_Shape == S_ARC )
|
else if( pt_segm->m_Shape == S_ARC )
|
||||||
PlotArc( PLOT_FORMAT_HPGL, start, StAngle, EndAngle, rayon, epaisseur );
|
PlotArc( PLOT_FORMAT_HPGL, start, StAngle, EndAngle, rayon, epaisseur );
|
||||||
else trace_1_segment_HPGL(start.x,start.y, end.x,end.y, epaisseur) ;
|
else
|
||||||
|
trace_1_segment_HPGL( start.x, start.y, end.x, end.y, epaisseur );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_POST:
|
case PLOT_FORMAT_POST:
|
||||||
|
@ -663,7 +726,8 @@ int rayon = 0, StAngle = 0, EndAngle = 0;
|
||||||
else if( pt_segm->m_Shape == S_ARC )
|
else if( pt_segm->m_Shape == S_ARC )
|
||||||
PlotArc( PLOT_FORMAT_POST, start,
|
PlotArc( PLOT_FORMAT_POST, start,
|
||||||
StAngle, EndAngle, rayon, epaisseur );
|
StAngle, EndAngle, rayon, epaisseur );
|
||||||
else PlotFilledSegmentPS(start, end, epaisseur) ;
|
else
|
||||||
|
PlotFilledSegmentPS( start, end, epaisseur );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -712,19 +776,22 @@ void PlotPolygon(int format_plot, bool Filled, int nbpoints, int * coord)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
void PlotArc( int format_plot, wxPoint centre, int start_angle, int end_angle,
|
void PlotArc( int format_plot, wxPoint centre, int start_angle, int end_angle,
|
||||||
int rayon, int epaisseur )
|
int rayon, int epaisseur )
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
/* Polt 1 arc
|
/* Polt 1 arc
|
||||||
start, end = angles in 1/10 degree for start and stop point
|
* start, end = angles in 1/10 degree for start and stop point
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int ii;
|
int ii;
|
||||||
int ox, oy, fx, fy;
|
int ox, oy, fx, fy;
|
||||||
int delta;/* increment (en 0.1 degres) angulaire pour trace de cercles */
|
int delta;/* increment (en 0.1 degres) angulaire pour trace de cercles */
|
||||||
|
|
||||||
if ( Plot_Mode == FILAIRE) epaisseur = g_PlotLine_Width;
|
if( Plot_Mode == FILAIRE )
|
||||||
|
epaisseur = g_PlotLine_Width;
|
||||||
|
|
||||||
if( format_plot == PLOT_FORMAT_POST )
|
if( format_plot == PLOT_FORMAT_POST )
|
||||||
{
|
{
|
||||||
|
@ -738,10 +805,13 @@ int delta; /* increment (en 0.1 degres) angulaire pour trace de cercles */
|
||||||
EXCHG( start_angle, end_angle );
|
EXCHG( start_angle, end_angle );
|
||||||
|
|
||||||
/* Correction pour petits cercles par rapport a l'epaisseur du trait */
|
/* Correction pour petits cercles par rapport a l'epaisseur du trait */
|
||||||
if( rayon < (epaisseur * 10) ) delta = 225; /* 16 segm pour 360 deg */
|
if( rayon < (epaisseur * 10) )
|
||||||
if( rayon < (epaisseur * 5) ) delta = 300; /* 12 segm pour 360 deg */
|
delta = 225; /* 16 segm pour 360 deg */
|
||||||
|
if( rayon < (epaisseur * 5) )
|
||||||
|
delta = 300; /* 12 segm pour 360 deg */
|
||||||
|
|
||||||
if ( start_angle > end_angle ) end_angle += 3600;
|
if( start_angle > end_angle )
|
||||||
|
end_angle += 3600;
|
||||||
ox = rayon; oy = 0;
|
ox = rayon; oy = 0;
|
||||||
RotatePoint( &ox, &oy, start_angle );
|
RotatePoint( &ox, &oy, start_angle );
|
||||||
|
|
||||||
|
@ -750,6 +820,7 @@ int delta; /* increment (en 0.1 degres) angulaire pour trace de cercles */
|
||||||
{
|
{
|
||||||
fx = rayon; fy = 0;
|
fx = rayon; fy = 0;
|
||||||
RotatePoint( &fx, &fy, ii );
|
RotatePoint( &fx, &fy, ii );
|
||||||
|
|
||||||
switch( format_plot )
|
switch( format_plot )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
|
@ -758,17 +829,23 @@ int delta; /* increment (en 0.1 degres) angulaire pour trace de cercles */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_HPGL:
|
case PLOT_FORMAT_HPGL:
|
||||||
trace_1_segment_HPGL(centre.x+ox,centre.y+oy,centre.x+fx,centre.y+fy, epaisseur) ;
|
trace_1_segment_HPGL( centre.x + ox,
|
||||||
|
centre.y + oy,
|
||||||
|
centre.x + fx,
|
||||||
|
centre.y + fy,
|
||||||
|
epaisseur );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_POST:
|
case PLOT_FORMAT_POST:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ox = fx; oy = fy;
|
ox = fx; oy = fy;
|
||||||
}
|
}
|
||||||
|
|
||||||
fx = rayon; fy = 0;
|
fx = rayon; fy = 0;
|
||||||
RotatePoint( &fx, &fy, end_angle );
|
RotatePoint( &fx, &fy, end_angle );
|
||||||
|
|
||||||
switch( format_plot )
|
switch( format_plot )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
|
@ -777,11 +854,14 @@ int delta; /* increment (en 0.1 degres) angulaire pour trace de cercles */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_HPGL:
|
case PLOT_FORMAT_HPGL:
|
||||||
trace_1_segment_HPGL(centre.x+ox,centre.y+oy,centre.x+fx,centre.y+fy, epaisseur) ;
|
trace_1_segment_HPGL( centre.x + ox,
|
||||||
|
centre.y + oy,
|
||||||
|
centre.x + fx,
|
||||||
|
centre.y + fy,
|
||||||
|
epaisseur );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_POST:
|
case PLOT_FORMAT_POST:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue