2018-10-19 05:20:09 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-10-19 05:20:09 -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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-10-19 05:20:09 -05: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-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2018-10-19 05:20:09 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "cafAppEnum.h"
|
|
|
|
#include "cafPdmBase.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
2019-09-05 02:43:17 -05:00
|
|
|
|
2018-10-19 05:20:09 -05:00
|
|
|
class RimMultipleValveLocations : public caf::PdmObject
|
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
public:
|
2018-10-19 05:20:09 -05:00
|
|
|
enum LocationType
|
|
|
|
{
|
|
|
|
VALVE_COUNT,
|
|
|
|
VALVE_SPACING,
|
|
|
|
VALVE_CUSTOM,
|
|
|
|
VALVE_UNDEFINED
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
RimMultipleValveLocations();
|
|
|
|
|
2018-12-14 01:44:36 -06:00
|
|
|
void perforationIntervalUpdated();
|
2019-09-06 03:40:57 -05:00
|
|
|
double measuredDepth( size_t valveIndex ) const;
|
2018-10-19 07:44:17 -05:00
|
|
|
double rangeStart() const;
|
|
|
|
double rangeEnd() const;
|
|
|
|
const std::vector<double>& valveLocations() const;
|
2018-10-19 05:20:09 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void setLocationType( LocationType locationType );
|
2018-10-19 05:20:09 -05:00
|
|
|
void computeRangesAndLocations();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void initFields( LocationType locationType,
|
|
|
|
double rangeStart,
|
|
|
|
double rangeEnd,
|
|
|
|
double valveSpacing,
|
|
|
|
int valveCount,
|
|
|
|
const std::vector<double>& locationOfValves );
|
|
|
|
|
2018-10-19 05:20:09 -05:00
|
|
|
protected:
|
2019-09-06 03:40:57 -05:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue ) override;
|
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2018-10-19 05:20:09 -05:00
|
|
|
|
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
int rangeCountFromSpacing() const;
|
|
|
|
double minimumSpacingMeters() const;
|
|
|
|
double perforationStartMD() const;
|
|
|
|
double perforationEndMD() const;
|
|
|
|
static std::vector<double> locationsFromStartSpacingAndCount( double start, double spacing, size_t count );
|
2018-10-19 05:20:09 -05:00
|
|
|
|
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmField<caf::AppEnum<LocationType>> m_locationType;
|
|
|
|
caf::PdmField<double> m_rangeStart;
|
|
|
|
caf::PdmField<double> m_rangeEnd;
|
|
|
|
caf::PdmField<double> m_rangeValveSpacing;
|
|
|
|
caf::PdmField<int> m_rangeValveCount;
|
2018-10-19 05:20:09 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmField<std::vector<double>> m_locationOfValves; // Given in measured depth
|
2018-10-19 05:20:09 -05:00
|
|
|
};
|