42 #include <wx/dirdlg.h> 85 m_printMirror( false ),
86 m_oneFileOnly( false )
129 cfg->m_ExportSvg.layers.clear();
137 cfg->m_ExportSvg.layers.push_back( layer );
154 wxCommandEvent
dummy;
207 wxDirDialog dirDialog(
this,
_(
"Select Output Directory" ),
path );
209 if( dirDialog.ShowModal() == wxID_CANCEL )
212 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
214 wxMessageDialog dialog(
this,
_(
"Use a relative path?" ),
_(
"Plot Output Directory" ),
215 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
217 if( dialog.ShowModal() == wxID_YES )
221 boardFilePath = wxPathOnly( boardFilePath );
223 if( !dirName.MakeRelativeTo( boardFilePath ) )
224 wxMessageBox(
_(
"Cannot make path relative (target volume different from board file volume)!" ),
225 _(
"Plot Output Directory" ), wxOK | wxICON_ERROR );
257 std::function<bool( wxString* )> textResolver =
258 [&]( wxString* token ) ->
bool 268 wxFileName outputDir = wxFileName::DirName(
path );
275 wxString msg =
wxString::Format(
_(
"Could not write plot files to folder '%s'." ),
276 outputDir.GetPath() );
286 for(
LSEQ seq = all_selected.
Seq(); seq; ++seq )
289 wxFileName fn( boardFilename );
293 wxString svgPath = fn.GetFullPath();
359 aFullFileName, wxEmptyString );
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
const PAGE_INFO & GetPageSettings() const
wxCheckBox * m_checkboxEdgesOnAllPages
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
wxString m_outputDirectory
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
void OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
void SetUseAuxOrigin(bool aAux)
wxCheckListBox * m_CopperLayersList
wxTextCtrl * m_outputDirectoryName
This file is part of the common library.
void PlotOneBoardLayer(BOARD *aBoard, PLOTTER *aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt)
Plot one copper or technical layer.
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
void SetPageSettings(const PAGE_INFO &aPageSettings)
wxRadioBox * m_ModeColorOption
bool CreateSVGFile(const wxString &FullFileName)
PLOTTER * StartPlotBoard(BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aFullFileName, const wxString &aSheetDesc)
Open a new plotfile using the options (and especially the format) specified in the options and prepar...
wxCheckBox * m_printMirrorOpt
void SetMirror(bool aFlag)
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
LSEQ SeqStackupBottom2Top() const
Return the sequence that is typical for a bottom-to-top stack-up.
void SetDrillMarksType(DrillMarksType aVal)
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
A pure virtual class used to derive REPORTER objects from.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
const wxString & GetFileName() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
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.
Board plot function definition file.
void onPagePerLayerClicked(wxCommandEvent &event) override
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
virtual bool EndPlot() override
void SetPlotFrameRef(bool aFlag)
DIALOG_EXPORT_SVG m_ExportSvg
LSET is a set of PCB_LAYER_IDs.
wxCheckListBox * m_TechnicalLayersList
void SetAuxOrigin(const wxPoint &aOrigin)
DIALOG_EXPORT_SVG(PCB_EDIT_FRAME *aParent, BOARD *aBoard)
wxBitmapButton * m_browseButton
void OnButtonPlot(wxCommandEvent &event) override
void SetColorSettings(COLOR_SETTINGS *aSettings)
const wxPoint GetOrigin() const
Describe the page size and margins of a paper page on which to eventually print or plot.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.
wxRadioBox * m_rbSvgPageSizeOpt
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
void SetSkipPlotNPTH_Pads(bool aSkip)
Definition of file extensions used in Kicad.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
LSET getCheckBoxSelectedLayers() const
void SetFormat(PLOT_FORMAT aFormat)
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Parameters and options when plotting/printing a board.
void SetHeightMils(int aHeightInMils)
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
Plotting engines similar to ps (PostScript, Gerber, svg)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
Class DIALOG_EXPORT_SVG_BASE.
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
~DIALOG_EXPORT_SVG() override
wxStdDialogButtonSizer * m_sdbSizer1
const wxPoint & GetAuxOrigin()
Information pertinent to a Pcbnew printed circuit board.
PCB_LAYER_ID
A quick note on layer IDs:
WX_HTML_REPORT_PANEL * m_messagesPanel
void SetWidthMils(int aWidthInMils)
Handle the component boundary box.
The main frame for Pcbnew.
PCBNEW_SETTINGS * GetPcbNewSettings() const
const std::string SVGFileExtension
bool InvokeExportSVG(PCB_EDIT_FRAME *aCaller, BOARD *aBoard)
Function InvokeExportSVG shows the Export SVG dialog.
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
PCB_EDIT_FRAME * m_parent
wxCheckBox * m_checkboxPagePerLayer
void ExportSVGFile(bool aOnlyOneFile)
std::vector< int > layers
void SetFileName(const wxString &aReportFileName)
bool ResolveTextVar(wxString *token, int aDepth) const
std::pair< wxCheckListBox *, int > m_boxSelectLayer[PCB_LAYER_ID_COUNT]
wxButton * m_sdbSizer1Cancel
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
wxString m_ColorTheme
Active color theme name.