kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #29356
[PATCH] DXF line plot mode and plot editable text for stable 4.0 branch
@Wayne, as you asked I prepared patches for stable 4.0 branch.
Related message and bug:
https://bugs.launchpad.net/kicad/+bug/1423515
>From 6a597c6f1b01b9ae0763e95deb25cedac988b962 Mon Sep 17 00:00:00 2001
From: Eldar Khayrullin <eldar.khayrullin@xxxxxxx>
Date: Sun, 16 Apr 2017 20:07:31 +0300
Subject: [PATCH 2/2] Pcbnew: add option to plot DXF editable text
Add option to plot DXF oneline ASCII text as editable text (in non-outline mode)
Fixes: lp:1423515
* https://bugs.launchpad.net/kicad/+bug/1423515
---
common/common_plotDXF_functions.cpp | 2 +-
pcbnew/dialogs/dialog_plot.cpp | 23 ++++++++++
pcbnew/dialogs/dialog_plot.h | 19 ++++----
pcbnew/dialogs/dialog_plot_base.cpp | 8 ++++
pcbnew/dialogs/dialog_plot_base.fbp | 90 ++++++++++++++++++++++++++++++++++++-
pcbnew/dialogs/dialog_plot_base.h | 4 +-
6 files changed, 134 insertions(+), 12 deletions(-)
diff --git a/common/common_plotDXF_functions.cpp b/common/common_plotDXF_functions.cpp
index ecec04fe5..5544ab19f 100644
--- a/common/common_plotDXF_functions.cpp
+++ b/common/common_plotDXF_functions.cpp
@@ -675,7 +675,7 @@ void DXF_PLOTTER::Text( const wxPoint& aPos,
if( textAsLines || containsNonAsciiChars( aText ) || aMultilineAllowed )
{
// output text as graphics.
- // Perhaps miltiline texts could be handled as DXF text entity
+ // Perhaps multiline texts could be handled as DXF text entity
// but I do not want spend time about this (JPC)
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
aWidth, aItalic, aBold, aMultilineAllowed );
diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp
index a633ea2bb..bab8e73cb 100644
--- a/pcbnew/dialogs/dialog_plot.cpp
+++ b/pcbnew/dialogs/dialog_plot.cpp
@@ -197,6 +197,9 @@ void DIALOG_PLOT::Init_Dialog()
// Plot outline mode
m_plotOutlineModeOpt->SetValue( m_plotOpts.GetPlotOutlineMode() );
+ // Plot text mode
+ m_plotTextAsLineOpt->SetValue( m_plotOpts.GetTextMode() == PLOTTEXTMODE_DEFAULT );
+
// Plot mirror option
m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() );
@@ -291,6 +294,14 @@ void DIALOG_PLOT::CreateDrillFile( wxCommandEvent& event )
}
+void DIALOG_PLOT::OnChangeOutlineMode( wxCommandEvent& event )
+{
+ m_plotTextAsLineOpt->Enable( !m_plotOutlineModeOpt->GetValue() );
+ if( !m_plotTextAsLineOpt->IsEnabled() )
+ m_plotTextAsLineOpt->SetValue( true );
+}
+
+
void DIALOG_PLOT::OnSetScaleOpt( wxCommandEvent& event )
{
/* Disable sheet reference for scale != 1:1 */
@@ -388,6 +399,8 @@ 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( false );
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
@@ -418,6 +431,8 @@ 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 );
@@ -450,6 +465,8 @@ 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 );
@@ -481,6 +498,8 @@ 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 );
@@ -518,6 +537,8 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
+
+ OnChangeOutlineMode( event );
break;
default:
@@ -593,6 +614,8 @@ void DIALOG_PLOT::applyPlotSettings()
tempOptions.SetPlotMode( m_plotModeOpt->GetSelection() == 1 ? SKETCH : FILLED );
tempOptions.SetPlotOutlineMode( m_plotOutlineModeOpt->GetValue() );
tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );
+ tempOptions.SetTextMode( m_plotTextAsLineOpt->GetValue() ?
+ PLOTTEXTMODE_DEFAULT : PLOTTEXTMODE_NATIVE );
// Update settings from text fields. Rewrite values back to the fields,
// since the values may have been constrained by the setters.
diff --git a/pcbnew/dialogs/dialog_plot.h b/pcbnew/dialogs/dialog_plot.h
index 47f4692ac..2ec12be3a 100644
--- a/pcbnew/dialogs/dialog_plot.h
+++ b/pcbnew/dialogs/dialog_plot.h
@@ -59,15 +59,16 @@ private:
// Event called functions
void Init_Dialog();
- void Plot( wxCommandEvent& event );
- void OnQuit( wxCommandEvent& event );
- void OnClose( wxCloseEvent& event );
- void OnOutputDirectoryBrowseClicked( wxCommandEvent& event );
- void OnRightClick( wxMouseEvent& event );
- void OnPopUpLayers( wxCommandEvent& event );
- void SetPlotFormat( wxCommandEvent& event );
- void OnSetScaleOpt( wxCommandEvent& event );
- void CreateDrillFile( wxCommandEvent& event );
+ void Plot( wxCommandEvent& event ) override;
+ void OnQuit( wxCommandEvent& event ) override;
+ void OnClose( wxCloseEvent& event ) override;
+ void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
+ void OnRightClick( wxMouseEvent& event ) override;
+ void OnPopUpLayers( wxCommandEvent& event ) override;
+ void SetPlotFormat( wxCommandEvent& event ) override;
+ void OnChangeOutlineMode( wxCommandEvent& event ) override;
+ void OnSetScaleOpt( wxCommandEvent& event ) override;
+ void CreateDrillFile( wxCommandEvent& event ) override;
// orther functions
void applyPlotSettings();
diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp
index fed9c843c..92a286dff 100644
--- a/pcbnew/dialogs/dialog_plot_base.cpp
+++ b/pcbnew/dialogs/dialog_plot_base.cpp
@@ -133,6 +133,12 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
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 );
@@ -424,6 +430,7 @@ 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_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 );
@@ -444,6 +451,7 @@ 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_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 );
diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp
index 589db7671..73f9259d7 100644
--- a/pcbnew/dialogs/dialog_plot_base.fbp
+++ b/pcbnew/dialogs/dialog_plot_base.fbp
@@ -44,7 +44,7 @@
<property name="minimum_size">-1,-1</property>
<property name="name">DIALOG_PLOT_BASE</property>
<property name="pos"></property>
- <property name="size">733,808</property>
+ <property name="size">733,809</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Plot</property>
@@ -1666,6 +1666,94 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
+ <event name="OnCheckBox">OnChangeOutlineMode</event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
+ <object class="sizeritem" expanded="0">
+ <property name="border">2</property>
+ <property name="flag">wxALL</property>
+ <property name="proportion">0</property>
+ <object class="wxCheckBox" expanded="0">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="checked">1</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">Plot all text as lines</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_plotTextAsLineOpt</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass"></property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip">Otherwise plot oneline ASCII text as editable text</property>
+ <property name="validator_data_type"></property>
+ <property name="validator_style">wxFILTER_NONE</property>
+ <property name="validator_type">wxDefaultValidator</property>
+ <property name="validator_variable"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h
index 7a9f1bf88..6935dadf6 100644
--- a/pcbnew/dialogs/dialog_plot_base.h
+++ b/pcbnew/dialogs/dialog_plot_base.h
@@ -79,6 +79,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
wxCheckBox* m_plotPSNegativeOpt;
wxCheckBox* m_useAuxOriginCheckBox;
wxCheckBox* m_plotOutlineModeOpt;
+ wxCheckBox* m_plotTextAsLineOpt;
wxStaticText* m_staticText11;
wxChoice* m_drillShapeOpt;
wxStaticText* m_staticText12;
@@ -121,6 +122,7 @@ 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 Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
@@ -130,7 +132,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( 733,808 ), 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( 733,809 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_BASE();
void DIALOG_PLOT_BASEOnContextMenu( wxMouseEvent &event )
--
2.11.0
>From 3a60a6c2e025e646418b974d49dd63407a88ff7c Mon Sep 17 00:00:00 2001
From: Eldar Khayrullin <eldar.khayrullin@xxxxxxx>
Date: Sat, 22 Apr 2017 23:15:08 +0300
Subject: [PATCH 1/2] Pcbnew: add option to plot DXF lines in outline mode
Add option to plot dialog to plot DXF layers *.Cu, *.Adhes, *.Paste, and
*.Mask in outline mode or line mode.
Fixes lp:1643330
https://bugs.launchpad.net/kicad/+bug/1643330
---
common/common_plotDXF_functions.cpp | 5 +-
pcbnew/dialogs/dialog_plot.cpp | 14 +++++
pcbnew/dialogs/dialog_plot_base.cpp | 15 +++---
pcbnew/dialogs/dialog_plot_base.fbp | 102 ++++++++++++++++++++++++++++++++++--
pcbnew/dialogs/dialog_plot_base.h | 5 +-
pcbnew/pcb_plot_params.cpp | 3 ++
pcbnew/pcb_plot_params.h | 6 +++
pcbnew/plot_board_layers.cpp | 6 +--
8 files changed, 137 insertions(+), 19 deletions(-)
diff --git a/common/common_plotDXF_functions.cpp b/common/common_plotDXF_functions.cpp
index ae8817df0..ecec04fe5 100644
--- a/common/common_plotDXF_functions.cpp
+++ b/common/common_plotDXF_functions.cpp
@@ -424,7 +424,7 @@ void DXF_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList,
// Now, output the final polygon to DXF file:
last = path.PointCount() - 1;
- VECTOR2I point = path.CPoint( 0 );
+ VECTOR2I point = path.CPoint( 0 );
wxPoint startPoint( point.x, point.y );
MoveTo( startPoint );
@@ -480,7 +480,8 @@ void DXF_PLOTTER::SetDash( bool dashed )
void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int aWidth,
EDA_DRAW_MODE_T aPlotMode )
{
- segmentAsOval( aStart, aEnd, aWidth, aPlotMode );
+ MoveTo( aStart );
+ FinishTo( aEnd );
}
/* Plot an arc in DXF format
diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp
index 5806438fe..a633ea2bb 100644
--- a/pcbnew/dialogs/dialog_plot.cpp
+++ b/pcbnew/dialogs/dialog_plot.cpp
@@ -194,6 +194,9 @@ void DIALOG_PLOT::Init_Dialog()
// Plot mode
setPlotModeChoiceSelection( m_plotOpts.GetPlotMode() );
+ // Plot outline mode
+ m_plotOutlineModeOpt->SetValue( m_plotOpts.GetPlotOutlineMode() );
+
// Plot mirror option
m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() );
@@ -362,6 +365,8 @@ 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 );
@@ -392,6 +397,8 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
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 );
@@ -422,6 +429,8 @@ 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 );
@@ -450,6 +459,8 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
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 );
@@ -479,6 +490,8 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
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 );
@@ -578,6 +591,7 @@ 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.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );
// Update settings from text fields. Rewrite values back to the fields,
diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp
index a568d1d15..fed9c843c 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 Dec 21 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 );
@@ -128,6 +127,12 @@ 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 );
+
bSizer192->Add( bSizerPlotItems, 0, wxEXPAND, 5 );
@@ -171,7 +176,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 );
@@ -266,7 +270,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizer20->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 );
@@ -280,7 +283,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
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 );
@@ -307,7 +309,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 +324,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 +339,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 79090732d..589db7671 100644
--- a/pcbnew/dialogs/dialog_plot_base.fbp
+++ b/pcbnew/dialogs/dialog_plot_base.fbp
@@ -44,7 +44,7 @@
<property name="minimum_size">-1,-1</property>
<property name="name">DIALOG_PLOT_BASE</property>
<property name="pos"></property>
- <property name="size">566,711</property>
+ <property name="size">733,808</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Plot</property>
@@ -88,7 +88,7 @@
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
- <object class="wxBoxSizer" expanded="1">
+ <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">m_MainSizer</property>
<property name="orient">wxVERTICAL</property>
@@ -589,6 +589,7 @@
<property name="minimum_size"></property>
<property name="name">m_LayersSizer</property>
<property name="orient">wxHORIZONTAL</property>
+ <property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -701,6 +702,7 @@
<property name="minimum_size"></property>
<property name="name">sbOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
+ <property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
@@ -1601,6 +1603,94 @@
<event name="OnUpdateUI"></event>
</object>
</object>
+ <object class="sizeritem" expanded="0">
+ <property name="border">2</property>
+ <property name="flag">wxALL</property>
+ <property name="proportion">0</property>
+ <object class="wxCheckBox" expanded="0">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="checked">1</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">Plot lines in outline mode</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_plotOutlineModeOpt</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass"></property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip">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)</property>
+ <property name="validator_data_type"></property>
+ <property name="validator_style">wxFILTER_NONE</property>
+ <property name="validator_type">wxDefaultValidator</property>
+ <property name="validator_variable"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <event name="OnChar"></event>
+ <event name="OnCheckBox"></event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -2315,6 +2405,7 @@
<property name="minimum_size"></property>
<property name="name">sbSizerSoldMaskLayerOpt</property>
<property name="orient">wxVERTICAL</property>
+ <property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -2679,6 +2770,7 @@
<property name="minimum_size"></property>
<property name="name">m_GerberOptionsSizer</property>
<property name="orient">wxHORIZONTAL</property>
+ <property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -3058,6 +3150,7 @@
<property name="minimum_size"></property>
<property name="name">m_HPGLOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
+ <property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -3453,6 +3546,7 @@
<property name="minimum_size"></property>
<property name="name">m_PSOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
+ <property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@@ -4115,7 +4209,7 @@
</object>
</object>
</object>
- <object class="sizeritem" expanded="1">
+ <object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
@@ -4206,7 +4300,7 @@
</object>
</object>
</object>
- <object class="sizeritem" expanded="1">
+ <object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h
index d33719b57..7a9f1bf88 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 Dec 21 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -78,6 +78,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
wxCheckBox* m_plotMirrorOpt;
wxCheckBox* m_plotPSNegativeOpt;
wxCheckBox* m_useAuxOriginCheckBox;
+ wxCheckBox* m_plotOutlineModeOpt;
wxStaticText* m_staticText11;
wxChoice* m_drillShapeOpt;
wxStaticText* m_staticText12;
@@ -129,7 +130,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( 733,808 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_BASE();
void DIALOG_PLOT_BASEOnContextMenu( wxMouseEvent &event )
diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp
index 9f40fbcdc..69a8c2ab2 100644
--- a/pcbnew/pcb_plot_params.cpp
+++ b/pcbnew/pcb_plot_params.cpp
@@ -90,6 +90,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() :
m_plotFrameRef = false;
m_plotViaOnMaskLayer = false;
m_plotMode = FILLED;
+ m_plotOutlineMode = true;
m_useAuxOrigin = false;
m_HPGLPenNum = 1;
m_HPGLPenSpeed = 20; // this param is always in cm/s
@@ -239,6 +240,8 @@ 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 )
+ return false;
if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
return false;
if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h
index ea46b620e..c111c0895 100644
--- a/pcbnew/pcb_plot_params.h
+++ b/pcbnew/pcb_plot_params.h
@@ -54,6 +54,9 @@ private:
*/
EDA_DRAW_MODE_T m_plotMode;
+ /// Plot lines in outline mode
+ bool m_plotOutlineMode;
+
/// Plot format type (chooses the driver to be used)
PlotFormat m_format;
@@ -182,6 +185,9 @@ 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 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 6ccbdd57a..eafb5befa 100644
--- a/pcbnew/plot_board_layers.cpp
+++ b/pcbnew/plot_board_layers.cpp
@@ -214,7 +214,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer,
case F_SilkS:
case B_SilkS:
- if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
+ if ( plotOpt.GetPlotOutlineMode() )
PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
else
PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
@@ -255,7 +255,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer,
plotOpt.SetSkipPlotNPTH_Pads( false );
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
- if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
+ if ( plotOpt.GetPlotOutlineMode() )
PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
else
PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
@@ -265,7 +265,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer,
plotOpt.SetSkipPlotNPTH_Pads( false );
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
- if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
+ if ( plotOpt.GetPlotOutlineMode() )
PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
else
PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
--
2.11.0