KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_export_sch_bom.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>
24
25
27 JOB( "bom", false),
28 m_filename(),
29
34 m_keepTabs( false ),
35 m_keepLineBreaks( false ),
36
41 m_sortAsc( true ),
43 m_excludeDNP( false )
44{
45 m_params.emplace_back( new JOB_PARAM<wxString>( "field_delimiter",
48 m_params.emplace_back( new JOB_PARAM<wxString>( "string_delimiter",
51 m_params.emplace_back( new JOB_PARAM<wxString>( "ref_delimiter",
54 m_params.emplace_back( new JOB_PARAM<wxString>( "ref_range_delimiter",
57 m_params.emplace_back( new JOB_PARAM<bool>( "keep_tabs", &m_keepTabs, m_keepTabs ) );
58 m_params.emplace_back( new JOB_PARAM<bool>( "keep_line_breaks",
61 m_params.emplace_back( new JOB_PARAM_LIST<wxString>( "fields_ordered",
64 m_params.emplace_back( new JOB_PARAM_LIST<wxString>( "fields_labels",
67 m_params.emplace_back( new JOB_PARAM_LIST<wxString>( "fields_group_by",
70 m_params.emplace_back( new JOB_PARAM<wxString>( "sort_field", &m_sortField, m_sortField ) );
71 m_params.emplace_back( new JOB_PARAM<bool>( "sort_asc", &m_sortAsc, m_sortAsc ) );
72 m_params.emplace_back( new JOB_PARAM<wxString>( "filter_string", &m_filterString, m_filterString ) );
73 m_params.emplace_back( new JOB_PARAM<bool>( "exclude_dnp", &m_excludeDNP, m_excludeDNP ) );
74
75 m_params.emplace_back( new JOB_PARAM<wxString>( "bom_preset_name",
78 m_params.emplace_back( new JOB_PARAM<wxString>( "bom_format_preset_name",
81}
82
83
85{
86 return wxString::Format( _( "Generate bill of materials" ) );
87}
88
89
91{
92 return wxString::Format( _( "Generate Bill of Materials Job Settings" ) );
93}
94
95
96REGISTER_JOB( sch_export_bom, _HKI( "Schematic: Generate Bill of Materials" ), KIWAY::FACE_SCH,
std::vector< wxString > m_fieldsLabels
std::vector< wxString > m_fieldsOrdered
wxString GetSettingsDialogTitle() const override
std::vector< wxString > m_fieldsGroupBy
wxString GetDefaultDescription() const override
std::vector< JOB_PARAM_BASE * > m_params
Definition job.h:267
JOB(const std::string &aType, bool aOutputIsDirectory)
Definition job.cpp:26
@ FACE_SCH
eeschema DSO
Definition kiway.h:293
#define _(s)
Some functions to handle hotkeys in KiCad.
#define REGISTER_JOB(job_name, title, face, T)
#define _HKI(x)
Definition page_info.cpp:44