mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2214 Summary Source Stepping : Remove obsolete code
This commit is contained in:
@@ -244,22 +244,6 @@ void RimSummaryCurveCollection::setCurrentSummaryCurve(RimSummaryCurve* curve)
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::applyNextIdentifier()
|
||||
{
|
||||
m_ySourceStepping->applyNextIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::applyPreviousIdentifier()
|
||||
{
|
||||
m_ySourceStepping->applyPreviousIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -61,8 +61,6 @@ public:
|
||||
|
||||
void setCurrentSummaryCurve(RimSummaryCurve* curve);
|
||||
|
||||
void applyNextIdentifier();
|
||||
void applyPreviousIdentifier();
|
||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
QString compileAutoPlotTitle() const;
|
||||
|
||||
@@ -496,22 +496,6 @@ void RimSummaryPlot::updatePlotTitle()
|
||||
updateMdiWindowTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::applyNextIdentifier()
|
||||
{
|
||||
m_summaryCurveCollection->applyNextIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::applyPreviousIdentifier()
|
||||
{
|
||||
m_summaryCurveCollection->applyPreviousIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -103,9 +103,6 @@ public:
|
||||
|
||||
void updatePlotTitle();
|
||||
|
||||
void applyNextIdentifier();
|
||||
void applyPreviousIdentifier();
|
||||
|
||||
// RimViewWindow overrides
|
||||
public:
|
||||
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
|
||||
@@ -142,7 +142,10 @@ void RimSummaryPlotSourceStepping::applyPrevCase()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyNextQuantity()
|
||||
{
|
||||
if (!m_quantity.uiCapability()->isUiHidden())
|
||||
{
|
||||
modifyCurrentIndex(&m_quantity, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -150,7 +153,10 @@ void RimSummaryPlotSourceStepping::applyNextQuantity()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyPrevQuantity()
|
||||
{
|
||||
if (!m_quantity.uiCapability()->isUiHidden())
|
||||
{
|
||||
modifyCurrentIndex(&m_quantity, -1);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -158,7 +164,10 @@ void RimSummaryPlotSourceStepping::applyPrevQuantity()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyNextOtherIdentifier()
|
||||
{
|
||||
caf::PdmValueField* valueField = valueFieldToModify();
|
||||
caf::PdmValueField* valueField = fieldToModify();
|
||||
if (!valueField)
|
||||
return;
|
||||
|
||||
modifyCurrentIndex(valueField, 1);
|
||||
}
|
||||
|
||||
@@ -167,110 +176,13 @@ void RimSummaryPlotSourceStepping::applyNextOtherIdentifier()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyPrevOtherIdentifier()
|
||||
{
|
||||
caf::PdmValueField* valueField = valueFieldToModify();
|
||||
caf::PdmValueField* valueField = fieldToModify();
|
||||
if (!valueField)
|
||||
return;
|
||||
|
||||
modifyCurrentIndex(valueField, -1);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyNextIdentifier()
|
||||
{
|
||||
updateUiFromCurves();
|
||||
|
||||
caf::PdmValueField* valueField = valueFieldToModify();
|
||||
if (valueField)
|
||||
{
|
||||
bool useOptionsOnly = true;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options = calculateValueOptions(valueField, nullptr);
|
||||
if (options.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto uiVariant = valueField->uiCapability()->toUiBasedQVariant();
|
||||
|
||||
int currentIndex = -1;
|
||||
for (int i = 0; i < options.size(); i++)
|
||||
{
|
||||
if (uiVariant == options[i].optionUiText())
|
||||
{
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentIndex == -1)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::applyPreviousIdentifier()
|
||||
{
|
||||
updateUiFromCurves();
|
||||
|
||||
caf::PdmValueField* valueField = valueFieldToModify();
|
||||
if (valueField)
|
||||
{
|
||||
bool useOptionsOnly = true;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options = calculateValueOptions(valueField, nullptr);
|
||||
if (options.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto uiVariant = valueField->uiCapability()->toUiBasedQVariant();
|
||||
|
||||
int currentIndex = -1;
|
||||
for (int i = 0; i < options.size(); i++)
|
||||
{
|
||||
if (uiVariant == options[i].optionUiText())
|
||||
{
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentIndex == -1)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -701,7 +613,7 @@ void RimSummaryPlotSourceStepping::updateUiFromCurves()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimSummaryPlotSourceStepping::fieldToModify()
|
||||
caf::PdmValueField* RimSummaryPlotSourceStepping::fieldToModify()
|
||||
{
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
analyzer.analyzeAdresses(allAddressesUsedInCurveCollection());
|
||||
@@ -721,36 +633,9 @@ caf::PdmFieldHandle* RimSummaryPlotSourceStepping::fieldToModify()
|
||||
return &m_region;
|
||||
}
|
||||
|
||||
if (analyzer.quantities().size() == 1)
|
||||
{
|
||||
return &m_quantity;
|
||||
}
|
||||
|
||||
// A pointer field is no a value field, so this must be improved
|
||||
// to be able to step between summary cases
|
||||
auto sumCases = allSummaryCasesUsedInCurveCollection();
|
||||
if (sumCases.size() == 1)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (proj->allSummaryCases().size() > 1)
|
||||
{
|
||||
return &m_summaryCase;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmValueField* RimSummaryPlotSourceStepping::valueFieldToModify()
|
||||
{
|
||||
// This will return a null pointer for summary case modifier
|
||||
|
||||
return dynamic_cast<caf::PdmValueField*>(fieldToModify());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -62,9 +62,6 @@ public:
|
||||
void applyNextOtherIdentifier();
|
||||
void applyPrevOtherIdentifier();
|
||||
|
||||
void applyNextIdentifier();
|
||||
void applyPreviousIdentifier();
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
private:
|
||||
@@ -83,8 +80,7 @@ private:
|
||||
RifSummaryReaderInterface* summaryReader() const;
|
||||
RimSummaryCase* singleSummaryCase() const;
|
||||
void updateUiFromCurves();
|
||||
caf::PdmFieldHandle* fieldToModify();
|
||||
caf::PdmValueField* valueFieldToModify();
|
||||
caf::PdmValueField* fieldToModify();
|
||||
|
||||
std::set<RifEclipseSummaryAddress> allAddressesUsedInCurveCollection() const;
|
||||
std::set<RimSummaryCase*> allSummaryCasesUsedInCurveCollection() const;
|
||||
|
||||
Reference in New Issue
Block a user