Commit a28492f4 authored by dickelbeck's avatar dickelbeck

bug fixing, gerbers, etc.

parent 16784384
...@@ -19,9 +19,16 @@ email address. ...@@ -19,9 +19,16 @@ email address.
2009-Feb-25 UPDATE Dick Hollenbeck <dick@softplc.com> 2009-Feb-25 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
++pcbnew ++pcbnew
Markers were now shown when on top of a high-lighted pad. Moved highlight * Markers were now shown when on top of a high-lighted pad. Moved highlight
drawing function into class BOARD and out of Frame. Call BOARD::DrawHighLight() from drawing function into class BOARD and out of Frame. Call BOARD::DrawHighLight() from
within BOARD::Draw() to fix. within BOARD::Draw() to fix.
* Gerbers were not generated if you had EDGE_MODULEs on a copper layer, such as in
a MuWaveBasicShape. The line thickness was not being put into the gerber via a DCODE.
These gerber files were bad, and geda gerbv would also complain.
* A few window titles were not conformant with UIpolicies.txt.
* You could not load a *.pro file from another project into PCBNEW if your current
project had none. Changed wildcard mask.
* Deleted gen_self.h and moved that code into muonde.cpp
2009-Feb-24 UPDATE Dick Hollenbeck <dick@softplc.com> 2009-Feb-24 UPDATE Dick Hollenbeck <dick@softplc.com>
......
...@@ -51,7 +51,6 @@ void EDGE_MODULE:: Copy( EDGE_MODULE* source ) // copy structure ...@@ -51,7 +51,6 @@ void EDGE_MODULE:: Copy( EDGE_MODULE* source ) // copy structure
if( source == NULL ) if( source == NULL )
return; return;
// @todo why not just use "*this = source;" ?
m_Start = source->m_Start; m_Start = source->m_Start;
m_End = source->m_End; m_End = source->m_End;
m_Shape = source->m_Shape; m_Shape = source->m_Shape;
......
...@@ -420,7 +420,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC ) ...@@ -420,7 +420,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
if( !segment->IsNull() ) if( !segment->IsNull() )
continue; continue;
/* Lenght segment = 0; delete it */ /* Length segment = 0; delete it */
segment->Draw( frame->DrawPanel, DC, GR_XOR ); segment->Draw( frame->DrawPanel, DC, GR_XOR );
segment->DeleteStructure(); segment->DeleteStructure();
nbpoints_supprimes++; nbpoints_supprimes++;
......
This diff is collapsed.
...@@ -722,7 +722,7 @@ MODULE* WinEDA_BasePcbFrame::Create_1_Module( wxDC* DC, const wxString& module_n ...@@ -722,7 +722,7 @@ MODULE* WinEDA_BasePcbFrame::Create_1_Module( wxDC* DC, const wxString& module_n
/* Ask fo the new module reference */ /* Ask fo the new module reference */
if( module_name.IsEmpty() ) if( module_name.IsEmpty() )
{ {
if( Get_Message( _( "Module Reference:" ), _( "Module Creation:" ), Line, this ) != 0 ) if( Get_Message( _( "Module Reference:" ), _( "Module Creation" ), Line, this ) != 0 )
{ {
DisplayInfo( this, _( "No reference, aborted" ) ); DisplayInfo( this, _( "No reference, aborted" ) );
return NULL; return NULL;
......
This diff is collapsed.
...@@ -69,11 +69,11 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) ...@@ -69,11 +69,11 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event )
case ID_CONFIG_READ: case ID_CONFIG_READ:
FullFileName = GetScreen()->m_FileName.AfterLast( '/' ); FullFileName = GetScreen()->m_FileName.AfterLast( '/' );
ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext ); ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext );
FullFileName = EDA_FileSelector( _( "Read config file" ), FullFileName = EDA_FileSelector( _( "Read Config File" ),
wxPathOnly( GetScreen()->m_FileName ), /* Chemin par defaut */ wxPathOnly( GetScreen()->m_FileName ), /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */ FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */ g_Prj_Config_Filename_ext, /* extension par defaut */
FullFileName, /* Masque d'affichage */ wxString( wxT("*")) + g_Prj_Config_Filename_ext,
this, this,
wxFD_OPEN, wxFD_OPEN,
TRUE /* ne change pas de repertoire courant */ TRUE /* ne change pas de repertoire courant */
...@@ -183,10 +183,9 @@ bool Read_Config( const wxString& project_name ) ...@@ -183,10 +183,9 @@ bool Read_Config( const wxString& project_name )
ScreenPcb->AddGrid( g_UserGrid, g_UserGrid_Unit, ID_POPUP_GRID_USER ); ScreenPcb->AddGrid( g_UserGrid, g_UserGrid_Unit, ID_POPUP_GRID_USER );
} }
g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_CurrentTrackWidth; g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
g_DesignSettings.m_ViaSizeHistory[0] =
g_DesignSettings.m_CurrentViaSize;
for( ii = 1; ii < HISTORY_NUMBER; ii++ ) for( ii = 1; ii < HISTORY_NUMBER; ii++ )
{ {
g_DesignSettings.m_TrackWidthHistory[ii] = 0; g_DesignSettings.m_TrackWidthHistory[ii] = 0;
......
...@@ -321,7 +321,7 @@ static void PlotTextModule( TEXTE_MODULE* pt_texte, int format_plot ) ...@@ -321,7 +321,7 @@ static void PlotTextModule( TEXTE_MODULE* pt_texte, int format_plot )
SetCurrentLineWidthPS( thickness ); SetCurrentLineWidthPS( thickness );
break; break;
} }
PlotGraphicText( format_plot, pos, BLACK, PlotGraphicText( format_plot, pos, BLACK,
pt_texte->m_Text, pt_texte->m_Text,
orient, size, orient, size,
...@@ -429,22 +429,21 @@ void Plot_Edges_Modules( BOARD* pcb, int format_plot, int masque_layer ) ...@@ -429,22 +429,21 @@ void Plot_Edges_Modules( BOARD* pcb, int format_plot, int masque_layer )
/* Trace les contours des modules */ /* Trace les contours des modules */
{ {
int nb_items; /* Pour affichage activite: nbr modules traites */ int nb_items; /* Pour affichage activite: nbr modules traites */
MODULE* Module;
EDGE_MODULE* PtEdge;
wxString msg; wxString msg;
nb_items = 0; nb_items = 0;
Module = pcb->m_Modules; for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
for( ; Module != NULL; Module = Module->Next() )
{ {
PtEdge = (EDGE_MODULE*) Module->m_Drawings.GetFirst(); EDGE_MODULE* edge = (EDGE_MODULE*) module->m_Drawings.GetFirst();
for( ; PtEdge != NULL; PtEdge = PtEdge->Next() ) for( ; edge; edge = edge->Next() )
{ {
if( PtEdge->Type() != TYPE_EDGE_MODULE ) if( edge->Type() != TYPE_EDGE_MODULE )
continue; continue;
if( (g_TabOneLayerMask[PtEdge->GetLayer()] & masque_layer) == 0 )
if( (g_TabOneLayerMask[edge->GetLayer()] & masque_layer) == 0 )
continue; continue;
Plot_1_EdgeModule( format_plot, PtEdge );
Plot_1_EdgeModule( format_plot, edge );
} }
/* Affichage du nombre de modules traites */ /* Affichage du nombre de modules traites */
...@@ -470,8 +469,12 @@ void Plot_1_EdgeModule( int format_plot, EDGE_MODULE* PtEdge ) ...@@ -470,8 +469,12 @@ void Plot_1_EdgeModule( int format_plot, EDGE_MODULE* PtEdge )
type_trace = PtEdge->m_Shape; type_trace = PtEdge->m_Shape;
thickness = PtEdge->m_Width; thickness = PtEdge->m_Width;
if( g_Plot_Mode == FILAIRE ) if( g_Plot_Mode == FILAIRE )
{
thickness = g_PlotLine_Width; thickness = g_PlotLine_Width;
wxLogDebug( wxT("changing edgemodule thickness to g_PlotLine_Width") );
}
pos = PtEdge->m_Start; pos = PtEdge->m_Start;
end = PtEdge->m_End; end = PtEdge->m_End;
...@@ -484,6 +487,7 @@ void Plot_1_EdgeModule( int format_plot, EDGE_MODULE* PtEdge ) ...@@ -484,6 +487,7 @@ void Plot_1_EdgeModule( int format_plot, EDGE_MODULE* PtEdge )
switch( format_plot ) switch( format_plot )
{ {
case PLOT_FORMAT_GERBER: case PLOT_FORMAT_GERBER:
SelectD_CODE_For_LineDraw(thickness);
PlotGERBERLine( pos, end, thickness ); PlotGERBERLine( pos, end, thickness );
break; break;
...@@ -577,16 +581,16 @@ void PlotTextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer ) ...@@ -577,16 +581,16 @@ void PlotTextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer )
switch( format_plot ) switch( format_plot )
{ {
case PLOT_FORMAT_GERBER: case PLOT_FORMAT_GERBER:
SelectD_CODE_For_LineDraw(thickness); SelectD_CODE_For_LineDraw(thickness);
break; break;
case PLOT_FORMAT_HPGL: case PLOT_FORMAT_HPGL:
break; break;
case PLOT_FORMAT_POST: case PLOT_FORMAT_POST:
SetCurrentLineWidthPS( thickness ); SetCurrentLineWidthPS( thickness );
break; break;
} }
PlotGraphicText( format_plot, pos, BLACK, PlotGraphicText( format_plot, pos, BLACK,
......
...@@ -84,10 +84,13 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer ...@@ -84,10 +84,13 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
/* Calculate scaling from pcbnew units (in 0.1 mil or 0.0001 inch) to gerber units */ /* Calculate scaling from pcbnew units (in 0.1 mil or 0.0001 inch) to gerber units */
Gerb_scale_plot = 1.0; /* for format 3.4 (4 digits for decimal format means 0.1 mil per gerber unit */ Gerb_scale_plot = 1.0; /* for format 3.4 (4 digits for decimal format means 0.1 mil per gerber unit */
scale_x = Scale_X * Gerb_scale_plot; scale_x = Scale_X * Gerb_scale_plot;
scale_y = Scale_Y * Gerb_scale_plot; scale_y = Scale_Y * Gerb_scale_plot;
g_PlotOffset.x = 0; g_PlotOffset.x = 0;
g_PlotOffset.y = 0; g_PlotOffset.y = 0;
if( PlotOriginIsAuxAxis ) if( PlotOriginIsAuxAxis )
g_PlotOffset = m_Auxiliary_Axis_Position; g_PlotOffset = m_Auxiliary_Axis_Position;
...@@ -175,35 +178,30 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer, ...@@ -175,35 +178,30 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
{ {
wxPoint pos; wxPoint pos;
wxSize size; wxSize size;
MODULE* Module;
D_PAD* PtPad;
TRACK* track;
EDA_BaseStruct* PtStruct;
wxString msg; wxString msg;
/* Draw items type Drawings Pcb matching with masque_layer: */ /* Draw items type Drawings Pcb matching with masque_layer: */
PtStruct = m_Pcb->m_Drawings; for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = item->Next() )
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
switch( PtStruct->Type() ) switch( item->Type() )
{ {
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
PlotDrawSegment( (DRAWSEGMENT*) PtStruct, PLOT_FORMAT_GERBER, PlotDrawSegment( (DRAWSEGMENT*) item, PLOT_FORMAT_GERBER,
masque_layer ); masque_layer );
break; break;
case TYPE_TEXTE: case TYPE_TEXTE:
PlotTextePcb( (TEXTE_PCB*) PtStruct, PLOT_FORMAT_GERBER, PlotTextePcb( (TEXTE_PCB*) item, PLOT_FORMAT_GERBER,
masque_layer ); masque_layer );
break; break;
case TYPE_COTATION: case TYPE_COTATION:
PlotCotation( (COTATION*) PtStruct, PLOT_FORMAT_GERBER, PlotCotation( (COTATION*) item, PLOT_FORMAT_GERBER,
masque_layer ); masque_layer );
break; break;
case TYPE_MIRE: case TYPE_MIRE:
PlotMirePcb( (MIREPCB*) PtStruct, PLOT_FORMAT_GERBER, PlotMirePcb( (MIREPCB*) item, PLOT_FORMAT_GERBER,
masque_layer ); masque_layer );
break; break;
...@@ -216,18 +214,16 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer, ...@@ -216,18 +214,16 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
} }
} }
/* Draw footprints shapes without pads (pads will plotted later) */ /* Draw footprint shapes without pads (pads will plotted later) */
Module = m_Pcb->m_Modules; for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
for( ; Module != NULL; Module = (MODULE*) Module->Next() )
{ {
PtStruct = Module->m_Drawings; for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
switch( PtStruct->Type() ) switch( item->Type() )
{ {
case TYPE_EDGE_MODULE: case TYPE_EDGE_MODULE:
if( masque_layer & g_TabOneLayerMask[( (EDGE_MODULE*) PtStruct )->GetLayer()] ) if( masque_layer & g_TabOneLayerMask[( (EDGE_MODULE*) item)->GetLayer()] )
Plot_1_EdgeModule( PLOT_FORMAT_GERBER, (EDGE_MODULE*) PtStruct ); Plot_1_EdgeModule( PLOT_FORMAT_GERBER, (EDGE_MODULE*) item );
break; break;
default: default:
...@@ -237,26 +233,25 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer, ...@@ -237,26 +233,25 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
} }
/* Plot footprint pads */ /* Plot footprint pads */
Module = m_Pcb->m_Modules; for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
for( ; Module != NULL; Module = (MODULE*) Module->Next() )
{ {
PtPad = (D_PAD*) Module->m_Pads; for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
for( ; PtPad != NULL; PtPad = (D_PAD*) PtPad->Next() )
{ {
wxPoint shape_pos; wxPoint shape_pos;
if( (PtPad->m_Masque_Layer & masque_layer) == 0 ) if( (pad->m_Masque_Layer & masque_layer) == 0 )
continue; continue;
shape_pos = PtPad->ReturnShapePos();
shape_pos = pad->ReturnShapePos();
pos = shape_pos; pos = shape_pos;
size.x = PtPad->m_Size.x + 2 * garde; size.x = pad->m_Size.x + 2 * garde;
size.y = PtPad->m_Size.y + 2 * garde; size.y = pad->m_Size.y + 2 * garde;
/* Don't draw a null size item : */ /* Don't draw a null size item : */
if( size.x <= 0 || size.y <= 0 ) if( size.x <= 0 || size.y <= 0 )
continue; continue;
switch( PtPad->m_PadShape ) switch( pad->m_PadShape )
{ {
case PAD_CIRCLE: case PAD_CIRCLE:
Plot_1_CIRCLE_pad_GERBER( pos, size.x ); Plot_1_CIRCLE_pad_GERBER( pos, size.x );
...@@ -268,20 +263,20 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer, ...@@ -268,20 +263,20 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
if( size.x == size.y ) if( size.x == size.y )
Plot_1_CIRCLE_pad_GERBER( pos, size.x ); Plot_1_CIRCLE_pad_GERBER( pos, size.x );
else else
trace_1_pastille_OVALE_GERBER( pos, size, PtPad->m_Orient ); trace_1_pastille_OVALE_GERBER( pos, size, pad->m_Orient );
break; break;
case PAD_TRAPEZOID: case PAD_TRAPEZOID:
{ {
wxSize delta = PtPad->m_DeltaSize; wxSize delta = pad->m_DeltaSize;
trace_1_pad_TRAPEZE_GERBER( pos, size, trace_1_pad_TRAPEZE_GERBER( pos, size,
delta, PtPad->m_Orient, FILLED ); delta, pad->m_Orient, FILLED );
} }
break; break;
case PAD_RECT: case PAD_RECT:
default: default:
PlotRectangularPad_GERBER( pos, size, PtPad->m_Orient ); PlotRectangularPad_GERBER( pos, size, pad->m_Orient );
break; break;
} }
} }
...@@ -290,39 +285,46 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer, ...@@ -290,39 +285,46 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
/* Plot vias : */ /* Plot vias : */
if( tracevia ) if( tracevia )
{ {
for( track = m_Pcb->m_Track; track != NULL; track = (TRACK*) track->Next() ) for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() )
{ {
if( track->Type() != TYPE_VIA ) if( track->Type() != TYPE_VIA )
continue; continue;
SEGVIA* Via = (SEGVIA*) track; SEGVIA* Via = (SEGVIA*) track;
// vias not plotted if not on selected layer, but if layer // vias not plotted if not on selected layer, but if layer
// == SOLDERMASK_LAYER_CU or SOLDERMASK_LAYER_CMP, vias are drawn, // == SOLDERMASK_LAYER_CU or SOLDERMASK_LAYER_CMP, vias are drawn,
// if they are on a external copper layer // if they are on a external copper layer
int via_mask_layer = Via->ReturnMaskLayer(); int via_mask_layer = Via->ReturnMaskLayer();
if( via_mask_layer & CUIVRE_LAYER ) if( via_mask_layer & CUIVRE_LAYER )
via_mask_layer |= SOLDERMASK_LAYER_CU; via_mask_layer |= SOLDERMASK_LAYER_CU;
if( via_mask_layer & CMP_LAYER ) if( via_mask_layer & CMP_LAYER )
via_mask_layer |= SOLDERMASK_LAYER_CMP; via_mask_layer |= SOLDERMASK_LAYER_CMP;
if( ( via_mask_layer & masque_layer) == 0 ) if( ( via_mask_layer & masque_layer) == 0 )
continue; continue;
pos = Via->m_Start; pos = Via->m_Start;
size.x = size.y = Via->m_Width + 2 * garde; size.x = size.y = Via->m_Width + 2 * garde;
/* Don't draw a null size item : */ /* Don't draw a null size item : */
if( size.x <= 0 ) if( size.x <= 0 )
continue; continue;
Plot_1_CIRCLE_pad_GERBER( pos, size.x ); Plot_1_CIRCLE_pad_GERBER( pos, size.x );
} }
} }
/* Plot tracks (not vias) : */ /* Plot tracks (not vias) : */
for( track = m_Pcb->m_Track; track != NULL; track = (TRACK*) track->Next() ) for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() )
{ {
wxPoint end; wxPoint end;
if( track->Type() == TYPE_VIA ) if( track->Type() == TYPE_VIA )
continue; continue;
if( (g_TabOneLayerMask[track->GetLayer()] & masque_layer) == 0 ) if( (g_TabOneLayerMask[track->GetLayer()] & masque_layer) == 0 )
continue; continue;
...@@ -335,7 +337,7 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer, ...@@ -335,7 +337,7 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
} }
/* Plot zones: */ /* Plot zones: */
for( track = m_Pcb->m_Zone; track != NULL; track = (TRACK*) track->Next() ) for( TRACK* track = m_Pcb->m_Zone; track; track = track->Next() )
{ {
wxPoint end; wxPoint end;
...@@ -781,9 +783,6 @@ int Gen_D_CODE_File( FILE* penfile ) ...@@ -781,9 +783,6 @@ int Gen_D_CODE_File( FILE* penfile )
/*****************************/ /*****************************/
void CloseFileGERBER( void ) void CloseFileGERBER( void )
/****************************/ /****************************/
/** Function CloseFileGERBER
*/
{ {
char line[1024]; char line[1024];
wxString TmpFileName, msg; wxString TmpFileName, 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