diff --git a/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js b/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js index 429994ab6..8213d1a98 100644 --- a/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js +++ b/src/jlmap3d/jl3dtrafficplan/connect/stationconnect.js @@ -84,11 +84,11 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe if(data.type == "TRAIN_PFI_BL"){ if(toptrain.nowcode == data.body.code && topswitch == true){ - console.log(data); + //根据上下车人数创建人 jl3d.updateNowLeaveData("top",data.body.out); setTimeout(function(){ - passerAi.passerout("top","start") + passerAi.passerout("top","start",data.body.in) }, 5000); } @@ -96,7 +96,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe //根据上下车人数创建人 jl3d.updateNowLeaveData("down",data.body.out); setTimeout(function(){ - passerAi.passerout("down","start"); + passerAi.passerout("down","start",data.body.in); }, 5000); } } @@ -154,8 +154,9 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe } } + if(downtrain.nowcode == data.body.code){ - // console.log(data.body); + if(data.body.open == "0"){ closetraindoor(downtrain,data.body.doorCode,"down"); @@ -165,6 +166,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe } } + } } @@ -217,7 +219,9 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe location.reload(); }); } + } + let actions; function opentraindoor(train,doorcode,direct){ diff --git a/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js b/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js index 3d2a88eb2..820331eed 100644 --- a/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js +++ b/src/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js @@ -261,6 +261,8 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap,initCode) { //下车控制开关 passerAi.toppasseron = false; passerAi.downpasseron = false; + passerAi.toppasserinNum = 0; + passerAi.downpasserinNum = 0; passerTrain.toptrain.nowcode = null; passerTrain.downtrain.nowcode = null; diff --git a/src/jlmap3d/jl3dtrafficplan/passerai/passerai.js b/src/jlmap3d/jl3dtrafficplan/passerai/passerai.js index 2563c84ac..0f71dffb2 100644 --- a/src/jlmap3d/jl3dtrafficplan/passerai/passerai.js +++ b/src/jlmap3d/jl3dtrafficplan/passerai/passerai.js @@ -8,7 +8,9 @@ export function PasserAi(zone,finder) { this.downpasseron = false; //上车控制开关 this.toppasserin = false; + this.toppasserinNum = 0; this.downpasserin = false; + this.downpasserinNum = 0; let passerZone = zone; let pathFinder = finder; @@ -16,18 +18,24 @@ export function PasserAi(zone,finder) { let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 ); let targetPosition = new THREE.Vector3(); //生成下车出站人物 - this.passerout = function(direct,mode){ - // console.log(direct); + this.passerout = function(direct,mode,inNum){ + if(direct == "top"){ // console.log("toppasser"); if(mode == "start"){ scope.toppasseron = true; scope.toppasserin = true; + scope.toppasserinNum = inNum; } if(mode == "end"){ scope.toppasseron = false scope.toppasserin = false; } + + + + + // scope.toppasseron = true; // setTimeout(function(){ // scope.toppasseron = false @@ -42,6 +50,7 @@ export function PasserAi(zone,finder) { if(mode == "start"){ scope.downpasseron = true; scope.downpasserin = true; + scope.downpasserinNum = inNum; } if(mode == "end"){ scope.downpasseron = false; @@ -133,46 +142,54 @@ export function PasserAi(zone,finder) { } for(let i=0;i0){ + if(topWaitPassers.children[i].status == 0){ + //stage = 4 上车 + if(topWaitPassers.children[i].stage == 4){ + if(scope.toppasserin && topWaitPassers.children[i].direct == "top"){ - let points = []; - points.push(new THREE.Vector3(topWaitPassers.children[i].position.x,topWaitPassers.children[i].position.y,topWaitPassers.children[i].position.z)); + let points = []; + points.push(new THREE.Vector3(topWaitPassers.children[i].position.x,topWaitPassers.children[i].position.y,topWaitPassers.children[i].position.z)); - points.push(passerZone.list["standtop"].doorpoints[topWaitPassers.children[i].door]); + points.push(passerZone.list["standtop"].doorpoints[topWaitPassers.children[i].door]); - if(points[1] == undefined){ + if(points[1] == undefined){ - }else{ - passerHuman.initMoveAnimate(topWaitPassers.children[i],i,points,i); + }else{ + + scope.toppasserinNum -= 1; + passerHuman.initMoveAnimate(topWaitPassers.children[i],i,points,i); + } } } } } + } - for(let i=0;i0){ + if(downWaitPassers.children[i].status == 0){ + //stage = 4 上车 + if(downWaitPassers.children[i].stage == 4){ - if(scope.downpasserin && downWaitPassers.children[i].direct == "down"){ - let points = []; - points.push(new THREE.Vector3(downWaitPassers.children[i].position.x,downWaitPassers.children[i].position.y,downWaitPassers.children[i].position.z)); + if(scope.downpasserin && downWaitPassers.children[i].direct == "down"){ + let points = []; + points.push(new THREE.Vector3(downWaitPassers.children[i].position.x,downWaitPassers.children[i].position.y,downWaitPassers.children[i].position.z)); - points.push(passerZone.list["standdown"].doorpoints[downWaitPassers.children[i].door]); + points.push(passerZone.list["standdown"].doorpoints[downWaitPassers.children[i].door]); - if(points[1] == undefined){ + if(points[1] == undefined){ - }else{ - passerHuman.initMoveAnimate(downWaitPassers.children[i],i,points,i); + }else{ + scope.downpasserinNum -= 1; + passerHuman.initMoveAnimate(downWaitPassers.children[i],i,points,i); + } } } } } + } for(let i=0;i