mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Legend config: Do not show two configs when loading new case
This commit is contained in:
parent
a29a388df2
commit
6a20f16de1
@ -174,8 +174,8 @@ RimReservoirView::RimReservoirView()
|
|||||||
|
|
||||||
|
|
||||||
this->cellResult()->setReservoirView(this);
|
this->cellResult()->setReservoirView(this);
|
||||||
this->cellResult()->legendConfig()->setReservoirView(this);
|
|
||||||
this->cellResult()->legendConfig()->setPosition(cvf::Vec2ui(10, 120));
|
this->cellResult()->legendConfig()->setPosition(cvf::Vec2ui(10, 120));
|
||||||
|
|
||||||
this->cellEdgeResult()->setReservoirView(this);
|
this->cellEdgeResult()->setReservoirView(this);
|
||||||
this->cellEdgeResult()->legendConfig()->setReservoirView(this);
|
this->cellEdgeResult()->legendConfig()->setReservoirView(this);
|
||||||
this->cellEdgeResult()->legendConfig()->setPosition(cvf::Vec2ui(10, 320));
|
this->cellEdgeResult()->legendConfig()->setPosition(cvf::Vec2ui(10, 320));
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
RimDefines::PorosityModelType porosityModel() const { return m_porosityModel(); }
|
RimDefines::PorosityModelType porosityModel() const { return m_porosityModel(); }
|
||||||
void setPorosityModel(RimDefines::PorosityModelType val);
|
void setPorosityModel(RimDefines::PorosityModelType val);
|
||||||
QString resultVariable() const { return m_resultVariable(); }
|
QString resultVariable() const { return m_resultVariable(); }
|
||||||
void setResultVariable(const QString& val);
|
virtual void setResultVariable(const QString& val);
|
||||||
void setPorosityModelUiFieldHidden(bool hide);
|
void setPorosityModelUiFieldHidden(bool hide);
|
||||||
|
|
||||||
void loadResult();
|
void loadResult();
|
||||||
|
@ -35,14 +35,18 @@ RimResultSlot::RimResultSlot()
|
|||||||
CAF_PDM_InitObject("Result Slot", "", "", "");
|
CAF_PDM_InitObject("Result Slot", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&legendConfig, "LegendDefinition", "Legend Definition", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&legendConfig, "LegendDefinition", "Legend Definition", "", "", "");
|
||||||
|
this->legendConfig = new RimLegendConfig();
|
||||||
|
this->legendConfig.setUiHidden(true);
|
||||||
|
this->legendConfig.setUiChildrenHidden(true);
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_legendConfigData, "ResultVarLegendDefinitionList", "", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_legendConfigData, "ResultVarLegendDefinitionList", "", "", "", "");
|
||||||
m_legendConfigData.setUiHidden(true);
|
m_legendConfigData.setUiHidden(true);
|
||||||
m_legendConfigData.setUiChildrenHidden(true);
|
m_legendConfigData.setUiChildrenHidden(true);
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&ternaryLegendConfig, "TernaryLegendDefinition", "Ternary Legend Definition", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&ternaryLegendConfig, "TernaryLegendDefinition", "Ternary Legend Definition", "", "", "");
|
||||||
ternaryLegendConfig = new RimTernaryLegendConfig();
|
this->ternaryLegendConfig = new RimTernaryLegendConfig();
|
||||||
|
this->ternaryLegendConfig.setUiHidden(true);
|
||||||
legendConfig = new RimLegendConfig();
|
this->ternaryLegendConfig.setUiChildrenHidden(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -73,6 +77,8 @@ void RimResultSlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, co
|
|||||||
{
|
{
|
||||||
if (m_reservoirView) m_reservoirView->animationMode = true;
|
if (m_reservoirView) m_reservoirView->animationMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RiuMainWindow::instance()->uiPdmModel()->updateUiSubTree(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_reservoirView) m_reservoirView->createDisplayModelAndRedraw();
|
if (m_reservoirView) m_reservoirView->createDisplayModelAndRedraw();
|
||||||
@ -128,7 +134,6 @@ void RimResultSlot::changeLegendConfig(QString resultVarNameOfNewLegend)
|
|||||||
this->legendConfig.setUiChildrenHidden(false);
|
this->legendConfig.setUiChildrenHidden(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
RiuMainWindow::instance()->uiPdmModel()->updateUiSubTree(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -159,6 +164,16 @@ void RimResultSlot::setReservoirView(RimReservoirView* ownerReservoirView)
|
|||||||
(*it)->setReservoirView(ownerReservoirView);
|
(*it)->setReservoirView(ownerReservoirView);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ternaryLegendConfig) ternaryLegendConfig->setReservoirView(ownerReservoirView);
|
this->ternaryLegendConfig()->setReservoirView(ownerReservoirView);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimResultSlot::setResultVariable(const QString& val)
|
||||||
|
{
|
||||||
|
RimResultDefinition::setResultVariable(val);
|
||||||
|
|
||||||
|
this->changeLegendConfig(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,9 @@ public:
|
|||||||
caf::PdmField<RimTernaryLegendConfig*> ternaryLegendConfig;
|
caf::PdmField<RimTernaryLegendConfig*> ternaryLegendConfig;
|
||||||
|
|
||||||
// Overridden methods
|
// Overridden methods
|
||||||
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
|
virtual void setResultVariable(const QString& resultName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void initAfterRead();
|
virtual void initAfterRead();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user