Added access method for the timestep string (date)

This commit is contained in:
Pål Hagen 2015-10-16 13:33:35 +02:00
parent 3ecd6d8da7
commit 0a7e971577
3 changed files with 44 additions and 10 deletions

View File

@ -431,15 +431,12 @@ QString RimWellLogExtractionCurve::createCurveName()
{ {
size_t maxTimeStep = 0; size_t maxTimeStep = 0;
QStringList timeStepNames;
if (eclipseCase) if (eclipseCase)
{ {
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel()); RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel());
if(eclipseCase->reservoirData()) if (eclipseCase->reservoirData())
{ {
maxTimeStep = eclipseCase->reservoirData()->results(porosityModel)->maxTimeStepCount(); maxTimeStep = eclipseCase->reservoirData()->results(porosityModel)->maxTimeStepCount();
timeStepNames = eclipseCase->timeStepStrings();
} }
} }
else if (geomCase) else if (geomCase)
@ -447,18 +444,21 @@ QString RimWellLogExtractionCurve::createCurveName()
if (geomCase->geoMechData()) if (geomCase->geoMechData())
{ {
maxTimeStep = geomCase->geoMechData()->femPartResults()->frameCount(); maxTimeStep = geomCase->geoMechData()->femPartResults()->frameCount();
timeStepNames = geomCase->timeStepStrings();
} }
} }
if (m_addDateToCurveName && m_timeStep < timeStepNames.size()) if (m_addDateToCurveName)
{ {
if (!generatedCurveName.isEmpty()) QString dateString = wellDate();
if (!dateString.isEmpty())
{ {
generatedCurveName += ", "; if (!generatedCurveName.isEmpty())
} {
generatedCurveName += ", ";
}
generatedCurveName += timeStepNames[m_timeStep]; generatedCurveName += dateString;
}
} }
if (m_addTimestepToCurveName) if (m_addTimestepToCurveName)
@ -511,3 +511,35 @@ QString RimWellLogExtractionCurve::wellName() const
{ {
return m_wellPath->name(); return m_wellPath->name();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellLogExtractionCurve::wellDate() const
{
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value());
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
QStringList timeStepNames;
size_t maxTimeStep = 0;
if (eclipseCase)
{
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel());
if (eclipseCase->reservoirData())
{
maxTimeStep = eclipseCase->reservoirData()->results(porosityModel)->maxTimeStepCount();
timeStepNames = eclipseCase->timeStepStrings();
}
}
else if (geomCase)
{
if (geomCase->geoMechData())
{
maxTimeStep = geomCase->geoMechData()->femPartResults()->frameCount();
timeStepNames = geomCase->timeStepStrings();
}
}
return (m_timeStep < timeStepNames.size()) ? timeStepNames[m_timeStep] : "";
}

View File

@ -48,6 +48,7 @@ public:
virtual QString wellName() const; virtual QString wellName() const;
virtual QString wellLogChannelName() const; virtual QString wellLogChannelName() const;
virtual QString wellDate() const;
protected: protected:
virtual QString createCurveName(); virtual QString createCurveName();

View File

@ -63,6 +63,7 @@ public:
virtual QString wellName() const = 0; virtual QString wellName() const = 0;
virtual QString wellLogChannelName() const = 0; virtual QString wellLogChannelName() const = 0;
virtual QString wellDate() const { return ""; };
virtual void updatePlotData() = 0; virtual void updatePlotData() = 0;
protected: protected: