55 GetSizer()->Fit(
this );
56 GetSizer()->SetSizeHints(
this );
222 wxCommandEvent cmd_event;
243 event.SetId( wxID_CANCEL );
253 event.SetId( wxID_OK );
271 switch( event.GetId() )
346 bool scale1 = (
m_scaleOpt->GetSelection() == 1 );
362 wxDirDialog dirDialog(
this, _(
"Select Output Directory" ), path );
364 if( dirDialog.ShowModal() == wxID_CANCEL )
367 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
370 wxString defaultPath = fn.GetPathWithSep();
372 msg.Printf( _(
"Do you want to use a path relative to\n\"%s\"" ),
375 wxMessageDialog dialog(
this, msg, _(
"Plot Output Directory" ),
376 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
378 if( dialog.ShowModal() == wxID_YES )
380 if( !dirName.MakeRelativeTo( defaultPath ) )
381 wxMessageBox( _(
"Cannot make path relative (target volume different from file volume)!" ),
382 _(
"Plot Output Directory" ), wxOK | wxICON_ERROR );
554 static bool setDouble(
double* aResult,
double aValue,
double aMin,
double aMax )
561 else if( aValue > aMax )
572 static bool setInt(
int* aResult,
int aValue,
int aMin,
int aMax )
579 else if( aValue > aMax )
629 msg.Printf( _(
"HPGL pen size constrained." ) );
641 msg.Printf( _(
"Default line width constrained." ) );
648 msg.ToDouble( &tmpDouble );
654 msg.Printf( _(
"X scale constrained." ) );
662 msg.ToDouble( &tmpDouble );
668 msg.Printf( _(
"Y scale constrained." ) );
682 msg.Printf( _(
"Width correction constrained. " 683 "The reasonable width correction value must be in a range of " 684 " [%+f; %+f] (%s) for current design rules." ),
714 selectedLayers = selectedLayers | disabledCopperLayers;
723 dirStr.Replace( wxT(
"\\" ), wxT(
"/" ) );
766 DisplayError(
this, _(
"No layer selected, Nothing to plot" ) );
779 msg.Printf( _(
"Could not write plot files to folder \"%s\"." ),
831 _(
"Warning: Scale option set to a very small value" ) );
835 _(
"Warning: Scale option set to a very large value" ) );
858 wxFileName fn( boardFilename );
866 wxString fullname = fn.GetFullName();
882 msg.Printf( _(
"Plot file \"%s\" created." ),
GetChars( fn.GetFullPath() ) );
887 msg.Printf( _(
"Unable to create file \"%s\"." ),
GetChars( fn.GetFullPath() ) );
895 wxFileName fn( boardFilename );
void SetTextMode(PlotTextMode aVal)
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
void SetUseGerberProtelExtensions(bool aUse)
void SetPlotReference(bool aFlag)
void SetExcludeEdgeLayer(bool aFlag)
bool GetUseGerberProtelExtensions() const
WX_HTML_REPORT_PANEL * m_messagesPanel
wxStaticBoxSizer * m_HPGLOptionsSizer
void SetScaleSelection(int aSelection)
wxStaticText * m_textPSFineAdjustWidth
void SetIncludeGerberNetlistInfo(bool aUse)
int m_SolderMaskMargin
Solder mask margin.
void SetDXFPlotPolygonMode(bool aFlag)
wxTextCtrl * m_linesWidth
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
bool GetSubtractMaskFromSilk() const
wxTextCtrl * m_fineAdjustYscaleOpt
int GetHPGLPenDiameter() const
wxCheckBox * m_useGerberExtensions
void DestroyDRCDialog(int aReason)
Deletes this ui dialog box and zeros out its pointer to remember the state of the dialog's existence...
void SetGerberPrecision(int aPrecision)
void OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
void SetPlotViaOnMaskLayer(bool aFlag)
bool CreateJobFile(const wxString &aFullFilename)
Creates a Gerber job file.
wxStaticText * m_SolderMaskMarginCurrValue
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Class LOCALE_IO is a class that can be instantiated within a scope in which you are expecting excepti...
#define OPTKEY_PLOT_Y_FINESCALE_ADJ
void SetLayerSelection(LSET aSelection)
void OnGerberX2Checked(wxCommandEvent &event) override
void SetUseAuxOrigin(bool aAux)
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
int GetSmallestClearanceValue()
Function GetSmallestClearanceValue.
bool GetUseGerberAttributes() const
wxStaticText * m_textPenSize
void OnChangeDXFPlotMode(wxCommandEvent &event) override
void PlotOneBoardLayer(BOARD *aBoard, PLOTTER *aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotOneBoardLayer main function to plot one copper or technical layer.
wxCheckBox * m_plotPSNegativeOpt
Class BOARD to handle a board.
wxRadioBox * m_rbGerberFormat
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
void SetFormat(PlotFormat aFormat)
PlotFormat getPlotFormat()
wxString GetDefaultPlotExtension(PlotFormat aFormat)
Returns the default plot extension for a format.
wxCheckBox * m_excludeEdgeLayerOpt
void SetCreateGerberJobFile(bool aCreate)
void onRunDRC(wxCommandEvent &event) override
void SetMirror(bool aFlag)
const wxString GetGerberProtelExtension(LAYER_NUM aLayer)
Function GetGerberProtelExtension.
PlotFormat
Enum PlotFormat is the set of supported output plot formats.
wxCheckBox * m_plotMirrorOpt
bool GetUseAuxOrigin() const
void SetDrillMarksType(DrillMarksType aVal)
Class REPORTER is a pure virtual class used to derive REPORTER objects from.
LSET GetLayerSelection() const
wxChoice * m_plotFormatOpt
static LSET AllTechMask()
Function AllTechMask returns a mask holding all technical layers (no CU layer) on both side...
void CreateDrillFile(wxCommandEvent &event) override
Classes used to generate a Gerber job file in JSON.
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
wxStaticBoxSizer * m_SizerDXF_options
bool GetPlotValue() const
wxCheckBox * m_useGerberX2Attributes
virtual const PCB_PLOT_PARAMS & GetPlotSettings() const
Function GetPlotSettings returns the PCB_PLOT_PARAMS for the BOARD owned by this frame.
void SetA4Output(int aForce)
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
bool SetHPGLPenDiameter(int aValue)
wxCheckBox * m_DXF_plotModeOpt
bool SetLineWidth(int aValue)
This file contains miscellaneous commonly used macros and functions.
void SetPlotValue(bool aFlag)
bool GetExcludeEdgeLayer() const
Board plot function definition file.
wxCheckBox * m_plotSheetRef
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
void SetPlotFrameRef(bool aFlag)
wxString GetOutputDirectory() const
void SetPlotFormat(wxCommandEvent &event) override
void Plot(wxCommandEvent &event) override
wxTextCtrl * m_PSFineAdjustWidthOpt
DrillMarksType GetDrillMarksType() const
PCB_LAYER_ID
A quick note on layer IDs:
GERBER_JOBFILE_WRITER is a class used to create Gerber job file a Gerber job file stores info to make...
bool GetIncludeGerberNetlistInfo() const
Class LSET is a set of PCB_LAYER_IDs.
#define OPTKEY_PLOT_X_FINESCALE_ADJ
PCB_EDIT_FRAME * m_parent
int m_widthAdjustMaxValue
wxStaticText * m_SolderMaskMinWidthCurrValue
const wxString & GetFileName() const
PlotTextMode GetTextMode() const
int m_TrackMinWidth
track min value for width ((min copper size value
static bool setDouble(double *aResult, double aValue, double aMin, double aMax)
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Helper function EnsureFileDirectoryExists make aTargetFullFileName absolute and creates the path of t...
REPORTER & Reporter()
returns the reporter object that reports to this panel
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
VTBL_ENTRY const wxString AbsolutePath(const wxString &aFileName) const
Function AbsolutePath fixes up aFileName if it is relative to the project's directory to be an absolu...
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
wxCheckBox * m_forcePSA4OutputOpt
void OnPopUpLayers(wxCommandEvent &event) override
void SetSubtractMaskFromSilk(bool aSubtract)
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
void AddGbrFile(PCB_LAYER_ID aLayer, wxString &aFilename)
add a gerber file name and type in job file list
#define CONFIG_PS_FINEWIDTH_ADJ
void setPlotModeChoiceSelection(EDA_DRAW_MODE_T aPlotMode)
wxConfigBase * KifaceSettings() const
bool GetPlotViaOnMaskLayer() const
int GetScaleSelection() const
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
void OnSetScaleOpt(wxCommandEvent &event) override
wxStaticBoxSizer * m_GerberOptionsSizer
bool GetCreateGerberJobFile() const
wxCheckBox * m_useGerberNetAttributes
void SetOutputDirectory(wxString aDir)
bool GetPlotReference() const
int m_widthAdjustMinValue
PlotFormat GetFormat() const
void SetUseGerberAttributes(bool aUse)
wxCheckBox * m_generateGerberJobFile
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board...
wxTextCtrl * m_outputDirectoryName
void SetPlotInvisibleText(bool aFlag)
bool IsSameAs(const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms) const
Compare current settings to aPcbPlotParams, including not saved parameters in brd file...
void SetScale(double aVal)
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
wxCheckBox * m_DXF_plotTextStrokeFontOpt
const wxString GerberJobFileExtension
PCB_PLOT_PARAMS m_plotOpts
void SetNegative(bool aFlag)
bool GetDXFPlotPolygonMode() const
EDA_UNITS_T g_UserUnit
Global variables definitions.
void SetFineScaleAdjustX(double aVal)
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Function BuildPlotFileName (helper function) Complete a plot filename: forces the output directory...
wxCheckBox * m_plotModuleRefOpt
void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
Function ConfigBaseWriteDouble This is a helper function to write doubles in config We cannot use wxC...
void SetPlotPadsOnSilkLayer(bool aFlag)
void SetPlotMode(EDA_DRAW_MODE_T aPlotMode)
Base plotter engine class.
wxCheckBox * m_subtractMaskFromSilk
wxCheckBox * m_plotNoViaOnMaskOpt
wxCheckBox * m_plotModuleValueOpt
void ShowDRCDialog(wxWindow *aParent=NULL)
Open a dialog and prompts the user, then if a test run button is clicked, runs the test(s) and create...
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
bool GetPlotInvisibleText() const
wxChoice * m_drillShapeOpt
void AddUnitSymbol(wxStaticText &Stext, EDA_UNITS_T aUnit)
Board layer functions and definitions.
wxTextCtrl * m_fineAdjustXscaleOpt
void SetWidthAdjust(int aVal)
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
static bool setInt(int *aResult, int aValue, int aMin, int aMax)
bool GetPlotFrameRef() const
wxTextCtrl * m_HPGLPenSizeOpt
wxCheckBox * m_plotInvisibleText
EDA_DRAW_MODE_T GetPlotMode() const
bool GetPlotPadsOnSilkLayer() const
wxCheckBox * m_useAuxOriginCheckBox
void SetAutoScale(bool aFlag)
void SetFineScaleAdjustY(double aVal)
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
double To_User_Unit(EDA_UNITS_T aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
wxCheckBox * m_excludePadsFromSilkscreen
void OnRightClick(wxMouseEvent &event) override
wxBitmapButton * m_browseButton
PLOTTER * StartPlotBoard(BOARD *aBoard, 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...
wxStaticText * m_textDefaultPenSize
void OnQuit(wxCommandEvent &event) override
wxCheckListBox * m_layerCheckListBox
wxStaticBoxSizer * m_PSOptionsSizer
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
void OnClose(wxCloseEvent &event) override
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
wxBoxSizer * m_PlotOptionsSizer
void InstallDrillFrame(wxCommandEvent &event)
DIALOG_PLOT(PCB_EDIT_FRAME *parent)
int m_SolderMaskMinWidth
Solder mask min width.
int GetGerberPrecision() const