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 );
124 _HKI(
"Default Editing" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false,
true
127 p.fieldsOrdered = std::vector<BOM_FIELD>{
128 {
"Reference",
"Reference",
true,
false },
129 {
"${QUANTITY}",
"Qty",
true,
false },
130 {
"Value",
"Value",
true,
true },
131 {
"${DNP}",
"DNP",
true,
true },
132 {
"${EXCLUDE_FROM_BOM}",
"Exclude from BOM",
true,
true },
133 {
"${EXCLUDE_FROM_BOARD}",
"Exclude from Board",
true,
true },
134 {
"Footprint",
"Footprint",
true,
true },
135 {
"Datasheet",
"Datasheet",
true,
false },
145 _HKI(
"Grouped By Value" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false,
false
148 p.fieldsOrdered = std::vector<BOM_FIELD>{
149 {
"Reference",
"Reference",
true,
false },
150 {
"Value",
"Value",
true,
true },
151 {
"Datasheet",
"Datasheet",
true,
false },
152 {
"Footprint",
"Footprint",
true,
false },
153 {
"${QUANTITY}",
"Qty",
true,
false },
154 {
"${DNP}",
"DNP",
true,
true },
164 _HKI(
"Grouped By Value and Footprint" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false,
false
167 p.fieldsOrdered = std::vector<BOM_FIELD>{
168 {
"Reference",
"Reference",
true,
false },
169 {
"Value",
"Value",
true,
true },
170 {
"Datasheet",
"Datasheet",
true,
false },
171 {
"Footprint",
"Footprint",
true,
true },
172 {
"${QUANTITY}",
"Qty",
true,
false },
173 {
"${DNP}",
"DNP",
true,
true },
183 _HKI(
"Attributes" ),
true, {},
_(
"Reference" ),
true,
"",
true,
false,
true
186 p.fieldsOrdered = std::vector<BOM_FIELD>{
187 {
"Reference",
"Reference",
true,
false },
188 {
"Value",
"Value",
true,
true },
189 {
"Datasheet",
"Datasheet",
false,
false },
190 {
"Footprint",
"Footprint",
false,
true },
191 {
"${DNP}",
"Do Not Place",
true,
false },
192 {
"${EXCLUDE_FROM_BOM}",
"Exclude from BOM",
true,
false },
193 {
"${EXCLUDE_FROM_BOARD}",
"Exclude from Board",
true,
false },
194 {
"${EXCLUDE_FROM_SIM}",
"Exclude from Simulation",
true,
false },
219 return !( lhs == rhs );
231 j = nlohmann::json{ {
"name", p.
name },
243 j.at(
"name" ).get_to( f.
name );
248 j.at(
"keep_tabs" ).get_to( f.
keepTabs );
255 return {
_HKI(
"CSV" ),
true, wxS(
"," ), wxT(
"\"" ), wxT(
"," ), wxT(
"" ),
false,
false };
260 return {
_HKI(
"TSV" ),
true, wxS(
"\t" ), wxT(
"" ), wxT(
"," ), wxT(
"" ),
false,
false };
266 _HKI(
"Semicolons" ),
true, wxS(
";" ), wxT(
"'" ), wxT(
"," ), wxT(
"" ),
false,
false
275#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()