Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class RealizationSurfacesProvider
return getAvailableIntersectionOptions(wellboreHeaders, fieldIntersectionPolylines);
});

const depthSurfaceMetadataDep = helperDependency(async ({ getLocalSetting, abortSignal }) => {
const surfaceMetadataSetDep = helperDependency(async ({ getLocalSetting, abortSignal }) => {
const ensembleIdent = getLocalSetting(Setting.ENSEMBLE);

if (!ensembleIdent) {
Expand All @@ -168,15 +168,17 @@ export class RealizationSurfacesProvider
}),
});

const depthSurfacesMetadata = surfaceMetadata.surfaces.filter(
(elm) => elm.attribute_type === SurfaceAttributeType_api.DEPTH,
);
return depthSurfacesMetadata;
return surfaceMetadata;
});

availableSettingsUpdater(Setting.ATTRIBUTE, ({ getHelperDependency }) => {
const depthSurfacesMetadata = getHelperDependency(depthSurfaceMetadataDep);

const surfaceMetadataSet = getHelperDependency(surfaceMetadataSetDep);
if (!surfaceMetadataSet) {
return [];
}
const depthSurfacesMetadata = surfaceMetadataSet.surfaces.filter(
(elm) => elm.attribute_type === SurfaceAttributeType_api.DEPTH,
);
if (!depthSurfacesMetadata) {
return [];
}
Expand All @@ -186,16 +188,20 @@ export class RealizationSurfacesProvider

availableSettingsUpdater(Setting.SURFACE_NAMES, ({ getLocalSetting, getHelperDependency }) => {
const attribute = getLocalSetting(Setting.ATTRIBUTE);
const depthSurfacesMetadata = getHelperDependency(depthSurfaceMetadataDep);
const surfaceMetadataSet = getHelperDependency(surfaceMetadataSetDep);

if (!attribute || !depthSurfacesMetadata) {
if (!attribute || !surfaceMetadataSet) {
return [];
}
const depthSurfacesMetadata = surfaceMetadataSet.surfaces.filter(
(elm) => elm.attribute_type === SurfaceAttributeType_api.DEPTH,
);

const filteredSurfaceNames = new Set(
depthSurfacesMetadata.filter((elm) => elm.attribute_name === attribute).map((elm) => elm.name),
);

// Filter depth surfaces metadata by the selected attribute
return Array.from(
new Set(depthSurfacesMetadata.filter((elm) => elm.attribute_name === attribute).map((elm) => elm.name)),
).sort();
return surfaceMetadataSet.surface_names_in_strat_order.filter((name) => filteredSurfaceNames.has(name));
});

// Create intersection polyline and actual section lengths data asynchronously
Expand Down
Loading