mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#500) Improved curve data property panel
Show curve data group first Hide auto name properties when custom name is defined
This commit is contained in:
parent
81b973a74c
commit
b481699cc2
@ -84,6 +84,8 @@ RimWellLogExtractionCurve::RimWellLogExtractionCurve()
|
||||
CAF_PDM_InitField(&m_addPropertyToCurveName, "AddPropertyToCurveName", true, "Property", "", "", "");
|
||||
CAF_PDM_InitField(&m_addWellNameToCurveName, "AddWellNameToCurveName", true, "WellName", "", "", "");
|
||||
CAF_PDM_InitField(&m_addTimestepToCurveName, "AddTimestepToCurveName", true, "Timestep", "", "", "");
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -114,13 +116,11 @@ void RimWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
||||
{
|
||||
this->updatePlotData();
|
||||
}
|
||||
|
||||
if (changedField == &m_wellPath)
|
||||
else if (changedField == &m_wellPath)
|
||||
{
|
||||
this->updatePlotData();
|
||||
}
|
||||
|
||||
if (changedField == &m_timeStep)
|
||||
else if (changedField == &m_timeStep)
|
||||
{
|
||||
this->updatePlotData();
|
||||
}
|
||||
@ -130,6 +130,8 @@ void RimWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
||||
changedField == &m_addWellNameToCurveName ||
|
||||
changedField == &m_addTimestepToCurveName)
|
||||
{
|
||||
this->uiCapability()->updateConnectedEditors();
|
||||
updateCurveName();
|
||||
updatePlotTitle();
|
||||
}
|
||||
}
|
||||
@ -220,7 +222,7 @@ void RimWellLogExtractionCurve::updatePlotData()
|
||||
updateTrackAndPlotFromCurveData();
|
||||
}
|
||||
|
||||
m_plot->replot();
|
||||
if (m_plot) m_plot->replot();
|
||||
}
|
||||
}
|
||||
|
||||
@ -290,49 +292,49 @@ QList<caf::PdmOptionItemInfo> RimWellLogExtractionCurve::calculateValueOptions(c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogExtractionCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Curve Display Name");
|
||||
caf::PdmUiGroup* generatedGroup = group->addNewGroup("Generated Display Name");
|
||||
generatedGroup->add(&m_generatedCurveName);
|
||||
caf::PdmUiGroup* generatedNameConfig = generatedGroup->addNewGroup("Include in Display Name");
|
||||
generatedNameConfig->add(&m_addCaseNameToCurveName);
|
||||
generatedNameConfig->add(&m_addPropertyToCurveName);
|
||||
generatedNameConfig->add(&m_addWellNameToCurveName);
|
||||
generatedNameConfig->add(&m_addTimestepToCurveName);
|
||||
|
||||
group->add(&m_useCustomCurveName);
|
||||
group->add(&m_customCurveName);
|
||||
|
||||
uiOrdering.add(&m_curveColor);
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data");
|
||||
curveDataGroup->add(&m_wellPath);
|
||||
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value());
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
|
||||
|
||||
uiOrdering.add(&m_wellPath);
|
||||
curveDataGroup->add(&m_wellPath);
|
||||
|
||||
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
|
||||
group1->add(&m_case);
|
||||
curveDataGroup->add(&m_case);
|
||||
if (eclipseCase)
|
||||
{
|
||||
group1->add(&(m_eclipseResultDefinition->m_resultTypeUiField));
|
||||
group1->add(&(m_eclipseResultDefinition->m_porosityModelUiField));
|
||||
group1->add(&(m_eclipseResultDefinition->m_resultVariableUiField));
|
||||
curveDataGroup->add(&(m_eclipseResultDefinition->m_resultTypeUiField));
|
||||
curveDataGroup->add(&(m_eclipseResultDefinition->m_porosityModelUiField));
|
||||
curveDataGroup->add(&(m_eclipseResultDefinition->m_resultVariableUiField));
|
||||
|
||||
if (m_eclipseResultDefinition->hasDynamicResult())
|
||||
{
|
||||
m_timeStep.uiCapability()->setUiHidden(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_timeStep.uiCapability()->setUiHidden(true);
|
||||
curveDataGroup->add(&m_timeStep);
|
||||
}
|
||||
}
|
||||
if (geomCase)
|
||||
else if (geomCase)
|
||||
{
|
||||
group1->add(&(m_geomResultDefinition->m_resultPositionTypeUiField));
|
||||
group1->add(&(m_geomResultDefinition->m_resultVariableUiField));
|
||||
curveDataGroup->add(&(m_geomResultDefinition->m_resultPositionTypeUiField));
|
||||
curveDataGroup->add(&(m_geomResultDefinition->m_resultVariableUiField));
|
||||
|
||||
m_timeStep.uiCapability()->setUiHidden(false);
|
||||
curveDataGroup->add(&m_timeStep);
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance");
|
||||
appearanceGroup->add(&m_curveName);
|
||||
appearanceGroup->add(&m_autoName);
|
||||
if (m_autoName)
|
||||
{
|
||||
caf::PdmUiGroup* autoGroup = appearanceGroup->addNewGroup("Auto Name Properties");
|
||||
autoGroup->add(&m_addCaseNameToCurveName);
|
||||
autoGroup->add(&m_addPropertyToCurveName);
|
||||
autoGroup->add(&m_addWellNameToCurveName);
|
||||
autoGroup->add(&m_addTimestepToCurveName);
|
||||
}
|
||||
|
||||
appearanceGroup->add(&m_curveColor);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -340,6 +342,8 @@ void RimWellLogExtractionCurve::defineUiOrdering(QString uiConfigName, caf::PdmU
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogExtractionCurve::initAfterRead()
|
||||
{
|
||||
RimWellLogPlotCurve::initAfterRead();
|
||||
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value());
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
|
||||
|
||||
|
@ -51,6 +51,8 @@ RimWellLogFileCurve::RimWellLogFileCurve()
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellLogChannnelName, "CurveWellLogChannel", "Well Log Channel", "", "", "");
|
||||
|
||||
m_wellPath = NULL;
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -98,7 +100,7 @@ void RimWellLogFileCurve::updatePlotData()
|
||||
|
||||
updateTrackAndPlotFromCurveData();
|
||||
|
||||
m_plot->replot();
|
||||
if (m_plot) m_plot->replot();
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,7 +136,7 @@ void RimWellLogFileCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
this->updatePlotData();
|
||||
}
|
||||
|
||||
m_plot->replot();
|
||||
if (m_plot) m_plot->replot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -142,10 +144,14 @@ void RimWellLogFileCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogFileCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
RimWellLogPlotCurve::defineUiOrdering(uiConfigName, uiOrdering);
|
||||
|
||||
uiOrdering.add(&m_wellPath);
|
||||
uiOrdering.add(&m_wellLogChannnelName);
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data");
|
||||
curveDataGroup->add(&m_wellPath);
|
||||
curveDataGroup->add(&m_wellLogChannnelName);
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance");
|
||||
appearanceGroup->add(&m_curveName);
|
||||
appearanceGroup->add(&m_autoName);
|
||||
appearanceGroup->add(&m_curveColor);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -40,20 +40,20 @@ RimWellLogPlotCurve::RimWellLogPlotCurve()
|
||||
|
||||
CAF_PDM_InitField(&m_showCurve, "Show", true, "Show curve", "", "", "");
|
||||
m_showCurve.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_customCurveName, "CurveDescription", "Custom Name", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_generatedCurveName, "GeneratedCurveName", "Autogenerated Name", "", "", "");
|
||||
m_generatedCurveName.uiCapability()->setUiReadOnly(true);
|
||||
m_generatedCurveName.xmlCapability()->setIOReadable(false);
|
||||
m_generatedCurveName.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitField(&m_useCustomCurveName, "UseCustomCurveName", false, "Show Custom Name", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_curveName, "CurveName", "Curve Name", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_customCurveName, "CurveDescription", "Custom Name", "", "", "");
|
||||
m_customCurveName.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_autoName, "AutoName", true, "Auto Name", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_curveColor, "Color", cvf::Color3f(cvf::Color3::BLACK), "Color", "", "", "");
|
||||
|
||||
m_plotCurve = new RiuWellLogPlotCurve;
|
||||
m_plotCurve->setXAxis(QwtPlot::xTop);
|
||||
m_plotCurve->setYAxis(QwtPlot::yLeft);
|
||||
|
||||
m_plot = NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -62,7 +62,7 @@ RimWellLogPlotCurve::RimWellLogPlotCurve()
|
||||
RimWellLogPlotCurve::~RimWellLogPlotCurve()
|
||||
{
|
||||
m_plotCurve->detach();
|
||||
m_plot->replot();
|
||||
if (m_plot) m_plot->replot();
|
||||
|
||||
delete m_plotCurve;
|
||||
}
|
||||
@ -76,24 +76,28 @@ void RimWellLogPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
{
|
||||
this->updateCurveVisibility();
|
||||
}
|
||||
|
||||
if (changedField == &m_customCurveName)
|
||||
else if (changedField == &m_curveName)
|
||||
{
|
||||
m_customCurveName = m_curveName;
|
||||
updatePlotTitle();
|
||||
}
|
||||
|
||||
if (&m_curveColor == changedField)
|
||||
else if (&m_curveColor == changedField)
|
||||
{
|
||||
m_plotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte())));
|
||||
}
|
||||
|
||||
if (changedField == &m_useCustomCurveName)
|
||||
else if (changedField == &m_autoName)
|
||||
{
|
||||
updatePlotTitle();
|
||||
if (!m_autoName)
|
||||
{
|
||||
m_customCurveName = createCurveName();
|
||||
}
|
||||
|
||||
updateOptionSensitivity();
|
||||
updateCurveName();
|
||||
updatePlotTitle();
|
||||
}
|
||||
|
||||
m_plot->replot();
|
||||
if (m_plot) m_plot->replot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -109,7 +113,7 @@ caf::PdmFieldHandle* RimWellLogPlotCurve::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCurve::updateCurveVisibility()
|
||||
{
|
||||
if (m_showCurve())
|
||||
if (m_showCurve() && m_plot)
|
||||
{
|
||||
m_plotCurve->attach(m_plot);
|
||||
}
|
||||
@ -125,6 +129,7 @@ void RimWellLogPlotCurve::updateCurveVisibility()
|
||||
void RimWellLogPlotCurve::updatePlotConfiguration()
|
||||
{
|
||||
this->updateCurveVisibility();
|
||||
this->updateCurveName();
|
||||
this->updatePlotTitle();
|
||||
|
||||
m_plotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte())));
|
||||
@ -149,14 +154,7 @@ void RimWellLogPlotCurve::setPlot(RiuWellLogTrackPlot* plot)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimWellLogPlotCurve::userDescriptionField()
|
||||
{
|
||||
if (m_useCustomCurveName)
|
||||
{
|
||||
return &m_customCurveName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return &m_generatedCurveName;
|
||||
}
|
||||
return &m_curveName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -197,7 +195,6 @@ bool RimWellLogPlotCurve::valueRange(double* minimumValue, double* maximumValue)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -227,29 +224,7 @@ QwtPlotCurve* RimWellLogPlotCurve::plotCurve() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCurve::updatePlotTitle()
|
||||
{
|
||||
m_generatedCurveName = this->createCurveName();
|
||||
|
||||
if (m_useCustomCurveName)
|
||||
{
|
||||
m_plotCurve->setTitle(m_customCurveName);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotCurve->setTitle(m_generatedCurveName);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Curve Display Name");
|
||||
group->add(&m_generatedCurveName);
|
||||
group->add(&m_useCustomCurveName);
|
||||
group->add(&m_customCurveName);
|
||||
|
||||
uiOrdering.add(&m_curveColor);
|
||||
m_plotCurve->setTitle(m_curveName);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -265,23 +240,9 @@ bool RimWellLogPlotCurve::isCurveVisibile()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCurve::initAfterRead()
|
||||
{
|
||||
// TODO:
|
||||
// In RimWellLogFileCurve::createCurveName, the object being referenced is not initialized at this point
|
||||
// No name is read from file
|
||||
// How to fix?
|
||||
m_generatedCurveName = this->createCurveName();
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCurve::updateOptionSensitivity()
|
||||
{
|
||||
m_customCurveName.uiCapability()->setUiReadOnly(!m_useCustomCurveName);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -307,3 +268,26 @@ void RimWellLogPlotCurve::updateTrackAndPlotFromCurveData()
|
||||
plotTrack->updateAxisRangesAndReplot();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCurve::updateCurveName()
|
||||
{
|
||||
if (m_autoName)
|
||||
{
|
||||
m_curveName = this->createCurveName();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_curveName = m_customCurveName;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCurve::updateOptionSensitivity()
|
||||
{
|
||||
m_curveName.uiCapability()->setUiReadOnly(m_autoName);
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ public:
|
||||
|
||||
QwtPlotCurve* plotCurve() const;
|
||||
|
||||
void updateCurveName();
|
||||
void updatePlotTitle();
|
||||
|
||||
virtual void updatePlotData() = 0;
|
||||
@ -62,14 +63,13 @@ protected:
|
||||
|
||||
void updatePlotConfiguration();
|
||||
void updateCurveVisibility();
|
||||
void updateOptionSensitivity();
|
||||
void updateTrackAndPlotFromCurveData();
|
||||
void updateOptionSensitivity();
|
||||
|
||||
// Overridden PDM methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
virtual void initAfterRead();
|
||||
|
||||
|
||||
@ -77,8 +77,9 @@ protected:
|
||||
RiuWellLogPlotCurve* m_plotCurve;
|
||||
|
||||
caf::PdmField<bool> m_showCurve;
|
||||
caf::PdmField<QString> m_curveName;
|
||||
caf::PdmField<QString> m_customCurveName;
|
||||
caf::PdmField<QString> m_generatedCurveName;
|
||||
caf::PdmField<bool> m_useCustomCurveName;
|
||||
|
||||
caf::PdmField<bool> m_autoName;
|
||||
caf::PdmField<cvf::Color3f> m_curveColor;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user