8 #include "../../odbdesign_export.h"
9 #include "../../enums.h"
10 #include "../../IProtoBuffable.h"
11 #include "PropertyRecord.h"
12 #include "../../ProtoBuf/componentsfile.pb.h"
13 #include "AttributeLookupTable.h"
16 namespace Odb::Lib::FileModel::Design
24 bool Parse(std::filesystem::path directory);
26 std::string GetUnits()
const;
27 BoardSide GetSide()
const;
28 std::filesystem::path GetPath();
29 std::filesystem::path GetDirectory();
30 std::string GetLayerName()
const;
50 constexpr
inline static const char* RECORD_TOKEN =
"CMP";
53 typedef std::map<std::string, std::shared_ptr<ComponentRecord>> StringMap;
54 typedef std::vector<std::shared_ptr<ComponentRecord>> Vector;
59 unsigned int pinNumber;
64 unsigned int netNumber;
65 unsigned int subnetNumber;
69 constexpr
inline static const char* RECORD_TOKEN =
"TOP";
72 typedef std::map<std::string, std::shared_ptr<ToeprintRecord>> StringMap;
73 typedef std::vector<std::shared_ptr<ToeprintRecord>> Vector;
76 std::unique_ptr<Odb::Lib::Protobuf::ComponentsFile::ComponentRecord::ToeprintRecord> to_protobuf()
const override;
77 void from_protobuf(
const Odb::Lib::Protobuf::ComponentsFile::ComponentRecord::ToeprintRecord& message)
override;
80 PropertyRecord::Vector m_propertyRecords;
81 ToeprintRecord::Vector m_toeprintRecords;
84 std::unique_ptr<Odb::Lib::Protobuf::ComponentsFile::ComponentRecord> to_protobuf()
const override;
85 void from_protobuf(
const Odb::Lib::Protobuf::ComponentsFile::ComponentRecord& message)
override;
94 std::vector<std::string> descriptions;
101 std::unique_ptr<Odb::Lib::Protobuf::ComponentsFile::BomDescriptionRecord> to_protobuf()
const override;
102 void from_protobuf(
const Odb::Lib::Protobuf::ComponentsFile::BomDescriptionRecord& message)
override;
104 typedef std::vector<std::shared_ptr<BomDescriptionRecord>> Vector;
105 typedef std::map<std::string, std::shared_ptr<BomDescriptionRecord>> StringMap;
107 inline static const char* CPN_RECORD_TOKEN =
"CPN";
108 inline static const char* PKG_RECORD_TOKEN =
"PKG";
109 inline static const char* IPN_RECORD_TOKEN =
"IPN";
110 inline static const char* DSC_RECORD_TOKEN =
"DSC";
111 inline static const char* VPL_VND_RECORD_TOKEN =
"VPL_VND";
112 inline static const char* VPL_MPN_RECORD_TOKEN =
"VPL_MPN";
113 inline static const char* VND_RECORD_TOKEN =
"VND";
114 inline static const char* MPN_RECORD_TOKEN =
"MPN";
118 const ComponentRecord::Vector& GetComponentRecords()
const;
119 const ComponentRecord::StringMap& GetComponentRecordsByName()
const;
120 const std::vector<std::string>& GetAttributeNames()
const;
121 const std::vector<std::string>& GetAttributeTextValues()
const;
122 const BomDescriptionRecord::StringMap& GetBomDescriptionRecordsByCpn()
const;
124 constexpr
inline static const char* TOP_COMPONENTS_LAYER_NAME =
"comp_+_top";
125 constexpr
inline static const char* BOTTOM_COMPONENTS_LAYER_NAME =
"comp_+_bot";
128 std::unique_ptr<Odb::Lib::Protobuf::ComponentsFile> to_protobuf()
const override;
129 void from_protobuf(
const Odb::Lib::Protobuf::ComponentsFile& message)
override;
135 std::string m_layerName;
136 std::filesystem::path m_path;
137 std::filesystem::path m_directory;
139 std::vector<std::string> m_attributeNames;
140 std::vector<std::string> m_attributeTextValues;
142 ComponentRecord::Vector m_componentRecords;
144 ComponentRecord::StringMap m_componentRecordsByName;
146 BomDescriptionRecord::StringMap m_bomDescriptionRecordsByCpn;
148 const bool m_allowToepintNetNumbersOfNegative1 =
true;
150 constexpr
inline static const char* COMPONENTS_FILENAMES[] =
157 constexpr
inline static const char* UNITS_TOKEN =
"UNITS";
158 constexpr
inline static const char* ID_TOKEN =
"ID";
159 constexpr
inline static const char* ATTRIBUTE_NAME_TOKEN =
"@";
160 constexpr
inline static const char* ATTRIBUTE_VALUE_TOKEN =
"&";
161 constexpr
inline static const char* COMMENT_TOKEN =
"#";
164 constexpr
inline static const char* BOM_DESCR_RECORD_TOKEN_CPN =
"CPN";
165 constexpr
inline static const char* BOM_DESCR_RECORD_TOKEN_PKG =
"PKG";
166 constexpr
inline static const char* BOM_DESCR_RECORD_TOKEN_IPN =
"IPN";
167 constexpr
inline static const char* BOM_DESCR_RECORD_TOKEN_DSC =
"DSC";
168 constexpr
inline static const char* BOM_DESCR_RECORD_TOKEN_VPL_VND =
"VPL_VND";
169 constexpr
inline static const char* BOM_DESCR_RECORD_TOKEN_VPL_MPN =
"VPL_MPN";
170 constexpr
inline static const char* BOM_DESCR_RECORD_TOKEN_VND =
"VND";
171 constexpr
inline static const char* BOM_DESCR_RECORD_TOKEN_MPN =
"MPN";