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
137066e5
Commit
137066e5
authored
Aug 30, 2012
by
Lorenzo Marcantonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fully encapsulated with accessors PCB_PLOT_PARAMS
parent
7cef5395
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
460 additions
and
343 deletions
+460
-343
dialog_gendrill.cpp
pcbnew/dialogs/dialog_gendrill.cpp
+4
-4
dialog_print_for_modedit.cpp
pcbnew/dialogs/dialog_print_for_modedit.cpp
+3
-3
dialog_print_using_printer.cpp
pcbnew/dialogs/dialog_print_using_printer.cpp
+3
-3
gen_drill_report_files.cpp
pcbnew/gen_drill_report_files.cpp
+2
-2
pcb_plot_params.cpp
pcbnew/pcb_plot_params.cpp
+117
-101
pcb_plot_params.h
pcbnew/pcb_plot_params.h
+166
-75
pcbplot.cpp
pcbnew/pcbplot.cpp
+112
-95
plot_rtn.cpp
pcbnew/plot_rtn.cpp
+17
-17
plotdxf.cpp
pcbnew/plotdxf.cpp
+2
-2
plotgerb.cpp
pcbnew/plotgerb.cpp
+4
-11
plothpgl.cpp
pcbnew/plothpgl.cpp
+17
-17
plotps.cpp
pcbnew/plotps.cpp
+13
-13
No files found.
pcbnew/dialogs/dialog_gendrill.cpp
View file @
137066e5
...
...
@@ -138,11 +138,11 @@ void DIALOG_GENDRILL::InitDisplayParams()
m_MicroViaDrillValue
->
SetLabel
(
_
(
"Use Netclasses values"
)
);
msg
.
Empty
();
msg
<<
plot_opts
.
m_HPGLPenNum
;
msg
<<
plot_opts
.
GetHPGLPenNum
()
;
m_PenNum
->
SetValue
(
msg
);
msg
.
Empty
();
msg
<<
plot_opts
.
m_HPGLPenSpeed
;
msg
<<
plot_opts
.
GetHPGLPenSpeed
()
;
m_PenSpeed
->
SetValue
(
msg
);
// See if we have some buried vias or/and microvias, and display
...
...
@@ -308,12 +308,12 @@ void DIALOG_GENDRILL::SetParams()
msg
=
m_PenSpeed
->
GetValue
();
if
(
msg
.
ToLong
(
&
ltmp
)
)
plot_opts
.
m_HPGLPenSpeed
=
ltmp
;
plot_opts
.
SetHPGLPenSpeed
(
ltmp
)
;
msg
=
m_PenNum
->
GetValue
();
if
(
msg
.
ToLong
(
&
ltmp
)
)
plot_opts
.
m_HPGLPenNum
=
ltmp
;
plot_opts
.
SetHPGLPenNum
(
ltmp
)
;
if
(
m_Choice_Drill_Offset
->
GetSelection
()
==
0
)
m_FileDrillOffset
=
wxPoint
(
0
,
0
);
...
...
pcbnew/dialogs/dialog_print_for_modedit.cpp
View file @
137066e5
...
...
@@ -191,9 +191,9 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick( wxCommandEvent& event )
s_Parameters
.
m_Print_Black_and_White
=
m_ModeColorOption
->
GetSelection
();
s_Parameters
.
m_PrintScale
=
s_ScaleList
[
m_ScaleOption
->
GetSelection
()];
plot_opts
.
m_FineScaleAdjustX
=
s_Parameters
.
m_XScaleAdjust
;
plot_opts
.
m_FineScaleAdjustY
=
s_Parameters
.
m_YScaleAdjust
;
plot_opts
.
m_PlotScale
=
s_Parameters
.
m_PrintScale
;
plot_opts
.
SetFineScaleAdjustX
(
s_Parameters
.
m_XScaleAdjust
)
;
plot_opts
.
SetFineScaleAdjustY
(
s_Parameters
.
m_YScaleAdjust
)
;
plot_opts
.
SetScale
(
s_Parameters
.
m_PrintScale
)
;
m_parent
->
SetPlotSettings
(
plot_opts
);
...
...
pcbnew/dialogs/dialog_print_using_printer.cpp
View file @
137066e5
...
...
@@ -353,7 +353,7 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( )
int
idx
=
m_ScaleOption
->
GetSelection
();
s_Parameters
.
m_PrintScale
=
s_ScaleList
[
idx
];
plot_opts
.
m_PlotScale
=
s_Parameters
.
m_PrintScale
;
plot_opts
.
SetScale
(
s_Parameters
.
m_PrintScale
)
;
if
(
m_FineAdjustXscaleOpt
)
{
...
...
@@ -371,8 +371,8 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( )
m_FineAdjustYscaleOpt
->
GetValue
().
ToDouble
(
&
s_Parameters
.
m_YScaleAdjust
);
}
plot_opts
.
m_FineScaleAdjustX
=
s_Parameters
.
m_XScaleAdjust
;
plot_opts
.
m_FineScaleAdjustY
=
s_Parameters
.
m_YScaleAdjust
;
plot_opts
.
SetFineScaleAdjustX
(
s_Parameters
.
m_XScaleAdjust
)
;
plot_opts
.
SetFineScaleAdjustY
(
s_Parameters
.
m_YScaleAdjust
)
;
m_parent
->
SetPlotSettings
(
plot_opts
);
...
...
pcbnew/gen_drill_report_files.cpp
View file @
137066e5
...
...
@@ -62,8 +62,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
{
HPGL_PLOTTER
*
hpgl_plotter
=
new
HPGL_PLOTTER
;
plotter
=
hpgl_plotter
;
hpgl_plotter
->
SetPenNumber
(
plot_opts
.
m_HPGLPenNum
);
hpgl_plotter
->
SetPenSpeed
(
plot_opts
.
m_HPGLPenSpeed
);
hpgl_plotter
->
SetPenNumber
(
plot_opts
.
GetHPGLPenNum
()
);
hpgl_plotter
->
SetPenSpeed
(
plot_opts
.
GetHPGLPenSpeed
()
);
hpgl_plotter
->
SetPenOverlap
(
0
);
plotter
->
SetPageSettings
(
aSheet
);
plotter
->
SetViewport
(
offset
,
IU_PER_DECIMILS
,
scale
,
false
);
...
...
pcbnew/pcb_plot_params.cpp
View file @
137066e5
...
...
@@ -73,47 +73,49 @@ static bool setInt( int* aInt, int aValue, int aMin, int aMax )
return
(
temp
==
aValue
);
}
// PCB_PLOT_PARAMS
PCB_PLOT_PARAMS
::
PCB_PLOT_PARAMS
()
{
layerSelection
=
LAYER_BACK
|
LAYER_FRONT
m_layerSelection
=
LAYER_BACK
|
LAYER_FRONT
|
SILKSCREEN_LAYER_FRONT
|
SILKSCREEN_LAYER_BACK
;
useGerberExtensions
=
true
;
m_SkipNPTH_Pads
=
false
;
m_ExcludeEdgeLayer
=
true
;
m_PlotLineWidth
=
g_DrawDefaultLineThickness
;
m_PlotFrameRef
=
false
;
m_PlotViaOnMaskLayer
=
false
;
m_PlotMode
=
FILLED
;
useAuxOrigin
=
false
;
m_useGerberExtensions
=
true
;
m_excludeEdgeLayer
=
true
;
m_lineWidth
=
g_DrawDefaultLineThickness
;
m_plotFrameRef
=
false
;
m_plotViaOnMaskLayer
=
false
;
m_mode
=
FILLED
;
m_useAuxOrigin
=
false
;
m_HPGLPenNum
=
1
;
m_HPGLPenSpeed
=
20
;
// this param is always in cm/s
m_HPGLPenDiam
=
15
;
// in mils
m_HPGLPenOvr
=
2
;
// in mils
m_PlotPSColorOpt
=
true
;
m_PlotPSNegative
=
false
;
psA4Output
=
false
;
m_PlotReference
=
true
;
m_PlotValue
=
true
;
m_PlotTextOther
=
true
;
m_PlotInvisibleTexts
=
false
;
m_PlotPadsOnSilkLayer
=
false
;
subtractMaskFromSilk
=
false
;
m_PlotFormat
=
PLOT_FORMAT_GERBER
;
m_PlotMirror
=
false
;
m_DrillShapeOpt
=
SMALL_DRILL_SHAPE
;
m_AutoScale
=
false
;
m_PlotScale
=
1.0
;
scaleSelection
=
1
;
m_FineScaleAdjustX
=
1.0
;
m_FineScaleAdjustY
=
1.0
;
m_FineWidthAdjust
=
0.
;
outputDirectory
=
wxT
(
""
);
m_negative
=
false
;
m_A4Output
=
false
;
m_plotReference
=
true
;
m_plotValue
=
true
;
m_plotOtherText
=
true
;
m_plotInvisibleText
=
false
;
m_plotPadsOnSilkLayer
=
false
;
m_subtractMaskFromSilk
=
false
;
m_format
=
PLOT_FORMAT_GERBER
;
m_mirror
=
false
;
m_drillMarks
=
SMALL_DRILL_SHAPE
;
m_autoScale
=
false
;
m_scale
=
1.0
;
m_scaleSelection
=
1
;
m_fineScaleAdjustX
=
1.0
;
m_fineScaleAdjustY
=
1.0
;
m_widthAdjust
=
0.
;
m_outputDirectory
.
clear
();
m_color
=
BLACK
;
m_referenceColor
=
BLACK
;
m_valueColor
=
BLACK
;
m_textMode
=
PLOTTEXTMODE_PHANTOM
;
}
// PLEASE NOTE: only plot dialog options are processed
void
PCB_PLOT_PARAMS
::
Format
(
OUTPUTFORMATTER
*
aFormatter
,
int
aNestLevel
,
int
aControl
)
const
throw
(
IO_ERROR
)
{
...
...
@@ -122,21 +124,21 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
aFormatter
->
Print
(
aNestLevel
,
"(%s
\n
"
,
getTokenName
(
T_pcbplotparams
)
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %ld)
\n
"
,
getTokenName
(
T_layerselection
),
l
ayerSelection
);
l
ong
(
m_layerSelection
)
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_usegerberextensions
),
useGerberExtensions
?
trueStr
:
falseStr
);
m_
useGerberExtensions
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_excludeedgelayer
),
m_
E
xcludeEdgeLayer
?
trueStr
:
falseStr
);
m_
e
xcludeEdgeLayer
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_linewidth
),
m_
PlotL
ineWidth
);
m_
l
ineWidth
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_plotframeref
),
m_
P
lotFrameRef
?
trueStr
:
falseStr
);
m_
p
lotFrameRef
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_viasonmask
),
m_
P
lotViaOnMaskLayer
?
trueStr
:
falseStr
);
m_
p
lotViaOnMaskLayer
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_mode
),
m_
PlotM
ode
);
m_
m
ode
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_useauxorigin
),
useAuxOrigin
?
trueStr
:
falseStr
);
m_
useAuxOrigin
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_hpglpennumber
),
m_HPGLPenNum
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_hpglpenspeed
),
...
...
@@ -145,34 +147,32 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
m_HPGLPenDiam
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_hpglpenoverlay
),
m_HPGLPenOvr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_pscolor
),
m_PlotPSColorOpt
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_psnegative
),
m_
PlotPSN
egative
?
trueStr
:
falseStr
);
m_
n
egative
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_psa4output
),
ps
A4Output
?
trueStr
:
falseStr
);
m_
A4Output
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_plotreference
),
m_
P
lotReference
?
trueStr
:
falseStr
);
m_
p
lotReference
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_plotvalue
),
m_
P
lotValue
?
trueStr
:
falseStr
);
m_
p
lotValue
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_plotothertext
),
m_
PlotTextOther
?
trueStr
:
falseStr
);
m_
plotOtherText
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_plotinvisibletext
),
m_
PlotInvisibleTexts
?
trueStr
:
falseStr
);
m_
plotInvisibleText
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_padsonsilk
),
m_
P
lotPadsOnSilkLayer
?
trueStr
:
falseStr
);
m_
p
lotPadsOnSilkLayer
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_subtractmaskfromsilk
),
subtractMaskFromSilk
?
trueStr
:
falseStr
);
m_
subtractMaskFromSilk
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_outputformat
),
m_
PlotF
ormat
);
m_
f
ormat
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_mirror
),
m_
PlotM
irror
?
trueStr
:
falseStr
);
m_
m
irror
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_drillshape
),
m_
DrillShapeOpt
);
m_
drillMarks
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_scaleselection
),
scaleSelection
);
m_
scaleSelection
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)"
,
getTokenName
(
T_outputdirectory
),
aFormatter
->
Quotew
(
outputDirectory
).
c_str
()
);
aFormatter
->
Quotew
(
m_
outputDirectory
).
c_str
()
);
aFormatter
->
Print
(
0
,
")
\n
"
);
}
...
...
@@ -185,21 +185,21 @@ void PCB_PLOT_PARAMS::Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR,
bool
PCB_PLOT_PARAMS
::
operator
==
(
const
PCB_PLOT_PARAMS
&
aPcbPlotParams
)
const
{
if
(
layerSelection
!=
aPcbPlotParams
.
layerSelection
)
if
(
m_layerSelection
!=
aPcbPlotParams
.
m_
layerSelection
)
return
false
;
if
(
useGerberExtensions
!=
aPcbPlotParams
.
useGerberExtensions
)
if
(
m_useGerberExtensions
!=
aPcbPlotParams
.
m_
useGerberExtensions
)
return
false
;
if
(
m_
ExcludeEdgeLayer
!=
aPcbPlotParams
.
m_E
xcludeEdgeLayer
)
if
(
m_
excludeEdgeLayer
!=
aPcbPlotParams
.
m_e
xcludeEdgeLayer
)
return
false
;
if
(
m_
PlotLineWidth
!=
aPcbPlotParams
.
m_PlotL
ineWidth
)
if
(
m_
lineWidth
!=
aPcbPlotParams
.
m_l
ineWidth
)
return
false
;
if
(
m_
PlotFrameRef
!=
aPcbPlotParams
.
m_P
lotFrameRef
)
if
(
m_
plotFrameRef
!=
aPcbPlotParams
.
m_p
lotFrameRef
)
return
false
;
if
(
m_
PlotViaOnMaskLayer
!=
aPcbPlotParams
.
m_P
lotViaOnMaskLayer
)
if
(
m_
plotViaOnMaskLayer
!=
aPcbPlotParams
.
m_p
lotViaOnMaskLayer
)
return
false
;
if
(
m_
PlotMode
!=
aPcbPlotParams
.
m_PlotM
ode
)
if
(
m_
mode
!=
aPcbPlotParams
.
m_m
ode
)
return
false
;
if
(
useAuxOrigin
!=
aPcbPlotParams
.
useAuxOrigin
)
if
(
m_useAuxOrigin
!=
aPcbPlotParams
.
m_
useAuxOrigin
)
return
false
;
if
(
m_HPGLPenNum
!=
aPcbPlotParams
.
m_HPGLPenNum
)
return
false
;
...
...
@@ -209,33 +209,49 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
return
false
;
if
(
m_HPGLPenOvr
!=
aPcbPlotParams
.
m_HPGLPenOvr
)
return
false
;
if
(
m_PlotPSColorOpt
!=
aPcbPlotParams
.
m_PlotPSColorOpt
)
if
(
m_negative
!=
aPcbPlotParams
.
m_negative
)
return
false
;
if
(
m_A4Output
!=
aPcbPlotParams
.
m_A4Output
)
return
false
;
if
(
m_plotReference
!=
aPcbPlotParams
.
m_plotReference
)
return
false
;
if
(
m_plotValue
!=
aPcbPlotParams
.
m_plotValue
)
return
false
;
if
(
m_plotOtherText
!=
aPcbPlotParams
.
m_plotOtherText
)
return
false
;
if
(
m_plotInvisibleText
!=
aPcbPlotParams
.
m_plotInvisibleText
)
return
false
;
if
(
m_plotPadsOnSilkLayer
!=
aPcbPlotParams
.
m_plotPadsOnSilkLayer
)
return
false
;
if
(
m_subtractMaskFromSilk
!=
aPcbPlotParams
.
m_subtractMaskFromSilk
)
return
false
;
if
(
m_format
!=
aPcbPlotParams
.
m_format
)
return
false
;
if
(
m_
PlotPSNegative
!=
aPcbPlotParams
.
m_PlotPSNegative
)
if
(
m_
mirror
!=
aPcbPlotParams
.
m_mirror
)
return
false
;
if
(
psA4Output
!=
aPcbPlotParams
.
psA4Output
)
if
(
m_drillMarks
!=
aPcbPlotParams
.
m_drillMarks
)
return
false
;
if
(
m_
PlotReference
!=
aPcbPlotParams
.
m_PlotReference
)
if
(
m_
scaleSelection
!=
aPcbPlotParams
.
m_scaleSelection
)
return
false
;
if
(
m_
PlotValue
!=
aPcbPlotParams
.
m_PlotValu
e
)
if
(
m_
autoScale
!=
aPcbPlotParams
.
m_autoScal
e
)
return
false
;
if
(
m_
PlotTextOther
!=
aPcbPlotParams
.
m_PlotTextOther
)
if
(
m_
scale
!=
aPcbPlotParams
.
m_scale
)
return
false
;
if
(
m_
PlotInvisibleTexts
!=
aPcbPlotParams
.
m_PlotInvisibleTexts
)
if
(
m_
fineScaleAdjustX
!=
aPcbPlotParams
.
m_fineScaleAdjustX
)
return
false
;
if
(
m_
PlotPadsOnSilkLayer
!=
aPcbPlotParams
.
m_PlotPadsOnSilkLayer
)
if
(
m_
fineScaleAdjustY
!=
aPcbPlotParams
.
m_fineScaleAdjustY
)
return
false
;
if
(
subtractMaskFromSilk
!=
aPcbPlotParams
.
subtractMaskFromSilk
)
if
(
m_widthAdjust
!=
aPcbPlotParams
.
m_widthAdjust
)
return
false
;
if
(
m_
PlotFormat
!=
aPcbPlotParams
.
m_PlotFormat
)
if
(
m_
color
!=
aPcbPlotParams
.
m_color
)
return
false
;
if
(
m_
PlotMirror
!=
aPcbPlotParams
.
m_PlotMirr
or
)
if
(
m_
referenceColor
!=
aPcbPlotParams
.
m_referenceCol
or
)
return
false
;
if
(
m_
DrillShapeOpt
!=
aPcbPlotParams
.
m_DrillShapeOpt
)
if
(
m_
valueColor
!=
aPcbPlotParams
.
m_valueColor
)
return
false
;
if
(
scaleSelection
!=
aPcbPlotParams
.
scaleSelection
)
if
(
m_textMode
!=
aPcbPlotParams
.
m_textMode
)
return
false
;
if
(
!
outputDirectory
.
IsSameAs
(
aPcbPlotParams
.
outputDirectory
)
)
if
(
!
m_outputDirectory
.
IsSameAs
(
aPcbPlotParams
.
m_
outputDirectory
)
)
return
false
;
return
true
;
}
...
...
@@ -247,27 +263,27 @@ bool PCB_PLOT_PARAMS::operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
}
bool
PCB_PLOT_PARAMS
::
SetH
pgl
PenDiameter
(
int
aValue
)
bool
PCB_PLOT_PARAMS
::
SetH
PGL
PenDiameter
(
int
aValue
)
{
return
setInt
(
&
m_HPGLPenDiam
,
aValue
,
HPGL_PEN_DIAMETER_MIN
,
HPGL_PEN_DIAMETER_MAX
);
}
bool
PCB_PLOT_PARAMS
::
SetH
pgl
PenSpeed
(
int
aValue
)
bool
PCB_PLOT_PARAMS
::
SetH
PGL
PenSpeed
(
int
aValue
)
{
return
setInt
(
&
m_HPGLPenSpeed
,
aValue
,
HPGL_PEN_SPEED_MIN
,
HPGL_PEN_SPEED_MAX
);
}
bool
PCB_PLOT_PARAMS
::
SetH
pgl
PenOverlay
(
int
aValue
)
bool
PCB_PLOT_PARAMS
::
SetH
PGL
PenOverlay
(
int
aValue
)
{
return
setInt
(
&
m_HPGLPenOvr
,
aValue
,
HPGL_PEN_OVERLAP_MIN
,
HPGL_PEN_OVERLAP_MAX
);
}
bool
PCB_PLOT_PARAMS
::
Set
Plot
LineWidth
(
int
aValue
)
bool
PCB_PLOT_PARAMS
::
SetLineWidth
(
int
aValue
)
{
return
setInt
(
&
m_
PlotL
ineWidth
,
aValue
,
PLOT_LINEWIDTH_MIN
,
PLOT_LINEWIDTH_MAX
);
return
setInt
(
&
m_
l
ineWidth
,
aValue
,
PLOT_LINEWIDTH_MIN
,
PLOT_LINEWIDTH_MAX
);
}
...
...
@@ -305,32 +321,32 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_
token
=
NextTok
();
if
(
token
!=
T_NUMBER
)
Expecting
(
T_NUMBER
);
aPcbPlotParams
->
layerSelection
=
atol
(
CurText
()
);
aPcbPlotParams
->
m_
layerSelection
=
atol
(
CurText
()
);
break
;
case
T_usegerberextensions
:
aPcbPlotParams
->
useGerberExtensions
=
ParseBool
();
aPcbPlotParams
->
m_
useGerberExtensions
=
ParseBool
();
break
;
case
T_psa4output
:
aPcbPlotParams
->
ps
A4Output
=
ParseBool
();
aPcbPlotParams
->
m_
A4Output
=
ParseBool
();
break
;
case
T_excludeedgelayer
:
aPcbPlotParams
->
m_
E
xcludeEdgeLayer
=
ParseBool
();
aPcbPlotParams
->
m_
e
xcludeEdgeLayer
=
ParseBool
();
break
;
case
T_linewidth
:
aPcbPlotParams
->
m_
PlotL
ineWidth
=
ParseInt
(
PLOT_LINEWIDTH_MIN
,
aPcbPlotParams
->
m_
l
ineWidth
=
ParseInt
(
PLOT_LINEWIDTH_MIN
,
PLOT_LINEWIDTH_MAX
);
break
;
case
T_plotframeref
:
aPcbPlotParams
->
m_
P
lotFrameRef
=
ParseBool
();
aPcbPlotParams
->
m_
p
lotFrameRef
=
ParseBool
();
break
;
case
T_viasonmask
:
aPcbPlotParams
->
m_
P
lotViaOnMaskLayer
=
ParseBool
();
aPcbPlotParams
->
m_
p
lotViaOnMaskLayer
=
ParseBool
();
break
;
case
T_mode
:
aPcbPlotParams
->
m_
PlotMode
=
(
EDA_DRAW_MODE_T
)
ParseInt
(
0
,
2
);
aPcbPlotParams
->
m_
mode
=
static_cast
<
EDA_DRAW_MODE_T
>
(
ParseInt
(
0
,
2
)
);
break
;
case
T_useauxorigin
:
aPcbPlotParams
->
useAuxOrigin
=
ParseBool
();
aPcbPlotParams
->
m_
useAuxOrigin
=
ParseBool
();
break
;
case
T_hpglpennumber
:
aPcbPlotParams
->
m_HPGLPenNum
=
ParseInt
(
HPGL_PEN_NUMBER_MIN
,
...
...
@@ -349,44 +365,44 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_
HPGL_PEN_OVERLAP_MAX
);
break
;
case
T_pscolor
:
aPcbPlotParams
->
m_PlotPSColorOpt
=
ParseBool
();
NeedSYMBOL
();
// This actually was never used...
break
;
case
T_psnegative
:
aPcbPlotParams
->
m_
PlotPSN
egative
=
ParseBool
();
aPcbPlotParams
->
m_
n
egative
=
ParseBool
();
break
;
case
T_plotreference
:
aPcbPlotParams
->
m_
P
lotReference
=
ParseBool
();
aPcbPlotParams
->
m_
p
lotReference
=
ParseBool
();
break
;
case
T_plotvalue
:
aPcbPlotParams
->
m_
P
lotValue
=
ParseBool
();
aPcbPlotParams
->
m_
p
lotValue
=
ParseBool
();
break
;
case
T_plotothertext
:
aPcbPlotParams
->
m_
PlotTextOther
=
ParseBool
();
aPcbPlotParams
->
m_
plotOtherText
=
ParseBool
();
break
;
case
T_plotinvisibletext
:
aPcbPlotParams
->
m_
PlotInvisibleTexts
=
ParseBool
();
aPcbPlotParams
->
m_
plotInvisibleText
=
ParseBool
();
break
;
case
T_padsonsilk
:
aPcbPlotParams
->
m_
P
lotPadsOnSilkLayer
=
ParseBool
();
aPcbPlotParams
->
m_
p
lotPadsOnSilkLayer
=
ParseBool
();
break
;
case
T_subtractmaskfromsilk
:
aPcbPlotParams
->
subtractMaskFromSilk
=
ParseBool
();
aPcbPlotParams
->
m_
subtractMaskFromSilk
=
ParseBool
();
break
;
case
T_outputformat
:
aPcbPlotParams
->
m_
PlotFormat
=
static_cast
<
PlotFormat
>
(
ParseInt
(
0
,
3
)
);
aPcbPlotParams
->
m_
format
=
static_cast
<
PlotFormat
>
(
ParseInt
(
0
,
3
)
);
break
;
case
T_mirror
:
aPcbPlotParams
->
m_
PlotM
irror
=
ParseBool
();
aPcbPlotParams
->
m_
m
irror
=
ParseBool
();
break
;
case
T_drillshape
:
aPcbPlotParams
->
m_
DrillShapeOpt
=
(
PCB_PLOT_PARAMS
::
DrillShapeOptT
)
ParseInt
(
0
,
2
);
aPcbPlotParams
->
m_
drillMarks
=
static_cast
<
PCB_PLOT_PARAMS
::
DrillMarksType
>
(
ParseInt
(
0
,
2
)
);
break
;
case
T_scaleselection
:
aPcbPlotParams
->
scaleSelection
=
ParseInt
(
0
,
4
);
aPcbPlotParams
->
m_
scaleSelection
=
ParseInt
(
0
,
4
);
break
;
case
T_outputdirectory
:
NeedSYMBOL
();
aPcbPlotParams
->
outputDirectory
=
FROM_UTF8
(
CurText
()
);
aPcbPlotParams
->
m_
outputDirectory
=
FROM_UTF8
(
CurText
()
);
break
;
default
:
Unexpected
(
CurText
()
);
...
...
pcbnew/pcb_plot_params.h
View file @
137066e5
...
...
@@ -40,64 +40,110 @@ class PCB_PLOT_PARAMS
{
friend
class
PCB_PLOT_PARAMS_PARSER
;
public
:
bool
m_ExcludeEdgeLayer
;
///< True: do not plot edge layer when plotting other layers
///< False: Edge layer always plotted (merged) when plotting other layers
int
m_PlotLineWidth
;
bool
m_PlotFrameRef
;
///< True to plot/print frame references
bool
m_PlotViaOnMaskLayer
;
///< True if vias are drawn on Mask layer
///< (ie protected by mask)
EDA_DRAW_MODE_T
m_PlotMode
;
///< LINE, FILLED or SKETCH: select how to plot filled objects.
///< depending on plot format or layers, all options are not always allowed
int
m_HPGLPenNum
;
///< HPGL only: pen number selection(1 to 9)
int
m_HPGLPenSpeed
;
///< HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
int
m_HPGLPenDiam
;
///< HPGL only: pen diameter in MILS, usefull to fill areas
int
m_HPGLPenOvr
;
///< HPGL only: pen overlay in MILS, usefull only to fill areas
int
m_PlotPSColorOpt
;
///< True for color Postscript output
bool
m_PlotPSNegative
;
///< True to create a negative board ps plot
// Flags to enable or disable ploting of various PCB elements.
bool
m_SkipNPTH_Pads
;
///< true to disable plot NPTH pads if hole and size have same value
///< GERBER only
bool
m_PlotReference
;
bool
m_PlotValue
;
bool
m_PlotTextOther
;
bool
m_PlotInvisibleTexts
;
bool
m_PlotPadsOnSilkLayer
;
///< allows pads outlines on silkscreen layer (when pads are also o, silk screen
PlotFormat
m_PlotFormat
;
///< id for plot format
bool
m_PlotMirror
;
enum
DrillShapeOptT
{
enum
DrillMarksType
{
NO_DRILL_SHAPE
=
0
,
SMALL_DRILL_SHAPE
=
1
,
FULL_DRILL_SHAPE
=
2
};
DrillShapeOptT
m_DrillShapeOpt
;
///< For postscript output: holes can be not plotted,
///< or have a small size or plotted with their actual size
bool
m_AutoScale
;
///< If true, use the better scale to fit in page
double
m_PlotScale
;
///< The global scale factor. a 1.0 scale factor plot a board
///< with its actual size.
// These next two scale factors are intended to compensable plotters (and mainly printers) X and Y scale error.
// Therefore they are expected very near 1.0
// Only X and Y dimensions are adjusted: circles are plotted as circle, even if X and Y fine scale differ.
private
:
/** LINE, FILLED or SKETCH selects how to plot filled objects.
* FILLED is not available with all drivers */
EDA_DRAW_MODE_T
m_mode
;
/// Plot format type (chooses the driver to be used)
PlotFormat
m_format
;
double
m_FineScaleAdjustX
;
///< fine scale adjust X axis
double
m_FineScaleAdjustY
;
///< dine scale adjust Y axis
/// Holes can be not plotted, have a small mark or plotted in actual size
DrillMarksType
m_drillMarks
;
/// This width factor is intended to compensate printers and plotters that do
/// not strictly obey line width settings.
double
m_FineWidthAdjust
;
/// Choose how represent text with PS, PDF and DXF drivers
PlotTextMode
m_textMode
;
private
:
long
layerSelection
;
bool
useGerberExtensions
;
bool
useAuxOrigin
;
bool
subtractMaskFromSilk
;
bool
psA4Output
;
int
scaleSelection
;
wxString
outputDirectory
;
/// The default line width (used for the frame and in LINE mode)
int
m_lineWidth
;
/// When true set the scale to fit the board in the page
bool
m_autoScale
;
/// Global scale factor, 1.0 plots a board with its actual size.
double
m_scale
;
/// Mirror the plot around the X axis
bool
m_mirror
;
/// Plot in negative color (supported only by some drivers)
bool
m_negative
;
/// True if vias are drawn on Mask layer (ie untented, *exposed* by mask)
bool
m_plotViaOnMaskLayer
;
/// True to plot/print frame references
bool
m_plotFrameRef
;
/// If false always plot (merge) the pcb edge layer on other layers
bool
m_excludeEdgeLayer
;
/// Set of layers to plot
long
m_layerSelection
;
/** When plotting gerbers use a conventional set of extensions instead of
* appending a suffix to the board name */
bool
m_useGerberExtensions
;
/// Plot gerbers using auxiliary (drill) origin instead of page coordinates
bool
m_useAuxOrigin
;
/// On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
bool
m_subtractMaskFromSilk
;
/// Autoscale the plot to fit an A4 (landscape?) sheet
bool
m_A4Output
;
/// Scale ratio index (UI only)
int
m_scaleSelection
;
/// Output directory for plot files (usually relative to the board file)
wxString
m_outputDirectory
;
/// Enable plotting of part references
bool
m_plotReference
;
/// Enable plotting of part values
bool
m_plotValue
;
/// Enable plotting of other fields
bool
m_plotOtherText
;
/// Force plotting of fields marked invisible
bool
m_plotInvisibleText
;
/// Allows pads outlines on silkscreen layer
/// (when pads are also on silk screen)
bool
m_plotPadsOnSilkLayer
;
/* These next two scale factors are intended to compensate plotters
* (mainly printers) X and Y scale error. Therefore they are expected very
* near 1.0; only X and Y dimensions are adjusted: circles are plotted as
* circles, even if X and Y fine scale differ; because of this it is mostly
* useful for printers: postscript plots would be best adjusted using
* the prologue (that would change the whole output matrix */
double
m_fineScaleAdjustX
;
///< fine scale adjust X axis
double
m_fineScaleAdjustY
;
///< fine scale adjust Y axis
/** This width factor is intended to compensate printers and plotters that do
* not strictly obey line width settings. Only used for pads and zone
* filling AFAIK */
double
m_widthAdjust
;
int
m_HPGLPenNum
;
///< HPGL only: pen number selection(1 to 9)
int
m_HPGLPenSpeed
;
///< HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
int
m_HPGLPenDiam
;
///< HPGL only: pen diameter in MILS, useful to fill areas
int
m_HPGLPenOvr
;
///< HPGL only: pen overlay in MILS, useful only to fill areas
EDA_COLOR_T
m_color
;
///< Color for plotting the current layer
EDA_COLOR_T
m_referenceColor
;
///< Color for plotting references
EDA_COLOR_T
m_valueColor
;
///< Color for plotting values
public
:
PCB_PLOT_PARAMS
();
...
...
@@ -108,31 +154,76 @@ public:
bool
operator
==
(
const
PCB_PLOT_PARAMS
&
aPcbPlotParams
)
const
;
bool
operator
!=
(
const
PCB_PLOT_PARAMS
&
aPcbPlotParams
)
const
;
void
SetPlotFormat
(
PlotFormat
aFormat
)
{
m_PlotFormat
=
aFormat
;
};
PlotFormat
GetPlotFormat
()
const
{
return
m_PlotFormat
;
};
void
SetOutputDirectory
(
wxString
aDir
)
{
outputDirectory
=
aDir
;
};
wxString
GetOutputDirectory
()
const
{
return
outputDirectory
;
};
void
SetUseGerberExtensions
(
bool
aUse
)
{
useGerberExtensions
=
aUse
;
};
bool
GetUseGerberExtensions
()
const
{
return
useGerberExtensions
;
};
void
SetSubtractMaskFromSilk
(
bool
aSubtract
)
{
subtractMaskFromSilk
=
aSubtract
;
};
bool
GetSubtractMaskFromSilk
()
const
{
return
subtractMaskFromSilk
;
};
void
SetLayerSelection
(
long
aSelection
)
{
layerSelection
=
aSelection
;
};
long
GetLayerSelection
()
const
{
return
layerSelection
;
};
void
SetUseAuxOrigin
(
bool
aAux
)
{
useAuxOrigin
=
aAux
;
};
bool
GetUseAuxOrigin
()
const
{
return
useAuxOrigin
;
};
void
SetScaleSelection
(
int
aSelection
)
{
scaleSelection
=
aSelection
;
};
int
GetScaleSelection
()
const
{
return
scaleSelection
;
};
void
SetPsA4Output
(
int
aForce
)
{
psA4Output
=
aForce
;
};
bool
GetPsA4Output
()
const
{
return
psA4Output
;
};
int
GetHpglPenDiameter
()
const
{
return
m_HPGLPenDiam
;
};
bool
SetHpglPenDiameter
(
int
aValue
);
int
GetHpglPenSpeed
()
const
{
return
m_HPGLPenSpeed
;
};
bool
SetHpglPenSpeed
(
int
aValue
);
int
GetHpglPenOverlay
()
const
{
return
m_HPGLPenOvr
;
};
bool
SetHpglPenOverlay
(
int
aValue
);
int
GetPlotLineWidth
()
const
{
return
m_PlotLineWidth
;
};
bool
SetPlotLineWidth
(
int
aValue
);
void
SetColor
(
EDA_COLOR_T
aVal
)
{
m_color
=
aVal
;
}
EDA_COLOR_T
GetColor
()
const
{
return
m_color
;
}
void
SetReferenceColor
(
EDA_COLOR_T
aVal
)
{
m_referenceColor
=
aVal
;
}
EDA_COLOR_T
GetReferenceColor
()
const
{
return
m_referenceColor
;
}
void
SetValueColor
(
EDA_COLOR_T
aVal
)
{
m_valueColor
=
aVal
;
}
EDA_COLOR_T
GetValueColor
()
const
{
return
m_valueColor
;
}
void
SetTextMode
(
PlotTextMode
aVal
)
{
m_textMode
=
aVal
;
}
PlotTextMode
GetTextMode
()
const
{
return
m_textMode
;
}
void
SetMode
(
EDA_DRAW_MODE_T
aVal
)
{
m_mode
=
aVal
;
}
EDA_DRAW_MODE_T
GetMode
()
const
{
return
m_mode
;
}
void
SetDrillMarksType
(
DrillMarksType
aVal
)
{
m_drillMarks
=
aVal
;
}
DrillMarksType
GetDrillMarksType
()
const
{
return
m_drillMarks
;
}
void
SetScale
(
double
aVal
)
{
m_scale
=
aVal
;
}
double
GetScale
()
const
{
return
m_scale
;
}
void
SetFineScaleAdjustX
(
double
aVal
)
{
m_fineScaleAdjustX
=
aVal
;
}
double
GetFineScaleAdjustX
()
const
{
return
m_fineScaleAdjustX
;
}
void
SetFineScaleAdjustY
(
double
aVal
)
{
m_fineScaleAdjustY
=
aVal
;
}
double
GetFineScaleAdjustY
()
const
{
return
m_fineScaleAdjustY
;
}
void
SetWidthAdjust
(
double
aVal
)
{
m_widthAdjust
=
aVal
;
}
double
GetWidthAdjust
()
const
{
return
m_widthAdjust
;
}
void
SetAutoScale
(
bool
aFlag
)
{
m_autoScale
=
aFlag
;
}
bool
GetAutoScale
()
const
{
return
m_autoScale
;
}
void
SetMirror
(
bool
aFlag
)
{
m_mirror
=
aFlag
;
}
bool
GetMirror
()
const
{
return
m_mirror
;
}
void
SetPlotPadsOnSilkLayer
(
bool
aFlag
)
{
m_plotPadsOnSilkLayer
=
aFlag
;
}
bool
GetPlotPadsOnSilkLayer
()
const
{
return
m_plotPadsOnSilkLayer
;
}
void
SetPlotInvisibleText
(
bool
aFlag
)
{
m_plotInvisibleText
=
aFlag
;
}
bool
GetPlotInvisibleText
()
const
{
return
m_plotInvisibleText
;
}
void
SetPlotOtherText
(
bool
aFlag
)
{
m_plotOtherText
=
aFlag
;
}
bool
GetPlotOtherText
()
const
{
return
m_plotOtherText
;
}
void
SetPlotValue
(
bool
aFlag
)
{
m_plotValue
=
aFlag
;
}
bool
GetPlotValue
()
const
{
return
m_plotValue
;
}
void
SetPlotReference
(
bool
aFlag
)
{
m_plotReference
=
aFlag
;
}
bool
GetPlotReference
()
const
{
return
m_plotReference
;
}
void
SetNegative
(
bool
aFlag
)
{
m_negative
=
aFlag
;
}
bool
GetNegative
()
const
{
return
m_negative
;
}
void
SetPlotViaOnMaskLayer
(
bool
aFlag
)
{
m_plotViaOnMaskLayer
=
aFlag
;
}
bool
GetPlotViaOnMaskLayer
()
const
{
return
m_plotViaOnMaskLayer
;
}
void
SetPlotFrameRef
(
bool
aFlag
)
{
m_plotFrameRef
=
aFlag
;
}
bool
GetPlotFrameRef
()
const
{
return
m_plotFrameRef
;
}
void
SetExcludeEdgeLayer
(
bool
aFlag
)
{
m_excludeEdgeLayer
=
aFlag
;
}
bool
GetExcludeEdgeLayer
()
const
{
return
m_excludeEdgeLayer
;
}
void
SetFormat
(
PlotFormat
aFormat
)
{
m_format
=
aFormat
;
};
PlotFormat
GetFormat
()
const
{
return
m_format
;
};
void
SetOutputDirectory
(
wxString
aDir
)
{
m_outputDirectory
=
aDir
;
};
wxString
GetOutputDirectory
()
const
{
return
m_outputDirectory
;
};
void
SetUseGerberExtensions
(
bool
aUse
)
{
m_useGerberExtensions
=
aUse
;
};
bool
GetUseGerberExtensions
()
const
{
return
m_useGerberExtensions
;
};
void
SetSubtractMaskFromSilk
(
bool
aSubtract
)
{
m_subtractMaskFromSilk
=
aSubtract
;
};
bool
GetSubtractMaskFromSilk
()
const
{
return
m_subtractMaskFromSilk
;
};
void
SetLayerSelection
(
long
aSelection
)
{
m_layerSelection
=
aSelection
;
};
long
GetLayerSelection
()
const
{
return
m_layerSelection
;
};
void
SetUseAuxOrigin
(
bool
aAux
)
{
m_useAuxOrigin
=
aAux
;
};
bool
GetUseAuxOrigin
()
const
{
return
m_useAuxOrigin
;
};
void
SetScaleSelection
(
int
aSelection
)
{
m_scaleSelection
=
aSelection
;
};
int
GetScaleSelection
()
const
{
return
m_scaleSelection
;
};
void
SetA4Output
(
int
aForce
)
{
m_A4Output
=
aForce
;
};
bool
GetA4Output
()
const
{
return
m_A4Output
;
};
int
GetHPGLPenDiameter
()
const
{
return
m_HPGLPenDiam
;
};
bool
SetHPGLPenDiameter
(
int
aValue
);
int
GetHPGLPenSpeed
()
const
{
return
m_HPGLPenSpeed
;
};
bool
SetHPGLPenSpeed
(
int
aValue
);
int
GetHPGLPenOverlay
()
const
{
return
m_HPGLPenOvr
;
};
bool
SetHPGLPenOverlay
(
int
aValue
);
void
SetHPGLPenNum
(
int
aVal
)
{
m_HPGLPenNum
=
aVal
;
}
int
GetHPGLPenNum
()
const
{
return
m_HPGLPenNum
;
}
int
GetLineWidth
()
const
{
return
m_lineWidth
;
};
bool
SetLineWidth
(
int
aValue
);
};
...
...
pcbnew/pcbplot.cpp
View file @
137066e5
...
...
@@ -139,26 +139,26 @@ void DIALOG_PLOT::Init_Dialog()
m_WidthAdjustMinValue
=
-
(
m_board
->
GetDesignSettings
().
m_TrackMinWidth
-
1
);
m_WidthAdjustMaxValue
=
m_board
->
GetSmallestClearanceValue
()
-
1
;
m_plotFormatOpt
->
SetSelection
(
m_plotOpts
.
Get
Plot
Format
()
);
m_plotFormatOpt
->
SetSelection
(
m_plotOpts
.
GetFormat
()
);
// Set units and value for HPGL pen size (this param in in mils).
AddUnitSymbol
(
*
m_textPenSize
,
g_UserUnit
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_plotOpts
.
GetH
pgl
PenDiameter
()
*
IU_PER_MILS
);
m_plotOpts
.
GetH
PGL
PenDiameter
()
*
IU_PER_MILS
);
m_HPGLPenSizeOpt
->
AppendText
(
msg
);
// Units are *always* cm/s for HPGL pen speed, from 1 to 99.
msg
=
ReturnStringFromValue
(
UNSCALED_UNITS
,
m_plotOpts
.
GetH
pgl
PenSpeed
()
);
msg
=
ReturnStringFromValue
(
UNSCALED_UNITS
,
m_plotOpts
.
GetH
PGL
PenSpeed
()
);
m_HPGLPenSpeedOpt
->
AppendText
(
msg
);
// Set units and value for HPGL pen overlay (this param in in mils).
AddUnitSymbol
(
*
m_textPenOvr
,
g_UserUnit
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_plotOpts
.
GetH
pgl
PenOverlay
()
*
IU_PER_MILS
);
m_plotOpts
.
GetH
PGL
PenOverlay
()
*
IU_PER_MILS
);
m_HPGLPenOverlayOpt
->
AppendText
(
msg
);
AddUnitSymbol
(
*
m_textDefaultPenSize
,
g_UserUnit
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_plotOpts
.
Get
Plot
LineWidth
()
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_plotOpts
.
GetLineWidth
()
);
m_linesWidth
->
AppendText
(
msg
);
// Set units for PS global width correction.
...
...
@@ -184,8 +184,8 @@ void DIALOG_PLOT::Init_Dialog()
msg
.
Printf
(
wxT
(
"%f"
),
To_User_Unit
(
g_UserUnit
,
m_PSWidthAdjust
)
);
m_PSFineAdjustWidthOpt
->
AppendText
(
msg
);
m_plotPSNegativeOpt
->
SetValue
(
m_plotOpts
.
m_PlotPSNegative
);
m_forcePSA4OutputOpt
->
SetValue
(
m_plotOpts
.
Get
Ps
A4Output
()
);
m_plotPSNegativeOpt
->
SetValue
(
m_plotOpts
.
GetNegative
()
);
m_forcePSA4OutputOpt
->
SetValue
(
m_plotOpts
.
GetA4Output
()
);
// List layers in same order than in setup layers dialog
// (Front or Top to Back or Bottom)
...
...
@@ -212,36 +212,36 @@ void DIALOG_PLOT::Init_Dialog()
m_useGerberExtensions
->
SetValue
(
m_plotOpts
.
GetUseGerberExtensions
()
);
// Option for excluding contents of "Edges Pcb" layer
m_excludeEdgeLayerOpt
->
SetValue
(
m_plotOpts
.
m_ExcludeEdgeLayer
);
m_excludeEdgeLayerOpt
->
SetValue
(
m_plotOpts
.
GetExcludeEdgeLayer
()
);
m_subtractMaskFromSilk
->
SetValue
(
m_plotOpts
.
GetSubtractMaskFromSilk
()
);
// Option to plot page references:
m_plotSheetRef
->
SetValue
(
m_plotOpts
.
m_PlotFrameRef
);
m_plotSheetRef
->
SetValue
(
m_plotOpts
.
GetPlotFrameRef
()
);
// Option to
plot pads on silkscreen layers or all
layers
m_plotPads_on_Silkscreen
->
SetValue
(
m_plotOpts
.
m_PlotPadsOnSilkLayer
);
// Option to
allow pads on silkscreen
layers
m_plotPads_on_Silkscreen
->
SetValue
(
m_plotOpts
.
GetPlotPadsOnSilkLayer
()
);
// Options to plot texts on footprints
m_plotModuleValueOpt
->
SetValue
(
m_plotOpts
.
m_PlotValue
);
m_plotModuleRefOpt
->
SetValue
(
m_plotOpts
.
m_PlotReference
);
m_plotTextOther
->
SetValue
(
m_plotOpts
.
m_PlotTextOther
);
m_plotInvisibleText
->
SetValue
(
m_plotOpts
.
m_PlotInvisibleTexts
);
m_plotModuleValueOpt
->
SetValue
(
m_plotOpts
.
GetPlotValue
()
);
m_plotModuleRefOpt
->
SetValue
(
m_plotOpts
.
GetPlotReference
()
);
m_plotTextOther
->
SetValue
(
m_plotOpts
.
GetPlotOtherText
()
);
m_plotInvisibleText
->
SetValue
(
m_plotOpts
.
GetPlotInvisibleText
()
);
// Options to plot pads and vias holes
m_drillShapeOpt
->
SetSelection
(
m_plotOpts
.
m_DrillShapeOpt
);
m_drillShapeOpt
->
SetSelection
(
m_plotOpts
.
GetDrillMarksType
()
);
// Scale option
m_scaleOpt
->
SetSelection
(
m_plotOpts
.
GetScaleSelection
()
);
// Plot mode
m_plotModeOpt
->
SetSelection
(
m_plotOpts
.
m_PlotMode
);
m_plotModeOpt
->
SetSelection
(
m_plotOpts
.
GetMode
()
);
// Plot mirror option
m_plotMirrorOpt
->
SetValue
(
m_plotOpts
.
m_PlotMirror
);
m_plotMirrorOpt
->
SetValue
(
m_plotOpts
.
GetMirror
()
);
// Put vias on mask layer
m_plotNoViaOnMaskOpt
->
SetValue
(
m_plotOpts
.
m_PlotViaOnMaskLayer
);
m_plotNoViaOnMaskOpt
->
SetValue
(
m_plotOpts
.
GetPlotViaOnMaskLayer
()
);
// Output directory
m_outputDirectoryName
->
SetValue
(
m_plotOpts
.
GetOutputDirectory
()
);
...
...
@@ -324,37 +324,39 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
switch
(
m_plotFormatOpt
->
GetSelection
()
)
{
case
PLOT_FORMAT_POST
:
default
:
m_drillShapeOpt
->
Enable
(
true
);
m_plotModeOpt
->
Enable
(
true
);
m_plotMirrorOpt
->
Enable
(
true
);
m_useAuxOriginCheckBox
->
Enable
(
false
);
m_useAuxOriginCheckBox
->
SetValue
(
false
);
m_linesWidth
->
Enable
(
true
);
m_HPGLPenSizeOpt
->
Enable
(
false
);
m_HPGLPenSpeedOpt
->
Enable
(
false
);
m_HPGLPenOverlayOpt
->
Enable
(
false
);
m_excludeEdgeLayerOpt
->
SetValue
(
false
);
m_excludeEdgeLayerOpt
->
Enable
(
false
);
m_excludeEdgeLayerOpt
->
Enable
(
true
);
m_subtractMaskFromSilk
->
Enable
(
false
);
m_subtractMaskFromSilk
->
SetValue
(
false
);
m_useGerberExtensions
->
Enable
(
false
);
m_useGerberExtensions
->
SetValue
(
false
);
m_scaleOpt
->
Enable
(
true
);
m_fineAdjustXscaleOpt
->
Enable
(
true
);
m_fineAdjustYscaleOpt
->
Enable
(
true
);
m_PSFineAdjustWidthOpt
->
Enable
(
true
);
m_plotPSNegativeOpt
->
Enable
(
true
);
m_forcePSA4OutputOpt
->
Enable
(
true
);
m_PlotOptionsSizer
->
Hide
(
m_GerberOptionsSizer
);
m_PlotOptionsSizer
->
Hide
(
m_HPGLOptionsSizer
);
m_PlotOptionsSizer
->
Show
(
m_PSOptionsSizer
);
Layout
();
m_MainSizer
->
SetSizeHints
(
this
);
break
;
case
PLOT_FORMAT_GERBER
:
m_drillShapeOpt
->
Enable
(
false
);
m_
plotModeOpt
->
SetSelection
(
1
);
m_
drillShapeOpt
->
SetSelection
(
0
);
m_plotModeOpt
->
Enable
(
false
);
m_plotM
irrorOpt
->
SetValue
(
false
);
m_plotM
odeOpt
->
SetSelection
(
1
);
m_plotMirrorOpt
->
Enable
(
false
);
m_plotMirrorOpt
->
SetValue
(
false
);
m_useAuxOriginCheckBox
->
Enable
(
true
);
m_linesWidth
->
Enable
(
true
);
m_HPGLPenSizeOpt
->
Enable
(
false
);
...
...
@@ -363,74 +365,89 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_excludeEdgeLayerOpt
->
Enable
(
true
);
m_subtractMaskFromSilk
->
Enable
(
true
);
m_useGerberExtensions
->
Enable
(
true
);
m_scaleOpt
->
SetSelection
(
1
);
m_scaleOpt
->
Enable
(
false
);
m_scaleOpt
->
SetSelection
(
1
);
m_fineAdjustXscaleOpt
->
Enable
(
false
);
m_fineAdjustYscaleOpt
->
Enable
(
false
);
m_PSFineAdjustWidthOpt
->
Enable
(
false
);
m_plotPSNegativeOpt
->
SetValue
(
false
);
m_plotPSNegativeOpt
->
Enable
(
false
);
m_plotPSNegativeOpt
->
SetValue
(
false
);
m_forcePSA4OutputOpt
->
Enable
(
false
);
m_forcePSA4OutputOpt
->
SetValue
(
false
);
m_PlotOptionsSizer
->
Show
(
m_GerberOptionsSizer
);
m_PlotOptionsSizer
->
Hide
(
m_HPGLOptionsSizer
);
m_PlotOptionsSizer
->
Hide
(
m_PSOptionsSizer
);
Layout
();
m_MainSizer
->
SetSizeHints
(
this
);
break
;
case
PLOT_FORMAT_HPGL
:
m_plotMirrorOpt
->
Enable
(
true
);
m_drillShapeOpt
->
Enable
(
false
);
m_drillShapeOpt
->
Enable
(
true
);
m_plotModeOpt
->
Enable
(
true
);
m_plotMirrorOpt
->
Enable
(
true
);
m_useAuxOriginCheckBox
->
Enable
(
false
);
m_useAuxOriginCheckBox
->
SetValue
(
false
);
m_linesWidth
->
Enable
(
false
);
m_HPGLPenSizeOpt
->
Enable
(
true
);
m_HPGLPenSpeedOpt
->
Enable
(
true
);
m_HPGLPenOverlayOpt
->
Enable
(
true
);
m_excludeEdgeLayerOpt
->
SetValue
(
false
);
m_excludeEdgeLayerOpt
->
Enable
(
false
);
m_excludeEdgeLayerOpt
->
Enable
(
true
);
m_subtractMaskFromSilk
->
Enable
(
false
);
m_subtractMaskFromSilk
->
SetValue
(
false
);
m_useGerberExtensions
->
Enable
(
false
);
m_useGerberExtensions
->
SetValue
(
false
);
m_scaleOpt
->
Enable
(
true
);
m_fineAdjustXscaleOpt
->
Enable
(
false
);
m_fineAdjustYscaleOpt
->
Enable
(
false
);
m_PSFineAdjustWidthOpt
->
Enable
(
false
);
m_plotPSNegativeOpt
->
SetValue
(
false
);
m_plotPSNegativeOpt
->
Enable
(
false
);
m_forcePSA4OutputOpt
->
Enable
(
true
);
m_PlotOptionsSizer
->
Hide
(
m_GerberOptionsSizer
);
m_PlotOptionsSizer
->
Show
(
m_HPGLOptionsSizer
);
m_PlotOptionsSizer
->
Hide
(
m_PSOptionsSizer
);
Layout
();
m_MainSizer
->
SetSizeHints
(
this
);
break
;
case
PLOT_FORMAT_DXF
:
m_drillShapeOpt
->
Enable
(
true
);
m_plotModeOpt
->
Enable
(
true
);
m_plotMirrorOpt
->
Enable
(
false
);
m_plotMirrorOpt
->
SetValue
(
false
);
m_drillShapeOpt
->
Enable
(
false
);
m_plotModeOpt
->
Enable
(
true
);
m_useAuxOriginCheckBox
->
Enable
(
false
);
m_useAuxOriginCheckBox
->
Enable
(
true
);
m_linesWidth
->
Enable
(
false
);
m_HPGLPenSizeOpt
->
Enable
(
false
);
m_HPGLPenSpeedOpt
->
Enable
(
false
);
m_HPGLPenOverlayOpt
->
Enable
(
false
);
m_excludeEdgeLayerOpt
->
SetValue
(
false
);
m_excludeEdgeLayerOpt
->
Enable
(
false
);
m_excludeEdgeLayerOpt
->
Enable
(
true
);
m_subtractMaskFromSilk
->
Enable
(
false
);
m_subtractMaskFromSilk
->
SetValue
(
false
);
m_useGerberExtensions
->
Enable
(
false
);
m_useGerberExtensions
->
SetValue
(
false
);
m_scaleOpt
->
Enable
(
false
);
m_scaleOpt
->
SetSelection
(
1
);
m_fineAdjustXscaleOpt
->
Enable
(
false
);
m_fineAdjustYscaleOpt
->
Enable
(
false
);
m_PSFineAdjustWidthOpt
->
Enable
(
false
);
m_plotPSNegativeOpt
->
SetValue
(
false
);
m_plotPSNegativeOpt
->
Enable
(
false
);
m_PlotOptionsSizer
->
Hide
(
m_GerberOptionsSizer
);
m_plotPSNegativeOpt
->
SetValue
(
false
);
m_forcePSA4OutputOpt
->
Enable
(
false
);
m_forcePSA4OutputOpt
->
SetValue
(
false
);
m_PlotOptionsSizer
->
Show
(
m_GerberOptionsSizer
);
m_PlotOptionsSizer
->
Hide
(
m_HPGLOptionsSizer
);
m_PlotOptionsSizer
->
Hide
(
m_PSOptionsSizer
);
Layout
();
m_MainSizer
->
SetSizeHints
(
this
);
break
;
default
:
wxASSERT
(
false
);
}
/* Update the interlock between scale and frame reference
* (scaling would mess up the frame border...) */
OnSetScaleOpt
(
event
);
Layout
();
m_MainSizer
->
SetSizeHints
(
this
);
}
...
...
@@ -438,29 +455,28 @@ void DIALOG_PLOT::applyPlotSettings()
{
PCB_PLOT_PARAMS
tempOptions
;
tempOptions
.
m_ExcludeEdgeLayer
=
m_excludeEdgeLayerOpt
->
GetValue
(
);
tempOptions
.
SetExcludeEdgeLayer
(
m_excludeEdgeLayerOpt
->
GetValue
()
);
tempOptions
.
SetSubtractMaskFromSilk
(
m_subtractMaskFromSilk
->
GetValue
()
);
if
(
m_plotSheetRef
)
tempOptions
.
m_PlotFrameRef
=
m_plotSheetRef
->
GetValue
();
tempOptions
.
SetPlotFrameRef
(
m_plotSheetRef
->
GetValue
()
);
tempOptions
.
m_PlotPadsOnSilkLayer
=
m_plotPads_on_Silkscreen
->
GetValue
(
);
tempOptions
.
SetPlotPadsOnSilkLayer
(
m_plotPads_on_Silkscreen
->
GetValue
()
);
tempOptions
.
SetUseAuxOrigin
(
m_useAuxOriginCheckBox
->
GetValue
()
);
tempOptions
.
m_PlotValue
=
m_plotModuleValueOpt
->
GetValue
(
);
tempOptions
.
m_PlotReference
=
m_plotModuleRefOpt
->
GetValue
(
);
tempOptions
.
m_PlotTextOther
=
m_plotTextOther
->
GetValue
(
);
tempOptions
.
m_PlotInvisibleTexts
=
m_plotInvisibleText
->
GetValue
(
);
tempOptions
.
SetPlotValue
(
m_plotModuleValueOpt
->
GetValue
()
);
tempOptions
.
SetPlotReference
(
m_plotModuleRefOpt
->
GetValue
()
);
tempOptions
.
SetPlotOtherText
(
m_plotTextOther
->
GetValue
()
);
tempOptions
.
SetPlotInvisibleText
(
m_plotInvisibleText
->
GetValue
()
);
tempOptions
.
SetScaleSelection
(
m_scaleOpt
->
GetSelection
()
);
tempOptions
.
m_DrillShapeOpt
=
(
PCB_PLOT_PARAMS
::
DrillShapeOptT
)
m_drillShapeOpt
->
GetSelection
(
);
tempOptions
.
m_PlotMirror
=
m_plotMirrorOpt
->
GetValue
(
);
tempOptions
.
m_PlotMode
=
(
EDA_DRAW_MODE_T
)
m_plotModeOpt
->
GetSelection
(
);
tempOptions
.
m_PlotViaOnMaskLayer
=
m_plotNoViaOnMaskOpt
->
GetValue
(
);
tempOptions
.
SetDrillMarksType
(
static_cast
<
PCB_PLOT_PARAMS
::
DrillMarksType
>
(
m_drillShapeOpt
->
GetSelection
()
)
);
tempOptions
.
SetMirror
(
m_plotMirrorOpt
->
GetValue
()
);
tempOptions
.
SetMode
(
static_cast
<
EDA_DRAW_MODE_T
>
(
m_plotModeOpt
->
GetSelection
()
)
);
tempOptions
.
SetPlotViaOnMaskLayer
(
m_plotNoViaOnMaskOpt
->
GetValue
()
);
// Update settings from text fields. Rewrite values back to the fields,
// since the values may have been constrained by the setters.
...
...
@@ -469,9 +485,9 @@ void DIALOG_PLOT::applyPlotSettings()
wxString
msg
=
m_HPGLPenSizeOpt
->
GetValue
();
int
tmp
=
ReturnValueFromString
(
g_UserUnit
,
msg
)
/
IU_PER_MILS
;
if
(
!
tempOptions
.
SetH
pgl
PenDiameter
(
tmp
)
)
if
(
!
tempOptions
.
SetH
PGL
PenDiameter
(
tmp
)
)
{
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
GetH
pgl
PenDiameter
()
*
IU_PER_MILS
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
GetH
PGL
PenDiameter
()
*
IU_PER_MILS
);
m_HPGLPenSizeOpt
->
SetValue
(
msg
);
msg
.
Printf
(
_
(
"HPGL pen size constrained!
\n
"
)
);
m_messagesBox
->
AppendText
(
msg
);
...
...
@@ -481,9 +497,9 @@ void DIALOG_PLOT::applyPlotSettings()
msg
=
m_HPGLPenSpeedOpt
->
GetValue
();
tmp
=
ReturnValueFromString
(
UNSCALED_UNITS
,
msg
);
if
(
!
tempOptions
.
SetH
pgl
PenSpeed
(
tmp
)
)
if
(
!
tempOptions
.
SetH
PGL
PenSpeed
(
tmp
)
)
{
msg
=
ReturnStringFromValue
(
UNSCALED_UNITS
,
tempOptions
.
GetH
pgl
PenSpeed
()
);
msg
=
ReturnStringFromValue
(
UNSCALED_UNITS
,
tempOptions
.
GetH
PGL
PenSpeed
()
);
m_HPGLPenSpeedOpt
->
SetValue
(
msg
);
msg
.
Printf
(
_
(
"HPGL pen speed constrained!
\n
"
)
);
m_messagesBox
->
AppendText
(
msg
);
...
...
@@ -493,10 +509,10 @@ void DIALOG_PLOT::applyPlotSettings()
msg
=
m_HPGLPenOverlayOpt
->
GetValue
();
tmp
=
ReturnValueFromString
(
g_UserUnit
,
msg
)
/
IU_PER_MILS
;
if
(
!
tempOptions
.
SetH
pgl
PenOverlay
(
tmp
)
)
if
(
!
tempOptions
.
SetH
PGL
PenOverlay
(
tmp
)
)
{
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
GetH
pgl
PenOverlay
()
*
IU_PER_MILS
);
tempOptions
.
GetH
PGL
PenOverlay
()
*
IU_PER_MILS
);
m_HPGLPenOverlayOpt
->
SetValue
(
msg
);
msg
.
Printf
(
_
(
"HPGL pen overlay constrained!
\n
"
)
);
m_messagesBox
->
AppendText
(
msg
);
...
...
@@ -506,9 +522,9 @@ void DIALOG_PLOT::applyPlotSettings()
msg
=
m_linesWidth
->
GetValue
();
tmp
=
ReturnValueFromString
(
g_UserUnit
,
msg
);
if
(
!
tempOptions
.
Set
Plot
LineWidth
(
tmp
)
)
if
(
!
tempOptions
.
SetLineWidth
(
tmp
)
)
{
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
Get
Plot
LineWidth
()
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
GetLineWidth
()
);
m_linesWidth
->
SetValue
(
msg
);
msg
.
Printf
(
_
(
"Default linewidth constrained!
\n
"
)
);
m_messagesBox
->
AppendText
(
msg
);
...
...
@@ -564,7 +580,7 @@ void DIALOG_PLOT::applyPlotSettings()
tempOptions
.
SetUseGerberExtensions
(
m_useGerberExtensions
->
GetValue
()
);
tempOptions
.
Set
PlotFormat
(
static_cast
<
PlotFormat
>
(
m_plotFormatOpt
->
GetSelection
()
)
);
tempOptions
.
Set
Format
(
static_cast
<
PlotFormat
>
(
m_plotFormatOpt
->
GetSelection
()
)
);
long
selectedLayers
=
0
;
unsigned
int
i
;
...
...
@@ -576,8 +592,8 @@ void DIALOG_PLOT::applyPlotSettings()
}
tempOptions
.
SetLayerSelection
(
selectedLayers
);
tempOptions
.
m_PlotPSNegative
=
m_plotPSNegativeOpt
->
GetValue
(
);
tempOptions
.
Set
Ps
A4Output
(
m_forcePSA4OutputOpt
->
GetValue
()
);
tempOptions
.
SetNegative
(
m_plotPSNegativeOpt
->
GetValue
()
);
tempOptions
.
SetA4Output
(
m_forcePSA4OutputOpt
->
GetValue
()
);
// Set output directory and replace backslashes with forward ones
wxString
dirStr
;
...
...
@@ -631,28 +647,27 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
}
}
m_plotOpts
.
m_AutoScale
=
false
;
m_plotOpts
.
m_PlotScale
=
1
;
m_plotOpts
.
SetAutoScale
(
false
);
m_plotOpts
.
SetScale
(
1
);
switch
(
m_plotOpts
.
GetScaleSelection
()
)
{
default
:
break
;
case
0
:
m_plotOpts
.
m_AutoScale
=
true
;
case
0
:
// Autoscale option
m_plotOpts
.
SetAutoScale
(
true
)
;
break
;
case
2
:
m_plotOpts
.
m_PlotScale
=
1.5
;
case
2
:
// 3:2 option
m_plotOpts
.
SetScale
(
1.5
)
;
break
;
case
3
:
m_plotOpts
.
m_PlotScale
=
2
;
case
3
:
// 2:1 option
m_plotOpts
.
SetScale
(
2
)
;
break
;
case
4
:
m_plotOpts
.
m_PlotScale
=
3
;
case
4
:
// 3:1 option
m_plotOpts
.
SetScale
(
3
)
;
break
;
}
...
...
@@ -662,32 +677,34 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
* settings resulting in a divide by zero fault.
*/
if
(
m_fineAdjustXscaleOpt
->
IsEnabled
()
&&
m_XScaleAdjust
!=
0.0
)
m_plotOpts
.
m_FineScaleAdjustX
=
m_XScaleAdjust
;
m_plotOpts
.
SetFineScaleAdjustX
(
m_XScaleAdjust
)
;
if
(
m_fineAdjustYscaleOpt
->
IsEnabled
()
&&
m_YScaleAdjust
!=
0.0
)
m_plotOpts
.
m_FineScaleAdjustY
=
m_YScaleAdjust
;
m_plotOpts
.
SetFineScaleAdjustY
(
m_YScaleAdjust
)
;
if
(
m_PSFineAdjustWidthOpt
->
IsEnabled
()
)
m_plotOpts
.
m_FineWidthAdjust
=
m_PSWidthAdjust
;
m_plotOpts
.
SetWidthAdjust
(
m_PSWidthAdjust
)
;
switch
(
m_plotOpts
.
Get
Plot
Format
()
)
switch
(
m_plotOpts
.
GetFormat
()
)
{
case
PLOT_FORMAT_GERBER
:
case
PLOT_FORMAT_DXF
:
m_plotOpts
.
m_PlotScale
=
1.0
;
// No scaling for these
m_plotOpts
.
SetScale
(
1
)
;
// No scaling for these
break
;
default
:
break
;
}
wxString
file_ext
(
GetDefaultPlotExtension
(
m_plotOpts
.
Get
Plot
Format
()
)
);
wxString
file_ext
(
GetDefaultPlotExtension
(
m_plotOpts
.
GetFormat
()
)
);
// Test for a reasonable scale value
if
(
m_plotOpts
.
m_PlotScale
<
MIN_SCALE
)
// XXX could this actually happen? isn't it constrained in the apply
// function?
if
(
m_plotOpts
.
GetScale
()
<
MIN_SCALE
)
DisplayInfoMessage
(
this
,
_
(
"Warning: Scale option set to a very small value"
)
);
if
(
m_plotOpts
.
m_PlotScale
>
MAX_SCALE
)
if
(
m_plotOpts
.
GetScale
()
>
MAX_SCALE
)
DisplayInfoMessage
(
this
,
_
(
"Warning: Scale option set to a very large value"
)
);
...
...
@@ -713,7 +730,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
// Use Gerber Extensions based on layer number
// (See http://en.wikipedia.org/wiki/Gerber_File)
if
(
(
m_plotOpts
.
Get
Plot
Format
()
==
PLOT_FORMAT_GERBER
)
if
(
(
m_plotOpts
.
GetFormat
()
==
PLOT_FORMAT_GERBER
)
&&
m_useGerberExtensions
->
GetValue
()
)
{
switch
(
layer
)
...
...
@@ -794,28 +811,28 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
fn
.
SetExt
(
file_ext
);
}
switch
(
m_plotOpts
.
Get
Plot
Format
()
)
switch
(
m_plotOpts
.
GetFormat
()
)
{
case
PLOT_FORMAT_POST
:
success
=
m_parent
->
ExportToPostScriptFile
(
fn
.
GetFullPath
(),
layer
,
m_plotOpts
.
Get
Ps
A4Output
(),
m_plotOpts
.
m_PlotMode
);
m_plotOpts
.
GetA4Output
(),
m_plotOpts
.
GetMode
()
);
break
;
case
PLOT_FORMAT_GERBER
:
success
=
m_parent
->
ExportToGerberFile
(
fn
.
GetFullPath
(),
layer
,
m_plotOpts
.
GetUseAuxOrigin
(),
m_plotOpts
.
m_PlotMode
);
m_plotOpts
.
GetMode
()
);
break
;
case
PLOT_FORMAT_HPGL
:
success
=
m_parent
->
ExportToHpglFile
(
fn
.
GetFullPath
(),
layer
,
m_plotOpts
.
m_PlotMode
);
m_plotOpts
.
GetMode
()
);
break
;
case
PLOT_FORMAT_DXF
:
success
=
m_parent
->
ExportToDxfFile
(
fn
.
GetFullPath
(),
layer
,
m_plotOpts
.
m_PlotMode
);
m_plotOpts
.
GetMode
()
);
break
;
}
...
...
pcbnew/plot_rtn.cpp
View file @
137066e5
...
...
@@ -80,7 +80,7 @@ void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* aPlotter, int aLayerMask, EDA_DRAW
int
layersmask_plotpads
=
aLayerMask
;
// Calculate the mask layers of allowed layers for pads
if
(
!
plot_opts
.
m_PlotPadsOnSilkLayer
)
// Do not plot pads on silk screen layers
if
(
!
plot_opts
.
GetPlotPadsOnSilkLayer
()
)
// Do not plot pads on silk screen layers
layersmask_plotpads
&=
~
(
SILKSCREEN_LAYER_BACK
|
SILKSCREEN_LAYER_FRONT
);
if
(
layersmask_plotpads
)
...
...
@@ -129,8 +129,8 @@ void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* aPlotter, int aLayerMask, EDA_DRAW
for
(
MODULE
*
module
=
m_Pcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
// see if we want to plot VALUE and REF fields
trace_val
=
plot_opts
.
m_PlotValue
;
trace_ref
=
plot_opts
.
m_PlotReference
;
trace_val
=
plot_opts
.
GetPlotValue
()
;
trace_ref
=
plot_opts
.
GetPlotReference
()
;
TEXTE_MODULE
*
text
=
module
->
m_Reference
;
unsigned
textLayer
=
text
->
GetLayer
();
...
...
@@ -149,7 +149,7 @@ module\n %s's \"reference\" text." ),
if
(
(
(
1
<<
textLayer
)
&
aLayerMask
)
==
0
)
trace_ref
=
false
;
if
(
!
text
->
IsVisible
()
&&
!
plot_opts
.
m_PlotInvisibleTexts
)
if
(
!
text
->
IsVisible
()
&&
!
plot_opts
.
GetPlotInvisibleText
()
)
trace_ref
=
false
;
text
=
module
->
m_Value
;
...
...
@@ -169,7 +169,7 @@ module\n %s's \"value\" text." ),
if
(
(
(
1
<<
textLayer
)
&
aLayerMask
)
==
0
)
trace_val
=
false
;
if
(
!
text
->
IsVisible
()
&&
!
plot_opts
.
m_PlotInvisibleTexts
)
if
(
!
text
->
IsVisible
()
&&
!
plot_opts
.
GetPlotInvisibleText
()
)
trace_val
=
false
;
// Plot text fields, if allowed
...
...
@@ -186,10 +186,10 @@ module\n %s's \"value\" text." ),
if
(
pt_texte
->
Type
()
!=
PCB_MODULE_TEXT_T
)
continue
;
if
(
!
plot_opts
.
m_PlotTextOther
)
if
(
!
plot_opts
.
GetPlotOtherText
()
)
continue
;
if
(
!
pt_texte
->
IsVisible
()
&&
!
plot_opts
.
m_PlotInvisibleTexts
)
if
(
!
pt_texte
->
IsVisible
()
&&
!
plot_opts
.
GetPlotInvisibleText
()
)
continue
;
textLayer
=
pt_texte
->
GetLayer
();
...
...
@@ -417,7 +417,7 @@ void Plot_1_EdgeModule( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts,
double
endAngle
=
startAngle
+
aEdge
->
GetAngle
();
if
(
(
aPlotOpts
.
Get
Plot
Format
()
==
PLOT_FORMAT_DXF
)
&&
if
(
(
aPlotOpts
.
GetFormat
()
==
PLOT_FORMAT_DXF
)
&&
(
masque_layer
&
(
SILKSCREEN_LAYER_BACK
|
DRAW_LAYER
|
COMMENT_LAYER
)
)
)
aPlotter
->
ThickArc
(
pos
,
-
startAngle
,
-
endAngle
,
radius
,
thickness
,
trace_mode
);
...
...
@@ -607,7 +607,7 @@ void PlotDrawSegment( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, DRAWS
return
;
if
(
trace_mode
==
LINE
)
thickness
=
aPlotOpts
.
m_PlotLineWidth
;
thickness
=
aPlotOpts
.
GetLineWidth
()
;
else
thickness
=
aSeg
->
GetWidth
();
...
...
@@ -658,7 +658,7 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* aPlotter, int Layer, EDA_DRAW_MODE_T t
// in addition to the contents of the currently specified layer.
int
layer_mask
=
GetLayerMask
(
Layer
);
if
(
!
plot_opts
.
m_ExcludeEdgeLayer
)
if
(
!
plot_opts
.
GetExcludeEdgeLayer
()
)
layer_mask
|=
EDGE_LAYER
;
switch
(
Layer
)
...
...
@@ -679,15 +679,15 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* aPlotter, int Layer, EDA_DRAW_MODE_T t
case
LAYER_N_14
:
case
LAYER_N_15
:
case
LAST_COPPER_LAYER
:
Plot_Standard_Layer
(
aPlotter
,
layer_mask
,
true
,
trace_mode
,
plot_opts
.
m_SkipNPTH_Pads
);
// The last true make it skip NPTH pad plotting
Plot_Standard_Layer
(
aPlotter
,
layer_mask
,
true
,
trace_mode
,
true
);
// Adding drill marks, if required and if the plotter is able to plot them:
if
(
plot_opts
.
m_DrillShapeOpt
!=
PCB_PLOT_PARAMS
::
NO_DRILL_SHAPE
)
if
(
plot_opts
.
GetDrillMarksType
()
!=
PCB_PLOT_PARAMS
::
NO_DRILL_SHAPE
)
{
if
(
aPlotter
->
GetPlotterType
()
==
PLOT_FORMAT_POST
)
PlotDrillMark
(
aPlotter
,
trace_mode
,
plot_opts
.
m_DrillShapeOpt
==
plot_opts
.
GetDrillMarksType
()
==
PCB_PLOT_PARAMS
::
SMALL_DRILL_SHAPE
);
}
...
...
@@ -696,7 +696,7 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* aPlotter, int Layer, EDA_DRAW_MODE_T t
case
SOLDERMASK_N_BACK
:
case
SOLDERMASK_N_FRONT
:
Plot_Standard_Layer
(
aPlotter
,
layer_mask
,
plot_opts
.
m_PlotViaOnMaskLayer
,
trace_mode
);
plot_opts
.
GetPlotViaOnMaskLayer
()
,
trace_mode
);
break
;
case
SOLDERPASTE_N_BACK
:
...
...
@@ -724,7 +724,7 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* aPlotter, int Layer, EDA_DRAW_MODE_T t
// Set layer polarity to negative
aPlotter
->
SetLayerPolarity
(
false
);
Plot_Standard_Layer
(
aPlotter
,
layer_mask
,
plot_opts
.
m_PlotViaOnMaskLayer
,
plot_opts
.
GetPlotViaOnMaskLayer
()
,
trace_mode
);
}
...
...
@@ -1012,7 +1012,7 @@ void PCB_BASE_FRAME::PlotDrillMark( PLOTTER* aPlotter,
pos
=
pts
->
m_Start
;
// It is quite possible that the real drill value is less then small drill value.
if
(
plot_opts
.
m_DrillShapeOpt
==
PCB_PLOT_PARAMS
::
SMALL_DRILL_SHAPE
)
if
(
plot_opts
.
GetDrillMarksType
()
==
PCB_PLOT_PARAMS
::
SMALL_DRILL_SHAPE
)
diam
.
x
=
diam
.
y
=
MIN
(
SMALL_DRILL
,
pts
->
GetDrillValue
()
);
else
diam
.
x
=
diam
.
y
=
pts
->
GetDrillValue
();
...
...
pcbnew/plotdxf.cpp
View file @
137066e5
...
...
@@ -36,8 +36,8 @@ bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer,
plotter
->
SetFilename
(
aFullFileName
);
plotter
->
StartPlot
(
output_file
);
if
(
plot_opts
.
m_PlotFrameRef
)
PlotWorkSheet
(
plotter
,
GetScreen
(),
plot_opts
.
Get
Plot
LineWidth
()
);
if
(
plot_opts
.
GetPlotFrameRef
()
)
PlotWorkSheet
(
plotter
,
GetScreen
(),
plot_opts
.
GetLineWidth
()
);
Plot_Layer
(
plotter
,
aLayer
,
aTraceMode
);
plotter
->
EndPlot
();
...
...
pcbnew/plotgerb.cpp
View file @
137066e5
...
...
@@ -37,7 +37,7 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
wxPoint
offset
;
// Calculate scaling from Pcbnew units (in 0.1 mil or 0.0001 inch) to gerber units
double
scale
=
plot_opts
.
m_PlotScale
;
double
scale
=
plot_opts
.
GetScale
()
;
if
(
aPlotOriginIsAuxAxis
)
{
...
...
@@ -55,29 +55,22 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
// No mirror and scaling for gerbers!
plotter
->
SetViewport
(
offset
,
IU_PER_DECIMILS
,
scale
,
0
);
plotter
->
SetDefaultLineWidth
(
plot_opts
.
m_PlotLineWidth
);
plotter
->
SetDefaultLineWidth
(
plot_opts
.
GetLineWidth
()
);
plotter
->
SetCreator
(
wxT
(
"PCBNEW-RS274X"
)
);
plotter
->
SetFilename
(
aFullFileName
);
if
(
plotter
->
StartPlot
(
output_file
)
)
{
// Skip NPTH pads on copper layers
// ( only if hole size == pad size ):
if
(
(
aLayer
>=
LAYER_N_BACK
)
&&
(
aLayer
<=
LAYER_N_FRONT
)
)
plot_opts
.
m_SkipNPTH_Pads
=
true
;
SetPlotSettings
(
plot_opts
);
// Sheet refs on gerber CAN be useful... and they're always 1:1
if
(
plot_opts
.
m_PlotFrameRef
)
PlotWorkSheet
(
plotter
,
GetScreen
(),
plot_opts
.
Get
Plot
LineWidth
()
);
if
(
plot_opts
.
GetPlotFrameRef
()
)
PlotWorkSheet
(
plotter
,
GetScreen
(),
plot_opts
.
GetLineWidth
()
);
Plot_Layer
(
plotter
,
aLayer
,
aTraceMode
);
plotter
->
EndPlot
();
plot_opts
.
m_SkipNPTH_Pads
=
false
;
SetPlotSettings
(
plot_opts
);
}
else
// error in start_plot( ): failed opening a temporary file
...
...
pcbnew/plothpgl.cpp
View file @
137066e5
...
...
@@ -58,22 +58,22 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
// Compute pen_dim (from m_HPGLPenDiam in mils) in pcb units,
// with plot scale (if Scale is 2, pen diameter value is always m_HPGLPenDiam
// so apparent pen diam is real pen diam / Scale
int
pen_diam
=
KiROUND
(
plot_opts
.
m_HPGLPenDiam
*
IU_PER_MILS
/
plot_opts
.
m_PlotScale
);
int
pen_diam
=
KiROUND
(
plot_opts
.
GetHPGLPenDiameter
()
*
IU_PER_MILS
/
plot_opts
.
GetScale
()
);
// compute pen_overlay (from m_HPGLPenOvr in mils) in pcb units
// with plot scale
if
(
plot_opts
.
m_HPGLPenOvr
<
0
)
plot_opts
.
m_HPGLPenOvr
=
0
;
if
(
plot_opts
.
GetHPGLPenOverlay
()
<
1
)
plot_opts
.
SetHPGLPenOverlay
(
0
)
;
if
(
plot_opts
.
m_HPGLPenOvr
>=
plot_opts
.
m_HPGLPenDiam
)
plot_opts
.
m_HPGLPenOvr
=
plot_opts
.
m_HPGLPenDiam
-
1
;
if
(
plot_opts
.
GetHPGLPenOverlay
()
>=
plot_opts
.
GetHPGLPenDiameter
()
)
plot_opts
.
SetHPGLPenOverlay
(
plot_opts
.
GetHPGLPenDiameter
()
-
1
)
;
int
pen_overlay
=
KiROUND
(
plot_opts
.
m_HPGLPenOvr
*
IU_PER_MILS
/
plot_opts
.
m_PlotScale
);
int
pen_overlay
=
KiROUND
(
plot_opts
.
GetHPGLPenOverlay
()
*
IU_PER_MILS
/
plot_opts
.
GetScale
()
);
if
(
plot_opts
.
m_PlotScale
!=
1.0
||
plot_opts
.
m_AutoScale
)
if
(
plot_opts
.
GetScale
()
!=
1.0
||
plot_opts
.
GetAutoScale
()
)
{
// when scale != 1.0 we must calculate the position in page
// because actual position has no meaning
...
...
@@ -88,7 +88,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
boardSize
=
bbbox
.
GetSize
();
boardCenter
=
bbbox
.
Centre
();
if
(
plot_opts
.
m_AutoScale
)
// Optimum scale
if
(
plot_opts
.
GetAutoScale
()
)
// Optimum scale
{
// Fit to 80% of the page
double
Xscale
=
(
(
pageSizeIU
.
x
*
0.8
)
/
boardSize
.
x
);
...
...
@@ -97,7 +97,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
}
else
{
scale
=
plot_opts
.
m_PlotScale
;
scale
=
plot_opts
.
GetScale
()
;
}
// Calculate the page size offset.
...
...
@@ -122,19 +122,19 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
SetPlotSettings
(
plot_opts
);
plotter
->
SetViewport
(
offset
,
IU_PER_DECIMILS
,
scale
,
plot_opts
.
m_PlotMirror
);
plotter
->
SetDefaultLineWidth
(
plot_opts
.
m_PlotLineWidth
);
plot_opts
.
GetMirror
()
);
plotter
->
SetDefaultLineWidth
(
plot_opts
.
GetLineWidth
()
);
plotter
->
SetCreator
(
wxT
(
"PCBNEW-HPGL"
)
);
plotter
->
SetFilename
(
aFullFileName
);
plotter
->
SetPenSpeed
(
plot_opts
.
m_HPGLPenSpeed
);
plotter
->
SetPenNumber
(
plot_opts
.
m_HPGLPenNum
);
plotter
->
SetPenSpeed
(
plot_opts
.
GetHPGLPenSpeed
()
);
plotter
->
SetPenNumber
(
plot_opts
.
GetHPGLPenNum
()
);
plotter
->
SetPenOverlap
(
pen_overlay
);
plotter
->
SetPenDiameter
(
pen_diam
);
plotter
->
StartPlot
(
output_file
);
// The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway
if
(
plot_opts
.
m_PlotFrameRef
&&
!
center
)
PlotWorkSheet
(
plotter
,
GetScreen
(),
plot_opts
.
Get
Plot
LineWidth
()
);
if
(
plot_opts
.
GetPlotFrameRef
()
&&
!
center
)
PlotWorkSheet
(
plotter
,
GetScreen
(),
plot_opts
.
GetLineWidth
()
);
Plot_Layer
(
plotter
,
aLayer
,
aTraceMode
);
plotter
->
EndPlot
();
...
...
pcbnew/plotps.cpp
View file @
137066e5
...
...
@@ -46,7 +46,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
return
false
;
}
if
(
plotOpts
.
m_PlotScale
!=
1.0
||
plotOpts
.
m_AutoScale
)
if
(
plotOpts
.
GetScale
()
!=
1.0
||
plotOpts
.
GetAutoScale
()
)
{
// when scale != 1.0 we must calculate the position in page
// because actual position has no meaning
...
...
@@ -54,8 +54,8 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
}
// Set default line width
if
(
plotOpts
.
m_PlotLineWidth
<
1
)
plotOpts
.
m_PlotLineWidth
=
1
;
if
(
plotOpts
.
GetLineWidth
()
<
1
)
plotOpts
.
SetLineWidth
(
1
)
;
wxSize
pageSizeIU
=
GetPageSizeIU
();
...
...
@@ -77,7 +77,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
boardSize
=
bbbox
.
GetSize
();
boardCenter
=
bbbox
.
Centre
();
if
(
plotOpts
.
m_AutoScale
)
// Optimum scale
if
(
plotOpts
.
GetAutoScale
()
)
// Optimum scale
{
// Fit to 80% of the page
double
Xscale
=
(
paperSizeIU
.
x
*
0.8
)
/
boardSize
.
x
;
...
...
@@ -87,7 +87,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
}
else
{
scale
=
plotOpts
.
m_PlotScale
*
paperscale
;
scale
=
plotOpts
.
GetScale
()
*
paperscale
;
}
if
(
center
)
...
...
@@ -108,24 +108,24 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
// why did we have to change these settings?
SetPlotSettings
(
plotOpts
);
plotter
->
SetScaleAdjust
(
plotOpts
.
m_FineScaleAdjustX
,
plotOpts
.
m_FineScaleAdjustY
);
plotter
->
SetPlotWidthAdj
(
plotOpts
.
m_FineWidthAdjust
);
plotter
->
SetScaleAdjust
(
plotOpts
.
GetFineScaleAdjustX
()
,
plotOpts
.
GetFineScaleAdjustY
()
);
plotter
->
SetPlotWidthAdj
(
plotOpts
.
GetWidthAdjust
()
);
plotter
->
SetViewport
(
offset
,
IU_PER_DECIMILS
,
scale
,
plotOpts
.
m_PlotMirror
);
plotter
->
SetDefaultLineWidth
(
plotOpts
.
m_PlotLineWidth
);
plotOpts
.
GetMirror
()
);
plotter
->
SetDefaultLineWidth
(
plotOpts
.
GetLineWidth
()
);
plotter
->
SetCreator
(
wxT
(
"PCBNEW-PS"
)
);
plotter
->
SetFilename
(
aFullFileName
);
plotter
->
StartPlot
(
output_file
);
/* The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway */
if
(
plotOpts
.
m_PlotFrameRef
&&
!
center
)
PlotWorkSheet
(
plotter
,
GetScreen
(),
plotOpts
.
Get
Plot
LineWidth
()
);
if
(
plotOpts
.
GetPlotFrameRef
()
&&
!
center
)
PlotWorkSheet
(
plotter
,
GetScreen
(),
plotOpts
.
GetLineWidth
()
);
// If plot a negative board:
// Draw a black rectangle (background for plot board in white)
// and switch the current color to WHITE
if
(
plotOpts
.
m_PlotPSNegative
)
if
(
plotOpts
.
GetNegative
()
)
{
int
margin
=
500
;
// Add a 0.5 inch margin around the board
plotter
->
SetNegative
(
true
);
...
...
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