diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index bdf0a4d318..0ed6f21190 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -193,10 +193,10 @@ void DIALOG_PLOT::init_Dialog() setPlotModeChoiceSelection( m_plotOpts.GetPlotMode() ); // Plot outline mode - m_plotOutlineModeOpt->SetValue( m_plotOpts.GetPlotOutlineMode() ); + m_DXF_plotModeOpt->SetValue( m_plotOpts.GetDXFPlotPolygonMode() ); // Plot text mode - m_plotTextAsLineOpt->SetValue( m_plotOpts.GetTextMode() == PLOTTEXTMODE_DEFAULT ); + m_DXF_plotTextStrokeFontOpt->SetValue( m_plotOpts.GetTextMode() == PLOTTEXTMODE_DEFAULT ); // Plot mirror option m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() ); @@ -312,12 +312,16 @@ void DIALOG_PLOT::CreateDrillFile( wxCommandEvent& event ) } -void DIALOG_PLOT::OnChangeOutlineMode( wxCommandEvent& event ) +void DIALOG_PLOT::OnChangeDXFPlotMode( wxCommandEvent& event ) { - m_plotTextAsLineOpt->Enable( !m_plotOutlineModeOpt->GetValue() ); + // m_DXF_plotTextStrokeFontOpt is disabled if m_DXF_plotModeOpt + // is checked (plot in DXF polygon mode) + m_DXF_plotTextStrokeFontOpt->Enable( !m_DXF_plotModeOpt->GetValue() ); - if( !m_plotTextAsLineOpt->IsEnabled() ) - m_plotTextAsLineOpt->SetValue( true ); + // if m_DXF_plotTextStrokeFontOpt option is disabled (plot DXF in polygon mode), + // force m_DXF_plotTextStrokeFontOpt to true to use Pcbnew stroke font + if( !m_DXF_plotTextStrokeFontOpt->IsEnabled() ) + m_DXF_plotTextStrokeFontOpt->SetValue( true ); } @@ -388,6 +392,9 @@ PlotFormat DIALOG_PLOT::getPlotFormat() // and clear also some optional values void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) { + // this option exist only in DXF format: + m_DXF_plotModeOpt->Enable( getPlotFormat() == PLOT_FORMAT_DXF ); + switch( getPlotFormat() ) { case PLOT_FORMAT_PDF: @@ -395,8 +402,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_drillShapeOpt->Enable( true ); m_plotModeOpt->Enable( false ); setPlotModeChoiceSelection( FILLED ); - m_plotOutlineModeOpt->Enable( false ); - m_plotOutlineModeOpt->SetValue( false ); m_plotMirrorOpt->Enable( true ); m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); @@ -411,19 +416,16 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotPSNegativeOpt->Enable( true ); m_forcePSA4OutputOpt->Enable( false ); m_forcePSA4OutputOpt->SetValue( false ); - m_plotTextAsLineOpt->Enable( false ); - m_plotTextAsLineOpt->SetValue( true ); m_PlotOptionsSizer->Hide( m_GerberOptionsSizer ); m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer ); m_PlotOptionsSizer->Hide( m_PSOptionsSizer ); + m_PlotOptionsSizer->Hide( m_SizerDXF_options ); break; case PLOT_FORMAT_POST: m_drillShapeOpt->Enable( true ); m_plotModeOpt->Enable( true ); - m_plotOutlineModeOpt->Enable( false ); - m_plotOutlineModeOpt->SetValue( false ); m_plotMirrorOpt->Enable( true ); m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); @@ -436,12 +438,11 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_PSFineAdjustWidthOpt->Enable( true ); m_plotPSNegativeOpt->Enable( true ); m_forcePSA4OutputOpt->Enable( true ); - m_plotTextAsLineOpt->Enable( false ); - m_plotTextAsLineOpt->SetValue( true ); m_PlotOptionsSizer->Hide( m_GerberOptionsSizer ); m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer ); m_PlotOptionsSizer->Show( m_PSOptionsSizer ); + m_PlotOptionsSizer->Hide( m_SizerDXF_options ); break; case PLOT_FORMAT_GERBER: @@ -449,8 +450,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_drillShapeOpt->SetSelection( 0 ); m_plotModeOpt->Enable( false ); setPlotModeChoiceSelection( FILLED ); - m_plotOutlineModeOpt->Enable( false ); - m_plotOutlineModeOpt->SetValue( false ); m_plotMirrorOpt->Enable( false ); m_plotMirrorOpt->SetValue( false ); m_useAuxOriginCheckBox->Enable( true ); @@ -466,19 +465,16 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotPSNegativeOpt->SetValue( false ); m_forcePSA4OutputOpt->Enable( false ); m_forcePSA4OutputOpt->SetValue( false ); - m_plotTextAsLineOpt->Enable( false ); - m_plotTextAsLineOpt->SetValue( true ); m_PlotOptionsSizer->Show( m_GerberOptionsSizer ); m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer ); m_PlotOptionsSizer->Hide( m_PSOptionsSizer ); + m_PlotOptionsSizer->Hide( m_SizerDXF_options ); break; case PLOT_FORMAT_HPGL: m_drillShapeOpt->Enable( true ); m_plotModeOpt->Enable( true ); - m_plotOutlineModeOpt->Enable( false ); - m_plotOutlineModeOpt->SetValue( false ); m_plotMirrorOpt->Enable( true ); m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); @@ -492,19 +488,17 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotPSNegativeOpt->SetValue( false ); m_plotPSNegativeOpt->Enable( false ); m_forcePSA4OutputOpt->Enable( true ); - m_plotTextAsLineOpt->Enable( false ); - m_plotTextAsLineOpt->SetValue( true ); m_PlotOptionsSizer->Hide( m_GerberOptionsSizer ); m_PlotOptionsSizer->Show( m_HPGLOptionsSizer ); m_PlotOptionsSizer->Hide( m_PSOptionsSizer ); + m_PlotOptionsSizer->Hide( m_SizerDXF_options ); break; case PLOT_FORMAT_DXF: m_drillShapeOpt->Enable( true ); m_plotModeOpt->Enable( false ); setPlotModeChoiceSelection( FILLED ); - m_plotOutlineModeOpt->Enable( true ); m_plotMirrorOpt->Enable( false ); m_plotMirrorOpt->SetValue( false ); m_useAuxOriginCheckBox->Enable( true ); @@ -524,12 +518,10 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_PlotOptionsSizer->Hide( m_GerberOptionsSizer ); m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer ); m_PlotOptionsSizer->Hide( m_PSOptionsSizer ); + m_PlotOptionsSizer->Show( m_SizerDXF_options ); - OnChangeOutlineMode( event ); + OnChangeDXFPlotMode( event ); break; - - default: - wxASSERT( false ); } /* Update the interlock between scale and frame reference @@ -599,13 +591,13 @@ void DIALOG_PLOT::applyPlotSettings() ( m_drillShapeOpt->GetSelection() ) ); tempOptions.SetMirror( m_plotMirrorOpt->GetValue() ); tempOptions.SetPlotMode( m_plotModeOpt->GetSelection() == 1 ? SKETCH : FILLED ); - tempOptions.SetPlotOutlineMode( m_plotOutlineModeOpt->GetValue() ); + tempOptions.SetDXFPlotPolygonMode( m_DXF_plotModeOpt->GetValue() ); tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() ); - if( !m_plotTextAsLineOpt->IsEnabled() ) // Currently, only DXF supports this option + if( !m_DXF_plotTextStrokeFontOpt->IsEnabled() ) // Currently, only DXF supports this option tempOptions.SetTextMode( PLOTTEXTMODE_DEFAULT ); else - tempOptions.SetTextMode( m_plotTextAsLineOpt->GetValue() ? + tempOptions.SetTextMode( m_DXF_plotTextStrokeFontOpt->GetValue() ? PLOTTEXTMODE_DEFAULT : PLOTTEXTMODE_NATIVE ); // Update settings from text fields. Rewrite values back to the fields, diff --git a/pcbnew/dialogs/dialog_plot.h b/pcbnew/dialogs/dialog_plot.h index ec0a902e90..39faa712e6 100644 --- a/pcbnew/dialogs/dialog_plot.h +++ b/pcbnew/dialogs/dialog_plot.h @@ -5,7 +5,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -25,19 +25,20 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +//#include #include #include #include /** - * Class DIALOG_PLOT - * + * Class DIALOG_PLOT is the dialog to set the plot options, and create plot files + * in various formats. */ class DIALOG_PLOT : public DIALOG_PLOT_BASE { public: DIALOG_PLOT( PCB_EDIT_FRAME* parent ); + private: PCB_EDIT_FRAME* m_parent; BOARD* m_board; @@ -65,15 +66,15 @@ private: void OnRightClick( wxMouseEvent& event ) override; void OnPopUpLayers( wxCommandEvent& event ) override; void SetPlotFormat( wxCommandEvent& event ) override; - void OnChangeOutlineMode( wxCommandEvent& event ) override; + void OnChangeDXFPlotMode( wxCommandEvent& event ) override; void OnSetScaleOpt( wxCommandEvent& event ) override; void CreateDrillFile( wxCommandEvent& event ) override; void OnGerberX2Checked( wxCommandEvent& event ) override; void onRunDRC( wxCommandEvent& event ) override; // other functions - void init_Dialog(); // main initialization - void reInitDialog(); // initialization after calling drill dialog + void init_Dialog(); // main initialization + void reInitDialog(); // initialization after calling drill dialog void applyPlotSettings(); PlotFormat getPlotFormat(); diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index 7930e659d1..75ff3946cf 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 Dec 21 2016) +// C++ code generated with wxFormBuilder (version Jul 2 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -128,18 +128,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr bSizerPlotItems->Add( m_useAuxOriginCheckBox, 0, wxALL, 2 ); - m_plotOutlineModeOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot lines in outline mode"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotOutlineModeOpt->SetValue(true); - m_plotOutlineModeOpt->SetToolTip( _("Otherwise plot with sketch lines in layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab) and plot in outline mode in other layers (*.Cu, *.Adhes, *.Paste, *.Mask)") ); - - bSizerPlotItems->Add( m_plotOutlineModeOpt, 0, wxALL, 2 ); - - m_plotTextAsLineOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot all text as lines"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotTextAsLineOpt->SetValue(true); - m_plotTextAsLineOpt->SetToolTip( _("Otherwise plot oneline ASCII text as editable text") ); - - bSizerPlotItems->Add( m_plotTextAsLineOpt, 0, wxALL, 2 ); - bSizer192->Add( bSizerPlotItems, 0, wxEXPAND, 5 ); @@ -271,18 +259,18 @@ 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( wxVERTICAL ); + wxBoxSizer* bSizerHPGL_options; + bSizerHPGL_options = new wxBoxSizer( wxVERTICAL ); m_textPenSize = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 ); m_textPenSize->Wrap( -1 ); - bSizer22->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 ); + bSizerHPGL_options->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 ); m_HPGLPenSizeOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer22->Add( m_HPGLPenSizeOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + bSizerHPGL_options->Add( m_HPGLPenSizeOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_HPGLOptionsSizer->Add( bSizer22, 1, wxEXPAND, 5 ); + m_HPGLOptionsSizer->Add( bSizerHPGL_options, 1, wxEXPAND, 5 ); m_PlotOptionsSizer->Add( m_HPGLOptionsSizer, 0, wxALL|wxEXPAND, 3 ); @@ -346,6 +334,22 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_PlotOptionsSizer->Add( m_PSOptionsSizer, 0, wxALL|wxEXPAND, 3 ); + m_SizerDXF_options = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF options") ), wxVERTICAL ); + + m_DXF_plotModeOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Plot all layers in outline (polygon) mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_DXF_plotModeOpt->SetValue(true); + m_DXF_plotModeOpt->SetToolTip( _("DXF only:\nCheck to plot all layers in polygon mode.\nUncheck to plot in sketch mode layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab)\nand plot in polygon mode other layers (*.Cu, *.Adhes, *.Paste, *.Mask)") ); + + m_SizerDXF_options->Add( m_DXF_plotModeOpt, 0, wxALL, 2 ); + + m_DXF_plotTextStrokeFontOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Use Pcbnew font to plot texts"), wxDefaultPosition, wxDefaultSize, 0 ); + m_DXF_plotTextStrokeFontOpt->SetToolTip( _("Check to use Pcbnew stroke font\nUncheck to plot oneline ASCII texts as editable text (using DXF font)") ); + + m_SizerDXF_options->Add( m_DXF_plotTextStrokeFontOpt, 0, wxALL, 2 ); + + + m_PlotOptionsSizer->Add( m_SizerDXF_options, 0, wxEXPAND, 5 ); + bmiddleSizer->Add( m_PlotOptionsSizer, 0, 0, 5 ); @@ -421,9 +425,9 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr 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_layerCheckListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this ); - m_plotOutlineModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeOutlineMode ), NULL, this ); m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); m_useGerberX2Attributes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); + m_DXF_plotModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), 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_buttonDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); @@ -444,9 +448,9 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() 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_layerCheckListBox->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_PLOT_BASE::OnRightClick ), NULL, this ); - m_plotOutlineModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeOutlineMode ), NULL, this ); m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this ); m_useGerberX2Attributes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); + m_DXF_plotModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), 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_buttonDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 3c2d8a155c..95ef900d15 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -88,16 +88,16 @@ - + m_MainSizer wxVERTICAL protected - + 5 wxEXPAND 0 - + bupperSizer wxHORIZONTAL @@ -570,11 +570,11 @@ - + 5 wxEXPAND 0 - + bmiddleSizer wxHORIZONTAL @@ -683,20 +683,20 @@ - + 5 0 - + m_PlotOptionsSizer wxVERTICAL protected - + 3 wxALL|wxEXPAND 0 - + wxID_ANY General Options @@ -705,20 +705,20 @@ 1 none - + 5 wxEXPAND 0 - + bSizer192 wxHORIZONTAL none - + 5 wxEXPAND 0 - + bSizerPlotItems wxVERTICAL @@ -1603,182 +1603,6 @@ - - 2 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Plot lines in outline mode - - 0 - - - 0 - - 1 - m_plotOutlineModeOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Otherwise plot with sketch lines in layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab) and plot in outline mode in other layers (*.Cu, *.Adhes, *.Paste, *.Mask) - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnChangeOutlineMode - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Plot all text as lines - - 0 - - - 0 - - 1 - m_plotTextAsLineOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Otherwise plot oneline ASCII text as editable text - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3335,7 +3159,7 @@ 1 - bSizer22 + bSizerHPGL_options wxVERTICAL none @@ -4185,11 +4009,202 @@ + + 5 + wxEXPAND + 0 + + wxID_ANY + DXF options + + m_SizerDXF_options + wxVERTICAL + 1 + protected + + + 2 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Plot all layers in outline (polygon) mode + + 0 + + + 0 + + 1 + m_DXF_plotModeOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + DXF only: Check to plot all layers in polygon mode. Uncheck to plot in sketch mode layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab) and plot in polygon mode other layers (*.Cu, *.Adhes, *.Paste, *.Mask) + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnChangeDXFPlotMode + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Use Pcbnew font to plot texts + + 0 + + + 0 + + 1 + m_DXF_plotTextStrokeFontOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Check to use Pcbnew stroke font Uncheck to plot oneline ASCII texts as editable text (using DXF font) + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + 5 wxEXPAND 1 diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index 7e7c4077f4..d0d5043088 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 Dec 21 2016) +// C++ code generated with wxFormBuilder (version Jul 2 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -78,8 +78,6 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxCheckBox* m_plotMirrorOpt; wxCheckBox* m_plotPSNegativeOpt; wxCheckBox* m_useAuxOriginCheckBox; - wxCheckBox* m_plotOutlineModeOpt; - wxCheckBox* m_plotTextAsLineOpt; wxStaticText* m_staticText11; wxChoice* m_drillShapeOpt; wxStaticText* m_staticText12; @@ -109,6 +107,9 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxStaticText* m_textPSFineAdjustWidth; wxTextCtrl* m_PSFineAdjustWidthOpt; wxCheckBox* m_forcePSA4OutputOpt; + wxStaticBoxSizer* m_SizerDXF_options; + wxCheckBox* m_DXF_plotModeOpt; + wxCheckBox* m_DXF_plotTextStrokeFontOpt; WX_HTML_REPORT_PANEL* m_messagesPanel; wxButton* m_plotButton; wxButton* m_buttonDrill; @@ -122,9 +123,9 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM virtual void OnRightClick( wxMouseEvent& event ) { event.Skip(); } virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); } virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } - virtual void OnChangeOutlineMode( wxCommandEvent& event ) { event.Skip(); } virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); } virtual void OnGerberX2Checked( wxCommandEvent& event ) { event.Skip(); } + virtual void OnChangeDXFPlotMode( wxCommandEvent& event ) { event.Skip(); } virtual void Plot( wxCommandEvent& event ) { event.Skip(); } virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } virtual void onRunDRC( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index 0431042c1c..0e0e085608 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -88,7 +88,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() m_plotFrameRef = false; m_plotViaOnMaskLayer = false; m_plotMode = FILLED; - m_plotOutlineMode = true; + m_DXFplotPolygonMode = true; m_useAuxOrigin = false; m_HPGLPenNum = 1; m_HPGLPenSpeed = 20; // this param is always in cm/s @@ -242,7 +242,7 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const return false; if( m_plotMode != aPcbPlotParams.m_plotMode ) return false; - if( m_plotOutlineMode != aPcbPlotParams.m_plotOutlineMode ) + if( m_DXFplotPolygonMode != aPcbPlotParams.m_DXFplotPolygonMode ) return false; if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin ) return false; @@ -294,6 +294,7 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const return false; if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) ) return false; + return true; } diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index 5f44bce561..a33b9375d6 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -54,8 +54,10 @@ private: */ EDA_DRAW_MODE_T m_plotMode; - /// Plot lines in outline mode - bool m_plotOutlineMode; + /// DXF format: Plot items in outline (polygon) mode + /// In polygon mode, each item to plot is converted to a polygon, and all + /// polygons are merged. + bool m_DXFplotPolygonMode; /// Plot format type (chooses the driver to be used) PlotFormat m_format; @@ -186,8 +188,8 @@ public: void SetPlotMode( EDA_DRAW_MODE_T aPlotMode ) { m_plotMode = aPlotMode; } EDA_DRAW_MODE_T GetPlotMode() const { return m_plotMode; } - void SetPlotOutlineMode( bool aFlag ) { m_plotOutlineMode = aFlag; } - bool GetPlotOutlineMode() const { return m_plotOutlineMode; } + void SetDXFPlotPolygonMode( bool aFlag ) { m_DXFplotPolygonMode = aFlag; } + bool GetDXFPlotPolygonMode() const { return m_DXFplotPolygonMode; } void SetDrillMarksType( DrillMarksType aVal ) { m_drillMarks = aVal; } DrillMarksType GetDrillMarksType() const { return m_drillMarks; } diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 308d351e19..b99aca98c1 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -223,7 +223,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer, case F_SilkS: case B_SilkS: - if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetPlotOutlineMode() ) + if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetDXFPlotPolygonMode() ) // PlotLayerOutlines() is designed only for DXF plotters. // and must not be used for other plot formats PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt ); @@ -266,7 +266,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer, plotOpt.SetSkipPlotNPTH_Pads( false ); plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE ); - if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetPlotOutlineMode() ) + if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetDXFPlotPolygonMode() ) // PlotLayerOutlines() is designed only for DXF plotters. // and must not be used for other plot formats PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt ); @@ -278,7 +278,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer, plotOpt.SetSkipPlotNPTH_Pads( false ); plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE ); - if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetPlotOutlineMode() ) + if( plotOpt.GetFormat() == PLOT_FORMAT_DXF && plotOpt.GetDXFPlotPolygonMode() ) // PlotLayerOutlines() is designed only for DXF plotters. // and must not be used for other plot formats PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );