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
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_singleFile( false ),
55 m_nakedFilename( false ),
56 m_side( SIDE::BOTH ),
57 m_units( UNITS::MILLIMETERS ),
58 m_format( FORMAT::ASCII ),
59 m_gerberBoardEdge( true )
60{
61 m_params.emplace_back( new JOB_PARAM<bool>( "use_drill_place_file_origin",
62 &m_useDrillPlaceFileOrigin,
63 m_useDrillPlaceFileOrigin ) );
64
65 m_params.emplace_back( new JOB_PARAM<bool>( "smd_only",
66 &m_smdOnly,
67 m_smdOnly ) );
68
69 m_params.emplace_back( new JOB_PARAM<bool>( "exclude_footprints_with_th",
70 &m_excludeFootprintsWithTh,
71 m_excludeFootprintsWithTh ) );
72
73 m_params.emplace_back( new JOB_PARAM<bool>( "exclude_dnp",
74 &m_excludeDNP,
75 m_excludeDNP ) );
76
77 m_params.emplace_back( new JOB_PARAM<bool>( "negate_bottom_x",
78 &m_negateBottomX,
79 m_negateBottomX ) );
80
81 m_params.emplace_back( new JOB_PARAM<bool>( "single_file",
82 &m_singleFile,
83 m_singleFile ) );
84
85 m_params.emplace_back( new JOB_PARAM<bool>( "gerber_board_edge",
86 &m_gerberBoardEdge,
87 m_gerberBoardEdge ) );
88
89 m_params.emplace_back( new JOB_PARAM<SIDE>( "side", &m_side, m_side ) );
90 m_params.emplace_back( new JOB_PARAM<UNITS>( "units", &m_units, m_units ) );
91 m_params.emplace_back( new JOB_PARAM<FORMAT>( "format", &m_format, m_format ) );
92}
93
94
96{
97 return _( "Export position data" );
98}
99
100
102{
103 return _( "Export Position Data Job Settings" );
104}
105
106
107void JOB_EXPORT_PCB_POS::SetDefaultOutputPath( const wxString& aReferenceName )
108{
109 wxFileName fn = aReferenceName;
110
114 fn.SetExt( FILEEXT::CsvFileExtension );
116 fn.SetExt( FILEEXT::GerberFileExtension );
117
118 SetConfiguredOutputPath( fn.GetFullName() );
119}
120
121REGISTER_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)
Definition: job.h:50
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:182
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:293
#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.