mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge remote-tracking branch 'origin/2018.11.01-patch' into dev
This commit is contained in:
commit
6f3097dd5f
@ -17,6 +17,7 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RiaSummaryCurveAnalyzer.h"
|
#include "RiaSummaryCurveAnalyzer.h"
|
||||||
|
#include "RiaStdStringTools.h"
|
||||||
|
|
||||||
#include "RiaSummaryCurveDefinition.h"
|
#include "RiaSummaryCurveDefinition.h"
|
||||||
|
|
||||||
@ -62,6 +63,44 @@ std::set<std::string> RiaSummaryCurveAnalyzer::quantities() const
|
|||||||
return m_quantities;
|
return m_quantities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::set<std::string> RiaSummaryCurveAnalyzer::quantityNamesWithHistory() const
|
||||||
|
{
|
||||||
|
assignCategoryToQuantities();
|
||||||
|
|
||||||
|
return m_quantitiesWithMatchingHistory;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::set<std::string> RiaSummaryCurveAnalyzer::quantityNamesNoHistory() const
|
||||||
|
{
|
||||||
|
assignCategoryToQuantities();
|
||||||
|
|
||||||
|
return m_quantitiesNoMatchingHistory;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::string RiaSummaryCurveAnalyzer::quantityNameForTitle() const
|
||||||
|
{
|
||||||
|
if (quantityNamesWithHistory().size() == 1 && quantityNamesNoHistory().empty())
|
||||||
|
{
|
||||||
|
return *quantityNamesWithHistory().begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quantityNamesNoHistory().size() == 1 && quantityNamesWithHistory().empty())
|
||||||
|
{
|
||||||
|
return *quantityNamesNoHistory().begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -130,7 +169,7 @@ std::vector<QString> RiaSummaryCurveAnalyzer::identifierTexts(RifEclipseSummaryA
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RifEclipseSummaryAddress>
|
std::vector<RifEclipseSummaryAddress>
|
||||||
RiaSummaryCurveAnalyzer::addressesForCategory(const std::set<RifEclipseSummaryAddress>& addresses,
|
RiaSummaryCurveAnalyzer::addressesForCategory(const std::set<RifEclipseSummaryAddress>& addresses,
|
||||||
RifEclipseSummaryAddress::SummaryVarCategory category)
|
RifEclipseSummaryAddress::SummaryVarCategory category)
|
||||||
{
|
{
|
||||||
std::vector<RifEclipseSummaryAddress> filteredAddresses;
|
std::vector<RifEclipseSummaryAddress> filteredAddresses;
|
||||||
@ -146,6 +185,24 @@ std::vector<RifEclipseSummaryAddress>
|
|||||||
return filteredAddresses;
|
return filteredAddresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::string RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName(const std::string& curveName)
|
||||||
|
{
|
||||||
|
static std::string historyIdentifier = "H";
|
||||||
|
|
||||||
|
if (RiaStdStringTools::endsWith(curveName, historyIdentifier))
|
||||||
|
{
|
||||||
|
std::string candidate = curveName.substr(0, curveName.size() - 1);
|
||||||
|
return candidate;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return curveName + historyIdentifier;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -158,6 +215,53 @@ void RiaSummaryCurveAnalyzer::clear()
|
|||||||
m_categories.clear();
|
m_categories.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiaSummaryCurveAnalyzer::assignCategoryToQuantities() const
|
||||||
|
{
|
||||||
|
if (!m_quantities.empty())
|
||||||
|
{
|
||||||
|
if (m_quantitiesWithMatchingHistory.empty() && m_quantitiesNoMatchingHistory.empty())
|
||||||
|
{
|
||||||
|
computeQuantityNamesWithHistory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiaSummaryCurveAnalyzer::computeQuantityNamesWithHistory() const
|
||||||
|
{
|
||||||
|
m_quantitiesNoMatchingHistory.clear();
|
||||||
|
m_quantitiesWithMatchingHistory.clear();
|
||||||
|
|
||||||
|
const std::string historyIdentifier("H");
|
||||||
|
|
||||||
|
for (const auto& s : m_quantities)
|
||||||
|
{
|
||||||
|
std::string correspondingHistoryCurve = correspondingHistorySummaryCurveName(s);
|
||||||
|
|
||||||
|
if (m_quantities.find(correspondingHistoryCurve) != m_quantities.end())
|
||||||
|
{
|
||||||
|
// Insert the curve name without H
|
||||||
|
if (RiaStdStringTools::endsWith(s, historyIdentifier))
|
||||||
|
{
|
||||||
|
m_quantitiesWithMatchingHistory.insert(correspondingHistoryCurve);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_quantitiesWithMatchingHistory.insert(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_quantitiesNoMatchingHistory.insert(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -42,6 +42,11 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
std::set<std::string> quantities() const;
|
std::set<std::string> quantities() const;
|
||||||
|
std::set<std::string> quantityNamesWithHistory() const;
|
||||||
|
std::set<std::string> quantityNamesNoHistory() const;
|
||||||
|
|
||||||
|
std::string quantityNameForTitle() const;
|
||||||
|
|
||||||
std::set<std::string> wellNames() const;
|
std::set<std::string> wellNames() const;
|
||||||
std::set<std::string> wellGroupNames() const;
|
std::set<std::string> wellGroupNames() const;
|
||||||
std::set<int> regionNumbers() const;
|
std::set<int> regionNumbers() const;
|
||||||
@ -53,11 +58,19 @@ public:
|
|||||||
static std::vector<RifEclipseSummaryAddress> addressesForCategory(const std::set<RifEclipseSummaryAddress>& addresses,
|
static std::vector<RifEclipseSummaryAddress> addressesForCategory(const std::set<RifEclipseSummaryAddress>& addresses,
|
||||||
RifEclipseSummaryAddress::SummaryVarCategory category);
|
RifEclipseSummaryAddress::SummaryVarCategory category);
|
||||||
|
|
||||||
|
static std::string correspondingHistorySummaryCurveName(const std::string& curveName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void assignCategoryToQuantities() const;
|
||||||
|
void computeQuantityNamesWithHistory() const;
|
||||||
|
|
||||||
void analyzeSingleAddress(const RifEclipseSummaryAddress& address);
|
void analyzeSingleAddress(const RifEclipseSummaryAddress& address);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::set<std::string> m_quantities;
|
std::set<std::string> m_quantities;
|
||||||
|
mutable std::set<std::string> m_quantitiesWithMatchingHistory;
|
||||||
|
mutable std::set<std::string> m_quantitiesNoMatchingHistory;
|
||||||
|
|
||||||
std::set<std::string> m_wellNames;
|
std::set<std::string> m_wellNames;
|
||||||
std::set<std::string> m_wellGroupNames;
|
std::set<std::string> m_wellGroupNames;
|
||||||
std::set<int> m_regionNumbers;
|
std::set<int> m_regionNumbers;
|
||||||
|
@ -116,9 +116,12 @@ RicFileHierarchyDialog::RicFileHierarchyDialog(QWidget* parent)
|
|||||||
m_effectiveFilter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
m_effectiveFilter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||||
m_fileListLabel->setText("Files found");
|
m_fileListLabel->setText("Files found");
|
||||||
m_fileListLabel->setVisible(false);
|
m_fileListLabel->setVisible(false);
|
||||||
|
|
||||||
m_fileList->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
m_fileList->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
m_fileList->setVisible(false);
|
m_fileList->setVisible(false);
|
||||||
m_fileList->setContextMenuPolicy(Qt::CustomContextMenu);
|
m_fileList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
m_fileList->setSortingEnabled(true);
|
||||||
|
|
||||||
m_browseButton->setText("...");
|
m_browseButton->setText("...");
|
||||||
m_browseButton->setFixedWidth(25);
|
m_browseButton->setFixedWidth(25);
|
||||||
m_findOrCancelButton->setText(FIND_BUTTON_FIND_TEXT);
|
m_findOrCancelButton->setText(FIND_BUTTON_FIND_TEXT);
|
||||||
|
@ -63,7 +63,8 @@ bool RicImportEnsembleFeature::isCommandEnabled()
|
|||||||
void RicImportEnsembleFeature::onActionTriggered(bool isChecked)
|
void RicImportEnsembleFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
QStringList fileNames = RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog("Import Ensemble");
|
QString pathCacheName = "ENSEMBLE_FILES";
|
||||||
|
QStringList fileNames = RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog("Import Ensemble", pathCacheName);
|
||||||
|
|
||||||
if (fileNames.isEmpty()) return;
|
if (fileNames.isEmpty()) return;
|
||||||
|
|
||||||
|
@ -70,7 +70,8 @@ bool RicImportSummaryCasesFeature::isCommandEnabled()
|
|||||||
void RicImportSummaryCasesFeature::onActionTriggered(bool isChecked)
|
void RicImportSummaryCasesFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
QStringList fileNames = runRecursiveSummaryCaseFileSearchDialog("Import Summary Cases");
|
QString pathCacheName = "INPUT_FILES";
|
||||||
|
QStringList fileNames = runRecursiveSummaryCaseFileSearchDialog("Import Summary Cases", pathCacheName);
|
||||||
|
|
||||||
std::vector<RimSummaryCase*> cases;
|
std::vector<RimSummaryCase*> cases;
|
||||||
if (!fileNames.isEmpty()) createSummaryCasesFromFiles(fileNames, &cases);
|
if (!fileNames.isEmpty()) createSummaryCasesFromFiles(fileNames, &cases);
|
||||||
@ -217,10 +218,11 @@ void RicImportSummaryCasesFeature::addCasesToGroupIfRelevant(const std::vector<R
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QStringList RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog(const QString& dialogTitle)
|
QStringList RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog(const QString& dialogTitle,
|
||||||
|
const QString& pathCacheName)
|
||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
QString defaultDir = app->lastUsedDialogDirectory("INPUT_FILES");
|
QString defaultDir = app->lastUsedDialogDirectory(pathCacheName);
|
||||||
|
|
||||||
RicFileHierarchyDialogResult result = RicFileHierarchyDialog::runRecursiveSearchDialog(nullptr,
|
RicFileHierarchyDialogResult result = RicFileHierarchyDialog::runRecursiveSearchDialog(nullptr,
|
||||||
dialogTitle,
|
dialogTitle,
|
||||||
@ -236,7 +238,7 @@ QStringList RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialo
|
|||||||
if (!result.ok) return QStringList();
|
if (!result.ok) return QStringList();
|
||||||
|
|
||||||
// Remember the path to next time
|
// Remember the path to next time
|
||||||
app->setLastUsedDialogDirectory("INPUT_FILES", QFileInfo(result.rootDir).absoluteFilePath());
|
app->setLastUsedDialogDirectory(pathCacheName, QFileInfo(result.rootDir).absoluteFilePath());
|
||||||
|
|
||||||
return result.files;
|
return result.files;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
static void addSummaryCases(const std::vector<RimSummaryCase*> cases);
|
static void addSummaryCases(const std::vector<RimSummaryCase*> cases);
|
||||||
static void addCasesToGroupIfRelevant(const std::vector<RimSummaryCase*> cases);
|
static void addCasesToGroupIfRelevant(const std::vector<RimSummaryCase*> cases);
|
||||||
|
|
||||||
static QStringList runRecursiveSummaryCaseFileSearchDialog(const QString& dialogTitle);
|
static QStringList runRecursiveSummaryCaseFileSearchDialog(const QString& dialogTitle, const QString& pathCacheName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
|
@ -61,7 +61,8 @@ bool RicImportSummaryGroupFeature::isCommandEnabled()
|
|||||||
void RicImportSummaryGroupFeature::onActionTriggered(bool isChecked)
|
void RicImportSummaryGroupFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
QStringList fileNames = RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog("Import Summary Case Group");
|
QString pathCacheName = "INPUT_FILES";
|
||||||
|
QStringList fileNames = RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog("Import Summary Case Group", pathCacheName);
|
||||||
|
|
||||||
if (fileNames.isEmpty()) return;
|
if (fileNames.isEmpty()) return;
|
||||||
|
|
||||||
|
@ -36,6 +36,10 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryEnsembleCurveSetFeature.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicPasteEnsembleCurveSetFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicPasteEnsembleCurveSetFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleCurveFilterFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleCurveFilterFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedEnsembleFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedEnsembleFeature.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingSummaryCurveFeature.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingSummaryCurveFeature.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -75,6 +79,10 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryEnsembleCurveSetFeature.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicPasteEnsembleCurveSetFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicPasteEnsembleCurveSetFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleCurveFilterFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleCurveFilterFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedEnsembleFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedEnsembleFeature.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingSummaryCurveFeature.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingSummaryCurveFeature.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
@ -0,0 +1,114 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Equinor 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 "RicClearSourceSteppingEnsembleCurveSetFeature.h"
|
||||||
|
|
||||||
|
#include "RimEnsembleCurveSet.h"
|
||||||
|
#include "RimEnsembleCurveSetCollection.h"
|
||||||
|
#include "RimSummaryCurve.h"
|
||||||
|
#include "RimSummaryCurveCollection.h"
|
||||||
|
#include "RimSummaryPlot.h"
|
||||||
|
|
||||||
|
#include "RiuPlotMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicClearSourceSteppingEnsembleCurveSetFeature, "RicClearSourceSteppingEnsembleCurveSetFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicClearSourceSteppingEnsembleCurveSetFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
std::vector<caf::PdmObject*> objects;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||||
|
|
||||||
|
if (objects.size() == 1)
|
||||||
|
{
|
||||||
|
auto c = objects[0];
|
||||||
|
|
||||||
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
|
c->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
if (summaryPlot->ensembleCurveSetCollection()->curveSetForSourceStepping()
|
||||||
|
|| summaryPlot->summaryCurveCollection()->curveForSourceStepping())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicClearSourceSteppingEnsembleCurveSetFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
std::vector<caf::PdmObject*> objects;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||||
|
|
||||||
|
if (objects.size() == 1)
|
||||||
|
{
|
||||||
|
auto c = objects[0];
|
||||||
|
|
||||||
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
|
c->firstAncestorOrThisOfType(summaryPlot);
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
clearAllSourceSteppingInSummaryPlot(summaryPlot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicClearSourceSteppingEnsembleCurveSetFeature::clearAllSourceSteppingInSummaryPlot(const RimSummaryPlot* summaryPlot)
|
||||||
|
{
|
||||||
|
RimEnsembleCurveSet* previousCurveSet = summaryPlot->ensembleCurveSetCollection()->curveSetForSourceStepping();
|
||||||
|
summaryPlot->ensembleCurveSetCollection()->setCurveSetForSourceStepping(nullptr);
|
||||||
|
|
||||||
|
RimSummaryCurve* previousCurve = summaryPlot->summaryCurveCollection()->curveForSourceStepping();
|
||||||
|
summaryPlot->summaryCurveCollection()->setCurveForSourceStepping(nullptr);
|
||||||
|
|
||||||
|
if (previousCurveSet)
|
||||||
|
{
|
||||||
|
previousCurveSet->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (previousCurve)
|
||||||
|
{
|
||||||
|
previousCurve->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
|
RiuPlotMainWindowTools::refreshToolbars();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicClearSourceSteppingEnsembleCurveSetFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setText("Clear Source Stepping Curve Set");
|
||||||
|
actionToSetup->setIcon(QIcon(":/StepUpDown16x16.png"));
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Equinor 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
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
class RimSummaryPlot;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicClearSourceSteppingEnsembleCurveSetFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void clearAllSourceSteppingInSummaryPlot(const RimSummaryPlot* summaryPlot);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool isCommandEnabled() override;
|
||||||
|
void onActionTriggered(bool isChecked) override;
|
||||||
|
|
||||||
|
|
||||||
|
void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
};
|
@ -0,0 +1,90 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Equinor 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 "RicClearSourceSteppingSummaryCurveFeature.h"
|
||||||
|
#include "RicClearSourceSteppingEnsembleCurveSetFeature.h"
|
||||||
|
|
||||||
|
#include "RimSummaryCurve.h"
|
||||||
|
#include "RimSummaryCurveCollection.h"
|
||||||
|
#include "RimSummaryPlot.h"
|
||||||
|
|
||||||
|
#include "RiuPlotMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
#include "RimEnsembleCurveSetCollection.h"
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicClearSourceSteppingSummaryCurveFeature, "RicClearSourceSteppingSummaryCurveFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicClearSourceSteppingSummaryCurveFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
std::vector<caf::PdmObject*> objects;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||||
|
|
||||||
|
if (objects.size() == 1)
|
||||||
|
{
|
||||||
|
auto c = objects[0];
|
||||||
|
|
||||||
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
|
c->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
if (summaryPlot->ensembleCurveSetCollection()->curveSetForSourceStepping()
|
||||||
|
|| summaryPlot->summaryCurveCollection()->curveForSourceStepping())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicClearSourceSteppingSummaryCurveFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
std::vector<RimSummaryCurve*> summaryCurves;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&summaryCurves);
|
||||||
|
|
||||||
|
if (summaryCurves.size() == 1)
|
||||||
|
{
|
||||||
|
auto c = summaryCurves[0];
|
||||||
|
|
||||||
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
|
c->firstAncestorOrThisOfType(summaryPlot);
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
RicClearSourceSteppingEnsembleCurveSetFeature::clearAllSourceSteppingInSummaryPlot(summaryPlot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicClearSourceSteppingSummaryCurveFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setText("Clear Source Stepping Curve");
|
||||||
|
actionToSetup->setIcon(QIcon(":/StepUpDown16x16.png"));
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Equinor 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
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicClearSourceSteppingSummaryCurveFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool isCommandEnabled() override;
|
||||||
|
void onActionTriggered(bool isChecked) override;
|
||||||
|
void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
};
|
@ -19,6 +19,7 @@
|
|||||||
#include "RicNewSummaryCurveFeature.h"
|
#include "RicNewSummaryCurveFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaColorTables.h"
|
||||||
|
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
@ -31,8 +32,6 @@
|
|||||||
|
|
||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
@ -62,7 +61,9 @@ void RicNewSummaryCurveFeature::onActionTriggered(bool isChecked)
|
|||||||
if (plot)
|
if (plot)
|
||||||
{
|
{
|
||||||
RimSummaryCurve* newCurve = new RimSummaryCurve();
|
RimSummaryCurve* newCurve = new RimSummaryCurve();
|
||||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(plot->curveCount());
|
|
||||||
|
// Use same counting as RicNewSummaryEnsembleCurveSetFeature::onActionTriggered
|
||||||
|
cvf::Color3f curveColor = RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f(plot->singleColorCurveCount());
|
||||||
newCurve->setColor(curveColor);
|
newCurve->setColor(curveColor);
|
||||||
|
|
||||||
plot->addCurveAndUpdate(newCurve);
|
plot->addCurveAndUpdate(newCurve);
|
||||||
|
@ -67,12 +67,8 @@ void RicNewSummaryEnsembleCurveSetFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
||||||
|
|
||||||
// Set single curve set color
|
// Use same counting as RicNewSummaryCurveFeature::onActionTriggered
|
||||||
auto allCurveSets = plot->ensembleCurveSetCollection()->curveSets();
|
auto colorIndex = plot->singleColorCurveCount();
|
||||||
size_t colorIndex = std::count_if(allCurveSets.begin(), allCurveSets.end(), [](RimEnsembleCurveSet* curveSet)
|
|
||||||
{
|
|
||||||
return curveSet->colorMode() == RimEnsembleCurveSet::SINGLE_COLOR;
|
|
||||||
});
|
|
||||||
curveSet->setColor(RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f(colorIndex));
|
curveSet->setColor(RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f(colorIndex));
|
||||||
curveSet->legendConfig()->setColorRange(RimEnsembleCurveSetColorManager::cycledEnsembleColorRange(static_cast<int>(colorIndex)));
|
curveSet->legendConfig()->setColorRange(RimEnsembleCurveSetColorManager::cycledEnsembleColorRange(static_cast<int>(colorIndex)));
|
||||||
|
|
||||||
|
@ -0,0 +1,98 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Equinor 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 "RicSetSourceSteppingEnsembleCurveSetFeature.h"
|
||||||
|
|
||||||
|
#include "RimEnsembleCurveSet.h"
|
||||||
|
#include "RimEnsembleCurveSetCollection.h"
|
||||||
|
|
||||||
|
#include "RiuPlotMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
#include "RicClearSourceSteppingEnsembleCurveSetFeature.h"
|
||||||
|
#include "RimSummaryPlot.h"
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicSetSourceSteppingEnsembleCurveSetFeature, "RicSetSourceSteppingEnsembleCurveSetFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicSetSourceSteppingEnsembleCurveSetFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
std::vector<RimEnsembleCurveSet*> ensembleCurveSets;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&ensembleCurveSets);
|
||||||
|
|
||||||
|
if (ensembleCurveSets.size() == 1)
|
||||||
|
{
|
||||||
|
auto c = ensembleCurveSets[0];
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* coll = nullptr;
|
||||||
|
c->firstAncestorOrThisOfType(coll);
|
||||||
|
if (coll)
|
||||||
|
{
|
||||||
|
if (coll->curveSetForSourceStepping() != c)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicSetSourceSteppingEnsembleCurveSetFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
std::vector<RimEnsembleCurveSet*> objects;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||||
|
|
||||||
|
if (objects.size() == 1)
|
||||||
|
{
|
||||||
|
auto c = objects[0];
|
||||||
|
|
||||||
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
|
c->firstAncestorOrThisOfType(summaryPlot);
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
RicClearSourceSteppingEnsembleCurveSetFeature::clearAllSourceSteppingInSummaryPlot(summaryPlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* coll = nullptr;
|
||||||
|
c->firstAncestorOrThisOfType(coll);
|
||||||
|
if (coll)
|
||||||
|
{
|
||||||
|
coll->setCurveSetForSourceStepping(c);
|
||||||
|
c->updateConnectedEditors();
|
||||||
|
|
||||||
|
RiuPlotMainWindowTools::refreshToolbars();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicSetSourceSteppingEnsembleCurveSetFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setText("Set as Source Stepping Curve Set");
|
||||||
|
actionToSetup->setIcon(QIcon(":/StepUpDown16x16.png"));
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Equinor 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
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicSetSourceSteppingEnsembleCurveSetFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool isCommandEnabled() override;
|
||||||
|
void onActionTriggered(bool isChecked) override;
|
||||||
|
void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
};
|
@ -0,0 +1,98 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Equinor 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 "RicSetSourceSteppingSummaryCurveFeature.h"
|
||||||
|
#include "RicClearSourceSteppingEnsembleCurveSetFeature.h"
|
||||||
|
|
||||||
|
#include "RimSummaryCurve.h"
|
||||||
|
#include "RimSummaryCurveCollection.h"
|
||||||
|
#include "RimSummaryPlot.h"
|
||||||
|
|
||||||
|
#include "RiuPlotMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicSetSourceSteppingSummaryCurveFeature, "RicSetSourceSteppingSummaryCurveFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicSetSourceSteppingSummaryCurveFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
std::vector<RimSummaryCurve*> summaryCurves;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&summaryCurves);
|
||||||
|
|
||||||
|
if (summaryCurves.size() == 1)
|
||||||
|
{
|
||||||
|
auto c = summaryCurves[0];
|
||||||
|
|
||||||
|
RimSummaryCurveCollection* coll = nullptr;
|
||||||
|
c->firstAncestorOrThisOfTypeAsserted(coll);
|
||||||
|
if (coll)
|
||||||
|
{
|
||||||
|
if (coll->curveForSourceStepping() != c)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicSetSourceSteppingSummaryCurveFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
std::vector<RimSummaryCurve*> summaryCurves;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&summaryCurves);
|
||||||
|
|
||||||
|
if (summaryCurves.size() == 1)
|
||||||
|
{
|
||||||
|
auto c = summaryCurves[0];
|
||||||
|
|
||||||
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
|
c->firstAncestorOrThisOfType(summaryPlot);
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
RicClearSourceSteppingEnsembleCurveSetFeature::clearAllSourceSteppingInSummaryPlot(summaryPlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
RimSummaryCurveCollection* coll = nullptr;
|
||||||
|
c->firstAncestorOrThisOfTypeAsserted(coll);
|
||||||
|
if (coll)
|
||||||
|
{
|
||||||
|
coll->setCurveForSourceStepping(c);
|
||||||
|
c->updateConnectedEditors();
|
||||||
|
|
||||||
|
RiuPlotMainWindowTools::refreshToolbars();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicSetSourceSteppingSummaryCurveFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setText("Set as Source Stepping Curve");
|
||||||
|
actionToSetup->setIcon(QIcon(":/StepUpDown16x16.png"));
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Equinor 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
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicSetSourceSteppingSummaryCurveFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool isCommandEnabled() override;
|
||||||
|
void onActionTriggered(bool isChecked) override;
|
||||||
|
void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
};
|
@ -520,14 +520,14 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress(con
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifEclipseSummaryAddress::isDependentOnWellName(const RifEclipseSummaryAddress& address)
|
bool RifEclipseSummaryAddress::isDependentOnWellName(SummaryVarCategory category)
|
||||||
{
|
{
|
||||||
// clang-format off
|
// clang-format off
|
||||||
if (address.category() == SUMMARY_WELL ||
|
if (category == SUMMARY_WELL ||
|
||||||
address.category() == SUMMARY_WELL_COMPLETION ||
|
category == SUMMARY_WELL_COMPLETION ||
|
||||||
address.category() == SUMMARY_WELL_COMPLETION_LGR ||
|
category == SUMMARY_WELL_COMPLETION_LGR ||
|
||||||
address.category() == SUMMARY_WELL_LGR ||
|
category == SUMMARY_WELL_LGR ||
|
||||||
address.category() == SUMMARY_WELL_SEGMENT)
|
category == SUMMARY_WELL_SEGMENT)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ public:
|
|||||||
static RifEclipseSummaryAddress importedAddress(const std::string& quantityName);
|
static RifEclipseSummaryAddress importedAddress(const std::string& quantityName);
|
||||||
static RifEclipseSummaryAddress ensembleStatisticsAddress(const std::string& quantityName, const std::string& dataQuantityName);
|
static RifEclipseSummaryAddress ensembleStatisticsAddress(const std::string& quantityName, const std::string& dataQuantityName);
|
||||||
|
|
||||||
static bool isDependentOnWellName(const RifEclipseSummaryAddress& address);
|
static bool isDependentOnWellName(SummaryVarCategory category);
|
||||||
|
|
||||||
// Access methods
|
// Access methods
|
||||||
|
|
||||||
|
@ -486,12 +486,16 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
{
|
{
|
||||||
menuBuilder << "RicPasteSummaryCurveFeature";
|
menuBuilder << "RicPasteSummaryCurveFeature";
|
||||||
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
|
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
|
||||||
|
|
||||||
menuBuilder << "Separator";
|
menuBuilder << "Separator";
|
||||||
menuBuilder << "RicNewSummaryCurveFeature";
|
menuBuilder << "RicNewSummaryCurveFeature";
|
||||||
menuBuilder << "RicDuplicateSummaryCurveFeature";
|
menuBuilder << "RicDuplicateSummaryCurveFeature";
|
||||||
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
|
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
|
||||||
menuBuilder << "RicDuplicateSummaryCrossPlotCurveFeature";
|
menuBuilder << "RicDuplicateSummaryCrossPlotCurveFeature";
|
||||||
menuBuilder << "Separator";
|
menuBuilder << "Separator";
|
||||||
|
menuBuilder << "RicSetSourceSteppingSummaryCurveFeature";
|
||||||
|
menuBuilder << "RicClearSourceSteppingSummaryCurveFeature";
|
||||||
|
menuBuilder << "Separator";
|
||||||
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
||||||
menuBuilder << "Separator";
|
menuBuilder << "Separator";
|
||||||
menuBuilder << "RicEditSummaryCurveCalculationFeature";
|
menuBuilder << "RicEditSummaryCurveCalculationFeature";
|
||||||
@ -513,6 +517,9 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
else if (dynamic_cast<RimEnsembleCurveSet*>(uiItem))
|
else if (dynamic_cast<RimEnsembleCurveSet*>(uiItem))
|
||||||
{
|
{
|
||||||
menuBuilder << "RicNewSummaryEnsembleCurveSetFeature";
|
menuBuilder << "RicNewSummaryEnsembleCurveSetFeature";
|
||||||
|
menuBuilder << "Separator";
|
||||||
|
menuBuilder << "RicSetSourceSteppingEnsembleCurveSetFeature";
|
||||||
|
menuBuilder << "RicClearSourceSteppingEnsembleCurveSetFeature";
|
||||||
}
|
}
|
||||||
else if (dynamic_cast<RimEnsembleCurveFilterCollection*>(uiItem))
|
else if (dynamic_cast<RimEnsembleCurveFilterCollection*>(uiItem))
|
||||||
{
|
{
|
||||||
|
@ -660,6 +660,25 @@ void RimEnsembleCurveSet::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrd
|
|||||||
}
|
}
|
||||||
|
|
||||||
uiTreeOrdering.skipRemainingChildren(true);
|
uiTreeOrdering.skipRemainingChildren(true);
|
||||||
|
|
||||||
|
// Reset dynamic icon
|
||||||
|
this->setUiIcon(QIcon());
|
||||||
|
// Get static one
|
||||||
|
QIcon icon = this->uiIcon();
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* coll = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(coll);
|
||||||
|
if (coll && coll->curveSetForSourceStepping() == this)
|
||||||
|
{
|
||||||
|
QPixmap combined = icon.pixmap(16, 16);
|
||||||
|
QPainter painter(&combined);
|
||||||
|
QPixmap updownpixmap(":/StepUpDownCorner16x16.png");
|
||||||
|
painter.drawPixmap(0,0,updownpixmap);
|
||||||
|
|
||||||
|
icon = QIcon(combined);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->setUiIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaColorTables.h"
|
#include "RiaColorTables.h"
|
||||||
|
#include "RiaStdStringTools.h"
|
||||||
|
|
||||||
#include "RifReaderEclipseSummary.h"
|
#include "RifReaderEclipseSummary.h"
|
||||||
|
|
||||||
@ -50,6 +51,13 @@ RimEnsembleCurveSetCollection::RimEnsembleCurveSetCollection()
|
|||||||
|
|
||||||
CAF_PDM_InitField(&m_showCurves, "IsActive", true, "Show Curves", "", "", "");
|
CAF_PDM_InitField(&m_showCurves, "IsActive", true, "Show Curves", "", "", "");
|
||||||
m_showCurves.uiCapability()->setUiHidden(true);
|
m_showCurves.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&m_ySourceStepping, "YSourceStepping", "", "", "", "");
|
||||||
|
m_ySourceStepping = new RimSummaryPlotSourceStepping;
|
||||||
|
m_ySourceStepping->setSourceSteppingType(RimSummaryPlotSourceStepping::Y_AXIS);
|
||||||
|
m_ySourceStepping.uiCapability()->setUiHidden(true);
|
||||||
|
m_ySourceStepping.uiCapability()->setUiTreeChildrenHidden(true);
|
||||||
|
m_ySourceStepping.xmlCapability()->disableIO();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -193,6 +201,80 @@ size_t RimEnsembleCurveSetCollection::curveSetCount() const
|
|||||||
return m_curveSets.size();
|
return m_curveSets.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<caf::PdmFieldHandle*> RimEnsembleCurveSetCollection::fieldsToShowInToolbar()
|
||||||
|
{
|
||||||
|
if (m_ySourceStepping)
|
||||||
|
{
|
||||||
|
return m_ySourceStepping->fieldsToShowInToolbar();
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::vector<caf::PdmFieldHandle*>();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEnsembleCurveSetCollection::setCurveSetForSourceStepping(RimEnsembleCurveSet* curveSet)
|
||||||
|
{
|
||||||
|
m_curveSetForSourceStepping = curveSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimEnsembleCurveSet* RimEnsembleCurveSetCollection::curveSetForSourceStepping() const
|
||||||
|
{
|
||||||
|
return m_curveSetForSourceStepping;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RimEnsembleCurveSet*> RimEnsembleCurveSetCollection::curveSetsForSourceStepping() const
|
||||||
|
{
|
||||||
|
std::vector<RimEnsembleCurveSet*> steppingCurveSets;
|
||||||
|
|
||||||
|
if (m_curveSetForSourceStepping)
|
||||||
|
{
|
||||||
|
steppingCurveSets.push_back(m_curveSetForSourceStepping);
|
||||||
|
|
||||||
|
{
|
||||||
|
// Add corresponding history/summary curve with or without H
|
||||||
|
|
||||||
|
const std::string historyIdentifier = "H";
|
||||||
|
|
||||||
|
std::string quantity = m_curveSetForSourceStepping->summaryAddress().quantityName();
|
||||||
|
|
||||||
|
std::string candidateName;
|
||||||
|
if (RiaStdStringTools::endsWith(quantity, historyIdentifier))
|
||||||
|
{
|
||||||
|
candidateName = quantity.substr(0, quantity.size() - 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
candidateName = quantity + historyIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto& c : curveSets())
|
||||||
|
{
|
||||||
|
if (c->summaryAddress().quantityName() == candidateName)
|
||||||
|
{
|
||||||
|
steppingCurveSets.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
steppingCurveSets = curveSets();
|
||||||
|
}
|
||||||
|
|
||||||
|
return steppingCurveSets;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -228,6 +310,16 @@ void RimEnsembleCurveSetCollection::fieldChangedByUi(const caf::PdmFieldHandle*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEnsembleCurveSetCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||||
|
{
|
||||||
|
auto group = uiOrdering.addNewGroup("Data Source");
|
||||||
|
|
||||||
|
m_ySourceStepping()->uiOrdering(uiConfigName, *group);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
|
|
||||||
class RimEnsembleCurveSet;
|
class RimEnsembleCurveSet;
|
||||||
|
class RimSummaryPlotSourceStepping;
|
||||||
|
class RimSummaryCurve;
|
||||||
class QwtPlot;
|
class QwtPlot;
|
||||||
class QwtPlotCurve;
|
class QwtPlotCurve;
|
||||||
|
|
||||||
@ -55,20 +57,32 @@ public:
|
|||||||
std::vector<RimEnsembleCurveSet*> curveSets() const;
|
std::vector<RimEnsembleCurveSet*> curveSets() const;
|
||||||
size_t curveSetCount() const;
|
size_t curveSetCount() const;
|
||||||
|
|
||||||
|
|
||||||
void deleteAllCurveSets();
|
void deleteAllCurveSets();
|
||||||
|
|
||||||
void setCurrentSummaryCurveSet(RimEnsembleCurveSet* curveSet);
|
void setCurrentSummaryCurveSet(RimEnsembleCurveSet* curveSet);
|
||||||
|
|
||||||
|
// Functions related to source stepping
|
||||||
|
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||||
|
void setCurveSetForSourceStepping(RimEnsembleCurveSet* curve);
|
||||||
|
RimEnsembleCurveSet* curveSetForSourceStepping() const;
|
||||||
|
std::vector<RimEnsembleCurveSet*> curveSetsForSourceStepping() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmFieldHandle* objectToggleField() override;
|
caf::PdmFieldHandle* objectToggleField() override;
|
||||||
|
|
||||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue, const QVariant& newValue) override;
|
const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
|
||||||
|
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<bool> m_showCurves;
|
caf::PdmField<bool> m_showCurves;
|
||||||
caf::PdmChildArrayField<RimEnsembleCurveSet*> m_curveSets;
|
caf::PdmChildArrayField<RimEnsembleCurveSet*> m_curveSets;
|
||||||
|
|
||||||
|
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_ySourceStepping;
|
||||||
|
|
||||||
caf::PdmPointer<RimEnsembleCurveSet> m_currentEnsembleCurveSet;
|
caf::PdmPointer<RimEnsembleCurveSet> m_currentEnsembleCurveSet;
|
||||||
|
caf::PdmPointer<RimEnsembleCurveSet> m_curveSetForSourceStepping;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -565,6 +565,33 @@ void RimSummaryCurve::updateLegendsInPlot()
|
|||||||
plot->updateAllLegendItems();
|
plot->updateAllLegendItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCurve::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||||
|
{
|
||||||
|
RimPlotCurve::defineUiTreeOrdering(uiTreeOrdering, uiConfigName);
|
||||||
|
|
||||||
|
// Reset dynamic icon
|
||||||
|
this->setUiIcon(QIcon());
|
||||||
|
// Get static one
|
||||||
|
QIcon icon = this->uiIcon();
|
||||||
|
|
||||||
|
RimSummaryCurveCollection* coll = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(coll);
|
||||||
|
if (coll && coll->curveForSourceStepping() == this)
|
||||||
|
{
|
||||||
|
QPixmap combined = icon.pixmap(16, 16);
|
||||||
|
QPainter painter(&combined);
|
||||||
|
QPixmap updownpixmap(":/StepUpDownCorner16x16.png");
|
||||||
|
painter.drawPixmap(0,0,updownpixmap);
|
||||||
|
|
||||||
|
icon = QIcon(combined);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->setUiIcon(icon);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -93,6 +93,9 @@ protected:
|
|||||||
|
|
||||||
void updateLegendsInPlot() override;
|
void updateLegendsInPlot() override;
|
||||||
|
|
||||||
|
|
||||||
|
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RifSummaryReaderInterface* valuesSummaryReaderX() const;
|
RifSummaryReaderInterface* valuesSummaryReaderX() const;
|
||||||
RifSummaryReaderInterface* valuesSummaryReaderY() const;
|
RifSummaryReaderInterface* valuesSummaryReaderY() const;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "RimSummaryCurveCollection.h"
|
#include "RimSummaryCurveCollection.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaStdStringTools.h"
|
||||||
|
|
||||||
#include "RifReaderEclipseSummary.h"
|
#include "RifReaderEclipseSummary.h"
|
||||||
|
|
||||||
@ -192,6 +193,72 @@ std::vector<RimSummaryCurve*> RimSummaryCurveCollection::curves() const
|
|||||||
return m_curves.childObjects();
|
return m_curves.childObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RimSummaryCurve*> RimSummaryCurveCollection::curvesForSourceStepping(RimSummaryPlotSourceStepping::SourceSteppingType steppingType) const
|
||||||
|
{
|
||||||
|
std::vector<RimSummaryCurve*> stepCurves;
|
||||||
|
|
||||||
|
if (m_curveForSourceStepping)
|
||||||
|
{
|
||||||
|
stepCurves.push_back(m_curveForSourceStepping);
|
||||||
|
|
||||||
|
{
|
||||||
|
// Add corresponding history/summary curve with or without H
|
||||||
|
|
||||||
|
const std::string historyIdentifier = "H";
|
||||||
|
|
||||||
|
std::string quantity;
|
||||||
|
|
||||||
|
if (steppingType == RimSummaryPlotSourceStepping::X_AXIS)
|
||||||
|
{
|
||||||
|
quantity = m_curveForSourceStepping->summaryAddressX().quantityName();
|
||||||
|
}
|
||||||
|
else if (steppingType == RimSummaryPlotSourceStepping::Y_AXIS)
|
||||||
|
{
|
||||||
|
quantity = m_curveForSourceStepping->summaryAddressY().quantityName();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string candidateName;
|
||||||
|
if (RiaStdStringTools::endsWith(quantity, historyIdentifier))
|
||||||
|
{
|
||||||
|
candidateName = quantity.substr(0, quantity.size() - 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
candidateName = quantity + historyIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto& c : curves())
|
||||||
|
{
|
||||||
|
if (steppingType == RimSummaryPlotSourceStepping::X_AXIS)
|
||||||
|
{
|
||||||
|
if (c->summaryCaseX() == m_curveForSourceStepping->summaryCaseX() &&
|
||||||
|
c->summaryAddressX().quantityName() == candidateName)
|
||||||
|
{
|
||||||
|
stepCurves.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (steppingType == RimSummaryPlotSourceStepping::Y_AXIS)
|
||||||
|
{
|
||||||
|
if (c->summaryCaseY() == m_curveForSourceStepping->summaryCaseY() &&
|
||||||
|
c->summaryAddressY().quantityName() == candidateName)
|
||||||
|
{
|
||||||
|
stepCurves.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stepCurves = curves();
|
||||||
|
}
|
||||||
|
|
||||||
|
return stepCurves;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -355,6 +422,22 @@ void RimSummaryCurveCollection::setCurveAsTopZWithinCategory(RimSummaryCurve* cu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCurveCollection::setCurveForSourceStepping(RimSummaryCurve* curve)
|
||||||
|
{
|
||||||
|
m_curveForSourceStepping = curve;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSummaryCurve* RimSummaryCurveCollection::curveForSourceStepping() const
|
||||||
|
{
|
||||||
|
return m_curveForSourceStepping;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "RimSummaryPlotSourceStepping.h"
|
||||||
|
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
#include "cafPdmChildField.h"
|
#include "cafPdmChildField.h"
|
||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
@ -29,7 +31,6 @@ class QwtPlot;
|
|||||||
class QwtPlotCurve;
|
class QwtPlotCurve;
|
||||||
class RimSummaryCase;
|
class RimSummaryCase;
|
||||||
class RimSummaryCurve;
|
class RimSummaryCurve;
|
||||||
class RimSummaryPlotSourceStepping;
|
|
||||||
class QKeyEvent;
|
class QKeyEvent;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@ -56,6 +57,7 @@ public:
|
|||||||
void deleteCurve(RimSummaryCurve* curve);
|
void deleteCurve(RimSummaryCurve* curve);
|
||||||
|
|
||||||
std::vector<RimSummaryCurve*> curves() const;
|
std::vector<RimSummaryCurve*> curves() const;
|
||||||
|
std::vector<RimSummaryCurve*> curvesForSourceStepping(RimSummaryPlotSourceStepping::SourceSteppingType steppingType) const;
|
||||||
|
|
||||||
void deleteCurvesAssosiatedWithCase(RimSummaryCase* summaryCase);
|
void deleteCurvesAssosiatedWithCase(RimSummaryCase* summaryCase);
|
||||||
void deleteAllCurves();
|
void deleteAllCurves();
|
||||||
@ -69,6 +71,9 @@ public:
|
|||||||
|
|
||||||
void setCurveAsTopZWithinCategory(RimSummaryCurve* curve);
|
void setCurveAsTopZWithinCategory(RimSummaryCurve* curve);
|
||||||
|
|
||||||
|
void setCurveForSourceStepping(RimSummaryCurve* curve);
|
||||||
|
RimSummaryCurve* curveForSourceStepping() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmFieldHandle* objectToggleField() override;
|
caf::PdmFieldHandle* objectToggleField() override;
|
||||||
void defineObjectEditorAttribute(QString uiConfigName,
|
void defineObjectEditorAttribute(QString uiConfigName,
|
||||||
@ -88,5 +93,6 @@ private:
|
|||||||
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_unionSourceStepping;
|
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_unionSourceStepping;
|
||||||
|
|
||||||
caf::PdmPointer<RimSummaryCurve> m_currentSummaryCurve;
|
caf::PdmPointer<RimSummaryCurve> m_currentSummaryCurve;
|
||||||
|
caf::PdmPointer<RimSummaryCurve> m_curveForSourceStepping;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -549,6 +549,22 @@ bool RimSummaryPlot::containsResamplableCurves() const
|
|||||||
return !m_gridTimeHistoryCurves.empty() || resamplableSummaryCurveCount > 0;
|
return !m_gridTimeHistoryCurves.empty() || resamplableSummaryCurveCount > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RimSummaryPlot::singleColorCurveCount() const
|
||||||
|
{
|
||||||
|
auto allCurveSets = ensembleCurveSetCollection()->curveSets();
|
||||||
|
size_t colorIndex = std::count_if(allCurveSets.begin(), allCurveSets.end(), [](RimEnsembleCurveSet* curveSet)
|
||||||
|
{
|
||||||
|
return curveSet->colorMode() == RimEnsembleCurveSet::SINGLE_COLOR;
|
||||||
|
});
|
||||||
|
|
||||||
|
colorIndex += curveCount();
|
||||||
|
|
||||||
|
return colorIndex;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -132,6 +132,8 @@ public:
|
|||||||
void updatePlotInfoLabel();
|
void updatePlotInfoLabel();
|
||||||
|
|
||||||
bool containsResamplableCurves() const;
|
bool containsResamplableCurves() const;
|
||||||
|
|
||||||
|
size_t singleColorCurveCount() const;
|
||||||
// RimViewWindow overrides
|
// RimViewWindow overrides
|
||||||
public:
|
public:
|
||||||
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include "RifSummaryReaderInterface.h"
|
#include "RifSummaryReaderInterface.h"
|
||||||
|
|
||||||
#include "RimDataSourceSteppingTools.h"
|
#include "RimDataSourceSteppingTools.h"
|
||||||
|
#include "RimEnsembleCurveSet.h"
|
||||||
|
#include "RimEnsembleCurveSetCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
#include "RimSummaryCaseMainCollection.h"
|
#include "RimSummaryCaseMainCollection.h"
|
||||||
@ -35,6 +37,7 @@
|
|||||||
|
|
||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
|
#include "RiaStdStringTools.h"
|
||||||
#include "cafPdmUiComboBoxEditor.h"
|
#include "cafPdmUiComboBoxEditor.h"
|
||||||
#include "cafPdmUiItem.h"
|
#include "cafPdmUiItem.h"
|
||||||
#include "cafPdmUiListEditor.h"
|
#include "cafPdmUiListEditor.h"
|
||||||
@ -51,11 +54,22 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
|||||||
CAF_PDM_InitObject("Summary Curves Modifier", "", "", "");
|
CAF_PDM_InitObject("Summary Curves Modifier", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_summaryCase, "CurveCase", "Case", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_summaryCase, "CurveCase", "Case", "", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_includeEnsembleCasesForCaseStepping,
|
||||||
|
"IncludeEnsembleCasesForCaseStepping",
|
||||||
|
false,
|
||||||
|
"Allow Stepping on Ensemble cases",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_wellName, "WellName", "Well Name", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_wellName, "WellName", "Well Name", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_wellGroupName, "GroupName", "Group Name", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_wellGroupName, "GroupName", "Group Name", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_region, "Region", "Region", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_region, "Region", "Region", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_quantity, "Quantities", "Quantity", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_quantity, "Quantities", "Quantity", "", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&m_ensemble, "Ensemble", "Ensemble", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_placeholderForLabel, "Placeholder", "", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_placeholderForLabel, "Placeholder", "", "", "", "");
|
||||||
m_placeholderForLabel = "No common identifiers detected";
|
m_placeholderForLabel = "No common identifiers detected";
|
||||||
m_placeholderForLabel.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
m_placeholderForLabel.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||||
@ -88,6 +102,22 @@ void RimSummaryPlotSourceStepping::applyPrevCase()
|
|||||||
modifyCurrentIndex(&m_summaryCase, -1);
|
modifyCurrentIndex(&m_summaryCase, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryPlotSourceStepping::applyNextEnsemble()
|
||||||
|
{
|
||||||
|
modifyCurrentIndex(&m_ensemble, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryPlotSourceStepping::applyPrevEnsemble()
|
||||||
|
{
|
||||||
|
modifyCurrentIndex(&m_ensemble, -1);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -162,85 +192,159 @@ void RimSummaryPlotSourceStepping::defineUiOrdering(QString uiConfigName, caf::P
|
|||||||
QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||||
bool* useOptionsOnly)
|
bool* useOptionsOnly)
|
||||||
{
|
{
|
||||||
if (fieldNeedingOptions == &m_placeholderForLabel)
|
QList<caf::PdmOptionItemInfo> options;
|
||||||
|
|
||||||
|
if (fieldNeedingOptions == &m_includeEnsembleCasesForCaseStepping)
|
||||||
{
|
{
|
||||||
return QList<caf::PdmOptionItemInfo>();
|
return caf::PdmObject::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
|
||||||
}
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_placeholderForLabel)
|
||||||
if (fieldNeedingOptions == &m_summaryCase)
|
|
||||||
{
|
{
|
||||||
QList<caf::PdmOptionItemInfo> options;
|
options;
|
||||||
|
}
|
||||||
RimProject* proj = RiaApplication::instance()->project();
|
else if (fieldNeedingOptions == &m_summaryCase)
|
||||||
for (auto sumCase : proj->allSummaryCases())
|
{
|
||||||
|
auto summaryCases = RimSummaryPlotSourceStepping::summaryCasesForSourceStepping();
|
||||||
|
for (auto sumCase : summaryCases)
|
||||||
{
|
{
|
||||||
options.append(caf::PdmOptionItemInfo(sumCase->caseName(), sumCase));
|
options.append(caf::PdmOptionItemInfo(sumCase->caseName(), sumCase));
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_ensemble)
|
||||||
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
for (auto ensemble : proj->summaryGroups())
|
||||||
|
{
|
||||||
|
if (ensemble->isEnsemble())
|
||||||
|
{
|
||||||
|
options.append(caf::PdmOptionItemInfo(ensemble->name(), ensemble));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<QString> identifierTexts;
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<RifSummaryReaderInterface*> readers = summaryReadersForCurves();
|
std::vector<RifSummaryReaderInterface*> readers = summaryReadersForCurves();
|
||||||
if (!readers.empty())
|
if (!readers.empty())
|
||||||
{
|
{
|
||||||
RiaSummaryCurveAnalyzer* analyzer = analyzerForReader(readers.front());
|
if (fieldNeedingOptions == &m_quantity)
|
||||||
|
|
||||||
if (fieldNeedingOptions == &m_wellName)
|
|
||||||
{
|
{
|
||||||
identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_WELL);
|
|
||||||
}
|
|
||||||
else if (fieldNeedingOptions == &m_region)
|
|
||||||
{
|
|
||||||
identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_REGION);
|
|
||||||
}
|
|
||||||
else if (fieldNeedingOptions == &m_wellGroupName)
|
|
||||||
{
|
|
||||||
identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_WELL_GROUP);
|
|
||||||
}
|
|
||||||
else if (fieldNeedingOptions == &m_quantity)
|
|
||||||
{
|
|
||||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
|
||||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
|
||||||
|
|
||||||
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_FIELD;
|
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_FIELD;
|
||||||
|
|
||||||
if (curveCollection->curves().size() > 0)
|
auto addresses = addressesCurveCollection();
|
||||||
|
if (!addresses.empty())
|
||||||
{
|
{
|
||||||
category = curveCollection->curves()[0]->summaryAddressY().category();
|
category = addresses.begin()->category();
|
||||||
}
|
}
|
||||||
|
|
||||||
RiaSummaryCurveAnalyzer quantityAnalyzer;
|
std::map<QString, QString> displayAndValueStrings;
|
||||||
|
|
||||||
for (auto reader : readers)
|
|
||||||
{
|
{
|
||||||
if (reader != nullptr)
|
RiaSummaryCurveAnalyzer quantityAnalyzer;
|
||||||
|
|
||||||
|
for (auto reader : readers)
|
||||||
{
|
{
|
||||||
auto subset = RiaSummaryCurveAnalyzer::addressesForCategory(reader->allResultAddresses(), category);
|
if (reader != nullptr)
|
||||||
quantityAnalyzer.appendAdresses(subset);
|
{
|
||||||
|
auto subset = RiaSummaryCurveAnalyzer::addressesForCategory(reader->allResultAddresses(), category);
|
||||||
|
quantityAnalyzer.appendAdresses(subset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RiaSummaryCurveAnalyzer analyzerForCurves;
|
||||||
|
analyzerForCurves.appendAdresses(addressesCurveCollection());
|
||||||
|
|
||||||
|
if (analyzerForCurves.quantityNamesWithHistory().empty())
|
||||||
|
{
|
||||||
|
auto quantities = quantityAnalyzer.quantities();
|
||||||
|
for (const auto& s : quantities)
|
||||||
|
{
|
||||||
|
QString valueString = QString::fromStdString(s);
|
||||||
|
|
||||||
|
displayAndValueStrings[valueString] = valueString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto quantitiesWithHistory = quantityAnalyzer.quantityNamesWithHistory();
|
||||||
|
for (const auto& s : quantitiesWithHistory)
|
||||||
|
{
|
||||||
|
QString valueString = QString::fromStdString(s);
|
||||||
|
QString displayString = valueString + " (H)";
|
||||||
|
|
||||||
|
displayAndValueStrings[displayString] = valueString;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto quantitiesNoHistory = quantityAnalyzer.quantityNamesNoHistory();
|
||||||
|
for (const auto& s : quantitiesNoHistory)
|
||||||
|
{
|
||||||
|
QString valueString = QString::fromStdString(s);
|
||||||
|
|
||||||
|
displayAndValueStrings[valueString] = valueString;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& quantity : quantityAnalyzer.quantities())
|
for (const auto& displayAndValue : displayAndValueStrings)
|
||||||
{
|
{
|
||||||
identifierTexts.push_back(QString::fromStdString(quantity));
|
options.append(caf::PdmOptionItemInfo(displayAndValue.first, displayAndValue.second));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.isEmpty())
|
||||||
|
{
|
||||||
|
options.push_back(caf::PdmOptionItemInfo("None", "None"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
|
||||||
QList<caf::PdmOptionItemInfo> options;
|
|
||||||
if (identifierTexts.size() > 0)
|
|
||||||
{
|
|
||||||
for (const auto& text : identifierTexts)
|
|
||||||
{
|
{
|
||||||
options.append(caf::PdmOptionItemInfo(text, text));
|
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||||
|
|
||||||
|
if (fieldNeedingOptions == &m_wellName)
|
||||||
|
{
|
||||||
|
category = RifEclipseSummaryAddress::SUMMARY_WELL;
|
||||||
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_region)
|
||||||
|
{
|
||||||
|
category = RifEclipseSummaryAddress::SUMMARY_REGION;
|
||||||
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_wellGroupName)
|
||||||
|
{
|
||||||
|
category = RifEclipseSummaryAddress::SUMMARY_WELL_GROUP;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::set<QString> identifierTexts;
|
||||||
|
|
||||||
|
if (category != RifEclipseSummaryAddress::SUMMARY_INVALID)
|
||||||
|
{
|
||||||
|
for (auto reader : readers)
|
||||||
|
{
|
||||||
|
auto analyzer = analyzerForReader(reader);
|
||||||
|
|
||||||
|
if (analyzer)
|
||||||
|
{
|
||||||
|
for (const auto& t : analyzer->identifierTexts(category))
|
||||||
|
{
|
||||||
|
identifierTexts.insert(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!identifierTexts.empty())
|
||||||
|
{
|
||||||
|
for (const auto& text : identifierTexts)
|
||||||
|
{
|
||||||
|
options.append(caf::PdmOptionItemInfo(text, text));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
options.push_back(caf::PdmOptionItemInfo("None", "None"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
options.push_back(caf::PdmOptionItemInfo("None", "None"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
@ -252,27 +356,90 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue)
|
const QVariant& newValue)
|
||||||
{
|
{
|
||||||
|
std::vector<RimSummaryCurve*> curves;
|
||||||
|
|
||||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
this->firstAncestorOrThisOfType(curveCollection);
|
||||||
|
if (curveCollection)
|
||||||
|
{
|
||||||
|
curves = curveCollection->curves();
|
||||||
|
}
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* ensembleCurveColl = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(ensembleCurveColl);
|
||||||
|
|
||||||
|
if (changedField == &m_includeEnsembleCasesForCaseStepping)
|
||||||
|
{
|
||||||
|
if (curveCollection)
|
||||||
|
{
|
||||||
|
curveCollection->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ensembleCurveColl)
|
||||||
|
{
|
||||||
|
ensembleCurveColl->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
|
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateMainPlotWindow();
|
||||||
|
bool forceUpdateOfFieldsInToolbar = true;
|
||||||
|
mainPlotWindow->updateSummaryPlotToolBar(forceUpdateOfFieldsInToolbar);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool triggerLoadDataAndUpdate = false;
|
bool triggerLoadDataAndUpdate = false;
|
||||||
|
|
||||||
|
std::string oldValueString = oldValue.toString().toStdString();
|
||||||
|
std::string newValueString = newValue.toString().toStdString();
|
||||||
|
|
||||||
if (changedField == &m_summaryCase)
|
if (changedField == &m_summaryCase)
|
||||||
{
|
{
|
||||||
if (m_summaryCase())
|
if (m_summaryCase())
|
||||||
{
|
{
|
||||||
for (auto curve : curveCollection->curves())
|
caf::PdmPointer<caf::PdmObjectHandle> variantHandle = oldValue.value<caf::PdmPointer<caf::PdmObjectHandle>>();
|
||||||
|
RimSummaryCase* previousCase = dynamic_cast<RimSummaryCase*>(variantHandle.p());
|
||||||
|
|
||||||
|
for (auto curve : curves)
|
||||||
{
|
{
|
||||||
if (isYAxisStepping())
|
if (isYAxisStepping())
|
||||||
{
|
{
|
||||||
bool doSetAppearance = curve->summaryCaseY()->isObservedData() != m_summaryCase->isObservedData();
|
if (previousCase == curve->summaryCaseY())
|
||||||
curve->setSummaryCaseY(m_summaryCase);
|
{
|
||||||
if (doSetAppearance) curve->forceUpdateCurveAppearanceFromCaseType();
|
bool doSetAppearance = curve->summaryCaseY()->isObservedData() != m_summaryCase->isObservedData();
|
||||||
|
curve->setSummaryCaseY(m_summaryCase);
|
||||||
|
if (doSetAppearance) curve->forceUpdateCurveAppearanceFromCaseType();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isXAxisStepping())
|
if (isXAxisStepping())
|
||||||
{
|
{
|
||||||
curve->setSummaryCaseX(m_summaryCase);
|
if (previousCase == curve->summaryCaseX())
|
||||||
|
{
|
||||||
|
curve->setSummaryCaseX(m_summaryCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerLoadDataAndUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_wellName.uiCapability()->updateConnectedEditors();
|
||||||
|
m_wellGroupName.uiCapability()->updateConnectedEditors();
|
||||||
|
m_region.uiCapability()->updateConnectedEditors();
|
||||||
|
m_quantity.uiCapability()->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
else if (changedField == &m_ensemble)
|
||||||
|
{
|
||||||
|
if (m_ensemble() && ensembleCurveColl)
|
||||||
|
{
|
||||||
|
caf::PdmPointer<caf::PdmObjectHandle> variantHandle = oldValue.value<caf::PdmPointer<caf::PdmObjectHandle>>();
|
||||||
|
RimSummaryCaseCollection* previousCollection = dynamic_cast<RimSummaryCaseCollection*>(variantHandle.p());
|
||||||
|
|
||||||
|
for (auto curveSet : ensembleCurveColl->curveSets())
|
||||||
|
{
|
||||||
|
if (curveSet->summaryCaseCollection() == previousCollection)
|
||||||
|
{
|
||||||
|
curveSet->setSummaryCaseCollection(m_ensemble);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,28 +453,30 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
}
|
}
|
||||||
else if (changedField == &m_wellName)
|
else if (changedField == &m_wellName)
|
||||||
{
|
{
|
||||||
for (auto curve : curveCollection->curves())
|
for (auto curve : curves)
|
||||||
{
|
{
|
||||||
if (isYAxisStepping())
|
if (isYAxisStepping())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||||
if (RifEclipseSummaryAddress::isDependentOnWellName(adr))
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_WELL, &adr);
|
||||||
{
|
curve->setSummaryAddressY(adr);
|
||||||
adr.setWellName(m_wellName().toStdString());
|
|
||||||
|
|
||||||
curve->setSummaryAddressY(adr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isXAxisStepping())
|
if (isXAxisStepping())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
||||||
if (RifEclipseSummaryAddress::isDependentOnWellName(adr))
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_WELL, &adr);
|
||||||
{
|
curve->setSummaryAddressX(adr);
|
||||||
adr.setWellName(m_wellName().toStdString());
|
}
|
||||||
|
}
|
||||||
|
|
||||||
curve->setSummaryAddressX(adr);
|
if (ensembleCurveColl)
|
||||||
}
|
{
|
||||||
|
for (auto curveSet : ensembleCurveColl->curveSets())
|
||||||
|
{
|
||||||
|
auto adr = curveSet->summaryAddress();
|
||||||
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_WELL, &adr);
|
||||||
|
curveSet->setSummaryAddress(adr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,28 +484,30 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
}
|
}
|
||||||
else if (changedField == &m_region)
|
else if (changedField == &m_region)
|
||||||
{
|
{
|
||||||
for (auto curve : curveCollection->curves())
|
for (auto curve : curves)
|
||||||
{
|
{
|
||||||
if (isYAxisStepping())
|
if (isYAxisStepping())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_REGION)
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_REGION, &adr);
|
||||||
{
|
curve->setSummaryAddressY(adr);
|
||||||
adr.setRegion(m_region());
|
|
||||||
|
|
||||||
curve->setSummaryAddressY(adr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isXAxisStepping())
|
if (isXAxisStepping())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
||||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_REGION)
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_REGION, &adr);
|
||||||
{
|
curve->setSummaryAddressX(adr);
|
||||||
adr.setRegion(m_region());
|
}
|
||||||
|
}
|
||||||
|
|
||||||
curve->setSummaryAddressX(adr);
|
if (ensembleCurveColl)
|
||||||
}
|
{
|
||||||
|
for (auto curveSet : ensembleCurveColl->curveSets())
|
||||||
|
{
|
||||||
|
auto adr = curveSet->summaryAddress();
|
||||||
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_REGION, &adr);
|
||||||
|
curveSet->setSummaryAddress(adr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,51 +515,61 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
}
|
}
|
||||||
else if (changedField == &m_quantity)
|
else if (changedField == &m_quantity)
|
||||||
{
|
{
|
||||||
for (auto curve : curveCollection->curves())
|
for (auto curve : curves)
|
||||||
{
|
{
|
||||||
if (isYAxisStepping())
|
if (isYAxisStepping())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
auto adr = curve->summaryAddressY();
|
||||||
adr.setQuantityName(m_quantity().toStdString());
|
updateHistoryAndSummaryQuantityIfMatching(oldValue, newValue, &adr);
|
||||||
|
|
||||||
curve->setSummaryAddressY(adr);
|
curve->setSummaryAddressY(adr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isXAxisStepping())
|
if (isXAxisStepping())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
auto adr = curve->summaryAddressX();
|
||||||
adr.setQuantityName(m_quantity().toStdString());
|
updateHistoryAndSummaryQuantityIfMatching(oldValue, newValue, &adr);
|
||||||
|
|
||||||
curve->setSummaryAddressX(adr);
|
curve->setSummaryAddressX(adr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ensembleCurveColl)
|
||||||
|
{
|
||||||
|
for (auto curveSet : ensembleCurveColl->curveSets())
|
||||||
|
{
|
||||||
|
auto adr = curveSet->summaryAddress();
|
||||||
|
updateHistoryAndSummaryQuantityIfMatching(oldValue, newValue, &adr);
|
||||||
|
curveSet->setSummaryAddress(adr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
triggerLoadDataAndUpdate = true;
|
triggerLoadDataAndUpdate = true;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_wellGroupName)
|
else if (changedField == &m_wellGroupName)
|
||||||
{
|
{
|
||||||
for (auto curve : curveCollection->curves())
|
for (auto curve : curves)
|
||||||
{
|
{
|
||||||
if (isYAxisStepping())
|
if (isYAxisStepping())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_WELL_GROUP, &adr);
|
||||||
{
|
curve->setSummaryAddressY(adr);
|
||||||
adr.setWellGroupName(m_wellGroupName().toStdString());
|
|
||||||
|
|
||||||
curve->setSummaryAddressY(adr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isXAxisStepping())
|
if (isXAxisStepping())
|
||||||
{
|
{
|
||||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
||||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_WELL_GROUP, &adr);
|
||||||
{
|
curve->setSummaryAddressX(adr);
|
||||||
adr.setWellGroupName(m_wellGroupName().toStdString());
|
}
|
||||||
|
}
|
||||||
|
|
||||||
curve->setSummaryAddressX(adr);
|
if (ensembleCurveColl)
|
||||||
}
|
{
|
||||||
|
for (auto curveSet : ensembleCurveColl->curveSets())
|
||||||
|
{
|
||||||
|
auto adr = curveSet->summaryAddress();
|
||||||
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_WELL_GROUP, &adr);
|
||||||
|
curveSet->setSummaryAddress(adr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,12 +584,20 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
summaryPlot->updatePlotTitle();
|
summaryPlot->updatePlotTitle();
|
||||||
summaryPlot->loadDataAndUpdate();
|
summaryPlot->loadDataAndUpdate();
|
||||||
|
|
||||||
|
if (ensembleCurveColl)
|
||||||
|
{
|
||||||
|
ensembleCurveColl->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
RimSummaryCrossPlot* summaryCrossPlot = dynamic_cast<RimSummaryCrossPlot*>(summaryPlot);
|
RimSummaryCrossPlot* summaryCrossPlot = dynamic_cast<RimSummaryCrossPlot*>(summaryPlot);
|
||||||
if (summaryCrossPlot)
|
if (summaryCrossPlot)
|
||||||
{
|
{
|
||||||
// Trigger update of curve collection (and summary toolbar in main window), as the visibility of combo boxes might
|
// Trigger update of curve collection (and summary toolbar in main window), as the visibility of combo boxes might
|
||||||
// have been changed due to the updates in this function
|
// have been changed due to the updates in this function
|
||||||
curveCollection->updateConnectedEditors();
|
if (curveCollection)
|
||||||
|
{
|
||||||
|
curveCollection->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||||
mainPlotWindow->updateSummaryPlotToolBar();
|
mainPlotWindow->updateSummaryPlotToolBar();
|
||||||
@ -423,18 +612,38 @@ std::vector<RifSummaryReaderInterface*> RimSummaryPlotSourceStepping::summaryRea
|
|||||||
{
|
{
|
||||||
std::vector<RifSummaryReaderInterface*> readers;
|
std::vector<RifSummaryReaderInterface*> readers;
|
||||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
this->firstAncestorOrThisOfType(curveCollection);
|
||||||
|
|
||||||
for (auto curve : curveCollection->curves())
|
if (curveCollection)
|
||||||
{
|
{
|
||||||
if (isYAxisStepping() && curve->summaryCaseY())
|
for (auto curve : curveCollection->curves())
|
||||||
{
|
{
|
||||||
readers.push_back(curve->summaryCaseY()->summaryReader());
|
if (isYAxisStepping() && curve->summaryCaseY())
|
||||||
}
|
{
|
||||||
|
readers.push_back(curve->summaryCaseY()->summaryReader());
|
||||||
|
}
|
||||||
|
|
||||||
if (isXAxisStepping() && curve->summaryCaseX())
|
if (isXAxisStepping() && curve->summaryCaseX())
|
||||||
|
{
|
||||||
|
readers.push_back(curve->summaryCaseX()->summaryReader());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* ensembleCollection = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(ensembleCollection);
|
||||||
|
if (ensembleCollection)
|
||||||
|
{
|
||||||
|
auto curveSets = ensembleCollection->curveSets();
|
||||||
|
for (const RimEnsembleCurveSet* curveSet : curveSets)
|
||||||
{
|
{
|
||||||
readers.push_back(curve->summaryCaseX()->summaryReader());
|
for (auto curve : curveSet->curves())
|
||||||
|
{
|
||||||
|
if (isYAxisStepping() && curve->summaryCaseY())
|
||||||
|
{
|
||||||
|
readers.push_back(curve->summaryCaseY()->summaryReader());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,19 +686,31 @@ std::set<RifEclipseSummaryAddress> RimSummaryPlotSourceStepping::addressesCurveC
|
|||||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||||
this->firstAncestorOrThisOfType(curveCollection);
|
this->firstAncestorOrThisOfType(curveCollection);
|
||||||
|
|
||||||
if (!curveCollection) return addresses;
|
if (curveCollection)
|
||||||
|
|
||||||
auto curves = curveCollection->curves();
|
|
||||||
for (auto c : curves)
|
|
||||||
{
|
{
|
||||||
if (isYAxisStepping())
|
auto curves = curveCollection->curvesForSourceStepping(m_sourceSteppingType);
|
||||||
|
for (auto c : curves)
|
||||||
{
|
{
|
||||||
addresses.insert(c->summaryAddressY());
|
if (isYAxisStepping())
|
||||||
}
|
{
|
||||||
|
addresses.insert(c->summaryAddressY());
|
||||||
|
}
|
||||||
|
|
||||||
if (isXAxisStepping())
|
if (isXAxisStepping())
|
||||||
|
{
|
||||||
|
addresses.insert(c->summaryAddressX());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* ensembleCollection = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(ensembleCollection);
|
||||||
|
if (ensembleCollection)
|
||||||
|
{
|
||||||
|
auto curveSets = ensembleCollection->curveSetsForSourceStepping();
|
||||||
|
for (const RimEnsembleCurveSet* curveSet : curveSets)
|
||||||
{
|
{
|
||||||
addresses.insert(c->summaryAddressX());
|
addresses.insert(curveSet->summaryAddress());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,7 +729,7 @@ std::set<RimSummaryCase*> RimSummaryPlotSourceStepping::summaryCasesCurveCollect
|
|||||||
|
|
||||||
if (!curveCollection) return sumCases;
|
if (!curveCollection) return sumCases;
|
||||||
|
|
||||||
auto curves = curveCollection->curves();
|
auto curves = curveCollection->curvesForSourceStepping(m_sourceSteppingType);
|
||||||
for (auto c : curves)
|
for (auto c : curves)
|
||||||
{
|
{
|
||||||
if (isYAxisStepping())
|
if (isYAxisStepping())
|
||||||
@ -531,10 +752,12 @@ std::set<RimSummaryCase*> RimSummaryPlotSourceStepping::summaryCasesCurveCollect
|
|||||||
std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFieldsAndSetFieldVisibility()
|
std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFieldsAndSetFieldVisibility()
|
||||||
{
|
{
|
||||||
m_summaryCase.uiCapability()->setUiHidden(true);
|
m_summaryCase.uiCapability()->setUiHidden(true);
|
||||||
|
m_includeEnsembleCasesForCaseStepping.uiCapability()->setUiHidden(true);
|
||||||
m_wellName.uiCapability()->setUiHidden(true);
|
m_wellName.uiCapability()->setUiHidden(true);
|
||||||
m_wellGroupName.uiCapability()->setUiHidden(true);
|
m_wellGroupName.uiCapability()->setUiHidden(true);
|
||||||
m_region.uiCapability()->setUiHidden(true);
|
m_region.uiCapability()->setUiHidden(true);
|
||||||
m_quantity.uiCapability()->setUiHidden(true);
|
m_quantity.uiCapability()->setUiHidden(true);
|
||||||
|
m_ensemble.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
std::vector<caf::PdmFieldHandle*> fields;
|
std::vector<caf::PdmFieldHandle*> fields;
|
||||||
|
|
||||||
@ -549,61 +772,108 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
|||||||
m_summaryCase.uiCapability()->setUiHidden(false);
|
m_summaryCase.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
fields.push_back(&m_summaryCase);
|
fields.push_back(&m_summaryCase);
|
||||||
|
|
||||||
|
m_includeEnsembleCasesForCaseStepping.uiCapability()->setUiHidden(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RiaSummaryCurveAnalyzer analyzer;
|
auto ensembleColl = ensembleCollection();
|
||||||
analyzer.appendAdresses(addressesCurveCollection());
|
if (ensembleColl.size() == 1)
|
||||||
|
|
||||||
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
|
||||||
{
|
{
|
||||||
if (analyzer.categories().size() == 1)
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
|
||||||
|
if (proj->summaryGroups().size() > 1)
|
||||||
{
|
{
|
||||||
category = *(analyzer.categories().begin());
|
m_ensemble = *(ensembleColl.begin());
|
||||||
|
|
||||||
|
m_ensemble.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
|
fields.push_back(&m_ensemble);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (category != RifEclipseSummaryAddress::SUMMARY_INVALID)
|
std::vector<caf::PdmFieldHandle*> fieldsCommonForAllCurves;
|
||||||
|
|
||||||
{
|
{
|
||||||
if (analyzer.wellNames().size() == 1)
|
RiaSummaryCurveAnalyzer analyzer;
|
||||||
{
|
analyzer.appendAdresses(addressesCurveCollection());
|
||||||
QString txt = QString::fromStdString(*(analyzer.wellNames().begin()));
|
|
||||||
m_wellName = txt;
|
|
||||||
m_wellName.uiCapability()->setUiHidden(false);
|
|
||||||
|
|
||||||
fields.push_back(&m_wellName);
|
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||||
|
{
|
||||||
|
if (analyzer.categories().size() == 1)
|
||||||
|
{
|
||||||
|
category = *(analyzer.categories().begin());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analyzer.wellGroupNames().size() == 1)
|
if (category != RifEclipseSummaryAddress::SUMMARY_INVALID)
|
||||||
{
|
{
|
||||||
QString txt = QString::fromStdString(*(analyzer.wellGroupNames().begin()));
|
if (analyzer.wellNames().size() == 1)
|
||||||
m_wellGroupName = txt;
|
{
|
||||||
m_wellGroupName.uiCapability()->setUiHidden(false);
|
QString txt = QString::fromStdString(*(analyzer.wellNames().begin()));
|
||||||
|
m_wellName = txt;
|
||||||
|
m_wellName.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
fields.push_back(&m_wellGroupName);
|
fieldsCommonForAllCurves.push_back(&m_wellName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (analyzer.wellGroupNames().size() == 1)
|
||||||
|
{
|
||||||
|
QString txt = QString::fromStdString(*(analyzer.wellGroupNames().begin()));
|
||||||
|
m_wellGroupName = txt;
|
||||||
|
m_wellGroupName.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
|
fieldsCommonForAllCurves.push_back(&m_wellGroupName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (analyzer.regionNumbers().size() == 1)
|
||||||
|
{
|
||||||
|
m_region = *(analyzer.regionNumbers().begin());
|
||||||
|
m_region.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
|
fieldsCommonForAllCurves.push_back(&m_region);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!analyzer.quantityNameForTitle().empty())
|
||||||
|
{
|
||||||
|
QString txt = QString::fromStdString(analyzer.quantityNameForTitle());
|
||||||
|
m_quantity = txt;
|
||||||
|
m_quantity.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
|
fieldsCommonForAllCurves.push_back(&m_quantity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (analyzer.regionNumbers().size() == 1)
|
for (const auto& f : fieldsCommonForAllCurves)
|
||||||
{
|
{
|
||||||
m_region = *(analyzer.regionNumbers().begin());
|
fields.push_back(f);
|
||||||
m_region.uiCapability()->setUiHidden(false);
|
|
||||||
|
|
||||||
fields.push_back(&m_region);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (analyzer.quantities().size() == 1)
|
|
||||||
{
|
|
||||||
QString txt = QString::fromStdString(*(analyzer.quantities().begin()));
|
|
||||||
m_quantity = txt;
|
|
||||||
m_quantity.uiCapability()->setUiHidden(false);
|
|
||||||
|
|
||||||
fields.push_back(&m_quantity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::set<RimSummaryCaseCollection*> RimSummaryPlotSourceStepping::ensembleCollection() const
|
||||||
|
{
|
||||||
|
std::set<RimSummaryCaseCollection*> sumCases;
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* curveCollection = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(curveCollection);
|
||||||
|
|
||||||
|
if (!curveCollection) return sumCases;
|
||||||
|
|
||||||
|
auto curves = curveCollection->curveSets();
|
||||||
|
for (auto c : curves)
|
||||||
|
{
|
||||||
|
sumCases.insert(c->summaryCaseCollection());
|
||||||
|
}
|
||||||
|
|
||||||
|
return sumCases;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -656,6 +926,119 @@ void RimSummaryPlotSourceStepping::modifyCurrentIndex(caf::PdmValueField* valueF
|
|||||||
RimDataSourceSteppingTools::modifyCurrentIndex(valueField, options, indexOffset);
|
RimDataSourceSteppingTools::modifyCurrentIndex(valueField, options, indexOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimSummaryPlotSourceStepping::updateAddressIfMatching(const QVariant& oldValue,
|
||||||
|
const QVariant& newValue,
|
||||||
|
RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||||
|
RifEclipseSummaryAddress* adr)
|
||||||
|
{
|
||||||
|
if (!adr) return false;
|
||||||
|
|
||||||
|
if (category == RifEclipseSummaryAddress::SUMMARY_REGION)
|
||||||
|
{
|
||||||
|
int oldInt = oldValue.toInt();
|
||||||
|
int newInt = newValue.toInt();
|
||||||
|
|
||||||
|
if (adr->regionNumber() == oldInt)
|
||||||
|
{
|
||||||
|
adr->setRegion(newInt);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
||||||
|
{
|
||||||
|
std::string oldString = oldValue.toString().toStdString();
|
||||||
|
std::string newString = newValue.toString().toStdString();
|
||||||
|
|
||||||
|
if (adr->wellGroupName() == oldString)
|
||||||
|
{
|
||||||
|
adr->setWellGroupName(newString);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (RifEclipseSummaryAddress::isDependentOnWellName(category))
|
||||||
|
{
|
||||||
|
std::string oldString = oldValue.toString().toStdString();
|
||||||
|
std::string newString = newValue.toString().toStdString();
|
||||||
|
|
||||||
|
if (adr->wellName() == oldString)
|
||||||
|
{
|
||||||
|
adr->setWellName(newString);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimSummaryPlotSourceStepping::updateHistoryAndSummaryQuantityIfMatching(const QVariant& oldValue,
|
||||||
|
const QVariant& newValue,
|
||||||
|
RifEclipseSummaryAddress* adr)
|
||||||
|
{
|
||||||
|
if (!adr) return false;
|
||||||
|
|
||||||
|
std::string oldString = oldValue.toString().toStdString();
|
||||||
|
std::string newString = newValue.toString().toStdString();
|
||||||
|
|
||||||
|
if (adr->quantityName() == oldString)
|
||||||
|
{
|
||||||
|
adr->setQuantityName(newString);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string correspondingOldString = RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName(oldString);
|
||||||
|
std::string correspondingNewString = RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName(newString);
|
||||||
|
|
||||||
|
if (adr->quantityName() == correspondingOldString)
|
||||||
|
{
|
||||||
|
adr->setQuantityName(correspondingNewString);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RimSummaryCase*> RimSummaryPlotSourceStepping::summaryCasesForSourceStepping()
|
||||||
|
{
|
||||||
|
std::vector<RimSummaryCase*> cases;
|
||||||
|
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
for (auto sumCase : proj->allSummaryCases())
|
||||||
|
{
|
||||||
|
if (sumCase->isObservedData()) continue;
|
||||||
|
|
||||||
|
RimSummaryCaseCollection* sumCaseColl = nullptr;
|
||||||
|
sumCase->firstAncestorOrThisOfType(sumCaseColl);
|
||||||
|
|
||||||
|
if (sumCaseColl && sumCaseColl->isEnsemble())
|
||||||
|
{
|
||||||
|
if (m_includeEnsembleCasesForCaseStepping())
|
||||||
|
{
|
||||||
|
cases.push_back(sumCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cases.push_back(sumCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cases;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -31,7 +31,9 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
class RimSummaryCase;
|
class RimSummaryCase;
|
||||||
|
class RimSummaryCurve;
|
||||||
class RifSummaryReaderInterface;
|
class RifSummaryReaderInterface;
|
||||||
|
class RimSummaryCaseCollection;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -56,6 +58,9 @@ public:
|
|||||||
void applyNextCase();
|
void applyNextCase();
|
||||||
void applyPrevCase();
|
void applyPrevCase();
|
||||||
|
|
||||||
|
void applyNextEnsemble();
|
||||||
|
void applyPrevEnsemble();
|
||||||
|
|
||||||
void applyNextQuantity();
|
void applyNextQuantity();
|
||||||
void applyPrevQuantity();
|
void applyPrevQuantity();
|
||||||
|
|
||||||
@ -83,6 +88,7 @@ private:
|
|||||||
std::set<RifEclipseSummaryAddress> addressesCurveCollection() const;
|
std::set<RifEclipseSummaryAddress> addressesCurveCollection() const;
|
||||||
std::set<RimSummaryCase*> summaryCasesCurveCollection() const;
|
std::set<RimSummaryCase*> summaryCasesCurveCollection() const;
|
||||||
std::vector<caf::PdmFieldHandle*> computeVisibleFieldsAndSetFieldVisibility();
|
std::vector<caf::PdmFieldHandle*> computeVisibleFieldsAndSetFieldVisibility();
|
||||||
|
std::set<RimSummaryCaseCollection*> ensembleCollection() const;
|
||||||
|
|
||||||
bool isXAxisStepping() const;
|
bool isXAxisStepping() const;
|
||||||
bool isYAxisStepping() const;
|
bool isYAxisStepping() const;
|
||||||
@ -91,13 +97,29 @@ private:
|
|||||||
|
|
||||||
void modifyCurrentIndex(caf::PdmValueField* valueField, int indexOffset);
|
void modifyCurrentIndex(caf::PdmValueField* valueField, int indexOffset);
|
||||||
|
|
||||||
|
static bool updateAddressIfMatching(const QVariant& oldValue,
|
||||||
|
const QVariant& newValue,
|
||||||
|
RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||||
|
RifEclipseSummaryAddress* adr);
|
||||||
|
|
||||||
|
static bool updateHistoryAndSummaryQuantityIfMatching(const QVariant& oldValue,
|
||||||
|
const QVariant& newValue,
|
||||||
|
RifEclipseSummaryAddress* adr);
|
||||||
|
|
||||||
|
std::vector<RimSummaryCase*> summaryCasesForSourceStepping();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
|
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
|
||||||
|
caf::PdmPtrField<RimSummaryCaseCollection*> m_ensemble;
|
||||||
|
|
||||||
caf::PdmField<QString> m_wellName;
|
caf::PdmField<QString> m_wellName;
|
||||||
caf::PdmField<QString> m_wellGroupName;
|
caf::PdmField<QString> m_wellGroupName;
|
||||||
caf::PdmField<int> m_region;
|
caf::PdmField<int> m_region;
|
||||||
caf::PdmField<QString> m_quantity;
|
caf::PdmField<QString> m_quantity;
|
||||||
caf::PdmField<QString> m_placeholderForLabel;
|
caf::PdmField<QString> m_placeholderForLabel;
|
||||||
|
|
||||||
|
caf::PdmField<bool> m_includeEnsembleCasesForCaseStepping;
|
||||||
|
|
||||||
SourceSteppingType m_sourceSteppingType;
|
SourceSteppingType m_sourceSteppingType;
|
||||||
|
|
||||||
std::pair<RifSummaryReaderInterface*, RiaSummaryCurveAnalyzer> m_curveAnalyzerForReader;
|
std::pair<RifSummaryReaderInterface*, RiaSummaryCurveAnalyzer> m_curveAnalyzerForReader;
|
||||||
|
@ -140,6 +140,8 @@
|
|||||||
<file>ToggleOnOff16x16.png</file>
|
<file>ToggleOnOff16x16.png</file>
|
||||||
<file>ToggleOnOthersOff16x16.png</file>
|
<file>ToggleOnOthersOff16x16.png</file>
|
||||||
<file>ExportCompletionsSymbol16x16.png</file>
|
<file>ExportCompletionsSymbol16x16.png</file>
|
||||||
|
<file>StepUpDown16x16.png</file>
|
||||||
|
<file>StepUpDownCorner16x16.png</file>
|
||||||
<file>TextAnnotation16x16.png</file>
|
<file>TextAnnotation16x16.png</file>
|
||||||
<file>Annotations16x16.png</file>
|
<file>Annotations16x16.png</file>
|
||||||
<file>PolylinesFromFile16x16.png</file>
|
<file>PolylinesFromFile16x16.png</file>
|
||||||
|
BIN
ApplicationCode/Resources/StepUpDown16x16.png
Normal file
BIN
ApplicationCode/Resources/StepUpDown16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
ApplicationCode/Resources/StepUpDownCorner16x16.png
Normal file
BIN
ApplicationCode/Resources/StepUpDownCorner16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -22,6 +22,7 @@
|
|||||||
#include "RiaBaseDefs.h"
|
#include "RiaBaseDefs.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
|
|
||||||
|
#include "RimEnsembleCurveSetCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCurveCollection.h"
|
#include "RimSummaryCurveCollection.h"
|
||||||
#include "RimSummaryPlot.h"
|
#include "RimSummaryPlot.h"
|
||||||
@ -43,6 +44,7 @@
|
|||||||
#include "cafPdmUiToolBarEditor.h"
|
#include "cafPdmUiToolBarEditor.h"
|
||||||
#include "cafPdmUiTreeView.h"
|
#include "cafPdmUiTreeView.h"
|
||||||
#include "cafQTreeViewStateSerializer.h"
|
#include "cafQTreeViewStateSerializer.h"
|
||||||
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
@ -494,18 +496,39 @@ void RiuPlotMainWindow::updateWellLogPlotToolBar()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuPlotMainWindow::updateSummaryPlotToolBar()
|
void RiuPlotMainWindow::updateSummaryPlotToolBar(bool forceUpdateUi)
|
||||||
{
|
{
|
||||||
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(m_activePlotViewWindow.p());
|
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(m_activePlotViewWindow.p());
|
||||||
if (summaryPlot)
|
if (summaryPlot)
|
||||||
{
|
{
|
||||||
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
||||||
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
|
||||||
|
RimEnsembleCurveSetCollection* ensembleCurveSetColl = nullptr;
|
||||||
|
|
||||||
|
caf::PdmObjectHandle* selectedObj =
|
||||||
|
dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||||
|
if (selectedObj)
|
||||||
|
{
|
||||||
|
selectedObj->firstAncestorOrThisOfType(ensembleCurveSetColl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ensembleCurveSetColl)
|
||||||
|
{
|
||||||
|
toolBarFields = ensembleCurveSetColl->fieldsToShowInToolbar();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_summaryPlotToolBarEditor->isEditorDataValid(toolBarFields))
|
if (!m_summaryPlotToolBarEditor->isEditorDataValid(toolBarFields))
|
||||||
{
|
{
|
||||||
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
||||||
}
|
}
|
||||||
|
else if (forceUpdateUi)
|
||||||
|
{
|
||||||
|
m_summaryPlotToolBarEditor->updateUi();
|
||||||
|
}
|
||||||
|
|
||||||
m_summaryPlotToolBarEditor->updateUi();
|
m_summaryPlotToolBarEditor->updateUi();
|
||||||
|
|
||||||
@ -694,6 +717,16 @@ void RiuPlotMainWindow::selectedObjectsChanged()
|
|||||||
|
|
||||||
m_pdmUiPropertyView->showProperties(firstSelectedObject);
|
m_pdmUiPropertyView->showProperties(firstSelectedObject);
|
||||||
|
|
||||||
|
if (firstSelectedObject)
|
||||||
|
{
|
||||||
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
|
firstSelectedObject->firstAncestorOrThisOfType(summaryPlot);
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
updateSummaryPlotToolBar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (uiItems.size() == 1 && m_allowActiveViewChangeFromSelection)
|
if (uiItems.size() == 1 && m_allowActiveViewChangeFromSelection)
|
||||||
{
|
{
|
||||||
// Find the reservoir view or the Plot that the selected item is within
|
// Find the reservoir view or the Plot that the selected item is within
|
||||||
|
@ -81,7 +81,7 @@ public:
|
|||||||
void addToTemporaryWidgets(QWidget* widget);
|
void addToTemporaryWidgets(QWidget* widget);
|
||||||
|
|
||||||
void updateWellLogPlotToolBar();
|
void updateWellLogPlotToolBar();
|
||||||
void updateSummaryPlotToolBar();
|
void updateSummaryPlotToolBar(bool forceUpdateUi = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent* event) override;
|
void closeEvent(QCloseEvent* event) override;
|
||||||
|
@ -54,6 +54,120 @@ namespace caf
|
|||||||
|
|
||||||
CAF_PDM_UI_FIELD_EDITOR_SOURCE_INIT(PdmUiComboBoxEditor);
|
CAF_PDM_UI_FIELD_EDITOR_SOURCE_INIT(PdmUiComboBoxEditor);
|
||||||
|
|
||||||
|
|
||||||
|
/* GIMP RGBA C-Source image dump (StepDown.c) */
|
||||||
|
|
||||||
|
static const struct {
|
||||||
|
unsigned int width;
|
||||||
|
unsigned int height;
|
||||||
|
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
|
||||||
|
unsigned char pixel_data[16 * 16 * 4 + 1];
|
||||||
|
} stepDownImageData = {
|
||||||
|
16, 16, 4,
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000AAA\001\030\030\030\001"
|
||||||
|
"\037\037\037\001\020\020\020\001\004\004\004\001\016\016\016\001!!!\001\"\"\"\001(((\001\060\060\060\001$$"
|
||||||
|
"$\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000UUU\014FFF\242\030\030\030\256\037\037\037\256"
|
||||||
|
"\022\022\022\256\005\005\005\256\021\021\021\256'''\256...\256\061\061\061\256\067\067\067"
|
||||||
|
"\256&&&\256AAAzTTT\010\000\000\000\000\000\000\000\000xxx\014```\273\033\033\033\377&&&\377\""
|
||||||
|
"\"\"\377\017\017\017\377\"\"\"\377LLL\377___\377^^^\377^^^\377AAA\376OOOXTT"
|
||||||
|
"T\001\000\000\000\000\000\000\000\000\000\000\000\000JJJ\071+++\343&&&\377%%%\377\017\017\017\377'''\377"
|
||||||
|
"WWW\377]]]\377hhh\377WWW\376NNN\300\177\177\177\032\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000KKK\004\066\066\066z\040\040\040\370\"\"\"\377\014\014\014\377$$$\377SSS\377"
|
||||||
|
"ccc\377bbb\377NNN\362\202\202\202=\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\064\064\064\040===\312\032\032\032\375\017\017\017\377$$$\377WWW\377bbb"
|
||||||
|
"\377MMM\374LLL\200iii\006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000W"
|
||||||
|
"WW\001AAA\063###\330\007\007\007\377(((\377VVV\377UUU\377WWW\314\217\217\217\040\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000;;;\001\066\066"
|
||||||
|
"\066}\027\027\027\371(((\377TTT\377FFF\360\\\\\\C\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000TTT\015\025\025\025\036\040\040\040!<<<<???\360\"\"\""
|
||||||
|
"\377===\377ddd\266GGG\062\026\026\026\061\040\040\040\066\"\"\"\022\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000HHH\015\071\071\071\256\007\007\007\314\015\015\015\316\024\024\024\326\034\034\034"
|
||||||
|
"\374\022\022\022\377!!!\377###\335###\326\035\035\035\336\032\032\032\343///\220A"
|
||||||
|
"AA\010\000\000\000\000\000\000\000\000bbb\014QQQ\264%%%\355$$$\363\035\035\035\352\034\034\034\351"
|
||||||
|
"&&&\353$$$\344)))\346\061\061\061\345\066\066\066\350\062\062\062\335\064\064\064\201"
|
||||||
|
"???\007\000\000\000\000\000\000\000\000\000\000\000\000SSS\023@@@?\070\070\070E---=,,,<///>\"\"\"\067&&"
|
||||||
|
"&\070$$$\070---:CCC\060;;;\015\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000",
|
||||||
|
};
|
||||||
|
|
||||||
|
QIcon createStepDownIcon()
|
||||||
|
{
|
||||||
|
QImage img(stepDownImageData.pixel_data,stepDownImageData.width, stepDownImageData.height, QImage::Format_ARGB32 );
|
||||||
|
QPixmap pxMap;
|
||||||
|
pxMap = QPixmap::fromImage(img);
|
||||||
|
|
||||||
|
return QIcon(pxMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const QIcon& stepDownIcon()
|
||||||
|
{
|
||||||
|
static QIcon expandDownIcon(createStepDownIcon());
|
||||||
|
return expandDownIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* GIMP RGBA C-Source image dump (StepUp.c) */
|
||||||
|
|
||||||
|
static const struct {
|
||||||
|
unsigned int width;
|
||||||
|
unsigned int height;
|
||||||
|
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
|
||||||
|
unsigned char pixel_data[16 * 16 * 4 + 1];
|
||||||
|
} stepUpImageData = {
|
||||||
|
16, 16, 4,
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000;;;\015CCC\060---:"
|
||||||
|
"$$$\070&&&\070\"\"\"\067///>,,,<---=\070\070\070E@@@?SSS\023\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000???\007\064\064\064\201\062\062\062\335\066\066\066\350\061\061\061\345)))\346$$$\344"
|
||||||
|
"&&&\353\034\034\034\351\035\035\035\352$$$\363%%%\355QQQ\264bbb\014\000\000\000\000\000\000"
|
||||||
|
"\000\000AAA\010///\220\032\032\032\343\035\035\035\336###\326###\335!!!\377\022\022\022"
|
||||||
|
"\377\034\034\034\374\024\024\024\326\015\015\015\316\007\007\007\314\071\071\071\256HHH\015"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\"\"\"\022\040\040\040\066\026\026\026\061GGG\062ddd\266=="
|
||||||
|
"=\377\"\"\"\377???\360<<<<\040\040\040!\025\025\025\036TTT\015\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\\\\\\CFFF\360TTT\377(((\377\027\027"
|
||||||
|
"\027\371\066\066\066};;;\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\217\217\217\040WWW\314UUU\377VVV\377(((\377\007\007\007\377###\330"
|
||||||
|
"AAA\063WWW\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000iii\006LLL\200M"
|
||||||
|
"MM\374bbb\377WWW\377$$$\377\017\017\017\377\032\032\032\375===\312\064\064\064\040"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\202\202\202=NNN\362bbb\377"
|
||||||
|
"ccc\377SSS\377$$$\377\014\014\014\377\"\"\"\377\040\040\040\370\066\066\066zKKK\004"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\177\177\177\032NNN\300WWW\376hhh\377]]]\377"
|
||||||
|
"WWW\377'''\377\017\017\017\377%%%\377&&&\377+++\343JJJ\071\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000TTT\001OOOXAAA\376^^^\377^^^\377___\377LLL\377\"\"\"\377\017\017\017\377"
|
||||||
|
"\"\"\"\377&&&\377\033\033\033\377```\273xxx\014\000\000\000\000\000\000\000\000TTT\010AAAz&&&"
|
||||||
|
"\256\067\067\067\256\061\061\061\256...\256'''\256\021\021\021\256\005\005\005\256\022\022"
|
||||||
|
"\022\256\037\037\037\256\030\030\030\256FFF\242UUU\014\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000$$$\001\060\060\060\001(((\001\"\"\"\001!!!\001\016\016\016\001\004\004\004\001\020\020\020\001\037"
|
||||||
|
"\037\037\001\030\030\030\001AAA\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
"\000\000\000\000",
|
||||||
|
};
|
||||||
|
|
||||||
|
QIcon createStepUpIcon()
|
||||||
|
{
|
||||||
|
QImage img(stepUpImageData.pixel_data,stepUpImageData.width, stepUpImageData.height, QImage::Format_ARGB32 );
|
||||||
|
QPixmap pxMap;
|
||||||
|
pxMap = QPixmap::fromImage(img);
|
||||||
|
|
||||||
|
return QIcon(pxMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const QIcon& stepUpIcon()
|
||||||
|
{
|
||||||
|
static QIcon stepUpIcon(createStepUpIcon());
|
||||||
|
return stepUpIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -129,22 +243,22 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
|
|||||||
|
|
||||||
if (m_comboBox->count() == 0 || m_comboBox->currentIndex() <= 0)
|
if (m_comboBox->count() == 0 || m_comboBox->currentIndex() <= 0)
|
||||||
{
|
{
|
||||||
QIcon disabledIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowUp).pixmap(16, 16, QIcon::Disabled));
|
QIcon disabledIcon(stepUpIcon().pixmap(16, 16, QIcon::Disabled));
|
||||||
m_previousItemButton->setIcon(disabledIcon);
|
m_previousItemButton->setIcon(disabledIcon);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_previousItemButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowUp));
|
m_previousItemButton->setIcon(stepUpIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_comboBox->count() == 0 || m_comboBox->currentIndex() >= m_comboBox->count() - 1)
|
if (m_comboBox->count() == 0 || m_comboBox->currentIndex() >= m_comboBox->count() - 1)
|
||||||
{
|
{
|
||||||
QIcon disabledIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowDown).pixmap(16, 16, QIcon::Disabled));
|
QIcon disabledIcon(stepDownIcon().pixmap(16, 16, QIcon::Disabled));
|
||||||
m_nextItemButton->setIcon(disabledIcon);
|
m_nextItemButton->setIcon(disabledIcon);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_nextItemButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowDown));
|
m_nextItemButton->setIcon(stepDownIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update button texts
|
// Update button texts
|
||||||
|
Loading…
Reference in New Issue
Block a user