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
de471744
Commit
de471744
authored
Jun 09, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some minor bugs in plot functions
parent
7f07b48e
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
4400 additions
and
4371 deletions
+4400
-4371
base_screen.cpp
common/base_screen.cpp
+5
-4
common_plot_functions.cpp
common/common_plot_functions.cpp
+3
-2
drawtxt.cpp
common/drawtxt.cpp
+39
-7
dialog_plot_schematic_DXF.cpp
eeschema/dialogs/dialog_plot_schematic_DXF.cpp
+1
-1
dialog_plot_schematic_HPGL.cpp
eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
+1
-1
dialog_plot_schematic_PDF.cpp
eeschema/dialogs/dialog_plot_schematic_PDF.cpp
+4
-4
dialog_plot_schematic_PS.cpp
eeschema/dialogs/dialog_plot_schematic_PS.cpp
+1
-1
wxstruct.h
include/wxstruct.h
+1
-1
dialog_edit_module_for_BoardEditor.cpp
pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp
+26
-0
dialog_plot_base.fbp
pcbnew/dialogs/dialog_plot_base.fbp
+4219
-4301
pcb_plot_params.cpp
pcbnew/pcb_plot_params.cpp
+14
-13
pcb_plot_params.h
pcbnew/pcb_plot_params.h
+4
-4
pcbplot.cpp
pcbnew/pcbplot.cpp
+43
-14
plotdxf.cpp
pcbnew/plotdxf.cpp
+1
-1
plotgerb.cpp
pcbnew/plotgerb.cpp
+1
-1
plothpgl.cpp
pcbnew/plothpgl.cpp
+35
-14
plotps.cpp
pcbnew/plotps.cpp
+2
-2
No files found.
common/base_screen.cpp
View file @
de471744
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -285,7 +286,7 @@ GRID_TYPE& BASE_SCREEN::GetGrid( size_t aIndex )
}
wxPoint
BASE_SCREEN
::
GetNearestGridPosition
(
const
wxPoint
&
aPosition
,
wxPoint
BASE_SCREEN
::
GetNearestGridPosition
(
const
wxPoint
&
aPosition
,
wxRealPoint
*
aGridSize
)
const
{
wxPoint
pt
;
...
...
common/common_plot_functions.cpp
View file @
de471744
...
...
@@ -19,7 +19,7 @@
/* Plot sheet references
* margin is in mils (1/1000 inch)
*/
void
EDA_DRAW_FRAME
::
PlotWorkSheet
(
PLOTTER
*
plotter
,
BASE_SCREEN
*
screen
)
void
EDA_DRAW_FRAME
::
PlotWorkSheet
(
PLOTTER
*
plotter
,
BASE_SCREEN
*
screen
,
int
aLineWidth
)
{
#define WSTEXTSIZE 50 // Text size in mils
...
...
@@ -46,10 +46,11 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
#endif
bool
italic
=
false
;
bool
thickness
=
0
;
//@todo : use current pen
int
thickness
=
aLineWidth
;
color
=
BLACK
;
plotter
->
SetColor
(
color
);
plotter
->
SetCurrentLineWidth
(
thickness
);
// Plot edge.
ref
.
x
=
pageInfo
.
GetLeftMarginMils
()
*
iusPerMil
;
...
...
common/drawtxt.cpp
View file @
de471744
...
...
@@ -2,6 +2,33 @@
* Functions to draw and plot text on screen
* @file drawtxt.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <common.h>
...
...
@@ -526,15 +553,17 @@ void PLOTTER::Text( const wxPoint& aPos,
bool
aItalic
,
bool
aBold
)
{
if
(
aWidth
==
0
&&
aBold
)
// Use default values if aWidth == 0
aWidth
=
GetPenSizeForBold
(
MIN
(
aSize
.
x
,
aSize
.
y
)
);
int
textPensize
=
aWidth
;
if
(
textPensize
==
0
&&
aBold
)
// Use default values if aWidth == 0
textPensize
=
GetPenSizeForBold
(
MIN
(
aSize
.
x
,
aSize
.
y
)
);
if
(
aWidth
>=
0
)
aWidth
=
Clamp_Text_PenSize
(
aWidth
,
aSize
,
aBold
);
if
(
textPensize
>=
0
)
textPensize
=
Clamp_Text_PenSize
(
aWidth
,
aSize
,
aBold
);
else
aWidth
=
-
Clamp_Text_PenSize
(
-
aWidth
,
aSize
,
aBold
);
textPensize
=
-
Clamp_Text_PenSize
(
-
aWidth
,
aSize
,
aBold
);
SetCurrentLineWidth
(
aWidth
);
SetCurrentLineWidth
(
textPensize
);
if
(
aColor
>=
0
)
...
...
@@ -543,8 +572,11 @@ void PLOTTER::Text( const wxPoint& aPos,
DrawGraphicText
(
NULL
,
NULL
,
aPos
,
aColor
,
aText
,
aOrient
,
aSize
,
aH_justify
,
aV_justify
,
aWidth
,
aItalic
,
textPensize
,
aItalic
,
aBold
,
NULL
,
this
);
if
(
aWidth
!=
textPensize
)
SetCurrentLineWidth
(
aWidth
);
}
eeschema/dialogs/dialog_plot_schematic_DXF.cpp
View file @
de471744
...
...
@@ -241,7 +241,7 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName,
if
(
m_plot_Sheet_Ref
)
{
plotter
->
SetColor
(
BLACK
);
m_Parent
->
PlotWorkSheet
(
plotter
,
screen
);
m_Parent
->
PlotWorkSheet
(
plotter
,
screen
,
g_DrawDefaultLineThickness
);
}
screen
->
Plot
(
plotter
);
...
...
eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
View file @
de471744
...
...
@@ -395,7 +395,7 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_1_Page_HPGL( const wxString& FileName,
plotter
->
SetColor
(
BLACK
);
if
(
s_plot_Sheet_Ref
)
m_Parent
->
PlotWorkSheet
(
plotter
,
screen
);
m_Parent
->
PlotWorkSheet
(
plotter
,
screen
,
g_DrawDefaultLineThickness
);
screen
->
Plot
(
plotter
);
...
...
eeschema/dialogs/dialog_plot_schematic_PDF.cpp
View file @
de471744
...
...
@@ -220,7 +220,7 @@ void DIALOG_PLOT_SCHEMATIC_PDF::createPDFFile()
if
(
first_page
)
{
wxString
msg
;
wxString
plotFileName
=
m_Parent
->
GetUniqueFilenameForCurrentSheet
()
wxString
plotFileName
=
m_Parent
->
GetUniqueFilenameForCurrentSheet
()
+
wxT
(
".pdf"
);
msg
.
Printf
(
_
(
"Plot: %s "
),
GetChars
(
plotFileName
)
);
m_MsgBox
->
AppendText
(
msg
);
...
...
@@ -241,8 +241,8 @@ void DIALOG_PLOT_SCHEMATIC_PDF::createPDFFile()
plotSetupPage
(
plotter
,
screen
);
plotter
->
StartPlot
(
output_file
);
first_page
=
false
;
}
else
}
else
{
/* For the following pages you need to close the (finished) page,
reconfigure, and then start a new one */
...
...
@@ -301,7 +301,7 @@ void DIALOG_PLOT_SCHEMATIC_PDF::plotOneSheet( PDF_PLOTTER* plotter,
if
(
m_plot_Sheet_Ref
)
{
plotter
->
SetColor
(
BLACK
);
m_Parent
->
PlotWorkSheet
(
plotter
,
screen
);
m_Parent
->
PlotWorkSheet
(
plotter
,
screen
,
g_DrawDefaultLineThickness
);
}
screen
->
Plot
(
plotter
);
...
...
eeschema/dialogs/dialog_plot_schematic_PS.cpp
View file @
de471744
...
...
@@ -294,7 +294,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName,
if
(
m_plot_Sheet_Ref
)
{
plotter
->
SetColor
(
BLACK
);
m_Parent
->
PlotWorkSheet
(
plotter
,
screen
);
m_Parent
->
PlotWorkSheet
(
plotter
,
screen
,
g_DrawDefaultLineThickness
);
}
screen
->
Plot
(
plotter
);
...
...
include/wxstruct.h
View file @
de471744
...
...
@@ -686,7 +686,7 @@ public:
int
aNScr
,
int
aScr
,
int
aLnW
,
double
aScalar
,
EDA_COLOR_T
aClr1
=
RED
,
EDA_COLOR_T
aClr2
=
RED
);
void
PlotWorkSheet
(
PLOTTER
*
aPlotter
,
BASE_SCREEN
*
aScreen
);
void
PlotWorkSheet
(
PLOTTER
*
aPlotter
,
BASE_SCREEN
*
aScreen
,
int
aLineWidth
);
/**
* Function GetXYSheetReferences
...
...
pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp
View file @
de471744
...
...
@@ -2,6 +2,32 @@
* Module editor: Dialog box for editing module properties in the pcb editor. *
******************************************************************************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2011 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2012 Dick Hollenbeck, dick@softplc.com
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <class_drawpanel.h>
...
...
pcbnew/dialogs/dialog_plot_base.fbp
View file @
de471744
This diff is collapsed.
Click to expand it.
pcbnew/pcb_plot_params.cpp
View file @
de471744
...
...
@@ -28,18 +28,19 @@
#include <layers_id_colors_and_visibility.h>
#include <plot_common.h>
#include <macros.h>
#include <convert_to_biu.h>
#define PLOT_LINEWIDTH_MIN 0
#define PLOT_LINEWIDTH_MAX (200*IU_PER_
DECI
MILS)
#define PLOT_LINEWIDTH_MAX (200*IU_PER_MILS)
#define HPGL_PEN_DIAMETER_MIN 0
#define HPGL_PEN_DIAMETER_MAX
(100*IU_PER_DECIMILS)
#define HPGL_PEN_SPEED_MIN
0
#define HPGL_PEN_SPEED_MAX
1000
#define HPGL_PEN_DIAMETER_MAX
100 // Unit = mil
#define HPGL_PEN_SPEED_MIN
1 // this param is always in cm/s
#define HPGL_PEN_SPEED_MAX
99 // this param is always in cm/s
#define HPGL_PEN_NUMBER_MIN 1
#define HPGL_PEN_NUMBER_MAX 16
#define HPGL_PEN_OVERLA
Y
_MIN 0
#define HPGL_PEN_OVERLA
Y_MAX 0x100
#define HPGL_PEN_OVERLA
P
_MIN 0
#define HPGL_PEN_OVERLA
P_MAX 50 // Unit = mil
/**
...
...
@@ -47,7 +48,7 @@
* default thickness line value (Frame references) (i.e. = 0 ).
* 0 = single pixel line width.
*/
int
g_DrawDefaultLineThickness
=
6
0
;
int
g_DrawDefaultLineThickness
=
6
*
IU_PER_MILS
;
using
namespace
PCBPLOTPARAMS_T
;
...
...
@@ -88,9 +89,9 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
m_PlotMode
=
FILLED
;
useAuxOrigin
=
false
;
m_HPGLPenNum
=
1
;
m_HPGLPenSpeed
=
20
;
m_HPGLPenDiam
=
15
;
m_HPGLPenOvr
=
2
;
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
;
...
...
@@ -260,7 +261,7 @@ bool PCB_PLOT_PARAMS::SetHpglPenSpeed( int aValue )
bool
PCB_PLOT_PARAMS
::
SetHpglPenOverlay
(
int
aValue
)
{
return
setInt
(
&
m_HPGLPenOvr
,
aValue
,
HPGL_PEN_OVERLA
Y_MIN
,
HPGL_PEN_OVERLAY
_MAX
);
return
setInt
(
&
m_HPGLPenOvr
,
aValue
,
HPGL_PEN_OVERLA
P_MIN
,
HPGL_PEN_OVERLAP
_MAX
);
}
...
...
@@ -344,8 +345,8 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_
HPGL_PEN_DIAMETER_MAX
);
break
;
case
T_hpglpenoverlay
:
aPcbPlotParams
->
m_HPGLPenOvr
=
ParseInt
(
HPGL_PEN_OVERLA
Y
_MIN
,
HPGL_PEN_OVERLA
Y_MIN
);
aPcbPlotParams
->
m_HPGLPenOvr
=
ParseInt
(
HPGL_PEN_OVERLA
P
_MIN
,
HPGL_PEN_OVERLA
P_MAX
);
break
;
case
T_pscolor
:
aPcbPlotParams
->
m_PlotPSColorOpt
=
ParseBool
();
...
...
pcbnew/pcb_plot_params.h
View file @
de471744
...
...
@@ -47,10 +47,10 @@ public:
///< (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
;
int
m_HPGLPenSpeed
;
int
m_HPGLPenDiam
;
int
m_HPGLPenOvr
;
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
...
...
pcbnew/pcbplot.cpp
View file @
de471744
...
...
@@ -2,6 +2,31 @@
* @file pcbnew/pcbplot.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h>
#include <appl_wxstruct.h>
#include <plot_common.h>
...
...
@@ -119,18 +144,20 @@ void DIALOG_PLOT::Init_Dialog()
m_plotFormatOpt
->
SetSelection
(
m_plotOpts
.
GetPlotFormat
()
);
// Set units and value for HPGL pen size.
// Set units and value for HPGL pen size
(this param in in mils)
.
AddUnitSymbol
(
*
m_textPenSize
,
g_UserUnit
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_plotOpts
.
GetHpglPenDiameter
()
*
10
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_plotOpts
.
GetHpglPenDiameter
()
*
IU_PER_MILS
);
m_HPGLPenSizeOpt
->
AppendText
(
msg
);
//
Set units to cm/s for standard HPGL pen speed
.
msg
=
ReturnStringFromValue
(
UNSCALED_UNITS
,
m_plotOpts
.
GetHpglPenSpeed
()
*
10000
);
//
Units are *always* cm/s for HPGL pen speed, from 1 to 99
.
msg
=
ReturnStringFromValue
(
UNSCALED_UNITS
,
m_plotOpts
.
GetHpglPenSpeed
()
);
m_HPGLPenSpeedOpt
->
AppendText
(
msg
);
// Set units and value for HPGL pen overlay.
// Set units and value for HPGL pen overlay
(this param in in mils)
.
AddUnitSymbol
(
*
m_textPenOvr
,
g_UserUnit
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_plotOpts
.
GetHpglPenOverlay
()
*
10
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
m_plotOpts
.
GetHpglPenOverlay
()
*
IU_PER_MILS
);
m_HPGLPenOverlayOpt
->
AppendText
(
msg
);
AddUnitSymbol
(
*
m_textDefaultPenSize
,
g_UserUnit
);
...
...
@@ -448,37 +475,39 @@ void DIALOG_PLOT::applyPlotSettings()
// Update settings from text fields. Rewrite values back to the fields,
// since the values may have been constrained by the setters.
// HPLG pen size
// read HPLG pen size (this param is stored in mils)
wxString
msg
=
m_HPGLPenSizeOpt
->
GetValue
();
int
tmp
=
ReturnValueFromString
(
g_UserUnit
,
msg
);
int
tmp
=
ReturnValueFromString
(
g_UserUnit
,
msg
)
/
IU_PER_MILS
;
if
(
!
tempOptions
.
SetHpglPenDiameter
(
tmp
)
)
{
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
GetHpglPenDiameter
()
*
10
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
GetHpglPenDiameter
()
*
IU_PER_MILS
);
m_HPGLPenSizeOpt
->
SetValue
(
msg
);
msg
.
Printf
(
_
(
"HPGL pen size constrained!
\n
"
)
);
m_messagesBox
->
AppendText
(
msg
);
}
//
HPGL pen speed
//
read HPGL pen speed (this param is stored in cm/s)
msg
=
m_HPGLPenSpeedOpt
->
GetValue
();
tmp
=
ReturnValueFromString
(
UNSCALED_UNITS
,
msg
);
if
(
!
tempOptions
.
SetHpglPenSpeed
(
tmp
)
)
{
msg
=
ReturnStringFromValue
(
UNSCALED_UNITS
,
tempOptions
.
GetHpglPenSpeed
()
*
1000
);
msg
=
ReturnStringFromValue
(
UNSCALED_UNITS
,
tempOptions
.
GetHpglPenSpeed
()
);
m_HPGLPenSpeedOpt
->
SetValue
(
msg
);
msg
.
Printf
(
_
(
"HPGL pen speed constrained!
\n
"
)
);
m_messagesBox
->
AppendText
(
msg
);
}
//
HPGL pen overlay
//
Read HPGL pen overlay (this param is stored in mils)
msg
=
m_HPGLPenOverlayOpt
->
GetValue
();
tmp
=
ReturnValueFromString
(
g_UserUnit
,
msg
);
tmp
=
ReturnValueFromString
(
g_UserUnit
,
msg
)
/
IU_PER_MILS
;
if
(
!
tempOptions
.
SetHpglPenOverlay
(
tmp
)
)
{
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
GetHpglPenOverlay
()
*
10
);
msg
=
ReturnStringFromValue
(
g_UserUnit
,
tempOptions
.
GetHpglPenOverlay
()
*
IU_PER_MILS
);
m_HPGLPenOverlayOpt
->
SetValue
(
msg
);
msg
.
Printf
(
_
(
"HPGL pen overlay constrained!
\n
"
)
);
m_messagesBox
->
AppendText
(
msg
);
...
...
pcbnew/plotdxf.cpp
View file @
de471744
...
...
@@ -37,7 +37,7 @@ bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer,
plotter
->
StartPlot
(
output_file
);
if
(
plot_opts
.
m_PlotFrameRef
)
PlotWorkSheet
(
plotter
,
GetScreen
()
);
PlotWorkSheet
(
plotter
,
GetScreen
()
,
plot_opts
.
GetPlotLineWidth
()
);
Plot_Layer
(
plotter
,
aLayer
,
aTraceMode
);
plotter
->
EndPlot
();
...
...
pcbnew/plotgerb.cpp
View file @
de471744
...
...
@@ -70,7 +70,7 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
// Sheet refs on gerber CAN be useful... and they're always 1:1
if
(
plot_opts
.
m_PlotFrameRef
)
PlotWorkSheet
(
plotter
,
GetScreen
()
);
PlotWorkSheet
(
plotter
,
GetScreen
()
,
plot_opts
.
GetPlotLineWidth
()
);
Plot_Layer
(
plotter
,
aLayer
,
aTraceMode
);
...
...
pcbnew/plothpgl.cpp
View file @
de471744
...
...
@@ -2,19 +2,39 @@
* @file plothpgl.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2012 Dick Hollenbeck, dick@softplc.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h>
#include <common.h>
#include <plot_common.h>
#include <confirm.h>
#include <trigo.h>
#include <wxBasePcbFrame.h>
#include <macros.h>
#include <class_board.h>
#include <pcbnew.h>
#include <protos.h>
#include <pcbplot.h>
#include <convert_to_biu.h>
bool
PCB_BASE_FRAME
::
ExportToHpglFile
(
const
wxString
&
aFullFileName
,
int
aLayer
,
...
...
@@ -35,20 +55,21 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
PCB_PLOT_PARAMS
plot_opts
=
GetPlotSettings
();
// Compute pen_dim (from
g_
m_HPGLPenDiam in mils) in pcb units,
// with plot scale (if Scale is 2, pen diameter
is always g_
m_HPGLPenDiam
// 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
/
int
pen_diam
=
KiROUND
(
plot_opts
.
m_HPGLPenDiam
*
IU_PER_MILS
/
plot_opts
.
m_PlotScale
);
// compute pen_overlay (from g_m_HPGLPenOvr in mils) with plot scale
// 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
.
m_HPGLPenOvr
>=
plot_opts
.
m_HPGLPenDiam
)
plot_opts
.
m_HPGLPenOvr
=
plot_opts
.
m_HPGLPenDiam
-
1
;
int
pen_overlay
=
KiROUND
(
plot_opts
.
m_HPGLPenOvr
*
10.0
/
int
pen_overlay
=
KiROUND
(
plot_opts
.
m_HPGLPenOvr
*
IU_PER_MILS
/
plot_opts
.
m_PlotScale
);
...
...
@@ -72,7 +93,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
// Fit to 80% of the page
double
Xscale
=
(
(
pageSizeIU
.
x
*
0.8
)
/
boardSize
.
x
);
double
Yscale
=
(
(
pageSizeIU
.
y
*
0.8
)
/
boardSize
.
y
);
scale
=
MIN
(
Xscale
,
Yscale
);
scale
=
std
::
min
(
Xscale
,
Yscale
);
}
else
{
...
...
@@ -100,7 +121,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
// why did we have to change these settings above?
SetPlotSettings
(
plot_opts
);
plotter
->
SetViewport
(
offset
,
IU_PER_DECIMILS
,
scale
,
plotter
->
SetViewport
(
offset
,
IU_PER_DECIMILS
,
scale
,
plot_opts
.
m_PlotMirror
);
plotter
->
SetDefaultLineWidth
(
plot_opts
.
m_PlotLineWidth
);
plotter
->
SetCreator
(
wxT
(
"PCBNEW-HPGL"
)
);
...
...
@@ -113,7 +134,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
// The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway
if
(
plot_opts
.
m_PlotFrameRef
&&
!
center
)
PlotWorkSheet
(
plotter
,
GetScreen
()
);
PlotWorkSheet
(
plotter
,
GetScreen
()
,
plot_opts
.
GetPlotLineWidth
()
);
Plot_Layer
(
plotter
,
aLayer
,
aTraceMode
);
plotter
->
EndPlot
();
...
...
pcbnew/plotps.cpp
View file @
de471744
...
...
@@ -111,7 +111,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
plotter
->
SetScaleAdjust
(
plotOpts
.
m_FineScaleAdjustX
,
plotOpts
.
m_FineScaleAdjustY
);
plotter
->
SetPlotWidthAdj
(
plotOpts
.
m_FineWidthAdjust
);
plotter
->
SetViewport
(
offset
,
IU_PER_DECIMILS
,
scale
,
plotter
->
SetViewport
(
offset
,
IU_PER_DECIMILS
,
scale
,
plotOpts
.
m_PlotMirror
);
plotter
->
SetDefaultLineWidth
(
plotOpts
.
m_PlotLineWidth
);
plotter
->
SetCreator
(
wxT
(
"PCBNEW-PS"
)
);
...
...
@@ -121,7 +121,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
/* The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway */
if
(
plotOpts
.
m_PlotFrameRef
&&
!
center
)
PlotWorkSheet
(
plotter
,
GetScreen
()
);
PlotWorkSheet
(
plotter
,
GetScreen
()
,
plotOpts
.
GetPlotLineWidth
()
);
// If plot a negative board:
// Draw a black rectangle (background for plot board in white)
...
...
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