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
45
47{
48public:
50
55
56private:
57 void OnPageSizeSelected( wxCommandEvent& event ) override;
58 void OnPlotCurrent( wxCommandEvent& event ) override;
59 void OnPlotAll( wxCommandEvent& event ) override;
60 void OnUpdateUI( wxUpdateUIEvent& event ) override;
61
62 void initDlg();
63
64 // common
65 void getPlotOptions( RENDER_SETTINGS* aSettings );
66
67 bool getModeColor() { return m_ModeColorOption->GetSelection() == 0; }
68
69 void setModeColor( bool aColor ) { m_ModeColorOption->SetSelection( aColor ? 0 : 1 ); }
70
72
76 void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
77
79
80 bool getPlotDrawingSheet() { return m_plotDrawingSheet->GetValue(); }
81 void setPlotDrawingSheet( bool aPlot) { m_plotDrawingSheet->SetValue( aPlot ); }
82
83 bool getOpenFileAfterPlot() { return m_openFileAfterPlot->GetValue(); }
84 void setOpenFileAfterPlot( bool aOpenFileAfterPlot ) { m_openFileAfterPlot->SetValue( aOpenFileAfterPlot ); }
85
86 void setHpglPenWidth();
87
88 void plotSchematic( bool aPlotAll );
89
90 // HPGLGetPlotOriginAndUnits
92 {
93 switch( m_plotOriginOpt->GetSelection() )
94 {
95 case 0:
96 default: return HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_BOT_LEFT;
97 case 1: return HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_CENTER;
98 case 2: return HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_PAGE;
99 case 3: return HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_CONTENT;
100 }
101 }
102
104 {
105 switch( aOriginAndUnits )
106 {
107 case HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_BOT_LEFT:
108 default:
109 m_plotOriginOpt->SetSelection( 0 );
110 break;
111
112 case HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_CENTER:
113 m_plotOriginOpt->SetSelection( 1 );
114 break;
115
116 case HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_PAGE:
117 m_plotOriginOpt->SetSelection( 2 );
118 break;
119
120 case HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_CONTENT:
121 m_plotOriginOpt->SetSelection( 3 );
122 break;
123 }
124 }
125
126
143 wxString getOutputPath();
144
146 bool m_configChanged; // true if a project config param has changed
148 static int m_pageSizeSelect; // Static to keep last option for some format
149 static HPGL_PAGE_SIZE m_HPGLPaperSizeSelect; // for HPGL format only: last selected paper size
153};
154
155#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)
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:64
HPGL_PAGE_SIZE
Definition: sch_plotter.h:64
HPGL_PLOT_ORIGIN_AND_UNITS
Definition: sch_plotter.h:47