| | |
| | | that.preZ = 0; |
| | | that.prePosition = null; |
| | | that.preForkPos = -1; // -1, "不在定位" 0, "货叉原位" 1, "货叉在左侧远" 2, "货叉在左侧" 3, "货叉在右侧" 4, "货叉在右侧远" |
| | | that.preLoadPos = -1; |
| | | // 当前数据 |
| | | that.bay = 1 ; |
| | | that.lev = 1 ; |
| | |
| | | that.z = 0; |
| | | that.position = null; |
| | | that.forkPos = -1; |
| | | that.loadPos = -1; |
| | | |
| | | that.crnBody = null; |
| | | that.crnLoad = null; |
| | |
| | | that.z = crnData.position.z; |
| | | that.position = crnData.position; |
| | | that.forkPos = crnData.forkPos; |
| | | that.loadPos = crnData.loadPos; |
| | | |
| | | that.crnBody = getArrVal(object.objects, "name", that.crnNo + "-body"); |
| | | that.crnLoad = getArrVal(object.objects, "name", that.crnNo + "-load"); |
| | |
| | | that.preZ = that.z; |
| | | that.prePosition = JSON.parse(JSON.stringify(that.position)); |
| | | that.preForkPos = that.forkPos; |
| | | that.preLoadPos = that.loadPos; |
| | | // 当前 |
| | | that.bay = crnData.bay; |
| | | that.lev = crnData.lev; |
| | |
| | | that.z = crnData.position.z; |
| | | that.position = crnData.position; |
| | | that.forkPos = crnData.forkPos; |
| | | that.loadPos = crnData.loadPos; |
| | | |
| | | // 根据货叉上下定位 判断堆垛机取放货作业 ----------------------------------------------- |
| | | |
| | | // 上定位 ===>> 下定位 放货完成 |
| | | if (that.preLoadPos === 1 && that.loadPos === 0) { |
| | | if (that.locNo != null) { |
| | | if (that.pallet != null) { |
| | | that.pallet.name = that.locNo + "-Pallet"; |
| | | } |
| | | if (that.goods != null) { |
| | | that.goods.name = that.locNo + "-Goods"; |
| | | } |
| | | } |
| | | // 下定位 ===>> 上定位 取货完成 |
| | | } else { |
| | | |
| | | } |
| | | |
| | | |
| | | // create Route ------------------------------------------------ |
| | | |
| | |
| | | progress: 0, |
| | | part: 'fork', |
| | | loaded: crnData.loaded, |
| | | loadPos: crnData.loadPos, |
| | | route: new Route([ |
| | | { |
| | | x: that.prePosition.x, |
| | |
| | | |
| | | curves.map((value, index) => { |
| | | if (that.crnNo === 1) { |
| | | // console.log(crnData) |
| | | // console.log(value.part + " --> " + JSON.stringify(value.route.points)) |
| | | } |
| | | }); |
| | |
| | | if (i !== curves.length - 1) { |
| | | curves[i+1].start = true; |
| | | } else { |
| | | // if (that.locNo != null) { |
| | | // if (that.pallet != null) { |
| | | // that.pallet.name = that.locNo + "-Pallet"; |
| | | // } |
| | | // if (that.goods != null) { |
| | | // that.goods.name = that.locNo + "-Goods"; |
| | | // } |
| | | // } |
| | | // reset |
| | | curves = []; |
| | | that.run = false; |
| | | } |
| | |
| | | break |
| | | case 'fork': |
| | | that.crnFork.position.set(point.x + xOffset1, point.y, point.z); |
| | | // todo:luxiaotao 托盘+货物 运动 不是根据loaded,是根据上下定位 |
| | | if (curves[i].loaded === 1 && that.pallet) { |
| | | if (curves[i].loadPos === 1 && that.pallet) { |
| | | that.pallet.position.setX(point.x + palletX); |
| | | that.goods.position.setX(point.x + goodsX); |
| | | } |