From 6e6098a05c887b36bf2164d22e961368758f4361 Mon Sep 17 00:00:00 2001 From: charras Date: Wed, 17 Dec 2008 06:51:39 +0000 Subject: [PATCH] cleanup --- pcbnew/CMakeLists.txt | 2 +- pcbnew/makefile.include | 4 +- ...lay2plot.cpp => print_board_functions.cpp} | 49 +++++++------------ 3 files changed, 22 insertions(+), 33 deletions(-) rename pcbnew/{lay2plot.cpp => print_board_functions.cpp} (84%) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 863edd76aa..cd1c280110 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -89,7 +89,7 @@ set(PCBNEW_SRCS hotkeys.cpp initpcb.cpp ioascii.cpp - lay2plot.cpp + print_board_functions.cpp librairi.cpp loadcmp.cpp locate.cpp diff --git a/pcbnew/makefile.include b/pcbnew/makefile.include index 52e9b74a90..7725190f72 100644 --- a/pcbnew/makefile.include +++ b/pcbnew/makefile.include @@ -24,7 +24,7 @@ SPECCTRA_TOOLS = specctra.o specctra_export.o dsn.o specctra_import.o OBJECTS= $(TARGET).o classpcb.o\ $(ZONE_FILES)\ $(SPECCTRA_TOOLS)\ - lay2plot.o\ + print_board_functions.o\ dialog_freeroute_exchange.o\ modedit_undo_redo.o\ block_module_editor.o\ @@ -160,7 +160,7 @@ export_gencad.o: export_gencad.cpp wxprint.o: ../share/wxprint.cpp ../share/dialog_print.cpp ../share/dialog_print.h $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp -lay2plot.o: lay2plot.cpp +print_board_functions.o: print_board_functions.cpp classpcb.o: classpcb.cpp diff --git a/pcbnew/lay2plot.cpp b/pcbnew/print_board_functions.cpp similarity index 84% rename from pcbnew/lay2plot.cpp rename to pcbnew/print_board_functions.cpp index c25650419b..fde95fef42 100644 --- a/pcbnew/lay2plot.cpp +++ b/pcbnew/print_board_functions.cpp @@ -1,5 +1,5 @@ /**********************************************/ -/* Routine de selection de couches pour trace */ +/*lay2plot.cpp: some functions to plot boards */ /**********************************************/ #include "fctsys.h" @@ -11,11 +11,8 @@ #include "protos.h" - -/* Variables locales : */ - -/* Routines Locales */ -static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, +/* Local functions */ +static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, int draw_mode, int masklayer ); @@ -24,7 +21,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl /************************************************************************************************************/ /* Used to print the board. - * Draw the board, but only layers allowed by printmasklayer + * Print the board, but only layers allowed by printmasklayer * ( printmasklayer is a 32 bits mask: bit n = 1 -> layer n is printed) */ { @@ -41,19 +38,19 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl else DisplayOpt.DisplayPadFill = SKETCH; frame->m_DisplayPadFill = DisplayOpt.DisplayPadFill; - frame->m_DisplayPadNum = DisplayOpt.DisplayPadNum = FALSE; - DisplayOpt.DisplayPadNoConn = FALSE; - DisplayOpt.DisplayPadIsol = FALSE; + frame->m_DisplayPadNum = DisplayOpt.DisplayPadNum = false; + DisplayOpt.DisplayPadNoConn = false; + DisplayOpt.DisplayPadIsol = false; DisplayOpt.DisplayModEdge = FILLED; DisplayOpt.DisplayModText = FILLED; frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = FILLED; - DisplayOpt.DisplayTrackIsol = FALSE; + DisplayOpt.DisplayTrackIsol = false; DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayZonesMode = 0; m_PrintIsMirrored = aPrintMirrorMode; - /* Draw the pcb graphic items (texts, ...) */ + /* Print the pcb graphic items (texts, ...) */ for( BOARD_ITEM* item = Pcb->m_Drawings; item; item = item->Next() ) { switch( item->Type() ) @@ -74,7 +71,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl } } - /* Draw the tracks */ + /* Print tracks */ pt_piste = Pcb->m_Track; for( ; pt_piste != NULL; pt_piste = pt_piste->Next() ) { @@ -105,15 +102,15 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl Module = (MODULE*) Pcb->m_Modules; for( ; Module != NULL; Module = Module->Next() ) { - Plot_Module( this, DC, Module, drawmode, printmasklayer ); + Print_Module( this, DC, Module, drawmode, printmasklayer ); } - /* draw the via holes in white color*/ + /* Print via holes in white color*/ pt_piste = Pcb->m_Track; int rayon = g_DesignSettings.m_ViaDrill / 2; int color = WHITE; bool blackpenstate = GetGRForceBlackPenState( ); - GRForceBlackPen( FALSE ); + GRForceBlackPen( false ); for( ; pt_piste != NULL; pt_piste = pt_piste->Next() ) { if( ( printmasklayer & pt_piste->ReturnMaskLayer() ) == 0 ) @@ -127,7 +124,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl } GRForceBlackPen( blackpenstate ); - /* Draw areas (i.e. zones) */ + /* Draw filled areas (i.e. zones) */ for( int ii = 0; ii < Pcb->GetAreaCount(); ii++ ) { ZONE_CONTAINER* zone = Pcb->GetArea(ii); @@ -150,7 +147,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl /***********************************************************/ -static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC, +static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, int draw_mode, int masklayer ) /***********************************************************/ { @@ -159,7 +156,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC, TEXTE_MODULE* TextMod; int mlayer; - /* Draw pads */ + /* Print pads */ pt_pad = Module->m_Pads; for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) { @@ -178,7 +175,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC, pt_pad->Draw( panel, DC, draw_mode ); } - /* draw footprint graphic shapes */ + /* Print footprint graphic shapes */ PtStruct = Module->m_Drawings; mlayer = g_TabOneLayerMask[Module->GetLayer()]; if( Module->GetLayer() == COPPER_LAYER_N ) @@ -188,17 +185,9 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC, if( mlayer & masklayer ) { - /* Analyse des autorisations de trace pour les textes VALEUR et REF */ - bool trace_val, trace_ref; - trace_val = trace_ref = TRUE; // les 2 autorisations de tracer sont donnees - if( Module->m_Reference->m_NoShow ) - trace_ref = FALSE; - if( Module->m_Value->m_NoShow ) - trace_val = FALSE; - - if( trace_ref ) + if( ! Module->m_Reference->m_NoShow ) Module->m_Reference->Draw( panel, DC, draw_mode ); - if( trace_val ) + if( ! Module->m_Value->m_NoShow ) Module->m_Value->Draw( panel, DC, draw_mode ); }