Pcbnew, plot functions: fix bug in SVG plotter, fix a minor other bug when using PS plotter (trcak width fine adjust not working)

and plot code cleaning continued
This commit is contained in:
jean-pierre charras 2012-09-24 08:39:59 +02:00
parent 160560c916
commit cc47e88b9e
16 changed files with 5024 additions and 5012 deletions

View File

@ -430,7 +430,6 @@ void PS_PLOTTER::SetCurrentLineWidth( int width )
currentPenWidth = pen_width; currentPenWidth = pen_width;
} }
void PS_PLOTTER::emitSetRGBColor( double r, double g, double b ) void PS_PLOTTER::emitSetRGBColor( double r, double g, double b )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );

View File

@ -228,15 +228,21 @@ void SVG_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int w
{ {
EDA_RECT rect( p1, wxSize( p2.x -p1.x, p2.y -p1.y ) ); EDA_RECT rect( p1, wxSize( p2.x -p1.x, p2.y -p1.y ) );
rect.Normalize(); rect.Normalize();
DPOINT pos_dev = userToDeviceCoordinates( rect.GetOrigin() ); DPOINT org_dev = userToDeviceCoordinates( rect.GetOrigin() );
DPOINT size_dev = userToDeviceSize( rect.GetSize() ); DPOINT end_dev = userToDeviceCoordinates( rect.GetEnd() );
DSIZE size_dev = end_dev - org_dev;
// Ensure size of rect in device coordinates is > 0
// Inkscape has problems with negative values for width and/or height
DBOX rect_dev( org_dev, size_dev);
rect_dev.Normalize();
setFillMode( fill ); setFillMode( fill );
SetCurrentLineWidth( width ); SetCurrentLineWidth( width );
fprintf( outputFile, fprintf( outputFile,
"<rect x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" rx=\"%g\" />\n", "<rect x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" rx=\"%g\" />\n",
pos_dev.x, pos_dev.y, size_dev.x, size_dev.y, rect_dev.GetPosition().x, rect_dev.GetPosition().y,
rect_dev.GetSize().x, rect_dev.GetSize().y,
0.0 // radius of rounded corners 0.0 // radius of rounded corners
); );
} }

View File

@ -17,9 +17,6 @@ enum PAD_SHAPE_T
PAD_RECT, PAD_RECT,
PAD_OVAL, PAD_OVAL,
PAD_TRAPEZOID, PAD_TRAPEZOID,
PAD_RRECT,
PAD_OCTAGON,
PAD_SQUARE,
}; };

View File

@ -119,21 +119,6 @@ public:
virtual void SetDash( bool dashed ) = 0; virtual void SetDash( bool dashed ) = 0;
/** PLEASE NOTE: the plot width adjustment is actually done by the
* pcbnew routines, the plotter class only carry it along!
* XXX In fact it's only used during postscript plot, I'd move this
* variable as a static in pcbnew/plot_rtn.cpp. Also: why it's double?
* it's added to pad/track size and it's specified in IU, so it should
* be an int */
virtual void SetPlotWidthAdj( double width )
{
}
virtual double GetPlotWidthAdj()
{
return 0.;
}
virtual void SetCreator( const wxString& _creator ) virtual void SetCreator( const wxString& _creator )
{ {
creator = _creator; creator = _creator;
@ -452,7 +437,7 @@ protected:
class PSLIKE_PLOTTER : public PLOTTER class PSLIKE_PLOTTER : public PLOTTER
{ {
public: public:
PSLIKE_PLOTTER() : plotScaleAdjX( 1 ), plotScaleAdjY( 1 ), plotWidthAdj( 0 ), PSLIKE_PLOTTER() : plotScaleAdjX( 1 ), plotScaleAdjY( 1 ),
m_textMode( PLOTTEXTMODE_PHANTOM ) m_textMode( PLOTTEXTMODE_PHANTOM )
{ {
} }
@ -476,20 +461,6 @@ public:
plotScaleAdjY = scaleY; plotScaleAdjY = scaleY;
} }
/**
* Set the 'width adjustment' for the postscript engine
* (useful for controlling toner bleeding during direct transfer)
*/
virtual void SetPlotWidthAdj( double width )
{
plotWidthAdj = width;
}
virtual double GetPlotWidthAdj() const
{
return plotWidthAdj;
}
// Pad routines are handled with lower level primitives // Pad routines are handled with lower level primitives
virtual void FlashPadCircle( const wxPoint& pos, int diametre, virtual void FlashPadCircle( const wxPoint& pos, int diametre,
EDA_DRAW_MODE_T trace_mode ); EDA_DRAW_MODE_T trace_mode );
@ -538,14 +509,9 @@ protected:
int returnPostscriptTextWidth( const wxString& aText, int aXSize, int returnPostscriptTextWidth( const wxString& aText, int aXSize,
bool aItalic, bool aBold ); bool aItalic, bool aBold );
/// Fine user scale /// Fine user scale adjust ( = 1.0 if no correction)
double plotScaleAdjX, plotScaleAdjY; double plotScaleAdjX, plotScaleAdjY;
/** Plot width adjust XXX should be moved in the PCB plotting
* routines!
*/
double plotWidthAdj;
/// How to draw text /// How to draw text
PlotTextMode m_textMode; PlotTextMode m_textMode;
}; };

View File

@ -248,7 +248,11 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName )
PCB_PLOT_PARAMS m_plotOpts; PCB_PLOT_PARAMS m_plotOpts;
m_plotOpts.SetPlotFrameRef( PrintPageRef() ); m_plotOpts.SetPlotFrameRef( PrintPageRef() );
// Adding drill marks
m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE ); m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE );
m_plotOpts.SetSkipPlotNPTH_Pads( false );
m_plotOpts.SetMirror( m_printMirror ); m_plotOpts.SetMirror( m_printMirror );
m_plotOpts.SetFormat( PLOT_FORMAT_SVG ); m_plotOpts.SetFormat( PLOT_FORMAT_SVG );
EDA_COLOR_T color = UNSPECIFIED_COLOR; // Used layer color to plot ref and value EDA_COLOR_T color = UNSPECIFIED_COLOR; // Used layer color to plot ref and value
@ -278,10 +282,7 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName )
if( plotter ) if( plotter )
{ {
plotter->SetColorMode( m_ModeColorOption->GetSelection() == 0 ); plotter->SetColorMode( m_ModeColorOption->GetSelection() == 0 );
PlotStandardLayer( brd, plotter, m_PrintMaskLayer, m_plotOpts, true, false ); PlotStandardLayer( brd, plotter, m_PrintMaskLayer, m_plotOpts );
// Adding drill marks, if required and if the plotter is able to plot them:
if( m_plotOpts.GetDrillMarksType() != PCB_PLOT_PARAMS::NO_DRILL_SHAPE )
PlotDrillMarks( brd, plotter, m_plotOpts );
} }
plotter->EndPlot(); plotter->EndPlot();

View File

@ -61,12 +61,16 @@ void DIALOG_PLOT::Init_Dialog()
m_config->Read( OPTKEY_PLOT_X_FINESCALE_ADJ, &m_XScaleAdjust ); m_config->Read( OPTKEY_PLOT_X_FINESCALE_ADJ, &m_XScaleAdjust );
m_config->Read( OPTKEY_PLOT_Y_FINESCALE_ADJ, &m_YScaleAdjust ); m_config->Read( OPTKEY_PLOT_Y_FINESCALE_ADJ, &m_YScaleAdjust );
m_config->Read( CONFIG_PS_FINEWIDTH_ADJ, &m_PSWidthAdjust );
// m_PSWidthAdjust is stored in mm in user config
double dtmp;
m_config->Read( CONFIG_PS_FINEWIDTH_ADJ, &dtmp, 0 );
m_PSWidthAdjust = KiROUND( dtmp * IU_PER_MM );
// The reasonable width correction value must be in a range of // The reasonable width correction value must be in a range of
// [-(MinTrackWidth-1), +(MinClearanceValue-1)] decimils. // [-(MinTrackWidth-1), +(MinClearanceValue-1)] decimils.
m_WidthAdjustMinValue = -(m_board->GetDesignSettings().m_TrackMinWidth - 1); m_widthAdjustMinValue = -(m_board->GetDesignSettings().m_TrackMinWidth - 1);
m_WidthAdjustMaxValue = m_board->GetSmallestClearanceValue() - 1; m_widthAdjustMaxValue = m_board->GetSmallestClearanceValue() - 1;
switch( m_plotOpts.GetFormat() ) switch( m_plotOpts.GetFormat() )
{ {
@ -130,7 +134,7 @@ void DIALOG_PLOT::Init_Dialog()
m_fineAdjustYscaleOpt->AppendText( msg ); m_fineAdjustYscaleOpt->AppendText( msg );
// Test for a reasonable PS width correction value. Set to 0 if problem. // Test for a reasonable PS width correction value. Set to 0 if problem.
if( m_PSWidthAdjust < m_WidthAdjustMinValue || m_PSWidthAdjust > m_WidthAdjustMaxValue ) if( m_PSWidthAdjust < m_widthAdjustMinValue || m_PSWidthAdjust > m_widthAdjustMaxValue )
m_PSWidthAdjust = 0.; m_PSWidthAdjust = 0.;
msg.Printf( wxT( "%f" ), To_User_Unit( g_UserUnit, m_PSWidthAdjust ) ); msg.Printf( wxT( "%f" ), To_User_Unit( g_UserUnit, m_PSWidthAdjust ) );
@ -289,7 +293,8 @@ PlotFormat DIALOG_PLOT::GetPlotFormat()
return plotFmt[ m_plotFormatOpt->GetSelection() ]; return plotFmt[ m_plotFormatOpt->GetSelection() ];
} }
// Enable or disable widgets according to the plot format selected
// and clear also some optional values
void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
{ {
switch( GetPlotFormat() ) switch( GetPlotFormat() )
@ -311,11 +316,13 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_useGerberExtensions->Enable( false ); m_useGerberExtensions->Enable( false );
m_useGerberExtensions->SetValue( false ); m_useGerberExtensions->SetValue( false );
m_scaleOpt->Enable( false ); m_scaleOpt->Enable( false );
m_scaleOpt->SetSelection( 1 );
m_fineAdjustXscaleOpt->Enable( false ); m_fineAdjustXscaleOpt->Enable( false );
m_fineAdjustYscaleOpt->Enable( false ); m_fineAdjustYscaleOpt->Enable( false );
m_PSFineAdjustWidthOpt->Enable( false ); m_PSFineAdjustWidthOpt->Enable( false );
m_plotPSNegativeOpt->Enable( false ); m_plotPSNegativeOpt->Enable( true );
m_forcePSA4OutputOpt->Enable( false ); m_forcePSA4OutputOpt->Enable( false );
m_forcePSA4OutputOpt->SetValue( false );
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer ); m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer ); m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
@ -469,6 +476,22 @@ static bool setDouble( double* aResult, double aValue, double aMin, double aMax
*aResult = aValue; *aResult = aValue;
return true; return true;
} }
static bool setInt( int* aResult, int aValue, int aMin, int aMax )
{
if( aValue < aMin )
{
*aResult = aMin;
return false;
}
else if( aValue > aMax )
{
*aResult = aMax;
return false;
}
*aResult = aValue;
return true;
}
void DIALOG_PLOT::applyPlotSettings() void DIALOG_PLOT::applyPlotSettings()
@ -476,22 +499,15 @@ void DIALOG_PLOT::applyPlotSettings()
PCB_PLOT_PARAMS tempOptions; PCB_PLOT_PARAMS tempOptions;
tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() ); tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() );
tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() ); tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() ); tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() );
tempOptions.SetPlotPadsOnSilkLayer( m_plotPads_on_Silkscreen->GetValue() ); tempOptions.SetPlotPadsOnSilkLayer( m_plotPads_on_Silkscreen->GetValue() );
tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() ); tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() );
tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() ); tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() );
tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() ); tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() );
tempOptions.SetPlotOtherText( m_plotTextOther->GetValue() ); tempOptions.SetPlotOtherText( m_plotTextOther->GetValue() );
tempOptions.SetPlotInvisibleText( m_plotInvisibleText->GetValue() ); tempOptions.SetPlotInvisibleText( m_plotInvisibleText->GetValue() );
tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() ); tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() );
tempOptions.SetDrillMarksType( static_cast<PCB_PLOT_PARAMS::DrillMarksType> tempOptions.SetDrillMarksType( static_cast<PCB_PLOT_PARAMS::DrillMarksType>
( m_drillShapeOpt->GetSelection() ) ); ( m_drillShapeOpt->GetSelection() ) );
tempOptions.SetMirror( m_plotMirrorOpt->GetValue() ); tempOptions.SetMirror( m_plotMirrorOpt->GetValue() );
@ -581,22 +597,23 @@ void DIALOG_PLOT::applyPlotSettings()
// PS Width correction // PS Width correction
msg = m_PSFineAdjustWidthOpt->GetValue(); msg = m_PSFineAdjustWidthOpt->GetValue();
tmpDouble = ReturnValueFromString( g_UserUnit, msg ); int itmp = ReturnValueFromString( g_UserUnit, msg );
if( !setDouble( &m_PSWidthAdjust, tmpDouble, m_WidthAdjustMinValue, m_WidthAdjustMaxValue ) ) if( !setInt( &m_PSWidthAdjust, itmp, m_widthAdjustMinValue, m_widthAdjustMaxValue ) )
{ {
msg = ReturnStringFromValue( g_UserUnit, m_PSWidthAdjust ); msg = ReturnStringFromValue( g_UserUnit, m_PSWidthAdjust );
m_PSFineAdjustWidthOpt->SetValue( msg ); m_PSFineAdjustWidthOpt->SetValue( msg );
msg.Printf( _( "Width correction constrained!\n" msg.Printf( _( "Width correction constrained!\n"
"The reasonable width correction value must be in a range of\n" "The reasonable width correction value must be in a range of\n"
" [%+f; %+f] (%s) for current design rules!\n" ), " [%+f; %+f] (%s) for current design rules!\n" ),
To_User_Unit( g_UserUnit, m_WidthAdjustMinValue ), To_User_Unit( g_UserUnit, m_widthAdjustMinValue ),
To_User_Unit( g_UserUnit, m_WidthAdjustMaxValue ), To_User_Unit( g_UserUnit, m_widthAdjustMaxValue ),
( g_UserUnit == INCHES ) ? wxT( "\"" ) : wxT( "mm" ) ); ( g_UserUnit == INCHES ) ? wxT( "\"" ) : wxT( "mm" ) );
m_messagesBox->AppendText( msg ); m_messagesBox->AppendText( msg );
} }
m_config->Write( CONFIG_PS_FINEWIDTH_ADJ, m_PSWidthAdjust ); // Store m_PSWidthAdjust in mm in user config
m_config->Write( CONFIG_PS_FINEWIDTH_ADJ, (double)m_PSWidthAdjust / IU_PER_MM );
tempOptions.SetUseGerberExtensions( m_useGerberExtensions->GetValue() ); tempOptions.SetUseGerberExtensions( m_useGerberExtensions->GetValue() );

