| | |
| | | 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中有变动 |
| | |
| | | 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) { |
| | |
| | | list2[i].moveAdvancePath = []; |
| | | } |
| | | |
| | | if (item.moveAdvancePath.length != list2[i].moveAdvancePath.length) { |
| | | if (!(item.moveAdvancePath.length == list2[i].moveAdvancePath.length)) { |
| | | return false;//小车预计路径长度不一致 |
| | | } |
| | | } |
| | |
| | | }) |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | }) |