2015-08-28 11:45:18 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
|
|
|
|
//
|
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// 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.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2015-09-18 17:29:17 +02:00
|
|
|
#include "RicNewWellLogFileCurveFeature.h"
|
2015-08-28 11:45:18 +02:00
|
|
|
|
2015-09-15 18:21:38 +02:00
|
|
|
#include "RicWellLogPlotCurveFeatureImpl.h"
|
2015-09-21 14:02:33 +02:00
|
|
|
#include "RicNewWellLogPlotFeatureImpl.h"
|
2015-09-15 18:21:38 +02:00
|
|
|
|
2016-06-27 11:07:01 +02:00
|
|
|
#include "RiaApplication.h"
|
|
|
|
|
|
|
|
|
|
#include "RimOilField.h"
|
|
|
|
|
#include "RimProject.h"
|
2015-09-21 14:02:33 +02:00
|
|
|
#include "RimWellLogFile.h"
|
2015-10-16 16:58:49 +02:00
|
|
|
#include "RimWellLogFileChannel.h"
|
2016-06-27 11:07:01 +02:00
|
|
|
#include "RimWellLogFileCurve.h"
|
|
|
|
|
#include "RimWellLogTrack.h"
|
2015-09-21 14:02:33 +02:00
|
|
|
#include "RimWellPath.h"
|
|
|
|
|
#include "RimWellPathCollection.h"
|
2016-06-27 11:07:01 +02:00
|
|
|
#include "RiuMainPlotWindow.h"
|
2015-08-28 11:45:18 +02:00
|
|
|
|
2017-10-09 14:30:27 +02:00
|
|
|
#include "RicWellLogTools.h"
|
|
|
|
|
|
2015-08-28 11:45:18 +02:00
|
|
|
#include "cafSelectionManager.h"
|
|
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
|
2015-08-31 02:06:37 +02:00
|
|
|
#include <vector>
|
2015-09-03 10:55:54 +02:00
|
|
|
|
2015-08-28 11:45:18 +02:00
|
|
|
|
2015-09-18 17:29:17 +02:00
|
|
|
CAF_CMD_SOURCE_INIT(RicNewWellLogFileCurveFeature, "RicNewWellLogFileCurveFeature");
|
2015-08-28 11:45:18 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-09-18 17:29:17 +02:00
|
|
|
bool RicNewWellLogFileCurveFeature::isCommandEnabled()
|
2015-08-28 11:45:18 +02:00
|
|
|
{
|
2017-10-10 11:18:35 +02:00
|
|
|
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
|
2017-10-09 14:30:27 +02:00
|
|
|
return (RicWellLogTools::selectedWellLogPlotTrack() != nullptr && wellLogFilesAvailable()) || RicWellLogTools::selectedWellPathWithLogFile() != nullptr;
|
2015-08-28 11:45:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-09-18 17:29:17 +02:00
|
|
|
void RicNewWellLogFileCurveFeature::onActionTriggered(bool isChecked)
|
2015-08-28 11:45:18 +02:00
|
|
|
{
|
2017-10-09 14:30:27 +02:00
|
|
|
RimWellLogTrack* wellLogPlotTrack = RicWellLogTools::selectedWellLogPlotTrack();
|
2015-09-18 12:29:23 +02:00
|
|
|
if (wellLogPlotTrack)
|
2015-08-28 11:45:18 +02:00
|
|
|
{
|
2017-10-09 14:30:27 +02:00
|
|
|
RicWellLogTools::addFileCurve(wellLogPlotTrack);
|
2015-08-28 11:45:18 +02:00
|
|
|
}
|
2015-09-21 14:02:33 +02:00
|
|
|
else
|
|
|
|
|
{
|
2017-10-09 14:30:27 +02:00
|
|
|
RimWellPath* wellPath = RicWellLogTools::selectedWellPathWithLogFile();
|
2015-09-21 14:02:33 +02:00
|
|
|
if (wellPath)
|
|
|
|
|
{
|
2015-11-04 15:57:06 +01:00
|
|
|
RimWellLogTrack* wellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
|
2017-10-09 14:30:27 +02:00
|
|
|
RimWellLogFileCurve* plotCurve = RicWellLogTools::addFileCurve(wellLogPlotTrack);
|
2015-09-21 14:02:33 +02:00
|
|
|
plotCurve->setWellPath(wellPath);
|
2017-10-24 08:18:03 +02:00
|
|
|
|
|
|
|
|
if (wellPath->wellLogFiles().size() == 1)
|
|
|
|
|
{
|
|
|
|
|
plotCurve->setWellLogFile(wellPath->wellLogFiles().front());
|
|
|
|
|
}
|
2015-09-21 14:02:33 +02:00
|
|
|
plotCurve->updateConnectedEditors();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-08-28 11:45:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-09-18 17:29:17 +02:00
|
|
|
void RicNewWellLogFileCurveFeature::setupActionLook(QAction* actionToSetup)
|
2015-08-28 11:45:18 +02:00
|
|
|
{
|
2018-03-15 13:04:57 +01:00
|
|
|
actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png"));
|
2015-09-18 09:07:06 +02:00
|
|
|
actionToSetup->setText("New Well Log LAS Curve");
|
2015-08-28 11:45:18 +02:00
|
|
|
}
|
|
|
|
|
|
2015-09-25 17:52:03 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-03-15 13:04:57 +01:00
|
|
|
bool RicNewWellLogFileCurveFeature::wellLogFilesAvailable()
|
2015-09-25 17:52:03 +02:00
|
|
|
{
|
|
|
|
|
RimProject* project = RiaApplication::instance()->project();
|
|
|
|
|
if (project->activeOilField()->wellPathCollection())
|
|
|
|
|
{
|
|
|
|
|
caf::PdmChildArrayField<RimWellPath*>& wellPaths = project->activeOilField()->wellPathCollection()->wellPaths;
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < wellPaths.size(); i++)
|
|
|
|
|
{
|
2018-03-15 13:04:57 +01:00
|
|
|
if (!wellPaths[i]->wellLogFiles().empty())
|
2015-09-25 17:52:03 +02:00
|
|
|
{
|
2017-10-19 16:12:22 +02:00
|
|
|
return true;
|
2015-09-25 17:52:03 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|