mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Handle no data gracefully
This commit is contained in:
@@ -75,7 +75,18 @@ void RimWellLogFileCurve::updatePlotData()
|
|||||||
if (logFileInfo)
|
if (logFileInfo)
|
||||||
{
|
{
|
||||||
RigWellLogFile* wellLogFile = logFileInfo->wellLogFile();
|
RigWellLogFile* wellLogFile = logFileInfo->wellLogFile();
|
||||||
m_plotCurve->setSamples(wellLogFile->values(m_wellLogChannnelName).data(), wellLogFile->depthValues().data(), (int) wellLogFile->depthValues().size());
|
|
||||||
|
std::vector<double> values = wellLogFile->values(m_wellLogChannnelName);
|
||||||
|
std::vector<double> depthValues = wellLogFile->depthValues();
|
||||||
|
|
||||||
|
if (values.size() > 0 && depthValues.size() > 0)
|
||||||
|
{
|
||||||
|
m_plotCurve->setSamples(values.data(), depthValues.data(), (int) depthValues.size());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_plotCurve->setSamples(NULL, NULL, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -204,6 +215,11 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions(const c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (optionList.size() == 0)
|
||||||
|
{
|
||||||
|
optionList.push_back(caf::PdmOptionItemInfo("None", "None"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return optionList;
|
return optionList;
|
||||||
|
|||||||
@@ -130,5 +130,11 @@ std::vector<double> RigWellLogFile::values(const QString& name) const
|
|||||||
// TODO: Possibly handle discrete logs
|
// TODO: Possibly handle discrete logs
|
||||||
|
|
||||||
CVF_ASSERT(m_wellLogFile);
|
CVF_ASSERT(m_wellLogFile);
|
||||||
return m_wellLogFile->GetContLog(name.toStdString());
|
|
||||||
|
if (m_wellLogFile->HasContLog(name.toStdString()))
|
||||||
|
{
|
||||||
|
return m_wellLogFile->GetContLog(name.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::vector<double>();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user