Exemple #1
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RimGeoMechPropertyFilter::computeResultValueRange()
{
    CVF_ASSERT(m_parentContainer);

    double min = 0.0;
    double max = 0.0;

    clearCategories();

    RigFemResultAddress resultAddress = resultDefinition->resultAddress();
    if (resultAddress.isValid() && resultDefinition->ownerCaseData())
    {
        if (resultDefinition->hasCategoryResult())
        {
            std::vector<QString> fnVector;
            if (resultDefinition->ownerCaseData()->femPartResults()->activeFormationNames())
            {
                fnVector = resultDefinition->ownerCaseData()->femPartResults()->activeFormationNames()->formationNames();
            }
            setCategoryNames(fnVector);
        }
        else
        {
            resultDefinition->ownerCaseData()->femPartResults()->minMaxScalarValues(resultAddress, &min, &max);
        }
    }

    m_maximumResultValue = max;
    m_minimumResultValue = min;

    lowerBound.uiCapability()->setUiName(QString("Min (%1)").arg(min));
    upperBound.uiCapability()->setUiName(QString("Max (%1)").arg(max));
}
Exemple #2
0
void CategoryMgr::reloadCategories(void)
{
  clearCategories();
  m_changed = false;
  
  QString section = "CategoryMgr";
  int i = 0;
  QString prefBaseName;
  QString tempStr;
  for(i = 1; i <= tMaxNumCategories; i++)
  {
    prefBaseName.sprintf("Category%d_", i);
    
    // attempt to pull a button title from the preferences
    tempStr = prefBaseName + "Name";
    if (pSEQPrefs->isPreference(tempStr, section))
    {
      QString name = pSEQPrefs->getPrefString(tempStr, section);
      QString filter =
	pSEQPrefs->getPrefString(prefBaseName + "Filter", section);
      QColor color = pSEQPrefs->getPrefColor(prefBaseName + "Color", 
					     section, QColor("black"));
      tempStr = prefBaseName + "FilterOut";
      QString filterout;
      if (pSEQPrefs->isPreference(tempStr, section))
	filterout = pSEQPrefs->getPrefString(tempStr, section);
	
      //seqDebug("%d: Got '%s' '%s' '%s'", i, name, filter, color);
      if (!name.isEmpty() && !filter.isEmpty())
      {
        Category* newcat = new Category(name, filter, filterout, color);
	
        m_categories.append(newcat);
      }
    }
  }
  
   // signal that the categories have been loaded
   emit loadedCategories();

   seqInfo("Categories Reloaded");
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RimEclipsePropertyFilter::computeResultValueRange()
{
    CVF_ASSERT(parentContainer());

    double min = 0.0;
    double max = 0.0;

    clearCategories();

    size_t scalarIndex = resultDefinition->scalarResultIndex();
    if (scalarIndex != cvf::UNDEFINED_SIZE_T)
    {
        RimReservoirCellResultsStorage* results = resultDefinition->currentGridCellResults();
        if (results)
        {
            results->cellResults()->minMaxCellScalarValues(scalarIndex, min, max);

            if (resultDefinition->hasCategoryResult())
            {
                if (resultDefinition->resultType() != RimDefines::FORMATION_NAMES)
                {
                    setCategoryValues(results->cellResults()->uniqueCellScalarValues(scalarIndex));
                }
                else
                {
                    CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->reservoirData());
                    CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->reservoirData()->activeFormationNames());

                    const std::vector<QString>& fnVector = parentContainer()->reservoirView()->eclipseCase()->reservoirData()->activeFormationNames()->formationNames();
                    setCategoryNames(fnVector);
                }
            }
        }
    }

    m_maximumResultValue = max;
    m_minimumResultValue = min;

    m_lowerBound.uiCapability()->setUiName(QString("Min (%1)").arg(min));
    m_upperBound.uiCapability()->setUiName(QString("Max (%1)").arg(max));
}