From 7cb91edeb02a377e3bdf1ef98e60fa2e6d9d5c96 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期一, 18 十二月 2023 16:32:10 +0800
Subject: [PATCH] #map latest test
---
src/main/webapp/views/console4.html | 83 +++++++++++++++++++++++++----------------
1 files changed, 51 insertions(+), 32 deletions(-)
diff --git a/src/main/webapp/views/console4.html b/src/main/webapp/views/console4.html
index d6737c5..0994b7b 100644
--- a/src/main/webapp/views/console4.html
+++ b/src/main/webapp/views/console4.html
@@ -14,7 +14,7 @@
<script type="text/javascript" src="../static/vue/js/vue.min.js"></script>
<script type="text/javascript" src="../static/vue/element/element.js"></script>
<script src="../static/js/gsap.min.js"></script>
- <script src="../static/js/pixi.min.js"></script>
+ <script src="../static/js/pixi-legacy.min.js"></script>
<style>
*{
margin: 0;
@@ -249,8 +249,8 @@
const shuttle = new PIXI.Sprite(resources.shuttle.texture);
shuttle.width = width
shuttle.height = height
- shuttle.x = item.point.x * width;//鏇存柊鍧愭爣x
- shuttle.y = item.point.y * height;//鏇存柊鍧愭爣y
+ shuttle.x = item.wcsPoint.x * height;//鏇存柊鍧愭爣x
+ shuttle.y = item.wcsPoint.y * width;//鏇存柊鍧愭爣y
shuttle.updateMoveStatus = true;//鍔ㄧ敾鎵ц瀹屾垚
shuttle.interactive = true; // 蹇呴』瑕佽缃墠鑳芥帴鏀朵簨浠�
shuttle.buttonMode = true; // 璁╁厜鏍囧湪hover鏃跺彉涓烘墜鍨嬫寚閽�
@@ -544,15 +544,17 @@
return false;//涓や釜闆嗗悎闀垮害涓嶄竴鑷�
}
+ let flag = false;
list1.forEach((item,index) => {
for (var i = 0; i < list2.length; i++) {
- if (item.shuttleNo != list2[i].shuttleNo) {
- return false;//鎵句笉鍒板皬杞﹀彿
+ if (item.shuttleNo == list2[i].shuttleNo) {
+ flag = true;
+ break;
}
}
});
- return true;
+ return flag;
},
findShuttlePathDiffList(list1, list2) {
//妫�娴嬮泦鍚�1閲岄潰鐨勫皬杞﹂璁¤矾寰勬槸鍚﹀湪闆嗗悎2涓湁鍙樺姩
@@ -567,7 +569,7 @@
let item = list1[index];
for (var i = 0; i < list2.length; i++) {
if (item.shuttleNo != list2[i].shuttleNo) {
- return false;//鎵句笉鍒板皬杞﹀彿
+ continue;//鎵句笉鍒板皬杞﹀彿
}
if (item.moveAdvancePath == null) {
@@ -578,7 +580,7 @@
list2[i].moveAdvancePath = [];
}
- if (item.moveAdvancePath.length != list2[i].moveAdvancePath.length) {
+ if (!(item.moveAdvancePath.length == list2[i].moveAdvancePath.length)) {
return false;//灏忚溅棰勮璺緞闀垮害涓嶄竴鑷�
}
}
@@ -845,38 +847,55 @@
})
if (pixiShuttleMoveAdvancePathList[shuttleNo] == null) {
- pixiShuttleMoveAdvancePathList[shuttleNo] = [locNo];
- } else {
- pixiShuttleMoveAdvancePathList[shuttleNo].push(locNo);
+ let locNos = new Set()
+ locNos.add(locNo);
+ pixiShuttleMoveAdvancePathList[shuttleNo] = locNos;
+ }else {
+ pixiShuttleMoveAdvancePathList[shuttleNo].add(locNo);
+ }
+ }else {
+ let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo)
+ let shuttleNos = pathMap.shuttleNos;
+ shuttleNos.push(shuttleNo);
+ pathMap.textObj.text = JSON.stringify(shuttleNos);
+ pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
+ if (pixiShuttleMoveAdvancePathList[shuttleNo] == null) {
+ let locNos = new Set()
+ locNos.add(locNo);
+ pixiShuttleMoveAdvancePathList[shuttleNo] = locNos;
+ }else {
+ pixiShuttleMoveAdvancePathList[shuttleNo].add(locNo);
}
}
});
},
removeMoveAdvancePath(shuttleNo) {//鍒犻櫎棰勮璺緞
let locNos = pixiShuttleMoveAdvancePathList[shuttleNo];
- locNos.forEach((locNo,index) => {
- let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo);
- if (pathMap != null) {
- let shuttleNos = pathMap.shuttleNos;
- let shuttleNosNew = [];
- shuttleNos.forEach((shuttle, idx) => {
- if (shuttle != shuttleNo) {
- shuttleNosNew.push(shuttle);
- }
- });
+ if (locNos != null) {
+ locNos.forEach((locNo,index) => {
+ let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo);
+ if (pathMap != null) {
+ let shuttleNos = pathMap.shuttleNos;
+ let shuttleNosNew = [];
+ shuttleNos.forEach((shuttle, idx) => {
+ if (shuttle != shuttleNo) {
+ shuttleNosNew.push(shuttle);
+ }
+ });
- if (shuttleNosNew.length === 0) {
- //棰勮璺緞娌℃湁灏忚溅锛岀洿鎺ュ垹闄よ矾寰�
- objectsContainer2.removeChild(pathMap.sprite);
- pixiShuttleMoveAdvancePathMap.delete(locNo)
- }else {
- //棰勮璺緞瀛樺湪鍏朵粬灏忚溅锛屾洿鏂版枃瀛椾俊鎭�
- pathMap.textObj.text = JSON.stringify(shuttleNosNew);
- pathMap.shuttleNos = shuttleNosNew;
- pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
+ if (shuttleNosNew.length === 0) {
+ //棰勮璺緞娌℃湁灏忚溅锛岀洿鎺ュ垹闄よ矾寰�
+ objectsContainer2.removeChild(pathMap.sprite);
+ pixiShuttleMoveAdvancePathMap.delete(locNo)
+ }else {
+ //棰勮璺緞瀛樺湪鍏朵粬灏忚溅锛屾洿鏂版枃瀛椾俊鎭�
+ pathMap.textObj.text = JSON.stringify(shuttleNosNew);
+ pathMap.shuttleNos = shuttleNosNew;
+ pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
+ }
}
- }
- })
+ })
+ }
},
}
})
--
Gitblit v1.9.1