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 (C) 1992-2023 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
32#include <eeschema_settings.h>
33#include <kiface_base.h>
34#include <locale_io.h>
38#include <reporter.h>
39#include <trace_helpers.h>
42#include <wx_filename.h>
43#include <pgm_base.h>
44
45#include <sch_edit_frame.h>
46#include <sch_painter.h>
47#include <schematic.h>
48#include <sch_screen.h>
49
50#include <wx/dirdlg.h>
51#include <wx/msgdlg.h>
53#include <wx/log.h>
54
56
57
58// static members (static to remember last state):
61
62
64 DIALOG_PLOT_SCHEMATIC( aEditFrame, aEditFrame )
65{
66
67}
68
69
72 : DIALOG_PLOT_SCHEMATIC_BASE( aEditFrame ),
73 m_editFrame( aEditFrame ),
74 m_plotFormat( PLOT_FORMAT::UNDEFINED ),
75 m_HPGLPenSize( 1.0 ),
76 m_defaultLineWidth( aEditFrame, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ),
77 m_penWidth( aEditFrame, m_penWidthLabel, m_penWidthCtrl, m_penWidthUnits ), m_job( aJob )
78{
79 m_configChanged = false;
80
81 if( !m_job )
82 {
83 m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
84 m_MessagesBox->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
85 SetupStandardButtons( { { wxID_OK, _( "Plot All Pages" ) },
86 { wxID_APPLY, _( "Plot Current Page" ) },
87 { wxID_CANCEL, _( "Close" ) } } );
88 }
89 else
90 {
91 m_browseButton->Hide();
92 m_MessagesBox->Hide();
93
94 m_sdbSizer1Apply->Hide();
95 m_openFileAfterPlot->Hide();
96
97 SetupStandardButtons( { { wxID_OK, _( "Save" ) },
98 { wxID_CANCEL, _( "Close" ) } } );
99 }
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 =
120 m_colorTheme->Append( settings->GetName(), 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
170 m_defaultLineWidth.SetValue( schIUScale.MilsToIU( cfg->m_Drawing.default_line_thickness ) );
171 }
172
173 // Initialize HPGL specific widgets
175
176 // Plot directory
178 wxString path = settings.m_PlotDirectoryName;
179#ifdef __WINDOWS__
180 path.Replace( '/', '\\' );
181#endif
182 m_outputDirectoryName->SetValue( path );
183 }
184 else if( m_job )
185 {
187 {
188 int idx = m_colorTheme->Append( settings->GetName(), static_cast<void*>( settings ) );
189
190 if( settings->GetName() == m_job->m_theme )
191 m_colorTheme->SetSelection( idx );
192 }
193
194 if( m_colorTheme->GetSelection() == wxNOT_FOUND )
195 m_colorTheme->SetSelection( 0 );
196
197 m_plotFormatOpt->SetSelection( static_cast<int>( m_job->m_plotFormat ) );
204 m_colorTheme->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
205 m_ModeColorOption->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
206 m_plotOriginOpt->SetSelection( static_cast<int>( m_job->m_HPGLPlotOrigin ) );
207 m_pageSizeSelect = static_cast<int>( m_job->m_pageSizeSelect );
209
210 // Set the plot format
211 switch( m_job->m_plotFormat )
212 {
213 default:
214 case SCH_PLOT_FORMAT::POST: m_plotFormatOpt->SetSelection( 0 ); break;
215 case SCH_PLOT_FORMAT::PDF: m_plotFormatOpt->SetSelection( 1 ); break;
216 case SCH_PLOT_FORMAT::SVG: m_plotFormatOpt->SetSelection( 2 ); break;
217 case SCH_PLOT_FORMAT::DXF: m_plotFormatOpt->SetSelection( 3 ); break;
218 case SCH_PLOT_FORMAT::HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
219 }
220
221 // And then hide it
222 m_plotFormatOpt->Hide();
223
225 }
226}
227
228
234{
235 // Build the absolute path of current output directory to preselect it in the file browser.
236 wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
237
238 // When editing a schematic that is not part of a project in the stand alone mode, the
239 // project path is not defined so point to the users document path to save the plot files.
240 if( Prj().IsNullProject() )
241 {
243 }
244 else
245 {
246 // Build the absolute path of current output directory to preselect it in the file browser.
248 path = Prj().AbsolutePath( path );
249 }
250
251 wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
252
253 if( dirDialog.ShowModal() == wxID_CANCEL )
254 return;
255
256 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
257
258 wxFileName fn( Prj().AbsolutePath( m_editFrame->Schematic().Root().GetFileName() ) );
259 wxString defaultPath = fn.GetPathWithSep();
260 wxString msg;
261 wxFileName relPathTest; // Used to test if we can make the path relative
262
263 relPathTest.Assign( dirDialog.GetPath() );
264
265 // Test if making the path relative is possible before asking the user if they want to do it
266 if( relPathTest.MakeRelativeTo( defaultPath ) )
267 {
268 msg.Printf( _( "Do you want to use a path relative to\n'%s'?" ), defaultPath );
269
270 wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
271 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
272
273 if( dialog.ShowModal() == wxID_YES )
274 dirName.MakeRelativeTo( defaultPath );
275 }
276
277 m_outputDirectoryName->SetValue( dirName.GetFullPath() );
278}
279
280
282{
283 switch( m_plotFormatOpt->GetSelection() )
284 {
285 default:
286 case 0: return PLOT_FORMAT::POST;
287 case 1: return PLOT_FORMAT::PDF;
288 case 2: return PLOT_FORMAT::SVG;
289 case 3: return PLOT_FORMAT::DXF;
290 case 4: return PLOT_FORMAT::HPGL;
291 }
292}
293
294
295void DIALOG_PLOT_SCHEMATIC::OnPageSizeSelected( wxCommandEvent& event )
296{
297 if( GetPlotFileFormat() == PLOT_FORMAT::HPGL )
298 m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( m_paperSizeOption->GetSelection() );
299 else
300 m_pageSizeSelect = m_paperSizeOption->GetSelection();
301}
302
303
304void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event )
305{
307
308 if( fmt != m_plotFormat )
309 {
310 m_plotFormat = fmt;
311
312 wxArrayString paperSizes;
313 paperSizes.push_back( _( "Schematic size" ) );
314
315 int selection;
316
317 if( fmt == PLOT_FORMAT::HPGL )
318 {
319 paperSizes.push_back( _( "A5" ) );
320 paperSizes.push_back( _( "A4" ) );
321 paperSizes.push_back( _( "A3" ) );
322 paperSizes.push_back( _( "A2" ) );
323 paperSizes.push_back( _( "A1" ) );
324 paperSizes.push_back( _( "A0" ) );
325 paperSizes.push_back( _( "A" ) );
326 paperSizes.push_back( _( "B" ) );
327 paperSizes.push_back( _( "C" ) );
328 paperSizes.push_back( _( "D" ) );
329 paperSizes.push_back( _( "E" ) );
330
331 selection = static_cast<int>( m_HPGLPaperSizeSelect );
332 }
333 else
334 {
335 paperSizes.push_back( _( "A4" ) );
336 paperSizes.push_back( _( "A" ) );
337
338 selection = m_pageSizeSelect;
339 }
340
341 m_openFileAfterPlot->Enable( fmt == PLOT_FORMAT::PDF );
342 m_plotPDFPropertyPopups->Enable( fmt == PLOT_FORMAT::PDF );
343 m_plotPDFHierarchicalLinks->Enable( fmt == PLOT_FORMAT::PDF );
344 m_plotPDFMetadata->Enable( fmt == PLOT_FORMAT::PDF );
345
346 m_paperSizeOption->Set( paperSizes );
347 m_paperSizeOption->SetSelection( selection );
348
350 fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
351
352 m_plotOriginTitle->Enable( fmt == PLOT_FORMAT::HPGL );
353 m_plotOriginOpt->Enable( fmt == PLOT_FORMAT::HPGL );
354 m_penWidth.Enable( fmt == PLOT_FORMAT::HPGL );
355
356 m_plotBackgroundColor->Enable(
357 fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
358
359 m_colorTheme->Enable( fmt != PLOT_FORMAT::HPGL );
360 m_ModeColorOption->Enable( fmt != PLOT_FORMAT::HPGL );
361 }
362}
363
364
366{
368
369 EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
370 wxASSERT( cfg );
371
373
374 if( cfg )
375 {
378 cfg->m_PlotPanel.color_theme = colors->GetFilename();
380 cfg->m_PlotPanel.format = static_cast<int>( GetPlotFileFormat() );
381 cfg->m_PlotPanel.hpgl_origin = m_plotOriginOpt->GetSelection();
382 cfg->m_PlotPanel.hpgl_paper_size = static_cast<int>( m_HPGLPaperSizeSelect );
385 cfg->m_PlotPanel.pdf_metadata = m_plotPDFMetadata->GetValue();
387
388 // HPGL Pen Size is stored in mm in config
390
391 aSettings->SetDefaultFont( cfg->m_Appearance.default_font );
392 }
393
394 aSettings->LoadColors( colors );
395 aSettings->SetMinPenWidth( (int) m_defaultLineWidth.GetValue() );
396
397 if( m_plotBackgroundColor->GetValue() )
399 else
400 aSettings->SetBackgroundColor( COLOR4D::UNSPECIFIED );
401
402 // Plot directory
403 wxString path = m_outputDirectoryName->GetValue();
404 path.Replace( '\\', '/' );
405
407
408 if( settings.m_PlotDirectoryName != path )
409 m_configChanged = true;
410
411 settings.m_PlotDirectoryName = path;
412}
413
414
416{
417 int selection = m_colorTheme->GetSelection();
418
419 if( selection < 0 )
420 {
423 }
424
425 return static_cast<COLOR_SETTINGS*>( m_colorTheme->GetClientData( selection ) );
426}
427
428
429void DIALOG_PLOT_SCHEMATIC::OnPlotCurrent( wxCommandEvent& event )
430{
431 plotSchematic( false );
432}
433
434
435void DIALOG_PLOT_SCHEMATIC::OnPlotAll( wxCommandEvent& event )
436{
437 if (!m_job)
438 {
439 plotSchematic( true );
440 }
441 else
442 {
446 // m_job->m_HPGLPaperSizeSelect = m_HPGLPaperSizeSelect;
452 m_job->m_plotAll = true;
454
456 static_cast<JOB_HPGL_PLOT_ORIGIN_AND_UNITS>( m_plotOriginOpt->GetSelection() );
457
459 m_job->m_theme = colors->GetName();
460
461
462 Close();
463 }
464}
465
466
468{
469 wxBusyCursor dummy;
470
472 renderSettings.m_ShowHiddenPins = false;
473 renderSettings.m_ShowHiddenFields = false;
474
475 getPlotOptions( &renderSettings );
476
477 std::unique_ptr<SCH_PLOTTER> schPlotter = std::make_unique<SCH_PLOTTER>( m_editFrame );
478
480
481 SCH_PLOT_OPTS plotOpts;
483 plotOpts.m_plotAll = aPlotAll;
484 plotOpts.m_blackAndWhite = !getModeColor();
485 plotOpts.m_useBackgroundColor = m_plotBackgroundColor->GetValue();
486 plotOpts.m_theme = colors->GetFilename();
487 plotOpts.m_PDFPropertyPopups = m_plotPDFPropertyPopups->GetValue();
489 plotOpts.m_PDFMetadata = m_plotPDFMetadata->GetValue();
491 plotOpts.m_HPGLPlotOrigin =
492 static_cast<HPGL_PLOT_ORIGIN_AND_UNITS>( m_plotOriginOpt->GetSelection() );
493 plotOpts.m_HPGLPenSize = m_HPGLPenSize;
494 plotOpts.m_outputDirectory = getOutputPath();
496
497 schPlotter->Plot( GetPlotFileFormat(), plotOpts, &renderSettings, &m_MessagesBox->Reporter() );
498
499 if( GetPlotFileFormat() == PLOT_FORMAT::PDF && getOpenFileAfterPlot() )
500 wxLaunchDefaultApplication( schPlotter->GetLastOutputFilePath() );
501}
502
503
505{
507
508 if( m_HPGLPenSize > schIUScale.mmToIU( 2 ) )
510
511 if( m_HPGLPenSize < schIUScale.mmToIU( 0.01 ) )
513}
514
515
517{
518 wxString msg;
519 wxString extMsg;
520 wxFileName fn;
521
522 extMsg.Printf( _( "Falling back to user path '%s'." ), KIPLATFORM::ENV::GetDocumentsPath() );
523
524 // Build the absolute path of current output directory to preselect it in the file browser.
525 std::function<bool( wxString* )> textResolver =
526 [&]( wxString* token ) -> bool
527 {
528 SCHEMATIC& schematic = m_editFrame->Schematic();
529 return schematic.ResolveTextVar( &schematic.CurrentSheet(), token, 0 );
530 };
531
532 wxString path = m_outputDirectoryName->GetValue();
533 path = ExpandTextVars( path, &textResolver );
535
536 fn.SetPath( path );
537
538 // If the contents of the path edit control results in an absolute path, return it as is.
539 if( fn.IsAbsolute() )
540 return path;
541
542 // When editing a schematic that is not part of a project in the stand alone mode, the
543 // project path is not defined.
544 if( Prj().IsNullProject() )
545 {
547
548 if( screen && !screen->GetFileName().IsEmpty() )
549 {
550 fn = screen->GetFileName();
551 msg.Printf( _( "Cannot normalize path '%s%s'." ), fn.GetPathWithSep(), path );
552 fn.SetPath( fn.GetPathWithSep() + path );
553
554 // Normalize always returns true for a non-empty file name so clear the file name
555 // and extension so that only the path is normalized.
556 fn.SetName( wxEmptyString );
557 fn.SetExt( wxEmptyString );
558
559 if( fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) )
560 {
561 path = fn.GetPath();
562 }
563 else
564 {
565 wxMessageDialog dlg( this, msg, _( "Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
566 | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
567
568 dlg.SetExtendedMessage( extMsg );
569 dlg.ShowModal();
570
572 }
573 }
574 else
575 {
576 msg = _( "No project or path defined for the current schematic." );
577
578 wxMessageDialog dlg( this, msg, _( "Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
579 | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
580 dlg.SetExtendedMessage( extMsg );
581 dlg.ShowModal();
582
583 // Always fall back to user's document path if no other absolute path can be normalized.
585 }
586 }
587 else
588 {
589 msg.Printf( _( "Cannot normalize path '%s%s'." ), Prj().GetProjectPath(), path );
590
591 // Build the absolute path of current output directory and the project path.
592 fn.SetPath( Prj().GetProjectPath() + path );
593
594 if( fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) )
595 {
596 path = fn.GetPath();
597 }
598 else
599 {
600 wxMessageDialog dlg( this, msg, _( "Warning" ),
601 wxOK | wxCENTER | wxRESIZE_BORDER | wxICON_EXCLAMATION |
602 wxSTAY_ON_TOP );
603
604 dlg.SetExtendedMessage( extMsg );
605 dlg.ShowModal();
606
608 }
609 }
610
611 return path;
612}
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 OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
Set the m_outputDirectoryName variable to the selected directory from directory dialog.
void OnPlotCurrent(wxCommandEvent &event) override
void setModeColor(bool aColor)
void setPlotDrawingSheet(bool aPlot)
void setOpenFileAfterPlot(bool aOpenFileAfterPlot)
JOB_EXPORT_SCH_PLOT * m_job
void getPlotOptions(RENDER_SETTINGS *aSettings)
COLOR_SETTINGS * getColorSettings()
void plotSchematic(bool aPlotAll)
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={})
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
wxString GetOutputPath() const
Definition: job.h:119
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:142
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:359
These are loaded from Eeschema settings but then overwritten by the project settings.
Holds all the data relating to one schematic.
Definition: schematic.h:77
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:152
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:314
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:255
SCH_SHEET & Root() const
Definition: schematic.h:121
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:306
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves 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 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)
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:348
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
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:391
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:1060
see class PGM_BASE
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:65
Plotting engine (HPGL)
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
const double IU_PER_MM
Definition: base_units.h:76
constexpr int MilsToIU(int mils) const
Definition: base_units.h:93
constexpr int mmToIU(double mm) const
Definition: base_units.h:88
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