2017-09-15 10:48:38 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2017- Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2017-09-15 10:48:38 +02: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-06 10:40:57 +02:00
|
|
|
//
|
2017-09-15 10:48:38 +02: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-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-09-15 10:48:38 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2020-02-18 12:29:13 +01:00
|
|
|
#include "RicSummaryPlotEditorDialog.h"
|
2017-09-15 10:48:38 +02:00
|
|
|
|
2019-05-06 10:36:05 +02:00
|
|
|
#include "RiaGuiApplication.h"
|
2017-09-27 14:35:12 +02:00
|
|
|
|
2020-02-18 13:36:07 +01:00
|
|
|
#include "RicSummaryPlotEditorUi.h"
|
2020-02-18 13:26:32 +01:00
|
|
|
#include "RicSummaryPlotEditorWidgetCreator.h"
|
2017-09-15 10:48:38 +02:00
|
|
|
|
2018-09-13 12:38:17 +02:00
|
|
|
#include "RifReaderEclipseSummary.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>
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-09-15 10:48:38 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-18 12:29:13 +01:00
|
|
|
RicSummaryPlotEditorDialog::RicSummaryPlotEditorDialog( QWidget* parent )
|
2019-09-06 10:40:57 +02:00
|
|
|
: QDialog( parent, RiuTools::defaultDialogFlags() )
|
2017-09-15 10:48:38 +02:00
|
|
|
{
|
2020-02-18 13:26:32 +01:00
|
|
|
m_curveCreatorSplitterUi = new RicSummaryPlotEditorWidgetCreator( this );
|
2017-09-15 10:48:38 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
QWidget* propertyWidget = m_curveCreatorSplitterUi->getOrCreateWidget( this );
|
2017-09-15 10:48:38 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
QVBoxLayout* dummy = new QVBoxLayout( this );
|
|
|
|
|
dummy->setContentsMargins( 0, 0, 0, 0 );
|
|
|
|
|
dummy->addWidget( propertyWidget );
|
2017-09-15 10:48:38 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
setWindowTitle( "Plot Editor" );
|
|
|
|
|
resize( 1200, 800 );
|
2019-12-04 13:04:44 +01:00
|
|
|
connect( m_curveCreatorSplitterUi, SIGNAL( signalCloseButtonPressed() ), this, SLOT( accept() ) );
|
2019-09-06 10:40:57 +02:00
|
|
|
|
|
|
|
|
connect( this, SIGNAL( finished( int ) ), this, SLOT( slotDialogFinished() ) );
|
2017-09-15 10:48:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-09-15 10:48:38 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-18 12:29:13 +01:00
|
|
|
RicSummaryPlotEditorDialog::~RicSummaryPlotEditorDialog()
|
2019-11-20 11:41:14 +01:00
|
|
|
{
|
|
|
|
|
m_curveCreatorSplitterUi->setPdmObject( nullptr );
|
|
|
|
|
}
|
2017-09-15 10:48:38 +02:00
|
|
|
|
2017-10-02 11:12:31 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-10-02 11:12:31 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-18 12:29:13 +01:00
|
|
|
void RicSummaryPlotEditorDialog::updateFromSummaryPlot( RimSummaryPlot* summaryPlot )
|
2017-10-02 11:12:31 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2018-05-07 09:45:50 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-18 12:29:13 +01:00
|
|
|
void RicSummaryPlotEditorDialog::updateFromDefaultCases( const std::vector<caf::PdmObject*> defaultSources )
|
2018-05-07 09:45:50 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-09-27 14:35:12 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-18 12:29:13 +01:00
|
|
|
void RicSummaryPlotEditorDialog::slotDialogFinished()
|
2017-09-27 14:35:12 +02:00
|
|
|
{
|
2019-05-06 10:36:05 +02:00
|
|
|
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( plotwindow )
|
2017-09-27 14:35:12 +02:00
|
|
|
{
|
|
|
|
|
plotwindow->cleanUpTemporaryWidgets();
|
|
|
|
|
}
|
2017-09-15 10:48:38 +02:00
|
|
|
}
|