|
@@ -1,11 +1,11 @@
|
|
|
import { displayDiameterFor } from './pipeDiameterDisplay.js'
|
|
import { displayDiameterFor } from './pipeDiameterDisplay.js'
|
|
|
import { resolvePipeDiameters } from './pipeDiameter.js'
|
|
import { resolvePipeDiameters } from './pipeDiameter.js'
|
|
|
-import { displayPipeDiameter, pipeColorKey } from './pipeVisual.js'
|
|
|
|
|
|
|
+import { displayPipeDiameter, pipeColorKey, pipeVirtualDepthM, PIPE_VIRTUAL_DEPTH_M } from './pipeVisual.js'
|
|
|
|
|
|
|
|
/** 管体是沿真实折线路径的体积示意;虚拟埋深不是业务实测值。 */
|
|
/** 管体是沿真实折线路径的体积示意;虚拟埋深不是业务实测值。 */
|
|
|
export const PIPE_MODEL_POLICY = Object.freeze({ virtualDepthM: 2, componentSizeM: 1 })
|
|
export const PIPE_MODEL_POLICY = Object.freeze({ virtualDepthM: 2, componentSizeM: 1 })
|
|
|
export const PIPE_MODEL_KINDS = ['spline', 'elbow', 'valve', 'branch', 'cross']
|
|
export const PIPE_MODEL_KINDS = ['spline', 'elbow', 'valve', 'branch', 'cross']
|
|
|
-export const PIPE_MODEL_NOTE = '管体示意放大8倍、限制1.5–3m(非工程尺寸);源/双侧推算优先,仍缺管径时仅显示默认:燃气DN160、供水DN400、污水/雨水及雨污未分类排水DN800,未知行业不猜;源管径不回写。地面视图所有距离保留彩色导引,管线视图已建模段600m外保留导引;虚拟埋深2m(非实测);燃气红、供水蓝、污水绿、雨水青、窨井紫,雨污按network_level:0污水、1雨水、缺失按0,其它值未分类;构件固定示意朝向,素材/地表失败保留折线或符号。'
|
|
|
|
|
|
|
+export const PIPE_MODEL_NOTE = '管体示意放大8倍、限制1.5–3m(非工程尺寸);虚拟埋深按类别:燃气1.5m、供水4m、污水8m、雨水10m(均非实测);源/双侧推算优先,缺径仅显示默认DN160/400/800/800,不回写源管径。地面视图所有距离保留彩色导引,管线视图已建模段600m外保留导引;燃气红、供水蓝、污水绿、雨水青、窨井紫,雨污按network_level:0污水、1雨水、缺失按0,其它值未分类;构件固定示意朝向,素材/地表失败保留折线或符号。'
|
|
|
|
|
|
|
|
/** 输入只接收 toPipeNetwork 已准入且经模式计划裁剪后的对象,不再推断坐标/拓扑。 */
|
|
/** 输入只接收 toPipeNetwork 已准入且经模式计划裁剪后的对象,不再推断坐标/拓扑。 */
|
|
|
export function planPipeModels(network = {}) {
|
|
export function planPipeModels(network = {}) {
|
|
@@ -26,7 +26,7 @@ export function planPipeModels(network = {}) {
|
|
|
if (!diameter) visualDefaultCount += 1
|
|
if (!diameter) visualDefaultCount += 1
|
|
|
const diameterM = diameter ? diameter.diameterMm / 1000 : null
|
|
const diameterM = diameter ? diameter.diameterMm / 1000 : null
|
|
|
for (let i = 1; i < pipe.positions.length; i += 1) {
|
|
for (let i = 1; i < pipe.positions.length; i += 1) {
|
|
|
- instances.push({ id, kind: 'spline', industry: pipe.industry, colorKey, start: pipe.positions[i - 1], end: pipe.positions[i], diameterM, displayDiameterM:displayPipeDiameter(diameterM ?? visualDefaultDiameterM), diameterSource:diameter?.source || 'visual-default', diameterAnchors:diameter?.anchors || [], visualDefaultDiameterM })
|
|
|
|
|
|
|
+ instances.push({ id, kind: 'spline', industry: pipe.industry, colorKey, virtualDepthM:pipeVirtualDepthM(colorKey), start: pipe.positions[i - 1], end: pipe.positions[i], diameterM, displayDiameterM:displayPipeDiameter(diameterM ?? visualDefaultDiameterM), diameterSource:diameter?.source || 'visual-default', diameterAnchors:diameter?.anchors || [], visualDefaultDiameterM })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for (const component of network.components || []) {
|
|
for (const component of network.components || []) {
|
|
@@ -36,12 +36,13 @@ export function planPipeModels(network = {}) {
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
const kind = component.kind === 'branch' && component.label === 'cross' ? 'cross' : component.kind
|
|
const kind = component.kind === 'branch' && component.label === 'cross' ? 'cross' : component.kind
|
|
|
- instances.push({ id, kind, industry: component.industry, colorKey:pipeColorKey(component), position: component.position, sizeM: PIPE_MODEL_POLICY.componentSizeM, orientationSource: 'fixed-approximate' })
|
|
|
|
|
|
|
+ const colorKey = pipeColorKey(component)
|
|
|
|
|
+ instances.push({ id, kind, industry: component.industry, colorKey, virtualDepthM:pipeVirtualDepthM(colorKey), position: component.position, sizeM: PIPE_MODEL_POLICY.componentSizeM, orientationSource: 'fixed-approximate' })
|
|
|
}
|
|
}
|
|
|
const diameterSummary = { reported:0, interpolated:0, missing:0 }
|
|
const diameterSummary = { reported:0, interpolated:0, missing:0 }
|
|
|
for (const pipe of pipes) {
|
|
for (const pipe of pipes) {
|
|
|
const diameter = diameters.get(pipe)
|
|
const diameter = diameters.get(pipe)
|
|
|
diameterSummary[diameter ? diameter.source : 'missing'] += 1
|
|
diameterSummary[diameter ? diameter.source : 'missing'] += 1
|
|
|
}
|
|
}
|
|
|
- return { instances, fallbacks, diameterSummary, visualDefaultCount, virtualDepthM: PIPE_MODEL_POLICY.virtualDepthM }
|
|
|
|
|
|
|
+ return { instances, fallbacks, diameterSummary, visualDefaultCount, virtualDepthM: null, virtualDepthByColor: PIPE_VIRTUAL_DEPTH_M }
|
|
|
}
|
|
}
|