mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2122 Formation/Well Path: Set formations path and key on RimWellPath
This commit is contained in:
@@ -36,7 +36,8 @@ std::map<QString, std::vector<std::pair<double, QString>>> RifWellPathFormationR
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationReader::readWellFormationsToGeometry(const QString& filePath)
|
||||
std::map<QString, cvf::ref<RigWellPathFormations>>
|
||||
RifWellPathFormationReader::readWellFormationsToGeometry(const QString& filePath)
|
||||
{
|
||||
std::map<QString, cvf::ref<RigWellPathFormations>> result;
|
||||
|
||||
@@ -48,9 +49,10 @@ std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationReader::r
|
||||
|
||||
for (it = formations.begin(); it != formations.end(); it++)
|
||||
{
|
||||
cvf::ref<RigWellPathFormations> wellPathFormations = new RigWellPathFormations(it->second);
|
||||
result[it->first] = wellPathFormations;
|
||||
cvf::ref<RigWellPathFormations> wellPathFormations = new RigWellPathFormations(it->second, filePath, it->first);
|
||||
result[it->first] = wellPathFormations;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,33 @@ cvf::ref<RigWellPathFormations> RifWellPathFormationsImporter::readWellPathForma
|
||||
const QString& wellName)
|
||||
{
|
||||
readAllWellPathFormations(formationFilePath);
|
||||
return m_fileNameToWellPathFormationMap[formationFilePath][wellName];
|
||||
if (m_fileNameToWellPathFormationMap[formationFilePath].find(wellName) != m_fileNameToWellPathFormationMap[formationFilePath].end())
|
||||
{
|
||||
return m_fileNameToWellPathFormationMap[formationFilePath][wellName];
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationsImporter::readWellPathFormationsFromPath(const QString& filePath)
|
||||
{
|
||||
// If we have the file in the map, assume it is already read.
|
||||
if (m_fileNameToWellPathFormationMap.find(filePath) != m_fileNameToWellPathFormationMap.end())
|
||||
{
|
||||
return m_fileNameToWellPathFormationMap[filePath];
|
||||
}
|
||||
|
||||
std::map<QString, cvf::ref<RigWellPathFormations>> wellPathToFormationMap =
|
||||
RifWellPathFormationReader::readWellFormationsToGeometry(filePath);
|
||||
|
||||
m_fileNameToWellPathFormationMap[filePath] = wellPathToFormationMap;
|
||||
|
||||
return wellPathToFormationMap;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -38,6 +38,8 @@ class RifWellPathFormationsImporter
|
||||
public:
|
||||
cvf::ref<RigWellPathFormations> readWellPathFormations(const QString& formationFilePath, const QString& wellName);
|
||||
|
||||
std::map<QString, cvf::ref<RigWellPathFormations>> readWellPathFormationsFromPath(const QString& filePath);
|
||||
|
||||
private:
|
||||
void readAllWellPathFormations(const QString& filePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user