diff --git a/src/jlmap3d/jl3ddevicetrain/component/StompClient.js b/src/jlmap3d/jl3ddevicetrain/component/StompClient.js deleted file mode 100644 index d8d0b3cdc..000000000 --- a/src/jlmap3d/jl3ddevicetrain/component/StompClient.js +++ /dev/null @@ -1,85 +0,0 @@ -import Stomp from 'stompjs'; -import { getBaseUrl } from '@/utils/baseUrl'; - -const BASE_API = getBaseUrl(); -let baseUrl = 'http://192.168.3.6:9600';// 本地旭强 -if (BASE_API == 'https://joylink.club/jlcloud') { - baseUrl = 'https://joylink.club/relay'; -} else if (BASE_API == 'https://test.joylink.club/jlcloud') { - baseUrl = 'https://test.joylink.club/relay'; -} - -class StompClient { - constructor() { - const ws = new WebSocket(`${baseUrl}/ws-relay`.replace(/https/, 'wss').replace(/http/, 'ws')); - this.client = Stomp.over(ws); - this.client.debug = function (message) { - console.debug(message); - }; - this.subscribeMap = new Map(); // 已订阅,对象{dest:'', handler:function, sub: Object} - this.connected = false; - this.onUsed = false; - } - - connect() { - return new Promise((resolve, reject) => { - this.onUsed = true; - const that = this; - const header = { - login: 'relay', - passcode: 'relay' - }; - this.client.connect(header, - ()=>{ - that.connected = true; - // 重连时需要重新订阅 - that.subscribeMap.forEach((subscribe, dest) => { - that.subscribe(subscribe.dest, subscribe.handler); - }); - resolve(); - }, - (error)=>{ - console.error(error); - this.connected = false; - reject(error); - }); - }); - } - - disconnect() { - this.onUsed = false; - this.client.disconnect(); - } - - subscribe(destination, handler) { - if (!this.connected) { - const that = this; - this.connect().then(() => { - that.subscribe(destination, handler); - }); - } else { - const sub = this.client.subscribe(destination, handler); - this.subscribeMap.set(destination, {dest: destination, handler: handler, sub: sub}); - } - } - - unsubscribe(destination) { - const subscribe = this.subscribeMap.get(destination); - if (subscribe && subscribe.sub) { - subscribe.sub.unsubscribe(); - } else if (subscribe) { - this.subscribeMap.delete(destination); - } - } - - send(destination, body) { - if (body) { - body = JSON.stringify(body); - this.client.send(destination, {}, body); - } else { - console.error('stomp send body required'); - } - } -} - -export default StompClient; diff --git a/src/jlmap3d/jl3ddevicetrain/component/deviceconnect.js b/src/jlmap3d/jl3ddevicetrain/component/deviceconnect.js deleted file mode 100644 index a2e08f32a..000000000 --- a/src/jlmap3d/jl3ddevicetrain/component/deviceconnect.js +++ /dev/null @@ -1,43 +0,0 @@ -import StompClient from '@/utils/sock'; - -// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation'; -// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp'; -import { getBaseUrl } from '@/utils/baseUrl' -import { getToken } from '@/utils/auth'; - -// 定于仿真socket接口 -export function DeviceSubscribe(jlmap3d,routegroup,jsonwebwork) { - - const scope = this; - this.map = null; - - this.teststomp = new StompClient(); - this.topic = '/user/queue/simulation/jl3d/'+routegroup; - let header = {'X-Token': getToken() }; - - - this.updatamap = function() { - - }; - - this.socketon = function(topic) { - try { - // console.log("teststomp"); - scope.teststomp.subscribe(topic, callback, header); - } catch (error) { - console.error('websocket订阅失败'); - } - - }; - - this.socketoff = function(topic) { - scope.teststomp.unsubscribe(topic); - }; - - // 仿真socket接口回调函数 - function callback(Response) { - - - } - -} diff --git a/src/jlmap3d/jl3ddevicetrain/component/jdqcontrol.js b/src/jlmap3d/jl3ddevicetrain/component/jdqcontrol.js deleted file mode 100644 index fa1fa9e21..000000000 --- a/src/jlmap3d/jl3ddevicetrain/component/jdqcontrol.js +++ /dev/null @@ -1,147 +0,0 @@ - -export function Jdqcontrol(){ - let scope = this; - - this.devicelist = []; - - this.jdqinit = function(){ - - } - - this.jdqraycast = function(){ - - } - - //配置继电器文字信息 - this.jdqdevicelist = function(selectmodel){ - if(scope.devicelist.length>0){ - scope.devicelist = []; - } - for(let i=0,leni=selectmodel.children.length;i=1){ - let point = scope.playlist[scope.playorder][i].curve.getPointAt(1); - //更新模型坐标 - scope.playlist[scope.playorder][i].connectmodel.position.x = point.x; - scope.playlist[scope.playorder][i].connectmodel.position.y = point.y; - scope.playlist[scope.playorder][i].connectmodel.position.z = point.z; - scope.playlist[scope.playorder][i].enable = false; - scope.playlist[scope.playorder][i].status = "end"; - scope.playlist[scope.playorder][i].progress = 0; - - - if(i >= scope.playlist[scope.playorder].length-1){ - if(scope.playorder >= scope.playlist.length-1 ){ - scope.playlist = null; - scope.status = true; - scope.enable = false; - main.animationmsgshowoff(); - scope.nowmodelname = undefined; - scope.playorder = null; - break; - }else{ - scope.playorder += 1; - } - } - - - }else{ - // console.log(scope.animatelist[k].connectmodel); - if(scope.nowmodelname != scope.playlist[scope.playorder][i].connectmodel.name){ - scope.nowmodelname = scope.playlist[scope.playorder][i].connectmodel.name; - main.animationmsgshowon(scope.playlist[scope.playorder][i].connectmodel); - } - //根据动画进度获取动画轨迹上点 - scope.status = false; - let point = scope.playlist[scope.playorder][i].curve.getPointAt(scope.playlist[scope.playorder][i].progress); - - //更新模型坐标 - scope.playlist[scope.playorder][i].connectmodel.position.x = point.x; - scope.playlist[scope.playorder][i].connectmodel.position.y = point.y; - scope.playlist[scope.playorder][i].connectmodel.position.z = point.z; - - if(scope.helpbox){ - scope.helpbox.update(); - } - if(scope.textplane){ - - scope.textplane.position.x = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[12]; - scope.textplane.position.y = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[13]+100; - scope.textplane.position.z = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[14]; - } - //判断模型转向 - if(scope.playlist[scope.playorder][i].directchange){ - let tangent = scope.playlist[scope.playorder][i].curve.getPointAt(scope.playlist[scope.playorder][i].progress+0.001); - // scope.animatelist[k] - tangent = null; - } - //增加动画进度,释放点变量 - scope.playlist[scope.playorder][i].progress += scope.playlist[scope.playorder][i].speed; - point = null; - - } - - } - - } - } - } - - -} diff --git a/src/jlmap3d/jl3ddevicetrain/config.js b/src/jlmap3d/jl3ddevicetrain/config.js deleted file mode 100644 index 073cc3b34..000000000 --- a/src/jlmap3d/jl3ddevicetrain/config.js +++ /dev/null @@ -1,73 +0,0 @@ -import { getBaseUrl } from '@/utils/baseUrl'; -import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; - - -const BASE_API = getBaseUrl(); -let modelurl = JL3D_LOCAL_STATIC+"/MODEL/jdq/"; -// if(BASE_API == 'https://joylink.club/jlcloud'){ -// modelurl = "https://joylink.club/oss/jdq/"; -// }else if(BASE_API == 'https://test.joylink.club/jlcloud'){ -// modelurl = "https://test.joylink.club/oss/jdq/"; -// } - -var Staticmodel = { - Jdq1: { - id: "1", - name: "继电器a1700", - deviceType: "jdq1700", - type: "training", - picUrl: "", - assetUrl: modelurl + "jdq1700.FBX" - }, - Jdq2: { - id: "1", - name: "继电器b1700", - deviceType: "jdq1700", - type: "training", - picUrl: "", - assetUrl: modelurl + "jdq1700.FBX" - }, - Jdq3: { - id: "1", - name: "继电器c1700", - deviceType: "jdq1700", - type: "training", - picUrl: "", - assetUrl: modelurl + "jdq1700.FBX" - }, - Jdq4: { - id: "1", - name: "继电器h18", - deviceType: "jdq", - type: "training", - picUrl: "", - assetUrl: modelurl + "jdqh18.FBX" - }, - Jdq5: { - id: "1", - name: "继电器H125", - deviceType: "jdq", - type: "training", - picUrl: "", - assetUrl: modelurl + "jdqH125.FBX" - }, - - Jdq6: { - id: "1", - name: "继电器135", - deviceType: "jdq", - type: "training", - picUrl: "", - assetUrl: modelurl + "jdq135.FBX" - }, - Jdqg:{ - id: "0", - name: "继电器柜", - deviceType: "jdqg", - type: "training", - picUrl: "", - assetUrl: modelurl + "jdqg.FBX" - } -} - -export { Staticmodel } diff --git a/src/jlmap3d/jl3ddevicetrain/jl3ddevicetrain.js b/src/jlmap3d/jl3ddevicetrain/jl3ddevicetrain.js deleted file mode 100644 index 511475cdb..000000000 --- a/src/jlmap3d/jl3ddevicetrain/jl3ddevicetrain.js +++ /dev/null @@ -1,576 +0,0 @@ -import { Staticmodel } from '@/jlmap3d/jl3ddevicetrain/config.js'; -import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; -//loader -import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader'; -import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls'; - -import { ModelManager } from '@/jlmap3d/jl3ddevicetrain/loader.js'; -import { Moveanimate } from '@/jlmap3d/jl3ddevicetrain/component/moveanimate.js'; -import { Jdqcontrol } from '@/jlmap3d/jl3ddevicetrain/component/jdqcontrol.js'; - -import { DragControls } from '@/jlmap3d/main/control/DragControls.js'; - -import StompClient from '@/jlmap3d/jl3ddevicetrain/component/StompClient.js'; -// import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js'; - -// import StompClient from '@/utils/sock'; -import {Stats} from '@/jlmap3d/main/lib/stats.min.js'; - -var clock = new THREE.Clock(); -export function Jl3ddevice(dom,serviceid) { - let scope = this; - //helpbox选中包围框 - //textplane三维介绍标牌 - let helpbox,textplane; - let connect = null; - this.dom = dom; - this.nowcode = null; - this.animateswitch = false; - this.mixers = []; - this.showmodel = null; - //场景状态 - this.status = 0; - //动画状态 - this.animastats = false; - //当前选中模型 - this.selectmodel = null; - //当前动画播放模型 - this.animationmodel = null; - //初始化webgl渲染 - let renderer = new THREE.WebGLRenderer({ antialias: true }); - renderer.setPixelRatio( window.devicePixelRatio ); - renderer.setSize(dom.offsetWidth, dom.offsetHeight); - - // renderer.shadowMap.enabled = true; - // renderer.shadowMap.type = THREE.PCFSoftShadowMap; - renderer.setClearColor( 0x000000, 0 ); - this.dom.appendChild(renderer.domElement); - - //定义相机 - let camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 4000); - camera.position.set(-1000, 1500, 0); - camera.aspect = dom.offsetWidth / dom.offsetHeight; - camera.updateProjectionMatrix(); - - //视角轨迹控制器 - this.controls = new THREE.OrbitControls(camera, dom); - this.controls.enabled = true; - this.controls.target = new THREE.Vector3(500,1000,0); - this.controls.screenSpacePanning = true; - this.controls.update(); - this.controls.maxDistance = 3000; - - //定义场景(渲染容器) - let scene = new THREE.Scene(); - var bgTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/other.jpg"); - scene.background = bgTexture; - - //定义全局光 - let ambientLight = new THREE.AmbientLight(0xffffff, 1.3); - scene.add(ambientLight); - - var light = new THREE.HemisphereLight( 0xffffff, 0x444444 ); - light.position.set( 0, 200, 0 ); - scene.add( light ); - - //网格地面 - // var grid = new THREE.GridHelper( 1000, 20, 0x000000, 0x000000 ); - // grid.material.opacity = 0.2; - // grid.material.transparent = true; - // grid.position.x = 10000; - // scene.add( grid ); - let objects = []; - let dragcontrol = new THREE.DragControls( objects, camera, scope.dom ); - dragcontrol.enabled = false; - - //菜单选中设备更新设备较少 - this.updateselect = function(updata){ - // console.log(updata); - if(helpbox){ - scene.remove( helpbox ); - helpbox = null; - } - helpbox = new THREE.BoxHelper( updata.mesh, 0xff0000 ); - // console.log(updata.mesh); - let point = { - x:updata.mesh.matrixWorld.elements[12], - y:updata.mesh.matrixWorld.elements[13], - z:updata.mesh.matrixWorld.elements[14] - }; - settext(updata.mesh,point) - getdevicemsg(updata.mesh.name); - scene.add( helpbox ); - } - - //返回设备选择 - this.backselect = function(){ - move3(); - updatemenulist(scope.jdqcontrol.devicelist,"all"); - - scope.modelmanager.controllist[0].position.set(19,1270,-275); - scope.modelmanager.controllist[0].rotation.y = -Math.PI/2; - scope.modelmanager.controllist[0].rotation.z = -Math.PI/2; - - scope.modelmanager.controllist[1].position.set(19,1270,-165); - scope.modelmanager.controllist[1].rotation.y = -Math.PI/2; - scope.modelmanager.controllist[1].rotation.z = -Math.PI/2; - - scope.modelmanager.controllist[2].position.set(19,1270,-55); - scope.modelmanager.controllist[2].rotation.y = -Math.PI/2; - scope.modelmanager.controllist[2].rotation.z = -Math.PI/2; - - scope.modelmanager.controllist[3].position.set(19,1270,65); - scope.modelmanager.controllist[3].rotation.y = -Math.PI/2; - scope.modelmanager.controllist[3].rotation.z = -Math.PI/2; - - scope.modelmanager.controllist[4].position.set(19,1270,170); - scope.modelmanager.controllist[4].rotation.y = -Math.PI/2; - scope.modelmanager.controllist[4].rotation.z = -Math.PI/2; - - scope.modelmanager.controllist[5].position.set(19,1270,280); - scope.modelmanager.controllist[5].rotation.y = -Math.PI/2; - scope.modelmanager.controllist[5].rotation.z = -Math.PI/2; - - camera.position.set(-1000, 1500, 0); - scope.controls.target = new THREE.Vector3(500,1000,0); - scope.controls.update(); - scope.status = '0'; - if(textplane){ - scene.remove(textplane); - textplane.geometry.dispose(); - textplane.material.dispose(); - } - scope.selectmodel = null; - scope.jdqcontrol.devicelist = []; - scope.animastats = false; - updatemsg(); - }; - - //设备分解、归位动画按钮 - this.disperdevice1 = function(){ - - if(scope.status == '1'){ - if(moveanima.status == true){ - if(scope.animastats == false){ - scope.animastats = true; - move1(); - } else if(scope.animastats == true){ - scope.animastats = false; - move2(); - } - } - - - } - }; - - this.disperdevice2 = function(){ - - if(scope.status == '1'){ - if(moveanima.status == true){ - if(scope.animastats == false){ - scope.animastats = true; - moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"chaijie"],true); - } else if(scope.animastats == true){ - scope.animastats = false; - moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"fuwei"],true); - } - } - - - } - }; - - - - // let stats = new Stats(); - // dom.appendChild( stats.dom ); - - document.addEventListener( "mousedown", onselect, false ); - document.addEventListener( "mouseup", onmouseup, false ); - document.addEventListener( "touchstart", ontouch, false ); - window.onresize = function () { - camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight; - camera.updateProjectionMatrix(); - renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight); - } - - this.jdqcontrol = new Jdqcontrol(); - - let moveanima = new Moveanimate(scope); - - this.anime = null; - this.modelmanager = new ModelManager(); - this.modelmanager.loadpromise(Staticmodel, scope.mixers,scene).then(function (data) { - moveanima.initlistnew( scope.modelmanager.controllist); - connect = new StompClient(); - // debugger - connect.subscribe("/queue/simulation/"+serviceid,callback); - animate(); - }); - this.sendmsg = function (type,index){ - // console.log(index); - let msg = { - // deskId:serviceid, - id:index+1, - on:null - }; - if(type == "0"){ - msg.on = true; - } - if(type == "1"){ - msg.on = false; - } - //"/app/topic/relay/"+msg.id+"/control/"+msg.on - - connect.send("/app/topic/simulation/"+serviceid+"/relay/"+msg.id+"/control/"+msg.on,{}); - } - - this.upmodelaction = function(type,index){ - - if(type == "0"){ - scope.modelmanager.actionlist[index].reset(); - scope.modelmanager.actionlist[index].time = 0; - scope.modelmanager.actionlist[index].timeScale = 1; - scope.modelmanager.actionlist[index].play(); - } - if(type == "1"){ - scope.modelmanager.actionlist[index].reset(); - scope.modelmanager.actionlist[index].time = scope.modelmanager.actionlist[index]._clip.duration; - scope.modelmanager.actionlist[index].timeScale = -1; - scope.modelmanager.actionlist[index].play(); - } - }; - - this.buttoncontrol = function(action){ - if("startstop"){ - moveanima.startstop(); - } - if("next"){ - moveanima.next(); - } - if("before"){ - moveanima.before(); - } - - }; - - this.resetmodel = function(){ - moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"fuwei"],true); - }; - //循环渲染函数 - let delta; - let data; - function callback(Response){ - // console.log(Response); - data = JSON.parse(Response.body); - // console.log(data); - upjdqstats(data); - } - function animate() { - - scope.anime = requestAnimationFrame(animate); - renderer.render(scene, camera); - moveanima.animateupdate(); - // scope.controls.update(); - // stats.update(); - delta = clock.getDelta(); - if(textplane){ - textplane.lookAt(camera.position); - } - if (scope.mixers) { - for (let i = 0; i < scope.mixers.length; i++) { - if (scope.mixers[i]._actions[0].isRunning()) { - scope.mixers[i].update(delta); - } - } - } - - } - - - function move1(){ - moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"on"],true); - } - - function move2(){ - if(scope.selectmodel){ - moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"off"],true); - } - } - - function move3(){ - if(scope.selectmodel){ - moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"fuwei"],true); - } - - } - function ontouch(event){ - if(scope.status == '0'){ - let raycaster = new THREE.Raycaster(); - //定义平面鼠标点击坐标 - - let mouse = new THREE.Vector2(); - mouse.x = (event.touches[0].pageX / dom.offsetWidth) * 2 - 1; - mouse.y = -(event.touches[0].pageY / dom.offsetHeight) * 2 + 1; - - raycaster.setFromCamera( mouse, camera ); - for(let i=0,leni=scope.modelmanager.controllist.length;i { - jdq1.mesh.stats = "0"; - jdq1.mesh.position.x = 19; - jdq1.mesh.position.z = -275; - jdq1.mesh.position.y = 1270; - jdq1.mesh.rotation.y = -Math.PI/2; - jdq1.mesh.rotation.z = -Math.PI/2; - - jdq2.mesh.stats = "0"; - jdq2.mesh.position.x = 19; - jdq2.mesh.position.z = -165; - jdq2.mesh.position.y = 1270; - jdq2.mesh.rotation.y = -Math.PI/2; - jdq2.mesh.rotation.z = -Math.PI/2; - - jdq3.mesh.stats = "0"; - jdq3.mesh.position.x = 19; - jdq3.mesh.position.z = -55; - jdq3.mesh.position.y = 1270; - jdq3.mesh.rotation.y = -Math.PI/2; - jdq3.mesh.rotation.z = -Math.PI/2; - - jdq4.mesh.stats = "0"; - jdq4.mesh.position.x = 19; - jdq4.mesh.position.z = 65; - jdq4.mesh.position.y = 1270; - jdq4.mesh.rotation.y = -Math.PI/2; - jdq4.mesh.rotation.z = -Math.PI/2; - - jdq5.mesh.stats = "0"; - jdq5.mesh.position.x = 19; - jdq5.mesh.position.z = 170; - jdq5.mesh.position.y = 1270; - jdq5.mesh.rotation.y = -Math.PI/2; - jdq5.mesh.rotation.z = -Math.PI/2; - - jdq6.mesh.stats = "0"; - jdq6.mesh.position.x = 19; - jdq6.mesh.position.z = 280; - jdq6.mesh.position.y = 1270; - jdq6.mesh.rotation.y = -Math.PI/2; - jdq6.mesh.rotation.z = -Math.PI/2; - - scope.controllist.push(jdq1.mesh); - scope.controllist.push(jdq2.mesh); - scope.controllist.push(jdq3.mesh); - scope.controllist.push(jdq4.mesh); - scope.controllist.push(jdq5.mesh); - scope.controllist.push(jdq6.mesh); - // console.log(jdq1); - scope.actionlist.push(jdq1.action); - scope.actionlist.push(jdq2.action); - scope.actionlist.push(jdq3.action); - scope.actionlist.push(jdq4.action); - scope.actionlist.push(jdq5.action); - scope.actionlist.push(jdq6.action); - - scene.add(jdq1.mesh); - scene.add(jdq2.mesh); - scene.add(jdq3.mesh); - scene.add(jdq4.mesh); - scene.add(jdq5.mesh); - scene.add(jdq6.mesh); - scene.add(scope.jdqg.mesh); - resolve("success"); //['成功了', 'success'] - }).catch((error) => { - //console.log(error); - }); - - }); - } - -} - -function fbxpromise(asset,mixers,model){ - return new Promise(function(resolve, reject){ - var loader = new THREE.FBXLoader(); - - loader.load( asset.assetUrl, function ( object ) { - let mixer = new THREE.AnimationMixer( object ); - // object.traverse( function ( child ) { - // if ( child.isMesh ) { - // child.castShadow = true; - // child.receiveShadow = true; - // } - // } ); - - //设置透明贴图的材质属性 - for(let i=0,leni=object.children.length;i0){ - - model.action = mixer.clipAction( object.animations[ 0 ] ); - model.action.setLoop(THREE.LoopOnce); - model.action.clampWhenFinished = true; - // model.action.play(); - // scope.actionlist.push("1"); - mixers.push(mixer); - } - resolve(asset.deviceType); - } ); - - }); -} diff --git a/src/jlmap3d/jl3ddrive/jl3ddrive.js b/src/jlmap3d/jl3ddrive/jl3ddrive.js index 39f4274e1..50aa53bf9 100644 --- a/src/jlmap3d/jl3ddrive/jl3ddrive.js +++ b/src/jlmap3d/jl3ddrive/jl3ddrive.js @@ -8,7 +8,7 @@ import {MTLLoader} from '@/jlmap3d/main/loaders/MTLLoader.js'; import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader.js'; // data -import { Jl3ddata } from '@/jlmap3d/main/model/jl3ddata'; +import { Jl3ddata } from '@/jlmap3d/main/newmodel/jl3ddata'; // setconfig import { SetCamera } from '@/jlmap3d/config/SetCamera'; @@ -21,10 +21,8 @@ import {OrbitControls} from '@/jlmap3d/main/control/OrbitControls.js'; import { DragControls } from '@/jlmap3d/main/control/DragControls.js'; // 加载器 -import { DriverLoad } from '@/jlmap3d/main/loaders/DriverLoad'; import { DriverLoadNew } from '@/jlmap3d/main/loaders/DriverLoadNew'; // connect -import {Jl3dDriving} from '@/jlmap3d/jl3ddrive/moveupdate/DrivingConnect'; import {Jl3dDrivingNew} from '@/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew'; import { getPublishMapVersion, getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; @@ -158,57 +156,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj getPublish3dMapDetail(mapId).then(netdata => { // console.log(netdata); let assetsdata = JSON.parse(netdata.data.sections); - if(assetsdata.link){ - scope.datatype = "old"; - // datanew(); - // scope.jsonwebwork = new Worker(JL3D_LOCAL_STATIC+"/workertest/jsonworker.js"); - // scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork); - // scope.Subscribe.socketon(scope.Subscribe.topic); - scope.Subscribe = new Jl3dDriving(mixers,updatemmi,sound,translation,routegroup); - - scope.Subscribe.socketon(scope.Subscribe.topic); - DriverLoad(data,scope,netdata.data,sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails, camera, controls3, scene,mixers,storemod); - var timer = setInterval(function() { - if(trainlisttest){ - if(trainlisttest.group){ - if(trainlisttest.group.children[0]){ - // console.log(trainlisttest.group.children[0].name); - updatemmi.updatedrivingcode(trainlisttest.group.children[0].name); - scope.Subscribe.initdrivercode(trainlisttest.group.children[0].name); - for(let k in rails.switchrail){ - const ddd = storemod.getters['map/getDeviceByCode'](k); - let switchdata = rails.switchrail[k]; - rails.switchrail[k].locateType = ddd.locateType; - - if(ddd.locateType == "01"){ - //1--向左 2--向右 - //__\__ __/__ - if(rails.switchrail[k].directtype == "1"){ - rails.linkrail[switchdata.alink].lconnect = switchdata.blink; - rails.linkrail[switchdata.blink].rconnect = switchdata.alink; - }else if(rails.switchrail[k].directtype == "2"){ - rails.linkrail[switchdata.alink].rconnect = switchdata.blink; - rails.linkrail[switchdata.blink].lconnect = switchdata.alink; - } - - }else if(ddd.locateType == "02"){ - if(rails.switchrail[k].directtype == "1"){ - rails.linkrail[switchdata.alink].lconnect = switchdata.clink; - rails.linkrail[switchdata.clink].rconnect = switchdata.alink; - }else if(rails.switchrail[k].directtype == "2"){ - rails.linkrail[switchdata.alink].rconnect = switchdata.clink; - rails.linkrail[switchdata.clink].lconnect = switchdata.alink; - } - } - } - clearInterval(timer); - } - } - } - - }, 2000); - }else{ scope.datatype = "new"; driverWebWorker = new Worker(JL3D_LOCAL_STATIC+"/workertest/driverWebWorker.js"); scope.Subscribe = new Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,driverWebWorker,stats); @@ -230,7 +178,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj }, 2000); - } + }); }); diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js deleted file mode 100644 index 5324265a7..000000000 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js +++ /dev/null @@ -1,886 +0,0 @@ -import StompClient from '@/utils/sock'; - -import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation'; - -import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp'; -import { getToken } from '@/utils/auth'; -import router from '@/router/index_APP_TARGET'; - -// 定于仿真socket接口 -export function Jl3dDriving(mixers, updatemmi, sound, translation, routegroup) { - - const scope = this; - this.map = null; - const toppic = '/app/topic/simulation/client/' + routegroup + '/drive'; - var trainlisttest = null; - var sectionlist = null; - var signallist = null; - var stationstandlist = null; - var sectionlist = null; - var materials = null; - var actions = null; - var rails = null; - var links = null; - - var scenes = null; - - var code = null; - - var drivingcode = null; - var drivingspeed = null; - var drivingaptspeed = null; - - let driverswitch = false; - - const stoptimer = null; - const num = 30; - const pointstand = null; - // run as plane = 01; - // reset = 02; - var datatype = '00'; - this.teststomp = new StompClient(); - this.topic = '/user/queue/simulation/jl3d/' + routegroup; - const header = {'X-Token': getToken() }; - - this.updatamap = function(newsectionlist, newlinklist, newsignallist, newstationstandlist, newtrainlisttest, newrealsectionlist, newrails, materiallist, nowaction, scene) { - // console.log(mapdata); - // console.log(newtrainlisttest); - trainlisttest = newtrainlisttest; - sectionlist = newsectionlist; - signallist = newsignallist; - stationstandlist = newstationstandlist; - materials = materiallist; - scenes = scene; - actions = nowaction; - links = newlinklist; - rails = newrails; - }; - - this.initdrivercode = function(code) { - drivingcode = code; - }; - - this.socketon = function(topic) { - try { - // console.log("teststomp"); - scope.teststomp.subscribe(topic, callback, header); - } catch (error) { - console.error('websocket订阅失败'); - } - - }; - - this.socketoff = function(topic) { - scope.teststomp.unsubscribe(topic); - for (let i = 0; i < trainlisttest.group.children.length; i++) { - if (trainlisttest.group.children[i].dispose == false) { - code = trainlisttest.group.children[i].name; - trainlisttest.list[code].rotation.y = 0; - trainlisttest.list[code].doorStatus = '01'; - trainlisttest.list[code].speed = 0; - trainlisttest.group.children[i].dispose = true; - trainlisttest.group.children[i].position.x = -50000; - trainlisttest.group.children[i].position.y = -50000; - trainlisttest.group.remove(trainlisttest.group.children[i]); - i--; - } - } - }; - - // 仿真socket接口回调函数 - function callback(Response) { - // console.log(Response); - // 对象化数据 - const data = JSON.parse(Response.body); - // 遍历后台数据 - - // 判断消息类型 - // if(data.type == "Simulation_TrainPosition"){ - // - // - // } - // console.log(data); - // console.log(data); - switch (data.type) { - case 'Simulation_Driver_Change': - - trainlisttest.group.remove(trainlisttest.list[drivingcode]); - trainlisttest.list[data.body.code].dispose = true; - trainlisttest.list[drivingcode].dispose = true; - drivingcode = data.body.code; - trainlisttest.group.add(trainlisttest.list[drivingcode]); - - // sound.volswitch = true; - updatemmi.updatedrivingcode( data.body.code); - break; - case 'Simulation_TrainSpeed': - - trainspeed(data); - break; - case 'SJL3D_TrainStatus': - trainstatus(data); - break; - case 'Simulation_DeviceStatus': - devicestatus(data); - break; - case 'Simulation_Drive_Data_Routing': - updatemmi.updatedrivedata(data.body); - break; - case 'Simulation_Reset': - simulationreset(data); - default : - // TODO - } - - // if(data.type == 'Simulation_Drive_Data_Routing'){ - // updatemmi.updatedrivedata(data.body); - // } - // - // if (data.type == 'Simulation_Driver_Change') { - // drivingcode = data.body.code; - // updatemmi.updatedrivingcode( data.body.code); - // } - // - // if (data.type == 'Simulation_TrainSpeed') { - // trainspeed(data); - // } - // - // if (data.type == 'SJL3D_TrainStatus') { - // trainstatus(data); - // } - // - // if (data.type == 'Simulation_DeviceStatus') { - // devicestatus(data); - // } - - } - - function trainspeed(data) { - // console.log(data); - if (trainlisttest) { - for (let tl = 0; tl < data.body.length; tl++) { - code = data.body[tl].id; - if (trainlisttest.list[code].speed != data.body[tl].v) { - trainlisttest.list[code].speed = data.body[tl].v; - - if (trainlisttest.list[code].runMode == '02') { - - if (trainlisttest.list[code].isStandTrack == true) { - trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); - } else { - trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); - } - } else { - - trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); - } - - if (code == drivingcode) { - // if (data.body[tl].v >0) { - // updatemmi.updatenowspeed(data.body[tl].v); - // } else { - - updatemmi.updatenowspeed(Math.abs(data.body[tl].v)); - // console.log(data.body[i]); - - // } - } - } - - if (code == drivingcode) { - // if(sound.volswitch == true){ - // sound.setVolume( data.body[tl].v/100 ); - // } - if (data.body[tl].atpv) { - updatemmi.updateatpspeed(data.body[tl].atpv); - } else { - updatemmi.updateatpspeed(-1); - } - if (data.body[tl].atov) { - updatemmi.updateatospeed(data.body[tl].atov); - } else { - updatemmi.updateatospeed(-1); - } - if (trainlisttest.list[code].progress < 1) { - const syncdata = { - type: 'Train', - code: code, - linkCode: trainlisttest.list[code].nowcode, - percent: 0 - }; - if (trainlisttest.list[code].status == '02') { - if (trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode) { - if ((trainlisttest.list[code].linkOffsetPercent / trainlisttest.list[code].pc) >= trainlisttest.list[code].targetpercent) { - syncdata.percent = trainlisttest.list[code].progress; - } else { - syncdata.percent = trainlisttest.list[code].progress * trainlisttest.list[code].pc; - } - } else { - syncdata.percent = trainlisttest.list[code].progress; - } - - } else { - if (trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode) { - if ((trainlisttest.list[code].linkOffsetPercent / trainlisttest.list[code].pc) <= trainlisttest.list[code].targetpercent) { - syncdata.percent = (1 - trainlisttest.list[code].progress); - } else { - syncdata.percent = (1 - trainlisttest.list[code].progress) * trainlisttest.list[code].pc; - } - } else { - syncdata.percent = (1 - trainlisttest.list[code].progress); - } - } - // console.log("send"); - // console.log(trainlisttest.list[code]); - // - // console.log(syncdata); - // console.log("============="); - scope.teststomp.send(toppic, syncdata); - } - - } - } - } - } - - function trainstatus(data) { - // console.log(data.body); - for (let i = data.body.length - 1; i >= 0; i--) { - // 遍历列车对象组 - // console.log(trainlisttest); - if (trainlisttest) { - - code = data.body[i].code; - // 剔除不显示的车 - // 找到对应列车 - - if (code == drivingcode) { - - driverswitch = data.body[i].runMode; - // 更新车组号 - updatemmi.updatetrainnum(data.body[i].groupNumber); - // 更新列车 - if (data.body[i].parkRemainTime > 0) { - updatemmi.updatestoptime(translation.stopTime + parseInt(data.body[i].parkRemainTime)); - } else { - if (data.body[i].runMode == '02') { - updatemmi.updatestoptime(translation.trainAtoOn); - } else { - if (trainlisttest.list[code].isStandTrack == true && trainlisttest.list[code].progress > 0.95 && trainlisttest.list[code].speed <= 0) { - // if(stoptimer){ - // - // }else{ - // stoptimer = setInterval(function(){ - // if(num >=0){ - // updatemmi.updatestoptime("停站时间:"+num); - // num --; - // } - // },1000); - // } - - } else { - updatemmi.updatestoptime(translation.trainAtoOff); - } - } - } - } - trainlisttest.list[code].runMode = data.body[i].runMode; - - // 车门开关验证 - if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // console.log("close"); - trainlisttest.list[code].doorStatus = '01'; - for (let an = actions[code].top.length - 1; an >= 0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = actions[code].top[an]._clip.duration; - actions[code].top[an].timeScale = -1; - actions[code].top[an].play(); - } - } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // console.log("open"); - trainlisttest.list[code].doorStatus = '02'; - for (let an = actions[code].top.length - 1; an >= 0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = 0; - actions[code].top[an].timeScale = 1; - actions[code].top[an].play(); - } - } - // if (data.body[i].directionType == '02') { - // - // } else { - // if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // // console.log("close"); - // trainlisttest.list[code].doorStatus = '01'; - // for (let an=actions[code].down.length-1; an>=0; an--) { - // actions[code].down[an].reset(); - // actions[code].down[an].time = actions[code].top[an]._clip.duration; - // actions[code].down[an].timeScale = -1; - // actions[code].down[an].play(); - // } - // } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // // console.log("open"); - // trainlisttest.list[code].doorStatus = '02'; - // for (let an=actions[code].down.length-1; an>=0; an--) { - // actions[code].down[an].reset(); - // actions[code].down[an].time = 0; - // actions[code].down[an].timeScale = 1; - // actions[code].down[an].play(); - // } - // } - // } - // 遍历获取所在轨道 - - if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) { - - if (rails.linkrail[data.body[i].linkCode]) { - // console.log(trainlisttest.group); - if (trainlisttest.group.children.length < 1) { - trainlisttest.group.add(trainlisttest.list[code]); - drivingcode = code; - updatemmi.updatedrivingcode(drivingcode); - } - if (trainlisttest.list[code].mixerpush == false) { - for (let mi = 0, lenmi = trainlisttest.list[code].mixer.length; mi < lenmi; mi++) { - mixers.push(trainlisttest.list[code].mixer[mi]); - } - trainlisttest.list[code].mixerpush = true; - } - // trainlisttest.group.add(trainlisttest.list[code]); - trainlisttest.list[code].position.y = 0; - trainlisttest.list[code].progress = 0; - // trainlisttest.list[code].oldoffset = data.body[i].sectionOffsetPercent; - trainlisttest.list[code].dispose = false; - trainlisttest.list[code].nowcode = data.body[i].linkCode; - - trainlisttest.list[code].pc = 1; - // console.log(data.body[i]); - if (data.body[i].directionType == '02') { // 向右 - - if (data.body[i].targetStation) { - - trainlisttest.list[code].stopstation = data.body[i].targetStation; - // console.log(rails.stops[data.body[i].targetStation].direct2.percent); - trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; - trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; - trainlisttest.list[code].progress = data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; - trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - trainlisttest.list[code].targetLink = data.body[i].targetLink; - } else { - trainlisttest.list[code].progress = data.body[i].linkOffsetPercent; - trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - } - - trainlisttest.list[code].status = '02'; - - trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; - const point = rails.linkrail[data.body[i].linkCode].lineleft.getPointAt(trainlisttest.list[code].progress); - trainlisttest.list[code].rotation.y = 0; - trainlisttest.list[code].position.x = point.x; - trainlisttest.list[code].position.y = 0; - for (let tl = 0; tl < 6; tl++) { - trainlisttest.list[code].children[tl].position.z = point.z; - } - } else if (data.body[i].directionType == '03') { // 向左 - - // if(trainlisttest.list[code].rname == "006"){ - // console.log("0000000000000000"); - // console.log(data.body[i].linkOffsetPercent); - // } - if (data.body[i].targetStation) { - - trainlisttest.list[code].stopstation = data.body[i].targetStation; - trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; - // console.log(data.body[i].targetLinkPercent); - // console.log(rails.stops[data.body[i].targetStation].direct1.percent); - // console.log(trainlisttest.list[code].pc); - trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; - trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; - trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - trainlisttest.list[code].targetLink = data.body[i].targetLink; - } else { - trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent; - trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - } - // console.log("progress:"+trainlisttest.list[code].progress); - // console.log("linkOffsetPercent:"+trainlisttest.list[code].linkOffsetPercent); - // console.log("datatarget:"+ data.body[i].targetLinkPercent); - // console.log("directpercent:"+trainlisttest.list[code].targetpercent); - // console.log("===================="); - trainlisttest.list[code].status = '03'; - - trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; - const point = rails.linkrail[data.body[i].linkCode].lineright.getPointAt(trainlisttest.list[code].progress); - trainlisttest.list[code].rotation.y = Math.PI; - trainlisttest.list[code].position.x = point.x; - trainlisttest.list[code].position.y = 0; - for (let tl = 0; tl < 6; tl++) { - trainlisttest.list[code].children[tl].position.z = -point.z; - } - } - trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; - // trainlisttest.list[code].isStandTrack = sectionlist.sections.datalist[data.body[i].sectionCode].isStandTrack; - - // trainlisttest.list[code].len = sectionlist.sections.datalist[data.body[i].sectionCode].distance; - - if (data.body[i].speed == 0) { - trainlisttest.list[code].speeds = data.body[i].speed; - trainlisttest.list[code].speeds = 0; - // trainlisttest.list[code].startmark = 1; - } else { - trainlisttest.list[code].speeds = data.body[i].speed; - trainlisttest.list[code].speeds = parseFloat(data.body[i].speed * 10 / 36 / 25 / trainlisttest.list[code].len); - } - - } - - } else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) { - trainlisttest.group.remove(trainlisttest.list[code]); - trainlisttest.list[code].progress = null; - trainlisttest.list[code].dispose = true; - code = trainlisttest.group.children[i].name; - trainlisttest.list[code].rotation.y = 0; - trainlisttest.list[code].doorStatus = '01'; - trainlisttest.list[code].speed = 0; - trainlisttest.list[code].position.x = -50000; - trainlisttest.list[code].position.y = -50000; - trainlisttest.list[code].pc = 1; - } else if (trainlisttest.list[code].dispose == data.body[i].dispose && data.body[i].dispose == false) { - - if (rails.linkrail[data.body[i].linkCode]) { - if (driverswitch == '02' && code == drivingcode) { - updatemmi.updatenowspeed(data.body[i].speed); - if (data.body[i].atpSpeed) { - updatemmi.updateatpspeed(data.body[i].atpSpeed); - } else { - updatemmi.updateatpspeed(-1); - } - if (data.body[i].targetSpeed) { - updatemmi.updateatospeed(data.body[i].targetSpeed); - } else { - updatemmi.updateatospeed(-1); - } - if (data.body[i].maLen) { - updatemmi.updatenowlen(data.body[i].maLen); - } else { - updatemmi.updatenowlen(0); - } - // if(trainlisttest.list[code].isStandTrack == true){ - // pointstand = null; - // if(data.body[i].directionType == "02"){ - // pointstand = trainlisttest.list[code].curve.getPointAt(data.body[i].sectionOffsetPercent); - // }else{ - // pointstand = trainlisttest.list[code].curve.getPointAt(1-data.body[i].sectionOffsetPercent); - // } - // console.log(data.body[i].sectionOffsetPercent) - // console.log(pointstand.x); - // - // trainlisttest.list[code].position.x = pointstand.x; - // } - } - if (driverswitch == '05' && code == drivingcode) { - if (data.body[i].maLen) { - updatemmi.updatenowlen(data.body[i].maLen); - } else { - updatemmi.updatenowlen(0); - } - } - if (trainlisttest.list[code].status != data.body[i].directionType) { - if (data.body[i].directionType == '02') { // 向右 - - trainlisttest.list[code].progress = 0; - const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; - const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14]; - trainlisttest.list[code].rotation.y = 0; - trainlisttest.list[code].position.x = rotaposx; - for (let tl = 0; tl < 6; tl++) { - trainlisttest.list[code].children[tl].position.z = rotaposz; - } - - trainlisttest.list[code].progress = (rotaposx - rails.linkrail[data.body[i].linkCode].lp.x) / rails.linkrail[data.body[i].linkCode].lengthfact; - trainlisttest.list[code].status = '02'; - trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; - trainlisttest.list[code].nextcurve = null; - - trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; - - } else if (data.body[i].directionType == '03') { // 向左 - trainlisttest.list[code].progress = 0; - const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; - const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]); - trainlisttest.list[code].rotation.y = Math.PI; - trainlisttest.list[code].position.x = rotaposx; - for (let tl = 0; tl < 6; tl++) { - trainlisttest.list[code].children[tl].position.z = -rotaposz; - } - trainlisttest.list[code].progress = 1 - (rotaposx - rails.linkrail[data.body[i].linkCode].lp.x) / rails.linkrail[data.body[i].linkCode].lengthfact; - trainlisttest.list[code].status = '03'; - trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; - trainlisttest.list[code].nextcurve = null; - - trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; - - } - } - let nextcode; - - if (code == drivingcode) { - // console.log(data.body[i].targetStation); - // console.log("netpercent"); - // console.log(data.body[i].targetLinkPercent); - // console.log(data.body[i].linkOffsetPercent); - // console.log("3dpercent"); - // if(rails.stops[data.body[i].targetStation]){ - // console.log(rails.stops[data.body[i].targetStation].direct2.percent); - // } - // - // console.log(trainlisttest.list[code].progress); - // console.log(trainlisttest.list[code].pc); - // console.log("==============="); - // console.log(data.body[i]); - if (data.body[i].directionType == '02') { - if (trainlisttest.list[code].stopstation != data.body[i].targetStation) { - trainlisttest.list[code].stopstation = data.body[i].targetStation; - if (data.body[i].targetStation) { - trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; - trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; - trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - trainlisttest.list[code].targetLink = data.body[i].targetLink; - - // trainlisttest.list[code].progress = trainlisttest.list[code].linkOffsetPercent*trainlisttest.list[code].pc; - } - } - - trainlisttest.list[code].status = '02'; - nextcode = rails.linkrail[data.body[i].linkCode].rconnect; - if (nextcode) { - // console.log(rails.linkrail[nextcode].lineleft.points); - trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft; - trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; - } else { - - trainlisttest.list[code].nextlen = 0; - } - } else if (data.body[i].directionType == '03') { - if (trainlisttest.list[code].stopstation != data.body[i].targetStation) { - trainlisttest.list[code].stopstation = data.body[i].targetStation; - if (data.body[i].targetStation) { - trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; - trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; - trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - trainlisttest.list[code].targetLink = data.body[i].targetLink; - // trainlisttest.list[code].progress = (1-trainlisttest.list[code].linkOffsetPercent)*trainlisttest.list[code].pc; - } - } - trainlisttest.list[code].status = '03'; - nextcode = rails.linkrail[data.body[i].linkCode].lconnect; - if (nextcode) { - trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright; - trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; - } else { - - trainlisttest.list[code].nextlen = 0; - } - } - trainlisttest.list[code].nextcode = nextcode; - - // console.log(trainlisttest.list[code].nowcode); - // console.log(trainlisttest.list[code].nextcode); - // console.log(trainlisttest.list[code].curve.points); - // console.log(trainlisttest.list[code].nextcurve.points); - // console.log("========================="); - - } else { - - // trainlisttest.list[code].stopstation = data.body[i].targetStation; - // // console.log(rails.stops[data.body[i].targetStation].direct2.percent); - // trainlisttest.list[code].pc = data.body[i].targetLinkPercent/rails.stops[data.body[i].targetStation].direct2.percent; - // trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; - // trainlisttest.list[code].progress = data.body[i].linkOffsetPercent*trainlisttest.list[code].pc; - // trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - // trainlisttest.list[code].targetLink = data.body[i].targetLink; - - let nextcode; - if (data.body[i].directionType == '02') { - if (rails.linkrail[data.body[i].linkCode].lineleft) { - nextcode = rails.linkrail[data.body[i].linkCode].rconnect; - trainlisttest.list[code].status = '02'; - if (nextcode) { - trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft; - trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; - } - trainlisttest.list[code].nowcode = data.body[i].linkCode; - trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; - trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; - trainlisttest.list[code].progress = data.body[i].linkOffsetPercent; - trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - if (data.body[i].targetStation) { - trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; - trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; - trainlisttest.list[code].targetLink = data.body[i].targetLink; - trainlisttest.list[code].progress = data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; - } - trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed * 10 / 36 / 25 / trainlisttest.list[code].len); - } - } else if (data.body[i].directionType == '03') { - if (rails.linkrail[data.body[i].linkCode].lineright) { - nextcode = rails.linkrail[data.body[i].linkCode].lconnect; - trainlisttest.list[code].status = '03'; - - if (nextcode) { - trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright; - trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; - } - trainlisttest.list[code].nowcode = data.body[i].linkCode; - trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; - trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; - trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent; - trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; - if (data.body[i].targetStation) { - trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; - trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; - trainlisttest.list[code].targetLink = data.body[i].targetLink; - trainlisttest.list[code].progress = (1 - data.body[i].linkOffsetPercent) / trainlisttest.list[code].pc; - } - trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed * 10 / 36 / 25 / trainlisttest.list[code].len); - } - } - trainlisttest.list[code].nextcode = nextcode; - } - - // console.log(data.body[i].linkOffsetPercent); - // console.log(trainlisttest.list[code].progress); - // console.log(trainlisttest.list[code].curve.points); - // console.log(trainlisttest.list[code].nextcurve.points); - // console.log(trainlisttest.list[code].len); - // console.log(trainlisttest.list[code].nextlen); - // console.log("=========================================="); - } - } - - } - } - } - - function simulationreset(data) { - // console.log(data); - for (const k in trainlisttest.list) { - trainlisttest.list[k].dispose = true; - trainlisttest.group.remove(trainlisttest.list[k]); - trainlisttest.list[k].stopstation = null; - trainlisttest.list[k].pc = null; - trainlisttest.list[k].targetpercent = null; - trainlisttest.list[k].progress = null; - trainlisttest.list[k].linkOffsetPercent = null; - trainlisttest.list[k].targetLink = null; - drivingcode = null; - } - } - - function devicestatus(data) { - for (let i = data.body.length - 1; i >= 0; i--) { - // 0xFFFFFF - // 0xCD0000 红 - // 0xEEEE00 黄 - // 0x32CD32 绿 - if (data.body[i]._type == 'Signal') { - if (signallist) { - signalupdate(data.body[i]); - } - } - - if (data.body[i]._type == 'StationStand' ) { - if (actions) { - standupdate(data.body[i]); - } - } - - if (data.body[i]._type == 'Switch') { - if (sectionlist) { - switchupdate(data.body[i]); - } - } - - } - } - - function standupdate(data) { - code = data.code; - if ( actions[code]) { - if (data.screenDoorOpenStatus == '02' && actions[code].status == '01') { - actions[code].status = '00'; - } - if (data.screenDoorOpenStatus == '02' && actions[code].status == '00') { - actions[code].status = '02'; - actions[code].action.reset(); - actions[code].action.time = 0; - actions[code].action.timeScale = 1; - actions[code].action.play(); - } - - if (data.screenDoorOpenStatus == '01' && actions[code].status == '02') { - actions[code].status = '00'; - } - if (data.screenDoorOpenStatus == '01' && actions[code].status == '00') { - actions[code].status = '01'; - actions[code].action.reset(); - actions[code].action.time = actions[code].action._clip.duration; - actions[code].action.timeScale = -1; - actions[code].action.play(); - } - } - - } - - function signalupdate(data) { - code = data.code; - if (data.lightType == '01') { - if (signallist.list[code].mesh.code) { - signallist.list[code].mesh.status = data.status; - - // 55 - // 33 - // 77 - // 关闭 - if (data.status == '01') { - signallist.list[code].mesh.getObjectByName('red').material.map = materials[0]; - signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; - - } - // 开放 - if (data.status == '02') { - signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('green').material.map = materials[2]; - signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; - } - if (data.status == '03') { - signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[1]; - signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; - - } - // 引导 - if (data.status == '03') { - signallist.list[code].mesh.getObjectByName('red').material.map = materials[0]; - signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[1]; - signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; - - } - // 封锁 - if (data.status == '04') { - signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; - - } - // 故障 - if (data.status == '05') { - signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; - - } - - } - - } else if (data.lightType == '02') { - if (signallist.list[code].mesh.code) { - signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; - signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; - - } - - } - - } - - function switchupdate(data) { - code = data.code; - for (let j = sectionlist.switchs.modellist.length - 1; j >= 0; j--) { - if (rails.switchrail[code]) { - if (rails.switchrail[code].locateType != data.locateType) { - // console.log("道岔变化:"+code); - if (data.locateType == '02') { - // console.log("02 反位"); - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = 0; - actions[sectionlist.switchs.modellist[j].code].timeScale = 1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = '02'; - - const testswitch = rails.switchrail[code]; - if (rails.switchrail[code].directtype == '1') { - // console.log("道岔朝向1向左"); - // console.log("aleft:"+testswitch.clink); - // console.log("cright:"+testswitch.alink); - rails.linkrail[testswitch.alink].lconnect = testswitch.clink; - rails.linkrail[testswitch.clink].rconnect = testswitch.alink; - } else if (rails.switchrail[code].directtype == '2') { - // console.log("道岔朝向2向右"); - // console.log("aright:"+testswitch.clink); - // console.log("cleft:"+testswitch.alink); - rails.linkrail[testswitch.alink].rconnect = testswitch.clink; - rails.linkrail[testswitch.clink].lconnect = testswitch.alink; - } - - } else if (data.locateType == '01') { - // console.log("01 定位"); - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration; - actions[sectionlist.switchs.modellist[j].code].timeScale = -1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = '01'; - const testswitch = rails.switchrail[code]; - if (rails.switchrail[code].directtype == '1') { - // console.log("道岔朝向1向左"); - // console.log("aleft"+testswitch.blink); - // console.log("cright:"+testswitch.alink); - rails.linkrail[testswitch.alink].lconnect = testswitch.blink; - rails.linkrail[testswitch.blink].rconnect = testswitch.alink; - } else if (rails.switchrail[code].directtype == '2') { - // console.log("道岔朝向2向右"); - // console.log("aright:"+testswitch.blink); - // console.log("cleft:"+testswitch.alink); - rails.linkrail[testswitch.alink].rconnect = testswitch.blink; - rails.linkrail[testswitch.blink].lconnect = testswitch.alink; - } - - } - } - j = 0; - } - } - } - -} diff --git a/src/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js b/src/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js index b473a1acb..91c00ae88 100644 --- a/src/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js +++ b/src/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js @@ -7,7 +7,7 @@ import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader'; import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; //data -import { Jl3ddata } from '@/jlmap3d/main/model/jl3ddata'; +import { Jl3ddata } from '@/jlmap3d/main/newmodel/jl3ddata'; //setconfig import { SetCamera } from '@/jlmap3d/config/SetCamera'; @@ -30,7 +30,6 @@ import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from ' //utils // import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain'; import { UpdateTrain } from '@/jlmap3d/jl3dsimulation/connect/UpdateTrainTest'; -import { UpdateTrainNew } from '@/jlmap3d/jl3dsimulation/connect/UpdateTrainNew'; // import { ReStart } from '@/jlmap3d/main/utils/ReStart'; import {Stats} from '@/jlmap3d/main/lib/stats.min.js'; @@ -198,12 +197,7 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project scope.webwork.onmessage = function (event) { //更新列车位置 - // if(scope.datatype == "new"){ - // - // UpdateTrainNew(camera,trainlisttest); - // }else{ - // UpdateTrain(camera,trainlisttest); - // } + if(camerarail.moveswitch == true){ // console.log(camerarail.progress); diff --git a/src/jlmap3d/jl3dmaintainer/maintainerload.js b/src/jlmap3d/jl3dmaintainer/maintainerload.js index ac67a1cd0..97d886f15 100644 --- a/src/jlmap3d/jl3dmaintainer/maintainerload.js +++ b/src/jlmap3d/jl3dmaintainer/maintainerload.js @@ -1,11 +1,4 @@ //componnent -import {SectionList} from '@/jlmap3d/main/model/SectionList.js'; -import {SignalList} from '@/jlmap3d/main/model/SignalList.js'; -import {StationStandList} from '@/jlmap3d/main/model/StationStandList.js'; -import {TrainList} from '@/jlmap3d/main/model/TrainList.js'; -import {RealSectionList} from '@/jlmap3d/main/model/RealSectionList.js'; -import {LinkList} from '@/jlmap3d/main/model/LinkList.js'; -import {RailList} from '@/jlmap3d/main/model/RailList.js'; import {TrainListN} from '@/jlmap3d/main/newmodel/TrainListN.js'; import {SectionListN} from '@/jlmap3d/main/newmodel/SectionListN'; @@ -52,8 +45,6 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene) let mapdata = data; //初始化轨道和道岔 - // lengthfact(data); - // linklist = new LinkList(); sectionlist = new SectionListN(); signallist = new SignalListN(); @@ -177,39 +168,3 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene) } - -function lengthfact(data){ - let linklist = []; - //console.log(data); - for(let i=0;i=0;i--){ - if ( mixers[i] && mixers[i].runplay == true){ - mixers[i].update( delta ); - } - } - moveanimateupdate(); - - requestAnimationFrame(animate); - - } - - function moveanimateinit(model,name,points,index,speed){ - - let curve = new THREE.CatmullRomCurve3(points); - curve.curvrtype = "chordal"; - // curve动画轨迹 - // progress动画进度 - // enable当前动画开关 - // speed动画速度 - - let animate = { - name:index, - index:index, - curve:curve, - progress:0, - directchange:false, - enable:true, - status:"start", - speed:speed, - }; - humans[index].runrail = animate; - humans[index].status = 1; - humans[index].action.play(); - humans[index].mixer.runplay = true; - moveanimatelist.push(animate); - } - - function moveanimateupdate(){ - if(humans.length>0){ - for(let i=0;i=1){ - // let point = humans[i].runrail.curve.getPointAt(1); - //更新模型坐标 - // console.log(moveanimatelist); - if(humans[i].status == 1){ - humans[i].runrail.enable = false; - humans[i].runrail.progress = 1; - humans[i].mixer.runplay = false; - humans[i].action.stop(); - humans[i].status = 0; - - if(humans[i].stage == 4){ - - rungroup.remove(humans[i].mesh); - // humans.splice(i,1); - } - - if(humans[i].stage == 3){ - - if(humans[i].direct == 1){ - - stationleft[humans[i].doors].waiting = 0; - }else{ - - stationright[humans[i].doors].waiting = 0; - } - humans[i].stage = 4; - - } - - if(humans[i].stage == 2){ - humans[i].stage = 3; - - } - - if(humans[i].stage == 1){ - - - humans[i].stage = 2; - - } - - if(humans[i].stage == 0){ - // console.log(humans[i].doors); - zhajiin[humans[i].doors].waiting = 0; - humans[i].stage = 1; - } - - moveanimatelist.splice(i,1); - - } - - }else{ - //根据动画进度获取动画轨迹上点 - - let point = humans[i].runrail.curve.getPointAt(humans[i].runrail.progress); - - //更新模型坐标 - humans[i].mesh.position.x = point.x; - humans[i].mesh.position.y = point.y; - humans[i].mesh.position.z = point.z; - if((humans[i].runrail.progress+0.001)<1){ - let tangent = humans[i].runrail.curve.getPointAt(humans[i].runrail.progress+0.001); - humans[i].mesh.lookAt(new THREE.Vector3(tangent.x,humans[i].mesh.position.y,tangent.z)); - } - - humans[i].runrail.progress += humans[i].runrail.speed; - point = null; - - } - - } - } - } - } - - function newhumancreate(){ - var direct = Math.floor(Math.random()*(3-1+1))+1; - var mantype = Math.floor(Math.random()*(3-1+1))+1; - // console.log(direct); - let points = []; - let newhuman; - if(mantype == 1){ - newhuman = THREE.SkeletonUtils.clone( originhuman1 ); - newhuman.animations = []; - newhuman.animations.push(originanima1.clone()); - }else{ - newhuman = THREE.SkeletonUtils.clone( originhuman2 ); - newhuman.animations = []; - newhuman.animations.push(originanima2.clone()); - } - if(direct == 1|| direct == 2){ - newhuman.position.set(32,10,25); - points.push(new THREE.Vector3(32,10,25)); - points.push(new THREE.Vector3(26,10,21)); - points.push(new THREE.Vector3(18,10,18)); - }else{ - newhuman.position.set(32,10,-5); - points.push(new THREE.Vector3(32,10,-5)); - points.push(new THREE.Vector3(26,10,12)); - points.push(new THREE.Vector3(24,10,17)); - points.push(new THREE.Vector3(18,10,18)); - } - - let j = Math.floor(Math.random()*(4-1+1))+1; - points.push(new THREE.Vector3(-0.5+j*1.4,10,18.5)); - // zhajiin[j].waiting = 1; - - let mixer = new THREE.AnimationMixer( newhuman ); - mixer.runplay = false; - let action = mixer.clipAction( newhuman.animations[ 0 ] ); - - var stationdirection = Math.floor(Math.random()*(2-1+1))+1; - let newone = { - id:humans.length, - mesh:newhuman, - status:1, - stage:0, - direct:stationdirection, - doorstatus:null, - doors:j, - action:action, - mixer:mixer, - runrail:null - }; - - humans.push(newone); - mixers.push(mixer); - rungroup.add(newhuman); - - - moveanimateinit(newone,humans.length,points,newone.id,0.002); - - // return newone; - } - - function initstationanimation(object){ - let mixer = new THREE.AnimationMixer( object ); - - let newclip = object.animations[ 0 ]; - for(let j=0;j { @@ -108,18 +108,13 @@ export function ModelManager(){ } } - +//fbx模型加载 function fbxpromise(asset,mixers,model){ return new Promise(function(resolve, reject){ var loader = new THREE.FBXLoader(); loader.load( BASE_ASSET_API+asset.url, function ( object ) { - // let mixer = new THREE.AnimationMixer( object ); - // object.traverse( function ( child ) { - // if ( child.isMesh ) { - // child.castShadow = true; - // child.receiveShadow = true; - // } - // } ); + + //列车模型子物体重新排序 if(asset.type == "cctvTrain"){ // let mixer = new THREE.AnimationMixer( object ); let realtrain = new THREE.Group(); diff --git a/src/jlmap3d/jl3dpassflow/model/passercheckdoor.js b/src/jlmap3d/jl3dpassflow/model/passercheckdoor.js index f55ea858c..9f87578d3 100644 --- a/src/jlmap3d/jl3dpassflow/model/passercheckdoor.js +++ b/src/jlmap3d/jl3dpassflow/model/passercheckdoor.js @@ -1,9 +1,10 @@ export function PasserCheckDoor(data) { var scope = this; - + //入口闸机组 this.zhajiin = []; + //出口闸机组 this.zhajiout = []; - + //定义闸机状态 for(let i=0;i<5;i++){ let zhaji = { id:"in0"+(i+1), @@ -12,7 +13,6 @@ export function PasserCheckDoor(data) { } scope.zhajiin.push(zhaji); } - for(let i=0;i<5;i++){ let zhaji = { id:"out0"+(i+1), @@ -21,6 +21,7 @@ export function PasserCheckDoor(data) { } scope.zhajiout.push(zhaji); } + //初始化闸机动画 this.initCheckDoorInAnimation = function(object,mixers ,deviceaction ,scene){ let mixer = new THREE.AnimationMixer( object ); let newclip = object.animations[ 0 ]; @@ -116,6 +117,7 @@ export function PasserCheckDoor(data) { scene.add(newzhaji); } + //初始化闸机动画 this.initCheckDoorOutAnimation = function(object,mixers ,deviceaction ,scene){ let mixer = new THREE.AnimationMixer( object ); let newclip = object.animations[ 0 ]; @@ -207,7 +209,7 @@ export function PasserCheckDoor(data) { } scene.add(newzhaji); } - + //闸机动画控制 this.checkDoorControl = function(type,door,deviceaction){ let devicenum = door; diff --git a/src/jlmap3d/jl3dpassflow/model/passerhuman.js b/src/jlmap3d/jl3dpassflow/model/passerhuman.js index ba3466a16..ee7369d80 100644 --- a/src/jlmap3d/jl3dpassflow/model/passerhuman.js +++ b/src/jlmap3d/jl3dpassflow/model/passerhuman.js @@ -1,12 +1,12 @@ export function PasserHuman() { let scope = this; - + //初始人物模型和动画 let originhuman1 = null; let originhuman2 = null; let originanima1 = null; let originanima2 = null; - + //初始化人物模型动画 this.initHumans = function(object1,object2,mixers,deviceaction,scene){ originhuman1 = object1; originhuman1.progress = 1; @@ -20,7 +20,7 @@ export function PasserHuman() { originhuman1.remove(originhuman1.children[2]); } - + //创建新的乘客 this.newHumanCreate = function(humanlist,position,stage,direct,door){ let mantype = Math.floor(Math.random()*(3-1+1))+1; let newhuman; @@ -63,7 +63,7 @@ export function PasserHuman() { humanlist.add(newhuman); // console.log(humanlist.children.length); } - + //定义新模型走路动画 this.initMoveAnimate = function(model,name,points,index){ model.status = 1; let curve = new THREE.CatmullRomCurve3(points); @@ -80,7 +80,7 @@ export function PasserHuman() { model.runrail = curve; model.speed = 0.2/curve.getLength(); } - + //更新人物列表中人物的动画 this.moveAnimateUpdate = function(humanlist,olddataai,passerHuman){ for(let i=0;i=0; i--) { - // console.log(data.body[i]); - - // console.log(data); - // 遍历列车对象组 - if (trainlisttest) { - code = data.code; - // 剔除不显示的车 - // 找到对应列车 - - - if ( trainlisttest.list[code]) { - - trainlisttest.list[code].runMode = data.runMode; - // 车门开关验证 - // if(data.directionType == "02"){ - if (trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == '01') { - // console.log("close"); - trainlisttest.list[code].doorStatus = '01'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = actions[code].top[an]._clip.duration; - actions[code].top[an].timeScale = -1; - actions[code].top[an].play(); - } - } else if (trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == '02') { - // console.log("open"); - trainlisttest.list[code].doorStatus = '02'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = 0; - actions[code].top[an].timeScale = 1; - actions[code].top[an].play(); - } - } - // if(trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == "01"){ - // //console.log("close"); - // trainlisttest.list[code].doorStatus = "01"; - // for(let an=actions[code].down.length-1;an>=0;an--){ - // actions[code].down[an].reset(); - // actions[code].down[an].time = actions[code].top[an]._clip.duration; - // actions[code].down[an].timeScale = -1; - // actions[code].down[an].play(); - // } - // }else if(trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == "02"){ - // //console.log("open"); - // trainlisttest.list[code].doorStatus = "02"; - // for(let an=actions[code].down.length-1;an>=0;an--){ - // actions[code].down[an].reset(); - // actions[code].down[an].time = 0; - // actions[code].down[an].timeScale = 1; - // actions[code].down[an].play(); - // } - // } - // } - // 遍历获取所在轨道 - if (trainlisttest.list[code].dispose != data.dispose && data.dispose == false) { - - if (rails.linkrail[data.linkCode]) { - trainlisttest.group.add(trainlisttest.list[code]); - trainlisttest.list[code].position.y = 0; - // trainlisttest.list[code].progress = 0; - trainlisttest.list[code].dispose = false; - trainlisttest.list[code].nowcode = data.linkCode; - trainlisttest.list[code].nextcode = null; - trainlisttest.list[code].pc = 1; - - if(trainlisttest.list[code].mixerpush == false){ - for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi=0; j--) { - if (rails.switchrail[code]) { - if (rails.switchrail[code].locateType != data.locateType) { - if (data.locateType == '02') { - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = 0; - actions[sectionlist.switchs.modellist[j].code].timeScale = 1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = "02"; - - let testswitch = rails.switchrail[code]; - // console.log(testswitch); - // console.log(rails.linkrail[testswitch.alink]); - // console.log(rails.linkrail[testswitch.clink]); - if(rails.switchrail[code].directtype == "1"){ - rails.linkrail[testswitch.alink].lconnect = testswitch.clink; - rails.linkrail[testswitch.clink].rconnect = testswitch.alink; - }else if(rails.switchrail[code].directtype == "2"){ - rails.linkrail[testswitch.alink].rconnect = testswitch.clink; - rails.linkrail[testswitch.clink].lconnect = testswitch.alink; - } - - } else if (data.locateType == '01') { - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration; - actions[sectionlist.switchs.modellist[j].code].timeScale = -1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = "01"; - let testswitch = rails.switchrail[code]; - // console.log(testswitch); - // console.log(rails.linkrail[testswitch.alink]); - // console.log(rails.linkrail[testswitch.clink]); - if(rails.switchrail[code].directtype == "1"){ - rails.linkrail[testswitch.alink].lconnect = testswitch.blink; - rails.linkrail[testswitch.blink].rconnect = testswitch.alink; - }else if(rails.switchrail[code].directtype == "2"){ - rails.linkrail[testswitch.alink].rconnect = testswitch.blink; - rails.linkrail[testswitch.blink].lconnect = testswitch.alink; - } - - } - } - j = 0; - } - } - } - function simulationreset(data){ - for(let i=0;i=0; i--) { - // console.log(data.body[i]); - - // console.log(data); - // 遍历列车对象组 - if (trainlisttest) { - code = data.code; - // 剔除不显示的车 - // 找到对应列车 - - - if ( trainlisttest.list[code]) { - - trainlisttest.list[code].runMode = data.runMode; - // 车门开关验证 - // if(data.directionType == "02"){ - if (trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == '01') { - // console.log("close"); - trainlisttest.list[code].doorStatus = '01'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = actions[code].top[an]._clip.duration; - actions[code].top[an].timeScale = -1; - actions[code].top[an].play(); - } - } else if (trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == '02') { - // console.log("open"); - trainlisttest.list[code].doorStatus = '02'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = 0; - actions[code].top[an].timeScale = 1; - actions[code].top[an].play(); - } - } - // if(trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == "01"){ - // //console.log("close"); - // trainlisttest.list[code].doorStatus = "01"; - // for(let an=actions[code].down.length-1;an>=0;an--){ - // actions[code].down[an].reset(); - // actions[code].down[an].time = actions[code].top[an]._clip.duration; - // actions[code].down[an].timeScale = -1; - // actions[code].down[an].play(); - // } - // }else if(trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == "02"){ - // //console.log("open"); - // trainlisttest.list[code].doorStatus = "02"; - // for(let an=actions[code].down.length-1;an>=0;an--){ - // actions[code].down[an].reset(); - // actions[code].down[an].time = 0; - // actions[code].down[an].timeScale = 1; - // actions[code].down[an].play(); - // } - // } - // } - // 遍历获取所在轨道 - if (trainlisttest.list[code].dispose != data.dispose && data.dispose == false) { - - if (rails.linkrail[data.linkCode]) { - trainlisttest.group.add(trainlisttest.list[code]); - trainlisttest.list[code].position.y = 0; - // trainlisttest.list[code].progress = 0; - trainlisttest.list[code].dispose = false; - trainlisttest.list[code].nowcode = data.linkCode; - trainlisttest.list[code].nextcode = null; - trainlisttest.list[code].pc = 1; - - if(trainlisttest.list[code].mixerpush == false){ - for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi=0; j--) { - if (rails.switchrail[code]) { - if (rails.switchrail[code].locateType != data.locateType) { - if (data.locateType == '02') { - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = 0; - actions[sectionlist.switchs.modellist[j].code].timeScale = 1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = "02"; - - let testswitch = rails.switchrail[code]; - // console.log(testswitch); - // console.log(rails.linkrail[testswitch.alink]); - // console.log(rails.linkrail[testswitch.clink]); - if(rails.switchrail[code].directtype == "1"){ - rails.linkrail[testswitch.alink].lconnect = testswitch.clink; - rails.linkrail[testswitch.clink].rconnect = testswitch.alink; - }else if(rails.switchrail[code].directtype == "2"){ - rails.linkrail[testswitch.alink].rconnect = testswitch.clink; - rails.linkrail[testswitch.clink].lconnect = testswitch.alink; - } - - } else if (data.locateType == '01') { - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration; - actions[sectionlist.switchs.modellist[j].code].timeScale = -1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = "01"; - let testswitch = rails.switchrail[code]; - // console.log(testswitch); - // console.log(rails.linkrail[testswitch.alink]); - // console.log(rails.linkrail[testswitch.clink]); - if(rails.switchrail[code].directtype == "1"){ - rails.linkrail[testswitch.alink].lconnect = testswitch.blink; - rails.linkrail[testswitch.blink].rconnect = testswitch.alink; - }else if(rails.switchrail[code].directtype == "2"){ - rails.linkrail[testswitch.alink].rconnect = testswitch.blink; - rails.linkrail[testswitch.blink].lconnect = testswitch.alink; - } - - } - } - j = 0; - } - } - } - function simulationreset(data){ - for(let i=0;i= 0; i--) { - - if (data.body[i]._type == 'Train') { - - // console.log(data.body[i]); - // 遍历列车对象组 - // console.log(data.body[i]); - if (trainlisttest) { - code = data.body[i].code; - // 剔除不显示的车 - // 找到对应列车 - - if (trainlisttest.list[code]) { - // 车门开关验证 - // if(data.body[i].directionType == "02"){ - if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // console.log("close"); - trainlisttest.list[code].doorStatus = '01'; - for (let an = actions[code].top.length - 1; an >= 0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = actions[code].top[an]._clip.duration; - actions[code].top[an].timeScale = -1; - actions[code].top[an].play(); - } - } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // console.log("open"); - trainlisttest.list[code].doorStatus = '02'; - for (let an = actions[code].top.length - 1; an >= 0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = 0; - actions[code].top[an].timeScale = 1; - actions[code].top[an].play(); - } - } - // }else{ - // if(trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == "01"){ - // //console.log("close"); - // trainlisttest.list[code].doorStatus = "01"; - // for(let an=actions[code].down.length-1;an>=0;an--){ - // actions[code].down[an].reset(); - // actions[code].down[an].time = actions[code].top[an]._clip.duration; - // actions[code].down[an].timeScale = -1; - // actions[code].down[an].play(); - // } - // }else if(trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == "02"){ - // //console.log("open"); - // trainlisttest.list[code].doorStatus = "02"; - // for(let an=actions[code].down.length-1;an>=0;an--){ - // actions[code].down[an].reset(); - // actions[code].down[an].time = 0; - // actions[code].down[an].timeScale = 1; - // actions[code].down[an].play(); - // } - // } - // } - // 遍历获取所在轨道 - if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) { - trainlisttest.group.add(trainlisttest.list[code]); - - if (sectionlist.sections.datalist[data.body[i].sectionCode].code) { - - trainlisttest.list[code].position.y = 0; - trainlisttest.list[code].progress = 0; - trainlisttest.list[code].oldoffset = data.body[i].sectionOffsetPercent; - trainlisttest.list[code].dispose = false; - - if (data.body[i].directionType == '02') { - trainlisttest.list[code].status = '02'; - trainlisttest.list[code].rotation.y = 0; - } else if (data.body[i].directionType == '03') { - trainlisttest.list[code].status = '03'; - trainlisttest.list[code].rotation.y = Math.PI; - } - - } - - } else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) { - trainlisttest.group.remove(trainlisttest.list[code]); - trainlisttest.list[code].progress = null; - trainlisttest.list[code].dispose = true; - - } else if (trainlisttest.list[code].dispose == data.body[i].dispose && data.body[i].dispose == false) { - - if (sectionlist.sections.datalist[data.body[i].sectionCode].code) { - if (trainlisttest.list[code].nowcode != data.body[i].sectionCode || trainlisttest.list[code].nextcode != data.body[i].nextSectionCode) { - trainlisttest.list[code].nowcode = data.body[i].sectionCode; - trainlisttest.list[code].nextcode = data.body[i].nextSectionCode; - const vexlist = []; - const endrotation = null; - if (data.body[i].directionType == '02') { // 向右 - if (trainlisttest.list[code].status != data.body[i].directionType) { - console.log(trainlisttest.list[code].position); - console.log(trainlisttest.list[code].children[5].matrixWorld); - trainlisttest.list[code].position.x = trainlisttest.list[code].children[5].matrixWorld.elements[12]; - trainlisttest.list[code].children[0].position.z = trainlisttest.list[code].children[0].matrixWorld.elements[14]; - trainlisttest.list[code].children[1].position.z = trainlisttest.list[code].children[1].matrixWorld.elements[14]; - trainlisttest.list[code].children[2].position.z = trainlisttest.list[code].children[2].matrixWorld.elements[14]; - trainlisttest.list[code].children[3].position.z = trainlisttest.list[code].children[3].matrixWorld.elements[14]; - trainlisttest.list[code].children[4].position.z = trainlisttest.list[code].children[4].matrixWorld.elements[14]; - trainlisttest.list[code].children[5].position.z = trainlisttest.list[code].children[5].matrixWorld.elements[14]; - - if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x > sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) { - vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14])); - for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) { - if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x > trainlisttest.list[code].position.x) { - vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]); - } - - } - } else { - vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14])); - for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) { - if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x > trainlisttest.list[code].position.x) { - vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]); - } - } - } - } else { - if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x > sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) { - for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) { - vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]); - } - } else { - for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) { - vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]); - } - } - } - trainlisttest.list[code].status = '02'; - trainlisttest.list[code].rotation.y = 0; - - } else if (data.body[i].directionType == '03') { // 向左 - - if (trainlisttest.list[code].status != data.body[i].directionType) { - trainlisttest.list[code].position.x = trainlisttest.list[code].children[5].matrixWorld.elements[12]; - trainlisttest.list[code].children[0].position.z = trainlisttest.list[code].children[0].matrixWorld.elements[14]; - trainlisttest.list[code].children[1].position.z = trainlisttest.list[code].children[1].matrixWorld.elements[14]; - trainlisttest.list[code].children[2].position.z = trainlisttest.list[code].children[2].matrixWorld.elements[14]; - trainlisttest.list[code].children[3].position.z = trainlisttest.list[code].children[3].matrixWorld.elements[14]; - trainlisttest.list[code].children[4].position.z = trainlisttest.list[code].children[4].matrixWorld.elements[14]; - trainlisttest.list[code].children[5].position.z = trainlisttest.list[code].children[5].matrixWorld.elements[14]; - // - if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x < sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) { - vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14])); - for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) { - if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x < trainlisttest.list[code].position.x) { - vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]); - } - } - } else { - vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14])); - for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) { - if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x < trainlisttest.list[code].position.x) { - vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]); - } - } - } - } else { - // - if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x < sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) { - for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) { - vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]); - } - - } else { - for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) { - vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]); - } - } - } - trainlisttest.list[code].status = '03'; - trainlisttest.list[code].rotation.y = Math.PI; - - } - - trainlisttest.list[code].curve = new THREE.CatmullRomCurve3(vexlist); - // console.log(trainlisttest.list[code].curve.points); - // console.log(data.body[i].speed) - // console.log(sectionlist.sections.datalist[data.body[i].sectionCode].distance); - trainlisttest.list[code].speeds = data.body[i].speed * 10 / 36 / 11 / sectionlist.sections.datalist[data.body[i].sectionCode].distance; - - trainlisttest.list[code].progress = 0; - } - // console.log("speed"); - // console.log(data.body[i].speed); - // console.log(trainlisttest.list[code].speed); - if (data.body[i].speed != trainlisttest.list[code].speed) { - trainlisttest.list[code].speed = data.body[i].speed; - trainlisttest.list[code].speeds = data.body[i].speed * 10 / 36 / 11 / sectionlist.sections.datalist[data.body[i].sectionCode].distance; - // if(trainlisttest.list[code].speeds > 0.1){ - // console.log(data.body[i]); - // console.log(data.body[i].speed) - // console.log(sectionlist.sections.datalist[data.body[i].sectionCode].distance); - // console.log(trainlisttest.list[code].speeds); - // } - } - - } - - } - - } - - } - } - - // 0xFFFFFF - // 0xCD0000 红 - // 0xEEEE00 黄 - // 0x32CD32 绿 - if (data.body[i]._type == 'Signal') { - - if (signallist) { - code = data.body[i].code; - if (data.body[i].lightType == '01') { - if (signallist.list[code].mesh.code) { - signallist.list[code].mesh.status = data.body[i].status; - - // 55 - // 33 - // 77 - // 关闭 - if (data.body[i].status == '01') { - signallist.list[code].mesh.children[0].material.map = materials[3]; - signallist.list[code].mesh.children[0].material.map.needsUpdate = true; - signallist.list[code].mesh.children[1].material.map = materials[0]; - signallist.list[code].mesh.children[1].material.map.needsUpdate = true; - signallist.list[code].mesh.children[2].material.map = materials[3]; - signallist.list[code].mesh.children[2].material.map.needsUpdate = true; - - } - // 开放 - if (data.body[i].status == '02') { - - if (data.body[i].switchLocateType == '01') { - signallist.list[code].mesh.children[0].material.map = materials[2]; - signallist.list[code].mesh.children[0].material.map.needsUpdate = true; - signallist.list[code].mesh.children[1].material.map = materials[3]; - signallist.list[code].mesh.children[1].material.map.needsUpdate = true; - signallist.list[code].mesh.children[2].material.map = materials[3]; - signallist.list[code].mesh.children[2].material.map.needsUpdate = true; - - } - - if (data.body[i].switchLocateType == '02') { - signallist.list[code].mesh.children[0].material.map = materials[3]; - signallist.list[code].mesh.children[0].material.map.needsUpdate = true; - signallist.list[code].mesh.children[1].material.map = materials[3]; - signallist.list[code].mesh.children[1].material.map.needsUpdate = true; - signallist.list[code].mesh.children[2].material.map = materials[1]; - signallist.list[code].mesh.children[2].material.map.needsUpdate = true; - - } - - } - // 引导 - if (data.body[i].status == '03') { - signallist.list[code].mesh.children[0].material.map = materials[3]; - signallist.list[code].mesh.children[0].material.map.needsUpdate = true; - signallist.list[code].mesh.children[1].material.map = materials[0]; - signallist.list[code].mesh.children[1].material.map.needsUpdate = true; - signallist.list[code].mesh.children[2].material.map = materials[1]; - signallist.list[code].mesh.children[2].material.map.needsUpdate = true; - - } - // 封锁 - if (data.body[i].status == '04') { - signallist.list[code].mesh.children[0].material.map = materials[3]; - signallist.list[code].mesh.children[0].material.map.needsUpdate = true; - signallist.list[code].mesh.children[1].material.map = materials[3]; - signallist.list[code].mesh.children[1].material.map.needsUpdate = true; - signallist.list[code].mesh.children[2].material.map = materials[3]; - signallist.list[code].mesh.children[2].material.map.needsUpdate = true; - - } - // 故障 - if (data.body[i].status == '05') { - signallist.list[code].mesh.children[0].material.map = materials[3]; - signallist.list[code].mesh.children[0].material.map.needsUpdate = true; - signallist.list[code].mesh.children[1].material.map = materials[3]; - signallist.list[code].mesh.children[1].material.map.needsUpdate = true; - signallist.list[code].mesh.children[2].material.map = materials[3]; - signallist.list[code].mesh.children[2].material.map.needsUpdate = true; - - } - - } - - } else if (data.body[i].lightType == '01') { - if (signallist.list[code].mesh.code) { - signallist.list[code].mesh.children[0].material.map = materials[3]; - signallist.list[code].mesh.children[0].material.map.needsUpdate = true; - signallist.list[code].mesh.children[1].material.map = materials[3]; - signallist.list[code].mesh.children[1].material.map.needsUpdate = true; - signallist.list[code].mesh.children[2].material.map = materials[3]; - signallist.list[code].mesh.children[2].material.map.needsUpdate = true; - - } - - } - - } - - } - - if (data.body[i]._type == 'StationStand') { - if (actions) { - code = data.body[i].code; - if (data.body[i].screenDoorOpenStatus == '02' && actions[code].status == '01') { - actions[code].status = '00'; - } - if (data.body[i].screenDoorOpenStatus == '02' && actions[code].status == '00') { - actions[code].status = '02'; - actions[code].action.reset(); - actions[code].action.time = 0; - actions[code].action.timeScale = 1; - actions[code].action.play(); - } - - if (data.body[i].screenDoorOpenStatus == '01' && actions[code].status == '02') { - actions[code].status = '00'; - } - if (data.body[i].screenDoorOpenStatus == '01' && actions[code].status == '00') { - actions[code].status = '01'; - actions[code].action.reset(); - actions[code].action.time = actions[code].action._clip.duration; - actions[code].action.timeScale = -1; - actions[code].action.play(); - } - - } - - } - - if (data.body[i]._type == 'Switch') { - - if (sectionlist) { - code = data.body[i].code; - for (let j = sectionlist.switchs.modellist.length - 1; j >= 0; j--) { - if (sectionlist.switchs.modellist[j].code == code) { - if (sectionlist.switchs.modellist[j].locateType != data.body[i].locateType) { - if (data.body[i].locateType == '02') { - sectionlist.switchs.modellist[j].locateType = data.body[i].locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = 0; - actions[sectionlist.switchs.modellist[j].code].timeScale = 1; - actions[sectionlist.switchs.modellist[j].code].play(); - - } else if (data.body[i].locateType == '01') { - sectionlist.switchs.modellist[j].locateType = data.body[i].locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration; - actions[sectionlist.switchs.modellist[j].code].timeScale = -1; - actions[sectionlist.switchs.modellist[j].code].play(); - - } - } - - // console.log(sectionlist.group[j].name); - j = 0; - } - } - } - - } - } - - } else if (data.body.length > 200) { - - } - - } - - } - -} diff --git a/src/jlmap3d/jl3dsimulation/connect/UpdateTrainNew.js b/src/jlmap3d/jl3dsimulation/connect/UpdateTrainNew.js deleted file mode 100644 index e0e9d5921..000000000 --- a/src/jlmap3d/jl3dsimulation/connect/UpdateTrainNew.js +++ /dev/null @@ -1,174 +0,0 @@ - -export function UpdateTrainNew(camera,traindata){ - if(traindata != undefined ){ - for(let j=traindata.group.children.length-1;j>=0;j--){ - //判断是否有移动事件 - - let trainmodel = traindata.group.children[j]; - - if(trainmodel.speeds > 0 && trainmodel.speeds){ - let speed = null; - if(traindata.group.children[j].progress >=0&&traindata.group.children[j].progress<=1){ - - let movecurve = trainmodel.curve; - if(trainmodel.status == "1"){ - - let point = movecurve.getPointAt(trainmodel.progress); - let worldpositionz = trainmodel.children[0].position.z; - - - trainmodel.position.x = point.x; - trainmodel.position.y = 0; - let offset = Math.abs( point.z -parseFloat(worldpositionz)); - if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.02){ - trainmodel.children[0].up = new THREE.Vector3(1,0,0); - let tangent = movecurve.getTangentAt(traindata.group.children[j].progress).normalize(); - trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize(); - let radians = Math.acos(trainmodel.children[0].up.dot(tangent)); - trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians); - trainmodel.children[0].rotation.x = -Math.PI/2; - trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y; - trainmodel.children[0].rotation.y = 0; - let rotas = { - posr:point, - rota:trainmodel.children[0].rotation.z - } - trainmodel.children[1].rotalist.push(rotas); - let offsetz = parseFloat(point.z) - parseFloat(trainmodel.children[0].matrixWorld.elements[14]); - trainmodel.children[0].position.z += offsetz; - } - - if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){ - - for(let rs = 1;rs<6;rs++){ - if(trainmodel.children[rs].rotalist[0]){ - - let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) - parseFloat(trainmodel.children[rs].matrixWorld.elements[14]); - trainmodel.children[rs].position.z += offsetz; - - for(let xh=0;xh=trainmodel.children[rs].rotalist[0].posr.x){ - - if(rs != 5){ - let asd = trainmodel.children[rs].rotalist[0]; - trainmodel.children[rs+1].rotalist.push(asd); - - } - trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rota; - trainmodel.children[rs].rotalist.splice(0,1) - xh--; - }else{ - xh = trainmodel.children[rs].rotalist.length; - } - } - } - } - } - trainmodel.progress += trainmodel.speeds; - // if(trainmodel.statsstop == 0){ - // if((1-trainmodel.progress) > 0.95){ - // - // trainmodel.progress += trainmodel.speeds; - // } - // - // }else{ - // trainmodel.progress += trainmodel.speeds; - // } - - } - - if(trainmodel.status == "0"){ - let point = movecurve.getPointAt(trainmodel.progress); - let worldpositionz = trainmodel.children[0].position.z; - - trainmodel.position.x = point.x; - trainmodel.position.y = 0; - - if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.02){ - trainmodel.children[0].up = new THREE.Vector3(-1,0,0); - let tangent = movecurve.getTangentAt(traindata.group.children[j].progress).normalize(); - trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize(); - let radians = Math.acos(trainmodel.children[0].up.dot(tangent)); - - trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians); - trainmodel.children[0].rotation.x = -Math.PI/2; - trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y; - trainmodel.children[0].rotation.y = 0; - - let rotas = { - posr:point, - rota:trainmodel.children[0].rotation.z - } - trainmodel.children[1].rotalist.push(rotas); - - let offsetz = parseFloat(trainmodel.children[0].matrixWorld.elements[14]) - parseFloat(point.z); - trainmodel.children[0].position.z += offsetz; - - } - - if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){ - for(let rs = 1;rs<6;rs++){ - if(trainmodel.children[rs].rotalist[0]){ - let offsetz = parseFloat(trainmodel.children[rs].matrixWorld.elements[14]) - parseFloat(trainmodel.children[rs].rotalist[0].posr.z); - - trainmodel.children[rs].position.z += offsetz; - - for(let xh=0;xh { let assetsdata = JSON.parse(netdata.data.sections); - if(assetsdata.link){ - scope.datatype = "old"; - scope.jsonwebwork = new Worker(JL3D_LOCAL_STATIC+"/workertest/jsonworker.js"); - scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork); - scope.Subscribe.socketon(scope.Subscribe.topic); - SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); - - }else{ - scope.datatype = "new"; - scope.jsonwebworknew = new Worker(JL3D_LOCAL_STATIC+"/workertest/jsonworkernew.js"); - scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew); - scope.Subscribe.socketon(scope.Subscribe.topic); - SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); - } - + scope.datatype = "new"; + scope.jsonwebworknew = new Worker(JL3D_LOCAL_STATIC+"/workertest/jsonworkernew.js"); + scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew); + scope.Subscribe.socketon(scope.Subscribe.topic); + SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); }); }); // @@ -193,7 +177,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { //更新列车位置 if(scope.datatype == "new"){ - // UpdateTrainNew(camera,trainlisttest); }else{ UpdateTrain(camera,trainlisttest); } diff --git a/src/jlmap3d/main/loaders/DriverLoad.js b/src/jlmap3d/main/loaders/DriverLoad.js deleted file mode 100644 index e14212b39..000000000 --- a/src/jlmap3d/main/loaders/DriverLoad.js +++ /dev/null @@ -1,187 +0,0 @@ -//componnent -import {SectionList} from '@/jlmap3d/main/model/SectionList.js'; -import {SignalList} from '@/jlmap3d/main/model/SignalList.js'; -import {StationStandList} from '@/jlmap3d/main/model/StationStandList.js'; -import {TrainList} from '@/jlmap3d/main/model/TrainList.js'; -import {RealSectionList} from '@/jlmap3d/main/model/RealSectionList.js'; -import {LinkList} from '@/jlmap3d/main/model/LinkList.js'; -import {RailList} from '@/jlmap3d/main/model/RailList.js'; - -import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js'; - -import {SectionListN} from '@/jlmap3d/main/newmodel/SectionListN'; -import {SignalListN} from '@/jlmap3d/main/newmodel/SignalListN'; -import {StationStandListN} from '@/jlmap3d/main/newmodel/StationStandListN'; -import {SwitchListN} from '@/jlmap3d/main/newmodel/SwitchListN'; -import {RailListN} from '@/jlmap3d/main/newmodel/RailListN.js'; - -import { Loading } from 'element-ui'; -// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js'; - -export function DriverLoad(data,scope,netdata,sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,camera,controls,scene,mixerss,storemod){ - //console.log(mapdata); - Materialload(scope); - //console.log(data); - //console.log(scope); - let sceneload = scene; - let backdata = scope; - let assetloader = scope.assetloader; - let animateswitch = scope.animateswitch; - - let mixers = mixerss; - let actions = scope.actions; - - let loadingInstance = Loading.service({ fullscreen: true }); - - let switchlist; - - let isSection = false; - let isNewdata = false; - if(netdata.assets){ - let assetsdata = JSON.parse(netdata.sections); - // console.log(assetsdata.link); - if(assetsdata.link){ - isSection = true; - }else{ - isNewdata = true; - } - } - // console.log(isNewdata); - // console.log(netdata); - if(isSection == true){ - init3d(data,netdata); - }else{ - loadingInstance.close(); - alert("没有三维数据"); - } - function init3d(data,netdata){ - let mapdata = data.data; - // console.log(data); - //初始化轨道和道岔 暂时 - lengthfact(data.data); - - linklist = new LinkList(); - sectionlist = new SectionList(); - signallist = new SignalList(); - //初始化站台 - stationstandlist = new StationStandList(); - //初始化测试列车 - trainlisttest = new TrainList(); - realsectionlist = new RealSectionList(); - - rails = new RailList(); - - let loaderdata = JSON.parse(netdata.sections); - let switchdata = JSON.parse(netdata.switchs); - let signaldata = JSON.parse(netdata.signals); - let standsdata = JSON.parse(netdata.stands); - - assetloader.setmodellist(netdata.assets); - - assetloader.assetpromise(sceneload) - .then(function(data){ - return linklist.loadpromise(loaderdata.link,sceneload,assetloader); - }) - .then(function(data){ - //console.log(data); - return stationstandlist.initpromise(mapdata.stationList,mapdata.stationStandList,sceneload,assetloader,netdata.stands,mixers,actions,"0"); - }) - .then(function(data){ - //console.log(data); - //console.log(assetloader); - return trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"0"); - }) - .then(function(data){ - //console.log(data); - return sectionlist.loadpromise(linklist,assetloader,loaderdata.section,switchdata,sceneload); - }) - // .then(function(data){ - // //console.log(data); - // return jlmap3ddata.realsectionlist.initpromise(jlmap3ddata,sceneload,assetloader,mixers,actions); - // }) - .then(function(data){ - //console.log(data); - return signallist.initpromise(mapdata.signalList,sceneload,assetloader,netdata.signals); - }) - .then(function(data){ - return new Promise(function(resolve, reject){ - let stopoffset = 64; - rails.init(loaderdata.link,mapdata.linkList,mapdata.sectionList,switchdata, - stationstandlist.list,sceneload,storemod,stopoffset); - resolve("loadrail"); - - }); - }) - - .then(function(data){ - for(let mn=0;mn0.49){ - rightlist.push(i); - } - if(autorail.geometry.attributes.position.array[i*3] <-0.49){ - leftlist.push(i); - } - } - - - - for(let i=0;i0.49){ - rightlist.push(i); - } - if(autorail.geometry.attributes.position.array[i*3] <-0.49){ - leftlist.push(i); - } - } - - autorail.rightlist = rightlist; - autorail.leftlist = leftlist; - - - let reallinks = []; - let testlink; - testlink = data; - if(data){ - let index,startdata; - for(let n=0;n=0){ - if(reallinks[i].leftFdCode == data[j].code){ - buildmodel(data[j],reallinks[i],j,"left"); - reallinks.push(data[j]); - data.splice(j,1); - j--; - } - } - if(reallinks[i].leftSdCode && j>=0){ - - if(reallinks[i].leftSdCode == data[j].code){ - buildmodel(data[j],reallinks[i],j,"left"); - reallinks.push(data[j]); - data.splice(j,1); - j--; - } - } - - if(reallinks[i].rightFdCode && j>=0){ - if(reallinks[i].rightFdCode == data[j].code){ - - buildmodel(data[j],reallinks[i],j,"right"); - reallinks.push(data[j]); - data.splice(j,1); - j--; - } - } - - if(reallinks[i].rightSdCode && j>=0){ - if(reallinks[i].rightSdCode == data[j].code){ - buildmodel(data[j],reallinks[i],j,"right"); - reallinks.push(data[j]); - data.splice(j,1); - j--; - } - } - - } - } - - function buildmodel(data,mdata,sx,direct){ - let len = data.lengthFact; - - let testmesh2 = autorail.clone(true); - for(let i=0;idata.rp.y){ - testmesh2.rotation.z = 0.218; - data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z); - data.lp.y = data.rp.y + (data.lengthFact)*Math.sin(testmesh2.rotation.z); - }else if(data.lp.ydata.rp.y){ - testmesh2.rotation.z = 0.218; - data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z); - data.rp.y = data.lp.y-(data.lengthFact)*Math.sin(testmesh2.rotation.z); - }else if(data.lp.y0){ - let testline = new THREE.CatmullRomCurve3([ - new THREE.Vector3(scope.linkrail[linkdata[i].code].lp.x,0,scope.linkrail[linkdata[i].code].lp.z), - new THREE.Vector3(scope.linkrail[linkdata[i].code].rp.x,0,scope.linkrail[linkdata[i].code].rp.z) - ]); - - scope.linkrail[linkdata[i].code].type = 1; - if(scope.linkrail[linkdata[i].code].lswitch){ - let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].lswitch].position; - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+1.5,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+4.5,0,switchpoint.z-0.05)); - } - - scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.12)); - scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.22)); - scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.82)); - scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.92)); - - if(scope.linkrail[linkdata[i].code].rswitch){ - let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].rswitch].position; - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-4.5,0,switchpoint.z+0.05)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-1.5,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z)); - } - - }else{ - let testline = new THREE.CatmullRomCurve3([ - new THREE.Vector3(scope.linkrail[linkdata[i].code].lp.x,0,scope.linkrail[linkdata[i].code].lp.z), - new THREE.Vector3(scope.linkrail[linkdata[i].code].rp.x,0,scope.linkrail[linkdata[i].code].rp.z) - ]); - scope.linkrail[linkdata[i].code].type = 2; - if(scope.linkrail[linkdata[i].code].lswitch){ - let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].lswitch].position; - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+1.5,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+4.5,0,switchpoint.z+0.05)); - } - - scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.12)); - scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.22)); - scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.82)); - scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.92)); - - if(scope.linkrail[linkdata[i].code].rswitch){ - let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].rswitch].position; - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-4.5,0,switchpoint.z-0.05)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-1.5,0,switchpoint.z)); - scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z)); - } - } - } - - } - - for(let i=0;i{ - rightpoints.push(item); - } - ); - rightpoints.reverse(); - scope.linkrail[linkdata[i].code].lineright = new THREE.CatmullRomCurve3(rightpoints); - scope.linkrail[linkdata[i].code].lineright.curveType = "centripetal"; - // - // for(let n=0,nm=scope.linkrail[linkdata[i].code].lineleft.points.length;nswitchdata[i].pb[0].x){ - if(((switchdata[i].pc[0].y+switchdata[i].pc[1].y)/2) < switchdata[i].pa[0].y){ - if(((switchdata[i].pc[0].x+switchdata[i].pc[1].x)/2)>switchdata[i].pa[0].x){ - testswitch = switchmesh1.clone(true); - }else{ - testswitch = switchmesh2.clone(true); - } - }else{ - if(((switchdata[i].pc[0].x+switchdata[i].pc[1].x)/2)>switchdata[i].pa[0].x){ - testswitch = switchmesh2.clone(true); - }else{ - testswitch = switchmesh1.clone(true); - } - testswitch.rotation.z = Math.PI; - } - }else{ - if(((switchdata[i].pc[0].y+switchdata[i].pc[1].y)/2) < switchdata[i].pa[1].y){ - if(((switchdata[i].pc[0].x+switchdata[i].pc[1].x)/2)>switchdata[i].pa[1].x){ - testswitch = switchmesh1.clone(true); - }else{ - testswitch = switchmesh2.clone(true); - } - }else{ - if(((switchdata[i].pc[0].x+switchdata[i].pc[1].x)/2)>switchdata[i].pa[1].x){ - testswitch = switchmesh2.clone(true); - }else{ - testswitch = switchmesh1.clone(true); - } - testswitch.rotation.z = Math.PI; - } - } - - testswitch.position.x = switchdata[i].position.x; - testswitch.position.y = switchdata[i].position.y; - testswitch.position.z = switchdata[i].position.z; - // testswitch.rotation.x = switchdata[i].rotation._x; - // testswitch.rotation.y = switchdata[i].rotation._y; - // testswitch.rotation.z = switchdata[i].rotation._z; - - scope.switchs.datalist.push(newswitch); - scope.switchs.modellist.push(testswitch); - switchgroup.add(testswitch); - } - - resolve("loadersection"); - }); - - } - - function buildsuidao(linkdata,suidaodata,assetloader,scene){ - let autosuidao; - for(let i=0;i7){ - rightlist.push(i); - if(autosuidao.geometry.attributes.position.array[i*3] > rightpoint){ - rightpoint = i; - } - } - if(autosuidao.geometry.attributes.position.array[i*3] <-7){ - leftlist.push(i); - if(autosuidao.geometry.attributes.position.array[i*3] < rightpoint){ - leftpoint = i; - } - } - } - autosuidao.rightlist = rightlist; - autosuidao.leftlist = leftlist; - autosuidao.rightpoint = rightpoint; - autosuidao.leftpoint = leftpoint; - // console.log(autosuidao); - // console.log(linkdata.linksgroup.children); - // console.log(suidaodata.datalist); - for(let i = 0;i < suidaodata.datalist.length;i++){ - let link = linkdata.linksgroup.getObjectByProperty("code",suidaodata.datalist[i].linkCode); - let suidao = suidaodata.datalist[i]; - let len = suidao.offsetRight-suidao.offsetLeft; - // console.log("-------------------------------------"); - // console.log("name:"+link.name); - // console.log(link.lengthfact); - // console.log(len); - // console.log("ofl:"+suidao.offsetLeft+" "+"ofr:"+suidao.offsetRight); - // console.log("-------------------------------------"); - - let testmesh1 = autosuidao.clone(true); - for(let i=0;i link.rp.y){ - testmesh1.position.z = link.lp.y-suidao.offsetLeft*(len/lenfact) + (link.rp.y-link.lp.y)*(len/lenfact)/2; - }else{ - testmesh1.position.z = link.lp.y+suidao.offsetLeft*(len/lenfact) + (link.rp.y-link.lp.y)*(len/lenfact)/2; - } - }else{ - testmesh1.position.x = link.lp.x+suidao.offsetLeft+len/2; - testmesh1.position.z = link.position.z; - } - testmesh1.position.y = 3.5; - // testmesh1.rotation.x = Math.PI/4; - testmesh1.code = suidaodata.datalist[i].code; - testmesh1.name = suidaodata.datalist[i].code; - // testmesh1.position.z = link.position.z; - testmesh1.relStandCode = suidaodata.datalist[i].relStandCode; - // testmesh1.stationCode = suidaodata.datalist[i].stationCode; - - testmesh1.rightlist = autosuidao.rightlist; - testmesh1.leftlist = autosuidao.leftlist; - testmesh1.rightpoint = autosuidao.rightpoint; - testmesh1.leftpoint = autosuidao.leftpoint; - testmesh1.isStandTrack = suidaodata.datalist[i].isStandTrack; - testmesh1.lengthfact = len; - testmesh1.linkCode = suidao.linkCode; - if(suidaodata.datalist[i].isStandTrack == false){ - sectiongroup.add(testmesh1); - - }else{ - scope.standtrack.push(testmesh1); - var box = new THREE.BoxHelper( testmesh1, 0xff0000 ); - sectiongroup.add( box ); - } - scope.sections.modellist.push(testmesh1); - } - } - - -} diff --git a/src/jlmap3d/main/model/SectionModel.js b/src/jlmap3d/main/model/SectionModel.js deleted file mode 100644 index 9ba9abb07..000000000 --- a/src/jlmap3d/main/model/SectionModel.js +++ /dev/null @@ -1,26 +0,0 @@ -export function SectionModel(data) { - var scope = this; - //命名 - this.name = null; - //code - this.code = null; - //索引位置 - this.index = null; - //轨迹点 - this.rail = []; - - this.railline = null; - //长度 - this.distance = []; - - this.isStandTrack = null; - - this.type = null; - //指向模型 - this.mesh = null; - // //模型地址 - // this.meshurl = null; - // //贴图地址 - // this.picurl = null; - -} diff --git a/src/jlmap3d/main/model/SignalList.js b/src/jlmap3d/main/model/SignalList.js deleted file mode 100644 index 68c3727d3..000000000 --- a/src/jlmap3d/main/model/SignalList.js +++ /dev/null @@ -1,113 +0,0 @@ -import {SignalModel} from '@/jlmap3d/main/model/SignalModel.js'; - -export function SignalList() { - - let scope = this; - - this.type = "signallist"; - - this.list = {}; - - this.group = new THREE.Group(); - - this.initpromise = function(data,scene,assetloader,netdata){ - return new Promise(function(resolve, reject){ - scope.group.name = "signal"; - //遍历信号数据 - let netsignal = null; - let haddata = false; - if(netdata){ - netsignal = JSON.parse(netdata); - haddata = true; - } - let selectmesh = null; - for(let j=0;j=0;n--){ - if(assetloader.modellist[n].deviceType == "train"){ - - selectmesh = assetloader.modellist[n].mesh - - ntracks1 = assetloader.modellist[n].animations.slice(16,27); - - tclip = new THREE.AnimationClip("three",2,ntracks1); - - ntracks2 = assetloader.modellist[n].animations.slice(0,15); - - fclip = new THREE.AnimationClip("four",2,ntracks2); - - n = 0; - } - } - //遍历列车数据 - // console.log(data.length); - for(let i=0;i=1;n--){ - // newmesh.children[n].position.x = -76; - // newmesh.children[n-1].add(newmesh.children[n]); - // } - //创建列车字牌 - if(mode){ - if(mode == "02"){ - let textgeometry = new THREE.PlaneBufferGeometry( 150, 100, 1 ); - let textt = new THREE.CanvasTexture(getTextCanvas(data[i])); - let textmaterial = new THREE.MeshBasicMaterial( { - side: THREE.DoubleSide, - map:textt ,transparent: true, - alphaTest:0.1 - } ); - let textplane = new THREE.Mesh( textgeometry, textmaterial ); - textplane.name = data[i].code; - textplane.position.x = 0; - textplane.position.y = 0; - textplane.position.z = 60; - textplane.tcode = data[i].code; - //textplane.rotation.x = Math.PI; - scope.textlist.push(textplane); - newmesh.children[0].add(textplane); - textgeometry.dispose(); - textmaterial.dispose(); - textt.dispose(); - } - } - - - - //group.add(textplane); - newmesh.first = false; - newmesh.name = data[i].code; - newmesh.rname = data[i].groupNumber; - newmesh.groupNumber = data[i].groupNumber; - - newmesh.position.set(0,-50000,0); - // newmesh.children[0].position.y = 0; - //newmesh.rotation.y = Math.PI/2; - newmesh.status = "00"; - newmesh.nowcode = null; - newmesh.curve = null; - newmesh.doorStatus = "01"; - newmesh.dispose = true; - newmesh.nowsection = null; - newmesh.nextsection = null; - newmesh.speed = 0; - newmesh.speeds = 0; - newmesh.progress = null; - newmesh.startmark = 0; - - - scope.list[data[i].code] = newmesh; - //scene.add(newmesh); - } - // console.log(selectmesh); - // for(let i=0,leni=selectmesh.children.length;i0.01){ - console.log(newsection.railpoint); closedSpline = new THREE.CatmullRomCurve3( [ new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z), new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[1].y,newsection.railpoint[1].z+0.001), @@ -110,9 +110,9 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){ ] ); }else{ closedSpline = new THREE.CatmullRomCurve3( [ - new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z), - new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[0].y,newsection.railpoint[1].z+0.001), - new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[0].y,newsection.railpoint[2].z) + new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[2].y,newsection.railpoint[0].z), + new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[2].y,newsection.railpoint[1].z+0.0015), + new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z) ] ); } @@ -123,18 +123,18 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){ closedSpline.tension = 0.15; closedSpline.closed = false; var extrudeSettings = { - steps : 6, - curveSegments : 1, - bevelSegments : 1, - bevelEnabled : false, - extrudePath : closedSpline, + steps : 6, + curveSegments : 1, + bevelSegments : 1, + bevelEnabled : false, + extrudePath : closedSpline, }; var shape = new THREE.Shape(); len = closedSpline.getLength(); - if(Math.abs(newsection.railpoint[0].y - newsection.railpoint[2].y)>0.001){ + if(Math.abs(newsection.railpoint[0].y - newsection.railpoint[2].y)>0.01){ shape.moveTo( -2, 0 ); shape.lineTo( 2, 0 ); }else{ diff --git a/src/jlmap3d/main/model/jl3ddata.js b/src/jlmap3d/main/newmodel/jl3ddata.js similarity index 100% rename from src/jlmap3d/main/model/jl3ddata.js rename to src/jlmap3d/main/newmodel/jl3ddata.js diff --git a/src/router/index_Common.js b/src/router/index_Common.js index 12b874aa7..a15745950 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -17,7 +17,6 @@ const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive'); const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation'); const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow'); const Jlmap3dModel = () => import('@/views/jlmap3d/device/jl3ddevice'); -const Jlmap3dTrain = () => import('@/views/jlmap3d/devicetrain/jl3ddevicetrain'); const Jlmap3dMaintainer = () => import('@/views/jlmap3d/maintainer/jl3dmaintainer'); const Jlmap3dMaintainerVr = () => import('@/views/jlmap3d/maintainer/jl3dmaintainervr'); const Jl3dTrainRescueVr = () => import('@/views/jlmap3d/maintainer/jl3dTrainRescueVr'); @@ -233,11 +232,6 @@ export const constantRoutes = [ component: Jlmap3dModel, hidden: true }, - { - path: '/gzzbxy/relay/:deviceid', // 贵阳 继电器 - component: Jlmap3dTrain, - hidden: true - }, { path: '/jlmap3d/maintainer', component: Jlmap3dMaintainer, diff --git a/src/router/index_HEB.js b/src/router/index_HEB.js index c35544df0..ccbe0c245 100644 --- a/src/router/index_HEB.js +++ b/src/router/index_HEB.js @@ -14,7 +14,6 @@ const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive'); const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation'); const Jlmap3dModel = () => import('@/views/jlmap3d/device/jl3ddevice'); const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow'); -const Jlmap3dTrain = () => import('@/views/jlmap3d/devicetrain/jl3ddevicetrain'); const DisplayNew = () => import('@/views/newMap/displayNew/index'); const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index'); @@ -184,11 +183,6 @@ export const constantRoutes = [ component: Jlmap3dPassFlow, hidden: true }, - { - path: '/jlmap3d/devicetrain', - component: Jlmap3dTrain, - hidden: true - }, { path: '/404', component: Errpr404, diff --git a/src/store/modules/map.js b/src/store/modules/map.js index b05d06c77..9633d0a7b 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -795,7 +795,7 @@ const map = { state.routeStartSignalData[data.startSignalCode] = [data]; } }); - state.map.automaticRouteButtonList && state.map.automaticRouteButtonList.forEach(item => { + state.map && state.map.automaticRouteButtonList && state.map.automaticRouteButtonList.forEach(item => { state.routeData[item.automaticRouteCode].automaticRouteCode = item.code; }); state.routeList = routeDataList; @@ -812,7 +812,7 @@ const map = { autoReentryList.forEach(data => { state.autoReentryData[data.code] = data; }); - state.map.cycleButtonList && state.map.cycleButtonList.forEach(item => { + state.map && state.map.cycleButtonList && state.map.cycleButtonList.forEach(item => { state.autoReentryData[item.cycleCode].cycleButtonCode = item.code; }); state.autoReentryList = autoReentryList; diff --git a/src/utils/loaddata.js b/src/utils/loaddata.js index c0bac5f53..594b1d12d 100644 --- a/src/utils/loaddata.js +++ b/src/utils/loaddata.js @@ -68,6 +68,10 @@ export function covertData(resp, type, resolve) { resolve(); }); }); + } else if (type == 'mapId') { + store.dispatch('map/setMapData', mapData).then(() => { + resolve(); + }); } const routeData = resp.data.logicDataNew.routeList; // 设置进路数据 diff --git a/src/views/iscs/iscsSystem/stationConfig/dialog/valve.vue b/src/views/iscs/iscsSystem/stationConfig/dialog/valve.vue index 6b050f4ff..b2acea2b0 100644 --- a/src/views/iscs/iscsSystem/stationConfig/dialog/valve.vue +++ b/src/views/iscs/iscsSystem/stationConfig/dialog/valve.vue @@ -128,18 +128,61 @@ export default { }, // 固定关联关系 模块变化 relevance() { - let model = {}; - // valve true 变绿 false 红色 - if (this.model.code == 'group_2' || this.model.code == 'group_52') { - model = this.$iscs.iscsDevice['group_23'].model; - model['valve'] = !(this.$iscs.iscsDevice['group_2'].model['valve'] || this.$iscs.iscsDevice['group_52'].model['valve']); - } else if (this.model.code == 'group_3' || this.model.code == 'group_16') { - model = this.$iscs.iscsDevice['group_15'].model; - model['valve'] = !(this.$iscs.iscsDevice['group_3'].model['valve'] || this.$iscs.iscsDevice['group_16'].model['valve']); + let time = 0; + let modelRelevance = {}; + if (this.model.code == 'group_2' && this.model['valve']) { + modelRelevance = this.$iscs.iscsDevice['group_34'].model; + modelRelevance['valve'] = this.model['valve']; + } else if (this.model.code == 'group_52' && this.model['valve']) { + modelRelevance = this.$iscs.iscsDevice['group_22'].model; + modelRelevance['valve'] = this.model['valve']; } - if (model && model.code) { - this.handleModel(model); + if (modelRelevance && modelRelevance.code) { + this.handleModel(modelRelevance); + time = 1500; } + setTimeout(() => { + let model = {}; + // valve true 变绿 false 红色 + if (this.model.code == 'group_2' || this.model.code == 'group_52') { + model = this.$iscs.iscsDevice['group_23'].model; + model['valve'] = !(this.$iscs.iscsDevice['group_2'].model['valve'] || this.$iscs.iscsDevice['group_52'].model['valve']); + } else if (this.model.code == 'group_3' || this.model.code == 'group_16') { + model = this.$iscs.iscsDevice['group_15'].model; + model['valve'] = !(this.$iscs.iscsDevice['group_3'].model['valve'] || this.$iscs.iscsDevice['group_16'].model['valve']); + } + if (model && model.code) { + this.handleModel(model); + time = 1500; + } + setTimeout(() => { + if (this.model.code == 'group_2' && !this.model['valve']) { + modelRelevance = this.$iscs.iscsDevice['group_34'].model; + modelRelevance['valve'] = this.model['valve']; + } else if (this.model.code == 'group_52' && !this.model['valve']) { + modelRelevance = this.$iscs.iscsDevice['group_22'].model; + modelRelevance['valve'] = this.model['valve']; + } + if (modelRelevance && modelRelevance.code) { + this.handleModel(modelRelevance); + } + if ((this.model.code == 'group_2' && this.model['valve']) || (this.model.code == 'group_52' && this.model['valve'])) { + const model1 = this.$iscs.iscsDevice['group_9'].model; + model1['valve'] = this.model['valve']; + const model2 = this.$iscs.iscsDevice['group_21'].model; + model2['valve'] = this.model['valve']; + const model3 = this.$iscs.iscsDevice['group_19'].model; + model3['valve'] = this.model['valve']; + const model4 = this.$iscs.iscsDevice['group_8'].model; + model4['valve'] = this.model['valve']; + this.handleModel(model1); + this.handleModel(model2); + this.handleModel(model3); + this.handleModel(model4); + } + }, time); + }, time); + }, // 执行操作 handleModel(model) { diff --git a/src/views/jlmap3d/devicetrain/component/devicetrainmenu.vue b/src/views/jlmap3d/devicetrain/component/devicetrainmenu.vue deleted file mode 100644 index 2dee7bbba..000000000 --- a/src/views/jlmap3d/devicetrain/component/devicetrainmenu.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - diff --git a/src/views/jlmap3d/devicetrain/jl3ddevicetrain.vue b/src/views/jlmap3d/devicetrain/jl3ddevicetrain.vue deleted file mode 100644 index 490451a74..000000000 --- a/src/views/jlmap3d/devicetrain/jl3ddevicetrain.vue +++ /dev/null @@ -1,559 +0,0 @@ - - - diff --git a/src/views/jlmap3d/jl3dassetmanager/component/modellist.vue b/src/views/jlmap3d/jl3dassetmanager/component/modellist.vue index a26b3d458..a4e92cc21 100644 --- a/src/views/jlmap3d/jl3dassetmanager/component/modellist.vue +++ b/src/views/jlmap3d/jl3dassetmanager/component/modellist.vue @@ -152,17 +152,13 @@ export default { handleDelete(index, row) { console.log(row); - deleteAsset(row.modelurl).then(netdata => { - console.log(netdata); deleteAssetData(row.id).then(netdata => { this.tableData.splice(index, 1); console.log(netdata); }).catch(error => { console.log(error); }); - }).catch(error => { - console.log(error); - }); + } } diff --git a/src/views/jlmap3d/maintainer/component/faultdevice.vue b/src/views/jlmap3d/maintainer/component/faultdevice.vue index 48f0fedf8..40d5259f1 100644 --- a/src/views/jlmap3d/maintainer/component/faultdevice.vue +++ b/src/views/jlmap3d/maintainer/component/faultdevice.vue @@ -9,11 +9,19 @@ {{switchshow}} --> -
-
-
+
+
+
-
+
@@ -53,6 +61,7 @@ }, data() { return { + localStatic:JL3D_LOCAL_STATIC, datastatus:"", jl3d: null, windowstatus:false, @@ -344,7 +353,6 @@ position: absolute; right:15px; bottom:5px; - background-image:url(JL3D_LOCAL_STATIC+"/texture/xiuli.png"); background-repeat:no-repeat; background-size:100%; } @@ -355,7 +363,6 @@ position: absolute; right:345px; bottom:5px; - background-image:url(JL3D_LOCAL_STATIC+"/texture/gousuodingwei.png"); background-repeat:no-repeat; background-size:100%; } @@ -366,7 +373,6 @@ position: absolute; right:180px; bottom:5px; - background-image:url(JL3D_LOCAL_STATIC+"/texture/gousuofanwei.png"); background-repeat:no-repeat; background-size:100%; } @@ -376,7 +382,6 @@ position: absolute; right:125px; top:5px; - background-image:url(JL3D_LOCAL_STATIC+"/texture/xx.png"); background-repeat:no-repeat; background-size:100%; } diff --git a/src/views/newMap/chatView/chatBox.vue b/src/views/newMap/chatView/chatBox.vue index a442f3983..3da6ad794 100644 --- a/src/views/newMap/chatView/chatBox.vue +++ b/src/views/newMap/chatView/chatBox.vue @@ -915,6 +915,7 @@ export default { this.conversitionStateMap[member.memberId] && this.conversitionStateMap[member.memberId].privateMessageList.push(data.message); }); } + // console.log(this.commonConversation, this.conversitionId, data.id, this.myMemberId, this.conversitionId === data.id, this.conversitionStateMap, '/////////////////////////'); if (this.commonConversation) { this.messageList.push(data.message); } else if (!this.commonConversation && this.conversitionId === data.id) { diff --git a/src/views/newMap/chatView/chatContent.vue b/src/views/newMap/chatView/chatContent.vue index 72f784098..94b343081 100644 --- a/src/views/newMap/chatView/chatContent.vue +++ b/src/views/newMap/chatView/chatContent.vue @@ -103,6 +103,12 @@ export default { } } } + }, + '$store.state.scriptRecord.audioPlay':function(val) { + this.isPlay = val; + if (!val) { + this.currentAudioList = []; + } } }, mounted() { diff --git a/src/views/newMap/displayNew/demonMenu.vue b/src/views/newMap/displayNew/demonMenu.vue index b1aeb7bed..942012345 100644 --- a/src/views/newMap/displayNew/demonMenu.vue +++ b/src/views/newMap/displayNew/demonMenu.vue @@ -6,16 +6,16 @@ - {{ jl3dmodel }} - - {{ jl3dname }} + {{ jl3dmodel }} + + {{ jl3dname }} - {{ jl3dpassflow }} + {{ jl3dpassflow }} 故障设备 - {{ $t('joinTraining.driverPerspective') }} + 司机视角 派班计划加载 派班计划预览 diff --git a/src/views/newMap/displayNew/dispatherContest/index.vue b/src/views/newMap/displayNew/dispatherContest/index.vue index c156b3d0c..eece5d30f 100644 --- a/src/views/newMap/displayNew/dispatherContest/index.vue +++ b/src/views/newMap/displayNew/dispatherContest/index.vue @@ -395,6 +395,7 @@ export default { handleQuitQuest() { competitionPracticalSceneExit(this.group).then(resp => { getSimulationInfoNew(this.group).then((res)=>{ + this.$store.dispatch('scriptRecord/updateAudioPlay', false); EventBus.$emit('quitScene'); this.$store.dispatch('scriptRecord/updateOperationalItemVOs', {}); this.quitQuest(); @@ -481,6 +482,7 @@ export default { // this.formatScore = res.data; // this. this.showResultData(res.data); + // this.$store.dispatch('scriptRecord/updateAudioPlay', false); // this.$messageBox('得分:' + this.formatScore); // } // this.userRole = 'AUDIENCE'; @@ -491,6 +493,7 @@ export default { }); }, startTraining() { + this.$store.dispatch('scriptRecord/updateAudioPlay', false); let userRole = 'AUDIENCE'; if (this.$route.query.prdType) { if (this.$route.query.prdType == '02') { diff --git a/src/views/newMap/displayNew/dispatherContest/theoryExam.vue b/src/views/newMap/displayNew/dispatherContest/theoryExam.vue index 1bda55faf..75d7932c2 100644 --- a/src/views/newMap/displayNew/dispatherContest/theoryExam.vue +++ b/src/views/newMap/displayNew/dispatherContest/theoryExam.vue @@ -155,7 +155,7 @@ export default { currentMode = '02'; } this.mode = type; - getItemListByProjectCode('drts', {mode:currentMode}).then(res=>{ + getItemListByProjectCode('DRTS', {mode:currentMode}).then(res=>{ this.questionList = res.data; if (this.isTest) { this.questionList.forEach((question, index)=>{ @@ -163,7 +163,7 @@ export default { }); } if (this.mode == 'practice') { - getPracticeQuestionProgress('drts').then(res=>{ + getPracticeQuestionProgress('DRTS').then(res=>{ this.currentQuestionNum = res.data.questionIndex; this.loading = false; }).catch(error=>{ @@ -287,7 +287,7 @@ export default { }, submitConfirmExam(submitData) { this.loading = true; - submitPracticeQuestionData('drts', {mode:'02', theoryAnswers:submitData}).then(res=>{ + submitPracticeQuestionData('DRTS', {mode:'02', theoryAnswers:submitData}).then(res=>{ this.loading = false; this.isResult = true; this.$message.success('提交成功'); @@ -369,7 +369,7 @@ export default { } } this.isSelect = true; - updatePracticeQuestionProgress('drts', {index:this.currentQuestionNum}).then(res=>{ + updatePracticeQuestionProgress('DRTS', {index:this.currentQuestionNum}).then(res=>{ }).catch(error=>{ console.log(error.message); }); diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index 58078885f..f949cbdc0 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -181,6 +181,7 @@ export default { } else { this.userRole = 'AUDIENCE'; } + console.log(this.$route.query.prdType, '======='); }, beforeDestroy() { if (this.time) { diff --git a/src/views/planMonitor/editToolAUS/index.vue b/src/views/planMonitor/editToolAUS/index.vue index 280dd8b60..0d2cf61a3 100644 --- a/src/views/planMonitor/editToolAUS/index.vue +++ b/src/views/planMonitor/editToolAUS/index.vue @@ -417,9 +417,9 @@ export default { }, doRemoveService() { if (this.selected) { - this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm('This operation will permanently delete the data. Do you want to continue?', 'Tips', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { delRpService(this.selected.serviceNo).then(resp => { @@ -435,9 +435,9 @@ export default { }, doRemoveTrip() { if (this.selected) { - this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm('This operation will permanently delete the data. Do you want to continue?', 'Tips', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { @@ -454,9 +454,9 @@ export default { }, doRemoveArea() { if (this.target) { - this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + this.$confirm('This operation will permanently delete the data. Do you want to continue?', 'Tips', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', type: 'warning' }).then(() => { const data = this.target.model; diff --git a/src/views/planMonitor/editToolAUS/monitor.js b/src/views/planMonitor/editToolAUS/monitor.js index 8b9c3750a..7f7efe578 100644 --- a/src/views/planMonitor/editToolAUS/monitor.js +++ b/src/views/planMonitor/editToolAUS/monitor.js @@ -15,6 +15,10 @@ export default { endKmRange: 0, endTime: 0 }, + offset: { + _x: 0, + _y: 0, + }, selected: null, target: null, drag: null, @@ -30,7 +34,7 @@ export default { this.listenersOff(); }, methods: { - pixelExecCb(e, cb) { + pixelExecCb(e, cb=e => {}) { const event = e.componentType ? e.event: e; const pointInPixel = [event.offsetX, event.offsetY] const pointInGrid = this.myChart.convertFromPixel('grid', pointInPixel); @@ -42,7 +46,7 @@ export default { const minY = option.yAxis[0].min; const xVal = option.xAxis[0].data[xIndex]; const yObj = this.planUtil.getStationByCoordinateY(this.stations, yIndex-minY); - if (yObj && cb) { + if (yObj) { cb({yObj, xVal, pointInPixel, pointInGrid, e}); } } @@ -55,10 +59,9 @@ export default { zr.on('mousedown', this.onZrMouseDown, this); zr.on('mouseup', this.onZrMouseUp, this); zr.on('mouseout', this.onZrMouseOut, this); - this.myChart.on('mousedown', this.onMouseDown); + this.myChart.on('click', this.onMouseClick); this.myChart.on('mouseover', this.onMouseOver); this.myChart.on('mouseout', this.onMouseOut); - this.myChart.on('mouseup', this.onMouseUP); this.myChart.on('datazoom', this.onUpdateZoom); window.addEventListener('resize', this.onUpdateZoom); } @@ -71,10 +74,9 @@ export default { zr.off('mousedown', this.onZrMouseDown, this); zr.off('mouseup', this.onZrMouseUp, this); zr.off('mouseout', this.onZrMouseOut, this); - this.myChart.off('mousedown', this.onMouseDown); + this.myChart.off('click', this.onMouseClick); this.myChart.off('mouseover', this.onMouseOver); this.myChart.off('mouseout', this.onMouseOut); - this.myChart.off('mouseup', this.onMouseUP); this.myChart.off('datazoom', this.onUpdateZoom); window.removeEventListener('resize', this.onUpdateZoom); } @@ -174,7 +176,7 @@ export default { } }); }, - onMouseDown(e) { + onMouseClick(e) { this.pixelExecCb(e, args => { if (this.model.choice == 'Plan') { this.doSetSelected(args); @@ -184,8 +186,6 @@ export default { } }); }, - onMouseUP(e) { - }, onMouseOut(e) { this.pixelExecCb(e, args => { if (this.model.choice == 'Plan') { @@ -310,25 +310,21 @@ export default { }, doSetDrag({e, pointInGrid}) { if (e.target && ['drag'].includes(e.target.subType)) { - this.dragging = false; - this.drag = e.target; - this.drag.model._x = pointInGrid[0]; - this.drag.model._y = pointInGrid[1]; + this.offset.x = pointInGrid[0]; + this.offset.y = pointInGrid[1]; } }, doSetTarget({e, pointInGrid}) { if (e.target && ['area'].includes(e.target.subType)) { - this.dragging = false; - if (this.target && this.target.model.areaNo != e.target.model.areaNo) { this.setTargetReset(); } this.target = e.target; - this.target.model._x = pointInGrid[0]; - this.target.model._y = pointInGrid[1]; + this.offset.x = pointInGrid[0]; + this.offset.y = pointInGrid[1]; this.$emit('tag', e.target); @@ -339,7 +335,6 @@ export default { if (e.componentType == "series" && e.componentSubType == "line" && e.seriesName.includes('service')) { - this.dragging = false; const value = e.value; const option = this.myChart.getOption(); @@ -377,6 +372,9 @@ export default { const obj =dataList[e.dataIndex][2]; + + this.offset.x = pointInGrid[0]; + this.offset.y = pointInGrid[1]; this.selected = { stationIndex: this.stations.findIndex(el => { return el.code == obj.stationCode; }), dataIndex: e.dataIndex, @@ -386,10 +384,6 @@ export default { depTime: e.dataIndex < length - 1? next[0] - value[0]: 0, runTime: e.dataIndex < length - 1? next[0] - value[0]: 0, ... value[2], - _x: pointInGrid[0], - _y: pointInGrid[1], - dx: 0, - dy: 0, time: 0, kmRange: 0 } @@ -402,12 +396,11 @@ export default { doSetAreaTranslate({e}) { if (e.target && ['area'].includes(e.target.subType)) { const option = this.myChart.getOption(); - const model = e.target.model; - const graph = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); + const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == e.target.model.areaNo; }); - graph.z = 90; - graph.draggable = true; - graph.ondrag = echarts.util.curry(this.onShapeDragging); + elem.z = 90; + elem.draggable = true; + elem.ondrag = echarts.util.curry(this.onShapeDragging); this.myChart.setOption(option, {notMerge: true}); } @@ -415,11 +408,10 @@ export default { doSetAreaHorns({e}) { if (e.target && ['area'].includes(e.target.subType)) { const option = this.myChart.getOption(); - const model = e.target.model; const elemList = option.graphic[0].elements.filter(el => { return !['drag'].includes(el.subType) }); - const graph = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); + const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == e.target.model.areaNo; }); - option.graphic[0].elements = this.calcHornList(elemList, graph); + option.graphic[0].elements = this.calcHornList(elemList, elem); this.myChart.setOption(option, {notMerge: true}); } }, @@ -463,152 +455,159 @@ export default { doSeriesDragging({e, pointInGrid}) { if (this.selected) { this.dragging = true; - this.selected.dx = pointInGrid[0] - this.selected._x; - this.selected.dy = pointInGrid[1] - this.selected._y; - this.selected._x = pointInGrid[0]; - this.selected._y = pointInGrid[1]; - this.selected.time += this.selected.dx; - this.selected.kmRange += this.selected.dy; - - const option = this.myChart.getOption(); - const model = option.series[this.selected.seriesIndex] - - model.data.forEach(el => { - if (el instanceof Array) { - el[0] += this.selected.dx; - } else { - el.value[0] += this.selected.dx; - } - }); - - model.markPoint.data.forEach(el => { - el.coord[0] += this.selected.dx; - }) - - if (e.target && - e.target.point && - e.target.position) { - e.target.point[0] += this.selected.dx; - } - - this.myChart.setOption(option, {notMerge: true}); + this.calcSeriesDragging({e, pointInGrid}); } }, doAreaDragging({e, pointInGrid}) { if (this.target && ['area'].includes(this.target.subType)) { this.dragging = true; - const target = this.target; - const model = target.model; - - if (model._x == undefined || model._y == undefined) { - model._x = pointInGrid[0]; - model._y = pointInGrid[1]; - } - - const dx = pointInGrid[0] - model._x; - const dy = pointInGrid[1] - model._y; - - model._x = pointInGrid[0]; - model._y = pointInGrid[1]; - - model.startTime += dx; - model.endTime += dx; - model.fartherKmRange += dy; - model.closerKmRange += dy; - - if (this.planUtil.limitAreaKmRange(this.stations, model)) { - this.onZrMouseUp(e); - } + this.calcAreaDragging({e, pointInGrid}); } }, doAreaHornDragging({e, pointInGrid}) { if (this.drag && ['drag'].includes(this.drag.subType)) { this.dragging = true; - const option = this.myChart.getOption(); - const drag = this.drag; - const target = this.target; - const model = target.model; + this.calcHornDragging({e, pointInGrid}); + } + }, + doTranslateSeries({e, pointInGrid}) { + if (this.dragging) { + this.dragging = false; + this.calcSeriesDragging({e, pointInGrid}); + this.$emit('translate'); + } + }, + doTranslateArea({e, pointInGrid}) { + if (this.dragging) { + this.dragging = false; + this.calcAreaDragging({e, pointInGrid}); + this.$emit('translate'); + } + }, + doTranslateHorn({e, pointInGrid}) { + if (this.dragging) { + this.dragging = false; + this.calcHornDragging({e, pointInGrid}); + this.$emit('translate'); + } + }, + calcSeriesDragging({e, pointInGrid}) { + const offset = this.offset; + const dx =pointInGrid[0] - offset.x; - const elements = option.graphic[0].elements.filter(el => { return ['drag'].includes(el.subType) }); - const index = elements.findIndex(el => { return drag.name == el.name; }); + offset.x = pointInGrid[0]; + offset.y = pointInGrid[1]; + this.selected.time += dx; - model._x = pointInGrid[0]; - model._y = pointInGrid[1]; + const option = this.myChart.getOption(); + const series = option.series[this.selected.seriesIndex] - const time = pointInGrid[0]; - const kmRange = this.planUtil.getKmRangeByCoordinateY(pointInGrid[1]); - - switch(index) { - case 0: - if (time < model.endTime) { - model.startTime = time; - } - if (model.closerKmRange < kmRange) { - model.fartherKmRange = kmRange; - } - break; - case 1: - if (model.startTime < time) { - model.endTime = time; - } - if (model.closerKmRange < kmRange) { - model.fartherKmRange = kmRange; - } - break; - case 2: - if (model.startTime < time) { - model.endTime = time; - } - if (kmRange < model.fartherKmRange) { - model.closerKmRange = kmRange; - } - break; - case 3: - if (time < model.endTime) { - model.startTime = time; - } - if (kmRange < model.fartherKmRange) { - model.closerKmRange = kmRange; - } - break; + series.data.forEach(el => { + if (el instanceof Array) { + el[0] += dx; + } else { + el.value[0] += dx; } + }); - if (this.planUtil.limitAreaKmRange(this.stations, model)) { - this.onZrMouseUp(e); - } + series.markPoint.data.forEach(el => { + el.coord[0] += dx; + }) - const args = this.planUtil.calcAreaArgsByModel(this.myChart, model); - const elemList = option.graphic[0].elements.filter(el => { return !['drag'].includes(el.subType) }); - const graph = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); + if (e.target && + e.target.point && + e.target.position) { + e.target.point[0] += dx; + } - graph.position = args.position; - graph.point1 = args.point1; - graph.point2 = args.point2; - graph.shape.width = args.width; - graph.shape.height = args.height; - graph.style.textOffset = [ -args.width/2, -args.height/2 ]; + this.myChart.setOption(option, {notMerge: true}); + }, + calcAreaDragging({e, pointInGrid}) { + const model = this.target.model; + const offset = this.offset; - option.graphic[0].elements = this.calcHornList(elemList, graph); - this.myChart.setOption(option, {notMerge: true}); + const dx = pointInGrid[0] - offset.x; + const dy = pointInGrid[1] - offset.y; + + offset.x = pointInGrid[0]; + offset.y = pointInGrid[1]; + + model.startTime += dx; + model.endTime += dx; + model.fartherKmRange += dy; + model.closerKmRange += dy; + + if (this.planUtil.limitAreaKmRange(this.stations, model)) { + this.onZrMouseUp(e); } }, - doTranslateSeries({e}) { - if (this.dragging) { - this.dragging = false; - this.$emit('translate'); + calcHornDragging({e, pointInGrid}) { + const option = this.myChart.getOption(); + const drag = this.drag; + const offset = this.offset; + const model = this.target.model; + + const elements = option.graphic[0].elements.filter(el => { return ['drag'].includes(el.subType) }); + const index = elements.findIndex(el => { return drag.name == el.name; }); + + offset.x = pointInGrid[0]; + offset.y = pointInGrid[1]; + + const time = pointInGrid[0]; + const kmRange = this.planUtil.getKmRangeByCoordinateY(pointInGrid[1]); + + switch(index) { + case 0: + if (time < model.endTime) { + model.startTime = time; + } + if (model.closerKmRange < kmRange) { + model.fartherKmRange = kmRange; + } + break; + case 1: + if (model.startTime < time) { + model.endTime = time; + } + if (model.closerKmRange < kmRange) { + model.fartherKmRange = kmRange; + } + break; + case 2: + if (model.startTime < time) { + model.endTime = time; + } + if (kmRange < model.fartherKmRange) { + model.closerKmRange = kmRange; + } + break; + case 3: + if (time < model.endTime) { + model.startTime = time; + } + if (kmRange < model.fartherKmRange) { + model.closerKmRange = kmRange; + } + break; } - }, - doTranslateArea({e}) { - if (this.dragging) { - this.dragging = false; - this.$emit('translate'); - } - }, - doTranslateHorn({e}) { - if (this.dragging) { - this.dragging = false; - this.$emit('translate'); + + if (this.planUtil.limitAreaKmRange(this.stations, model)) { + this.onZrMouseUp(e); } + + const args = this.planUtil.calcAreaArgsByModel(this.myChart, model); + const elemList = option.graphic[0].elements.filter(el => { return !['drag'].includes(el.subType) }); + const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); + + elem.position = args.position; + elem.point1 = args.point1; + elem.point2 = args.point2; + elem.shape.width = args.width; + elem.shape.height = args.height; + elem.style.textOffset = [ -args.width/2, -args.height/2 ]; + + option.graphic[0].elements = this.calcHornList(elemList, elem); + this.myChart.setOption(option, {notMerge: true}); } } } diff --git a/src/views/planMonitor/editToolAUS/schedule.vue b/src/views/planMonitor/editToolAUS/schedule.vue index 785b079c4..e19e6dc44 100644 --- a/src/views/planMonitor/editToolAUS/schedule.vue +++ b/src/views/planMonitor/editToolAUS/schedule.vue @@ -268,24 +268,27 @@ export default { this.pushModels(option.series, [this.planUtil.initializeYaxis(this.stations)]); this.pushModels(option.series, this.planUtil.parseDataToSeries(this.myChart, planData, this.stations)); this.pushModels(option.graphic[0].elements, this.planUtil.parseDataToGraph(this.myChart, planData, this.stations)); - if (this.model.choice == 'Construction') { - const target = this.target; - const elemList = option.graphic[0].elements.filter(el => { return el.subType == 'area'}); + + const elemList = option.graphic[0].elements.filter(el => { return el.subType == 'area'}); + elemList.forEach(el => { + el.draggable = false; + el.ondrag = echarts.util.curry(this.onShapeDragging); + }); + + if (this.model.choice == 'Construction' && this.target) { elemList.forEach(el => { - el.draggable = false; - el.ondrag = echarts.util.curry(this.onShapeDragging); if (this.model.action == 'Translate' && - target && - target.model.areaNo == el.model.areaNo) { + this.target.model && + this.target.model.areaNo == el.model.areaNo) { el.draggable = true; } }) - if (this.model.action == 'Edit' && target) { - const model = target.model; + if (this.model.action == 'Edit' && + this.target.model) { const elemList = option.graphic[0].elements.filter(el => { return !['drag'].includes(el.subType) }); - const graph = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); - option.graphic[0].elements = this.calcHornList(elemList, graph); + const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == this.target.model.areaNo; }); + option.graphic[0].elements = this.calcHornList(elemList, elem); } } @@ -397,10 +400,10 @@ export default { setTargetLight() { if (this.target) { const option = this.myChart.getOption(); - const model = this.target.model; - const graph = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); - if (graph) { - graph.style.fill = 'rgb(255,0,0, 0.6)'; + const model =this.target.model; + const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); + if (elem) { + elem.style.fill = 'rgb(255,0,0, 0.6)'; } this.myChart.setOption({graphic: option.graphic}); } @@ -408,10 +411,10 @@ export default { setTargetReset() { if (this.target) { const option = this.myChart.getOption(); - const model = this.target.model; - const graph = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); - if (graph) { - graph.style.fill = 'rgb(255,0,0, 0.3)'; + const model = this.target.model; + const elem = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; }); + if (elem) { + elem.style.fill = 'rgb(255,0,0, 0.3)'; } this.myChart.setOption({graphic: option.graphic}); } @@ -441,10 +444,10 @@ export default { option.graphic[0].elements = elements.filter(el => { return !labels.includes(el.subType)}); this.myChart.setOption(option, {notMerge: true}); }, - calcHornList(elemList, graph) { - const p = graph.position; - const w = graph.shape.width; - const h = graph.shape.height; + calcHornList(elemList, elem) { + const p = elem.position; + const w = elem.shape.width; + const h = elem.shape.height; const point1 = [p[0], p[1]]; const point2 = [p[0]+w, p[1]]; const point3 = [p[0]+w, p[1]+h]; diff --git a/static/MODEL/jdq/jdq1000.FBX b/static/MODEL/jdq/jdq1000.FBX deleted file mode 100644 index 5b4d80f5c..000000000 Binary files a/static/MODEL/jdq/jdq1000.FBX and /dev/null differ diff --git a/static/MODEL/jdq/jdq135.FBX b/static/MODEL/jdq/jdq135.FBX deleted file mode 100644 index 603e96ba5..000000000 Binary files a/static/MODEL/jdq/jdq135.FBX and /dev/null differ diff --git a/static/MODEL/jdq/jdq1700.FBX b/static/MODEL/jdq/jdq1700.FBX deleted file mode 100644 index 866178ea3..000000000 Binary files a/static/MODEL/jdq/jdq1700.FBX and /dev/null differ diff --git a/static/MODEL/jdq/jdq480.FBX b/static/MODEL/jdq/jdq480.FBX deleted file mode 100644 index d096f7a51..000000000 Binary files a/static/MODEL/jdq/jdq480.FBX and /dev/null differ diff --git a/static/MODEL/jdq/jdqH125.FBX b/static/MODEL/jdq/jdqH125.FBX deleted file mode 100644 index 52bfb7812..000000000 Binary files a/static/MODEL/jdq/jdqH125.FBX and /dev/null differ diff --git a/static/MODEL/jdq/jdqg.FBX b/static/MODEL/jdq/jdqg.FBX deleted file mode 100644 index 1db4f543d..000000000 Binary files a/static/MODEL/jdq/jdqg.FBX and /dev/null differ diff --git a/static/MODEL/jdq/jdqh18.FBX b/static/MODEL/jdq/jdqh18.FBX deleted file mode 100644 index c5bba70a1..000000000 Binary files a/static/MODEL/jdq/jdqh18.FBX and /dev/null differ diff --git a/static/MODEL/suidao/0820xinhaoding.png b/static/MODEL/suidao/0820xinhaoding.png deleted file mode 100644 index a635cbeaf..000000000 Binary files a/static/MODEL/suidao/0820xinhaoding.png and /dev/null differ diff --git a/static/MODEL/suidao/fengkou.png b/static/MODEL/suidao/fengkou.png deleted file mode 100644 index e8f162c59..000000000 Binary files a/static/MODEL/suidao/fengkou.png and /dev/null differ diff --git a/static/MODEL/suidao/guanggaopai820.png b/static/MODEL/suidao/guanggaopai820.png deleted file mode 100644 index e278c2625..000000000 Binary files a/static/MODEL/suidao/guanggaopai820.png and /dev/null differ diff --git a/static/MODEL/suidao/hebsuidao.FBX b/static/MODEL/suidao/hebsuidao.FBX deleted file mode 100644 index 97e9798a7..000000000 Binary files a/static/MODEL/suidao/hebsuidao.FBX and /dev/null differ diff --git a/static/MODEL/suidao/suidao.FBX b/static/MODEL/suidao/suidao.FBX deleted file mode 100644 index 665e67b82..000000000 Binary files a/static/MODEL/suidao/suidao.FBX and /dev/null differ diff --git a/static/texture/heb/Station11094.jpg b/static/texture/heb/Station11094.jpg deleted file mode 100644 index a153b8959..000000000 Binary files a/static/texture/heb/Station11094.jpg and /dev/null differ diff --git a/static/texture/heb/Station11136.jpg b/static/texture/heb/Station11136.jpg deleted file mode 100644 index f9171fbf5..000000000 Binary files a/static/texture/heb/Station11136.jpg and /dev/null differ diff --git a/static/texture/heb/Station17293.jpg b/static/texture/heb/Station17293.jpg deleted file mode 100644 index e95024ce1..000000000 Binary files a/static/texture/heb/Station17293.jpg and /dev/null differ diff --git a/static/texture/heb/Station18398.jpg b/static/texture/heb/Station18398.jpg deleted file mode 100644 index 01281241e..000000000 Binary files a/static/texture/heb/Station18398.jpg and /dev/null differ diff --git a/static/texture/heb/Station22163.jpg b/static/texture/heb/Station22163.jpg deleted file mode 100644 index a2e170622..000000000 Binary files a/static/texture/heb/Station22163.jpg and /dev/null differ diff --git a/static/texture/heb/Station25464.jpg b/static/texture/heb/Station25464.jpg deleted file mode 100644 index 912503a6a..000000000 Binary files a/static/texture/heb/Station25464.jpg and /dev/null differ diff --git a/static/texture/heb/Station28090.jpg b/static/texture/heb/Station28090.jpg deleted file mode 100644 index b6b517cc5..000000000 Binary files a/static/texture/heb/Station28090.jpg and /dev/null differ diff --git a/static/texture/heb/Station41999.jpg b/static/texture/heb/Station41999.jpg deleted file mode 100644 index 98d353b8e..000000000 Binary files a/static/texture/heb/Station41999.jpg and /dev/null differ diff --git a/static/texture/heb/Station44338.jpg b/static/texture/heb/Station44338.jpg deleted file mode 100644 index 0d30b550c..000000000 Binary files a/static/texture/heb/Station44338.jpg and /dev/null differ diff --git a/static/texture/heb/Station46464.jpg b/static/texture/heb/Station46464.jpg deleted file mode 100644 index 61440d4a1..000000000 Binary files a/static/texture/heb/Station46464.jpg and /dev/null differ diff --git a/static/texture/heb/Station50565.jpg b/static/texture/heb/Station50565.jpg deleted file mode 100644 index cff1fc865..000000000 Binary files a/static/texture/heb/Station50565.jpg and /dev/null differ diff --git a/static/texture/heb/Station5361.jpg b/static/texture/heb/Station5361.jpg deleted file mode 100644 index 059cae0b3..000000000 Binary files a/static/texture/heb/Station5361.jpg and /dev/null differ diff --git a/static/texture/heb/Station60068.jpg b/static/texture/heb/Station60068.jpg deleted file mode 100644 index 74cdbafcc..000000000 Binary files a/static/texture/heb/Station60068.jpg and /dev/null differ diff --git a/static/texture/heb/Station62429.jpg b/static/texture/heb/Station62429.jpg deleted file mode 100644 index a2398c7ba..000000000 Binary files a/static/texture/heb/Station62429.jpg and /dev/null differ diff --git a/static/texture/heb/Station64444.jpg b/static/texture/heb/Station64444.jpg deleted file mode 100644 index ce7e12f6c..000000000 Binary files a/static/texture/heb/Station64444.jpg and /dev/null differ diff --git a/static/texture/heb/Station71700.jpg b/static/texture/heb/Station71700.jpg deleted file mode 100644 index 6771f3e67..000000000 Binary files a/static/texture/heb/Station71700.jpg and /dev/null differ diff --git a/static/texture/heb/Station72132.jpg b/static/texture/heb/Station72132.jpg deleted file mode 100644 index fd35c8552..000000000 Binary files a/static/texture/heb/Station72132.jpg and /dev/null differ diff --git a/static/texture/heb/Station78164.jpg b/static/texture/heb/Station78164.jpg deleted file mode 100644 index 91f07f8d9..000000000 Binary files a/static/texture/heb/Station78164.jpg and /dev/null differ diff --git a/static/texture/heb/Station79537.jpg b/static/texture/heb/Station79537.jpg deleted file mode 100644 index 163a36183..000000000 Binary files a/static/texture/heb/Station79537.jpg and /dev/null differ diff --git a/static/texture/heb/Station82618.jpg b/static/texture/heb/Station82618.jpg deleted file mode 100644 index 3e11ddebe..000000000 Binary files a/static/texture/heb/Station82618.jpg and /dev/null differ diff --git a/static/texture/heb/Station85520.jpg b/static/texture/heb/Station85520.jpg deleted file mode 100644 index 04e0b0e4b..000000000 Binary files a/static/texture/heb/Station85520.jpg and /dev/null differ diff --git a/static/texture/heb/Station89483.jpg b/static/texture/heb/Station89483.jpg deleted file mode 100644 index c67b4c94f..000000000 Binary files a/static/texture/heb/Station89483.jpg and /dev/null differ diff --git a/static/texture/heb/Station96090.jpg b/static/texture/heb/Station96090.jpg deleted file mode 100644 index eba8f84a3..000000000 Binary files a/static/texture/heb/Station96090.jpg and /dev/null differ diff --git a/static/texture/heb/devicelist.jpg b/static/texture/heb/devicelist.jpg deleted file mode 100644 index f39912fa9..000000000 Binary files a/static/texture/heb/devicelist.jpg and /dev/null differ diff --git a/static/texture/heb/haerbinlist.jpg b/static/texture/heb/haerbinlist.jpg deleted file mode 100644 index d6a468721..000000000 Binary files a/static/texture/heb/haerbinlist.jpg and /dev/null differ diff --git a/static/texture/heb/haerbinlistold.jpg b/static/texture/heb/haerbinlistold.jpg deleted file mode 100644 index a0f4d965d..000000000 Binary files a/static/texture/heb/haerbinlistold.jpg and /dev/null differ diff --git a/static/texture/heb/kongbai.jpg b/static/texture/heb/kongbai.jpg deleted file mode 100644 index 2713c81db..000000000 Binary files a/static/texture/heb/kongbai.jpg and /dev/null differ diff --git a/static/texture/heb/pingbimen.png b/static/texture/heb/pingbimen.png deleted file mode 100644 index c059bcba7..000000000 Binary files a/static/texture/heb/pingbimen.png and /dev/null differ diff --git a/static/texture/nb1/Station11231.jpg b/static/texture/nb1/Station11231.jpg deleted file mode 100644 index a0d813bd1..000000000 Binary files a/static/texture/nb1/Station11231.jpg and /dev/null differ diff --git a/static/texture/nb1/Station12421.jpg b/static/texture/nb1/Station12421.jpg deleted file mode 100644 index 4a1e8358a..000000000 Binary files a/static/texture/nb1/Station12421.jpg and /dev/null differ diff --git a/static/texture/nb1/Station1533.jpg b/static/texture/nb1/Station1533.jpg deleted file mode 100644 index 6e7653038..000000000 Binary files a/static/texture/nb1/Station1533.jpg and /dev/null differ diff --git a/static/texture/nb1/Station16356.jpg b/static/texture/nb1/Station16356.jpg deleted file mode 100644 index afc0c2d7a..000000000 Binary files a/static/texture/nb1/Station16356.jpg and /dev/null differ diff --git a/static/texture/nb1/Station18678.jpg b/static/texture/nb1/Station18678.jpg deleted file mode 100644 index 8c822ec9d..000000000 Binary files a/static/texture/nb1/Station18678.jpg and /dev/null differ diff --git a/static/texture/nb1/Station19817.jpg b/static/texture/nb1/Station19817.jpg deleted file mode 100644 index 27dbdac71..000000000 Binary files a/static/texture/nb1/Station19817.jpg and /dev/null differ diff --git a/static/texture/nb1/Station23567.jpg b/static/texture/nb1/Station23567.jpg deleted file mode 100644 index 91cb44621..000000000 Binary files a/static/texture/nb1/Station23567.jpg and /dev/null differ diff --git a/static/texture/nb1/Station24903.jpg b/static/texture/nb1/Station24903.jpg deleted file mode 100644 index 07b82a170..000000000 Binary files a/static/texture/nb1/Station24903.jpg and /dev/null differ diff --git a/static/texture/nb1/Station26416.jpg b/static/texture/nb1/Station26416.jpg deleted file mode 100644 index 6fecb3331..000000000 Binary files a/static/texture/nb1/Station26416.jpg and /dev/null differ diff --git a/static/texture/nb1/Station27207.jpg b/static/texture/nb1/Station27207.jpg deleted file mode 100644 index f2ca22796..000000000 Binary files a/static/texture/nb1/Station27207.jpg and /dev/null differ diff --git a/static/texture/nb1/Station28032.jpg b/static/texture/nb1/Station28032.jpg deleted file mode 100644 index 3bc6ef91a..000000000 Binary files a/static/texture/nb1/Station28032.jpg and /dev/null differ diff --git a/static/texture/nb1/Station28958.jpg b/static/texture/nb1/Station28958.jpg deleted file mode 100644 index dfcd0a6f3..000000000 Binary files a/static/texture/nb1/Station28958.jpg and /dev/null differ diff --git a/static/texture/nb1/Station30520.jpg b/static/texture/nb1/Station30520.jpg deleted file mode 100644 index d254b1f0a..000000000 Binary files a/static/texture/nb1/Station30520.jpg and /dev/null differ diff --git a/static/texture/nb1/Station32955.jpg b/static/texture/nb1/Station32955.jpg deleted file mode 100644 index 88d659ced..000000000 Binary files a/static/texture/nb1/Station32955.jpg and /dev/null differ diff --git a/static/texture/nb1/Station38286.jpg b/static/texture/nb1/Station38286.jpg deleted file mode 100644 index 4fca253a2..000000000 Binary files a/static/texture/nb1/Station38286.jpg and /dev/null differ diff --git a/static/texture/nb1/Station38674.jpg b/static/texture/nb1/Station38674.jpg deleted file mode 100644 index 57e06da7a..000000000 Binary files a/static/texture/nb1/Station38674.jpg and /dev/null differ diff --git a/static/texture/nb1/Station44173.jpg b/static/texture/nb1/Station44173.jpg deleted file mode 100644 index 298f3788d..000000000 Binary files a/static/texture/nb1/Station44173.jpg and /dev/null differ diff --git a/static/texture/nb1/Station63100.jpg b/static/texture/nb1/Station63100.jpg deleted file mode 100644 index 5ad5043ec..000000000 Binary files a/static/texture/nb1/Station63100.jpg and /dev/null differ diff --git a/static/texture/nb1/Station69378.jpg b/static/texture/nb1/Station69378.jpg deleted file mode 100644 index 0bb07f545..000000000 Binary files a/static/texture/nb1/Station69378.jpg and /dev/null differ diff --git a/static/texture/nb1/Station72310.jpg b/static/texture/nb1/Station72310.jpg deleted file mode 100644 index 6037427ed..000000000 Binary files a/static/texture/nb1/Station72310.jpg and /dev/null differ diff --git a/static/texture/nb1/Station72764.jpg b/static/texture/nb1/Station72764.jpg deleted file mode 100644 index ff6e2fc4c..000000000 Binary files a/static/texture/nb1/Station72764.jpg and /dev/null differ diff --git a/static/texture/nb1/Station75414.jpg b/static/texture/nb1/Station75414.jpg deleted file mode 100644 index bb54f6ea9..000000000 Binary files a/static/texture/nb1/Station75414.jpg and /dev/null differ diff --git a/static/texture/nb1/Station75494.jpg b/static/texture/nb1/Station75494.jpg deleted file mode 100644 index 11002d948..000000000 Binary files a/static/texture/nb1/Station75494.jpg and /dev/null differ diff --git a/static/texture/nb1/Station75703.jpg b/static/texture/nb1/Station75703.jpg deleted file mode 100644 index 019359b10..000000000 Binary files a/static/texture/nb1/Station75703.jpg and /dev/null differ diff --git a/static/texture/nb1/Station78392.jpg b/static/texture/nb1/Station78392.jpg deleted file mode 100644 index 319573ca1..000000000 Binary files a/static/texture/nb1/Station78392.jpg and /dev/null differ diff --git a/static/texture/nb1/Station81700.jpg b/static/texture/nb1/Station81700.jpg deleted file mode 100644 index f14321a29..000000000 Binary files a/static/texture/nb1/Station81700.jpg and /dev/null differ diff --git a/static/texture/nb1/Station84098.jpg b/static/texture/nb1/Station84098.jpg deleted file mode 100644 index 5d694525a..000000000 Binary files a/static/texture/nb1/Station84098.jpg and /dev/null differ diff --git a/static/texture/nb1/Station86112.jpg b/static/texture/nb1/Station86112.jpg deleted file mode 100644 index 483ed9f7d..000000000 Binary files a/static/texture/nb1/Station86112.jpg and /dev/null differ diff --git a/static/texture/nb1/Station99584.jpg b/static/texture/nb1/Station99584.jpg deleted file mode 100644 index c7c1c849a..000000000 Binary files a/static/texture/nb1/Station99584.jpg and /dev/null differ diff --git a/static/texture/nb1/devicelist.jpg b/static/texture/nb1/devicelist.jpg deleted file mode 100644 index 027ca487b..000000000 Binary files a/static/texture/nb1/devicelist.jpg and /dev/null differ diff --git a/static/texture/nb1/nb1list.jpg b/static/texture/nb1/nb1list.jpg deleted file mode 100644 index aa30db6a8..000000000 Binary files a/static/texture/nb1/nb1list.jpg and /dev/null differ diff --git a/static/texture/nb1/pingbimen.png b/static/texture/nb1/pingbimen.png deleted file mode 100644 index 30880b6d1..000000000 Binary files a/static/texture/nb1/pingbimen.png and /dev/null differ diff --git a/static/texture/xian3/Station17596.jpg b/static/texture/xian3/Station17596.jpg deleted file mode 100644 index 71bcab933..000000000 Binary files a/static/texture/xian3/Station17596.jpg and /dev/null differ diff --git a/static/texture/xian3/Station18000.jpg b/static/texture/xian3/Station18000.jpg deleted file mode 100644 index 21ed7de35..000000000 Binary files a/static/texture/xian3/Station18000.jpg and /dev/null differ diff --git a/static/texture/xian3/Station19253.jpg b/static/texture/xian3/Station19253.jpg deleted file mode 100644 index fd521f78d..000000000 Binary files a/static/texture/xian3/Station19253.jpg and /dev/null differ diff --git a/static/texture/xian3/Station21203.jpg b/static/texture/xian3/Station21203.jpg deleted file mode 100644 index f0f094a3a..000000000 Binary files a/static/texture/xian3/Station21203.jpg and /dev/null differ diff --git a/static/texture/xian3/Station34499.jpg b/static/texture/xian3/Station34499.jpg deleted file mode 100644 index d5b486730..000000000 Binary files a/static/texture/xian3/Station34499.jpg and /dev/null differ diff --git a/static/texture/xian3/Station37821.jpg b/static/texture/xian3/Station37821.jpg deleted file mode 100644 index 8f6a04742..000000000 Binary files a/static/texture/xian3/Station37821.jpg and /dev/null differ diff --git a/static/texture/xian3/Station41790.jpg b/static/texture/xian3/Station41790.jpg deleted file mode 100644 index c12ce3096..000000000 Binary files a/static/texture/xian3/Station41790.jpg and /dev/null differ diff --git a/static/texture/xian3/Station4324.jpg b/static/texture/xian3/Station4324.jpg deleted file mode 100644 index 26e8d1b78..000000000 Binary files a/static/texture/xian3/Station4324.jpg and /dev/null differ diff --git a/static/texture/xian3/Station43447.jpg b/static/texture/xian3/Station43447.jpg deleted file mode 100644 index b36159e75..000000000 Binary files a/static/texture/xian3/Station43447.jpg and /dev/null differ diff --git a/static/texture/xian3/Station47557.jpg b/static/texture/xian3/Station47557.jpg deleted file mode 100644 index e42572212..000000000 Binary files a/static/texture/xian3/Station47557.jpg and /dev/null differ diff --git a/static/texture/xian3/Station53597.jpg b/static/texture/xian3/Station53597.jpg deleted file mode 100644 index 73e3e0cbd..000000000 Binary files a/static/texture/xian3/Station53597.jpg and /dev/null differ diff --git a/static/texture/xian3/Station54200.jpg b/static/texture/xian3/Station54200.jpg deleted file mode 100644 index 9f9b4a79b..000000000 Binary files a/static/texture/xian3/Station54200.jpg and /dev/null differ diff --git a/static/texture/xian3/Station55755.jpg b/static/texture/xian3/Station55755.jpg deleted file mode 100644 index 41ae244c7..000000000 Binary files a/static/texture/xian3/Station55755.jpg and /dev/null differ diff --git a/static/texture/xian3/Station571.jpg b/static/texture/xian3/Station571.jpg deleted file mode 100644 index 7bfb19cb8..000000000 Binary files a/static/texture/xian3/Station571.jpg and /dev/null differ diff --git a/static/texture/xian3/Station60649.jpg b/static/texture/xian3/Station60649.jpg deleted file mode 100644 index 32059bef3..000000000 Binary files a/static/texture/xian3/Station60649.jpg and /dev/null differ diff --git a/static/texture/xian3/Station61238.jpg b/static/texture/xian3/Station61238.jpg deleted file mode 100644 index 6fbda9a3d..000000000 Binary files a/static/texture/xian3/Station61238.jpg and /dev/null differ diff --git a/static/texture/xian3/Station64474.jpg b/static/texture/xian3/Station64474.jpg deleted file mode 100644 index ec8720605..000000000 Binary files a/static/texture/xian3/Station64474.jpg and /dev/null differ diff --git a/static/texture/xian3/Station66742.jpg b/static/texture/xian3/Station66742.jpg deleted file mode 100644 index bf1e3d889..000000000 Binary files a/static/texture/xian3/Station66742.jpg and /dev/null differ diff --git a/static/texture/xian3/Station67917.jpg b/static/texture/xian3/Station67917.jpg deleted file mode 100644 index 5c13f1c9a..000000000 Binary files a/static/texture/xian3/Station67917.jpg and /dev/null differ diff --git a/static/texture/xian3/Station67945.jpg b/static/texture/xian3/Station67945.jpg deleted file mode 100644 index 6817f38da..000000000 Binary files a/static/texture/xian3/Station67945.jpg and /dev/null differ diff --git a/static/texture/xian3/Station68029.jpg b/static/texture/xian3/Station68029.jpg deleted file mode 100644 index e06022c18..000000000 Binary files a/static/texture/xian3/Station68029.jpg and /dev/null differ diff --git a/static/texture/xian3/Station78551.jpg b/static/texture/xian3/Station78551.jpg deleted file mode 100644 index 38c7dce21..000000000 Binary files a/static/texture/xian3/Station78551.jpg and /dev/null differ diff --git a/static/texture/xian3/Station85598.jpg b/static/texture/xian3/Station85598.jpg deleted file mode 100644 index 7076afa53..000000000 Binary files a/static/texture/xian3/Station85598.jpg and /dev/null differ diff --git a/static/texture/xian3/Station90652.jpg b/static/texture/xian3/Station90652.jpg deleted file mode 100644 index 574648cd6..000000000 Binary files a/static/texture/xian3/Station90652.jpg and /dev/null differ diff --git a/static/texture/xian3/Station90701.jpg b/static/texture/xian3/Station90701.jpg deleted file mode 100644 index 7a23c0854..000000000 Binary files a/static/texture/xian3/Station90701.jpg and /dev/null differ diff --git a/static/texture/xian3/Station99903.jpg b/static/texture/xian3/Station99903.jpg deleted file mode 100644 index ab4196ab8..000000000 Binary files a/static/texture/xian3/Station99903.jpg and /dev/null differ diff --git a/static/texture/xian3/devicelist.jpg b/static/texture/xian3/devicelist.jpg deleted file mode 100644 index 3b41ca721..000000000 Binary files a/static/texture/xian3/devicelist.jpg and /dev/null differ diff --git a/static/texture/xian3/pingbimen.png b/static/texture/xian3/pingbimen.png deleted file mode 100644 index 63b42ef22..000000000 Binary files a/static/texture/xian3/pingbimen.png and /dev/null differ diff --git a/static/texture/xian3/xian3list.jpg b/static/texture/xian3/xian3list.jpg deleted file mode 100644 index 9abd0688c..000000000 Binary files a/static/texture/xian3/xian3list.jpg and /dev/null differ diff --git a/static/texture/xian3/xian3listold.jpg b/static/texture/xian3/xian3listold.jpg deleted file mode 100644 index 3b41ca721..000000000 Binary files a/static/texture/xian3/xian3listold.jpg and /dev/null differ