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_browseButton->Hide();
89 m_MessagesBox->Hide();
90
91 m_sdbSizer1Apply->Hide();
92 m_openFileAfterPlot->Hide();
93
95 }
96
97 // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
98 // non-job versions (which have different sizes).
99 m_hash_key = TO_UTF8( GetTitle() );
100
101 initDlg();
102
103 // Now all widgets have the size fixed, call FinishDialogSettings
105}
106
107
109{
110 auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
111 wxASSERT( cfg );
112
113 if( !m_job )
114 {
115 if( cfg )
116 {
117 for( COLOR_SETTINGS* settings : Pgm().GetSettingsManager().GetColorSettingsList() )
118 {
119 int idx = m_colorTheme->Append( settings->GetName(),
120 static_cast<void*>( settings ) );
121
122 if( settings->GetFilename() == cfg->m_PlotPanel.color_theme )
123 m_colorTheme->SetSelection( idx );
124 }
125
126 m_colorTheme->Enable( cfg->m_PlotPanel.color );
127
128 m_plotBackgroundColor->Enable( cfg->m_PlotPanel.color );
129 m_plotBackgroundColor->SetValue( cfg->m_PlotPanel.background_color );
130
131 // Set color or B&W plot option
132 setModeColor( cfg->m_PlotPanel.color );
133
134 // Set plot or not frame reference option
135 setPlotDrawingSheet( cfg->m_PlotPanel.frame_reference );
136
137 setOpenFileAfterPlot( cfg->m_PlotPanel.open_file_after_plot );
138
139 m_plotPDFPropertyPopups->SetValue( cfg->m_PlotPanel.pdf_property_popups );
140 m_plotPDFHierarchicalLinks->SetValue( cfg->m_PlotPanel.pdf_hierarchical_links );
141 m_plotPDFMetadata->SetValue( cfg->m_PlotPanel.pdf_metadata );
142
143 // HPGL plot origin and unit system configuration
144 m_plotOriginOpt->SetSelection( cfg->m_PlotPanel.hpgl_origin );
145
146 m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( cfg->m_PlotPanel.hpgl_paper_size );
147
148 // HPGL Pen Size is stored in mm in config
149 m_HPGLPenSize = cfg->m_PlotPanel.hpgl_pen_size * schIUScale.IU_PER_MM;
150
151 // Switch to the last save plot format
152 PLOT_FORMAT fmt = static_cast<PLOT_FORMAT>( cfg->m_PlotPanel.format );
153
154 switch( fmt )
155 {
156 default:
157 case PLOT_FORMAT::POST: m_plotFormatOpt->SetSelection( 0 ); break;
158 case PLOT_FORMAT::PDF: m_plotFormatOpt->SetSelection( 1 ); break;
159 case PLOT_FORMAT::SVG: m_plotFormatOpt->SetSelection( 2 ); break;
160 case PLOT_FORMAT::DXF: m_plotFormatOpt->SetSelection( 3 ); break;
161 case PLOT_FORMAT::HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
162 }
163
164 if( fmt == PLOT_FORMAT::DXF || fmt == PLOT_FORMAT::HPGL )
165 m_plotBackgroundColor->Disable();
166
167 // Set the default line width (pen width which should be used for
168 // items that do not have a pen size defined (like frame ref)
169 // the default line width is stored in mils in config
171 schIUScale.MilsToIU( cfg->m_Drawing.default_line_thickness ) );
172 }
173
174 // Initialize HPGL specific widgets
176
177 // Plot directory
179 wxString path = settings.m_PlotDirectoryName;
180#ifdef __WINDOWS__
181 path.Replace( '/', '\\' );
182#endif
183 m_outputPath->SetValue( path );
184 }
185 else if( m_job )
186 {
188 {
189 int idx = m_colorTheme->Append( settings->GetName(), static_cast<void*>( settings ) );
190
191 if( settings->GetName() == m_job->m_theme )
192 m_colorTheme->SetSelection( idx );
193 }
194
195 if( m_colorTheme->GetSelection() == wxNOT_FOUND )
196 m_colorTheme->SetSelection( 0 );
197
205 m_colorTheme->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
206 m_ModeColorOption->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
207 m_plotOriginOpt->SetSelection( static_cast<int>( m_job->m_HPGLPlotOrigin ) );
208 m_pageSizeSelect = static_cast<int>( m_job->m_pageSizeSelect );
211
212 // Set the plot format
213 switch( m_job->m_plotFormat )
214 {
215 default:
216 case SCH_PLOT_FORMAT::POST: m_plotFormatOpt->SetSelection( 0 ); break;
217 case SCH_PLOT_FORMAT::PDF: m_plotFormatOpt->SetSelection( 1 ); break;
218 case SCH_PLOT_FORMAT::SVG: m_plotFormatOpt->SetSelection( 2 ); break;
219 case SCH_PLOT_FORMAT::DXF: m_plotFormatOpt->SetSelection( 3 ); break;
220 case SCH_PLOT_FORMAT::HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
221 }
222
223 // And then hide it
224 m_plotFormatOpt->Hide();
225
227 }
228}
229
230
236{
237 // Build the absolute path of current output directory to preselect it in the file browser.
238 wxString path = ExpandEnvVarSubstitutions( m_outputPath->GetValue(), &Prj() );
239
240 // When editing a schematic that is not part of a project in the stand alone mode, the
241 // project path is not defined so point to the users document path to save the plot files.
242 if( Prj().IsNullProject() )
243 {
245 }
246 else
247 {
248 // Build the absolute path of current output directory to preselect it in the file browser.
249 path = ExpandEnvVarSubstitutions( m_outputPath->GetValue(), &Prj() );
250 path = Prj().AbsolutePath( path );
251 }
252
253 wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
254
255 if( dirDialog.ShowModal() == wxID_CANCEL )
256 return;
257
258 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
259
260 wxFileName fn( Prj().AbsolutePath( m_editFrame->Schematic().Root().GetFileName() ) );
261 wxString defaultPath = fn.GetPathWithSep();
262 wxString msg;
263 wxFileName relPathTest; // Used to test if we can make the path relative
264
265 relPathTest.Assign( dirDialog.GetPath() );
266
267 // Test if making the path relative is possible before asking the user if they want to do it
268 if( relPathTest.MakeRelativeTo( defaultPath ) )
269 {
270 msg.Printf( _( "Do you want to use a path relative to\n'%s'?" ), defaultPath );
271
272 wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
273 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
274
275 if( dialog.ShowModal() == wxID_YES )
276 dirName.MakeRelativeTo( defaultPath );
277 }
278
279 m_outputPath->SetValue( dirName.GetFullPath() );
280}
281
282
284{
285 switch( m_plotFormatOpt->GetSelection() )
286 {
287 default:
288 case 0: return PLOT_FORMAT::POST;
289 case 1: return PLOT_FORMAT::PDF;
290 case 2: return PLOT_FORMAT::SVG;
291 case 3: return PLOT_FORMAT::DXF;
292 case 4: return PLOT_FORMAT::HPGL;
293 }
294}
295
296
297void DIALOG_PLOT_SCHEMATIC::OnPageSizeSelected( wxCommandEvent& event )
298{
299 if( GetPlotFileFormat() == PLOT_FORMAT::HPGL )
300 m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( m_paperSizeOption->GetSelection() );
301 else
302 m_pageSizeSelect = m_paperSizeOption->GetSelection();
303}
304
305
306void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event )
307{
309
310 if( fmt != m_plotFormat )
311 {
312 m_plotFormat = fmt;
313
314 wxArrayString paperSizes;
315 paperSizes.push_back( _( "Schematic size" ) );
316
317 int selection;
318
319 if( fmt == PLOT_FORMAT::HPGL )
320 {
321 paperSizes.push_back( _( "A5" ) );
322 paperSizes.push_back( _( "A4" ) );
323 paperSizes.push_back( _( "A3" ) );
324 paperSizes.push_back( _( "A2" ) );
325 paperSizes.push_back( _( "A1" ) );
326 paperSizes.push_back( _( "A0" ) );
327 paperSizes.push_back( _( "A" ) );
328 paperSizes.push_back( _( "B" ) );
329 paperSizes.push_back( _( "C" ) );
330 paperSizes.push_back( _( "D" ) );
331 paperSizes.push_back( _( "E" ) );
332
333 selection = static_cast<int>( m_HPGLPaperSizeSelect );
334 }
335 else
336 {
337 paperSizes.push_back( _( "A4" ) );
338 paperSizes.push_back( _( "A" ) );
339
340 selection = m_pageSizeSelect;
341 }
342
343 m_openFileAfterPlot->Enable( fmt == PLOT_FORMAT::PDF );
344 m_plotPDFPropertyPopups->Enable( fmt == PLOT_FORMAT::PDF );
345 m_plotPDFHierarchicalLinks->Enable( fmt == PLOT_FORMAT::PDF );
346 m_plotPDFMetadata->Enable( fmt == PLOT_FORMAT::PDF );
347
348 m_paperSizeOption->Set( paperSizes );
349 m_paperSizeOption->SetSelection( selection );
350
352 fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
353
354 m_plotOriginTitle->Enable( fmt == PLOT_FORMAT::HPGL );
355 m_plotOriginOpt->Enable( fmt == PLOT_FORMAT::HPGL );
356 m_penWidth.Enable( fmt == PLOT_FORMAT::HPGL );
357
358 m_plotBackgroundColor->Enable(
359 fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
360
361 m_colorTheme->Enable( fmt != PLOT_FORMAT::HPGL );
362 m_ModeColorOption->Enable( fmt != PLOT_FORMAT::HPGL );
363 }
364}
365
366
368{
370
371 EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
372 wxASSERT( cfg );
373
375
376 if( cfg )
377 {
380 cfg->m_PlotPanel.color_theme = colors->GetFilename();
382 cfg->m_PlotPanel.format = static_cast<int>( GetPlotFileFormat() );
383 cfg->m_PlotPanel.hpgl_origin = m_plotOriginOpt->GetSelection();
384 cfg->m_PlotPanel.hpgl_paper_size = static_cast<int>( m_HPGLPaperSizeSelect );
387 cfg->m_PlotPanel.pdf_metadata = m_plotPDFMetadata->GetValue();
389
390 // HPGL Pen Size is stored in mm in config
392
393 aSettings->SetDefaultFont( cfg->m_Appearance.default_font );
394 }
395
396 aSettings->LoadColors( colors );
397 aSettings->SetMinPenWidth( (int) m_defaultLineWidth.GetValue() );
398
399 if( m_plotBackgroundColor->GetValue() )
401 else
402 aSettings->SetBackgroundColor( COLOR4D::UNSPECIFIED );
403
404 // Plot directory
405 wxString path = m_outputPath->GetValue();
406 path.Replace( '\\', '/' );
407
409
410 if( settings.m_PlotDirectoryName != path )
411 m_configChanged = true;
412
413 settings.m_PlotDirectoryName = path;
414}
415
416
418{
419 int selection = m_colorTheme->GetSelection();
420
421 if( selection < 0 )
422 {
425 }
426
427 return static_cast<COLOR_SETTINGS*>( m_colorTheme->GetClientData( selection ) );
428}
429
430
431void DIALOG_PLOT_SCHEMATIC::OnPlotCurrent( wxCommandEvent& event )
432{
433 plotSchematic( false );
434}
435
436
437void DIALOG_PLOT_SCHEMATIC::OnPlotAll( wxCommandEvent& event )
438{
439 if( !m_job )
440 {
441 plotSchematic( true );
442 }
443 else
444 {
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, int aMinHeight)
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:83
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:162
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:322
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
Definition: schematic.cpp:218
bool ResolveTextVar(const SCH_SHEET_PATH *aSheetPath, wxString *token, int aDepth) const
Definition: schematic.cpp:263
SCH_SHEET & Root() const
Definition: schematic.h:131
SCH_RENDER_SETTINGS * GetRenderSettings()
Schematic editor (Eeschema) main window.
SCHEMATIC & Schematic() const
const wxString & GetFileName() const
Definition: sch_screen.h:144
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:310
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)
int GetIntValue()
Definition: unit_binder.h:129
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:477
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:403
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