2014-07-30 02:13:47 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-24 00:14:52 -05:00
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2014-07-30 02:13:47 -05:00
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RifReaderInterface.h"
|
|
|
|
|
2017-08-29 01:27:42 -05:00
|
|
|
#include "RiaApplication.h"
|
|
|
|
#include "RiaPreferences.h"
|
2014-07-30 02:13:47 -05:00
|
|
|
|
2017-08-29 01:27:42 -05:00
|
|
|
#include "RifReaderSettings.h"
|
2014-07-30 02:13:47 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RifReaderInterface::isFaultImportEnabled()
|
|
|
|
{
|
2017-08-29 01:27:42 -05:00
|
|
|
return readerSettings()->importFaults;
|
2014-07-30 02:13:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2014-10-24 04:38:47 -05:00
|
|
|
bool RifReaderInterface::isImportOfCompleteMswDataEnabled()
|
2014-07-30 02:13:47 -05:00
|
|
|
{
|
2017-08-29 01:27:42 -05:00
|
|
|
return readerSettings()->importAdvancedMswData;
|
2014-07-30 02:13:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RifReaderInterface::isNNCsEnabled()
|
|
|
|
{
|
2017-08-29 01:27:42 -05:00
|
|
|
return readerSettings()->importNNCs;
|
2014-07-30 02:13:47 -05:00
|
|
|
}
|
2017-04-18 04:32:04 -05:00
|
|
|
|
2017-08-10 06:08:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-04-18 04:32:04 -05:00
|
|
|
const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix()
|
|
|
|
{
|
2017-08-29 01:27:42 -05:00
|
|
|
return readerSettings()->faultIncludeFileAbsolutePathPrefix;
|
2017-04-18 04:32:04 -05:00
|
|
|
}
|
2017-08-10 06:08:38 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-08-11 00:34:54 -05:00
|
|
|
void RifReaderInterface::setTimeStepFilter(const std::vector<size_t>& fileTimeStepIndices)
|
2017-08-10 06:08:38 -05:00
|
|
|
{
|
2017-08-11 00:34:54 -05:00
|
|
|
m_fileTimeStepIndices = fileTimeStepIndices;
|
2017-08-10 06:08:38 -05:00
|
|
|
}
|
|
|
|
|
2017-11-10 02:43:51 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::set<RiaDefines::PhaseType> RifReaderInterface::availablePhases() const
|
|
|
|
{
|
|
|
|
return std::set<RiaDefines::PhaseType>();
|
|
|
|
}
|
|
|
|
|
2017-08-10 06:08:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RifReaderInterface::isTimeStepIncludedByFilter(size_t timeStepIndex) const
|
|
|
|
{
|
2017-08-11 00:34:54 -05:00
|
|
|
if (m_fileTimeStepIndices.empty()) return true;
|
2017-08-10 06:08:38 -05:00
|
|
|
|
2017-08-11 00:34:54 -05:00
|
|
|
for (auto i : m_fileTimeStepIndices)
|
2017-08-10 06:08:38 -05:00
|
|
|
{
|
|
|
|
if (i == timeStepIndex)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
size_t RifReaderInterface::timeStepIndexOnFile(size_t timeStepIndex) const
|
|
|
|
{
|
2017-08-11 00:34:54 -05:00
|
|
|
if (timeStepIndex < m_fileTimeStepIndices.size())
|
2017-08-10 06:08:38 -05:00
|
|
|
{
|
2017-08-11 00:34:54 -05:00
|
|
|
return m_fileTimeStepIndices[timeStepIndex];
|
2017-08-10 06:08:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return timeStepIndex;
|
|
|
|
}
|
|
|
|
|
2017-08-29 01:27:42 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const RifReaderSettings* RifReaderInterface::readerSettings() const
|
|
|
|
{
|
|
|
|
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
|
|
|
|
|
|
|
CVF_ASSERT(prefs->readerSettings());
|
|
|
|
|
|
|
|
return prefs->readerSettings();
|
|
|
|
}
|
|
|
|
|