KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_export_pcb_idf.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
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
21#include <jobs/job_registry.h>
22#include <i18n_utility.h>
24#include <wx/filename.h>
25
39
41 JOB( "idf", false ),
42 m_filename(),
46 m_includeDNP( true ),
48{
49 m_params.emplace_back( new JOB_PARAM<IDF_SETTINGS::UNITS>( "units", &m_units, m_units ) );
51 m_params.emplace_back( new JOB_PARAM<double>( "user_origin.x", &m_userOrigin.x, m_userOrigin.x ) );
52 m_params.emplace_back( new JOB_PARAM<double>( "user_origin.y", &m_userOrigin.y, m_userOrigin.y ) );
53 m_params.emplace_back( new JOB_PARAM<bool>( "include_unspecified", &m_includeUnspecified, m_includeUnspecified ) );
54 m_params.emplace_back( new JOB_PARAM<bool>( "include_dnp", &m_includeDNP, m_includeDNP ) );
55 m_params.emplace_back( new JOB_PARAM<bool>( "calculate_height_from_models", &m_calculateHeightFromModels,
57 m_params.emplace_back( new JOB_PARAM<wxString>( "part_number_field", &m_partNumberField, m_partNumberField ) );
58}
59
60
62{
63 return _( "Export IDFv3" );
64}
65
66
68{
69 return _( "Export IDFv3 Job Settings" );
70}
71
72
73void JOB_EXPORT_PCB_IDF::SetDefaultOutputPath( const wxString& aReferenceName )
74{
75 wxFileName fn = aReferenceName;
76
78
79 SetConfiguredOutputPath( fn.GetFullName() );
80}
81
82
83REGISTER_JOB( pcb_export_idf, _HKI( "PCB: Export IDFv3" ), KIWAY::FACE_PCB, JOB_EXPORT_PCB_IDF );
void SetDefaultOutputPath(const wxString &aReferenceName)
wxString GetDefaultDescription() const override
IDF_SETTINGS::COORD_ORIGIN m_originMode
VECTOR2D m_userOrigin
In whatever units the user specified in m_units.
IDF_SETTINGS::UNITS m_units
wxString GetSettingsDialogTitle() const override
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
Definition job.cpp:157
std::vector< JOB_PARAM_BASE * > m_params
Definition job.h:277
JOB(const std::string &aType, bool aOutputIsDirectory)
Definition job.cpp:26
@ FACE_PCB
pcbnew DSO
Definition kiway.h:356
#define _(s)
static const std::string IdfV3BoardFileExtension
Some functions to handle hotkeys in KiCad.
NLOHMANN_JSON_SERIALIZE_ENUM(IDF_SETTINGS::UNITS, { { IDF_SETTINGS::UNITS::MM, "mm" }, { IDF_SETTINGS::UNITS::MILS, "mils" }, }) NLOHMANN_JSON_SERIALIZE_ENUM(IDF_SETTINGS
#define REGISTER_JOB(job_name, title, face, T)
#define _HKI(x)
Definition page_info.cpp:40
Definition of file extensions used in Kicad.