#2077 Well Allocation Plot: Set default formation name values

This commit is contained in:
Rebecca Cox 2017-11-05 12:26:27 +01:00
parent ae372a4a79
commit bf00807aee
3 changed files with 50 additions and 12 deletions

View File

@ -248,6 +248,7 @@ void RimWellAllocationPlot::updateFromWell()
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plotTrack->setDescription(QString("Branch %1").arg(brIdx + 1));
plotTrack->setBranchIndex((int)brIdx);
accumulatedWellFlowPlot()->addTrack(plotTrack);

View File

@ -44,6 +44,7 @@
#include "RimProject.h"
#include "RimTools.h"
#include "RimWellFlowRateCurve.h"
#include "RimWellAllocationPlot.h"
#include "RimWellLogCurve.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
@ -259,6 +260,16 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
m_formationCase = cases[0];
}
}
RimWellAllocationPlot* wellAllocationPlot;
firstAncestorOrThisOfType(wellAllocationPlot);
if (wellAllocationPlot)
{
m_trajectoryType = RimWellLogTrack::SIMULATION_WELL;
m_simulationWellChosen = true;
m_simWellName = wellAllocationPlot->wellName();
}
}
loadDataAndUpdate();
@ -508,29 +519,32 @@ void RimWellLogTrack::loadDataAndUpdate()
}
else
{
m_trajectoryType == RimWellLogTrack::SIMULATION_WELL;
m_trajectoryType = RimWellLogTrack::SIMULATION_WELL;
m_simulationWellChosen = true;
m_simWellName = wellName;
m_branchIndex = rftPlot->branchIndex();
}
}
if (m_showFormations)
RimWellAllocationPlot* wellAllocationPlot;
(rftPlot || pltPlot) ? wellAllocationPlot = nullptr : firstAncestorOrThisOfType(wellAllocationPlot);
if (wellAllocationPlot)
{
m_trajectoryType.uiCapability()->setUiReadOnly(false);
m_simWellName.uiCapability()->setUiReadOnly(false);
m_formationCase.uiCapability()->setUiReadOnly(false);
m_wellPath.uiCapability()->setUiReadOnly(false);
m_branchIndex.uiCapability()->setUiReadOnly(false);
setFormationFieldsUiReadOnly(true);
}
else
{
m_trajectoryType.uiCapability()->setUiReadOnly(true);
m_simWellName.uiCapability()->setUiReadOnly(true);
m_formationCase.uiCapability()->setUiReadOnly(true);
m_wellPath.uiCapability()->setUiReadOnly(true);
m_branchIndex.uiCapability()->setUiReadOnly(true);
if (m_showFormations)
{
setFormationFieldsUiReadOnly(false);
}
else
{
setFormationFieldsUiReadOnly(true);
}
}
updateFormationNamesOnPlot();
}
@ -543,6 +557,14 @@ void RimWellLogTrack::setXAxisTitle(const QString& text)
m_xAxisTitle = text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setBranchIndex(int branchIndex)
{
m_branchIndex = branchIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -1054,6 +1076,18 @@ std::vector<QString> RimWellLogTrack::formationNamesVector(RimCase* rimCase)
return std::vector<QString>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setFormationFieldsUiReadOnly(bool readOnly /*= true*/)
{
m_trajectoryType.uiCapability()->setUiReadOnly(readOnly);
m_simWellName.uiCapability()->setUiReadOnly(readOnly);
m_formationCase.uiCapability()->setUiReadOnly(readOnly);
m_wellPath.uiCapability()->setUiReadOnly(readOnly);
m_branchIndex.uiCapability()->setUiReadOnly(readOnly);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -77,6 +77,7 @@ public:
size_t curveIndex(RimWellLogCurve* curve);
size_t curveCount() { return curves.size(); }
void setXAxisTitle(const QString& text);
void setBranchIndex(int branchIndex);
void recreateViewer();
void detachAllCurves();
@ -132,6 +133,8 @@ private:
static std::vector<QString> formationNamesVector(RimCase* rimCase);
void setFormationFieldsUiReadOnly(bool readOnly = true);
void updateFormationNamesOnPlot();
void removeFormationNames();
void updateAxisScaleEngine();