Merge fix of #1858

This commit is contained in:
Jacob Støren 2017-12-12 17:40:55 +01:00
commit 7d39d29ca5
68 changed files with 1945 additions and 404 deletions

View File

@ -108,3 +108,19 @@ double RiaEclipseUnitTools::convertSurfaceGasFlowRateToOilEquivalents(UnitSystem
return oilEquivalentGasRate;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaEclipseUnitTools::unitStringPressure(UnitSystem unitSystem)
{
switch (unitSystem)
{
case RiaEclipseUnitTools::UNITS_METRIC: return "barsa";
case RiaEclipseUnitTools::UNITS_FIELD: return "psia";
case RiaEclipseUnitTools::UNITS_LAB: return "atma";
case RiaEclipseUnitTools::UNITS_UNKNOWN: return "";
default: return "";
}
}

View File

@ -49,5 +49,7 @@ public:
static RiaDefines::DepthUnitType depthUnit(UnitSystem unit);
static double convertSurfaceGasFlowRateToOilEquivalents(UnitSystem, double eclGasFlowRate);
static QString unitStringPressure(UnitSystem unitSystem);
};

View File

@ -130,3 +130,11 @@ RimSummaryCrossPlotCollection* RiaSummaryTools::parentCrossPlotCollection(caf::P
return crossPlotColl;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaSummaryTools::isSummaryCrossPlot(const RimSummaryPlot* plot)
{
return dynamic_cast<const RimSummaryCrossPlot*>(plot);
}

View File

@ -44,4 +44,5 @@ public:
static RimSummaryCrossPlot* parentCrossPlot(caf::PdmObject* object);
static RimSummaryCrossPlotCollection* parentCrossPlotCollection(caf::PdmObject* object);
static bool isSummaryCrossPlot(const RimSummaryPlot* plot);
};

View File

