Skip to content

Commit

Permalink
#1138 - pre-proto - Added possibility to visualize all properties in …
Browse files Browse the repository at this point in the history
…input XML stimPlan file
  • Loading branch information
astridkbjorke committed Feb 17, 2017
1 parent e971c52 commit 1b99c25
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 52 deletions.
17 changes: 2 additions & 15 deletions ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,8 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
else return;

int timeStepIndex = m_rimFracture->stimPlanTimeIndexToPlot;
std::vector<std::vector<double> > dataToPlot;

if (m_rimFracture->stimPlanParameterToPlot == RimFracture::CONDUCTIVITY)
{
dataToPlot = stimPlanFracTemplate->getConductivitiesAtTimeStep(timeStepIndex);
}
else if (m_rimFracture->stimPlanParameterToPlot == RimFracture::PERMEABILITY)
{
dataToPlot = stimPlanFracTemplate->getPermeabilitiesAtTimeStep(timeStepIndex);

}
else if (m_rimFracture->stimPlanParameterToPlot == RimFracture::WIDTH)
{
dataToPlot = stimPlanFracTemplate->getWidthsAtTimeStep(timeStepIndex);
}
QString resultToPlot = m_rimFracture->stimPlanParameterToPlot;
std::vector<std::vector<double> > dataToPlot = stimPlanFracTemplate->getDataAtTimeIndex(resultToPlot, timeStepIndex);

if (dataToPlot.empty()) return; //TODO: Set all values to undefined if no data available...

Expand Down
52 changes: 27 additions & 25 deletions ApplicationCode/ProjectDataModel/RimFracture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,6 @@
#include <QDebug>
#include <QString>


namespace caf
{
template<>

void caf::AppEnum< RimFracture::stimPlanPlotParameterEnum>::setUp()
{
addItem(RimFracture::CONDUCTIVITY, "Cond", "Conductivity");
addItem(RimFracture::PERMEABILITY, "Perm", "Permeability");
addItem(RimFracture::WIDTH, "Width", "Width");

setDefault(RimFracture::CONDUCTIVITY);
}
}

CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimFracture, "Fracture");

//--------------------------------------------------------------------------------------------------
Expand All @@ -101,7 +86,7 @@ RimFracture::RimFracture(void)
azimuth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
CAF_PDM_InitField(&perforationLength, "PerforationLength", 0.0, "PerforationLength", "", "", "");

CAF_PDM_InitField(&stimPlanParameterToPlot, "parameterToPlot", caf::AppEnum<stimPlanPlotParameterEnum>(WIDTH), "Parameter from StimPlan file to plot", "", "", "");
CAF_PDM_InitField(&stimPlanParameterToPlot, "parameterToPlot", QString(""), "Parameter from StimPlan file to plot", "", "", "");
CAF_PDM_InitField(&stimPlanTimeIndexToPlot, "timeIndexToPlot", 0, "Timestep from StimPlan file to plot", "", "", "");

CAF_PDM_InitField(&m_i, "I", 1, "Fracture location cell I", "", "", "");
Expand Down Expand Up @@ -596,7 +581,6 @@ QString RimFracture::createOneBasedIJK() const
return QString("Cell : [%1, %2, %3]").arg(m_i + 1).arg(m_j + 1).arg(m_k + 1);
}


//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -639,6 +623,22 @@ QList<caf::PdmOptionItemInfo> RimFracture::calculateValueOptions(const caf::PdmF

}
}
else if (fieldNeedingOptions == &stimPlanParameterToPlot)
{
RimFractureTemplate* fracTemplate = attachedFractureDefinition();
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate))
{
RimStimPlanFractureTemplate* fracTemplateStimPlan = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
std::vector<std::pair<QString, QString>> properties = fracTemplateStimPlan->getStimPlanPropertyNamesUnits();

for (std::pair<QString, QString> propNameUnit : properties)
{
QString nameAndUnit = propNameUnit.first + " [" + propNameUnit.second + "]";
QString name = propNameUnit.first;
options.push_back(caf::PdmOptionItemInfo(nameAndUnit, name));
}
}
}

