Merge remote-tracking branch 'refs/remotes/origin/dev'

Conflicts:
	ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h
	ApplicationCode/ProjectDataModel/RimEclipseWell.cpp
	ApplicationCode/ProjectDataModel/RimEclipseWell.h
	ApplicationCode/UserInterface/RiuViewerCommands.cpp
This commit is contained in:
Magne Sjaastad
2017-01-18 12:19:07 +01:00
101 changed files with 2990 additions and 635 deletions

View File

@@ -84,7 +84,7 @@ void RicSaveEclipseResultAsInputPropertyExec::redo()
projectFolder = m_cellColors->reservoirView()->eclipseCase()->locationOnDisc();
}
QString outputFileName = projectFolder + "/" + caf::Utils::makeValidFileBasename( m_cellColors->resultVariableUiName());
QString outputFileName = projectFolder + "/" + caf::Utils::makeValidFileBasename( m_cellColors->resultVariableUiShortName());
exportSettings.fileName = outputFileName;
}

View File

@@ -0,0 +1,23 @@
# Use this workaround until we're on 2.8.3 on all platforms and can use CMAKE_CURRENT_LIST_DIR directly
if (${CMAKE_VERSION} VERSION_GREATER "2.8.2")
set(CEE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}/)
endif()
set (SOURCE_GROUP_HEADER_FILES
${CEE_CURRENT_LIST_DIR}RicShowWellAllocationPlotFeature.h
)
set (SOURCE_GROUP_SOURCE_FILES
${CEE_CURRENT_LIST_DIR}RicShowWellAllocationPlotFeature.cpp
)
list(APPEND CODE_HEADER_FILES
${SOURCE_GROUP_HEADER_FILES}
)
list(APPEND CODE_SOURCE_FILES
${SOURCE_GROUP_SOURCE_FILES}
)
source_group( "CommandFeature\\FlowDiagnostics" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CEE_CURRENT_LIST_DIR}CMakeLists_files.cmake )

View File

