KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_export_pcb_ipc2581.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 Mark Roszko <[email protected]>
5 * Copyright (C) 2024 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>
25
27 {
30 } )
31
33 {
36 } )
37
39 JOB( "ipc2581", false ),
40 m_filename(),
41 m_drawingSheet(),
42 m_units( IPC2581_UNITS::MILLIMETERS ),
43 m_version( IPC2581_VERSION::C ),
44 m_precision( 3 ),
45 m_compress( false ),
46 m_colInternalId(),
47 m_colMfgPn(),
48 m_colMfg(),
49 m_colDistPn(),
50 m_colDist()
51{
52 m_params.emplace_back( new JOB_PARAM<wxString>( "drawing_sheet", &m_drawingSheet, m_drawingSheet ) );
53 m_params.emplace_back( new JOB_PARAM<IPC2581_UNITS>( "units", &m_units, m_units ) );
54 m_params.emplace_back( new JOB_PARAM<IPC2581_VERSION>( "version", &m_version, m_version ) );
55 m_params.emplace_back( new JOB_PARAM<int>( "precision", &m_precision, m_precision ) );
56 m_params.emplace_back( new JOB_PARAM<bool>( "compress", &m_compress, m_compress ) );
57 m_params.emplace_back( new JOB_PARAM<wxString>( "field_bom_map.internal_id",
58 &m_colInternalId,
59 m_colInternalId ) );
60 m_params.emplace_back( new JOB_PARAM<wxString>( "field_bom_map.mfg_pn",
61 &m_colMfgPn, m_colMfgPn ) );
62 m_params.emplace_back( new JOB_PARAM<wxString>( "field_bom_map.mfg", &m_colMfg, m_colMfg ) );
63 m_params.emplace_back( new JOB_PARAM<wxString>( "field_bom_map.dist_pn",
64 &m_colDistPn,
65 m_colDistPn ) );
66 m_params.emplace_back( new JOB_PARAM<wxString>( "field_bom_map.dist", &m_colDist, m_colDist ) );
67}
68
69
71{
72 return wxString::Format( _( "IPC2581 export" ) );
73}
74
75
76void JOB_EXPORT_PCB_IPC2581::SetDefaultOutputPath( const wxString& aReferenceName )
77{
78 wxFileName fn = aReferenceName;
79
81
82 SetOutputPath( fn.GetFullName() );
83}
84
85REGISTER_JOB( pcb_export_ipc2581, _HKI( "PCB: Export IPC2581" ), KIWAY::FACE_PCB,
wxString GetDescription() override
void SetDefaultOutputPath(const wxString &aReferenceName)
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)
static const std::string Ipc2581FileExtension
Some functions to handle hotkeys in KiCad.
NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_IPC2581::IPC2581_UNITS, { { JOB_EXPORT_PCB_IPC2581::IPC2581_UNITS::INCHES, "in" }, { JOB_EXPORT_PCB_IPC2581::IPC2581_UNITS::MILLIMETERS, "mm" }, }) NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_IPC2581
#define REGISTER_JOB(job_name, title, face, T)
Definition: job_registry.h:64
Definition of file extensions used in Kicad.