Commit a28492f4 authored by dickelbeck's avatar dickelbeck

bug fixing, gerbers, etc.

parent 16784384
......@@ -19,9 +19,16 @@ email address.
2009-Feb-25 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++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
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>
......
......@@ -51,7 +51,6 @@ void EDGE_MODULE:: Copy( EDGE_MODULE* source ) // copy structure
if( source == NULL )
return;
// @todo why not just use "*this = source;" ?
m_Start = source->m_Start;
m_End = source->m_End;
m_Shape = source->m_Shape;
......
......@@ -420,7 +420,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
if( !segment->IsNull() )
continue;
/* Lenght segment = 0; delete it */
/* Length segment = 0; delete it */
segment->Draw( frame->DrawPanel, DC, GR_XOR );
segment->DeleteStructure();
nbpoints_supprimes++;
......
This diff is collapsed.
......@@ -722,7 +722,7 @@ MODULE* WinEDA_BasePcbFrame::Create_1_Module( wxDC* DC, const wxString& module_n
/* Ask fo the new module reference */
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" ) );
return NULL;
......
This diff is collapsed.
......@@ -69,11 +69,11 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event )
case ID_CONFIG_READ:
FullFileName = GetScreen()->m_FileName.AfterLast( '/' );
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 */
FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */
FullFileName, /* Masque d'affichage */
wxString( wxT("*")) + g_Prj_Config_Filename_ext,
this,
wxFD_OPEN,
TRUE /* ne change pas de repertoire courant */
......@@ -183,10 +183,9 @@ bool Read_Config( const wxString& project_name )
ScreenPcb->AddGrid( g_UserGrid, g_UserGrid_Unit, ID_POPUP_GRID_USER );
}
g_DesignSettings.m_TrackWidthHistory[0] =
g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_ViaSizeHistory[0] =
g_DesignSettings.m_CurrentViaSize;
g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
for( ii = 1; ii < HISTORY_NUMBER; ii++ )
{
g_DesignSettings.m_TrackWidthHistory[ii] = 0;
......
......@@ -429,22 +429,21 @@ void Plot_Edges_Modules( BOARD* pcb, int format_plot, int masque_layer )
/* Trace les contours des modules */
{
int nb_items; /* Pour affichage activite: nbr modules traites */
MODULE* Module;
EDGE_MODULE* PtEdge;
wxString msg;
nb_items = 0;
Module = pcb->m_Modules;
for( ; Module != NULL; Module = Module->Next() )
for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
{
PtEdge = (EDGE_MODULE*) Module->m_Drawings.GetFirst();
for( ; PtEdge != NULL; PtEdge = PtEdge->Next() )
EDGE_MODULE* edge = (EDGE_MODULE*) module->m_Drawings.GetFirst();
for( ; edge; edge = edge->Next() )
{
if( PtEdge->Type() != TYPE_EDGE_MODULE )
if( edge->Type() != TYPE_EDGE_MODULE )
continue;
if( (g_TabOneLayerMask[PtEdge->GetLayer()] & masque_layer) == 0 )
if( (g_TabOneLayerMask[edge->GetLayer()] & masque_layer) == 0 )
continue;
Plot_1_EdgeModule( format_plot, PtEdge );
Plot_1_EdgeModule( format_plot, edge );
}
/* Affichage du nombre de modules traites */
......@@ -470,8 +469,12 @@ void Plot_1_EdgeModule( int format_plot, EDGE_MODULE* PtEdge )
type_trace = PtEdge->m_Shape;
thickness = PtEdge->m_Width;
if( g_Plot_Mode == FILAIRE )
{
thickness = g_PlotLine_Width;
wxLogDebug( wxT("changing edgemodule thickness to g_PlotLine_Width") );
}
pos = PtEdge->m_Start;
end = PtEdge->m_End;
......@@ -484,6 +487,7 @@ void Plot_1_EdgeModule( int format_plot, EDGE_MODULE* PtEdge )
switch( format_plot )
{
case PLOT_FORMAT_GERBER:
SelectD_CODE_For_LineDraw(thickness);
PlotGERBERLine( pos, end, thickness );
break;
......
......@@ -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 */
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_y = Scale_Y * Gerb_scale_plot;
g_PlotOffset.x = 0;
g_PlotOffset.y = 0;
if( PlotOriginIsAuxAxis )
g_PlotOffset = m_Auxiliary_Axis_Position;
......@@ -175,35 +178,30 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
{
wxPoint pos;
wxSize size;
MODULE* Module;
D_PAD* PtPad;
TRACK* track;
EDA_BaseStruct* PtStruct;
wxString msg;
/* Draw items type Drawings Pcb matching with masque_layer: */
PtStruct = m_Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = item->Next() )
{
switch( PtStruct->Type() )
switch( item->Type() )
{
case TYPE_DRAWSEGMENT:
PlotDrawSegment( (DRAWSEGMENT*) PtStruct, PLOT_FORMAT_GERBER,
PlotDrawSegment( (DRAWSEGMENT*) item, PLOT_FORMAT_GERBER,
masque_layer );
break;
case TYPE_TEXTE:
PlotTextePcb( (TEXTE_PCB*) PtStruct, PLOT_FORMAT_GERBER,
PlotTextePcb( (TEXTE_PCB*) item, PLOT_FORMAT_GERBER,
masque_layer );
break;
case TYPE_COTATION:
PlotCotation( (COTATION*) PtStruct, PLOT_FORMAT_GERBER,
PlotCotation( (COTATION*) item, PLOT_FORMAT_GERBER,
masque_layer );
break;
case TYPE_MIRE:
PlotMirePcb( (MIREPCB*) PtStruct, PLOT_FORMAT_GERBER,
PlotMirePcb( (MIREPCB*) item, PLOT_FORMAT_GERBER,
masque_layer );
break;
......@@ -216,18 +214,16 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
}
}
/* Draw footprints shapes without pads (pads will plotted later) */
Module = m_Pcb->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Next() )
/* Draw footprint shapes without pads (pads will plotted later) */
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
{
PtStruct = Module->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
{
switch( PtStruct->Type() )
switch( item->Type() )
{
case TYPE_EDGE_MODULE:
if( masque_layer & g_TabOneLayerMask[( (EDGE_MODULE*) PtStruct )->GetLayer()] )
Plot_1_EdgeModule( PLOT_FORMAT_GERBER, (EDGE_MODULE*) PtStruct );
if( masque_layer & g_TabOneLayerMask[( (EDGE_MODULE*) item)->GetLayer()] )
Plot_1_EdgeModule( PLOT_FORMAT_GERBER, (EDGE_MODULE*) item );
break;
default:
......@@ -237,26 +233,25 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
}
/* Plot footprint pads */
Module = m_Pcb->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Next() )
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
{
PtPad = (D_PAD*) Module->m_Pads;
for( ; PtPad != NULL; PtPad = (D_PAD*) PtPad->Next() )
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
{
wxPoint shape_pos;
if( (PtPad->m_Masque_Layer & masque_layer) == 0 )
if( (pad->m_Masque_Layer & masque_layer) == 0 )
continue;
shape_pos = PtPad->ReturnShapePos();
shape_pos = pad->ReturnShapePos();
pos = shape_pos;
size.x = PtPad->m_Size.x + 2 * garde;
size.y = PtPad->m_Size.y + 2 * garde;
size.x = pad->m_Size.x + 2 * garde;
size.y = pad->m_Size.y + 2 * garde;
/* Don't draw a null size item : */
if( size.x <= 0 || size.y <= 0 )
continue;
switch( PtPad->m_PadShape )
switch( pad->m_PadShape )
{
case PAD_CIRCLE:
Plot_1_CIRCLE_pad_GERBER( pos, size.x );
......@@ -268,20 +263,20 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
if( size.x == size.y )
Plot_1_CIRCLE_pad_GERBER( pos, size.x );
else
trace_1_pastille_OVALE_GERBER( pos, size, PtPad->m_Orient );
trace_1_pastille_OVALE_GERBER( pos, size, pad->m_Orient );
break;
case PAD_TRAPEZOID:
{
wxSize delta = PtPad->m_DeltaSize;
wxSize delta = pad->m_DeltaSize;
trace_1_pad_TRAPEZE_GERBER( pos, size,
delta, PtPad->m_Orient, FILLED );
delta, pad->m_Orient, FILLED );
}
break;
case PAD_RECT:
default:
PlotRectangularPad_GERBER( pos, size, PtPad->m_Orient );
PlotRectangularPad_GERBER( pos, size, pad->m_Orient );
break;
}
}
......@@ -290,39 +285,46 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
/* Plot vias : */
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 )
continue;
SEGVIA* Via = (SEGVIA*) track;
// vias not plotted if not on selected layer, but if layer
// == SOLDERMASK_LAYER_CU or SOLDERMASK_LAYER_CMP, vias are drawn,
// if they are on a external copper layer
int via_mask_layer = Via->ReturnMaskLayer();
if( via_mask_layer & CUIVRE_LAYER )
via_mask_layer |= SOLDERMASK_LAYER_CU;
if( via_mask_layer & CMP_LAYER )
via_mask_layer |= SOLDERMASK_LAYER_CMP;
if( ( via_mask_layer & masque_layer) == 0 )
continue;
pos = Via->m_Start;
size.x = size.y = Via->m_Width + 2 * garde;
/* Don't draw a null size item : */
if( size.x <= 0 )
continue;
Plot_1_CIRCLE_pad_GERBER( pos, size.x );
}
}
/* 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;
if( track->Type() == TYPE_VIA )
continue;
if( (g_TabOneLayerMask[track->GetLayer()] & masque_layer) == 0 )
continue;
......@@ -335,7 +337,7 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer,
}
/* 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;
......@@ -781,9 +783,6 @@ int Gen_D_CODE_File( FILE* penfile )
/*****************************/
void CloseFileGERBER( void )
/****************************/
/** Function CloseFileGERBER
*/
{
char line[1024];
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