update ui and use value.

This commit is contained in:
Kristian Bendiksen committed 2025-12-23 12:17:24 +01:00
1 parent a1b243d723
commit 0f35398b90
5 files changed
+97 -41

No files matched your search

@@ -40,7 +40,8 @@
//--------------------------------------------------------------------------------------------------
void RicMswTableDataTools::collectWelsegsData( RigMswTableData& tableData,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
bool exportCompletionSegmentsAfterMainBore )
{
@@ -66,6 +67,7 @@ void RicMswTableDataTools::collectWelsegsData( RigMswTableData&
exportInfo,
exportInfo.mainBoreBranch(),
&segmentNumber,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
exportCompletionSegmentsAfterMainBore,
@@ -79,7 +81,8 @@ void RicMswTableDataTools::collectWelsegsDataRecursively( RigMswTableData&
RicMswExportInfo& exportInfo,
gsl::not_null<RicMswBranch*> branch,
gsl::not_null<int*> segmentNumber,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
bool exportCompletionSegmentsAfterMainBore,
RicMswSegment* connectedToSegment )
@@ -93,7 +96,14 @@ void RicMswTableDataTools::collectWelsegsDataRecursively( RigMswTableData&
// Handle tie-in ICV at the beginning of branch
if ( outletValve = dynamic_cast<RicMswTieInICV*>( branch.get() ); outletValve != nullptr )
{
collectValveWelsegsSegment( tableData, outletSegment, outletValve, exportInfo, maxSegmentLength, customSegmentIntervals, segmentNumber );
collectValveWelsegsSegment( tableData,
outletSegment,
outletValve,
exportInfo,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
segmentNumber );
auto valveSegments = outletValve->segments();
outletSegment = valveSegments.front();
@@ -114,7 +124,16 @@ void RicMswTableDataTools::collectWelsegsDataRecursively( RigMswTableData&
branchDescription = QString( "Segments on branch %1" ).arg( branch->label() );
}
collectWelsegsSegment( tableData, segment, outletSegment, exportInfo, maxSegmentLength, customSegmentIntervals, branch, segmentNumber, branchDescription );
collectWelsegsSegment( tableData,
segment,
outletSegment,
exportInfo,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
branch,
segmentNumber,
branchDescription );
outletSegment = segment;
if ( !exportCompletionSegmentsAfterMainBore )
@@ -124,6 +143,7 @@ void RicMswTableDataTools::collectWelsegsDataRecursively( RigMswTableData&
segment,
&outletValve,
exportInfo,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
segmentNumber );
@@ -142,6 +162,7 @@ void RicMswTableDataTools::collectWelsegsDataRecursively( RigMswTableData&
segment,
&outletValve,
exportInfo,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
segmentNumber );
@@ -159,6 +180,7 @@ void RicMswTableDataTools::collectWelsegsDataRecursively( RigMswTableData&
exportInfo,
childBranch,
segmentNumber,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
exportCompletionSegmentsAfterMainBore,
@@ -173,7 +195,8 @@ void RicMswTableDataTools::collectWelsegsSegment( RigMswTableData&
RicMswSegment* segment,
const RicMswSegment* previousSegment,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
gsl::not_null<RicMswBranch*> branch,
int* segmentNumber,
@@ -185,11 +208,7 @@ void RicMswTableDataTools::collectWelsegsSegment( RigMswTableData&
double endMD = segment->endMD();
std::vector<std::pair<double, double>> segments =
RicMswTableFormatterTools::createSubSegmentMDPairs( startMD,
endMD,
std::nullopt,
std::optional<double>( maxSegmentLength ),
customSegmentIntervals );
RicMswTableFormatterTools::createSubSegmentMDPairs( startMD, endMD, minSegmentLength, maxSegmentLength, customSegmentIntervals );
CVF_ASSERT( branch->wellPath() );
@@ -283,7 +302,8 @@ void RicMswTableDataTools::collectValveWelsegsSegment( RigMswTableData&
const RicMswSegment* outletSegment,
RicMswValve* valve,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
int* segmentNumber )
{
@@ -318,11 +338,8 @@ void RicMswTableDataTools::collectValveWelsegsSegment( RigMswTableData&
endMD = subSegment->endMD();
}
auto splitSegments = RicMswTableFormatterTools::createSubSegmentMDPairs( startMD,
endMD,
std::nullopt,
std::optional<double>( maxSegmentLength ),
customSegmentIntervals );
auto splitSegments =
RicMswTableFormatterTools::createSubSegmentMDPairs( startMD, endMD, minSegmentLength, maxSegmentLength, customSegmentIntervals );
int outletSegmentNumber = outletSegment ? outletSegment->segmentNumber() : 1;
const auto linerDiameter = valve->wellPath()->mswCompletionParameters()->linerDiameter( exportInfo.unitSystem() );
@@ -381,7 +398,8 @@ void RicMswTableDataTools::collectCompletionsForSegment( RigMswTableData&
gsl::not_null<RicMswSegment*> segment,
RicMswValve** outletValve,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
int* segmentNumber )
{
@@ -396,7 +414,14 @@ void RicMswTableDataTools::collectCompletionsForSegment( RigMswTableData&
auto fishboneIcd = dynamic_cast<RicMswFishbonesICD*>( completion );
if ( !fishboneIcd && segmentValve != nullptr )
{
collectValveWelsegsSegment( tableData, segment, segmentValve, exportInfo, maxSegmentLength, customSegmentIntervals, segmentNumber );
collectValveWelsegsSegment( tableData,
segment,
segmentValve,
exportInfo,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
segmentNumber );
*outletValve = segmentValve;
}
else if ( dynamic_cast<RicMswTieInICV*>( completion ) )
@@ -408,6 +433,7 @@ void RicMswTableDataTools::collectCompletionsForSegment( RigMswTableData&
outletSegmentForCompletion,
completion,
exportInfo,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
segmentNumber );
@@ -415,7 +441,14 @@ void RicMswTableDataTools::collectCompletionsForSegment( RigMswTableData&
else
{
// This is the default case for completions that are not valves
collectCompletionWelsegsSegments( tableData, segment, completion, exportInfo, maxSegmentLength, customSegmentIntervals, segmentNumber );
collectCompletionWelsegsSegments( tableData,
segment,
completion,
exportInfo,
minSegmentLength,
maxSegmentLength,
customSegmentIntervals,
segmentNumber );
}
}
}
@@ -428,7 +461,8 @@ void RicMswTableDataTools::collectCompletionWelsegsSegments( RigMswTableData&
gsl::not_null<const RicMswSegment*> outletSegment,
gsl::not_null<RicMswCompletion*> completion,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
int* segmentNumber )
{
@@ -446,7 +480,7 @@ void RicMswTableDataTools::collectCompletionWelsegsSegments( RigMswTableData&
double endTVD = segment->endTVD();
auto splitSegments =
RicMswTableFormatterTools::createSubSegmentMDPairs( startMD, endMD, std::nullopt, maxSegmentLength, customSegmentIntervals );
RicMswTableFormatterTools::createSubSegmentMDPairs( startMD, endMD, minSegmentLength, maxSegmentLength, customSegmentIntervals );
for ( const auto& [subStartMD, subEndMD] : splitSegments )
{
int subSegmentNumber = ( *segmentNumber )++;
@@ -510,7 +544,7 @@ void RicMswTableDataTools::collectCompletionWelsegsSegments( RigMswTableData&
for ( auto comp : segment->completions() )
{
collectCompletionWelsegsSegments( tableData, segment, comp, exportInfo, maxSegmentLength, customSegmentIntervals, segmentNumber );
collectCompletionWelsegsSegments( tableData, segment, comp, exportInfo, minSegmentLength, maxSegmentLength, customSegmentIntervals, segmentNumber );
}
}
}
@@ -76,7 +76,8 @@ public:
// New data collection functions (replace formatter versions)
void collectWelsegsData( RigMswTableData& tableData,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
bool exportCompletionSegmentsAfterMainBore );
@@ -84,7 +85,8 @@ void collectWelsegsDataRecursively( RigMswTableData&
RicMswExportInfo& exportInfo,
gsl::not_null<RicMswBranch*> branch,
gsl::not_null<int*> segmentNumber,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
bool exportCompletionSegmentsAfterMainBore,
RicMswSegment* connectedToSegment );
@@ -111,7 +113,8 @@ void collectWelsegsSegment( RigMswTableData& tableD
RicMswSegment* segment,
const RicMswSegment* previousSegment,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
gsl::not_null<RicMswBranch*> branch,
int* segmentNumber,
@@ -121,7 +124,8 @@ void collectValveWelsegsSegment( RigMswTableData& t
const RicMswSegment* outletSegment,
RicMswValve* valve,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
int* segmentNumber );
@@ -130,7 +134,8 @@ void collectCompletionsForSegment( RigMswTableData&
gsl::not_null<RicMswSegment*> segment,
RicMswValve** outletValve,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
int* segmentNumber );
@@ -138,7 +143,8 @@ void collectCompletionWelsegsSegments( RigMswTableData&
gsl::not_null<const RicMswSegment*> outletSegment,
gsl::not_null<RicMswCompletion*> completion,
RicMswExportInfo& exportInfo,
double maxSegmentLength,
std::optional<double> minSegmentLength,
std::optional<double> maxSegmentLength,
const std::vector<std::pair<double, double>>& customSegmentIntervals,
int* segmentNumber );
@@ -125,6 +125,7 @@ std::expected<RigMswTableData, std::string> RicWellPathExportMswTableData::extra
// Use the new collection functions to populate the table data
RicMswTableDataTools::collectWelsegsData( tableData,
exportInfo,
mswParameters->minSegmentLength(),
mswParameters->maxSegmentLength(),
customSegmentIntervals,
exportCompletionsAfterMainBoreSegments );
@@ -116,6 +116,9 @@ RimMswCompletionParameters::RimMswCompletionParameters()
CAF_PDM_InitScriptableField( &m_maxSegmentLength, "MaxSegmentLength", 200.0, "Max Segment Length" );
m_maxSegmentLength.uiCapability()->setUiHidden( true );
CAF_PDM_InitScriptableFieldNoDefault( &m_minimumSegmentLength, "MinimumSegmentLength", "Minimum Segment Length" );
CAF_PDM_InitScriptableFieldNoDefault( &m_maximumSegmentLength, "MaximumSegmentLength", "Maximum Segment Length" );
CAF_PDM_InitFieldNoDefault( &m_customSegmentIntervals, "CustomSegmentIntervals", "Custom Segment Intervals" );
m_customSegmentIntervals = new RimCustomSegmentIntervalCollection();
m_customSegmentIntervals->intervalsField().uiCapability()->setUiEditorTypeName( caf::PdmUiTableViewEditor::uiEditorTypeName() );
@@ -335,9 +338,17 @@ RimMswCompletionParameters::LengthAndDepthEnum RimMswCompletionParameters::lengt
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimMswCompletionParameters::maxSegmentLength() const
std::optional<double> RimMswCompletionParameters::minSegmentLength() const
{
return m_enforceMaxSegmentLength ? m_maxSegmentLength : std::numeric_limits<double>::infinity();
return m_minimumSegmentLength;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::optional<double> RimMswCompletionParameters::maxSegmentLength() const
{
return m_maximumSegmentLength;
}
//--------------------------------------------------------------------------------------------------
@@ -499,8 +510,8 @@ void RimMswCompletionParameters::defineUiOrdering( QString uiConfigName, caf::Pd
// Custom Segment Configuration section
auto* segmentConfigGroup = uiOrdering.addNewGroup( "Custom Segment Configuration" );
segmentConfigGroup->add( &m_enforceMaxSegmentLength );
segmentConfigGroup->add( &m_maxSegmentLength );
segmentConfigGroup->add( &m_minimumSegmentLength );
segmentConfigGroup->add( &m_maximumSegmentLength );
segmentConfigGroup->add( &m_customSegmentIntervals->intervalsField() );
}
else
@@ -67,15 +67,16 @@ public:
RimMswCompletionParameters& operator=( const RimMswCompletionParameters& rhs );
ReferenceMDType referenceMDType() const;
double manualReferenceMD() const;
double linerDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const;
double linerDiameter() const;
double roughnessFactor() const;
double roughnessFactor( RiaDefines::EclipseUnitSystem unitSystem ) const;
PressureDropEnum pressureDrop() const;
LengthAndDepthEnum lengthAndDepth() const;
double maxSegmentLength() const;
ReferenceMDType referenceMDType() const;
double manualReferenceMD() const;
double linerDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const;
double linerDiameter() const;
double roughnessFactor() const;
double roughnessFactor( RiaDefines::EclipseUnitSystem unitSystem ) const;
PressureDropEnum pressureDrop() const;
LengthAndDepthEnum lengthAndDepth() const;
std::optional<double> minSegmentLength() const;
std::optional<double> maxSegmentLength() const;
void setReferenceMDType( ReferenceMDType refType );
void setManualReferenceMD( double manualRefMD );
@@ -132,5 +133,8 @@ private:
caf::PdmField<bool> m_enforceMaxSegmentLength;
caf::PdmField<double> m_maxSegmentLength;
caf::PdmField<std::optional<double>> m_minimumSegmentLength;
caf::PdmField<std::optional<double>> m_maximumSegmentLength;
caf::PdmChildField<RimCustomSegmentIntervalCollection*> m_customSegmentIntervals;
};