mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Remove unused code and clean up includes
This commit is contained in:
@@ -18,18 +18,7 @@
|
||||
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiuProjectPropertyView.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryPlotCollection, "SummaryPlotCollection");
|
||||
@@ -43,7 +32,6 @@ RimSummaryPlotCollection::RimSummaryPlotCollection()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&summaryPlots, "SummaryPlots", "Summary Plots", "", "", "");
|
||||
summaryPlots.uiCapability()->setUiHidden(true);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -52,72 +40,6 @@ RimSummaryPlotCollection::RimSummaryPlotCollection()
|
||||
RimSummaryPlotCollection::~RimSummaryPlotCollection()
|
||||
{
|
||||
summaryPlots.deleteAllChildObjects();
|
||||
|
||||
for (auto it = m_summaryFileReaders.begin(); it != m_summaryFileReaders.end(); it++)
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
m_summaryFileReaders.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifSummaryReaderInterface* RimSummaryPlotCollection::getOrCreateSummaryFileReader(const QString& eclipseCaseFilePathBasename)
|
||||
{
|
||||
auto it = m_summaryFileReaders.find(eclipseCaseFilePathBasename);
|
||||
if (it != m_summaryFileReaders.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
return createSummaryFileReader(eclipseCaseFilePathBasename);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifSummaryReaderInterface* RimSummaryPlotCollection::getOrCreateSummaryFileReader(const RimEclipseResultCase* eclipseCase)
|
||||
{
|
||||
if (!eclipseCase) return NULL;
|
||||
|
||||
QString caseName = eclipseCase->gridFileName();
|
||||
QString caseNameWithNoExtension = caseName.remove(".egrid", Qt::CaseInsensitive);
|
||||
|
||||
QString caseNameAbsPath = caseNameWithNoExtension.replace("/", "\\");
|
||||
|
||||
return this->getOrCreateSummaryFileReader(caseNameAbsPath);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifSummaryReaderInterface* RimSummaryPlotCollection::createSummaryFileReader(const QString& eclipseCaseFilePathBasename)
|
||||
{
|
||||
std::string headerFile;
|
||||
bool isFormatted = false;
|
||||
RifEclipseSummaryTools::findSummaryHeaderFile(eclipseCaseFilePathBasename.toStdString(), &headerFile, &isFormatted);
|
||||
|
||||
if (headerFile.empty()) return nullptr;
|
||||
|
||||
std::vector<std::string> dataFiles = RifEclipseSummaryTools::findSummaryDataFiles(eclipseCaseFilePathBasename.toStdString());
|
||||
|
||||
if (!dataFiles.size()) return nullptr;
|
||||
|
||||
RifSummaryReaderInterface* reader = new RifReaderEclipseSummary;
|
||||
if (!reader->open(headerFile, dataFiles))
|
||||
{
|
||||
delete reader;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryFileReaders.insert(std::make_pair(eclipseCaseFilePathBasename, reader));
|
||||
return reader;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user