KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_export_sch_plot.cpp
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) 2023 Mark Roszko <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
22#include <jobs/job_registry.h>
23#include <i18n_utility.h>
24
26 {
30 } )
31
33 {
34 { JOB_HPGL_PAGE_SIZE::DEFAULT, "default" },
46 } )
47
49 {
54 } )
55
57 {
58 { SCH_PLOT_FORMAT::HPGL, "hpgl" },
59 { SCH_PLOT_FORMAT::PDF, "pdf" },
60 { SCH_PLOT_FORMAT::POST, "post" },
61 { SCH_PLOT_FORMAT::SVG, "svg" },
62 { SCH_PLOT_FORMAT::DXF, "dxf" },
63 } )
64
65JOB_EXPORT_SCH_PLOT::JOB_EXPORT_SCH_PLOT( bool aOutputIsDirectory ) :
66 JOB( "plot", aOutputIsDirectory ),
67 m_plotFormat( SCH_PLOT_FORMAT::PDF ),
68 m_filename(),
69 m_drawingSheet(),
70 m_plotAll( true ),
71 m_plotDrawingSheet( true ),
72 m_blackAndWhite( false ),
73 m_pageSizeSelect( JOB_PAGE_SIZE::PAGE_SIZE_AUTO ),
74 m_useBackgroundColor( true ),
75 m_HPGLPenSize( 1.0 ),
76 m_HPGLPaperSizeSelect( JOB_HPGL_PAGE_SIZE::DEFAULT ),
77 m_PDFPropertyPopups( true ),
78 m_PDFHierarchicalLinks( true ),
79 m_PDFMetadata( true ),
80 m_theme(),
82{
83 m_params.emplace_back( new JOB_PARAM<SCH_PLOT_FORMAT>( "format",
84 &m_plotFormat, m_plotFormat ) );
85
86 m_params.emplace_back( new JOB_PARAM<wxString>( "drawing_sheet",
87 &m_drawingSheet, m_drawingSheet ) );
88
89 m_params.emplace_back( new JOB_PARAM<bool>( "plot_all",
90 &m_plotAll, m_plotAll ) );
91
92 m_params.emplace_back( new JOB_PARAM<bool>( "plot_drawing_sheet",
93 &m_plotDrawingSheet, m_plotDrawingSheet ) );
94
95 m_params.emplace_back( new JOB_PARAM<bool>( "black_and_white",
96 &m_blackAndWhite, m_blackAndWhite ) );
97
98 m_params.emplace_back( new JOB_PARAM<JOB_PAGE_SIZE>( "page_size",
99 &m_pageSizeSelect, m_pageSizeSelect ) );
100
101 m_params.emplace_back( new JOB_PARAM<bool>( "use_background_color",
102 &m_useBackgroundColor, m_useBackgroundColor ) );
103
104 m_params.emplace_back( new JOB_PARAM<double>( "hpgl_pen_size",
105 &m_HPGLPenSize, m_HPGLPenSize ) );
106
107 m_params.emplace_back( new JOB_PARAM<JOB_HPGL_PAGE_SIZE>( "hpgl_page_size",
108 &m_HPGLPaperSizeSelect, m_HPGLPaperSizeSelect ) );
109
110 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_property_popups",
111 &m_PDFPropertyPopups, m_PDFPropertyPopups ) );
112
113 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_hierarchical_links",
114 &m_PDFHierarchicalLinks, m_PDFHierarchicalLinks ) );
115
116 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_metadata",
117 &m_PDFMetadata, m_PDFMetadata ) );
118
119 m_params.emplace_back( new JOB_PARAM<wxString>( "color_theme",
120 &m_theme, m_theme ) );
121
122 m_params.emplace_back( new JOB_PARAM<JOB_HPGL_PLOT_ORIGIN_AND_UNITS>( "hpgl_plot_origin",
123 &m_HPGLPlotOrigin, m_HPGLPlotOrigin ) );
124
125}
126
127
129 JOB_EXPORT_SCH_PLOT( false )
130{
131 m_plotFormat = SCH_PLOT_FORMAT::PDF;
132}
133
134
136{
137 return _( "Export PDF" );
138}
139
140
142{
143 return _( "Export PDF Job Settings" );
144}
145
146
147JOB_EXPORT_SCH_PLOT_DXF ::JOB_EXPORT_SCH_PLOT_DXF () :
148 JOB_EXPORT_SCH_PLOT( true )
149{
150 m_plotFormat = SCH_PLOT_FORMAT::DXF;
151}
152
153
155{
156 return _( "Export DXF" );
157}
158
159
161{
162 return _( "Export DXF Job Settings" );
163}
164
165
167 JOB_EXPORT_SCH_PLOT( true )
168{
169 m_plotFormat = SCH_PLOT_FORMAT::SVG;
170}
171
172
174{
175 return _( "Export SVG" );
176}
177
178
180{
181 return _( "Export SVG Job Settings" );
182}
183
184
186 JOB_EXPORT_SCH_PLOT( true )
187{
188 m_plotFormat = SCH_PLOT_FORMAT::POST;
189}
190
191
193{
194 return _( "Export Postscript" );
195}
196
197
199{
200 return _( "Export Postscript Job Settings" );
201}
202
203
205 JOB_EXPORT_SCH_PLOT( true )
206{
207 m_plotFormat = SCH_PLOT_FORMAT::HPGL;
208}
209
210
212{
213 return _( "Export HPGL" );
214}
215
216
218{
219 return _( "Export HPGL Job Settings" );
220}
221
222
223REGISTER_JOB( sch_export_plot_svg, _HKI( "Schematic: Export SVG" ), KIWAY::FACE_SCH,
225REGISTER_JOB( sch_export_plot_hpgl, _HKI( "Schematic: Export HPGL" ), KIWAY::FACE_SCH,
227REGISTER_JOB( sch_export_plot_ps, _HKI( "Schematic: Export Postscript" ), KIWAY::FACE_SCH,
229REGISTER_JOB( sch_export_plot_dxf, _HKI( "Schematic: Export DXF" ), KIWAY::FACE_SCH,
231REGISTER_JOB( sch_export_plot_pdf, _HKI( "Schematic: Export PDF" ), KIWAY::FACE_SCH,
wxString GetSettingsDialogTitle() const override
wxString GetDefaultDescription() const override
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
JOB_EXPORT_SCH_PLOT(bool aOutputIsDirectory)
Definition: job.h:50
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:182
@ FACE_SCH
eeschema DSO
Definition: kiway.h:292
#define _HKI(x)
#define _(s)
Some functions to handle hotkeys in KiCad.
NLOHMANN_JSON_SERIALIZE_ENUM(JOB_PAGE_SIZE, { { JOB_PAGE_SIZE::PAGE_SIZE_AUTO, "auto" }, { JOB_PAGE_SIZE::PAGE_SIZE_A4, "A4" }, { JOB_PAGE_SIZE::PAGE_SIZE_A, "A" }, }) NLOHMANN_JSON_SERIALIZE_ENUM(JOB_HPGL_PAGE_SIZE
SCH_PLOT_FORMAT
JOB_PAGE_SIZE
JOB_HPGL_PLOT_ORIGIN_AND_UNITS
JOB_HPGL_PAGE_SIZE
#define REGISTER_JOB(job_name, title, face, T)
Definition: job_registry.h:64
@ PAGE_SIZE_AUTO
Definition: sch_plotter.h:57