3 #include "../odbdesign_export.h"
10 #include "../ProtoBuf/design.pb.h"
11 #include "../IProtoBuffable.h"
14 #include "../FileModel/Design/StepDirectory.h"
15 #include "../FileModel/Design/EdaDataFile.h"
16 #include "../FileModel/Design/ComponentsFile.h"
17 #include "../FileModel/Design/FileArchive.h"
20 namespace Odb::Lib::ProductModel
28 const std::string& GetName()
const;
29 const std::string& GetProductModel()
const;
31 const Net::Vector& GetNets()
const;
32 const Net::StringMap GetNetsByName()
const;
33 std::shared_ptr<Net> GetNet(
const std::string& name)
const;
35 const Package::Vector& GetPackages()
const;
36 const Package::StringMap& GetPackagesByName()
const;
38 const Component::Vector& GetComponents()
const;
39 const Component::StringMap& GetComponentsByName()
const;
40 std::shared_ptr<Component> GetComponent(
const std::string& refDes)
const;
42 const Part::Vector& GetParts()
const;
43 const Part::StringMap& GetPartsByName()
const;
45 std::shared_ptr<Net> GetNoneNet()
const;
47 bool Build(std::string path);
48 bool Build(std::shared_ptr<FileModel::Design::FileArchive> pFileModel);
50 std::shared_ptr<FileModel::Design::FileArchive> GetFileModel()
const;
54 std::unique_ptr<Protobuf::ProductModel::Design> to_protobuf()
const override;
55 void from_protobuf(
const Protobuf::ProductModel::Design& message)
override;
57 typedef std::vector<std::shared_ptr<Design>> Vector;
58 typedef std::map<std::string, std::shared_ptr<Design>> StringMap;
61 std::string m_productModel;
64 std::shared_ptr<FileModel::Design::FileArchive> m_pFileModel;
67 Net::StringMap m_netsByName;
69 Package::Vector m_packages;
70 Package::StringMap m_packagesByName;
72 Component::Vector m_components;
73 Component::StringMap m_componentsByName;
76 Part::StringMap m_partsByName;
82 bool BuildAllComponents();
86 bool BuildPlacementsFromComponentsFiles();
89 bool BuildPlacementsFromEdaDataFile();
92 bool BreakSinglePinNets();
95 bool CreatePinConnection(
const std::string& refDes,
unsigned int netNumber,
unsigned int pinNumber,
const std::string& pinName);
96 bool CreateNetConnections(
const std::shared_ptr<FileModel::Design::EdaDataFile::NetRecord>& pNetRecord,
const std::shared_ptr<FileModel::Design::StepDirectory>& pStepDirectory);
98 constexpr
inline static const char* NONE_NET_NAME =
"$NONE$";
100 constexpr
inline static bool CLIP_FILEMODEL_AFTER_BUILD =
false;