#1399 QA of SummaryCurveFilter and Curve Auto Name Config

This commit is contained in:
Jacob Støren 2017-04-07 11:50:11 +02:00
parent 78fef85f8b
commit cbeca54dbe
3 changed files with 24 additions and 58 deletions

View File

@ -47,10 +47,6 @@ RimSummaryCurveAutoName::RimSummaryCurveAutoName()
CAF_PDM_InitField(&m_completion, "Completion", true, "I, J, K", "", "", "");
CAF_PDM_InitField(&m_caseName, "CaseName", true, "Case Name", "", "", "");
CAF_PDM_InitField(&m_showAdvancedProperties, "ShowAdvancedProperties", false, "Show Advanced Properties", "", "", "");
m_showAdvancedProperties.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
m_showAdvancedProperties.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
}
//--------------------------------------------------------------------------------------------------
@ -208,8 +204,6 @@ void RimSummaryCurveAutoName::applySettings(const RimSummaryCurveAutoName& other
m_wellSegmentNumber = other.m_wellSegmentNumber;
m_lgrName = other.m_lgrName;
m_completion = other.m_completion;
m_showAdvancedProperties = other.m_showAdvancedProperties;
}
//--------------------------------------------------------------------------------------------------
@ -269,39 +263,14 @@ void RimSummaryCurveAutoName::defineUiOrdering(QString uiConfigName, caf::PdmUiO
uiOrdering.add(&m_wellGroupName);
uiOrdering.add(&m_wellName);
if (m_showAdvancedProperties)
{
uiOrdering.add(&m_regionNumber);
uiOrdering.add(&m_lgrName);
uiOrdering.add(&m_completion);
uiOrdering.add(&m_wellSegmentNumber);
uiOrdering.add(&m_unit);
}
uiOrdering.add(&m_showAdvancedProperties);
caf::PdmUiGroup& advanced = *(uiOrdering.addNewGroup("Advanced"));
advanced.setCollapsedByDefault(true);
advanced.add(&m_regionNumber);
advanced.add(&m_lgrName);
advanced.add(&m_completion);
advanced.add(&m_wellSegmentNumber);
advanced.add(&m_unit);
uiOrdering.skipRemainingFields();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCurveAutoName::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute)
{
if (&m_showAdvancedProperties == field)
{
caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*> (attribute);
if (attrib)
{
if (m_showAdvancedProperties)
{
attrib->m_buttonText = "Hide Advanced Options";
}
else
{
attrib->m_buttonText = "Show Advanced Options";
}
}
}
}

View File

@ -42,7 +42,6 @@ protected:
friend class RimSummaryCurveFilter;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute);
private:
void appendWellName(std::string& text, const RifEclipseSummaryAddress& summaryAddress) const;

View File

@ -72,7 +72,7 @@ RimSummaryCurveFilter::RimSummaryCurveFilter()
m_selectedSummaryCases.uiCapability()->setAutoAddingOptionFromValue(false);
m_selectedSummaryCases.xmlCapability()->setIOWritable(false);
m_selectedSummaryCases.xmlCapability()->setIOReadable(false);
m_selectedSummaryCases.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
m_selectedSummaryCases.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
CAF_PDM_InitFieldNoDefault(&m_summaryFilter, "VarListFilter", "Filter", "", "", "");
m_summaryFilter.uiCapability()->setUiTreeChildrenHidden(true);
@ -91,12 +91,12 @@ RimSummaryCurveFilter::RimSummaryCurveFilter()
m_curves.uiCapability()->setUiHidden(true);
m_curves.uiCapability()->setUiTreeChildrenHidden(false);
CAF_PDM_InitFieldNoDefault(&m_applyButtonField, "ApplySelection", "Apply", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_applyButtonField, "ApplySelection", "", "", "", "");
m_applyButtonField.xmlCapability()->setIOWritable(false);
m_applyButtonField.xmlCapability()->setIOReadable(false);
m_applyButtonField = false;
m_applyButtonField.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
m_applyButtonField.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
m_applyButtonField.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::LEFT);
CAF_PDM_InitField(&m_autoApplyChangesToPlot, "AutoApplyFilterChanges", false, "Auto Apply Changes", "", "", "");
@ -189,27 +189,24 @@ QList<caf::PdmOptionItemInfo> RimSummaryCurveFilter::calculateValueOptions(const
//--------------------------------------------------------------------------------------------------
void RimSummaryCurveFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Summary Vectors");
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Cases");
curveDataGroup->add(&m_selectedSummaryCases);
caf::PdmUiGroup* curveVarSelectionGroup = curveDataGroup->addNewGroup("Vector Selection");
caf::PdmUiGroup* curveVarSelectionGroup = uiOrdering.addNewGroup("Vector Selection");
m_summaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
curveVarSelectionGroup->add(&m_uiFilterResultMultiSelection);
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance settings");
appearanceGroup->add(&m_useAutoAppearanceAssignment);
if(!m_useAutoAppearanceAssignment())
{
appearanceGroup->add(&m_caseAppearanceType);
appearanceGroup->add(&m_variableAppearanceType);
appearanceGroup->add(&m_wellAppearanceType);
appearanceGroup->add(&m_groupAppearanceType);
appearanceGroup->add(&m_regionAppearanceType);
}
uiOrdering.add(&m_plotAxis);
// Set sensitivity
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance settings");
appearanceGroup->setCollapsedByDefault(true);
appearanceGroup->add(&m_useAutoAppearanceAssignment);
appearanceGroup->add(&m_caseAppearanceType);
appearanceGroup->add(&m_variableAppearanceType);
appearanceGroup->add(&m_wellAppearanceType);
appearanceGroup->add(&m_groupAppearanceType);
appearanceGroup->add(&m_regionAppearanceType);
// Appearance option sensitivity
{
m_caseAppearanceType.uiCapability()->setUiReadOnly(m_useAutoAppearanceAssignment);
m_variableAppearanceType.uiCapability()->setUiReadOnly(m_useAutoAppearanceAssignment);
@ -219,11 +216,12 @@ void RimSummaryCurveFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd
}
caf::PdmUiGroup* autoNameGroup = uiOrdering.addNewGroup("Curve Name Configuration");
autoNameGroup->setCollapsedByDefault(true);
m_curveNameConfig->uiOrdering(uiConfigName, *autoNameGroup);
uiOrdering.add(&m_plotAxis);
uiOrdering.add(&m_autoApplyChangesToPlot);
uiOrdering.add(&m_applyButtonField);
m_applyButtonField.uiCapability()->setUiReadOnly(m_autoApplyChangesToPlot());
uiOrdering.skipRemainingFields(true);
}