Пример #1
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
RifEclipseSummaryAddress RimSummaryAddress::address()
{
    return RifEclipseSummaryAddress( m_category(),
                                     m_quantityName().toStdString(),
                                     m_regionNumber(),
                                     m_regionNumber2(),
                                     m_wellGroupName().toStdString(),
                                     m_wellName().toStdString(),
                                     m_wellSegmentNumber(),
                                     m_lgrName().toStdString(),
                                     m_cellI(), m_cellJ(), m_cellK());
}
Пример #2
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
                                                    const QVariant& newValue)
{
    RimSummaryCurveCollection* curveCollection = nullptr;
    this->firstAncestorOrThisOfTypeAsserted(curveCollection);

    bool triggerLoadDataAndUpdate = false;

    if (changedField == &m_summaryCase)
    {
        if (m_summaryCase())
        {
            for (auto curve : curveCollection->curves())
            {
                if (isYAxisStepping())
                {
                    curve->setSummaryCaseY(m_summaryCase);
                }

                if (isXAxisStepping())
                {
                    curve->setSummaryCaseX(m_summaryCase);
                }
            }

            triggerLoadDataAndUpdate = true;
        }

        m_wellName.uiCapability()->updateConnectedEditors();
        m_wellGroupName.uiCapability()->updateConnectedEditors();
        m_region.uiCapability()->updateConnectedEditors();
        m_quantity.uiCapability()->updateConnectedEditors();
    }
    else if (changedField == &m_wellName)
    {
        for (auto curve : curveCollection->curves())
        {
            if (isYAxisStepping())
            {
                RifEclipseSummaryAddress adr = curve->summaryAddressY();
                if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL)
                {
                    adr.setWellName(m_wellName().toStdString());

                    curve->setSummaryAddressY(adr);
                }
            }

            if (isXAxisStepping())
            {
                RifEclipseSummaryAddress adr = curve->summaryAddressX();
                if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL)
                {
                    adr.setWellName(m_wellName().toStdString());

                    curve->setSummaryAddressX(adr);
                }
            }
        }

        triggerLoadDataAndUpdate = true;
    }
    else if (changedField == &m_region)
    {
        for (auto curve : curveCollection->curves())
        {
            if (isYAxisStepping())
            {
                RifEclipseSummaryAddress adr = curve->summaryAddressY();
                if (adr.category() == RifEclipseSummaryAddress::SUMMARY_REGION)
                {
                    adr.setRegion(m_region());

                    curve->setSummaryAddressY(adr);
                }
            }

            if (isXAxisStepping())
            {
                RifEclipseSummaryAddress adr = curve->summaryAddressX();
                if (adr.category() == RifEclipseSummaryAddress::SUMMARY_REGION)
                {
                    adr.setRegion(m_region());

                    curve->setSummaryAddressX(adr);
                }
            }
        }

        triggerLoadDataAndUpdate = true;
    }
    else if (changedField == &m_quantity)
    {
        for (auto curve : curveCollection->curves())
        {
            if (isYAxisStepping())
            {
                RifEclipseSummaryAddress adr = curve->summaryAddressY();
                adr.setQuantityName(m_quantity().toStdString());

                curve->setSummaryAddressY(adr);
            }

            if (isXAxisStepping())
            {
                RifEclipseSummaryAddress adr = curve->summaryAddressX();
                adr.setQuantityName(m_quantity().toStdString());

                curve->setSummaryAddressX(adr);
            }
        }

        triggerLoadDataAndUpdate = true;
    }
    else if (changedField == &m_wellGroupName)
    {
        for (auto curve : curveCollection->curves())
        {
            if (isYAxisStepping())
            {
                RifEclipseSummaryAddress adr = curve->summaryAddressY();
                if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
                {
                    adr.setWellGroupName(m_wellGroupName().toStdString());

                    curve->setSummaryAddressY(adr);
                }
            }

            if (isXAxisStepping())
            {
                RifEclipseSummaryAddress adr = curve->summaryAddressX();
                if (adr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
                {
                    adr.setWellGroupName(m_wellGroupName().toStdString());

                    curve->setSummaryAddressX(adr);
                }
            }
        }

        triggerLoadDataAndUpdate = true;
    }

    if (triggerLoadDataAndUpdate)
    {
        RimSummaryPlot* summaryPlot = nullptr;
        this->firstAncestorOrThisOfTypeAsserted(summaryPlot);

        summaryPlot->updatePlotTitle();
        summaryPlot->loadDataAndUpdate();

        RimSummaryCrossPlot* summaryCrossPlot = dynamic_cast<RimSummaryCrossPlot*>(summaryPlot);
        if (summaryCrossPlot)
        {
            // Trigger update of curve collection (and summary toolbar in main window), as the visibility of combo boxes might
            // have been changed due to the updates in this function
            curveCollection->updateConnectedEditors();

            RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
            mainPlotWindow->updateSummaryPlotToolBar();
        }
    }
}