KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_plot_schematic.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-2018 Jean-Pierre Charras jp.charras at wanadoo.fr
5 * Copyright (C) 1992-2010 Lorenzo Marcantonio
6 * Copyright (C) 2011 Wayne Stambaugh <[email protected]>
7 * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
31#ifndef __DIALOG_PLOT_SCHEMATIC__
32#define __DIALOG_PLOT_SCHEMATIC__
33
34#include <plotters/plotter.h>
36#include <widgets/unit_binder.h>
37#include <sch_plotter.h>
38
39class PDF_PLOTTER;
40class SCH_REPORTER;
41class SCH_EDIT_FRAME;
42class SCH_SCREEN;
43class SCH_SHEET_PATH;
44
46
48{
49public:
51 DIALOG_PLOT_SCHEMATIC( SCH_EDIT_FRAME* aEditFrame, wxWindow* aParent, JOB_EXPORT_SCH_PLOT* aJob = nullptr );
52
57
58private:
59 void OnPageSizeSelected( wxCommandEvent& event ) override;
60 void OnPlotCurrent( wxCommandEvent& event ) override;
61 void OnPlotAll( wxCommandEvent& event ) override;
62 void OnUpdateUI( wxUpdateUIEvent& event ) override;
63
64 void initDlg();
65
66 // common
67 void getPlotOptions( RENDER_SETTINGS* aSettings );
68
69 bool getModeColor() { return m_ModeColorOption->GetSelection() == 0; }
70
71 void setModeColor( bool aColor ) { m_ModeColorOption->SetSelection( aColor ? 0 : 1 ); }
72
74
78 void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
79
81
82 bool getPlotDrawingSheet() { return m_plotDrawingSheet->GetValue(); }
83 void setPlotDrawingSheet( bool aPlot) { m_plotDrawingSheet->SetValue( aPlot ); }
84
85 bool getOpenFileAfterPlot() { return m_openFileAfterPlot->GetValue(); }
86 void setOpenFileAfterPlot( bool aOpenFileAfterPlot ) { m_openFileAfterPlot->SetValue( aOpenFileAfterPlot ); }
87
88 void setHpglPenWidth();
89
90 void plotSchematic( bool aPlotAll );
91
92 // HPGLGetPlotOriginAndUnits
94 {
95 switch( m_plotOriginOpt->GetSelection() )
96 {
97 case 0:
98 default: return HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_BOT_LEFT;
99 case 1: return HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_CENTER;
100 case 2: return HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_PAGE;
101 case 3: return HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_CONTENT;
102 }
103 }
104
106 {
107 switch( aOriginAndUnits )
108 {
109 case HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_BOT_LEFT:
110 default:
111 m_plotOriginOpt->SetSelection( 0 );
112 break;
113
114 case HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_CENTER:
115 m_plotOriginOpt->SetSelection( 1 );
116 break;
117
118 case HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_PAGE:
119 m_plotOriginOpt->SetSelection( 2 );
120 break;
121
122 case HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_CONTENT:
123 m_plotOriginOpt->SetSelection( 3 );
124 break;
125 }
126 }
127
128
145 wxString getOutputPath();
146
148 bool m_configChanged; // true if a project config param has changed
150 static int m_pageSizeSelect; // Static to keep last option for some format
151 static HPGL_PAGE_SIZE m_HPGLPaperSizeSelect; // for HPGL format only: last selected paper size
156};
157
158#endif // __DIALOG_PLOT_SCHEMATIC__
Color settings are a bit different than most of the settings objects in that there can be more than o...
Class DIALOG_PLOT_SCHEMATIC_BASE.
void OnPageSizeSelected(wxCommandEvent &event) override
void OnPlotAll(wxCommandEvent &event) override
static HPGL_PAGE_SIZE m_HPGLPaperSizeSelect
void OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
Set the m_outputDirectoryName variable to the selected directory from directory dialog.
void OnPlotCurrent(wxCommandEvent &event) override
void setPlotOriginAndUnits(HPGL_PLOT_ORIGIN_AND_UNITS aOriginAndUnits)
HPGL_PLOT_ORIGIN_AND_UNITS getPlotOriginAndUnits()
void setModeColor(bool aColor)
void setPlotDrawingSheet(bool aPlot)
void setOpenFileAfterPlot(bool aOpenFileAfterPlot)
JOB_EXPORT_SCH_PLOT * m_job
bool PrjConfigChanged()
Return true if the project configuration was modified.
void getPlotOptions(RENDER_SETTINGS *aSettings)
COLOR_SETTINGS * getColorSettings()
void plotSchematic(bool aPlotAll)
void OnUpdateUI(wxUpdateUIEvent &event) override
wxString getOutputPath()
Determine the best absolute path to plot files given the contents of the path edit control.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Schematic editor (Eeschema) main window.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:65
HPGL_PAGE_SIZE
Definition: sch_plotter.h:64
HPGL_PLOT_ORIGIN_AND_UNITS
Definition: sch_plotter.h:47