mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 15:36:09 -06:00
#1947 RFT/PLT Plot: Fix calculateVaueOptions
This commit is contained in:
parent
66b9bb34b5
commit
7db64e099e
@ -200,11 +200,15 @@ bool RimEclipseResultCase::importGridAndResultMetaData(bool showTimeStepFilter)
|
|||||||
|
|
||||||
m_flowDagSolverInterface = new RigFlowDiagSolverInterface(this);
|
m_flowDagSolverInterface = new RigFlowDiagSolverInterface(this);
|
||||||
|
|
||||||
QString rftFile = caseFileName() + ".RFT";
|
QStringList fileSplitOnDot = caseFileName().split(".");
|
||||||
std::string rftFileStdString = rftFile.toStdString();
|
if (fileSplitOnDot.size() == 2)
|
||||||
if (std::ifstream(rftFileStdString.c_str()))
|
|
||||||
{
|
{
|
||||||
m_readerEclipseRft = new RifReaderEclipseRft(rftFileStdString);
|
QString rftFile = fileSplitOnDot[0] + ".RFT";
|
||||||
|
std::string rftFileStdString = rftFile.toStdString();
|
||||||
|
if (std::ifstream(rftFileStdString.c_str()))
|
||||||
|
{
|
||||||
|
m_readerEclipseRft = new RifReaderEclipseRft(rftFileStdString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -136,6 +136,8 @@ void RimWellLogRftCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
|||||||
std::vector<double> values = xValues();
|
std::vector<double> values = xValues();
|
||||||
std::vector<double> depthVector = depthValues();
|
std::vector<double> depthVector = depthValues();
|
||||||
|
|
||||||
|
if (values.empty() || depthVector.empty()) return;
|
||||||
|
|
||||||
if (values.size() == depthVector.size())
|
if (values.size() == depthVector.size())
|
||||||
{
|
{
|
||||||
m_curveData->setValuesAndMD(values, depthVector, RiaEclipseUnitTools::depthUnit(m_eclipseResultCase->eclipseCaseData()->unitsType()), false);
|
m_curveData->setValuesAndMD(values, depthVector, RiaEclipseUnitTools::depthUnit(m_eclipseResultCase->eclipseCaseData()->unitsType()), false);
|
||||||
@ -162,6 +164,7 @@ void RimWellLogRftCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderi
|
|||||||
RimPlotCurve::updateOptionSensitivity();
|
RimPlotCurve::updateOptionSensitivity();
|
||||||
|
|
||||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data");
|
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data");
|
||||||
|
curveDataGroup->add(&m_eclipseResultCase);
|
||||||
curveDataGroup->add(&m_wellName);
|
curveDataGroup->add(&m_wellName);
|
||||||
curveDataGroup->add(&m_wellLogChannelName);
|
curveDataGroup->add(&m_wellLogChannelName);
|
||||||
curveDataGroup->add(&m_timeStep);
|
curveDataGroup->add(&m_timeStep);
|
||||||
@ -191,19 +194,42 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions(const ca
|
|||||||
|
|
||||||
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
||||||
}
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_wellName)
|
||||||
if (fieldNeedingOptions == &m_wellLogChannelName)
|
|
||||||
{
|
{
|
||||||
RimTools::caseOptionItems(&options);
|
options.push_back(caf::PdmOptionItemInfo("None", nullptr));
|
||||||
|
RifReaderEclipseRft* reader = rftReader();
|
||||||
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
if (reader)
|
||||||
|
{
|
||||||
|
std::set<QString> wellNames = reader->wellNames();
|
||||||
|
for (const QString& name : wellNames)
|
||||||
|
{
|
||||||
|
options.push_back(caf::PdmOptionItemInfo(name, name, false, QIcon(":/Well.png")));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_wellLogChannelName)
|
||||||
if (fieldNeedingOptions == &m_timeStep)
|
|
||||||
{
|
{
|
||||||
RimTools::caseOptionItems(&options);
|
options.push_back(caf::PdmOptionItemInfo("None", nullptr));
|
||||||
|
|
||||||
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
for (const QString& channelName : RifEclipseRftAddress::allWellLogChannelNames())
|
||||||
|
{
|
||||||
|
options.push_back(caf::PdmOptionItemInfo(channelName, channelName));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_timeStep)
|
||||||
|
{
|
||||||
|
RifReaderEclipseRft* reader = rftReader();
|
||||||
|
if (reader)
|
||||||
|
{
|
||||||
|
std::vector<QDateTime> timeStamps = reader->availableTimeSteps(m_wellName, m_wellLogChannelName);
|
||||||
|
for (const QDateTime& dt : timeStamps)
|
||||||
|
{
|
||||||
|
options.push_back(caf::PdmOptionItemInfo(dt.toString(), nullptr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
options.push_back(caf::PdmOptionItemInfo("None", nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
@ -215,8 +241,11 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions(const ca
|
|||||||
void RimWellLogRftCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void RimWellLogRftCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
RimWellLogCurve::fieldChangedByUi(changedField, oldValue, newValue);
|
RimWellLogCurve::fieldChangedByUi(changedField, oldValue, newValue);
|
||||||
|
if (changedField == &m_eclipseResultCase)
|
||||||
if (changedField == &m_wellName)
|
{
|
||||||
|
this->loadDataAndUpdate(true);
|
||||||
|
}
|
||||||
|
else if (changedField == &m_wellName)
|
||||||
{
|
{
|
||||||
this->loadDataAndUpdate(true);
|
this->loadDataAndUpdate(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user