#1727 Reload summary case: A new file reader will be created on reload

This commit is contained in:
Rebecca Cox 2017-09-08 09:18:11 +02:00
parent b7ac93a905
commit 788ac2c8a8
3 changed files with 6 additions and 19 deletions

View File

@ -41,7 +41,11 @@ RifReaderEclipseSummary::RifReaderEclipseSummary()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RifReaderEclipseSummary::~RifReaderEclipseSummary() RifReaderEclipseSummary::~RifReaderEclipseSummary()
{ {
close(); if (m_ecl_sum)
{
ecl_sum_free(m_ecl_sum);
m_ecl_sum = NULL;
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -87,15 +91,6 @@ bool RifReaderEclipseSummary::open(const std::string& headerFileName, const std:
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RifReaderEclipseSummary::close()
{
if (m_ecl_sum)
{
ecl_sum_free(m_ecl_sum);
m_ecl_sum = NULL;
}
}
RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSumVarNode) RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSumVarNode)
{ {
if ( smspec_node_get_var_type(ertSumVarNode) == ECL_SMSPEC_INVALID_VAR if ( smspec_node_get_var_type(ertSumVarNode) == ECL_SMSPEC_INVALID_VAR

View File

@ -41,7 +41,6 @@ public:
~RifReaderEclipseSummary(); ~RifReaderEclipseSummary();
bool open(const std::string& headerFileName, const std::vector<std::string>& dataFileNames); bool open(const std::string& headerFileName, const std::vector<std::string>& dataFileNames);
void close();
bool hasAddress(const RifEclipseSummaryAddress& resultAddress); bool hasAddress(const RifEclipseSummaryAddress& resultAddress);
const std::vector<RifEclipseSummaryAddress>& allResultAddresses(); const std::vector<RifEclipseSummaryAddress>& allResultAddresses();

View File

@ -50,14 +50,7 @@ void RigSummaryCaseData::openOrReloadCase(const QString& summaryHeaderFileName)
std::string nativeSumHeadFileName = QDir::toNativeSeparators(summaryHeaderFileName).toStdString(); std::string nativeSumHeadFileName = QDir::toNativeSeparators(summaryHeaderFileName).toStdString();
RifEclipseSummaryTools::findSummaryFiles(nativeSumHeadFileName, &headerFileName, &dataFileNames); RifEclipseSummaryTools::findSummaryFiles(nativeSumHeadFileName, &headerFileName, &dataFileNames);
if (m_summaryFileReader.isNull()) m_summaryFileReader = new RifReaderEclipseSummary();
{
m_summaryFileReader = new RifReaderEclipseSummary();
}
else
{
m_summaryFileReader->close();
}
if (!m_summaryFileReader->open(headerFileName, dataFileNames)) if (!m_summaryFileReader->open(headerFileName, dataFileNames))
{ {