@@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicShowWellAllocationPlotFeature.h"
#include "RiaApplication.h"
#include "RimEclipseWell.h"
#include "RimFlowPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimWellAllocationPlot.h"
#include "RiuMainPlotWindow.h"
#include "cafSelectionManager.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicShowWellAllocationPlotFeature, "RicShowWellAllocationPlotFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowWellAllocationPlotFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked)
{
std::vector<RimEclipseWell*> collection;
caf::SelectionManager::instance()->objectsByType(&collection);
if (collection.size() > 0)
{
RimEclipseWell* eclWell = collection[0];
if (RiaApplication::instance()->project())
{
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
if (flowPlotColl)
{
flowPlotColl->defaultPlot->setSimulationWell(eclWell);
flowPlotColl->defaultPlot->updateConnectedEditors();
// Make sure the summary plot window is created and visible
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
//RiaApplication::instance()->project()->updateConnectedEditors();
plotwindow->selectAsCurrentItem(flowPlotColl->defaultPlot);
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowWellAllocationPlotFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
actionToSetup->setText("Show Well Allocation Plot");
}

View File

@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
class RimEclipseWell;
//==================================================================================================
///
//==================================================================================================
class RicShowWellAllocationPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled() override;
virtual void onActionTriggered( bool isChecked ) override;
virtual void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -77,9 +77,11 @@ void RicExportMultipleSnapshotsFeature::onActionTriggered(bool isChecked)
RiuExportMultipleSnapshotsWidget dlg(nullptr, proj);
if (proj->multiSnapshotDefinitions.size() == 0)
RimView* activeView = RiaApplication::instance()->activeReservoirView();
if (activeView && proj->multiSnapshotDefinitions.size() == 0)
{
dlg.addSnapshotItemFromActiveView();
dlg.addEmptySnapshotItems(4);
}
dlg.exec();
@@ -110,18 +112,20 @@ void RicExportMultipleSnapshotsFeature::exportMultipleSnapshots(const QString& f
for (RimMultiSnapshotDefinition* msd : project->multiSnapshotDefinitions())
{
RimView* rimView = msd->viewObject();
if (!rimView) continue;
if (!rimView->viewer()) continue;
int initialFramIndex = rimView->viewer()->currentFrameIndex();
if (!msd->isActive()) continue;
exportResultVariations(rimView, msd, folder);
RimView* sourceView = msd->view();
if (!sourceView) continue;
if (!sourceView->viewer()) continue;
int initialFramIndex = sourceView->viewer()->currentFrameIndex();
//exportViewVariations(sourceView, msd, folder);
for (RimCase* rimCase : msd->additionalCases())
{
RimEclipseCase* eclCase = dynamic_cast<RimEclipseCase*>(rimCase);
RimEclipseView* sourceEclipseView = dynamic_cast<RimEclipseView*>(rimView);
RimEclipseView* sourceEclipseView = dynamic_cast<RimEclipseView*>(sourceView);
if (eclCase && sourceEclipseView)
{
RimEclipseView* copyOfEclipseView = eclCase->createCopyAndAddView(sourceEclipseView);
@@ -129,7 +133,7 @@ void RicExportMultipleSnapshotsFeature::exportMultipleSnapshots(const QString& f
copyOfEclipseView->loadDataAndUpdate();
exportResultVariations(copyOfEclipseView, msd, folder);
exportViewVariations(copyOfEclipseView, msd, folder);
eclCase->reservoirViews().removeChildObject(copyOfEclipseView);
@@ -137,7 +141,7 @@ void RicExportMultipleSnapshotsFeature::exportMultipleSnapshots(const QString& f
}
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(rimCase);
RimGeoMechView* sourceGeoMechView = dynamic_cast<RimGeoMechView*>(rimView);
RimGeoMechView* sourceGeoMechView = dynamic_cast<RimGeoMechView*>(sourceView);
if (geomCase && sourceGeoMechView)
{
RimGeoMechView* copyOfGeoMechView = dynamic_cast<RimGeoMechView*>(sourceGeoMechView->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
@@ -155,7 +159,7 @@ void RicExportMultipleSnapshotsFeature::exportMultipleSnapshots(const QString& f
copyOfGeoMechView->loadDataAndUpdate();
exportResultVariations(copyOfGeoMechView, msd, folder);
exportViewVariations(copyOfGeoMechView, msd, folder);
geomCase->geoMechViews().removeChildObject(copyOfGeoMechView);
@@ -164,20 +168,18 @@ void RicExportMultipleSnapshotsFeature::exportMultipleSnapshots(const QString& f
}
// Set view back to initial state
rimView->viewer()->setCurrentFrame(initialFramIndex);
rimView->viewer()->animationControl()->setCurrentFrameOnly(initialFramIndex);
sourceView->viewer()->setCurrentFrame(initialFramIndex);
sourceView->viewer()->animationControl()->setCurrentFrameOnly(initialFramIndex);
rimView->scheduleCreateDisplayModelAndRedraw();
sourceView->scheduleCreateDisplayModelAndRedraw();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportMultipleSnapshotsFeature::exportResultVariations(RimView* rimView, RimMultiSnapshotDefinition* msd, const QString& folder)
void RicExportMultipleSnapshotsFeature::exportViewVariations(RimView* rimView, RimMultiSnapshotDefinition* msd, const QString& folder)
{
exportViewVariationsToFolder(rimView, msd, folder);
if (msd->selectedEclipseResults().size() > 0)
{
RimEclipseCase* eclCase = dynamic_cast<RimEclipseCase*>(rimView->ownerCase());
@@ -293,7 +295,7 @@ QString RicExportMultipleSnapshotsFeature::resultName(RimView* rimView)
{
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(rimView);
return caf::Utils::makeValidFileBasename(eclView->cellResult()->resultVariableUiName());
return caf::Utils::makeValidFileBasename(eclView->cellResult()->resultVariableUiShortName());
}
else if (dynamic_cast<RimGeoMechView*>(rimView))
{

View File

@@ -39,7 +39,7 @@ protected:
public:
static void exportMultipleSnapshots(const QString& folder, RimProject* project);
static void exportResultVariations(RimView* rimView, RimMultiSnapshotDefinition* msd, const QString& folder);
static void exportViewVariations(RimView* rimView, RimMultiSnapshotDefinition* msd, const QString& folder);
private:
static void exportViewVariationsToFolder(RimView* rimView, RimMultiSnapshotDefinition* msd, const QString& folder);

View File

@@ -96,9 +96,9 @@ void RicNewSummaryPlotFeature::setupActionLook(QAction* actionToSetup)
void RicNewSummaryPlotFeature::createNewSummaryPlot(RimSummaryPlotCollection* summaryPlotColl, RimSummaryCase* summaryCase)
{
RimSummaryPlot* plot = new RimSummaryPlot();
summaryPlotColl->m_summaryPlots().push_back(plot);
summaryPlotColl->summaryPlots().push_back(plot);
plot->setDescription(QString("Summary Plot %1").arg(summaryPlotColl->m_summaryPlots.size()));
plot->setDescription(QString("Summary Plot %1").arg(summaryPlotColl->summaryPlots.size()));
RimSummaryCurveFilter* newCurveFilter = new RimSummaryCurveFilter();

View File

@@ -74,7 +74,7 @@ void RicPasteSummaryPlotFeature::onActionTriggered(bool isChecked)
RimSummaryPlot* newSummaryPlot = dynamic_cast<RimSummaryPlot*>(sourceObjects[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newSummaryPlot);
plotColl->m_summaryPlots.push_back(newSummaryPlot);
plotColl->summaryPlots.push_back(newSummaryPlot);
// Resolve references after object has been inserted into the data model
newSummaryPlot->resolveReferencesRecursively();