Commit 11d9edfe authored by charras's avatar charras
Browse files

beautify files

parent daeb1901
Loading
Loading
Loading
Loading
+225 −237
Original line number Original line Diff line number Diff line
@@ -37,9 +37,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter *plotter,


    /* Trace du contour du PCB et des Elements du  type Drawings Pcb */
    /* Trace du contour du PCB et des Elements du  type Drawings Pcb */


    for( PtStruct = m_Pcb->m_Drawings; 
    for( PtStruct = m_Pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Next() )
	    PtStruct != NULL; 
	    PtStruct = PtStruct->Next() )
    {
    {
        switch( PtStruct->Type() )
        switch( PtStruct->Type() )
        {
        {
@@ -79,12 +77,11 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter *plotter,
            Module;
            Module;
            Module = Module->Next() )
            Module = Module->Next() )
        {
        {
            for(pt_pad = (D_PAD*) Module->m_Pads; 
            for( pt_pad = (D_PAD*) Module->m_Pads; pt_pad != NULL; pt_pad = pt_pad->Next() )
		    pt_pad != NULL; 
		    pt_pad = pt_pad->Next() )
            {
            {
                /* 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

                   /* Copper pads go on copper silk, component
                   /* Copper pads go on copper silk, component
                    * pads go on component silk */
                    * pads go on component silk */
                   && ( ( (pt_pad->m_Masque_Layer & CUIVRE_LAYER) == 0 )
                   && ( ( (pt_pad->m_Masque_Layer & CUIVRE_LAYER) == 0 )
@@ -111,7 +108,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter *plotter,
                                             pt_pad->m_Orient, FILAIRE );
                                             pt_pad->m_Orient, FILAIRE );
                    break;
                    break;


                case PAD_TRAPEZOID: {
                case PAD_TRAPEZOID:
                {
                    wxSize delta;
                    wxSize delta;
                    delta = pt_pad->m_DeltaSize;
                    delta = pt_pad->m_DeltaSize;
                    plotter->flash_pad_trapez( pos, size,
                    plotter->flash_pad_trapez( pos, size,
@@ -122,8 +120,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter *plotter,


                case PAD_RECT:
                case PAD_RECT:
                default:
                default:
		    plotter->flash_pad_rect( pos, size, pt_pad->m_Orient, 
                    plotter->flash_pad_rect( pos, size, pt_pad->m_Orient, FILAIRE );
			    FILAIRE);
                    break;
                    break;
                }
                }
            }
            }
@@ -131,9 +128,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter *plotter,
    }     /* Fin Sequence de trace des Pads */
    }     /* Fin Sequence de trace des Pads */


    /* Trace Textes MODULES */
    /* Trace Textes MODULES */
    for( MODULE* Module = m_Pcb->m_Modules;  
    for( MODULE* Module = m_Pcb->m_Modules; Module; Module = Module->Next() )
	    Module;  
	    Module = Module->Next() )
    {
    {
        /* Analyse des autorisations de trace pour les textes VALEUR et REF */
        /* Analyse des autorisations de trace pour les textes VALEUR et REF */
        trace_val = g_pcb_plot_options.Sel_Texte_Valeur;
        trace_val = g_pcb_plot_options.Sel_Texte_Valeur;
@@ -204,7 +199,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter *plotter,
                wxString errMsg;
                wxString errMsg;


                errMsg.Printf(
                errMsg.Printf(
                    _( "Your BOARD has a bad layer number of %u for module\n %s's \"module text\" text of %s." ),
                    _(
                        "Your BOARD has a bad layer number of %u for module\n %s's \"module text\" text of %s." ),
                    textLayer, Module->GetReference().GetData(), pt_texte->m_Text.GetData() );
                    textLayer, Module->GetReference().GetData(), pt_texte->m_Text.GetData() );
                DisplayError( this, errMsg );
                DisplayError( this, errMsg );
                return;
                return;
@@ -257,7 +253,7 @@ static void PlotTextModule(Plotter *plotter, TEXTE_MODULE* pt_texte,
        thickness = -1;
        thickness = -1;


    if( pt_texte->m_Mirror )
    if( pt_texte->m_Mirror )
        size.x = -size.x; // Text is mirrored
        NEGATE( size.x ); // Text is mirrored


    plotter->text( pos, BLACK,
    plotter->text( pos, BLACK,
                   pt_texte->m_Text,
                   pt_texte->m_Text,
@@ -361,6 +357,7 @@ void PlotMirePcb(Plotter *plotter, MIREPCB* Mire, int masque_layer,
    delete DrawTmp;
    delete DrawTmp;
}
}



/**********************************************************************/
/**********************************************************************/
void Plot_Edges_Modules( Plotter* plotter, BOARD* pcb, int masque_layer,
void Plot_Edges_Modules( Plotter* plotter, BOARD* pcb, int masque_layer,
                         GRTraceMode trace_mode )
                         GRTraceMode trace_mode )
@@ -509,7 +506,6 @@ void PlotTextePcb(Plotter *plotter, TEXTE_PCB* pt_texte, int masque_layer,


        delete (list);
        delete (list);
    }
    }
    
    else
    else
        plotter->text( pos, BLACK,
        plotter->text( pos, BLACK,
                       pt_texte->m_Text,
                       pt_texte->m_Text,
@@ -600,13 +596,13 @@ void PlotFilledAreas(Plotter *plotter, ZONE_CONTAINER* aZone,
    }
    }
}
}



/******************************************************************************/
/******************************************************************************/
void PlotDrawSegment( Plotter* plotter, DRAWSEGMENT* pt_segm, int masque_layer,
void PlotDrawSegment( Plotter* plotter, DRAWSEGMENT* pt_segm, int masque_layer,
                      GRTraceMode trace_mode )
                      GRTraceMode trace_mode )
/******************************************************************************/
/******************************************************************************/


/* Trace un element du type DRAWSEGMENT draw appartenant
/* Plot items type DRAWSEGMENT on layers allowed by masque_layer
 *   aux couches specifiees par masque_layer
 */
 */
{
{
    wxPoint start, end;
    wxPoint start, end;
@@ -643,6 +639,7 @@ void PlotDrawSegment(Plotter *plotter, DRAWSEGMENT* pt_segm, int masque_layer,
        for( unsigned i = 1; i < pt_segm->m_BezierPoints.size(); i++ )
        for( unsigned i = 1; i < pt_segm->m_BezierPoints.size(); i++ )
            plotter->thick_segment( pt_segm->m_BezierPoints[i - 1],
            plotter->thick_segment( pt_segm->m_BezierPoints[i - 1],
                                    pt_segm->m_BezierPoints[i], thickness, trace_mode );
                                    pt_segm->m_BezierPoints[i], thickness, trace_mode );

        break;
        break;


    default:
    default:
@@ -650,6 +647,7 @@ void PlotDrawSegment(Plotter *plotter, DRAWSEGMENT* pt_segm, int masque_layer,
    }
    }
}
}



/*********************************************************************/
/*********************************************************************/
void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer,
void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer,
                                      GRTraceMode trace_mode )
                                      GRTraceMode trace_mode )
@@ -658,6 +656,7 @@ void WinEDA_BasePcbFrame::Plot_Layer(Plotter *plotter, int Layer,
    // Specify that the contents of the "Edges Pcb" layer are to be plotted
    // Specify that the contents of the "Edges Pcb" layer are to be plotted
    // in addition to the contents of the currently specified layer.
    // in addition to the contents of the currently specified layer.
    int layer_mask = g_TabOneLayerMask[Layer];
    int layer_mask = g_TabOneLayerMask[Layer];

    if( !g_pcb_plot_options.Exclude_Edges_Pcb )
    if( !g_pcb_plot_options.Exclude_Edges_Pcb )
        layer_mask |= EDGE_LAYER;
        layer_mask |= EDGE_LAYER;


@@ -698,12 +697,17 @@ void WinEDA_BasePcbFrame::Plot_Layer(Plotter *plotter, int Layer,
        Plot_Serigraphie( plotter, layer_mask, trace_mode );
        Plot_Serigraphie( plotter, layer_mask, trace_mode );
        break;
        break;
    }
    }

    PlotDrillMark( plotter, trace_mode );
    PlotDrillMark( plotter, trace_mode );
}
}



/*********************************************************************/
/*********************************************************************/
void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter*    plotter,
void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter*    plotter,
	int masque_layer, int garde, bool trace_via, GRTraceMode trace_mode )
                                               int         masque_layer,
                                               int         garde,
                                               bool        trace_via,
                                               GRTraceMode trace_mode )
