From 96bff275195dc94478ab02f3541953cfac41b58c Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Mon, 15 Jan 2018 17:40:39 +0100 Subject: [PATCH] #2372 Elm props: Map modulus and ratio ui names --- ApplicationCode/FileInterface/RifElementPropertyReader.cpp | 6 +++--- ApplicationCode/FileInterface/RifElementPropertyReader.h | 2 +- .../GeoMechDataModel/RigFemPartResultsCollection.cpp | 5 ++++- .../ProjectDataModel/RimGeoMechResultDefinition.cpp | 3 +++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ApplicationCode/FileInterface/RifElementPropertyReader.cpp b/ApplicationCode/FileInterface/RifElementPropertyReader.cpp index 6339aa8f0d..793884622e 100644 --- a/ApplicationCode/FileInterface/RifElementPropertyReader.cpp +++ b/ApplicationCode/FileInterface/RifElementPropertyReader.cpp @@ -68,14 +68,14 @@ void RifElementPropertyReader::removeFile(const std::string& fileName) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::map> RifElementPropertyReader::scalarElementFields() const +std::vector RifElementPropertyReader::scalarElementFields() const { - std::map> fields; + std::vector fields; for (std::map::const_iterator field = m_fieldsMetaData.begin(); field != m_fieldsMetaData.end(); field++) { - fields[field->first]; + fields.push_back(field->first); } return fields; diff --git a/ApplicationCode/FileInterface/RifElementPropertyReader.h b/ApplicationCode/FileInterface/RifElementPropertyReader.h index 2620ef96e4..34b6508d2f 100644 --- a/ApplicationCode/FileInterface/RifElementPropertyReader.h +++ b/ApplicationCode/FileInterface/RifElementPropertyReader.h @@ -42,7 +42,7 @@ public: void addFile(const std::string& fileName); void removeFile(const std::string& fileName); - std::map> scalarElementFields() const; + std::vector scalarElementFields() const; std::map> readAllElementPropertiesInFileContainingField(const std::string& fieldName); diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp index d0ba561a41..fde4783e0d 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp @@ -451,7 +451,10 @@ std::map > RigFemPartResultsCollection::sc } else if (resPos == RIG_ELEMENT) { - fieldCompNames = m_elementPropertyReader->scalarElementFields(); + for (const std::string& field : m_elementPropertyReader->scalarElementFields()) + { + fieldCompNames[field]; + } } } diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp index 0120e088db..9ff629b103 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp @@ -139,6 +139,7 @@ QList RimGeoMechResultDefinition::calculateValueOptions( if (&m_resultVariableUiField == fieldNeedingOptions) { std::map > fieldCompNames = getResultMetaDataForUIFieldSetting(); + QStringList uiVarNames; QStringList varNames; bool isNeedingTimeLapseStrings = m_isTimeLapseResultUiField() && (m_resultPositionTypeUiField() != RIG_FORMATION_NAMES); @@ -435,6 +436,8 @@ QString RimGeoMechResultDefinition::convertToUiResultFieldName(QString resultFie if (resultFieldName == "S") newName = "NativeAbaqus Stress"; if (resultFieldName == "NE") newName = "E"; // Make NE and NS appear as E and SE if (resultFieldName == "POR-Bar") newName = "POR"; // POR-Bar appear as POR + if (resultFieldName == "MODULUS") newName = "Young's Modulus"; + if (resultFieldName == "RATIO") newName = "Poisson's Ratio"; if (isTimeLapseResultList) newName += "_D" + QString::number(baseFrameIdx);