26 bool Parse(std::filesystem::path directory);
28 bool Save(std::ostream& os)
override;
30 std::string GetUnits()
const;
32 std::filesystem::path GetPath();
33 std::filesystem::path GetDirectory();
34 std::string GetLayerName()
const;
41 unsigned int pkgRef = 0;
42 double locationX = 0.0;
43 double locationY = 0.0;
44 double rotation = 0.0;
51 std::optional<unsigned int>
id;
53 unsigned int index = 0;
56 constexpr inline static const char* RECORD_TOKEN =
"CMP";
59 typedef std::map<std::string, std::shared_ptr<ComponentRecord>>
StringMap;
60 typedef std::vector<std::shared_ptr<ComponentRecord>>
Vector;
65 unsigned int pinNumber = 0;
66 double locationX = 0.0;
67 double locationY = 0.0;
68 double rotation = 0.0;
70 unsigned int netNumber = 0;
71 unsigned int subnetNumber = 0;
75 constexpr inline static const char* RECORD_TOKEN =
"TOP";
78 typedef std::map<std::string, std::shared_ptr<ToeprintRecord>>
StringMap;
79 typedef std::vector<std::shared_ptr<ToeprintRecord>>
Vector;
82 std::unique_ptr<Odb::Lib::Protobuf::ComponentsFile::ComponentRecord::ToeprintRecord> to_protobuf()
const override;
83 void from_protobuf(
const Odb::Lib::Protobuf::ComponentsFile::ComponentRecord::ToeprintRecord& message)
override;
90 std::unique_ptr<Odb::Lib::Protobuf::ComponentsFile::ComponentRecord> to_protobuf()
const override;
91 void from_protobuf(
const Odb::Lib::Protobuf::ComponentsFile::ComponentRecord& message)
override;
107 std::unique_ptr<Odb::Lib::Protobuf::ComponentsFile::BomDescriptionRecord> to_protobuf()
const override;
108 void from_protobuf(
const Odb::Lib::Protobuf::ComponentsFile::BomDescriptionRecord& message)
override;
110 typedef std::vector<std::shared_ptr<BomDescriptionRecord>>
Vector;
111 typedef std::map<std::string, std::shared_ptr<BomDescriptionRecord>>
StringMap;
113 inline static const char* CPN_RECORD_TOKEN =
"CPN";
114 inline static const char* PKG_RECORD_TOKEN =
"PKG";
115 inline static const char* IPN_RECORD_TOKEN =
"IPN";
116 inline static const char* DSC_RECORD_TOKEN =
"DSC";
117 inline static const char* VPL_VND_RECORD_TOKEN =
"VPL_VND";
118 inline static const char* VPL_MPN_RECORD_TOKEN =
"VPL_MPN";
119 inline static const char* VND_RECORD_TOKEN =
"VND";
120 inline static const char* MPN_RECORD_TOKEN =
"MPN";
125 const std::vector<std::string>& GetAttributeNames()
const;
126 const std::vector<std::string>& GetAttributeTextValues()
const;
129 constexpr inline static const char* TOP_COMPONENTS_LAYER_NAME =
"comp_+_top";
130 constexpr inline static const char* BOTTOM_COMPONENTS_LAYER_NAME =
"comp_+_bot";
133 std::unique_ptr<Odb::Lib::Protobuf::ComponentsFile> to_protobuf()
const override;
134 void from_protobuf(
const Odb::Lib::Protobuf::ComponentsFile& message)
override;
140 std::string m_layerName;
141 std::filesystem::path m_path;
142 std::filesystem::path m_directory;
144 std::vector<std::string> m_attributeNames;
145 std::vector<std::string> m_attributeTextValues;
151 const bool m_allowToepintNetNumbersOfNegative1 =
true;
153 constexpr inline static const char* COMPONENTS_FILENAMES[] =
160 constexpr inline static const char* UNITS_TOKEN =
"UNITS";
161 constexpr inline static const char* ID_TOKEN =
"ID";
162 constexpr inline static const char* ATTRIBUTE_NAME_TOKEN =
"@";
163 constexpr inline static const char* ATTRIBUTE_VALUE_TOKEN =
"&";
164 constexpr inline static const char* COMMENT_TOKEN =
"#";
167 constexpr inline static const char* BOM_DESCR_RECORD_TOKEN_CPN =
"CPN";
168 constexpr inline static const char* BOM_DESCR_RECORD_TOKEN_PKG =
"PKG";
169 constexpr inline static const char* BOM_DESCR_RECORD_TOKEN_IPN =
"IPN";
170 constexpr inline static const char* BOM_DESCR_RECORD_TOKEN_DSC =
"DSC";
171 constexpr inline static const char* BOM_DESCR_RECORD_TOKEN_VPL_VND =
"VPL_VND";
172 constexpr inline static const char* BOM_DESCR_RECORD_TOKEN_VPL_MPN =
"VPL_MPN";
173 constexpr inline static const char* BOM_DESCR_RECORD_TOKEN_VND =
"VND";
174 constexpr inline static const char* BOM_DESCR_RECORD_TOKEN_MPN =
"MPN";