kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #21611
[feature] Add eeschema plot option: plot fields of values of components
Hi.
For Russian documentation of constructor need to plot(to print to paper)
schemes without fields of values of components in accordance with GOST
(Russian standard) requirements of decoration. Values contain in another
document BOM.
I have add option for plotting that select visibility of plotting these
fields (except power symbols).
I am wanting request to add this feature.
Thanks
diff --git a/common/class_plotter.cpp b/common/class_plotter.cpp
index 3150d2c..02ee075 100644
--- a/common/class_plotter.cpp
+++ b/common/class_plotter.cpp
@@ -65,6 +65,7 @@ PLOTTER::PLOTTER( )
iuPerDeviceUnit = 1; // will be set later to the actual value
m_dashMarkLength_mm = 0.5; // Dashed line parameter in mm: segment
m_dashGapLength_mm = 0.25; // Dashed line parameter in mm: gap
+ m_plotFieldValue = true;
}
PLOTTER::~PLOTTER()
diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp
index dc40e56..9fe7f90 100644
--- a/eeschema/dialogs/dialog_plot_schematic.cpp
+++ b/eeschema/dialogs/dialog_plot_schematic.cpp
@@ -308,25 +308,25 @@ void DIALOG_PLOT_SCHEMATIC::PlotSchematic( bool aPlotAll )
switch( GetPlotFileFormat() )
{
case PLOT_FORMAT_HPGL:
- createHPGLFile( aPlotAll, getPlotFrameRef() );
+ createHPGLFile( aPlotAll, getPlotFrameRef(), getPlotFieldValue() );
break;
case PLOT_FORMAT_DXF:
- CreateDXFFile( aPlotAll, getPlotFrameRef() );
+ CreateDXFFile( aPlotAll, getPlotFrameRef(), getPlotFieldValue() );
break;
case PLOT_FORMAT_PDF:
- createPDFFile( aPlotAll, getPlotFrameRef() );
+ createPDFFile( aPlotAll, getPlotFrameRef(), getPlotFieldValue() );
break;
case PLOT_FORMAT_SVG:
- createSVGFile( aPlotAll, getPlotFrameRef() );
+ createSVGFile( aPlotAll, getPlotFrameRef(), getPlotFieldValue() );
break;
case PLOT_FORMAT_POST:
// Fall through. Default to Postscript.
default:
- createPSFile( aPlotAll, getPlotFrameRef() );
+ createPSFile( aPlotAll, getPlotFrameRef(), getPlotFieldValue() );
break;
}
diff --git a/eeschema/dialogs/dialog_plot_schematic.h b/eeschema/dialogs/dialog_plot_schematic.h
index 69cf6c0..ccced9d 100644
--- a/eeschema/dialogs/dialog_plot_schematic.h
+++ b/eeschema/dialogs/dialog_plot_schematic.h
@@ -89,10 +89,12 @@ private:
bool getPlotFrameRef() { return m_PlotFrameRefOpt->GetValue(); }
void setPlotFrameRef( bool aPlot) {m_PlotFrameRefOpt->SetValue( aPlot ); }
+ bool getPlotFieldValue() { return m_PlotFieldValueOpt->GetValue(); }
+
void PlotSchematic( bool aPlotAll );
// PDF
- void createPDFFile( bool aPlotAll, bool aPlotFrameRef );
+ void createPDFFile( bool aPlotAll, bool aPlotFrameRef, bool aPlotFieldValue );
void plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen, bool aPlotFrameRef);
void setupPlotPagePDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen );
@@ -104,9 +106,11 @@ private:
void restoreEnvironment( PDF_PLOTTER* aPlotter, SCH_SHEET_PATH& aOldsheetpath );
// DXF
- void CreateDXFFile( bool aPlotAll, bool aPlotFrameRef );
+ void CreateDXFFile( bool aPlotAll, bool aPlotFrameRef,
+ bool aPlotFieldValue );
bool PlotOneSheetDXF( const wxString& aFileName, SCH_SCREEN* aScreen,
- wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef );
+ wxPoint aPlot0ffset, double aScale,
+ bool aPlotFrameRef, bool aPlotFieldValue );
// HPGL
bool GetPlotOriginCenter()
@@ -119,20 +123,25 @@ private:
m_plotOriginOpt->SetSelection( aCenter ? 1 : 0 );
}
- void createHPGLFile( bool aPlotAll, bool aPlotFrameRef );
+ void createHPGLFile( bool aPlotAll, bool aPlotFrameRef,
+ bool aPlotFieldValue );
void SetHPGLPenWidth();
bool Plot_1_Page_HPGL( const wxString& aFileName, SCH_SCREEN* aScreen,
const PAGE_INFO& aPageInfo,
- wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef );
+ wxPoint aPlot0ffset, double aScale,
+ bool aPlotFrameRef, bool aPlotFieldValue );
// PS
- void createPSFile( bool aPlotAll, bool aPlotFrameRef );
+ void createPSFile( bool aPlotAll, bool aPlotFrameRef,
+ bool aPlotFieldValue );
bool plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen,
const PAGE_INFO& aPageInfo,
- wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef );
+ wxPoint aPlot0ffset, double aScale,
+ bool aPlotFrameRef, bool aPlotFieldValue );
// SVG
- void createSVGFile( bool aPlotAll, bool aPlotFrameRef );
+ void createSVGFile( bool aPlotAll, bool aPlotFrameRef,
+ bool aPlotFieldValue );
/**
* Create a file name with an absolute path name
@@ -153,5 +162,6 @@ public:
// outside a dialog. This is the reason we need aFrame as parameter
static bool plotOneSheetSVG( EDA_DRAW_FRAME* aFrame, const wxString& aFileName,
SCH_SCREEN* aScreen,
- bool aPlotBlackAndWhite, bool aPlotFrameRef );
+ bool aPlotBlackAndWhite, bool aPlotFrameRef,
+ bool aPlotFieldValue);
};
diff --git a/eeschema/dialogs/dialog_plot_schematic_base.cpp b/eeschema/dialogs/dialog_plot_schematic_base.cpp
index ca6467d..875e48e 100644
--- a/eeschema/dialogs/dialog_plot_schematic_base.cpp
+++ b/eeschema/dialogs/dialog_plot_schematic_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Jun 6 2014)
+// C++ code generated with wxFormBuilder (version Nov 29 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -29,7 +29,6 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
bSizer5 = 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 schematic main file location.") );
bSizer5->Add( m_outputDirectoryName, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 );
@@ -49,34 +48,33 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
wxString m_PaperSizeOptionChoices[] = { _("Schematic size"), _("Force size A4"), _("Force size A") };
int m_PaperSizeOptionNChoices = sizeof( m_PaperSizeOptionChoices ) / sizeof( wxString );
- m_PaperSizeOption = new wxRadioBox( this, wxID_ANY, _("Page Size:"), wxDefaultPosition, wxDefaultSize, m_PaperSizeOptionNChoices, m_PaperSizeOptionChoices, 1, wxRA_SPECIFY_COLS );
+ m_PaperSizeOption = new wxRadioBox( m_paperOptionsSizer->GetStaticBox(), wxID_ANY, _("Page Size:"), wxDefaultPosition, wxDefaultSize, m_PaperSizeOptionNChoices, m_PaperSizeOptionChoices, 1, wxRA_SPECIFY_COLS );
m_PaperSizeOption->SetSelection( 1 );
m_paperOptionsSizer->Add( m_PaperSizeOption, 0, wxALL|wxEXPAND, 5 );
- m_paperHPGLSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options") ), wxVERTICAL );
+ m_paperHPGLSizer = new wxStaticBoxSizer( new wxStaticBox( m_paperOptionsSizer->GetStaticBox(), wxID_ANY, _("HPGL Options") ), wxVERTICAL );
- m_staticText4 = new wxStaticText( this, wxID_ANY, _("Page Size:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText4 = new wxStaticText( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, _("Page Size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
m_paperHPGLSizer->Add( m_staticText4, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxString m_HPGLPaperSizeOptionChoices[] = { _("Schematic size"), _("Page size A4"), _("Page size A3"), _("Page size A2"), _("Page size A1"), _("Page size A0"), _("Page size A"), _("Page size B"), _("Page size C"), _("Page size D"), _("Page size E") };
int m_HPGLPaperSizeOptionNChoices = sizeof( m_HPGLPaperSizeOptionChoices ) / sizeof( wxString );
- m_HPGLPaperSizeOption = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_HPGLPaperSizeOptionNChoices, m_HPGLPaperSizeOptionChoices, 0 );
+ m_HPGLPaperSizeOption = new wxChoice( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_HPGLPaperSizeOptionNChoices, m_HPGLPaperSizeOptionChoices, 0 );
m_HPGLPaperSizeOption->SetSelection( 0 );
m_paperHPGLSizer->Add( m_HPGLPaperSizeOption, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxString m_plotOriginOptChoices[] = { _("Bottom left corner"), _("Center of the page") };
int m_plotOriginOptNChoices = sizeof( m_plotOriginOptChoices ) / sizeof( wxString );
- m_plotOriginOpt = new wxRadioBox( this, wxID_ANY, _("Origin"), wxDefaultPosition, wxDefaultSize, m_plotOriginOptNChoices, m_plotOriginOptChoices, 1, wxRA_SPECIFY_COLS );
+ m_plotOriginOpt = new wxRadioBox( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, _("Origin"), wxDefaultPosition, wxDefaultSize, m_plotOriginOptNChoices, m_plotOriginOptChoices, 1, wxRA_SPECIFY_COLS );
m_plotOriginOpt->SetSelection( 0 );
m_paperHPGLSizer->Add( m_plotOriginOpt, 0, wxALL, 5 );
- m_penHPLGWidthTitle = new wxStaticText( this, wxID_ANY, _("Pen width"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_penHPLGWidthTitle = new wxStaticText( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, _("Pen width"), wxDefaultPosition, wxDefaultSize, 0 );
m_penHPLGWidthTitle->Wrap( -1 );
m_paperHPGLSizer->Add( m_penHPLGWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
- m_penHPGLWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- m_penHPGLWidthCtrl->SetMaxLength( 0 );
+ m_penHPGLWidthCtrl = new wxTextCtrl( m_paperHPGLSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_paperHPGLSizer->Add( m_penHPGLWidthCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
@@ -94,30 +92,35 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
wxStaticBoxSizer* sbSizerPlotFormat;
sbSizerPlotFormat = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("General Options") ), wxVERTICAL );
- m_defaultLineWidthTitle = new wxStaticText( this, wxID_ANY, _("Default line thickness"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_defaultLineWidthTitle = new wxStaticText( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, _("Default line thickness"), wxDefaultPosition, wxDefaultSize, 0 );
m_defaultLineWidthTitle->Wrap( -1 );
sbSizerPlotFormat->Add( m_defaultLineWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
- m_DefaultLineSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- m_DefaultLineSizeCtrl->SetMaxLength( 0 );
+ m_DefaultLineSizeCtrl = new wxTextCtrl( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_DefaultLineSizeCtrl->SetToolTip( _("Selection of the default pen thickness used to draw items, when their thickness is set to 0.") );
sbSizerPlotFormat->Add( m_DefaultLineSizeCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") };
int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString );
- m_ModeColorOption = new wxRadioBox( this, wxID_ANY, _("Mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS );
+ m_ModeColorOption = new wxRadioBox( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, _("Mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS );
m_ModeColorOption->SetSelection( 1 );
m_ModeColorOption->SetToolTip( _("Choose if you want to draw the sheet like it appears on screen,\nor in black and white mode, better to print it when using black and white printers") );
sbSizerPlotFormat->Add( m_ModeColorOption, 0, wxALL|wxEXPAND, 5 );
- m_PlotFrameRefOpt = new wxCheckBox( this, wxID_ANY, _("Plot border and title block"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_PlotFrameRefOpt = new wxCheckBox( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, _("Plot border and title block"), wxDefaultPosition, wxDefaultSize, 0 );
m_PlotFrameRefOpt->SetValue(true);
m_PlotFrameRefOpt->SetToolTip( _("Print (or not) the Frame references.") );
sbSizerPlotFormat->Add( m_PlotFrameRefOpt, 0, wxALL, 5 );
+ m_PlotFieldValueOpt = new wxCheckBox( sbSizerPlotFormat->GetStaticBox(), wxID_ANY, _("Plot fields of values of components"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_PlotFieldValueOpt->SetValue(true);
+ m_PlotFieldValueOpt->SetToolTip( _("Print (or not) fields of values of components") );
+
+ sbSizerPlotFormat->Add( m_PlotFieldValueOpt, 0, wxALL, 5 );
+
m_optionsSizer->Add( sbSizerPlotFormat, 0, wxEXPAND|wxLEFT, 5 );
diff --git a/eeschema/dialogs/dialog_plot_schematic_base.fbp b/eeschema/dialogs/dialog_plot_schematic_base.fbp
index 0018cb2..bea9c17 100644
--- a/eeschema/dialogs/dialog_plot_schematic_base.fbp
+++ b/eeschema/dialogs/dialog_plot_schematic_base.fbp
@@ -396,6 +396,7 @@
<property name="minimum_size"></property>
<property name="name">m_paperOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
+ <property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
@@ -498,6 +499,7 @@
<property name="minimum_size"></property>
<property name="name">m_paperHPGLSizer</property>
<property name="orient">wxVERTICAL</property>
+ <property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
@@ -1039,6 +1041,7 @@
<property name="minimum_size"></property>
<property name="name">sbSizerPlotFormat</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">
@@ -1393,6 +1396,94 @@
<event name="OnUpdateUI"></event>
</object>
</object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxALL</property>
+ <property name="proportion">0</property>
+ <object class="wxCheckBox" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_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 fields of values of components</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_PlotFieldValueOpt</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">Print (or not) fields of values of components</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">
diff --git a/eeschema/dialogs/dialog_plot_schematic_base.h b/eeschema/dialogs/dialog_plot_schematic_base.h
index b983cca..316f7b5 100644
--- a/eeschema/dialogs/dialog_plot_schematic_base.h
+++ b/eeschema/dialogs/dialog_plot_schematic_base.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Jun 6 2014)
+// C++ code generated with wxFormBuilder (version Nov 29 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -64,6 +64,7 @@ class DIALOG_PLOT_SCHEMATIC_BASE : public DIALOG_SHIM
wxTextCtrl* m_DefaultLineSizeCtrl;
wxRadioBox* m_ModeColorOption;
wxCheckBox* m_PlotFrameRefOpt;
+ wxCheckBox* m_PlotFieldValueOpt;
wxBoxSizer* m_ButtonsSizer;
wxButton* m_buttonPlotCurrent;
wxButton* m_buttonPlotAll;
diff --git a/eeschema/plot_schematic_DXF.cpp b/eeschema/plot_schematic_DXF.cpp
index a571c73..8dd114f 100644
--- a/eeschema/plot_schematic_DXF.cpp
+++ b/eeschema/plot_schematic_DXF.cpp
@@ -36,7 +36,8 @@
#include <wx_html_report_panel.h>
-void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
+void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef,
+ bool aPlotFieldValue )
{
SCH_EDIT_FRAME* schframe = m_parent;
SCH_SCREEN* screen = schframe->GetScreen();
@@ -89,7 +90,8 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
wxFileName plotFileName = createPlotFileName( m_outputDirectoryName, fname,
ext, &reporter );
- if( PlotOneSheetDXF( plotFileName.GetFullPath(), screen, plot_offset, 1.0, aPlotFrameRef ) )
+ if( PlotOneSheetDXF( plotFileName.GetFullPath(), screen, plot_offset,
+ 1.0, aPlotFrameRef, aPlotFieldValue ) )
{
msg.Printf( _( "Plot: '%s' OK.\n" ), GetChars( plotFileName.GetFullPath() ) );
reporter.Report( msg, REPORTER::RPT_ACTION );
@@ -125,7 +127,8 @@ bool DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF( const wxString& aFileName,
SCH_SCREEN* aScreen,
wxPoint aPlotOffset,
double aScale,
- bool aPlotFrameRef )
+ bool aPlotFrameRef,
+ bool aPlotFieldValue )
{
DXF_PLOTTER* plotter = new DXF_PLOTTER();
@@ -133,6 +136,7 @@ bool DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF( const wxString& aFileName,
plotter->SetPageSettings( pageInfo );
plotter->SetColorMode( getModeColor() );
plotter->SetViewport( aPlotOffset, IU_PER_DECIMILS, aScale, false );
+ plotter->SetPlotFieldValue(aPlotFieldValue);
// Init :
plotter->SetCreator( wxT( "Eeschema-DXF" ) );
diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp
index 9b64ab0..6879d9d 100644
--- a/eeschema/plot_schematic_HPGL.cpp
+++ b/eeschema/plot_schematic_HPGL.cpp
@@ -108,7 +108,8 @@ void DIALOG_PLOT_SCHEMATIC::SetHPGLPenWidth()
}
-void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
+void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef,
+ bool aPlotFieldValue )
{
SCH_SCREEN* screen = m_parent->GetScreen();
SCH_SHEET_PATH* sheetpath;
@@ -185,7 +186,7 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
LOCALE_IO toggle;
if( Plot_1_Page_HPGL( plotFileName.GetFullPath(), screen, plotPage, plotOffset,
- plot_scale, aPlotFrameRef ) )
+ plot_scale, aPlotFrameRef, aPlotFieldValue ) )
{
msg.Printf( _( "Plot: '%s' OK.\n" ), GetChars( plotFileName.GetFullPath() ) );
reporter.Report( msg, REPORTER::RPT_ACTION );
@@ -218,12 +219,14 @@ bool DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL( const wxString& aFileName,
const PAGE_INFO& aPageInfo,
wxPoint aPlot0ffset,
double aScale,
- bool aPlotFrameRef )
+ bool aPlotFrameRef,
+ bool aPlotFieldValue )
{
HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
plotter->SetPageSettings( aPageInfo );
plotter->SetViewport( aPlot0ffset, IU_PER_DECIMILS, aScale, false );
+ plotter->SetPlotFieldValue( aPlotFieldValue );
// Init :
plotter->SetCreator( wxT( "Eeschema-HPGL" ) );
diff --git a/eeschema/plot_schematic_PDF.cpp b/eeschema/plot_schematic_PDF.cpp
index 900e1fb..29970b4 100644
--- a/eeschema/plot_schematic_PDF.cpp
+++ b/eeschema/plot_schematic_PDF.cpp
@@ -38,7 +38,8 @@
#include <dialog_plot_schematic.h>
#include <wx_html_report_panel.h>
-void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
+void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef,
+ bool aPlotFieldValue )
{
SCH_SCREEN* screen = m_parent->GetScreen();
SCH_SHEET_PATH* sheetpath;
@@ -59,6 +60,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
PDF_PLOTTER* plotter = new PDF_PLOTTER();
plotter->SetDefaultLineWidth( GetDefaultLineThickness() );
plotter->SetColorMode( getModeColor() );
+ plotter->SetPlotFieldValue( aPlotFieldValue );
plotter->SetCreator( wxT( "Eeschema-PDF" ) );
wxString msg;
diff --git a/eeschema/plot_schematic_PS.cpp b/eeschema/plot_schematic_PS.cpp
index 0c42e53..a2e4e6f 100644
--- a/eeschema/plot_schematic_PS.cpp
+++ b/eeschema/plot_schematic_PS.cpp
@@ -36,7 +36,8 @@
#include <dialog_plot_schematic.h>
#include <wx_html_report_panel.h>
-void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
+void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef,
+ bool aPlotFieldValue )
{
SCH_SCREEN* screen = m_parent->GetScreen();
SCH_SHEET_PATH* sheetpath;
@@ -117,7 +118,7 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
fname, ext, &reporter );
if( plotOneSheetPS( plotFileName.GetFullPath(), screen, plotPage, plot_offset,
- scale, aPlotFrameRef ) )
+ scale, aPlotFrameRef, aPlotFieldValue ) )
{
msg.Printf( _( "Plot: '%s' OK.\n" ), GetChars( plotFileName.GetFullPath() ) );
reporter.Report( msg, REPORTER::RPT_ACTION );
@@ -151,13 +152,15 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetPS( const wxString& aFileName,
const PAGE_INFO& aPageInfo,
wxPoint aPlot0ffset,
double aScale,
- bool aPlotFrameRef )
+ bool aPlotFrameRef,
+ bool aPlotFieldValue )
{
PS_PLOTTER* plotter = new PS_PLOTTER();
plotter->SetPageSettings( aPageInfo );
plotter->SetDefaultLineWidth( GetDefaultLineThickness() );
plotter->SetColorMode( getModeColor() );
plotter->SetViewport( aPlot0ffset, IU_PER_DECIMILS, aScale, false );
+ plotter->SetPlotFieldValue(aPlotFieldValue);
// Init :
plotter->SetCreator( wxT( "Eeschema-PS" ) );
diff --git a/eeschema/plot_schematic_SVG.cpp b/eeschema/plot_schematic_SVG.cpp
index 0cc81ed..0b50521 100644
--- a/eeschema/plot_schematic_SVG.cpp
+++ b/eeschema/plot_schematic_SVG.cpp
@@ -41,7 +41,8 @@
#include <dialog_plot_schematic.h>
#include <wx_html_report_panel.h>
-void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
+void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef,
+ bool aPlotFieldValue )
{
wxString msg;
REPORTER& reporter = m_MessagesBox->Reporter();
@@ -87,7 +88,7 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
bool success = plotOneSheetSVG( m_parent, plotFileName.GetFullPath(), screen,
getModeColor() ? false : true,
- aPrintFrameRef );
+ aPrintFrameRef, aPlotFieldValue );
if( !success )
{
@@ -131,7 +132,7 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
bool success = plotOneSheetSVG( m_parent, fn.GetFullPath(), screen,
getModeColor() ? false : true,
- aPrintFrameRef );
+ aPrintFrameRef, aPlotFieldValue );
if( success )
{
msg.Printf( _( "Plot: '%s' OK.\n" ),
@@ -161,7 +162,8 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG( EDA_DRAW_FRAME* aFrame,
const wxString& aFileName,
SCH_SCREEN* aScreen,
bool aPlotBlackAndWhite,
- bool aPlotFrameRef )
+ bool aPlotFrameRef,
+ bool aPlotFieldValue )
{
SVG_PLOTTER* plotter = new SVG_PLOTTER();
@@ -172,6 +174,7 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG( EDA_DRAW_FRAME* aFrame,
wxPoint plot_offset;
double scale = 1.0;
plotter->SetViewport( plot_offset, IU_PER_DECIMILS, scale, false );
+ plotter->SetPlotFieldValue(aPlotFieldValue);
// Init :
plotter->SetCreator( wxT( "Eeschema-SVG" ) );
diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp
index 82694d8..f78458c 100644
--- a/eeschema/sch_component.cpp
+++ b/eeschema/sch_component.cpp
@@ -2042,6 +2042,11 @@ void SCH_COMPONENT::Plot( PLOTTER* aPlotter )
for( size_t i = 0; i < m_Fields.size(); i++ )
{
+ if( !part->IsPower() &&
+ !aPlotter->IsPlotFieldValue() &&
+ m_Fields[i].GetId() == VALUE )
+ continue;
+
m_Fields[i].Plot( aPlotter );
}
}
diff --git a/include/plot_common.h b/include/plot_common.h
index 334b955..ca2b544 100644
--- a/include/plot_common.h
+++ b/include/plot_common.h
@@ -83,8 +83,9 @@ enum PlotTextMode {
class PLOTTER
{
private:
- double m_dashMarkLength_mm ; ///< Dashed line parameter in mm: segment
+ double m_dashMarkLength_mm; ///< Dashed line parameter in mm: segment
double m_dashGapLength_mm; ///< Dashed line parameter in mm: gap
+ bool m_plotFieldValue; ///< Enable plot fields of values of components
public:
static const int USE_DEFAULT_LINE_WIDTH = -1;
@@ -147,6 +148,16 @@ public:
creator = aCreator;
}
+ void SetPlotFieldValue( bool plotted )
+ {
+ m_plotFieldValue = plotted;
+ }
+
+ bool IsPlotFieldValue() const
+ {
+ return m_plotFieldValue;
+ }
+
/**
* Function AddLineToHeader
* Add a line to the list of free lines to print at the beginning of the file
Follow ups