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 The 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
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_excludeBOM( false ),
54 m_negateBottomX( false ),
55 m_singleFile( false ),
56 m_nakedFilename( false ),
57 m_side( SIDE::BOTH ),
58 m_units( UNITS::MM ),
59 m_format( FORMAT::ASCII ),
60 m_gerberBoardEdge( true )
61{
62 m_params.emplace_back( new JOB_PARAM<bool>( "use_drill_place_file_origin",
63 &m_useDrillPlaceFileOrigin,
64 m_useDrillPlaceFileOrigin ) );
65
66 m_params.emplace_back( new JOB_PARAM<bool>( "smd_only",
67 &m_smdOnly,
68 m_smdOnly ) );
69
70 m_params.emplace_back( new JOB_PARAM<bool>( "exclude_footprints_with_th",
71 &m_excludeFootprintsWithTh,
72 m_excludeFootprintsWithTh ) );
73
74 m_params.emplace_back( new JOB_PARAM<bool>( "exclude_dnp",
75 &m_excludeDNP,
76 m_excludeDNP ) );
77
78 m_params.emplace_back( new JOB_PARAM<bool>( "exclude_bom",
79 &m_excludeBOM,
80 m_excludeBOM ) );
81
82 m_params.emplace_back( new JOB_PARAM<bool>( "negate_bottom_x",
83 &m_negateBottomX,
84 m_negateBottomX ) );
85
86 m_params.emplace_back( new JOB_PARAM<bool>( "single_file",
87 &m_singleFile,
88 m_singleFile ) );
89
90 m_params.emplace_back( new JOB_PARAM<bool>( "gerber_board_edge",
91 &m_gerberBoardEdge,
92 m_gerberBoardEdge ) );
93
94 m_params.emplace_back( new JOB_PARAM<SIDE>( "side", &m_side, m_side ) );
95 m_params.emplace_back( new JOB_PARAM<UNITS>( "units", &m_units, m_units ) );
96 m_params.emplace_back( new JOB_PARAM<FORMAT>( "format", &m_format, m_format ) );
97}
98
99
101{
102 return _( "Export position data" );
103}
104
105
107{
108 return _( "Export Position Data Job Settings" );
109}
110
111
112void JOB_EXPORT_PCB_POS::SetDefaultOutputPath( const wxString& aReferenceName )
113{
114 wxFileName fn = aReferenceName;
115
119 fn.SetExt( FILEEXT::CsvFileExtension );
121 fn.SetExt( FILEEXT::GerberFileExtension );
122
123 SetConfiguredOutputPath( fn.GetFullName() );
124}
125
126REGISTER_JOB( pcb_export_pos, _HKI( "PCB: Export Position Data" ), KIWAY::FACE_PCB, JOB_EXPORT_PCB_POS );
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
void SetDefaultOutputPath(const wxString &aReferenceName)
An simple container class that lets us dispatch output jobs to kifaces.
Definition job.h:183
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:294
#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)
#define _HKI(x)
Definition page_info.cpp:44
Definition of file extensions used in Kicad.