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"
|
2016-10-24 06:54:35 -05:00
|
|
|
#include "RiaPreferences.h"
|
2016-06-30 03:06:15 -05:00
|
|
|
|
2017-10-27 01:26:20 -05:00
|
|
|
#include "RicEditSummaryPlotFeature.h"
|
2017-09-21 02:49:49 -05:00
|
|
|
#include "RicSummaryCurveCreator.h"
|
|
|
|
#include "RicSummaryCurveCreatorDialog.h"
|
2017-09-26 00:48:42 -05:00
|
|
|
|
2017-09-21 02:49:49 -05:00
|
|
|
#include "RimSummaryCurveFilter.h"
|
2017-09-26 00:48:42 -05:00
|
|
|
#include "RimSummaryPlot.h"
|
|
|
|
#include "RimSummaryPlotCollection.h"
|
|
|
|
|
2017-09-21 02:49:49 -05:00
|
|
|
#include "RiuMainPlotWindow.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2017-09-26 00:48:42 -05:00
|
|
|
#include "cvfAssert.h"
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
|
|
|
|
CAF_CMD_SOURCE_INIT(RicNewSummaryPlotFeature, "RicNewSummaryPlotFeature");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RicNewSummaryPlotFeature::isCommandEnabled()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicNewSummaryPlotFeature::onActionTriggered(bool isChecked)
|
|
|
|
{
|
|
|
|
RimProject* project = RiaApplication::instance()->project();
|
|
|
|
CVF_ASSERT(project);
|
|
|
|
|
2017-10-27 01:26:20 -05:00
|
|
|
auto dialog = RicEditSummaryPlotFeature::curveCreatorDialog();
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2017-09-21 02:49:49 -05:00
|
|
|
if (!dialog->isVisible())
|
2017-09-21 08:48:00 -05:00
|
|
|
{
|
2017-09-21 02:49:49 -05:00
|
|
|
dialog->show();
|
2017-09-21 08:48:00 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
dialog->raise();
|
|
|
|
}
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2017-10-27 01:26:20 -05:00
|
|
|
dialog->updateFromSummaryPlot(nullptr);
|
2016-06-30 06:21:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicNewSummaryPlotFeature::setupActionLook(QAction* actionToSetup)
|
|
|
|
{
|
|
|
|
actionToSetup->setText("New Summary Plot");
|
2016-11-06 12:09:15 -06:00
|
|
|
actionToSetup->setIcon(QIcon(":/SummaryPlot16x16.png"));
|
2016-06-30 06:21:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-21 02:49:49 -05:00
|
|
|
/// This method is not called from within this class, only by other classes
|
2016-06-30 06:21:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-08-11 04:20:40 -05:00
|
|
|
RimSummaryPlot* RicNewSummaryPlotFeature::createNewSummaryPlot(RimSummaryPlotCollection* summaryPlotColl, RimSummaryCase* summaryCase)
|
2016-06-30 06:21:04 -05:00
|
|
|
{
|
2016-05-09 05:13:54 -05:00
|
|
|
RimSummaryPlot* plot = new RimSummaryPlot();
|
2017-01-13 02:51:37 -06:00
|
|
|
summaryPlotColl->summaryPlots().push_back(plot);
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2017-01-13 02:51:37 -06:00
|
|
|
plot->setDescription(QString("Summary Plot %1").arg(summaryPlotColl->summaryPlots.size()));
|
2016-05-31 06:42:27 -05:00
|
|
|
|
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
|
|
|
|
2017-08-11 04:20:40 -05:00
|
|
|
return plot;
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|