Fix some minor bugs in plot functions
This commit is contained in:
parent
7f07b48e88
commit
de471744cd
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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( aWidth >= 0 )
|
||||
aWidth = Clamp_Text_PenSize( aWidth, aSize, aBold );
|
||||
if( textPensize == 0 && aBold ) // Use default values if aWidth == 0
|
||||
textPensize = GetPenSizeForBold( MIN( aSize.x, aSize.y ) );
|
||||
|
||||
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 );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -25,62 +25,28 @@
|
|||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">DIALOG_PLOT_BASE</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Plot</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -206,10 +172,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -392,10 +354,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -1539,10 +1497,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -1714,10 +1668,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -1889,10 +1839,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -2064,10 +2010,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Pen size used to draw items that have no pen size specified.
Used mainly to draw items in sketch mode.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -2644,10 +2586,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -2822,10 +2760,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -3011,10 +2945,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -3225,10 +3155,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -3414,10 +3340,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -3603,10 +3525,6 @@
|
|||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
|
|
@ -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_DECIMILS)
|
||||
#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_OVERLAY_MIN 0
|
||||
#define HPGL_PEN_OVERLAY_MAX 0x100
|
||||
#define HPGL_PEN_OVERLAP_MIN 0
|
||||
#define HPGL_PEN_OVERLAP_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 = 60;
|
||||
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_OVERLAY_MIN, HPGL_PEN_OVERLAY_MAX );
|
||||
return setInt( &m_HPGLPenOvr, aValue, HPGL_PEN_OVERLAP_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_OVERLAY_MIN,
|
||||
HPGL_PEN_OVERLAY_MIN );
|
||||
aPcbPlotParams->m_HPGLPenOvr = ParseInt( HPGL_PEN_OVERLAP_MIN,
|
||||
HPGL_PEN_OVERLAP_MAX );
|
||||
break;
|
||||
case T_pscolor:
|
||||
aPcbPlotParams->m_PlotPSColorOpt = ParseBool();
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue