Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Jan 24, 2024
1 parent 993a2a1 commit bd6a919
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
9 changes: 4 additions & 5 deletions ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,13 @@ void RiaSummaryTools::copyCurveAxisData( RimSummaryCurve& curve, const RimSummar
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaSummaryTools::updateRequredCalculatedCurves( RimSummaryCase* sourceSummaryCase )
void RiaSummaryTools::updateRequiredCalculatedCurves( RimSummaryCase* sourceSummaryCase )
{
RimSummaryCalculationCollection* calcColl = RimProject::current()->calculationCollection();

for ( RimUserDefinedCalculation* summaryCalculation : calcColl->calculations() )
{
bool needsUpdate = RiaSummaryTools::checkIfCalculationNeedsUpdate( summaryCalculation, sourceSummaryCase );
bool needsUpdate = RiaSummaryTools::isCalculationRequired( summaryCalculation, sourceSummaryCase );
if ( needsUpdate )
{
summaryCalculation->parseExpression();
Expand All @@ -351,7 +351,7 @@ void RiaSummaryTools::updateRequredCalculatedCurves( RimSummaryCase* sourceSumma
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaSummaryTools::checkIfCalculationNeedsUpdate( const RimUserDefinedCalculation* summaryCalculation, const RimSummaryCase* summaryCase )
bool RiaSummaryTools::isCalculationRequired( const RimUserDefinedCalculation* summaryCalculation, const RimSummaryCase* summaryCase )
{
std::vector<RimUserDefinedCalculationVariable*> variables = summaryCalculation->allVariables();
for ( RimUserDefinedCalculationVariable* variable : variables )
Expand All @@ -374,12 +374,11 @@ void RiaSummaryTools::reloadSummaryCase( RimSummaryCase* summaryCase )
if ( !summaryCase ) return;

summaryCase->updateAutoShortName();

summaryCase->createSummaryReaderInterface();
summaryCase->createRftReaderInterface();
summaryCase->refreshMetaData();

RiaSummaryTools::updateRequredCalculatedCurves( summaryCase );
RiaSummaryTools::updateRequiredCalculatedCurves( summaryCase );

RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
for ( RimSummaryMultiPlot* multiPlot : summaryPlotColl->multiPlots() )
Expand Down
6 changes: 4 additions & 2 deletions ApplicationLibCode/Application/Tools/RiaSummaryTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ class RiaSummaryTools
static void copyCurveDataSources( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve );
static void copyCurveAxisData( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve );

static void updateRequredCalculatedCurves( RimSummaryCase* sourceSummaryCase );
static bool checkIfCalculationNeedsUpdate( const RimUserDefinedCalculation* summaryCalculation, const RimSummaryCase* summaryCase );
static void reloadSummaryCase( RimSummaryCase* summaryCase );

private:
static void updateRequiredCalculatedCurves( RimSummaryCase* sourceSummaryCase );
static bool isCalculationRequired( const RimUserDefinedCalculation* summaryCalculation, const RimSummaryCase* summaryCase );
};
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,6 @@ void RimSummaryCaseMainCollection::loadSummaryCaseData( std::vector<RimSummaryCa
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCaseMainCollection::loadSummaryData( RimSummaryCase* summaryCase )
{
loadSummaryCaseData( { summaryCase } );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class RimSummaryCaseMainCollection : public caf::PdmObject
void removeCaseCollection( RimSummaryCaseCollection* caseCollection );

void loadAllSummaryCaseData();
void loadSummaryData( RimSummaryCase* summaryCase );

QString uniqueShortNameForCase( RimSummaryCase* summaryCase );

Expand Down

0 comments on commit bd6a919

Please sign in to comment.