View File

@ -47,12 +47,12 @@ private:
// plotter X scaling error // plotter X scaling error
double m_YScaleAdjust; // X scale factor adjust to compensate double m_YScaleAdjust; // X scale factor adjust to compensate
// plotter Y scaling error // plotter Y scaling error
double m_PSWidthAdjust; // Global width correction for exact line width int m_PSWidthAdjust; // Global width correction for exact line width
// in postscript output. // in postscript output.
// this is a correction factor for tracks width // this is a correction factor for tracks width
// when plotted // when plotted
double m_WidthAdjustMinValue; // Global track width limits int m_widthAdjustMinValue; // Global track width limits
double m_WidthAdjustMaxValue; // tracks width will be "clipped" whenever the int m_widthAdjustMaxValue; // tracks width will be "clipped" whenever the
// m_PSWidthAdjust to these limits. // m_PSWidthAdjust to these limits.
PCB_PLOT_PARAMS m_plotOpts; PCB_PLOT_PARAMS m_plotOpts;

View File

@ -1,379 +1,379 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_plot_base.h" #include "dialog_plot_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
m_MainSizer = new wxBoxSizer( wxHORIZONTAL ); m_MainSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer12; wxBoxSizer* bSizer12;
bSizer12 = new wxBoxSizer( wxVERTICAL ); bSizer12 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer26; wxBoxSizer* bSizer26;
bSizer26 = new wxBoxSizer( wxHORIZONTAL ); bSizer26 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer27; wxBoxSizer* bSizer27;
bSizer27 = new wxBoxSizer( wxVERTICAL ); bSizer27 = new wxBoxSizer( wxVERTICAL );
m_staticText121 = new wxStaticText( this, wxID_ANY, _("Plot format:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText121 = new wxStaticText( this, wxID_ANY, _("Plot format:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText121->Wrap( -1 ); m_staticText121->Wrap( -1 );
bSizer27->Add( m_staticText121, 0, wxTOP, 5 ); bSizer27->Add( m_staticText121, 0, wxTOP, 5 );
wxString m_plotFormatOptChoices[] = { _("Gerber"), _("Postscript"), _("SVG"), _("DXF"), _("HPGL") }; wxString m_plotFormatOptChoices[] = { _("Gerber"), _("Postscript"), _("SVG"), _("DXF"), _("HPGL") };
int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString ); int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString );
m_plotFormatOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 ); m_plotFormatOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 );
m_plotFormatOpt->SetSelection( 0 ); m_plotFormatOpt->SetSelection( 0 );
bSizer27->Add( m_plotFormatOpt, 0, 0, 5 ); bSizer27->Add( m_plotFormatOpt, 0, 0, 5 );
bSizer26->Add( bSizer27, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); bSizer26->Add( bSizer27, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer28; wxBoxSizer* bSizer28;
bSizer28 = new wxBoxSizer( wxVERTICAL ); bSizer28 = new wxBoxSizer( wxVERTICAL );
m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDir->Wrap( -1 ); m_staticTextDir->Wrap( -1 );
bSizer28->Add( m_staticTextDir, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); bSizer28->Add( m_staticTextDir, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
wxBoxSizer* bSizer29; wxBoxSizer* bSizer29;
bSizer29 = new wxBoxSizer( wxHORIZONTAL ); bSizer29 = new wxBoxSizer( wxHORIZONTAL );
m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_outputDirectoryName->SetToolTip( _("Target directory for plot files. Can be absolute or relative to the board file location.") ); m_outputDirectoryName->SetToolTip( _("Target directory for plot files. Can be absolute or relative to the board file location.") );
bSizer29->Add( m_outputDirectoryName, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); bSizer29->Add( m_outputDirectoryName, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_browseButton = new wxButton( this, wxID_ANY, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0 ); m_browseButton = new wxButton( this, wxID_ANY, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0 );
bSizer29->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); bSizer29->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
bSizer28->Add( bSizer29, 1, wxEXPAND, 5 ); bSizer28->Add( bSizer29, 1, wxEXPAND, 5 );
bSizer26->Add( bSizer28, 1, 0, 5 ); bSizer26->Add( bSizer28, 1, 0, 5 );
bSizer12->Add( bSizer26, 0, wxEXPAND, 5 ); bSizer12->Add( bSizer26, 0, wxEXPAND, 5 );
wxBoxSizer* bUpperSizer; wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
m_LayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers") ), wxHORIZONTAL ); m_LayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers") ), wxHORIZONTAL );
wxArrayString m_layerCheckListBoxChoices; wxArrayString m_layerCheckListBoxChoices;
m_layerCheckListBox = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerCheckListBoxChoices, 0 ); m_layerCheckListBox = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerCheckListBoxChoices, 0 );
m_LayersSizer->Add( m_layerCheckListBox, 1, wxEXPAND, 5 ); m_LayersSizer->Add( m_layerCheckListBox, 1, wxEXPAND, 5 );
bUpperSizer->Add( m_LayersSizer, 1, wxALL|wxEXPAND, 3 ); bUpperSizer->Add( m_LayersSizer, 1, wxALL|wxEXPAND, 3 );
m_PlotOptionsSizer = new wxBoxSizer( wxVERTICAL ); m_PlotOptionsSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbOptionsSizer; wxStaticBoxSizer* sbOptionsSizer;
sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL );
wxBoxSizer* bSizer192; wxBoxSizer* bSizer192;
bSizer192 = new wxBoxSizer( wxHORIZONTAL ); bSizer192 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerPlotItems; wxBoxSizer* bSizerPlotItems;
bSizerPlotItems = new wxBoxSizer( wxVERTICAL ); bSizerPlotItems = new wxBoxSizer( wxVERTICAL );
m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference on all layers"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference on all layers"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerPlotItems->Add( m_plotSheetRef, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); bSizerPlotItems->Add( m_plotSheetRef, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_plotPads_on_Silkscreen = new wxCheckBox( this, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Plot pads on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotPads_on_Silkscreen = new wxCheckBox( this, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Plot pads on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
m_plotPads_on_Silkscreen->SetToolTip( _("Enable/disable print/plot pads on silkscreen layers\nWhen disable, pads are never potted on silkscreen layers\nWhen enable, pads are potted only if they appear on silkscreen layers") ); m_plotPads_on_Silkscreen->SetToolTip( _("Enable/disable print/plot pads on silkscreen layers\nWhen disable, pads are never potted on silkscreen layers\nWhen enable, pads are potted only if they appear on silkscreen layers") );
bSizerPlotItems->Add( m_plotPads_on_Silkscreen, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); bSizerPlotItems->Add( m_plotPads_on_Silkscreen, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerPlotItems->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); bSizerPlotItems->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot module reference on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot module reference on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerPlotItems->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); bSizerPlotItems->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_plotTextOther = new wxCheckBox( this, wxID_ANY, _("Plot other module texts on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotTextOther = new wxCheckBox( this, wxID_ANY, _("Plot other module texts on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
m_plotTextOther->SetToolTip( _("Enable/disable print/plot module field texts on silkscreen layers") ); m_plotTextOther->SetToolTip( _("Enable/disable print/plot module field texts on silkscreen layers") );
bSizerPlotItems->Add( m_plotTextOther, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); bSizerPlotItems->Add( m_plotTextOther, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Plot invisible texts on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Plot invisible texts on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
m_plotInvisibleText->SetToolTip( _("Force print/plot module invisible texts on silkscreen layers") ); m_plotInvisibleText->SetToolTip( _("Force print/plot module invisible texts on silkscreen layers") );
bSizerPlotItems->Add( m_plotInvisibleText, 0, wxALL, 2 ); bSizerPlotItems->Add( m_plotInvisibleText, 0, wxALL, 2 );
m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 );
m_plotNoViaOnMaskOpt->SetToolTip( _("Remove soldermask on vias.") ); m_plotNoViaOnMaskOpt->SetToolTip( _("Remove soldermask on vias.") );
bSizerPlotItems->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 2 ); bSizerPlotItems->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 2 );
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 ); m_excludeEdgeLayerOpt = new wxCheckBox( this, wxID_ANY, _("Exclude PCB edge layer from other layers"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerPlotItems->Add( m_plotMirrorOpt, 0, wxALL, 2 ); m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") );
m_excludeEdgeLayerOpt = new wxCheckBox( this, wxID_ANY, _("Exclude PCB edge layer from other layers"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerPlotItems->Add( m_excludeEdgeLayerOpt, 0, wxALL, 2 );
m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") );
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerPlotItems->Add( m_excludeEdgeLayerOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); bSizerPlotItems->Add( m_plotMirrorOpt, 0, wxALL, 2 );
m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Negative plot"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer192->Add( bSizerPlotItems, 0, wxEXPAND, 5 ); bSizerPlotItems->Add( m_plotPSNegativeOpt, 0, wxALL, 2 );
wxBoxSizer* bSizer14;
bSizer14 = new wxBoxSizer( wxVERTICAL ); bSizer192->Add( bSizerPlotItems, 0, wxEXPAND, 5 );
m_staticText11 = new wxStaticText( this, wxID_ANY, _("Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* bSizer14;
m_staticText11->Wrap( -1 ); bSizer14 = new wxBoxSizer( wxVERTICAL );
bSizer14->Add( m_staticText11, 0, wxRIGHT|wxLEFT, 5 );
m_staticText11 = new wxStaticText( this, wxID_ANY, _("Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 );
wxString m_drillShapeOptChoices[] = { _("None"), _("Small"), _("Actual size") }; m_staticText11->Wrap( -1 );
int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString ); bSizer14->Add( m_staticText11, 0, wxRIGHT|wxLEFT, 5 );
m_drillShapeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 );
m_drillShapeOpt->SetSelection( 0 ); wxString m_drillShapeOptChoices[] = { _("None"), _("Small"), _("Actual size") };
bSizer14->Add( m_drillShapeOpt, 0, wxEXPAND|wxLEFT, 5 ); int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString );
m_drillShapeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 );
m_staticText12 = new wxStaticText( this, wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 ); m_drillShapeOpt->SetSelection( 0 );
m_staticText12->Wrap( -1 ); bSizer14->Add( m_drillShapeOpt, 0, wxEXPAND|wxLEFT, 5 );
bSizer14->Add( m_staticText12, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticText12 = new wxStaticText( this, wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 );
wxString m_scaleOptChoices[] = { _("Auto"), _("1:1"), _("3:2"), _("2:1"), _("3:1") }; m_staticText12->Wrap( -1 );
int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString ); bSizer14->Add( m_staticText12, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_scaleOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 );
m_scaleOpt->SetSelection( 1 ); wxString m_scaleOptChoices[] = { _("Auto"), _("1:1"), _("3:2"), _("2:1"), _("3:1") };
bSizer14->Add( m_scaleOpt, 0, wxEXPAND|wxLEFT, 5 ); int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString );
m_scaleOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 );
m_staticText13 = new wxStaticText( this, wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 ); m_scaleOpt->SetSelection( 1 );
m_staticText13->Wrap( -1 ); bSizer14->Add( m_scaleOpt, 0, wxEXPAND|wxLEFT, 5 );
bSizer14->Add( m_staticText13, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticText13 = new wxStaticText( this, wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 );
wxString m_plotModeOptChoices[] = { _("Line"), _("Filled"), _("Sketch") }; m_staticText13->Wrap( -1 );
int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString ); bSizer14->Add( m_staticText13, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_plotModeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 );
m_plotModeOpt->SetSelection( 0 ); wxString m_plotModeOptChoices[] = { _("Line"), _("Filled"), _("Sketch") };
bSizer14->Add( m_plotModeOpt, 0, wxEXPAND|wxLEFT, 5 ); int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString );
m_plotModeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 );
m_textDefaultPenSize = new wxStaticText( this, wxID_ANY, _("Default linewidth"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotModeOpt->SetSelection( 0 );
m_textDefaultPenSize->Wrap( -1 ); bSizer14->Add( m_plotModeOpt, 0, wxEXPAND|wxLEFT, 5 );
m_textDefaultPenSize->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") );
m_textDefaultPenSize = new wxStaticText( this, wxID_ANY, _("Default linewidth"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer14->Add( m_textDefaultPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_textDefaultPenSize->Wrap( -1 );
m_textDefaultPenSize->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") );
m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") ); bSizer14->Add( m_textDefaultPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer14->Add( m_linesWidth, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 ); m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") );
bSizer192->Add( bSizer14, 1, wxRIGHT|wxLEFT, 3 ); bSizer14->Add( m_linesWidth, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 );
sbOptionsSizer->Add( bSizer192, 0, wxEXPAND, 5 ); bSizer192->Add( bSizer14, 1, wxRIGHT|wxLEFT, 3 );
m_PlotOptionsSizer->Add( sbOptionsSizer, 0, wxALL|wxEXPAND, 3 ); sbOptionsSizer->Add( bSizer192, 0, wxEXPAND, 5 );
m_GerberOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Gerber Options") ), wxVERTICAL );
m_PlotOptionsSizer->Add( sbOptionsSizer, 0, wxALL|wxEXPAND, 3 );
m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use proper filename extensions"), wxDefaultPosition, wxDefaultSize, 0 );
m_useGerberExtensions->SetToolTip( _("Use proper Gerber extensions - .GBL, .GTL, etc...") ); m_GerberOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Gerber Options") ), wxVERTICAL );
m_GerberOptionsSizer->Add( m_useGerberExtensions, 0, wxLEFT|wxRIGHT|wxTOP, 2 ); m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use proper filename extensions"), wxDefaultPosition, wxDefaultSize, 0 );
m_useGerberExtensions->SetToolTip( _("Use proper Gerber extensions - .GBL, .GTL, etc...") );
m_subtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") ); m_GerberOptionsSizer->Add( m_useGerberExtensions, 0, wxLEFT|wxRIGHT|wxTOP, 2 );
m_GerberOptionsSizer->Add( m_subtractMaskFromSilk, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); m_subtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") );
m_useAuxOriginCheckBox = new wxCheckBox( this, wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 );
m_useAuxOriginCheckBox->SetToolTip( _("Use auxiliary axis as coordinates origin in Gerber files.") ); m_GerberOptionsSizer->Add( m_subtractMaskFromSilk, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_GerberOptionsSizer->Add( m_useAuxOriginCheckBox, 0, wxALL, 2 ); m_useAuxOriginCheckBox = new wxCheckBox( this, wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 );
m_useAuxOriginCheckBox->SetToolTip( _("Use auxiliary axis as coordinates origin in Gerber files.") );
m_PlotOptionsSizer->Add( m_GerberOptionsSizer, 0, wxALL|wxEXPAND, 3 ); m_GerberOptionsSizer->Add( m_useAuxOriginCheckBox, 0, wxALL, 2 );
m_HPGLOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options") ), wxVERTICAL );
m_PlotOptionsSizer->Add( m_GerberOptionsSizer, 0, wxALL|wxEXPAND, 3 );
wxBoxSizer* bSizer22;
bSizer22 = new wxBoxSizer( wxHORIZONTAL ); m_HPGLOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options") ), wxVERTICAL );
wxBoxSizer* bSizer20; wxBoxSizer* bSizer22;
bSizer20 = new wxBoxSizer( wxVERTICAL ); bSizer22 = new wxBoxSizer( wxHORIZONTAL );
m_textPenSize = new wxStaticText( this, wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* bSizer20;
m_textPenSize->Wrap( -1 ); bSizer20 = new wxBoxSizer( wxVERTICAL );
bSizer20->Add( m_textPenSize, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_textPenSize = new wxStaticText( this, wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenSizeOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textPenSize->Wrap( -1 );
bSizer20->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizer20->Add( m_textPenSize, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_textPenOvr = new wxStaticText( this, wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 ); m_HPGLPenSizeOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textPenOvr->Wrap( -1 ); bSizer20->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizer20->Add( m_textPenOvr, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_textPenOvr = new wxStaticText( this, wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textPenOvr->Wrap( -1 );
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") ); bSizer20->Add( m_textPenOvr, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer20->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") );
bSizer22->Add( bSizer20, 1, wxEXPAND, 5 ); bSizer20->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxBoxSizer* bSizer21;
bSizer21 = new wxBoxSizer( wxVERTICAL ); bSizer22->Add( bSizer20, 1, wxEXPAND, 5 );
m_textPenSpeed = new wxStaticText( this, wxID_ANY, _("Pen speed (cm/s):"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* bSizer21;
m_textPenSpeed->Wrap( -1 ); bSizer21 = new wxBoxSizer( wxVERTICAL );
bSizer21->Add( m_textPenSpeed, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_textPenSpeed = new wxStaticText( this, wxID_ANY, _("Pen speed (cm/s):"), wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenSpeedOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textPenSpeed->Wrap( -1 );
m_HPGLPenSpeedOpt->SetToolTip( _("Set pen speed in cm/s") ); bSizer21->Add( m_textPenSpeed, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer21->Add( m_HPGLPenSpeedOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_HPGLPenSpeedOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenSpeedOpt->SetToolTip( _("Set pen speed in cm/s") );
bSizer22->Add( bSizer21, 1, wxEXPAND, 5 ); bSizer21->Add( m_HPGLPenSpeedOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_HPGLOptionsSizer->Add( bSizer22, 1, wxEXPAND, 5 ); bSizer22->Add( bSizer21, 1, wxEXPAND, 5 );
m_PlotOptionsSizer->Add( m_HPGLOptionsSizer, 0, wxALL|wxEXPAND, 3 ); m_HPGLOptionsSizer->Add( bSizer22, 1, wxEXPAND, 5 );
m_PSOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Postscript Options") ), wxVERTICAL );
m_PlotOptionsSizer->Add( m_HPGLOptionsSizer, 0, wxALL|wxEXPAND, 3 );
wxBoxSizer* bSizer17;
bSizer17 = new wxBoxSizer( wxHORIZONTAL ); m_PSOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Postscript Options") ), wxVERTICAL );
wxBoxSizer* bSizer18; wxBoxSizer* bSizer17;
bSizer18 = new wxBoxSizer( wxVERTICAL ); bSizer17 = new wxBoxSizer( wxHORIZONTAL );
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X scale:"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* bSizer18;
m_staticText7->Wrap( -1 ); bSizer18 = new wxBoxSizer( wxVERTICAL );
bSizer18->Add( m_staticText7, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_fineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_staticText7->Wrap( -1 );
m_fineAdjustXscaleOpt->SetToolTip( _("Set global X scale adjust for exact scale postscript output.") ); bSizer18->Add( m_staticText7, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer18->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_fineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fineAdjustXscaleOpt->SetToolTip( _("Set global X scale adjust for exact scale postscript output.") );
bSizer17->Add( bSizer18, 1, wxEXPAND, 5 ); bSizer18->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer19;
bSizer19 = new wxBoxSizer( wxVERTICAL ); bSizer17->Add( bSizer18, 1, wxEXPAND, 5 );
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Y scale:"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* bSizer19;
m_staticText8->Wrap( -1 ); bSizer19 = new wxBoxSizer( wxVERTICAL );
bSizer19->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Y scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_staticText8->Wrap( -1 );
m_fineAdjustYscaleOpt->SetToolTip( _("Set global Y scale adjust for exact scale postscript output.") ); bSizer19->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer19->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fineAdjustYscaleOpt->SetToolTip( _("Set global Y scale adjust for exact scale postscript output.") );
bSizer17->Add( bSizer19, 1, wxEXPAND, 5 ); bSizer19->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer191;
bSizer191 = new wxBoxSizer( wxVERTICAL ); bSizer17->Add( bSizer19, 1, wxEXPAND, 5 );
m_textPSFineAdjustWidth = new wxStaticText( this, wxID_ANY, _("Width correction"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* bSizer191;
m_textPSFineAdjustWidth->Wrap( -1 ); bSizer191 = new wxBoxSizer( wxVERTICAL );
bSizer191->Add( m_textPSFineAdjustWidth, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_textPSFineAdjustWidth = new wxStaticText( this, wxID_ANY, _("Width correction"), wxDefaultPosition, wxDefaultSize, 0 );
m_PSFineAdjustWidthOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textPSFineAdjustWidth->Wrap( -1 );
m_PSFineAdjustWidthOpt->SetToolTip( _("Set global width correction for exact width postscript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)] in decimils.") ); bSizer191->Add( m_textPSFineAdjustWidth, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
bSizer191->Add( m_PSFineAdjustWidthOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_PSFineAdjustWidthOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_PSFineAdjustWidthOpt->SetToolTip( _("Set global width correction for exact width postscript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)] in decimils.") );
bSizer17->Add( bSizer191, 1, wxEXPAND, 5 ); bSizer191->Add( m_PSFineAdjustWidthOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_PSOptionsSizer->Add( bSizer17, 1, wxEXPAND, 5 ); bSizer17->Add( bSizer191, 1, wxEXPAND, 5 );
m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Negative plot"), wxDefaultPosition, wxDefaultSize, 0 );
m_PSOptionsSizer->Add( m_plotPSNegativeOpt, 0, wxALL, 2 ); m_PSOptionsSizer->Add( bSizer17, 1, wxEXPAND, 5 );
m_forcePSA4OutputOpt = new wxCheckBox( this, wxID_ANY, _("Force A4 output"), wxDefaultPosition, wxDefaultSize, 0 ); m_forcePSA4OutputOpt = new wxCheckBox( this, wxID_ANY, _("Force A4 output"), wxDefaultPosition, wxDefaultSize, 0 );
m_PSOptionsSizer->Add( m_forcePSA4OutputOpt, 0, wxALL, 2 ); m_PSOptionsSizer->Add( m_forcePSA4OutputOpt, 0, wxALL, 2 );
m_PlotOptionsSizer->Add( m_PSOptionsSizer, 0, wxALL|wxEXPAND, 3 ); m_PlotOptionsSizer->Add( m_PSOptionsSizer, 0, wxALL|wxEXPAND, 3 );
bUpperSizer->Add( m_PlotOptionsSizer, 0, 0, 5 ); bUpperSizer->Add( m_PlotOptionsSizer, 0, 0, 5 );
bSizer12->Add( bUpperSizer, 0, wxEXPAND, 5 ); bSizer12->Add( bUpperSizer, 0, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerMsg; wxStaticBoxSizer* sbSizerMsg;
sbSizerMsg = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxVERTICAL ); sbSizerMsg = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxVERTICAL );
m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_messagesBox->SetMinSize( wxSize( -1,70 ) ); m_messagesBox->SetMinSize( wxSize( -1,70 ) );
sbSizerMsg->Add( m_messagesBox, 1, wxEXPAND, 5 ); sbSizerMsg->Add( m_messagesBox, 1, wxEXPAND, 5 );
bSizer12->Add( sbSizerMsg, 1, wxEXPAND, 5 ); bSizer12->Add( sbSizerMsg, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerButtons; wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxHORIZONTAL ); bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_plotButton = new wxButton( this, wxID_ANY, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotButton = new wxButton( this, wxID_ANY, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 );
m_plotButton->SetDefault(); m_plotButton->SetDefault();
bSizerButtons->Add( m_plotButton, 0, wxALL, 5 ); bSizerButtons->Add( m_plotButton, 0, wxALL, 5 );
m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate Drill File"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate Drill File"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonDrill, 0, wxALL, 5 ); bSizerButtons->Add( m_buttonDrill, 0, wxALL, 5 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonQuit, 0, wxALL, 5 ); bSizerButtons->Add( m_buttonQuit, 0, wxALL, 5 );
bSizer12->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 ); bSizer12->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
m_MainSizer->Add( bSizer12, 1, wxALL|wxEXPAND, 5 ); m_MainSizer->Add( bSizer12, 1, wxALL|wxEXPAND, 5 );
this->SetSizer( m_MainSizer ); this->SetSizer( m_MainSizer );
this->Layout(); this->Layout();
m_MainSizer->Fit( this ); m_MainSizer->Fit( this );
this->Centre( wxBOTH ); this->Centre( wxBOTH );
// Connect Events // Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnClose ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnClose ) );
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) );
m_plotFormatOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); m_plotFormatOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this );
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this );
m_plotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); m_plotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
} }
DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
{ {
// Disconnect Events // Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnClose ) ); this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnClose ) );
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) );
m_plotFormatOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); m_plotFormatOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this );
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this );
m_plotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); m_plotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,117 +1,117 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_PLOT_BASE_H__ #ifndef __DIALOG_PLOT_BASE_H__
#define __DIALOG_PLOT_BASE_H__ #define __DIALOG_PLOT_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#include "dialog_shim.h" #include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/checklst.h> #include <wx/checklst.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PLOT_BASE /// Class DIALOG_PLOT_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_PLOT_BASE : public DIALOG_SHIM class DIALOG_PLOT_BASE : public DIALOG_SHIM
{ {
private: private:
protected: protected:
enum enum
{ {
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000,
ID_PRINT_REF, ID_PRINT_REF,
ID_MIROR_OPT, ID_MIROR_OPT,
ID_CREATE_DRILL_FILE ID_CREATE_DRILL_FILE
}; };
wxBoxSizer* m_MainSizer; wxBoxSizer* m_MainSizer;
wxStaticText* m_staticText121; wxStaticText* m_staticText121;
wxChoice* m_plotFormatOpt; wxChoice* m_plotFormatOpt;
wxStaticText* m_staticTextDir; wxStaticText* m_staticTextDir;
wxTextCtrl* m_outputDirectoryName; wxTextCtrl* m_outputDirectoryName;
wxButton* m_browseButton; wxButton* m_browseButton;
wxStaticBoxSizer* m_LayersSizer; wxStaticBoxSizer* m_LayersSizer;
wxCheckListBox* m_layerCheckListBox; wxCheckListBox* m_layerCheckListBox;
wxBoxSizer* m_PlotOptionsSizer; wxBoxSizer* m_PlotOptionsSizer;
wxCheckBox* m_plotSheetRef; wxCheckBox* m_plotSheetRef;
wxCheckBox* m_plotPads_on_Silkscreen; wxCheckBox* m_plotPads_on_Silkscreen;
wxCheckBox* m_plotModuleValueOpt; wxCheckBox* m_plotModuleValueOpt;
wxCheckBox* m_plotModuleRefOpt; wxCheckBox* m_plotModuleRefOpt;
wxCheckBox* m_plotTextOther; wxCheckBox* m_plotTextOther;
wxCheckBox* m_plotInvisibleText; wxCheckBox* m_plotInvisibleText;
wxCheckBox* m_plotNoViaOnMaskOpt; wxCheckBox* m_plotNoViaOnMaskOpt;
wxCheckBox* m_plotMirrorOpt; wxCheckBox* m_excludeEdgeLayerOpt;
wxCheckBox* m_excludeEdgeLayerOpt; wxCheckBox* m_plotMirrorOpt;
wxStaticText* m_staticText11; wxCheckBox* m_plotPSNegativeOpt;
wxChoice* m_drillShapeOpt; wxStaticText* m_staticText11;
wxStaticText* m_staticText12; wxChoice* m_drillShapeOpt;
wxChoice* m_scaleOpt; wxStaticText* m_staticText12;
wxStaticText* m_staticText13; wxChoice* m_scaleOpt;
wxChoice* m_plotModeOpt; wxStaticText* m_staticText13;
wxStaticText* m_textDefaultPenSize; wxChoice* m_plotModeOpt;
wxTextCtrl* m_linesWidth; wxStaticText* m_textDefaultPenSize;
wxStaticBoxSizer* m_GerberOptionsSizer; wxTextCtrl* m_linesWidth;
wxCheckBox* m_useGerberExtensions; wxStaticBoxSizer* m_GerberOptionsSizer;
wxCheckBox* m_subtractMaskFromSilk; wxCheckBox* m_useGerberExtensions;
wxCheckBox* m_useAuxOriginCheckBox; wxCheckBox* m_subtractMaskFromSilk;
wxStaticBoxSizer* m_HPGLOptionsSizer; wxCheckBox* m_useAuxOriginCheckBox;
wxStaticText* m_textPenSize; wxStaticBoxSizer* m_HPGLOptionsSizer;
wxTextCtrl* m_HPGLPenSizeOpt; wxStaticText* m_textPenSize;
wxStaticText* m_textPenOvr; wxTextCtrl* m_HPGLPenSizeOpt;
wxTextCtrl* m_HPGLPenOverlayOpt; wxStaticText* m_textPenOvr;
wxStaticText* m_textPenSpeed; wxTextCtrl* m_HPGLPenOverlayOpt;
wxTextCtrl* m_HPGLPenSpeedOpt; wxStaticText* m_textPenSpeed;
wxStaticBoxSizer* m_PSOptionsSizer; wxTextCtrl* m_HPGLPenSpeedOpt;
wxStaticText* m_staticText7; wxStaticBoxSizer* m_PSOptionsSizer;
wxTextCtrl* m_fineAdjustXscaleOpt; wxStaticText* m_staticText7;
wxStaticText* m_staticText8; wxTextCtrl* m_fineAdjustXscaleOpt;
wxTextCtrl* m_fineAdjustYscaleOpt; wxStaticText* m_staticText8;
wxStaticText* m_textPSFineAdjustWidth; wxTextCtrl* m_fineAdjustYscaleOpt;
wxTextCtrl* m_PSFineAdjustWidthOpt; wxStaticText* m_textPSFineAdjustWidth;
wxCheckBox* m_plotPSNegativeOpt; wxTextCtrl* m_PSFineAdjustWidthOpt;
wxCheckBox* m_forcePSA4OutputOpt; wxCheckBox* m_forcePSA4OutputOpt;
wxTextCtrl* m_messagesBox; wxTextCtrl* m_messagesBox;
wxButton* m_plotButton; wxButton* m_plotButton;
wxButton* m_buttonDrill; wxButton* m_buttonDrill;
wxButton* m_buttonQuit; wxButton* m_buttonQuit;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); } virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); } virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); } virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_BASE(); ~DIALOG_PLOT_BASE();
}; };
#endif //__DIALOG_PLOT_BASE_H__ #endif //__DIALOG_PLOT_BASE_H__

View File

@ -472,7 +472,7 @@ void PCB_PARSER::parseGeneralSection() throw( IO_ERROR, PARSE_ERROR )
break; break;
default: // Skip everything but the board thickness. default: // Skip everything but the board thickness.
wxLogDebug( wxT( "Skipping general section token %s " ), wxLogDebug( wxT( "Skipping general section token %s " ),
GetChars( GetTokenString( token ) ) ); GetChars( GetTokenString( token ) ) );
while( ( token = NextTok() ) != T_RIGHT ) while( ( token = NextTok() ) != T_RIGHT )
@ -756,7 +756,6 @@ void PCB_PARSER::parseSetup() throw( IO_ERROR, PARSE_ERROR )
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as setup." ) ); wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as setup." ) );
T token; T token;
int lastTraceWidth;
NETCLASS* defaultNetclass = m_board->m_NetClasses.GetDefault(); NETCLASS* defaultNetclass = m_board->m_NetClasses.GetDefault();
BOARD_DESIGN_SETTINGS designSettings = m_board->GetDesignSettings(); BOARD_DESIGN_SETTINGS designSettings = m_board->GetDesignSettings();
ZONE_SETTINGS zoneSettings = m_board->GetZoneSettings(); ZONE_SETTINGS zoneSettings = m_board->GetZoneSettings();
@ -770,8 +769,8 @@ void PCB_PARSER::parseSetup() throw( IO_ERROR, PARSE_ERROR )
switch( token ) switch( token )
{ {
case T_last_trace_width: case T_last_trace_width: // not used now
lastTraceWidth = parseBoardUnits( T_last_trace_width ); /* lastTraceWidth =*/ parseBoardUnits( T_last_trace_width );
NeedRIGHT(); NeedRIGHT();
break; break;

View File

@ -112,6 +112,10 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
m_referenceColor = BLACK; m_referenceColor = BLACK;
m_valueColor = BLACK; m_valueColor = BLACK;
m_textMode = PLOTTEXTMODE_PHANTOM; m_textMode = PLOTTEXTMODE_PHANTOM;
// This parameter controls if the NPTH pads will be plotted or not
// it is are "local" parameters
m_skipNPTH_Pads = false;
} }

View File

@ -47,6 +47,10 @@ public:
}; };
private: private:
// If true, do not plot NPTH pads
// (mainly used to disable NPTH pads plotting on copper layers)
bool m_skipNPTH_Pads;
/** LINE, FILLED or SKETCH selects how to plot filled objects. /** LINE, FILLED or SKETCH selects how to plot filled objects.
* FILLED is not available with all drivers */ * FILLED is not available with all drivers */
EDA_DRAW_MODE_T m_mode; EDA_DRAW_MODE_T m_mode;
@ -132,10 +136,10 @@ private:
double m_fineScaleAdjustX; ///< fine scale adjust X axis double m_fineScaleAdjustX; ///< fine scale adjust X axis
double m_fineScaleAdjustY; ///< fine scale adjust Y axis double m_fineScaleAdjustY; ///< fine scale adjust Y axis
/** This width factor is intended to compensate printers and plotters that do /** This width factor is intended to compensate PS printers/ plotters that do
* not strictly obey line width settings. Only used for pads and zone * not strictly obey line width settings. Only used to plot pads and tracks
* filling AFAIK */ */
double m_widthAdjust; int m_widthAdjust;
int m_HPGLPenNum; ///< HPGL only: pen number selection(1 to 9) 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_HPGLPenSpeed; ///< HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
@ -148,7 +152,11 @@ private:
public: public:
PCB_PLOT_PARAMS(); PCB_PLOT_PARAMS();
void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl=0 ) const throw( IO_ERROR ); void SetSkipPlotNPTH_Pads( bool aSkip ) { m_skipNPTH_Pads = aSkip; }
bool GetSkipPlotNPTH_Pads() const { return m_skipNPTH_Pads; }
void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl=0 )
const throw( IO_ERROR );
void Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR, PARSE_ERROR ); void Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR, PARSE_ERROR );
bool operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const; bool operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
@ -156,30 +164,41 @@ public:
void SetColor( EDA_COLOR_T aVal ) { m_color = aVal; } void SetColor( EDA_COLOR_T aVal ) { m_color = aVal; }
EDA_COLOR_T GetColor() const { return m_color; } EDA_COLOR_T GetColor() const { return m_color; }
void SetReferenceColor( EDA_COLOR_T aVal ) { m_referenceColor = aVal; } void SetReferenceColor( EDA_COLOR_T aVal ) { m_referenceColor = aVal; }
EDA_COLOR_T GetReferenceColor() const { return m_referenceColor; } EDA_COLOR_T GetReferenceColor() const { return m_referenceColor; }
void SetValueColor( EDA_COLOR_T aVal ) { m_valueColor = aVal; } void SetValueColor( EDA_COLOR_T aVal ) { m_valueColor = aVal; }
EDA_COLOR_T GetValueColor() const { return m_valueColor; } EDA_COLOR_T GetValueColor() const { return m_valueColor; }
void SetTextMode( PlotTextMode aVal ) { m_textMode = aVal; } void SetTextMode( PlotTextMode aVal ) { m_textMode = aVal; }
PlotTextMode GetTextMode() const { return m_textMode; } PlotTextMode GetTextMode() const { return m_textMode; }
void SetMode( EDA_DRAW_MODE_T aVal ) { m_mode = aVal; } void SetMode( EDA_DRAW_MODE_T aVal ) { m_mode = aVal; }
EDA_DRAW_MODE_T GetMode() const { return m_mode; } EDA_DRAW_MODE_T GetMode() const { return m_mode; }
void SetDrillMarksType( DrillMarksType aVal ) { m_drillMarks = aVal; } void SetDrillMarksType( DrillMarksType aVal ) { m_drillMarks = aVal; }
DrillMarksType GetDrillMarksType() const { return m_drillMarks; } DrillMarksType GetDrillMarksType() const { return m_drillMarks; }
void SetScale( double aVal ) { m_scale = aVal; } void SetScale( double aVal ) { m_scale = aVal; }
double GetScale() const { return m_scale; } double GetScale() const { return m_scale; }
void SetFineScaleAdjustX( double aVal ) { m_fineScaleAdjustX = aVal; } void SetFineScaleAdjustX( double aVal ) { m_fineScaleAdjustX = aVal; }
double GetFineScaleAdjustX() const { return m_fineScaleAdjustX; } double GetFineScaleAdjustX() const { return m_fineScaleAdjustX; }
void SetFineScaleAdjustY( double aVal ) { m_fineScaleAdjustY = aVal; } void SetFineScaleAdjustY( double aVal ) { m_fineScaleAdjustY = aVal; }
double GetFineScaleAdjustY() const { return m_fineScaleAdjustY; } double GetFineScaleAdjustY() const { return m_fineScaleAdjustY; }
void SetWidthAdjust( double aVal ) { m_widthAdjust = aVal; } void SetWidthAdjust( int aVal ) { m_widthAdjust = aVal; }
double GetWidthAdjust() const { return m_widthAdjust; } int GetWidthAdjust() const { return m_widthAdjust; }
void SetAutoScale( bool aFlag ) { m_autoScale = aFlag; } void SetAutoScale( bool aFlag ) { m_autoScale = aFlag; }
bool GetAutoScale() const { return m_autoScale; } bool GetAutoScale() const { return m_autoScale; }
void SetMirror( bool aFlag ) { m_mirror = aFlag; } void SetMirror( bool aFlag ) { m_mirror = aFlag; }
bool GetMirror() const { return m_mirror; } bool GetMirror() const { return m_mirror; }
void SetPlotPadsOnSilkLayer( bool aFlag ) { m_plotPadsOnSilkLayer = aFlag; } void SetPlotPadsOnSilkLayer( bool aFlag ) { m_plotPadsOnSilkLayer = aFlag; }
bool GetPlotPadsOnSilkLayer() const { return m_plotPadsOnSilkLayer; } bool GetPlotPadsOnSilkLayer() const { return m_plotPadsOnSilkLayer; }
void SetPlotInvisibleText( bool aFlag ) { m_plotInvisibleText = aFlag; } void SetPlotInvisibleText( bool aFlag ) { m_plotInvisibleText = aFlag; }
bool GetPlotInvisibleText() const { return m_plotInvisibleText; } bool GetPlotInvisibleText() const { return m_plotInvisibleText; }
void SetPlotOtherText( bool aFlag ) { m_plotOtherText = aFlag; } void SetPlotOtherText( bool aFlag ) { m_plotOtherText = aFlag; }
@ -188,29 +207,41 @@ public:
bool GetPlotValue() const { return m_plotValue; } bool GetPlotValue() const { return m_plotValue; }
void SetPlotReference( bool aFlag ) { m_plotReference = aFlag; } void SetPlotReference( bool aFlag ) { m_plotReference = aFlag; }
bool GetPlotReference() const { return m_plotReference; } bool GetPlotReference() const { return m_plotReference; }
void SetNegative( bool aFlag ) { m_negative = aFlag; } void SetNegative( bool aFlag ) { m_negative = aFlag; }
bool GetNegative() const { return m_negative; } bool GetNegative() const { return m_negative; }
void SetPlotViaOnMaskLayer( bool aFlag ) { m_plotViaOnMaskLayer = aFlag; } void SetPlotViaOnMaskLayer( bool aFlag ) { m_plotViaOnMaskLayer = aFlag; }
bool GetPlotViaOnMaskLayer() const { return m_plotViaOnMaskLayer; } bool GetPlotViaOnMaskLayer() const { return m_plotViaOnMaskLayer; }
void SetPlotFrameRef( bool aFlag ) { m_plotFrameRef = aFlag; } void SetPlotFrameRef( bool aFlag ) { m_plotFrameRef = aFlag; }
bool GetPlotFrameRef() const { return m_plotFrameRef; } bool GetPlotFrameRef() const { return m_plotFrameRef; }
void SetExcludeEdgeLayer( bool aFlag ) { m_excludeEdgeLayer = aFlag; } void SetExcludeEdgeLayer( bool aFlag ) { m_excludeEdgeLayer = aFlag; }
bool GetExcludeEdgeLayer() const { return m_excludeEdgeLayer; } bool GetExcludeEdgeLayer() const { return m_excludeEdgeLayer; }
void SetFormat( PlotFormat aFormat ) { m_format = aFormat; }; void SetFormat( PlotFormat aFormat ) { m_format = aFormat; };
PlotFormat GetFormat() const { return m_format; }; PlotFormat GetFormat() const { return m_format; };
void SetOutputDirectory( wxString aDir ) { m_outputDirectory = aDir; }; void SetOutputDirectory( wxString aDir ) { m_outputDirectory = aDir; };
wxString GetOutputDirectory() const { return m_outputDirectory; }; wxString GetOutputDirectory() const { return m_outputDirectory; };
void SetUseGerberExtensions( bool aUse ) { m_useGerberExtensions = aUse; }; void SetUseGerberExtensions( bool aUse ) { m_useGerberExtensions = aUse; };
bool GetUseGerberExtensions() const { return m_useGerberExtensions; }; bool GetUseGerberExtensions() const { return m_useGerberExtensions; };
void SetSubtractMaskFromSilk( bool aSubtract ) { m_subtractMaskFromSilk = aSubtract; }; void SetSubtractMaskFromSilk( bool aSubtract ) { m_subtractMaskFromSilk = aSubtract; };
bool GetSubtractMaskFromSilk() const { return m_subtractMaskFromSilk; }; bool GetSubtractMaskFromSilk() const { return m_subtractMaskFromSilk; };
void SetLayerSelection( long aSelection ) void SetLayerSelection( long aSelection )
{ m_layerSelection = aSelection; }; { m_layerSelection = aSelection; };
long GetLayerSelection() const { return m_layerSelection; }; long GetLayerSelection() const { return m_layerSelection; };
void SetUseAuxOrigin( bool aAux ) { m_useAuxOrigin = aAux; }; void SetUseAuxOrigin( bool aAux ) { m_useAuxOrigin = aAux; };
bool GetUseAuxOrigin() const { return m_useAuxOrigin; }; bool GetUseAuxOrigin() const { return m_useAuxOrigin; };
void SetScaleSelection( int aSelection ) { m_scaleSelection = aSelection; }; void SetScaleSelection( int aSelection ) { m_scaleSelection = aSelection; };
int GetScaleSelection() const { return m_scaleSelection; }; int GetScaleSelection() const { return m_scaleSelection; };
void SetA4Output( int aForce ) { m_A4Output = aForce; }; void SetA4Output( int aForce ) { m_A4Output = aForce; };
bool GetA4Output() const { return m_A4Output; }; bool GetA4Output() const { return m_A4Output; };
@ -222,6 +253,7 @@ public:
bool SetHPGLPenOverlay( int aValue ); bool SetHPGLPenOverlay( int aValue );
void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; } void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; }
int GetHPGLPenNum() const { return m_HPGLPenNum; } int GetHPGLPenNum() const { return m_HPGLPenNum; }
int GetLineWidth() const { return m_lineWidth; }; int GetLineWidth() const { return m_lineWidth; };
bool SetLineWidth( int aValue ); bool SetLineWidth( int aValue );
}; };

