mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#1842 RFT Plot. Implement property view and RFT plot commands
This commit is contained in:
parent
536225eb7e
commit
141bfd27d7
@ -8,6 +8,7 @@ set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicAddWellLogToPlotFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogCurveExtractionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewRftPlotFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteRftPlotFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogFileCurveFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotFeatureImpl.h
|
||||
@ -28,6 +29,7 @@ set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicAddWellLogToPlotFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogCurveExtractionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewRftPlotFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteRftPlotFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogFileCurveFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotFeatureImpl.cpp
|
||||
|
@ -1,6 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -16,48 +17,63 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimWellRftPlotLegend.h"
|
||||
#include "RicDeleteRftPlotFeature.h"
|
||||
|
||||
#include "RimRftPlotCollection.h"
|
||||
#include "RimWellRftPlot.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellRftPlotLegend, "WellRftPlotLegend");
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicDeleteRftPlotFeature, "RicDeleteRftPlotFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellRftPlotLegend::RimWellRftPlotLegend()
|
||||
bool RicDeleteRftPlotFeature::isCommandEnabled()
|
||||
{
|
||||
CAF_PDM_InitObject("Legend", ":/WellAllocLegend16x16.png", "", "");
|
||||
CAF_PDM_InitField(&m_showLegend, "ShowPlotLegend", true, "Show Plot Legend", "", "", "");
|
||||
std::vector<RimWellRftPlot*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellRftPlotLegend::~RimWellRftPlotLegend()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimWellRftPlotLegend::objectToggleField()
|
||||
{
|
||||
return &m_showLegend;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlotLegend::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &m_showLegend)
|
||||
if (objects.size() > 0)
|
||||
{
|
||||
RimWellRftPlot* walp;
|
||||
firstAncestorOrThisOfType(walp);
|
||||
|
||||
if (walp) walp->showPlotLegend(m_showLegend());
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDeleteRftPlotFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellRftPlot*> selectedPlots;
|
||||
caf::SelectionManager::instance()->objectsByType(&selectedPlots);
|
||||
|
||||
if (selectedPlots.size() == 0) return;
|
||||
|
||||
RimWellRftPlot* firstPlot = selectedPlots[0];
|
||||
|
||||
RimRftPlotCollection* rftPlotCollection = nullptr;
|
||||
firstPlot->firstAncestorOrThisOfType(rftPlotCollection);
|
||||
if (!rftPlotCollection) return;
|
||||
|
||||
for (RimWellRftPlot* plot : selectedPlots)
|
||||
{
|
||||
rftPlotCollection->removePlot(plot);
|
||||
delete plot;
|
||||
}
|
||||
|
||||
rftPlotCollection->uiCapability()->updateConnectedEditors();
|
||||
//rftPlotCollection->scheduleRedrawAffectedViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDeleteRftPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Delete RFT Plot");
|
||||
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@ -18,30 +19,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimWellRftPlotLegend : public caf::PdmObject
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicDeleteRftPlotFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimWellRftPlotLegend();
|
||||
virtual ~RimWellRftPlotLegend();
|
||||
|
||||
bool isShowingLegend() { return m_showLegend();}
|
||||
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showLegend;
|
||||
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
@ -54,6 +54,7 @@ CAF_CMD_SOURCE_INIT(RicNewRftPlotFeature, "RicNewRftPlotFeature");
|
||||
bool RicNewRftPlotFeature::isCommandEnabled()
|
||||
{
|
||||
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
|
||||
return true;
|
||||
int branchIndex;
|
||||
return (selectedWellLogPlotTrack() != nullptr || selectedWellPath() != nullptr || selectedSimulationWell(&branchIndex) != nullptr) && caseAvailable();
|
||||
}
|
||||
@ -70,12 +71,17 @@ void RicNewRftPlotFeature::onActionTriggered(bool isChecked)
|
||||
auto rftPlotColl = proj->mainPlotCollection()->rftPlotCollection();
|
||||
if (rftPlotColl)
|
||||
{
|
||||
RiuSelectionItem* selItem = RiuSelectionManager::instance()->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
|
||||
RiuSimWellSelectionItem* simWellSelItem = dynamic_cast<RiuSimWellSelectionItem*>(selItem);
|
||||
QString plotName = QString("RFT: %1").arg(simWellSelItem != nullptr ? simWellSelItem->m_simWell->name : QString("(Unknown)"));
|
||||
std::vector<caf::PdmUiItem*> selectedItems;
|
||||
caf::SelectionManager::instance()->selectedItems(selectedItems);
|
||||
|
||||
// Todo: support other classes as well
|
||||
RimWellPath* simWellPath = dynamic_cast<RimWellPath*>(selectedItems.front());
|
||||
|
||||
QString plotName = QString("RFT: %1").arg(simWellPath != nullptr ? simWellPath->name() : QString("(Unknown)"));
|
||||
|
||||
auto plot = new RimWellRftPlot();
|
||||
rftPlotColl->rftPlots().push_back(plot);
|
||||
plot->setCurrentWellName(simWellPath->name());
|
||||
rftPlotColl->addPlot(plot);
|
||||
|
||||
plot->setDescription(plotName);
|
||||
plot->loadDataAndUpdate();
|
||||
|
@ -14,7 +14,6 @@ ${CEE_CURRENT_LIST_DIR}RimWellFlowRateCurve.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellAllocationPlotLegend.h
|
||||
${CEE_CURRENT_LIST_DIR}RimFlowCharacteristicsPlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellRftPlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellRftPlotLegend.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -27,7 +26,6 @@ ${CEE_CURRENT_LIST_DIR}RimWellFlowRateCurve.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellAllocationPlotLegend.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimFlowCharacteristicsPlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellRftPlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellRftPlotLegend.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -40,12 +40,18 @@
|
||||
#include "RimWellFlowRateCurve.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellRftPlotLegend.h"
|
||||
#include "RimTofAccumulatedPhaseFractionsPlot.h"
|
||||
|
||||
#include "RimOilField.h"
|
||||
#include "RiuMainPlotWindow.h"
|
||||
#include "RiuWellRftPlot.h"
|
||||
#include "RiuWellLogTrack.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
#include "SummaryPlotCommands/RicSummaryCurveCreatorUiKeywords.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellRftPlot, "WellRftPlot");
|
||||
|
||||
@ -53,18 +59,18 @@ CAF_PDM_SOURCE_INIT(RimWellRftPlot, "WellRftPlot");
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace caf
|
||||
{
|
||||
|
||||
template<>
|
||||
void AppEnum<RimWellRftPlot::FlowType>::setUp()
|
||||
{
|
||||
addItem(RimWellRftPlot::ACCUMULATED, "ACCUMULATED", "Accumulated");
|
||||
addItem(RimWellRftPlot::INFLOW, "INFLOW", "Inflow Rates");
|
||||
setDefault(RimWellRftPlot::ACCUMULATED);
|
||||
|
||||
}
|
||||
}
|
||||
//namespace caf
|
||||
//{
|
||||
//
|
||||
//template<>
|
||||
//void AppEnum<RimWellRftPlot::FlowType>::setUp()
|
||||
//{
|
||||
// addItem(RimWellRftPlot::ACCUMULATED, "ACCUMULATED", "Accumulated");
|
||||
// addItem(RimWellRftPlot::INFLOW, "INFLOW", "Inflow Rates");
|
||||
// setDefault(RimWellRftPlot::ACCUMULATED);
|
||||
//
|
||||
//}
|
||||
//}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -73,45 +79,29 @@ RimWellRftPlot::RimWellRftPlot()
|
||||
{
|
||||
CAF_PDM_InitObject("Well Allocation Plot", ":/WellAllocPlot16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_userName, "PlotDescription", QString("Flow Diagnostics Plot"), "Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_userName, "PlotDescription", QString("RFT Plot"), "Name", "", "", "");
|
||||
m_userName.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_case, "CurveCase", "Case", "", "", "");
|
||||
m_case.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_timeStep, "PlotTimeStep", 0, "Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&m_wellName, "WellName", QString("None"), "Well", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_flowDiagSolution, "FlowDiagSolution", "Plot Type", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_flowType, "FlowType", "Flow Type", "", "", "");
|
||||
CAF_PDM_InitField(&m_groupSmallContributions, "GroupSmallContributions", true, "Group Small Contributions", "", "", "");
|
||||
CAF_PDM_InitField(&m_smallContributionsThreshold, "SmallContributionsThreshold", 0.005, "Threshold", "", "", "");
|
||||
//CAF_PDM_InitFieldNoDefault(&m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow", "", "", "");
|
||||
//m_accumulatedWellFlowPlot.uiCapability()->setUiHidden(true);
|
||||
//m_accumulatedWellFlowPlot = new RimWellLogPlot;
|
||||
//m_accumulatedWellFlowPlot->setDepthUnit(RiaDefines::UNIT_NONE);
|
||||
//m_accumulatedWellFlowPlot->setDepthType(RimWellLogPlot::CONNECTION_NUMBER);
|
||||
//m_accumulatedWellFlowPlot->setTrackLegendsVisible(false);
|
||||
//m_accumulatedWellFlowPlot->uiCapability()->setUiIcon(QIcon(":/WellFlowPlot16x16.png"));
|
||||
|
||||
//CAF_PDM_InitFieldNoDefault(&m_totalWellAllocationPlot, "TotalWellFlowPlot", "Total Well Flow", "", "", "");
|
||||
//m_totalWellAllocationPlot.uiCapability()->setUiHidden(true);
|
||||
//m_totalWellAllocationPlot = new RimTotalWellAllocationPlot;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellLogPlot, "WellLog", "WellLog", "", "", "");
|
||||
m_wellLogPlot.uiCapability()->setUiHidden(true);
|
||||
m_wellLogPlot = new RimWellLogPlot();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_rftPlotLegend, "WellLogLegend", "Legend", "", "", "");
|
||||
m_rftPlotLegend.uiCapability()->setUiHidden(true);
|
||||
m_rftPlotLegend = new RimWellRftPlotLegend();
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellName, "WellName", "WellName", "", "", "");
|
||||
|
||||
//CAF_PDM_InitFieldNoDefault(&m_tofAccumulatedPhaseFractionsPlot, "TofAccumulatedPhaseFractionsPlot", "TOF Accumulated Phase Fractions", "", "", "");
|
||||
//m_tofAccumulatedPhaseFractionsPlot.uiCapability()->setUiHidden(true);
|
||||
//m_tofAccumulatedPhaseFractionsPlot = new RimTofAccumulatedPhaseFractionsPlot;
|
||||
CAF_PDM_InitFieldNoDefault(&m_selectedSources, "Sources", "Sources", "", "", "");
|
||||
m_selectedSources.uiCapability()->setUiEditorTypeName(caf::PdmUiTreeSelectionEditor::uiEditorTypeName());
|
||||
m_selectedSources.xmlCapability()->setIOReadable(false);
|
||||
m_selectedSources.xmlCapability()->setIOWritable(false);
|
||||
m_selectedSources.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
this->setAsPlotMdiWindow();
|
||||
CAF_PDM_InitFieldNoDefault(&m_selectedTimeSteps, "TimeSteps", "TimeSteps", "", "", "");
|
||||
m_selectedTimeSteps.uiCapability()->setUiEditorTypeName(caf::PdmUiTreeSelectionEditor::uiEditorTypeName());
|
||||
m_selectedTimeSteps.xmlCapability()->setIOReadable(false);
|
||||
m_selectedTimeSteps.xmlCapability()->setIOWritable(false);
|
||||
m_selectedTimeSteps.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
//this->setAsPlotMdiWindow();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -124,30 +114,6 @@ RimWellRftPlot::~RimWellRftPlot()
|
||||
deleteViewWidget();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::setFromSimulationWell(RimEclipseWell* simWell)
|
||||
{
|
||||
RimEclipseView* eclView;
|
||||
simWell->firstAncestorOrThisOfType(eclView);
|
||||
RimEclipseResultCase* eclCase;
|
||||
simWell->firstAncestorOrThisOfType(eclCase);
|
||||
|
||||
m_case = eclCase;
|
||||
m_wellName = simWell->wellResults()->m_wellName;
|
||||
m_timeStep = eclView->currentTimeStep();
|
||||
|
||||
// Use the active flow diag solutions, or the first one as default
|
||||
m_flowDiagSolution = eclView->cellResult()->flowDiagSolution();
|
||||
if ( !m_flowDiagSolution )
|
||||
{
|
||||
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
|
||||
}
|
||||
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -165,275 +131,6 @@ void RimWellRftPlot::deleteViewWidget()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::updateFromWell()
|
||||
{
|
||||
// Delete existing tracks
|
||||
{
|
||||
std::vector<RimWellLogTrack*> tracks;
|
||||
wellLogPlot()->descendantsIncludingThisOfType(tracks);
|
||||
|
||||
for (RimWellLogTrack* t : tracks)
|
||||
{
|
||||
wellLogPlot()->removeTrack(t);
|
||||
delete t;
|
||||
}
|
||||
}
|
||||
|
||||
CVF_ASSERT(wellLogPlot()->trackCount() == 0);
|
||||
|
||||
QString description;
|
||||
if (m_flowType() == ACCUMULATED) description = "Well Log";
|
||||
if (m_flowType() == INFLOW) description = "Inflow Rates";
|
||||
|
||||
wellLogPlot()->setDescription(description + " (" + m_wellName + ")");
|
||||
|
||||
if (!m_case) return;
|
||||
|
||||
const RigSingleWellResultsData* wellResults = m_case->eclipseCaseData()->findWellResult(m_wellName);
|
||||
|
||||
if (!wellResults) return;
|
||||
|
||||
// Set up the Accumulated Well Flow Calculator
|
||||
|
||||
std::vector< std::vector <cvf::Vec3d> > pipeBranchesCLCoords;
|
||||
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
||||
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame(m_case->eclipseCaseData(),
|
||||
wellResults,
|
||||
m_timeStep,
|
||||
true,
|
||||
true,
|
||||
pipeBranchesCLCoords,
|
||||
pipeBranchesCellIds);
|
||||
|
||||
std::map<QString, const std::vector<double>* > tracerFractionCellValues = findRelevantTracerCellFractions(wellResults);
|
||||
|
||||
std::unique_ptr< RigAccWellFlowCalculator > wfCalculator;
|
||||
|
||||
double smallContributionThreshold = 0.0;
|
||||
if (m_groupSmallContributions()) smallContributionThreshold = m_smallContributionsThreshold;
|
||||
|
||||
if ( tracerFractionCellValues.size() )
|
||||
{
|
||||
bool isProducer = ( wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::PRODUCER
|
||||
|| wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE );
|
||||
RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL));
|
||||
wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords,
|
||||
pipeBranchesCellIds,
|
||||
tracerFractionCellValues,
|
||||
cellIdxCalc,
|
||||
smallContributionThreshold,
|
||||
isProducer));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pipeBranchesCLCoords.size() > 0)
|
||||
{
|
||||
wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords,
|
||||
pipeBranchesCellIds,
|
||||
smallContributionThreshold));
|
||||
}
|
||||
}
|
||||
|
||||
auto depthType = wellLogPlot()->depthType();
|
||||
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH ) return;
|
||||
|
||||
// Create tracks and curves from the calculated data
|
||||
|
||||
size_t branchCount = pipeBranchesCLCoords.size();
|
||||
for (size_t brIdx = 0; brIdx < branchCount; ++brIdx)
|
||||
{
|
||||
// Skip Tiny dummy branches
|
||||
if (pipeBranchesCellIds[brIdx].size() <= 3) continue;
|
||||
|
||||
RimWellLogTrack* plotTrack = new RimWellLogTrack();
|
||||
|
||||
plotTrack->setDescription(QString("Branch %1").arg(brIdx + 1));
|
||||
|
||||
wellLogPlot()->addTrack(plotTrack);
|
||||
|
||||
const std::vector<double>& depthValues = depthType == RimWellLogPlot::CONNECTION_NUMBER ? wfCalculator->connectionNumbersFromTop(brIdx) :
|
||||
depthType == RimWellLogPlot::PSEUDO_LENGTH ? wfCalculator->pseudoLengthFromTop(brIdx) :
|
||||
depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH ? wfCalculator->trueVerticalDepth(brIdx) :
|
||||
std::vector<double>();
|
||||
|
||||
{
|
||||
std::vector<QString> tracerNames = wfCalculator->tracerNames();
|
||||
for (const QString& tracerName: tracerNames)
|
||||
{
|
||||
const std::vector<double>* accFlow = nullptr;
|
||||
if (depthType == RimWellLogPlot::CONNECTION_NUMBER)
|
||||
{
|
||||
accFlow = &(m_flowType == ACCUMULATED ?
|
||||
wfCalculator->accumulatedTracerFlowPrConnection(tracerName, brIdx):
|
||||
wfCalculator->tracerFlowPrConnection(tracerName, brIdx));
|
||||
}
|
||||
else if ( depthType == RimWellLogPlot::PSEUDO_LENGTH || depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
|
||||
{
|
||||
accFlow = &(m_flowType == ACCUMULATED ?
|
||||
wfCalculator->accumulatedTracerFlowPrPseudoLength(tracerName, brIdx):
|
||||
wfCalculator->tracerFlowPrPseudoLength(tracerName, brIdx));
|
||||
}
|
||||
|
||||
addStackedCurve(tracerName, depthValues, *accFlow, plotTrack);
|
||||
//TODO: THIs is the data to be plotted...
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
updateWellFlowPlotXAxisTitle(plotTrack);
|
||||
|
||||
}
|
||||
|
||||
QString wellStatusText = QString("(%1)").arg(RimWellRftPlot::wellStatusTextForTimeStep(m_wellName, m_case, m_timeStep));
|
||||
|
||||
QString flowTypeText = m_flowDiagSolution() ? "Well Allocation": "Well Flow";
|
||||
setDescription(flowTypeText + ": " + m_wellName + " " + wellStatusText + ", " + m_case->timeStepStrings()[m_timeStep] + " (" + m_case->caseUserDescription() + ")");
|
||||
|
||||
/// Pie chart
|
||||
|
||||
//m_totalWellAllocationPlot->clearSlices();
|
||||
//if (m_wellLogPlotWidget) m_WellRftPlotWidget->clearLegend();
|
||||
|
||||
//if (wfCalculator)
|
||||
//{
|
||||
// std::vector<std::pair<QString, double> > totalTracerFractions = wfCalculator->totalTracerFractions() ;
|
||||
|
||||
// for ( const auto& tracerVal : totalTracerFractions )
|
||||
// {
|
||||
// cvf::Color3f color;
|
||||
// if (m_flowDiagSolution)
|
||||
// color = m_flowDiagSolution->tracerColor(tracerVal.first);
|
||||
// else
|
||||
// color = getTracerColor(tracerVal.first);
|
||||
|
||||
// double tracerPercent = 100*tracerVal.second;
|
||||
|
||||
// m_totalWellAllocationPlot->addSlice(tracerVal.first, color, tracerPercent);
|
||||
// if ( m_WellRftPlotWidget ) m_WellRftPlotWidget->addLegendItem(tracerVal.first, color, tracerPercent);
|
||||
// }
|
||||
//}
|
||||
|
||||
//if (m_WellRftPlotWidget) m_WellRftPlotWidget->showLegend(m_WellRftPlotLegend->isShowingLegend());
|
||||
//m_totalWellAllocationPlot->updateConnectedEditors();
|
||||
|
||||
//accumulatedWellFlowPlot()->updateConnectedEditors();
|
||||
|
||||
//m_tofAccumulatedPhaseFractionsPlot->reloadFromWell();
|
||||
//m_tofAccumulatedPhaseFractionsPlot->updateConnectedEditors();
|
||||
|
||||
//if (m_WellRftPlotWidget) m_WellRftPlotWidget->updateGeometry();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<QString, const std::vector<double> *> RimWellRftPlot::findRelevantTracerCellFractions(const RigSingleWellResultsData* wellResults)
|
||||
{
|
||||
std::map<QString, const std::vector<double> *> tracerCellFractionValues;
|
||||
|
||||
if ( m_flowDiagSolution && wellResults->hasWellResult(m_timeStep) )
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::UNDEFINED;
|
||||
|
||||
const RigWellResultFrame::WellProductionType prodType = wellResults->wellProductionType(m_timeStep);
|
||||
if ( prodType == RigWellResultFrame::PRODUCER
|
||||
|| prodType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE )
|
||||
{
|
||||
requestedTracerType = RimFlowDiagSolution::INJECTOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
requestedTracerType = RimFlowDiagSolution::PRODUCER;
|
||||
}
|
||||
|
||||
std::vector<QString> tracerNames = m_flowDiagSolution->tracerNames();
|
||||
for ( const QString& tracerName : tracerNames )
|
||||
{
|
||||
if ( m_flowDiagSolution->tracerStatusInTimeStep(tracerName, m_timeStep) == requestedTracerType )
|
||||
{
|
||||
RigFlowDiagResultAddress resAddr(RIG_FLD_CELL_FRACTION_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, tracerName.toStdString());
|
||||
const std::vector<double>* tracerCellFractions = m_flowDiagSolution->flowDiagResults()->resultValues(resAddr, m_timeStep);
|
||||
if (tracerCellFractions) tracerCellFractionValues[tracerName] = tracerCellFractions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tracerCellFractionValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTrack)
|
||||
{
|
||||
RiaEclipseUnitTools::UnitSystem unitSet = m_case->eclipseCaseData()->unitsType();
|
||||
|
||||
|
||||
if (m_flowDiagSolution)
|
||||
{
|
||||
QString unitText;
|
||||
switch ( unitSet )
|
||||
{
|
||||
case RiaEclipseUnitTools::UNITS_METRIC:
|
||||
unitText = "[m<sup>3</sup>/day]";
|
||||
break;
|
||||
case RiaEclipseUnitTools::UNITS_FIELD:
|
||||
unitText = "[Brl/day]";
|
||||
break;
|
||||
case RiaEclipseUnitTools::UNITS_LAB:
|
||||
unitText = "[cm<sup>3</sup>/hr]";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
plotTrack->setXAxisTitle("Reservoir Flow Rate " + unitText);
|
||||
}
|
||||
else
|
||||
{
|
||||
QString unitText;
|
||||
switch ( unitSet )
|
||||
{
|
||||
case RiaEclipseUnitTools::UNITS_METRIC:
|
||||
unitText = "[Liquid Sm<sup>3</sup>/day], [Gas kSm<sup>3</sup>/day]";
|
||||
break;
|
||||
case RiaEclipseUnitTools::UNITS_FIELD:
|
||||
unitText = "[Liquid BBL/day], [Gas BOE/day]";
|
||||
break;
|
||||
case RiaEclipseUnitTools::UNITS_LAB:
|
||||
unitText = "[cm<sup>3</sup>/hr]";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
plotTrack->setXAxisTitle("Surface Flow Rate " + unitText);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::addStackedCurve(const QString& tracerName,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack)
|
||||
{
|
||||
RimWellFlowRateCurve* curve = new RimWellFlowRateCurve;
|
||||
curve->setFlowValuesPrDepthValue(tracerName, depthValues, accFlow);
|
||||
|
||||
if ( m_flowDiagSolution )
|
||||
{
|
||||
curve->setColor(m_flowDiagSolution->tracerColor(tracerName));
|
||||
}
|
||||
else
|
||||
{
|
||||
curve->setColor(getTracerColor(tracerName));
|
||||
}
|
||||
|
||||
plotTrack->addCurve(curve);
|
||||
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -456,51 +153,6 @@ void RimWellRftPlot::updateWidgetTitleWindowTitle()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellRftPlot::wellStatusTextForTimeStep(const QString& wellName, const RimEclipseResultCase* eclipseResultCase, size_t timeStep)
|
||||
{
|
||||
QString statusText = "Undefined";
|
||||
|
||||
if (eclipseResultCase)
|
||||
{
|
||||
const RigSingleWellResultsData* wellResults = eclipseResultCase->eclipseCaseData()->findWellResult(wellName);
|
||||
|
||||
if (wellResults)
|
||||
{
|
||||
if (wellResults->hasWellResult(timeStep))
|
||||
{
|
||||
const RigWellResultFrame& wellResultFrame = wellResults->wellResultFrame(timeStep);
|
||||
|
||||
RigWellResultFrame::WellProductionType prodType = wellResultFrame.m_productionType;
|
||||
|
||||
switch (prodType)
|
||||
{
|
||||
case RigWellResultFrame::PRODUCER:
|
||||
statusText = "Producer";
|
||||
break;
|
||||
case RigWellResultFrame::OIL_INJECTOR:
|
||||
statusText = "Oil Injector";
|
||||
break;
|
||||
case RigWellResultFrame::GAS_INJECTOR:
|
||||
statusText = "Gas Injector";
|
||||
break;
|
||||
case RigWellResultFrame::WATER_INJECTOR:
|
||||
statusText = "Water Injector";
|
||||
break;
|
||||
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return statusText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -520,28 +172,7 @@ void RimWellRftPlot::zoomAll()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//RimWellLogPlot* RimWellRftPlot::accumulatedWellFlowPlot()
|
||||
//{
|
||||
// return m_accumulatedWellFlowPlot();
|
||||
//}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//RimTotalWellAllocationPlot* RimWellRftPlot::totalWellFlowPlot()
|
||||
//{
|
||||
// return m_totalWellAllocationPlot();
|
||||
//}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//RimTofAccumulatedPhaseFractionsPlot * RimWellRftPlot::tofAccumulatedPhaseFractionsPlot()
|
||||
//{
|
||||
// return m_tofAccumulatedPhaseFractionsPlot();
|
||||
//}
|
||||
|
||||
RimWellLogPlot* RimWellRftPlot::wellLogPlot() const
|
||||
RimWellLogPlot* RimWellRftPlot::wellLogPlot() const
|
||||
{
|
||||
return m_wellLogPlot();
|
||||
}
|
||||
@ -549,25 +180,17 @@ RimWellLogPlot* RimWellRftPlot::wellLogPlot() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObject* RimWellRftPlot::plotLegend()
|
||||
void RimWellRftPlot::setCurrentWellName(const QString& currWellName)
|
||||
{
|
||||
return m_rftPlotLegend;
|
||||
m_wellName = currWellName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseResultCase* RimWellRftPlot::rimCase()
|
||||
QString RimWellRftPlot::currentWellName() const
|
||||
{
|
||||
return m_case();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimWellRftPlot::timeStep()
|
||||
{
|
||||
return m_timeStep();
|
||||
return m_wellName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -579,159 +202,66 @@ QList<caf::PdmOptionItemInfo> RimWellRftPlot::calculateValueOptions(const caf::P
|
||||
|
||||
if (fieldNeedingOptions == &m_wellName)
|
||||
{
|
||||
std::set<QString> sortedWellNames = this->findSortedWellNames();
|
||||
|
||||
QIcon simWellIcon(":/Well.png");
|
||||
for ( const QString& wname: sortedWellNames )
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(wname, wname, false, simWellIcon));
|
||||
}
|
||||
|
||||
if (options.size() == 0)
|
||||
{
|
||||
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
||||
}
|
||||
calculateValueOptionsForWells(options);
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_timeStep)
|
||||
else if (fieldNeedingOptions == &m_selectedSources)
|
||||
{
|
||||
QStringList timeStepNames;
|
||||
calculateValueOptionsForObservedData(options);
|
||||
|
||||
if (m_case && m_case->eclipseCaseData())
|
||||
{
|
||||
timeStepNames = m_case->timeStepStrings();
|
||||
}
|
||||
|
||||
for (int i = 0; i < timeStepNames.size(); i++)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(timeStepNames[i], i));
|
||||
}
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_case)
|
||||
else if (fieldNeedingOptions == &m_selectedTimeSteps)
|
||||
{
|
||||
RimProject* proj = nullptr;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj)
|
||||
{
|
||||
std::vector<RimEclipseResultCase*> cases;
|
||||
proj->descendantsIncludingThisOfType(cases);
|
||||
|
||||
for (RimEclipseResultCase* c : cases)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c, false, c->uiIcon()));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_flowDiagSolution)
|
||||
{
|
||||
if (m_case)
|
||||
{
|
||||
//std::vector<RimFlowDiagSolution*> flowSols = m_case->flowDiagSolutions();
|
||||
// options.push_back(caf::PdmOptionItemInfo("None", nullptr));
|
||||
//for (RimFlowDiagSolution* flowSol : flowSols)
|
||||
//{
|
||||
// options.push_back(caf::PdmOptionItemInfo(flowSol->userDescription(), flowSol, false, flowSol->uiIcon()));
|
||||
//}
|
||||
|
||||
RimFlowDiagSolution* defaultFlowSolution = m_case->defaultFlowDiagSolution();
|
||||
options.push_back(caf::PdmOptionItemInfo("Well Flow", nullptr));
|
||||
if (defaultFlowSolution)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo("Allocation", defaultFlowSolution ));
|
||||
}
|
||||
}
|
||||
options.push_back(caf::PdmOptionItemInfo("TimeStep 1", "TimeStep 1"));
|
||||
options.push_back(caf::PdmOptionItemInfo("TimeStep 2", "TimeStep 2"));
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellRftPlot::wellName() const
|
||||
{
|
||||
return m_wellName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::removeFromMdiAreaAndDeleteViewWidget()
|
||||
{
|
||||
removeMdiWindowFromMdiArea();
|
||||
deleteViewWidget();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::showPlotLegend(bool doShow)
|
||||
{
|
||||
if (m_wellLogPlotWidget) m_wellLogPlotWidget->showLegend(doShow);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
RimViewWindow::fieldChangedByUi(changedField, oldValue, newValue);
|
||||
//RimViewWindow::fieldChangedByUi(changedField, oldValue, newValue);
|
||||
|
||||
if (changedField == &m_userName ||
|
||||
changedField == &m_showPlotTitle)
|
||||
{
|
||||
updateWidgetTitleWindowTitle();
|
||||
}
|
||||
else if ( changedField == &m_case)
|
||||
{
|
||||
if ( m_flowDiagSolution && m_case )
|
||||
{
|
||||
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_flowDiagSolution = nullptr;
|
||||
}
|
||||
//if (changedField == &m_userName ||
|
||||
// changedField == &m_showPlotTitle)
|
||||
//{
|
||||
// updateWidgetTitleWindowTitle();
|
||||
//}
|
||||
//else if ( changedField == &m_case)
|
||||
//{
|
||||
// if ( m_flowDiagSolution && m_case )
|
||||
// {
|
||||
// m_flowDiagSolution = m_case->defaultFlowDiagSolution();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_flowDiagSolution = nullptr;
|
||||
// }
|
||||
|
||||
if (!m_case) m_timeStep = 0;
|
||||
else if (m_timeStep >= static_cast<int>(m_case->timeStepDates().size()))
|
||||
{
|
||||
m_timeStep = std::max(0, ((int)m_case->timeStepDates().size()) - 1);
|
||||
}
|
||||
// if (!m_case) m_timeStep = 0;
|
||||
// else if (m_timeStep >= static_cast<int>(m_case->timeStepDates().size()))
|
||||
// {
|
||||
// m_timeStep = std::max(0, ((int)m_case->timeStepDates().size()) - 1);
|
||||
// }
|
||||
|
||||
std::set<QString> sortedWellNames = findSortedWellNames();
|
||||
if (!sortedWellNames.size()) m_wellName = "";
|
||||
else if ( sortedWellNames.count(m_wellName()) == 0 ){ m_wellName = *sortedWellNames.begin();}
|
||||
// std::set<QString> sortedWellNames = findSortedWellNames();
|
||||
// if (!sortedWellNames.size()) m_wellName = "";
|
||||
// else if ( sortedWellNames.count(m_wellName()) == 0 ){ m_wellName = *sortedWellNames.begin();}
|
||||
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
else if ( changedField == &m_wellName
|
||||
|| changedField == &m_timeStep
|
||||
|| changedField == &m_flowDiagSolution
|
||||
|| changedField == &m_groupSmallContributions
|
||||
|| changedField == &m_smallContributionsThreshold
|
||||
|| changedField == &m_flowType )
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<QString> RimWellRftPlot::findSortedWellNames()
|
||||
{
|
||||
std::set<QString> sortedWellNames;
|
||||
if ( m_case && m_case->eclipseCaseData() )
|
||||
{
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellRes = m_case->eclipseCaseData()->wellResults();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellRes.size(); ++wIdx )
|
||||
{
|
||||
sortedWellNames.insert(wellRes[wIdx]->m_wellName);
|
||||
}
|
||||
}
|
||||
|
||||
return sortedWellNames;
|
||||
// loadDataAndUpdate();
|
||||
//}
|
||||
//else if ( changedField == &m_wellName
|
||||
// || changedField == &m_timeStep
|
||||
// || changedField == &m_flowDiagSolution
|
||||
// || changedField == &m_groupSmallContributions
|
||||
// || changedField == &m_smallContributionsThreshold
|
||||
// || changedField == &m_flowType )
|
||||
//{
|
||||
// loadDataAndUpdate();
|
||||
//}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -756,19 +286,60 @@ QImage RimWellRftPlot::snapshotWindowContent()
|
||||
void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_userName);
|
||||
uiOrdering.add(&m_wellName);
|
||||
|
||||
caf::PdmUiGroup* sourcesGroup = uiOrdering.addNewGroupWithKeyword("Sources", "Sources");
|
||||
sourcesGroup->add(&m_selectedSources);
|
||||
|
||||
caf::PdmUiGroup* timeStepsGroup = uiOrdering.addNewGroupWithKeyword("Time Steps", "TimeSteps");
|
||||
timeStepsGroup->add(&m_selectedTimeSteps);
|
||||
|
||||
uiOrdering.add(&m_showPlotTitle);
|
||||
}
|
||||
|
||||
caf::PdmUiGroup& dataGroup = *uiOrdering.addNewGroup("Plot Data");
|
||||
dataGroup.add(&m_case);
|
||||
dataGroup.add(&m_timeStep);
|
||||
dataGroup.add(&m_wellName);
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options)
|
||||
{
|
||||
auto project = RiaApplication::instance()->project();
|
||||
|
||||
caf::PdmUiGroup& optionGroup = *uiOrdering.addNewGroup("Options");
|
||||
optionGroup.add(&m_flowDiagSolution);
|
||||
optionGroup.add(&m_flowType);
|
||||
optionGroup.add(&m_groupSmallContributions);
|
||||
optionGroup.add(&m_smallContributionsThreshold);
|
||||
m_smallContributionsThreshold.uiCapability()->setUiReadOnly(!m_groupSmallContributions());
|
||||
for (RimOilField* oilField : project->oilFields)
|
||||
{
|
||||
auto wellPathColl = oilField->wellPathCollection();
|
||||
for (const auto& wellPath : wellPathColl->wellPaths)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath->name()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::calculateValueOptionsForObservedData(QList<caf::PdmOptionItemInfo>& options)
|
||||
{
|
||||
auto project = RiaApplication::instance()->project();
|
||||
|
||||
for (RimOilField* oilField : project->oilFields)
|
||||
{
|
||||
auto wellPathColl = oilField->wellPathCollection();
|
||||
for (const auto& wellPath : wellPathColl->wellPaths)
|
||||
{
|
||||
const auto& wellLogFile = wellPath->wellLogFile();
|
||||
const auto& channels = wellLogFile->wellLogChannelNames();
|
||||
|
||||
for (const auto& channel : *channels)
|
||||
{
|
||||
auto name = channel->name();
|
||||
|
||||
if (QString::compare(name, "GR") == 0) // Test code
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(name, name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -31,7 +31,6 @@ class RimEclipseResultCase;
|
||||
class RimEclipseWell;
|
||||
class RimFlowDiagSolution;
|
||||
class RimTotalWellAllocationPlot;
|
||||
class RimWellRftPlotLegend;
|
||||
class RimWellLogPlot;
|
||||
class RiuWellRftPlot;
|
||||
class RimWellLogTrack;
|
||||
@ -61,8 +60,6 @@ public:
|
||||
RimWellRftPlot();
|
||||
virtual ~RimWellRftPlot();
|
||||
|
||||
void setFromSimulationWell(RimEclipseWell* simWell);
|
||||
|
||||
void setDescription(const QString& description);
|
||||
QString description() const;
|
||||
|
||||
@ -72,21 +69,16 @@ public:
|
||||
virtual void zoomAll() override;
|
||||
|
||||
RimWellLogPlot* wellLogPlot() const;
|
||||
caf::PdmObject* plotLegend();
|
||||
RimEclipseResultCase* rimCase();
|
||||
int timeStep();
|
||||
|
||||
QString wellName() const;
|
||||
void setCurrentWellName(const QString& currWellName);
|
||||
QString currentWellName() const;
|
||||
|
||||
void removeFromMdiAreaAndDeleteViewWidget();
|
||||
|
||||
void showPlotLegend(bool doShow);
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; }
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
std::set<QString> findSortedWellNames();
|
||||
//std::set<QString> findSortedWellNames();
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
@ -96,19 +88,10 @@ protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
private:
|
||||
void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options);
|
||||
void calculateValueOptionsForObservedData(QList<caf::PdmOptionItemInfo>& options);
|
||||
void updateFromWell();
|
||||
|
||||
std::map<QString, const std::vector<double> *> findRelevantTracerCellFractions(const RigSingleWellResultsData* wellResults);
|
||||
|
||||
void updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTrack);
|
||||
|
||||
void addStackedCurve(const QString& tracerName,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack);
|
||||
|
||||
void updateWidgetTitleWindowTitle();
|
||||
static QString wellStatusTextForTimeStep(const QString& wellName, const RimEclipseResultCase* eclipseResultCase, size_t timeStep);
|
||||
|
||||
// RimViewWindow overrides
|
||||
|
||||
@ -121,16 +104,11 @@ private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<QString> m_userName;
|
||||
|
||||
caf::PdmPtrField<RimEclipseResultCase*> m_case;
|
||||
caf::PdmField<QString> m_wellName;
|
||||
caf::PdmField<int> m_timeStep;
|
||||
caf::PdmPtrField<RimFlowDiagSolution*> m_flowDiagSolution;
|
||||
caf::PdmField<bool> m_groupSmallContributions;
|
||||
caf::PdmField<double> m_smallContributionsThreshold;
|
||||
caf::PdmField<caf::AppEnum<FlowType> > m_flowType;
|
||||
caf::PdmField<std::vector<QString>> m_selectedSources;
|
||||
caf::PdmField<std::vector<QString>> m_selectedTimeSteps;
|
||||
|
||||
QPointer<RiuWellRftPlot> m_wellLogPlotWidget;
|
||||
|
||||
caf::PdmChildField<RimWellLogPlot*> m_wellLogPlot;
|
||||
caf::PdmChildField<RimWellRftPlotLegend*> m_rftPlotLegend;
|
||||
};
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellRftPlot.h"
|
||||
|
||||
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
@ -221,10 +222,15 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
}
|
||||
else if (dynamic_cast<RimWellPath*>(uiItem))
|
||||
{
|
||||
commandIds << "RicNewRftPlotFeature";
|
||||
commandIds << "RicNewWellLogFileCurveFeature";
|
||||
commandIds << "RicNewWellLogCurveExtractionFeature";
|
||||
commandIds << "RicNewWellPathIntersectionFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimWellRftPlot*>(uiItem))
|
||||
{
|
||||
commandIds << "RicDeleteRftPlotFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimCalcScript*>(uiItem))
|
||||
{
|
||||
commandIds << "RicEditScriptFeature";
|
||||
|
@ -126,7 +126,7 @@ RimFlowPlotCollection* RimMainPlotCollection::flowPlotCollection()
|
||||
void RimMainPlotCollection::deleteAllContainedObjects()
|
||||
{
|
||||
m_wellLogPlotCollection()->wellLogPlots.deleteAllChildObjects();
|
||||
m_rftPlotCollection()->rftPlots.deleteAllChildObjects();
|
||||
m_rftPlotCollection()->deleteAllPlots();
|
||||
m_summaryPlotCollection()->summaryPlots.deleteAllChildObjects();
|
||||
|
||||
m_flowPlotCollection()->closeDefaultPlotWindowAndDeletePlots();
|
||||
|
@ -41,8 +41,8 @@ RimRftPlotCollection::RimRftPlotCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("RFT Plots", ":/WellLogPlots16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&rftPlots, "RftPlots", "", "", "", "");
|
||||
rftPlots.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_rftPlots, "RftPlots", "", "", "", "");
|
||||
m_rftPlots.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -50,7 +50,7 @@ RimRftPlotCollection::RimRftPlotCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimRftPlotCollection::~RimRftPlotCollection()
|
||||
{
|
||||
rftPlots.deleteAllChildObjects();
|
||||
m_rftPlots.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -184,3 +184,42 @@ void RimRftPlotCollection::removeExtractors(const RigGeoMechCaseData* caseData)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<RimWellRftPlot*> RimRftPlotCollection::rftPlots() const
|
||||
{
|
||||
std::vector<RimWellRftPlot*> plots;
|
||||
for (const auto& plot : m_rftPlots)
|
||||
{
|
||||
plots.push_back(plot);
|
||||
}
|
||||
return plots;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimRftPlotCollection::addPlot(RimWellRftPlot* newPlot)
|
||||
{
|
||||
m_rftPlots.push_back(newPlot);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimRftPlotCollection::removePlot(RimWellRftPlot* plot)
|
||||
{
|
||||
size_t index = m_rftPlots.index(plot);
|
||||
if (index < m_rftPlots.size())
|
||||
m_rftPlots.erase(index);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimRftPlotCollection::deleteAllPlots()
|
||||
{
|
||||
m_rftPlots.deleteAllChildObjects();
|
||||
}
|
||||
|
@ -59,8 +59,13 @@ public:
|
||||
void removeExtractors(const RigEclipseCaseData* caseData);
|
||||
void removeExtractors(const RigGeoMechCaseData* caseData);
|
||||
|
||||
caf::PdmChildArrayField<RimWellRftPlot*> rftPlots;
|
||||
const std::vector<RimWellRftPlot*> rftPlots() const;
|
||||
void addPlot(RimWellRftPlot* newPlot);
|
||||
void removePlot(RimWellRftPlot* plot);
|
||||
void deleteAllPlots();
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimWellRftPlot*> m_rftPlots;
|
||||
cvf::Collection<RigEclipseWellLogExtractor> m_extractors;
|
||||
cvf::Collection<RigGeoMechWellLogExtractor> m_geomExtractors;
|
||||
};
|
||||
|
@ -302,6 +302,14 @@ void RimWellPath::setName(const QString& name)
|
||||
m_completions->setWellNameForExport(name);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogFile* RimWellPath::wellLogFile() const
|
||||
{
|
||||
return m_wellLogFile;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -534,3 +542,18 @@ void RimWellPath::setLogFileInfo(RimWellLogFile* logFileInfo)
|
||||
|
||||
setName(m_wellLogFile->wellName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPath* RimWellPath::fromFilePath(QString filePath)
|
||||
{
|
||||
RimWellLogFile* logFileInfo = RimWellLogFile::readWellLogFile(filePath);
|
||||
if (logFileInfo)
|
||||
{
|
||||
auto wellPath = new RimWellPath();
|
||||
wellPath->setLogFileInfo(logFileInfo);
|
||||
return wellPath;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
@ -71,6 +71,8 @@ public:
|
||||
QString name() const;
|
||||
void setName(const QString& name);
|
||||
|
||||
RimWellLogFile* wellLogFile() const;
|
||||
|
||||
caf::PdmField<QString> filepath;
|
||||
caf::PdmField<int> wellPathIndexInFile; // -1 means none.
|
||||
|
||||
@ -104,6 +106,7 @@ public:
|
||||
|
||||
void setUnitSystem(RiaEclipseUnitTools::UnitSystem unitSystem);
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem() const;
|
||||
static RimWellPath* fromFilePath(QString filePath);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -271,6 +271,17 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
|
||||
this->sortWellsByName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::addWellPaths(const std::vector<RimWellPath*> wellPaths)
|
||||
{
|
||||
for(const auto& wellPath : wellPaths)
|
||||
{
|
||||
this->wellPaths.push_back(wellPath);
|
||||
}
|
||||
this->sortWellsByName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -93,6 +93,7 @@ public:
|
||||
void deleteAllWellPaths();
|
||||
|
||||
RimWellPath* wellPathByName(const QString& wellPathName) const;
|
||||
void addWellPaths(const std::vector<RimWellPath*> wellPaths);
|
||||
void addWellLogs(const QStringList& filePaths);
|
||||
|
||||
void scheduleRedrawAffectedViews();
|
||||
|
@ -76,8 +76,8 @@ RiuWellRftPlot::RiuWellRftPlot(RimWellRftPlot* plotDefinition, QWidget* parent)
|
||||
mainLayout->addLayout(plotWidgetsLayout);
|
||||
plotWidgetsLayout->addLayout(rightColumnLayout);
|
||||
|
||||
m_legendWidget = new RiuNightchartsWidget(this);
|
||||
new RiuPlotObjectPicker(m_legendWidget, m_plotDefinition->plotLegend());
|
||||
//m_legendWidget = new RiuNightchartsWidget(this);
|
||||
//new RiuPlotObjectPicker(m_legendWidget, m_plotDefinition->plotLegend());
|
||||
|
||||
QStringList commandIds;
|
||||
commandIds << "RicShowTotalAllocationDataFeature";
|
||||
|
Loading…
Reference in New Issue
Block a user