@ -27,12 +27,13 @@
#include "RifEclipseInputFileTools.h"
#include "RimView.h"
#include "RimEclipseView.h"
#include "RimEclipseCase.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseView.h"
#include "RimView.h"
#include "RigEclipseCaseData.h"
#include "RigActiveCellInfo.h"
#include "RigEclipseCaseData.h"
#include "RiuMainWindow.h"
@ -43,23 +44,15 @@
#include <QFileInfo>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputActiveVisibleCellsFeature, "RicSaveEclipseInputActiveVisibleCellsFeature");
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputVisibleCellsFeature, "RicSaveEclipseInputVisibleCellsFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSaveEclipseInputVisibleCellsFeature::isCommandEnabled()
{
return getSelectedEclipseView() != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSaveEclipseInputVisibleCellsFeature::onActionTriggered(bool isChecked)
void executeCommand(RimEclipseView* view)
{
RimEclipseView* view = getEclipseActiveView();
RicSaveEclipseInputVisibleCellsUi exportSettings;
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export FLUXNUM/MULTNUM", "");
RicExportFeatureImpl::configureForExport(&propertyDialog);
@ -99,6 +92,23 @@ void RicSaveEclipseInputVisibleCellsFeature::onActionTriggered(bool isChecked)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSaveEclipseInputVisibleCellsFeature::isCommandEnabled()
{
return selectedView() != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSaveEclipseInputVisibleCellsFeature::onActionTriggered(bool isChecked)
{
RimEclipseView* view = RicSaveEclipseInputVisibleCellsFeature::selectedView();
executeCommand(view);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -110,17 +120,61 @@ void RicSaveEclipseInputVisibleCellsFeature::setupActionLook(QAction* actionToSe
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseView* RicSaveEclipseInputVisibleCellsFeature::getEclipseActiveView()
RimEclipseView* RicSaveEclipseInputVisibleCellsFeature::selectedView() const
{
RimEclipseView* view = dynamic_cast<RimEclipseView*>(caf::SelectionManager::instance()->selectedItem());
if (view)
{
return view;
}
RimEclipseCellColors* cellResultItem = dynamic_cast<RimEclipseCellColors*>(caf::SelectionManager::instance()->selectedItem());
if (cellResultItem)
{
cellResultItem->firstAncestorOrThisOfType(view);
}
return view;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSaveEclipseInputActiveVisibleCellsFeature::isCommandEnabled()
{
return getEclipseActiveView() != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSaveEclipseInputActiveVisibleCellsFeature::onActionTriggered(bool isChecked)
{
RimEclipseView* view = RicSaveEclipseInputActiveVisibleCellsFeature::getEclipseActiveView();
executeCommand(view);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSaveEclipseInputActiveVisibleCellsFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Export Visible Cells as FLUXNUM/MULTNUM");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseView* RicSaveEclipseInputActiveVisibleCellsFeature::getEclipseActiveView()
{
RimView* activeView = RiaApplication::instance()->activeReservoirView();
return dynamic_cast<RimEclipseView*>(activeView);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseView * RicSaveEclipseInputVisibleCellsFeature::getSelectedEclipseView()
{
return dynamic_cast<RimEclipseView*>(caf::SelectionManager::instance()->selectedItem());
}

View File

@ -31,12 +31,26 @@ class RicSaveEclipseInputVisibleCellsFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled();
virtual void onActionTriggered( bool isChecked );
virtual void setupActionLook( QAction* actionToSetup );
virtual bool isCommandEnabled() override;
virtual void onActionTriggered(bool isChecked) override;
virtual void setupActionLook(QAction* actionToSetup) override;
private:
RimEclipseView* getEclipseActiveView();
RimEclipseView* getSelectedEclipseView();
RimEclipseView* selectedView() const;
};
//==================================================================================================
///
//==================================================================================================
class RicSaveEclipseInputActiveVisibleCellsFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
virtual bool isCommandEnabled() override;
virtual void onActionTriggered( bool isChecked ) override;
virtual void setupActionLook( QAction* actionToSetup ) override;
private:
static RimEclipseView* getEclipseActiveView();
};

View File

@ -280,6 +280,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
"",
-1,
-1,
-1,
-1);
if (!gridSummaryCase->summaryReader()->hasAddress(addr))

View File

@ -9,12 +9,18 @@ set (SOURCE_GROUP_HEADER_FILES
${CEE_CURRENT_LIST_DIR}RicNewSummaryPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicNewSummaryCrossPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicNewSummaryCurveFeature.h
${CEE_CURRENT_LIST_DIR}RicDuplicateSummaryPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicDuplicateSummaryCurveFeature.h
${CEE_CURRENT_LIST_DIR}RicDuplicateSummaryCrossPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicDuplicateSummaryCrossPlotCurveFeature.h
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataToSummaryPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataToSummaryPlotFeatureUi.h
${CEE_CURRENT_LIST_DIR}RicViewZoomAllFeature.h
${CEE_CURRENT_LIST_DIR}RicSummaryCurveSwitchAxisFeature.h
${CEE_CURRENT_LIST_DIR}RicPasteSummaryPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicPasteSummaryCrossPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicPasteSummaryCurveFeature.h
${CEE_CURRENT_LIST_DIR}RicPasteSummaryCrossPlotCurveFeature.h
${CEE_CURRENT_LIST_DIR}RicPasteSummaryCaseFeature.h
${CEE_CURRENT_LIST_DIR}RicAsciiExportSummaryPlotFeature.h
${CEE_CURRENT_LIST_DIR}RicNewGridTimeHistoryCurveFeature.h
@ -38,12 +44,18 @@ set (SOURCE_GROUP_SOURCE_FILES
${CEE_CURRENT_LIST_DIR}RicNewSummaryPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicNewSummaryCrossPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicNewSummaryCurveFeature.cpp
${CEE_CURRENT_LIST_DIR}RicDuplicateSummaryPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicDuplicateSummaryCurveFeature.cpp
${CEE_CURRENT_LIST_DIR}RicDuplicateSummaryCrossPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicDuplicateSummaryCrossPlotCurveFeature.cpp
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataToSummaryPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicPasteAsciiDataToSummaryPlotFeatureUi.cpp
${CEE_CURRENT_LIST_DIR}RicViewZoomAllFeature.cpp
${CEE_CURRENT_LIST_DIR}RicSummaryCurveSwitchAxisFeature.cpp
${CEE_CURRENT_LIST_DIR}RicPasteSummaryPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicPasteSummaryCrossPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicPasteSummaryCurveFeature.cpp
${CEE_CURRENT_LIST_DIR}RicPasteSummaryCrossPlotCurveFeature.cpp
${CEE_CURRENT_LIST_DIR}RicPasteSummaryCaseFeature.cpp
${CEE_CURRENT_LIST_DIR}RicAsciiExportSummaryPlotFeature.cpp
${CEE_CURRENT_LIST_DIR}RicNewGridTimeHistoryCurveFeature.cpp

View File

@ -0,0 +1,63 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicDuplicateSummaryCrossPlotCurveFeature.h"
#include "RiaApplication.h"
#include "RicPasteSummaryCurveFeature.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RiaSummaryTools.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCrossPlot.h"
#include "RimSummaryCrossPlotCollection.h"
#include "RiuMainPlotWindow.h"
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
#include "cafSelectionManagerTools.h"
#include "cvfAssert.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDuplicateSummaryCrossPlotCurveFeature, "RicDuplicateSummaryCrossPlotCurveFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicDuplicateSummaryCrossPlotCurveFeature::isCommandEnabled()
{
RimSummaryCrossPlot* selectedPlot = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryCrossPlot*>();
return (selectedPlot);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateSummaryCrossPlotCurveFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Duplicate Summary Cross Plot Curve");
actionToSetup->setIcon(QIcon(":/SummaryCurve16x16.png"));
}

View File

@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RicDuplicateSummaryCurveFeature.h"
#include "cafCmdFeature.h"
#include <vector>
class RimSummaryCrossPlot;
//==================================================================================================
///
//==================================================================================================
class RicDuplicateSummaryCrossPlotCurveFeature : public RicDuplicateSummaryCurveFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled();
virtual void setupActionLook( QAction* actionToSetup );
};

View File

@ -0,0 +1,75 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicDuplicateSummaryCrossPlotFeature.h"
#include "RiaSummaryTools.h"
#include "RicPasteSummaryCrossPlotFeature.h"
#include "RimSummaryCrossPlot.h"
#include "RimSummaryCrossPlotCollection.h"
#include "cvfAssert.h"
#include "cafSelectionManagerTools.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDuplicateSummaryCrossPlotFeature, "RicDuplicateSummaryCrossPlotFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicDuplicateSummaryCrossPlotFeature::isCommandEnabled()
{
RimSummaryCrossPlotCollection* sumPlotColl = nullptr;
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>(caf::SelectionManager::instance()->selectedItem());
if (selObj)
{
sumPlotColl = RiaSummaryTools::parentCrossPlotCollection(selObj);
}
if (sumPlotColl) return true;
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateSummaryCrossPlotFeature::onActionTriggered(bool isChecked)
{
std::vector<RimSummaryCrossPlot*> selectedObjects = caf::selectedObjectsByType<RimSummaryCrossPlot*>();
if (selectedObjects.size() == 1)
{
RicPasteSummaryCrossPlotFeature::copyPlotAndAddToCollection(selectedObjects[0]);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateSummaryCrossPlotFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Duplicate Summary Cross Plot");
actionToSetup->setIcon(QIcon(":/SummaryPlot16x16.png"));
}

View File

@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
class RimSummaryPlotCollection;
class RimSummaryCase;
class RimSummaryPlot;
//==================================================================================================
///
//==================================================================================================
class RicDuplicateSummaryCrossPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled();
virtual void onActionTriggered( bool isChecked );
virtual void setupActionLook(QAction* actionToSetup);
};

View File

@ -0,0 +1,80 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicDuplicateSummaryCurveFeature.h"
#include "RiaApplication.h"
#include "RicPasteSummaryCurveFeature.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RiaSummaryTools.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryCurve.h"
#include "RimSummaryPlot.h"
#include "RimSummaryPlotCollection.h"
#include "RiuMainPlotWindow.h"
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
#include "cafSelectionManagerTools.h"
#include "cvfAssert.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDuplicateSummaryCurveFeature, "RicDuplicateSummaryCurveFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicDuplicateSummaryCurveFeature::isCommandEnabled()
{
RimSummaryPlot* selectedPlot = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlot*>();
return (selectedPlot && !RiaSummaryTools::isSummaryCrossPlot(selectedPlot));
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateSummaryCurveFeature::onActionTriggered(bool isChecked)
{
RimProject* project = RiaApplication::instance()->project();
CVF_ASSERT(project);
RimSummaryCurve* curve = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryCurve*>();
if (curve)
{
RimSummaryCurve* newCurve = RicPasteSummaryCurveFeature::copyCurveAndAddToPlot(curve);
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(newCurve);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateSummaryCurveFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Duplicate Summary Curve");
actionToSetup->setIcon(QIcon(":/SummaryCurve16x16.png"));
}

View File

@ -0,0 +1,38 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
#include <vector>
class RimSummaryPlot;
//==================================================================================================
///
//==================================================================================================
class RicDuplicateSummaryCurveFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled();
virtual void onActionTriggered( bool isChecked );
virtual void setupActionLook( QAction* actionToSetup );
};

View File

@ -0,0 +1,75 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicDuplicateSummaryPlotFeature.h"
#include "RiaSummaryTools.h"
#include "RicPasteSummaryPlotFeature.h"
#include "RimSummaryPlot.h"
#include "RimSummaryPlotCollection.h"
#include "cvfAssert.h"
#include "cafSelectionManagerTools.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDuplicateSummaryPlotFeature, "RicDuplicateSummaryPlotFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicDuplicateSummaryPlotFeature::isCommandEnabled()
{
RimSummaryPlotCollection* sumPlotColl = nullptr;
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>(caf::SelectionManager::instance()->selectedItem());
if (selObj)
{
sumPlotColl = RiaSummaryTools::parentSummaryPlotCollection(selObj);
}
if (sumPlotColl) return true;
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateSummaryPlotFeature::onActionTriggered(bool isChecked)
{
std::vector<RimSummaryPlot*> selectedObjects = caf::selectedObjectsByType<RimSummaryPlot*>();
if (selectedObjects.size() == 1)
{
RicPasteSummaryPlotFeature::copyPlotAndAddToCollection(selectedObjects[0]);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateSummaryPlotFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Duplicate Summary Plot");
actionToSetup->setIcon(QIcon(":/SummaryPlot16x16.png"));
}

View File

@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
class RimSummaryPlotCollection;
class RimSummaryCase;
class RimSummaryPlot;
//==================================================================================================
///
//==================================================================================================
class RicDuplicateSummaryPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled();
virtual void onActionTriggered( bool isChecked );
virtual void setupActionLook(QAction* actionToSetup);
};

View File

@ -57,8 +57,9 @@ void RicNewSummaryCrossPlotFeature::onActionTriggered(bool isChecked)
CVF_ASSERT(project);
RimSummaryCrossPlotCollection* summaryCrossPlotColl = project->mainPlotCollection()->summaryCrossPlotCollection();
RimSummaryPlot* summaryPlot = summaryCrossPlotColl->addSummaryPlot();
RimSummaryPlot* summaryPlot = summaryCrossPlotColl->createSummaryPlot();
summaryCrossPlotColl->addSummaryPlot(summaryPlot);
if (summaryPlot)
{
summaryCrossPlotColl->updateConnectedEditors();

View File

@ -0,0 +1,91 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicPasteSummaryCrossPlotCurveFeature.h"
#include "RiaSummaryTools.h"
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCurveFilter.h"
#include "RimSummaryCrossPlot.h"
#include "cafPdmDefaultObjectFactory.h"
#include "cafPdmDocument.h"
#include "cafPdmObjectGroup.h"
#include "cafSelectionManagerTools.h"
#include "cvfAssert.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicPasteSummaryCrossPlotCurveFeature, "RicPasteSummaryCrossPlotCurveFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicPasteSummaryCrossPlotCurveFeature::isCommandEnabled()
{
caf::PdmObject* destinationObject = dynamic_cast<caf::PdmObject*>(caf::SelectionManager::instance()->selectedItem());
if(!RiaSummaryTools::parentCrossPlot(destinationObject))
{
return false;
}
if (summaryCurvesOnClipboard().size() == 0)
{
return false;
}
for (caf::PdmPointer<RimSummaryCurve> curve : summaryCurvesOnClipboard())
{
// Check that owner plot is correct type
RimSummaryCrossPlot* ownerPlot = nullptr;
curve->firstAncestorOrThisOfType(ownerPlot);
if (!ownerPlot) return false;
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
//void RicPasteSummaryCrossPlotCurveFeature::onActionTriggered(bool isChecked)
//{
// std::vector<caf::PdmPointer<RimSummaryCurve> > sourceObjects = RicPasteSummaryCurveFeature::summaryCurves();
//
// for (size_t i = 0; i < sourceObjects.size(); i++)
// {
// copyCurveAndAddToPlot(sourceObjects[i]);
// }
//}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicPasteSummaryCrossPlotCurveFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Paste Summary Cross Plot Curve");
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
}

View File

@ -0,0 +1,43 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RicPasteSummaryCurveFeature.h"
#include "cafCmdFeature.h"
#include "cafPdmPointer.h"
#include <vector>
class RimSummaryCurve;
class RimSummaryCurveFilter;
//==================================================================================================
///
//==================================================================================================
class RicPasteSummaryCrossPlotCurveFeature : public RicPasteSummaryCurveFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled() override;
//virtual void onActionTriggered( bool isChecked ) override;
virtual void setupActionLook(QAction* actionToSetup) override;
};

View File

@ -0,0 +1,120 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicPasteSummaryCrossPlotFeature.h"
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
#include "RimSummaryCrossPlot.h"
#include "RimSummaryCrossPlotCollection.h"
#include "cafPdmDefaultObjectFactory.h"
#include "cafPdmDocument.h"
#include "cafPdmObjectGroup.h"
#include "cafPdmObjectGroup.h"
#include "cafSelectionManagerTools.h"
#include "cvfAssert.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicPasteSummaryCrossPlotFeature, "RicPasteSummaryCrossPlotFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicPasteSummaryCrossPlotFeature::copyPlotAndAddToCollection(RimSummaryCrossPlot *sourcePlot)
{
RimSummaryCrossPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryCrossPlotCollection*>();
if (plotColl)
{
RimSummaryCrossPlot* newSummaryPlot = dynamic_cast<RimSummaryCrossPlot*>(sourcePlot->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newSummaryPlot);
plotColl->addSummaryPlot(newSummaryPlot);
// Resolve references after object has been inserted into the data model
newSummaryPlot->resolveReferencesRecursively();
newSummaryPlot->initAfterReadRecursively();
QString nameOfCopy = QString("Copy of ") + newSummaryPlot->description();
newSummaryPlot->setDescription(nameOfCopy);
plotColl->updateConnectedEditors();
newSummaryPlot->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicPasteSummaryCrossPlotFeature::isCommandEnabled()
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimSummaryCrossPlotCollection* plotColl = nullptr;
destinationObject->firstAncestorOrThisOfType(plotColl);
if (!plotColl)
{
return false;
}
return RicPasteSummaryCrossPlotFeature::summaryPlots().size() > 0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicPasteSummaryCrossPlotFeature::onActionTriggered(bool isChecked)
{
std::vector<caf::PdmPointer<RimSummaryCrossPlot> > sourceObjects = RicPasteSummaryCrossPlotFeature::summaryPlots();
for (size_t i = 0; i < sourceObjects.size(); i++)
{
copyPlotAndAddToCollection(sourceObjects[i]);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicPasteSummaryCrossPlotFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Paste Summary Cross Plot");
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<caf::PdmPointer<RimSummaryCrossPlot> > RicPasteSummaryCrossPlotFeature::summaryPlots()
{
caf::PdmObjectGroup objectGroup;
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
std::vector<caf::PdmPointer<RimSummaryCrossPlot> > typedObjects;
objectGroup.objectsByType(&typedObjects);
return typedObjects;
}

View File

@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
#include "cafPdmPointer.h"
#include <vector>
class RimSummaryCrossPlot;
//==================================================================================================
///
//==================================================================================================
class RicPasteSummaryCrossPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static void copyPlotAndAddToCollection(RimSummaryCrossPlot *sourcePlot);
protected:
// Overrides
virtual bool isCommandEnabled() override;
virtual void onActionTriggered( bool isChecked ) override;
virtual void setupActionLook(QAction* actionToSetup) override;
private:
static std::vector<caf::PdmPointer<RimSummaryCrossPlot> > summaryPlots();
};

View File

@ -18,16 +18,19 @@
#include "RicPasteSummaryCurveFeature.h"
#include "RiaSummaryTools.h"
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCurveFilter.h"
#include "RimSummaryPlot.h"
#include "RimSummaryCrossPlot.h"
#include "cafPdmDefaultObjectFactory.h"
#include "cafPdmDocument.h"
#include "cafPdmObjectGroup.h"
#include "cafSelectionManager.h"
#include "cafSelectionManagerTools.h"
#include "cvfAssert.h"
@ -36,21 +39,62 @@
CAF_CMD_SOURCE_INIT(RicPasteSummaryCurveFeature, "RicPasteSummaryCurveFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryCurve* RicPasteSummaryCurveFeature::copyCurveAndAddToPlot(RimSummaryCurve *sourceCurve)
{
RimSummaryPlot* summaryPlot = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlot*>();
RimSummaryCurve* newCurve = dynamic_cast<RimSummaryCurve*>(sourceCurve->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newCurve);
summaryPlot->addCurveAndUpdate(newCurve);
// Resolve references after object has been inserted into the project data model
newCurve->resolveReferencesRecursively();
// If source curve is part of a curve filter, resolve of references to the summary case does not
// work when pasting the new curve into a plot. Must set summary case manually.
newCurve->setSummaryCaseY(sourceCurve->summaryCaseY());
newCurve->initAfterReadRecursively();
newCurve->loadDataAndUpdate(true);
newCurve->updateConnectedEditors();
summaryPlot->updateConnectedEditors();
return newCurve;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicPasteSummaryCurveFeature::isCommandEnabled()
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
caf::PdmObject* destinationObject = dynamic_cast<caf::PdmObject*>(caf::SelectionManager::instance()->selectedItem());
RimSummaryPlot* summaryPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(summaryPlot);
if (!summaryPlot)
if(!RiaSummaryTools::parentSummaryPlot(destinationObject))
{
return false;
}
return RicPasteSummaryCurveFeature::summaryCurves().size() > 0;
if (summaryCurvesOnClipboard().size() == 0)
{
return false;
}
for (caf::PdmPointer<RimSummaryCurve> curve : summaryCurvesOnClipboard())
{
// Check that owner plot is correct type
RimSummaryPlot* ownerPlot = RiaSummaryTools::parentSummaryPlot(curve);
if (!ownerPlot) return false;
}
return true;
}
//--------------------------------------------------------------------------------------------------
@ -58,37 +102,11 @@ bool RicPasteSummaryCurveFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicPasteSummaryCurveFeature::onActionTriggered(bool isChecked)
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimSummaryPlot* summaryPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(summaryPlot);
if (!summaryPlot)
{
return;
}
std::vector<caf::PdmPointer<RimSummaryCurve> > sourceObjects = RicPasteSummaryCurveFeature::summaryCurves();
std::vector<caf::PdmPointer<RimSummaryCurve> > sourceObjects = RicPasteSummaryCurveFeature::summaryCurvesOnClipboard();
for (size_t i = 0; i < sourceObjects.size(); i++)
{
RimSummaryCurve* newObject = dynamic_cast<RimSummaryCurve*>(sourceObjects[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newObject);
summaryPlot->addCurveAndUpdate(newObject);
// Resolve references after object has been inserted into the project data model
newObject->resolveReferencesRecursively();
// If source curve is part of a curve filter, resolve of references to the summary case does not
// work when pasting the new curve into a plot. Must set summary case manually.
newObject->setSummaryCaseY(sourceObjects[i]->summaryCaseY());
newObject->initAfterReadRecursively();
newObject->loadDataAndUpdate(true);
newObject->updateConnectedEditors();
summaryPlot->updateConnectedEditors();
copyCurveAndAddToPlot(sourceObjects[i]);
}
}
@ -105,7 +123,7 @@ void RicPasteSummaryCurveFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<caf::PdmPointer<RimSummaryCurve> > RicPasteSummaryCurveFeature::summaryCurves()
std::vector<caf::PdmPointer<RimSummaryCurve> > RicPasteSummaryCurveFeature::summaryCurvesOnClipboard()
{
caf::PdmObjectGroup objectGroup;
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);

View File

@ -33,12 +33,14 @@ class RicPasteSummaryCurveFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static RimSummaryCurve* copyCurveAndAddToPlot(RimSummaryCurve *sourceCurve);
protected:
// Overrides
virtual bool isCommandEnabled() override;
virtual void onActionTriggered( bool isChecked ) override;
virtual void setupActionLook(QAction* actionToSetup) override;
private:
static std::vector<caf::PdmPointer<RimSummaryCurve> > summaryCurves();
static std::vector<caf::PdmPointer<RimSummaryCurve> > summaryCurvesOnClipboard();
};

View File

@ -27,7 +27,7 @@
#include "cafPdmDocument.h"
#include "cafPdmObjectGroup.h"
#include "cafPdmObjectGroup.h"
#include "cafSelectionManager.h"
#include "cafSelectionManagerTools.h"
#include "cvfAssert.h"
@ -36,6 +36,34 @@
CAF_CMD_SOURCE_INIT(RicPasteSummaryPlotFeature, "RicPasteSummaryPlotFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicPasteSummaryPlotFeature::copyPlotAndAddToCollection(RimSummaryPlot *sourcePlot)
{
RimSummaryPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlotCollection*>();
if (plotColl)
{
RimSummaryPlot* newSummaryPlot = dynamic_cast<RimSummaryPlot*>(sourcePlot->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newSummaryPlot);
plotColl->summaryPlots.push_back(newSummaryPlot);
// Resolve references after object has been inserted into the data model
newSummaryPlot->resolveReferencesRecursively();
newSummaryPlot->initAfterReadRecursively();
QString nameOfCopy = QString("Copy of ") + newSummaryPlot->description();
newSummaryPlot->setDescription(nameOfCopy);
plotColl->updateConnectedEditors();
newSummaryPlot->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -58,34 +86,11 @@ bool RicPasteSummaryPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicPasteSummaryPlotFeature::onActionTriggered(bool isChecked)
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimSummaryPlotCollection* plotColl = nullptr;
destinationObject->firstAncestorOrThisOfType(plotColl);
if (!plotColl)
{
return;
}
std::vector<caf::PdmPointer<RimSummaryPlot> > sourceObjects = RicPasteSummaryPlotFeature::summaryPlots();
for (size_t i = 0; i < sourceObjects.size(); i++)
{
RimSummaryPlot* newSummaryPlot = dynamic_cast<RimSummaryPlot*>(sourceObjects[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newSummaryPlot);
plotColl->summaryPlots.push_back(newSummaryPlot);
// Resolve references after object has been inserted into the data model
newSummaryPlot->resolveReferencesRecursively();
newSummaryPlot->initAfterReadRecursively();
QString nameOfCopy = QString("Copy of ") + newSummaryPlot->description();
newSummaryPlot->setDescription(nameOfCopy);
plotColl->updateConnectedEditors();
newSummaryPlot->loadDataAndUpdate();
copyPlotAndAddToCollection(sourceObjects[i]);
}
}

View File

@ -32,6 +32,9 @@ class RicPasteSummaryPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static void copyPlotAndAddToCollection(RimSummaryPlot *sourcePlot);
protected:
// Overrides
virtual bool isCommandEnabled() override;

View File

@ -357,18 +357,6 @@ void RicSummaryCurveCreator::updatePreviewCurvesFromCurveDefinitions(const std::
curve->applyCurveAutoNameSettings(*m_curveNameConfig());
m_previewPlot->addCurveNoUpdate(curve);
curveLookCalc.setupCurveLook(curve);
if (curveDef.summaryAddress().category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED)
{
// Use short version of calculated curves name
std::string fullName = curveDef.summaryAddress().quantityName();
size_t firstSpace = fullName.find_first_of(' ');
QString shortName = firstSpace != std::string::npos ?
QString::fromStdString(fullName.substr(0, firstSpace)) :
QString::fromStdString(fullName);
curve->setCustomCurveName(shortName);
}
}
m_previewPlot->loadDataAndUpdate();

View File

@ -20,6 +20,7 @@
#include "RiaApplication.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimWellPath.h"
@ -65,6 +66,11 @@ void RicWellPathFormationsImportFileFeature::onActionTriggered(bool isChecked)
if (project)
{
project->createDisplayModelAndRedrawAllViews();
if (project->mainPlotCollection())
{
project->mainPlotCollection->updatePlotsWithFormations();
}
RimOilField* oilField = project->activeOilField();
if (!oilField) return;

View File

@ -88,6 +88,9 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress(SummaryVarCategory category,
m_cellJ = std::get<1>(ijkTuple);
m_cellK = std::get<2>(ijkTuple);
break;
case SUMMARY_AQUIFER:
m_aquiferNumber = RiaStdStringTools::toInt(identifiers[INPUT_AQUIFER_NUMBER]);
break;
}
// Set quantity for all categories
@ -195,6 +198,11 @@ std::string RifEclipseSummaryAddress::uiText() const
text += ":" + formatUiTextIJK();
}
break;
case RifEclipseSummaryAddress::SUMMARY_AQUIFER:
{
text += ":" + std::to_string(this->aquiferNumber());
}
break;
}
return text;
@ -214,6 +222,7 @@ std::string RifEclipseSummaryAddress::uiText(RifEclipseSummaryAddress::SummaryId
case RifEclipseSummaryAddress::INPUT_CELL_IJK: return formatUiTextIJK();
case RifEclipseSummaryAddress::INPUT_LGR_NAME: return lgrName();
case RifEclipseSummaryAddress::INPUT_SEGMENT_NUMBER: return std::to_string(wellSegmentNumber());
case RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER: return std::to_string(aquiferNumber());
case RifEclipseSummaryAddress::INPUT_VECTOR_NAME: return quantityName();
}
return "";
@ -283,6 +292,10 @@ bool RifEclipseSummaryAddress::isValid() const
if (m_cellJ == -1) return false;
if (m_cellK == -1) return false;
return true;
case SUMMARY_AQUIFER:
if (m_aquiferNumber == -1) return false;
return true;
}
return true;
@ -409,7 +422,11 @@ bool operator==(const RifEclipseSummaryAddress& first, const RifEclipseSummaryAd
if(first.cellK() != second.cellK()) return false;
}
break;
case RifEclipseSummaryAddress::SUMMARY_AQUIFER:
{
if (first.aquiferNumber() != second.aquiferNumber()) return false;
}
break;
}
return true;
}
@ -489,6 +506,11 @@ bool operator<(const RifEclipseSummaryAddress& first, const RifEclipseSummaryAdd
if(first.cellK() != second.cellK()) return (first.cellK() < second.cellK());
}
break;
case RifEclipseSummaryAddress::SUMMARY_AQUIFER:
{
if (first.aquiferNumber() != second.aquiferNumber()) return first.aquiferNumber() < second.aquiferNumber();
}
break;
}
return false;

View File

@ -59,7 +59,8 @@ public:
INPUT_CELL_IJK,
INPUT_LGR_NAME,
INPUT_SEGMENT_NUMBER,
INPUT_VECTOR_NAME
INPUT_AQUIFER_NUMBER,
INPUT_VECTOR_NAME,
};
public:
@ -71,7 +72,8 @@ public:
m_wellSegmentNumber(-1),
m_cellI(-1),
m_cellJ(-1),
m_cellK(-1)
m_cellK(-1),
m_aquiferNumber(-1)
{
}
@ -85,7 +87,8 @@ public:
const std::string& lgrName,
int cellI,
int cellJ,
int cellK):
int cellK,
int aquiferNumber):
m_variableCategory(category),
m_quantityName(quantityName),
m_regionNumber(regionNumber),
@ -96,7 +99,8 @@ public:
m_lgrName(lgrName),
m_cellI(cellI),
m_cellJ(cellJ),
m_cellK(cellK)
m_cellK(cellK),
m_aquiferNumber(aquiferNumber)
{
}
@ -124,6 +128,7 @@ public:
int cellI() const { return m_cellI; }
int cellJ() const { return m_cellJ; }
int cellK() const { return m_cellK; }
int aquiferNumber() const { return m_aquiferNumber; }
// Derived properties
@ -135,6 +140,7 @@ public:
void setWellName(const std::string& wellName) { m_wellName = wellName; }
void setWellGroupName(const std::string& wellGroupName) { m_wellGroupName = wellGroupName; }
void setRegion(int region) { m_regionNumber = region; }
void setAquiferNumber(int aquiferNumber) { m_aquiferNumber = aquiferNumber; }
private:
@ -154,6 +160,7 @@ private:
int m_cellI;
int m_cellJ;
int m_cellK;
int m_aquiferNumber;
};
bool operator==(const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second);

View File

@ -167,13 +167,20 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress(cons
int cellI = -1;
int cellJ = -1;
int cellK = -1;
int aquiferNumber = -1;
switch (category)
{
case RifEclipseSummaryAddress::SUMMARY_FIELD:
break;
case RifEclipseSummaryAddress::SUMMARY_AQUIFER:
{
if (columnHeaderText.size() > 0)
{
aquiferNumber = RiaStdStringTools::toInt(columnHeaderText[0]);
}
break;
}
case RifEclipseSummaryAddress::SUMMARY_NETWORK:
break;
case RifEclipseSummaryAddress::SUMMARY_MISC:
@ -268,7 +275,8 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress(cons
lgrName,
cellI,
cellJ,
cellK);
cellK,
aquiferNumber);
}

View File

@ -175,8 +175,8 @@ bool RifKeywordVectorUserData::parse(const QString& data, const QString& customW
"",
-1,
-1,
-1
);
-1,
-1);
m_allResultAddresses.push_back(addr);

View File

@ -112,6 +112,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSu
int cellI(-1);
int cellJ(-1);
int cellK(-1);
int aquiferNumber(-1);
quantityName = smspec_node_get_keyword(ertSumVarNode);
@ -120,6 +121,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSu
case ECL_SMSPEC_AQUIFER_VAR:
{
sumCategory = RifEclipseSummaryAddress::SUMMARY_AQUIFER;
aquiferNumber = smspec_node_get_num(ertSumVarNode);
}
break;
case ECL_SMSPEC_WELL_VAR:
@ -230,7 +232,8 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSu
wellName,
wellSegmentNumber,
lgrName,
cellI, cellJ, cellK);
cellI, cellJ, cellK,
aquiferNumber);
}
//--------------------------------------------------------------------------------------------------

View File

@ -143,6 +143,7 @@ RifEclipseSummaryAddress RifReaderObservedData::address(const QString& quantity,
int cellI(-1);
int cellJ(-1);
int cellK(-1);
int aquiferNumber(-1);
switch (summaryCategory)
{
@ -167,7 +168,8 @@ RifEclipseSummaryAddress RifReaderObservedData::address(const QString& quantity,
wellName,
wellSegmentNumber,
lgrName,
cellI, cellJ, cellK);
cellI, cellJ, cellK,
aquiferNumber);
}
//--------------------------------------------------------------------------------------------------

View File

@ -990,7 +990,7 @@ void RimWellPltPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
{
RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0);
track->uiOrderingForShowFormationNamesAndCase(uiOrdering);
track->uiOrderingForFormations(uiOrdering);
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis");
legendAndAxisGroup->setCollapsedByDefault(true);

View File

@ -773,13 +773,11 @@ void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* timeStepsGroup = uiOrdering.addNewGroupWithKeyword("Time Steps", "TimeSteps");
timeStepsGroup->add(&m_selectedTimeSteps);
//uiOrdering.add(&m_showPlotTitle);
if (m_wellLogPlot && m_wellLogPlot->trackCount() > 0)
{
RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0);
track->uiOrderingForShowFormationNamesAndCase(uiOrdering);
track->uiOrderingForFormations(uiOrdering);
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis");
legendAndAxisGroup->setCollapsedByDefault(true);

View File

@ -185,6 +185,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
else if (dynamic_cast<RimEclipseCellColors*>(uiItem))
{
menuBuilder << "RicSaveEclipseResultAsInputPropertyFeature";
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
}
else if (dynamic_cast<RimEclipseInputPropertyCollection*>(uiItem))
{
@ -330,6 +331,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
}
else if (dynamic_cast<RimSummaryCrossPlotCollection*>(uiItem))
{
menuBuilder << "RicPasteSummaryCrossPlotFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewSummaryCrossPlotFeature";
}
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
@ -358,12 +361,15 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
else if (dynamic_cast<RimSummaryPlot*>(uiItem)) // This is also the definition for RimSummaryCrossPlot
{
menuBuilder << "RicPasteSummaryCurveFeature";
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
menuBuilder << "RicPasteSummaryPlotFeature";
menuBuilder << "RicPasteAsciiDataToSummaryPlotFeature";
menuBuilder << "Separator";
menuBuilder << "RicEditSummaryPlotFeature";
menuBuilder << "RicNewSummaryPlotFeature";
menuBuilder << "RicDuplicateSummaryPlotFeature";
menuBuilder << "RicNewSummaryCurveFeature";
menuBuilder << "RicDuplicateSummaryCrossPlotFeature";
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicShowSummaryCurveCalculatorFeature";
@ -377,9 +383,12 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
else if (dynamic_cast<RimSummaryCurve*>(uiItem))
{
menuBuilder << "RicPasteSummaryCurveFeature";
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewSummaryCurveFeature";
menuBuilder << "RicDuplicateSummaryCurveFeature";
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
menuBuilder << "RicDuplicateSummaryCrossPlotCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicCopyReferencesToClipboardFeature";
menuBuilder << "Separator";
@ -388,6 +397,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
else if (dynamic_cast<RimSummaryCurveCollection*>(uiItem))
{
menuBuilder << "RicPasteSummaryCurveFeature";
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicEditSummaryPlotFeature";
menuBuilder << "RicNewSummaryCurveFeature";

View File

@ -552,15 +552,6 @@ void RimPlotCurve::setZOrder(double z)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setCustomCurveName(const QString& customName)
{
m_isUsingAutoName = false;
m_customCurveName = customName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -99,7 +99,6 @@ public:
void showLegend(bool show);
void setZOrder(double z);
void setCustomCurveName(const QString& customName);
protected:

View File

@ -248,17 +248,31 @@ void RimTools::wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>*
CVF_ASSERT(options);
if (!options) return;
std::vector<RimWellPath*> wellPaths;
RimTools::wellPathWithFormations(&wellPaths);
QIcon wellIcon(":/Well.png");
for (RimWellPath* wellPath : wellPaths)
{
options->push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath, false, wellIcon));
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimTools::wellPathWithFormations(std::vector<RimWellPath*>* wellPaths)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection())
{
caf::PdmChildArrayField<RimWellPath*>& wellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
caf::PdmChildArrayField<RimWellPath*>& allWellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
QIcon wellIcon(":/Well.png");
for (RimWellPath* wellPath : wellPaths)
for (RimWellPath* wellPath : allWellPaths)
{
if (wellPath->hasFormations())
{
options->push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath, false, wellIcon));
wellPaths->push_back(wellPath);
}
}
}

View File

@ -20,6 +20,8 @@
#pragma once
#include "RimWellPath.h"
#include <QList>
#include <QString>
@ -43,6 +45,7 @@ public:
static void wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options);
static void wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>* options);
static void wellPathWithFormations(std::vector<RimWellPath*>* wellPaths);
static void caseOptionItems(QList<caf::PdmOptionItemInfo>* options);
static QString createTimeFormatStringFromDates(const std::vector<QDateTime>& dates);

View File

@ -80,9 +80,29 @@ namespace caf
void AppEnum< RimWellLogTrack::FormationSource >::setUp()
{
addItem(RimWellLogTrack::CASE, "CASE", "Case");
addItem(RimWellLogTrack::WELL_PICK, "WELLPICK", "Well Pick");
addItem(RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Path");
setDefault(RimWellLogTrack::CASE);
}
template<>
void AppEnum<RigWellPathFormations::FormationLevel>::setUp()
{
addItem(RigWellPathFormations::NONE, "NONE", "None");
addItem(RigWellPathFormations::ALL, "ALL", "All");
addItem(RigWellPathFormations::GROUP, "GROUP", "Formation Group");
addItem(RigWellPathFormations::LEVEL0, "LEVEL0", "Formation");
addItem(RigWellPathFormations::LEVEL1, "LEVEL1", "Formation 1");
addItem(RigWellPathFormations::LEVEL2, "LEVEL2", "Formation 2");
addItem(RigWellPathFormations::LEVEL3, "LEVEL3", "Formation 3");
addItem(RigWellPathFormations::LEVEL4, "LEVEL4", "Formation 4");
addItem(RigWellPathFormations::LEVEL5, "LEVEL5", "Formation 5");
addItem(RigWellPathFormations::LEVEL6, "LEVEL6", "Formation 6");
addItem(RigWellPathFormations::LEVEL7, "LEVEL7", "Formation 7");
addItem(RigWellPathFormations::LEVEL8, "LEVEL8", "Formation 8");
addItem(RigWellPathFormations::LEVEL9, "LEVEL9", "Formation 9");
addItem(RigWellPathFormations::LEVEL10, "LEVEL10", "Formation 10");
setDefault(RigWellPathFormations::ALL);
}
}
@ -109,9 +129,9 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitField(&m_isLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale", "", "", "");
CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show Formations", "", "", "");
CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Formation Source", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Source", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_formationTrajectoryType, "FormationTrajectoryType", "Trajectory", "", "", "");
@ -125,6 +145,10 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault(&m_formationCase, "FormationCase", "Formation Case", "", "", "");
m_formationCase.uiCapability()->setUiTreeChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&m_formationLevel, "FormationLevel", "Well Pick Filter", "", "", "");
CAF_PDM_InitField(&m_showformationFluids, "ShowFormationFluids", false, "Show Fluids", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@ -253,6 +277,22 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
pltPlot->updateConnectedEditors();
}
}
bool validWellPathChosen = false;
std::vector<RimWellPath*> wellPaths;
RimTools::wellPathWithFormations(&wellPaths);
for (RimWellPath* wellPath : wellPaths)
{
if (wellPath == m_formationWellPath)
{
validWellPathChosen = true;
break;
}
}
if (!validWellPathChosen)
{
m_formationWellPath = nullptr;
}
}
else if (changedField == &m_formationCase)
{
@ -285,6 +325,14 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
loadDataAndUpdate();
}
else if (changedField == &m_formationLevel)
{
loadDataAndUpdate();
}
else if (changedField == &m_showformationFluids)
{
loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
@ -302,7 +350,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
{
RimTools::wellPathOptionItems(&options);
}
else if(m_formationSource == WELL_PICK)
else if(m_formationSource == WELL_PICK_FILTER)
{
RimTools::wellPathWithFormationsOptionItems(&options);
}
@ -324,6 +372,32 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
auto simulationWellBranches = RiaSimWellBranchTools::simulationWellBranches(m_formationSimWellName(), m_formationBranchDetection);
options = RiaSimWellBranchTools::valueOptionsForBranchIndexField(simulationWellBranches);
}
else if (fieldNeedingOptions == &m_formationLevel)
{
if (m_formationWellPath)
{
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry();
if (formations)
{
using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>;
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::NONE),
RigWellPathFormations::NONE));
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::ALL),
RigWellPathFormations::ALL));
for (const RigWellPathFormations::FormationLevel& level : formations->formationsLevelsPresent())
{
size_t index = FormationLevelEnum::index(level);
if (index >= FormationLevelEnum::size()) continue;
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiTextFromIndex(index),
FormationLevelEnum::fromIndex(index)));
}
}
}
}
return options;
}
@ -736,9 +810,14 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
m_formationBranchIndex);
}
}
else if (m_formationSource() == WELL_PICK)
else if (m_formationSource() == WELL_PICK_FILTER)
{
formationGroup->add(&m_formationWellPath);
if (m_formationWellPath())
{
formationGroup->add(&m_formationLevel);
formationGroup->add(&m_showformationFluids);
}
}
uiOrderingForVisibleXRange(uiOrdering);
@ -867,7 +946,7 @@ std::vector<RimWellLogCurve* > RimWellLogTrack::curvesVector()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering& uiOrdering)
void RimWellLogTrack::uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Zonation/Formation Names");
formationGroup->setCollapsedByDefault(true);
@ -877,6 +956,15 @@ void RimWellLogTrack::uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering&
{
formationGroup->add(&m_formationCase);
}
if (m_formationSource == WELL_PICK_FILTER)
{
formationGroup->add(&m_formationWellPath);
if (m_formationWellPath())
{
formationGroup->add(&m_formationLevel);
formationGroup->add(&m_showformationFluids);
}
}
}
//--------------------------------------------------------------------------------------------------
@ -1075,6 +1163,8 @@ void RimWellLogTrack::setFormationFieldsUiReadOnly(bool readOnly /*= true*/)
m_formationCase.uiCapability()->setUiReadOnly(readOnly);
m_formationWellPath.uiCapability()->setUiReadOnly(readOnly);
m_formationBranchIndex.uiCapability()->setUiReadOnly(readOnly);
m_formationLevel.uiCapability()->setUiReadOnly(readOnly);
m_showformationFluids.uiCapability()->setUiReadOnly(readOnly);
}
//--------------------------------------------------------------------------------------------------
@ -1158,7 +1248,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
m_annotationTool->attachFormationNames(this->viewer(), formationNamesToPlot, yValues);
}
else if (m_formationSource() == WELL_PICK)
else if (m_formationSource() == WELL_PICK_FILTER)
{
if (m_formationWellPath == nullptr) return;
if (plot->depthType() != RimWellLogPlot::MEASURED_DEPTH) return;
@ -1168,8 +1258,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry();
if (!formations) return;
formations->measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(&formationNamesToPlot, &yValues);
formations->measuredDepthAndFormationNamesUpToLevel(m_formationLevel(), &formationNamesToPlot, &yValues, m_showformationFluids());
m_annotationTool->attachWellPicks(this->viewer(), formationNamesToPlot, yValues);
}
}

