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 (C) 2024 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 {
35 } )
36
37
39 JOB( "odb", false ),
40 m_filename(),
41 m_drawingSheet(),
42 m_units( ODB_UNITS::MILLIMETERS ),
43 m_precision( 2 ),
44 m_compressionMode( ODB_COMPRESSION::ZIP )
45{
46 m_params.emplace_back( new JOB_PARAM<wxString>( "drawing_sheet", &m_drawingSheet, m_drawingSheet ) );
47 m_params.emplace_back( new JOB_PARAM<ODB_UNITS>( "units", &m_units, m_units ) );
48 m_params.emplace_back( new JOB_PARAM<int>( "precision", &m_precision, m_precision ) );
49 m_params.emplace_back( new JOB_PARAM<ODB_COMPRESSION>( "compression", &m_compressionMode,
50 m_compressionMode ) );
51}
52
53
55{
56 return wxString::Format( _( "ODB++ export" ) );
57}
58
59
60void JOB_EXPORT_PCB_ODB::SetDefaultOutputPath( const wxString& aReferenceName )
61{
62 wxFileName fn = aReferenceName;
63
64 fn.SetExt( "zip" );
65
66 SetOutputPath( fn.GetFullName() );
67}
68
69REGISTER_JOB( pcb_export_odb, _HKI( "PCB: Export ODB++" ), KIWAY::FACE_PCB,
void SetDefaultOutputPath(const wxString &aReferenceName)
wxString GetDescription() override
Definition: job.h:45
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:79
void SetOutputPath(const wxString &aPath)
Definition: job.cpp:129
@ FACE_PCB
pcbnew DSO
Definition: kiway.h:292
#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.