mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2179 Summary Plot : Make it clear that a ptr field is not yet supported
This commit is contained in:
parent
0a8a67c2aa
commit
dba6a5820d
@ -66,13 +66,7 @@ void RimSummaryCurvesModifier::applyNextIdentifier()
|
||||
{
|
||||
updateUiFromCurves();
|
||||
|
||||
caf::PdmValueField* valueField = nullptr;
|
||||
{
|
||||
auto identifierField = fieldToModify();
|
||||
|
||||
valueField = dynamic_cast<caf::PdmValueField*>(identifierField);
|
||||
}
|
||||
|
||||
caf::PdmValueField* valueField = valueFieldToModify();
|
||||
if (valueField)
|
||||
{
|
||||
bool useOptionsOnly = true;
|
||||
@ -93,22 +87,24 @@ void RimSummaryCurvesModifier::applyNextIdentifier()
|
||||
}
|
||||
}
|
||||
|
||||
if (currentIndex != -1)
|
||||
if (currentIndex == -1)
|
||||
{
|
||||
int nextIndex = currentIndex + 1;
|
||||
if (nextIndex >= options.size() - 1)
|
||||
{
|
||||
nextIndex = 0;
|
||||
}
|
||||
|
||||
auto optionValue = options[nextIndex].value();
|
||||
|
||||
QVariant currentValue = valueField->toQVariant();
|
||||
|
||||
valueField->setFromQVariant(optionValue);
|
||||
|
||||
valueField->uiCapability()->notifyFieldChanged(currentValue, optionValue);
|
||||
currentIndex = 0;
|
||||
}
|
||||
|
||||
int nextIndex = currentIndex + 1;
|
||||
if (nextIndex >= options.size() - 1)
|
||||
{
|
||||
nextIndex = 0;
|
||||
}
|
||||
|
||||
auto optionValue = options[nextIndex].value();
|
||||
|
||||
QVariant currentValue = valueField->toQVariant();
|
||||
|
||||
valueField->setFromQVariant(optionValue);
|
||||
|
||||
valueField->uiCapability()->notifyFieldChanged(currentValue, optionValue);
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,13 +115,7 @@ void RimSummaryCurvesModifier::applyPreviousIdentifier()
|
||||
{
|
||||
updateUiFromCurves();
|
||||
|
||||
caf::PdmValueField* valueField = nullptr;
|
||||
{
|
||||
auto identifierField = fieldToModify();
|
||||
|
||||
valueField = dynamic_cast<caf::PdmValueField*>(identifierField);
|
||||
}
|
||||
|
||||
caf::PdmValueField* valueField = valueFieldToModify();
|
||||
if (valueField)
|
||||
{
|
||||
bool useOptionsOnly = true;
|
||||
@ -146,22 +136,24 @@ void RimSummaryCurvesModifier::applyPreviousIdentifier()
|
||||
}
|
||||
}
|
||||
|
||||
if (currentIndex != -1)
|
||||
if (currentIndex == -1)
|
||||
{
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -496,6 +488,8 @@ caf::PdmFieldHandle* RimSummaryCurvesModifier::fieldToModify()
|
||||
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;
|
||||
@ -503,3 +497,13 @@ caf::PdmFieldHandle* RimSummaryCurvesModifier::fieldToModify()
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmValueField* RimSummaryCurvesModifier::valueFieldToModify()
|
||||
{
|
||||
// This will return a null pointer for summary case modifier
|
||||
|
||||
return dynamic_cast<caf::PdmValueField*>(fieldToModify());
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ private:
|
||||
void setWellName(const QString& wellName);
|
||||
void updateUiFromCurves();
|
||||
caf::PdmFieldHandle* fieldToModify();
|
||||
caf::PdmValueField* valueFieldToModify();
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
|
||||
|
Loading…
Reference in New Issue
Block a user