View File

@ -274,7 +274,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
wxString msg; wxString msg;
if( plotter ) if( plotter )
{ {
PlotBoardLayer( board, plotter, layer, m_plotOpts ); PlotOneBoardLayer( board, plotter, layer, m_plotOpts );
plotter->EndPlot(); plotter->EndPlot();
delete plotter; delete plotter;
@ -372,7 +372,7 @@ bool PLOT_CONTROLLER::PlotLayer( int aLayer )/*{{{*/
return false; return false;
// Fully delegated to the parent // Fully delegated to the parent
PlotBoardLayer( m_board, m_plotter, aLayer, m_plotOpts ); PlotOneBoardLayer( m_board, m_plotter, aLayer, m_plotOpts );
return true; return true;
}/*}}}*/ }/*}}}*/

View File

@ -5,6 +5,7 @@
#ifndef PCBPLOT_H_ #ifndef PCBPLOT_H_
#define PCBPLOT_H_ #define PCBPLOT_H_
#include <pad_shapes.h>
#include <pcb_plot_params.h> #include <pcb_plot_params.h>
class PLOTTER; class PLOTTER;
@ -52,6 +53,7 @@ class BRDITEMS_PLOTTER: public PCB_PLOT_PARAMS
BOARD* m_board; BOARD* m_board;
int m_layerMask; int m_layerMask;
public: public:
BRDITEMS_PLOTTER( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS& aPlotOpts ) BRDITEMS_PLOTTER( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS& aPlotOpts )
: PCB_PLOT_PARAMS( aPlotOpts ) : PCB_PLOT_PARAMS( aPlotOpts )
@ -61,6 +63,18 @@ public:
m_layerMask = 0; m_layerMask = 0;
} }
/**
* @return a 'width adjustment' for the postscript engine
* (useful for controlling toner bleeding during direct transfer)
* addded to track width and via/pads size
*/
int getFineWidthAdj()
{
if( GetFormat() == PLOT_FORMAT_POST )
return GetWidthAdjust();
else
return 0;
}
// Basic functions to plot a board item // Basic functions to plot a board item
void SetLayerMask( int aLayerMask ){ m_layerMask = aLayerMask; } void SetLayerMask( int aLayerMask ){ m_layerMask = aLayerMask; }
void Plot_Edges_Modules(); void Plot_Edges_Modules();
@ -73,6 +87,20 @@ public:
void PlotTextePcb( TEXTE_PCB* pt_texte ); void PlotTextePcb( TEXTE_PCB* pt_texte );
void PlotDrawSegment( DRAWSEGMENT* PtSegm ); void PlotDrawSegment( DRAWSEGMENT* PtSegm );
/**
* lot items like text and graphics,
* but not tracks and modules
*/
void PlotBoardGraphicItems();
/** Function PlotDrillMarks
* Draw a drill mark for pads and vias.
* Must be called after all drawings, because it
* redraw the drill mark on a pad or via, as a negative (i.e. white) shape in
* FILLED plot mode (for PS and PDF outputs)
*/
void PlotDrillMarks();
/** /**
* Function getColor * Function getColor
* @return the layer color * @return the layer color
@ -82,6 +110,16 @@ public:
* so the returned color is LIGHTGRAY when the layer color is WHITE * so the returned color is LIGHTGRAY when the layer color is WHITE
*/ */
EDA_COLOR_T getColor( int aLayer ); EDA_COLOR_T getColor( int aLayer );
private:
/** Helper function to plot a single drill mark. It compensate and clamp
* the drill mark size depending on the current plot options
*/
void plotOneDrillMark( PAD_SHAPE_T aDrillShape,
const wxPoint &aDrillPos, wxSize aDrillSize,
const wxSize &aPadSize,
double aOrientation, int aSmallDrill );
}; };
PLOTTER *StartPlotBoard( BOARD *aBoard, PLOTTER *StartPlotBoard( BOARD *aBoard,
@ -90,34 +128,41 @@ PLOTTER *StartPlotBoard( BOARD *aBoard,
const wxString& aSheetDesc ); const wxString& aSheetDesc );
/** /**
* Function PlotBoardLayer * Function PlotOneBoardLayer
* main function to plot copper or technical layers. * main function to plot one copper or technical layer.
* It calls the specilize plot function, according to the layer type * It prepare options and calls the specilized plot function,
* according to the layer type
* @param aBoard = the board to plot * @param aBoard = the board to plot
* @param aPlotter = the plotter to use * @param aPlotter = the plotter to use
* @param aLayer = the layer id to plot * @param aLayer = the layer id to plot
* @param aPlotOpt = the plot options (files, sketch). Has meaning for some formats only * @param aPlotOpt = the plot options (files, sketch). Has meaning for some formats only
*/ */
void PlotBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer, void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer,
const PCB_PLOT_PARAMS& aPlotOpt ); const PCB_PLOT_PARAMS& aPlotOpt );
/** /**
* Function Plot_Standard_Layer * Function PlotStandardLayer
* plot copper or technical layers. * plot copper or technical layers.
* not used for silk screen layers, because these layers have specific * not used for silk screen layers, because these layers have specific
* requirements, mainly for pads * requirements, mainly for pads
* @param aBoard = the board to plot * @param aBoard = the board to plot
* @param aPlotter = the plotter to use * @param aPlotter = the plotter to use
* @param aLayerMask = the mask to define the layers to plot * @param aLayerMask = the mask to define the layers to plot
* @param aPlotVia = true to plot vias, false to skip vias (has meaning
* only for solder mask layers).
* @param aPlotOpt = the plot options (files, sketch). Has meaning for some formats only * @param aPlotOpt = the plot options (files, sketch). Has meaning for some formats only
* @param aSkipNPTH_Pads = true to skip NPTH Pads, when the pad size and the pad hole *
* have the same size. Used in GERBER format only. * aPlotOpt has 3 important options to controle this plot,
* which are set, depending on the layer typpe to plot
* SetEnablePlotVia( bool aEnable )
* aEnable = true to plot vias, false to skip vias (has meaning
* only for solder mask layers).
* SetSkipPlotNPTH_Pads( bool aSkip )
* aSkip = true to skip NPTH Pads, when the pad size and the pad hole
* have the same size. Used in GERBER format only.
* SetDrillMarksType( DrillMarksType aVal ) controle the actual hole:
* no hole, small hole, actual hole
*/ */
void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask, void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt, const PCB_PLOT_PARAMS& aPlotOpt );
bool aPlotVia, bool aSkipNPTH_Pads );
/** /**
* Function PlotSilkScreen * Function PlotSilkScreen
@ -131,18 +176,6 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask,
void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask, void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt ); const PCB_PLOT_PARAMS& aPlotOpt );
/**
* Function PlotDrillMarks
* Draw a drill mark for pads and vias.
* Must be called after all drawings, because it
* redraw the drill mark on a pad or via, as a negative (i.e. white) shape
* in FILLED plot mode
* @param aBoard = the board to plot
* @param aPlotter = the PLOTTER
* @param aPlotOpts = plot options
*/
void PlotDrillMarks( BOARD *aBoard, PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts );
// PLOTGERB.CPP // PLOTGERB.CPP
void SelectD_CODE_For_LineDraw( PLOTTER* plotter, int aSize ); void SelectD_CODE_For_LineDraw( PLOTTER* plotter, int aSize );

