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 (C) 1992-2023 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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <board.h>
25#include <dialog_plot_base.h>
26#include <pcb_plot_params.h>
27#include <widgets/unit_binder.h>
28
29// the plot dialog window name, used by wxWidgets
30#define DLG_WINDOW_NAME wxT( "plot_dialog-window" )
31
32class wxRearrangeList;
33class wxBitmapButton;
34
36
41{
42public:
43 DIALOG_PLOT( PCB_EDIT_FRAME* aEditFrame );
44 DIALOG_PLOT( PCB_EDIT_FRAME* aEditFrame, wxWindow* aParent,
45 JOB_EXPORT_PCB_PLOT* aJob = nullptr );
46
47 virtual ~DIALOG_PLOT();
48
49private:
50
51 // Event called functions
52 void Plot( wxCommandEvent& event ) override;
53 void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
54 void OnRightClickLayers( wxMouseEvent& event );
55 void OnRightClickAllLayers( wxMouseEvent& event );
56 void SetPlotFormat( wxCommandEvent& event ) override;
57 void OnChangeDXFPlotMode( wxCommandEvent& event ) override;
58 void OnSetScaleOpt( wxCommandEvent& event ) override;
59 void CreateDrillFile( wxCommandEvent& event ) override;
60 void OnGerberX2Checked( wxCommandEvent& event ) override;
61 void onRunDRC( wxCommandEvent& event ) override;
62 void onOpenOutputDirectory( wxCommandEvent& event ) override;
63 void onBoardSetup( wxHyperlinkEvent& aEvent ) override;
64
65 void onPlotAllListMoveUp( wxCommandEvent& aEvent );
66 void onPlotAllListMoveDown( wxCommandEvent& aEvent );
67
68 void onDNPCheckbox( wxCommandEvent& event ) override;
69 void onSketchPads( wxCommandEvent& event ) override;
70
71 // other functions
72 void init_Dialog(); // main initialization
73 void reInitDialog(); // initialization after calling drill dialog
74 void applyPlotSettings();
76
78 {
79 m_plotModeOpt->SetSelection( aPlotMode == SKETCH ? 1 : 0 );
80 }
81
82 void arrangeAllLayersList( const LSEQ& aSeq );
85
86private:
88 LSEQ m_layerList; // List to hold CheckListBox layer numbers
89 double m_XScaleAdjust; // X scale factor adjust to compensate
90 // plotter X scaling error
91 double m_YScaleAdjust; // X scale factor adjust to compensate
92 // plotter Y scaling error
93 int m_PSWidthAdjust; // Global width correction for exact line width
94 // in postscript output.
95 // this is a correction factor for tracks width
96 // when plotted
97 int m_widthAdjustMinValue; // Global track width limits
98 int m_widthAdjustMaxValue; // tracks width will be "clipped" whenever the
99 // m_PSWidthAdjust to these limits.
102
104
106
107 wxRearrangeList* m_plotAllLayersList;
108
111
113
117
120};
Class DIALOG_PLOT_BASE.
wxChoice * m_plotModeOpt
A dialog to set the plot options and create plot files in various formats.
Definition: dialog_plot.h:41
void loadPlotParamsFromJob()
static LSET s_lastAllLayersSet
Definition: dialog_plot.h:116
void reInitDialog()
void OnRightClickLayers(wxMouseEvent &event)
static LSEQ s_lastAllLayersOrder
The plot on all layers ordering the last time the dialog was opened.
Definition: dialog_plot.h:119
JOB_EXPORT_PCB_PLOT * m_job
Definition: dialog_plot.h:112
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:105
STD_BITMAP_BUTTON * m_bpMoveUp
Definition: dialog_plot.h:109
void onPlotAllListMoveUp(wxCommandEvent &aEvent)
void OnChangeDXFPlotMode(wxCommandEvent &event) override
int m_widthAdjustMinValue
Definition: dialog_plot.h:97
UNIT_BINDER m_trackWidthCorrection
Definition: dialog_plot.h:101
void onBoardSetup(wxHyperlinkEvent &aEvent) override
void OnRightClickAllLayers(wxMouseEvent &event)
void onSketchPads(wxCommandEvent &event) override
void Plot(wxCommandEvent &event) override
void applyPlotSettings()
int m_PSWidthAdjust
Definition: dialog_plot.h:93
wxString m_DRCWarningTemplate
Definition: dialog_plot.h:103
void setPlotModeChoiceSelection(OUTLINE_MODE aPlotMode)
Definition: dialog_plot.h:77
void OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
wxRearrangeList * m_plotAllLayersList
Definition: dialog_plot.h:107
void onPlotAllListMoveDown(wxCommandEvent &aEvent)
void onRunDRC(wxCommandEvent &event) override
void arrangeAllLayersList(const LSEQ &aSeq)
double m_YScaleAdjust
Definition: dialog_plot.h:91
void onOpenOutputDirectory(wxCommandEvent &event) override
void OnSetScaleOpt(wxCommandEvent &event) override
PCB_EDIT_FRAME * m_editFrame
Definition: dialog_plot.h:87
virtual ~DIALOG_PLOT()
STD_BITMAP_BUTTON * m_bpMoveDown
Definition: dialog_plot.h:110
void CreateDrillFile(wxCommandEvent &event) override
void onDNPCheckbox(wxCommandEvent &event) override
UNIT_BINDER m_defaultPenSize
Definition: dialog_plot.h:100
double m_XScaleAdjust
Definition: dialog_plot.h:89
PLOT_FORMAT getPlotFormat()
static LSET s_lastLayerSet
The plot layer set that last time the dialog was opened.
Definition: dialog_plot.h:115
void transferPlotParamsToJob()
int m_widthAdjustMaxValue
Definition: dialog_plot.h:98
void OnGerberX2Checked(wxCommandEvent &event) override
void init_Dialog()
void SetPlotFormat(wxCommandEvent &event) override
LSEQ m_layerList
Definition: dialog_plot.h:88
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: lseq.h:47
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:36
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.
OUTLINE_MODE
Definition: outline_mode.h:25
@ SKETCH
Definition: outline_mode.h:26
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:65