| | |
| | | import {StoreCrn} from './object/StoreCrn.js'; |
| | | import {StoreConvey} from './object/StoreConvey.js'; |
| | | import {StoreGoods} from './object/StoreGoods.js'; |
| | | |
| | | import {StaTask} from './object/StaTask.js'; |
| | | |
| | | var APP = { |
| | | |
| | |
| | | this.outlinePass = null; |
| | | this.goodTypes=[];//存储所有的库位类型 |
| | | this.crnTasks = [];// 堆垛机列表 |
| | | this.staTasks = [];// 输送线列表 |
| | | this.moveForward = false;//是否向前运行 |
| | | this.moveBackward = false;//是否向后运行 |
| | | this.moveLeft = false;//是否向左运行 |
| | |
| | | this.stats.end(); |
| | | this.queryCrn(); |
| | | this.crnMove(); |
| | | this.querySta(); |
| | | this.staChange(); |
| | | } |
| | | this.initScene = function () { |
| | | this.scene = new THREE.Scene(); |
| | |
| | | this.composer.addPass( this.fxaaPass ); |
| | | } |
| | | this.initObjectSelect = function(){ |
| | | new ObjectSelect(this.scene, this.camera, this.outlinePass); |
| | | new ObjectSelect(this.scene, this.camera, this.outlinePass, this); |
| | | } |
| | | this.initPointLockControl = function(object){ |
| | | this.controls = new PointerLockControls( this.camera, document.body ); |
| | |
| | | if (line.bins !== null) { |
| | | new StoreGoods(object, line.bins, shelf); |
| | | } |
| | | //显示库位上的货物 |
| | | // for (var bin of line.bins) { |
| | | // let existGoods=this.getExistedGoodType(bin.State); |
| | | // let storeGoods = new StoreGoods(optionGroup, bin); |
| | | // if(existGoods==null) { |
| | | // let goods=storeGoods.create(); |
| | | // object.addObject(goods); |
| | | // this.goodTypes.push({type: bin.State, object: goods}); |
| | | // } else { |
| | | // let goods= storeGoods.clone(existGoods); |
| | | // object.addObject(goods); |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | } |
| | | this.firstTime = 0; |
| | |
| | | } |
| | | } |
| | | } |
| | | this.getExistedGoodType=function(state){ |
| | | for (let i=0;i<this.goodTypes.length;i++) { |
| | | let type=this.goodTypes[i]; |
| | | if(type.type===state) { |
| | | return type.object; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | this.crnMove = function (object) { |
| | | this.crnMove = function () { |
| | | for (let crnTask of this.crnTasks) { |
| | | crnTask.move(); |
| | | } |
| | | } |
| | | this.querySta = function () { |
| | | if (StaDatas !== null && this.firstTime === 0) { |
| | | for (let staData of StaDatas) { |
| | | let staTask = getArrVal(this.staTasks, "no", staData.no); |
| | | if (null == staTask) { |
| | | this.staTasks.push(new StaTask(staData, this)); |
| | | } else { |
| | | if(!staTask.run) { |
| | | staTask.modify(staData); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | this.staChange = function () { |
| | | for (let staTask of this.staTasks) { |
| | | staTask.change(); |
| | | } |
| | | } |
| | | |
| | | // 功能方法区 |
| | | this.changeStats = function () { |