mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1555 Add start measured depth to fishbones collection
This commit is contained in:
parent
c5264f56cb
commit
3bb0e84eb7
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimFishbonesCollection, "FishbonesCollection");
|
CAF_PDM_SOURCE_INIT(RimFishbonesCollection, "FishbonesCollection");
|
||||||
|
|
||||||
@ -49,6 +50,8 @@ RimFishbonesCollection::RimFishbonesCollection()
|
|||||||
CAF_PDM_InitFieldNoDefault(&m_wellPathCollection, "WellPathCollection", "Well Paths", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_wellPathCollection, "WellPathCollection", "Well Paths", "", "", "");
|
||||||
m_wellPathCollection = new RimFishboneWellPathCollection;
|
m_wellPathCollection = new RimFishboneWellPathCollection;
|
||||||
m_wellPathCollection.uiCapability()->setUiHidden(true);
|
m_wellPathCollection.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_startMD, "StartMD", HUGE_VAL, "Start MD", "", "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -78,6 +81,8 @@ void RimFishbonesCollection::appendFishbonesSubs(RimFishbonesMultipleSubs* subs)
|
|||||||
{
|
{
|
||||||
subs->fishbonesColor = nextFishbonesColor();
|
subs->fishbonesColor = nextFishbonesColor();
|
||||||
fishbonesSubs.push_back(subs);
|
fishbonesSubs.push_back(subs);
|
||||||
|
|
||||||
|
recalculateStartMD();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -113,3 +118,24 @@ cvf::Color3f RimFishbonesCollection::nextFishbonesColor() const
|
|||||||
return cvf::Color3f::fromByteColor(qFishbonesColor.red(), qFishbonesColor.green(), qFishbonesColor.blue());
|
return cvf::Color3f::fromByteColor(qFishbonesColor.red(), qFishbonesColor.green(), qFishbonesColor.blue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFishbonesCollection::recalculateStartMD()
|
||||||
|
{
|
||||||
|
double minStartMD = HUGE_VAL;
|
||||||
|
|
||||||
|
for (const RimFishbonesMultipleSubs* sub : fishbonesSubs())
|
||||||
|
{
|
||||||
|
for (auto& index : sub->installedLateralIndices())
|
||||||
|
{
|
||||||
|
minStartMD = std::min(minStartMD, sub->measuredDepth(index.subIndex) - 13.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (minStartMD < m_startMD())
|
||||||
|
{
|
||||||
|
m_startMD = minStartMD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -46,11 +46,16 @@ public:
|
|||||||
|
|
||||||
caf::PdmChildArrayField<RimFishbonesMultipleSubs*> fishbonesSubs;
|
caf::PdmChildArrayField<RimFishbonesMultipleSubs*> fishbonesSubs;
|
||||||
|
|
||||||
|
void recalculateStartMD();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cvf::Color3f nextFishbonesColor() const;
|
cvf::Color3f nextFishbonesColor() const;
|
||||||
|
|
||||||
|
private:
|
||||||
caf::PdmChildField<RimFishboneWellPathCollection*> m_wellPathCollection;
|
caf::PdmChildField<RimFishboneWellPathCollection*> m_wellPathCollection;
|
||||||
|
|
||||||
|
caf::PdmField<double> m_startMD;
|
||||||
};
|
};
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "RigWellPath.h"
|
#include "RigWellPath.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
|
#include "RimFishbonesCollection.h"
|
||||||
|
|
||||||
#include "cafPdmUiListEditor.h"
|
#include "cafPdmUiListEditor.h"
|
||||||
|
|
||||||
@ -334,6 +335,10 @@ void RimFishbonesMultipleSubs::computeRangesAndLocations()
|
|||||||
|
|
||||||
m_locationOfSubs = validMeasuredDepths;
|
m_locationOfSubs = validMeasuredDepths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimFishbonesCollection* collection;
|
||||||
|
this->firstAncestorOrThisOfTypeAsserted(collection);
|
||||||
|
collection->recalculateStartMD();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user