mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 15:10:22 -05:00
Python: Reject overwriting source summary vectors
This commit is contained in:
1 parent
dc1cc8e243
commit
ef1ad39723
2 files changed
+32
-5
No files matched your search
@@ -22,6 +22,7 @@
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifMultipleSummaryReaders.h"
|
||||
#include "RifOpmCommonSummary.h"
|
||||
@@ -358,6 +359,17 @@ std::expected<void, QString>
|
||||
return std::unexpected( errorMsg );
|
||||
}
|
||||
|
||||
auto address = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( keyword );
|
||||
auto fileReader = m_multiSummaryReader->findReader( m_fileSummaryReaderId );
|
||||
if ( fileReader && fileReader->hasAddress( address ) )
|
||||
{
|
||||
QString errorMsg = QString( "Cannot set summary values for '%1' because the vector comes from the source summary file. "
|
||||
"Use a new summary vector address instead." )
|
||||
.arg( QString::fromStdString( keyword ) );
|
||||
RiaLogging::error( errorMsg.toStdString() );
|
||||
return std::unexpected( errorMsg );
|
||||
}
|
||||
|
||||
// Validate value count matches main summary file
|
||||
size_t mainSummaryFileValueCount = m_multiSummaryReader->timeSteps( RifEclipseSummaryAddress() ).size();
|
||||
if ( values.size() != mainSummaryFileValueCount )
|
||||
|
||||
Reference in new issue
Block a user