Example #1
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<std::string> RicSummaryCurveCreator::getAllSummaryWellNames()
{
    std::set<std::string> summaryWellNames;
    RimProject*           proj = RiaApplication::instance()->project();

    std::vector<RimSummaryCase*> cases = proj->allSummaryCases();
    for (RimSummaryCase* rimCase : cases)
    {
        RifSummaryReaderInterface* reader = nullptr;
        if (rimCase)
        {
            reader = rimCase->summaryReader();
        }

        if (reader)
        {
            const std::vector<RifEclipseSummaryAddress> allAddresses = reader->allResultAddresses();

            for (size_t i = 0; i < allAddresses.size(); i++)
            {
                if (allAddresses[i].category() == RifEclipseSummaryAddress::SUMMARY_WELL)
                {
                    summaryWellNames.insert(allAddresses[i].wellName());
                }
            }
        }
    }
    return summaryWellNames;
}
Example #2
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
std::set<RifEclipseSummaryAddress> RimSummaryCaseCollection::calculateUnionOfSummaryAddresses() const
{
   std::set<RifEclipseSummaryAddress> addressUnion;

   for (RimSummaryCase* currCase: m_cases)
   {
       if ( !currCase ) continue;
       
       RifSummaryReaderInterface* reader = currCase->summaryReader();

       if ( !reader ) continue;

       const std::vector<RifEclipseSummaryAddress>& readerAddresses = reader->allResultAddresses();
       addressUnion.insert(readerAddresses.begin(), readerAddresses.end());

    }

    return addressUnion;
}
Example #3
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
                                                                                  bool*                      useOptionsOnly)
{
    if (fieldNeedingOptions == &m_placeholderForLabel)
    {
        return QList<caf::PdmOptionItemInfo>();
    }

    if (fieldNeedingOptions == &m_summaryCase)
    {
        QList<caf::PdmOptionItemInfo> options;

        RimProject* proj = RiaApplication::instance()->project();
        for (auto sumCase : proj->allSummaryCases())
        {
            options.append(caf::PdmOptionItemInfo(sumCase->caseName(), sumCase));
        }

        return options;
    }

    std::vector<QString> identifierTexts;

    RifSummaryReaderInterface* reader = firstSummaryReaderForCurves();
    if (reader)
    {
        RiaSummaryCurveAnalyzer* analyzer = analyzerForReader(reader);

        if (fieldNeedingOptions == &m_wellName)
        {
            identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_WELL);
        }
        else if (fieldNeedingOptions == &m_region)
        {
            identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_REGION);
        }
        else if (fieldNeedingOptions == &m_wellGroupName)
        {
            identifierTexts = analyzer->identifierTexts(RifEclipseSummaryAddress::SUMMARY_WELL_GROUP);
        }
        else if (fieldNeedingOptions == &m_quantity)
        {
            RimSummaryCurveCollection* curveCollection = nullptr;
            this->firstAncestorOrThisOfTypeAsserted(curveCollection);

            RifEclipseSummaryAddress::SummaryVarCategory category = RifEclipseSummaryAddress::SUMMARY_FIELD;

            if (curveCollection->curves().size() > 0)
            {
                category = curveCollection->curves()[0]->summaryAddressY().category();
            }

            RiaSummaryCurveAnalyzer quantityAnalyzer;

            auto subset = RiaSummaryCurveAnalyzer::addressesForCategory(reader->allResultAddresses(), category);

            quantityAnalyzer.appendAdresses(subset);
            for (const auto& quantity : quantityAnalyzer.quantities())
            {
                identifierTexts.push_back(QString::fromStdString(quantity));
            }
        }
    }

    QList<caf::PdmOptionItemInfo> options;
    if (identifierTexts.size() > 0)
    {
        for (const auto& text : identifierTexts)
        {
            options.append(caf::PdmOptionItemInfo(text, text));
        }
    }
    else
    {
        options.push_back(caf::PdmOptionItemInfo("None", "None"));
    }

    return options;
}