73 m_editFrame( aEditFrame ),
76 m_defaultLineWidth( aEditFrame, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ),
77 m_penWidth( aEditFrame, m_penWidthLabel, m_penWidthCtrl, m_penWidthUnits ), m_job( aJob )
86 { wxID_APPLY,
_(
"Plot Current Page" ) },
87 { wxID_CANCEL,
_(
"Close" ) } } );
98 { wxID_CANCEL,
_(
"Close" ) } } );
120 m_colorTheme->Append( settings->GetName(),
static_cast<void*
>( settings ) );
122 if( settings->GetFilename() == cfg->m_PlotPanel.color_theme )
164 if( fmt == PLOT_FORMAT::DXF || fmt == PLOT_FORMAT::HPGL )
180 path.Replace(
'/',
'\\' );
188 int idx =
m_colorTheme->Append( settings->GetName(),
static_cast<void*
>( settings ) );
240 if(
Prj().IsNullProject() )
251 wxDirDialog dirDialog(
this,
_(
"Select Output Directory" ),
path );
253 if( dirDialog.ShowModal() == wxID_CANCEL )
256 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
259 wxString defaultPath = fn.GetPathWithSep();
261 wxFileName relPathTest;
263 relPathTest.Assign( dirDialog.GetPath() );
266 if( relPathTest.MakeRelativeTo( defaultPath ) )
268 msg.Printf(
_(
"Do you want to use a path relative to\n'%s'?" ), defaultPath );
270 wxMessageDialog dialog(
this, msg,
_(
"Plot Output Directory" ),
271 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
273 if( dialog.ShowModal() == wxID_YES )
274 dirName.MakeRelativeTo( defaultPath );
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;
312 wxArrayString paperSizes;
313 paperSizes.push_back(
_(
"Schematic size" ) );
317 if( fmt == PLOT_FORMAT::HPGL )
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" ) );
335 paperSizes.push_back(
_(
"A4" ) );
336 paperSizes.push_back(
_(
"A" ) );
350 fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
357 fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
404 path.Replace(
'\\',
'/' );
477 std::unique_ptr<SCH_PLOTTER> schPlotter = std::make_unique<SCH_PLOTTER>(
m_editFrame );
500 wxLaunchDefaultApplication( schPlotter->GetLastOutputFilePath() );
525 std::function<bool( wxString* )> textResolver =
526 [&]( wxString* token ) ->
bool
539 if( fn.IsAbsolute() )
544 if(
Prj().IsNullProject() )
551 msg.Printf(
_(
"Cannot normalize path '%s%s'." ), fn.GetPathWithSep(),
path );
552 fn.SetPath( fn.GetPathWithSep() +
path );
556 fn.SetName( wxEmptyString );
557 fn.SetExt( wxEmptyString );
565 wxMessageDialog dlg(
this, msg,
_(
"Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
566 | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
568 dlg.SetExtendedMessage( extMsg );
576 msg =
_(
"No project or path defined for the current schematic." );
578 wxMessageDialog dlg(
this, msg,
_(
"Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
579 | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
580 dlg.SetExtendedMessage( extMsg );
589 msg.Printf(
_(
"Cannot normalize path '%s%s'." ),
Prj().GetProjectPath(),
path );
592 fn.SetPath(
Prj().GetProjectPath() +
path );
600 wxMessageDialog dlg(
this, msg,
_(
"Warning" ),
601 wxOK | wxCENTER | wxRESIZE_BORDER | wxICON_EXCLAMATION |
604 dlg.SetExtendedMessage( extMsg );
constexpr EDA_IU_SCALE schIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
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.
wxTextCtrl * m_outputDirectoryName
wxRadioBox * m_plotFormatOpt
wxCheckBox * m_plotPDFMetadata
wxChoice * m_ModeColorOption
wxStaticText * m_plotOriginTitle
STD_BITMAP_BUTTON * m_browseButton
wxCheckBox * m_plotDrawingSheet
wxCheckBox * m_plotPDFPropertyPopups
WX_HTML_REPORT_PANEL * m_MessagesBox
wxCheckBox * m_plotPDFHierarchicalLinks
wxChoice * m_paperSizeOption
wxChoice * m_plotOriginOpt
wxCheckBox * m_openFileAfterPlot
wxButton * m_sdbSizer1Apply
wxCheckBox * m_plotBackgroundColor
UNIT_BINDER m_defaultLineWidth
void OnPageSizeSelected(wxCommandEvent &event) override
void OnPlotAll(wxCommandEvent &event) override
bool getOpenFileAfterPlot()
static HPGL_PAGE_SIZE m_HPGLPaperSizeSelect
void OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
Set the m_outputDirectoryName variable to the selected directory from directory dialog.
PLOT_FORMAT GetPlotFileFormat()
static int m_pageSizeSelect
void OnPlotCurrent(wxCommandEvent &event) override
void setModeColor(bool aColor)
bool getPlotDrawingSheet()
void setPlotDrawingSheet(bool aPlot)
void setOpenFileAfterPlot(bool aOpenFileAfterPlot)
JOB_EXPORT_SCH_PLOT * m_job
SCH_EDIT_FRAME * m_editFrame
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
bool m_useBackgroundColor
bool m_PDFHierarchicalLinks
JOB_HPGL_PLOT_ORIGIN_AND_UNITS m_HPGLPlotOrigin
JOB_HPGL_PAGE_SIZE m_HPGLPaperSizeSelect
wxString GetOutputPath() const
wxString GetFilename() const
APP_SETTINGS_BASE * KifaceSettings() const
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
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.
These are loaded from Eeschema settings but then overwritten by the project settings.
wxString m_PlotDirectoryName
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
SCHEMATIC_SETTINGS & Settings() const
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
bool ResolveTextVar(const SCH_SHEET_PATH *aSheetPath, wxString *token, int aDepth) const
SCH_RENDER_SETTINGS * GetRenderSettings()
Schematic editor (Eeschema) main window.
SCHEMATIC & Schematic() const
const wxString & GetFileName() const
wxString GetFileName() const
Return the filename corresponding to this sheet.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
std::vector< COLOR_SETTINGS * > GetColorSettingsList()
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.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
JOB_HPGL_PLOT_ORIGIN_AND_UNITS
@ LAYER_SCHEMATIC_BACKGROUND
SETTINGS_MANAGER * GetSettingsManager()
PGM_BASE & Pgm()
The global Program "get" accessor.
PLOT_FORMAT
The set of supported output plot formats.
Plotting engines similar to ps (PostScript, Gerber, svg)
HPGL_PLOT_ORIGIN_AND_UNITS
std::vector< FAB_LAYER_COLOR > dummy
constexpr int MilsToIU(int mils) const
constexpr int mmToIU(double mm) const
bool open_file_after_plot
bool pdf_hierarchical_links
wxString m_outputDirectory
HPGL_PLOT_ORIGIN_AND_UNITS m_HPGLPlotOrigin
HPGL_PAGE_SIZE m_HPGLPaperSizeSelect
bool m_PDFHierarchicalLinks
bool m_useBackgroundColor
wxLogTrace helper definitions.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().