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 m_variantNames()
58{
59 m_params.emplace_back( new JOB_PARAM<SCH_PLOT_FORMAT>( "format",
60 &m_plotFormat, m_plotFormat ) );
61
62 m_params.emplace_back( new JOB_PARAM<wxString>( "drawing_sheet",
63 &m_drawingSheet, m_drawingSheet ) );
64
65 m_params.emplace_back( new JOB_PARAM<bool>( "plot_all",
66 &m_plotAll, m_plotAll ) );
67
68 m_params.emplace_back( new JOB_PARAM<bool>( "plot_drawing_sheet",
69 &m_plotDrawingSheet, m_plotDrawingSheet ) );
70
71 m_params.emplace_back( new JOB_PARAM<bool>( "black_and_white",
72 &m_blackAndWhite, m_blackAndWhite ) );
73
74 m_params.emplace_back( new JOB_PARAM<bool>( "show_hop_over",
75 &m_show_hop_over, m_show_hop_over ) );
76
77 m_params.emplace_back( new JOB_PARAM<JOB_PAGE_SIZE>( "page_size",
78 &m_pageSizeSelect, m_pageSizeSelect ) );
79
80 m_params.emplace_back( new JOB_PARAM<bool>( "use_background_color",
81 &m_useBackgroundColor, m_useBackgroundColor ) );
82
83 m_params.emplace_back( new JOB_PARAM<int>( "min_pen_width",
84 &m_minPenWidth, m_minPenWidth ) );
85
86 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_property_popups",
87 &m_PDFPropertyPopups, m_PDFPropertyPopups ) );
88
89 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_hierarchical_links",
90 &m_PDFHierarchicalLinks, m_PDFHierarchicalLinks ) );
91
92 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_metadata",
93 &m_PDFMetadata, m_PDFMetadata ) );
94
95 m_params.emplace_back( new JOB_PARAM<wxString>( "color_theme",
96 &m_theme, m_theme ) );
97
98 m_params.emplace_back( new JOB_PARAM<wxString>( "variant_name", &m_variant, m_variant ) );
99}
100
101
102JOB_EXPORT_SCH_PLOT_PDF::JOB_EXPORT_SCH_PLOT_PDF( bool aOutputIsDirectory ) :
103 JOB_EXPORT_SCH_PLOT( aOutputIsDirectory )
104{
105 m_plotFormat = SCH_PLOT_FORMAT::PDF;
106}
107
108
110{
111 return _( "Export PDF" );
112}
113
114
116{
117 return _( "Export PDF Job Settings" );
118}
119
120
121JOB_EXPORT_SCH_PLOT_DXF ::JOB_EXPORT_SCH_PLOT_DXF () :
122 JOB_EXPORT_SCH_PLOT( true )
123{
124 m_plotFormat = SCH_PLOT_FORMAT::DXF;
125}
126
127
129{
130 return _( "Export DXF" );
131}
132
133
135{
136 return _( "Export DXF Job Settings" );
137}
138
139
141 JOB_EXPORT_SCH_PLOT( true )
142{
143 m_plotFormat = SCH_PLOT_FORMAT::SVG;
144}
145
146
148{
149 return _( "Export SVG" );
150}
151
152
154{
155 return _( "Export SVG Job Settings" );
156}
157
158
160 JOB_EXPORT_SCH_PLOT( true )
161{
162 m_plotFormat = SCH_PLOT_FORMAT::POST;
163}
164
165
167{
168 return _( "Export Postscript" );
169}
170
171
173{
174 return _( "Export Postscript Job Settings" );
175}
176
177
179 JOB_EXPORT_SCH_PLOT( true )
180{
181 m_plotFormat = SCH_PLOT_FORMAT::HPGL;
182}
183
184
186{
187 return _( "Export HPGL" );
188}
189
190
191REGISTER_JOB( sch_export_plot_svg, _HKI( "Schematic: Export SVG" ), KIWAY::FACE_SCH,
193REGISTER_DEPRECATED_JOB( sch_export_plot_hpgl, _HKI( "Schematic: Export HPGL" ), KIWAY::FACE_SCH,
195REGISTER_JOB( sch_export_plot_ps, _HKI( "Schematic: Export Postscript" ), KIWAY::FACE_SCH,
197REGISTER_JOB( sch_export_plot_dxf, _HKI( "Schematic: Export DXF" ), KIWAY::FACE_SCH,
199REGISTER_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:301
#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