Horizon
bom_export_settings.hpp
1 #pragma once
2 #include "common/lut.hpp"
3 #include "util/uuid.hpp"
4 #include "nlohmann/json_fwd.hpp"
5 #include "bom.hpp"
6 #include <vector>
7 
8 namespace horizon {
9 using json = nlohmann::json;
10 
11 class BOMExportSettings {
12 public:
13  BOMExportSettings(const json &, class IPool &pool);
14  BOMExportSettings();
15  json serialize() const;
16 
17  enum class Format { CSV };
18  Format format = Format::CSV;
19  std::map<UUID, UUID> orderable_MPNs; // part->orderable MPN
20  std::map<UUID, const class Part *> concrete_parts; // part->part
21 
22  class CSVSettings {
23  public:
24  CSVSettings(const json &j);
25  CSVSettings();
26 
27  std::vector<BOMColumn> columns;
28  BOMColumn sort_column = BOMColumn::REFDES;
29  enum class Order { ASC, DESC };
30  Order order = Order::ASC;
31 
32  json serialize() const;
33  };
34 
35  CSVSettings csv_settings;
36 
37  std::string output_filename;
38 
39  bool include_nopopulate = true;
40 };
41 } // namespace horizon
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:166
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61