KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_plot.h
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <board.h>
21#include <dialog_plot_base.h>
22#include <pcb_plot_params.h>
23#include <widgets/unit_binder.h>
24
25// the plot dialog window name, used by wxWidgets
26#define DLG_WINDOW_NAME wxT( "plot_dialog-window" )
27
28class wxRearrangeList;
29class wxBitmapButton;
30class COLOR_SETTINGS;
31
33
38{
39public:
40 DIALOG_PLOT( PCB_EDIT_FRAME* aEditFrame );
41 DIALOG_PLOT( PCB_EDIT_FRAME* aEditFrame, wxWindow* aParent, JOB_EXPORT_PCB_PLOT* aJob = nullptr );
42
43 virtual ~DIALOG_PLOT();
44
45 bool TransferDataToWindow() override;
46
47private:
48 // Event called functions
49 void Plot( wxCommandEvent& event ) override;
50 void onOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
51 void OnRightClickLayers( wxMouseEvent& event );
52 void OnRightClickAllLayers( wxMouseEvent& event );
53 void SetPlotFormat( wxCommandEvent& event ) override;
54 void OnChangeDXFPlotMode( wxCommandEvent& event ) override;
55 void CreateDrillFile( wxCommandEvent& event ) override;
56 void OnGerberX2Checked( wxCommandEvent& event ) override;
57 void onRunDRC( wxCommandEvent& event ) override;
58 void onOpenOutputDirectory( wxCommandEvent& event ) override;
59 void onBoardSetup( wxHyperlinkEvent& aEvent ) override;
60
61 void onPlotAllListMoveUp( wxCommandEvent& aEvent );
62 void onPlotAllListMoveDown( wxCommandEvent& aEvent );
63
64 void onLayerToggled( wxCommandEvent& event ) override;
65 void onAllCopperLayers( wxCommandEvent& event ) override;
66 void onDNPCheckbox( wxCommandEvent& event ) override;
67 void onSketchPads( wxCommandEvent& event ) override;
68 void onSVGColorChoice( wxCommandEvent& event ) override;
69 void onPDFColorChoice( wxCommandEvent& event ) override;
70
71 // other functions
72 void reInitDialog(); // initialization after calling drill dialog
73 void applyPlotSettings();
75 wxString getSelectedVariant() const;
78
79 void arrangeAllLayersList( const LSEQ& aSeq );
81 void setColorThemeSelection( const wxString& aTheme );
88 bool allCopperLayersChecked() const;
90
91private:
93 LSEQ m_layerList; // List to hold CheckListBox layer numbers
94 double m_XScaleAdjust; // X scale factor adjust to compensate
95 // plotter X scaling error
96 double m_YScaleAdjust; // X scale factor adjust to compensate
97 // plotter Y scaling error
98 int m_PSWidthAdjust; // Global width correction for exact line width
99 // in postscript output.
100 // this is a correction factor for tracks width
101 // when plotted
102 int m_widthAdjustMinValue; // Global track width limits
103 int m_widthAdjustMaxValue; // tracks width will be "clipped" whenever the
104 // m_PSWidthAdjust to these limits.
106
108
110
111 wxRearrangeList* m_plotAllLayersList;
112
115
117
120};
Color settings are a bit different than most of the settings objects in that there can be more than o...
DIALOG_PLOT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Plot"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
bool formatUsesColorTheme()
void populateColorThemeSelector()
void onPDFColorChoice(wxCommandEvent &event) override
DIALOG_PLOT(PCB_EDIT_FRAME *aEditFrame)
COLOR_SETTINGS * getEditorColorSettings() const
void reInitDialog()
void OnRightClickLayers(wxMouseEvent &event)
static LSEQ s_lastAllLayersOrder
The plot on all layers ordering the last time the dialog was opened.
void onAllCopperLayers(wxCommandEvent &event) override
JOB_EXPORT_PCB_PLOT * m_job
PCB_PLOT_PARAMS m_plotOpts
STD_BITMAP_BUTTON * m_bpMoveUp
void onPlotAllListMoveUp(wxCommandEvent &aEvent)
void OnChangeDXFPlotMode(wxCommandEvent &event) override
int m_widthAdjustMinValue
UNIT_BINDER m_trackWidthCorrection
void onBoardSetup(wxHyperlinkEvent &aEvent) override
void OnRightClickAllLayers(wxMouseEvent &event)
void onSketchPads(wxCommandEvent &event) override
bool allCopperLayersChecked() const
void Plot(wxCommandEvent &event) override
void applyPlotSettings()
int m_PSWidthAdjust
Definition dialog_plot.h:98
wxString m_DRCWarningTemplate
wxRearrangeList * m_plotAllLayersList
bool TransferDataToWindow() override
void onPlotAllListMoveDown(wxCommandEvent &aEvent)
void onRunDRC(wxCommandEvent &event) override
void arrangeAllLayersList(const LSEQ &aSeq)
double m_YScaleAdjust
Definition dialog_plot.h:96
void checkAllCopperLayers()
void onOpenOutputDirectory(wxCommandEvent &event) override
void updatePdfColorOptions()
PCB_EDIT_FRAME * m_editFrame
Definition dialog_plot.h:92
virtual ~DIALOG_PLOT()
void updateColorThemeControl()
STD_BITMAP_BUTTON * m_bpMoveDown
void syncAllCopperLayers()
void onLayerToggled(wxCommandEvent &event) override
void updateJobOutputLabel()
COLOR_SETTINGS * getColorSettings() const
wxString getSelectedVariant() const
void CreateDrillFile(wxCommandEvent &event) override
void onSVGColorChoice(wxCommandEvent &event) override
void onDNPCheckbox(wxCommandEvent &event) override
double m_XScaleAdjust
Definition dialog_plot.h:94
PLOT_FORMAT getPlotFormat()
void transferPlotParamsToJob()
int m_widthAdjustMaxValue
void onOutputDirectoryBrowseClicked(wxCommandEvent &event) override
void OnGerberX2Checked(wxCommandEvent &event) override
void setColorThemeSelection(const wxString &aTheme)
void SetPlotFormat(wxCommandEvent &event) override
LSEQ m_layerList
Definition dialog_plot.h:93
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition lseq.h:47
The main frame for Pcbnew.
Parameters and options when plotting/printing a board.
A bitmap button widget that behaves like a standard dialog button except with an icon.
PLOT_FORMAT
The set of supported output plot formats.
Definition plotter.h:65