Junjie
2023-12-18 05f8bdf7e09849c1db885b6c996ad18280d130b3
#map latest test
1个文件已修改
77 ■■■■■ 已修改文件
src/main/webapp/views/console4.html 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/console4.html
@@ -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);
              }
            }
          }
        })
          })
        }
      },
    }
  })