View File

@ -112,6 +112,38 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule )
return true; return true;
} }
// plot items like text and graphics, but not tracks and module
void BRDITEMS_PLOTTER::PlotBoardGraphicItems()
{
for( BOARD_ITEM* item = m_board->m_Drawings; item; item = item->Next() )
{
switch( item->Type() )
{
case PCB_LINE_T:
PlotDrawSegment( (DRAWSEGMENT*) item);
break;
case PCB_TEXT_T:
PlotTextePcb( (TEXTE_PCB*) item );
break;
case PCB_DIMENSION_T:
PlotDimension( (DIMENSION*) item );
break;
case PCB_TARGET_T:
PlotPcbTarget( (PCB_TARGET*) item );
break;
case PCB_MARKER_T:
default:
break;
}
}
}
/* Creates the plot for silkscreen layers /* Creates the plot for silkscreen layers
*/ */
void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask, void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask,
@ -121,35 +153,7 @@ void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, long aLayerMask,
itemplotter.SetLayerMask( aLayerMask ); itemplotter.SetLayerMask( aLayerMask );
// Plot edge layer and graphic items // Plot edge layer and graphic items
for( EDA_ITEM* item = aBoard->m_Drawings; item; item = item->Next() ) itemplotter.PlotBoardGraphicItems();
{
switch( item->Type() )
{
case PCB_LINE_T:
itemplotter.PlotDrawSegment( (DRAWSEGMENT*) item);
break;
case PCB_TEXT_T:
itemplotter.PlotTextePcb( (TEXTE_PCB*) item );
break;
case PCB_DIMENSION_T:
itemplotter.PlotDimension( (DIMENSION*) item );
break;
case PCB_TARGET_T:
itemplotter.PlotPcbTarget( (PCB_TARGET*) item );
break;
case PCB_MARKER_T:
break;
default:
wxLogMessage( wxT( "PlotSilkScreen() error: unexpected Type(%d)" ),
item->Type() );
break;
}
}
// Plot footprint outlines : // Plot footprint outlines :
itemplotter.Plot_Edges_Modules(); itemplotter.Plot_Edges_Modules();
@ -682,9 +686,10 @@ void BRDITEMS_PLOTTER::PlotDrawSegment( DRAWSEGMENT* aSeg )
} }
void PlotBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer, void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer,
const PCB_PLOT_PARAMS& aPlotOpt ) const PCB_PLOT_PARAMS& aPlotOpt )
{ {
PCB_PLOT_PARAMS plotOpt = aPlotOpt;
// Set a default color and the text mode for this layer // Set a default color and the text mode for this layer
aPlotter->SetColor( aPlotOpt.GetColor() ); aPlotter->SetColor( aPlotOpt.GetColor() );
aPlotter->SetTextMode( aPlotOpt.GetTextMode() ); aPlotter->SetTextMode( aPlotOpt.GetTextMode() );
@ -715,48 +720,53 @@ void PlotBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer,
case LAYER_N_15: case LAYER_N_15:
case LAST_COPPER_LAYER: case LAST_COPPER_LAYER:
// Skip NPTH pads on copper layers ( only if hole size == pad size ): // Skip NPTH pads on copper layers ( only if hole size == pad size ):
PlotStandardLayer( aBoard, aPlotter, layer_mask, aPlotOpt, true, true ); plotOpt.SetSkipPlotNPTH_Pads( true );
// Drill mark will be plotted,
// Adding drill marks, if required and if the plotter is able to plot them: // if drill mark is SMALL_DRILL_SHAPE or FULL_DRILL_SHAPE
if( aPlotOpt.GetDrillMarksType() != PCB_PLOT_PARAMS::NO_DRILL_SHAPE ) PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
PlotDrillMarks( aBoard, aPlotter, aPlotOpt );
break; break;
case SOLDERMASK_N_BACK: case SOLDERMASK_N_BACK:
case SOLDERMASK_N_FRONT: case SOLDERMASK_N_FRONT:
PlotStandardLayer( aBoard, aPlotter, layer_mask, aPlotOpt, plotOpt.SetSkipPlotNPTH_Pads( false );
aPlotOpt.GetPlotViaOnMaskLayer(), false ); // Disable plot pad holes
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
break; break;
case SOLDERPASTE_N_BACK: case SOLDERPASTE_N_BACK:
case SOLDERPASTE_N_FRONT: case SOLDERPASTE_N_FRONT:
PlotStandardLayer( aBoard, aPlotter, layer_mask, aPlotOpt, plotOpt.SetSkipPlotNPTH_Pads( false );
false, false ); // Disable plot pad holes
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
break; break;
case SILKSCREEN_N_FRONT: case SILKSCREEN_N_FRONT:
case SILKSCREEN_N_BACK: case SILKSCREEN_N_BACK:
PlotSilkScreen( aBoard, aPlotter, layer_mask, aPlotOpt ); PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
// Gerber: Subtract soldermask from silkscreen if enabled // Gerber: Subtract soldermask from silkscreen if enabled
if( aPlotter->GetPlotterType() == PLOT_FORMAT_GERBER if( aPlotter->GetPlotterType() == PLOT_FORMAT_GERBER
&& aPlotOpt.GetSubtractMaskFromSilk() ) && plotOpt.GetSubtractMaskFromSilk() )
{ {
plotOpt.SetPlotViaOnMaskLayer( true );
if( aLayer == SILKSCREEN_N_FRONT ) if( aLayer == SILKSCREEN_N_FRONT )
layer_mask = GetLayerMask( SOLDERMASK_N_FRONT ); layer_mask = GetLayerMask( SOLDERMASK_N_FRONT );
else else
layer_mask = GetLayerMask( SOLDERMASK_N_BACK ); layer_mask = GetLayerMask( SOLDERMASK_N_BACK );
// Set layer polarity to negative // Create the mask to substract by creating a negative layer polarity
aPlotter->SetLayerPolarity( false ); aPlotter->SetLayerPolarity( false );
PlotStandardLayer( aBoard, aPlotter, layer_mask, aPlotOpt, // Disable plot pad holes
aPlotOpt.GetPlotViaOnMaskLayer(), false ); plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
// Plot the mask
PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
} }
break; break;
default: default:
PlotSilkScreen( aBoard, aPlotter, layer_mask, aPlotOpt ); PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
break; break;
} }
} }
@ -766,48 +776,16 @@ void PlotBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer,
* Silk screen layers are not plotted here. * Silk screen layers are not plotted here.
*/ */
void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
long aLayerMask, const PCB_PLOT_PARAMS& aPlotOpt, long aLayerMask, const PCB_PLOT_PARAMS& aPlotOpt )
bool aPlotVia, bool aSkipNPTH_Pads )
{ {
BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt ); BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
itemplotter.SetLayerMask( aLayerMask ); itemplotter.SetLayerMask( aLayerMask );
wxPoint pos; EDA_DRAW_MODE_T plotMode = aPlotOpt.GetMode();
wxSize size;
EDA_DRAW_MODE_T aPlotMode = aPlotOpt.GetMode(); // Plot edge layer and graphic items
itemplotter.PlotBoardGraphicItems();
// Plot pcb draw items.
for( BOARD_ITEM* item = aBoard->m_Drawings; item; item = item->Next() )
{
switch( item->Type() )
{
case PCB_LINE_T:
itemplotter.PlotDrawSegment( (DRAWSEGMENT*) item );
break;
case PCB_TEXT_T:
itemplotter.PlotTextePcb( (TEXTE_PCB*) item );
break;
case PCB_DIMENSION_T:
itemplotter.PlotDimension( (DIMENSION*) item );
break;
case PCB_TARGET_T:
itemplotter.PlotPcbTarget( (PCB_TARGET*) item );
break;
case PCB_MARKER_T:
break;
default:
wxLogMessage( wxT( "Plot_Standard_Layer() error : Unexpected Draw Type %d" ),
item->Type() );
break;
}
}
// Draw footprint shapes without pads (pads will plotted later) // Draw footprint shapes without pads (pads will plotted later)
// We plot here module texts, but they are usually on silkscreen layer, // We plot here module texts, but they are usually on silkscreen layer,
@ -851,14 +829,12 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
wxPoint shape_pos = pad->ReturnShapePos(); wxPoint shape_pos = pad->ReturnShapePos();
pos = shape_pos;
wxSize margin; wxSize margin;
double width_adj = 0; double width_adj = 0;
if( aLayerMask & ALL_CU_LAYERS ) if( aLayerMask & ALL_CU_LAYERS )
{ {
width_adj = aPlotter->GetPlotWidthAdj(); width_adj = itemplotter.getFineWidthAdj();
} }
switch( aLayerMask & switch( aLayerMask &
@ -879,6 +855,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
break; break;
} }
wxSize size;
size.x = pad->GetSize().x + ( 2 * margin.x ) + width_adj; size.x = pad->GetSize().x + ( 2 * margin.x ) + width_adj;
size.y = pad->GetSize().y + ( 2 * margin.y ) + width_adj; size.y = pad->GetSize().y + ( 2 * margin.y ) + width_adj;
@ -886,7 +863,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
if( size.x <= 0 || size.y <= 0 ) if( size.x <= 0 || size.y <= 0 )
continue; continue;
EDA_COLOR_T color = ColorFromInt(0); EDA_COLOR_T color = BLACK;
if( (pad->GetLayerMask() & LAYER_BACK) ) if( (pad->GetLayerMask() & LAYER_BACK) )
color = aBoard->GetVisibleElementColor( PAD_BK_VISIBLE ); color = aBoard->GetVisibleElementColor( PAD_BK_VISIBLE );
@ -901,126 +878,112 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
switch( pad->GetShape() ) switch( pad->GetShape() )
{ {
case PAD_CIRCLE: case PAD_CIRCLE:
if( aSkipNPTH_Pads && if( aPlotOpt.GetSkipPlotNPTH_Pads() &&
(pad->GetSize() == pad->GetDrillSize()) && (pad->GetSize() == pad->GetDrillSize()) &&
(pad->GetAttribute() == PAD_HOLE_NOT_PLATED) ) (pad->GetAttribute() == PAD_HOLE_NOT_PLATED) )
break; break;
aPlotter->FlashPadCircle( pos, size.x, aPlotMode ); aPlotter->FlashPadCircle( shape_pos, size.x, plotMode );
break; break;
case PAD_OVAL: case PAD_OVAL:
if( aSkipNPTH_Pads && if( aPlotOpt.GetSkipPlotNPTH_Pads() &&
(pad->GetSize() == pad->GetDrillSize()) && (pad->GetSize() == pad->GetDrillSize()) &&
(pad->GetAttribute() == PAD_HOLE_NOT_PLATED) ) (pad->GetAttribute() == PAD_HOLE_NOT_PLATED) )
break; break;
aPlotter->FlashPadOval( pos, size, pad->GetOrientation(), aPlotMode ); aPlotter->FlashPadOval( shape_pos, size, pad->GetOrientation(), plotMode );
break; break;
case PAD_TRAPEZOID: case PAD_TRAPEZOID:
{ {
wxPoint coord[4]; wxPoint coord[4];
pad->BuildPadPolygon( coord, margin, 0 ); pad->BuildPadPolygon( coord, margin, 0 );
aPlotter->FlashPadTrapez( pos, coord, pad->GetOrientation(), aPlotMode ); aPlotter->FlashPadTrapez( shape_pos, coord, pad->GetOrientation(), plotMode );
} }
break; break;
case PAD_RECT: case PAD_RECT:
default: default:
aPlotter->FlashPadRect( pos, size, pad->GetOrientation(), aPlotMode ); aPlotter->FlashPadRect( shape_pos, size, pad->GetOrientation(), plotMode );
break; break;
} }
} }
} }
// Plot vias : // Plot vias on copper layers, and if aPlotOpt.GetPlotViaOnMaskLayer() is true,
if( aPlotVia ) // plot them on solder mask
for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
{ {
for( TRACK* track = aBoard->m_Track; track; track = track->Next() ) if( track->Type() != PCB_VIA_T )
continue;
SEGVIA* Via = (SEGVIA*) track;
// vias are not plotted if not on selected layer, but if layer
// is SOLDERMASK_LAYER_BACK or SOLDERMASK_LAYER_FRONT,vias are drawn,
// only if they are on the corresponding external copper layer
int via_mask_layer = Via->ReturnMaskLayer();
if( aPlotOpt.GetPlotViaOnMaskLayer() )
{ {
if( track->Type() != PCB_VIA_T )
continue;
SEGVIA* Via = (SEGVIA*) track;
// vias are not plotted if not on selected layer, but if layer
// is SOLDERMASK_LAYER_BACK or SOLDERMASK_LAYER_FRONT,vias are drawn,
// if they are on an external copper layer
int via_mask_layer = Via->ReturnMaskLayer();
if( via_mask_layer & LAYER_BACK ) if( via_mask_layer & LAYER_BACK )
via_mask_layer |= SOLDERMASK_LAYER_BACK; via_mask_layer |= SOLDERMASK_LAYER_BACK;
if( via_mask_layer & LAYER_FRONT ) if( via_mask_layer & LAYER_FRONT )
via_mask_layer |= SOLDERMASK_LAYER_FRONT; via_mask_layer |= SOLDERMASK_LAYER_FRONT;
if( ( via_mask_layer & aLayerMask ) == 0 )
continue;
int via_margin = 0;
double width_adj = 0;
// If the current layer is a solder mask, use the global mask
// clearance for vias
if( ( aLayerMask & ( SOLDERMASK_LAYER_BACK | SOLDERMASK_LAYER_FRONT ) ) )
via_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
if( aLayerMask & ALL_CU_LAYERS )
width_adj = aPlotter->GetPlotWidthAdj();
pos = Via->m_Start;
size.x = size.y = Via->m_Width + 2 * via_margin + width_adj;
// Don't draw a null size item :
if( size.x <= 0 )
continue;
EDA_COLOR_T color = aBoard->GetVisibleElementColor(VIAS_VISIBLE + Via->m_Shape);
// Set plot color (change WHITE to LIGHTGRAY because
// the white items are not seen on a white paper or screen
aPlotter->SetColor( color != WHITE ? color : LIGHTGRAY);
aPlotter->FlashPadCircle( pos, size.x, aPlotMode );
} }
if( ( via_mask_layer & aLayerMask ) == 0 )
continue;
int via_margin = 0;
double width_adj = 0;
// If the current layer is a solder mask, use the global mask
// clearance for vias
if( ( aLayerMask & ( SOLDERMASK_LAYER_BACK | SOLDERMASK_LAYER_FRONT ) ) )
via_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
if( aLayerMask & ALL_CU_LAYERS )
width_adj = itemplotter.getFineWidthAdj();
int diameter = Via->m_Width + 2 * via_margin + width_adj;
// Don't draw a null size item :
if( diameter <= 0 )
continue;
EDA_COLOR_T color = aBoard->GetVisibleElementColor(VIAS_VISIBLE + Via->m_Shape);
// Set plot color (change WHITE to LIGHTGRAY because
// the white items are not seen on a white paper or screen
aPlotter->SetColor( color != WHITE ? color : LIGHTGRAY);
aPlotter->FlashPadCircle( Via->m_Start, diameter, plotMode );
} }
// Plot tracks (not vias) : // Plot tracks (not vias) :
for( TRACK* track = aBoard->m_Track; track; track = track->Next() ) for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
{ {
wxPoint end;
if( track->Type() == PCB_VIA_T ) if( track->Type() == PCB_VIA_T )
continue; continue;
if( (GetLayerMask( track->GetLayer() ) & aLayerMask) == 0 ) if( (GetLayerMask( track->GetLayer() ) & aLayerMask) == 0 )
continue; continue;
size.x = size.y = track->m_Width + aPlotter->GetPlotWidthAdj(); int width = track->m_Width + itemplotter.getFineWidthAdj();
pos = track->m_Start; aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );
end = track->m_End; aPlotter->ThickSegment( track->m_Start, track->m_End, width, plotMode );
EDA_COLOR_T color = aBoard->GetLayerColor( track->GetLayer() );
// Set plot color (change WHITE to LIGHTGRAY because
// the white items are not seen on a white paper or screen
aPlotter->SetColor( color != WHITE ? color : LIGHTGRAY);
aPlotter->ThickSegment( pos, end, size.x, aPlotMode );
} }
// Plot zones (outdated, for old boards compatibility): // Plot zones (outdated, for old boards compatibility):
for( TRACK* track = aBoard->m_Zone; track; track = track->Next() ) for( TRACK* track = aBoard->m_Zone; track; track = track->Next() )
{ {
wxPoint end;
if( (GetLayerMask( track->GetLayer() ) & aLayerMask) == 0 ) if( (GetLayerMask( track->GetLayer() ) & aLayerMask) == 0 )
continue; continue;
size.x = size.y = track->m_Width + aPlotter->GetPlotWidthAdj(); int width = track->m_Width + itemplotter.getFineWidthAdj();
pos = track->m_Start; aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );
end = track->m_End; aPlotter->ThickSegment( track->m_Start, track->m_End, width, plotMode );
aPlotter->ThickSegment( pos, end, size.x, aPlotMode );
} }
// Plot filled ares // Plot filled ares
@ -1033,31 +996,35 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
itemplotter.PlotFilledAreas( zone ); itemplotter.PlotFilledAreas( zone );
} }
// Adding drill marks, if required and if the plotter is able to plot them:
if( aPlotOpt.GetDrillMarksType() != PCB_PLOT_PARAMS::NO_DRILL_SHAPE )
itemplotter.PlotDrillMarks();
} }
/** Helper function to plot a single drill mark. It compensate and clamp /** Helper function to plot a single drill mark. It compensate and clamp
the drill mark size depending on the current plot options */ * the drill mark size depending on the current plot options
static void PlotDrillMark( PLOTTER *aPlotter, PAD_SHAPE_T aDrillShape, */
void BRDITEMS_PLOTTER::plotOneDrillMark( PAD_SHAPE_T aDrillShape,
const wxPoint &aDrillPos, wxSize aDrillSize, const wxPoint &aDrillPos, wxSize aDrillSize,
const wxSize &aPadSize, const wxSize &aPadSize,
double aOrientation, int aSmallDrill, double aOrientation, int aSmallDrill )
EDA_DRAW_MODE_T aTraceMode )
{ {
// Small drill marks have no significance when applied to slots // Small drill marks have no significance when applied to slots
if( aSmallDrill && aDrillShape == PAD_ROUND ) if( aSmallDrill && aDrillShape == PAD_ROUND )
aDrillSize.x = std::min( aSmallDrill, aDrillSize.x ); aDrillSize.x = std::min( aSmallDrill, aDrillSize.x );
// Round holes only have x diameter, slots have both // Round holes only have x diameter, slots have both
aDrillSize.x -= aPlotter->GetPlotWidthAdj(); aDrillSize.x -= getFineWidthAdj();
aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 ); aDrillSize.x = Clamp( 1, aDrillSize.x, aPadSize.x - 1 );
if( aDrillShape == PAD_OVAL ) if( aDrillShape == PAD_OVAL )
{ {
aDrillSize.y -= aPlotter->GetPlotWidthAdj(); aDrillSize.y -= getFineWidthAdj();
aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 ); aDrillSize.y = Clamp( 1, aDrillSize.y, aPadSize.y - 1 );
aPlotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, aTraceMode ); m_plotter->FlashPadOval( aDrillPos, aDrillSize, aOrientation, GetMode() );
} }
else else
aPlotter->FlashPadCircle( aDrillPos, aDrillSize.x, aTraceMode ); m_plotter->FlashPadCircle( aDrillPos, aDrillSize.x, GetMode() );
} }
/* Function PlotDrillMarks /* Function PlotDrillMarks
@ -1066,14 +1033,11 @@ static void PlotDrillMark( PLOTTER *aPlotter, PAD_SHAPE_T aDrillShape,
* redraw the drill mark on a pad or via, as a negative (i.e. white) shape in * redraw the drill mark on a pad or via, as a negative (i.e. white) shape in
* FILLED plot mode (for PS and PDF outputs) * FILLED plot mode (for PS and PDF outputs)
*/ */
void PlotDrillMarks( BOARD *aBoard, PLOTTER* aPlotter, void BRDITEMS_PLOTTER::PlotDrillMarks()
const PCB_PLOT_PARAMS& aPlotOpts )
{ {
EDA_DRAW_MODE_T trace_mode = aPlotOpts.GetMode();
/* If small drills marks were requested prepare a clamp value to pass /* If small drills marks were requested prepare a clamp value to pass
to the helper function */ to the helper function */
int small_drill = (aPlotOpts.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ? int small_drill = (GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ?
SMALL_DRILL : 0; SMALL_DRILL : 0;
/* In the filled trace mode drill marks are drawn white-on-black to scrape /* In the filled trace mode drill marks are drawn white-on-black to scrape
@ -1087,40 +1051,35 @@ void PlotDrillMarks( BOARD *aBoard, PLOTTER* aPlotter,
you could start a layer with negative polarity to scrape the film. you could start a layer with negative polarity to scrape the film.
- In DXF they go into the 'WHITE' layer. This could be useful. - In DXF they go into the 'WHITE' layer. This could be useful.
*/ */
if( trace_mode == FILLED ) if( GetMode() == FILLED )
{ m_plotter->SetColor( WHITE );
aPlotter->SetColor( WHITE );
}
for( TRACK *pts = aBoard->m_Track; pts != NULL; pts = pts->Next() ) for( TRACK *pts = m_board->m_Track; pts != NULL; pts = pts->Next() )
{ {
if( pts->Type() != PCB_VIA_T ) if( pts->Type() != PCB_VIA_T )
continue; continue;
PlotDrillMark( aPlotter, PAD_CIRCLE, plotOneDrillMark(PAD_CIRCLE,
pts->m_Start, wxSize( pts->GetDrillValue(), 0 ), pts->m_Start, wxSize( pts->GetDrillValue(), 0 ),
wxSize( pts->m_Width, 0 ), 0, small_drill, wxSize( pts->m_Width, 0 ), 0, small_drill );
trace_mode );
} }
for( MODULE *Module = aBoard->m_Modules; Module != NULL; Module = Module->Next() ) for( MODULE *Module = m_board->m_Modules; Module != NULL; Module = Module->Next() )
{ {
for( D_PAD *pad = Module->m_Pads; pad != NULL; pad = pad->Next() ) for( D_PAD *pad = Module->m_Pads; pad != NULL; pad = pad->Next() )
{ {
if( pad->GetDrillSize().x == 0 ) if( pad->GetDrillSize().x == 0 )
continue; continue;
PlotDrillMark( aPlotter, pad->GetDrillShape(), plotOneDrillMark( pad->GetDrillShape(),
pad->GetPosition(), pad->GetDrillSize(), pad->GetPosition(), pad->GetDrillSize(),
pad->GetSize(), pad->GetOrientation(), pad->GetSize(), pad->GetOrientation(),
small_drill, trace_mode ); small_drill );
} }
} }
if( trace_mode == FILLED ) if( GetMode() == FILLED )
{ m_plotter->SetColor( GetColor() );
aPlotter->SetColor( aPlotOpts.GetColor() );
}
} }
/** Set up most plot options for plotting a board (especially the viewport) /** Set up most plot options for plotting a board (especially the viewport)
@ -1202,7 +1161,7 @@ static void PlotSetupPlotter( PLOTTER *aPlotter, PCB_PLOT_PARAMS *aPlotOpts,
/* Configure the plotter object with all the stuff computed and /* Configure the plotter object with all the stuff computed and
most of that taken from the options */ most of that taken from the options */
aPlotter->SetPageSettings( *sheet_info ); aPlotter->SetPageSettings( *sheet_info );
aPlotter->SetPlotWidthAdj( aPlotOpts->GetWidthAdjust() );
aPlotter->SetViewport( offset, IU_PER_DECIMILS, compound_scale, aPlotter->SetViewport( offset, IU_PER_DECIMILS, compound_scale,
aPlotOpts->GetMirror() ); aPlotOpts->GetMirror() );
aPlotter->SetDefaultLineWidth( aPlotOpts->GetLineWidth() ); aPlotter->SetDefaultLineWidth( aPlotOpts->GetLineWidth() );
@ -1214,14 +1173,14 @@ static void PlotSetupPlotter( PLOTTER *aPlotter, PCB_PLOT_PARAMS *aPlotOpts,
/** Prefill in black an area a little bigger than the board to prepare for the /** Prefill in black an area a little bigger than the board to prepare for the
* negative plot */ * negative plot */
static void FillNegativeKnockout(PLOTTER *aPlotter, const EDA_RECT &aBbbox ) static void FillNegativeKnockout( PLOTTER *aPlotter, const EDA_RECT &aBbbox )
{ {
static const int margin = 5 * IU_PER_MM; // Add a 5 mm margin around the board const int margin = 5 * IU_PER_MM; // Add a 5 mm margin around the board
aPlotter->SetNegative( true ); aPlotter->SetNegative( true );
aPlotter->SetColor( WHITE ); // Which will be plotted as black aPlotter->SetColor( WHITE ); // Which will be plotted as black
aPlotter->Rect( wxPoint( aBbbox.GetX() - margin, aBbbox.GetY() - margin ), EDA_RECT area = aBbbox;
wxPoint( aBbbox.GetRight() + margin, aBbbox.GetBottom() + margin ), area.Inflate( margin );
FILLED_SHAPE ); aPlotter->Rect( area.GetOrigin(), area.GetEnd(), FILLED_SHAPE );
aPlotter->SetColor( BLACK ); aPlotter->SetColor( BLACK );
} }
@ -1232,7 +1191,7 @@ static void ConfigureHPGLPenSizes( HPGL_PLOTTER *aPlotter,
{ {
/* Compute pen_dim (the value is given in mils) in pcb units, /* Compute pen_dim (the value is given in mils) in pcb units,
with plot scale (if Scale is 2, pen diameter value is always m_HPGLPenDiam with plot scale (if Scale is 2, pen diameter value is always m_HPGLPenDiam
so apparent pen diam is real pen diam / Scale */ so apparent pen diam is actually pen diam / Scale */
int pen_diam = KiROUND( aPlotOpts->GetHPGLPenDiameter() * IU_PER_MILS / int pen_diam = KiROUND( aPlotOpts->GetHPGLPenDiameter() * IU_PER_MILS /
aPlotOpts->GetScale() ); aPlotOpts->GetScale() );
@ -1263,8 +1222,6 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
const wxString& aSheetDesc ) const wxString& aSheetDesc )
{ {
const PAGE_INFO& pageInfo = aBoard->GetPageSettings(); const PAGE_INFO& pageInfo = aBoard->GetPageSettings();
EDA_RECT bbbox = aBoard->ComputeBoundingBox();
wxPoint auxOrigin( aBoard->GetOriginAxisPosition() );
FILE* output_file = wxFopen( aFullFileName, wxT( "wt" ) ); FILE* output_file = wxFopen( aFullFileName, wxT( "wt" ) );
if( output_file == NULL ) if( output_file == NULL )
@ -1315,6 +1272,8 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
if( the_plotter ) if( the_plotter )
{ {
EDA_RECT bbbox = aBoard->ComputeBoundingBox();
wxPoint auxOrigin( aBoard->GetOriginAxisPosition() );
// Compute the viewport and set the other options // Compute the viewport and set the other options
PlotSetupPlotter( the_plotter, aPlotOpts, pageInfo, bbbox, auxOrigin, PlotSetupPlotter( the_plotter, aPlotOpts, pageInfo, bbbox, auxOrigin,
aFullFileName ); aFullFileName );
@ -1333,8 +1292,7 @@ PLOTTER *StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts,
PlotWorkSheet( the_plotter, aBoard->GetTitleBlock(), PlotWorkSheet( the_plotter, aBoard->GetTitleBlock(),
aBoard->GetPageSettings(), aBoard->GetPageSettings(),
1, 1, // Only one page 1, 1, // Only one page
aSheetDesc, aSheetDesc, aBoard->GetFileName() );
aBoard->GetFileName() );
return the_plotter; return the_plotter;
} }