View File

@ -21,6 +21,8 @@
#include "RimWellLogPlot.h"
#include "RigWellPathFormations.h"
#include "cafPdmObject.h"
#include "cafPdmField.h"
#include "cafPdmChildArrayField.h"
@ -67,7 +69,7 @@ public:
virtual ~RimWellLogTrack();
enum TrajectoryType { WELL_PATH, SIMULATION_WELL };
enum FormationSource { CASE, WELL_PICK };
enum FormationSource { CASE, WELL_PICK_FILTER };
void setDescription(const QString& description);
bool isVisible();
@ -114,7 +116,7 @@ public:
QString description();
std::vector<RimWellLogCurve* > curvesVector();
void uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering& uiOrdering);
void uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering);
void uiOrderingForVisibleXRange(caf::PdmUiOrdering& uiOrdering);
private:
@ -163,15 +165,17 @@ private:
caf::PdmField<bool> m_isAutoScaleXEnabled;
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
caf::PdmField<bool> m_showFormations;
caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource;
caf::PdmPtrField<RimCase*> m_formationCase;
caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType;
caf::PdmPtrField<RimWellPath*> m_formationWellPath;
caf::PdmField<bool> m_showFormations;
caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource;
caf::PdmPtrField<RimCase*> m_formationCase;
caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType;
caf::PdmPtrField<RimWellPath*> m_formationWellPath;
caf::PdmField<QString> m_formationSimWellName;
caf::PdmField<int> m_formationBranchIndex;
caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel;
caf::PdmField<bool> m_showformationFluids;
caf::PdmField<QString> m_formationSimWellName;
caf::PdmField<int> m_formationBranchIndex;
caf::PdmField<bool> m_formationBranchDetection;
caf::PdmField<bool> m_formationBranchDetection;
QPointer<RiuWellLogTrack> m_wellLogTrackPlotWidget;

