Move defines into separate file

This commit is contained in:
Magne Sjaastad committed 2025-10-03 08:37:24 +02:00
1 parent 336e4b65fd
commit a73999323a
31 files changed
+602 -416

No files matched your search

@@ -545,11 +545,11 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
if ( m_cellFilter() == RigFlowDiagResults::CELLS_COMMUNICATION )
{
view->cellResult()->setResultVariable( RIG_FLD_COMMUNICATION_RESNAME );
view->cellResult()->setResultVariable( RigFlowDiagDefines::communicationResultName() );
}
else
{
view->cellResult()->setResultVariable( RIG_FLD_TOF_RESNAME );
view->cellResult()->setResultVariable( RigFlowDiagDefines::tofResultName() );
}
int timeStep = 0;
@@ -660,7 +660,7 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
}
}
std::map<int, RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame> timeStepToFlowResultMap;
std::map<int, RigFlowDiagDefines::FlowCharacteristicsResultFrame> timeStepToFlowResultMap;
for ( int timeStepIdx : m_currentlyPlottedTimeSteps )
{
@@ -119,8 +119,8 @@ private:
caf::PdmField<double> m_minCommunication;
caf::PdmField<int> m_maxTof;
std::vector<int> m_currentlyPlottedTimeSteps;
std::map<int, RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame> m_timeStepToFlowResultMap;
std::vector<int> m_currentlyPlottedTimeSteps;
std::map<int, RigFlowDiagDefines::FlowCharacteristicsResultFrame> m_timeStepToFlowResultMap;
QPointer<RiuFlowCharacteristicsPlot> m_flowCharPlotWidget;
};
@@ -326,9 +326,9 @@ cvf::Color3f RimFlowDiagSolution::tracerColor( const QString& tracerName ) const
{
QString wellName = removeCrossFlowEnding( tracerName );
if ( wellName == RIG_FLOW_TOTAL_NAME ) return cvf::Color3f::LIGHT_GRAY;
if ( wellName == RIG_RESERVOIR_TRACER_NAME ) return cvf::Color3f::LIGHT_GRAY;
if ( wellName == RIG_TINY_TRACER_GROUP_NAME ) return cvf::Color3f::DARK_GRAY;
if ( wellName == RigFlowDiagDefines::flowTotalName() ) return cvf::Color3f::LIGHT_GRAY;
if ( wellName == RigFlowDiagDefines::reservoirTracerName() ) return cvf::Color3f::LIGHT_GRAY;
if ( wellName == RigFlowDiagDefines::tinyTracerGroupName() ) return cvf::Color3f::DARK_GRAY;
auto eclCase = firstAncestorOrThisOfType<RimEclipseResultCase>();
if ( eclCase )
@@ -747,9 +747,9 @@ QList<caf::PdmOptionItemInfo> RimWellAllocationOverTimePlot::calculateValueOptio
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimWellAllocationOverTimePlot::getTracerColor( const QString& tracerName )
{
if ( tracerName == RIG_FLOW_OIL_NAME ) return cvf::Color3f::DARK_GREEN;
if ( tracerName == RIG_FLOW_GAS_NAME ) return cvf::Color3f::DARK_RED;
if ( tracerName == RIG_FLOW_WATER_NAME ) return cvf::Color3f::BLUE;
if ( tracerName == RigFlowDiagDefines::flowOilName() ) return cvf::Color3f::DARK_GREEN;
if ( tracerName == RigFlowDiagDefines::flowGasName() ) return cvf::Color3f::DARK_RED;
if ( tracerName == RigFlowDiagDefines::flowWaterName() ) return cvf::Color3f::BLUE;
return cvf::Color3f::DARK_GRAY;
}
@@ -923,9 +923,9 @@ QWidget* RimWellAllocationPlot::createViewWidget( QWidget* mainWindowParent )
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimWellAllocationPlot::getTracerColor( const QString& tracerName )
{
if ( tracerName == RIG_FLOW_OIL_NAME ) return cvf::Color3f::DARK_GREEN;
if ( tracerName == RIG_FLOW_GAS_NAME ) return cvf::Color3f::DARK_RED;
if ( tracerName == RIG_FLOW_WATER_NAME ) return cvf::Color3f::BLUE;
if ( tracerName == RigFlowDiagDefines::flowOilName() ) return cvf::Color3f::DARK_GREEN;
if ( tracerName == RigFlowDiagDefines::flowGasName() ) return cvf::Color3f::DARK_RED;
if ( tracerName == RigFlowDiagDefines::flowWaterName() ) return cvf::Color3f::BLUE;
return cvf::Color3f::DARK_GRAY;
}
@@ -65,7 +65,9 @@ std::map<QString, const std::vector<double>*>
{
if ( flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex ) == requestedTracerType )
{
RigFlowDiagResultAddress resAddr( RIG_FLD_CELL_FRACTION_RESNAME, phaseSelection, tracerName.toStdString() );
RigFlowDiagResultAddress resAddr( RigFlowDiagDefines::cellFractionResultName().toStdString(),
phaseSelection,
tracerName.toStdString() );
const std::vector<double>* tracerCellFractions = flowDiagSolution->flowDiagResults()->resultValues( resAddr, timeStepIndex );
if ( tracerCellFractions )
{
@@ -537,8 +537,9 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
QString curveUnitText = RimWellPlotTools::flowUnitText( RimWellLogLasFile::WELL_FLOW_COND_RESERVOIR, unitSet );
const std::vector<double> accFlow = wfTotalAccumulator.accumulatedTracerFlowPrPseudoLength( RIG_FLOW_TOTAL_NAME, 0 );
addStackedCurve( curveName + ", " + RIG_FLOW_TOTAL_NAME + " " + curveUnitText,
const std::vector<double> accFlow =
wfTotalAccumulator.accumulatedTracerFlowPrPseudoLength( RigFlowDiagDefines::flowTotalName(), 0 );
addStackedCurve( curveName + ", " + RigFlowDiagDefines::flowTotalName() + " " + curveUnitText,
depthValues,
accFlow,
plotTrack,
@@ -559,21 +560,24 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
std::vector<QString> tracerNames = wfPhaseAccumulator.tracerNames();
for ( const QString& tracerName : tracerNames )
{
auto color = tracerName == RIG_FLOW_OIL_NAME ? cvf::Color3f::DARK_GREEN
: tracerName == RIG_FLOW_GAS_NAME ? cvf::Color3f::DARK_RED
: tracerName == RIG_FLOW_WATER_NAME ? cvf::Color3f::BLUE
: cvf::Color3f::DARK_GRAY;
auto color = tracerName == RigFlowDiagDefines::flowOilName() ? cvf::Color3f::DARK_GREEN
: tracerName == RigFlowDiagDefines::flowGasName() ? cvf::Color3f::DARK_RED
: tracerName == RigFlowDiagDefines::flowWaterName() ? cvf::Color3f::BLUE
: cvf::Color3f::DARK_GRAY;
if ( ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_OIL ) ) ||
( tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_GAS ) ) ||
( tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_WATER ) ) )
if ( ( tracerName == RigFlowDiagDefines::flowOilName() &&
selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_OIL ) ) ||
( tracerName == RigFlowDiagDefines::flowGasName() &&
selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_GAS ) ) ||
( tracerName == RigFlowDiagDefines::flowWaterName() &&
selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_WATER ) ) )
{
RimWellPlotTools::FlowPhase flowPhase = RimWellPlotTools::FlowPhase::FLOW_PHASE_NONE;
if ( tracerName == RIG_FLOW_OIL_NAME )
if ( tracerName == RigFlowDiagDefines::flowOilName() )
flowPhase = RimWellPlotTools::FlowPhase::FLOW_PHASE_OIL;
else if ( tracerName == RIG_FLOW_GAS_NAME )
else if ( tracerName == RigFlowDiagDefines::flowGasName() )
flowPhase = RimWellPlotTools::FlowPhase::FLOW_PHASE_GAS;
else if ( tracerName == RIG_FLOW_WATER_NAME )
else if ( tracerName == RigFlowDiagDefines::flowWaterName() )
flowPhase = RimWellPlotTools::FlowPhase::FLOW_PHASE_WATER;
QString curveUnitText =
RimWellPlotTools::curveUnitText( RimWellLogLasFile::WELL_FLOW_COND_STANDARD, unitSet, flowPhase );
@@ -389,8 +389,8 @@ void RimEclipseResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
if ( m_phaseSelection() != RigFlowDiagResultAddress::PHASE_ALL )
{
m_resultType = m_resultTypeUiField;
m_resultVariable = RIG_FLD_TOF_RESNAME;
m_resultVariableUiField = RIG_FLD_TOF_RESNAME;
m_resultVariable = RigFlowDiagDefines::tofResultName();
m_resultVariableUiField = RigFlowDiagDefines::tofResultName();
}
loadDataAndUpdate();
}
@@ -697,15 +697,15 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
options.push_back( caf::PdmOptionItemInfo( RimEclipseResultDefinitionTools::timeOfFlightString( injectorSelectionState(),
producerSelectionState(),
false ),
RIG_FLD_TOF_RESNAME ) );
RigFlowDiagDefines::tofResultName() ) );
if ( m_phaseSelection() == RigFlowDiagResultAddress::PHASE_ALL )
{
options.push_back( caf::PdmOptionItemInfo( "Tracer Cell Fraction (Sum)", RIG_FLD_CELL_FRACTION_RESNAME ) );
options.push_back( caf::PdmOptionItemInfo( "Tracer Cell Fraction (Sum)", RigFlowDiagDefines::cellFractionResultName() ) );
options.push_back( caf::PdmOptionItemInfo( RimEclipseResultDefinitionTools::maxFractionTracerString( injectorSelectionState(),
producerSelectionState(),
false ),
RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) );
options.push_back( caf::PdmOptionItemInfo( "Injector Producer Communication", RIG_FLD_COMMUNICATION_RESNAME ) );
RigFlowDiagDefines::maxFractionTracerResultName() ) );
options.push_back( caf::PdmOptionItemInfo( "Injector Producer Communication", RigFlowDiagDefines::communicationResultName() ) );
}
}
else if ( fieldNeedingOptions == &m_flowSolutionUiField )
@@ -752,7 +752,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
}
else if ( fieldNeedingOptions == &m_resultVariableUiField )
{
options.push_back( caf::PdmOptionItemInfo( RIG_NUM_FLOODED_PV, RIG_NUM_FLOODED_PV ) );
options.push_back( caf::PdmOptionItemInfo( RigFlowDiagDefines::numFloodedPv(), RigFlowDiagDefines::numFloodedPv() ) );
}
}
else
@@ -1450,7 +1450,8 @@ bool RimEclipseResultDefinition::hasCategoryResult() const
if ( m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && resultVariable() == RiaResultNames::completionTypeResultName() )
return true;
if ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME )
if ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS &&
m_resultVariable() == RigFlowDiagDefines::maxFractionTracerResultName() )
return true;
if ( resultVariable() == RiaResultNames::formationAllanResultName() || resultVariable() == RiaResultNames::formationBinaryAllanResultName() )
@@ -1546,7 +1547,7 @@ void RimEclipseResultDefinition::defineUiOrdering( QString uiConfigName, caf::Pd
}
if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS &&
m_resultVariableUiField() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME )
m_resultVariableUiField() == RigFlowDiagDefines::maxFractionTracerResultName() )
{
showOnlyVisibleCategoriesOption = true;
}
@@ -1629,11 +1630,11 @@ bool RimEclipseResultDefinition::hasDualPorFractureResult()
QString RimEclipseResultDefinition::flowDiagResUiText( bool shortLabel, int maxTracerStringLength ) const
{
QString uiText = QString::fromStdString( flowDiagResAddress().variableName );
if ( flowDiagResAddress().variableName == RIG_FLD_TOF_RESNAME )
if ( uiText == RigFlowDiagDefines::tofResultName() )
{
uiText = RimEclipseResultDefinitionTools::timeOfFlightString( injectorSelectionState(), producerSelectionState(), shortLabel );
}
else if ( flowDiagResAddress().variableName == RIG_FLD_MAX_FRACTION_TRACER_RESNAME )
else if ( uiText == RigFlowDiagDefines::maxFractionTracerResultName() )
{
uiText = RimEclipseResultDefinitionTools::maxFractionTracerString( injectorSelectionState(), producerSelectionState(), shortLabel );
}
@@ -130,10 +130,10 @@ QStringList RimEclipseResultDefinitionTools::getResultNamesForResultType( RiaDef
}
QStringList flowVars;
flowVars.push_back( RIG_FLD_TOF_RESNAME );
flowVars.push_back( RIG_FLD_CELL_FRACTION_RESNAME );
flowVars.push_back( RIG_FLD_MAX_FRACTION_TRACER_RESNAME );
flowVars.push_back( RIG_FLD_COMMUNICATION_RESNAME );
flowVars.push_back( RigFlowDiagDefines::tofResultName() );
flowVars.push_back( RigFlowDiagDefines::cellFractionResultName() );
flowVars.push_back( RigFlowDiagDefines::maxFractionTracerResultName() );
flowVars.push_back( RigFlowDiagDefines::communicationResultName() );
return flowVars;
}