2017-09-15 10:48:38 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// 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 "RicSummaryCurveCreatorDialog.h"
|
|
|
|
|
|
2017-09-27 14:35:12 +02:00
|
|
|
#include "RiaApplication.h"
|
|
|
|
|
|
2017-09-15 10:48:38 +02:00
|
|
|
#include "RicSummaryCurveCreator.h"
|
|
|
|
|
#include "RicSummaryCurveCreatorSplitterUi.h"
|
|
|
|
|
|
2018-04-27 06:28:08 +02:00
|
|
|
#include "RiuPlotMainWindow.h"
|
2017-11-29 08:50:48 +01:00
|
|
|
#include "RiuTools.h"
|
2017-09-27 14:35:12 +02:00
|
|
|
|
2017-09-15 10:48:38 +02:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-02 11:12:31 +02:00
|
|
|
RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog(QWidget* parent)
|
2017-11-29 08:50:48 +01:00
|
|
|
: QDialog(parent, RiuTools::defaultDialogFlags())
|
2017-09-15 10:48:38 +02:00
|
|
|
{
|
|
|
|
|
m_curveCreatorSplitterUi = new RicSummaryCurveCreatorSplitterUi(this);
|
|
|
|
|
|
|
|
|
|
QWidget* propertyWidget = m_curveCreatorSplitterUi->getOrCreateWidget(this);
|
|
|
|
|
|
|
|
|
|
QVBoxLayout* dummy = new QVBoxLayout(this);
|
|
|
|
|
dummy->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
dummy->addWidget(propertyWidget);
|
|
|
|
|
|
2017-12-18 14:30:19 +01:00
|
|
|
setWindowTitle("Plot Editor");
|
2017-09-25 15:38:57 +02:00
|
|
|
resize(1200, 800);
|
2017-09-15 14:40:25 +02:00
|
|
|
connect(m_curveCreatorSplitterUi, SIGNAL(signalCloseButtonPressed()), this, SLOT(accept()));
|
2017-09-27 14:35:12 +02:00
|
|
|
|
|
|
|
|
connect(this, SIGNAL(finished(int)), this, SLOT(slotDialogFinished()));
|
2017-09-15 10:48:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RicSummaryCurveCreatorDialog::~RicSummaryCurveCreatorDialog()
|
|
|
|
|
{
|
2017-09-27 14:35:12 +02:00
|
|
|
}
|
2017-09-15 10:48:38 +02:00
|
|
|
|
2017-10-02 11:12:31 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-27 08:26:20 +02:00
|
|
|
void RicSummaryCurveCreatorDialog::updateFromSummaryPlot(RimSummaryPlot* summaryPlot)
|
2017-10-02 11:12:31 +02:00
|
|
|
{
|
2017-10-27 08:26:20 +02:00
|
|
|
m_curveCreatorSplitterUi->updateFromSummaryPlot(summaryPlot);
|
2017-10-02 11:12:31 +02:00
|
|
|
m_curveCreatorSplitterUi->updateUi();
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-07 09:45:50 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-05-28 13:26:56 +02:00
|
|
|
void RicSummaryCurveCreatorDialog::updateFromDefaultCases(const std::vector<caf::PdmObject*> defaultSources)
|
2018-05-07 09:45:50 +02:00
|
|
|
{
|
2018-05-28 13:26:56 +02:00
|
|
|
m_curveCreatorSplitterUi->updateFromDefaultSources(defaultSources);
|
2018-05-07 09:45:50 +02:00
|
|
|
m_curveCreatorSplitterUi->updateUi();
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-27 14:35:12 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicSummaryCurveCreatorDialog::slotDialogFinished()
|
|
|
|
|
{
|
2018-04-27 06:28:08 +02:00
|
|
|
RiuPlotMainWindow* plotwindow = RiaApplication::instance()->mainPlotWindow();
|
2017-09-27 14:35:12 +02:00
|
|
|
if (plotwindow)
|
|
|
|
|
{
|
|
|
|
|
plotwindow->cleanUpTemporaryWidgets();
|
|
|
|
|
}
|
2017-09-15 10:48:38 +02:00
|
|
|
}
|