#3904 Summary : Move function

This commit is contained in:
Magne Sjaastad 2018-12-19 10:07:17 +01:00
parent cad072ba0b
commit b7e569d09a
4 changed files with 22 additions and 22 deletions

View File

@ -185,6 +185,24 @@ std::vector<RifEclipseSummaryAddress>
return filteredAddresses;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName(const std::string& curveName)
{
static std::string historyIdentifier = "H";
if (RiaStdStringTools::endsWith(curveName, historyIdentifier))
{
std::string candidate = curveName.substr(0, curveName.size() - 1);
return candidate;
}
else
{
return curveName + historyIdentifier;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -58,6 +58,8 @@ public:
static std::vector<RifEclipseSummaryAddress> addressesForCategory(const std::set<RifEclipseSummaryAddress>& addresses,
RifEclipseSummaryAddress::SummaryVarCategory category);
static std::string correspondingHistorySummaryCurveName(const std::string& curveName);
private:
void assignCategoryToQuantities() const;
void computeQuantityNamesWithHistory() const;

View File

@ -965,8 +965,8 @@ bool RimSummaryPlotSourceStepping::updateHistoryAndSummaryQuantityIfMatching(con
return true;
}
std::string correspondingOldString = correspondingHistorySummaryCurveName(oldString);
std::string correspondingNewString = correspondingHistorySummaryCurveName(newString);
std::string correspondingOldString = RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName(oldString);
std::string correspondingNewString = RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName(newString);
if (adr->quantityName() == correspondingOldString)
{
@ -978,24 +978,6 @@ bool RimSummaryPlotSourceStepping::updateHistoryAndSummaryQuantityIfMatching(con
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RimSummaryPlotSourceStepping::correspondingHistorySummaryCurveName(const std::string& curveName)
{
static std::string historyIdentifier = "H";
if (RiaStdStringTools::endsWith(curveName, historyIdentifier))
{
std::string candidate = curveName.substr(0, curveName.size() - 1);
return candidate;
}
else
{
return curveName + historyIdentifier;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -106,8 +106,6 @@ private:
const QVariant& newValue,
RifEclipseSummaryAddress* adr);
static std::string correspondingHistorySummaryCurveName(const std::string& curveName);
private:
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
caf::PdmPtrField<RimSummaryCaseCollection*> m_ensemble;