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 "util/uuid_ptr.hpp"
7 #include <vector>
8 
9 namespace horizon {
10 using json = nlohmann::json;
11 
13 public:
14  BOMExportSettings(const json &, class IPool &pool);
16  json serialize() const;
17 
18  enum class Format { CSV };
19  Format format = Format::CSV;
20  std::map<UUID, UUID> orderable_MPNs; // part->orderable MPN
21  std::map<UUID, uuid_ptr<const class Part>> concrete_parts; // part->part
22  void update_refs(class IPool &pool);
23 
24  class CSVSettings {
25  public:
26  CSVSettings(const json &j);
27  CSVSettings();
28 
29  std::vector<BOMColumn> columns;
30  BOMColumn sort_column = BOMColumn::REFDES;
31  enum class Order { ASC, DESC };
32  Order order = Order::ASC;
33 
34  json serialize() const;
35  };
36 
37  CSVSettings csv_settings;
38 
39  std::string output_filename;
40 
41  bool include_nopopulate = true;
42 };
43 } // namespace horizon
Definition: bom_export_settings.hpp:24
Definition: bom_export_settings.hpp:12
Definition: ipool.hpp:14
a class to store JSON values
Definition: json.hpp:177
basic_json<> json
default JSON class
Definition: json_fwd.hpp:62