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 );
94 j.at(
"name" ).get_to( f.
name );
96 j.at(
"sort_field" ).get_to( f.
sortField );
97 j.at(
"sort_asc" ).get_to( f.
sortAsc );
119 BOM_PRESET p{
_HKI(
"Grouped By Value" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false };
121 p.fieldsOrdered = std::vector<BOM_FIELD>{
122 {
"Reference",
"Reference",
true,
false },
123 {
"Value",
"Value",
true,
true },
124 {
"Datasheet",
"Datasheet",
true,
false },
125 {
"Footprint",
"Footprint",
true,
false },
126 {
"${QUANTITY}",
"Qty",
true,
false },
127 {
"${DNP}",
"DNP",
true,
true },
137 _HKI(
"Grouped By Value and Footprint" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false
140 p.fieldsOrdered = std::vector<BOM_FIELD>{
141 {
"Reference",
"Reference",
true,
false },
142 {
"Value",
"Value",
true,
true },
143 {
"Datasheet",
"Datasheet",
true,
false },
144 {
"Footprint",
"Footprint",
true,
true },
145 {
"${QUANTITY}",
"Qty",
true,
false },
146 {
"${DNP}",
"DNP",
true,
true },
156 _HKI(
"Attributes" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false
159 p.fieldsOrdered = std::vector<BOM_FIELD>{
160 {
"Reference",
"Reference",
true,
false },
161 {
"Value",
"Value",
true,
true },
162 {
"Datasheet",
"Datasheet",
false,
false },
163 {
"Footprint",
"Footprint",
false,
true },
164 {
"${DNP}",
"Do Not Place",
true,
false },
165 {
"${EXCLUDE_FROM_BOM}",
"Exclude from BOM",
true,
false },
166 {
"${EXCLUDE_FROM_BOARD}",
"Exclude from Board",
true,
false },
167 {
"${EXCLUDE_FROM_SIM}",
"Exclude from Simulation",
true,
false },
192 return !( lhs == rhs );
204 j = nlohmann::json{ {
"name", p.
name },
216 j.at(
"name" ).get_to( f.
name );
221 j.at(
"keep_tabs" ).get_to( f.
keepTabs );
228 return {
_HKI(
"CSV" ),
true, wxS(
"," ), wxT(
"\"" ), wxT(
"," ), wxT(
"" ),
false,
false };
233 return {
_HKI(
"TSV" ),
true, wxS(
"\t" ), wxT(
"" ), wxT(
"," ), wxT(
"" ),
false,
false };
239 _HKI(
"Semicolons" ),
true, wxS(
";" ), wxT(
"'" ), wxT(
"," ), wxT(
"" ),
false,
false
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
std::vector< BOM_FIELD > fieldsOrdered
static BOM_PRESET GroupedByValue()
static std::vector< BOM_PRESET > BuiltInPresets()
static BOM_PRESET GroupedByValueFootprint()
static BOM_PRESET Attributes()