From 732f97d740de606004cd19436ba19846bbd5b378 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期四, 13 六月 2024 15:05:53 +0800 Subject: [PATCH] # --- zy-asrs-flow/src/pages/map/utils.js | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js index 75532e5..62d5468 100644 --- a/zy-asrs-flow/src/pages/map/utils.js +++ b/zy-asrs-flow/src/pages/map/utils.js @@ -9,6 +9,7 @@ import conveyor from '/public/img/map/conveyor.png' import point from '/public/img/map/point.svg' import shuttle from '/public/img/map/shuttle.svg' +import { log } from 'three/examples/jsm/nodes/Nodes.js'; let app = null; let mapContainer = null; @@ -618,6 +619,8 @@ // shuttle showShuttle(shuttleVo, curFloor, setCurSPrite); } + + showLockPath(mapVo.lockPath, curFloor, setCurSPrite); } export const drawTravelPath = (shuttleVo, curFloor) => { @@ -679,4 +682,38 @@ }, 1000).onUpdate(() => { updateEffect(shuttle); }).start(); +} + +export const showLockPath = (nodes, curFloor, setCurSPrite) => { + const pathLineName = 'lockPath-' + curFloor; + let pathLine = mapContainer.getChildByName(pathLineName); + if (pathLine) { + mapContainer.removeChild(pathLine); + } + + pathLine = new PIXI.Graphics(); + pathLine.name = pathLineName; + pathLine.lineStyle(3 * (1 / mapContainer.scale.x), 0xff0000, 0.8); + pathLine.zIndex = SENSOR_ZINDEX.TRAVEL_PATH; + let firstNode = true; + + for(let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.z !== curFloor) { continue } + const shelf = querySprite(SENSOR_TYPE.SHELF, node.x + '-' + node.y); + if (!shelf) { continue } + + let position = shelf.position; + let x = position.x; + let y = position.y; + if (firstNode) { + pathLine.moveTo(x, y); + firstNode = false; + } else { + pathLine.lineTo(x, y); + } + + } + + mapContainer.addChild(pathLine); } \ No newline at end of file -- Gitblit v1.9.1