Skip to content

Commit

Permalink
use designName (filename) for names in DesignCache
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed May 12, 2024
1 parent 8bb3c35 commit 4955c9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions OdbDesignLib/App/DesignCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include "../FileModel/Design/FileArchive.h"
#include <memory>
#include "../ProductModel/Design.h"
#include <iosfwd>
#include <string>
#include <type_traits>
#include <StringVector.h>

using namespace Utils;
using namespace std::filesystem;
Expand Down Expand Up @@ -91,7 +95,7 @@ namespace Odb::Lib::App
std::vector<std::string> loadedDesigns;
for (const auto& kv : m_designsByName)
{
loadedDesigns.push_back(kv.second->GetFileModel()->GetProductName());
loadedDesigns.push_back(kv.first);
}
return loadedDesigns;
}
Expand All @@ -101,7 +105,7 @@ namespace Odb::Lib::App
std::vector<std::string> loadedFileArchives;
for (const auto& kv : m_fileArchivesByName)
{
loadedFileArchives.push_back(kv.second->GetProductName());
loadedFileArchives.push_back(kv.first);
}
return loadedFileArchives;
}
Expand Down Expand Up @@ -274,7 +278,7 @@ namespace Odb::Lib::App
if (pDesign->Build(pFileModel))
{
// overwrite any existing design with the same name
m_designsByName[pFileModel->GetProductName()] = pDesign;
m_designsByName[designName] = pDesign;
return pDesign;
}
else
Expand Down Expand Up @@ -313,7 +317,7 @@ namespace Odb::Lib::App
if (pFileArchive->ParseFileModel())
{
// overwrite any existing file archive with the same name
m_fileArchivesByName[pFileArchive->GetProductName()] = pFileArchive;
m_fileArchivesByName[designName] = pFileArchive;
return pFileArchive;
}
else
Expand Down
4 changes: 4 additions & 0 deletions OdbDesignLib/ProductModel/Design.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "Part.h"
#include <memory>
#include "Net.h"
#include "../FileModel/Design/FileArchive.h"


namespace Odb::Lib::ProductModel
Expand Down Expand Up @@ -118,6 +119,9 @@ namespace Odb::Lib::ProductModel

m_pFileModel = pFileModel;

//m_productModel = m_pFileModel->GetProductName();
//m_name = m_pFileModel->GetProductName();

// atomic elements
if (! BuildNets()) return false;
if (! BuildPackages()) return false;
Expand Down

0 comments on commit 4955c9e

Please sign in to comment.