mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Whitespace
This commit is contained in:
parent
d0a23252ab
commit
77dbd8a25f
@ -30,11 +30,11 @@
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimViewManipulator.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
@ -45,12 +45,14 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RicShowContributingWellsFeatureImpl::manipulateSelectedView(RimEclipseResultCase* eclipseResultCase, QString wellName, int timeStep)
|
||||
RimEclipseView* RicShowContributingWellsFeatureImpl::manipulateSelectedView(RimEclipseResultCase* eclipseResultCase,
|
||||
QString wellName,
|
||||
int timeStep)
|
||||
{
|
||||
RimEclipseView* viewToManipulate = RicSelectOrCreateViewFeatureImpl::showViewSelection(
|
||||
eclipseResultCase, "lastUsedWellAllocationView", "ContributingWells_" + wellName, "Show Contributing Wells in View");
|
||||
|
||||
if (!viewToManipulate) return nullptr;
|
||||
if (!viewToManipulate) return nullptr;
|
||||
|
||||
RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(viewToManipulate, wellName, timeStep);
|
||||
|
||||
@ -65,7 +67,9 @@ RimEclipseView* RicShowContributingWellsFeatureImpl::manipulateSelectedView(RimE
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(RimEclipseView* viewToModify, const QString& wellName, int timeStep)
|
||||
void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(RimEclipseView* viewToModify,
|
||||
const QString& wellName,
|
||||
int timeStep)
|
||||
{
|
||||
CVF_ASSERT(viewToModify);
|
||||
|
||||
@ -91,7 +95,7 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(RimE
|
||||
flowDiagSolution = eclipseResultCase->defaultFlowDiagSolution();
|
||||
}
|
||||
|
||||
//assert(flowDiagSolution);
|
||||
// assert(flowDiagSolution);
|
||||
CVF_ASSERT(flowDiagSolution);
|
||||
|
||||
RimFlowDiagSolution::TracerStatusType tracerStatus = flowDiagSolution->tracerStatusInTimeStep(selectedWell->name(), timeStep);
|
||||
@ -107,16 +111,16 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(RimE
|
||||
|
||||
switch (tracerStatus)
|
||||
{
|
||||
case RimFlowDiagSolution::PRODUCER:
|
||||
viewToModify->cellResult()->setFlowDiagTracerSelectionType(RimEclipseResultDefinition::FLOW_TR_INJECTORS);
|
||||
break;
|
||||
case RimFlowDiagSolution::INJECTOR:
|
||||
viewToModify->cellResult()->setFlowDiagTracerSelectionType(RimEclipseResultDefinition::FLOW_TR_PRODUCERS);
|
||||
break;
|
||||
case RimFlowDiagSolution::PRODUCER:
|
||||
viewToModify->cellResult()->setFlowDiagTracerSelectionType(RimEclipseResultDefinition::FLOW_TR_INJECTORS);
|
||||
break;
|
||||
case RimFlowDiagSolution::INJECTOR:
|
||||
viewToModify->cellResult()->setFlowDiagTracerSelectionType(RimEclipseResultDefinition::FLOW_TR_PRODUCERS);
|
||||
break;
|
||||
|
||||
default:
|
||||
CVF_ASSERT(false);
|
||||
break;
|
||||
default:
|
||||
CVF_ASSERT(false);
|
||||
break;
|
||||
}
|
||||
|
||||
viewToModify->cellResult()->loadDataAndUpdate();
|
||||
@ -126,8 +130,8 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(RimE
|
||||
|
||||
for (RimSimWellInView* w : viewToModify->wellCollection()->wells())
|
||||
{
|
||||
if (std::find(tracerNames.begin(), tracerNames.end(), w->name()) != tracerNames.end()
|
||||
|| selectedWell->name() == w->name())
|
||||
if (std::find(tracerNames.begin(), tracerNames.end(), w->name()) != tracerNames.end() ||
|
||||
selectedWell->name() == w->name())
|
||||
{
|
||||
w->showWell = true;
|
||||
}
|
||||
@ -168,10 +172,9 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(RimE
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RicShowContributingWellsFeatureImpl::findContributingTracerNames(
|
||||
const RimFlowDiagSolution* flowDiagSolution,
|
||||
const RigSimWellData* simWellData,
|
||||
int timeStep)
|
||||
std::vector<QString> RicShowContributingWellsFeatureImpl::findContributingTracerNames(const RimFlowDiagSolution* flowDiagSolution,
|
||||
const RigSimWellData* simWellData,
|
||||
int timeStep)
|
||||
{
|
||||
std::vector<QString> tracerCellFractionValues;
|
||||
|
||||
@ -180,8 +183,7 @@ std::vector<QString> RicShowContributingWellsFeatureImpl::findContributingTracer
|
||||
RimFlowDiagSolution::TracerStatusType requestedTracerType = RimFlowDiagSolution::UNDEFINED;
|
||||
|
||||
const RigWellResultFrame::WellProductionType prodType = simWellData->wellProductionType(timeStep);
|
||||
if ( prodType == RigWellResultFrame::PRODUCER
|
||||
|| prodType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE)
|
||||
if (prodType == RigWellResultFrame::PRODUCER || prodType == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE)
|
||||
{
|
||||
requestedTracerType = RimFlowDiagSolution::INJECTOR;
|
||||
}
|
||||
@ -202,4 +204,3 @@ std::vector<QString> RicShowContributingWellsFeatureImpl::findContributingTracer
|
||||
|
||||
return tracerCellFractionValues;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,8 @@ CAF_CMD_SOURCE_INIT(RicShowContributingWellsFromPlotFeature, "RicShowContributin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicShowContributingWellsFromPlotFeature::isCommandEnabled()
|
||||
{
|
||||
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>(RiaApplication::instance()->activePlotWindow());
|
||||
RimWellAllocationPlot* wellAllocationPlot =
|
||||
dynamic_cast<RimWellAllocationPlot*>(RiaApplication::instance()->activePlotWindow());
|
||||
|
||||
if (wellAllocationPlot) return true;
|
||||
|
||||
@ -47,11 +48,12 @@ bool RicShowContributingWellsFromPlotFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowContributingWellsFromPlotFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>(RiaApplication::instance()->activePlotWindow());
|
||||
RimWellAllocationPlot* wellAllocationPlot =
|
||||
dynamic_cast<RimWellAllocationPlot*>(RiaApplication::instance()->activePlotWindow());
|
||||
|
||||
if (!wellAllocationPlot) return;
|
||||
|
||||
int timeStep = wellAllocationPlot->timeStep();
|
||||
int timeStep = wellAllocationPlot->timeStep();
|
||||
QString wellName = wellAllocationPlot->wellName();
|
||||
|
||||
RimEclipseResultCase* wellAllocationResultCase = wellAllocationPlot->rimCase();
|
||||
@ -64,6 +66,6 @@ void RicShowContributingWellsFromPlotFeature::onActionTriggered(bool isChecked)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowContributingWellsFromPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
//actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
||||
// actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
||||
actionToSetup->setText("Show Contributing Wells");
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
@ -29,10 +28,7 @@ class RicShowContributingWellsFromPlotFeature : public caf::CmdFeature
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
void onActionTriggered(bool isChecked) override;
|
||||
void setupActionLook(QAction* actionToSetup) override;
|
||||
};
|
||||
|
||||
|
||||
|
@ -22,9 +22,9 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
@ -73,7 +73,8 @@ RimEclipseView* RicSelectOrCreateViewFeatureImpl::showViewSelection(RimEclipseRe
|
||||
viewToManipulate = featureUi.selectedView();
|
||||
}
|
||||
|
||||
QString refFromProjectToView = caf::PdmReferenceHelper::referenceFromRootToObject(RiaApplication::instance()->project(), viewToManipulate);
|
||||
QString refFromProjectToView =
|
||||
caf::PdmReferenceHelper::referenceFromRootToObject(RiaApplication::instance()->project(), viewToManipulate);
|
||||
RiaApplication::instance()->setCacheDataObject(lastUsedViewKey, refFromProjectToView);
|
||||
|
||||
return viewToManipulate;
|
||||
@ -92,12 +93,14 @@ void RicSelectOrCreateViewFeatureImpl::focusView(RimEclipseView* view)
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
RimEclipseView* RicSelectOrCreateViewFeatureImpl::getDefaultSelectedView(RimEclipseResultCase* resultCase, const QString& lastUsedViewKey)
|
||||
RimEclipseView* RicSelectOrCreateViewFeatureImpl::getDefaultSelectedView(RimEclipseResultCase* resultCase,
|
||||
const QString& lastUsedViewKey)
|
||||
{
|
||||
RimEclipseView* defaultSelectedView = nullptr;
|
||||
|
||||
QString lastUsedViewRef = RiaApplication::instance()->cacheDataObject(lastUsedViewKey).toString();
|
||||
RimEclipseView* lastUsedView = dynamic_cast<RimEclipseView*>(caf::PdmReferenceHelper::objectFromReference(RiaApplication::instance()->project(), lastUsedViewRef));
|
||||
QString lastUsedViewRef = RiaApplication::instance()->cacheDataObject(lastUsedViewKey).toString();
|
||||
RimEclipseView* lastUsedView = dynamic_cast<RimEclipseView*>(
|
||||
caf::PdmReferenceHelper::objectFromReference(RiaApplication::instance()->project(), lastUsedViewRef));
|
||||
if (lastUsedView)
|
||||
{
|
||||
RimEclipseResultCase* lastUsedViewResultCase = nullptr;
|
||||
|
@ -18,18 +18,18 @@
|
||||
|
||||
#include "RimFlowCharacteristicsPlot.h"
|
||||
|
||||
#include "RigFlowDiagResults.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFlowDiagResults.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipsePropertyFilter.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInViewCollection.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RicEclipsePropertyFilterFeatureImpl.h"
|
||||
#include "RicSelectOrCreateViewFeatureImpl.h"
|
||||
@ -46,21 +46,19 @@
|
||||
|
||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void AppEnum< RimFlowCharacteristicsPlot::TimeSelectionType >::setUp()
|
||||
{
|
||||
addItem(RimFlowCharacteristicsPlot::ALL_AVAILABLE, "ALL_AVAILABLE", "All With Calculated Flow Diagnostics");
|
||||
addItem(RimFlowCharacteristicsPlot::SELECTED, "SELECTED", "Selected");
|
||||
setDefault(RimFlowCharacteristicsPlot::SELECTED);
|
||||
}
|
||||
template<>
|
||||
void AppEnum<RimFlowCharacteristicsPlot::TimeSelectionType>::setUp()
|
||||
{
|
||||
addItem(RimFlowCharacteristicsPlot::ALL_AVAILABLE, "ALL_AVAILABLE", "All With Calculated Flow Diagnostics");
|
||||
addItem(RimFlowCharacteristicsPlot::SELECTED, "SELECTED", "Selected");
|
||||
setDefault(RimFlowCharacteristicsPlot::SELECTED);
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimFlowCharacteristicsPlot, "FlowCharacteristicsPlot");
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -79,8 +77,13 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot()
|
||||
CAF_PDM_InitFieldNoDefault(&m_applyTimeSteps, "ApplyTimeSteps", "", "", "", "");
|
||||
caf::PdmUiPushButtonEditor::configureEditorForField(&m_applyTimeSteps);
|
||||
|
||||
CAF_PDM_InitField(&m_maxPvFraction, "CellPVThreshold", 0.1, "Aquifer Cell Threshold", "", "Exclude Aquifer Effects by adding a Cell Pore Volume Threshold as Fraction of Total Pore Volume.", "");
|
||||
|
||||
CAF_PDM_InitField(&m_maxPvFraction,
|
||||
"CellPVThreshold",
|
||||
0.1,
|
||||
"Aquifer Cell Threshold",
|
||||
"",
|
||||
"Exclude Aquifer Effects by adding a Cell Pore Volume Threshold as Fraction of Total Pore Volume.",
|
||||
"");
|
||||
|
||||
CAF_PDM_InitField(&m_showLegend, "ShowLegend", true, "Legend", "", "", "");
|
||||
|
||||
@ -110,15 +113,14 @@ RimFlowCharacteristicsPlot::~RimFlowCharacteristicsPlot()
|
||||
deleteViewWidget();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFlowCharacteristicsPlot::setFromFlowSolution(RimFlowDiagSolution* flowSolution)
|
||||
{
|
||||
if ( !flowSolution )
|
||||
if (!flowSolution)
|
||||
{
|
||||
m_case = nullptr;
|
||||
m_case = nullptr;
|
||||
m_cellFilterView = nullptr;
|
||||
}
|
||||
else
|
||||
@ -133,7 +135,7 @@ void RimFlowCharacteristicsPlot::setFromFlowSolution(RimFlowDiagSolution* flowSo
|
||||
}
|
||||
|
||||
m_flowDiagSolution = flowSolution;
|
||||
m_showWindow = true;
|
||||
m_showWindow = true;
|
||||
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
@ -146,7 +148,7 @@ void RimFlowCharacteristicsPlot::deleteViewWidget()
|
||||
if (m_flowCharPlotWidget)
|
||||
{
|
||||
m_flowCharPlotWidget->deleteLater();
|
||||
m_flowCharPlotWidget= nullptr;
|
||||
m_flowCharPlotWidget = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,8 +160,8 @@ void RimFlowCharacteristicsPlot::updateCurrentTimeStep()
|
||||
if (m_timeStepSelectionType() != ALL_AVAILABLE) return;
|
||||
if (!m_flowDiagSolution()) return;
|
||||
|
||||
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
|
||||
if (m_currentlyPlottedTimeSteps == calculatedTimesteps) return;
|
||||
|
||||
@ -169,30 +171,31 @@ void RimFlowCharacteristicsPlot::updateCurrentTimeStep()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
|
||||
QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if ( fieldNeedingOptions == &m_case )
|
||||
if (fieldNeedingOptions == &m_case)
|
||||
{
|
||||
RimProject* proj = nullptr;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if ( proj )
|
||||
if (proj)
|
||||
{
|
||||
std::vector<RimEclipseResultCase*> cases;
|
||||
proj->descendantsIncludingThisOfType(cases);
|
||||
for ( RimEclipseResultCase* c : cases )
|
||||
for (RimEclipseResultCase* c : cases)
|
||||
{
|
||||
if ( c->defaultFlowDiagSolution() )
|
||||
if (c->defaultFlowDiagSolution())
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c, false, c->uiIcon()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_cellFilterView )
|
||||
else if (fieldNeedingOptions == &m_cellFilterView)
|
||||
{
|
||||
if ( m_case )
|
||||
if (m_case)
|
||||
{
|
||||
for (RimEclipseView* view : m_case()->reservoirViews())
|
||||
{
|
||||
@ -200,28 +203,29 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_flowDiagSolution )
|
||||
else if (fieldNeedingOptions == &m_flowDiagSolution)
|
||||
{
|
||||
if ( m_case )
|
||||
if (m_case)
|
||||
{
|
||||
std::vector<RimFlowDiagSolution*> flowSols = m_case->flowDiagSolutions();
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo("None", nullptr));
|
||||
for ( RimFlowDiagSolution* flowSol : flowSols )
|
||||
for (RimFlowDiagSolution* flowSol : flowSols)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(flowSol->userDescription(), flowSol, false, flowSol->uiIcon()));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_selectedTimeStepsUi )
|
||||
else if (fieldNeedingOptions == &m_selectedTimeStepsUi)
|
||||
{
|
||||
if ( m_flowDiagSolution && m_case )
|
||||
if (m_flowDiagSolution && m_case)
|
||||
{
|
||||
QStringList timeStepDates = m_case->timeStepStrings();
|
||||
std::vector<int> calculatedTimeSteps = m_flowDiagSolution()->flowDiagResults()->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
QStringList timeStepDates = m_case->timeStepStrings();
|
||||
std::vector<int> calculatedTimeSteps =
|
||||
m_flowDiagSolution()->flowDiagResults()->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
for (int tsIdx = 0; tsIdx < timeStepDates.size(); ++tsIdx)
|
||||
{
|
||||
auto it = std::find(calculatedTimeSteps.begin(), calculatedTimeSteps.end(), tsIdx);
|
||||
auto it = std::find(calculatedTimeSteps.begin(), calculatedTimeSteps.end(), tsIdx);
|
||||
QString itemText = timeStepDates[tsIdx];
|
||||
if (it != calculatedTimeSteps.end())
|
||||
{
|
||||
@ -235,7 +239,7 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
|
||||
{
|
||||
if (m_flowDiagSolution)
|
||||
{
|
||||
std::vector<QString> tracerNames = m_flowDiagSolution->tracerNames();
|
||||
std::vector<QString> tracerNames = m_flowDiagSolution->tracerNames();
|
||||
std::vector<std::pair<QString, QString>> sortedTracerNames;
|
||||
for (QString tracerName : tracerNames)
|
||||
{
|
||||
@ -263,18 +267,18 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
|
||||
QString prefix;
|
||||
switch (tracerStatus)
|
||||
{
|
||||
case RimFlowDiagSolution::INJECTOR:
|
||||
prefix = "I : ";
|
||||
break;
|
||||
case RimFlowDiagSolution::PRODUCER:
|
||||
prefix = "P : ";
|
||||
break;
|
||||
case RimFlowDiagSolution::VARYING:
|
||||
prefix = "I/P: ";
|
||||
break;
|
||||
case RimFlowDiagSolution::UNDEFINED:
|
||||
prefix = "U : ";
|
||||
break;
|
||||
case RimFlowDiagSolution::INJECTOR:
|
||||
prefix = "I : ";
|
||||
break;
|
||||
case RimFlowDiagSolution::PRODUCER:
|
||||
prefix = "P : ";
|
||||
break;
|
||||
case RimFlowDiagSolution::VARYING:
|
||||
prefix = "I/P: ";
|
||||
break;
|
||||
case RimFlowDiagSolution::UNDEFINED:
|
||||
prefix = "U : ";
|
||||
break;
|
||||
}
|
||||
sortedTracerNames.push_back(std::make_pair(prefix + tracerName, tracerName));
|
||||
}
|
||||
@ -282,10 +286,9 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
|
||||
|
||||
std::sort(sortedTracerNames.begin(),
|
||||
sortedTracerNames.end(),
|
||||
[](const std::pair<QString, QString>& a, const std::pair<QString, QString>& b) -> bool
|
||||
{
|
||||
return a.first < b.first;
|
||||
});
|
||||
[](const std::pair<QString, QString>& a, const std::pair<QString, QString>& b) -> bool {
|
||||
return a.first < b.first;
|
||||
});
|
||||
|
||||
for (auto& tracer : sortedTracerNames)
|
||||
{
|
||||
@ -295,7 +298,6 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
|
||||
}
|
||||
|
||||
return options;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -321,7 +323,7 @@ void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
}
|
||||
if (!m_case() && defaultCase)
|
||||
{
|
||||
m_case = defaultCase;
|
||||
m_case = defaultCase;
|
||||
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
|
||||
if (!m_case()->reservoirViews.empty())
|
||||
{
|
||||
@ -348,8 +350,7 @@ void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
{
|
||||
caf::PdmUiGroup* regionGroup = uiOrdering.addNewGroup("Region");
|
||||
regionGroup->add(&m_cellFilter);
|
||||
if (m_cellFilter() == RigFlowDiagResults::CELLS_COMMUNICATION ||
|
||||
m_cellFilter() == RigFlowDiagResults::CELLS_DRAINED ||
|
||||
if (m_cellFilter() == RigFlowDiagResults::CELLS_COMMUNICATION || m_cellFilter() == RigFlowDiagResults::CELLS_DRAINED ||
|
||||
m_cellFilter() == RigFlowDiagResults::CELLS_FLOODED)
|
||||
{
|
||||
regionGroup->add(&m_tracerFilter);
|
||||
@ -365,8 +366,7 @@ void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
{
|
||||
regionGroup->add(&m_minCommunication);
|
||||
}
|
||||
else if (m_cellFilter() == RigFlowDiagResults::CELLS_DRAINED ||
|
||||
m_cellFilter() == RigFlowDiagResults::CELLS_FLOODED)
|
||||
else if (m_cellFilter() == RigFlowDiagResults::CELLS_DRAINED || m_cellFilter() == RigFlowDiagResults::CELLS_FLOODED)
|
||||
{
|
||||
regionGroup->add(&m_maxTof);
|
||||
}
|
||||
@ -386,7 +386,9 @@ void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFlowCharacteristicsPlot::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
void RimFlowCharacteristicsPlot::defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
if (field == &m_applyTimeSteps)
|
||||
{
|
||||
@ -425,11 +427,13 @@ void RimFlowCharacteristicsPlot::zoomAll()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFlowCharacteristicsPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
void RimFlowCharacteristicsPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
RimViewWindow::fieldChangedByUi(changedField, oldValue, newValue);
|
||||
|
||||
if ( &m_case == changedField )
|
||||
if (&m_case == changedField)
|
||||
{
|
||||
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
|
||||
m_currentlyPlottedTimeSteps.clear();
|
||||
@ -481,7 +485,8 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
{
|
||||
if (m_flowDiagSolution)
|
||||
{
|
||||
std::vector<int> timeSteps = m_flowDiagSolution()->flowDiagResults()->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
std::vector<int> timeSteps =
|
||||
m_flowDiagSolution()->flowDiagResults()->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
if (!timeSteps.empty())
|
||||
{
|
||||
timeStep = timeSteps[0];
|
||||
@ -535,7 +540,7 @@ QImage RimFlowCharacteristicsPlot::snapshotWindowContent()
|
||||
if (m_flowCharPlotWidget)
|
||||
{
|
||||
QPixmap pix = QPixmap::grabWidget(m_flowCharPlotWidget);
|
||||
image = pix.toImage();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
@ -550,8 +555,8 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
|
||||
|
||||
if (m_flowDiagSolution && m_flowCharPlotWidget)
|
||||
{
|
||||
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
|
||||
if (m_timeStepSelectionType == SELECTED)
|
||||
{
|
||||
@ -564,9 +569,9 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
|
||||
|
||||
m_currentlyPlottedTimeSteps = calculatedTimesteps;
|
||||
|
||||
std::vector<QDateTime> timeStepDates = m_case->timeStepDates();
|
||||
QStringList timeStepStrings = m_case->timeStepStrings();
|
||||
std::vector<double> lorenzVals(timeStepDates.size(), HUGE_VAL);
|
||||
std::vector<QDateTime> timeStepDates = m_case->timeStepDates();
|
||||
QStringList timeStepStrings = m_case->timeStepStrings();
|
||||
std::vector<double> lorenzVals(timeStepDates.size(), HUGE_VAL);
|
||||
|
||||
m_flowCharPlotWidget->removeAllCurves();
|
||||
|
||||
@ -594,7 +599,7 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
|
||||
}
|
||||
|
||||
RigActiveCellInfo* activeCellInfo = m_case()->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
std::vector<char> visibleActiveCells(activeCellInfo->reservoirActiveCellCount(), 0);
|
||||
std::vector<char> visibleActiveCells(activeCellInfo->reservoirActiveCellCount(), 0);
|
||||
|
||||
for (size_t i = 0; i < visibleCells.size(); ++i)
|
||||
{
|
||||
@ -610,12 +615,8 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
|
||||
}
|
||||
else
|
||||
{
|
||||
auto flowCharResults = flowResult->flowCharacteristicsResults(timeStepIdx,
|
||||
m_cellFilter(),
|
||||
selectedTracerNames,
|
||||
m_maxPvFraction(),
|
||||
m_minCommunication(),
|
||||
m_maxTof());
|
||||
auto flowCharResults = flowResult->flowCharacteristicsResults(
|
||||
timeStepIdx, m_cellFilter(), selectedTracerNames, m_maxPvFraction(), m_minCommunication(), m_maxTof());
|
||||
timeStepToFlowResultMap[timeStepIdx] = flowCharResults;
|
||||
}
|
||||
lorenzVals[timeStepIdx] = timeStepToFlowResultMap[timeStepIdx].m_lorenzCoefficient;
|
||||
@ -623,9 +624,8 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
|
||||
|
||||
m_flowCharPlotWidget->setLorenzCurve(timeStepStrings, timeStepDates, lorenzVals);
|
||||
|
||||
for ( int timeStepIdx: calculatedTimesteps )
|
||||
for (int timeStepIdx : calculatedTimesteps)
|
||||
{
|
||||
|
||||
const auto& flowCharResults = timeStepToFlowResultMap[timeStepIdx];
|
||||
|
||||
m_flowCharPlotWidget->addFlowCapStorageCapCurve(timeStepDates[timeStepIdx],
|
||||
@ -660,5 +660,3 @@ QWidget* RimFlowCharacteristicsPlot::createViewWidget(QWidget* mainWindowParent)
|
||||
m_flowCharPlotWidget = new RiuFlowCharacteristicsPlot(this, mainWindowParent);
|
||||
return m_flowCharPlotWidget;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user