mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch '2018.11.01-patch'
This commit is contained in:
commit
329d2f7f07
@ -102,6 +102,17 @@ bool RiaStdStringTools::startsWithAlphabetic(const std::string& s)
|
|||||||
return isalpha(s[0]) != 0;
|
return isalpha(s[0]) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RiaStdStringTools::endsWith(const std::string& mainStr, const std::string& toMatch)
|
||||||
|
{
|
||||||
|
if (mainStr.size() >= toMatch.size() && mainStr.compare(mainStr.size() - toMatch.size(), toMatch.size(), toMatch) == 0)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -127,3 +138,4 @@ size_t RiaStdStringTools::findCharMatchCount(const std::string& s, char c)
|
|||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,9 @@ public:
|
|||||||
static bool containsAlphabetic(const std::string& s);
|
static bool containsAlphabetic(const std::string& s);
|
||||||
static bool startsWithAlphabetic(const std::string& s);
|
static bool startsWithAlphabetic(const std::string& s);
|
||||||
|
|
||||||
|
static bool endsWith(const std::string& mainStr, const std::string& toMatch);
|
||||||
|
|
||||||
|
|
||||||
static std::vector<std::string> splitStringBySpace(const std::string& s);
|
static std::vector<std::string> splitStringBySpace(const std::string& s);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -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;
|
||||||
|
@ -101,7 +101,7 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
|
|||||||
QString subIndexText = QString("%1").arg(sub.subIndex, 2, 10, QChar('0'));
|
QString subIndexText = QString("%1").arg(sub.subIndex, 2, 10, QChar('0'));
|
||||||
QString lateralName = QString("%1_%2_Sub%3_Lat%4").arg(wellPath->name()).arg(fishboneName).arg(subIndexText).arg(lateralIndex);
|
QString lateralName = QString("%1_%2_Sub%3_Lat%4").arg(wellPath->name()).arg(fishboneName).arg(subIndexText).arg(lateralIndex);
|
||||||
|
|
||||||
EXP::writeWellPathGeometryToStream(*stream, wellPath, lateralName, mdStepSize);
|
EXP::writeWellPathGeometryToStream(*stream, &geometry, lateralName, mdStepSize, false, 0.0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
|||||||
std::vector<RigCompletionData> completionsForWell;
|
std::vector<RigCompletionData> completionsForWell;
|
||||||
for (const auto& completion : completions)
|
for (const auto& completion : completions)
|
||||||
{
|
{
|
||||||
if (completion.wellName() == wellPath->completions()->wellNameForExport())
|
if (RicWellPathExportCompletionDataFeatureImpl::isCompletionWellPathEqual(completion, wellPath))
|
||||||
{
|
{
|
||||||
completionsForWell.push_back(completion);
|
completionsForWell.push_back(completion);
|
||||||
}
|
}
|
||||||
@ -369,12 +369,14 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
|
|||||||
std::vector<RigCompletionData> completionsForWell;
|
std::vector<RigCompletionData> completionsForWell;
|
||||||
for (const auto& completion : completions)
|
for (const auto& completion : completions)
|
||||||
{
|
{
|
||||||
if (completion.wellName() == wellPath->completions()->wellNameForExport() &&
|
if (completionType == completion.completionType())
|
||||||
completionType == completion.completionType())
|
{
|
||||||
|
if (RicWellPathExportCompletionDataFeatureImpl::isCompletionWellPathEqual(completion, wellPath))
|
||||||
{
|
{
|
||||||
completionsForWell.push_back(completion);
|
completionsForWell.push_back(completion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (completionsForWell.empty()) continue;
|
if (completionsForWell.empty()) continue;
|
||||||
|
|
||||||
@ -616,7 +618,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsTable(RifEclipse
|
|||||||
formatter.add(startMD);
|
formatter.add(startMD);
|
||||||
formatter.addValueOrDefaultMarker(exportInfo.topWellBoreVolume(), RicMswExportInfo::defaultDoubleValue());
|
formatter.addValueOrDefaultMarker(exportInfo.topWellBoreVolume(), RicMswExportInfo::defaultDoubleValue());
|
||||||
formatter.add(exportInfo.lengthAndDepthText());
|
formatter.add(exportInfo.lengthAndDepthText());
|
||||||
formatter.add(exportInfo.pressureDropText());
|
formatter.add(QString("'%1'").arg(exportInfo.pressureDropText()));
|
||||||
|
|
||||||
formatter.rowCompleted();
|
formatter.rowCompleted();
|
||||||
}
|
}
|
||||||
@ -998,6 +1000,7 @@ RigCompletionData
|
|||||||
|
|
||||||
RigCompletionData resultCompletion(wellName, cellIndexIJK, firstCompletion.firstOrderingValue());
|
RigCompletionData resultCompletion(wellName, cellIndexIJK, firstCompletion.firstOrderingValue());
|
||||||
resultCompletion.setSecondOrderingValue(firstCompletion.secondOrderingValue());
|
resultCompletion.setSecondOrderingValue(firstCompletion.secondOrderingValue());
|
||||||
|
resultCompletion.setSourcePdmObject(firstCompletion.sourcePdmObject());
|
||||||
|
|
||||||
bool anyNonDarcyFlowPresent = false;
|
bool anyNonDarcyFlowPresent = false;
|
||||||
for (const auto& c : completions)
|
for (const auto& c : completions)
|
||||||
@ -1125,7 +1128,9 @@ QFilePtr RicWellPathExportCompletionDataFeatureImpl::openFileForExport(const QSt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString filePath = exportFolder.filePath(fileName);
|
QString validFileName = caf::Utils::makeValidFileBasename(fileName);
|
||||||
|
|
||||||
|
QString filePath = exportFolder.filePath(validFileName);
|
||||||
QFilePtr exportFile(new QFile(filePath));
|
QFilePtr exportFile(new QFile(filePath));
|
||||||
if (!exportFile->open(QIODevice::WriteOnly | QIODevice::Text))
|
if (!exportFile->open(QIODevice::WriteOnly | QIODevice::Text))
|
||||||
{
|
{
|
||||||
@ -2669,6 +2674,23 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCarfinForTemporaryLgrs(co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicWellPathExportCompletionDataFeatureImpl::isCompletionWellPathEqual(const RigCompletionData& completion,
|
||||||
|
const RimWellPath* wellPath)
|
||||||
|
{
|
||||||
|
if (!wellPath) return false;
|
||||||
|
|
||||||
|
RimWellPath* parentWellPath = nullptr;
|
||||||
|
if (completion.sourcePdmObject())
|
||||||
|
{
|
||||||
|
completion.sourcePdmObject()->firstAncestorOrThisOfType(parentWellPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (parentWellPath == wellPath);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Internal function
|
/// Internal function
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -290,4 +290,5 @@ private:
|
|||||||
|
|
||||||
static void exportCarfinForTemporaryLgrs(const RimEclipseCase* sourceCase, const QString& folder);
|
static void exportCarfinForTemporaryLgrs(const RimEclipseCase* sourceCase, const QString& folder);
|
||||||
|
|
||||||
|
static bool isCompletionWellPathEqual(const RigCompletionData& completion, const RimWellPath* wellPath);
|
||||||
};
|
};
|
||||||
|
@ -374,9 +374,9 @@ void RicExportLgrFeature::writeLgrs(QTextStream& stream, const std::vector<LgrIn
|
|||||||
formatter.addOneBasedCellIndex(lgrInfo.mainGridEndCell.j());
|
formatter.addOneBasedCellIndex(lgrInfo.mainGridEndCell.j());
|
||||||
formatter.addOneBasedCellIndex(lgrInfo.mainGridStartCell.k());
|
formatter.addOneBasedCellIndex(lgrInfo.mainGridStartCell.k());
|
||||||
formatter.addOneBasedCellIndex(lgrInfo.mainGridEndCell.k());
|
formatter.addOneBasedCellIndex(lgrInfo.mainGridEndCell.k());
|
||||||
formatter.add(lgrInfo.sizesPerMainGridCell().i());
|
formatter.add(lgrInfo.sizes.i());
|
||||||
formatter.add(lgrInfo.sizesPerMainGridCell().j());
|
formatter.add(lgrInfo.sizes.j());
|
||||||
formatter.add(lgrInfo.sizesPerMainGridCell().k());
|
formatter.add(lgrInfo.sizes.k());
|
||||||
formatter.rowCompleted();
|
formatter.rowCompleted();
|
||||||
formatter.tableCompleted("", false);
|
formatter.tableCompleted("", false);
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,33 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
|
|||||||
auto wellPathGeom = wellPath->wellPathGeometry();
|
auto wellPathGeom = wellPath->wellPathGeometry();
|
||||||
if (!wellPathGeom) return;
|
if (!wellPathGeom) return;
|
||||||
|
|
||||||
|
bool useMdRkb = false;
|
||||||
|
double rkb = 0.0;
|
||||||
|
{
|
||||||
|
const RimModeledWellPath* modeledWellPath = dynamic_cast<const RimModeledWellPath*>(wellPath);
|
||||||
|
if (modeledWellPath)
|
||||||
|
{
|
||||||
|
useMdRkb = true;
|
||||||
|
rkb = modeledWellPath->geometryDefinition()->mdrkbAtFirstTarget();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writeWellPathGeometryToStream(stream, wellPathGeom, exportName, mdStepSize, useMdRkb, rkb, writeProjectInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStream& stream,
|
||||||
|
const RigWellPath* wellPathGeom,
|
||||||
|
const QString& exportName,
|
||||||
|
double mdStepSize,
|
||||||
|
bool useMdRkb,
|
||||||
|
double rkbOffset,
|
||||||
|
bool writeProjectInfo)
|
||||||
|
{
|
||||||
|
if (!wellPathGeom) return;
|
||||||
|
|
||||||
double currMd = wellPathGeom->measureDepths().front() - mdStepSize;
|
double currMd = wellPathGeom->measureDepths().front() - mdStepSize;
|
||||||
double endMd = wellPathGeom->measureDepths().back();
|
double endMd = wellPathGeom->measureDepths().back();
|
||||||
|
|
||||||
@ -88,17 +115,6 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
|
|||||||
stream << endl;
|
stream << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool useMdRkb = false;
|
|
||||||
double rkb = 0.0;
|
|
||||||
{
|
|
||||||
const RimModeledWellPath* modeledWellPath = dynamic_cast<const RimModeledWellPath*>(wellPath);
|
|
||||||
if (modeledWellPath)
|
|
||||||
{
|
|
||||||
useMdRkb = true;
|
|
||||||
rkb = modeledWellPath->geometryDefinition()->mdrkbAtFirstTarget();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename(exportName) << "'" << endl;
|
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename(exportName) << "'" << endl;
|
||||||
|
|
||||||
auto numberFormat = RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 2);
|
auto numberFormat = RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 2);
|
||||||
@ -122,7 +138,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
|
|||||||
formatter.add(pt.x());
|
formatter.add(pt.x());
|
||||||
formatter.add(pt.y());
|
formatter.add(pt.y());
|
||||||
formatter.add(tvd);
|
formatter.add(tvd);
|
||||||
formatter.add(currMd + rkb);
|
formatter.add(currMd + rkbOffset);
|
||||||
formatter.rowCompleted("");
|
formatter.rowCompleted("");
|
||||||
}
|
}
|
||||||
formatter.tableCompleted("", false);
|
formatter.tableCompleted("", false);
|
||||||
|
@ -51,12 +51,21 @@ class RicExportSelectedWellPathsFeature : public caf::CmdFeature
|
|||||||
static RicExportWellPathsUi* openDialog();
|
static RicExportWellPathsUi* openDialog();
|
||||||
static QFilePtr openFileForExport(const QString& folderName, const QString& fileName);
|
static QFilePtr openFileForExport(const QString& folderName, const QString& fileName);
|
||||||
static QTextStreamPtr createOutputFileStream(QFile& file);
|
static QTextStreamPtr createOutputFileStream(QFile& file);
|
||||||
|
|
||||||
static void writeWellPathGeometryToStream(QTextStream& stream,
|
static void writeWellPathGeometryToStream(QTextStream& stream,
|
||||||
const RimWellPath* wellPath,
|
const RimWellPath* wellPath,
|
||||||
const QString& exportName,
|
const QString& exportName,
|
||||||
double mdStepSize,
|
double mdStepSize,
|
||||||
bool writeProjectInfo = true);
|
bool writeProjectInfo = true);
|
||||||
|
|
||||||
|
static void writeWellPathGeometryToStream(QTextStream& stream,
|
||||||
|
const RigWellPath* wellPath,
|
||||||
|
const QString& exportName,
|
||||||
|
double mdStepSize,
|
||||||
|
bool useMdRkb,
|
||||||
|
double rkbOffset,
|
||||||
|
bool writeProjectInfo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
void onActionTriggered( bool isChecked ) override;
|
void onActionTriggered( bool isChecked ) override;
|
||||||
|
@ -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;
|
||||||
|
};
|
@ -230,6 +230,9 @@ void RicSummaryCurveCreator::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
|||||||
|
|
||||||
caf::PdmField<bool>* field = dynamic_cast<caf::PdmField<bool>*>(m_targetPlot->uiCapability()->objectToggleField());
|
caf::PdmField<bool>* field = dynamic_cast<caf::PdmField<bool>*>(m_targetPlot->uiCapability()->objectToggleField());
|
||||||
field->setValueWithFieldChanged(true);
|
field->setValueWithFieldChanged(true);
|
||||||
|
|
||||||
|
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||||
|
mainPlotWindow->updateSummaryPlotToolBar();
|
||||||
}
|
}
|
||||||
else if (changedField == &m_useAutoAppearanceAssignment && m_useAutoAppearanceAssignment)
|
else if (changedField == &m_useAutoAppearanceAssignment && m_useAutoAppearanceAssignment)
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ RimFishbonesMultipleSubs::RimFishbonesMultipleSubs()
|
|||||||
initialiseObsoleteFields();
|
initialiseObsoleteFields();
|
||||||
CAF_PDM_InitFieldNoDefault(&m_valveLocations, "ValveLocations", "Valve Locations", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_valveLocations, "ValveLocations", "Valve Locations", "", "", "");
|
||||||
m_valveLocations = new RimMultipleValveLocations();
|
m_valveLocations = new RimMultipleValveLocations();
|
||||||
|
m_valveLocations->findField("RangeValveCount")->uiCapability()->setUiName("Number of Subs");
|
||||||
m_valveLocations.uiCapability()->setUiHidden(true);
|
m_valveLocations.uiCapability()->setUiHidden(true);
|
||||||
m_valveLocations.uiCapability()->setUiTreeChildrenHidden(true);
|
m_valveLocations.uiCapability()->setUiTreeChildrenHidden(true);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace caf {
|
|||||||
addItem(RimMswCompletionParameters::HYDROSTATIC, "H--", "Hydrostatic");
|
addItem(RimMswCompletionParameters::HYDROSTATIC, "H--", "Hydrostatic");
|
||||||
addItem(RimMswCompletionParameters::HYDROSTATIC_FRICTION, "HF-", "Hydrostatic + Friction");
|
addItem(RimMswCompletionParameters::HYDROSTATIC_FRICTION, "HF-", "Hydrostatic + Friction");
|
||||||
addItem(RimMswCompletionParameters::HYDROSTATIC_FRICTION_ACCELERATION, "HFA", "Hydrostatic + Friction + Acceleration");
|
addItem(RimMswCompletionParameters::HYDROSTATIC_FRICTION_ACCELERATION, "HFA", "Hydrostatic + Friction + Acceleration");
|
||||||
setDefault(RimMswCompletionParameters::HYDROSTATIC);
|
setDefault(RimMswCompletionParameters::HYDROSTATIC_FRICTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
@ -461,7 +461,6 @@ WellFractureIntersectionData RimStimPlanFractureTemplate::wellFractureIntersecti
|
|||||||
double weightedConductivity = 0.0;
|
double weightedConductivity = 0.0;
|
||||||
double weightedWidth = 0.0;
|
double weightedWidth = 0.0;
|
||||||
double weightedBetaFactorOnFile = 0.0;
|
double weightedBetaFactorOnFile = 0.0;
|
||||||
double conversionFactorForBeta = 1.0;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
std::vector<double> widthResultValues;
|
std::vector<double> widthResultValues;
|
||||||
@ -483,20 +482,6 @@ WellFractureIntersectionData RimStimPlanFractureTemplate::wellFractureIntersecti
|
|||||||
auto nameUnit = betaFactorParameterNameAndUnit();
|
auto nameUnit = betaFactorParameterNameAndUnit();
|
||||||
betaFactorResultValues = m_stimPlanFractureDefinitionData->fractureGridResults(
|
betaFactorResultValues = m_stimPlanFractureDefinitionData->fractureGridResults(
|
||||||
nameUnit.first, nameUnit.second, m_activeTimeStepIndex);
|
nameUnit.first, nameUnit.second, m_activeTimeStepIndex);
|
||||||
|
|
||||||
QString trimmedUnit = nameUnit.second.trimmed().toLower();
|
|
||||||
if (trimmedUnit == "/m")
|
|
||||||
{
|
|
||||||
conversionFactorForBeta = 1.01325E+08;
|
|
||||||
}
|
|
||||||
else if (trimmedUnit == "/cm")
|
|
||||||
{
|
|
||||||
conversionFactorForBeta = 1.01325E+06;
|
|
||||||
}
|
|
||||||
else if (trimmedUnit == "/ft")
|
|
||||||
{
|
|
||||||
conversionFactorForBeta = 3.088386E+07;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RiaWeightedMeanCalculator<double> widthCalc;
|
RiaWeightedMeanCalculator<double> widthCalc;
|
||||||
@ -522,7 +507,15 @@ WellFractureIntersectionData RimStimPlanFractureTemplate::wellFractureIntersecti
|
|||||||
|
|
||||||
if (fractureGlobalCellIndex < betaFactorResultValues.size())
|
if (fractureGlobalCellIndex < betaFactorResultValues.size())
|
||||||
{
|
{
|
||||||
betaFactorCalc.addValueAndWeight(betaFactorResultValues[fractureGlobalCellIndex], intersectionLength);
|
double nativeBetaFactor = betaFactorResultValues[fractureGlobalCellIndex];
|
||||||
|
|
||||||
|
// Guard against zero beta values, as these values will set the geometric mean to zero
|
||||||
|
// Consider using the conductivity threshold instead of a local beta threshold
|
||||||
|
const double threshold = 1e-6;
|
||||||
|
if (fabs(nativeBetaFactor) > threshold)
|
||||||
|
{
|
||||||
|
betaFactorCalc.addValueAndWeight(nativeBetaFactor, intersectionLength);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (conductivityCalc.validAggregatedWeight())
|
if (conductivityCalc.validAggregatedWeight())
|
||||||
@ -545,7 +538,9 @@ WellFractureIntersectionData RimStimPlanFractureTemplate::wellFractureIntersecti
|
|||||||
values.m_width = weightedWidth;
|
values.m_width = weightedWidth;
|
||||||
values.m_conductivity = weightedConductivity;
|
values.m_conductivity = weightedConductivity;
|
||||||
|
|
||||||
|
double conversionFactorForBeta = conversionFactorForBetaValues();
|
||||||
double betaFactorForcheimer = weightedBetaFactorOnFile / conversionFactorForBeta;
|
double betaFactorForcheimer = weightedBetaFactorOnFile / conversionFactorForBeta;
|
||||||
|
|
||||||
values.m_betaFactorInForcheimerUnits = betaFactorForcheimer;
|
values.m_betaFactorInForcheimerUnits = betaFactorForcheimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,6 +556,7 @@ WellFractureIntersectionData RimStimPlanFractureTemplate::wellFractureIntersecti
|
|||||||
double conductivity = wellCell.getConductivityValue();
|
double conductivity = wellCell.getConductivityValue();
|
||||||
values.m_conductivity = conductivity;
|
values.m_conductivity = conductivity;
|
||||||
|
|
||||||
|
{
|
||||||
auto nameUnit = widthParameterNameAndUnit();
|
auto nameUnit = widthParameterNameAndUnit();
|
||||||
if (!nameUnit.first.isEmpty())
|
if (!nameUnit.first.isEmpty())
|
||||||
{
|
{
|
||||||
@ -582,6 +578,23 @@ WellFractureIntersectionData RimStimPlanFractureTemplate::wellFractureIntersecti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto nameUnit = betaFactorParameterNameAndUnit();
|
||||||
|
std::vector<double> betaFactorResultValues =
|
||||||
|
m_stimPlanFractureDefinitionData->fractureGridResults(nameUnit.first, nameUnit.second, m_activeTimeStepIndex);
|
||||||
|
|
||||||
|
if (wellCellIndex < betaFactorResultValues.size())
|
||||||
|
{
|
||||||
|
double nativeBetaValue = betaFactorResultValues[wellCellIndex];
|
||||||
|
|
||||||
|
double conversionFactorForBeta = conversionFactorForBetaValues();
|
||||||
|
double betaFactorForcheimer = nativeBetaValue / conversionFactorForBeta;
|
||||||
|
|
||||||
|
values.m_betaFactorInForcheimerUnits = betaFactorForcheimer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return values;
|
return values;
|
||||||
@ -668,6 +681,32 @@ bool RimStimPlanFractureTemplate::isBetaFactorAvailableOnFile() const
|
|||||||
return !nameAndUnit.first.isEmpty();
|
return !nameAndUnit.first.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
double RimStimPlanFractureTemplate::conversionFactorForBetaValues() const
|
||||||
|
{
|
||||||
|
auto nameUnit = betaFactorParameterNameAndUnit();
|
||||||
|
|
||||||
|
double conversionFactorForBeta = 1.0;
|
||||||
|
|
||||||
|
QString trimmedUnit = nameUnit.second.trimmed().toLower();
|
||||||
|
if (trimmedUnit == "/m")
|
||||||
|
{
|
||||||
|
conversionFactorForBeta = 1.01325E+08;
|
||||||
|
}
|
||||||
|
else if (trimmedUnit == "/cm")
|
||||||
|
{
|
||||||
|
conversionFactorForBeta = 1.01325E+06;
|
||||||
|
}
|
||||||
|
else if (trimmedUnit == "/ft")
|
||||||
|
{
|
||||||
|
conversionFactorForBeta = 3.088386E+07;
|
||||||
|
}
|
||||||
|
|
||||||
|
return conversionFactorForBeta;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -114,6 +114,8 @@ private:
|
|||||||
std::pair<QString, QString> betaFactorParameterNameAndUnit() const;
|
std::pair<QString, QString> betaFactorParameterNameAndUnit() const;
|
||||||
bool isBetaFactorAvailableOnFile() const override;
|
bool isBetaFactorAvailableOnFile() const override;
|
||||||
|
|
||||||
|
double conversionFactorForBetaValues() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_activeTimeStepIndex;
|
caf::PdmField<int> m_activeTimeStepIndex;
|
||||||
caf::PdmField<QString> m_conductivityResultNameOnFile;
|
caf::PdmField<QString> m_conductivityResultNameOnFile;
|
||||||
|
@ -231,6 +231,7 @@ void RimWellPathCompletions::setUnitSystemSpecificDefaults()
|
|||||||
{
|
{
|
||||||
m_fishbonesCollection->setUnitSystemSpecificDefaults();
|
m_fishbonesCollection->setUnitSystemSpecificDefaults();
|
||||||
m_fractureCollection->setUnitSystemSpecificDefaults();
|
m_fractureCollection->setUnitSystemSpecificDefaults();
|
||||||
|
m_perforationCollection->setUnitSystemSpecificDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -481,12 +481,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";
|
||||||
@ -508,6 +512,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))
|
||||||
{
|
{
|
||||||
|
@ -781,10 +781,14 @@ bool RimContourMapProjection::hasResultInCell(uint i, uint j) const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RimContourMapProjection::calculateValueInCell(uint i, uint j) const
|
double RimContourMapProjection::calculateValueInCell(uint i, uint j) const
|
||||||
{
|
{
|
||||||
if (!isColumnResult() && view()->cellResult()->scalarResultIndex() == cvf::UNDEFINED_SIZE_T)
|
if (!isColumnResult())
|
||||||
|
{
|
||||||
|
if (!view()->cellResult()->isFlowDiagOrInjectionFlooding() &&
|
||||||
|
view()->cellResult()->scalarResultIndex() == cvf::UNDEFINED_SIZE_T)
|
||||||
{
|
{
|
||||||
return 0.0; // Special case of NONE-result. Show 0 all over to ensure we see something.
|
return 0.0; // Special case of NONE-result. Show 0 all over to ensure we see something.
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const std::vector<std::pair<size_t, double>>& matchingCells = cellsAtIJ(i, j);
|
const std::vector<std::pair<size_t, double>>& matchingCells = cellsAtIJ(i, j);
|
||||||
if (!matchingCells.empty())
|
if (!matchingCells.empty())
|
||||||
{
|
{
|
||||||
|
@ -214,11 +214,8 @@ void RimContourMapView::updateGeometry()
|
|||||||
|
|
||||||
appendPickPointVisToModel();
|
appendPickPointVisToModel();
|
||||||
|
|
||||||
if (m_overlayInfoConfig->isActive())
|
|
||||||
{
|
|
||||||
m_overlayInfoConfig()->update3DInfo();
|
m_overlayInfoConfig()->update3DInfo();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
@ -384,7 +384,7 @@ const RigVirtualPerforationTransmissibilities* RimEclipseCase::computeAndGetVirt
|
|||||||
{
|
{
|
||||||
for (const auto& r : wellResultBranch.m_branchResultPoints)
|
for (const auto& r : wellResultBranch.m_branchResultPoints)
|
||||||
{
|
{
|
||||||
if (r.isValid())
|
if (r.isCell())
|
||||||
{
|
{
|
||||||
RigCompletionData compData(
|
RigCompletionData compData(
|
||||||
wellRes->m_wellName,
|
wellRes->m_wellName,
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "cafPdmUiTreeSelectionEditor.h"
|
#include "cafPdmUiTreeSelectionEditor.h"
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
@ -861,6 +862,11 @@ bool RimEclipseResultDefinition::hasDynamicResult() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipseResultDefinition::initAfterRead()
|
void RimEclipseResultDefinition::initAfterRead()
|
||||||
{
|
{
|
||||||
|
if (m_flowSolution() == nullptr)
|
||||||
|
{
|
||||||
|
assignFlowSolutionFromCase();
|
||||||
|
}
|
||||||
|
|
||||||
m_porosityModelUiField = m_porosityModel;
|
m_porosityModelUiField = m_porosityModel;
|
||||||
m_resultTypeUiField = m_resultType;
|
m_resultTypeUiField = m_resultType;
|
||||||
m_resultVariableUiField = m_resultVariable;
|
m_resultVariableUiField = m_resultVariable;
|
||||||
@ -868,42 +874,6 @@ void RimEclipseResultDefinition::initAfterRead()
|
|||||||
m_flowSolutionUiField = m_flowSolution();
|
m_flowSolutionUiField = m_flowSolution();
|
||||||
m_selectedInjectorTracersUiField = m_selectedInjectorTracers;
|
m_selectedInjectorTracersUiField = m_selectedInjectorTracers;
|
||||||
|
|
||||||
if (m_flowSolution() == nullptr)
|
|
||||||
{
|
|
||||||
assignFlowSolutionFromCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_flowSolution())
|
|
||||||
{
|
|
||||||
std::vector<QString> selectedInjectorTracers;
|
|
||||||
std::vector<QString> selectedProducerTracers;
|
|
||||||
for (const QString& tracerName : m_selectedTracers_OBSOLETE())
|
|
||||||
{
|
|
||||||
RimFlowDiagSolution::TracerStatusType tracerStatus = m_flowSolution()->tracerStatusOverall(tracerName);
|
|
||||||
if (tracerStatus == RimFlowDiagSolution::INJECTOR)
|
|
||||||
{
|
|
||||||
selectedInjectorTracers.push_back(tracerName);
|
|
||||||
}
|
|
||||||
else if (tracerStatus == RimFlowDiagSolution::PRODUCER)
|
|
||||||
{
|
|
||||||
selectedProducerTracers.push_back(tracerName);
|
|
||||||
}
|
|
||||||
else if (tracerStatus == RimFlowDiagSolution::VARYING || tracerStatus == RimFlowDiagSolution::UNDEFINED)
|
|
||||||
{
|
|
||||||
selectedInjectorTracers.push_back(tracerName);
|
|
||||||
selectedProducerTracers.push_back(tracerName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!selectedInjectorTracers.empty())
|
|
||||||
{
|
|
||||||
setSelectedInjectorTracers(selectedInjectorTracers);
|
|
||||||
}
|
|
||||||
if (!selectedProducerTracers.empty())
|
|
||||||
{
|
|
||||||
setSelectedProducerTracers(selectedProducerTracers);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this->updateUiIconFromToggleField();
|
this->updateUiIconFromToggleField();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1159,6 +1129,43 @@ void RimEclipseResultDefinition::defineEditorAttribute(const caf::PdmFieldHandle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseResultDefinition::onEditorWidgetsCreated()
|
||||||
|
{
|
||||||
|
if (m_flowSolution() && !m_selectedTracers_OBSOLETE().empty())
|
||||||
|
{
|
||||||
|
std::vector<QString> selectedTracers;
|
||||||
|
selectedTracers.swap(m_selectedTracers_OBSOLETE.v());
|
||||||
|
|
||||||
|
std::set<QString, TracerComp> allInjectorTracers = setOfTracersOfType(true);
|
||||||
|
std::set<QString, TracerComp> allProducerTracers = setOfTracersOfType(false);
|
||||||
|
|
||||||
|
std::vector<QString> selectedInjectorTracers;
|
||||||
|
std::vector<QString> selectedProducerTracers;
|
||||||
|
for (const QString& tracerName : selectedTracers)
|
||||||
|
{
|
||||||
|
if (allInjectorTracers.count(tracerName))
|
||||||
|
{
|
||||||
|
selectedInjectorTracers.push_back(tracerName);
|
||||||
|
}
|
||||||
|
if (allProducerTracers.count(tracerName))
|
||||||
|
{
|
||||||
|
selectedProducerTracers.push_back(tracerName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!selectedInjectorTracers.empty())
|
||||||
|
{
|
||||||
|
setSelectedInjectorTracers(selectedInjectorTracers);
|
||||||
|
}
|
||||||
|
if (!selectedProducerTracers.empty())
|
||||||
|
{
|
||||||
|
setSelectedProducerTracers(selectedProducerTracers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -123,6 +123,7 @@ protected:
|
|||||||
void initAfterRead() override;
|
void initAfterRead() override;
|
||||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||||
|
void onEditorWidgetsCreated() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultType;
|
caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultType;
|
||||||
@ -174,6 +175,7 @@ private:
|
|||||||
|
|
||||||
QList<caf::PdmOptionItemInfo> calcOptionsForVariableUiFieldStandard();
|
QList<caf::PdmOptionItemInfo> calcOptionsForVariableUiFieldStandard();
|
||||||
QList<caf::PdmOptionItemInfo> calcOptionsForSelectedTracerField(bool injector);
|
QList<caf::PdmOptionItemInfo> calcOptionsForSelectedTracerField(bool injector);
|
||||||
|
|
||||||
QString timeOfFlightString(bool shorter) const;
|
QString timeOfFlightString(bool shorter) const;
|
||||||
QString maxFractionTracerString(bool shorter) const;
|
QString maxFractionTracerString(bool shorter) const;
|
||||||
|
|
||||||
|
@ -218,19 +218,7 @@ void RimPlotCurve::setCustomName(const QString& customName)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimPlotCurve::updateCurveVisibility(bool updateParentPlot)
|
void RimPlotCurve::updateCurveVisibility(bool updateParentPlot)
|
||||||
{
|
{
|
||||||
bool isVisibleInPossibleParent = true;
|
if (canCurveBeAttached())
|
||||||
|
|
||||||
{
|
|
||||||
RimSummaryCurveCollection* summaryCurveCollection = nullptr;
|
|
||||||
this->firstAncestorOrThisOfType(summaryCurveCollection);
|
|
||||||
if (summaryCurveCollection) isVisibleInPossibleParent = summaryCurveCollection->isCurvesVisible();
|
|
||||||
|
|
||||||
RimEnsembleCurveSet* ensembleCurveSet = nullptr;
|
|
||||||
firstAncestorOrThisOfType(ensembleCurveSet);
|
|
||||||
if (ensembleCurveSet) isVisibleInPossibleParent = ensembleCurveSet->isCurvesVisible();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_showCurve() && m_parentQwtPlot && isVisibleInPossibleParent)
|
|
||||||
{
|
{
|
||||||
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
||||||
}
|
}
|
||||||
@ -282,7 +270,7 @@ void RimPlotCurve::updateCurvePresentation(bool updatePlotLegendAndTitle)
|
|||||||
void RimPlotCurve::setParentQwtPlotAndReplot(QwtPlot* plot)
|
void RimPlotCurve::setParentQwtPlotAndReplot(QwtPlot* plot)
|
||||||
{
|
{
|
||||||
m_parentQwtPlot = plot;
|
m_parentQwtPlot = plot;
|
||||||
if (m_showCurve && m_parentQwtPlot)
|
if (canCurveBeAttached())
|
||||||
{
|
{
|
||||||
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
||||||
m_parentQwtPlot->replot();
|
m_parentQwtPlot->replot();
|
||||||
@ -295,7 +283,7 @@ void RimPlotCurve::setParentQwtPlotAndReplot(QwtPlot* plot)
|
|||||||
void RimPlotCurve::setParentQwtPlotNoReplot(QwtPlot* plot)
|
void RimPlotCurve::setParentQwtPlotNoReplot(QwtPlot* plot)
|
||||||
{
|
{
|
||||||
m_parentQwtPlot = plot;
|
m_parentQwtPlot = plot;
|
||||||
if (m_showCurve && m_parentQwtPlot)
|
if (canCurveBeAttached())
|
||||||
{
|
{
|
||||||
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
||||||
}
|
}
|
||||||
@ -331,7 +319,7 @@ void RimPlotCurve::detachQwtCurve()
|
|||||||
void RimPlotCurve::reattachQwtCurve()
|
void RimPlotCurve::reattachQwtCurve()
|
||||||
{
|
{
|
||||||
detachQwtCurve();
|
detachQwtCurve();
|
||||||
if (m_parentQwtPlot && m_showCurve)
|
if (canCurveBeAttached())
|
||||||
{
|
{
|
||||||
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
||||||
}
|
}
|
||||||
@ -454,6 +442,36 @@ void RimPlotCurve::curveNameUiOrdering(caf::PdmUiOrdering& uiOrdering)
|
|||||||
uiOrdering.add(&m_curveName);
|
uiOrdering.add(&m_curveName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimPlotCurve::canCurveBeAttached() const
|
||||||
|
{
|
||||||
|
if (!m_parentQwtPlot)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_showCurve())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isVisibleInPossibleParent = true;
|
||||||
|
|
||||||
|
{
|
||||||
|
RimSummaryCurveCollection* summaryCurveCollection = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(summaryCurveCollection);
|
||||||
|
if (summaryCurveCollection) isVisibleInPossibleParent = summaryCurveCollection->isCurvesVisible();
|
||||||
|
|
||||||
|
RimEnsembleCurveSet* ensembleCurveSet = nullptr;
|
||||||
|
firstAncestorOrThisOfType(ensembleCurveSet);
|
||||||
|
if (ensembleCurveSet) isVisibleInPossibleParent = ensembleCurveSet->isCurvesVisible();
|
||||||
|
}
|
||||||
|
|
||||||
|
return isVisibleInPossibleParent;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -109,6 +109,9 @@ protected:
|
|||||||
void appearanceUiOrdering(caf::PdmUiOrdering& uiOrdering);
|
void appearanceUiOrdering(caf::PdmUiOrdering& uiOrdering);
|
||||||
void curveNameUiOrdering(caf::PdmUiOrdering& uiOrdering);
|
void curveNameUiOrdering(caf::PdmUiOrdering& uiOrdering);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool canCurveBeAttached() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QPointer<QwtPlot> m_parentQwtPlot;
|
QPointer<QwtPlot> m_parentQwtPlot;
|
||||||
RiuQwtPlotCurve* m_qwtPlotCurve;
|
RiuQwtPlotCurve* m_qwtPlotCurve;
|
||||||
|
@ -174,12 +174,15 @@ std::vector<const RigWellPath*> RimSimWellInView::wellPipeBranches() const
|
|||||||
this->firstAncestorOrThisOfTypeAsserted(eclipseCase);
|
this->firstAncestorOrThisOfTypeAsserted(eclipseCase);
|
||||||
RigEclipseCaseData* caseData = eclipseCase->eclipseCaseData();
|
RigEclipseCaseData* caseData = eclipseCase->eclipseCaseData();
|
||||||
CVF_ASSERT(caseData);
|
CVF_ASSERT(caseData);
|
||||||
|
if (caseData)
|
||||||
|
{
|
||||||
bool includeCellCenters = this->isUsingCellCenterForPipe();
|
bool includeCellCenters = this->isUsingCellCenterForPipe();
|
||||||
bool detectBrances = simWellCollection->isAutoDetectingBranches;
|
bool detectBrances = simWellCollection->isAutoDetectingBranches;
|
||||||
|
|
||||||
return caseData->simulationWellBranches(this->name(), includeCellCenters, detectBrances);
|
return caseData->simulationWellBranches(this->name(), includeCellCenters, detectBrances);
|
||||||
}
|
}
|
||||||
|
return std::vector<const RigWellPath*>();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
@ -74,6 +74,7 @@ RimTimeStepFilter::RimTimeStepFilter()
|
|||||||
m_interval.uiCapability()->setUiEditorTypeName(caf::PdmUiLineEditor::uiEditorTypeName());
|
m_interval.uiCapability()->setUiEditorTypeName(caf::PdmUiLineEditor::uiEditorTypeName());
|
||||||
|
|
||||||
CAF_PDM_InitField(&m_timeStepNamesFromFile, "TimeStepsFromFile", std::vector<QString>(), "TimeSteps From File", "", "", "");
|
CAF_PDM_InitField(&m_timeStepNamesFromFile, "TimeStepsFromFile", std::vector<QString>(), "TimeSteps From File", "", "", "");
|
||||||
|
m_timeStepNamesFromFile.xmlCapability()->disableIO();
|
||||||
CAF_PDM_InitField(&m_dateFormat, "DateFormat", QString("yyyy-MM-dd"), "Date Format", "", "", "");
|
CAF_PDM_InitField(&m_dateFormat, "DateFormat", QString("yyyy-MM-dd"), "Date Format", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_filteredTimeSteps, "TimeStepIndicesToImport", "Select From Time Steps", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_filteredTimeSteps, "TimeStepIndicesToImport", "Select From Time Steps", "", "", "");
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -1028,7 +1047,6 @@ void RimEnsembleCurveSet::updateStatisticsCurves(const std::vector<RimSummaryCas
|
|||||||
curve->setSummaryCaseY(m_ensembleStatCase.get());
|
curve->setSummaryCaseY(m_ensembleStatCase.get());
|
||||||
curve->setSummaryAddressY(address);
|
curve->setSummaryAddressY(address);
|
||||||
curve->setLeftOrRightAxisY(m_plotAxis());
|
curve->setLeftOrRightAxisY(m_plotAxis());
|
||||||
curve->setZOrder(1000);
|
|
||||||
|
|
||||||
curve->updateCurveVisibility(false);
|
curve->updateCurveVisibility(false);
|
||||||
curve->loadDataAndUpdate(false);
|
curve->loadDataAndUpdate(false);
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -147,6 +147,8 @@ void RimEnsembleStatisticsCase::calculate(const std::vector<RimSummaryCase*> sum
|
|||||||
std::vector<double> values;
|
std::vector<double> values;
|
||||||
reader->values(inputAddress, &values);
|
reader->values(inputAddress, &values);
|
||||||
|
|
||||||
|
if (timeSteps.size() != values.size()) continue;
|
||||||
|
|
||||||
RiaTimeHistoryCurveResampler resampler;
|
RiaTimeHistoryCurveResampler resampler;
|
||||||
resampler.setCurveData(values, timeSteps);
|
resampler.setCurveData(values, timeSteps);
|
||||||
if (inputAddress.hasAccumulatedData()) resampler.resampleAndComputePeriodEndValues(DateTimePeriod::DAY);
|
if (inputAddress.hasAccumulatedData()) resampler.resampleAndComputePeriodEndValues(DateTimePeriod::DAY);
|
||||||
|
@ -142,6 +142,9 @@ RimSummaryCurve::RimSummaryCurve()
|
|||||||
|
|
||||||
m_curveNameConfig = new RimSummaryCurveAutoName;
|
m_curveNameConfig = new RimSummaryCurveAutoName;
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_isTopZWithinCategory, "isTopZWithinCategory", false, "", "", "", "");
|
||||||
|
m_isTopZWithinCategory.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
m_symbolSkipPixelDistance = 10.0f;
|
m_symbolSkipPixelDistance = 10.0f;
|
||||||
m_curveThickness = 2;
|
m_curveThickness = 2;
|
||||||
}
|
}
|
||||||
@ -450,6 +453,8 @@ void RimSummaryCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
|||||||
|
|
||||||
updateConnectedEditors();
|
updateConnectedEditors();
|
||||||
|
|
||||||
|
setZIndexFromCurveInfo();
|
||||||
|
|
||||||
if (isCurveVisible())
|
if (isCurveVisible())
|
||||||
{
|
{
|
||||||
std::vector<double> curveValuesY = this->valuesY();
|
std::vector<double> curveValuesY = this->valuesY();
|
||||||
@ -560,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);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -660,6 +692,44 @@ void RimSummaryCurve::appendOptionItemsForSummaryAddresses(QList<caf::PdmOptionI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCurve::setZIndexFromCurveInfo()
|
||||||
|
{
|
||||||
|
auto sumAddr = summaryAddressY();
|
||||||
|
auto sumCase = summaryCaseY();
|
||||||
|
|
||||||
|
double zOrder = 0.0;
|
||||||
|
|
||||||
|
if (sumCase && sumAddr.isValid())
|
||||||
|
{
|
||||||
|
if (sumCase->isObservedData())
|
||||||
|
{
|
||||||
|
zOrder = RiuQwtPlotCurve::Z_SINGLE_CURVE_OBSERVED;
|
||||||
|
}
|
||||||
|
else if (sumAddr.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS)
|
||||||
|
{
|
||||||
|
zOrder = RiuQwtPlotCurve::Z_ENSEMBLE_STAT_CURVE;
|
||||||
|
}
|
||||||
|
else if (sumCase->ensemble())
|
||||||
|
{
|
||||||
|
zOrder = RiuQwtPlotCurve::Z_ENSEMBLE_CURVE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zOrder = RiuQwtPlotCurve::Z_SINGLE_CURVE_NON_OBSERVED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_isTopZWithinCategory)
|
||||||
|
{
|
||||||
|
zOrder += 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
setZOrder(zOrder);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -747,6 +817,14 @@ void RimSummaryCurve::markCachedDataForPurge()
|
|||||||
if(reader) reader->markForCachePurge(m_yValuesCurveVariable->address());
|
if(reader) reader->markForCachePurge(m_yValuesCurveVariable->address());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCurve::setAsTopZWithinCategory(bool enable)
|
||||||
|
{
|
||||||
|
m_isTopZWithinCategory = enable;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -785,6 +863,11 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|||||||
|
|
||||||
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||||
mainPlotWindow->updateSummaryPlotToolBar();
|
mainPlotWindow->updateSummaryPlotToolBar();
|
||||||
|
|
||||||
|
if (m_showCurve() == true)
|
||||||
|
{
|
||||||
|
plot->summaryCurveCollection()->setCurveAsTopZWithinCategory(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (changedField == &m_plotAxis)
|
else if (changedField == &m_plotAxis)
|
||||||
{
|
{
|
||||||
|
@ -81,6 +81,9 @@ public:
|
|||||||
|
|
||||||
void markCachedDataForPurge();
|
void markCachedDataForPurge();
|
||||||
|
|
||||||
|
void setAsTopZWithinCategory(bool enable);
|
||||||
|
void setZIndexFromCurveInfo();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// RimPlotCurve overrides
|
// RimPlotCurve overrides
|
||||||
QString createCurveAutoName() override;
|
QString createCurveAutoName() override;
|
||||||
@ -90,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;
|
||||||
@ -126,4 +132,5 @@ private:
|
|||||||
|
|
||||||
caf::PdmChildField<RimSummaryCurveAutoName*> m_curveNameConfig;
|
caf::PdmChildField<RimSummaryCurveAutoName*> m_curveNameConfig;
|
||||||
caf::PdmField<caf::AppEnum< RiaDefines::PlotAxis>> m_plotAxis;
|
caf::PdmField<caf::AppEnum< RiaDefines::PlotAxis>> m_plotAxis;
|
||||||
|
caf::PdmField<bool> m_isTopZWithinCategory;
|
||||||
};
|
};
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -335,6 +402,42 @@ void RimSummaryCurveCollection::handleKeyPressEvent(QKeyEvent* keyEvent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCurveCollection::setCurveAsTopZWithinCategory(RimSummaryCurve* curve)
|
||||||
|
{
|
||||||
|
for (const auto& c : m_curves)
|
||||||
|
{
|
||||||
|
if (c == curve)
|
||||||
|
{
|
||||||
|
c->setAsTopZWithinCategory(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
c->setAsTopZWithinCategory(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
c->setZIndexFromCurveInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
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();
|
||||||
@ -67,6 +69,11 @@ public:
|
|||||||
|
|
||||||
void handleKeyPressEvent(QKeyEvent* keyEvent);
|
void handleKeyPressEvent(QKeyEvent* keyEvent);
|
||||||
|
|
||||||
|
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,
|
||||||
@ -86,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;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -1000,6 +1016,10 @@ void RimSummaryPlot::deleteCurves(const std::vector<RimSummaryCurve*>& curves)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RiuPlotMainWindowTools::refreshToolbars();
|
||||||
|
|
||||||
updateCaseNameHasChanged();
|
updateCaseNameHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -161,73 +191,148 @@ 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)
|
|
||||||
{
|
|
||||||
return QList<caf::PdmOptionItemInfo>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fieldNeedingOptions == &m_summaryCase)
|
|
||||||
{
|
{
|
||||||
QList<caf::PdmOptionItemInfo> options;
|
QList<caf::PdmOptionItemInfo> options;
|
||||||
|
|
||||||
RimProject* proj = RiaApplication::instance()->project();
|
if (fieldNeedingOptions == &m_includeEnsembleCasesForCaseStepping)
|
||||||
for (auto sumCase : proj->allSummaryCases())
|
{
|
||||||
|
return caf::PdmObject::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
|
||||||
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_placeholderForLabel)
|
||||||
|
{
|
||||||
|
options;
|
||||||
|
}
|
||||||
|
else if (fieldNeedingOptions == &m_summaryCase)
|
||||||
|
{
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::map<QString, QString> displayAndValueStrings;
|
||||||
|
|
||||||
|
{
|
||||||
RiaSummaryCurveAnalyzer quantityAnalyzer;
|
RiaSummaryCurveAnalyzer quantityAnalyzer;
|
||||||
|
|
||||||
for (auto reader : readers)
|
for (auto reader : readers)
|
||||||
|
{
|
||||||
|
if (reader != nullptr)
|
||||||
{
|
{
|
||||||
auto subset = RiaSummaryCurveAnalyzer::addressesForCategory(reader->allResultAddresses(), category);
|
auto subset = RiaSummaryCurveAnalyzer::addressesForCategory(reader->allResultAddresses(), category);
|
||||||
quantityAnalyzer.appendAdresses(subset);
|
quantityAnalyzer.appendAdresses(subset);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto& quantity : quantityAnalyzer.quantities())
|
RiaSummaryCurveAnalyzer analyzerForCurves;
|
||||||
|
analyzerForCurves.appendAdresses(addressesCurveCollection());
|
||||||
|
|
||||||
|
if (analyzerForCurves.quantityNamesWithHistory().empty())
|
||||||
{
|
{
|
||||||
identifierTexts.push_back(QString::fromStdString(quantity));
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<caf::PdmOptionItemInfo> options;
|
for (const auto& displayAndValue : displayAndValueStrings)
|
||||||
if (identifierTexts.size() > 0)
|
{
|
||||||
|
options.append(caf::PdmOptionItemInfo(displayAndValue.first, displayAndValue.second));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.isEmpty())
|
||||||
|
{
|
||||||
|
options.push_back(caf::PdmOptionItemInfo("None", "None"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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)
|
for (const auto& text : identifierTexts)
|
||||||
{
|
{
|
||||||
@ -238,6 +343,8 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
|
|||||||
{
|
{
|
||||||
options.push_back(caf::PdmOptionItemInfo("None", "None"));
|
options.push_back(caf::PdmOptionItemInfo("None", "None"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
@ -249,29 +356,92 @@ 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())
|
||||||
|
{
|
||||||
|
if (previousCase == curve->summaryCaseY())
|
||||||
{
|
{
|
||||||
bool doSetAppearance = curve->summaryCaseY()->isObservedData() != m_summaryCase->isObservedData();
|
bool doSetAppearance = curve->summaryCaseY()->isObservedData() != m_summaryCase->isObservedData();
|
||||||
curve->setSummaryCaseY(m_summaryCase);
|
curve->setSummaryCaseY(m_summaryCase);
|
||||||
if (doSetAppearance) curve->forceUpdateCurveAppearanceFromCaseType();
|
if (doSetAppearance) curve->forceUpdateCurveAppearanceFromCaseType();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (isXAxisStepping())
|
if (isXAxisStepping())
|
||||||
|
{
|
||||||
|
if (previousCase == curve->summaryCaseX())
|
||||||
{
|
{
|
||||||
curve->setSummaryCaseX(m_summaryCase);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
triggerLoadDataAndUpdate = true;
|
triggerLoadDataAndUpdate = true;
|
||||||
}
|
}
|
||||||
@ -283,110 +453,124 @@ 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);
|
||||||
{
|
|
||||||
adr.setWellName(m_wellName().toStdString());
|
|
||||||
|
|
||||||
curve->setSummaryAddressY(adr);
|
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);
|
||||||
{
|
|
||||||
adr.setWellName(m_wellName().toStdString());
|
|
||||||
|
|
||||||
curve->setSummaryAddressX(adr);
|
curve->setSummaryAddressX(adr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ensembleCurveColl)
|
||||||
|
{
|
||||||
|
for (auto curveSet : ensembleCurveColl->curveSets())
|
||||||
|
{
|
||||||
|
auto adr = curveSet->summaryAddress();
|
||||||
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_WELL, &adr);
|
||||||
|
curveSet->setSummaryAddress(adr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerLoadDataAndUpdate = true;
|
triggerLoadDataAndUpdate = true;
|
||||||
}
|
}
|
||||||
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);
|
||||||
{
|
|
||||||
adr.setRegion(m_region());
|
|
||||||
|
|
||||||
curve->setSummaryAddressY(adr);
|
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);
|
||||||
{
|
|
||||||
adr.setRegion(m_region());
|
|
||||||
|
|
||||||
curve->setSummaryAddressX(adr);
|
curve->setSummaryAddressX(adr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ensembleCurveColl)
|
||||||
|
{
|
||||||
|
for (auto curveSet : ensembleCurveColl->curveSets())
|
||||||
|
{
|
||||||
|
auto adr = curveSet->summaryAddress();
|
||||||
|
updateAddressIfMatching(oldValue, newValue, RifEclipseSummaryAddress::SUMMARY_REGION, &adr);
|
||||||
|
curveSet->setSummaryAddress(adr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerLoadDataAndUpdate = true;
|
triggerLoadDataAndUpdate = true;
|
||||||
}
|
}
|
||||||
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);
|
||||||
{
|
|
||||||
adr.setWellGroupName(m_wellGroupName().toStdString());
|
|
||||||
|
|
||||||
curve->setSummaryAddressY(adr);
|
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);
|
||||||
{
|
|
||||||
adr.setWellGroupName(m_wellGroupName().toStdString());
|
|
||||||
|
|
||||||
curve->setSummaryAddressX(adr);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerLoadDataAndUpdate = true;
|
triggerLoadDataAndUpdate = true;
|
||||||
@ -400,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
|
||||||
|
if (curveCollection)
|
||||||
|
{
|
||||||
curveCollection->updateConnectedEditors();
|
curveCollection->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||||
mainPlotWindow->updateSummaryPlotToolBar();
|
mainPlotWindow->updateSummaryPlotToolBar();
|
||||||
@ -420,8 +612,10 @@ 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);
|
||||||
|
|
||||||
|
if (curveCollection)
|
||||||
|
{
|
||||||
for (auto curve : curveCollection->curves())
|
for (auto curve : curveCollection->curves())
|
||||||
{
|
{
|
||||||
if (isYAxisStepping() && curve->summaryCaseY())
|
if (isYAxisStepping() && curve->summaryCaseY())
|
||||||
@ -434,6 +628,24 @@ std::vector<RifSummaryReaderInterface*> RimSummaryPlotSourceStepping::summaryRea
|
|||||||
readers.push_back(curve->summaryCaseX()->summaryReader());
|
readers.push_back(curve->summaryCaseX()->summaryReader());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* ensembleCollection = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(ensembleCollection);
|
||||||
|
if (ensembleCollection)
|
||||||
|
{
|
||||||
|
auto curveSets = ensembleCollection->curveSets();
|
||||||
|
for (const RimEnsembleCurveSet* curveSet : curveSets)
|
||||||
|
{
|
||||||
|
for (auto curve : curveSet->curves())
|
||||||
|
{
|
||||||
|
if (isYAxisStepping() && curve->summaryCaseY())
|
||||||
|
{
|
||||||
|
readers.push_back(curve->summaryCaseY()->summaryReader());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return readers;
|
return readers;
|
||||||
}
|
}
|
||||||
@ -474,9 +686,9 @@ 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();
|
auto curves = curveCollection->curvesForSourceStepping(m_sourceSteppingType);
|
||||||
for (auto c : curves)
|
for (auto c : curves)
|
||||||
{
|
{
|
||||||
if (isYAxisStepping())
|
if (isYAxisStepping())
|
||||||
@ -489,6 +701,18 @@ std::set<RifEclipseSummaryAddress> RimSummaryPlotSourceStepping::addressesCurveC
|
|||||||
addresses.insert(c->summaryAddressX());
|
addresses.insert(c->summaryAddressX());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RimEnsembleCurveSetCollection* ensembleCollection = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(ensembleCollection);
|
||||||
|
if (ensembleCollection)
|
||||||
|
{
|
||||||
|
auto curveSets = ensembleCollection->curveSetsForSourceStepping();
|
||||||
|
for (const RimEnsembleCurveSet* curveSet : curveSets)
|
||||||
|
{
|
||||||
|
addresses.insert(curveSet->summaryAddress());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return addresses;
|
return addresses;
|
||||||
}
|
}
|
||||||
@ -505,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())
|
||||||
@ -528,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;
|
||||||
|
|
||||||
@ -546,9 +772,29 @@ 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto ensembleColl = ensembleCollection();
|
||||||
|
if (ensembleColl.size() == 1)
|
||||||
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
|
||||||
|
if (proj->summaryGroups().size() > 1)
|
||||||
|
{
|
||||||
|
m_ensemble = *(ensembleColl.begin());
|
||||||
|
|
||||||
|
m_ensemble.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
|
fields.push_back(&m_ensemble);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<caf::PdmFieldHandle*> fieldsCommonForAllCurves;
|
||||||
|
|
||||||
|
{
|
||||||
RiaSummaryCurveAnalyzer analyzer;
|
RiaSummaryCurveAnalyzer analyzer;
|
||||||
analyzer.appendAdresses(addressesCurveCollection());
|
analyzer.appendAdresses(addressesCurveCollection());
|
||||||
|
|
||||||
@ -568,7 +814,7 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
|||||||
m_wellName = txt;
|
m_wellName = txt;
|
||||||
m_wellName.uiCapability()->setUiHidden(false);
|
m_wellName.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
fields.push_back(&m_wellName);
|
fieldsCommonForAllCurves.push_back(&m_wellName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analyzer.wellGroupNames().size() == 1)
|
if (analyzer.wellGroupNames().size() == 1)
|
||||||
@ -577,7 +823,7 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
|||||||
m_wellGroupName = txt;
|
m_wellGroupName = txt;
|
||||||
m_wellGroupName.uiCapability()->setUiHidden(false);
|
m_wellGroupName.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
fields.push_back(&m_wellGroupName);
|
fieldsCommonForAllCurves.push_back(&m_wellGroupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analyzer.regionNumbers().size() == 1)
|
if (analyzer.regionNumbers().size() == 1)
|
||||||
@ -585,22 +831,49 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
|||||||
m_region = *(analyzer.regionNumbers().begin());
|
m_region = *(analyzer.regionNumbers().begin());
|
||||||
m_region.uiCapability()->setUiHidden(false);
|
m_region.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
fields.push_back(&m_region);
|
fieldsCommonForAllCurves.push_back(&m_region);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analyzer.quantities().size() == 1)
|
if (!analyzer.quantityNameForTitle().empty())
|
||||||
{
|
{
|
||||||
QString txt = QString::fromStdString(*(analyzer.quantities().begin()));
|
QString txt = QString::fromStdString(analyzer.quantityNameForTitle());
|
||||||
m_quantity = txt;
|
m_quantity = txt;
|
||||||
m_quantity.uiCapability()->setUiHidden(false);
|
m_quantity.uiCapability()->setUiHidden(false);
|
||||||
|
|
||||||
fields.push_back(&m_quantity);
|
fieldsCommonForAllCurves.push_back(&m_quantity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const auto& f : fieldsCommonForAllCurves)
|
||||||
|
{
|
||||||
|
fields.push_back(f);
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -653,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>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/Shader/">
|
<qresource prefix="/Shader/">
|
||||||
<file>fs_CellFace.glsl</file>
|
<file>fs_CellFace.glsl</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,19 +496,40 @@ 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;
|
||||||
|
|
||||||
|
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();
|
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_summaryPlotToolBarEditor->isEditorDataValid(toolBarFields))
|
if (!m_summaryPlotToolBarEditor->isEditorDataValid(toolBarFields))
|
||||||
{
|
{
|
||||||
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
||||||
m_summaryPlotToolBarEditor->updateUi();
|
m_summaryPlotToolBarEditor->updateUi();
|
||||||
}
|
}
|
||||||
|
else if (forceUpdateUi)
|
||||||
|
{
|
||||||
|
m_summaryPlotToolBarEditor->updateUi();
|
||||||
|
}
|
||||||
|
|
||||||
m_summaryPlotToolBarEditor->show();
|
m_summaryPlotToolBarEditor->show();
|
||||||
}
|
}
|
||||||
@ -693,6 +716,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;
|
||||||
|
@ -55,6 +55,7 @@ RiuQwtPlotCurve::RiuQwtPlotCurve(const QString &title)
|
|||||||
m_errorBars->setStyle(QwtPlotIntervalCurve::CurveStyle::NoCurve);
|
m_errorBars->setStyle(QwtPlotIntervalCurve::CurveStyle::NoCurve);
|
||||||
m_errorBars->setSymbol(new QwtIntervalSymbol(QwtIntervalSymbol::Bar));
|
m_errorBars->setSymbol(new QwtIntervalSymbol(QwtIntervalSymbol::Bar));
|
||||||
m_errorBars->setItemAttribute(QwtPlotItem::Legend, false);
|
m_errorBars->setItemAttribute(QwtPlotItem::Legend, false);
|
||||||
|
m_errorBars->setZ(Z_ERROR_BARS);
|
||||||
|
|
||||||
m_showErrorBars = true;
|
m_showErrorBars = true;
|
||||||
m_attachedToPlot = nullptr;
|
m_attachedToPlot = nullptr;
|
||||||
|
@ -63,6 +63,16 @@ public:
|
|||||||
STYLE_DASH_DOT
|
STYLE_DASH_DOT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Z index. Higher Z is painted in front
|
||||||
|
enum ZIndex
|
||||||
|
{
|
||||||
|
Z_ENSEMBLE_CURVE = 100,
|
||||||
|
Z_ENSEMBLE_STAT_CURVE = 200,
|
||||||
|
Z_SINGLE_CURVE_NON_OBSERVED = 300,
|
||||||
|
Z_ERROR_BARS = 400,
|
||||||
|
Z_SINGLE_CURVE_OBSERVED = 500
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RiuQwtPlotCurve(const QString &title = QString::null);
|
explicit RiuQwtPlotCurve(const QString &title = QString::null);
|
||||||
~RiuQwtPlotCurve() override;
|
~RiuQwtPlotCurve() override;
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
#include "RiuQwtSymbol.h"
|
#include "RiuQwtSymbol.h"
|
||||||
|
|
||||||
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -130,7 +132,7 @@ void RiuQwtSymbol::renderSymbolLabel(QPainter *painter, const QPointF& position)
|
|||||||
{
|
{
|
||||||
QSize symbolSize = QwtSymbol::size();
|
QSize symbolSize = QwtSymbol::size();
|
||||||
QRect symbolRect (position.x(), position.y(), symbolSize.width(), symbolSize.height());
|
QRect symbolRect (position.x(), position.y(), symbolSize.width(), symbolSize.height());
|
||||||
QRect labelRect = labelBoundingRect(symbolRect);
|
QRect labelRect = labelBoundingRect(painter, symbolRect);
|
||||||
painter->drawText(labelRect.topLeft(), m_label);
|
painter->drawText(labelRect.topLeft(), m_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,24 +147,16 @@ void RiuQwtSymbol::setLabelPosition(LabelPosition labelPosition)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QRect RiuQwtSymbol::boundingRect() const
|
QRect RiuQwtSymbol::labelBoundingRect(const QPainter* painter, const QRect& symbolRect) const
|
||||||
{
|
{
|
||||||
QRect symbolRect = QwtSymbol::boundingRect();
|
CVF_ASSERT(painter);
|
||||||
QRect labelRect = labelBoundingRect(symbolRect);
|
|
||||||
return symbolRect.united(labelRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
QRect RiuQwtSymbol::labelBoundingRect(const QRect& symbolRect) const
|
|
||||||
{
|
|
||||||
QPoint symbolPosition = symbolRect.topLeft();
|
QPoint symbolPosition = symbolRect.topLeft();
|
||||||
|
|
||||||
int symbolWidth = symbolRect.width();
|
int symbolWidth = symbolRect.width();
|
||||||
|
|
||||||
int labelWidth = QPainter().fontMetrics().width(m_label);
|
int labelWidth = painter->fontMetrics().width(m_label);
|
||||||
int labelHeight = QPainter().fontMetrics().height();
|
int labelHeight = painter->fontMetrics().height();
|
||||||
|
|
||||||
QPoint labelPosition;
|
QPoint labelPosition;
|
||||||
if (m_labelPosition == LabelAboveSymbol)
|
if (m_labelPosition == LabelAboveSymbol)
|
||||||
|
@ -60,10 +60,8 @@ public:
|
|||||||
QString label() const { return m_label; }
|
QString label() const { return m_label; }
|
||||||
|
|
||||||
void setLabelPosition(LabelPosition labelPosition);
|
void setLabelPosition(LabelPosition labelPosition);
|
||||||
QRect boundingRect() const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QRect labelBoundingRect(const QRect& symbolRect) const;
|
QRect labelBoundingRect(const QPainter* painter, const QRect& symbolRect) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_label;
|
QString m_label;
|
||||||
|
@ -41,6 +41,46 @@ std::map<QString, uint64_t> readProcessBytesLinux()
|
|||||||
}
|
}
|
||||||
return quantities;
|
return quantities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
/// Read bytes of memory of different types for system from /proc/meminfo
|
||||||
|
/// See: http://man7.org/linux/man-pages/man5/proc.5.html
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::map<QString, uint64_t> readMemInfoLinuxMiB()
|
||||||
|
{
|
||||||
|
std::map<QString, uint64_t> quantities;
|
||||||
|
uint64_t conversionToMiB = 1024;
|
||||||
|
QFile procMemInfo("/proc/meminfo");
|
||||||
|
|
||||||
|
if (procMemInfo.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
qint64 lineLength = 0;
|
||||||
|
while (lineLength != -1)
|
||||||
|
{
|
||||||
|
lineLength = procMemInfo.readLine(buf, sizeof(buf));
|
||||||
|
if (lineLength > 0)
|
||||||
|
{
|
||||||
|
QString line = QString::fromLatin1(buf, lineLength);
|
||||||
|
QStringList words = line.split(QRegExp(":*\\s+"), QString::SkipEmptyParts);
|
||||||
|
if (words.size() > 1)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
unsigned long long value = words[1].toULongLong(&ok);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
quantities[words[0]] = value / conversionToMiB;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
quantities[words[0]] = 0u;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return quantities;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -93,7 +133,8 @@ uint64_t caf::MemoryInspector::getTotalVirtualMemoryMiB()
|
|||||||
long long totalVirtualMem = memInfo.totalram;
|
long long totalVirtualMem = memInfo.totalram;
|
||||||
totalVirtualMem += memInfo.totalswap;
|
totalVirtualMem += memInfo.totalswap;
|
||||||
totalVirtualMem *= memInfo.mem_unit;
|
totalVirtualMem *= memInfo.mem_unit;
|
||||||
return totalVirtualMem / MIB_DIV;
|
uint64_t totalVirtualMemMiB = totalVirtualMem / MIB_DIV;
|
||||||
|
return totalVirtualMemMiB;
|
||||||
#else
|
#else
|
||||||
return 0u;
|
return 0u;
|
||||||
#endif
|
#endif
|
||||||
@ -137,8 +178,12 @@ uint64_t caf::MemoryInspector::getAvailableVirtualMemoryMiB()
|
|||||||
sysinfo(&memInfo);
|
sysinfo(&memInfo);
|
||||||
long long availVirtualMem = memInfo.freeram;
|
long long availVirtualMem = memInfo.freeram;
|
||||||
availVirtualMem += memInfo.freeswap;
|
availVirtualMem += memInfo.freeswap;
|
||||||
|
availVirtualMem += memInfo.bufferram;
|
||||||
availVirtualMem *= memInfo.mem_unit;
|
availVirtualMem *= memInfo.mem_unit;
|
||||||
return availVirtualMem / MIB_DIV;
|
uint64_t virtualMemoryWithoutCachedMiB = availVirtualMem / MIB_DIV;
|
||||||
|
uint64_t cachedMemMiB = readMemInfoLinuxMiB()["Cached"];
|
||||||
|
uint64_t totalFreeVirtualMemoryMiB = virtualMemoryWithoutCachedMiB + cachedMemMiB;
|
||||||
|
return totalFreeVirtualMemoryMiB;
|
||||||
#else
|
#else
|
||||||
return 0u;
|
return 0u;
|
||||||
#endif
|
#endif
|
||||||
|
@ -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
|
||||||
|
@ -170,6 +170,13 @@ void PdmUiToolBarEditor::configureAndUpdateUi(const QString& uiConfigName)
|
|||||||
fieldEditor->updateUi(uiConfigName);
|
fieldEditor->updateUi(uiConfigName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (it->second)
|
||||||
|
{
|
||||||
|
it->second->updateUi(uiConfigName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CAF_ASSERT(m_fields.size() == m_fieldViews.size());
|
CAF_ASSERT(m_fields.size() == m_fieldViews.size());
|
||||||
|
@ -259,9 +259,6 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName)
|
|||||||
m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||||
|
|
||||||
m_treeView->setModel(m_proxyModel);
|
m_treeView->setModel(m_proxyModel);
|
||||||
|
|
||||||
connect(m_treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(slotCurrentChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool optionsOnly = true;
|
bool optionsOnly = true;
|
||||||
@ -487,14 +484,6 @@ void PdmUiTreeSelectionEditor::customMenuRequested(const QPoint& pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void PdmUiTreeSelectionEditor::slotCurrentChanged(const QModelIndex& current, const QModelIndex& previous)
|
|
||||||
{
|
|
||||||
currentChanged(current);
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -103,7 +103,6 @@ protected:
|
|||||||
private slots:
|
private slots:
|
||||||
void customMenuRequested(const QPoint& pos);
|
void customMenuRequested(const QPoint& pos);
|
||||||
|
|
||||||
void slotCurrentChanged(const QModelIndex& current, const QModelIndex& previous);
|
|
||||||
void slotSetSelectedOn();
|
void slotSetSelectedOn();
|
||||||
void slotSetSelectedOff();
|
void slotSetSelectedOff();
|
||||||
void slotSetSubItemsOn();
|
void slotSetSubItemsOn();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
set(RESINSIGHT_MAJOR_VERSION 2018)
|
set(RESINSIGHT_MAJOR_VERSION 2018)
|
||||||
set(RESINSIGHT_MINOR_VERSION 11)
|
set(RESINSIGHT_MINOR_VERSION 11)
|
||||||
set(RESINSIGHT_PATCH_VERSION 0)
|
set(RESINSIGHT_PATCH_VERSION 1)
|
||||||
|
|
||||||
# Opional text with no restrictions
|
# Opional text with no restrictions
|
||||||
#set(RESINSIGHT_VERSION_TEXT "-RC1")
|
#set(RESINSIGHT_VERSION_TEXT "-patch_RC02")
|
||||||
|
|
||||||
# Optional text
|
# Optional text
|
||||||
# Must be unique and increasing within one combination of major/minor/patch version
|
# Must be unique and increasing within one combination of major/minor/patch version
|
||||||
|
Loading…
Reference in New Issue
Block a user