/*********************************************************************/
/*********************************************************************/


/* Trace en format HPGL. d'une couche cuivre ou masque
/* Trace en format HPGL. d'une couche cuivre ou masque
@@ -716,9 +720,7 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,


    // trace des elements type Drawings Pcb :
    // trace des elements type Drawings Pcb :


    for (BOARD_ITEM* item = m_Pcb->m_Drawings;
    for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = item->Next() )
	    item;
	    item = item->Next() )
    {
    {
        switch( item->Type() )
        switch( item->Type() )
        {
        {
@@ -743,19 +745,15 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,


        default:
        default:
            DisplayError( this,
            DisplayError( this,
                wxT( "Plot_Layer : Unexpected Draw Type" ) );
                         wxT( "Plot_Standard_Layer() error : Unexpected Draw Type" ) );
            break;
            break;
        }
        }
    }
    }


    /* Draw footprint shapes without pads (pads will plotted later) */
    /* Draw footprint shapes without pads (pads will plotted later) */
    for( MODULE* module = m_Pcb->m_Modules;  
    for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
	    module;  
	    module = module->Next() )
    {
    {
        for( BOARD_ITEM* item = module->m_Drawings;
        for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
		item;  
		item = item->Next() )
        {
        {
            switch( item->Type() )
            switch( item->Type() )
            {
            {
@@ -771,9 +769,7 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
    }
    }


    /* Plot footprint pads */
    /* Plot footprint pads */
    for( MODULE* module = m_Pcb->m_Modules;  
    for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
	    module;
	    module = module->Next() )
    {
    {
        for( D_PAD* pad = module->m_Pads;  pad;  pad = pad->Next() )
        for( D_PAD* pad = module->m_Pads;  pad;  pad = pad->Next() )
        {
        {
@@ -798,22 +794,19 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
                break;
                break;


            case PAD_OVAL:
            case PAD_OVAL:
		plotter->flash_pad_oval(pos, size, pad->m_Orient, 
                plotter->flash_pad_oval( pos, size, pad->m_Orient, trace_mode );
			trace_mode);
                break;
                break;


            case PAD_TRAPEZOID:
            case PAD_TRAPEZOID:
            {
            {
                wxSize delta = pad->m_DeltaSize;
                wxSize delta = pad->m_DeltaSize;
                plotter->flash_pad_trapez(pos, size,
                plotter->flash_pad_trapez( pos, size, delta, pad->m_Orient, trace_mode );
			delta, pad->m_Orient, trace_mode);
            }
            }
            break;
            break;


            case PAD_RECT:
            case PAD_RECT:
            default:
            default:
                plotter->flash_pad_rect(pos, size, pad->m_Orient, 
                plotter->flash_pad_rect( pos, size, pad->m_Orient, trace_mode );
			trace_mode);
                break;
                break;
            }
            }
        }
        }
@@ -822,9 +815,7 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
    /* Plot vias : */
    /* Plot vias : */
    if( trace_via )
    if( trace_via )
    {
    {
        for( TRACK* track = m_Pcb->m_Track;  
        for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() )
		track;  
		track = track->Next() )
        {
        {
            if( track->Type() != TYPE_VIA )
            if( track->Type() != TYPE_VIA )
                continue;
                continue;
@@ -854,9 +845,7 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
    }
    }


    /* Plot tracks (not vias) : */
    /* Plot tracks (not vias) : */
    for( TRACK* track = m_Pcb->m_Track;  
    for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() )
	    track;  
	    track = track->Next() )
    {
    {
        wxPoint end;
        wxPoint end;


@@ -874,9 +863,7 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
    }
    }


    /* Plot zones: */
    /* Plot zones: */
    for( TRACK* track = m_Pcb->m_Zone;
    for( TRACK* track = m_Pcb->m_Zone; track; track = track->Next() )
	    track;
	    track = track->Next() )
    {
    {
        wxPoint end;
        wxPoint end;


@@ -901,9 +888,9 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
}
}




/*************************************/
/***********************************************************************************/
void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mode )
void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mode )
/*************************************/
/***********************************************************************************/


/* Draw a drill mark for pads and vias.
/* Draw a drill mark for pads and vias.
 * Must be called after all drawings, because it
 * Must be called after all drawings, because it
@@ -920,7 +907,8 @@ void WinEDA_BasePcbFrame::PlotDrillMark(Plotter *plotter, GRTraceMode trace_mode
    if( g_pcb_plot_options.DrillShapeOpt == PCB_Plot_Options::NO_DRILL_SHAPE )
    if( g_pcb_plot_options.DrillShapeOpt == PCB_Plot_Options::NO_DRILL_SHAPE )
        return;
        return;


    if (trace_mode == FILLED) {
    if( trace_mode == FILLED )
    {
        plotter->set_color( WHITE );
        plotter->set_color( WHITE );
    }
    }


@@ -941,7 +929,6 @@ void WinEDA_BasePcbFrame::PlotDrillMark(Plotter *plotter, GRTraceMode trace_mode
        Module != NULL;
        Module != NULL;
        Module = Module->Next() )
        Module = Module->Next() )
    {
    {

        for( PtPad = Module->m_Pads;
        for( PtPad = Module->m_Pads;
            PtPad != NULL;
            PtPad != NULL;
            PtPad = PtPad->Next() )
            PtPad = PtPad->Next() )
@@ -965,7 +952,8 @@ void WinEDA_BasePcbFrame::PlotDrillMark(Plotter *plotter, GRTraceMode trace_mode
        }
        }
    }
    }


    if (trace_mode == FILLED) {
    if( trace_mode == FILLED )
    {
        plotter->set_color( BLACK );
        plotter->set_color( BLACK );
    }
    }
}
}
+14 −14
Original line number Original line Diff line number Diff line
@@ -68,6 +68,7 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
    Affiche_1_Parametre( this, 0, _( "File" ), FullFileName, CYAN );
    Affiche_1_Parametre( this, 0, _( "File" ), FullFileName, CYAN );


    plotter->start_plot( output_file );
    plotter->start_plot( output_file );

    // Sheet refs on gerber CAN be useful... and they're always 1:1
    // Sheet refs on gerber CAN be useful... and they're always 1:1
    if( g_pcb_plot_options.Plot_Frame_Ref )
    if( g_pcb_plot_options.Plot_Frame_Ref )
        PlotWorkSheet( plotter, GetScreen() );
        PlotWorkSheet( plotter, GetScreen() );
@@ -77,4 +78,3 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
    delete plotter;
    delete plotter;
    SetLocaleTo_Default();
    SetLocaleTo_Default();
}
}
+46 −44
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
    wxPoint       offset;
    wxPoint       offset;


    MsgPanel->EraseMsgBox();
    MsgPanel->EraseMsgBox();

    // Compute pen_dim (from g_HPGL_Pen_Diam in mils) in pcb units,
    // Compute pen_dim (from g_HPGL_Pen_Diam in mils) in pcb units,
    // with plot scale (if Scale is 2, pen diametre is always g_HPGL_Pen_Diam
    // with plot scale (if Scale is 2, pen diametre is always g_HPGL_Pen_Diam
    // so apparent pen diam is real pen diam / Scale
    // so apparent pen diam is real pen diam / Scale
@@ -37,7 +38,8 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
        g_pcb_plot_options.HPGL_Pen_Recouvrement = 0;
        g_pcb_plot_options.HPGL_Pen_Recouvrement = 0;
    if( g_pcb_plot_options.HPGL_Pen_Recouvrement >= g_pcb_plot_options.HPGL_Pen_Diam )
    if( g_pcb_plot_options.HPGL_Pen_Recouvrement >= g_pcb_plot_options.HPGL_Pen_Diam )
        g_pcb_plot_options.HPGL_Pen_Recouvrement = g_pcb_plot_options.HPGL_Pen_Diam - 1;
        g_pcb_plot_options.HPGL_Pen_Recouvrement = g_pcb_plot_options.HPGL_Pen_Diam - 1;
    int pen_recouvrement = wxRound( g_pcb_plot_options.HPGL_Pen_Recouvrement * 10.0 / g_pcb_plot_options.Scale );
    int   pen_recouvrement = wxRound(
        g_pcb_plot_options.HPGL_Pen_Recouvrement * 10.0 / g_pcb_plot_options.Scale );


    FILE* output_file = wxFopen( FullFileName, wxT( "wt" ) );
    FILE* output_file = wxFopen( FullFileName, wxT( "wt" ) );
    if( output_file == NULL )
    if( output_file == NULL )
@@ -66,6 +68,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
    if( g_pcb_plot_options.PlotScaleOpt == 0 )       // Optimum scale
    if( g_pcb_plot_options.PlotScaleOpt == 0 )       // Optimum scale
    {
    {
        double Xscale, Yscale;
        double Xscale, Yscale;

        // Fit to 80% of the page
        // Fit to 80% of the page
        Xscale = ( (SheetSize.x * 0.8) / BoardSize.x );
        Xscale = ( (SheetSize.x * 0.8) / BoardSize.x );
        Yscale = ( (SheetSize.y * 0.8) / BoardSize.y );
        Yscale = ( (SheetSize.y * 0.8) / BoardSize.y );
@@ -109,4 +112,3 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
    delete plotter;
    delete plotter;
    SetLocaleTo_Default();
    SetLocaleTo_Default();
}
}
+47 −47
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
    if( g_pcb_plot_options.PlotScaleOpt == 0 )       // Optimum scale
    if( g_pcb_plot_options.PlotScaleOpt == 0 )       // Optimum scale
    {
    {
        double Xscale, Yscale;
        double Xscale, Yscale;

        // Fit to 80% of the page
        // Fit to 80% of the page
        Xscale = (PaperSize.x * 0.8) / BoardSize.x;
        Xscale = (PaperSize.x * 0.8) / BoardSize.x;
        Yscale = (PaperSize.y * 0.8) / BoardSize.y;
        Yscale = (PaperSize.y * 0.8) / BoardSize.y;
@@ -134,4 +135,3 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
    delete plotter;
    delete plotter;
    SetLocaleTo_Default();
    SetLocaleTo_Default();
}
}