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 (C) 2023 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::GERBER, "gerber" },
61 { SCH_PLOT_FORMAT::POST, "post" },
62 { SCH_PLOT_FORMAT::SVG, "svg" },
63 { SCH_PLOT_FORMAT::DXF, "dxf" },
64 } )
65
67 JOB( "plot", false ),
68 m_plotFormat( SCH_PLOT_FORMAT::PDF ),
69 m_filename(),
70 m_drawingSheet(),
71 m_plotAll( true ),
72 m_plotDrawingSheet( true ),
73 m_blackAndWhite( false ),
74 m_pageSizeSelect( JOB_PAGE_SIZE::PAGE_SIZE_AUTO ),
75 m_useBackgroundColor( true ),
76 m_HPGLPenSize( 1.0 ),
77 m_HPGLPaperSizeSelect( JOB_HPGL_PAGE_SIZE::DEFAULT ),
78 m_PDFPropertyPopups( true ),
79 m_PDFHierarchicalLinks( true ),
80 m_PDFMetadata( true ),
81 m_theme(),
82 m_outputDirectory(),
83 m_outputFile(),
85{
86 m_params.emplace_back(
87 new JOB_PARAM<SCH_PLOT_FORMAT>( "format", &m_plotFormat, m_plotFormat ) );
88 m_params.emplace_back(
89 new JOB_PARAM<wxString>( "drawing_sheet", &m_drawingSheet, m_drawingSheet ) );
90 m_params.emplace_back( new JOB_PARAM<bool>( "plot_all", &m_plotAll, m_plotAll ) );
91 m_params.emplace_back(
92 new JOB_PARAM<bool>( "plot_drawing_sheet", &m_plotDrawingSheet, m_plotDrawingSheet ) );
93 m_params.emplace_back(
94 new JOB_PARAM<bool>( "black_and_white", &m_blackAndWhite, m_blackAndWhite ) );
95 m_params.emplace_back(
96 new JOB_PARAM<JOB_PAGE_SIZE>( "page_size", &m_pageSizeSelect, m_pageSizeSelect ) );
97 m_params.emplace_back( new JOB_PARAM<bool>( "use_background_color", &m_useBackgroundColor,
98 m_useBackgroundColor ) );
99 m_params.emplace_back(
100 new JOB_PARAM<double>( "hpgl_pen_size", &m_HPGLPenSize, m_HPGLPenSize ) );
101 m_params.emplace_back( new JOB_PARAM<JOB_HPGL_PAGE_SIZE>(
102 "hpgl_page_size", &m_HPGLPaperSizeSelect, m_HPGLPaperSizeSelect ) );
103 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_property_popups", &m_PDFPropertyPopups,
104 m_PDFPropertyPopups ) );
105 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_hierarchical_links", &m_PDFHierarchicalLinks,
106 m_PDFHierarchicalLinks ) );
107 m_params.emplace_back( new JOB_PARAM<bool>( "pdf_metadata", &m_PDFMetadata, m_PDFMetadata ) );
108 m_params.emplace_back( new JOB_PARAM<wxString>( "color_theme", &m_theme, m_theme ) );
109 m_params.emplace_back(
110 new JOB_PARAM<wxString>( "output_filename", &m_outputFile, m_outputFile ) );
111 m_params.emplace_back(
112 new JOB_PARAM<wxString>( "output_directory", &m_outputDirectory, m_outputDirectory ) );
113 m_params.emplace_back( new JOB_PARAM<JOB_HPGL_PLOT_ORIGIN_AND_UNITS>(
114 "hpgl_plot_origin", &m_HPGLPlotOrigin, m_HPGLPlotOrigin ) );
115
116}
117
118
121{
122 m_plotFormat = SCH_PLOT_FORMAT::PDF;
123}
124
125
127{
128 return wxString::Format( _( "Schematic PDF Plot" ) );
129}
130
131
132JOB_EXPORT_SCH_PLOT_DXF ::JOB_EXPORT_SCH_PLOT_DXF () :
134{
135 m_plotFormat = SCH_PLOT_FORMAT::DXF;
136}
137
138
140{
141 return wxString::Format( _( "Schematic DXF Plot" ) );
142}
143
144
147{
148 m_plotFormat = SCH_PLOT_FORMAT::SVG;
149}
150
151
153{
154 return wxString::Format( _( "Schematic SVG Plot" ) );
155}
156
157
160{
161 m_plotFormat = SCH_PLOT_FORMAT::POST;
162}
163
164
166{
167 return wxString::Format( _( "Schematic PS Plot" ) );
168}
169
170
173{
174 m_plotFormat = SCH_PLOT_FORMAT::HPGL;
175}
176
177
179{
180 return wxString::Format( _( "Schematic HPGL Plot" ) );
181}
182
183
184REGISTER_JOB( sch_export_plot_svg, _HKI( "Schematic: Export SVG" ), KIWAY::FACE_SCH,
186REGISTER_JOB( sch_export_plot_hpgl, _HKI( "Schematic: Export HPGL" ), KIWAY::FACE_SCH,
188REGISTER_JOB( sch_export_plot_ps, _HKI( "Schematic: Export PS" ), KIWAY::FACE_SCH,
190REGISTER_JOB( sch_export_plot_dxf, _HKI( "Schematic: Export DXF" ), KIWAY::FACE_SCH,
192REGISTER_JOB( sch_export_plot_pdf, _HKI( "Schematic: Export PDF" ), KIWAY::FACE_SCH,
wxString GetDescription() override
wxString GetDescription() override
wxString GetDescription() override
wxString GetDescription() override
wxString GetDescription() override
Definition: job.h:45
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:79
@ FACE_SCH
eeschema DSO
Definition: kiway.h:291
#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