2017-09-08 07:49:41 -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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-09-26 00:49:00 -05:00
|
|
|
#include "RifEclipseSummaryAddress.h"
|
|
|
|
#include "RimSummaryCurveAppearanceCalculator.h"
|
2017-10-23 04:41:16 -05:00
|
|
|
#include "RiuSummaryCurveDefSelectionEditor.h"
|
2017-09-26 00:49:00 -05:00
|
|
|
|
2017-09-08 07:49:41 -05:00
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
#include "cafPdmChildField.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmPointer.h"
|
2017-12-14 02:59:11 -06:00
|
|
|
#include "cafPdmProxyValueField.h"
|
2017-09-08 07:49:41 -05:00
|
|
|
#include "cafPdmPtrArrayField.h"
|
|
|
|
#include "cafPdmPtrField.h"
|
|
|
|
|
2017-10-26 06:59:30 -05:00
|
|
|
#include <memory>
|
|
|
|
|
2017-09-26 03:38:50 -05:00
|
|
|
|
|
|
|
#define OBSERVED_DATA_AVALUE_POSTFIX "_OBSDATA"
|
|
|
|
|
2017-09-08 07:49:41 -05:00
|
|
|
class RimSummaryCase;
|
2017-09-22 02:54:40 -05:00
|
|
|
class RimSummaryCurveAutoName;
|
2017-09-26 00:49:00 -05:00
|
|
|
class RimSummaryPlot;
|
2017-10-23 04:41:16 -05:00
|
|
|
class RiaSummaryCurveDefinition;
|
2017-09-08 07:49:41 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RicSummaryCurveCreator : public caf::PdmObject
|
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
private:
|
2017-09-14 06:14:06 -05:00
|
|
|
typedef caf::AppEnum<RimSummaryCurveAppearanceCalculator::CurveAppearanceType> AppearanceTypeAppEnum;
|
|
|
|
|
2017-09-08 07:49:41 -05:00
|
|
|
public:
|
|
|
|
RicSummaryCurveCreator();
|
|
|
|
virtual ~RicSummaryCurveCreator();
|
|
|
|
|
2017-10-26 06:59:30 -05:00
|
|
|
RimSummaryPlot* previewPlot() const;
|
2017-09-18 00:46:29 -05:00
|
|
|
void updateFromSummaryPlot(RimSummaryPlot* targetPlot);
|
2017-09-15 04:49:09 -05:00
|
|
|
|
2017-10-27 01:26:20 -05:00
|
|
|
QWidget* addressSelectionWidget(QWidget* parent);
|
|
|
|
|
2017-09-15 07:40:25 -05:00
|
|
|
bool isCloseButtonPressed() const;
|
|
|
|
void clearCloseButton();
|
2017-09-22 02:54:40 -05:00
|
|
|
void updateCurveNames();
|
2017-09-15 07:40:25 -05:00
|
|
|
|
2017-09-08 07:49:41 -05:00
|
|
|
private:
|
2017-09-13 11:55:58 -05:00
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue);
|
2017-09-08 07:49:41 -05:00
|
|
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly);
|
|
|
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
2017-09-15 06:47:15 -05:00
|
|
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName,
|
|
|
|
caf::PdmUiEditorAttribute* attribute) override;
|
2017-09-08 07:49:41 -05:00
|
|
|
|
2017-09-18 04:54:38 -05:00
|
|
|
void syncPreviewCurvesFromUiSelection();
|
2017-10-23 04:41:16 -05:00
|
|
|
void updatePreviewCurvesFromCurveDefinitions(const std::set<RiaSummaryCurveDefinition>& allCurveDefsToDisplay,
|
|
|
|
const std::set<RiaSummaryCurveDefinition>& curveDefsToAdd,
|
2017-09-19 08:19:48 -05:00
|
|
|
const std::set<RimSummaryCurve*>& curvesToDelete);
|
2017-09-14 06:14:06 -05:00
|
|
|
std::set<std::string> getAllSummaryCaseNames();
|
|
|
|
std::set<std::string> getAllSummaryWellNames();
|
2017-09-08 07:49:41 -05:00
|
|
|
|
2017-09-15 04:49:09 -05:00
|
|
|
void populateCurveCreator(const RimSummaryPlot& sourceSummaryPlot);
|
|
|
|
void updateTargetPlot();
|
2017-09-18 04:54:38 -05:00
|
|
|
static void copyCurveAndAddToPlot(const RimSummaryCurve *curve, RimSummaryPlot *plot, bool forceVisible = false);
|
2017-12-04 07:36:17 -06:00
|
|
|
void setDefaultCurveSelection();
|
2017-09-15 04:49:09 -05:00
|
|
|
|
2017-09-18 00:46:29 -05:00
|
|
|
void resetAllFields();
|
2017-09-19 08:19:48 -05:00
|
|
|
void initCurveAppearanceCalculator(RimSummaryCurveAppearanceCalculator& curveAppearanceCalc);
|
|
|
|
void applyAppearanceToAllPreviewCurves();
|
|
|
|
void updateAppearanceEditor();
|
2017-10-23 04:41:16 -05:00
|
|
|
std::set<RiaSummaryCurveDefinition> allPreviewCurveDefs() const;
|
2017-09-21 02:49:49 -05:00
|
|
|
void createNewPlot();
|
2017-09-27 07:57:37 -05:00
|
|
|
bool isObservedData(RimSummaryCase *sumCase) const;
|
2017-09-21 02:49:49 -05:00
|
|
|
|
2017-10-18 04:20:19 -05:00
|
|
|
static RimSummaryCase* calculatedSummaryCase();
|
2017-10-23 04:41:16 -05:00
|
|
|
void selectionEditorFieldChanged();
|
2017-10-18 04:20:19 -05:00
|
|
|
|
2017-12-14 02:59:11 -06:00
|
|
|
void proxyEnablePlotAutoTitle(const bool& enable);
|
|
|
|
bool proxyPlotAutoTitle() const;
|
|
|
|
|
2017-09-08 07:49:41 -05:00
|
|
|
private:
|
2017-10-26 06:59:30 -05:00
|
|
|
caf::PdmPtrField<RimSummaryPlot*> m_targetPlot;
|
2017-09-18 00:46:29 -05:00
|
|
|
|
2017-10-26 06:59:30 -05:00
|
|
|
std::unique_ptr<RimSummaryPlot> m_previewPlot;
|
2017-09-14 06:14:06 -05:00
|
|
|
|
2017-12-14 02:59:11 -06:00
|
|
|
caf::PdmProxyValueField<bool> m_useAutoPlotTitleProxy;
|
|
|
|
|
2017-10-26 06:59:30 -05:00
|
|
|
caf::PdmField<bool> m_useAutoAppearanceAssignment;
|
|
|
|
caf::PdmField<bool> m_appearanceApplyButton;
|
|
|
|
caf::PdmField< AppearanceTypeAppEnum > m_caseAppearanceType;
|
|
|
|
caf::PdmField< AppearanceTypeAppEnum > m_variableAppearanceType;
|
|
|
|
caf::PdmField< AppearanceTypeAppEnum > m_wellAppearanceType;
|
|
|
|
caf::PdmField< AppearanceTypeAppEnum > m_groupAppearanceType;
|
|
|
|
caf::PdmField< AppearanceTypeAppEnum > m_regionAppearanceType;
|
2017-09-15 06:47:15 -05:00
|
|
|
|
2017-10-26 06:59:30 -05:00
|
|
|
caf::PdmChildField<RimSummaryCurveAutoName*> m_curveNameConfig;
|
2017-09-22 02:54:40 -05:00
|
|
|
|
2017-10-26 06:59:30 -05:00
|
|
|
caf::PdmField<bool> m_okButtonField;
|
|
|
|
caf::PdmField<bool> m_applyButtonField;
|
|
|
|
caf::PdmField<bool> m_closeButtonField;
|
2017-10-27 01:26:20 -05:00
|
|
|
|
|
|
|
std::unique_ptr<RiuSummaryCurveDefSelectionEditor> m_summaryCurveSelectionEditor;
|
2017-09-08 07:49:41 -05:00
|
|
|
};
|