22#include <nlohmann/json.hpp>
24#include <wx/translation.h>
37 return !( lhs == rhs );
57 j.at(
"name" ).get_to( f.
name );
58 j.at(
"label" ).get_to( f.
label );
59 j.at(
"show" ).get_to( f.
show );
60 j.at(
"group_by" ).get_to( f.
groupBy );
66 return !( lhs == rhs );
95 j.at(
"name" ).get_to( f.
name );
97 j.at(
"sort_field" ).get_to( f.
sortField );
98 j.at(
"sort_asc" ).get_to( f.
sortAsc );
125 _HKI(
"Default Editing" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false,
true
128 p.fieldsOrdered = std::vector<BOM_FIELD>{
129 {
"Reference",
"Reference",
true,
false },
130 {
"${QUANTITY}",
"Qty",
true,
false },
131 {
"Value",
"Value",
true,
true },
132 {
"${DNP}",
"DNP",
true,
true },
133 {
"${EXCLUDE_FROM_BOM}",
"Exclude from BOM",
true,
true },
134 {
"${EXCLUDE_FROM_BOARD}",
"Exclude from Board",
true,
true },
135 {
"Footprint",
"Footprint",
true,
true },
136 {
"Datasheet",
"Datasheet",
true,
false },
146 _HKI(
"Grouped By Value" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false,
false
149 p.fieldsOrdered = std::vector<BOM_FIELD>{
150 {
"Reference",
"Reference",
true,
false },
151 {
"Value",
"Value",
true,
true },
152 {
"Datasheet",
"Datasheet",
true,
false },
153 {
"Footprint",
"Footprint",
true,
false },
154 {
"${QUANTITY}",
"Qty",
true,
false },
155 {
"${DNP}",
"DNP",
true,
true },
165 _HKI(
"Grouped By Value and Footprint" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false,
false
168 p.fieldsOrdered = std::vector<BOM_FIELD>{
169 {
"Reference",
"Reference",
true,
false },
170 {
"Value",
"Value",
true,
true },
171 {
"Datasheet",
"Datasheet",
true,
false },
172 {
"Footprint",
"Footprint",
true,
true },
173 {
"${QUANTITY}",
"Qty",
true,
false },
174 {
"${DNP}",
"DNP",
true,
true },
184 _HKI(
"Attributes" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false,
true
187 p.fieldsOrdered = std::vector<BOM_FIELD>{
188 {
"Reference",
"Reference",
true,
false },
189 {
"Value",
"Value",
true,
true },
190 {
"Datasheet",
"Datasheet",
false,
false },
191 {
"Footprint",
"Footprint",
false,
true },
192 {
"${DNP}",
"Do Not Place",
true,
false },
193 {
"${EXCLUDE_FROM_BOM}",
"Exclude from BOM",
true,
false },
194 {
"${EXCLUDE_FROM_BOARD}",
"Exclude from Board",
true,
false },
195 {
"${EXCLUDE_FROM_SIM}",
"Exclude from Simulation",
true,
false },
220 return !( lhs == rhs );
232 j = nlohmann::json{ {
"name", p.
name },
244 j.at(
"name" ).get_to( f.
name );
249 j.at(
"keep_tabs" ).get_to( f.
keepTabs );
256 return {
_HKI(
"CSV" ),
true, wxS(
"," ), wxT(
"\"" ), wxT(
"," ), wxT(
"" ),
false,
false };
261 return {
_HKI(
"TSV" ),
true, wxS(
"\t" ), wxT(
"" ), wxT(
"," ), wxT(
"" ),
false,
false };
267 _HKI(
"Semicolons" ),
true, wxS(
";" ), wxT(
"'" ), wxT(
"," ), wxT(
"" ),
false,
false
276#if !defined( __MINGW32__ )
void to_json(nlohmann::json &j, const BOM_FIELD &f)
bool operator<(const BOM_FIELD &lhs, const BOM_FIELD &rhs)
void from_json(const nlohmann::json &j, BOM_FIELD &f)
bool operator!=(const BOM_FIELD &lhs, const BOM_FIELD &rhs)
bool operator==(const BOM_FIELD &rhs) const
bool operator==(const BOM_FMT_PRESET &rhs) const
static BOM_FMT_PRESET CSV()
static std::vector< BOM_FMT_PRESET > BuiltInPresets()
static BOM_FMT_PRESET TSV()
wxString refRangeDelimiter
static BOM_FMT_PRESET Semicolons()
bool operator==(const BOM_PRESET &rhs) const
static BOM_PRESET DefaultEditing()
std::vector< BOM_FIELD > fieldsOrdered
static BOM_PRESET GroupedByValue()
bool includeExcludedFromBOM
static std::vector< BOM_PRESET > BuiltInPresets()
static BOM_PRESET GroupedByValueFootprint()
static BOM_PRESET Attributes()