2017-11-09 01:21:36 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
2017-11-09 01:21:36 -06: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.
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
2017-11-09 01:21:36 -06:00
|
|
|
// 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.
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-11-09 01:21:36 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RiaRftPltCurveDefinition.h"
|
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
RiaRftPltCurveDefinition::RiaRftPltCurveDefinition( const RifDataSourceForRftPlt& address, const QString& wellName, const QDateTime& timeStep )
|
2019-09-06 03:40:57 -05:00
|
|
|
: m_curveAddress( address )
|
|
|
|
, m_wellName( wellName )
|
|
|
|
, m_timeStep( timeStep )
|
2019-07-25 00:38:46 -05:00
|
|
|
{
|
|
|
|
}
|
2017-11-09 01:21:36 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-11-09 01:21:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
const RifDataSourceForRftPlt& RiaRftPltCurveDefinition::address() const
|
2017-11-09 01:21:36 -06:00
|
|
|
{
|
2019-07-25 00:38:46 -05:00
|
|
|
return m_curveAddress;
|
2017-11-09 01:21:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-11-09 01:21:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
const QString& RiaRftPltCurveDefinition::wellName() const
|
2017-11-09 01:21:36 -06:00
|
|
|
{
|
2019-07-25 00:38:46 -05:00
|
|
|
return m_wellName;
|
2017-11-09 01:21:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-11-09 01:21:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
const QDateTime& RiaRftPltCurveDefinition::timeStep() const
|
2017-11-09 01:21:36 -06:00
|
|
|
{
|
2019-07-25 00:38:46 -05:00
|
|
|
return m_timeStep;
|
2017-11-09 01:21:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
2017-11-09 01:21:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-03-13 08:34:16 -05:00
|
|
|
auto RiaRftPltCurveDefinition::operator<=>( const RiaRftPltCurveDefinition& other ) const -> std::strong_ordering
|
2017-11-09 01:21:36 -06:00
|
|
|
{
|
2023-03-13 08:34:16 -05:00
|
|
|
RimSummaryCaseCollection* thisEnsemble = m_curveAddress.ensemble();
|
|
|
|
RimSummaryCaseCollection* otherEnsemble = other.m_curveAddress.ensemble();
|
|
|
|
|
|
|
|
if ( ( thisEnsemble && !otherEnsemble ) || ( !thisEnsemble && otherEnsemble ) )
|
2023-03-09 01:54:28 -06:00
|
|
|
{
|
2023-03-13 08:34:16 -05:00
|
|
|
// If one is an ensemble and the other is not, the ensemble should be first to make sure the ensemble curves are created and plotted
|
|
|
|
// before the single summary curves
|
2023-03-09 01:54:28 -06:00
|
|
|
|
2023-03-13 08:34:16 -05:00
|
|
|
return m_curveAddress.ensemble() <=> other.m_curveAddress.ensemble();
|
2023-03-09 01:54:28 -06:00
|
|
|
}
|
|
|
|
|
2023-03-13 08:34:16 -05:00
|
|
|
if ( ( m_curveAddress <=> other.m_curveAddress ) == std::strong_ordering::equal )
|
2019-09-06 03:40:57 -05:00
|
|
|
{
|
|
|
|
if ( m_wellName == other.m_wellName )
|
|
|
|
{
|
2023-03-13 08:34:16 -05:00
|
|
|
return m_timeStep.toTime_t() <=> other.m_timeStep.toTime_t();
|
2019-09-06 03:40:57 -05:00
|
|
|
}
|
2023-03-13 08:34:16 -05:00
|
|
|
return m_wellName.toStdString() <=> other.m_wellName.toStdString();
|
2019-09-06 03:40:57 -05:00
|
|
|
}
|
2023-03-13 08:34:16 -05:00
|
|
|
return m_curveAddress <=> other.m_curveAddress;
|
2017-11-09 01:21:36 -06:00
|
|
|
}
|