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
eed97c54
Commit
eed97c54
authored
Feb 06, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plotter output file being left open fix.
parent
d958f92c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
36 deletions
+32
-36
plot_common.h
include/plot_common.h
+15
-15
plot_board_layers.cpp
pcbnew/plot_board_layers.cpp
+17
-21
No files found.
include/plot_common.h
View file @
eed97c54
...
@@ -59,7 +59,7 @@ class PLOTTER
...
@@ -59,7 +59,7 @@ class PLOTTER
public
:
public
:
static
const
int
DEFAULT_LINE_WIDTH
=
-
1
;
static
const
int
DEFAULT_LINE_WIDTH
=
-
1
;
PLOTTER
(
);
PLOTTER
();
virtual
~
PLOTTER
();
virtual
~
PLOTTER
();
...
@@ -127,7 +127,7 @@ public:
...
@@ -127,7 +127,7 @@ public:
* transfers or some kind of film)
* transfers or some kind of film)
*/
*/
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
double
aScale
,
bool
aMirror
)
=
0
;
double
aScale
,
bool
aMirror
)
=
0
;
/**
/**
* Open or create the plot file aFullFilename
* Open or create the plot file aFullFilename
...
@@ -194,7 +194,7 @@ public:
...
@@ -194,7 +194,7 @@ public:
* @param aWidth = line width
* @param aWidth = line width
*/
*/
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
FILL_T
aFill
,
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
FILL_T
aFill
,
int
aWidth
=
DEFAULT_LINE_WIDTH
)
=
0
;
int
aWidth
=
DEFAULT_LINE_WIDTH
)
=
0
;
/**
/**
* Function PlotImage
* Function PlotImage
...
@@ -279,7 +279,7 @@ public:
...
@@ -279,7 +279,7 @@ public:
*/
*/
virtual
void
SetTextMode
(
PlotTextMode
mode
)
virtual
void
SetTextMode
(
PlotTextMode
mode
)
{
{
// NOP for most plotters
// NOP for most plotters
}
}
protected
:
protected
:
...
@@ -390,9 +390,9 @@ public:
...
@@ -390,9 +390,9 @@ public:
}
}
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
double
aScale
,
bool
aMirror
);
double
aScale
,
bool
aMirror
);
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
...
@@ -532,13 +532,13 @@ public:
...
@@ -532,13 +532,13 @@ public:
virtual
void
SetDash
(
bool
dashed
);
virtual
void
SetDash
(
bool
dashed
);
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
double
aScale
,
bool
aMirror
);
double
aScale
,
bool
aMirror
);
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Arc
(
const
wxPoint
&
centre
,
int
StAngle
,
int
EndAngle
,
virtual
void
Arc
(
const
wxPoint
&
centre
,
int
StAngle
,
int
EndAngle
,
int
rayon
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
rayon
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
FILL_T
aFill
,
int
aWidth
=
DEFAULT_LINE_WIDTH
);
FILL_T
aFill
,
int
aWidth
=
DEFAULT_LINE_WIDTH
);
...
@@ -599,13 +599,13 @@ public:
...
@@ -599,13 +599,13 @@ public:
* with the outputFile open (but not inside a page stream!) */
* with the outputFile open (but not inside a page stream!) */
virtual
void
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
);
virtual
void
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
);
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
double
aScale
,
bool
aMirror
);
double
aScale
,
bool
aMirror
);
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Arc
(
const
wxPoint
&
centre
,
int
StAngle
,
int
EndAngle
,
virtual
void
Arc
(
const
wxPoint
&
centre
,
int
StAngle
,
int
EndAngle
,
int
rayon
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
rayon
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
FILL_T
aFill
,
int
aWidth
=
DEFAULT_LINE_WIDTH
);
FILL_T
aFill
,
int
aWidth
=
DEFAULT_LINE_WIDTH
);
...
@@ -666,13 +666,13 @@ public:
...
@@ -666,13 +666,13 @@ public:
virtual
void
SetDash
(
bool
dashed
);
virtual
void
SetDash
(
bool
dashed
);
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
double
aScale
,
bool
aMirror
);
double
aScale
,
bool
aMirror
);
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Arc
(
const
wxPoint
&
centre
,
int
StAngle
,
int
EndAngle
,
virtual
void
Arc
(
const
wxPoint
&
centre
,
int
StAngle
,
int
EndAngle
,
int
rayon
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
rayon
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
virtual
void
PlotPoly
(
const
std
::
vector
<
wxPoint
>&
aCornerList
,
FILL_T
aFill
,
int
aWidth
=
DEFAULT_LINE_WIDTH
);
FILL_T
aFill
,
int
aWidth
=
DEFAULT_LINE_WIDTH
);
...
@@ -775,7 +775,7 @@ public:
...
@@ -775,7 +775,7 @@ public:
virtual
void
SetDash
(
bool
dashed
)
{};
virtual
void
SetDash
(
bool
dashed
)
{};
virtual
void
SetColor
(
EDA_COLOR_T
color
)
{};
virtual
void
SetColor
(
EDA_COLOR_T
color
)
{};
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
double
aScale
,
bool
aMirror
);
double
aScale
,
bool
aMirror
);
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
...
@@ -803,7 +803,7 @@ protected:
...
@@ -803,7 +803,7 @@ protected:
void
emitDcode
(
const
DPOINT
&
pt
,
int
dcode
);
void
emitDcode
(
const
DPOINT
&
pt
,
int
dcode
);
std
::
vector
<
APERTURE
>::
iterator
std
::
vector
<
APERTURE
>::
iterator
getAperture
(
const
wxSize
&
size
,
APERTURE
::
APERTURE_TYPE
type
);
getAperture
(
const
wxSize
&
size
,
APERTURE
::
APERTURE_TYPE
type
);
FILE
*
workFile
;
FILE
*
workFile
;
FILE
*
finalFile
;
FILE
*
finalFile
;
...
@@ -861,7 +861,7 @@ public:
...
@@ -861,7 +861,7 @@ public:
virtual
void
SetColor
(
EDA_COLOR_T
color
);
virtual
void
SetColor
(
EDA_COLOR_T
color
);
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
virtual
void
SetViewport
(
const
wxPoint
&
aOffset
,
double
aIusPerDecimil
,
double
aScale
,
bool
aMirror
);
double
aScale
,
bool
aMirror
);
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
virtual
void
Rect
(
const
wxPoint
&
p1
,
const
wxPoint
&
p2
,
FILL_T
fill
,
int
width
=
DEFAULT_LINE_WIDTH
);
int
width
=
DEFAULT_LINE_WIDTH
);
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
virtual
void
Circle
(
const
wxPoint
&
pos
,
int
diametre
,
FILL_T
fill
,
...
...
pcbnew/plot_board_layers.cpp
View file @
eed97c54
...
@@ -784,22 +784,18 @@ static void ConfigureHPGLPenSizes( HPGL_PLOTTER *aPlotter,
...
@@ -784,22 +784,18 @@ static void ConfigureHPGLPenSizes( HPGL_PLOTTER *aPlotter,
* Return the plotter object if OK, NULL if the file is not created
* Return the plotter object if OK, NULL if the file is not created
* (or has a problem)
* (or has a problem)
*/
*/
PLOTTER
*
StartPlotBoard
(
BOARD
*
aBoard
,
PCB_PLOT_PARAMS
*
aPlotOpts
,
PLOTTER
*
StartPlotBoard
(
BOARD
*
aBoard
,
PCB_PLOT_PARAMS
*
aPlotOpts
,
const
wxString
&
aFullFileName
,
const
wxString
&
aFullFileName
,
const
wxString
&
aSheetDesc
)
const
wxString
&
aSheetDesc
)
{
{
FILE
*
output_file
=
wxFopen
(
aFullFileName
,
wxT
(
"wt"
)
);
if
(
output_file
==
NULL
)
return
NULL
;
// Create the plotter driver and set the few plotter specific
// Create the plotter driver and set the few plotter specific
// options
// options
PLOTTER
*
the_plotter
=
NULL
;
PLOTTER
*
plotter
=
NULL
;
switch
(
aPlotOpts
->
GetFormat
()
)
switch
(
aPlotOpts
->
GetFormat
()
)
{
{
case
PLOT_FORMAT_DXF
:
case
PLOT_FORMAT_DXF
:
the_
plotter
=
new
DXF_PLOTTER
();
plotter
=
new
DXF_PLOTTER
();
break
;
break
;
case
PLOT_FORMAT_POST
:
case
PLOT_FORMAT_POST
:
...
@@ -807,11 +803,11 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
...
@@ -807,11 +803,11 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
PS_plotter
=
new
PS_PLOTTER
();
PS_plotter
=
new
PS_PLOTTER
();
PS_plotter
->
SetScaleAdjust
(
aPlotOpts
->
GetFineScaleAdjustX
(),
PS_plotter
->
SetScaleAdjust
(
aPlotOpts
->
GetFineScaleAdjustX
(),
aPlotOpts
->
GetFineScaleAdjustY
()
);
aPlotOpts
->
GetFineScaleAdjustY
()
);
the_
plotter
=
PS_plotter
;
plotter
=
PS_plotter
;
break
;
break
;
case
PLOT_FORMAT_PDF
:
case
PLOT_FORMAT_PDF
:
the_
plotter
=
new
PDF_PLOTTER
();
plotter
=
new
PDF_PLOTTER
();
break
;
break
;
case
PLOT_FORMAT_HPGL
:
case
PLOT_FORMAT_HPGL
:
...
@@ -821,31 +817,32 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
...
@@ -821,31 +817,32 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
/* HPGL options are a little more convoluted to compute, so
/* HPGL options are a little more convoluted to compute, so
they're split in an other function */
they're split in an other function */
ConfigureHPGLPenSizes
(
HPGL_plotter
,
aPlotOpts
);
ConfigureHPGLPenSizes
(
HPGL_plotter
,
aPlotOpts
);
the_
plotter
=
HPGL_plotter
;
plotter
=
HPGL_plotter
;
break
;
break
;
case
PLOT_FORMAT_GERBER
:
case
PLOT_FORMAT_GERBER
:
the_
plotter
=
new
GERBER_PLOTTER
();
plotter
=
new
GERBER_PLOTTER
();
break
;
break
;
case
PLOT_FORMAT_SVG
:
case
PLOT_FORMAT_SVG
:
the_
plotter
=
new
SVG_PLOTTER
();
plotter
=
new
SVG_PLOTTER
();
break
;
break
;
default:
default:
wxASSERT
(
false
);
wxASSERT
(
false
);
return
NULL
;
}
}
// Compute the viewport and set the other options
// Compute the viewport and set the other options
initializePlotter
(
the_
plotter
,
aBoard
,
aPlotOpts
);
initializePlotter
(
plotter
,
aBoard
,
aPlotOpts
);
if
(
the_
plotter
->
OpenFile
(
aFullFileName
)
)
if
(
plotter
->
OpenFile
(
aFullFileName
)
)
{
{
the_
plotter
->
StartPlot
();
plotter
->
StartPlot
();
// Plot the frame reference if requested
// Plot the frame reference if requested
if
(
aPlotOpts
->
GetPlotFrameRef
()
)
if
(
aPlotOpts
->
GetPlotFrameRef
()
)
PlotWorkSheet
(
the_
plotter
,
aBoard
->
GetTitleBlock
(),
PlotWorkSheet
(
plotter
,
aBoard
->
GetTitleBlock
(),
aBoard
->
GetPageSettings
(),
aBoard
->
GetPageSettings
(),
1
,
1
,
// Only one page
1
,
1
,
// Only one page
aSheetDesc
,
aBoard
->
GetFileName
()
);
aSheetDesc
,
aBoard
->
GetFileName
()
);
...
@@ -857,13 +854,12 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
...
@@ -857,13 +854,12 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
if
(
aPlotOpts
->
GetNegative
()
)
if
(
aPlotOpts
->
GetNegative
()
)
{
{
EDA_RECT
bbox
=
aBoard
->
ComputeBoundingBox
();
EDA_RECT
bbox
=
aBoard
->
ComputeBoundingBox
();
FillNegativeKnockout
(
the_
plotter
,
bbox
);
FillNegativeKnockout
(
plotter
,
bbox
);
}
}
return
the_
plotter
;
return
plotter
;
}
}
// error in start_plot( )
delete
plotter
;
delete
the_plotter
;
// will close also output_file
return
NULL
;
return
NULL
;
}
}
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