mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2360 Elm Props: read metadata on project load
This commit is contained in:
parent
2cd006882f
commit
118980d568
@ -179,7 +179,15 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult(in
|
|||||||
currentFrames->frameData(0).swap(elem.second);
|
currentFrames->frameData(0).swap(elem.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_femPartResults[partIndex]->findScalarResult(resVarAddr);
|
frames = m_femPartResults[partIndex]->findScalarResult(resVarAddr);
|
||||||
|
if (frames)
|
||||||
|
{
|
||||||
|
return frames;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return m_femPartResults[partIndex]->createScalarResult(resVarAddr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to read the data as bulk fields, and populate the correct scalar caches
|
// We need to read the data as bulk fields, and populate the correct scalar caches
|
||||||
|
@ -157,19 +157,24 @@ bool RimGeoMechCase::openGeoMechCase(std::string* errorMessage)
|
|||||||
{
|
{
|
||||||
// If opening failed, release all data
|
// If opening failed, release all data
|
||||||
// Also, several places is checked for this data to validate availability of data
|
// Also, several places is checked for this data to validate availability of data
|
||||||
m_geoMechCaseData = NULL;
|
m_geoMechCaseData = nullptr;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (activeFormationNames())
|
||||||
|
{
|
||||||
|
m_geoMechCaseData->femPartResults()->setActiveFormationNames(activeFormationNames()->formationNamesData());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( activeFormationNames() )
|
m_geoMechCaseData->femPartResults()->setActiveFormationNames(nullptr);
|
||||||
{
|
|
||||||
m_geoMechCaseData->femPartResults()->setActiveFormationNames(activeFormationNames()->formationNamesData());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_geoMechCaseData->femPartResults()->setActiveFormationNames(nullptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_geoMechCaseData.notNull())
|
||||||
|
{
|
||||||
|
geoMechData()->femPartResults()->addElementPropertyFiles(m_elementPropertyFileNames);
|
||||||
|
}
|
||||||
|
|
||||||
return fileOpenSuccess;
|
return fileOpenSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,6 +189,11 @@ void RimGeoMechCase::updateFilePathsFromProjectPath(const QString& newProjectPat
|
|||||||
// Update filename and folder paths when opening project from a different file location
|
// Update filename and folder paths when opening project from a different file location
|
||||||
m_caseFileName = RimTools::relocateFile(m_caseFileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
|
m_caseFileName = RimTools::relocateFile(m_caseFileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
|
||||||
|
|
||||||
|
for (QString& fileName : m_elementPropertyFileNames.v())
|
||||||
|
{
|
||||||
|
fileName = RimTools::relocateFile(fileName, newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0 // Output the search path for debugging
|
#if 0 // Output the search path for debugging
|
||||||
for (size_t i = 0; i < searchedPaths.size(); ++i)
|
for (size_t i = 0; i < searchedPaths.size(); ++i)
|
||||||
qDebug() << searchedPaths[i];
|
qDebug() << searchedPaths[i];
|
||||||
@ -326,7 +336,9 @@ void RimGeoMechCase::addElementPropertyFiles(const std::vector<QString>& fileNam
|
|||||||
{
|
{
|
||||||
m_elementPropertyFileNames.v().push_back(fileName);
|
m_elementPropertyFileNames.v().push_back(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->updateConnectedEditors();
|
this->updateConnectedEditors();
|
||||||
|
|
||||||
if (m_geoMechCaseData.notNull())
|
if (m_geoMechCaseData.notNull())
|
||||||
{
|
{
|
||||||
geoMechData()->femPartResults()->addElementPropertyFiles(fileNames);
|
geoMechData()->femPartResults()->addElementPropertyFiles(fileNames);
|
||||||
|
Loading…
Reference in New Issue
Block a user