mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge fix of #1858
This commit is contained in:
@@ -990,7 +990,7 @@ void RimWellPltPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
{
|
||||
RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0);
|
||||
|
||||
track->uiOrderingForShowFormationNamesAndCase(uiOrdering);
|
||||
track->uiOrderingForFormations(uiOrdering);
|
||||
|
||||
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis");
|
||||
legendAndAxisGroup->setCollapsedByDefault(true);
|
||||
|
||||
@@ -773,13 +773,11 @@ void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
caf::PdmUiGroup* timeStepsGroup = uiOrdering.addNewGroupWithKeyword("Time Steps", "TimeSteps");
|
||||
timeStepsGroup->add(&m_selectedTimeSteps);
|
||||
|
||||
//uiOrdering.add(&m_showPlotTitle);
|
||||
|
||||
if (m_wellLogPlot && m_wellLogPlot->trackCount() > 0)
|
||||
{
|
||||
RimWellLogTrack* track = m_wellLogPlot->trackByIndex(0);
|
||||
|
||||
track->uiOrderingForShowFormationNamesAndCase(uiOrdering);
|
||||
track->uiOrderingForFormations(uiOrdering);
|
||||
|
||||
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup("Legend and Axis");
|
||||
legendAndAxisGroup->setCollapsedByDefault(true);
|
||||
|
||||
@@ -185,6 +185,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
else if (dynamic_cast<RimEclipseCellColors*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicSaveEclipseResultAsInputPropertyFeature";
|
||||
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimEclipseInputPropertyCollection*>(uiItem))
|
||||
{
|
||||
@@ -330,6 +331,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
}
|
||||
else if (dynamic_cast<RimSummaryCrossPlotCollection*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicPasteSummaryCrossPlotFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicNewSummaryCrossPlotFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
|
||||
@@ -358,12 +361,15 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
else if (dynamic_cast<RimSummaryPlot*>(uiItem)) // This is also the definition for RimSummaryCrossPlot
|
||||
{
|
||||
menuBuilder << "RicPasteSummaryCurveFeature";
|
||||
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
|
||||
menuBuilder << "RicPasteSummaryPlotFeature";
|
||||
menuBuilder << "RicPasteAsciiDataToSummaryPlotFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicEditSummaryPlotFeature";
|
||||
menuBuilder << "RicNewSummaryPlotFeature";
|
||||
menuBuilder << "RicDuplicateSummaryPlotFeature";
|
||||
menuBuilder << "RicNewSummaryCurveFeature";
|
||||
menuBuilder << "RicDuplicateSummaryCrossPlotFeature";
|
||||
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicShowSummaryCurveCalculatorFeature";
|
||||
@@ -377,9 +383,12 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
else if (dynamic_cast<RimSummaryCurve*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicPasteSummaryCurveFeature";
|
||||
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicNewSummaryCurveFeature";
|
||||
menuBuilder << "RicDuplicateSummaryCurveFeature";
|
||||
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
|
||||
menuBuilder << "RicDuplicateSummaryCrossPlotCurveFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
||||
menuBuilder << "Separator";
|
||||
@@ -388,6 +397,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
else if (dynamic_cast<RimSummaryCurveCollection*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicPasteSummaryCurveFeature";
|
||||
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicEditSummaryPlotFeature";
|
||||
menuBuilder << "RicNewSummaryCurveFeature";
|
||||
|
||||
@@ -552,15 +552,6 @@ void RimPlotCurve::setZOrder(double z)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::setCustomCurveName(const QString& customName)
|
||||
{
|
||||
m_isUsingAutoName = false;
|
||||
m_customCurveName = customName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -99,7 +99,6 @@ public:
|
||||
void showLegend(bool show);
|
||||
|
||||
void setZOrder(double z);
|
||||
void setCustomCurveName(const QString& customName);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -248,17 +248,31 @@ void RimTools::wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>*
|
||||
CVF_ASSERT(options);
|
||||
if (!options) return;
|
||||
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
RimTools::wellPathWithFormations(&wellPaths);
|
||||
|
||||
QIcon wellIcon(":/Well.png");
|
||||
for (RimWellPath* wellPath : wellPaths)
|
||||
{
|
||||
options->push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath, false, wellIcon));
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTools::wellPathWithFormations(std::vector<RimWellPath*>* wellPaths)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection())
|
||||
{
|
||||
caf::PdmChildArrayField<RimWellPath*>& wellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
|
||||
caf::PdmChildArrayField<RimWellPath*>& allWellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
|
||||
|
||||
QIcon wellIcon(":/Well.png");
|
||||
for (RimWellPath* wellPath : wellPaths)
|
||||
for (RimWellPath* wellPath : allWellPaths)
|
||||
{
|
||||
if (wellPath->hasFormations())
|
||||
{
|
||||
options->push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath, false, wellIcon));
|
||||
wellPaths->push_back(wellPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
@@ -43,6 +45,7 @@ public:
|
||||
|
||||
static void wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
||||
static void wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
||||
static void wellPathWithFormations(std::vector<RimWellPath*>* wellPaths);
|
||||
static void caseOptionItems(QList<caf::PdmOptionItemInfo>* options);
|
||||
|
||||
static QString createTimeFormatStringFromDates(const std::vector<QDateTime>& dates);
|
||||
|
||||
@@ -80,9 +80,29 @@ namespace caf
|
||||
void AppEnum< RimWellLogTrack::FormationSource >::setUp()
|
||||
{
|
||||
addItem(RimWellLogTrack::CASE, "CASE", "Case");
|
||||
addItem(RimWellLogTrack::WELL_PICK, "WELLPICK", "Well Pick");
|
||||
addItem(RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Path");
|
||||
setDefault(RimWellLogTrack::CASE);
|
||||
}
|
||||
|
||||
template<>
|
||||
void AppEnum<RigWellPathFormations::FormationLevel>::setUp()
|
||||
{
|
||||
addItem(RigWellPathFormations::NONE, "NONE", "None");
|
||||
addItem(RigWellPathFormations::ALL, "ALL", "All");
|
||||
addItem(RigWellPathFormations::GROUP, "GROUP", "Formation Group");
|
||||
addItem(RigWellPathFormations::LEVEL0, "LEVEL0", "Formation");
|
||||
addItem(RigWellPathFormations::LEVEL1, "LEVEL1", "Formation 1");
|
||||
addItem(RigWellPathFormations::LEVEL2, "LEVEL2", "Formation 2");
|
||||
addItem(RigWellPathFormations::LEVEL3, "LEVEL3", "Formation 3");
|
||||
addItem(RigWellPathFormations::LEVEL4, "LEVEL4", "Formation 4");
|
||||
addItem(RigWellPathFormations::LEVEL5, "LEVEL5", "Formation 5");
|
||||
addItem(RigWellPathFormations::LEVEL6, "LEVEL6", "Formation 6");
|
||||
addItem(RigWellPathFormations::LEVEL7, "LEVEL7", "Formation 7");
|
||||
addItem(RigWellPathFormations::LEVEL8, "LEVEL8", "Formation 8");
|
||||
addItem(RigWellPathFormations::LEVEL9, "LEVEL9", "Formation 9");
|
||||
addItem(RigWellPathFormations::LEVEL10, "LEVEL10", "Formation 10");
|
||||
setDefault(RigWellPathFormations::ALL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,9 +129,9 @@ RimWellLogTrack::RimWellLogTrack()
|
||||
|
||||
CAF_PDM_InitField(&m_isLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show Formations", "", "", "");
|
||||
CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Formation Source", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Source", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_formationTrajectoryType, "FormationTrajectoryType", "Trajectory", "", "", "");
|
||||
|
||||
@@ -125,6 +145,10 @@ RimWellLogTrack::RimWellLogTrack()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_formationCase, "FormationCase", "Formation Case", "", "", "");
|
||||
m_formationCase.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_formationLevel, "FormationLevel", "Well Pick Filter", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_showformationFluids, "ShowFormationFluids", false, "Show Fluids", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -253,6 +277,22 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
pltPlot->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
bool validWellPathChosen = false;
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
RimTools::wellPathWithFormations(&wellPaths);
|
||||
for (RimWellPath* wellPath : wellPaths)
|
||||
{
|
||||
if (wellPath == m_formationWellPath)
|
||||
{
|
||||
validWellPathChosen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!validWellPathChosen)
|
||||
{
|
||||
m_formationWellPath = nullptr;
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_formationCase)
|
||||
{
|
||||
@@ -285,6 +325,14 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
else if (changedField == &m_formationLevel)
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
else if (changedField == &m_showformationFluids)
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -302,7 +350,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
|
||||
{
|
||||
RimTools::wellPathOptionItems(&options);
|
||||
}
|
||||
else if(m_formationSource == WELL_PICK)
|
||||
else if(m_formationSource == WELL_PICK_FILTER)
|
||||
{
|
||||
RimTools::wellPathWithFormationsOptionItems(&options);
|
||||
}
|
||||
@@ -324,6 +372,32 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions(const caf::
|
||||
auto simulationWellBranches = RiaSimWellBranchTools::simulationWellBranches(m_formationSimWellName(), m_formationBranchDetection);
|
||||
options = RiaSimWellBranchTools::valueOptionsForBranchIndexField(simulationWellBranches);
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_formationLevel)
|
||||
{
|
||||
if (m_formationWellPath)
|
||||
{
|
||||
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry();
|
||||
if (formations)
|
||||
{
|
||||
using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>;
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::NONE),
|
||||
RigWellPathFormations::NONE));
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiText(RigWellPathFormations::ALL),
|
||||
RigWellPathFormations::ALL));
|
||||
|
||||
for (const RigWellPathFormations::FormationLevel& level : formations->formationsLevelsPresent())
|
||||
{
|
||||
size_t index = FormationLevelEnum::index(level);
|
||||
if (index >= FormationLevelEnum::size()) continue;
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo(FormationLevelEnum::uiTextFromIndex(index),
|
||||
FormationLevelEnum::fromIndex(index)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
@@ -736,9 +810,14 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
m_formationBranchIndex);
|
||||
}
|
||||
}
|
||||
else if (m_formationSource() == WELL_PICK)
|
||||
else if (m_formationSource() == WELL_PICK_FILTER)
|
||||
{
|
||||
formationGroup->add(&m_formationWellPath);
|
||||
if (m_formationWellPath())
|
||||
{
|
||||
formationGroup->add(&m_formationLevel);
|
||||
formationGroup->add(&m_showformationFluids);
|
||||
}
|
||||
}
|
||||
|
||||
uiOrderingForVisibleXRange(uiOrdering);
|
||||
@@ -867,7 +946,7 @@ std::vector<RimWellLogCurve* > RimWellLogTrack::curvesVector()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering& uiOrdering)
|
||||
void RimWellLogTrack::uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Zonation/Formation Names");
|
||||
formationGroup->setCollapsedByDefault(true);
|
||||
@@ -877,6 +956,15 @@ void RimWellLogTrack::uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering&
|
||||
{
|
||||
formationGroup->add(&m_formationCase);
|
||||
}
|
||||
if (m_formationSource == WELL_PICK_FILTER)
|
||||
{
|
||||
formationGroup->add(&m_formationWellPath);
|
||||
if (m_formationWellPath())
|
||||
{
|
||||
formationGroup->add(&m_formationLevel);
|
||||
formationGroup->add(&m_showformationFluids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1075,6 +1163,8 @@ void RimWellLogTrack::setFormationFieldsUiReadOnly(bool readOnly /*= true*/)
|
||||
m_formationCase.uiCapability()->setUiReadOnly(readOnly);
|
||||
m_formationWellPath.uiCapability()->setUiReadOnly(readOnly);
|
||||
m_formationBranchIndex.uiCapability()->setUiReadOnly(readOnly);
|
||||
m_formationLevel.uiCapability()->setUiReadOnly(readOnly);
|
||||
m_showformationFluids.uiCapability()->setUiReadOnly(readOnly);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1158,7 +1248,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
|
||||
|
||||
m_annotationTool->attachFormationNames(this->viewer(), formationNamesToPlot, yValues);
|
||||
}
|
||||
else if (m_formationSource() == WELL_PICK)
|
||||
else if (m_formationSource() == WELL_PICK_FILTER)
|
||||
{
|
||||
if (m_formationWellPath == nullptr) return;
|
||||
if (plot->depthType() != RimWellLogPlot::MEASURED_DEPTH) return;
|
||||
@@ -1168,8 +1258,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
|
||||
const RigWellPathFormations* formations = m_formationWellPath->formationsGeometry();
|
||||
if (!formations) return;
|
||||
|
||||
formations->measuredDepthAndFormationNamesWithoutDuplicatesOnDepth(&formationNamesToPlot, &yValues);
|
||||
|
||||
formations->measuredDepthAndFormationNamesUpToLevel(m_formationLevel(), &formationNamesToPlot, &yValues, m_showformationFluids());
|
||||
|
||||
m_annotationTool->attachWellPicks(this->viewer(), formationNamesToPlot, yValues);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "RimWellLogPlot.h"
|
||||
|
||||
#include "RigWellPathFormations.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
@@ -67,7 +69,7 @@ public:
|
||||
virtual ~RimWellLogTrack();
|
||||
|
||||
enum TrajectoryType { WELL_PATH, SIMULATION_WELL };
|
||||
enum FormationSource { CASE, WELL_PICK };
|
||||
enum FormationSource { CASE, WELL_PICK_FILTER };
|
||||
|
||||
void setDescription(const QString& description);
|
||||
bool isVisible();
|
||||
@@ -114,7 +116,7 @@ public:
|
||||
QString description();
|
||||
std::vector<RimWellLogCurve* > curvesVector();
|
||||
|
||||
void uiOrderingForShowFormationNamesAndCase(caf::PdmUiOrdering& uiOrdering);
|
||||
void uiOrderingForFormations(caf::PdmUiOrdering& uiOrdering);
|
||||
void uiOrderingForVisibleXRange(caf::PdmUiOrdering& uiOrdering);
|
||||
|
||||
private:
|
||||
@@ -163,15 +165,17 @@ private:
|
||||
caf::PdmField<bool> m_isAutoScaleXEnabled;
|
||||
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
|
||||
|
||||
caf::PdmField<bool> m_showFormations;
|
||||
caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource;
|
||||
caf::PdmPtrField<RimCase*> m_formationCase;
|
||||
caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType;
|
||||
caf::PdmPtrField<RimWellPath*> m_formationWellPath;
|
||||
caf::PdmField<bool> m_showFormations;
|
||||
caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource;
|
||||
caf::PdmPtrField<RimCase*> m_formationCase;
|
||||
caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType;
|
||||
caf::PdmPtrField<RimWellPath*> m_formationWellPath;
|
||||
caf::PdmField<QString> m_formationSimWellName;
|
||||
caf::PdmField<int> m_formationBranchIndex;
|
||||
caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel;
|
||||
caf::PdmField<bool> m_showformationFluids;
|
||||
|
||||
caf::PdmField<QString> m_formationSimWellName;
|
||||
caf::PdmField<int> m_formationBranchIndex;
|
||||
caf::PdmField<bool> m_formationBranchDetection;
|
||||
caf::PdmField<bool> m_formationBranchDetection;
|
||||
|
||||
QPointer<RiuWellLogTrack> m_wellLogTrackPlotWidget;
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@ std::string RifCalculatedSummaryCurveReader::unitName(const RifEclipseSummaryAdd
|
||||
{
|
||||
return calculation->unitName().toStdString();
|
||||
}
|
||||
return "Calculated Curve Unit";
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -67,9 +67,10 @@ RimSummaryAddress::RimSummaryAddress()
|
||||
CAF_PDM_InitFieldNoDefault(&m_cellI, "SummaryCellI", "I", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_cellJ, "SummaryCellJ", "J", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_cellK, "SummaryCellK", "K", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_aquiferNumber, "SummaryAquifer", "Aquifer", "", "", "");
|
||||
|
||||
m_category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
m_regionNumber = m_regionNumber2 = m_wellSegmentNumber = m_cellI = m_cellJ = m_cellK = -1;
|
||||
m_regionNumber = m_regionNumber2 = m_wellSegmentNumber = m_cellI = m_cellJ = m_cellK = m_aquiferNumber -1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -93,6 +94,7 @@ void RimSummaryAddress::setAddress(const RifEclipseSummaryAddress& addr)
|
||||
m_wellName = addr.wellName().c_str();
|
||||
m_wellSegmentNumber = addr.wellSegmentNumber();
|
||||
m_lgrName = addr.lgrName().c_str();
|
||||
m_aquiferNumber = addr.aquiferNumber();
|
||||
|
||||
m_cellI = addr.cellI(); m_cellJ = addr.cellJ(); m_cellK = addr.cellK();
|
||||
}
|
||||
@@ -110,6 +112,7 @@ RifEclipseSummaryAddress RimSummaryAddress::address()
|
||||
m_wellName().toStdString(),
|
||||
m_wellSegmentNumber(),
|
||||
m_lgrName().toStdString(),
|
||||
m_cellI(), m_cellJ(), m_cellK());
|
||||
m_cellI(), m_cellJ(), m_cellK(),
|
||||
m_aquiferNumber);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,6 @@ private:
|
||||
caf::PdmField<int> m_cellI;
|
||||
caf::PdmField<int> m_cellJ;
|
||||
caf::PdmField<int> m_cellK;
|
||||
|
||||
caf::PdmField<int> m_aquiferNumber;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,61 +1,57 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016 Statoil ASA
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimSummaryAxisProperties.h"
|
||||
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum< RimSummaryAxisProperties::NumberFormatType >::setUp()
|
||||
{
|
||||
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_AUTO, "NUMBER_FORMAT_AUTO", "Auto");
|
||||
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_DECIMAL, "NUMBER_FORMAT_DECIMAL", "Decimal");
|
||||
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_SCIENTIFIC,"NUMBER_FORMAT_SCIENTIFIC", "Scientific");
|
||||
|
||||
setDefault(RimSummaryAxisProperties::NUMBER_FORMAT_AUTO);
|
||||
}
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum< RimSummaryAxisProperties::AxisTitlePositionType >::setUp()
|
||||
void caf::AppEnum<RimSummaryAxisProperties::NumberFormatType>::setUp()
|
||||
{
|
||||
addItem(RimSummaryAxisProperties::AXIS_TITLE_CENTER, "AXIS_TITLE_CENTER", "Center");
|
||||
addItem(RimSummaryAxisProperties::AXIS_TITLE_END, "AXIS_TITLE_END", "At End");
|
||||
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_AUTO, "NUMBER_FORMAT_AUTO", "Auto");
|
||||
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_DECIMAL, "NUMBER_FORMAT_DECIMAL", "Decimal");
|
||||
addItem(RimSummaryAxisProperties::NUMBER_FORMAT_SCIENTIFIC, "NUMBER_FORMAT_SCIENTIFIC", "Scientific");
|
||||
|
||||
setDefault(RimSummaryAxisProperties::NUMBER_FORMAT_AUTO);
|
||||
}
|
||||
|
||||
template<>
|
||||
void caf::AppEnum<RimSummaryAxisProperties::AxisTitlePositionType>::setUp()
|
||||
{
|
||||
addItem(RimSummaryAxisProperties::AXIS_TITLE_CENTER, "AXIS_TITLE_CENTER", "Center");
|
||||
addItem(RimSummaryAxisProperties::AXIS_TITLE_END, "AXIS_TITLE_END", "At End");
|
||||
|
||||
setDefault(RimSummaryAxisProperties::AXIS_TITLE_CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryAxisProperties, "SummaryYAxisProperties");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryAxisProperties::RimSummaryAxisProperties()
|
||||
{
|
||||
@@ -68,28 +64,34 @@ RimSummaryAxisProperties::RimSummaryAxisProperties()
|
||||
m_name.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&isAutoTitle, "AutoTitle", true, "Auto Title", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&customTitle, "CustomTitle", "Title", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&titlePositionEnum, "TitlePosition", "Title Position", "", "", "");
|
||||
CAF_PDM_InitField(&titleFontSize, "FontSize", 11, "Font Size", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_displayLongName, "DisplayLongName", true, " Names", "", "", "");
|
||||
CAF_PDM_InitField(&m_displayShortName, "DisplayShortName", false, " Acronymes", "", "", "");
|
||||
CAF_PDM_InitField(&m_displayUnitText, "DisplayUnitText", true, " Units", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&customTitle, "CustomTitle", "Title", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&titlePositionEnum, "TitlePosition", "Title Position", "", "", "");
|
||||
CAF_PDM_InitField(&titleFontSize, "FontSize", 11, "Font Size", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&visibleRangeMax, "VisibleRangeMax", RiaDefines::maximumDefaultValuePlot(), "Max", "", "", "");
|
||||
CAF_PDM_InitField(&visibleRangeMin, "VisibleRangeMin", RiaDefines::minimumDefaultValuePlot(), "Min", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&numberFormat, "NumberFormat", "Number Format", "", "", "");
|
||||
CAF_PDM_InitField(&numberOfDecimals, "Decimals", 2, "Number of Decimals", "", "", "");
|
||||
CAF_PDM_InitField(&scaleFactor, "ScaleFactor", 1.0, "Scale Factor", "", "", "");
|
||||
CAF_PDM_InitField(&valuesFontSize, "ValuesFontSize", 11, "Font Size", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&numberFormat, "NumberFormat", "Number Format", "", "", "");
|
||||
CAF_PDM_InitField(&numberOfDecimals, "Decimals", 2, "Number of Decimals", "", "", "");
|
||||
CAF_PDM_InitField(&scaleFactor, "ScaleFactor", 1.0, "Scale Factor", "", "", "");
|
||||
CAF_PDM_InitField(&valuesFontSize, "ValuesFontSize", 11, "Font Size", "", "", "");
|
||||
|
||||
numberOfDecimals.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
|
||||
|
||||
CAF_PDM_InitField(&isLogarithmicScaleEnabled, "LogarithmicScale", false, "Logarithmic Scale", "", "", "");
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
// clang-format on
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimSummaryAxisProperties::userDescriptionField()
|
||||
{
|
||||
@@ -97,15 +99,15 @@ caf::PdmFieldHandle* RimSummaryAxisProperties::userDescriptionField()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimSummaryAxisProperties::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||
QList<caf::PdmOptionItemInfo> RimSummaryAxisProperties::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
*useOptionsOnly = true;
|
||||
|
||||
if (&titleFontSize == fieldNeedingOptions ||
|
||||
&valuesFontSize == fieldNeedingOptions)
|
||||
if (&titleFontSize == fieldNeedingOptions || &valuesFontSize == fieldNeedingOptions)
|
||||
{
|
||||
std::vector<int> fontSizes;
|
||||
fontSizes.push_back(8);
|
||||
@@ -128,10 +130,8 @@ QList<caf::PdmOptionItemInfo> RimSummaryAxisProperties::calculateValueOptions(co
|
||||
{
|
||||
for (int exp = -12; exp <= 12; exp += 3)
|
||||
{
|
||||
QString uiText =
|
||||
exp == 0 ? "1" :
|
||||
QString("10 ^ %1").arg(exp);
|
||||
double value = std::pow(10, exp);
|
||||
QString uiText = exp == 0 ? "1" : QString("10 ^ %1").arg(exp);
|
||||
double value = std::pow(10, exp);
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo(uiText, value));
|
||||
}
|
||||
@@ -141,20 +141,40 @@ QList<caf::PdmOptionItemInfo> RimSummaryAxisProperties::calculateValueOptions(co
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAxisProperties::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup& titleGroup = *(uiOrdering.addNewGroup("Axis Title"));
|
||||
titleGroup.add(&isAutoTitle);
|
||||
titleGroup.add(&customTitle);
|
||||
titleGroup.add(&titlePositionEnum);
|
||||
titleGroup.add(&titleFontSize);
|
||||
{
|
||||
caf::PdmUiGroup* titleTextGroup = uiOrdering.addNewGroup("Title Text");
|
||||
|
||||
caf::PdmUiGroup& scaleGroup = *(uiOrdering.addNewGroup("Axis Values"));
|
||||
titleTextGroup->add(&isAutoTitle);
|
||||
|
||||
if (isAutoTitle())
|
||||
{
|
||||
titleTextGroup->add(&m_displayLongName);
|
||||
titleTextGroup->add(&m_displayShortName);
|
||||
titleTextGroup->add(&m_displayUnitText);
|
||||
|
||||
customTitle.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
titleTextGroup->add(&customTitle);
|
||||
customTitle.uiCapability()->setUiReadOnly(false);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup("Title Layout");
|
||||
titleGroup->add(&titlePositionEnum);
|
||||
titleGroup->add(&titleFontSize);
|
||||
}
|
||||
|
||||
caf::PdmUiGroup& scaleGroup = *(uiOrdering.addNewGroup("Axis Values"));
|
||||
scaleGroup.add(&isLogarithmicScaleEnabled);
|
||||
scaleGroup.add(&numberFormat);
|
||||
|
||||
|
||||
if (numberFormat() != NUMBER_FORMAT_AUTO)
|
||||
{
|
||||
scaleGroup.add(&numberOfDecimals);
|
||||
@@ -164,11 +184,12 @@ void RimSummaryAxisProperties::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
scaleGroup.add(&visibleRangeMin);
|
||||
scaleGroup.add(&visibleRangeMax);
|
||||
scaleGroup.add(&valuesFontSize);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAxisProperties::setNameAndAxis(const QString& name, QwtPlot::Axis axis)
|
||||
{
|
||||
@@ -180,7 +201,7 @@ void RimSummaryAxisProperties::setNameAndAxis(const QString& name, QwtPlot::Axis
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QwtPlot::Axis RimSummaryAxisProperties::qwtPlotAxisType() const
|
||||
{
|
||||
@@ -188,7 +209,7 @@ QwtPlot::Axis RimSummaryAxisProperties::qwtPlotAxisType() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::PlotAxis RimSummaryAxisProperties::plotAxisType() const
|
||||
{
|
||||
@@ -199,7 +220,39 @@ RiaDefines::PlotAxis RimSummaryAxisProperties::plotAxisType() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAxisProperties::useAutoTitle() const
|
||||
{
|
||||
return isAutoTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAxisProperties::showDescription() const
|
||||
{
|
||||
return m_displayLongName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAxisProperties::showAcronym() const
|
||||
{
|
||||
return m_displayShortName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAxisProperties::showUnitText() const
|
||||
{
|
||||
return m_displayUnitText();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAxisProperties::isActive() const
|
||||
{
|
||||
@@ -207,11 +260,11 @@ bool RimSummaryAxisProperties::isActive() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
|
||||
if (changedField == &isAutoTitle)
|
||||
{
|
||||
updateOptionSensitivity();
|
||||
@@ -224,13 +277,13 @@ void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
if (changedField == &visibleRangeMax)
|
||||
{
|
||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMax = oldValue.toDouble();
|
||||
|
||||
|
||||
rimSummaryPlot->disableAutoZoom();
|
||||
}
|
||||
else if (changedField == &visibleRangeMin)
|
||||
{
|
||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMin = oldValue.toDouble();
|
||||
|
||||
|
||||
rimSummaryPlot->disableAutoZoom();
|
||||
}
|
||||
|
||||
@@ -246,7 +299,7 @@ void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAxisProperties::updateOptionSensitivity()
|
||||
{
|
||||
@@ -254,7 +307,7 @@ void RimSummaryAxisProperties::updateOptionSensitivity()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAxisProperties::initAfterRead()
|
||||
{
|
||||
@@ -262,10 +315,9 @@ void RimSummaryAxisProperties::initAfterRead()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimSummaryAxisProperties::objectToggleField()
|
||||
{
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,40 +1,37 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016 Statoil ASA
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "qwt_plot.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimSummaryAxisProperties : public caf::PdmObject
|
||||
{
|
||||
@@ -57,39 +54,51 @@ public:
|
||||
public:
|
||||
RimSummaryAxisProperties();
|
||||
|
||||
void setNameAndAxis(const QString& name, QwtPlot::Axis axis);
|
||||
QwtPlot::Axis qwtPlotAxisType() const;
|
||||
RiaDefines::PlotAxis plotAxisType() const;
|
||||
void setNameAndAxis(const QString& name, QwtPlot::Axis axis);
|
||||
QwtPlot::Axis qwtPlotAxisType() const;
|
||||
RiaDefines::PlotAxis plotAxisType() const;
|
||||
bool useAutoTitle() const;
|
||||
bool showDescription() const;
|
||||
bool showAcronym() const;
|
||||
bool showUnitText() const;
|
||||
|
||||
caf::PdmField<bool> isAutoTitle;
|
||||
caf::PdmField<QString> customTitle;
|
||||
caf::PdmField<int> titleFontSize;
|
||||
caf::PdmField< caf::AppEnum< AxisTitlePositionType > > titlePositionEnum;
|
||||
caf::PdmField<QString> customTitle;
|
||||
caf::PdmField<int> titleFontSize;
|
||||
caf::PdmField<caf::AppEnum<AxisTitlePositionType>> titlePositionEnum;
|
||||
|
||||
caf::PdmField<double> visibleRangeMin;
|
||||
caf::PdmField<double> visibleRangeMax;
|
||||
caf::PdmField<double> visibleRangeMin;
|
||||
caf::PdmField<double> visibleRangeMax;
|
||||
|
||||
caf::PdmField< caf::AppEnum< NumberFormatType > > numberFormat;
|
||||
caf::PdmField<int> numberOfDecimals;
|
||||
caf::PdmField<double> scaleFactor;
|
||||
caf::PdmField<bool> isLogarithmicScaleEnabled;
|
||||
caf::PdmField<int> valuesFontSize;
|
||||
caf::PdmField<caf::AppEnum<NumberFormatType>> numberFormat;
|
||||
caf::PdmField<int> numberOfDecimals;
|
||||
caf::PdmField<double> scaleFactor;
|
||||
caf::PdmField<bool> isLogarithmicScaleEnabled;
|
||||
caf::PdmField<int> valuesFontSize;
|
||||
|
||||
bool isActive() const;
|
||||
bool isActive() const;
|
||||
|
||||
protected:
|
||||
virtual void initAfterRead() override;
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void initAfterRead() override;
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
|
||||
const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly) override;
|
||||
|
||||
private:
|
||||
void updateOptionSensitivity();
|
||||
void updateOptionSensitivity();
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmField<QString> m_name;
|
||||
QwtPlot::Axis m_axis;
|
||||
caf::PdmField<bool> m_isActive;
|
||||
|
||||
caf::PdmField<bool> isAutoTitle;
|
||||
caf::PdmField<bool> m_displayShortName;
|
||||
caf::PdmField<bool> m_displayLongName;
|
||||
caf::PdmField<bool> m_displayUnitText;
|
||||
|
||||
caf::PdmField<QString> m_name;
|
||||
QwtPlot::Axis m_axis;
|
||||
};
|
||||
|
||||
@@ -86,13 +86,19 @@ void RimSummaryCrossPlotCollection::summaryPlotItemInfos(QList<caf::PdmOptionIte
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RimSummaryCrossPlotCollection::addSummaryPlot()
|
||||
RimSummaryPlot* RimSummaryCrossPlotCollection::createSummaryPlot()
|
||||
{
|
||||
RimSummaryPlot* plot = new RimSummaryCrossPlot();
|
||||
m_summaryCrossPlots().push_back(plot);
|
||||
|
||||
plot->setDescription(QString("Summary Cross Plot %1").arg(m_summaryCrossPlots.size()));
|
||||
|
||||
return plot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCrossPlotCollection::addSummaryPlot(RimSummaryPlot *plot)
|
||||
{
|
||||
m_summaryCrossPlots().push_back(plot);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ public:
|
||||
void deleteAllChildObjects();
|
||||
|
||||
std::vector<RimSummaryPlot*> summaryPlots() const;
|
||||
RimSummaryPlot* addSummaryPlot();
|
||||
RimSummaryPlot* createSummaryPlot();
|
||||
void addSummaryPlot(RimSummaryPlot *plot);
|
||||
|
||||
void updateSummaryNameHasChanged();
|
||||
void summaryPlotItemInfos(QList<caf::PdmOptionItemInfo>* optionInfos) const;
|
||||
|
||||
@@ -63,7 +63,7 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
|
||||
{
|
||||
text += summaryAddress.quantityName();
|
||||
|
||||
if (m_unit && summaryCurve)
|
||||
if (m_unit && summaryCurve && !summaryCurve->unitNameY().empty())
|
||||
{
|
||||
text += "[" + summaryCurve->unitNameY() + "]";
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "RimAsciiDataCurve.h"
|
||||
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
#include "RiuSummaryVectorDescriptionMap.h"
|
||||
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_scale_draw.h"
|
||||
@@ -124,7 +125,7 @@ void RimSummaryPlotYAxisFormatter::applyYAxisPropertiesToPlot(RiuSummaryQwtPlot*
|
||||
|
||||
{
|
||||
QString axisTitle = m_axisProperties->customTitle;
|
||||
if (m_axisProperties->isAutoTitle) axisTitle = autoAxisTitle();
|
||||
if (m_axisProperties->useAutoTitle()) axisTitle = autoAxisTitle();
|
||||
|
||||
QwtText axisTitleY = qwtPlot->axisTitle(m_axisProperties->qwtPlotAxisType());
|
||||
|
||||
@@ -200,23 +201,60 @@ void RimSummaryPlotYAxisFormatter::applyYAxisPropertiesToPlot(RiuSummaryQwtPlot*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
std::map<std::string, std::set<std::string> > unitToQuantityNameMap;
|
||||
std::map<std::string, std::set<std::string>> unitToQuantityNameMap;
|
||||
|
||||
if (m_axisProperties->plotAxisType() == RiaDefines::PLOT_AXIS_BOTTOM)
|
||||
for (RimSummaryCurve* rimCurve : m_summaryCurves)
|
||||
{
|
||||
for (RimSummaryCurve* rimCurve : m_summaryCurves)
|
||||
RifEclipseSummaryAddress sumAddress;
|
||||
std::string unitText;
|
||||
|
||||
if (m_axisProperties->plotAxisType() == RiaDefines::PLOT_AXIS_BOTTOM)
|
||||
{
|
||||
unitToQuantityNameMap[rimCurve->unitNameX()].insert(rimCurve->curveName().toStdString());
|
||||
sumAddress = rimCurve->summaryAddressX();
|
||||
unitText = rimCurve->unitNameX();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( RimSummaryCurve* rimCurve : m_summaryCurves )
|
||||
else if (rimCurve->axisY() == this->m_axisProperties->plotAxisType())
|
||||
{
|
||||
if ( rimCurve->axisY() == this->m_axisProperties->plotAxisType() )
|
||||
sumAddress = rimCurve->summaryAddressY();
|
||||
unitText = rimCurve->unitNameY();
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string quantityNameForDisplay;
|
||||
{
|
||||
std::string quantityName = sumAddress.quantityName();
|
||||
|
||||
if (sumAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED)
|
||||
{
|
||||
unitToQuantityNameMap[rimCurve->unitNameY()].insert(rimCurve->curveName().toStdString());
|
||||
quantityNameForDisplay = shortCalculationName(quantityName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_axisProperties->showDescription())
|
||||
{
|
||||
quantityNameForDisplay = RiuSummaryVectorDescriptionMap::instance()->fieldInfo(quantityName);
|
||||
}
|
||||
|
||||
if (m_axisProperties->showAcronym())
|
||||
{
|
||||
if (!quantityNameForDisplay.empty())
|
||||
{
|
||||
quantityNameForDisplay += " (";
|
||||
quantityNameForDisplay += quantityName;
|
||||
quantityNameForDisplay += ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
quantityNameForDisplay += quantityName;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
unitToQuantityNameMap[unitText].insert(quantityNameForDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,19 +265,22 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
if (m_axisProperties->scaleFactor() != 1.0)
|
||||
{
|
||||
int exponent = std::log10(m_axisProperties->scaleFactor());
|
||||
int exponent = std::log10(m_axisProperties->scaleFactor());
|
||||
scaleFactorText = QString(" x 10<sup>%1</sup> ").arg(QString::number(exponent));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for ( auto unitIt : unitToQuantityNameMap )
|
||||
for (auto unitIt : unitToQuantityNameMap)
|
||||
{
|
||||
for (const auto &quantIt: unitIt.second)
|
||||
for (const auto& quantIt : unitIt.second)
|
||||
{
|
||||
assembledYAxisText += QString::fromStdString(quantIt) + " ";
|
||||
}
|
||||
assembledYAxisText += "[" + QString::fromStdString(unitIt.first) + scaleFactorText + "] ";
|
||||
|
||||
if (m_axisProperties->showUnitText() && !unitIt.first.empty())
|
||||
{
|
||||
assembledYAxisText += "[" + QString::fromStdString(unitIt.first) + scaleFactorText + "] ";
|
||||
}
|
||||
}
|
||||
|
||||
if (m_timeHistoryCurveQuantities.size() > 0)
|
||||
@@ -258,9 +299,21 @@ QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
||||
return assembledYAxisText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimSummaryPlotYAxisFormatter::shortCalculationName(const std::string& calculationName)
|
||||
{
|
||||
QString calculationShortName = QString::fromStdString(calculationName);
|
||||
|
||||
int indexOfFirstSpace = calculationShortName.indexOf(' ');
|
||||
if (indexOfFirstSpace > -1 && indexOfFirstSpace < calculationShortName.size())
|
||||
{
|
||||
calculationShortName = calculationShortName.left(indexOfFirstSpace);
|
||||
}
|
||||
|
||||
|
||||
return calculationShortName.toStdString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ public:
|
||||
|
||||
private:
|
||||
QString autoAxisTitle() const;
|
||||
|
||||
static std::string shortCalculationName(const std::string& calculationName);
|
||||
|
||||
private:
|
||||
RimSummaryAxisProperties* m_axisProperties;
|
||||
|
||||
@@ -156,7 +156,7 @@ void RimSummaryPlot::updateAxes()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlot::isLogarithmicScaleEnabled(RiaDefines::PlotAxis plotAxis) const
|
||||
{
|
||||
return yAxisPropertiesForAxis(plotAxis)->isLogarithmicScaleEnabled();
|
||||
return yAxisPropertiesLeftOrRight(plotAxis)->isLogarithmicScaleEnabled();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -516,7 +516,7 @@ void RimSummaryPlot::updateAxis(RiaDefines::PlotAxis plotAxis)
|
||||
qwtAxis = QwtPlot::yRight;
|
||||
}
|
||||
|
||||
RimSummaryAxisProperties* yAxisProperties = yAxisPropertiesForAxis(plotAxis);
|
||||
RimSummaryAxisProperties* yAxisProperties = yAxisPropertiesLeftOrRight(plotAxis);
|
||||
if (yAxisProperties->isActive() && hasVisibleCurvesForAxis(plotAxis))
|
||||
{
|
||||
m_qwtPlot->enableAxis(qwtAxis, true);
|
||||
@@ -545,7 +545,7 @@ void RimSummaryPlot::updateAxis(RiaDefines::PlotAxis plotAxis)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateZoomForAxis(RiaDefines::PlotAxis plotAxis)
|
||||
{
|
||||
RimSummaryAxisProperties* yAxisProps = yAxisPropertiesForAxis(plotAxis);
|
||||
RimSummaryAxisProperties* yAxisProps = yAxisPropertiesLeftOrRight(plotAxis);
|
||||
|
||||
if (yAxisProps->isLogarithmicScaleEnabled)
|
||||
{
|
||||
@@ -648,11 +648,11 @@ bool RimSummaryPlot::hasVisibleCurvesForAxis(RiaDefines::PlotAxis plotAxis) cons
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryAxisProperties* RimSummaryPlot::yAxisPropertiesForAxis(RiaDefines::PlotAxis plotAxis) const
|
||||
RimSummaryAxisProperties* RimSummaryPlot::yAxisPropertiesLeftOrRight(RiaDefines::PlotAxis leftOrRightPlotAxis) const
|
||||
{
|
||||
RimSummaryAxisProperties* yAxisProps = nullptr;
|
||||
|
||||
if (plotAxis == RiaDefines::PLOT_AXIS_LEFT)
|
||||
if (leftOrRightPlotAxis == RiaDefines::PLOT_AXIS_LEFT)
|
||||
{
|
||||
yAxisProps = m_leftYAxisProperties();
|
||||
}
|
||||
@@ -776,15 +776,15 @@ void RimSummaryPlot::updateBottomXAxis()
|
||||
|
||||
QwtPlot::Axis qwtAxis = QwtPlot::xBottom;
|
||||
|
||||
RimSummaryAxisProperties* yAxisProperties = m_bottomAxisProperties();
|
||||
RimSummaryAxisProperties* bottomAxisProperties = m_bottomAxisProperties();
|
||||
|
||||
if (yAxisProperties->isActive())
|
||||
if (bottomAxisProperties->isActive())
|
||||
{
|
||||
m_qwtPlot->enableAxis(qwtAxis, true);
|
||||
|
||||
std::set<QString> timeHistoryQuantities;
|
||||
|
||||
RimSummaryPlotYAxisFormatter calc(yAxisProperties,
|
||||
RimSummaryPlotYAxisFormatter calc(bottomAxisProperties,
|
||||
visibleSummaryCurvesForAxis(RiaDefines::PLOT_AXIS_BOTTOM),
|
||||
visibleAsciiDataCurvesForAxis(RiaDefines::PLOT_AXIS_BOTTOM),
|
||||
timeHistoryQuantities);
|
||||
@@ -805,7 +805,6 @@ void RimSummaryPlot::updateCaseNameHasChanged()
|
||||
{
|
||||
m_summaryCurveCollection->updateCaseNameHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -134,7 +134,7 @@ private:
|
||||
std::vector<RimAsciiDataCurve*> visibleAsciiDataCurvesForAxis(RiaDefines::PlotAxis plotAxis) const;
|
||||
bool hasVisibleCurvesForAxis(RiaDefines::PlotAxis plotAxis) const;
|
||||
|
||||
RimSummaryAxisProperties* yAxisPropertiesForAxis(RiaDefines::PlotAxis plotAxis) const;
|
||||
RimSummaryAxisProperties* yAxisPropertiesLeftOrRight(RiaDefines::PlotAxis leftOrRightPlotAxis) const;
|
||||
void updateAxis(RiaDefines::PlotAxis plotAxis);
|
||||
void updateZoomForAxis(RiaDefines::PlotAxis plotAxis);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user