(#622) Show warning when hiding LAS curves in TVD plots

This warning can be disabled from preferences
This commit is contained in:
Magne Sjaastad 2015-10-30 11:42:11 +01:00
parent 11c76b9fcc
commit 6c864c5bed
3 changed files with 25 additions and 2 deletions

View File

@ -59,6 +59,8 @@ RiaPreferences::RiaPreferences(void)
CAF_PDM_InitField(&defaultViewerBackgroundColor, "defaultViewerBackgroundColor", cvf::Color3f(0.69f, 0.77f, 0.87f), "Viewer background", "", "The viewer background color for new views", "");
CAF_PDM_InitField(&defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Z scale factor", "", "", "");
CAF_PDM_InitField(&showLasCurveWithoutTvdWarning, "showLasCurveWithoutTvdWarning", true, "Show LAS curve without TVD warning", "", "", "");
showLasCurveWithoutTvdWarning.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
CAF_PDM_InitField(&useShaders, "useShaders", true, "Use Shaders", "", "", "");
useShaders.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
@ -109,7 +111,8 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt
field == &loadAndShowSoil ||
field == &useShaders ||
field == &showHud ||
field == &appendClassNameToUiText)
field == &appendClassNameToUiText ||
field == &showLasCurveWithoutTvdWarning )
{
caf::PdmUiCheckBoxEditorAttribute* myAttr = static_cast<caf::PdmUiCheckBoxEditorAttribute*>(attribute);
if (myAttr)
@ -141,6 +144,7 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
defaultSettingsGroup->add(&defaultGridLineColors);
defaultSettingsGroup->add(&defaultFaultGridLineColors);
defaultSettingsGroup->add(&defaultWellLabelColor);
defaultSettingsGroup->add(&showLasCurveWithoutTvdWarning);
caf::PdmUiGroup* autoComputeGroup = uiOrdering.addNewGroup("Behavior when loading new case");
autoComputeGroup->add(&autocomputeDepthRelatedProperties);

View File

@ -59,6 +59,8 @@ public: // Pdm Fields
caf::PdmField<cvf::Color3f> defaultFaultGridLineColors;
caf::PdmField<cvf::Color3f> defaultViewerBackgroundColor;
caf::PdmField<cvf::Color3f> defaultWellLabelColor;
caf::PdmField<bool> showLasCurveWithoutTvdWarning;
caf::PdmField<bool> useShaders;
caf::PdmField<bool> showHud;

View File

@ -32,9 +32,12 @@
#include "RiuWellLogPlotCurve.h"
#include "RiaApplication.h"
#include "RiaPreferences.h"
#include "cafPdmUiTreeOrdering.h"
#include <QMessageBox>
CAF_PDM_SOURCE_INIT(RimWellLogFileCurve, "WellLogFileCurve");
@ -73,7 +76,21 @@ void RimWellLogFileCurve::updatePlotData()
{
m_curveData = new RigWellLogCurveData;
if (m_wellPath)
RimWellLogPlot* wellLogPlot;
firstAnchestorOrThisOfType(wellLogPlot);
CVF_ASSERT(wellLogPlot);
if (wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
{
if (RiaApplication::instance()->preferences()->showLasCurveWithoutTvdWarning())
{
QString tmp = QString("Display of True Vertical Depth (TVD) for LAS curves in not yet supported, and no LAS curve will be displayed in this mode.\n\n");
tmp += "Control display of this warning from \"Preferences->Show LAS curve without TVD warning\"";
QMessageBox::warning(NULL, "LAS curve without TVD", tmp);
}
}
else if (m_wellPath)
{
RimWellLogFile* logFileInfo = m_wellPath->m_wellLogFile;
if (logFileInfo)