Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
d4bd033a
Commit
d4bd033a
authored
Jan 09, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: print dialog: added pads drill option (like in plot dialog)
parent
cee9ab76
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
270 additions
and
113 deletions
+270
-113
copy_to_clipboard.cpp
common/copy_to_clipboard.cpp
+1
-1
dialog_SVG_print.cpp
eeschema/dialog_SVG_print.cpp
+1
-1
dialog_print_using_printer.cpp
eeschema/dialog_print_using_printer.cpp
+1
-1
eeredraw.cpp
eeschema/eeredraw.cpp
+10
-8
tracepcb.cpp
gerbview/tracepcb.cpp
+15
-9
class_drawpanel.h
include/class_drawpanel.h
+14
-4
dialog_SVG_print.cpp
pcbnew/dialog_SVG_print.cpp
+1
-1
dialog_print_using_printer.cpp
pcbnew/dialog_print_using_printer.cpp
+9
-0
dialog_print_using_printer_base.cpp
pcbnew/dialog_print_using_printer_base.cpp
+23
-11
dialog_print_using_printer_base.fbp
pcbnew/dialog_print_using_printer_base.fbp
+92
-18
dialog_print_using_printer_base.h
pcbnew/dialog_print_using_printer_base.h
+4
-1
pcbplot.h
pcbnew/pcbplot.h
+4
-0
plot_rtn.cpp
pcbnew/plot_rtn.cpp
+0
-1
print_board_functions.cpp
pcbnew/print_board_functions.cpp
+84
-54
printout_controler.cpp
pcbnew/printout_controler.cpp
+4
-3
printout_controler.h
pcbnew/printout_controler.h
+7
-0
No files found.
common/copy_to_clipboard.cpp
View file @
d4bd033a
...
...
@@ -99,7 +99,7 @@ bool DrawPage( WinEDA_DrawPanel* panel )
dc
.
SetClippingRegion
(
DrawArea
);
}
panel
->
PrintPage
(
&
dc
,
Print_Sheet_Ref
,
-
1
,
false
);
panel
->
PrintPage
(
&
dc
,
Print_Sheet_Ref
,
-
1
,
false
,
NULL
);
screen
->
m_IsPrinting
=
false
;
panel
->
m_ClipBox
=
tmp
;
wxMetafile
*
mf
=
dc
.
Close
();
...
...
eeschema/dialog_SVG_print.cpp
View file @
d4bd033a
...
...
@@ -238,7 +238,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
screen
->
m_IsPrinting
=
true
;
SetLocaleTo_C_standard
(
);
// Switch the locale to standard C (needed
// to print floating point numbers like 1.3)
panel
->
PrintPage
(
&
dc
,
aPrint_Sheet_Ref
,
1
,
false
);
panel
->
PrintPage
(
&
dc
,
aPrint_Sheet_Ref
,
1
,
false
,
NULL
);
SetLocaleTo_Default
(
);
// revert to the current locale
screen
->
m_IsPrinting
=
false
;
panel
->
m_ClipBox
=
tmp
;
...
...
eeschema/dialog_print_using_printer.cpp
View file @
d4bd033a
...
...
@@ -432,7 +432,7 @@ void EDA_Printout::DrawPage()
screen
->
m_IsPrinting
=
true
;
int
bg_color
=
g_DrawBgColor
;
panel
->
PrintPage
(
dc
,
m_Print_Sheet_Ref
,
0xFFFFFFFF
,
false
);
panel
->
PrintPage
(
dc
,
m_Print_Sheet_Ref
,
0xFFFFFFFF
,
false
,
NULL
);
g_DrawBgColor
=
bg_color
;
screen
->
m_IsPrinting
=
false
;
...
...
eeschema/eeredraw.cpp
View file @
d4bd033a
...
...
@@ -104,20 +104,22 @@ void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
* PrintPage
* used to print a page.
* Print the page pointed by ActiveScreen, set by the calling print function
* @param DC = wxDC given by the calling print function
* @param Print_Sheet_Ref = true to print page references
* @param PrintMask = not used here
* @param
a
DC = wxDC given by the calling print function
* @param
a
Print_Sheet_Ref = true to print page references
* @param
a
PrintMask = not used here
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
* @param aData = a pointer on an auxiliary data (not used here)
*/
void
WinEDA_DrawPanel
::
PrintPage
(
wxDC
*
DC
,
bool
Print_Sheet_Ref
,
int
PrintMask
,
bool
aPrintMirrorMode
)
void
WinEDA_DrawPanel
::
PrintPage
(
wxDC
*
aDC
,
bool
aPrint_Sheet_Ref
,
int
aPrintMask
,
bool
aPrintMirrorMode
,
void
*
aData
)
{
wxBeginBusyCursor
();
RedrawStructList
(
this
,
DC
,
ActiveScreen
->
EEDrawList
,
GR_COPY
);
RedrawStructList
(
this
,
a
DC
,
ActiveScreen
->
EEDrawList
,
GR_COPY
);
if
(
Print_Sheet_Ref
)
m_Parent
->
TraceWorkSheet
(
DC
,
ActiveScreen
,
g_DrawDefaultLineThickness
);
if
(
a
Print_Sheet_Ref
)
m_Parent
->
TraceWorkSheet
(
a
DC
,
ActiveScreen
,
g_DrawDefaultLineThickness
);
wxEndBusyCursor
();
}
...
...
gerbview/tracepcb.cpp
View file @
d4bd033a
...
...
@@ -25,11 +25,17 @@ static void Draw_Track_Buffer( WinEDA_DrawPanel* panel,
static
void
Affiche_DCodes_Pistes
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
BOARD
*
Pcb
,
int
drawmode
);
/************************************************************************************************************/
void
WinEDA_DrawPanel
::
PrintPage
(
wxDC
*
DC
,
bool
Print_Sheet_Ref
,
int
printmasklayer
,
bool
aPrintMirrorMode
)
/*************************************************************************************************************/
/* Draw gerbview layers, for printing
*/
/** Function PrintPage
* Used to print the board (on printer, or when creating SVF files).
* Print the board, but only layers allowed by aPrintMaskLayer
* @param aDC = the print device context
* @param aPrint_Sheet_Ref = true to print frame references
* @param aPrint_Sheet_Ref = a 32 bits mask: bit n = 1 -> layer n is printed
* @param aPrintMirrorMode = true to plot mirrored
* @param aData = a pointer to an optional data (not used here: can be NULL)
*/
void
WinEDA_DrawPanel
::
PrintPage
(
wxDC
*
aDC
,
bool
aPrint_Sheet_Ref
,
int
aPrintmasklayer
,
bool
aPrintMirrorMode
,
void
*
aData
)
{
DISPLAY_OPTIONS
save_opt
;
int
DisplayPolygonsModeImg
;
...
...
@@ -46,10 +52,10 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
m_PrintIsMirrored
=
aPrintMirrorMode
;
(
(
WinEDA_GerberFrame
*
)
m_Parent
)
->
Trace_Gerber
(
DC
,
GR_COPY
,
p
rintmasklayer
);
(
(
WinEDA_GerberFrame
*
)
m_Parent
)
->
Trace_Gerber
(
aDC
,
GR_COPY
,
aP
rintmasklayer
);
if
(
Print_Sheet_Ref
)
m_Parent
->
TraceWorkSheet
(
DC
,
GetScreen
(),
0
);
if
(
a
Print_Sheet_Ref
)
m_Parent
->
TraceWorkSheet
(
a
DC
,
GetScreen
(),
0
);
m_PrintIsMirrored
=
false
;
...
...
@@ -178,7 +184,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
// Draw tracks and flashes down here. This will probably not be a final solution to drawing order issues
Draw_Track_Buffer
(
DrawPanel
,
DC
,
GetBoard
(),
draw_mode
,
printmasklayer
);
SetPenMinWidth
(
tmp
);
if
(
DisplayOpt
.
DisplayPadNum
)
...
...
include/class_drawpanel.h
View file @
d4bd033a
...
...
@@ -83,10 +83,20 @@ public:
void
OnPaint
(
wxPaintEvent
&
event
);
void
OnSize
(
wxSizeEvent
&
event
);
void
PrintPage
(
wxDC
*
DC
,
bool
Print_Sheet_Ref
,
int
PrintMask
,
bool
aPrintMirrorMode
);
/** Function PrintPage
* Used to print the board (on printer, or when creating SVF files).
* Print the board, but only layers allowed by aPrintMaskLayer
* @param aDC = the print device context
* @param aPrint_Sheet_Ref = true to print frame references
* @param aPrint_Sheet_Ref = a 32 bits mask: bit n = 1 -> layer n is printed
* @param aPrintMirrorMode = true to plot mirrored
* @param aData = a pointer to an optional data (NULL if not used)
*/
void
PrintPage
(
wxDC
*
aDC
,
bool
aPrint_Sheet_Ref
,
int
aPrintMask
,
bool
aPrintMirrorMode
,
void
*
aData
);
void
DrawBackGround
(
wxDC
*
DC
);
void
DrawAuxiliaryAxis
(
wxDC
*
DC
,
int
drawmode
);
void
OnEraseBackground
(
wxEraseEvent
&
event
);
...
...
pcbnew/dialog_SVG_print.cpp
View file @
d4bd033a
...
...
@@ -263,7 +263,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
SetLocaleTo_C_standard
();
// Switch the locale to standard C (needed
// to print floating point numbers like
// 1.3)
panel
->
PrintPage
(
&
dc
,
aPrint_Framet_Ref
,
m_PrintMaskLayer
,
false
);
panel
->
PrintPage
(
&
dc
,
aPrint_Framet_Ref
,
m_PrintMaskLayer
,
false
,
NULL
);
SetLocaleTo_Default
();
// revert to the current locale
screen
->
m_IsPrinting
=
false
;
panel
->
m_ClipBox
=
tmp
;
...
...
pcbnew/dialog_print_using_printer.cpp
View file @
d4bd033a
...
...
@@ -186,6 +186,9 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
m_Config
->
Read
(
OPTKEY_PRINT_SCALE
,
&
scale_idx
);
m_Config
->
Read
(
OPTKEY_PRINT_PAGE_FRAME
,
&
s_Parameters
.
m_Print_Sheet_Ref
,
1
);
m_Config
->
Read
(
OPTKEY_PRINT_MONOCHROME_MODE
,
&
s_Parameters
.
m_Print_Black_and_White
,
1
);
int
tmp
;
m_Config
->
Read
(
OPTKEY_PRINT_PADS_DRILL
,
&
tmp
,
PRINT_PARAMETERS
::
SMALL_DRILL_SHAPE
);
s_Parameters
.
m_DrillShapeOpt
=
(
PRINT_PARAMETERS
::
DrillShapeOptT
)
tmp
;
// Test for a reasonnable scale value. Set to 1 if problem
if
(
s_Parameters
.
m_XScaleAdjust
<
MIN_SCALE
||
...
...
@@ -220,6 +223,8 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
m_Exclude_Edges_Pcb
->
SetValue
(
m_ExcludeEdgeLayer
);
m_Print_Sheet_Ref
->
SetValue
(
s_Parameters
.
m_Print_Sheet_Ref
);
// Options to plot pads and vias holes
m_Drill_Shape_Opt
->
SetSelection
(
s_Parameters
.
m_DrillShapeOpt
);
if
(
s_Parameters
.
m_Print_Black_and_White
)
m_ModeColorOption
->
SetSelection
(
1
);
...
...
@@ -286,6 +291,7 @@ void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event )
m_Config
->
Write
(
OPTKEY_PRINT_SCALE
,
m_ScaleOption
->
GetSelection
()
);
m_Config
->
Write
(
OPTKEY_PRINT_PAGE_FRAME
,
s_Parameters
.
m_Print_Sheet_Ref
);
m_Config
->
Write
(
OPTKEY_PRINT_MONOCHROME_MODE
,
s_Parameters
.
m_Print_Black_and_White
);
m_Config
->
Write
(
OPTKEY_PRINT_PADS_DRILL
,
(
long
)
s_Parameters
.
m_DrillShapeOpt
);
wxString
layerKey
;
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
{
...
...
@@ -308,6 +314,9 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( )
s_Parameters
.
m_Print_Black_and_White
=
m_ModeColorOption
->
GetSelection
()
!=
0
;
s_Parameters
.
m_DrillShapeOpt
=
(
PRINT_PARAMETERS
::
DrillShapeOptT
)
m_Drill_Shape_Opt
->
GetSelection
();
if
(
m_PagesOption
)
s_Parameters
.
m_OptionPrintPage
=
m_PagesOption
->
GetSelection
()
!=
0
;
...
...
pcbnew/dialog_print_using_printer_base.cpp
View file @
d4bd033a
...
...
@@ -46,7 +46,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare
wxString
m_ScaleOptionChoices
[]
=
{
_
(
"fit in page"
),
_
(
"Scale 0.5"
),
_
(
"Scale 0.7"
),
_
(
"Approx. Scale 1"
),
_
(
"Accurate Scale 1"
),
_
(
"Scale 1.4"
),
_
(
"Scale 2"
),
_
(
"Scale 3"
),
_
(
"Scale 4"
)
};
int
m_ScaleOptionNChoices
=
sizeof
(
m_ScaleOptionChoices
)
/
sizeof
(
wxString
);
m_ScaleOption
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Approx. Scale:"
),
wxDefaultPosition
,
wxDefaultSize
,
m_ScaleOptionNChoices
,
m_ScaleOptionChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_ScaleOption
->
SetSelection
(
3
);
m_ScaleOption
->
SetSelection
(
4
);
bmiddleLeftSizer
->
Add
(
m_ScaleOption
,
0
,
wxALL
,
5
);
m_FineAdjustXscaleTitle
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"X Scale Adjust"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -89,7 +89,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare
m_Print_Sheet_Ref
->
SetToolTip
(
_
(
"Print (or not) the Frame references."
)
);
sbOptionsSizer
->
Add
(
m_Print_Sheet_Ref
,
0
,
wx
ALL
,
5
);
sbOptionsSizer
->
Add
(
m_Print_Sheet_Ref
,
0
,
wx
TOP
|
wxRIGHT
|
wxLEFT
,
5
);
m_Print_Mirror
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Mirror"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -97,6 +97,12 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare
bmiddleRightSizer
->
Add
(
sbOptionsSizer
,
0
,
wxEXPAND
|
wxALL
,
5
);
wxString
m_Drill_Shape_OptChoices
[]
=
{
_
(
"No drill mark"
),
_
(
"Small mark"
),
_
(
"Real drill"
)
};
int
m_Drill_Shape_OptNChoices
=
sizeof
(
m_Drill_Shape_OptChoices
)
/
sizeof
(
wxString
);
m_Drill_Shape_Opt
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Pads Drill Opt"
),
wxDefaultPosition
,
wxDefaultSize
,
m_Drill_Shape_OptNChoices
,
m_Drill_Shape_OptChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_Drill_Shape_Opt
->
SetSelection
(
1
);
bmiddleRightSizer
->
Add
(
m_Drill_Shape_Opt
,
0
,
wxALL
|
wxEXPAND
,
5
);
wxString
m_ModeColorOptionChoices
[]
=
{
_
(
"Color"
),
_
(
"Black and white"
)
};
int
m_ModeColorOptionNChoices
=
sizeof
(
m_ModeColorOptionChoices
)
/
sizeof
(
wxString
);
m_ModeColorOption
=
new
wxRadioBox
(
this
,
wxID_PRINT_MODE
,
_
(
"Print Mode"
),
wxDefaultPosition
,
wxDefaultSize
,
m_ModeColorOptionNChoices
,
m_ModeColorOptionChoices
,
1
,
wxRA_SPECIFY_COLS
);
...
...
@@ -105,30 +111,36 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare
bmiddleRightSizer
->
Add
(
m_ModeColorOption
,
0
,
wxALL
|
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bmiddleRightSizer
,
0
,
wxEXPAND
,
5
);
wxBoxSizer
*
bbuttonsSizer
;
bbuttonsSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
wxString
m_PagesOptionChoices
[]
=
{
_
(
"1 Page per Layer"
),
_
(
"Single page"
)
};
int
m_PagesOptionNChoices
=
sizeof
(
m_PagesOptionChoices
)
/
sizeof
(
wxString
);
m_PagesOption
=
new
wxRadioBox
(
this
,
wxID_PAGE_MODE
,
_
(
"Page Print"
),
wxDefaultPosition
,
wxDefaultSize
,
m_PagesOptionNChoices
,
m_PagesOptionChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_PagesOption
->
SetSelection
(
0
);
b
middleRight
Sizer
->
Add
(
m_PagesOption
,
0
,
wxALL
|
wxEXPAND
,
5
);
b
buttons
Sizer
->
Add
(
m_PagesOption
,
0
,
wxALL
|
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bmiddleRightSizer
,
0
,
wxEXPAND
,
5
);
wxBoxSizer
*
bbuttonsSizer
;
bbuttonsSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
bbuttonsSizer
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
5
);
m_buttonOption
=
new
wxButton
(
this
,
wxID_PRINT_OPTIONS
,
_
(
"Page Options"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bbuttonsSizer
->
Add
(
m_buttonOption
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bbuttonsSizer
->
Add
(
m_buttonOption
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
m_buttonPreview
=
new
wxButton
(
this
,
wxID_PREVIEW
,
_
(
"Preview"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bbuttonsSizer
->
Add
(
m_buttonPreview
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bbuttonsSizer
->
Add
(
m_buttonPreview
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
m_buttonPrint
=
new
wxButton
(
this
,
wxID_PRINT_ALL
,
_
(
"Print"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bbuttonsSizer
->
Add
(
m_buttonPrint
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bbuttonsSizer
->
Add
(
m_buttonPrint
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
m_buttonQuit
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"Close"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bbuttonsSizer
->
Add
(
m_buttonQuit
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bbuttonsSizer
->
Add
(
m_buttonQuit
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
bbuttonsSizer
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
bbuttonsSizer
,
0
,
wxALIGN_CENTER_VERTICAL
,
5
);
bMainSizer
->
Add
(
bbuttonsSizer
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxEXPAND
,
5
);
this
->
SetSizer
(
bMainSizer
);
this
->
Layout
();
...
...
pcbnew/dialog_print_using_printer_base.fbp
View file @
d4bd033a
This diff is collapsed.
Click to expand it.
pcbnew/dialog_print_using_printer_base.h
View file @
d4bd033a
...
...
@@ -55,13 +55,16 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog
wxTextCtrl
*
m_DialogPenWidth
;
wxCheckBox
*
m_Print_Sheet_Ref
;
wxCheckBox
*
m_Print_Mirror
;
wxRadioBox
*
m_Drill_Shape_Opt
;
wxRadioBox
*
m_ModeColorOption
;
wxRadioBox
*
m_PagesOption
;
wxButton
*
m_buttonOption
;
wxButton
*
m_buttonPreview
;
wxButton
*
m_buttonPrint
;
wxButton
*
m_buttonQuit
;
// Virtual event handlers, overide them in your derived class
virtual
void
OnCloseWindow
(
wxCloseEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnPrintSetup
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
...
...
@@ -71,7 +74,7 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog
public
:
DIALOG_PRINT_USING_PRINTER_base
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Print"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
551
,
31
4
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
DIALOG_PRINT_USING_PRINTER_base
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Print"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
551
,
31
5
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DIALOG_PRINT_USING_PRINTER_base
();
};
...
...
pcbnew/pcbplot.h
View file @
d4bd033a
...
...
@@ -15,6 +15,7 @@
#define OPTKEY_PRINT_MODULE_SCALE wxT( "PrintModuleScale" )
#define OPTKEY_PRINT_PAGE_FRAME wxT( "PrintPageFrame" )
#define OPTKEY_PRINT_MONOCHROME_MODE wxT( "PrintMonochrome" )
#define OPTKEY_PRINT_PADS_DRILL wxT( "PrintPadsDrillOpt" )
/* Conversion unit constants. */
/* Convert pcb dimension of 0.1 mil to PS units of inches. */
...
...
@@ -22,6 +23,9 @@
/* Convert dimension 0.1 mil -> HPGL units: */
#define SCALE_HPGL 0.102041
// Small drill marks diameter value (in internal value = 1/10000 inch)
#define SMALL_DRILL 150
/* Plot Options : */
class
PCB_Plot_Options
{
...
...
pcbnew/plot_rtn.cpp
View file @
d4bd033a
...
...
@@ -1003,7 +1003,6 @@ void WinEDA_BasePcbFrame::PlotDrillMark( PLOTTER* aPlotter,
GRTraceMode
aTraceMode
,
bool
aSmallDrillShape
)
{
const
int
SMALL_DRILL
=
150
;
wxPoint
pos
;
wxSize
diam
;
MODULE
*
Module
;
...
...
pcbnew/print_board_functions.cpp
View file @
d4bd033a
...
...
@@ -10,22 +10,29 @@
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "pcbplot.h"
#include "printout_controler.h"
#include "protos.h"
static
void
Print_Module
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
MODULE
*
Module
,
int
draw_mode
,
int
masklayer
);
static
void
Print_Module
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
MODULE
*
aModule
,
int
aDraw_mode
,
int
aMasklayer
,
PRINT_PARAMETERS
::
DrillShapeOptT
aDrillShapeOpt
);
/** Function PrintPage
* Used to print the board (on printer, or when creating SVF files).
* Print the board, but only layers allowed by aPrintMaskLayer
* ( printmasklayer is a 32 bits mask: bit n = 1 -> layer n is printed)
* Print the board, but only layers allowed by aPrintMaskLayer
* @param aDC = the print device context
* @param aPrint_Sheet_Ref = true to print frame references
* @param aPrint_Sheet_Ref = a 32 bits mask: bit n = 1 -> layer n is printed
* @param aPrintMirrorMode = true to plot mirrored
* @param aData = a pointer to an optional data (NULL if not used)
*/
void
WinEDA_DrawPanel
::
PrintPage
(
wxDC
*
aDC
,
bool
aPrint_Sheet_Ref
,
int
aPrintMaskLayer
,
bool
aPrintMirrorMode
)
bool
aPrintMirrorMode
,
void
*
aData
)
{
MODULE
*
Module
;
int
drawmode
=
GR_COPY
;
...
...
@@ -33,6 +40,11 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC,
TRACK
*
pt_piste
;
WinEDA_BasePcbFrame
*
frame
=
(
WinEDA_BasePcbFrame
*
)
m_Parent
;
BOARD
*
Pcb
=
frame
->
GetBoard
();
PRINT_PARAMETERS
*
printParameters
=
(
PRINT_PARAMETERS
*
)
aData
;
// can be null
PRINT_PARAMETERS
::
DrillShapeOptT
drillShapeOpt
=
PRINT_PARAMETERS
::
FULL_DRILL_SHAPE
;
if
(
printParameters
)
drillShapeOpt
=
printParameters
->
m_DrillShapeOpt
;
save_opt
=
DisplayOpt
;
if
(
aPrintMaskLayer
&
ALL_CU_LAYERS
)
...
...
@@ -101,14 +113,11 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC,
int
rayon
=
pt_piste
->
m_Width
>>
1
;
int
color
=
g_DesignSettings
.
m_ViaColor
[
pt_piste
->
m_Shape
];
GRSetDrawMode
(
aDC
,
drawmode
);
GRFilledCircle
(
&
m_ClipBox
,
aDC
,
GRFilledCircle
(
&
m_ClipBox
,
aDC
,
pt_piste
->
m_Start
.
x
,
pt_piste
->
m_Start
.
y
,
rayon
,
0
,
color
,
color
);
0
,
color
,
color
);
}
else
pt_piste
->
Draw
(
this
,
aDC
,
drawmode
);
...
...
@@ -138,36 +147,38 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC,
Module
=
(
MODULE
*
)
Pcb
->
m_Modules
;
for
(
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
{
Print_Module
(
this
,
aDC
,
Module
,
drawmode
,
aPrintMaskLayer
);
Print_Module
(
this
,
aDC
,
Module
,
drawmode
,
aPrintMaskLayer
,
drillShapeOpt
);
}
/* Print via holes in bg color: Not sure it is good for buried or blind
* vias */
pt_piste
=
Pcb
->
m_Track
;
int
color
=
g_DrawBgColor
;
bool
blackpenstate
=
GetGRForceBlackPenState
();
GRForceBlackPen
(
false
);
GRSetDrawMode
(
aDC
,
GR_COPY
);
for
(
;
pt_piste
!=
NULL
;
pt_piste
=
pt_piste
->
Next
()
)
if
(
drillShapeOpt
!=
PRINT_PARAMETERS
::
NO_DRILL_SHAPE
)
{
if
(
(
aPrintMaskLayer
&
pt_piste
->
ReturnMaskLayer
()
)
==
0
)
continue
;
if
(
pt_piste
->
Type
()
==
TYPE_VIA
)
/* VIA encountered. */
pt_piste
=
Pcb
->
m_Track
;
int
color
=
g_DrawBgColor
;
bool
blackpenstate
=
GetGRForceBlackPenState
();
GRForceBlackPen
(
false
);
GRSetDrawMode
(
aDC
,
GR_COPY
);
for
(
;
pt_piste
!=
NULL
;
pt_piste
=
pt_piste
->
Next
()
)
{
int
rayon
=
pt_piste
->
GetDrillValue
()
/
2
;
GRFilledCircle
(
&
m_ClipBox
,
aDC
,
pt_piste
->
m_Start
.
x
,
pt_piste
->
m_Start
.
y
,
rayon
,
0
,
color
,
color
);
if
(
(
aPrintMaskLayer
&
pt_piste
->
ReturnMaskLayer
()
)
==
0
)
continue
;
if
(
pt_piste
->
Type
()
==
TYPE_VIA
)
/* VIA encountered. */
{
int
diameter
;
if
(
drillShapeOpt
==
PRINT_PARAMETERS
::
SMALL_DRILL_SHAPE
)
diameter
=
min
(
SMALL_DRILL
,
pt_piste
->
GetDrillValue
());
else
diameter
=
pt_piste
->
GetDrillValue
();
GRFilledCircle
(
&
m_ClipBox
,
aDC
,
pt_piste
->
m_Start
.
x
,
pt_piste
->
m_Start
.
y
,
diameter
/
2
,
0
,
color
,
color
);
}
}
GRForceBlackPen
(
blackpenstate
);
}
GRForceBlackPen
(
blackpenstate
);
if
(
aPrint_Sheet_Ref
)
m_Parent
->
TraceWorkSheet
(
aDC
,
GetScreen
(),
10
);
...
...
@@ -181,8 +192,9 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC,
}
static
void
Print_Module
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
MODULE
*
Module
,
int
draw_mode
,
int
masklayer
)
static
void
Print_Module
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
MODULE
*
aModule
,
int
aDraw_mode
,
int
aMasklayer
,
PRINT_PARAMETERS
::
DrillShapeOptT
aDrillShapeOpt
)
{
D_PAD
*
pt_pad
;
EDA_BaseStruct
*
PtStruct
;
...
...
@@ -190,42 +202,60 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC,
int
mlayer
;
/* Print pads */
pt_pad
=
Module
->
m_Pads
;
pt_pad
=
a
Module
->
m_Pads
;
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
pt_pad
->
Next
()
)
{
if
(
(
pt_pad
->
m_Masque_Layer
&
m
asklayer
)
==
0
)
if
(
(
pt_pad
->
m_Masque_Layer
&
aM
asklayer
)
==
0
)
continue
;
// Usually we draw pads in sketch mode on non copper layers:
if
(
(
m
asklayer
&
ALL_CU_LAYERS
)
==
0
)
if
(
(
aM
asklayer
&
ALL_CU_LAYERS
)
==
0
)
{
int
tmp_fill
=
(
(
WinEDA_BasePcbFrame
*
)
p
anel
->
GetParent
()
)
->
m_DisplayPadFill
;
(
(
WinEDA_BasePcbFrame
*
)
aP
anel
->
GetParent
()
)
->
m_DisplayPadFill
;
// Switch in sketch mode
(
(
WinEDA_BasePcbFrame
*
)
p
anel
->
GetParent
()
)
->
m_DisplayPadFill
=
0
;
pt_pad
->
Draw
(
panel
,
DC
,
d
raw_mode
);
(
(
WinEDA_BasePcbFrame
*
)
p
anel
->
GetParent
()
)
->
m_DisplayPadFill
=
(
(
WinEDA_BasePcbFrame
*
)
aP
anel
->
GetParent
()
)
->
m_DisplayPadFill
=
0
;
pt_pad
->
Draw
(
aPanel
,
aDC
,
aD
raw_mode
);
(
(
WinEDA_BasePcbFrame
*
)
aP
anel
->
GetParent
()
)
->
m_DisplayPadFill
=
tmp_fill
;
}
else
// on copper layer, draw pads according to current options
pt_pad
->
Draw
(
panel
,
DC
,
draw_mode
);
{
// Manage hole according to the print drill option
wxSize
drill_tmp
=
pt_pad
->
m_Drill
;
switch
(
aDrillShapeOpt
)
{
case
PRINT_PARAMETERS
:
:
NO_DRILL_SHAPE
:
pt_pad
->
m_Drill
=
wxSize
(
0
,
0
);
break
;
case
PRINT_PARAMETERS
:
:
SMALL_DRILL_SHAPE
:
pt_pad
->
m_Drill
.
x
=
MIN
(
SMALL_DRILL
,
pt_pad
->
m_Drill
.
x
);
pt_pad
->
m_Drill
.
y
=
MIN
(
SMALL_DRILL
,
pt_pad
->
m_Drill
.
y
);
break
;
case
PRINT_PARAMETERS
:
:
FULL_DRILL_SHAPE
:
// Do nothing
break
;
}
pt_pad
->
Draw
(
aPanel
,
aDC
,
aDraw_mode
);
pt_pad
->
m_Drill
=
drill_tmp
;
}
}
/* Print footprint graphic shapes */
PtStruct
=
Module
->
m_Drawings
;
mlayer
=
g_TabOneLayerMask
[
Module
->
GetLayer
()];
if
(
Module
->
GetLayer
()
==
LAYER_N_BACK
)
PtStruct
=
a
Module
->
m_Drawings
;
mlayer
=
g_TabOneLayerMask
[
a
Module
->
GetLayer
()];
if
(
a
Module
->
GetLayer
()
==
LAYER_N_BACK
)
mlayer
=
SILKSCREEN_LAYER_BACK
;
else
if
(
Module
->
GetLayer
()
==
LAYER_N_FRONT
)
else
if
(
a
Module
->
GetLayer
()
==
LAYER_N_FRONT
)
mlayer
=
SILKSCREEN_LAYER_FRONT
;
if
(
mlayer
&
m
asklayer
)
if
(
mlayer
&
aM
asklayer
)
{
if
(
!
Module
->
m_Reference
->
m_NoShow
)
Module
->
m_Reference
->
Draw
(
panel
,
DC
,
d
raw_mode
);
if
(
!
Module
->
m_Value
->
m_NoShow
)
Module
->
m_Value
->
Draw
(
panel
,
DC
,
d
raw_mode
);
if
(
!
a
Module
->
m_Reference
->
m_NoShow
)
aModule
->
m_Reference
->
Draw
(
aPanel
,
aDC
,
aD
raw_mode
);
if
(
!
a
Module
->
m_Value
->
m_NoShow
)
aModule
->
m_Value
->
Draw
(
aPanel
,
aDC
,
aD
raw_mode
);
}
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Next
()
)
...
...
@@ -233,19 +263,19 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC,
switch
(
PtStruct
->
Type
()
)
{
case
TYPE_TEXTE_MODULE
:
if
(
(
mlayer
&
m
asklayer
)
==
0
)
if
(
(
mlayer
&
aM
asklayer
)
==
0
)
break
;
TextMod
=
(
TEXTE_MODULE
*
)
PtStruct
;
TextMod
->
Draw
(
panel
,
DC
,
d
raw_mode
);
TextMod
->
Draw
(
aPanel
,
aDC
,
aD
raw_mode
);
break
;
case
TYPE_EDGE_MODULE
:
{
EDGE_MODULE
*
edge
=
(
EDGE_MODULE
*
)
PtStruct
;
if
(
(
g_TabOneLayerMask
[
edge
->
GetLayer
()]
&
m
asklayer
)
==
0
)
if
(
(
g_TabOneLayerMask
[
edge
->
GetLayer
()]
&
aM
asklayer
)
==
0
)
break
;
edge
->
Draw
(
panel
,
DC
,
d
raw_mode
);
edge
->
Draw
(
aPanel
,
aDC
,
aD
raw_mode
);
break
;
}
...
...
pcbnew/printout_controler.cpp
View file @
d4bd033a
...
...
@@ -31,6 +31,7 @@ PRINT_PARAMETERS::PRINT_PARAMETERS()
m_PageCount
=
1
;
m_ForceCentered
=
false
;
m_Flags
=
0
;
m_DrillShapeOpt
=
PRINT_PARAMETERS
::
SMALL_DRILL_SHAPE
;
}
...
...
@@ -282,13 +283,13 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage()
* 2 - Plot in OR mode on black "local" background
*/
if
(
!
m_PrintParams
.
m_Print_Black_and_White
)
{
{
// Creates a "local" black background
GRForceBlackPen
(
true
);
panel
->
PrintPage
(
dc
,
0
,
m_PrintParams
.
m_PrintMaskLayer
,
printMirror
);
panel
->
PrintPage
(
dc
,
0
,
m_PrintParams
.
m_PrintMaskLayer
,
printMirror
,
&
m_PrintParams
);
GRForceBlackPen
(
false
);
}
panel
->
PrintPage
(
dc
,
0
,
m_PrintParams
.
m_PrintMaskLayer
,
printMirror
);
panel
->
PrintPage
(
dc
,
0
,
m_PrintParams
.
m_PrintMaskLayer
,
printMirror
,
&
m_PrintParams
);
g_DrawBgColor
=
bg_color
;
m_Parent
->
GetBaseScreen
()
->
m_IsPrinting
=
false
;
...
...
pcbnew/printout_controler.h
View file @
d4bd033a
...
...
@@ -31,6 +31,13 @@ public:
bool
m_ForceCentered
;
// Forge plot origin to page centre (used in modedit)
int
m_Flags
;
// auxiliary variable: can be used to pass some other info
enum
DrillShapeOptT
{
NO_DRILL_SHAPE
=
0
,
SMALL_DRILL_SHAPE
=
1
,
FULL_DRILL_SHAPE
=
2
};
DrillShapeOptT
m_DrillShapeOpt
;
// Options to print pads and vias holes
public
:
PRINT_PARAMETERS
();
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment