mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch 'dev' of https://github.com/OPM/ResInsight.git
This commit is contained in:
commit
b092c6e047
@ -72,6 +72,14 @@ QDateTime RiaQDateTimeTools::fromYears(double years)
|
||||
return RiaQDateTimeTools::addYears(dt, yearsAfterEpoch);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::addMSecs(const QDateTime& dt, double msecs)
|
||||
{
|
||||
return dt.addMSecs(msecs);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
static QDateTime fromString(const QString& dateString, const QString& format);
|
||||
static QDateTime fromYears(double years);
|
||||
|
||||
static QDateTime addMSecs(const QDateTime& dt, double msecs);
|
||||
static QDateTime addDays(const QDateTime& dt, double days);
|
||||
static QDateTime addYears(const QDateTime& dt, double years);
|
||||
|
||||
|
@ -35,18 +35,12 @@ RiaSummaryCurveAnalyzer::RiaSummaryCurveAnalyzer() {}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::analyzeCurves(const RimSummaryCurveCollection* sumCurveCollection)
|
||||
void RiaSummaryCurveAnalyzer::analyzeAdresses(const std::vector<RifEclipseSummaryAddress>& allAddresses)
|
||||
{
|
||||
clearAllSets();
|
||||
|
||||
if (!sumCurveCollection)
|
||||
return;
|
||||
|
||||
for (auto curve : sumCurveCollection->curves())
|
||||
for (const auto& adr : allAddresses)
|
||||
{
|
||||
m_summaryCases.insert(curve->summaryCaseY());
|
||||
|
||||
auto adr = curve->summaryAddressY();
|
||||
analyzeAddress(adr);
|
||||
}
|
||||
}
|
||||
@ -54,7 +48,7 @@ void RiaSummaryCurveAnalyzer::analyzeCurves(const RimSummaryCurveCollection* sum
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::analyzeAdresses(const std::vector<RifEclipseSummaryAddress>& allAddresses)
|
||||
void RiaSummaryCurveAnalyzer::analyzeAdresses(const std::set<RifEclipseSummaryAddress>& allAddresses)
|
||||
{
|
||||
clearAllSets();
|
||||
|
||||
@ -99,14 +93,6 @@ std::set<int> RiaSummaryCurveAnalyzer::regionNumbers() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RimSummaryCase*> RiaSummaryCurveAnalyzer::summaryCases() const
|
||||
{
|
||||
return m_summaryCases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryCurveAnalyzer::categories() const
|
||||
{
|
||||
return m_categories;
|
||||
@ -145,9 +131,11 @@ std::set<QString> RiaSummaryCurveAnalyzer::identifierTexts(RifEclipseSummaryAddr
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RifEclipseSummaryAddress> RiaSummaryCurveAnalyzer::addressesForCategory(const std::vector<RifEclipseSummaryAddress>& addresses, RifEclipseSummaryAddress::SummaryVarCategory category)
|
||||
std::vector<RifEclipseSummaryAddress>
|
||||
RiaSummaryCurveAnalyzer::addressesForCategory(const std::vector<RifEclipseSummaryAddress>& addresses,
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category)
|
||||
{
|
||||
std::vector<RifEclipseSummaryAddress> filteredAddresses;
|
||||
|
||||
@ -171,7 +159,6 @@ void RiaSummaryCurveAnalyzer::clearAllSets()
|
||||
m_wellNames.clear();
|
||||
m_wellGroupNames.clear();
|
||||
m_regionNumbers.clear();
|
||||
m_summaryCases.clear();
|
||||
m_categories.clear();
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <vector>
|
||||
|
||||
class RimSummaryCurveCollection;
|
||||
class RimSummaryCase;
|
||||
|
||||
class QString;
|
||||
|
||||
@ -37,15 +36,14 @@ class RiaSummaryCurveAnalyzer
|
||||
public:
|
||||
RiaSummaryCurveAnalyzer();
|
||||
|
||||
void analyzeCurves(const RimSummaryCurveCollection* sumCurveCollection);
|
||||
void analyzeAdresses(const std::vector<RifEclipseSummaryAddress>& allAddresses);
|
||||
void analyzeAdresses(const std::set<RifEclipseSummaryAddress>& allAddresses);
|
||||
|
||||
std::set<std::string> quantities() const;
|
||||
std::set<std::string> wellNames() const;
|
||||
std::set<std::string> wellGroupNames() const;
|
||||
|
||||
std::set<int> regionNumbers() const;
|
||||
std::set<RimSummaryCase*> summaryCases() const;
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() const;
|
||||
|
||||
std::set<QString> identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category) const;
|
||||
@ -62,7 +60,6 @@ private:
|
||||
std::set<std::string> m_wellNames;
|
||||
std::set<std::string> m_wellGroupNames;
|
||||
std::set<int> m_regionNumbers;
|
||||
std::set<RimSummaryCase*> m_summaryCases;
|
||||
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> m_categories;
|
||||
};
|
||||
|
@ -162,7 +162,7 @@ void RicGridStatisticsDialog::setHistogramData(RimView* view)
|
||||
auto hist = new QwtPlotHistogram("Histogram");
|
||||
auto aggr = new QwtPlotCurve("Aggregated");
|
||||
|
||||
hist->setBrush(QBrush(QColor(Qt::darkYellow)));
|
||||
hist->setBrush(QBrush(QColor(Qt::darkCyan)));
|
||||
hist->setZ(-1);
|
||||
aggr->setStyle(QwtPlotCurve::Steps);
|
||||
aggr->setCurveAttribute(QwtPlotCurve::Inverted);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
@ -37,6 +38,7 @@
|
||||
#include <QAction>
|
||||
#include <QFileDialog>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicImportFormationNamesFeature, "RicImportFormationNamesFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -72,27 +74,21 @@ void RicImportFormationNamesFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
// For each file, find existing Formation names item, or create new
|
||||
|
||||
RimFormationNames* formationName = fomNameColl->importFiles(fileNames);
|
||||
|
||||
if (fileNames.size() > 1) return;
|
||||
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases(cases);
|
||||
|
||||
if (cases.size() == 1)
|
||||
if (!cases.empty())
|
||||
{
|
||||
std::vector<RimEclipseCase*> eclCases = proj->eclipseCases();
|
||||
if (eclCases.size() == 1)
|
||||
{
|
||||
eclCases[0]->activeFormationNames = formationName;
|
||||
eclCases[0]->eclipseCaseData()->setActiveFormationNames(formationName->formationNamesData());
|
||||
}
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
RimCase* ownerCase = activeView->ownerCase();
|
||||
|
||||
std::vector<RimGeoMechCase*> geoMechCases = proj->geoMechCases();
|
||||
|
||||
if (geoMechCases.size() == 1)
|
||||
if (ownerCase)
|
||||
{
|
||||
geoMechCases[0]->activeFormationNames = formationName;
|
||||
geoMechCases[0]->geoMechData()->femPartResults()->setActiveFormationNames(formationName->formationNamesData());
|
||||
ownerCase->setFormationNames(formationName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,30 +62,45 @@ void RicImportObservedDataFeature::selectObservedDataFileInDialog()
|
||||
RimObservedDataCollection* observedDataCollection = proj->activeOilField() ? proj->activeOilField()->observedDataCollection() : nullptr;
|
||||
if (!observedDataCollection) return;
|
||||
|
||||
QString aggregatedErrorStrings;
|
||||
RimObservedData* observedData = nullptr;
|
||||
|
||||
for (const QString& fileName : fileNames)
|
||||
{
|
||||
QString s;
|
||||
RicImportObservedDataFeature::createAndAddObservedDataFromFile(fileName, &s);
|
||||
if (!s.isEmpty())
|
||||
bool retryImport = false;
|
||||
|
||||
do
|
||||
{
|
||||
aggregatedErrorStrings += fileName;
|
||||
aggregatedErrorStrings += "\n";
|
||||
aggregatedErrorStrings += s;
|
||||
aggregatedErrorStrings += "\n";
|
||||
aggregatedErrorStrings += "\n";
|
||||
}
|
||||
QString errorText;
|
||||
|
||||
if (fileName.endsWith(".rsm", Qt::CaseInsensitive))
|
||||
{
|
||||
observedData = observedDataCollection->createAndAddRsmObservedDataFromFile(fileName, &errorText);
|
||||
retryImport = false;
|
||||
}
|
||||
else if (fileName.endsWith(".txt", Qt::CaseInsensitive) || fileName.endsWith(".csv", Qt::CaseInsensitive))
|
||||
{
|
||||
bool useSavedFieldValuesInDialog = retryImport;
|
||||
observedData = observedDataCollection->createAndAddCvsObservedDataFromFile(fileName, useSavedFieldValuesInDialog, &errorText);
|
||||
retryImport = !errorText.isEmpty();
|
||||
}
|
||||
else
|
||||
{
|
||||
errorText = "Not able to import file. Make sure '*.rsm' is used as extension if data is in RMS format or '*.txt' or '*.csv' if data is in CSV format.";
|
||||
retryImport = false;
|
||||
}
|
||||
|
||||
if (!errorText.isEmpty())
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setIcon(QMessageBox::Warning);
|
||||
msgBox.setText("Errors detected during import ");
|
||||
msgBox.setDetailedText(errorText);
|
||||
msgBox.exec();
|
||||
}
|
||||
} while (retryImport);
|
||||
}
|
||||
|
||||
if (!aggregatedErrorStrings.isEmpty())
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setIcon(QMessageBox::Warning);
|
||||
msgBox.setText("Errors detected during import ");
|
||||
msgBox.setDetailedText(aggregatedErrorStrings);
|
||||
msgBox.exec();
|
||||
}
|
||||
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(observedData);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -118,22 +133,3 @@ void RicImportObservedDataFeature::setupActionLook(QAction* actionToSetup)
|
||||
actionToSetup->setIcon(QIcon(":/Default.png"));
|
||||
actionToSetup->setText("Import Observed Time History Data");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicImportObservedDataFeature::createAndAddObservedDataFromFile(const QString& fileName, QString* errorText)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* proj = app->project();
|
||||
|
||||
RimObservedDataCollection* observedDataCollection = proj->activeOilField() ? proj->activeOilField()->observedDataCollection() : nullptr;
|
||||
if (!observedDataCollection) return false;
|
||||
|
||||
RimObservedData* newObservedData = observedDataCollection->createAndAddObservedDataFromFileName(fileName, errorText);
|
||||
|
||||
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(newObservedData);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,4 @@ private:
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
|
||||
static bool createAndAddObservedDataFromFile(const QString& fileName, QString* errorText = nullptr);
|
||||
};
|
||||
|
@ -20,6 +20,10 @@
|
||||
|
||||
#include "RicSummaryCurveCalculatorDialog.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
@ -60,7 +64,14 @@ void RicShowSummaryCurveCalculatorFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RicSummaryCurveCalculatorDialog* dialog = RicShowSummaryCurveCalculatorFeature::curveCalculatorDialog();
|
||||
|
||||
dialog->setCalculationAndUpdateUi(nullptr);
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimSummaryCalculationCollection* calcColl = proj->calculationCollection();
|
||||
if (calcColl->calculations().size() == 0)
|
||||
{
|
||||
calcColl->addCalculation();
|
||||
}
|
||||
|
||||
dialog->setCalculationAndUpdateUi(calcColl->calculations()[0]);
|
||||
|
||||
dialog->show();
|
||||
dialog->raise();
|
||||
|
@ -138,6 +138,10 @@ void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot)
|
||||
{
|
||||
populateCurveCreator(*m_targetPlot);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDefaultCurveSelection();
|
||||
}
|
||||
|
||||
syncPreviewCurvesFromUiSelection();
|
||||
|
||||
@ -353,6 +357,18 @@ void RicSummaryCurveCreator::updatePreviewCurvesFromCurveDefinitions(const std::
|
||||
curve->applyCurveAutoNameSettings(*m_curveNameConfig());
|
||||
m_previewPlot->addCurveNoUpdate(curve);
|
||||
curveLookCalc.setupCurveLook(curve);
|
||||
|
||||
if (curveDef.summaryAddress().category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED)
|
||||
{
|
||||
// Use short version of calculated curves name
|
||||
std::string fullName = curveDef.summaryAddress().quantityName();
|
||||
size_t firstSpace = fullName.find_first_of(' ');
|
||||
QString shortName = firstSpace != std::string::npos ?
|
||||
QString::fromStdString(fullName.substr(0, firstSpace)) :
|
||||
QString::fromStdString(fullName);
|
||||
|
||||
curve->setCustomCurveName(shortName);
|
||||
}
|
||||
}
|
||||
|
||||
m_previewPlot->loadDataAndUpdate();
|
||||
@ -368,10 +384,8 @@ std::set<std::string> RicSummaryCurveCreator::getAllSummaryCaseNames()
|
||||
{
|
||||
std::set<std::string> summaryCaseHashes;
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
|
||||
proj->allSummaryCases(cases);
|
||||
|
||||
|
||||
std::vector<RimSummaryCase*> cases = proj->allSummaryCases();
|
||||
for (RimSummaryCase* rimCase : cases)
|
||||
{
|
||||
summaryCaseHashes.insert(rimCase->summaryHeaderFilename().toUtf8().constData());
|
||||
@ -387,9 +401,8 @@ std::set<std::string> RicSummaryCurveCreator::getAllSummaryWellNames()
|
||||
{
|
||||
std::set<std::string> summaryWellNames;
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
|
||||
proj->allSummaryCases(cases);
|
||||
std::vector<RimSummaryCase*> cases = proj->allSummaryCases();
|
||||
for (RimSummaryCase* rimCase : cases)
|
||||
{
|
||||
RifSummaryReaderInterface* reader = nullptr;
|
||||
@ -545,6 +558,14 @@ void RicSummaryCurveCreator::copyCurveAndAddToPlot(const RimSummaryCurve *curve,
|
||||
curveCopy->loadDataAndUpdate(false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryCurveCreator::setDefaultCurveSelection()
|
||||
{
|
||||
m_summaryCurveSelectionEditor->summaryAddressSelection()->setDefaultSelection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -84,6 +84,7 @@ private:
|
||||
void populateCurveCreator(const RimSummaryPlot& sourceSummaryPlot);
|
||||
void updateTargetPlot();
|
||||
static void copyCurveAndAddToPlot(const RimSummaryCurve *curve, RimSummaryPlot *plot, bool forceVisible = false);
|
||||
void setDefaultCurveSelection();
|
||||
|
||||
void resetAllFields();
|
||||
void initCurveAppearanceCalculator(RimSummaryCurveAppearanceCalculator& curveAppearanceCalc);
|
||||
|
@ -121,8 +121,6 @@ std::vector<QDateTime> RifHdf5Reader::timeSteps() const
|
||||
|
||||
QDateTime dtInitial = sourSimDateTimeToQDateTime(dateString);
|
||||
|
||||
int secondsPerDay = 60 * 60 * 24;
|
||||
|
||||
for (size_t i = 0; i < m_timeStepFileNames.size(); i++)
|
||||
{
|
||||
std::string fileName = m_timeStepFileNames[i];
|
||||
@ -137,8 +135,8 @@ std::vector<QDateTime> RifHdf5Reader::timeSteps() const
|
||||
double milliseconds = fractionOfDay * 24.0 * 60.0 * 60.0 * 1000.0;
|
||||
|
||||
QDateTime dt = dtInitial;
|
||||
dt = dt.addDays(timeStepDays);
|
||||
dt = dt.addMSecs(milliseconds);
|
||||
dt = RiaQDateTimeTools::addDays(dt, timeStepDays);
|
||||
dt = RiaQDateTimeTools::addMSecs(dt, milliseconds);
|
||||
|
||||
times.push_back(dt);
|
||||
}
|
||||
|
@ -21,18 +21,6 @@
|
||||
#include <QFile>
|
||||
#include <QStringList>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<QString, std::vector<std::pair<double, QString>>> RifWellPathFormationReader::readWellFormations(const QString& filePath)
|
||||
{
|
||||
std::map<QString, std::vector<std::pair<double, QString>>> formations;
|
||||
|
||||
readFileIntoMap(filePath, &formations);
|
||||
|
||||
return formations;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -35,7 +35,6 @@
|
||||
class RifWellPathFormationReader
|
||||
{
|
||||
public:
|
||||
static std::map<QString, std::vector<std::pair<double, QString>> > readWellFormations(const QString& filePath);
|
||||
static std::map<QString, cvf::ref<RigWellPathFormations> > readWellFormationsToGeometry(const QString& filePath);
|
||||
|
||||
private:
|
||||
|
@ -24,25 +24,35 @@
|
||||
#ifdef USE_ODB_API
|
||||
#include "RifOdbReader.h"
|
||||
#endif
|
||||
#include "RigFemScalarResultFrames.h"
|
||||
#include "RigStatisticsDataCache.h"
|
||||
#include "RigFemPartResults.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigFemNativeStatCalc.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RigFemPartGrid.h"
|
||||
#include "RigFemPartResults.h"
|
||||
#include "RigFemScalarResultFrames.h"
|
||||
#include "RigFormationNames.h"
|
||||
#include "RigStatisticsDataCache.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cvfBoundingBox.h"
|
||||
#include <QString>
|
||||
|
||||
#include <cmath>
|
||||
#include <stdlib.h>
|
||||
#include "RigFemNativeStatCalc.h"
|
||||
#include "cafTensor3.h"
|
||||
#include "cafProgressInfo.h"
|
||||
#include "RigFemPartGrid.h"
|
||||
#include "cafTensor3.h"
|
||||
#include "cvfGeometryTools.h"
|
||||
#include "cvfMath.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -80,6 +90,23 @@ RigFemPartResultsCollection::~RigFemPartResultsCollection()
|
||||
void RigFemPartResultsCollection::setActiveFormationNames(RigFormationNames* activeFormationNames)
|
||||
{
|
||||
m_activeFormationNamesData = activeFormationNames;
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
if (project)
|
||||
{
|
||||
if (project->mainPlotCollection())
|
||||
{
|
||||
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
|
||||
if (plotCollection)
|
||||
{
|
||||
for (RimWellLogPlot* wellLogPlot : plotCollection->wellLogPlots)
|
||||
{
|
||||
wellLogPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this->deleteResult(RigFemResultAddress(RIG_FORMATION_NAMES, "Active Formation Names", ""));
|
||||
}
|
||||
|
||||
|
@ -92,12 +92,10 @@ void RivIntersectionGeometryGenerator::calculateArrays()
|
||||
sectionBBox.add(p1);
|
||||
sectionBBox.add(p2);
|
||||
|
||||
|
||||
cvf::Vec3d maxHeightVec;
|
||||
|
||||
double maxSectionHeight = sectionBBox.radius();
|
||||
double maxSectionHeightUp;
|
||||
double maxSectionHeightDown;
|
||||
double maxSectionHeightUp = 0;
|
||||
double maxSectionHeightDown = 0;
|
||||
|
||||
if (m_crossSection->type == RimIntersection::CS_AZIMUTHLINE)
|
||||
{
|
||||
@ -121,7 +119,7 @@ void RivIntersectionGeometryGenerator::calculateArrays()
|
||||
}
|
||||
else
|
||||
{
|
||||
maxHeightVec = m_extrusionDirection*maxSectionHeight;
|
||||
maxHeightVec = m_extrusionDirection*gridBBox.radius();
|
||||
|
||||
sectionBBox.add(p1 + maxHeightVec);
|
||||
sectionBBox.add(p1 - maxHeightVec);
|
||||
@ -171,7 +169,7 @@ void RivIntersectionGeometryGenerator::calculateArrays()
|
||||
{
|
||||
cvf::Vec3d temp = vertex.vx - p1;
|
||||
double dot = temp.dot(m_extrusionDirection);
|
||||
double lengthCheck;
|
||||
double lengthCheck = 0;
|
||||
|
||||
if (dot < 0)
|
||||
{
|
||||
|
@ -66,6 +66,14 @@ cvf::Vec3d RimCase::displayModelOffset() const
|
||||
return cvf::Vec3d::ZERO;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCase::setFormationNames(RimFormationNames* formationNames)
|
||||
{
|
||||
activeFormationNames = formationNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
virtual cvf::Vec3d displayModelOffset() const;
|
||||
|
||||
virtual void updateFormationNamesData() = 0;
|
||||
virtual void setFormationNames(RimFormationNames* formationNames);
|
||||
|
||||
virtual double characteristicCellSize() const = 0;
|
||||
|
||||
|
@ -775,6 +775,18 @@ double RimEclipseCase::characteristicCellSize() const
|
||||
return 10.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::setFormationNames(RimFormationNames* formationNames)
|
||||
{
|
||||
activeFormationNames = formationNames;
|
||||
if (m_rigEclipseCase.notNull() && formationNames != nullptr)
|
||||
{
|
||||
m_rigEclipseCase->setActiveFormationNames(formationNames->formationNamesData());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -107,6 +107,8 @@ public:
|
||||
|
||||
virtual double characteristicCellSize() const override;
|
||||
|
||||
virtual void setFormationNames(RimFormationNames* formationNames) override;
|
||||
|
||||
protected:
|
||||
virtual void initAfterRead();
|
||||
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
||||
|
@ -203,33 +203,14 @@ bool RimEclipseResultCase::importGridAndResultMetaData(bool showTimeStepFilter)
|
||||
|
||||
m_flowDagSolverInterface = new RigFlowDiagSolverInterface(this);
|
||||
|
||||
QStringList fileSplitOnDot = caseFileName().split(".");
|
||||
if (fileSplitOnDot.size() == 2)
|
||||
{
|
||||
QStringList fileSplitOnBackSlash = fileSplitOnDot[0].split("\\");
|
||||
if (fileSplitOnDot[0] != fileSplitOnBackSlash[0])
|
||||
{
|
||||
m_caseName = fileSplitOnBackSlash.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList fileSplitOnSlash = fileSplitOnDot[0].split("/");
|
||||
m_caseName = fileSplitOnSlash.back();
|
||||
}
|
||||
QFileInfo eclipseCaseFileInfo(caseFileName());
|
||||
QString rftFileName = eclipseCaseFileInfo.path() + "/" + eclipseCaseFileInfo.completeBaseName() + ".RFT";
|
||||
QFileInfo rftFileInfo(rftFileName);
|
||||
|
||||
QString rftFile = fileSplitOnDot[0] + ".RFT";
|
||||
std::string rftFileStdString = rftFile.toStdString();
|
||||
|
||||
std::ifstream inputStream(rftFileStdString.c_str());
|
||||
if (!inputStream.fail())
|
||||
{
|
||||
RiaLogging::info(QString("File '%1' found, creating reader").arg(rftFileStdString.c_str()));
|
||||
m_readerEclipseRft = new RifReaderEclipseRft(rftFileStdString);
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning(QString("Could not find file '%1'").arg(rftFileStdString.c_str()));
|
||||
}
|
||||
if (rftFileInfo.exists())
|
||||
{
|
||||
RiaLogging::info(QString("RFT file found"));
|
||||
m_readerEclipseRft = new RifReaderEclipseRft(rftFileInfo.filePath().toStdString());
|
||||
}
|
||||
|
||||
|
||||
|
@ -603,8 +603,11 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
|
||||
QStringList cellCenterResultNames;
|
||||
QStringList cellFaceResultNames;
|
||||
|
||||
RigCaseCellResultsData* results = this->currentGridCellResults();
|
||||
foreach(QString s, getResultNamesForCurrentUiResultType())
|
||||
{
|
||||
if (s == RiaDefines::completionTypeResultName() && results->timeStepDates().empty()) continue;
|
||||
|
||||
if (RiaDefines::isPerCellFaceResult(s))
|
||||
{
|
||||
cellFaceResultNames.push_back(s);
|
||||
|
@ -304,6 +304,18 @@ double RimGeoMechCase::characteristicCellSize() const
|
||||
return 10.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechCase::setFormationNames(RimFormationNames* formationNames)
|
||||
{
|
||||
activeFormationNames = formationNames;
|
||||
if (m_geoMechCaseData.notNull() && formationNames != nullptr)
|
||||
{
|
||||
m_geoMechCaseData->femPartResults()->setActiveFormationNames(formationNames->formationNamesData());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -67,6 +67,8 @@ public:
|
||||
|
||||
virtual double characteristicCellSize() const override;
|
||||
|
||||
virtual void setFormationNames(RimFormationNames* formationNames) override;
|
||||
|
||||
// Fields:
|
||||
caf::PdmChildArrayField<RimGeoMechView*> geoMechViews;
|
||||
|
||||
|
@ -19,17 +19,21 @@
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
|
||||
#include "RimFlowCharacteristicsPlot.h"
|
||||
#include "RimFlowPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimRftPlotCollection.h"
|
||||
#include "RimPltPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRftPlotCollection.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimViewWindow.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellPltPlot.h"
|
||||
#include "RimWellRftPlot.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuProjectPropertyView.h"
|
||||
#include "RimFlowCharacteristicsPlot.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimMainPlotCollection, "MainPlotCollection");
|
||||
|
||||
@ -171,3 +175,38 @@ void RimMainPlotCollection::updateCurrentTimeStepInPlots()
|
||||
m_flowPlotCollection()->defaultFlowCharacteristicsPlot()->updateCurrentTimeStep();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMainPlotCollection::updatePlotsWithFormations()
|
||||
{
|
||||
if (m_wellLogPlotCollection)
|
||||
{
|
||||
for (RimWellLogPlot* wellLogPlot : m_wellLogPlotCollection->wellLogPlots())
|
||||
{
|
||||
wellLogPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pltPlotCollection)
|
||||
{
|
||||
for (RimWellPltPlot* pltPlot : m_pltPlotCollection->pltPlots())
|
||||
{
|
||||
pltPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_rftPlotCollection)
|
||||
{
|
||||
for (RimWellRftPlot* rftPlot : m_rftPlotCollection->rftPlots())
|
||||
{
|
||||
rftPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_flowPlotCollection)
|
||||
{
|
||||
m_flowPlotCollection->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
|
||||
void deleteAllContainedObjects();
|
||||
void updateCurrentTimeStepInPlots();
|
||||
void updatePlotsWithFormations();
|
||||
|
||||
private:
|
||||
|
||||
|
@ -552,6 +552,15 @@ void RimPlotCurve::setZOrder(double z)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::setCustomCurveName(const QString& customName)
|
||||
{
|
||||
m_isUsingAutoName = false;
|
||||
m_customCurveName = customName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -99,6 +99,7 @@ public:
|
||||
void showLegend(bool show);
|
||||
|
||||
void setZOrder(double z);
|
||||
void setCustomCurveName(const QString& customName);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -547,9 +547,10 @@ void RimProject::allCases(std::vector<RimCase*>& cases)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::allSummaryCases(std::vector<RimSummaryCase*>& sumCases)
|
||||
std::vector<RimSummaryCase*> RimProject::allSummaryCases() const
|
||||
{
|
||||
sumCases.clear();
|
||||
std::vector<RimSummaryCase*> sumCases;
|
||||
|
||||
for (RimOilField* oilField: oilFields)
|
||||
{
|
||||
if(!oilField) continue;
|
||||
@ -567,24 +568,8 @@ void RimProject::allSummaryCases(std::vector<RimSummaryCase*>& sumCases)
|
||||
sumCases.insert(sumCases.end(), observedData.begin(), observedData.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::allObservedData(std::vector<RimSummaryCase*>& observedData)
|
||||
{
|
||||
for (RimOilField* oilField : oilFields)
|
||||
{
|
||||
if (!oilField) continue;
|
||||
RimObservedDataCollection* observedDataCollection = oilField->observedDataCollection();
|
||||
if (observedDataCollection)
|
||||
{
|
||||
observedData.clear();
|
||||
std::vector<RimSummaryCase*> allObservedData = observedDataCollection->allObservedData();
|
||||
observedData.insert(observedData.end(), allObservedData.begin(), allObservedData.end());
|
||||
}
|
||||
}
|
||||
return sumCases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -100,8 +100,9 @@ public:
|
||||
void assignIdToCaseGroup(RimIdenticalGridCaseGroup* caseGroup);
|
||||
|
||||
void allCases(std::vector<RimCase*>& cases);
|
||||
void allSummaryCases(std::vector<RimSummaryCase*>& sumCases);
|
||||
void allObservedData(std::vector<RimSummaryCase*>& observedData);
|
||||
|
||||
std::vector<RimSummaryCase*> allSummaryCases() const;
|
||||
|
||||
void allNotLinkedViews(std::vector<RimView*>& views);
|
||||
void allVisibleViews(std::vector<RimView*>& views);
|
||||
|
||||
|
@ -312,19 +312,23 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
RimWellLogPlotCollection* wellLogCollection = mainPlotCollection->wellLogPlotCollection();
|
||||
|
||||
cvf::ref<RigEclipseWellLogExtractor> eclExtractor;
|
||||
if ( m_trajectoryType == WELL_PATH )
|
||||
|
||||
if (eclipseCase)
|
||||
{
|
||||
eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_branchIndex >= 0 && m_branchIndex < static_cast<int>(m_generatedSimulationWellPathBranches.size()) )
|
||||
if (m_trajectoryType == WELL_PATH)
|
||||
{
|
||||
eclExtractor = wellLogCollection->findOrCreateSimWellExtractor(m_simWellName,
|
||||
eclipseCase->caseUserDescription(),
|
||||
m_generatedSimulationWellPathBranches[m_branchIndex].p(),
|
||||
eclipseCase->eclipseCaseData());
|
||||
isUsingPseudoLength = true;
|
||||
eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_branchIndex >= 0 && m_branchIndex < static_cast<int>(m_generatedSimulationWellPathBranches.size()))
|
||||
{
|
||||
eclExtractor = wellLogCollection->findOrCreateSimWellExtractor(m_simWellName,
|
||||
eclipseCase->caseUserDescription(),
|
||||
m_generatedSimulationWellPathBranches[m_branchIndex].p(),
|
||||
eclipseCase->eclipseCaseData());
|
||||
isUsingPseudoLength = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, geomCase);
|
||||
@ -335,7 +339,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
|
||||
RiaDefines::DepthUnitType depthUnit = RiaDefines::UNIT_METER;
|
||||
|
||||
if (eclExtractor.notNull())
|
||||
if (eclExtractor.notNull() && eclipseCase)
|
||||
{
|
||||
measuredDepthValues = eclExtractor->measuredDepth();
|
||||
tvDepthValues = eclExtractor->trueVerticalDepth();
|
||||
|
@ -465,8 +465,10 @@ RifReaderEclipseRft* RimWellLogRftCurve::rftReader() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseWellLogExtractor* RimWellLogRftCurve::extractor()
|
||||
{
|
||||
if (!m_eclipseResultCase()) return nullptr;
|
||||
RifReaderEclipseRft* reader = rftReader();
|
||||
if (!reader) return nullptr;
|
||||
|
||||
|
||||
RimMainPlotCollection* mainPlotCollection;
|
||||
this->firstAncestorOrThisOfTypeAsserted(mainPlotCollection);
|
||||
|
@ -788,7 +788,7 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
{
|
||||
uiOrdering.add(&m_userName);
|
||||
|
||||
caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Formation Names Properties");
|
||||
caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Formation Names");
|
||||
|
||||
formationGroup->add(&m_showFormations);
|
||||
|
||||
@ -978,7 +978,8 @@ RigEclipseWellLogExtractor* RimWellLogTrack::createSimWellExtractor(RimWellLogPl
|
||||
if (!wellLogCollection) return nullptr;
|
||||
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(rimCase);
|
||||
|
||||
if (!eclipseCase) return nullptr;
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<const RigWellPath*> wellPaths = proj->simulationWellBranches(simWellName);
|
||||
|
||||
|
@ -168,11 +168,11 @@ private:
|
||||
cvf::ref<RivWellPathPartMgr> m_wellPathPartMgr;
|
||||
caf::PdmField<QString> m_name;
|
||||
|
||||
caf::PdmField<QString> m_wellPathFormationFilePath;
|
||||
caf::PdmField<QString> m_formationKeyInFile;
|
||||
|
||||
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
|
||||
|
||||
caf::PdmField<QString> m_wellPathFormationFilePath;
|
||||
|
||||
caf::PdmChildField<RimWellLogFile*> m_wellLogFile_OBSOLETE;
|
||||
|
||||
|
@ -38,6 +38,11 @@ RimCsvUserData::RimCsvUserData()
|
||||
{
|
||||
CAF_PDM_InitObject("Observed CSV Data File", ":/Default.png", "", "");
|
||||
m_summaryHeaderFilename.uiCapability()->setUiName("File");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_parseOptions, "ParseOptions", "", "", "", "");
|
||||
m_parseOptions = new RicPasteAsciiDataToSummaryPlotFeatureUi();
|
||||
m_parseOptions->uiCapability()->setUiHidden(true);
|
||||
m_parseOptions->uiCapability()->setUiTreeHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -58,7 +63,7 @@ void RimCsvUserData::createSummaryReaderInterface()
|
||||
if (caf::Utils::fileExists(this->summaryHeaderFilename()))
|
||||
{
|
||||
RifCsvUserData* csvUserData = new RifCsvUserData();
|
||||
if (csvUserData->parse(this->summaryHeaderFilename(), m_parseOptions, &m_errorText))
|
||||
if (csvUserData->parse(this->summaryHeaderFilename(), m_parseOptions->parseOptions() , &m_errorText))
|
||||
{
|
||||
m_summaryReader = csvUserData;
|
||||
}
|
||||
@ -88,7 +93,7 @@ QString RimCsvUserData::errorMessagesFromReader()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCsvUserData::setParseOptions(const AsciiDataParseOptions &parseOptions)
|
||||
RicPasteAsciiDataToSummaryPlotFeatureUi* RimCsvUserData::parseOptions() const
|
||||
{
|
||||
m_parseOptions = parseOptions;
|
||||
return m_parseOptions();
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
class RifSummaryReaderInterface;
|
||||
@ -44,10 +45,10 @@ public:
|
||||
|
||||
virtual QString errorMessagesFromReader() override;
|
||||
|
||||
void setParseOptions(const AsciiDataParseOptions &parseOptions);
|
||||
RicPasteAsciiDataToSummaryPlotFeatureUi* parseOptions() const;
|
||||
|
||||
private:
|
||||
caf::PdmChildField<RicPasteAsciiDataToSummaryPlotFeatureUi*> m_parseOptions;
|
||||
cvf::ref<RifSummaryReaderInterface> m_summaryReader;
|
||||
QString m_errorText;
|
||||
AsciiDataParseOptions m_parseOptions;
|
||||
};
|
||||
|
@ -77,44 +77,6 @@ void RimObservedDataCollection::addObservedData(RimObservedData* observedData)
|
||||
m_observedDataArray.push_back(observedData);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimObservedData* RimObservedDataCollection::createAndAddObservedDataFromFileName(const QString& fileName, QString* errorText)
|
||||
{
|
||||
RimObservedData* observedData = nullptr;
|
||||
|
||||
{
|
||||
QFile file(fileName);
|
||||
if (!file.exists())
|
||||
{
|
||||
QString s = QString("File does not exist, %1").arg(fileName);
|
||||
RiaLogging::error(s);
|
||||
|
||||
if (errorText) errorText->append(s);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (fileName.endsWith(".rsm", Qt::CaseInsensitive))
|
||||
{
|
||||
return createAndAddRsmObservedDataFromFile(fileName, errorText);
|
||||
}
|
||||
else if (fileName.endsWith(".txt", Qt::CaseInsensitive) || fileName.endsWith(".csv", Qt::CaseInsensitive))
|
||||
{
|
||||
return createAndAddCvsObservedDataFromFile(fileName, errorText);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (errorText)
|
||||
{
|
||||
errorText->append("Not able to import file. Make sure '*.rsm' is used as extension if data is in RMS format or '*.txt' or '*.csv' if data is in CSV format.");
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -127,11 +89,30 @@ std::vector<RimSummaryCase*> RimObservedDataCollection::allObservedData()
|
||||
return allObservedData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimObservedDataCollection::fileExists(const QString& fileName, QString* errorText /*= nullptr*/)
|
||||
{
|
||||
QFile file(fileName);
|
||||
if (!file.exists())
|
||||
{
|
||||
QString s = QString("File does not exist, %1").arg(fileName);
|
||||
RiaLogging::error(s);
|
||||
|
||||
if (errorText) errorText->append(s);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimObservedData* RimObservedDataCollection::createAndAddRsmObservedDataFromFile(const QString& fileName, QString* errorText /*= nullptr*/)
|
||||
{
|
||||
if (!fileExists(fileName, errorText)) return nullptr;
|
||||
|
||||
RimObservedData* observedData = nullptr;
|
||||
RimObservedEclipseUserData* columnBasedUserData = new RimObservedEclipseUserData();
|
||||
observedData = columnBasedUserData;
|
||||
@ -162,48 +143,58 @@ RimObservedData* RimObservedDataCollection::createAndAddRsmObservedDataFromFile(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimObservedData* RimObservedDataCollection::createAndAddCvsObservedDataFromFile(const QString& fileName, QString* errorText /*= nullptr*/)
|
||||
RimObservedData* RimObservedDataCollection::createAndAddCvsObservedDataFromFile(const QString& fileName, bool useSavedFieldsValuesInDialog, QString* errorText /*= nullptr*/)
|
||||
{
|
||||
if (!fileExists(fileName, errorText)) return nullptr;
|
||||
|
||||
RimObservedData* observedData = nullptr;
|
||||
bool parseOk = false;
|
||||
|
||||
RicPasteAsciiDataToSummaryPlotFeatureUi parseOptionsUi;
|
||||
parseOptionsUi.setUiModeImport(fileName);
|
||||
RimCsvUserData* userData = new RimCsvUserData();
|
||||
RicPasteAsciiDataToSummaryPlotFeatureUi* parseOptions = userData->parseOptions();
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(NULL, &parseOptionsUi, "CSV Import Options", "");
|
||||
if (useSavedFieldsValuesInDialog)
|
||||
{
|
||||
caf::PdmSettings::readFieldsFromApplicationStore(parseOptions);
|
||||
}
|
||||
parseOptions->setUiModeImport(fileName);
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(NULL, parseOptions, "CSV Import Options", "");
|
||||
if (propertyDialog.exec() != QDialog::Accepted)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RimCsvUserData* columnBasedUserData = new RimCsvUserData();
|
||||
columnBasedUserData->setParseOptions(parseOptionsUi.parseOptions());
|
||||
observedData = columnBasedUserData;
|
||||
caf::PdmSettings::writeFieldsToApplicationStore(parseOptions);
|
||||
|
||||
observedData->setSummaryHeaderFileName(fileName);
|
||||
observedData->createSummaryReaderInterface();
|
||||
observedData->updateMetaData();
|
||||
observedData->updateOptionSensitivity();
|
||||
//userData->setParseOptions(parseOptionsUi.parseOptions());
|
||||
userData->setSummaryHeaderFileName(fileName);
|
||||
userData->createSummaryReaderInterface();
|
||||
userData->updateMetaData();
|
||||
userData->updateOptionSensitivity();
|
||||
|
||||
if (errorText && !observedData->errorMessagesFromReader().isEmpty())
|
||||
if (errorText && !userData->errorMessagesFromReader().isEmpty())
|
||||
{
|
||||
errorText->append(observedData->errorMessagesFromReader());
|
||||
errorText->append(userData->errorMessagesFromReader());
|
||||
}
|
||||
|
||||
if (observedData->summaryReader())
|
||||
if (userData->summaryReader())
|
||||
{
|
||||
this->m_observedDataArray.push_back(observedData);
|
||||
this->m_observedDataArray.push_back(userData);
|
||||
observedData = userData;
|
||||
parseOk = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete columnBasedUserData;
|
||||
delete userData;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||
if (mainPlotWindow)
|
||||
{
|
||||
mainPlotWindow->selectAsCurrentItem(observedData);
|
||||
mainPlotWindow->setExpanded(observedData);
|
||||
mainPlotWindow->selectAsCurrentItem(userData);
|
||||
mainPlotWindow->setExpanded(userData);
|
||||
}
|
||||
|
||||
this->updateConnectedEditors();
|
||||
|
@ -38,12 +38,12 @@ public:
|
||||
|
||||
void removeObservedData(RimObservedData* observedData);
|
||||
void addObservedData(RimObservedData* observedData);
|
||||
RimObservedData* createAndAddObservedDataFromFileName(const QString& fileName, QString* errorText = nullptr);
|
||||
RimObservedData* createAndAddRsmObservedDataFromFile(const QString& fileName, QString* errorText = nullptr);
|
||||
RimObservedData* createAndAddCvsObservedDataFromFile(const QString& fileName, bool useSavedFieldsValuesInDialog, QString* errorText = nullptr);
|
||||
std::vector<RimSummaryCase*> allObservedData();
|
||||
|
||||
private:
|
||||
RimObservedData* createAndAddRsmObservedDataFromFile(const QString& fileName, QString* errorText = nullptr);
|
||||
RimObservedData* createAndAddCvsObservedDataFromFile(const QString& fileName, QString* errorText = nullptr);
|
||||
bool fileExists(const QString& fileName, QString* errorText = nullptr);
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimObservedData*> m_observedDataArray;
|
||||
|
@ -191,6 +191,16 @@ RifEclipseSummaryAddress RimSummaryCurve::summaryAddressX() const
|
||||
return m_xValuesCurveVariable->address();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::setSummaryAddressX(const RifEclipseSummaryAddress& address)
|
||||
{
|
||||
m_xValuesCurveVariable->setAddress(address);
|
||||
|
||||
// TODO: Should interpolation be computed similar to RimSummaryCurve::setSummaryAddressY
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -283,6 +293,22 @@ const std::vector<time_t>& RimSummaryCurve::timeStepsY() const
|
||||
return reader->timeSteps(addr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::setSummaryCaseX(RimSummaryCase* sumCase)
|
||||
{
|
||||
m_xValuesSummaryCase = sumCase;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCase* RimSummaryCurve::summaryCaseX() const
|
||||
{
|
||||
return m_xValuesSummaryCase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -311,9 +337,8 @@ QList<caf::PdmOptionItemInfo> RimSummaryCurve::calculateValueOptions(const caf::
|
||||
fieldNeedingOptions == &m_xValuesSummaryCase)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
|
||||
proj->allSummaryCases(cases);
|
||||
std::vector<RimSummaryCase*> cases = proj->allSummaryCases();
|
||||
|
||||
cases.push_back(proj->calculationCollection->calculationSummaryCase());
|
||||
|
||||
@ -480,7 +505,7 @@ void RimSummaryCurve::defineEditorAttribute(const caf::PdmFieldHandle* field, QS
|
||||
caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*> (attribute);
|
||||
if (attrib)
|
||||
{
|
||||
attrib->m_buttonText = "Select Vector...";
|
||||
attrib->m_buttonText = "Vector Selection Dialog";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -505,8 +530,8 @@ void RimSummaryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
curveVarSelectionGroup->setCollapsedByDefault(true);
|
||||
m_yValuesSummaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
|
||||
curveVarSelectionGroup->add(&m_yValuesUiFilterResultSelection);
|
||||
curveVarSelectionGroup->add(&m_yPushButtonSelectSummaryAddress);
|
||||
|
||||
curveDataGroup->add(&m_yPushButtonSelectSummaryAddress);
|
||||
curveDataGroup->add(&m_plotAxis);
|
||||
}
|
||||
|
||||
@ -521,7 +546,7 @@ void RimSummaryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
m_xValuesSummaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
|
||||
curveVarSelectionGroup->add(&m_xValuesUiFilterResultSelection);
|
||||
|
||||
curveDataGroup->add(&m_xPushButtonSelectSummaryAddress);
|
||||
curveVarSelectionGroup->add(&m_xPushButtonSelectSummaryAddress);
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,7 +63,10 @@ public:
|
||||
const std::vector<time_t>& timeStepsY() const;
|
||||
|
||||
// X Axis functions
|
||||
void setSummaryCaseX(RimSummaryCase* sumCase);
|
||||
RimSummaryCase* summaryCaseX() const;
|
||||
RifEclipseSummaryAddress summaryAddressX() const;
|
||||
void setSummaryAddressX(const RifEclipseSummaryAddress& address);
|
||||
std::string unitNameX() const;
|
||||
std::vector<double> valuesX() const;
|
||||
|
||||
|
@ -25,15 +25,18 @@
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlotSourceStepping.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotSourceStepping.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
#include "cafPdmUiTreeViewEditor.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryCurveCollection, "RimSummaryCurveCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -50,11 +53,26 @@ RimSummaryCurveCollection::RimSummaryCurveCollection()
|
||||
CAF_PDM_InitField(&m_showCurves, "IsActive", true, "Show Curves", "", "", "");
|
||||
m_showCurves.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_sourceStepping, "SourceStepping", "Plot Source Stepping", "", "", "");
|
||||
m_sourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_sourceStepping.uiCapability()->setUiHidden(true);
|
||||
m_sourceStepping.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_sourceStepping.xmlCapability()->disableIO();
|
||||
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();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_xSourceStepping, "XSourceStepping", "", "", "", "");
|
||||
m_xSourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_xSourceStepping->setSourceSteppingType(RimSummaryPlotSourceStepping::X_AXIS);
|
||||
m_xSourceStepping.uiCapability()->setUiHidden(true);
|
||||
m_xSourceStepping.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_xSourceStepping.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_unionSourceStepping, "UnionSourceStepping", "", "", "", "");
|
||||
m_unionSourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_unionSourceStepping->setSourceSteppingType(RimSummaryPlotSourceStepping::UNION_X_Y_AXIS);
|
||||
m_unionSourceStepping.uiCapability()->setUiHidden(true);
|
||||
m_unionSourceStepping.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_unionSourceStepping.xmlCapability()->disableIO();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -226,28 +244,20 @@ void RimSummaryCurveCollection::setCurrentSummaryCurve(RimSummaryCurve* curve)
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::applyNextIdentifier()
|
||||
{
|
||||
m_sourceStepping->applyNextIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::applyPreviousIdentifier()
|
||||
{
|
||||
m_sourceStepping->applyPreviousIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<caf::PdmFieldHandle*> RimSummaryCurveCollection::fieldsToShowInToolbar()
|
||||
{
|
||||
return m_sourceStepping()->fieldsToShowInToolbar();
|
||||
RimSummaryCrossPlot* parentCrossPlot;
|
||||
firstAncestorOrThisOfType(parentCrossPlot);
|
||||
|
||||
if (parentCrossPlot)
|
||||
{
|
||||
return m_unionSourceStepping->fieldsToShowInToolbar();
|
||||
}
|
||||
|
||||
return m_ySourceStepping()->fieldsToShowInToolbar();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -257,7 +267,16 @@ QString RimSummaryCurveCollection::compileAutoPlotTitle() const
|
||||
{
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
|
||||
analyzer.analyzeCurves(this);
|
||||
std::set<RifEclipseSummaryAddress> addresses;
|
||||
for (auto c : m_curves)
|
||||
{
|
||||
addresses.insert(c->summaryAddressY());
|
||||
|
||||
// TODO : Improve how cross plot curves contribute to title
|
||||
// Suggestion : Delegate to RimSummaryPlotSourceStepping to find title
|
||||
}
|
||||
|
||||
analyzer.analyzeAdresses(addresses);
|
||||
|
||||
auto quantities = analyzer.quantities();
|
||||
auto wellNames = analyzer.wellNames();
|
||||
@ -286,6 +305,72 @@ QString RimSummaryCurveCollection::compileAutoPlotTitle() const
|
||||
return title;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::handleKeyPressEvent(QKeyEvent* keyEvent)
|
||||
{
|
||||
if (!keyEvent) return;
|
||||
|
||||
RimSummaryPlotSourceStepping* sourceStepping = nullptr;
|
||||
{
|
||||
RimSummaryCrossPlot* summaryCrossPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(summaryCrossPlot);
|
||||
|
||||
if (summaryCrossPlot)
|
||||
{
|
||||
sourceStepping = m_unionSourceStepping();
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceStepping = m_ySourceStepping();
|
||||
}
|
||||
}
|
||||
|
||||
if (keyEvent->key() == Qt::Key_PageUp)
|
||||
{
|
||||
if (keyEvent->modifiers() & Qt::ShiftModifier)
|
||||
{
|
||||
sourceStepping->applyPrevCase();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
else if (keyEvent->modifiers() & Qt::ControlModifier)
|
||||
{
|
||||
sourceStepping->applyPrevOtherIdentifier();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceStepping->applyPrevQuantity();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
}
|
||||
else if (keyEvent->key() == Qt::Key_PageDown)
|
||||
{
|
||||
if (keyEvent->modifiers() & Qt::ShiftModifier)
|
||||
{
|
||||
sourceStepping->applyNextCase();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
else if (keyEvent->modifiers() & Qt::ControlModifier)
|
||||
{
|
||||
sourceStepping->applyNextOtherIdentifier();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceStepping->applyNextQuantity();
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -302,9 +387,35 @@ void RimSummaryCurveCollection::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup("Plot Source Stepping");
|
||||
RimSummaryCrossPlot* parentCrossPlot;
|
||||
firstAncestorOrThisOfType(parentCrossPlot);
|
||||
|
||||
m_sourceStepping()->uiOrdering(uiConfigName, *group);
|
||||
if (parentCrossPlot)
|
||||
{
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup("Y Source Stepping");
|
||||
|
||||
m_ySourceStepping()->uiOrdering(uiConfigName, *group);
|
||||
}
|
||||
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup("X Source Stepping");
|
||||
|
||||
m_xSourceStepping()->uiOrdering(uiConfigName, *group);
|
||||
}
|
||||
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup("XY Union Source Stepping");
|
||||
|
||||
m_unionSourceStepping()->uiOrdering(uiConfigName, *group);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup("Plot Source Stepping");
|
||||
|
||||
m_ySourceStepping()->uiOrdering(uiConfigName, *group);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -30,6 +30,7 @@ class QwtPlotCurve;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryCurve;
|
||||
class RimSummaryPlotSourceStepping;
|
||||
class QKeyEvent;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -60,12 +61,12 @@ public:
|
||||
|
||||
void setCurrentSummaryCurve(RimSummaryCurve* curve);
|
||||
|
||||
void applyNextIdentifier();
|
||||
void applyPreviousIdentifier();
|
||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
QString compileAutoPlotTitle() const;
|
||||
|
||||
void handleKeyPressEvent(QKeyEvent* keyEvent);
|
||||
|
||||
private:
|
||||
caf::PdmFieldHandle* objectToggleField();
|
||||
virtual void defineObjectEditorAttribute(QString uiConfigName,
|
||||
@ -80,7 +81,10 @@ private:
|
||||
caf::PdmField<bool> m_showCurves;
|
||||
caf::PdmChildArrayField<RimSummaryCurve*> m_curves;
|
||||
|
||||
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_sourceStepping;
|
||||
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_ySourceStepping;
|
||||
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_xSourceStepping;
|
||||
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_unionSourceStepping;
|
||||
|
||||
caf::PdmPointer<RimSummaryCurve> m_currentSummaryCurve;
|
||||
};
|
||||
|
||||
|
@ -199,7 +199,7 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
for (RimSummaryCurve* rimCurve : m_summaryCurves)
|
||||
{
|
||||
unitToQuantityNameMap[rimCurve->unitNameX()].insert(rimCurve->summaryAddressX().quantityName());
|
||||
unitToQuantityNameMap[rimCurve->unitNameX()].insert(rimCurve->curveName().toStdString());
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -208,7 +208,7 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
if ( rimCurve->axisY() == this->m_axisProperties->plotAxisType() )
|
||||
{
|
||||
unitToQuantityNameMap[rimCurve->unitNameY()].insert(rimCurve->summaryAddressY().quantityName());
|
||||
unitToQuantityNameMap[rimCurve->unitNameY()].insert(rimCurve->curveName().toStdString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -496,22 +496,6 @@ void RimSummaryPlot::updatePlotTitle()
|
||||
updateMdiWindowTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::applyNextIdentifier()
|
||||
{
|
||||
m_summaryCurveCollection->applyNextIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::applyPreviousIdentifier()
|
||||
{
|
||||
m_summaryCurveCollection->applyPreviousIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -103,9 +103,6 @@ public:
|
||||
|
||||
void updatePlotTitle();
|
||||
|
||||
void applyNextIdentifier();
|
||||
void applyPreviousIdentifier();
|
||||
|
||||
// RimViewWindow overrides
|
||||
public:
|
||||
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
|
@ -24,14 +24,16 @@
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuMainPlotWindow.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiItem.h"
|
||||
#include "cafPdmUiListEditor.h"
|
||||
@ -41,7 +43,7 @@ CAF_PDM_SOURCE_INIT(RimSummaryPlotSourceStepping, "RimSummaryCurveCollectionModi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
||||
RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping() : m_sourceSteppingType(Y_AXIS)
|
||||
{
|
||||
// clang-format off
|
||||
CAF_PDM_InitObject("Summary Curves Modifier", "", "", "");
|
||||
@ -51,115 +53,136 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellGroupName, "GroupName", "Group Name", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_region, "Region", "Region", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_quantity, "Quantities", "Quantity", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_placeholderForLabel, "Placeholder", "", "", "", "");
|
||||
m_placeholderForLabel = "No common identifiers detected";
|
||||
m_placeholderForLabel.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
m_placeholderForLabel.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellNameProxy, "WellNameProxy", "WellNameProxy", "", "", "");
|
||||
m_wellNameProxy.registerGetMethod(this, &RimSummaryPlotSourceStepping::wellName);
|
||||
m_wellNameProxy.registerSetMethod(this, &RimSummaryPlotSourceStepping::setWellName);
|
||||
m_wellNameProxy.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
||||
m_wellNameProxy.uiCapability()->setUiHidden(true);
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyNextIdentifier()
|
||||
void RimSummaryPlotSourceStepping::setSourceSteppingType(SourceSteppingType sourceSteppingType)
|
||||
{
|
||||
updateUiFromCurves();
|
||||
m_sourceSteppingType = sourceSteppingType;
|
||||
}
|
||||
|
||||
caf::PdmValueField* valueField = valueFieldToModify();
|
||||
if (valueField)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyNextCase()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
auto summaryCases = proj->allSummaryCases();
|
||||
if (summaryCases.size() < 1)
|
||||
return;
|
||||
|
||||
auto currentCase = std::find(summaryCases.begin(), summaryCases.end(), m_summaryCase());
|
||||
|
||||
if (currentCase != summaryCases.end())
|
||||
{
|
||||
bool useOptionsOnly = true;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options = calculateValueOptions(valueField, nullptr);
|
||||
if (options.isEmpty())
|
||||
currentCase++;
|
||||
if (currentCase != summaryCases.end())
|
||||
{
|
||||
return;
|
||||
m_summaryCase = *currentCase;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryCase = summaryCases[0];
|
||||
}
|
||||
|
||||
auto uiVariant = valueField->uiCapability()->toUiBasedQVariant();
|
||||
fieldChangedByUi(&m_summaryCase, QVariant(), QVariant());
|
||||
m_summaryCase.uiCapability()->updateConnectedEditors();
|
||||
|
||||
int currentIndex = -1;
|
||||
for (int i = 0; i < options.size(); i++)
|
||||
{
|
||||
if (uiVariant == options[i].optionUiText())
|
||||
{
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
||||
|
||||
if (currentIndex == -1)
|
||||
{
|
||||
currentIndex = 0;
|
||||
}
|
||||
curveCollection->updateConnectedEditors();
|
||||
}
|
||||
|
||||
int nextIndex = currentIndex + 1;
|
||||
if (nextIndex >= options.size() - 1)
|
||||
{
|
||||
nextIndex = 0;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyPrevCase()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
auto optionValue = options[nextIndex].value();
|
||||
auto summaryCases = proj->allSummaryCases();
|
||||
if (summaryCases.size() < 1)
|
||||
return;
|
||||
|
||||
QVariant currentValue = valueField->toQVariant();
|
||||
auto currentCase = std::find(summaryCases.begin(), summaryCases.end(), m_summaryCase());
|
||||
|
||||
valueField->setFromQVariant(optionValue);
|
||||
if (currentCase != summaryCases.end() && currentCase != summaryCases.begin())
|
||||
{
|
||||
currentCase--;
|
||||
m_summaryCase = *currentCase;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryCase = summaryCases[0];
|
||||
}
|
||||
|
||||
valueField->uiCapability()->notifyFieldChanged(currentValue, optionValue);
|
||||
fieldChangedByUi(&m_summaryCase, QVariant(), QVariant());
|
||||
m_summaryCase.uiCapability()->updateConnectedEditors();
|
||||
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
||||
|
||||
curveCollection->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyNextQuantity()
|
||||
{
|
||||
if (!m_quantity.uiCapability()->isUiHidden())
|
||||
{
|
||||
modifyCurrentIndex(&m_quantity, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyPreviousIdentifier()
|
||||
void RimSummaryPlotSourceStepping::applyPrevQuantity()
|
||||
{
|
||||
updateUiFromCurves();
|
||||
|
||||
caf::PdmValueField* valueField = valueFieldToModify();
|
||||
if (valueField)
|
||||
if (!m_quantity.uiCapability()->isUiHidden())
|
||||
{
|
||||
bool useOptionsOnly = true;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options = calculateValueOptions(valueField, nullptr);
|
||||
if (options.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto uiVariant = valueField->uiCapability()->toUiBasedQVariant();
|
||||
|
||||
int currentIndex = -1;
|
||||
for (int i = 0; i < options.size(); i++)
|
||||
{
|
||||
if (uiVariant == options[i].optionUiText())
|
||||
{
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentIndex == -1)
|
||||
{
|
||||
currentIndex = 0;
|
||||
}
|
||||
|
||||
int nextIndex = currentIndex - 1;
|
||||
if (nextIndex < 0)
|
||||
{
|
||||
nextIndex = options.size() - 1;
|
||||
}
|
||||
|
||||
auto optionValue = options[nextIndex].value();
|
||||
|
||||
QVariant currentValue = valueField->toQVariant();
|
||||
|
||||
valueField->setFromQVariant(optionValue);
|
||||
|
||||
valueField->uiCapability()->notifyFieldChanged(currentValue, optionValue);
|
||||
modifyCurrentIndex(&m_quantity, -1);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyNextOtherIdentifier()
|
||||
{
|
||||
caf::PdmValueField* valueField = fieldToModify();
|
||||
if (!valueField)
|
||||
return;
|
||||
|
||||
modifyCurrentIndex(valueField, 1);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyPrevOtherIdentifier()
|
||||
{
|
||||
caf::PdmValueField* valueField = fieldToModify();
|
||||
if (!valueField)
|
||||
return;
|
||||
|
||||
modifyCurrentIndex(valueField, -1);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -167,16 +190,18 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::fieldsToShowInTo
|
||||
{
|
||||
std::vector<caf::PdmFieldHandle*> fields;
|
||||
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
||||
auto sumCases = allSummaryCasesUsedInCurveCollection();
|
||||
if (sumCases.size() == 1)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allSummaryCases().size() > 1)
|
||||
{
|
||||
fields.push_back(&m_summaryCase);
|
||||
}
|
||||
}
|
||||
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
analyzer.analyzeCurves(curveCollection);
|
||||
|
||||
if (analyzer.summaryCases().size() == 1)
|
||||
{
|
||||
fields.push_back(&m_summaryCase);
|
||||
}
|
||||
analyzer.analyzeAdresses(allAddressesUsedInCurveCollection());
|
||||
|
||||
if (analyzer.wellNames().size() == 1)
|
||||
{
|
||||
@ -215,20 +240,19 @@ void RimSummaryPlotSourceStepping::defineUiOrdering(QString uiConfigName, caf::P
|
||||
QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
{
|
||||
if (fieldNeedingOptions == &m_placeholderForLabel)
|
||||
{
|
||||
return QList<caf::PdmOptionItemInfo>();
|
||||
}
|
||||
|
||||
if (fieldNeedingOptions == &m_summaryCase)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
RimSummaryCaseMainCollection* sumCaseColl =
|
||||
proj->activeOilField() ? proj->activeOilField()->summaryCaseMainCollection() : nullptr;
|
||||
if (sumCaseColl)
|
||||
for (auto sumCase : proj->allSummaryCases())
|
||||
{
|
||||
for (auto sumCase : sumCaseColl->allSummaryCases())
|
||||
{
|
||||
options.append(caf::PdmOptionItemInfo(sumCase->caseName(), sumCase));
|
||||
}
|
||||
options.append(caf::PdmOptionItemInfo(sumCase->caseName(), sumCase));
|
||||
}
|
||||
|
||||
return options;
|
||||
@ -239,22 +263,19 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
|
||||
RifSummaryReaderInterface* reader = summaryReader();
|
||||
if (reader)
|
||||
{
|
||||
const std::vector<RifEclipseSummaryAddress> allAddresses = reader->allResultAddresses();
|
||||
RiaSummaryCurveAnalyzer* analyzer = analyzerForReader(reader);
|
||||
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
analyzer.analyzeAdresses(allAddresses);
|
||||
|
||||
if (fieldNeedingOptions == &m_wellName || fieldNeedingOptions == &m_wellNameProxy)
|
||||
if (fieldNeedingOptions == &m_wellName)
|
||||
{
|
||||
identifierTexts = analyzer.identifierTexts(RifEclipseSummaryAddress::SUMMARY_WELL);
|
||||
identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_WELL);
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_region)
|
||||
{
|
||||
identifierTexts = analyzer.identifierTexts(RifEclipseSummaryAddress::SUMMARY_REGION);
|
||||
identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_REGION);
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_wellGroupName)
|
||||
{
|
||||
identifierTexts = analyzer.identifierTexts(RifEclipseSummaryAddress::SUMMARY_WELL_GROUP);
|
||||
identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_WELL_GROUP);
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_quantity)
|
||||
{
|
||||
@ -270,7 +291,7 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
|
||||
|
||||
RiaSummaryCurveAnalyzer quantityAnalyzer;
|
||||
|
||||
auto subset = RiaSummaryCurveAnalyzer::addressesForCategory(allAddresses, category);
|
||||
auto subset = RiaSummaryCurveAnalyzer::addressesForCategory(reader->allResultAddresses(), category);
|
||||
quantityAnalyzer.analyzeAdresses(subset);
|
||||
|
||||
for (const auto& quantity : quantityAnalyzer.quantities())
|
||||
@ -313,22 +334,44 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
||||
{
|
||||
for (auto curve : curveCollection->curves())
|
||||
{
|
||||
curve->setSummaryCaseY(m_summaryCase);
|
||||
if (isYAxisStepping())
|
||||
{
|
||||
curve->setSummaryCaseY(m_summaryCase);
|
||||
}
|
||||
|
||||
if (isXAxisStepping())
|
||||
{
|
||||
curve->setSummaryCaseX(m_summaryCase);
|
||||
}
|
||||
}
|
||||
|
||||
triggerLoadDataAndUpdate = true;
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_wellName || changedField == &m_wellNameProxy)
|
||||
else if (changedField == &m_wellName)
|
||||
{
|
||||
for (auto curve : curveCollection->curves())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL)
|
||||
if (isYAxisStepping())
|
||||
{
|
||||
adr.setWellName(m_wellName().toStdString());
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL)
|
||||
{
|
||||
adr.setWellName(m_wellName().toStdString());
|
||||
|
||||
curve->setSummaryAddressY(adr);
|
||||
curve->setSummaryAddressY(adr);
|
||||
}
|
||||
}
|
||||
|
||||
if (isXAxisStepping())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL)
|
||||
{
|
||||
adr.setWellName(m_wellName().toStdString());
|
||||
|
||||
curve->setSummaryAddressX(adr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,12 +381,26 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
||||
{
|
||||
for (auto curve : curveCollection->curves())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_REGION)
|
||||
if (isYAxisStepping())
|
||||
{
|
||||
adr.setRegion(m_region());
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_REGION)
|
||||
{
|
||||
adr.setRegion(m_region());
|
||||
|
||||
curve->setSummaryAddressY(adr);
|
||||
curve->setSummaryAddressY(adr);
|
||||
}
|
||||
}
|
||||
|
||||
if (isXAxisStepping())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_REGION)
|
||||
{
|
||||
adr.setRegion(m_region());
|
||||
|
||||
curve->setSummaryAddressX(adr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -353,9 +410,21 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
||||
{
|
||||
for (auto curve : curveCollection->curves())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
adr.setQuantityName(m_quantity().toStdString());
|
||||
curve->setSummaryAddressY(adr);
|
||||
if (isYAxisStepping())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
adr.setQuantityName(m_quantity().toStdString());
|
||||
|
||||
curve->setSummaryAddressY(adr);
|
||||
}
|
||||
|
||||
if (isXAxisStepping())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
||||
adr.setQuantityName(m_quantity().toStdString());
|
||||
|
||||
curve->setSummaryAddressX(adr);
|
||||
}
|
||||
}
|
||||
|
||||
triggerLoadDataAndUpdate = true;
|
||||
@ -364,12 +433,26 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
||||
{
|
||||
for (auto curve : curveCollection->curves())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
||||
if (isYAxisStepping())
|
||||
{
|
||||
adr.setWellGroupName(m_wellGroupName().toStdString());
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
||||
{
|
||||
adr.setWellGroupName(m_wellGroupName().toStdString());
|
||||
|
||||
curve->setSummaryAddressY(adr);
|
||||
curve->setSummaryAddressY(adr);
|
||||
}
|
||||
}
|
||||
|
||||
if (isXAxisStepping())
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
||||
if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
||||
{
|
||||
adr.setWellGroupName(m_wellGroupName().toStdString());
|
||||
|
||||
curve->setSummaryAddressX(adr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,8 +465,18 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
|
||||
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
||||
|
||||
summaryPlot->updatePlotTitle();
|
||||
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
|
||||
RimSummaryCrossPlot* summaryCrossPlot = dynamic_cast<RimSummaryCrossPlot*>(summaryPlot);
|
||||
if (summaryCrossPlot)
|
||||
{
|
||||
// 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
|
||||
curveCollection->updateConnectedEditors();
|
||||
|
||||
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||
mainPlotWindow->updateSummaryPlotToolBar();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -412,7 +505,15 @@ RimSummaryCase* RimSummaryPlotSourceStepping::singleSummaryCase() const
|
||||
std::set<RimSummaryCase*> cases;
|
||||
for (auto curve : curveCollection->curves())
|
||||
{
|
||||
cases.insert(curve->summaryCaseY());
|
||||
if (isYAxisStepping())
|
||||
{
|
||||
cases.insert(curve->summaryCaseY());
|
||||
}
|
||||
|
||||
if (isXAxisStepping())
|
||||
{
|
||||
cases.insert(curve->summaryCaseX());
|
||||
}
|
||||
}
|
||||
|
||||
if (cases.size() == 1)
|
||||
@ -423,22 +524,6 @@ RimSummaryCase* RimSummaryPlotSourceStepping::singleSummaryCase() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryPlotSourceStepping::wellName() const
|
||||
{
|
||||
return m_wellName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::setWellName(const QString& wellName)
|
||||
{
|
||||
m_wellName.setValueWithFieldChanged(wellName);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -449,18 +534,29 @@ void RimSummaryPlotSourceStepping::updateUiFromCurves()
|
||||
m_wellGroupName.uiCapability()->setUiHidden(true);
|
||||
m_region.uiCapability()->setUiHidden(true);
|
||||
m_quantity.uiCapability()->setUiHidden(true);
|
||||
m_placeholderForLabel.uiCapability()->setUiHidden(true);
|
||||
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
||||
bool commonIdentifierFound = false;
|
||||
|
||||
auto sumCases = allSummaryCasesUsedInCurveCollection();
|
||||
if (sumCases.size() == 1)
|
||||
{
|
||||
if (sumCases.find(m_summaryCase) == sumCases.end())
|
||||
{
|
||||
m_summaryCase = *(sumCases.begin());
|
||||
}
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allSummaryCases().size() > 1)
|
||||
{
|
||||
m_summaryCase.uiCapability()->setUiHidden(false);
|
||||
|
||||
commonIdentifierFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
analyzer.analyzeCurves(curveCollection);
|
||||
|
||||
if (analyzer.summaryCases().size() == 1)
|
||||
{
|
||||
m_summaryCase = *(analyzer.summaryCases().begin());
|
||||
m_summaryCase.uiCapability()->setUiHidden(false);
|
||||
}
|
||||
analyzer.analyzeAdresses(allAddressesUsedInCurveCollection());
|
||||
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
{
|
||||
@ -477,6 +573,8 @@ void RimSummaryPlotSourceStepping::updateUiFromCurves()
|
||||
QString txt = QString::fromStdString(*(analyzer.wellNames().begin()));
|
||||
m_wellName = txt;
|
||||
m_wellName.uiCapability()->setUiHidden(false);
|
||||
|
||||
commonIdentifierFound = true;
|
||||
}
|
||||
|
||||
if (analyzer.wellGroupNames().size() == 1)
|
||||
@ -484,12 +582,16 @@ void RimSummaryPlotSourceStepping::updateUiFromCurves()
|
||||
QString txt = QString::fromStdString(*(analyzer.wellGroupNames().begin()));
|
||||
m_wellGroupName = txt;
|
||||
m_wellGroupName.uiCapability()->setUiHidden(false);
|
||||
|
||||
commonIdentifierFound = true;
|
||||
}
|
||||
|
||||
if (analyzer.regionNumbers().size() == 1)
|
||||
{
|
||||
m_region = *(analyzer.regionNumbers().begin());
|
||||
m_region.uiCapability()->setUiHidden(false);
|
||||
|
||||
commonIdentifierFound = true;
|
||||
}
|
||||
|
||||
if (analyzer.quantities().size() == 1)
|
||||
@ -497,20 +599,24 @@ void RimSummaryPlotSourceStepping::updateUiFromCurves()
|
||||
QString txt = QString::fromStdString(*(analyzer.quantities().begin()));
|
||||
m_quantity = txt;
|
||||
m_quantity.uiCapability()->setUiHidden(false);
|
||||
|
||||
commonIdentifierFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!commonIdentifierFound)
|
||||
{
|
||||
m_placeholderForLabel.uiCapability()->setUiHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimSummaryPlotSourceStepping::fieldToModify()
|
||||
caf::PdmValueField* RimSummaryPlotSourceStepping::fieldToModify()
|
||||
{
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
||||
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
analyzer.analyzeCurves(curveCollection);
|
||||
analyzer.analyzeAdresses(allAddressesUsedInCurveCollection());
|
||||
|
||||
if (analyzer.wellNames().size() == 1)
|
||||
{
|
||||
@ -519,7 +625,7 @@ caf::PdmFieldHandle* RimSummaryPlotSourceStepping::fieldToModify()
|
||||
|
||||
if (analyzer.wellGroupNames().size() == 1)
|
||||
{
|
||||
return &m_wellName;
|
||||
return &m_wellGroupName;
|
||||
}
|
||||
|
||||
if (analyzer.regionNumbers().size() == 1)
|
||||
@ -527,29 +633,153 @@ caf::PdmFieldHandle* RimSummaryPlotSourceStepping::fieldToModify()
|
||||
return &m_region;
|
||||
}
|
||||
|
||||
if (analyzer.quantities().size() == 1)
|
||||
{
|
||||
return &m_quantity;
|
||||
}
|
||||
|
||||
// A pointer field is no a value field, so this must be improved
|
||||
// to be able to step between summary cases
|
||||
if (analyzer.summaryCases().size() == 1)
|
||||
{
|
||||
return &m_summaryCase;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmValueField* RimSummaryPlotSourceStepping::valueFieldToModify()
|
||||
std::set<RifEclipseSummaryAddress> RimSummaryPlotSourceStepping::allAddressesUsedInCurveCollection() const
|
||||
{
|
||||
// This will return a null pointer for summary case modifier
|
||||
std::set<RifEclipseSummaryAddress> addresses;
|
||||
|
||||
return dynamic_cast<caf::PdmValueField*>(fieldToModify());
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
||||
|
||||
auto curves = curveCollection->curves();
|
||||
for (auto c : curves)
|
||||
{
|
||||
if (isYAxisStepping())
|
||||
{
|
||||
addresses.insert(c->summaryAddressY());
|
||||
}
|
||||
|
||||
if (isXAxisStepping())
|
||||
{
|
||||
addresses.insert(c->summaryAddressX());
|
||||
}
|
||||
}
|
||||
|
||||
return addresses;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RimSummaryCase*> RimSummaryPlotSourceStepping::allSummaryCasesUsedInCurveCollection() const
|
||||
{
|
||||
std::set<RimSummaryCase*> sumCases;
|
||||
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(curveCollection);
|
||||
|
||||
auto curves = curveCollection->curves();
|
||||
for (auto c : curves)
|
||||
{
|
||||
if (isYAxisStepping())
|
||||
{
|
||||
sumCases.insert(c->summaryCaseY());
|
||||
}
|
||||
|
||||
if (isXAxisStepping())
|
||||
{
|
||||
sumCases.insert(c->summaryCaseX());
|
||||
}
|
||||
}
|
||||
|
||||
return sumCases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlotSourceStepping::isXAxisStepping() const
|
||||
{
|
||||
if (m_sourceSteppingType == UNION_X_Y_AXIS)
|
||||
return true;
|
||||
|
||||
if (m_sourceSteppingType == X_AXIS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlotSourceStepping::isYAxisStepping() const
|
||||
{
|
||||
if (m_sourceSteppingType == UNION_X_Y_AXIS)
|
||||
return true;
|
||||
|
||||
if (m_sourceSteppingType == Y_AXIS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryCurveAnalyzer* RimSummaryPlotSourceStepping::analyzerForReader(RifSummaryReaderInterface* reader)
|
||||
{
|
||||
if (!reader)
|
||||
return nullptr;
|
||||
|
||||
if (m_curveAnalyzerForReader.first != reader)
|
||||
{
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
m_curveAnalyzerForReader = std::make_pair(reader, analyzer);
|
||||
}
|
||||
|
||||
m_curveAnalyzerForReader.second.analyzeAdresses(reader->allResultAddresses());
|
||||
|
||||
return &m_curveAnalyzerForReader.second;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::modifyCurrentIndex(caf::PdmValueField* valueField, int indexOffset)
|
||||
{
|
||||
if (valueField)
|
||||
{
|
||||
bool useOptionsOnly = true;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options = calculateValueOptions(valueField, nullptr);
|
||||
if (options.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto uiVariant = valueField->uiCapability()->toUiBasedQVariant();
|
||||
|
||||
int currentIndex = -1;
|
||||
for (int i = 0; i < options.size(); i++)
|
||||
{
|
||||
if (uiVariant == options[i].optionUiText())
|
||||
{
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentIndex == -1)
|
||||
{
|
||||
currentIndex = 0;
|
||||
}
|
||||
|
||||
int nextIndex = currentIndex + indexOffset;
|
||||
if (nextIndex < options.size() && nextIndex > -1)
|
||||
{
|
||||
auto optionValue = options[nextIndex].value();
|
||||
|
||||
QVariant currentValue = valueField->toQVariant();
|
||||
|
||||
valueField->setFromQVariant(optionValue);
|
||||
|
||||
valueField->uiCapability()->notifyFieldChanged(currentValue, optionValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -562,5 +792,26 @@ void RimSummaryPlotSourceStepping::defineEditorAttribute(const caf::PdmFieldHand
|
||||
if (myAttr)
|
||||
{
|
||||
myAttr->showPreviousAndNextButtons = true;
|
||||
|
||||
QString modifierText;
|
||||
|
||||
if (field == &m_summaryCase)
|
||||
{
|
||||
modifierText = ("(Shift+");
|
||||
}
|
||||
else if (field == &m_wellName || field == &m_wellGroupName || field == &m_region)
|
||||
{
|
||||
modifierText = ("(Ctrl+");
|
||||
}
|
||||
else if (field == &m_quantity)
|
||||
{
|
||||
modifierText = ("(");
|
||||
}
|
||||
|
||||
if (!modifierText.isEmpty())
|
||||
{
|
||||
myAttr->nextButtonText = "Next " + modifierText + "PgDown)";
|
||||
myAttr->prevButtonText = "Previous " + modifierText + "PgUp)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmProxyValueField.h"
|
||||
@ -25,6 +28,8 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <set>
|
||||
|
||||
class RimSummaryCase;
|
||||
class RifSummaryReaderInterface;
|
||||
|
||||
@ -35,13 +40,29 @@ class RimSummaryPlotSourceStepping : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum SourceSteppingType
|
||||
{
|
||||
Y_AXIS,
|
||||
X_AXIS,
|
||||
UNION_X_Y_AXIS
|
||||
};
|
||||
|
||||
public:
|
||||
RimSummaryPlotSourceStepping();
|
||||
|
||||
void applyNextIdentifier();
|
||||
void applyPreviousIdentifier();
|
||||
void setSourceSteppingType(SourceSteppingType sourceSteppingType);
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
void applyNextCase();
|
||||
void applyPrevCase();
|
||||
|
||||
void applyNextQuantity();
|
||||
void applyPrevQuantity();
|
||||
|
||||
void applyNextOtherIdentifier();
|
||||
void applyPrevOtherIdentifier();
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
private:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
@ -52,16 +73,24 @@ private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
|
||||
const QVariant& newValue) override;
|
||||
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute) override;
|
||||
|
||||
private:
|
||||
RifSummaryReaderInterface* summaryReader() const;
|
||||
RimSummaryCase* singleSummaryCase() const;
|
||||
QString wellName() const;
|
||||
void setWellName(const QString& wellName);
|
||||
void updateUiFromCurves();
|
||||
caf::PdmFieldHandle* fieldToModify();
|
||||
caf::PdmValueField* valueFieldToModify();
|
||||
caf::PdmValueField* fieldToModify();
|
||||
|
||||
std::set<RifEclipseSummaryAddress> allAddressesUsedInCurveCollection() const;
|
||||
std::set<RimSummaryCase*> allSummaryCasesUsedInCurveCollection() const;
|
||||
|
||||
bool isXAxisStepping() const;
|
||||
bool isYAxisStepping() const;
|
||||
|
||||
RiaSummaryCurveAnalyzer* analyzerForReader(RifSummaryReaderInterface* reader);
|
||||
|
||||
void modifyCurrentIndex(caf::PdmValueField* valueField, int indexOffset);
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
|
||||
@ -69,6 +98,8 @@ private:
|
||||
caf::PdmField<QString> m_wellGroupName;
|
||||
caf::PdmField<int> m_region;
|
||||
caf::PdmField<QString> m_quantity;
|
||||
caf::PdmField<QString> m_placeholderForLabel;
|
||||
SourceSteppingType m_sourceSteppingType;
|
||||
|
||||
caf::PdmProxyValueField<QString> m_wellNameProxy; // TODO: This is a test field for a list editor
|
||||
std::pair<RifSummaryReaderInterface*, RiaSummaryCurveAnalyzer> m_curveAnalyzerForReader;
|
||||
};
|
||||
|
@ -20,18 +20,24 @@
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigFormationNames.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigSimWellData.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include "RigSimulationWellCenterLineCalculator.h"
|
||||
#include "RigSimulationWellCoordsAndMD.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimFlowPlotCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -670,6 +676,14 @@ void RigEclipseCaseData::setActiveFormationNames(RigFormationNames* activeFormat
|
||||
}
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
if (project)
|
||||
{
|
||||
if (project->mainPlotCollection())
|
||||
{
|
||||
project->mainPlotCollection->updatePlotsWithFormations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -121,7 +121,7 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose()
|
||||
|
||||
cleanUpTemporaryWidgets();
|
||||
|
||||
m_summaryPlotToolBar->clear();
|
||||
m_summaryPlotToolBarEditor->clear();
|
||||
|
||||
setWindowTitle("Plots - ResInsight");
|
||||
}
|
||||
@ -307,7 +307,8 @@ void RiuMainPlotWindow::createToolBars()
|
||||
}
|
||||
}
|
||||
|
||||
m_summaryPlotToolBar = new caf::PdmUiToolBarEditor("Summary Plot", this);
|
||||
m_summaryPlotToolBarEditor = new caf::PdmUiToolBarEditor("Summary Plot", this);
|
||||
m_summaryPlotToolBarEditor->hide();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -415,6 +416,34 @@ void RiuMainPlotWindow::addToTemporaryWidgets(QWidget* widget)
|
||||
m_temporaryWidgets.push_back(widget);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainPlotWindow::updateSummaryPlotToolBar()
|
||||
{
|
||||
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(m_activePlotViewWindow);
|
||||
if (summaryPlot)
|
||||
{
|
||||
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
||||
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||
|
||||
if (!m_summaryPlotToolBarEditor->isEditorDataValid(toolBarFields))
|
||||
{
|
||||
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
||||
m_summaryPlotToolBarEditor->updateUi();
|
||||
}
|
||||
|
||||
m_summaryPlotToolBarEditor->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryPlotToolBarEditor->clear();
|
||||
|
||||
m_summaryPlotToolBarEditor->hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -525,6 +554,8 @@ void RiuMainPlotWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
|
||||
|
||||
m_activePlotViewWindow = viewWindow;
|
||||
}
|
||||
|
||||
updateSummaryPlotToolBar();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -598,19 +629,6 @@ void RiuMainPlotWindow::selectedObjectsChanged()
|
||||
}
|
||||
m_pdmUiPropertyView->showProperties(firstSelectedObject);
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
||||
if (firstSelectedObject)
|
||||
{
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
firstSelectedObject->firstAncestorOrThisOfType(summaryPlot);
|
||||
if (summaryPlot)
|
||||
{
|
||||
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||
}
|
||||
}
|
||||
m_summaryPlotToolBar->setFields(toolBarFields);
|
||||
m_summaryPlotToolBar->updateUi();
|
||||
|
||||
if (uiItems.size() == 1)
|
||||
{
|
||||
// Find the reservoir view or the Plot that the selected item is within
|
||||
|
@ -83,6 +83,8 @@ public:
|
||||
|
||||
void addToTemporaryWidgets(QWidget* widget);
|
||||
|
||||
void updateSummaryPlotToolBar();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent* event);
|
||||
|
||||
@ -119,7 +121,7 @@ private:
|
||||
QMenu* m_windowMenu;
|
||||
|
||||
caf::PdmUiTreeView* m_projectTreeView;
|
||||
caf::PdmUiToolBarEditor* m_summaryPlotToolBar;
|
||||
caf::PdmUiToolBarEditor* m_summaryPlotToolBarEditor;
|
||||
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
||||
|
||||
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
||||
|
@ -252,7 +252,7 @@ std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelection::selectedCurv
|
||||
|
||||
std::set<RifEclipseSummaryAddress> selectedAddressesFromUi = buildAddressListFromSelections();
|
||||
|
||||
for (RimSummaryCase* currCase : summaryCases())
|
||||
for (RimSummaryCase* currCase : selectedSummaryCases())
|
||||
{
|
||||
if (currCase && currCase->summaryReader())
|
||||
{
|
||||
@ -291,6 +291,25 @@ void RiuSummaryCurveDefSelection::setFieldChangedHandler(const std::function<voi
|
||||
m_toggleChangedHandler = handlerFunc;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryCurveDefSelection::setDefaultSelection()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
auto allSumCases = proj->allSummaryCases();
|
||||
if (allSumCases.size() > 0)
|
||||
{
|
||||
RifEclipseSummaryAddress defaultAddress = RifEclipseSummaryAddress::fieldVarAddress("FOPT");
|
||||
|
||||
RiaSummaryCurveDefinition curveDef(allSumCases[0], defaultAddress);
|
||||
std::vector<RiaSummaryCurveDefinition> curveDefs;
|
||||
curveDefs.push_back(curveDef);
|
||||
|
||||
setSelectedCurveDefinitions(curveDefs);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -950,7 +969,7 @@ bool RiuSummaryCurveDefSelection::isObservedData(RimSummaryCase *sumCase) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCase*> RiuSummaryCurveDefSelection::summaryCases() const
|
||||
std::vector<RimSummaryCase*> RiuSummaryCurveDefSelection::selectedSummaryCases() const
|
||||
{
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
|
||||
|
@ -55,6 +55,8 @@ public:
|
||||
void setMultiSelectionMode(bool multiSelectionMode);
|
||||
void setFieldChangedHandler(const std::function<void()>& handlerFunc);
|
||||
|
||||
void setDefaultSelection();
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
@ -86,7 +88,7 @@ private:
|
||||
void resetAllFields();
|
||||
bool isObservedData(RimSummaryCase *sumCase) const;
|
||||
|
||||
std::vector<RimSummaryCase*> summaryCases() const;
|
||||
std::vector<RimSummaryCase*> selectedSummaryCases() const;
|
||||
static RimSummaryCase* calculatedSummaryCase();
|
||||
|
||||
private:
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RimContextCommandBuilder.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuMainPlotWindow.h"
|
||||
@ -186,24 +187,10 @@ void RiuSummaryQwtPlot::contextMenuEvent(QContextMenuEvent* event)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::keyPressEvent(QKeyEvent* keyEvent)
|
||||
{
|
||||
if (keyEvent->key() == Qt::Key_PageUp)
|
||||
if (m_plotDefinition && m_plotDefinition->summaryCurveCollection())
|
||||
{
|
||||
if (m_plotDefinition)
|
||||
{
|
||||
m_plotDefinition->applyPreviousIdentifier();
|
||||
}
|
||||
|
||||
keyEvent->accept();
|
||||
}
|
||||
|
||||
if (keyEvent->key() == Qt::Key_PageDown)
|
||||
{
|
||||
if (m_plotDefinition)
|
||||
{
|
||||
m_plotDefinition->applyNextIdentifier();
|
||||
}
|
||||
|
||||
keyEvent->accept();
|
||||
RimSummaryCurveCollection* curveColl = m_plotDefinition->summaryCurveCollection();
|
||||
curveColl->handleKeyPressEvent(keyEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
kSliceList.push_back(2);
|
||||
kSliceList.push_back(CVF_MAX(static_cast<int>(k + 1), 1));
|
||||
|
||||
menuBuilder.subMenuStart("Range Filter Slice");
|
||||
menuBuilder.subMenuStart("Range Filter Slice", QIcon(":/CellFilter_Range.png"));
|
||||
|
||||
menuBuilder.addCmdFeatureWithUserData("RicNewSliceRangeFilterFeature", "I-slice Range Filter", iSliceList);
|
||||
menuBuilder.addCmdFeatureWithUserData("RicNewSliceRangeFilterFeature", "J-slice Range Filter", jSliceList);
|
||||
@ -249,7 +249,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
menuBuilder.subMenuStart("Intersection");
|
||||
menuBuilder.subMenuStart("Intersections", QIcon(":/IntersectionXPlane16x16.png"));
|
||||
|
||||
menuBuilder << "RicNewPolylineIntersectionFeature";
|
||||
menuBuilder << "RicNewAzimuthDipIntersectionFeature";
|
||||
@ -305,18 +305,23 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
|
||||
menuBuilder << "RicNewWellLogCurveExtractionFeature";
|
||||
menuBuilder << "RicNewWellLogFileCurveFeature";
|
||||
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
menuBuilder.subMenuStart("Well Plot");
|
||||
menuBuilder.subMenuStart("Well Plots", QIcon(":/SummaryPlot16x16.png"));
|
||||
|
||||
menuBuilder << "RicNewRftPlotFeature";
|
||||
menuBuilder << "RicNewPltPlotFeature";
|
||||
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
menuBuilder << "RicShowWellAllocationPlotFeature";
|
||||
|
||||
menuBuilder.subMenuEnd();
|
||||
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
menuBuilder.subMenuStart("Perforation");
|
||||
menuBuilder.subMenuStart("Completions", QIcon(":/FishBoneGroup16x16.png"));
|
||||
|
||||
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
menuBuilder << "RicNewWellPathFractureAtPosFeature";
|
||||
@ -346,10 +351,15 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
menuBuilder << "RicNewWellLogCurveExtractionFeature";
|
||||
menuBuilder << "RicNewWellLogRftCurveFeature";
|
||||
|
||||
menuBuilder.subMenuStart("Well Plot");
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
menuBuilder.subMenuStart("Well Plots", QIcon(":/SummaryPlot16x16.png"));
|
||||
|
||||
menuBuilder << "RicNewRftPlotFeature";
|
||||
menuBuilder << "RicNewPltPlotFeature";
|
||||
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
menuBuilder << "RicPlotProductionRateFeature";
|
||||
menuBuilder << "RicShowWellAllocationPlotFeature";
|
||||
|
||||
|
@ -34,40 +34,30 @@
|
||||
//
|
||||
//##################################################################################################
|
||||
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafCmdSelectionHelper.h"
|
||||
#include "cafFactory.h"
|
||||
|
||||
#include "defaultfeatures/cafCmdDeleteItemFeature.h"
|
||||
#include "defaultfeatures/cafCmdAddItemFeature.h"
|
||||
#include "cafFactory.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
|
||||
// typedef Factory<CmdFeature, std::string> CommandFeatureFactory;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdFeatureMenuBuilder::CmdFeatureMenuBuilder()
|
||||
{
|
||||
}
|
||||
CmdFeatureMenuBuilder::CmdFeatureMenuBuilder() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdFeatureMenuBuilder::~CmdFeatureMenuBuilder()
|
||||
{
|
||||
}
|
||||
CmdFeatureMenuBuilder::~CmdFeatureMenuBuilder() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::operator<<(const QString& commandId)
|
||||
{
|
||||
@ -79,79 +69,86 @@ CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::operator<<(const QString& commandI
|
||||
{
|
||||
addCmdFeature(commandId);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::addCmdFeature(const QString commandId, const QString& uiText)
|
||||
{
|
||||
MenuItem i;
|
||||
i.itemType = MenuItem::COMMAND;
|
||||
i.itemName = commandId;
|
||||
i.uiText = uiText;
|
||||
i.uiText = uiText;
|
||||
m_items.push_back(i);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::addCmdFeatureWithUserData(const QString commandId, const QString& uiText, const QVariant& userData)
|
||||
CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::addCmdFeatureWithUserData(const QString commandId, const QString& uiText,
|
||||
const QVariant& userData)
|
||||
{
|
||||
MenuItem i;
|
||||
i.itemType = MenuItem::COMMAND;
|
||||
i.itemName = commandId;
|
||||
i.uiText = uiText;
|
||||
i.uiText = uiText;
|
||||
i.userData = userData;
|
||||
m_items.push_back(i);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::addSeparator()
|
||||
{
|
||||
MenuItem i;
|
||||
i.itemType = MenuItem::SEPARATOR;
|
||||
m_items.push_back(i);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::subMenuStart(const QString& menuName)
|
||||
CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::subMenuStart(const QString& menuName, const QIcon& menuIcon)
|
||||
{
|
||||
MenuItem i;
|
||||
i.itemType = MenuItem::SUBMENU_START;
|
||||
i.itemName = menuName;
|
||||
i.icon = menuIcon;
|
||||
m_items.push_back(i);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdFeatureMenuBuilder& CmdFeatureMenuBuilder::subMenuEnd()
|
||||
{
|
||||
MenuItem i;
|
||||
i.itemType = MenuItem::SUBMENU_END;
|
||||
m_items.push_back(i);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void CmdFeatureMenuBuilder::appendToMenu(QMenu* menu)
|
||||
{
|
||||
CAF_ASSERT(menu);
|
||||
|
||||
std::vector<QMenu*> menus = { menu };
|
||||
std::vector<QMenu*> menus = {menu};
|
||||
for (size_t i = 0; i < m_items.size(); i++)
|
||||
{
|
||||
if (m_items[i].itemType == MenuItem::SEPARATOR)
|
||||
@ -160,7 +157,7 @@ void CmdFeatureMenuBuilder::appendToMenu(QMenu* menu)
|
||||
}
|
||||
else if (m_items[i].itemType == MenuItem::SUBMENU_START)
|
||||
{
|
||||
QMenu* subMenu = menus.back()->addMenu(m_items[i].itemName);
|
||||
QMenu* subMenu = menus.back()->addMenu(m_items[i].icon, m_items[i].itemName);
|
||||
menus.push_back(subMenu);
|
||||
}
|
||||
else if (m_items[i].itemType == MenuItem::SUBMENU_END)
|
||||
@ -173,8 +170,8 @@ void CmdFeatureMenuBuilder::appendToMenu(QMenu* menu)
|
||||
else
|
||||
{
|
||||
CmdFeatureManager* commandManager = CmdFeatureManager::instance();
|
||||
QMenu* currentMenu = menus.back();
|
||||
caf::CmdFeature* feature = commandManager->getCommandFeature(m_items[i].itemName.toStdString());
|
||||
QMenu* currentMenu = menus.back();
|
||||
caf::CmdFeature* feature = commandManager->getCommandFeature(m_items[i].itemName.toStdString());
|
||||
CAF_ASSERT(feature);
|
||||
|
||||
if (feature->canFeatureBeExecuted())
|
||||
@ -188,14 +185,15 @@ void CmdFeatureMenuBuilder::appendToMenu(QMenu* menu)
|
||||
{
|
||||
act = commandManager->action(m_items[i].itemName);
|
||||
}
|
||||
|
||||
|
||||
CAF_ASSERT(act);
|
||||
|
||||
for (QAction* existingAct : currentMenu->actions())
|
||||
{
|
||||
// If action exist, continue to make sure the action is positioned at the first
|
||||
// location of a command ID
|
||||
if (existingAct == act) continue;
|
||||
if (existingAct == act)
|
||||
continue;
|
||||
}
|
||||
|
||||
currentMenu->addAction(const_cast<QAction*>(act));
|
||||
|
@ -34,26 +34,22 @@
|
||||
//
|
||||
//##################################################################################################
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include <QObject>
|
||||
#include <QIcon>
|
||||
#include <QVariant>
|
||||
|
||||
class QAction;
|
||||
class QMenu;
|
||||
|
||||
namespace caf
|
||||
namespace caf
|
||||
{
|
||||
|
||||
class CmdFeature;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class CmdFeatureMenuBuilder
|
||||
{
|
||||
@ -61,47 +57,38 @@ public:
|
||||
CmdFeatureMenuBuilder();
|
||||
virtual ~CmdFeatureMenuBuilder();
|
||||
|
||||
CmdFeatureMenuBuilder& operator<<(const QString& commandIdOrSeparator);
|
||||
CmdFeatureMenuBuilder& addCmdFeature(const QString commandId, const QString& customUiText = "");
|
||||
CmdFeatureMenuBuilder& addCmdFeatureWithUserData(const QString commandId, const QString& customUiText, const QVariant& userData);
|
||||
CmdFeatureMenuBuilder& operator<<(const QString& commandIdOrSeparator);
|
||||
CmdFeatureMenuBuilder& addCmdFeature(const QString commandId, const QString& customUiText = "");
|
||||
CmdFeatureMenuBuilder& addCmdFeatureWithUserData(const QString commandId, const QString& customUiText,
|
||||
const QVariant& userData);
|
||||
|
||||
CmdFeatureMenuBuilder& addSeparator();
|
||||
CmdFeatureMenuBuilder& addSeparator();
|
||||
|
||||
CmdFeatureMenuBuilder& subMenuStart(const QString& menuName);
|
||||
CmdFeatureMenuBuilder& subMenuEnd();
|
||||
CmdFeatureMenuBuilder& subMenuStart(const QString& menuName, const QIcon& menuIcon = QIcon());
|
||||
CmdFeatureMenuBuilder& subMenuEnd();
|
||||
|
||||
void appendToMenu(QMenu* menu);
|
||||
void appendToMenu(QMenu* menu);
|
||||
|
||||
private:
|
||||
struct MenuItem
|
||||
{
|
||||
public:
|
||||
enum ItemType { COMMAND, SEPARATOR, SUBMENU_START, SUBMENU_END };
|
||||
enum ItemType
|
||||
{
|
||||
COMMAND,
|
||||
SEPARATOR,
|
||||
SUBMENU_START,
|
||||
SUBMENU_END
|
||||
};
|
||||
|
||||
ItemType itemType;
|
||||
QString itemName;
|
||||
QString uiText;
|
||||
QVariant userData;
|
||||
ItemType itemType;
|
||||
QString itemName;
|
||||
QString uiText;
|
||||
QVariant userData;
|
||||
QIcon icon;
|
||||
};
|
||||
|
||||
std::vector<MenuItem> m_items;
|
||||
std::vector<MenuItem> m_items;
|
||||
};
|
||||
|
||||
} // end namespace caf
|
||||
|
||||
|
||||
|
||||
//static MenuItem command(QString commandName)
|
||||
//{
|
||||
// MenuItem i;
|
||||
// i.itemType = COMMAND;
|
||||
// i.itemName = commandName;
|
||||
// return i;
|
||||
//}
|
||||
//
|
||||
//static MenuItem separator()
|
||||
//{
|
||||
// MenuItem i;
|
||||
// i.itemType = SEPARATOR;
|
||||
// return i;
|
||||
//}
|
||||
|
@ -144,6 +144,17 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
m_nextItemButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowDown));
|
||||
}
|
||||
|
||||
// Update button texts
|
||||
if (!attributes.nextButtonText.isEmpty())
|
||||
{
|
||||
m_nextItemButton->setToolTip(attributes.nextButtonText);
|
||||
}
|
||||
|
||||
if (!attributes.prevButtonText.isEmpty())
|
||||
{
|
||||
m_previousItemButton->setToolTip(attributes.prevButtonText);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -65,6 +65,9 @@ public:
|
||||
public:
|
||||
bool adjustWidthToContents;
|
||||
bool showPreviousAndNextButtons;
|
||||
|
||||
QString nextButtonText;
|
||||
QString prevButtonText;
|
||||
};
|
||||
|
||||
|
||||
|
@ -73,22 +73,62 @@ PdmUiToolBarEditor::~PdmUiToolBarEditor()
|
||||
clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool PdmUiToolBarEditor::isEditorDataValid(const std::vector<caf::PdmFieldHandle*>& fields) const
|
||||
{
|
||||
if (m_fields.size() == fields.size() && m_fieldViews.size() == fields.size())
|
||||
{
|
||||
bool equalContent = true;
|
||||
|
||||
for (size_t i = 0; i < m_fields.size(); i++)
|
||||
{
|
||||
if (m_fields[i] != fields[i])
|
||||
{
|
||||
equalContent = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (equalContent)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiToolBarEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
{
|
||||
// Find set of owner objects. Can be several objects, make a set to avoid calling uiOrdering more than once for an object
|
||||
|
||||
std::set<caf::PdmUiObjectHandle*> ownerUiObjects;
|
||||
|
||||
for (PdmFieldHandle* field : m_fields)
|
||||
{
|
||||
caf::PdmUiObjectHandle* ownerUiObject = field->ownerObject()->uiCapability();
|
||||
if (ownerUiObject)
|
||||
{
|
||||
ownerUiObjects.insert(ownerUiObject);
|
||||
}
|
||||
}
|
||||
|
||||
PdmUiOrdering config;
|
||||
for (caf::PdmUiObjectHandle* ownerUiObject : ownerUiObjects)
|
||||
{
|
||||
ownerUiObject->uiOrdering(uiConfigName, config);
|
||||
}
|
||||
}
|
||||
|
||||
for (PdmFieldHandle* field : m_fields)
|
||||
{
|
||||
PdmUiFieldEditorHandle* fieldEditor = nullptr;
|
||||
|
||||
caf::PdmUiObjectHandle* ownerUiObject = uiObj(field->ownerObject());
|
||||
if (ownerUiObject)
|
||||
{
|
||||
PdmUiOrdering config;
|
||||
ownerUiObject->uiOrdering(uiConfigName, config);
|
||||
}
|
||||
|
||||
// Find or create FieldEditor
|
||||
std::map<QString, PdmUiFieldEditorHandle*>::iterator it;
|
||||
it = m_fieldViews.find(field->keyword());
|
||||
@ -185,4 +225,26 @@ void PdmUiToolBarEditor::clear()
|
||||
m_actions.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiToolBarEditor::show()
|
||||
{
|
||||
if (m_toolbar)
|
||||
{
|
||||
m_toolbar->show();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiToolBarEditor::hide()
|
||||
{
|
||||
if (m_toolbar)
|
||||
{
|
||||
m_toolbar->hide();
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace caf
|
||||
|
@ -61,8 +61,12 @@ public:
|
||||
PdmUiToolBarEditor(const QString& title, QMainWindow* mainWindow);
|
||||
~PdmUiToolBarEditor();
|
||||
|
||||
bool isEditorDataValid(const std::vector<caf::PdmFieldHandle*>& fields) const;
|
||||
void setFields(std::vector<caf::PdmFieldHandle*>& fields);
|
||||
void clear();
|
||||
|
||||
void show();
|
||||
void hide();
|
||||
|
||||
private:
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName) override;
|
||||
|
@ -207,14 +207,14 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
m_treeView->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
m_model->enableSingleSelectionMode(m_attributes.singleSelectionMode);
|
||||
|
||||
connect(m_treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotClicked(QModelIndex)));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
}
|
||||
|
||||
connect(m_treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotClicked(QModelIndex)));
|
||||
|
||||
if (!m_attributes.showTextFilter)
|
||||
{
|
||||
m_textFilterLineEdit->hide();
|
||||
@ -453,7 +453,14 @@ void PdmUiTreeSelectionEditor::slotTextFilterChanged()
|
||||
QString searchString = m_textFilterLineEdit->text();
|
||||
searchString += "*";
|
||||
|
||||
m_proxyModel->setFilterWildcard(searchString);
|
||||
// Escape the characters '[' and ']' as these have special meaning for a search string
|
||||
// To be able to search for vector names in brackets, these must be escaped
|
||||
// See "Wildcard Matching" in Qt documentation
|
||||
searchString.replace("[", "\\[");
|
||||
searchString.replace("]", "\\]");
|
||||
|
||||
QRegExp searcher(searchString, Qt::CaseInsensitive, QRegExp::WildcardUnix);
|
||||
m_proxyModel->setFilterRegExp(searcher);
|
||||
|
||||
updateUi();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user