2015-09-15 09:20:37 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-05 05:24:45 -05:00
|
|
|
//
|
2015-09-15 09:20:37 -05:00
|
|
|
// 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.
|
2019-09-05 05:24:45 -05:00
|
|
|
//
|
2015-09-15 09:20:37 -05:00
|
|
|
// 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.
|
2019-09-05 05:24:45 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-09-15 09:20:37 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RicNewWellLogPlotFeatureImpl.h"
|
|
|
|
|
|
|
|
#include "RimMainPlotCollection.h"
|
2015-12-02 08:07:12 -06:00
|
|
|
#include "RimProject.h"
|
2019-09-05 05:24:45 -05:00
|
|
|
#include "RimWellBoreStabilityPlot.h"
|
2015-09-15 09:20:37 -05:00
|
|
|
#include "RimWellLogPlot.h"
|
2015-12-02 08:07:12 -06:00
|
|
|
#include "RimWellLogPlotCollection.h"
|
2015-11-04 09:14:42 -06:00
|
|
|
#include "RimWellLogTrack.h"
|
2015-09-15 09:20:37 -05:00
|
|
|
|
2019-05-06 03:36:05 -05:00
|
|
|
#include "RiaGuiApplication.h"
|
2015-09-15 09:20:37 -05:00
|
|
|
|
|
|
|
#include "cvfAssert.h"
|
|
|
|
|
2018-06-29 04:36:50 -05:00
|
|
|
#include <QString>
|
2015-09-15 09:20:37 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-05 05:24:45 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellBoreStabilityPlot*
|
|
|
|
RicNewWellLogPlotFeatureImpl::createWellBoreStabilityPlot( bool showAfterCreation /*= true*/,
|
|
|
|
const QString& plotDescription /*= QString("")*/ )
|
|
|
|
{
|
|
|
|
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
|
|
|
|
CVF_ASSERT( wellLogPlotColl );
|
|
|
|
|
|
|
|
// Make sure the summary plot window is created
|
|
|
|
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
|
|
|
|
|
|
|
|
RimWellBoreStabilityPlot* plot = new RimWellBoreStabilityPlot();
|
|
|
|
plot->setAsPlotMdiWindow();
|
|
|
|
|
|
|
|
wellLogPlotColl->wellLogPlots().push_back( plot );
|
|
|
|
|
|
|
|
if ( !plotDescription.isEmpty() )
|
|
|
|
{
|
|
|
|
plot->setDescription( plotDescription );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
plot->setDescription(
|
|
|
|
QString( "Well Bore Stability Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( showAfterCreation )
|
|
|
|
{
|
|
|
|
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
|
|
|
}
|
|
|
|
|
|
|
|
return plot;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
2015-09-15 09:20:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-05 05:24:45 -05:00
|
|
|
RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot( bool showAfterCreation, const QString& plotDescription )
|
2015-09-15 09:20:37 -05:00
|
|
|
{
|
|
|
|
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
|
2019-09-05 05:24:45 -05:00
|
|
|
CVF_ASSERT( wellLogPlotColl );
|
2015-09-15 09:20:37 -05:00
|
|
|
|
2018-08-17 03:54:30 -05:00
|
|
|
// Make sure the summary plot window is created
|
2019-05-06 03:36:05 -05:00
|
|
|
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
|
2018-08-17 03:54:30 -05:00
|
|
|
|
2015-09-15 09:20:37 -05:00
|
|
|
RimWellLogPlot* plot = new RimWellLogPlot();
|
2017-01-20 04:38:18 -06:00
|
|
|
plot->setAsPlotMdiWindow();
|
2015-09-15 09:20:37 -05:00
|
|
|
|
2019-09-05 05:24:45 -05:00
|
|
|
wellLogPlotColl->wellLogPlots().push_back( plot );
|
|
|
|
|
|
|
|
if ( !plotDescription.isEmpty() )
|
2018-06-29 04:36:50 -05:00
|
|
|
{
|
2019-09-05 05:24:45 -05:00
|
|
|
plot->setDescription( plotDescription );
|
2018-06-29 04:36:50 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-05 05:24:45 -05:00
|
|
|
plot->setDescription( QString( "Well Log Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) );
|
2018-06-29 04:36:50 -05:00
|
|
|
}
|
|
|
|
|
2019-09-05 05:24:45 -05:00
|
|
|
if ( showAfterCreation )
|
2018-06-29 04:36:50 -05:00
|
|
|
{
|
2019-05-06 03:36:05 -05:00
|
|
|
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
2018-06-29 04:36:50 -05:00
|
|
|
}
|
2015-09-15 09:20:37 -05:00
|
|
|
|
|
|
|
return plot;
|
|
|
|
}
|
2015-09-21 07:02:33 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-05 05:24:45 -05:00
|
|
|
///
|
2015-09-21 07:02:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-05 05:24:45 -05:00
|
|
|
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( bool updateAfter,
|
|
|
|
const QString& trackDescription,
|
|
|
|
RimWellLogPlot* existingPlot )
|
2015-09-21 07:02:33 -05:00
|
|
|
{
|
2018-06-29 04:36:50 -05:00
|
|
|
RimWellLogPlot* plot = existingPlot;
|
2019-09-05 05:24:45 -05:00
|
|
|
if ( plot == nullptr )
|
2018-06-29 04:36:50 -05:00
|
|
|
{
|
|
|
|
plot = createWellLogPlot();
|
|
|
|
}
|
2015-09-21 07:02:33 -05:00
|
|
|
|
2015-11-04 08:57:06 -06:00
|
|
|
RimWellLogTrack* plotTrack = new RimWellLogTrack();
|
2019-09-05 05:24:45 -05:00
|
|
|
plot->addTrack( plotTrack );
|
|
|
|
if ( !trackDescription.isEmpty() )
|
2018-06-29 04:36:50 -05:00
|
|
|
{
|
2019-09-05 05:24:45 -05:00
|
|
|
plotTrack->setDescription( trackDescription );
|
2018-06-29 04:36:50 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-05 05:24:45 -05:00
|
|
|
plotTrack->setDescription( QString( "Track %1" ).arg( plot->trackCount() ) );
|
2018-06-29 04:36:50 -05:00
|
|
|
}
|
|
|
|
|
2019-09-05 05:24:45 -05:00
|
|
|
if ( updateAfter )
|
2018-06-29 04:36:50 -05:00
|
|
|
{
|
2019-09-05 05:24:45 -05:00
|
|
|
updateAfterCreation( plot );
|
2018-06-29 04:36:50 -05:00
|
|
|
}
|
2015-09-21 07:02:33 -05:00
|
|
|
|
2018-06-29 04:36:50 -05:00
|
|
|
return plotTrack;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-05 05:24:45 -05:00
|
|
|
void RicNewWellLogPlotFeatureImpl::updateAfterCreation( RimWellLogPlot* plot )
|
2018-06-29 04:36:50 -05:00
|
|
|
{
|
2019-09-05 05:24:45 -05:00
|
|
|
CVF_ASSERT( plot );
|
2015-09-21 07:02:33 -05:00
|
|
|
plot->loadDataAndUpdate();
|
2018-06-29 04:36:50 -05:00
|
|
|
plot->updateDepthZoom();
|
2015-09-21 07:02:33 -05:00
|
|
|
plot->updateConnectedEditors();
|
|
|
|
RiaApplication::instance()->project()->updateConnectedEditors();
|
|
|
|
}
|
2015-12-02 08:07:12 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-05 05:24:45 -05:00
|
|
|
///
|
2015-12-02 08:07:12 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellLogPlotCollection* RicNewWellLogPlotFeatureImpl::wellLogPlotCollection()
|
|
|
|
{
|
|
|
|
RimProject* project = RiaApplication::instance()->project();
|
2019-09-05 05:24:45 -05:00
|
|
|
CVF_ASSERT( project );
|
2015-12-02 08:07:12 -06:00
|
|
|
|
|
|
|
RimMainPlotCollection* mainPlotColl = project->mainPlotCollection();
|
2019-09-05 05:24:45 -05:00
|
|
|
CVF_ASSERT( mainPlotColl );
|
2015-12-02 08:07:12 -06:00
|
|
|
|
|
|
|
RimWellLogPlotCollection* wellLogPlotColl = mainPlotColl->wellLogPlotCollection();
|
2019-09-05 05:24:45 -05:00
|
|
|
CVF_ASSERT( wellLogPlotColl );
|
2015-12-02 08:07:12 -06:00
|
|
|
|
|
|
|
return mainPlotColl->wellLogPlotCollection();
|
|
|
|
}
|