Skip to content

Commit

Permalink
BUG: Temporary fix for recursive pipeline to json (#1033)
Browse files Browse the repository at this point in the history
Temporary fix for recursive pipeline to json

* Attempting to create json for a pipeline with a import dream3d
filter that has stored pipeline json that also has an import dream3d
filter to itself results in an infinite recursive loop until stack
overflow

Signed-off-by: Jared Duffey <jared.duffey@bluequartz.net>
  • Loading branch information
JDuffeyBQ authored Aug 3, 2024
1 parent 0d07a8b commit b1a142c
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ Result<> ReadDREAM3DFilter::executeImpl(DataStructure& dataStructure, const Argu
nlohmann::json ReadDREAM3DFilter::toJson(const Arguments& args) const
{
auto json = IFilter::toJson(args);
auto importData = args.value<Dream3dImportParameter::ImportData>(k_ImportFileData);
nx::core::HDF5::FileReader d3dReader(importData.FilePath);
if(d3dReader.isValid())
{
std::string fileVersion = DREAM3D::GetFileVersion(d3dReader);
// File version checking should be more robust
if(fileVersion == DREAM3D::k_CurrentFileVersion)
{
Result<Pipeline> pipelineResult = DREAM3D::ImportPipelineFromFile(d3dReader);
if(pipelineResult.valid())
{
json[k_ImportedPipeline] = pipelineResult.value().toJson();
}
}
}
// auto importData = args.value<Dream3dImportParameter::ImportData>(k_ImportFileData);
// nx::core::HDF5::FileReader d3dReader(importData.FilePath);
// if(d3dReader.isValid())
//{
// std::string fileVersion = DREAM3D::GetFileVersion(d3dReader);
// // File version checking should be more robust
// if(fileVersion == DREAM3D::k_CurrentFileVersion)
// {
// Result<Pipeline> pipelineResult = DREAM3D::ImportPipelineFromFile(d3dReader);
// if(pipelineResult.valid())
// {
// json[k_ImportedPipeline] = pipelineResult.value().toJson();
// }
// }
// }
return json;
}

Expand Down

0 comments on commit b1a142c

Please sign in to comment.