KiCad PCB EDA Suite
Loading...
Searching...
No Matches
bom_settings.h
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 Mike Williams <[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
21#ifndef _BOM_SETTINGS_H
22#define _BOM_SETTINGS_H
23
24
26#include <settings/parameters.h>
27#include <i18n_utility.h>
28
29// A single field within a BOM, e.g. Reference, Value, Footprint
31{
32 wxString name;
33 wxString label;
34 bool show = false;
35 bool groupBy = false;
36
37 bool operator==( const BOM_FIELD& rhs ) const;
38};
39
40KICOMMON_API bool operator!=( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
41KICOMMON_API bool operator<( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
42
43KICOMMON_API void to_json( nlohmann::json& j, const BOM_FIELD& f );
44KICOMMON_API void from_json( const nlohmann::json& j, BOM_FIELD& f );
45
46
47// A complete preset defining a BOM "View" with a list of all the fields to show,
48// group by, order, filtering settings, etc.
50{
51 wxString name;
52 bool readOnly = false;
53 std::vector<BOM_FIELD> fieldsOrdered;
54 wxString sortField;
55 bool sortAsc = true;
56 wxString filterString;
57 bool groupSymbols = false;
58 bool excludeDNP = false;
59 bool includeExcludedFromBOM = false;
60
61 bool operator==( const BOM_PRESET& rhs ) const;
62
63 static BOM_PRESET DefaultEditing();
64 static BOM_PRESET GroupedByValue();
65 static BOM_PRESET GroupedByValueFootprint();
66 static BOM_PRESET Attributes();
67
68 static std::vector<BOM_PRESET> BuiltInPresets();
69};
70
71KICOMMON_API bool operator!=( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
72KICOMMON_API bool operator<( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
73
74KICOMMON_API void to_json( nlohmann::json& j, const BOM_PRESET& f );
75KICOMMON_API void from_json( const nlohmann::json& j, BOM_PRESET& f );
76
77
78// A formatting preset, like CSV (Comma Separated Values)
80{
81 wxString name;
82 bool readOnly = false;
85 wxString refDelimiter;
87 bool keepTabs = false;
88 bool keepLineBreaks = false;
89
90 bool operator==( const BOM_FMT_PRESET& rhs ) const;
91
92 static BOM_FMT_PRESET CSV();
93 static BOM_FMT_PRESET TSV();
94 static BOM_FMT_PRESET Semicolons();
95
96 static std::vector<BOM_FMT_PRESET> BuiltInPresets();
97};
98
99KICOMMON_API bool operator!=( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
100KICOMMON_API bool operator<( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
101
102KICOMMON_API void to_json( nlohmann::json& j, const BOM_FMT_PRESET& f );
103KICOMMON_API void from_json( const nlohmann::json& j, BOM_FMT_PRESET& f );
104
105#if defined( __MINGW32__ )
108#else
109extern template class APIVISIBLE PARAM_LIST<BOM_PRESET>;
110extern template class APIVISIBLE PARAM_LIST<BOM_FMT_PRESET>;
111#endif
112
113#endif
bool operator==(const wxAuiPaneInfo &aLhs, const wxAuiPaneInfo &aRhs)
KICOMMON_API void to_json(nlohmann::json &j, const BOM_FIELD &f)
KICOMMON_API bool operator!=(const BOM_FIELD &lhs, const BOM_FIELD &rhs)
KICOMMON_API bool operator<(const BOM_FIELD &lhs, const BOM_FIELD &rhs)
KICOMMON_API void from_json(const nlohmann::json &j, BOM_FIELD &f)
Some functions to handle hotkeys in KiCad.
#define APIVISIBLE
Definition: import_export.h:55
#define KICOMMON_API
Definition: kicommon.h:28
wxString label
Definition: bom_settings.h:33
wxString name
Definition: bom_settings.h:32
wxString fieldDelimiter
Definition: bom_settings.h:83
wxString name
Definition: bom_settings.h:81
wxString stringDelimiter
Definition: bom_settings.h:84
wxString refRangeDelimiter
Definition: bom_settings.h:86
wxString refDelimiter
Definition: bom_settings.h:85
wxString name
Definition: bom_settings.h:51
wxString sortField
Definition: bom_settings.h:54
std::vector< BOM_FIELD > fieldsOrdered
Definition: bom_settings.h:53
wxString filterString
Definition: bom_settings.h:56