|
|
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
|
|
|
import * as THREE from 'three'
|
|
|
import { planPipeEnhancement } from '../../../src/modules/cockpit/domain/pipeEnhancement.js'
|
|
|
import { planEnhancementDevices } from '../../../src/modules/cockpit/domain/enhancementDevices.js'
|
|
|
-import { mountPipeEnhancement } from '../../../src/modules/cockpit/services/threePipeEnhancement.js'
|
|
|
+import { mountPipeEnhancement, deviceMarkerPlan } from '../../../src/modules/cockpit/services/threePipeEnhancement.js'
|
|
|
const plan = planPipeEnhancement({ selected: { kind: 'pipe', code: 'P' }, visiblePipes: [
|
|
|
{ code: 'P', industry: 'WATER_SUPPLY', diameter: 400, positions: [[110, 28], [110.001, 28]] },
|
|
|
] })
|
|
|
@@ -84,3 +84,21 @@ viewer.destroy()
|
|
|
pointer('pointerdown'); pointer('pointerup')
|
|
|
assert.equal(picked, null)
|
|
|
console.log('PASS 真实Three设备模型射线点选派发业务身份;拖拽和销毁后不误派发')
|
|
|
+
|
|
|
+// ---- 语义同步:颜色状态与中间类型图标必须与主图同表(维护者 2026-10-22 第二次反馈)----
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'ALARM', industry: 'GAS', pointCode: 'MP' }).tint, 'lv1', '报警→lv1')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'WARNING', industry: 'GAS', pointCode: 'MP' }).tint, 'lv2', '预警→lv2')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'WORK_ORDER', industry: 'GAS', pointCode: 'MP' }).tint, 'lv3', '工单处置→lv3')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'NORMAL', industry: 'GAS', pointCode: 'MP' }).tint, 'lv4', '正常→lv4')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'OFFLINE', industry: 'GAS', pointCode: 'MP' }).tint, 'point-offline', '离线必须用设备表的 point-offline,不能落点位表的 neutral')
|
|
|
+assert.equal(deviceMarkerPlan({ status: '未知态', industry: 'GAS', pointCode: 'MP' }).tint, 'point-unknown', '认不出必须 point-unknown,不能猜正常')
|
|
|
+const gasPlan = deviceMarkerPlan({ status: 'ALARM', industry: 'GAS', pointCode: 'MP' })
|
|
|
+assert.equal(gasPlan.inner.enabled, true, '有行业必须有内层类型图标')
|
|
|
+assert.equal(gasPlan.inner.icon, 'gas')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'ALARM', industry: 'WATER_SUPPLY', pointCode: 'MP' }).inner.icon, 'water')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'ALARM', industry: 'DRAINAGE', pointCode: 'MP' }).inner.icon, 'drainage')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'ALARM', industry: 'MANHOLE', pointCode: 'MP' }).inner.icon, 'manhole')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'ALARM', industry: '', pointCode: 'MP' }).inner.enabled, false, '无行业不造类型图标')
|
|
|
+assert.equal(gasPlan.master, 'solid', '有点位归属=实心母版')
|
|
|
+assert.equal(deviceMarkerPlan({ status: 'NORMAL', industry: 'GAS' }).master, 'hollow', '未关联设备=镂空母版')
|
|
|
+console.log('PASS 场景图标颜色状态/内层类型图标/母版形状与主图同表(设备五态 + 未知态)')
|