View File

@ -73,7 +73,8 @@ std::string RifCalculatedSummaryCurveReader::unitName(const RifEclipseSummaryAdd
{
return calculation->unitName().toStdString();
}
return "Calculated Curve Unit";
return "";
}
//--------------------------------------------------------------------------------------------------

View File

@ -67,9 +67,10 @@ RimSummaryAddress::RimSummaryAddress()
CAF_PDM_InitFieldNoDefault(&m_cellI, "SummaryCellI", "I", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_cellJ, "SummaryCellJ", "J", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_cellK, "SummaryCellK", "K", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_aquiferNumber, "SummaryAquifer", "Aquifer", "", "", "");
m_category = RifEclipseSummaryAddress::SUMMARY_INVALID;
m_regionNumber = m_regionNumber2 = m_wellSegmentNumber = m_cellI = m_cellJ = m_cellK = -1;
m_regionNumber = m_regionNumber2 = m_wellSegmentNumber = m_cellI = m_cellJ = m_cellK = m_aquiferNumber -1;
}
//--------------------------------------------------------------------------------------------------
@ -93,6 +94,7 @@ void RimSummaryAddress::setAddress(const RifEclipseSummaryAddress& addr)
m_wellName = addr.wellName().c_str();
m_wellSegmentNumber = addr.wellSegmentNumber();
m_lgrName = addr.lgrName().c_str();
m_aquiferNumber = addr.aquiferNumber();
m_cellI = addr.cellI(); m_cellJ = addr.cellJ(); m_cellK = addr.cellK();
}
@ -110,6 +112,7 @@ RifEclipseSummaryAddress RimSummaryAddress::address()
m_wellName().toStdString(),
m_wellSegmentNumber(),
m_lgrName().toStdString(),
m_cellI(), m_cellJ(), m_cellK());
m_cellI(), m_cellJ(), m_cellK(),
m_aquiferNumber);
}

View File

@ -62,6 +62,6 @@ private:
caf::PdmField<int> m_cellI;
caf::PdmField<int> m_cellJ;
caf::PdmField<int> m_cellK;
caf::PdmField<int> m_aquiferNumber;
};

View File

