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