|  |  |  | 
|---|
|  |  |  | const yOffset1 = -116; | 
|---|
|  |  |  | const zOffset1 = -475; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const palletX = -18; | 
|---|
|  |  |  | const palletY = 2; | 
|---|
|  |  |  | const palletZ = -46; | 
|---|
|  |  |  | const palletX = -2; | 
|---|
|  |  |  | const palletY = 0; | 
|---|
|  |  |  | const palletZ = -25; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const goodsX = -17; | 
|---|
|  |  |  | const goodsY = 5; | 
|---|
|  |  |  | const goodsZ = -6; | 
|---|
|  |  |  | const goodsX = -2; | 
|---|
|  |  |  | const goodsY = 22; | 
|---|
|  |  |  | const goodsZ = -25; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 堆垛机当前运行状态对象 | 
|---|
|  |  |  | function CrnTask(crnData, object) { | 
|---|
|  |  |  | 
|---|
|  |  |  | that.pallet = null; | 
|---|
|  |  |  | that.goods = null; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | that.wrkNo = null; | 
|---|
|  |  |  | that.sourceLocNo = null; | 
|---|
|  |  |  | that.locNo = null; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (that.crnBody===null) { | 
|---|
|  |  |  | that.crnBody = getArrVal(object.objects, "name", that.crnNo + "-body"); | 
|---|
|  |  |  | // return; | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (that.crnLoad===null) { | 
|---|
|  |  |  | that.crnLoad = getArrVal(object.objects, "name", that.crnNo + "-load"); | 
|---|
|  |  |  | // return; | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (that.crnFork===null) { | 
|---|
|  |  |  | that.crnFork = getArrVal(object.objects, "name", that.crnNo + "-fork"); | 
|---|
|  |  |  | // return; | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 出库 / 移库 | 
|---|
|  |  |  | if (crnData.sourceLocNo != null) { | 
|---|
|  |  |  | that.sourceLocNo = crnData.sourceLocNo; | 
|---|
|  |  |  | that.pallet = getArrVal(object.objects, "name", crnData.sourceLocNo + "-Pallet"); | 
|---|
|  |  |  | that.goods = getArrVal(object.objects, "name", crnData.sourceLocNo + "-Goods"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (crnData.locNo != null) { | 
|---|
|  |  |  | that.locNo = crnData.locNo; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 入库 | 
|---|
|  |  |  | if (crnData.wrkNo != null) { | 
|---|
|  |  |  | that.pallet = getArrVal(object.objects, "name", crnData.wrkNo + "-Pallet"); | 
|---|
|  |  |  | that.goods = getArrVal(object.objects, "name", crnData.wrkNo + "-Goods"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (JSON.stringify(crnData.position) === JSON.stringify(that.position)) { | 
|---|
|  |  |  | 
|---|
|  |  |  | that.position = crnData.position; | 
|---|
|  |  |  | that.forkPos = crnData.forkPos; | 
|---|
|  |  |  | that.loadPos = crnData.loadPos; | 
|---|
|  |  |  | that.sourceLocNo = crnData.sourceLocNo; | 
|---|
|  |  |  | that.locNo = crnData.locNo; | 
|---|
|  |  |  | that.wrkNo = crnData.wrkNo; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 根据货叉上下定位 判断堆垛机取放货作业 ----------------------------------------------- | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 上定位 ===>> 下定位    放货完成 | 
|---|
|  |  |  | 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 { | 
|---|
|  |  |  | // 出库 | 
|---|
|  |  |  | if (crnData.wrkNo != null) { | 
|---|
|  |  |  | if (that.pallet != null) { | 
|---|
|  |  |  | that.pallet.name = crnData.wrkNo + "-Pallet"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (that.goods != null) { | 
|---|
|  |  |  | that.goods.name = crnData.wrkNo + "-Goods"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 下定位 ===>> 上定位    取货完成 | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // create Route ------------------------------------------------ | 
|---|
|  |  |  |  | 
|---|