mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
Add flag to optionally distribute a summary calculation to all cases
This commit is contained in:
parent
319dc2ab9b
commit
eea56e4818
@ -61,8 +61,11 @@ RimSummaryCalculation::RimSummaryCalculation()
|
||||
{
|
||||
CAF_PDM_InitObject( "RimSummaryCalculation", ":/octave.png", "Calculation", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_distributeToOtherItems, "DistributeToOtherItems", true, "Distribute to other items (wells, groups, ..)" );
|
||||
CAF_PDM_InitField( &m_distributeToOtherItems, "DistributeToOtherItems", true, "Distribute to other items (wells, groups, ...)" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_distributeToOtherItems );
|
||||
|
||||
CAF_PDM_InitField( &m_distributeToAllCases, "DistributeToAllCases", true, "Distribute to All Cases" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_distributeToAllCases );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -465,6 +468,20 @@ void RimSummaryCalculation::removeDependentObjects()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCalculationAddress> RimSummaryCalculation::allAddressesForSummaryCase( RimSummaryCase* summaryCase ) const
|
||||
{
|
||||
if ( !m_distributeToAllCases )
|
||||
{
|
||||
for ( auto& v : m_variables )
|
||||
{
|
||||
if ( auto variable = dynamic_cast<RimSummaryCalculationVariable*>( v.p() ) )
|
||||
{
|
||||
if ( variable->summaryCase() != summaryCase )
|
||||
{
|
||||
return {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto variables = getVariables();
|
||||
if ( variables && !variables.value().empty() )
|
||||
{
|
||||
|
@ -91,4 +91,5 @@ protected:
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_distributeToOtherItems;
|
||||
caf::PdmField<bool> m_distributeToAllCases;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user