7 #include "../../odbdesign_export.h"
8 #include "../../enums.h"
9 #include "../../ProtoBuf/edadatafile.pb.h"
10 #include "../../ProtoBuf/common.pb.h"
11 #include "../../IProtoBuffable.h"
12 #include "PropertyRecord.h"
13 #include "ContourPolygon.h"
14 #include "AttributeLookupTable.h"
17 namespace Odb::Lib::FileModel::Design
25 const std::filesystem::path& GetPath()
const;
26 const std::filesystem::path& GetDirectory()
const;
27 const std::string& GetUnits()
const;
28 const std::string& GetSource()
const;
30 bool Parse(std::filesystem::path path);
41 typedef std::vector<std::shared_ptr<FeatureIdRecord>> Vector;
44 unsigned int layerNumber;
45 unsigned int featureNumber;
48 std::unique_ptr<Odb::Lib::Protobuf::EdaDataFile::FeatureIdRecord> to_protobuf()
const override;
49 void from_protobuf(
const Odb::Lib::Protobuf::EdaDataFile::FeatureIdRecord& message)
override;
80 typedef std::vector<std::shared_ptr<SubnetRecord>> Vector;
86 FeatureIdRecord::Vector m_featureIdRecords;
90 unsigned int componentNumber;
91 unsigned toeprintNumber;
95 CutoutType cutoutType;
99 inline static const std::string RECORD_TOKEN =
"SNT";
100 inline static const std::string RECORD_TYPE_TRACE_TOKEN =
"TRC";
101 inline static const std::string RECORD_TYPE_VIA_TOKEN =
"VIA";
102 inline static const std::string RECORD_TYPE_TOEPRINT_TOKEN =
"TOP";
103 inline static const std::string RECORD_TYPE_PLANE_TOKEN =
"PLN";
106 std::unique_ptr<Odb::Lib::Protobuf::EdaDataFile::NetRecord::SubnetRecord> to_protobuf()
const override;
107 void from_protobuf(
const Odb::Lib::Protobuf::EdaDataFile::NetRecord::SubnetRecord& message)
override;
111 typedef std::vector<std::shared_ptr<NetRecord>> Vector;
112 typedef std::map<std::string, std::shared_ptr<NetRecord>> StringMap;
119 SubnetRecord::Vector m_subnetRecords;
120 PropertyRecord::Vector m_propertyRecords;
123 std::unique_ptr<Odb::Lib::Protobuf::EdaDataFile::NetRecord> to_protobuf()
const override;
124 void from_protobuf(
const Odb::Lib::Protobuf::EdaDataFile::NetRecord& message)
override;
140 typedef std::vector<std::shared_ptr<OutlineRecord>> Vector;
144 m_contourPolygons.clear();
164 ContourPolygon::Vector m_contourPolygons;
167 std::unique_ptr<Odb::Lib::Protobuf::EdaDataFile::PackageRecord::OutlineRecord> to_protobuf()
const override;
168 void from_protobuf(
const Odb::Lib::Protobuf::EdaDataFile::PackageRecord::OutlineRecord& message)
override;
170 inline static const char* RECTANGLE_RECORD_TOKEN =
"RC";
171 inline static const char* CIRCLE_RECORD_TOKEN =
"CR";
172 inline static const char* SQUARE_RECORD_TOKEN =
"SQ";
173 inline static const char* CONTOUR_BEGIN_RECORD_TOKEN =
"CT";
174 inline static const char* CONTOUR_END_RECORD_TOKEN =
"CE";
187 enum class ElectricalType
199 RecommendedThroughHole,
206 typedef std::vector<std::shared_ptr<PinRecord>> Vector;
207 typedef std::map<std::string, std::shared_ptr<PinRecord>> StringMap;
211 m_outlineRecords.clear();
218 float finishedHoleSize;
219 ElectricalType electricalType;
224 OutlineRecord::Vector m_outlineRecords;
227 std::unique_ptr<Odb::Lib::Protobuf::EdaDataFile::PackageRecord::PinRecord> to_protobuf()
const override;
228 void from_protobuf(
const Odb::Lib::Protobuf::EdaDataFile::PackageRecord::PinRecord& message)
override;
232 typedef std::vector<std::shared_ptr<PackageRecord>> Vector;
233 typedef std::map<std::string, std::shared_ptr<PackageRecord>> StringMap;
237 m_outlineRecords.clear();
238 m_pinRecords.clear();
239 m_pinRecordsByName.clear();
240 m_propertyRecords.clear();
249 OutlineRecord::Vector m_outlineRecords;
250 PinRecord::Vector m_pinRecords;
251 PinRecord::StringMap m_pinRecordsByName;
252 PropertyRecord::Vector m_propertyRecords;
255 std::unique_ptr<Odb::Lib::Protobuf::EdaDataFile::PackageRecord> to_protobuf()
const override;
256 void from_protobuf(
const Odb::Lib::Protobuf::EdaDataFile::PackageRecord& message)
override;
264 m_propertyRecords.clear();
265 m_featureIdRecords.clear();
270 PropertyRecord::Vector m_propertyRecords;
271 FeatureIdRecord::Vector m_featureIdRecords;
273 typedef std::shared_ptr<FeatureGroupRecord> shared_ptr;
274 typedef std::vector<FeatureGroupRecord::shared_ptr> Vector;
277 std::unique_ptr<Odb::Lib::Protobuf::EdaDataFile::FeatureGroupRecord> to_protobuf()
const override;
278 void from_protobuf(
const Odb::Lib::Protobuf::EdaDataFile::FeatureGroupRecord& message)
override;
282 const std::vector<std::string>& GetLayerNames()
const;
283 const std::vector<std::string>& GetAttributeNames()
const;
284 const std::vector<std::string>& GetAttributeTextValues()
const;
286 const NetRecord::Vector& GetNetRecords()
const;
287 const NetRecord::StringMap& GetNetRecordsByName()
const;
288 const PackageRecord::Vector& GetPackageRecords()
const;
289 const PackageRecord::StringMap& GetPackageRecordsByName()
const;
290 const FeatureGroupRecord::Vector& GetFeatureGroupRecords()
const;
291 const PropertyRecord::Vector& GetPropertyRecords()
const;
294 std::unique_ptr<Odb::Lib::Protobuf::EdaDataFile> to_protobuf()
const override;
295 void from_protobuf(
const Odb::Lib::Protobuf::EdaDataFile& message)
override;
298 std::filesystem::path m_directory;
299 std::filesystem::path m_path;
302 std::string m_source;
303 std::vector<std::string> m_layerNames;
305 std::vector<std::string> m_attributeNames;
306 std::vector<std::string> m_attributeTextValues;
308 NetRecord::Vector m_netRecords;
309 NetRecord::StringMap m_netRecordsByName;
311 PackageRecord::Vector m_packageRecords;
312 PackageRecord::StringMap m_packageRecordsByName;
314 FeatureGroupRecord::Vector m_featureGroupRecords;
316 PropertyRecord::Vector m_propertyRecords;
318 bool m_logAllLineParsing;
320 inline static const char* EDADATA_FILENAME =
"data";
322 inline static const char* COMMENT_TOKEN =
"#";
323 inline static const char* UNITS_TOKEN =
"UNITS";
324 inline static const char* HEADER_RECORD_TOKEN =
"HDR";
325 inline static const char* LAYER_NAMES_RECORD_TOKEN =
"LYR";
326 inline static const char* PROPERTY_RECORD_TOKEN =
"PRP";
327 inline static const char* ATTRIBUTE_NAME_TOKEN =
"@";
328 inline static const char* ATTRIBUTE_VALUE_TOKEN =
"&";
329 inline static const char* NET_RECORD_TOKEN =
"NET";
330 inline static const char* FEATURE_ID_RECORD_TOKEN =
"FID";
331 inline static const char* PACKAGE_RECORD_TOKEN =
"PKG";
332 inline static const char* PIN_RECORD_TOKEN =
"PIN";
334 inline static const char* FEATURE_GROUP_RECORD_TOKEN =
"FGR";