From e7224548b8db64dc27eaa0d0779d5c90fe4458ad Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Mon, 1 Jun 2020 12:29:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=89=E7=BB=B4=E9=80=9A=E4=BF=A1bug=EF=BC=8Ccctv?= =?UTF-8?q?=E4=B8=89=E7=BB=B4=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/jl3ddrive/jl3ddrive.js | 3 +- .../jl3ddrive/moveupdate/DrivingConnect.js | 2 + .../jl3ddrive/moveupdate/DrivingConnectNew.js | 1 + src/jlmap3d/jl3dpassflow/config.js | 16 + src/jlmap3d/jl3dpassflow/jl3dpassflownew.js | 615 +++++++++--------- src/jlmap3d/jl3dpassflow/loader.js | 18 + src/jlmap3d/jl3dpassflow/model/zonemanager.js | 47 ++ src/jlmap3d/jl3dpassflow/model/zonemodel.js | 1 + .../connect/Jlmap3dSubscribe.js | 1 + src/jlmap3d/jl3dsimulation/jlmap3d.js | 12 +- src/jlmap3d/main/loaders/Materialload.js | 116 ++-- src/utils/baseUrl.js | 4 +- .../drive/drivecontrol/drivecontrol.vue | 1 + src/views/jlmap3d/passflow/jl3dpassflow.vue | 6 +- static/model/passflow/section.FBX | Bin 0 -> 9219264 bytes static/workertest/jsonworker.js | 4 +- 16 files changed, 453 insertions(+), 394 deletions(-) create mode 100644 static/model/passflow/section.FBX diff --git a/src/jlmap3d/jl3ddrive/jl3ddrive.js b/src/jlmap3d/jl3ddrive/jl3ddrive.js index e586d0b96..792546382 100644 --- a/src/jlmap3d/jl3ddrive/jl3ddrive.js +++ b/src/jlmap3d/jl3ddrive/jl3ddrive.js @@ -154,6 +154,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj let assetsdata = JSON.parse(netdata.data.sections); if(assetsdata.link){ scope.datatype = "old"; + // datanew(); // scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js"); // scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork); // scope.Subscribe.socketon(scope.Subscribe.topic); @@ -165,7 +166,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj if(trainlisttest){ if(trainlisttest.group){ if(trainlisttest.group.children[0]){ - console.log(trainlisttest.group.children[0].name); + // 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){ diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js index 8ddb3f7ba..5324265a7 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js @@ -100,6 +100,7 @@ export function Jl3dDriving(mixers, updatemmi, sound, translation, routegroup) { // // } // console.log(data); + // console.log(data); switch (data.type) { case 'Simulation_Driver_Change': @@ -113,6 +114,7 @@ export function Jl3dDriving(mixers, updatemmi, sound, translation, routegroup) { updatemmi.updatedrivingcode( data.body.code); break; case 'Simulation_TrainSpeed': + trainspeed(data); break; case 'SJL3D_TrainStatus': diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js index 6cc0ffa7f..132d67030 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js @@ -98,6 +98,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta // console.log(data); if(data.type == "Train_Position"){ // stats.update(); + trainrun(data.body); return; } diff --git a/src/jlmap3d/jl3dpassflow/config.js b/src/jlmap3d/jl3dpassflow/config.js index 77ebe869e..121f1ab83 100644 --- a/src/jlmap3d/jl3dpassflow/config.js +++ b/src/jlmap3d/jl3dpassflow/config.js @@ -48,6 +48,22 @@ var Staticmodel = { picUrl: "", assetUrl: "../../static/model/passflow/monitor.FBX" }, + train: { + id: "7", + name: "列车", + deviceType: "train", + type: "hrb", + picUrl: "", + assetUrl: "../../static/model/train/train.FBX" + }, + section: { + id: "8", + name: "区段", + deviceType: "section", + type: "hrb", + picUrl: "", + assetUrl: "../../static/model/passflow/section.FBX" + }, } diff --git a/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js b/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js index b05c2fc8d..74de4cee8 100644 --- a/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js +++ b/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js @@ -38,7 +38,6 @@ let originhuman1 = null; let originhuman2 = null; let originanima1 = null; let originanima2 = null; -let moveanimatelist = []; let zhajiin = []; let zhajiout = []; @@ -218,10 +217,6 @@ export function Jl3dpassflow(dom) { this.selectmodel = null; - const Color = { - GROUND: new THREE.Color( 0x606060 ).convertGammaToLinear( 2.2 ).getHex(), - NAVMESH: new THREE.Color( 0xFFFFFF ).convertGammaToLinear( 2.2 ).getHex(), - }; const ZONE = 'level'; const SPEED = 10; @@ -233,12 +228,12 @@ export function Jl3dpassflow(dom) { let groupID, path; - const playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 ); - const targetPosition = new THREE.Vector3(); + let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 ); + let targetPosition = new THREE.Vector3(); - const pathfinder = new THREE.Pathfinding(); - const mouse = new THREE.Vector2(); - const raycaster = new THREE.Raycaster(); + let pathfinder = new THREE.Pathfinding(); + let mouse = new THREE.Vector2(); + let raycaster = new THREE.Raycaster(); var loader = new THREE.OBJLoader(); @@ -250,9 +245,9 @@ export function Jl3dpassflow(dom) { function ( object ) { - console.time('createZone()'); + // console.time('createZone()'); const zone = THREE.Pathfinding.createZone(object.children[0].geometry); - console.timeEnd('createZone()'); + // console.timeEnd('createZone()'); pathfinder.setZoneData( ZONE, zone ); @@ -301,7 +296,6 @@ export function Jl3dpassflow(dom) { console.log(intersects[0].point); targetPosition.copy( intersects[0].point ); - originhuman1.position.copy( playerPosition ); // Teleport on ctrl/cmd click or RMB. if (event.metaKey || event.ctrlKey || event.button === 2) { @@ -320,28 +314,14 @@ export function Jl3dpassflow(dom) { points.push(path[i]); } originhuman1.curve = new THREE.CatmullRomCurve3(points); - originhuman1.curve.curvrtype = "chordal"; + originhuman1.curve.curvrtype = "centripetal"; originhuman1.progress = 0; console.log(path); } function tick ( dt ) { - // if ( !level || !(path||[]).length ) return - // - // let targetPosition = path[ 0 ]; - // const velocity = targetPosition.clone().sub( playerPosition ); - // - // if (velocity.lengthSq() > 0.05 * 0.05) { - // velocity.normalize(); - // // Move player to target - // playerPosition.add( velocity.multiplyScalar( dt * SPEED ) ); - // // originhuman1.lookAt(); - // originhuman1.position.copy( playerPosition ); - // } else { - // // Remove node from the path we calculated - // path.shift(); - // } + if(originhuman1.curve){ if(originhuman1.progress<1){ let point = originhuman1.curve.getPointAt(originhuman1.progress); @@ -383,7 +363,8 @@ export function Jl3dpassflow(dom) { initstationanimation(scope.modelmanager.station.mesh); initzhajiinaimation(scope.modelmanager.zhajiin.mesh); initzhajioutanimation(scope.modelmanager.zhajiout.mesh); - + scene.add(scope.modelmanager.section.mesh); + scene.add(scope.modelmanager.train.mesh); level = scope.modelmanager.station.mesh; monitor = scope.modelmanager.monitor.mesh; @@ -415,45 +396,6 @@ export function Jl3dpassflow(dom) { scene.add(humanlist); scene.add(scope.modelmanager.man1.mesh); - for(let i=0;i<200;i++){ - var mantype = Math.floor(Math.random()*(3-1+1))+1; - 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()); - } - - // zhajiin[j].waiting = 1; - - let mixer = new THREE.AnimationMixer( newhuman ); - mixer.runplay = false; - let action = mixer.clipAction( newhuman.animations[ 0 ] ); - - newhuman.status = 1; - newhuman.stage = 0; - let newone = { - id:i, - mesh:newhuman, - direct:null, - doorstatus:null, - doors:null, - action:action, - mixer:mixer, - runrail:null - }; - - - - humans.push(newone); - mixers.push(mixer); - humanlist.add(newhuman); - } - } @@ -466,8 +408,8 @@ export function Jl3dpassflow(dom) { clearInterval(checkobject); //进站控制 startWorker(); - // stationwebwork.postMessage("on"); - // passerwebwork.postMessage("on"); + stationwebwork.postMessage("on"); + passerwebwork.postMessage("on"); }; },1000); @@ -488,123 +430,40 @@ export function Jl3dpassflow(dom) { } } + function initpasser(){ + + for(let i=0;i<3;i++){ + + newhumancreate(stationzon.getinitposition("enter1"),0); + } + for(let i=0;i<3;i++){ + newhumancreate(stationzon.getinitposition("enter2"),0); + } + for(let i=0;i<3;i++){ + newhumancreate(stationzon.getinitposition("security"),1); + } + for(let i=0;i<2;i++){ + newhumancreate(stationzon.getinitposition("entergate"),2); + } + for(let i=0;i<6;i++){ + newhumancreate(stationzon.getinitposition("standtop"),3); + } + for(let i=0;i<6;i++){ + newhumancreate(stationzon.getinitposition("standdown"),3); + } + for(let i=0;i<5;i++){ + newhumancreate(stationzon.getinitposition("exitgate"),4); + } + console.log(humanlist); + } function startWorker(){ + initpasser(); passerwebwork.onmessage = function (event) { - if(humans){ - // console.log(humans.length); - - // console.log(humans.length); - for(let i=0;i=0;i--){ if(mixers[i]._actions[0].isRunning()){ @@ -615,9 +474,17 @@ export function Jl3dpassflow(dom) { }; stationwebwork.onmessage = function (event) { // console.log("stationwebwork"); - if(humans.length<200){ - newhumancreate(); + // if(humans.length<200){ + var direct = Math.floor(Math.random()*(3-1+1))+1; + //1--top + //2-- down + if(direct == 1){ + newhumancreate(stationzon.getzoneposition("enter1"),0); + }else{ + newhumancreate(stationzon.getzoneposition("enter2"),0); } + + // } }; } @@ -632,125 +499,257 @@ export function Jl3dpassflow(dom) { monitorrender(); } - delta = clock.getDelta(); - tick(delta); + // delta = clock.getDelta(); + // tick(delta); requestAnimationFrame(animate); } - function moveanimateinit(model,name,points,index,speed){ + function passerai(){ + for(let i=0;i0){ - 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; + for(let i=0;i=1){ + // let point = humans[i].runrail.curve.getPointAt(1); + //更新模型坐标 + if(humanlist.children[i].status == 1){ + // humanlist.children[i].runrail.enable = false; + humanlist.children[i].progress = 1; + // humanlist.children[i].mixer.runplay = false; + humanlist.children[i].action.stop(); + humanlist.children[i].status = 0; - if(humans[i].stage == 4){ + // if(humanlist.children[i].stage == 4){ + // + // humanlist.remove(humanlist.children[i].mesh); + // // humans.splice(i,1); + // } + // + if(humanlist.children[i].stage == 6){ + humanlist.remove(humanlist.children[i]); + // humanlist.children[i].stage = 7; - humanlist.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; - - } - - } } + + if(humanlist.children[i].stage == 5){ + + humanlist.children[i].stage = 6; + + } + if(humanlist.children[i].stage == 4){ + + humanlist.children[i].stage = 5; + + } + if(humanlist.children[i].stage == 3){ + + humanlist.children[i].stage = 4; + + } + // + if(humanlist.children[i].stage == 2){ + humanlist.children[i].stage = 3; + + } + + if(humanlist.children[i].stage == 1){ + + + humanlist.children[i].stage = 2; + + } + + if(humanlist.children[i].stage == 0){ + // // console.log(humans[i].doors); + // zhajiin[humanlist.children[i].doors].waiting = 0; + humanlist.children[i].stage = 1; + } + + } + + }else{ + //根据动画进度获取动画轨迹上点 + // console.log(i); + // console.log(humanlist.children[i].runrail); + // console.log(humanlist.children[i].progress); + let point = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress); + + //更新模型坐标 + humanlist.children[i].position.x = point.x; + humanlist.children[i].position.y = point.y; + humanlist.children[i].position.z = point.z; + if((humanlist.children[i].progress+0.001)<1){ + let tangent = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress+0.001); + humanlist.children[i].lookAt(new THREE.Vector3(tangent.x,humanlist.children[i].position.y,tangent.z)); + } + + humanlist.children[i].progress += humanlist.children[i].speed; + point = null; + + } } } + } - function newhumancreate(){ - var direct = Math.floor(Math.random()*(3-1+1))+1; + function newhumancreate(position,stage,){ 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 ); @@ -762,51 +761,21 @@ export function Jl3dpassflow(dom) { newhuman.animations.push(originanima2.clone()); } - if(direct == 1|| direct == 2){ - let testposition = stationzon.getzoneposition("enter1"); - newhuman.position.set(32,10,25); - points.push(testposition); - points.push(new THREE.Vector3(26,10,21)); - points.push(new THREE.Vector3(18,10,18)); - }else{ - let testposition = stationzon.getzoneposition("enter2"); - newhuman.position.set(32,10,-5); - points.push(testposition); - 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 ] ); + newhuman.position.copy(position); + newhuman.status = 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); + newhuman.stage = stage; + newhuman.direct = null; + newhuman.doorstatus = null; + newhuman.doors = null; + newhuman.action = mixer.clipAction( newhuman.animations[ 0 ] ); + newhuman.mixer = mixer; + newhuman.runrail = null; + newhuman.speed = 0; mixers.push(mixer); humanlist.add(newhuman); - - moveanimateinit(newone,humans.length,points,newone.id,0.002); - - // return newone; } function initstationanimation(object){ diff --git a/src/jlmap3d/jl3dpassflow/loader.js b/src/jlmap3d/jl3dpassflow/loader.js index b10aab84c..09de73026 100644 --- a/src/jlmap3d/jl3dpassflow/loader.js +++ b/src/jlmap3d/jl3dpassflow/loader.js @@ -44,6 +44,22 @@ export function ModelManager(){ action:null }; + this.train = { + code:null, + screenDoorOpenStatus:"01", + mesh:null, + action:null + }; + + + this.section = { + code:null, + screenDoorOpenStatus:"01", + mesh:null, + action:null + }; + + this.loadpromise = function (data,mixers){ let initlist = []; initlist.push(fbxpromise(data.man1,mixers,scope.man1)); @@ -52,6 +68,8 @@ export function ModelManager(){ initlist.push(fbxpromise(data.zhajiin,mixers,scope.zhajiin)); initlist.push(fbxpromise(data.zhajiout,mixers,scope.zhajiout)); initlist.push(fbxpromise(data.monitor,mixers,scope.monitor)); + initlist.push(fbxpromise(data.train,mixers,scope.train)); + initlist.push(fbxpromise(data.section,mixers,scope.section)); return new Promise(function(resolve, reject){ diff --git a/src/jlmap3d/jl3dpassflow/model/zonemanager.js b/src/jlmap3d/jl3dpassflow/model/zonemanager.js index ef7c16c1d..4e088a552 100644 --- a/src/jlmap3d/jl3dpassflow/model/zonemanager.js +++ b/src/jlmap3d/jl3dpassflow/model/zonemanager.js @@ -5,6 +5,7 @@ let enter1 = { name : "enter1", type : "normal", stage : "0", + randompoint : new THREE.Vector3(26.6,9.8,-2.7), railpoints : [ new THREE.Vector3(34,9.8,-6), new THREE.Vector3(32,9.8,-6) @@ -16,6 +17,7 @@ let enter2 = { name : "enter2", type : "normal", stage : "0", + randompoint : new THREE.Vector3(27,9.8,16), railpoints : [ new THREE.Vector3(35,9.8,31.5), new THREE.Vector3(31,9.8,31.5) @@ -27,6 +29,7 @@ let security = { name : "security", type : "device", stage : "1", + randompoint : new THREE.Vector3(8.8,9.8,18), railpoints : [ new THREE.Vector3(20.5,9.8,18), new THREE.Vector3(21,9.8,21) @@ -38,6 +41,7 @@ let entergate = { name : "entergate", type : "device", stage : "2", + randompoint : new THREE.Vector3(2.3,9.8,13), railpoints : [ new THREE.Vector3(6.3,9.8,17.4), new THREE.Vector3(4.8,9.8,17.4), @@ -52,6 +56,7 @@ let standtop = { name : "standtop", type : "stand", stage : "3", + randompoint : new THREE.Vector3(-64,1.77,0.38), railpoints : [ new THREE.Vector3(52.1,1.77,-1.8), new THREE.Vector3(-63.5,1.77,-1.8) @@ -63,6 +68,7 @@ let standdown = { name : "standdown", type : "stand", stage : "3", + randompoint : new THREE.Vector3(-64,1.77,21), railpoints : [ new THREE.Vector3(52.1,1.77,24), new THREE.Vector3(-64,1.77,24) @@ -74,6 +80,7 @@ let exitgate = { name : "exitgate", type : "device", stage : "5", + randompoint : new THREE.Vector3(-16,9.8,-0.4), railpoints : [ new THREE.Vector3(18.8,9.8,-0.27), new THREE.Vector3(18.8,9.8,1.18), @@ -88,6 +95,7 @@ let exit1 = { name : "exit1", type : "normal", stage : "6", + randompoint : new THREE.Vector3(), railpoints : [ new THREE.Vector3(28.2,9.8,-7), new THREE.Vector3(30.5,9.8,-7.4) @@ -99,6 +107,7 @@ let exit2 = { name : "exit2", type : "normal", stage : "6", + randompoint : new THREE.Vector3(), railpoints : [ new THREE.Vector3(28.3,9.8,28.8), new THREE.Vector3(31.2,9.8,28.8) @@ -127,6 +136,44 @@ export function ZoneManager() { scope.list[exit2.name] = new ZoneModel(exit2); } + this.getinitposition = function(name){ + // console.log(scope.list[name]); + let randompoint = new THREE.Vector3(0,scope.list[name].randompoint.y,0); + + // console.log(randompoint); + if(name == "enter1"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*8; + randompoint.z = scope.list[name].randompoint.z + Math.random()*8; + } + if(name == "enter2"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*8; + randompoint.z = scope.list[name].randompoint.z + Math.random()*8; + } + if(name == "security"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*10; + randompoint.z = scope.list[name].randompoint.z + Math.random()*2; + } + if(name == "entergate"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*5; + randompoint.z = scope.list[name].randompoint.z - Math.random()*2; + } + if(name == "standtop"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*100; + randompoint.z = scope.list[name].randompoint.z + Math.random(); + } + if(name == "standdown"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*100; + randompoint.z = scope.list[name].randompoint.z ; + } + if(name == "exitgate"){ + randompoint.x = scope.list[name].randompoint.x + Math.random()*30; + randompoint.z = scope.list[name].randompoint.z + Math.random()*5; + } + // let random = Math.random(); + return randompoint; + } + + this.getzoneposition = function(name){ // let random = Math.random(); let position = scope.list[name].railline.getPointAt(Math.random()); diff --git a/src/jlmap3d/jl3dpassflow/model/zonemodel.js b/src/jlmap3d/jl3dpassflow/model/zonemodel.js index 8d18ebde5..c0d820d8e 100644 --- a/src/jlmap3d/jl3dpassflow/model/zonemodel.js +++ b/src/jlmap3d/jl3dpassflow/model/zonemodel.js @@ -7,6 +7,7 @@ export function ZoneModel(data) { this.type = data.type; this.stage = data.stage; this.status = 0; + this.randompoint = data.randompoint; //轨迹点 this.railpoints = data.railpoints; diff --git a/src/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe.js b/src/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe.js index c7c1b5577..92ca9a1e2 100644 --- a/src/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe.js +++ b/src/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe.js @@ -66,6 +66,7 @@ export function Jlmap3dSubscribe(jlmap3d,routegroup,jsonwebwork) { // if(event.data.type == 'Simulation_DeviceStatus'){ // devicestatus(event.data); // } + // console.log(data); if(event.data._type == 'Simulation_Driver_Change'){ drivingcode = event.data.body.code; jlmap3d.updatedrivingcode( event.data.body.code); diff --git a/src/jlmap3d/jl3dsimulation/jlmap3d.js b/src/jlmap3d/jl3dsimulation/jlmap3d.js index 1bd2c00e8..596b4088e 100644 --- a/src/jlmap3d/jl3dsimulation/jlmap3d.js +++ b/src/jlmap3d/jl3dsimulation/jlmap3d.js @@ -191,12 +191,12 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) { scope.webwork.onmessage = function (event) { //更新列车位置 - // if(scope.datatype == "new"){ - // - // UpdateTrainNew(camera,trainlisttest); - // }else{ - // UpdateTrain(camera,trainlisttest); - // } + if(scope.datatype == "new"){ + + // UpdateTrainNew(camera,trainlisttest); + }else{ + UpdateTrain(camera,trainlisttest); + } if(camerarail.moveswitch == true){ // console.log(camerarail.progress); diff --git a/src/jlmap3d/main/loaders/Materialload.js b/src/jlmap3d/main/loaders/Materialload.js index 201046cd9..f1722bf31 100644 --- a/src/jlmap3d/main/loaders/Materialload.js +++ b/src/jlmap3d/main/loaders/Materialload.js @@ -7,66 +7,68 @@ export function Materialload(jlmap3dedit,assettype){ settexture( jlmap3dedit.materiallist,"green",'../../static/material/signal/3.jpg'); settexture( jlmap3dedit.materiallist,"black",'../../static/material/signal/5.jpg'); - - if(assettype.stationtexture == "xian3"){ - if(jlmap3dedit.stationtexture){ - setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/xian3list.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station18000",'../../static/texture/xian3/Station18000.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station61238",'../../static/texture/xian3/Station61238.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station41790",'../../static/texture/xian3/Station41790.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station67945",'../../static/texture/xian3/Station67945.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station85598",'../../static/texture/xian3/Station85598.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station4324",'../../static/texture/xian3/Station4324.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station55755",'../../static/texture/xian3/Station55755.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station53597",'../../static/texture/xian3/Station53597.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station68029",'../../static/texture/xian3/Station68029.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station17596",'../../static/texture/xian3/Station17596.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station66742",'../../static/texture/xian3/Station66742.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station90701",'../../static/texture/xian3/Station90701.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station90652",'../../static/texture/xian3/Station90652.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station54200",'../../static/texture/xian3/Station54200.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station19253",'../../static/texture/xian3/Station19253.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station37821",'../../static/texture/xian3/Station37821.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station47557",'../../static/texture/xian3/Station47557.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station78551",'../../static/texture/xian3/Station78551.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station64474",'../../static/texture/xian3/Station64474.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station21203",'../../static/texture/xian3/Station21203.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station34499",'../../static/texture/xian3/Station34499.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station571",'../../static/texture/xian3/Station571.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station99903",'../../static/texture/xian3/Station99903.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station43447",'../../static/texture/xian3/Station43447.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station67917",'../../static/texture/xian3/Station67917.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station60649",'../../static/texture/xian3/Station60649.jpg'); + if(assettype){ + if(assettype.stationtexture == "xian3"){ + if(jlmap3dedit.stationtexture){ + setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/xian3list.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station18000",'../../static/texture/xian3/Station18000.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station61238",'../../static/texture/xian3/Station61238.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station41790",'../../static/texture/xian3/Station41790.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station67945",'../../static/texture/xian3/Station67945.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station85598",'../../static/texture/xian3/Station85598.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station4324",'../../static/texture/xian3/Station4324.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station55755",'../../static/texture/xian3/Station55755.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station53597",'../../static/texture/xian3/Station53597.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station68029",'../../static/texture/xian3/Station68029.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station17596",'../../static/texture/xian3/Station17596.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station66742",'../../static/texture/xian3/Station66742.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station90701",'../../static/texture/xian3/Station90701.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station90652",'../../static/texture/xian3/Station90652.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station54200",'../../static/texture/xian3/Station54200.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station19253",'../../static/texture/xian3/Station19253.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station37821",'../../static/texture/xian3/Station37821.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station47557",'../../static/texture/xian3/Station47557.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station78551",'../../static/texture/xian3/Station78551.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station64474",'../../static/texture/xian3/Station64474.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station21203",'../../static/texture/xian3/Station21203.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station34499",'../../static/texture/xian3/Station34499.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station571",'../../static/texture/xian3/Station571.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station99903",'../../static/texture/xian3/Station99903.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station43447",'../../static/texture/xian3/Station43447.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station67917",'../../static/texture/xian3/Station67917.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station60649",'../../static/texture/xian3/Station60649.jpg'); + } } - } - if(assettype.stationtexture == "haerbin1"){ - if(jlmap3dedit.stationtexture){ - setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/haerbinlist.jpg'); + if(assettype.stationtexture == "haerbin1"){ + if(jlmap3dedit.stationtexture){ + setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/haerbinlist.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station11136",'../../static/texture/heb/Station11136.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station17293",'../../static/texture/heb/Station17293.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station18398",'../../static/texture/heb/Station18398.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station22163",'../../static/texture/heb/Station22163.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station25464",'../../static/texture/heb/Station25464.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station28090",'../../static/texture/heb/Station28090.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station41999",'../../static/texture/heb/Station41999.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station44338",'../../static/texture/heb/Station44338.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station46464",'../../static/texture/heb/Station46464.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station50565",'../../static/texture/heb/Station50565.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station60068",'../../static/texture/heb/Station60068.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station62429",'../../static/texture/heb/Station62429.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station64444",'../../static/texture/heb/Station64444.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station71700",'../../static/texture/heb/Station71700.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station72132",'../../static/texture/heb/Station72132.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station78164",'../../static/texture/heb/Station78164.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station79537",'../../static/texture/heb/Station79537.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station82618",'../../static/texture/heb/Station82618.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station85520",'../../static/texture/heb/Station85520.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station89483",'../../static/texture/heb/Station89483.jpg'); - setstationtexture(jlmap3dedit.stationtexture,"Station96090",'../../static/texture/heb/Station96090.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station11136",'../../static/texture/heb/Station11136.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station17293",'../../static/texture/heb/Station17293.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station18398",'../../static/texture/heb/Station18398.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station22163",'../../static/texture/heb/Station22163.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station25464",'../../static/texture/heb/Station25464.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station28090",'../../static/texture/heb/Station28090.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station41999",'../../static/texture/heb/Station41999.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station44338",'../../static/texture/heb/Station44338.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station46464",'../../static/texture/heb/Station46464.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station50565",'../../static/texture/heb/Station50565.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station60068",'../../static/texture/heb/Station60068.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station62429",'../../static/texture/heb/Station62429.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station64444",'../../static/texture/heb/Station64444.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station71700",'../../static/texture/heb/Station71700.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station72132",'../../static/texture/heb/Station72132.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station78164",'../../static/texture/heb/Station78164.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station79537",'../../static/texture/heb/Station79537.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station82618",'../../static/texture/heb/Station82618.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station85520",'../../static/texture/heb/Station85520.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station89483",'../../static/texture/heb/Station89483.jpg'); + setstationtexture(jlmap3dedit.stationtexture,"Station96090",'../../static/texture/heb/Station96090.jpg'); + } } + } //console.log(jlmap3dedit.materiallist); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 778caeb7b..c59924e25 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - // BASE_API = 'http://192.168.3.6:9000'; // 旭强 + BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue b/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue index 07045e547..a449f2fd4 100644 --- a/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue +++ b/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue @@ -138,6 +138,7 @@ import axios from 'axios'; } }, updatetrainlist(){ + console.log(this.group); getSimulationTrainlistNew(this.group).then(netdata => { this.options = []; this.trainlist = netdata.data; diff --git a/src/views/jlmap3d/passflow/jl3dpassflow.vue b/src/views/jlmap3d/passflow/jl3dpassflow.vue index d5d1f4068..47626642f 100644 --- a/src/views/jlmap3d/passflow/jl3dpassflow.vue +++ b/src/views/jlmap3d/passflow/jl3dpassflow.vue @@ -3,11 +3,11 @@
- +