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 { SCH_PLOT_FORMAT::HPGL, "hpgl" },
35 { SCH_PLOT_FORMAT::PDF, "pdf" },
36 { SCH_PLOT_FORMAT::POST, "post" },
37 { SCH_PLOT_FORMAT::SVG, "svg" },
38 { SCH_PLOT_FORMAT::DXF, "dxf" },
39 } )
40
41JOB_EXPORT_SCH_PLOT::JOB_EXPORT_SCH_PLOT( bool aOutputIsDirectory ) :
42 JOB( "plot", aOutputIsDirectory ),
43 m_plotFormat( SCH_PLOT_FORMAT::PDF ),
44 m_filename(),
45 m_drawingSheet(),
46 m_plotAll( true ),
47 m_plotDrawingSheet( true ),
48 m_show_hop_over( false ),
49 m_blackAndWhite( false ),
50 m_pageSizeSelect( JOB_PAGE_SIZE::PAGE_SIZE_AUTO ),
51 m_useBackgroundColor( true ),
52 m_minPenWidth( 847 /* hairline @ 300dpi */ ),
53 m_PDFPropertyPopups( true ),
54 m_PDFHierarchicalLinks( true ),
55 m_PDFMetadata( true ),
56 m_theme()
57{
58 m_params.emplace_back( new JOB_PARAM<SCH_PLOT_FORMAT>( "format",
59 &m_plotFormat, m_plotFormat ) );
60
61 m_params.emplace_back( new JOB_PARAM<wxString>( "drawing_sheet",
62 &m_drawingSheet, m_drawingSheet ) );
63
64 m_params.emplace_back( new JOB_PARAM<bool>( "plot_all",
65 &m_plotAll, m_plotAll ) );
66
67 m_params.emplace_back( new JOB_PARAM<bool>( "plot_drawing_sheet",
68 &m_plotDrawingSheet, m_plotDrawingSheet ) );
69
70 m_params.emplace_back( new JOB_PARAM<bool>( "black_and_white",
71 &m_blackAndWhite, m_blackAndWhite ) );
72
73 m_params.emplace_back( new JOB_PARAM<bool>( "show_hop_over",
74 &m_show_hop_over, m_show_hop_over ) );
75
76 m_params.emplace_back( new JOB_PARAM<JOB_PAGE_SIZE>( "page_size",
77 &m_pageSizeSelect, m_pageSizeSelect ) );
78
79 m_params.emplace_back( new JOB_PARAM<bool>( "use_background_color",
80 &m_useBackgroundColor, m_useBackgroundColor ) );
81
82 m_params.emplace_back( new JOB_PARAM<int>( "min_pen_width",
83 &m_minPenWidth, m_minPenWidth ) );
84
85 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_property_popups",
86 &m_PDFPropertyPopups, m_PDFPropertyPopups ) );
87
88 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_hierarchical_links",
89 &m_PDFHierarchicalLinks, m_PDFHierarchicalLinks ) );
90
91 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_metadata",
92 &m_PDFMetadata, m_PDFMetadata ) );
93
94 m_params.emplace_back( new JOB_PARAM<wxString>( "color_theme",
95 &m_theme, m_theme ) );
96}
97
98
99JOB_EXPORT_SCH_PLOT_PDF::JOB_EXPORT_SCH_PLOT_PDF( bool aOutputIsDirectory ) :
100 JOB_EXPORT_SCH_PLOT( aOutputIsDirectory )
101{
102 m_plotFormat = SCH_PLOT_FORMAT::PDF;
103}
104
105
107{
108 return _( "Export PDF" );
109}
110
111
113{
114 return _( "Export PDF Job Settings" );
115}
116
117
118JOB_EXPORT_SCH_PLOT_DXF ::JOB_EXPORT_SCH_PLOT_DXF () :
119 JOB_EXPORT_SCH_PLOT( true )
120{
121 m_plotFormat = SCH_PLOT_FORMAT::DXF;
122}
123
124
126{
127 return _( "Export DXF" );
128}
129
130
132{
133 return _( "Export DXF Job Settings" );
134}
135
136
138 JOB_EXPORT_SCH_PLOT( true )
139{
140 m_plotFormat = SCH_PLOT_FORMAT::SVG;
141}
142
143
145{
146 return _( "Export SVG" );
147}
148
149
151{
152 return _( "Export SVG Job Settings" );
153}
154
155
157 JOB_EXPORT_SCH_PLOT( true )
158{
159 m_plotFormat = SCH_PLOT_FORMAT::POST;
160}
161
162
164{
165 return _( "Export Postscript" );
166}
167
168
170{
171 return _( "Export Postscript Job Settings" );
172}
173
174
176 JOB_EXPORT_SCH_PLOT( true )
177{
178 m_plotFormat = SCH_PLOT_FORMAT::HPGL;
179}
180
181
183{
184 return _( "Export HPGL" );
185}
186
187
188REGISTER_JOB( sch_export_plot_svg, _HKI( "Schematic: Export SVG" ), KIWAY::FACE_SCH,
190REGISTER_DEPRECATED_JOB( sch_export_plot_hpgl, _HKI( "Schematic: Export HPGL" ), KIWAY::FACE_SCH,
192REGISTER_JOB( sch_export_plot_ps, _HKI( "Schematic: Export Postscript" ), KIWAY::FACE_SCH,
194REGISTER_JOB( sch_export_plot_dxf, _HKI( "Schematic: Export DXF" ), KIWAY::FACE_SCH,
196REGISTER_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 GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
JOB_EXPORT_SCH_PLOT_PDF(bool aOutputIsDirectory=true)
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
JOB_EXPORT_SCH_PLOT(bool aOutputIsDirectory)
An simple container class that lets us dispatch output jobs to kifaces.
Definition job.h:183
@ FACE_SCH
eeschema DSO
Definition kiway.h:293
#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(SCH_PLOT_FORMAT
SCH_PLOT_FORMAT
#define REGISTER_JOB(job_name, title, face, T)
#define REGISTER_DEPRECATED_JOB(job_name, title, face, T)
#define _HKI(x)
Definition page_info.cpp:44
@ PAGE_SIZE_AUTO
Definition sch_plotter.h:48