2016-05-09 05:13:54 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// 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 "RicNewSummaryPlotFeature.h"
|
|
|
|
|
2016-06-30 03:06:15 -05:00
|
|
|
#include "RiaApplication.h"
|
|
|
|
|
|
|
|
#include "RimMainPlotCollection.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
#include "RimProject.h"
|
2016-06-30 03:06:15 -05:00
|
|
|
#include "RimSummaryCurveFilter.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
#include "RimSummaryPlot.h"
|
2016-06-30 03:06:15 -05:00
|
|
|
#include "RimSummaryPlotCollection.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2016-06-30 03:06:15 -05:00
|
|
|
#include "RiuMainPlotWindow.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
|
|
|
#include "cvfAssert.h"
|
|
|
|
|
|
|
|
|
|
|
|
CAF_CMD_SOURCE_INIT(RicNewSummaryPlotFeature, "RicNewSummaryPlotFeature");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RicNewSummaryPlotFeature::isCommandEnabled()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicNewSummaryPlotFeature::onActionTriggered(bool isChecked)
|
|
|
|
{
|
|
|
|
RimProject* project = RiaApplication::instance()->project();
|
|
|
|
CVF_ASSERT(project);
|
|
|
|
|
|
|
|
RimMainPlotCollection* mainPlotColl = project->mainPlotCollection();
|
|
|
|
CVF_ASSERT(mainPlotColl);
|
|
|
|
|
|
|
|
RimSummaryPlotCollection* summaryPlotColl = mainPlotColl->summaryPlotCollection();
|
|
|
|
CVF_ASSERT(summaryPlotColl);
|
|
|
|
|
|
|
|
RimSummaryPlot* plot = new RimSummaryPlot();
|
|
|
|
summaryPlotColl->m_summaryPlots().push_back(plot);
|
|
|
|
|
2016-06-20 10:55:11 -05:00
|
|
|
plot->setDescription(QString("Summary Plot %1").arg(summaryPlotColl->m_summaryPlots.size()));
|
2016-05-31 06:42:27 -05:00
|
|
|
|
2016-06-30 03:06:15 -05:00
|
|
|
RimSummaryCurveFilter* newCurveFilter = new RimSummaryCurveFilter();
|
|
|
|
newCurveFilter->createCurves("*F*P*");
|
|
|
|
plot->addCurveFilter(newCurveFilter);
|
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
summaryPlotColl->updateConnectedEditors();
|
2016-05-25 07:05:31 -05:00
|
|
|
plot->loadDataAndUpdate();
|
2016-05-31 06:42:27 -05:00
|
|
|
|
2016-06-30 03:06:15 -05:00
|
|
|
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(newCurveFilter);
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicNewSummaryPlotFeature::setupActionLook(QAction* actionToSetup)
|
|
|
|
{
|
|
|
|
actionToSetup->setText("New Summary Plot");
|
|
|
|
}
|