@ -1,61 +1,57 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 Statoil ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimSummaryAxisProperties.h"
#include "RimSummaryPlot.h"
#include "RiaDefines.h"
#include "RimSummaryPlot.h"
#include "cafPdmUiSliderEditor.h"
#include <cmath>
namespace caf
{
template<>
void caf::AppEnum< RimSummaryAxisProperties::NumberFormatType >::setUp()
{
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_AUTO, "NUMBER_FORMAT_AUTO", "Auto");
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_DECIMAL, "NUMBER_FORMAT_DECIMAL", "Decimal");
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_SCIENTIFIC,"NUMBER_FORMAT_SCIENTIFIC", "Scientific");
setDefault(RimSummaryAxisProperties::NUMBER_FORMAT_AUTO);
}
}
// clang-format off
namespace caf
{
template<>
void caf::AppEnum< RimSummaryAxisProperties::AxisTitlePositionType >::setUp()
void caf::AppEnum<RimSummaryAxisProperties::NumberFormatType>::setUp()
{
addItem(RimSummaryAxisProperties::AXIS_TITLE_CENTER, "AXIS_TITLE_CENTER", "Center");
addItem(RimSummaryAxisProperties::AXIS_TITLE_END, "AXIS_TITLE_END", "At End");
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_AUTO, "NUMBER_FORMAT_AUTO", "Auto");
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_DECIMAL, "NUMBER_FORMAT_DECIMAL", "Decimal");
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_SCIENTIFIC, "NUMBER_FORMAT_SCIENTIFIC", "Scientific");
setDefault(RimSummaryAxisProperties::NUMBER_FORMAT_AUTO);
}
template<>
void caf::AppEnum<RimSummaryAxisProperties::AxisTitlePositionType>::setUp()
{
addItem(RimSummaryAxisProperties::AXIS_TITLE_CENTER, "AXIS_TITLE_CENTER", "Center");
addItem(RimSummaryAxisProperties::AXIS_TITLE_END, "AXIS_TITLE_END", "At End");
setDefault(RimSummaryAxisProperties::AXIS_TITLE_CENTER);
}
}
} // namespace caf
CAF_PDM_SOURCE_INIT(RimSummaryAxisProperties, "SummaryYAxisProperties");
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimSummaryAxisProperties::RimSummaryAxisProperties()
{
@ -68,28 +64,34 @@ RimSummaryAxisProperties::RimSummaryAxisProperties()
m_name.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&isAutoTitle, "AutoTitle", true, "Auto Title", "", "", "");
CAF_PDM_InitFieldNoDefault(&customTitle, "CustomTitle", "Title", "", "", "");
CAF_PDM_InitFieldNoDefault(&titlePositionEnum, "TitlePosition", "Title Position", "", "", "");
CAF_PDM_InitField(&titleFontSize, "FontSize", 11, "Font Size", "", "", "");
CAF_PDM_InitField(&m_displayLongName, "DisplayLongName", true, " Names", "", "", "");
CAF_PDM_InitField(&m_displayShortName, "DisplayShortName", false, " Acronymes", "", "", "");
CAF_PDM_InitField(&m_displayUnitText, "DisplayUnitText", true, " Units", "", "", "");
CAF_PDM_InitFieldNoDefault(&customTitle, "CustomTitle", "Title", "", "", "");
CAF_PDM_InitFieldNoDefault(&titlePositionEnum, "TitlePosition", "Title Position", "", "", "");
CAF_PDM_InitField(&titleFontSize, "FontSize", 11, "Font Size", "", "", "");
CAF_PDM_InitField(&visibleRangeMax, "VisibleRangeMax", RiaDefines::maximumDefaultValuePlot(), "Max", "", "", "");
CAF_PDM_InitField(&visibleRangeMin, "VisibleRangeMin", RiaDefines::minimumDefaultValuePlot(), "Min", "", "", "");
CAF_PDM_InitFieldNoDefault(&numberFormat, "NumberFormat", "Number Format", "", "", "");
CAF_PDM_InitField(&numberOfDecimals, "Decimals", 2, "Number of Decimals", "", "", "");
CAF_PDM_InitField(&scaleFactor, "ScaleFactor", 1.0, "Scale Factor", "", "", "");
CAF_PDM_InitField(&valuesFontSize, "ValuesFontSize", 11, "Font Size", "", "", "");
CAF_PDM_InitFieldNoDefault(&numberFormat, "NumberFormat", "Number Format", "", "", "");
CAF_PDM_InitField(&numberOfDecimals, "Decimals", 2, "Number of Decimals", "", "", "");
CAF_PDM_InitField(&scaleFactor, "ScaleFactor", 1.0, "Scale Factor", "", "", "");
CAF_PDM_InitField(&valuesFontSize, "ValuesFontSize", 11, "Font Size", "", "", "");
numberOfDecimals.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
CAF_PDM_InitField(&isLogarithmicScaleEnabled, "LogarithmicScale", false, "Logarithmic Scale", "", "", "");
updateOptionSensitivity();
}
// clang-format on
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimSummaryAxisProperties::userDescriptionField()
{
@ -97,15 +99,15 @@ caf::PdmFieldHandle* RimSummaryAxisProperties::userDescriptionField()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimSummaryAxisProperties::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
QList<caf::PdmOptionItemInfo> RimSummaryAxisProperties::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly)
{
QList<caf::PdmOptionItemInfo> options;
*useOptionsOnly = true;
if (&titleFontSize == fieldNeedingOptions ||
&valuesFontSize == fieldNeedingOptions)
if (&titleFontSize == fieldNeedingOptions || &valuesFontSize == fieldNeedingOptions)
{
std::vector<int> fontSizes;
fontSizes.push_back(8);
@ -128,10 +130,8 @@ QList<caf::PdmOptionItemInfo> RimSummaryAxisProperties::calculateValueOptions(co
{
for (int exp = -12; exp <= 12; exp += 3)
{
QString uiText =
exp == 0 ? "1" :
QString("10 ^ %1").arg(exp);
double value = std::pow(10, exp);
QString uiText = exp == 0 ? "1" : QString("10 ^ %1").arg(exp);
double value = std::pow(10, exp);
options.push_back(caf::PdmOptionItemInfo(uiText, value));
}
@ -141,20 +141,40 @@ QList<caf::PdmOptionItemInfo> RimSummaryAxisProperties::calculateValueOptions(co
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimSummaryAxisProperties::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup& titleGroup = *(uiOrdering.addNewGroup("Axis Title"));
titleGroup.add(&isAutoTitle);
titleGroup.add(&customTitle);
titleGroup.add(&titlePositionEnum);
titleGroup.add(&titleFontSize);
{
caf::PdmUiGroup* titleTextGroup = uiOrdering.addNewGroup("Title Text");
caf::PdmUiGroup& scaleGroup = *(uiOrdering.addNewGroup("Axis Values"));
titleTextGroup->add(&isAutoTitle);
if (isAutoTitle())
{
titleTextGroup->add(&m_displayLongName);
titleTextGroup->add(&m_displayShortName);
titleTextGroup->add(&m_displayUnitText);
customTitle.uiCapability()->setUiReadOnly(true);
}
else
{
titleTextGroup->add(&customTitle);
customTitle.uiCapability()->setUiReadOnly(false);
}
}
{
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup("Title Layout");
titleGroup->add(&titlePositionEnum);
titleGroup->add(&titleFontSize);
}
caf::PdmUiGroup& scaleGroup = *(uiOrdering.addNewGroup("Axis Values"));
scaleGroup.add(&isLogarithmicScaleEnabled);
scaleGroup.add(&numberFormat);
if (numberFormat() != NUMBER_FORMAT_AUTO)
{
scaleGroup.add(&numberOfDecimals);
@ -164,11 +184,12 @@ void RimSummaryAxisProperties::defineUiOrdering(QString uiConfigName, caf::PdmUi
scaleGroup.add(&visibleRangeMin);
scaleGroup.add(&visibleRangeMax);
scaleGroup.add(&valuesFontSize);
uiOrdering.skipRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimSummaryAxisProperties::setNameAndAxis(const QString& name, QwtPlot::Axis axis)
{
@ -180,7 +201,7 @@ void RimSummaryAxisProperties::setNameAndAxis(const QString& name, QwtPlot::Axis
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QwtPlot::Axis RimSummaryAxisProperties::qwtPlotAxisType() const
{
@ -188,7 +209,7 @@ QwtPlot::Axis RimSummaryAxisProperties::qwtPlotAxisType() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RiaDefines::PlotAxis RimSummaryAxisProperties::plotAxisType() const
{
@ -199,7 +220,39 @@ RiaDefines::PlotAxis RimSummaryAxisProperties::plotAxisType() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RimSummaryAxisProperties::useAutoTitle() const
{
return isAutoTitle();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSummaryAxisProperties::showDescription() const
{
return m_displayLongName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSummaryAxisProperties::showAcronym() const
{
return m_displayShortName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSummaryAxisProperties::showUnitText() const
{
return m_displayUnitText();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSummaryAxisProperties::isActive() const
{
@ -207,11 +260,11 @@ bool RimSummaryAxisProperties::isActive() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
const QVariant& newValue)
{
if (changedField == &isAutoTitle)
{
updateOptionSensitivity();
@ -224,13 +277,13 @@ void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* chang
if (changedField == &visibleRangeMax)
{
if (visibleRangeMin > visibleRangeMax) visibleRangeMax = oldValue.toDouble();
rimSummaryPlot->disableAutoZoom();
}
else if (changedField == &visibleRangeMin)
{
if (visibleRangeMin > visibleRangeMax) visibleRangeMin = oldValue.toDouble();
rimSummaryPlot->disableAutoZoom();
}
@ -246,7 +299,7 @@ void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* chang
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimSummaryAxisProperties::updateOptionSensitivity()
{
@ -254,7 +307,7 @@ void RimSummaryAxisProperties::updateOptionSensitivity()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimSummaryAxisProperties::initAfterRead()
{
@ -262,10 +315,9 @@ void RimSummaryAxisProperties::initAfterRead()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimSummaryAxisProperties::objectToggleField()
{
return &m_isActive;
}

View File

@ -1,40 +1,37 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 Statoil ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaDefines.h"
#include "cafPdmObject.h"
#include "cafPdmField.h"
#include "cafPdmChildArrayField.h"
#include "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "qwt_plot.h"
#include <QString>
//==================================================================================================
///
///
///
///
//==================================================================================================
class RimSummaryAxisProperties : public caf::PdmObject
{
@ -57,39 +54,51 @@ public:
public:
RimSummaryAxisProperties();
void setNameAndAxis(const QString& name, QwtPlot::Axis axis);
QwtPlot::Axis qwtPlotAxisType() const;
RiaDefines::PlotAxis plotAxisType() const;
void setNameAndAxis(const QString& name, QwtPlot::Axis axis);
QwtPlot::Axis qwtPlotAxisType() const;
RiaDefines::PlotAxis plotAxisType() const;
bool useAutoTitle() const;
bool showDescription() const;
bool showAcronym() const;
bool showUnitText() const;
caf::PdmField<bool> isAutoTitle;
caf::PdmField<QString> customTitle;
caf::PdmField<int> titleFontSize;
caf::PdmField< caf::AppEnum< AxisTitlePositionType > > titlePositionEnum;
caf::PdmField<QString> customTitle;
caf::PdmField<int> titleFontSize;
caf::PdmField<caf::AppEnum<AxisTitlePositionType>> titlePositionEnum;
caf::PdmField<double> visibleRangeMin;
caf::PdmField<double> visibleRangeMax;
caf::PdmField<double> visibleRangeMin;
caf::PdmField<double> visibleRangeMax;
caf::PdmField< caf::AppEnum< NumberFormatType > > numberFormat;
caf::PdmField<int> numberOfDecimals;
caf::PdmField<double> scaleFactor;
caf::PdmField<bool> isLogarithmicScaleEnabled;
caf::PdmField<int> valuesFontSize;
caf::PdmField<caf::AppEnum<NumberFormatType>> numberFormat;
caf::PdmField<int> numberOfDecimals;
caf::PdmField<double> scaleFactor;
caf::PdmField<bool> isLogarithmicScaleEnabled;
caf::PdmField<int> valuesFontSize;
bool isActive() const;
bool isActive() const;
protected:
virtual void initAfterRead() override;
virtual caf::PdmFieldHandle* userDescriptionField() override;
virtual caf::PdmFieldHandle* objectToggleField() override;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void initAfterRead() override;
virtual caf::PdmFieldHandle* userDescriptionField() override;
virtual caf::PdmFieldHandle* objectToggleField() override;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
const QVariant& newValue) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly) override;
private:
void updateOptionSensitivity();
void updateOptionSensitivity();
private:
caf::PdmField<bool> m_isActive;
caf::PdmField<QString> m_name;
QwtPlot::Axis m_axis;
caf::PdmField<bool> m_isActive;
caf::PdmField<bool> isAutoTitle;
caf::PdmField<bool> m_displayShortName;
caf::PdmField<bool> m_displayLongName;
caf::PdmField<bool> m_displayUnitText;
caf::PdmField<QString> m_name;
QwtPlot::Axis m_axis;
};

View File

@ -86,13 +86,19 @@ void RimSummaryCrossPlotCollection::summaryPlotItemInfos(QList<caf::PdmOptionIte
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlot* RimSummaryCrossPlotCollection::addSummaryPlot()
RimSummaryPlot* RimSummaryCrossPlotCollection::createSummaryPlot()
{
RimSummaryPlot* plot = new RimSummaryCrossPlot();
m_summaryCrossPlots().push_back(plot);
plot->setDescription(QString("Summary Cross Plot %1").arg(m_summaryCrossPlots.size()));
return plot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCrossPlotCollection::addSummaryPlot(RimSummaryPlot *plot)
{
m_summaryCrossPlots().push_back(plot);
}

View File

@ -37,7 +37,8 @@ public:
void deleteAllChildObjects();
std::vector<RimSummaryPlot*> summaryPlots() const;
RimSummaryPlot* addSummaryPlot();
RimSummaryPlot* createSummaryPlot();
void addSummaryPlot(RimSummaryPlot *plot);
void updateSummaryNameHasChanged();
void summaryPlotItemInfos(QList<caf::PdmOptionItemInfo>* optionInfos) const;

View File

@ -63,7 +63,7 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
{
text += summaryAddress.quantityName();
if (m_unit && summaryCurve)
if (m_unit && summaryCurve && !summaryCurve->unitNameY().empty())
{
text += "[" + summaryCurve->unitNameY() + "]";
}

View File

@ -26,6 +26,7 @@
#include "RimAsciiDataCurve.h"
#include "RiuSummaryQwtPlot.h"
#include "RiuSummaryVectorDescriptionMap.h"
#include "qwt_plot_curve.h"
#include "qwt_scale_draw.h"
@ -124,7 +125,7 @@ void RimSummaryPlotYAxisFormatter::applyYAxisPropertiesToPlot(RiuSummaryQwtPlot*
{
QString axisTitle = m_axisProperties->customTitle;
if (m_axisProperties->isAutoTitle) axisTitle = autoAxisTitle();
if (m_axisProperties->useAutoTitle()) axisTitle = autoAxisTitle();
QwtText axisTitleY = qwtPlot->axisTitle(m_axisProperties->qwtPlotAxisType());
@ -200,23 +201,60 @@ void RimSummaryPlotYAxisFormatter::applyYAxisPropertiesToPlot(RiuSummaryQwtPlot*
//--------------------------------------------------------------------------------------------------
QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
{
std::map<std::string, std::set<std::string> > unitToQuantityNameMap;
std::map<std::string, std::set<std::string>> unitToQuantityNameMap;
if (m_axisProperties->plotAxisType() == RiaDefines::PLOT_AXIS_BOTTOM)
for (RimSummaryCurve* rimCurve : m_summaryCurves)
{
for (RimSummaryCurve* rimCurve : m_summaryCurves)
RifEclipseSummaryAddress sumAddress;
std::string unitText;
if (m_axisProperties->plotAxisType() == RiaDefines::PLOT_AXIS_BOTTOM)
{
unitToQuantityNameMap[rimCurve->unitNameX()].insert(rimCurve->curveName().toStdString());
sumAddress = rimCurve->summaryAddressX();
unitText = rimCurve->unitNameX();
}
}
else
{
for ( RimSummaryCurve* rimCurve : m_summaryCurves )
else if (rimCurve->axisY() == this->m_axisProperties->plotAxisType())
{
if ( rimCurve->axisY() == this->m_axisProperties->plotAxisType() )
sumAddress = rimCurve->summaryAddressY();
unitText = rimCurve->unitNameY();
}
else
{
continue;
}
std::string quantityNameForDisplay;
{
std::string quantityName = sumAddress.quantityName();
if (sumAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED)
{
unitToQuantityNameMap[rimCurve->unitNameY()].insert(rimCurve->curveName().toStdString());
quantityNameForDisplay = shortCalculationName(quantityName);
}
else
{
if (m_axisProperties->showDescription())
{
quantityNameForDisplay = RiuSummaryVectorDescriptionMap::instance()->fieldInfo(quantityName);
}
if (m_axisProperties->showAcronym())
{
if (!quantityNameForDisplay.empty())
{
quantityNameForDisplay += " (";
quantityNameForDisplay += quantityName;
quantityNameForDisplay += ")";
}
else
{
quantityNameForDisplay += quantityName;
}
}
}
unitToQuantityNameMap[unitText].insert(quantityNameForDisplay);
}
}
@ -227,19 +265,22 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
{
if (m_axisProperties->scaleFactor() != 1.0)
{
int exponent = std::log10(m_axisProperties->scaleFactor());
int exponent = std::log10(m_axisProperties->scaleFactor());
scaleFactorText = QString(" x 10<sup>%1</sup> ").arg(QString::number(exponent));
}
}
for ( auto unitIt : unitToQuantityNameMap )
for (auto unitIt : unitToQuantityNameMap)
{
for (const auto &quantIt: unitIt.second)
for (const auto& quantIt : unitIt.second)
{
assembledYAxisText += QString::fromStdString(quantIt) + " ";
}
assembledYAxisText += "[" + QString::fromStdString(unitIt.first) + scaleFactorText + "] ";
if (m_axisProperties->showUnitText() && !unitIt.first.empty())
{
assembledYAxisText += "[" + QString::fromStdString(unitIt.first) + scaleFactorText + "] ";
}
}
if (m_timeHistoryCurveQuantities.size() > 0)
@ -258,9 +299,21 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
return assembledYAxisText;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RimSummaryPlotYAxisFormatter::shortCalculationName(const std::string& calculationName)
{
QString calculationShortName = QString::fromStdString(calculationName);
int indexOfFirstSpace = calculationShortName.indexOf(' ');
if (indexOfFirstSpace > -1 && indexOfFirstSpace < calculationShortName.size())
{
calculationShortName = calculationShortName.left(indexOfFirstSpace);
}
return calculationShortName.toStdString();
}

View File

@ -42,6 +42,8 @@ public:
private:
QString autoAxisTitle() const;
static std::string shortCalculationName(const std::string& calculationName);
private:
RimSummaryAxisProperties* m_axisProperties;

View File

@ -156,7 +156,7 @@ void RimSummaryPlot::updateAxes()
//--------------------------------------------------------------------------------------------------
bool RimSummaryPlot::isLogarithmicScaleEnabled(RiaDefines::PlotAxis plotAxis) const
{
return yAxisPropertiesForAxis(plotAxis)->isLogarithmicScaleEnabled();
return yAxisPropertiesLeftOrRight(plotAxis)->isLogarithmicScaleEnabled();
}
//--------------------------------------------------------------------------------------------------
@ -516,7 +516,7 @@ void RimSummaryPlot::updateAxis(RiaDefines::PlotAxis plotAxis)
qwtAxis = QwtPlot::yRight;
}
RimSummaryAxisProperties* yAxisProperties = yAxisPropertiesForAxis(plotAxis);
RimSummaryAxisProperties* yAxisProperties = yAxisPropertiesLeftOrRight(plotAxis);
if (yAxisProperties->isActive() && hasVisibleCurvesForAxis(plotAxis))
{
m_qwtPlot->enableAxis(qwtAxis, true);
@ -545,7 +545,7 @@ void RimSummaryPlot::updateAxis(RiaDefines::PlotAxis plotAxis)
//--------------------------------------------------------------------------------------------------
void RimSummaryPlot::updateZoomForAxis(RiaDefines::PlotAxis plotAxis)
{
RimSummaryAxisProperties* yAxisProps = yAxisPropertiesForAxis(plotAxis);
RimSummaryAxisProperties* yAxisProps = yAxisPropertiesLeftOrRight(plotAxis);
if (yAxisProps->isLogarithmicScaleEnabled)
{
@ -648,11 +648,11 @@ bool RimSummaryPlot::hasVisibleCurvesForAxis(RiaDefines::PlotAxis plotAxis) cons
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryAxisProperties* RimSummaryPlot::yAxisPropertiesForAxis(RiaDefines::PlotAxis plotAxis) const
RimSummaryAxisProperties* RimSummaryPlot::yAxisPropertiesLeftOrRight(RiaDefines::PlotAxis leftOrRightPlotAxis) const
{
RimSummaryAxisProperties* yAxisProps = nullptr;
if (plotAxis == RiaDefines::PLOT_AXIS_LEFT)
if (leftOrRightPlotAxis == RiaDefines::PLOT_AXIS_LEFT)
{
yAxisProps = m_leftYAxisProperties();
}
@ -776,15 +776,15 @@ void RimSummaryPlot::updateBottomXAxis()
QwtPlot::Axis qwtAxis = QwtPlot::xBottom;
RimSummaryAxisProperties* yAxisProperties = m_bottomAxisProperties();
RimSummaryAxisProperties* bottomAxisProperties = m_bottomAxisProperties();
if (yAxisProperties->isActive())
if (bottomAxisProperties->isActive())
{
m_qwtPlot->enableAxis(qwtAxis, true);
std::set<QString> timeHistoryQuantities;
RimSummaryPlotYAxisFormatter calc(yAxisProperties,
RimSummaryPlotYAxisFormatter calc(bottomAxisProperties,
visibleSummaryCurvesForAxis(RiaDefines::PLOT_AXIS_BOTTOM),
visibleAsciiDataCurvesForAxis(RiaDefines::PLOT_AXIS_BOTTOM),
timeHistoryQuantities);
@ -805,7 +805,6 @@ void RimSummaryPlot::updateCaseNameHasChanged()
{
m_summaryCurveCollection->updateCaseNameHasChanged();
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -134,7 +134,7 @@ private:
std::vector<RimAsciiDataCurve*> visibleAsciiDataCurvesForAxis(RiaDefines::PlotAxis plotAxis) const;
bool hasVisibleCurvesForAxis(RiaDefines::PlotAxis plotAxis) const;
RimSummaryAxisProperties* yAxisPropertiesForAxis(RiaDefines::PlotAxis plotAxis) const;
RimSummaryAxisProperties* yAxisPropertiesLeftOrRight(RiaDefines::PlotAxis leftOrRightPlotAxis) const;
void updateAxis(RiaDefines::PlotAxis plotAxis);
void updateZoomForAxis(RiaDefines::PlotAxis plotAxis);

View File

@ -706,22 +706,56 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::ca
// Requesting FVF or Viscosity
const Opm::ECLPVT::RawCurve rawCurveType = (pvtCurveType == PvtCurveType::PVT_CT_FVF) ? Opm::ECLPVT::RawCurve::FVF : Opm::ECLPVT::RawCurve::Viscosity;
const std::array<Opm::ECLPhaseIndex, 2> queryPhaseArr = { Opm::ECLPhaseIndex::Vapour, Opm::ECLPhaseIndex::Liquid };
const std::array<PvtCurve::Phase, 2> mapToPhaseArr = { PvtCurve::GAS, PvtCurve::OIL };
for (size_t i = 0; i < queryPhaseArr.size(); i++)
if (pvtCurveType == PvtCurveType::PVT_CT_FVF)
{
const Opm::ECLPhaseIndex queryPhaseIndex = queryPhaseArr[i];
const PvtCurve::Phase mapToPhase = mapToPhaseArr[i];
std::vector<Opm::ECLPVT::PVTGraph> graphArr = m_opmFlowDiagStaticData->m_eclPvtCurveCollection->getPvtCurve(rawCurveType, queryPhaseIndex, static_cast<int>(activeCellIndex));
for (Opm::ECLPVT::PVTGraph srcGraph : graphArr)
// Bo
{
if (srcGraph.press.size() > 0)
std::vector<Opm::ECLPVT::PVTGraph> graphArr = m_opmFlowDiagStaticData->m_eclPvtCurveCollection->getPvtCurve(Opm::ECLPVT::RawCurve::FVF, Opm::ECLPhaseIndex::Liquid, static_cast<int>(activeCellIndex));
for (Opm::ECLPVT::PVTGraph srcGraph : graphArr)
{
retCurveArr.push_back({ mapToPhase, srcGraph.press, srcGraph.value});
if (srcGraph.press.size() > 0)
{
retCurveArr.push_back({ PvtCurve::Bo, PvtCurve::OIL, srcGraph.press, srcGraph.value });
}
}
}
// Bg
{
std::vector<Opm::ECLPVT::PVTGraph> graphArr = m_opmFlowDiagStaticData->m_eclPvtCurveCollection->getPvtCurve(Opm::ECLPVT::RawCurve::FVF, Opm::ECLPhaseIndex::Vapour, static_cast<int>(activeCellIndex));
for (Opm::ECLPVT::PVTGraph srcGraph : graphArr)
{
if (srcGraph.press.size() > 0)
{
retCurveArr.push_back({ PvtCurve::Bg, PvtCurve::GAS, srcGraph.press, srcGraph.value });
}
}
}
}
else if (pvtCurveType == PvtCurveType::PVT_CT_VISCOSITY)
{
// Visc_o / mu_o
{
std::vector<Opm::ECLPVT::PVTGraph> graphArr = m_opmFlowDiagStaticData->m_eclPvtCurveCollection->getPvtCurve(Opm::ECLPVT::RawCurve::Viscosity, Opm::ECLPhaseIndex::Liquid, static_cast<int>(activeCellIndex));
for (Opm::ECLPVT::PVTGraph srcGraph : graphArr)
{
if (srcGraph.press.size() > 0)
{
retCurveArr.push_back({ PvtCurve::Visc_o, PvtCurve::OIL, srcGraph.press, srcGraph.value });
}
}
}
// Visc_g / mu_g
{
std::vector<Opm::ECLPVT::PVTGraph> graphArr = m_opmFlowDiagStaticData->m_eclPvtCurveCollection->getPvtCurve(Opm::ECLPVT::RawCurve::Viscosity, Opm::ECLPhaseIndex::Vapour, static_cast<int>(activeCellIndex));
for (Opm::ECLPVT::PVTGraph srcGraph : graphArr)
{
if (srcGraph.press.size() > 0)
{
retCurveArr.push_back({ PvtCurve::Visc_g, PvtCurve::GAS, srcGraph.press, srcGraph.value });
}
}
}
}

View File

@ -83,7 +83,7 @@ public:
Ident ident;
std::string name;
EpsMode epsMode;
std::vector<double> xVals;
std::vector<double> saturationVals;
std::vector<double> yVals;
};
@ -96,9 +96,11 @@ public:
struct PvtCurve
{
enum Phase { OIL, GAS };
enum Ident { Unknown, Bo, Bg, Visc_o, Visc_g };
Ident ident;
Phase phase;
std::vector<double> xVals;
std::vector<double> pressureVals;
std::vector<double> yVals;
};

View File

@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@ -23,20 +23,35 @@
#include "cvfMath.h"
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RigWellPathFormations::RigWellPathFormations(std::vector<RigWellPathFormation> formations, const QString& filePath, const QString& key)
RigWellPathFormations::RigWellPathFormations(const std::vector<RigWellPathFormation>& formations, const QString& filePath,
const QString& key)
{
m_filePath = filePath;
m_keyInFile = key;
m_formations = formations;
m_filePath = filePath;
m_keyInFile = key;
for (const RigWellPathFormation& formation : formations)
{
if (isFluid(formation.formationName))
{
m_fluids.push_back(formation);
}
else
{
FormationLevel level = detectLevel(formation.formationName);
m_formationsLevelsPresent[level] = true;
m_formations.push_back(std::pair<RigWellPathFormation, FormationLevel>(formation, level));
}
}
}
struct MeasuredDepthComp
{
bool operator()(const double& md1, const double& md2) const
{
if (cvf::Math::abs(md1 - md2) < 1.0)
if (cvf::Math::abs(md1 - md2) < 0.1)
{
return false;
}
@ -45,38 +60,178 @@ struct MeasuredDepthComp
};
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigWellPathFormations::measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(std::vector<QString>* names, std::vector<double>* measuredDepths) const
void RigWellPathFormations::measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(std::vector<QString>* names,
std::vector<double>* measuredDepths) const
{
names->clear();
measuredDepths->clear();
std::map<double, bool, MeasuredDepthComp> tempMakeVectorUniqueOnMeasuredDepth;
for (RigWellPathFormation formation : m_formations)
for (const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations)
{
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.mdTop))
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.first.mdTop))
{
measuredDepths->push_back(formation.mdTop);
names->push_back(formation.formationName + " Top");
tempMakeVectorUniqueOnMeasuredDepth[formation.mdTop] = true;
measuredDepths->push_back(formation.first.mdTop);
names->push_back(formation.first.formationName + " Top");
tempMakeVectorUniqueOnMeasuredDepth[formation.first.mdTop] = true;
}
}
for (RigWellPathFormation formation : m_formations)
for (const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations)
{
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.mdBase))
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.first.mdBase))
{
measuredDepths->push_back(formation.mdBase);
names->push_back(formation.formationName + " Base");
tempMakeVectorUniqueOnMeasuredDepth[formation.mdBase] = true;
measuredDepths->push_back(formation.first.mdBase);
names->push_back(formation.first.formationName + " Base");
tempMakeVectorUniqueOnMeasuredDepth[formation.first.mdBase] = true;
}
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
struct LevelAndName
{
LevelAndName() {}
LevelAndName(RigWellPathFormations::FormationLevel level, QString name) : level(level), name(name) {}
RigWellPathFormations::FormationLevel level;
QString name;
};
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
enum PICK_POSITION
{
TOP,
BASE
};
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void evaluateFormationsForOnePosition(const std::vector<std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>>& formations,
const RigWellPathFormations::FormationLevel& maxLevel, const PICK_POSITION& position,
std::map<double, LevelAndName, MeasuredDepthComp>* uniqueListMaker)
{
QString postFix;
if (position == TOP)
{
postFix = " Top";
}
else
{
postFix = " Base";
}
for (const std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>& formation : formations)
{
double md;
if (position == TOP)
{
md = formation.first.mdTop;
}
else
{
md = formation.first.mdBase;
}
if (formation.second > maxLevel) continue;
if (!uniqueListMaker->count(md) || uniqueListMaker->at(md).level < formation.second)
{
(*uniqueListMaker)[md] = LevelAndName(formation.second, formation.first.formationName + postFix);
}
}
}
void evaluateFormations(const std::vector<std::pair<RigWellPathFormation, RigWellPathFormations::FormationLevel>>& formations,
const RigWellPathFormations::FormationLevel& maxLevel,
std::vector<QString>* names, std::vector<double>* measuredDepths)
{
std::map<double, LevelAndName, MeasuredDepthComp> tempMakeVectorUniqueOnMeasuredDepth;
evaluateFormationsForOnePosition(formations, maxLevel, PICK_POSITION::TOP, &tempMakeVectorUniqueOnMeasuredDepth);
evaluateFormationsForOnePosition(formations, maxLevel, PICK_POSITION::BASE, &tempMakeVectorUniqueOnMeasuredDepth);
for (auto it = tempMakeVectorUniqueOnMeasuredDepth.begin(); it != tempMakeVectorUniqueOnMeasuredDepth.end(); it++)
{
measuredDepths->push_back(it->first);
names->push_back(it->second.name);
}
}
void evaluateFluids(const std::vector<RigWellPathFormation>& fluidFormations,
std::vector<QString>* names, std::vector<double>* measuredDepths)
{
std::map<double, QString, MeasuredDepthComp> uniqueListMaker;
for (const RigWellPathFormation& formation : fluidFormations)
{
uniqueListMaker[formation.mdBase] = formation.formationName + " Base";
}
for (const RigWellPathFormation& formation : fluidFormations)
{
uniqueListMaker[formation.mdTop] = formation.formationName + " Top";
}
for (auto it = uniqueListMaker.begin(); it != uniqueListMaker.end(); it++)
{
measuredDepths->push_back(it->first);
names->push_back(it->second);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellPathFormations::measuredDepthAndFormationNamesUpToLevel(FormationLevel maxLevel,
std::vector<QString>* names,
std::vector<double>* measuredDepths, bool includeFluids) const
{
names->clear();
measuredDepths->clear();
if (includeFluids)
{
evaluateFluids(m_fluids, names, measuredDepths);
}
if (maxLevel == RigWellPathFormations::NONE)
{
return;
}
else if (maxLevel == RigWellPathFormations::ALL)
{
measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(names, measuredDepths);
}
else
{
evaluateFormations(m_formations, maxLevel, names, measuredDepths);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigWellPathFormations::FormationLevel> RigWellPathFormations::formationsLevelsPresent() const
{
std::vector<RigWellPathFormations::FormationLevel> formationLevels;
for (auto it = m_formationsLevelsPresent.begin(); it != m_formationsLevelsPresent.end(); it++)
{
formationLevels.push_back(it->first);
}
return formationLevels;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigWellPathFormations::filePath() const
{
@ -84,7 +239,7 @@ QString RigWellPathFormations::filePath() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QString RigWellPathFormations::keyInFile() const
{
@ -92,9 +247,108 @@ QString RigWellPathFormations::keyInFile() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
size_t RigWellPathFormations::formationNamesCount() const
{
return m_formations.size();
return m_formations.size() + m_fluids.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigWellPathFormations::isFluid(QString formationName)
{
formationName = formationName.trimmed();
if (formationName == "OIL" || formationName == "GAS" || formationName == "WATER")
{
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigWellPathFormations::FormationLevel RigWellPathFormations::detectLevel(QString formationName)
{
formationName = formationName.trimmed();
bool isGroupName = true;
for (QChar c : formationName)
{
if (c.isLower())
{
isGroupName = false;
break;
}
}
if (isGroupName)
{
return RigWellPathFormations::GROUP;
}
QStringList formationNameSplitted = formationName.split(" ");
std::vector<QString> levelDesctiptorCandidates;
for (QString word : formationNameSplitted)
{
for (const QChar& c : word)
{
if (c.isDigit())
{
levelDesctiptorCandidates.push_back(word);
break;
}
}
}
if (levelDesctiptorCandidates.empty())
{
return RigWellPathFormations::LEVEL0;
}
if (levelDesctiptorCandidates.size() > 1)
{
for (auto it = levelDesctiptorCandidates.begin(); it != levelDesctiptorCandidates.end(); it++)
{
for (const QChar& c : *it)
{
if (c.isLetter())
{
levelDesctiptorCandidates.erase(it);
}
}
}
}
if (levelDesctiptorCandidates.size() != 1) return RigWellPathFormations::UNKNOWN;
QString levelDescriptor = levelDesctiptorCandidates[0];
QStringList joinedLevel = levelDescriptor.split('+');
if ( joinedLevel.size() > 1 )
{
levelDescriptor = joinedLevel[0];
}
int dotCount = levelDescriptor.count('.');
size_t level = dotCount + 1;
switch (dotCount)
{
case 0: return RigWellPathFormations::LEVEL1;
case 1: return RigWellPathFormations::LEVEL2;
case 2: return RigWellPathFormations::LEVEL3;
case 3: return RigWellPathFormations::LEVEL4;
case 4: return RigWellPathFormations::LEVEL5;
case 5: return RigWellPathFormations::LEVEL6;
case 6: return RigWellPathFormations::LEVEL7;
case 7: return RigWellPathFormations::LEVEL8;
case 8: return RigWellPathFormations::LEVEL9;
case 9: return RigWellPathFormations::LEVEL10;
default: break;
}
return RigWellPathFormations::UNKNOWN;
}

View File

@ -29,30 +29,44 @@
struct RigWellPathFormation
{
double mdTop;
double mdBase;
double mdTop;
double mdBase;
QString formationName;
size_t level = 0;
};
class RigWellPathFormations : public cvf::Object
{
public:
RigWellPathFormations(std::vector<RigWellPathFormation> formations, const QString& filePath, const QString& key);
RigWellPathFormations(const std::vector<RigWellPathFormation>& formations, const QString& filePath, const QString& key);
void measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(std::vector<QString>* names, std::vector<double>* measuredDepths) const;
enum FormationLevel
{
GROUP, LEVEL0, LEVEL1, LEVEL2, LEVEL3, LEVEL4, LEVEL5, LEVEL6, LEVEL7, LEVEL8, LEVEL9, LEVEL10, ALL, UNKNOWN, NONE
};
void measuredDepthAndFormationNamesForLevel(size_t level, std::vector<QString>* names, std::vector<double>* measuredDepths) const;
void measuredDepthAndFormationNamesUpToLevel(FormationLevel level, std::vector<QString>* names,
std::vector<double>* measuredDepths, bool includeFluids) const;
std::vector<FormationLevel> formationsLevelsPresent() const;
QString filePath() const;
QString keyInFile() const;
size_t formationNamesCount() const;
size_t formationNamesCount() const;
private:
void measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(std::vector<QString>* names,
std::vector<double>* measuredDepths) const;
bool isFluid(QString formationName);
FormationLevel detectLevel(QString formationName);
private:
QString m_filePath;
QString m_keyInFile;
std::vector<RigWellPathFormation> m_formations;
std::map<FormationLevel, bool> m_formationsLevelsPresent;
std::vector<std::pair<RigWellPathFormation, FormationLevel>> m_formations;
std::vector<RigWellPathFormation> m_fluids;
};

View File

@ -412,7 +412,7 @@ TEST(RifColumnBasedRsmspecParserTest, TestTableValues)
RifColumnBasedUserData userData;
userData.parse(data);
RifEclipseSummaryAddress adr(RifEclipseSummaryAddress::SUMMARY_WELL, "WLVP", -1, -1, "", "P-15P", -1, "", -1, -1, -1);
RifEclipseSummaryAddress adr(RifEclipseSummaryAddress::SUMMARY_WELL, "WLVP", -1, -1, "", "P-15P", -1, "", -1, -1, -1, -1);
QDateTime firstTimeStep = RiaQDateTimeTools::addDays(RiaQDateTimeTools::epoch(), 1.0);
auto timeSteps = userData.timeSteps(adr);

View File

@ -1283,8 +1283,8 @@ void RiuMainWindow::selectedObjectsChanged()
if (selectedReservoirView->viewer())
{
setActiveViewer(selectedReservoirView->viewer()->layoutWidget());
isActiveViewChanged = true;
}
isActiveViewChanged = true;
}
if (isActiveViewChanged)

View File

@ -68,6 +68,7 @@ public:
//--------------------------------------------------------------------------------------------------
RiuPvtPlotPanel::RiuPvtPlotPanel(QDockWidget* parent)
: QWidget(parent),
m_unitSystem(RiaEclipseUnitTools::UNITS_UNKNOWN),
m_pressure(HUGE_VAL),
m_plotUpdater(new RiuPvtPlotUpdater(this))
{
@ -132,10 +133,11 @@ void RiuPvtPlotPanel::setPlotDefaults(QwtPlot* plot)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPvtPlotPanel::setPlotData(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, FvfDynProps fvfDynProps, ViscosityDynProps viscosityDynProps, double pressure)
void RiuPvtPlotPanel::setPlotData(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, FvfDynProps fvfDynProps, ViscosityDynProps viscosityDynProps, double pressure)
{
//cvf::Trace::show("RiuPvtPlotPanel::setPlotData()");
m_unitSystem = unitSystem;
m_allFvfCurvesArr = fvfCurveArr;
m_allViscosityCurvesArr = viscosityCurveArr;
m_fvfDynProps = fvfDynProps;
@ -157,6 +159,7 @@ void RiuPvtPlotPanel::clearPlot()
return;
}
m_unitSystem = RiaEclipseUnitTools::UNITS_UNKNOWN;
m_allFvfCurvesArr.clear();
m_allViscosityCurvesArr.clear();
m_fvfDynProps = FvfDynProps();
@ -179,64 +182,86 @@ RiuPvtPlotUpdater* RiuPvtPlotPanel::plotUpdater()
//--------------------------------------------------------------------------------------------------
void RiuPvtPlotPanel::plotUiSelectedCurves()
{
std::vector<RigFlowDiagSolverInterface::PvtCurve> selectedFvfCurves;
std::vector<RigFlowDiagSolverInterface::PvtCurve> selectedViscosityCurves;
// Determine which curves (phase) to actually plot based on selection in GUI
const int currComboIdx = m_phaseComboBox->currentIndex();
const RigFlowDiagSolverInterface::PvtCurve::Phase phaseToPlot = static_cast<const RigFlowDiagSolverInterface::PvtCurve::Phase>(m_phaseComboBox->itemData(currComboIdx).toInt());
for (RigFlowDiagSolverInterface::PvtCurve curve : m_allFvfCurvesArr)
{
if (curve.phase == phaseToPlot)
{
selectedFvfCurves.push_back(curve);
}
}
for (RigFlowDiagSolverInterface::PvtCurve curve : m_allViscosityCurvesArr)
{
if (curve.phase == phaseToPlot)
{
selectedViscosityCurves.push_back(curve);
}
}
QString phaseString = "";
double fvfPointMarkerYValue = HUGE_VAL;
double viscosityPointMarkerYValue = HUGE_VAL;
if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::GAS)
{
phaseString = "Gas ";
fvfPointMarkerYValue = m_fvfDynProps.bg;
viscosityPointMarkerYValue = m_viscosityDynProps.mu_g;
}
else if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::OIL)
{
phaseString = "Oil ";
fvfPointMarkerYValue = m_fvfDynProps.bo;
viscosityPointMarkerYValue = m_viscosityDynProps.mu_o;
}
// FVF plot
{
const QString plotTitle = phaseString + "Formation Volume Factor";
const QString yAxisTitle = phaseString + "Formation Volume Factor";
plotCurvesInQwt(selectedFvfCurves, m_pressure, fvfPointMarkerYValue, plotTitle, yAxisTitle, m_fvfPlot, &m_fvfPlotMarkers);
}
{
const QString plotTitle = phaseString + "Viscosity";
const QString yAxisTitle = phaseString + "Viscosity";
plotCurvesInQwt(selectedViscosityCurves, m_pressure, viscosityPointMarkerYValue, plotTitle, yAxisTitle, m_viscosityPlot, &m_viscosityPlotMarkers);
}
RigFlowDiagSolverInterface::PvtCurve::Ident curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Unknown;
double fvfPointMarkerYValue = HUGE_VAL;
if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::GAS)
{
curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Bg;
fvfPointMarkerYValue = m_fvfDynProps.bg;
}
else if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::OIL)
{
curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Bo;
fvfPointMarkerYValue = m_fvfDynProps.bo;
}
std::vector<RigFlowDiagSolverInterface::PvtCurve> selectedFvfCurves;
for (RigFlowDiagSolverInterface::PvtCurve curve : m_allFvfCurvesArr)
{
if (curve.ident == curveIdentToPlot)
{
selectedFvfCurves.push_back(curve);
}
}
const QString plotTitle = QString("%1 Formation Volume Factor").arg(phaseString);
const QString yAxisTitle = QString("%1 Formation Volume Factor [%2]").arg(phaseString).arg(unitStringFromCurveIdent(m_unitSystem, curveIdentToPlot));
plotCurvesInQwt(m_unitSystem, selectedFvfCurves, m_pressure, fvfPointMarkerYValue, plotTitle, yAxisTitle, m_fvfPlot, &m_fvfPlotMarkers);
}
// Viscosity plot
{
RigFlowDiagSolverInterface::PvtCurve::Ident curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Unknown;
double viscosityPointMarkerYValue = HUGE_VAL;
if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::GAS)
{
curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Visc_g;
viscosityPointMarkerYValue = m_viscosityDynProps.mu_g;
}
else if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::OIL)
{
curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Visc_o;
viscosityPointMarkerYValue = m_viscosityDynProps.mu_o;
}
std::vector<RigFlowDiagSolverInterface::PvtCurve> selectedViscosityCurves;
for (RigFlowDiagSolverInterface::PvtCurve curve : m_allViscosityCurvesArr)
{
if (curve.ident == curveIdentToPlot)
{
selectedViscosityCurves.push_back(curve);
}
}
const QString plotTitle = QString("%1 Viscosity").arg(phaseString);
const QString yAxisTitle = QString("%1 Viscosity [%2]").arg(phaseString).arg(unitStringFromCurveIdent(m_unitSystem, curveIdentToPlot));
plotCurvesInQwt(m_unitSystem, selectedViscosityCurves, m_pressure, viscosityPointMarkerYValue, plotTitle, yAxisTitle, m_viscosityPlot, &m_viscosityPlotMarkers);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPvtPlotPanel::plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, double pointMarkerYValue, QString plotTitle, QString yAxisTitle, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers)
void RiuPvtPlotPanel::plotCurvesInQwt(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, double pointMarkerYValue, QString plotTitle, QString yAxisTitle, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers)
{
plot->detachItems(QwtPlotItem::Rtti_PlotCurve);
@ -256,8 +281,8 @@ void RiuPvtPlotPanel::plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterfa
const RigFlowDiagSolverInterface::PvtCurve& curve = curveArr[i];
QwtPlotCurve* qwtCurve = new QwtPlotCurve();
CVF_ASSERT(curve.xVals.size() == curve.yVals.size());
qwtCurve->setSamples(curve.xVals.data(), curve.yVals.data(), static_cast<int>(curve.xVals.size()));
CVF_ASSERT(curve.pressureVals.size() == curve.yVals.size());
qwtCurve->setSamples(curve.pressureVals.data(), curve.yVals.data(), static_cast<int>(curve.pressureVals.size()));
qwtCurve->setStyle(QwtPlotCurve::Lines);
@ -308,12 +333,52 @@ void RiuPvtPlotPanel::plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterfa
plot->setTitle(plotTitle);
plot->setAxisTitle(QwtPlot::xBottom, "Pressure");
plot->setAxisTitle(QwtPlot::xBottom, QString("Pressure [%1]").arg(RiaEclipseUnitTools::unitStringPressure(unitSystem)));
plot->setAxisTitle(QwtPlot::yLeft, yAxisTitle);
plot->replot();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiuPvtPlotPanel::unitStringFromCurveIdent(RiaEclipseUnitTools::UnitSystem unitSystem, RigFlowDiagSolverInterface::PvtCurve::Ident curveIdent)
{
if (curveIdent == RigFlowDiagSolverInterface::PvtCurve::Bo)
{
switch (unitSystem)
{
case RiaEclipseUnitTools::UNITS_METRIC: return "rm3/sm3";
case RiaEclipseUnitTools::UNITS_FIELD: return "rb/stb";
case RiaEclipseUnitTools::UNITS_LAB: return "rcc/scc";
default: return "";
}
}
else if (curveIdent == RigFlowDiagSolverInterface::PvtCurve::Bg)
{
switch (unitSystem)
{
case RiaEclipseUnitTools::UNITS_METRIC: return "rm3/sm3";
case RiaEclipseUnitTools::UNITS_FIELD: return "rb/Mscf";
case RiaEclipseUnitTools::UNITS_LAB: return "rcc/scc";
default: return "";
}
}
else if (curveIdent == RigFlowDiagSolverInterface::PvtCurve::Visc_o ||
curveIdent == RigFlowDiagSolverInterface::PvtCurve::Visc_g)
{
switch (unitSystem)
{
case RiaEclipseUnitTools::UNITS_METRIC: return "cP";
case RiaEclipseUnitTools::UNITS_FIELD: return "cP";
case RiaEclipseUnitTools::UNITS_LAB: return "cP";
default: return "";
}
}
return "";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -19,6 +19,7 @@
#pragma once
#include "RigFlowDiagSolverInterface.h"
#include "RiaEclipseUnitTools.h"
#include <QWidget>
@ -58,19 +59,21 @@ public:
RiuPvtPlotPanel(QDockWidget* parent);
virtual ~RiuPvtPlotPanel();
void setPlotData(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, FvfDynProps fvfDynProps, ViscosityDynProps viscosityDynProps, double pressure);
void setPlotData(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, FvfDynProps fvfDynProps, ViscosityDynProps viscosityDynProps, double pressure);
void clearPlot();
RiuPvtPlotUpdater* plotUpdater();
private:
void plotUiSelectedCurves();
static void setPlotDefaults(QwtPlot* plot);
static void plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, double pointMarkerYValue, QString plotTitle, QString yAxisTitle, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
static void plotCurvesInQwt(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, double pointMarkerYValue, QString plotTitle, QString yAxisTitle, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
static QString unitStringFromCurveIdent(RiaEclipseUnitTools::UnitSystem unitSystem, RigFlowDiagSolverInterface::PvtCurve::Ident curveIdent);
private slots:
void slotPhaseComboCurrentIndexChanged(int);
private:
RiaEclipseUnitTools::UnitSystem m_unitSystem;
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_allFvfCurvesArr;
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_allViscosityCurvesArr;
FvfDynProps m_fvfDynProps;

View File

@ -159,7 +159,7 @@ bool RiuPvtPlotUpdater::queryDataAndUpdatePlot(const RimEclipseView& eclipseView
RiuPvtPlotPanel::ViscosityDynProps viscosityDynProps;
eclipseResultCase->flowDiagSolverInterface()->calculatePvtDynamicPropertiesViscosity(activeCellIndex, cellPressure, cellRS, cellRV, &viscosityDynProps.mu_o, &viscosityDynProps.mu_g);
plotPanel->setPlotData(fvfCurveArr, viscosityCurveArr, fvfDynProps, viscosityDynProps, cellPressure);
plotPanel->setPlotData(eclipseCaseData->unitsType(), fvfCurveArr, viscosityCurveArr, fvfDynProps, viscosityDynProps, cellPressure);
return true;
}

View File

@ -76,6 +76,7 @@ public:
//--------------------------------------------------------------------------------------------------
RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel(QDockWidget* parent)
: QWidget(parent),
m_unitSystem(RiaEclipseUnitTools::UNITS_UNKNOWN),
m_swat(HUGE_VAL),
m_sgas(HUGE_VAL),
m_plotUpdater(new RiuRelativePermeabilityPlotUpdater(this))
@ -157,10 +158,11 @@ void RiuRelativePermeabilityPlotPanel::setPlotDefaults(QwtPlot* plot)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::setPlotData(const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves, double swat, double sgas, QString cellReferenceText)
void RiuRelativePermeabilityPlotPanel::setPlotData(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves, double swat, double sgas, QString cellReferenceText)
{
//cvf::Trace::show("Set RelPerm plot data");
m_unitSystem = unitSystem;
m_allCurvesArr = relPermCurves;
m_swat = swat;
m_sgas = sgas;
@ -181,12 +183,13 @@ void RiuRelativePermeabilityPlotPanel::clearPlot()
return;
}
m_unitSystem = RiaEclipseUnitTools::UNITS_UNKNOWN;
m_allCurvesArr.clear();
m_swat = HUGE_VAL;
m_sgas = HUGE_VAL;
m_cellReferenceText.clear();
plotCurvesInQwt(m_allCurvesArr, m_swat, m_sgas, m_cellReferenceText, false, m_qwtPlot, &m_myPlotMarkers);
plotCurvesInQwt(m_unitSystem, m_allCurvesArr, m_swat, m_sgas, m_cellReferenceText, false, m_qwtPlot, &m_myPlotMarkers);
}
//--------------------------------------------------------------------------------------------------
@ -222,13 +225,13 @@ void RiuRelativePermeabilityPlotPanel::plotUiSelectedCurves()
}
}
plotCurvesInQwt(selectedCurves, m_swat, m_sgas, m_cellReferenceText, useLogScale, m_qwtPlot, &m_myPlotMarkers);
plotCurvesInQwt(m_unitSystem, selectedCurves, m_swat, m_sgas, m_cellReferenceText, useLogScale, m_qwtPlot, &m_myPlotMarkers);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr, double swat, double sgas, QString cellReferenceText, bool logScaleLeftAxis, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers)
void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr, double swat, double sgas, QString cellReferenceText, bool logScaleLeftAxis, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers)
{
plot->detachItems(QwtPlotItem::Rtti_PlotCurve);
@ -244,7 +247,7 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(const std::vector<RigFlow
//ValueRange leftYAxisValueRange;
bool shouldEableRightYAxis = false;
bool shouldEnableRightYAxis = false;
for (size_t i = 0; i < curveArr.size(); i++)
{
@ -266,10 +269,10 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(const std::vector<RigFlow
//QwtPlotCurve* qwtCurve = new QwtPlotCurve(curve.name.c_str());
RiuLineSegmentQwtPlotCurve* qwtCurve = new RiuLineSegmentQwtPlotCurve(curve.name.c_str());
CVF_ASSERT(curve.xVals.size() == curve.yVals.size());
CVF_ASSERT(curve.saturationVals.size() == curve.yVals.size());
//qwtCurve->setSamples(curve.xVals.data(), curve.yVals.data(), static_cast<int>(curve.xVals.size()));
const bool includePositiveValuesOnly = (logScaleLeftAxis && plotOnWhichYAxis == LEFT_YAXIS);
qwtCurve->setSamplesFromXValuesAndYValues(curve.xVals, curve.yVals, includePositiveValuesOnly);
qwtCurve->setSamplesFromXValuesAndYValues(curve.saturationVals, curve.yVals, includePositiveValuesOnly);
qwtCurve->setTitle(curve.name.c_str());
@ -305,7 +308,7 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(const std::vector<RigFlow
if (plotOnWhichYAxis == RIGHT_YAXIS)
{
qwtCurve->setYAxis(QwtPlot::yRight);
shouldEableRightYAxis = true;
shouldEnableRightYAxis = true;
}
qwtCurve->attach(plot);
@ -377,9 +380,9 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(const std::vector<RigFlow
plot->setAxisTitle(QwtPlot::xBottom, determineXAxisTitleFromCurveCollection(curveArr));
plot->setAxisTitle(QwtPlot::yLeft, "Kr");
plot->setAxisTitle(QwtPlot::yRight, "Pc");
plot->setAxisTitle(QwtPlot::yRight, QString("Pc [%1]").arg(RiaEclipseUnitTools::unitStringPressure(unitSystem)));
plot->enableAxis(QwtPlot::yRight, shouldEableRightYAxis);
plot->enableAxis(QwtPlot::yRight, shouldEnableRightYAxis);
plot->replot();
}
@ -439,7 +442,7 @@ void RiuRelativePermeabilityPlotPanel::addVerticalSaturationMarkerLine(double sa
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::addCurveConstSaturationIntersectionMarker(const RigFlowDiagSolverInterface::RelPermCurve& curve, double saturationValue, QColor markerColor, WhichYAxis whichYAxis, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers)
{
const double yVal = interpolatedCurveYValue(curve.xVals, curve.yVals, saturationValue);
const double yVal = interpolatedCurveYValue(curve.saturationVals, curve.yVals, saturationValue);
if (yVal != HUGE_VAL)
{
QwtPlotMarker* pointMarker = new QwtPlotMarker;

View File

@ -19,6 +19,7 @@
#pragma once
#include "RigFlowDiagSolverInterface.h"
#include "RiaEclipseUnitTools.h"
#include <QWidget>
@ -46,7 +47,7 @@ public:
RiuRelativePermeabilityPlotPanel(QDockWidget* parent);
virtual ~RiuRelativePermeabilityPlotPanel();
void setPlotData(const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves, double swat, double sgas, QString cellReferenceText);
void setPlotData(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves, double swat, double sgas, QString cellReferenceText);
void clearPlot();
RiuRelativePermeabilityPlotUpdater* plotUpdater();
@ -70,7 +71,7 @@ private:
void plotUiSelectedCurves();
static void setPlotDefaults(QwtPlot* plot);
static void plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr, double swat, double sgas, QString cellReferenceText, bool logScaleLeftAxis, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
static void plotCurvesInQwt(RiaEclipseUnitTools::UnitSystem unitSystem, const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr, double swat, double sgas, QString cellReferenceText, bool logScaleLeftAxis, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
static QString determineXAxisTitleFromCurveCollection(const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr);
static void addVerticalSaturationMarkerLine(double saturationValue, QString label, QColor color, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
static void addCurveConstSaturationIntersectionMarker(const RigFlowDiagSolverInterface::RelPermCurve& curve, double saturationValue, QColor markerColor, WhichYAxis whichYAxis, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
@ -82,6 +83,7 @@ private slots:
void slotSomeCheckBoxStateChanged(int);
private:
RiaEclipseUnitTools::UnitSystem m_unitSystem;
std::vector<RigFlowDiagSolverInterface::RelPermCurve> m_allCurvesArr;
double m_swat;
double m_sgas;

View File

@ -154,7 +154,7 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot(const RimEclipse
QString cellRefText = constructCellReferenceText(eclipseCaseData, gridIndex, gridLocalCellIndex, cellSATNUM);
plotPanel->setPlotData(relPermCurveArr, cellSWAT, cellSGAS, cellRefText);
plotPanel->setPlotData(eclipseCaseData->unitsType(), relPermCurveArr, cellSWAT, cellSGAS, cellRefText);
return true;
}

View File

@ -84,6 +84,7 @@ RiuSummaryCurveDefSelection::RiuSummaryCurveDefSelection() : m_identifierFieldsM
{ new SummaryIdentifierAndField(RifEclipseSummaryAddress::INPUT_VECTOR_NAME) }
} },
{ RifEclipseSummaryAddress::SUMMARY_AQUIFER, {
{ new SummaryIdentifierAndField(RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER) },
{ new SummaryIdentifierAndField(RifEclipseSummaryAddress::INPUT_VECTOR_NAME) }
} },
{ RifEclipseSummaryAddress::SUMMARY_NETWORK, {
@ -155,7 +156,8 @@ RiuSummaryCurveDefSelection::RiuSummaryCurveDefSelection() : m_identifierFieldsM
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_FIELD][0]->pdmField(), "FieldVectors", "Field vectors", "", "", "");
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_AQUIFER][0]->pdmField(), "AquiferVectors", "Aquifer Vectors", "", "", "");
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_AQUIFER][0]->pdmField(), "Aquifers", "Aquifers", "", "", "");
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_AQUIFER][1]->pdmField(), "AquiferVectors", "Aquifer Vectors", "", "", "");
CAF_PDM_InitFieldNoDefault(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][0]->pdmField(), "NetworkVectors", "Network Vectors", "", "", "");
@ -534,22 +536,22 @@ QList<caf::PdmOptionItemInfo> RiuSummaryCurveDefSelection::calculateValueOptions
}
auto itemPostfix = (isVectorField && i == OBS_DATA) ? QString(OBSERVED_DATA_AVALUE_POSTFIX) : QString("");
for (const auto& iName : itemNames[i])
for (const auto& itemName : itemNames[i])
{
QString displayName;
if (isVectorField)
{
std::string descriptiveName = RiuSummaryVectorDescriptionMap::instance()->fieldInfo(iName);
displayName = QString::fromStdString(descriptiveName);
displayName += QString(" [%1]").arg(QString::fromStdString(iName));
std::string longVectorName = RiuSummaryVectorDescriptionMap::instance()->fieldInfo(itemName);
displayName = QString::fromStdString(longVectorName);
displayName += QString(" (%1)").arg(QString::fromStdString(itemName));
}
else
{
displayName = QString::fromStdString(iName);
displayName = QString::fromStdString(itemName);
}
auto optionItem = caf::PdmOptionItemInfo(displayName, QString::fromStdString(iName) + itemPostfix);
auto optionItem = caf::PdmOptionItemInfo(displayName, QString::fromStdString(itemName) + itemPostfix);
if (groupItems)
optionItem.setLevel(1);
options.push_back(optionItem);
@ -586,7 +588,12 @@ void RiuSummaryCurveDefSelection::defineUiOrdering(QString uiConfigName, caf::Pd
}
else if (sumCategory == RifEclipseSummaryAddress::SUMMARY_AQUIFER)
{
summaryiesField = m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_AQUIFER][0]->pdmField();
{
caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup("Aquifers");
myGroup->add(m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_AQUIFER][0]->pdmField());
}
summaryiesField = m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_AQUIFER][1]->pdmField();
}
else if (sumCategory == RifEclipseSummaryAddress::SUMMARY_NETWORK)
{

View File

@ -389,7 +389,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
menuBuilder.addSeparator();
menuBuilder << "RicNewGridTimeHistoryCurveFeature";
menuBuilder << "RicShowFlowCharacteristicsPlotFeature";
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
menuBuilder << "RicSaveEclipseInputActiveVisibleCellsFeature";
menuBuilder << "RicShowGridStatisticsFeature";
menuBuilder.appendToMenu(&menu);