mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor: move historyIdentifier/differenceIdentifier.
This commit is contained in:
committed by
Magne Sjaastad
parent
ca87cee79b
commit
08f9e9b5bb
@@ -254,7 +254,7 @@ std::set<RifEclipseSummaryAddress> RiaSummaryStringTools::computeFilteredAddress
|
||||
|
||||
if ( includeDiffCurves ) return addresses;
|
||||
|
||||
const auto diffText = RifReaderEclipseSummary::differenceIdentifier();
|
||||
const auto diffText = RifEclipseSummaryAddressDefines::differenceIdentifier();
|
||||
|
||||
std::set<RifEclipseSummaryAddress> addressesWithoutDiffVectors;
|
||||
for ( const auto& adr : addresses )
|
||||
|
@@ -125,7 +125,7 @@ void RicNewSummaryMultiPlotFromDataVectorFeature::onActionTriggered( bool isChec
|
||||
if ( !addr.isHistoryVector() )
|
||||
{
|
||||
auto historyAddr = addr;
|
||||
historyAddr.setVectorName( addr.vectorName() + RifReaderEclipseSummary::historyIdentifier() );
|
||||
historyAddr.setVectorName( addr.vectorName() + RifEclipseSummaryAddressDefines::historyIdentifier() );
|
||||
|
||||
if ( availableAddresses.count( historyAddr ) > 0 ) eclipseAddresses.insert( historyAddr );
|
||||
}
|
||||
|
@@ -73,3 +73,19 @@ std::string RifEclipseSummaryAddressDefines::statisticsTypeToString( StatisticsT
|
||||
caf::AppEnum<StatisticsType> enumType( type );
|
||||
return enumType.uiText().toStdString();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifEclipseSummaryAddressDefines::differenceIdentifier()
|
||||
{
|
||||
return "_DIFF";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifEclipseSummaryAddressDefines::historyIdentifier()
|
||||
{
|
||||
return "H";
|
||||
}
|
||||
|
@@ -79,4 +79,7 @@ std::string statisticsNameP90();
|
||||
std::string statisticsNameMean();
|
||||
std::string statisticsTypeToString( StatisticsType type );
|
||||
|
||||
std::string differenceIdentifier();
|
||||
std::string historyIdentifier();
|
||||
|
||||
}; // namespace RifEclipseSummaryAddressDefines
|
||||
|
@@ -176,7 +176,8 @@ std::pair<bool, std::vector<double>> RifReaderEclipseSummary::values( const RifE
|
||||
if ( m_differenceAddresses.count( resultAddress ) )
|
||||
{
|
||||
const std::string& quantityName = resultAddress.vectorName();
|
||||
auto historyQuantity = quantityName.substr( 0, quantityName.size() - differenceIdentifier().size() ) + historyIdentifier();
|
||||
auto historyQuantity = quantityName.substr( 0, quantityName.size() - RifEclipseSummaryAddressDefines::differenceIdentifier().size() ) +
|
||||
RifEclipseSummaryAddressDefines::historyIdentifier();
|
||||
|
||||
RifEclipseSummaryAddress nativeAdrNoHistory = resultAddress;
|
||||
nativeAdrNoHistory.setVectorName( historyQuantity );
|
||||
@@ -251,10 +252,10 @@ void RifReaderEclipseSummary::buildMetaData()
|
||||
|
||||
{
|
||||
const std::string& s = adr.vectorName();
|
||||
if ( !RiaStdStringTools::endsWith( s, historyIdentifier() ) )
|
||||
if ( !RiaStdStringTools::endsWith( s, RifEclipseSummaryAddressDefines::historyIdentifier() ) )
|
||||
{
|
||||
RifEclipseSummaryAddress candidate = adr;
|
||||
candidate.setVectorName( s + historyIdentifier() );
|
||||
candidate.setVectorName( s + RifEclipseSummaryAddressDefines::historyIdentifier() );
|
||||
if ( m_allResultAddresses.count( candidate ) )
|
||||
{
|
||||
adrWithHistory = candidate;
|
||||
@@ -267,7 +268,7 @@ void RifReaderEclipseSummary::buildMetaData()
|
||||
{
|
||||
RifEclipseSummaryAddress candidate = adr;
|
||||
|
||||
std::string s = candidate.vectorName() + differenceIdentifier();
|
||||
std::string s = candidate.vectorName() + RifEclipseSummaryAddressDefines::differenceIdentifier();
|
||||
candidate.setVectorName( s );
|
||||
|
||||
m_allResultAddresses.insert( candidate );
|
||||
@@ -296,7 +297,7 @@ std::string RifReaderEclipseSummary::unitName( const RifEclipseSummaryAddress& r
|
||||
if ( reader )
|
||||
{
|
||||
auto nativeName = resultAddress.vectorName();
|
||||
auto stringToRemove = RifReaderEclipseSummary::differenceIdentifier();
|
||||
auto stringToRemove = RifEclipseSummaryAddressDefines::differenceIdentifier();
|
||||
if ( RiaStdStringTools::endsWith( nativeName, stringToRemove ) )
|
||||
{
|
||||
nativeName = nativeName.substr( 0, nativeName.size() - stringToRemove.size() );
|
||||
|
@@ -55,9 +55,6 @@ public:
|
||||
std::string unitName( const RifEclipseSummaryAddress& resultAddress ) const override;
|
||||
RiaDefines::EclipseUnitSystem unitSystem() const override;
|
||||
|
||||
static std::string differenceIdentifier() { return "_DIFF"; }
|
||||
static const std::string historyIdentifier() { return "H"; }
|
||||
|
||||
private:
|
||||
void buildMetaData();
|
||||
|
||||
|
@@ -105,10 +105,10 @@ double RimObjectiveFunction::value( RimSummaryCase*
|
||||
|
||||
for ( auto vectorSummaryAddress : vectorSummaryAddresses )
|
||||
{
|
||||
std::string s = vectorSummaryAddress.vectorName() + RifReaderEclipseSummary::differenceIdentifier();
|
||||
std::string s = vectorSummaryAddress.vectorName() + RifEclipseSummaryAddressDefines::differenceIdentifier();
|
||||
if ( !vectorSummaryAddress.vectorName().empty() )
|
||||
{
|
||||
if ( vectorSummaryAddress.vectorName().find( RifReaderEclipseSummary::differenceIdentifier() ) != std::string::npos )
|
||||
if ( vectorSummaryAddress.vectorName().find( RifEclipseSummaryAddressDefines::differenceIdentifier() ) != std::string::npos )
|
||||
{
|
||||
s = vectorSummaryAddress.vectorName();
|
||||
}
|
||||
@@ -116,7 +116,8 @@ double RimObjectiveFunction::value( RimSummaryCase*
|
||||
vectorSummaryAddressDiff.setVectorName( s );
|
||||
|
||||
RifEclipseSummaryAddress vectorSummaryAddressHistory = vectorSummaryAddress;
|
||||
vectorSummaryAddressHistory.setVectorName( vectorSummaryAddress.vectorName() + RifReaderEclipseSummary::historyIdentifier() );
|
||||
vectorSummaryAddressHistory.setVectorName( vectorSummaryAddress.vectorName() +
|
||||
RifEclipseSummaryAddressDefines::historyIdentifier() );
|
||||
|
||||
if ( readerInterface->allResultAddresses().count( vectorSummaryAddressDiff ) )
|
||||
{
|
||||
|
@@ -62,7 +62,7 @@ std::string RimObjectiveFunctionTools::nativeQuantityName( const std::string& qu
|
||||
std::string nativeName = quantityName;
|
||||
|
||||
{
|
||||
auto stringToRemove = RifReaderEclipseSummary::differenceIdentifier();
|
||||
auto stringToRemove = RifEclipseSummaryAddressDefines::differenceIdentifier();
|
||||
if ( RiaStdStringTools::endsWith( nativeName, stringToRemove ) )
|
||||
{
|
||||
nativeName = nativeName.substr( 0, nativeName.size() - stringToRemove.size() );
|
||||
@@ -70,7 +70,7 @@ std::string RimObjectiveFunctionTools::nativeQuantityName( const std::string& qu
|
||||
}
|
||||
|
||||
{
|
||||
auto stringToRemove = RifReaderEclipseSummary::historyIdentifier();
|
||||
auto stringToRemove = RifEclipseSummaryAddressDefines::historyIdentifier();
|
||||
if ( RiaStdStringTools::endsWith( nativeName, stringToRemove ) )
|
||||
{
|
||||
nativeName = nativeName.substr( 0, nativeName.size() - stringToRemove.size() );
|
||||
|
@@ -2417,7 +2417,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar
|
||||
if ( !addr.isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectors() )
|
||||
{
|
||||
auto historyAddr = addr;
|
||||
historyAddr.setVectorName( addr.vectorName() + RifReaderEclipseSummary::historyIdentifier() );
|
||||
historyAddr.setVectorName( addr.vectorName() + RifEclipseSummaryAddressDefines::historyIdentifier() );
|
||||
|
||||
auto historyCurveDef = newCurveDef;
|
||||
historyCurveDef.setSummaryAddressY( historyAddr );
|
||||
@@ -2477,7 +2477,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryAddressDrop( RimSummaryAd
|
||||
if ( !summaryAddr->address().isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectors() )
|
||||
{
|
||||
auto historyAddr = summaryAddr->address();
|
||||
historyAddr.setVectorName( summaryAddr->address().vectorName() + RifReaderEclipseSummary::historyIdentifier() );
|
||||
historyAddr.setVectorName( summaryAddr->address().vectorName() + RifEclipseSummaryAddressDefines::historyIdentifier() );
|
||||
newCurveAddresses.push_back( historyAddr );
|
||||
}
|
||||
|
||||
|
@@ -1086,13 +1086,13 @@ std::set<RifEclipseSummaryAddress>
|
||||
|
||||
if ( m_hideDifferenceVectors )
|
||||
{
|
||||
const auto diffText = RifReaderEclipseSummary::differenceIdentifier();
|
||||
const auto diffText = RifEclipseSummaryAddressDefines::differenceIdentifier();
|
||||
if ( RiaStdStringTools::endsWith( adr.vectorName(), diffText ) ) continue;
|
||||
}
|
||||
|
||||
if ( m_hideVectorsWithoutHistory )
|
||||
{
|
||||
auto candidateName = adr.vectorName() + RifReaderEclipseSummary::historyIdentifier();
|
||||
auto candidateName = adr.vectorName() + RifEclipseSummaryAddressDefines::historyIdentifier();
|
||||
|
||||
bool found = false;
|
||||
for ( const auto& ad : addrUnion )
|
||||
|
Reference in New Issue
Block a user