| | |
| | | import Stats from './lib/stats.module.js'; |
| | | import {MTLLoader} from './lib/MTLLoader.js'; |
| | | import {OBJLoader} from './lib/OBJLoader.js'; |
| | | import {StoreShelf} from './object/StoreShelf.js'; |
| | | |
| | | var APP = { |
| | | |
| | |
| | | this.stats.end(); |
| | | // this.queryTask(); |
| | | this.queryCrn(); |
| | | this.modelMove(); |
| | | // this.modelMove(); |
| | | this.crnMove(); |
| | | } |
| | | this.initScene = function () { |
| | | this.scene = new THREE.Scene(); |
| | |
| | | initStore(); |
| | | if (Store3DData !== null) { |
| | | for(var group of Store3DData.data.store.groups) { |
| | | let crn = new StoreCrn(group.crn, object); |
| | | new StoreCrn(group.crn, object); |
| | | for (var line of group.lines) { |
| | | let shelf = new StoreShelf(line); |
| | | object.addObject(shelf); |
| | |
| | | for (let crnData of CrnDatas) { |
| | | let crnTask = getArrVal(this.crnTasks, "crnNo", crnData.crnNo); |
| | | if (null == crnTask) { |
| | | // let crnFork = getArrVal(this.objects, "name", wrkMast.crnNo + "-fork"); |
| | | this.crnTasks.push(new CrnTask(crnData)); |
| | | this.crnTasks.push(new CrnTask(crnData, this)); |
| | | } else { |
| | | if(!crnTask.run) { |
| | | // console.log(2) |
| | | crnTask.modify(crnData); |
| | | } |
| | | } |
| | |
| | | }); |
| | | } |
| | | this.initModelMove = function () { |
| | | console.log(this.wrkTasks) |
| | | for (var wrkMast of this.wrkTasks) { |
| | | this.crnBody = getArrVal(this.objects, "name", wrkMast.crnNo + "-body"); |
| | | // 取货点定位 |
| | | let sourceLocPosition = getBinPosition(wrkMast.sourceLocNo); |
| | | let points = [new THREE.Vector3(this.crnBody.position.x, this.crnBody.position.y, this.crnBody.position.z), sourceLocPosition]; |
| | | this.curve = new Route(points); |
| | | } |
| | | console.log(this.crnTasks) |
| | | // for (var wrkMast of this.wrkTasks) { |
| | | // this.crnBody = getArrVal(this.objects, "name", wrkMast.crnNo + "-body"); |
| | | // // 取货点定位 |
| | | // let sourceLocPosition = getBinPosition(wrkMast.sourceLocNo); |
| | | // let points = [new THREE.Vector3(this.crnBody.position.x, this.crnBody.position.y, this.crnBody.position.z), sourceLocPosition]; |
| | | // this.curve = new Route(points); |
| | | // } |
| | | |
| | | } |
| | | this.modelMove = function () { |
| | |
| | | } |
| | | } |
| | | } |
| | | this.crnMove = function (object) { |
| | | for (let crnTask of this.crnTasks) { |
| | | crnTask.move(); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | }; |