#
luxiaotao1123
2022-03-21 4f7e5d3dc070ea46f4ca243bcbae9eda76d8c8a0
#
1个文件已修改
37 ■■■■■ 已修改文件
static/js/object/CrnTask.js 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/CrnTask.js
@@ -33,6 +33,7 @@
    that.preZ = 0;
    that.prePosition = null;
    that.preForkPos = -1;    // -1, "不在定位" 0, "货叉原位" 1, "货叉在左侧远" 2, "货叉在左侧" 3, "货叉在右侧"  4, "货叉在右侧远"
    that.preLoadPos = -1;
    // 当前数据
    that.bay = 1 ;
    that.lev = 1 ;
@@ -41,6 +42,7 @@
    that.z = 0;
    that.position = null;
    that.forkPos = -1;
    that.loadPos = -1;
    that.crnBody = null;
    that.crnLoad = null;
@@ -63,6 +65,7 @@
        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");
@@ -112,6 +115,7 @@
        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;
@@ -120,6 +124,25 @@
        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 ------------------------------------------------
@@ -130,6 +153,7 @@
                progress: 0,
                part: 'fork',
                loaded: crnData.loaded,
                loadPos: crnData.loadPos,
                route: new Route([
                    {
                        x: that.prePosition.x,
@@ -170,7 +194,6 @@
        curves.map((value, index) => {
            if (that.crnNo === 1) {
                // console.log(crnData)
                // console.log(value.part + " --> " + JSON.stringify(value.route.points))
            }
        });
@@ -189,15 +212,6 @@
                        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;
                        }
@@ -216,8 +230,7 @@
                                    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);
                                    }