KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_plot_schematic.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 1992-2018 Jean-Pierre Charras jp.charras at wanadoo.fr
5 * Copyright (C) 1992-2010 Lorenzo Marcantonio
6 * Copyright (C) 2011 Wayne Stambaugh <[email protected]>
7 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#include <bitmaps.h>
28#include <common.h> // For ExpandEnvVarSubstitutions
29#include "string_utils.h"
33#include <eeschema_settings.h>
34#include <kiface_base.h>
35#include <locale_io.h>
38#include <reporter.h>
39#include <trace_helpers.h>
41#include <wx_filename.h>
42#include <pgm_base.h>
43#include <sch_edit_frame.h>
44#include <sch_painter.h>
45
46#include <wx/dirdlg.h>
47#include <wx/msgdlg.h>
49#include <wx/log.h>
50
52
53
54// static members (static to remember last state):
57
58
60 DIALOG_PLOT_SCHEMATIC( aEditFrame, aEditFrame )
61{
62}
63
64
66 JOB_EXPORT_SCH_PLOT* aJob ) :
67 DIALOG_PLOT_SCHEMATIC_BASE( aEditFrame ),
68 m_editFrame( aEditFrame ),
69 m_plotFormat( PLOT_FORMAT::UNDEFINED ),
70 m_HPGLPenSize( 1.0 ),
71 m_defaultLineWidth( aEditFrame, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ),
72 m_penWidth( aEditFrame, m_penWidthLabel, m_penWidthCtrl, m_penWidthUnits ), m_job( aJob )
73{
74 m_configChanged = false;
75
76 if( !m_job )
77 {
78 m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
79 m_MessagesBox->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
80 SetupStandardButtons( { { wxID_OK, _( "Plot All Pages" ) },
81 { wxID_APPLY, _( "Plot Current Page" ) },
82 { wxID_CANCEL, _( "Close" ) } } );
83 }
84 else
85 {
86 SetTitle( m_job->GetSettingsDialogTitle() );
87
88 m_outputPathLabel->SetLabel( _( "Output file:" ) );
89
90 m_browseButton->Hide();
91 m_MessagesBox->Hide();
92
93 m_sdbSizer1Apply->Hide();
94 m_openFileAfterPlot->Hide();
95
97 }
98
99 // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
100 // non-job versions (which have different sizes).
101 m_hash_key = TO_UTF8( GetTitle() );
102
103 initDlg();
104
105 // Now all widgets have the size fixed, call FinishDialogSettings
107}
108
109
111{
112 auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
113 wxASSERT( cfg );
114
115 if( !m_job )
116 {
117 if( cfg )
118 {
119 for( COLOR_SETTINGS* settings : Pgm().GetSettingsManager().GetColorSettingsList() )
120 {
121 int idx = m_colorTheme->Append( settings->GetName(),
122 static_cast<void*>( settings ) );
123
124 if( settings->GetFilename() == cfg->m_PlotPanel.color_theme )
125 m_colorTheme->SetSelection( idx );
126 }
127
128 m_colorTheme->Enable( cfg->m_PlotPanel.color );
129
130 m_plotBackgroundColor->Enable( cfg->m_PlotPanel.color );
131 m_plotBackgroundColor->SetValue( cfg->m_PlotPanel.background_color );
132
133 // Set color or B&W plot option
134 setModeColor( cfg->m_PlotPanel.color );
135
136 // Set plot or not frame reference option
137 setPlotDrawingSheet( cfg->m_PlotPanel.frame_reference );
138
139 setOpenFileAfterPlot( cfg->m_PlotPanel.open_file_after_plot );
140
141 m_plotPDFPropertyPopups->SetValue( cfg->m_PlotPanel.pdf_property_popups );
142 m_plotPDFHierarchicalLinks->SetValue( cfg->m_PlotPanel.pdf_hierarchical_links );
143 m_plotPDFMetadata->SetValue( cfg->m_PlotPanel.pdf_metadata );
144
145 // HPGL plot origin and unit system configuration
146 m_plotOriginOpt->SetSelection( cfg->m_PlotPanel.hpgl_origin );
147
148 m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( cfg->m_PlotPanel.hpgl_paper_size );
149
150 // HPGL Pen Size is stored in mm in config
151 m_HPGLPenSize = cfg->m_PlotPanel.hpgl_pen_size * schIUScale.IU_PER_MM;
152
153 // Switch to the last save plot format
154 PLOT_FORMAT fmt = static_cast<PLOT_FORMAT>( cfg->m_PlotPanel.format );
155
156 switch( fmt )
157 {
158 default:
159 case PLOT_FORMAT::POST: m_plotFormatOpt->SetSelection( 0 ); break;
160 case PLOT_FORMAT::PDF: m_plotFormatOpt->SetSelection( 1 ); break;
161 case PLOT_FORMAT::SVG: m_plotFormatOpt->SetSelection( 2 ); break;
162 case PLOT_FORMAT::DXF: m_plotFormatOpt->SetSelection( 3 ); break;
163 case PLOT_FORMAT::HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
164 }
165
166 if( fmt == PLOT_FORMAT::DXF || fmt == PLOT_FORMAT::HPGL )
167 m_plotBackgroundColor->Disable();
168
169 // Set the default line width (pen width which should be used for
170 // items that do not have a pen size defined (like frame ref)
171 // the default line width is stored in mils in config
173 schIUScale.MilsToIU( cfg->m_Drawing.default_line_thickness ) );
174 }
175
176 // Initialize HPGL specific widgets
178
179 // Plot directory
181 wxString path = settings.m_PlotDirectoryName;
182#ifdef __WINDOWS__
183 path.Replace( '/', '\\' );
184#endif
185 m_outputPath->SetValue( path );
186 }
187 else if( m_job )
188 {
190 {
191 int idx = m_colorTheme->Append( settings->GetName(), static_cast<void*>( settings ) );
192
193 if( settings->GetName() == m_job->m_theme )
194 m_colorTheme->SetSelection( idx );
195 }
196
197 if( m_colorTheme->GetSelection() == wxNOT_FOUND )
198 m_colorTheme->SetSelection( 0 );
199
206 m_colorTheme->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
207 m_ModeColorOption->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
208 m_plotOriginOpt->SetSelection( static_cast<int>( m_job->m_HPGLPlotOrigin ) );
209 m_pageSizeSelect = static_cast<int>( m_job->m_pageSizeSelect );
212
213 // Set the plot format
214 switch( m_job->m_plotFormat )
215 {
216 default:
217 case SCH_PLOT_FORMAT::POST: m_plotFormatOpt->SetSelection( 0 ); break;
218 case SCH_PLOT_FORMAT::PDF: m_plotFormatOpt->SetSelection( 1 ); break;
219 case SCH_PLOT_FORMAT::SVG: m_plotFormatOpt->SetSelection( 2 ); break;
220 case SCH_PLOT_FORMAT::DXF: m_plotFormatOpt->SetSelection( 3 ); break;
221 case SCH_PLOT_FORMAT::HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
222 }
223
224 // And then hide it
225 m_plotFormatOpt->Hide();
226
228 }
229}
230
231
237{
238 // Build the absolute path of current output directory to preselect it in the file browser.
239 wxString path = ExpandEnvVarSubstitutions( m_outputPath->GetValue(), &Prj() );
240
241 // When editing a schematic that is not part of a project in the stand alone mode, the
242 // project path is not defined so point to the users document path to save the plot files.
243 if( Prj().IsNullProject() )
244 {
246 }
247 else
248 {
249 // Build the absolute path of current output directory to preselect it in the file browser.
250 path = ExpandEnvVarSubstitutions( m_outputPath->GetValue(), &Prj() );
251 path = Prj().AbsolutePath( path );
252 }
253
254 wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
255
256 if( dirDialog.ShowModal() == wxID_CANCEL )
257 return;
258
259 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
260
261 wxFileName fn( Prj().AbsolutePath( m_editFrame->Schematic().Root().GetFileName() ) );
262 wxString defaultPath = fn.GetPathWithSep();
263 wxString msg;
264 wxFileName relPathTest; // Used to test if we can make the path relative
265
266 relPathTest.Assign( dirDialog.GetPath() );
267
268 // Test if making the path relative is possible before asking the user if they want to do it
269 if( relPathTest.MakeRelativeTo( defaultPath ) )
270 {
271 msg.Printf( _( "Do you want to use a path relative to\n'%s'?" ), defaultPath );
272
273 wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
274 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
275
276 if( dialog.ShowModal() == wxID_YES )
277 dirName.MakeRelativeTo( defaultPath );
278 }
279
280 m_outputPath->SetValue( dirName.GetFullPath() );
281}
282
283
285{
286 switch( m_plotFormatOpt->GetSelection() )
287 {
288 default:
289 case 0: return PLOT_FORMAT::POST;
290 case 1: return PLOT_FORMAT::PDF;
291 case 2: return PLOT_FORMAT::SVG;
292 case 3: return PLOT_FORMAT::DXF;
293 case 4: return PLOT_FORMAT::HPGL;
294 }
295}
296
297
298void DIALOG_PLOT_SCHEMATIC::OnPageSizeSelected( wxCommandEvent& event )
299{
300 if( GetPlotFileFormat() == PLOT_FORMAT::HPGL )
301 m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( m_paperSizeOption->GetSelection() );
302 else
303 m_pageSizeSelect = m_paperSizeOption->GetSelection();
304}
305
306
307void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event )
308{
310
311 if( fmt != m_plotFormat )
312 {
313 m_plotFormat = fmt;
314
315 wxArrayString paperSizes;
316 paperSizes.push_back( _( "Schematic size" ) );
317
318 int selection;
319
320 if( fmt == PLOT_FORMAT::HPGL )
321 {
322 paperSizes.push_back( _( "A5" ) );
323 paperSizes.push_back( _( "A4" ) );
324 paperSizes.push_back( _( "A3" ) );
325 paperSizes.push_back( _( "A2" ) );
326 paperSizes.push_back( _( "A1" ) );
327 paperSizes.push_back( _( "A0" ) );
328 paperSizes.push_back( _( "A" ) );
329 paperSizes.push_back( _( "B" ) );
330 paperSizes.push_back( _( "C" ) );
331 paperSizes.push_back( _( "D" ) );
332 paperSizes.push_back( _( "E" ) );
333
334 selection = static_cast<int>( m_HPGLPaperSizeSelect );
335 }
336 else
337 {
338 paperSizes.push_back( _( "A4" ) );
339 paperSizes.push_back( _( "A" ) );
340
341 selection = m_pageSizeSelect;
342 }
343
344 m_openFileAfterPlot->Enable( fmt == PLOT_FORMAT::PDF );
345 m_plotPDFPropertyPopups->Enable( fmt == PLOT_FORMAT::PDF );
346 m_plotPDFHierarchicalLinks->Enable( fmt == PLOT_FORMAT::PDF );
347 m_plotPDFMetadata->Enable( fmt == PLOT_FORMAT::PDF );
348
349 m_paperSizeOption->Set( paperSizes );
350 m_paperSizeOption->SetSelection( selection );
351
353 fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
354
355 m_plotOriginTitle->Enable( fmt == PLOT_FORMAT::HPGL );
356 m_plotOriginOpt->Enable( fmt == PLOT_FORMAT::HPGL );
357 m_penWidth.Enable( fmt == PLOT_FORMAT::HPGL );
358
359 m_plotBackgroundColor->Enable(
360 fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
361
362 m_colorTheme->Enable( fmt != PLOT_FORMAT::HPGL );
363 m_ModeColorOption->Enable( fmt != PLOT_FORMAT::HPGL );
364 }
365}
366
367
369{
371
372 EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
373 wxASSERT( cfg );
374
376
377 if( cfg )
378 {
381 cfg->m_PlotPanel.color_theme = colors->GetFilename();
383 cfg->m_PlotPanel.format = static_cast<int>( GetPlotFileFormat() );
384 cfg->m_PlotPanel.hpgl_origin = m_plotOriginOpt->GetSelection();
385 cfg->m_PlotPanel.hpgl_paper_size = static_cast<int>( m_HPGLPaperSizeSelect );
388 cfg->m_PlotPanel.pdf_metadata = m_plotPDFMetadata->GetValue();
390
391 // HPGL Pen Size is stored in mm in config
393
394 aSettings->SetDefaultFont( cfg->m_Appearance.default_font );
395 }
396
397 aSettings->LoadColors( colors );
398 aSettings->SetMinPenWidth( (int) m_defaultLineWidth.GetValue() );
399
400 if( m_plotBackgroundColor->GetValue() )
402 else
403 aSettings->SetBackgroundColor( COLOR4D::UNSPECIFIED );
404
405 // Plot directory
406 wxString path = m_outputPath->GetValue();
407 path.Replace( '\\', '/' );
408
410
411 if( settings.m_PlotDirectoryName != path )
412 m_configChanged = true;
413
414 settings.m_PlotDirectoryName = path;
415}
416
417
419{
420 int selection = m_colorTheme->GetSelection();
421
422 if( selection < 0 )
423 {
426 }
427
428 return static_cast<COLOR_SETTINGS*>( m_colorTheme->GetClientData( selection ) );
429}
430
431
432void DIALOG_PLOT_SCHEMATIC::OnPlotCurrent( wxCommandEvent& event )
433{
434 plotSchematic( false );
435}
436
437
438void DIALOG_PLOT_SCHEMATIC::OnPlotAll( wxCommandEvent& event )
439{
440 if( !m_job )
441 {
442 plotSchematic( true );
443 }
444 else
445 {
449
450 // m_job->m_HPGLPaperSizeSelect = m_HPGLPaperSizeSelect;
456 m_job->m_plotAll = true;
458
460 static_cast<JOB_HPGL_PLOT_ORIGIN_AND_UNITS>( m_plotOriginOpt->GetSelection() );
461
463 m_job->m_theme = colors->GetName();
464
465 event.Skip(); // Allow normal close action
466 }
467}
468
469
471{
472 wxBusyCursor dummy;
473
475 renderSettings.m_ShowHiddenPins = false;
476 renderSettings.m_ShowHiddenFields = false;
477
478 getPlotOptions( &renderSettings );
479
480 std::unique_ptr<SCH_PLOTTER> schPlotter = std::make_unique<SCH_PLOTTER>( m_editFrame );
481
483
484 SCH_PLOT_OPTS plotOpts;
486 plotOpts.m_plotAll = aPlotAll;
487 plotOpts.m_blackAndWhite = !getModeColor();
488 plotOpts.m_useBackgroundColor = m_plotBackgroundColor->GetValue();
489 plotOpts.m_theme = colors->GetFilename();
490 plotOpts.m_PDFPropertyPopups = m_plotPDFPropertyPopups->GetValue();
492 plotOpts.m_PDFMetadata = m_plotPDFMetadata->GetValue();
494 plotOpts.m_HPGLPlotOrigin =
495 static_cast<HPGL_PLOT_ORIGIN_AND_UNITS>( m_plotOriginOpt->GetSelection() );
496 plotOpts.m_HPGLPenSize = m_HPGLPenSize;
497 plotOpts.m_outputDirectory = getOutputPath();
499
500 schPlotter->Plot( GetPlotFileFormat(), plotOpts, &renderSettings, &m_MessagesBox->Reporter() );
501
502 if( GetPlotFileFormat() == PLOT_FORMAT::PDF && getOpenFileAfterPlot() )
503 wxLaunchDefaultApplication( schPlotter->GetLastOutputFilePath() );
504}
505
506
508{
509 wxString msg;
510 wxString extMsg;
511 wxFileName fn;
512
513 extMsg.Printf( _( "Falling back to user path '%s'." ), KIPLATFORM::ENV::GetDocumentsPath() );
514
515 // Build the absolute path of current output directory to preselect it in the file browser.
516 std::function<bool( wxString* )> textResolver =
517 [&]( wxString* token ) -> bool
518 {
519 SCHEMATIC& schematic = m_editFrame->Schematic();
520 return schematic.ResolveTextVar( &schematic.CurrentSheet(), token, 0 );
521 };
522
523 wxString path = m_outputPath->GetValue();
524 path = ExpandTextVars( path, &textResolver );
526
527 fn.SetPath( path );
528
529 // If the contents of the path edit control results in an absolute path, return it as is.
530 if( fn.IsAbsolute() )
531 return path;
532
533 // When editing a schematic that is not part of a project in the stand alone mode, the
534 // project path is not defined.
535 if( Prj().IsNullProject() )
536 {
538
539 if( screen && !screen->GetFileName().IsEmpty() )
540 {
541 fn = screen->GetFileName();
542 msg.Printf( _( "Cannot normalize path '%s%s'." ), fn.GetPathWithSep(), path );
543 fn.SetPath( fn.GetPathWithSep() + path );
544
545 // Normalize always returns true for a non-empty file name so clear the file name
546 // and extension so that only the path is normalized.
547 fn.SetName( wxEmptyString );
548 fn.SetExt( wxEmptyString );
549
550 if( fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) )
551 {
552 path = fn.GetPath();
553 }
554 else
555 {
556 wxMessageDialog dlg( this, msg, _( "Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
557 | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
558
559 dlg.SetExtendedMessage( extMsg );
560 dlg.ShowModal();
561
563 }
564 }
565 else
566 {
567 msg = _( "No project or path defined for the current schematic." );
568
569 wxMessageDialog dlg( this, msg, _( "Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
570 | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
571 dlg.SetExtendedMessage( extMsg );
572 dlg.ShowModal();
573
574 // Always fall back to user's document path if no other absolute path can be normalized.
576 }
577 }
578 else
579 {
580 msg.Printf( _( "Cannot normalize path '%s%s'." ), Prj().GetProjectPath(), path );
581
582 // Build the absolute path of current output directory and the project path.
583 fn.SetPath( Prj().GetProjectPath() + path );
584
585 if( fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) )
586 {
587 path = fn.GetPath();
588 }
589 else
590 {
591 wxMessageDialog dlg( this, msg, _( "Warning" ),
592 wxOK | wxCENTER | wxRESIZE_BORDER | wxICON_EXCLAMATION |
593 wxSTAY_ON_TOP );
594
595 dlg.SetExtendedMessage( extMsg );
596 dlg.ShowModal();
597
599 }
600 }
601
602 return path;
603}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:110
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Definition: bitmap.cpp:110
Color settings are a bit different than most of the settings objects in that there can be more than o...
static const wxString COLOR_BUILTIN_DEFAULT
COLOR4D GetColor(int aLayer) const
const wxString & GetName() const
Class DIALOG_PLOT_SCHEMATIC_BASE.
WX_HTML_REPORT_PANEL * m_MessagesBox
void OnPageSizeSelected(wxCommandEvent &event) override
void OnPlotAll(wxCommandEvent &event) override
static HPGL_PAGE_SIZE m_HPGLPaperSizeSelect
void setOpenFileAfterPlot(bool aOpen)
void OnPlotCurrent(wxCommandEvent &event) override
void setModeColor(bool aColor)
void setPlotDrawingSheet(bool aPlot)
JOB_EXPORT_SCH_PLOT * m_job
void getPlotOptions(RENDER_SETTINGS *aSettings)
COLOR_SETTINGS * getColorSettings()
void plotSchematic(bool aPlotAll)
void onOutputDirectoryBrowseClicked(wxCommandEvent &event) override
Set the m_outputDirectoryName variable to the selected directory from directory dialog.
void OnUpdateUI(wxUpdateUIEvent &event) override
DIALOG_PLOT_SCHEMATIC(SCH_EDIT_FRAME *aEditFrame)
wxString getOutputPath()
Determine the best absolute path to plot files given the contents of the path edit control.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
std::string m_hash_key
Definition: dialog_shim.h:230
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
SETTINGS_MANAGER * GetSettingsManager() const
JOB_PAGE_SIZE m_pageSizeSelect
SCH_PLOT_FORMAT m_plotFormat
JOB_HPGL_PLOT_ORIGIN_AND_UNITS m_HPGLPlotOrigin
JOB_HPGL_PAGE_SIZE m_HPGLPaperSizeSelect
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
Definition: job.cpp:153
virtual wxString GetSettingsDialogTitle() const
Definition: job.cpp:80
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
Definition: job.h:226
wxString GetFilename() const
Definition: json_settings.h:80
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:95
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
void SetDefaultFont(const wxString &aFont)
virtual void SetBackgroundColor(const COLOR4D &aColor)=0
Set the background color.
void SetMinPenWidth(int aWidth)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition: project.cpp:370
These are loaded from Eeschema settings but then overwritten by the project settings.
Holds all the data relating to one schematic.
Definition: schematic.h:82
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:161
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:312
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
Definition: schematic.cpp:208
bool ResolveTextVar(const SCH_SHEET_PATH *aSheetPath, wxString *token, int aDepth) const
Definition: schematic.cpp:253
SCH_SHEET & Root() const
Definition: schematic.h:130
SCH_RENDER_SETTINGS * GetRenderSettings()
Schematic editor (Eeschema) main window.
SCHEMATIC & Schematic() const
const wxString & GetFileName() const
Definition: sch_screen.h:143
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:305
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieve a color settings object that applications can read colors from.
std::vector< COLOR_SETTINGS * > GetColorSettingsList()
void SetBitmap(const wxBitmapBundle &aBmp)
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetFileName(const wxString &aReportFileName)
Set the report full file name to the string.
REPORTER & Reporter()
Return the reporter object that reports to this panel.
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:351
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
Definition: common.cpp:59
The common library.
#define _(s)
JOB_PAGE_SIZE
JOB_HPGL_PLOT_ORIGIN_AND_UNITS
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:440
wxString GetDocumentsPath()
Retrieves the operating system specific path for a user's documents.
SETTINGS_MANAGER * GetSettingsManager()
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
see class PGM_BASE
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:65
Plotting engines similar to ps (PostScript, Gerber, svg)
@ PAGE_SIZE_AUTO
Definition: sch_plotter.h:57
HPGL_PAGE_SIZE
Definition: sch_plotter.h:64
HPGL_PLOT_ORIGIN_AND_UNITS
Definition: sch_plotter.h:47
std::vector< FAB_LAYER_COLOR > dummy
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:398
const double IU_PER_MM
Definition: base_units.h:76
constexpr int MilsToIU(int mils) const
Definition: base_units.h:93
wxString m_theme
Definition: sch_plotter.h:94
bool m_PDFPropertyPopups
Definition: sch_plotter.h:91
wxString m_outputDirectory
Definition: sch_plotter.h:96
HPGL_PLOT_ORIGIN_AND_UNITS m_HPGLPlotOrigin
Definition: sch_plotter.h:99
int m_pageSizeSelect
Definition: sch_plotter.h:87
bool m_PDFMetadata
Definition: sch_plotter.h:93
bool m_blackAndWhite
Definition: sch_plotter.h:86
HPGL_PAGE_SIZE m_HPGLPaperSizeSelect
Definition: sch_plotter.h:90
double m_HPGLPenSize
Definition: sch_plotter.h:89
bool m_PDFHierarchicalLinks
Definition: sch_plotter.h:92
bool m_useBackgroundColor
Definition: sch_plotter.h:88
bool m_plotDrawingSheet
Definition: sch_plotter.h:83
wxLogTrace helper definitions.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().
Definition: wx_filename.h:39