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
11d9edfe
Commit
11d9edfe
authored
Jun 29, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beautify files
parent
daeb1901
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
332 additions
and
342 deletions
+332
-342
plot_rtn.cpp
pcbnew/plot_rtn.cpp
+225
-237
plotgerb.cpp
pcbnew/plotgerb.cpp
+14
-14
plothpgl.cpp
pcbnew/plothpgl.cpp
+46
-44
plotps.cpp
pcbnew/plotps.cpp
+47
-47
No files found.
pcbnew/plot_rtn.cpp
View file @
11d9edfe
This diff is collapsed.
Click to expand it.
pcbnew/plotgerb.cpp
View file @
11d9edfe
...
@@ -49,7 +49,7 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
...
@@ -49,7 +49,7 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
offset
.
y
=
0
;
offset
.
y
=
0
;
}
}
FILE
*
output_file
=
wxFopen
(
FullFileName
,
wxT
(
"wt"
)
);
FILE
*
output_file
=
wxFopen
(
FullFileName
,
wxT
(
"wt"
)
);
if
(
output_file
==
NULL
)
if
(
output_file
==
NULL
)
{
{
wxString
msg
=
_
(
"unable to create file "
)
+
FullFileName
;
wxString
msg
=
_
(
"unable to create file "
)
+
FullFileName
;
...
@@ -58,23 +58,23 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
...
@@ -58,23 +58,23 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
}
}
SetLocaleTo_C_standard
();
SetLocaleTo_C_standard
();
Plotter
*
plotter
=
new
Gerber_Plotter
();
Plotter
*
plotter
=
new
Gerber_Plotter
();
/* No mirror and scaling for gerbers! */
/* No mirror and scaling for gerbers! */
plotter
->
set_viewport
(
offset
,
scale
,
0
);
plotter
->
set_viewport
(
offset
,
scale
,
0
);
plotter
->
set_default_line_width
(
g_pcb_plot_options
.
PlotLine_Width
);
plotter
->
set_default_line_width
(
g_pcb_plot_options
.
PlotLine_Width
);
plotter
->
set_creator
(
wxT
(
"PCBNEW-RS274X"
)
);
plotter
->
set_creator
(
wxT
(
"PCBNEW-RS274X"
)
);
plotter
->
set_filename
(
FullFileName
);
plotter
->
set_filename
(
FullFileName
);
Affiche_1_Parametre
(
this
,
0
,
_
(
"File"
),
FullFileName
,
CYAN
);
Affiche_1_Parametre
(
this
,
0
,
_
(
"File"
),
FullFileName
,
CYAN
);
plotter
->
start_plot
(
output_file
);
plotter
->
start_plot
(
output_file
);
// Sheet refs on gerber CAN be useful... and they're always 1:1
// Sheet refs on gerber CAN be useful... and they're always 1:1
if
(
g_pcb_plot_options
.
Plot_Frame_Ref
)
if
(
g_pcb_plot_options
.
Plot_Frame_Ref
)
PlotWorkSheet
(
plotter
,
GetScreen
()
);
PlotWorkSheet
(
plotter
,
GetScreen
()
);
Plot_Layer
(
plotter
,
Layer
,
trace_mode
);
Plot_Layer
(
plotter
,
Layer
,
trace_mode
);
plotter
->
end_plot
();
plotter
->
end_plot
();
delete
plotter
;
delete
plotter
;
SetLocaleTo_Default
();
SetLocaleTo_Default
();
}
}
pcbnew/plothpgl.cpp
View file @
11d9edfe
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
/*****************************************************************************/
/*****************************************************************************/
void
WinEDA_BasePcbFrame
::
Genere_HPGL
(
const
wxString
&
FullFileName
,
int
Layer
,
void
WinEDA_BasePcbFrame
::
Genere_HPGL
(
const
wxString
&
FullFileName
,
int
Layer
,
GRTraceMode
trace_mode
)
GRTraceMode
trace_mode
)
/*****************************************************************************/
/*****************************************************************************/
{
{
wxSize
SheetSize
;
wxSize
SheetSize
;
...
@@ -26,6 +26,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
...
@@ -26,6 +26,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
wxPoint
offset
;
wxPoint
offset
;
MsgPanel
->
EraseMsgBox
();
MsgPanel
->
EraseMsgBox
();
// Compute pen_dim (from g_HPGL_Pen_Diam in mils) in pcb units,
// Compute pen_dim (from g_HPGL_Pen_Diam in mils) in pcb units,
// with plot scale (if Scale is 2, pen diametre is always g_HPGL_Pen_Diam
// with plot scale (if Scale is 2, pen diametre is always g_HPGL_Pen_Diam
// so apparent pen diam is real pen diam / Scale
// so apparent pen diam is real pen diam / Scale
...
@@ -37,9 +38,10 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
...
@@ -37,9 +38,10 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
g_pcb_plot_options
.
HPGL_Pen_Recouvrement
=
0
;
g_pcb_plot_options
.
HPGL_Pen_Recouvrement
=
0
;
if
(
g_pcb_plot_options
.
HPGL_Pen_Recouvrement
>=
g_pcb_plot_options
.
HPGL_Pen_Diam
)
if
(
g_pcb_plot_options
.
HPGL_Pen_Recouvrement
>=
g_pcb_plot_options
.
HPGL_Pen_Diam
)
g_pcb_plot_options
.
HPGL_Pen_Recouvrement
=
g_pcb_plot_options
.
HPGL_Pen_Diam
-
1
;
g_pcb_plot_options
.
HPGL_Pen_Recouvrement
=
g_pcb_plot_options
.
HPGL_Pen_Diam
-
1
;
int
pen_recouvrement
=
wxRound
(
g_pcb_plot_options
.
HPGL_Pen_Recouvrement
*
10.0
/
g_pcb_plot_options
.
Scale
);
int
pen_recouvrement
=
wxRound
(
g_pcb_plot_options
.
HPGL_Pen_Recouvrement
*
10.0
/
g_pcb_plot_options
.
Scale
);
FILE
*
output_file
=
wxFopen
(
FullFileName
,
wxT
(
"wt"
)
);
FILE
*
output_file
=
wxFopen
(
FullFileName
,
wxT
(
"wt"
)
);
if
(
output_file
==
NULL
)
if
(
output_file
==
NULL
)
{
{
wxString
msg
=
_
(
"Unable to create file "
)
+
FullFileName
;
wxString
msg
=
_
(
"Unable to create file "
)
+
FullFileName
;
...
@@ -66,9 +68,10 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
...
@@ -66,9 +68,10 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
if
(
g_pcb_plot_options
.
PlotScaleOpt
==
0
)
// Optimum scale
if
(
g_pcb_plot_options
.
PlotScaleOpt
==
0
)
// Optimum scale
{
{
double
Xscale
,
Yscale
;
double
Xscale
,
Yscale
;
// Fit to 80% of the page
// Fit to 80% of the page
Xscale
=
(
(
SheetSize
.
x
*
0.8
)
/
BoardSize
.
x
);
Xscale
=
(
(
SheetSize
.
x
*
0.8
)
/
BoardSize
.
x
);
Yscale
=
(
(
SheetSize
.
y
*
0.8
)
/
BoardSize
.
y
);
Yscale
=
(
(
SheetSize
.
y
*
0.8
)
/
BoardSize
.
y
);
scale
=
MIN
(
Xscale
,
Yscale
);
scale
=
MIN
(
Xscale
,
Yscale
);
}
}
else
else
...
@@ -77,8 +80,8 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
...
@@ -77,8 +80,8 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
// Calcul du cadrage (echelle != 1 donc recadrage du trace)
// Calcul du cadrage (echelle != 1 donc recadrage du trace)
if
(
Center
)
if
(
Center
)
{
{
offset
.
x
=
BoardCenter
.
x
-
(
SheetSize
.
x
/
2
)
/
scale
;
offset
.
x
=
BoardCenter
.
x
-
(
SheetSize
.
x
/
2
)
/
scale
;
offset
.
y
=
BoardCenter
.
y
-
(
SheetSize
.
y
/
2
)
/
scale
;
offset
.
y
=
BoardCenter
.
y
-
(
SheetSize
.
y
/
2
)
/
scale
;
}
}
else
else
{
{
...
@@ -86,27 +89,26 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
...
@@ -86,27 +89,26 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
offset
.
y
=
0
;
offset
.
y
=
0
;
}
}
HPGL_Plotter
*
plotter
=
new
HPGL_Plotter
();
HPGL_Plotter
*
plotter
=
new
HPGL_Plotter
();
plotter
->
set_paper_size
(
currentsheet
);
plotter
->
set_paper_size
(
currentsheet
);
plotter
->
set_viewport
(
offset
,
scale
,
plotter
->
set_viewport
(
offset
,
scale
,
g_pcb_plot_options
.
PlotOrient
);
g_pcb_plot_options
.
PlotOrient
);
plotter
->
set_default_line_width
(
g_pcb_plot_options
.
PlotLine_Width
);
plotter
->
set_default_line_width
(
g_pcb_plot_options
.
PlotLine_Width
);
plotter
->
set_creator
(
wxT
(
"PCBNEW-HPGL"
)
);
plotter
->
set_creator
(
wxT
(
"PCBNEW-HPGL"
)
);
plotter
->
set_filename
(
FullFileName
);
plotter
->
set_filename
(
FullFileName
);
plotter
->
set_pen_speed
(
g_pcb_plot_options
.
HPGL_Pen_Speed
);
plotter
->
set_pen_speed
(
g_pcb_plot_options
.
HPGL_Pen_Speed
);
plotter
->
set_pen_number
(
g_pcb_plot_options
.
HPGL_Pen_Num
);
plotter
->
set_pen_number
(
g_pcb_plot_options
.
HPGL_Pen_Num
);
plotter
->
set_pen_overlap
(
pen_recouvrement
);
plotter
->
set_pen_overlap
(
pen_recouvrement
);
plotter
->
set_pen_diameter
(
pen_diam
);
plotter
->
set_pen_diameter
(
pen_diam
);
plotter
->
start_plot
(
output_file
);
plotter
->
start_plot
(
output_file
);
/* The worksheet is not significant with scale!=1... It is with
/* The worksheet is not significant with scale!=1... It is with
* paperscale!=1, anyway */
* paperscale!=1, anyway */
if
(
g_pcb_plot_options
.
Plot_Frame_Ref
&&
!
Center
)
if
(
g_pcb_plot_options
.
Plot_Frame_Ref
&&
!
Center
)
PlotWorkSheet
(
plotter
,
GetScreen
()
);
PlotWorkSheet
(
plotter
,
GetScreen
()
);
Plot_Layer
(
plotter
,
Layer
,
trace_mode
);
Plot_Layer
(
plotter
,
Layer
,
trace_mode
);
plotter
->
end_plot
();
plotter
->
end_plot
();
delete
plotter
;
delete
plotter
;
SetLocaleTo_Default
();
SetLocaleTo_Default
();
}
}
pcbnew/plotps.cpp
View file @
11d9edfe
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
/****************************************************************************/
/****************************************************************************/
void
WinEDA_BasePcbFrame
::
Genere_PS
(
const
wxString
&
FullFileName
,
int
Layer
,
void
WinEDA_BasePcbFrame
::
Genere_PS
(
const
wxString
&
FullFileName
,
int
Layer
,
bool
useA4
,
GRTraceMode
trace_mode
)
bool
useA4
,
GRTraceMode
trace_mode
)
/****************************************************************************/
/****************************************************************************/
/* Genere un fichier POSTSCRIPT (*.ps) de trace du circuit, couche layer
/* Genere un fichier POSTSCRIPT (*.ps) de trace du circuit, couche layer
...
@@ -33,7 +33,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
...
@@ -33,7 +33,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
MsgPanel
->
EraseMsgBox
();
MsgPanel
->
EraseMsgBox
();
FILE
*
output_file
=
wxFopen
(
FullFileName
,
wxT
(
"wt"
)
);
FILE
*
output_file
=
wxFopen
(
FullFileName
,
wxT
(
"wt"
)
);
if
(
output_file
==
NULL
)
if
(
output_file
==
NULL
)
{
{
wxString
msg
=
_
(
"Unable to create file "
)
+
FullFileName
;
wxString
msg
=
_
(
"Unable to create file "
)
+
FullFileName
;
...
@@ -77,9 +77,10 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
...
@@ -77,9 +77,10 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
if
(
g_pcb_plot_options
.
PlotScaleOpt
==
0
)
// Optimum scale
if
(
g_pcb_plot_options
.
PlotScaleOpt
==
0
)
// Optimum scale
{
{
double
Xscale
,
Yscale
;
double
Xscale
,
Yscale
;
// Fit to 80% of the page
// Fit to 80% of the page
Xscale
=
(
PaperSize
.
x
*
0.8
)
/
BoardSize
.
x
;
Xscale
=
(
PaperSize
.
x
*
0.8
)
/
BoardSize
.
x
;
Yscale
=
(
PaperSize
.
y
*
0.8
)
/
BoardSize
.
y
;
Yscale
=
(
PaperSize
.
y
*
0.8
)
/
BoardSize
.
y
;
scale
=
MIN
(
Xscale
,
Yscale
);
scale
=
MIN
(
Xscale
,
Yscale
);
}
}
else
else
...
@@ -88,8 +89,8 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
...
@@ -88,8 +89,8 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
// Calcul du cadrage (echelle != 1 donc recadrage du trace)
// Calcul du cadrage (echelle != 1 donc recadrage du trace)
if
(
Center
)
if
(
Center
)
{
{
offset
.
x
=
BoardCenter
.
x
-
(
PaperSize
.
x
/
2
)
/
scale
;
offset
.
x
=
BoardCenter
.
x
-
(
PaperSize
.
x
/
2
)
/
scale
;
offset
.
y
=
BoardCenter
.
y
-
(
PaperSize
.
y
/
2
)
/
scale
;
offset
.
y
=
BoardCenter
.
y
-
(
PaperSize
.
y
/
2
)
/
scale
;
}
}
else
else
{
{
...
@@ -97,20 +98,20 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
...
@@ -97,20 +98,20 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
offset
.
y
=
0
;
offset
.
y
=
0
;
}
}
PS_Plotter
*
plotter
=
new
PS_Plotter
();
PS_Plotter
*
plotter
=
new
PS_Plotter
();
plotter
->
set_paper_size
(
SheetPS
);
plotter
->
set_paper_size
(
SheetPS
);
plotter
->
set_scale_adjust
(
g_pcb_plot_options
.
ScaleAdjX
,
plotter
->
set_scale_adjust
(
g_pcb_plot_options
.
ScaleAdjX
,
g_pcb_plot_options
.
ScaleAdjY
);
g_pcb_plot_options
.
ScaleAdjY
);
plotter
->
set_viewport
(
offset
,
scale
,
plotter
->
set_viewport
(
offset
,
scale
,
g_pcb_plot_options
.
PlotOrient
);
g_pcb_plot_options
.
PlotOrient
);
plotter
->
set_default_line_width
(
g_pcb_plot_options
.
PlotLine_Width
);
plotter
->
set_default_line_width
(
g_pcb_plot_options
.
PlotLine_Width
);
plotter
->
set_creator
(
wxT
(
"PCBNEW-PS"
)
);
plotter
->
set_creator
(
wxT
(
"PCBNEW-PS"
)
);
plotter
->
set_filename
(
FullFileName
);
plotter
->
set_filename
(
FullFileName
);
plotter
->
start_plot
(
output_file
);
plotter
->
start_plot
(
output_file
);
/* The worksheet is not significant with scale!=1... It is with
/* The worksheet is not significant with scale!=1... It is with
* paperscale!=1, anyway */
* paperscale!=1, anyway */
if
(
g_pcb_plot_options
.
Plot_Frame_Ref
&&
!
Center
)
if
(
g_pcb_plot_options
.
Plot_Frame_Ref
&&
!
Center
)
PlotWorkSheet
(
plotter
,
GetScreen
()
);
PlotWorkSheet
(
plotter
,
GetScreen
()
);
// If plot a negative board:
// If plot a negative board:
...
@@ -119,19 +120,18 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
...
@@ -119,19 +120,18 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
if
(
g_pcb_plot_options
.
Plot_PS_Negative
)
if
(
g_pcb_plot_options
.
Plot_PS_Negative
)
{
{
int
margin
=
500
;
// Add a 0.5 inch margin around the board
int
margin
=
500
;
// Add a 0.5 inch margin around the board
plotter
->
set_negative
(
true
);
plotter
->
set_negative
(
true
);
plotter
->
set_color
(
WHITE
);
// Which will be plotted as black
plotter
->
set_color
(
WHITE
);
// Which will be plotted as black
plotter
->
rect
(
wxPoint
(
m_Pcb
->
m_BoundaryBox
.
GetX
()
-
margin
,
plotter
->
rect
(
wxPoint
(
m_Pcb
->
m_BoundaryBox
.
GetX
()
-
margin
,
m_Pcb
->
m_BoundaryBox
.
GetY
()
-
margin
),
m_Pcb
->
m_BoundaryBox
.
GetY
()
-
margin
),
wxPoint
(
m_Pcb
->
m_BoundaryBox
.
GetRight
()
+
margin
,
wxPoint
(
m_Pcb
->
m_BoundaryBox
.
GetRight
()
+
margin
,
m_Pcb
->
m_BoundaryBox
.
GetBottom
()
+
margin
),
m_Pcb
->
m_BoundaryBox
.
GetBottom
()
+
margin
),
FILLED_SHAPE
);
FILLED_SHAPE
);
plotter
->
set_color
(
BLACK
);
plotter
->
set_color
(
BLACK
);
}
}
Plot_Layer
(
plotter
,
Layer
,
trace_mode
);
Plot_Layer
(
plotter
,
Layer
,
trace_mode
);
plotter
->
end_plot
();
plotter
->
end_plot
();
delete
plotter
;
delete
plotter
;
SetLocaleTo_Default
();
SetLocaleTo_Default
();
}
}
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