KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_export_pcb_pos.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>
25
27 {
31 } )
32
34 {
38 } )
39
41 {
44 } )
45
47 JOB( "pos", false ),
48 m_filename(),
49 m_useDrillPlaceFileOrigin( true ),
50 m_smdOnly( false ),
51 m_excludeFootprintsWithTh( false ),
52 m_excludeDNP( false ),
53 m_negateBottomX( false ),
54 m_side( SIDE::BOTH ),
55 m_units( UNITS::MILLIMETERS ),
56 m_format( FORMAT::ASCII ),
57 m_gerberBoardEdge( true )
58{
59 m_params.emplace_back( new JOB_PARAM<bool>( "use_drill_place_file_origin",
60 &m_useDrillPlaceFileOrigin,
61 m_useDrillPlaceFileOrigin ) );
62
63 m_params.emplace_back( new JOB_PARAM<bool>( "smd_only",
64 &m_smdOnly,
65 m_smdOnly ) );
66
67 m_params.emplace_back( new JOB_PARAM<bool>( "exclude_footprints_with_th",
68 &m_excludeFootprintsWithTh,
69 m_excludeFootprintsWithTh ) );
70
71 m_params.emplace_back( new JOB_PARAM<bool>( "exclude_dnp",
72 &m_excludeDNP,
73 m_excludeDNP ) );
74
75 m_params.emplace_back( new JOB_PARAM<bool>( "negate_bottom_x",
76 &m_negateBottomX,
77 m_negateBottomX ) );
78
79 m_params.emplace_back( new JOB_PARAM<bool>( "gerber_board_edge",
80 &m_gerberBoardEdge,
81 m_gerberBoardEdge ) );
82
83 m_params.emplace_back( new JOB_PARAM<SIDE>( "side", &m_side, m_side ) );
84 m_params.emplace_back( new JOB_PARAM<UNITS>( "units", &m_units, m_units ) );
85 m_params.emplace_back( new JOB_PARAM<FORMAT>( "format", &m_format, m_format ) );
86}
87
88
90{
91 return wxString::Format( _( "Placement data export" ) );
92}
93
94
95void JOB_EXPORT_PCB_POS::SetDefaultOutputPath( const wxString& aReferenceName )
96{
97 wxFileName fn = aReferenceName;
98
102 fn.SetExt( FILEEXT::CsvFileExtension );
104 fn.SetExt( FILEEXT::GerberFileExtension );
105
106 SetOutputPath( fn.GetFullName() );
107}
108
109REGISTER_JOB( pcb_export_pos, _HKI( "PCB: Export Position Data" ), KIWAY::FACE_PCB, JOB_EXPORT_PCB_POS );
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 GerberFileExtension
static const std::string FootprintPlaceFileExtension
static const std::string CsvFileExtension
Some functions to handle hotkeys in KiCad.
NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_POS::FORMAT, { { JOB_EXPORT_PCB_POS::FORMAT::ASCII, "ascii" }, { JOB_EXPORT_PCB_POS::FORMAT::CSV, "csv" }, { JOB_EXPORT_PCB_POS::FORMAT::GERBER, "gerber" }, }) NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_POS
#define REGISTER_JOB(job_name, title, face, T)
Definition: job_registry.h:64
Definition of file extensions used in Kicad.