return options;
}
Expand Down Expand Up @@ -706,10 +706,11 @@ void RimFracture::defineEditorAttribute(const caf::PdmFieldHandle* field, QStrin
//--------------------------------------------------------------------------------------------------
void RimFracture::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{
if (stimPlanParameterToPlot == RimFracture::CONDUCTIVITY) uiTreeOrdering.add(m_legendConfigConductivity);
else if (stimPlanParameterToPlot == RimFracture::PERMEABILITY) uiTreeOrdering.add(m_legendConfigPermeability);
else if (stimPlanParameterToPlot == RimFracture::WIDTH) uiTreeOrdering.add(m_legendConfigWidth);

//TODO
uiTreeOrdering.add(m_legendConfigConductivity);
// uiTreeOrdering.add(m_legendConfigPermeability);
// uiTreeOrdering.add(m_legendConfigWidth);

uiTreeOrdering.setForgetRemainingFields(true);
}

Expand Down Expand Up @@ -799,11 +800,12 @@ RivWellFracturePartMgr* RimFracture::fracturePartManager()
//--------------------------------------------------------------------------------------------------
RimLegendConfig* RimFracture::activeLegend()
{
if (stimPlanParameterToPlot == RimFracture::CONDUCTIVITY) return m_legendConfigConductivity;
else if (stimPlanParameterToPlot == RimFracture::PERMEABILITY) return m_legendConfigPermeability;
else if (stimPlanParameterToPlot == RimFracture::WIDTH) return m_legendConfigWidth;
// if (stimPlanParameterToPlot == RimFracture::CONDUCTIVITY) return m_legendConfigConductivity;
// else if (stimPlanParameterToPlot == RimFracture::PERMEABILITY) return m_legendConfigPermeability;
// else if (stimPlanParameterToPlot == RimFracture::WIDTH) return m_legendConfigWidth;
// return nullptr;

return nullptr;
return m_legendConfigConductivity;
}

//--------------------------------------------------------------------------------------------------
Expand Down
18 changes: 6 additions & 12 deletions ApplicationCode/ProjectDataModel/RimFracture.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,12 @@ class RimFracture : public caf::PdmObject
RimFracture(void);
virtual ~RimFracture(void);

caf::PdmField<QString> name;
caf::PdmField<double> azimuth;
caf::PdmField<double> perforationLength;

caf::PdmField<int> stimPlanTimeIndexToPlot;
enum stimPlanPlotParameterEnum
{
CONDUCTIVITY,
PERMEABILITY,
WIDTH
};
caf::PdmField< caf::AppEnum< stimPlanPlotParameterEnum > > stimPlanParameterToPlot;
caf::PdmField<QString> name;
caf::PdmField<double> azimuth;
caf::PdmField<double> perforationLength;

caf::PdmField<int> stimPlanTimeIndexToPlot;
caf::PdmField<QString> stimPlanParameterToPlot;


cvf::Vec3d anchorPosition();
Expand Down
22 changes: 22 additions & 0 deletions ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ void RimStimPlanFractureTemplate::loadDataAndUpdate()
}


//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::vector<double>> RimStimPlanFractureTemplate::getDataAtTimeIndex(QString resultName, size_t timeStepIndex)
{
return m_stimPlanFractureDefinitionData->getDataAtTimeIndex(resultName, timeStepIndex);
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -545,6 +553,20 @@ std::vector<double> RimStimPlanFractureTemplate::getStimPlanTimeValues()
return m_stimPlanFractureDefinitionData->timeSteps;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::pair<QString, QString> > RimStimPlanFractureTemplate::getStimPlanPropertyNamesUnits()
{
std::vector<RigStimPlanData > allStimPlanData = m_stimPlanFractureDefinitionData->stimPlanData;
std::vector<std::pair<QString, QString> > propertyNamesUnits;
for (RigStimPlanData stimPlanDataEntry : allStimPlanData)
{
propertyNamesUnits.push_back(std::make_pair(stimPlanDataEntry.resultName, stimPlanDataEntry.unit));
}
return propertyNamesUnits;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class RimStimPlanFractureTemplate : public RimFractureTemplate
std::vector<double> getNegAndPosXcoords();
std::vector<double> adjustedDepthCoordsAroundWellPathPosition();
std::vector<double> getStimPlanTimeValues();
std::vector<std::pair<QString, QString> > getStimPlanPropertyNamesUnits();


//TODO: Remove!!!
std::vector<std::vector<double>> getConductivitiesAtTimeStep(size_t timStep);
Expand All @@ -70,6 +72,7 @@ class RimStimPlanFractureTemplate : public RimFractureTemplate

void loadDataAndUpdate();

std::vector<std::vector<double>> getDataAtTimeIndex(QString resultName, size_t timeStepIndex);
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);

Expand Down

0 comments on commit 1b99c25

Please sign in to comment.