From 2284228c35bbfb070d478cd4ce01db557061b939 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 11 Feb 2016 13:14:46 +0100 Subject: [PATCH] HPGL plot dialog: remove no more in use Pen Overlap parameter. Fix incorrect polygon fill by setting the hpgl pen thickness in hpgl file. Add filled circle (previously, a circle was never filled) --- common/common_plotHPGL_functions.cpp | 41 +- eeschema/plot_schematic_HPGL.cpp | 1 - include/plot_common.h | 11 +- pcbnew/dialogs/dialog_plot.cpp | 24 - pcbnew/dialogs/dialog_plot_base.cpp | 36 +- pcbnew/dialogs/dialog_plot_base.fbp | 542 +++++++------------- pcbnew/dialogs/dialog_plot_base.h | 6 +- pcbnew/exporters/gen_drill_report_files.cpp | 1 - pcbnew/pcb_plot_params.cpp | 17 +- pcbnew/pcb_plot_params.h | 3 - pcbnew/plot_board_layers.cpp | 11 - 11 files changed, 217 insertions(+), 476 deletions(-) diff --git a/common/common_plotHPGL_functions.cpp b/common/common_plotHPGL_functions.cpp index 4af40f311e..ba9bb8ad96 100644 --- a/common/common_plotHPGL_functions.cpp +++ b/common/common_plotHPGL_functions.cpp @@ -126,7 +126,7 @@ * PS (Paper Size): * PS {n}; * - * PT (Pen Thickness): + * PT (Pen Thickness): in mm * PT {l}; * * PU (Pen Up): Executes pen then moves to the requested position @@ -183,7 +183,7 @@ * * VS (Velocity Select): * VS {v {, n}}; - * v [1 .. 40] + * v [1 .. 40] in cm/s * n [1 .. 8] * * XT (X Tick): @@ -204,6 +204,12 @@ #include #include +// The hpgl command to close a polygon def, fill it and plot outline: +// PM 2; ends the polygon definition and closes it if not closed +// FP; fills the polygon +// EP; draws the polygon outline. It usually gives a better look to the filled polygon +static const char hpgl_end_polygon_cmd[] = "PM 2; FP; EP;\n"; + // HPGL scale factor (1 PLU = 1/40mm = 25 micrometers) static const double PLUsPERDECIMIL = 0.102041; @@ -212,7 +218,6 @@ HPGL_PLOTTER::HPGL_PLOTTER() SetPenSpeed( 40 ); // Default pen speed = 40 cm/s; Pen speed is *always* in cm SetPenNumber( 1 ); // Default pen num = 1 SetPenDiameter( 0.0 ); - SetPenOverlap( 0.0 ); } void HPGL_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil, @@ -239,6 +244,11 @@ bool HPGL_PLOTTER::StartPlot() { wxASSERT( outputFile ); fprintf( outputFile, "IN;VS%d;PU;PA;SP%d;\n", penSpeed, penNumber ); + + // Set HPGL Pen Thickness (in mm) (usefull in polygon fill command) + double penThicknessMM = userToDeviceSize( penDiameter )/40; + fprintf( outputFile, "PT %.1f;\n", penThicknessMM ); + return true; } @@ -256,6 +266,11 @@ bool HPGL_PLOTTER::EndPlot() } +void HPGL_PLOTTER::SetPenDiameter( double diameter ) +{ + penDiameter = diameter; +} + /** * HPGL rectangle: fill not supported */ @@ -269,14 +284,22 @@ void HPGL_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int } -/** - * HPGL circle: fill not supported - */ +// HPGL circle void HPGL_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int width ) { wxASSERT( outputFile ); double radius = userToDeviceSize( diameter / 2 ); + SetCurrentLineWidth( width ); + + if( fill == FILLED_SHAPE ) + { + // Draw the filled area + MoveTo( centre ); + fprintf( outputFile, "PM 0; CI %g;\n", radius ); + fprintf( outputFile, hpgl_end_polygon_cmd ); // Close, fill polygon and draw outlines + PenFinish(); + } if( radius > 0 ) { @@ -314,7 +337,7 @@ void HPGL_PLOTTER::PlotPoly( const std::vector& aCornerList, if( aCornerList[ii] != aCornerList[0] ) LineTo( aCornerList[0] ); - fprintf( outputFile, "PM 2; FP; EP;\n" ); // Close, fill polygon and draw outlines + fprintf( outputFile, hpgl_end_polygon_cmd ); // Close, fill polygon and draw outlines } else { @@ -536,8 +559,8 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, // Gives a correct current starting point for the circle MoveTo( wxPoint( pos.x+radius, pos.y ) ); // Plot filled area and its outline - fprintf( outputFile, "PM 0; PA %.0f,%.0f;CI %.0f; PM 2; FP; EP;\n", - pos_dev.x, pos_dev.y, rsize ); + fprintf( outputFile, "PM 0; PA %.0f,%.0f;CI %.0f;%s", + pos_dev.x, pos_dev.y, rsize, hpgl_end_polygon_cmd ); } else { diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp index ca69560e85..a19cd16341 100644 --- a/eeschema/plot_schematic_HPGL.cpp +++ b/eeschema/plot_schematic_HPGL.cpp @@ -240,7 +240,6 @@ bool DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL( const wxString& aFileName, // Pen num and pen speed are not initialized here. // Default HPGL driver values are used plotter->SetPenDiameter( m_HPGLPenSize ); - plotter->SetPenOverlap( m_HPGLPenSize / 4 ); plotter->StartPlot(); plotter->SetColor( BLACK ); diff --git a/include/plot_common.h b/include/plot_common.h index 8bd541a6c9..4b33c3d07f 100644 --- a/include/plot_common.h +++ b/include/plot_common.h @@ -529,15 +529,7 @@ public: penNumber = number; } - virtual void SetPenDiameter( double diameter ) - { - penDiameter = diameter; - } - - virtual void SetPenOverlap( double overlap ) - { - penOverlap = overlap; - } + virtual void SetPenDiameter( double diameter ); virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil, double aScale, bool aMirror ); @@ -574,7 +566,6 @@ protected: int penSpeed; int penNumber; double penDiameter; - double penOverlap; }; /** diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index ad9d9cac7c..378dfaa119 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -110,12 +110,6 @@ void DIALOG_PLOT::Init_Dialog() m_plotOpts.GetHPGLPenDiameter() * IU_PER_MILS ); m_HPGLPenSizeOpt->AppendText( msg ); - // Set units and value for HPGL pen overlay (this param in in mils). - AddUnitSymbol( *m_textPenOvr, g_UserUnit ); - msg = StringFromValue( g_UserUnit, - m_plotOpts.GetHPGLPenOverlay() * IU_PER_MILS ); - m_HPGLPenOverlayOpt->AppendText( msg ); - AddUnitSymbol( *m_textDefaultPenSize, g_UserUnit ); msg = StringFromValue( g_UserUnit, m_plotOpts.GetLineWidth() ); m_linesWidth->AppendText( msg ); @@ -367,7 +361,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_useAuxOriginCheckBox->SetValue( false ); m_linesWidth->Enable( true ); m_HPGLPenSizeOpt->Enable( false ); - m_HPGLPenOverlayOpt->Enable( false ); m_excludeEdgeLayerOpt->Enable( true ); m_subtractMaskFromSilk->Enable( false ); m_subtractMaskFromSilk->SetValue( false ); @@ -397,7 +390,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_useAuxOriginCheckBox->SetValue( false ); m_linesWidth->Enable( true ); m_HPGLPenSizeOpt->Enable( false ); - m_HPGLPenOverlayOpt->Enable( false ); m_excludeEdgeLayerOpt->Enable( true ); m_subtractMaskFromSilk->Enable( false ); m_subtractMaskFromSilk->SetValue( false ); @@ -427,7 +419,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_useAuxOriginCheckBox->Enable( true ); m_linesWidth->Enable( true ); m_HPGLPenSizeOpt->Enable( false ); - m_HPGLPenOverlayOpt->Enable( false ); m_excludeEdgeLayerOpt->Enable( true ); m_subtractMaskFromSilk->Enable( true ); m_useGerberExtensions->Enable( true ); @@ -455,7 +446,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_useAuxOriginCheckBox->SetValue( false ); m_linesWidth->Enable( false ); m_HPGLPenSizeOpt->Enable( true ); - m_HPGLPenOverlayOpt->Enable( true ); m_excludeEdgeLayerOpt->Enable( true ); m_subtractMaskFromSilk->Enable( false ); m_subtractMaskFromSilk->SetValue( false ); @@ -484,7 +474,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_useAuxOriginCheckBox->Enable( true ); m_linesWidth->Enable( false ); m_HPGLPenSizeOpt->Enable( false ); - m_HPGLPenOverlayOpt->Enable( false ); m_excludeEdgeLayerOpt->Enable( true ); m_subtractMaskFromSilk->Enable( false ); m_subtractMaskFromSilk->SetValue( false ); @@ -595,19 +584,6 @@ void DIALOG_PLOT::applyPlotSettings() reporter.Report( msg, REPORTER::RPT_INFO ); } - // Read HPGL pen overlay (this param is stored in mils) - msg = m_HPGLPenOverlayOpt->GetValue(); - tmp = ValueFromString( g_UserUnit, msg ) / IU_PER_MILS; - - if( !tempOptions.SetHPGLPenOverlay( tmp ) ) - { - msg = StringFromValue( g_UserUnit, - tempOptions.GetHPGLPenOverlay() * IU_PER_MILS ); - m_HPGLPenOverlayOpt->SetValue( msg ); - msg.Printf( _( "HPGL pen overlay constrained." ) ); - reporter.Report( msg, REPORTER::RPT_INFO ); - } - // Default linewidth msg = m_linesWidth->GetValue(); tmp = ValueFromString( g_UserUnit, msg ); diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index a568d1d154..1cffba831c 100644 --- a/pcbnew/dialogs/dialog_plot_base.cpp +++ b/pcbnew/dialogs/dialog_plot_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 17 2015) +// C++ code generated with wxFormBuilder (version Jan 1 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -47,7 +47,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr bSizer29 = new wxBoxSizer( wxHORIZONTAL ); m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_outputDirectoryName->SetMaxLength( 0 ); m_outputDirectoryName->SetToolTip( _("Target directory for plot files. Can be absolute or relative to the board file location.") ); bSizer29->Add( m_outputDirectoryName, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); @@ -171,7 +170,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr bSizer14->Add( m_textDefaultPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_linesWidth = new wxTextCtrl( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_linesWidth->SetMaxLength( 0 ); m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") ); bSizer14->Add( m_linesWidth, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 ); @@ -256,37 +254,14 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_HPGLOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options") ), wxVERTICAL ); wxBoxSizer* bSizer22; - bSizer22 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer20; - bSizer20 = new wxBoxSizer( wxVERTICAL ); + bSizer22 = new wxBoxSizer( wxVERTICAL ); m_textPenSize = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 ); m_textPenSize->Wrap( -1 ); - bSizer20->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 ); + bSizer22->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 ); m_HPGLPenSizeOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_HPGLPenSizeOpt->SetMaxLength( 0 ); - bSizer20->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer22->Add( bSizer20, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer21; - bSizer21 = new wxBoxSizer( wxVERTICAL ); - - m_textPenOvr = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 ); - m_textPenOvr->Wrap( -1 ); - bSizer21->Add( m_textPenOvr, 0, wxRIGHT|wxLEFT, 5 ); - - m_HPGLPenOverlayOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_HPGLPenOverlayOpt->SetMaxLength( 0 ); - m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") ); - - bSizer21->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - - bSizer22->Add( bSizer21, 1, wxEXPAND, 5 ); + bSizer22->Add( m_HPGLPenSizeOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_HPGLOptionsSizer->Add( bSizer22, 1, wxEXPAND, 5 ); @@ -307,7 +282,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr bSizer18->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 ); m_fineAdjustXscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fineAdjustXscaleOpt->SetMaxLength( 0 ); m_fineAdjustXscaleOpt->SetToolTip( _("Set global X scale adjust for exact scale postscript output.") ); bSizer18->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -323,7 +297,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr bSizer19->Add( m_staticText8, 0, wxRIGHT|wxLEFT, 5 ); m_fineAdjustYscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fineAdjustYscaleOpt->SetMaxLength( 0 ); m_fineAdjustYscaleOpt->SetToolTip( _("Set global Y scale adjust for exact scale postscript output.") ); bSizer19->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -339,7 +312,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr bSizer191->Add( m_textPSFineAdjustWidth, 0, wxRIGHT|wxLEFT, 5 ); m_PSFineAdjustWidthOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_PSFineAdjustWidthOpt->SetMaxLength( 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.") ); bSizer191->Add( m_PSFineAdjustWidthOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 79090732d0..cc0ee4ac3b 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -44,7 +44,7 @@ -1,-1 DIALOG_PLOT_BASE - 566,711 + 566,618 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Plot @@ -589,6 +589,7 @@ m_LayersSizer wxHORIZONTAL + 1 protected @@ -701,6 +702,7 @@ sbOptionsSizer wxVERTICAL + 1 none @@ -2315,6 +2317,7 @@ sbSizerSoldMaskLayerOpt wxVERTICAL + 1 none @@ -2679,6 +2682,7 @@ m_GerberOptionsSizer wxHORIZONTAL + 1 protected @@ -3048,395 +3052,200 @@ - + 3 wxALL|wxEXPAND 0 - + wxID_ANY HPGL Options m_HPGLOptionsSizer wxVERTICAL + 1 protected - + 5 wxEXPAND 1 - + bSizer22 - wxHORIZONTAL + wxVERTICAL none 5 - wxEXPAND - 1 - + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pen size + + 0 + + + 0 - bSizer20 - wxVERTICAL - none - - 5 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Pen size - - 0 - - - 0 - - 1 - m_textPenSize - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_HPGLPenSizeOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + m_textPenSize + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + 5 - wxEXPAND - 1 - + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 - bSizer21 - wxVERTICAL - none - - 5 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Pen overlay - - 0 - - - 0 - - 1 - m_textPenOvr - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_HPGLPenOverlayOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Set plot overlay for filling - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + m_HPGLPenSizeOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3453,6 +3262,7 @@ m_PSOptionsSizer wxVERTICAL + 1 protected diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index d33719b572..57088bcfd2 100644 --- a/pcbnew/dialogs/dialog_plot_base.h +++ b/pcbnew/dialogs/dialog_plot_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 17 2015) +// C++ code generated with wxFormBuilder (version Jan 1 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -98,8 +98,6 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxStaticBoxSizer* m_HPGLOptionsSizer; wxStaticText* m_textPenSize; wxTextCtrl* m_HPGLPenSizeOpt; - wxStaticText* m_textPenOvr; - wxTextCtrl* m_HPGLPenOverlayOpt; wxStaticBoxSizer* m_PSOptionsSizer; wxStaticText* m_staticText7; wxTextCtrl* m_fineAdjustXscaleOpt; @@ -129,7 +127,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM public: - DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 566,711 ), 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( 566,618 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_PLOT_BASE(); void DIALOG_PLOT_BASEOnContextMenu( wxMouseEvent &event ) diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index 94a6c75e52..d2c9820c4b 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -89,7 +89,6 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName, plotter = hpgl_plotter; hpgl_plotter->SetPenNumber( plot_opts.GetHPGLPenNum() ); hpgl_plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() ); - hpgl_plotter->SetPenOverlap( 0 ); plotter->SetPageSettings( page_info ); plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false ); } diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index 85aeb0420b..ffcf96e15b 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -40,8 +40,6 @@ #define HPGL_PEN_SPEED_MAX 99 // this param is always in cm/s #define HPGL_PEN_NUMBER_MIN 1 #define HPGL_PEN_NUMBER_MAX 16 -#define HPGL_PEN_OVERLAP_MIN 0 -#define HPGL_PEN_OVERLAP_MAX 50 // Unit = mil /** @@ -93,7 +91,6 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() m_HPGLPenNum = 1; m_HPGLPenSpeed = 20; // this param is always in cm/s m_HPGLPenDiam = 15; // in mils - m_HPGLPenOvr = 2; // in mils m_negative = false; m_A4Output = false; m_plotReference = true; @@ -182,8 +179,6 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter, m_HPGLPenSpeed ); aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpendiameter ), m_HPGLPenDiam ); - aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenoverlay ), - m_HPGLPenOvr ); aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ), m_negative ? trueStr : falseStr ); aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ), @@ -247,8 +242,6 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const return false; if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam ) return false; - if( m_HPGLPenOvr != aPcbPlotParams.m_HPGLPenOvr ) - return false; if( m_negative != aPcbPlotParams.m_negative ) return false; if( m_A4Output != aPcbPlotParams.m_A4Output ) @@ -313,12 +306,6 @@ bool PCB_PLOT_PARAMS::SetHPGLPenSpeed( int aValue ) } -bool PCB_PLOT_PARAMS::SetHPGLPenOverlay( int aValue ) -{ - return setInt( &m_HPGLPenOvr, aValue, HPGL_PEN_OVERLAP_MIN, HPGL_PEN_OVERLAP_MAX ); -} - - bool PCB_PLOT_PARAMS::SetLineWidth( int aValue ) { return setInt( &m_lineWidth, aValue, PLOT_LINEWIDTH_MIN, PLOT_LINEWIDTH_MAX ); @@ -450,8 +437,8 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) HPGL_PEN_DIAMETER_MAX ); break; case T_hpglpenoverlay: - aPcbPlotParams->m_HPGLPenOvr = parseInt( HPGL_PEN_OVERLAP_MIN, - HPGL_PEN_OVERLAP_MAX ); + // No more used. juste here for compatibility with old versions + parseInt( 0, HPGL_PEN_DIAMETER_MAX ); break; case T_pscolor: NeedSYMBOL(); // This actually was never used... diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index ea46b620e6..59f921a360 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -149,7 +149,6 @@ private: int m_HPGLPenNum; ///< HPGL only: pen number selection(1 to 9) int m_HPGLPenSpeed; ///< HPGL only: pen speed, always in cm/s (1 to 99 cm/s) int m_HPGLPenDiam; ///< HPGL only: pen diameter in MILS, useful to fill areas - int m_HPGLPenOvr; ///< HPGL only: pen overlay in MILS, useful only to fill areas EDA_COLOR_T m_color; ///< Color for plotting the current layer EDA_COLOR_T m_referenceColor; ///< Color for plotting references EDA_COLOR_T m_valueColor; ///< Color for plotting values @@ -263,8 +262,6 @@ public: bool SetHPGLPenDiameter( int aValue ); int GetHPGLPenSpeed() const { return m_HPGLPenSpeed; }; bool SetHPGLPenSpeed( int aValue ); - int GetHPGLPenOverlay() const { return m_HPGLPenOvr; }; - bool SetHPGLPenOverlay( int aValue ); void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; } int GetHPGLPenNum() const { return m_HPGLPenNum; } diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index ada2e2dc6e..354e51ae1d 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -903,20 +903,9 @@ static void ConfigureHPGLPenSizes( HPGL_PLOTTER *aPlotter, int pen_diam = KiROUND( aPlotOpts->GetHPGLPenDiameter() * IU_PER_MILS / aPlotOpts->GetScale() ); - // compute pen_overlay (value comes in mils) in pcb units with plot scale - if( aPlotOpts->GetHPGLPenOverlay() < 0 ) - aPlotOpts->SetHPGLPenOverlay( 0 ); - - if( aPlotOpts->GetHPGLPenOverlay() >= aPlotOpts->GetHPGLPenDiameter() ) - aPlotOpts->SetHPGLPenOverlay( aPlotOpts->GetHPGLPenDiameter() - 1 ); - - int pen_overlay = KiROUND( aPlotOpts->GetHPGLPenOverlay() * IU_PER_MILS / - aPlotOpts->GetScale() ); - // Set HPGL-specific options and start aPlotter->SetPenSpeed( aPlotOpts->GetHPGLPenSpeed() ); aPlotter->SetPenNumber( aPlotOpts->GetHPGLPenNum() ); - aPlotter->SetPenOverlap( pen_overlay ); aPlotter->SetPenDiameter( pen_diam ); }