2017-10-12 00:32:21 -05: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 "RicSummaryCurveCalculatorDialog.h"
|
2017-11-13 14:40:26 -06:00
|
|
|
|
2017-11-08 01:43:14 -06:00
|
|
|
#include "RicSummaryCurveCalculator.h"
|
2017-10-12 13:24:26 -05:00
|
|
|
#include "RicSummaryCurveCalculatorEditor.h"
|
2017-10-12 00:32:21 -05:00
|
|
|
|
2017-10-12 02:28:34 -05:00
|
|
|
#include <QDialogButtonBox>
|
2017-10-12 00:32:21 -05:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RicSummaryCurveCalculatorDialog::RicSummaryCurveCalculatorDialog(QWidget* parent)
|
|
|
|
: QDialog(parent)
|
|
|
|
{
|
|
|
|
setWindowTitle("Summary Curve Calculator");
|
|
|
|
resize(1200, 800);
|
|
|
|
|
|
|
|
setUp();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RicSummaryCurveCalculatorDialog::~RicSummaryCurveCalculatorDialog()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-11-08 01:43:14 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-13 14:40:26 -06:00
|
|
|
void RicSummaryCurveCalculatorDialog::setCalculationAndUpdateUi(RimSummaryCalculation* calculation)
|
2017-11-08 01:43:14 -06:00
|
|
|
{
|
2017-11-13 14:40:26 -06:00
|
|
|
m_summaryCalcEditor->calculator()->setCurrentCalculation(calculation);
|
|
|
|
|
|
|
|
m_summaryCalcEditor->updateUi();
|
2017-11-08 01:43:14 -06:00
|
|
|
}
|
|
|
|
|
2017-11-14 00:30:49 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicSummaryCurveCalculatorDialog::slotTryCloseDialog()
|
|
|
|
{
|
|
|
|
// Test for dirty
|
|
|
|
|
|
|
|
accept();
|
|
|
|
}
|
|
|
|
|
2017-10-12 00:32:21 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicSummaryCurveCalculatorDialog::setUp()
|
|
|
|
{
|
2017-10-12 02:28:34 -05:00
|
|
|
QVBoxLayout* mainLayout = new QVBoxLayout(this);
|
|
|
|
mainLayout->setContentsMargins(0, 0, 0, 0);
|
2017-10-12 00:32:21 -05:00
|
|
|
|
2017-10-12 13:39:02 -05:00
|
|
|
m_summaryCalcEditor = std::unique_ptr<RicSummaryCurveCalculatorEditor>(new RicSummaryCurveCalculatorEditor());
|
|
|
|
mainLayout->addWidget(m_summaryCalcEditor->getOrCreateWidget(this));
|
2017-10-12 02:28:34 -05:00
|
|
|
|
2017-11-14 00:30:49 -06:00
|
|
|
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
|
|
|
connect(buttonBox, SIGNAL(rejected()), this, SLOT(slotTryCloseDialog()));
|
2017-10-12 02:28:34 -05:00
|
|
|
|
|
|
|
mainLayout->addWidget(buttonBox);
|
2017-10-12 00:32:21 -05:00
|
|
|
|
2017-10-12 13:39:02 -05:00
|
|
|
m_summaryCalcEditor->updateUi();
|
2017-10-12 00:32:21 -05:00
|
|
|
}
|
|
|
|
|