KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_export_pcb_odb.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
21#include <jobs/job_registry.h>
22#include <i18n_utility.h>
24
26 {
29 } )
30
32 {
36 } )
37
38
40 JOB( "odb", false ),
41 m_filename(),
42 m_drawingSheet(),
43 m_units( ODB_UNITS::MILLIMETERS ),
44 m_precision( 2 ),
45 m_compressionMode( ODB_COMPRESSION::ZIP )
46{
47 m_params.emplace_back( new JOB_PARAM<wxString>( "drawing_sheet", &m_drawingSheet, m_drawingSheet ) );
48 m_params.emplace_back( new JOB_PARAM<ODB_UNITS>( "units", &m_units, m_units ) );
49 m_params.emplace_back( new JOB_PARAM<int>( "precision", &m_precision, m_precision ) );
50 m_params.emplace_back( new JOB_PARAM<ODB_COMPRESSION>( "compression", &m_compressionMode,
51 m_compressionMode ) );
52}
53
54
56{
57 return _( "Export ODB++" );
58}
59
60
62{
63 return _( "Export ODB++ Job Settings" );
64}
65
66
67void JOB_EXPORT_PCB_ODB::SetDefaultOutputPath( const wxString& aReferenceName )
68{
69 wxFileName fn = aReferenceName;
70
71 fn.SetExt( "zip" );
72
73 SetConfiguredOutputPath( fn.GetFullName() );
74}
75
76REGISTER_JOB( pcb_export_odb, _HKI( "PCB: Export ODB++" ), KIWAY::FACE_PCB,
void SetDefaultOutputPath(const wxString &aReferenceName)
wxString GetSettingsDialogTitle() const override
wxString GetDefaultDescription() const override
Definition: job.h:50
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:182
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
Definition: job.cpp:153
@ FACE_PCB
pcbnew DSO
Definition: kiway.h:293
#define _HKI(x)
#define _(s)
Some functions to handle hotkeys in KiCad.
NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_ODB::ODB_UNITS, { { JOB_EXPORT_PCB_ODB::ODB_UNITS::INCHES, "in" }, { JOB_EXPORT_PCB_ODB::ODB_UNITS::MILLIMETERS, "mm" }, }) NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_ODB
#define REGISTER_JOB(job_name, title, face, T)
Definition: job_registry.h:64
Definition of file extensions used in Kicad.