67 m_editFrame( aEditFrame ),
69 m_defaultLineWidth( aEditFrame, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ),
79 { wxID_APPLY,
_(
"Plot Current Page" ) },
80 { wxID_CANCEL,
_(
"Close" ) } } );
118 static_cast<void*
>( settings ) );
120 if( settings->GetFilename() == cfg->m_PlotPanel.color_theme )
151 case PLOT_FORMAT::HPGL:
break;
154 if( fmt == PLOT_FORMAT::DXF )
167 path.Replace(
'/',
'\\' );
175 int idx =
m_colorTheme->Append( settings->GetName(),
static_cast<void*
>( settings ) );
201 case SCH_PLOT_FORMAT::HPGL:
break;
223 if(
Prj().IsNullProject() )
234 wxDirDialog dirDialog(
this,
_(
"Select Output Directory" ),
path );
236 if( dirDialog.ShowModal() == wxID_CANCEL )
239 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
242 wxString defaultPath = fn.GetPathWithSep();
244 wxFileName relPathTest;
246 relPathTest.Assign( dirDialog.GetPath() );
249 if( relPathTest.MakeRelativeTo( defaultPath ) )
251 msg.Printf(
_(
"Do you want to use a path relative to\n'%s'?" ), defaultPath );
253 wxMessageDialog dialog(
this, msg,
_(
"Plot Output Directory" ),
254 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
256 if( dialog.ShowModal() == wxID_YES )
257 dirName.MakeRelativeTo( defaultPath );
268 case 0:
return PLOT_FORMAT::POST;
270 case 1:
return PLOT_FORMAT::PDF;
271 case 2:
return PLOT_FORMAT::SVG;
272 case 3:
return PLOT_FORMAT::DXF;
291 wxArrayString paperSizes;
292 paperSizes.push_back(
_(
"Schematic size" ) );
296 paperSizes.push_back(
_(
"A4" ) );
297 paperSizes.push_back(
_(
"A" ) );
310 || fmt == PLOT_FORMAT::PDF
311 || fmt == PLOT_FORMAT::SVG );
314 || fmt == PLOT_FORMAT::PDF
315 || fmt == PLOT_FORMAT::SVG );
352 path.Replace(
'\\',
'/' );
418 std::unique_ptr<SCH_PLOTTER> schPlotter = std::make_unique<SCH_PLOTTER>(
m_editFrame );
438 wxLaunchDefaultApplication( schPlotter->GetLastOutputFilePath() );
451 std::function<bool( wxString* )> textResolver =
452 [&]( wxString* token ) ->
bool
465 if( fn.IsAbsolute() )
470 if(
Prj().IsNullProject() )
477 msg.Printf(
_(
"Cannot normalize path '%s%s'." ), fn.GetPathWithSep(),
path );
478 fn.SetPath( fn.GetPathWithSep() +
path );
482 fn.SetName( wxEmptyString );
483 fn.SetExt( wxEmptyString );
491 wxMessageDialog dlg(
this, msg,
_(
"Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
492 | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
494 dlg.SetExtendedMessage( extMsg );
502 msg =
_(
"No project or path defined for the current schematic." );
504 wxMessageDialog dlg(
this, msg,
_(
"Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
505 | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
506 dlg.SetExtendedMessage( extMsg );
515 msg.Printf(
_(
"Cannot normalize path '%s%s'." ),
Prj().GetProjectPath(),
path );
518 fn.SetPath(
Prj().GetProjectPath() +
path );
526 wxMessageDialog dlg(
this, msg,
_(
"Warning" ),
527 wxOK | wxCENTER | wxRESIZE_BORDER | wxICON_EXCLAMATION |
530 dlg.SetExtendedMessage( extMsg );
constexpr EDA_IU_SCALE schIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
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.
wxRadioBox * m_plotFormatOpt
wxCheckBox * m_plotPDFMetadata
STD_BITMAP_BUTTON * m_browseButton
wxCheckBox * m_plotDrawingSheet
wxCheckBox * m_plotPDFPropertyPopups
WX_HTML_REPORT_PANEL * m_MessagesBox
wxCheckBox * m_plotPDFHierarchicalLinks
wxChoice * m_paperSizeOption
wxCheckBox * m_openFileAfterPlot
wxButton * m_sdbSizer1Apply
wxCheckBox * m_plotBackgroundColor
wxTextCtrl * m_outputPath
UNIT_BINDER m_defaultLineWidth
void OnPageSizeSelected(wxCommandEvent &event) override
void OnPlotAll(wxCommandEvent &event) override
bool getOpenFileAfterPlot()
PLOT_FORMAT GetPlotFileFormat()
static int m_pageSizeSelect
void setOpenFileAfterPlot(bool aOpen)
void OnPlotCurrent(wxCommandEvent &event) override
void setModeColor(bool aColor)
bool getPlotDrawingSheet()
void setPlotDrawingSheet(bool aPlot)
JOB_EXPORT_SCH_PLOT * m_job
SCH_EDIT_FRAME * m_editFrame
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={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
JOB_PAGE_SIZE m_pageSizeSelect
SCH_PLOT_FORMAT m_plotFormat
bool m_useBackgroundColor
bool m_PDFHierarchicalLinks
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
virtual wxString GetSettingsDialogTitle() const
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
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.
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_SHEET_PATH & CurrentSheet() 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.
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)
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.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
@ 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)
std::vector< FAB_LAYER_COLOR > dummy
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
constexpr int MilsToIU(int mils) const
bool open_file_after_plot
bool pdf_hierarchical_links
wxString m_outputDirectory
bool m_PDFHierarchicalLinks
bool m_useBackgroundColor
wxLogTrace helper definitions.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().