修改三维客流订阅连接,增加三维车站管理界面
This commit is contained in:
parent
84e77d7fbc
commit
67d8c9467c
@ -144,6 +144,7 @@ export default {
|
||||
jlmap3d: '3d editing',
|
||||
publish3d: '3d',
|
||||
assetmanager3d: '3d Asset Manager',
|
||||
stationmanager3d:'3d Station Manager',
|
||||
automaticSignalList: 'Automatic signal list',
|
||||
automaticSignalCode: 'Automatic signal coding',
|
||||
signalCodeName: 'Signal name',
|
||||
|
@ -15,6 +15,7 @@ export default {
|
||||
edit3d: '三维编辑',
|
||||
publish3d: '三维发布',
|
||||
assetmanager3d: '三维资源管理',
|
||||
stationmanager3d: '三维车站管理',
|
||||
logicalView: '逻辑视图',
|
||||
physicalView: '物理视图',
|
||||
mixedView: '混合视图',
|
||||
|
1141
src/jlmap3d/jl3dstationmanager/controls/stationManagerControls.js
Normal file
1141
src/jlmap3d/jl3dstationmanager/controls/stationManagerControls.js
Normal file
File diff suppressed because it is too large
Load Diff
435
src/jlmap3d/jl3dstationmanager/jl3dstationmanager.js
Normal file
435
src/jlmap3d/jl3dstationmanager/jl3dstationmanager.js
Normal file
@ -0,0 +1,435 @@
|
||||
import { Staticmodel } from '@/jlmap3d/jl3dtrafficplan/loader/stationconfig.js';
|
||||
//静态资源文件路劲
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//loader
|
||||
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
|
||||
//轨道视角控制
|
||||
import { StationManagerControls } from '@/jlmap3d/jl3dstationmanager/controls/stationManagerControls';
|
||||
//模型管理器
|
||||
import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/loader/loader.js';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
//获取信息接口
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
//cctv站台对象
|
||||
import { PasserStation } from '@/jlmap3d/jl3dtrafficplan/model/passerstation.js';
|
||||
//cctv检票机对象
|
||||
import { PasserCheckDoor } from '@/jlmap3d/jl3dtrafficplan/model/passercheckdoor.js';
|
||||
//cctv列车对象
|
||||
import { PasserTrain } from '@/jlmap3d/jl3dtrafficplan/model/passertrain.js';
|
||||
//cctv行人对象
|
||||
import { PasserHuman } from '@/jlmap3d/jl3dtrafficplan/model/passerhuman.js';
|
||||
//cctv渲染器
|
||||
import { PasserRender } from '@/jlmap3d/jl3dpassflow/passerrender/passerrender.js';
|
||||
//cctv行人ai
|
||||
import { PasserAi } from '@/jlmap3d/jl3dtrafficplan/passerai/passerai.js';
|
||||
//行人寻路相关工具
|
||||
import { ZoneManager } from '@/jlmap3d/jl3dtrafficplan/model/zonemanager.js';
|
||||
import { PathFinder } from '@/jlmap3d/jl3dtrafficplan/passerai/pathfinder.js';
|
||||
//cctv通信工具
|
||||
import { PassflowConnect } from '@/jlmap3d/jl3dtrafficplan/connect/stationconnect.js';
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import store from '@/store/index';
|
||||
// import { Loading } from 'element-ui';
|
||||
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
|
||||
|
||||
//动画播放相关
|
||||
let clock = new THREE.Clock();
|
||||
let delta;
|
||||
|
||||
let scene,camerass,renderer;
|
||||
|
||||
let aiswitch = 0;
|
||||
//动画组
|
||||
let mixers = [];
|
||||
//车站摄像机模型
|
||||
let monitor;
|
||||
|
||||
//寻路相关对象
|
||||
let passerZone = new ZoneManager();
|
||||
let pathFinder = new PathFinder();
|
||||
let path;
|
||||
|
||||
//设备动画action组
|
||||
let deviceaction = [];
|
||||
//控制帧率的webworker线程
|
||||
let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/trafficstation.js");
|
||||
|
||||
//老版本临时ai控制
|
||||
let olddataai = false;
|
||||
|
||||
export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
|
||||
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.dom = dom;
|
||||
this.nowcode = null;
|
||||
this.animateswitch = false;
|
||||
this.signallights = [];
|
||||
this.mixers = [];
|
||||
this.showmodel = null;
|
||||
|
||||
this.allStationData = [];
|
||||
this.humanWaitTop = 0;
|
||||
this.humanWaitDown = 0;
|
||||
this.humanInSpeed = 0;
|
||||
this.humanOutSpeed = 0;
|
||||
let waitForCreatIn = [];
|
||||
let waitForCreatOutTop = [];
|
||||
let waitForCreatOutDown = [];
|
||||
//定义相机
|
||||
camerass = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 10000);
|
||||
camerass.position.set(0, 100, 0);
|
||||
camerass.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
camerass.updateProjectionMatrix();
|
||||
|
||||
//定义场景(渲染容器)
|
||||
scene = new THREE.Scene();
|
||||
// scene.background = new THREE.Color(0xa0a0a0);
|
||||
|
||||
|
||||
var mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 1000, 1000 ), new THREE.MeshPhongMaterial( { color: 0x999999, depthWrite: false } ) );
|
||||
mesh.rotation.x = - Math.PI / 2;
|
||||
mesh.receiveShadow = true;
|
||||
scene.add( mesh );
|
||||
|
||||
var grid = new THREE.GridHelper( 1000, 100, 0x000000, 0x000000 );
|
||||
grid.material.opacity = 0.2;
|
||||
grid.material.transparent = true;
|
||||
scene.add( grid );
|
||||
|
||||
|
||||
let passerRender = new PasserRender(viewMap);
|
||||
passerRender.initView(dom,scene,camerass);
|
||||
|
||||
//定义全局光
|
||||
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
|
||||
scene.add(ambientLight);
|
||||
var light = new THREE.HemisphereLight( 0xffffff, 0x444444 );
|
||||
light.position.set( 0, 4000, 0 );
|
||||
scene.add( light );
|
||||
|
||||
let controls = new THREE.StationManagerControls(camerass, dom);
|
||||
controls.maxPolarAngle = Math.PI / 2;
|
||||
controls.minPolarangle = Math.PI / 5;
|
||||
controls.maxDistance = 800;
|
||||
controls.screenSpacePanning = true;
|
||||
controls.update();
|
||||
this.selectmodel = null;
|
||||
|
||||
// let mouse = new THREE.Vector2();
|
||||
let raycaster = new THREE.Raycaster();
|
||||
|
||||
//进站运动中乘客
|
||||
let humanlist = new THREE.Group();
|
||||
//上行等待上车乘客
|
||||
let topWaitPassers = new THREE.Group();
|
||||
//下行等待上车乘客
|
||||
let downWaitPassers = new THREE.Group();
|
||||
//出站乘客
|
||||
let outStationPassers = new THREE.Group();
|
||||
|
||||
let passerHuman = new PasserHuman();
|
||||
|
||||
let passerAi = new PasserAi(passerZone,pathFinder);
|
||||
|
||||
this.anime = null;
|
||||
|
||||
this.modelmanager = new ModelManager();
|
||||
// let loadingInstance = Loading.service({ fullscreen: true });
|
||||
|
||||
let stationlist = [];
|
||||
let socktest = null;
|
||||
let passerStation = new PasserStation();
|
||||
let passerCheckDoor = new PasserCheckDoor();
|
||||
let passerTrain = new PasserTrain();
|
||||
|
||||
// document.addEventListener( "mousedown", onselect, false );
|
||||
|
||||
this.modelmanager.loadpromise(Staticmodel, scope.mixers,"2").then(function (data) {
|
||||
// console.log(scope.modelmanager.station.mesh.getObjectByName("top"));
|
||||
// let testtop = scope.modelmanager.station.mesh.getObjectByName("down");
|
||||
// for(let i=0;i<testtop.children.length;i++){
|
||||
// console.log(testtop.children[i].matrixWorld.elements[12]);
|
||||
// console.log(testtop.children[i].matrixWorld.elements);
|
||||
// }
|
||||
// console.log(scope.modelmanager.station.mesh.getObjectByName("down"));
|
||||
passerStation.initStationAnimation(scope.modelmanager.station.mesh,mixers,deviceaction,scene);
|
||||
passerCheckDoor.initCheckDoorInAnimation(scope.modelmanager.zhajiin.mesh,mixers,deviceaction,scene);
|
||||
passerCheckDoor.initCheckDoorOutAnimation(scope.modelmanager.zhajiout.mesh,mixers,deviceaction,scene);
|
||||
|
||||
passerTrain.initTrain(scope.modelmanager.train.mesh,mixers,deviceaction,scene);
|
||||
|
||||
scene.add(scope.modelmanager.section.mesh);
|
||||
|
||||
monitor = scope.modelmanager.monitor.mesh;
|
||||
scene.add(monitor);
|
||||
console.log("animate");
|
||||
animate();
|
||||
})
|
||||
|
||||
this.initTrafficStart = function(){
|
||||
passerStation.initCodeStation(initCode);
|
||||
scope.humanWaitTop = passerStation.nowStation.toppassers;
|
||||
scope.humanWaitDown = passerStation.nowStation.downpassers;
|
||||
scope.humanInSpeed = 0;
|
||||
scope.humanOutSpeed = 0;
|
||||
passerHuman.speed = scope.humanInSpeed;
|
||||
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
|
||||
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
scope.resetscene();
|
||||
}
|
||||
|
||||
this.changestation = function(stationname){
|
||||
passerStation.changestation(stationname);
|
||||
// console.log(passerStation.nowStation);
|
||||
scope.humanWaitTop = passerStation.nowStation.toppassers;
|
||||
scope.humanWaitDown = passerStation.nowStation.downpassers;
|
||||
passerHuman.speed = passerStation.nowStation.topspeed + passerStation.nowStation.downspeed;
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
|
||||
scope.resetscene();
|
||||
}
|
||||
|
||||
this.updateNowStationData = function(){
|
||||
for(let i=0;i<passerStation.nowStation.topspeed;i++){
|
||||
let newIn = {
|
||||
overGoal:"top",
|
||||
};
|
||||
waitForCreatIn.push(newIn);
|
||||
}
|
||||
for(let i=0;i<passerStation.nowStation.downspeed;i++){
|
||||
let newIn = {
|
||||
overGoal:"down",
|
||||
};
|
||||
waitForCreatIn.push(newIn);
|
||||
}
|
||||
|
||||
|
||||
scope.humanInSpeed = passerStation.nowStation.topspeed+passerStation.nowStation.downspeed;
|
||||
passerHuman.speed = scope.humanInSpeed;
|
||||
passerWebWork.postMessage(["changespeed",scope.humanInSpeed/30]);
|
||||
}
|
||||
|
||||
this.updateNowLeaveData = function(direct,outNum){
|
||||
if(direct == "top"){
|
||||
waitForCreatOutTop = getnum(outNum,17);
|
||||
// console.log(waitForCreatOutTop);
|
||||
for(let i=0;i<waitForCreatOutTop.length;i++){
|
||||
for(let j=0;j<waitForCreatOutTop[i];j++){
|
||||
setTimeout(function(){
|
||||
// console.log(passerZone.list["standtop"].doorpoints[i]);
|
||||
passerHuman.newHumanCreate(outStationPassers,passerZone.list["standtop"].doorpoints[i],5,"top",i);
|
||||
}, Math.random()*1000*j);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
waitForCreatOutDown = getnum(outNum,17);
|
||||
for(let i=0;i<waitForCreatOutDown.length;i++){
|
||||
for(let j=0;j<waitForCreatOutDown[i];j++){
|
||||
setTimeout(function(){
|
||||
// console.log(passerZone.list["standdown"].doorpoints[i]);
|
||||
passerHuman.newHumanCreate(outStationPassers,passerZone.list["standdown"].doorpoints[i],5,"down",i);
|
||||
}, Math.random()*1000*j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.resetscene = function(){
|
||||
aiswitch = 1;
|
||||
passerAi.toppasserin = false;
|
||||
passerAi.downpasserin = false;
|
||||
//下车控制开关
|
||||
passerAi.toppasseron = false;
|
||||
passerAi.downpasseron = false;
|
||||
passerAi.toppasserinNum = 0;
|
||||
passerAi.downpasserinNum = 0;
|
||||
|
||||
passerTrain.toptrain.nowcode = null;
|
||||
passerTrain.downtrain.nowcode = null;
|
||||
// humanlist = new THREE.Group();
|
||||
for(let j=0; j<humanlist.children.length;j++){
|
||||
|
||||
humanlist.remove(humanlist.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
|
||||
for(let j=0; j<topWaitPassers.children.length;j++){
|
||||
|
||||
topWaitPassers.remove(topWaitPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
for(let j=0; j<downWaitPassers.children.length;j++){
|
||||
|
||||
downWaitPassers.remove(downWaitPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
for(let j=0; j<outStationPassers.children.length;j++){
|
||||
|
||||
outStationPassers.remove(outStationPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
passerTrain.toptrain.position.y = -20000;
|
||||
passerTrain.downtrain.position.y = -20000;
|
||||
|
||||
deviceaction.down.action.reset();
|
||||
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
|
||||
deviceaction.down.action.timeScale = -1;
|
||||
deviceaction.down.action.play();
|
||||
|
||||
deviceaction.top.action.reset();
|
||||
deviceaction.top.action.time = deviceaction.down.action._clip.duration;
|
||||
deviceaction.top.action.timeScale = -1;
|
||||
deviceaction.top.action.play();
|
||||
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
|
||||
passerTrain.toptrain.action.top[an].reset();
|
||||
passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration;
|
||||
passerTrain.toptrain.action.top[an].timeScale = -1;
|
||||
passerTrain.toptrain.action.top[an].play();
|
||||
}
|
||||
for(let an=passerTrain.toptrain.action.down.length-1;an>=0;an--){
|
||||
passerTrain.toptrain.action.down[an].reset();
|
||||
passerTrain.toptrain.action.down[an].time = passerTrain.toptrain.action.down[an]._clip.duration;
|
||||
passerTrain.toptrain.action.down[an].timeScale = -1;
|
||||
passerTrain.toptrain.action.down[an].play();
|
||||
}
|
||||
// for(let an=actions.length-1;an>=0;an--){
|
||||
// actions[an].reset();
|
||||
// actions[an].time = actions[an]._clip.duration;
|
||||
// actions[an].timeScale = -1;
|
||||
// actions[an].play();
|
||||
// }
|
||||
setTimeout(function(){
|
||||
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
|
||||
aiswitch = 0;
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
function startWorker(){
|
||||
|
||||
let updateaianimate = setInterval(
|
||||
function(){
|
||||
// console.log("?");
|
||||
if(aiswitch == 0){
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
|
||||
passerHuman.moveAnimateUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman);
|
||||
passerAi.aiUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman,passerCheckDoor,deviceaction);
|
||||
// passerZone.zoneActionCheck(humanlist,passerHuman,passerCheckDoor,deviceaction);
|
||||
delta = clock.getDelta();
|
||||
|
||||
for(let i=mixers.length-1;i>=0;i--){
|
||||
if(mixers[i]._actions[0].isRunning()){
|
||||
mixers[i].update( delta );
|
||||
}
|
||||
}
|
||||
// for(let i=topWaitPassers.children.length-1;i>=0;i--){
|
||||
// if(topWaitPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// topWaitPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=downWaitPassers.children.length-1;i>=0;i--){
|
||||
// if(downWaitPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// downWaitPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=outStationPassers.children.length-1;i>=0;i--){
|
||||
// if(outStationPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// outStationPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=humanlist.children.length-1;i>=0;i--){
|
||||
// if(humanlist.children[i].mixer._actions[0].isRunning()){
|
||||
// humanlist.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
, 100);
|
||||
|
||||
passerWebWork.onmessage = function (event) {
|
||||
if(aiswitch == 0){
|
||||
// console.log(humanlist.children.length);
|
||||
|
||||
this.allStationData = [];
|
||||
if(waitForCreatIn.length>0){
|
||||
let direct = Math.floor(Math.random()*(3-1+1))+1;
|
||||
//1--top
|
||||
//2-- down
|
||||
if(direct == 1){
|
||||
passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter1"),0,waitForCreatIn[0].overGoal);
|
||||
}else{
|
||||
passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter2"),0,waitForCreatIn[0].overGoal);
|
||||
}
|
||||
waitForCreatIn.shift();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
//
|
||||
// function onselect(event){
|
||||
// if(event.button == '0'){
|
||||
//
|
||||
// //定义光线
|
||||
// let raycaster = new THREE.Raycaster();
|
||||
// //定义平面鼠标点击坐标
|
||||
// let mouse = new THREE.Vector2();
|
||||
// mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1;
|
||||
// mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1;
|
||||
//
|
||||
// raycaster.setFromCamera( mouse, camerass );
|
||||
//
|
||||
// let intersects = raycaster.intersectObject(scope.modelmanager.station.mesh,true);
|
||||
// console.log(intersects[0].point);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
//循环渲染函数
|
||||
function animate() {
|
||||
passerRender.update();
|
||||
// console.log("ss");
|
||||
// if(passerRender.state == "freeview"){
|
||||
controls.update();
|
||||
// }
|
||||
// delta = clock.getDelta();
|
||||
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
}
|
||||
|
||||
window.onresize = function () {
|
||||
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
|
||||
}
|
||||
|
||||
this.switchviews = function(viewmode){
|
||||
passerRender.changeRenderMode(viewmode);
|
||||
}
|
||||
|
||||
|
||||
function getnum(num,pnum){
|
||||
let re = [];
|
||||
let base = Math.floor(num/pnum);
|
||||
let reset = num%pnum;
|
||||
for(let i=0;i<pnum;i++){
|
||||
let nownum = base+(i<reset?1:0);
|
||||
re.push(nownum);
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
||||
}
|
170
src/jlmap3d/jl3dstationmanager/loader/loader.js
Normal file
170
src/jlmap3d/jl3dstationmanager/loader/loader.js
Normal file
@ -0,0 +1,170 @@
|
||||
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
import store from '@/store/index';
|
||||
//模型管理器
|
||||
let mode = "0";
|
||||
export function ModelManager(){
|
||||
let scope = this;
|
||||
|
||||
this.man1 = {
|
||||
code:null,
|
||||
locateType:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
this.man2 = {
|
||||
code:null,
|
||||
locateType:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
|
||||
this.station = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.zhajiin = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
this.zhajiout = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.monitor = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.train = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
|
||||
this.section = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.seat = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
//读取模型
|
||||
this.loadpromise = function (data,mixers,loadmode){
|
||||
mode = loadmode;
|
||||
let initlist = [];
|
||||
for(let i=0,leni=data.length;i<leni;i++){
|
||||
if(data[i].type == "man1" || data[i].type == "cctvMan1"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.man1));
|
||||
}
|
||||
if(data[i].type == "man2" || data[i].type == "cctvMan2"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.man2));
|
||||
}
|
||||
if(data[i].type == "cctvStation"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.station));
|
||||
}
|
||||
if(data[i].type == "cctvGateIn"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.zhajiin));
|
||||
}
|
||||
if(data[i].type == "cctvGateOut"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.zhajiout));
|
||||
}
|
||||
if(data[i].type == "cctvMonitor"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.monitor));
|
||||
}
|
||||
if(data[i].type == "cctvTrain"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.train));
|
||||
}
|
||||
if(data[i].type == "cctvSection"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.section));
|
||||
}
|
||||
if(data[i].type == "seat"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.seat));
|
||||
}
|
||||
}
|
||||
//promise按顺序加载
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
Promise.all(initlist).then((result) => {
|
||||
console.log("success");
|
||||
store.dispatch('app/animationsClose');
|
||||
resolve("success"); //['成功了', 'success']
|
||||
}).catch((error) => {
|
||||
//console.log(error);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
//fbx模型加载
|
||||
function fbxpromise(asset,mixers,model){
|
||||
return new Promise(function(resolve, reject){
|
||||
var loader = new THREE.FBXLoader();
|
||||
if( mode == "2"){
|
||||
loader.load( asset.url, function ( object ) {
|
||||
model.mesh = object;
|
||||
|
||||
resolve(asset.deviceType);
|
||||
} );
|
||||
|
||||
}else{
|
||||
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
|
||||
|
||||
//列车模型子物体重新排序
|
||||
if(asset.type == "cctvTrain"){
|
||||
// let mixer = new THREE.AnimationMixer( object );
|
||||
let realtrain = new THREE.Group();
|
||||
for(let j=6;j>0;j--){
|
||||
let name = "c"+j;
|
||||
for(let i=0;i<object.children.length;i++){
|
||||
if(object.children[i].name == name){
|
||||
|
||||
object.children[i].position.x = object.children[i].position.x;
|
||||
//object.children[i].position.y = j*10;
|
||||
realtrain.add(object.children[i]);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
model.mesh = realtrain;
|
||||
model.mesh.animations = object.animations[0].tracks;
|
||||
//
|
||||
}else{
|
||||
model.mesh = object;
|
||||
|
||||
}
|
||||
|
||||
resolve(asset.deviceType);
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
56
src/jlmap3d/jl3dstationmanager/loader/stationconfig.js
Normal file
56
src/jlmap3d/jl3dstationmanager/loader/stationconfig.js
Normal file
@ -0,0 +1,56 @@
|
||||
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
var Staticmodel = [
|
||||
{
|
||||
id: "1",
|
||||
name: "人物1",
|
||||
deviceType: "man1",
|
||||
type: "man1",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-12-28/165-74879.FBX"
|
||||
},{
|
||||
id: "2",
|
||||
name: "人物2",
|
||||
deviceType: "man2",
|
||||
type: "man2",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-12-28/165-74879.FBX"
|
||||
},{
|
||||
id: "3",
|
||||
name: "车站",
|
||||
deviceType: "cctvStation",
|
||||
type: "cctvStation",
|
||||
url: BASE_ASSET_API + "/MODEL/2021-01-27/323-88925.FBX"///MODEL/2020-11-23/79-95086.FBX
|
||||
},{
|
||||
id: "4",
|
||||
name: "闸机",
|
||||
deviceType: "cctvGateIn",
|
||||
type: "cctvGateIn",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-20/42-7172.FBX"
|
||||
},{
|
||||
id: "5",
|
||||
name: "闸机",
|
||||
deviceType: "cctvGateOut",
|
||||
type: "cctvGateOut",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-20/43-8227.FBX"
|
||||
},{
|
||||
id: "6",
|
||||
name: "摄像机",
|
||||
deviceType: "cctvMonitor",
|
||||
type: "cctvMonitor",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-20/44-24100.FBX"
|
||||
},{
|
||||
id: "7",
|
||||
name: "列车",
|
||||
deviceType: "cctvTrain",
|
||||
type: "cctvTrain",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-11-23/80-14604.FBX"
|
||||
},{
|
||||
id: "8",
|
||||
name: "区段",
|
||||
deviceType: "cctvSection",
|
||||
type: "cctvSection",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-20/45-36330.FBX"
|
||||
}
|
||||
|
||||
|
||||
];
|
||||
|
||||
export { Staticmodel }
|
@ -8,7 +8,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
const scope = this;
|
||||
this.teststomp = new StompClient();
|
||||
let start = true;
|
||||
let topic = '/user/queue/simulation/jl3d/'+routegroup;
|
||||
let topic = '/queue/simulation/passenger/'+routegroup;
|
||||
let header = {'X-Token': getToken() };
|
||||
let topswitch = false;
|
||||
let downswitch = false;
|
||||
@ -84,7 +84,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
|
||||
if(data.type == "TRAIN_PFI_BL"){
|
||||
|
||||
if(toptrain.nowcode == data.body.code && topswitch == true){
|
||||
|
||||
|
||||
//根据上下车人数创建人
|
||||
jl3d.updateNowLeaveData("top",data.body.out);
|
||||
setTimeout(function(){
|
||||
|
@ -8,7 +8,7 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
|
||||
const scope = this;
|
||||
this.teststomp = new StompClient();
|
||||
|
||||
let topic = '/user/queue/simulation/jl3d/'+routegroup;
|
||||
let topic = '/queue/simulation/passenger/'+routegroup;
|
||||
let header = {'X-Token': getToken() };
|
||||
let restart = false;
|
||||
socketon(topic);
|
||||
|
@ -18,7 +18,10 @@ const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation')
|
||||
const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
|
||||
const Jlmap3dTrafficPlan = () => import('@/views/jlmap3d/trafficplan/jl3dtrafficplan');
|
||||
const Jlmap3dTrafficTrain = () => import('@/views/jlmap3d/trafficplan/jl3dtraffictrain');
|
||||
//三维沙盘测试
|
||||
const Jlmap3dSandBoxTest = () => import('@/views/jlmap3d/trafficplan/jl3dtestview');
|
||||
//三维车站管理测试
|
||||
const Jlmap3dStationManager = () => import('@/views/jlmap3d/stationmanager/jl3dstationmanager');
|
||||
const Jlmap3dModel = () => import('@/views/jlmap3d/device/jl3ddevice');
|
||||
const Jlmap3dMaintainer = () => import('@/views/jlmap3d/maintainer/jl3dmaintainer');
|
||||
const Jlmap3dMaintainerVr = () => import('@/views/jlmap3d/maintainer/jl3dmaintainervr');
|
||||
@ -259,6 +262,11 @@ export const constantRoutes = [
|
||||
component: Jlmap3dSandBoxTest,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/design/jlmap3d/jl3dstationmanager',
|
||||
component: Jlmap3dStationManager,
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{
|
||||
path: '/jlmap3d/traffictrain',
|
||||
|
@ -2,9 +2,9 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://api.joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.8.129:9000'; // 旭强
|
||||
BASE_API = 'http://192.168.8.129:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.8.119:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
|
70
src/views/jlmap3d/stationmanager/jl3dstationmanager.vue
Normal file
70
src/views/jlmap3d/stationmanager/jl3dstationmanager.vue
Normal file
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="jl3dstationmanager">
|
||||
<div id="jl3d" class="jl3ddraw">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
import { Jl3dStationManager } from '@/jlmap3d/jl3dstationmanager/jl3dstationmanager.js';
|
||||
|
||||
export default {
|
||||
name: 'jl3devacuation',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
localStatic:JL3D_LOCAL_STATIC,
|
||||
jl3d: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
this.initnewdata();
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
methods: {
|
||||
initnewdata: function (group,header){
|
||||
let dom = document.getElementById('jl3d');
|
||||
this.jl3d = new Jl3dStationManager(dom);
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.jl3ddraw {
|
||||
position: absolute;
|
||||
float: right;
|
||||
/* top:25%; */
|
||||
/* left: 0; */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9;
|
||||
}
|
||||
.jl3dstationmanager{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
#canvastexture {
|
||||
position: absolute;
|
||||
float: left;
|
||||
left: 0;
|
||||
z-index: -12;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
@ -28,6 +28,7 @@
|
||||
@refresh="loadInitData"
|
||||
@jlmap3d="jlmap3d"
|
||||
@assetmanager3d="assetmanager3d"
|
||||
@stationmanager3d="stationmanager3d"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -154,6 +155,11 @@ export default {
|
||||
assetmanager3d() {
|
||||
this.$router.push({ path: '/design/jlmap3d/assetmanager' });
|
||||
},
|
||||
stationmanager3d() {
|
||||
this.$router.push({ path: '/design/jlmap3d/jl3dstationmanager' });
|
||||
},
|
||||
|
||||
|
||||
importMap() {
|
||||
this.$refs.mapImport.show();
|
||||
}
|
||||
|
@ -102,6 +102,10 @@ export default {
|
||||
label: this.$t('map.assetmanager3d'),
|
||||
handler: this.assetmanager3d
|
||||
},
|
||||
// {
|
||||
// label: this.$t('map.stationmanager3d'),
|
||||
// handler: this.stationmanager3d
|
||||
// },
|
||||
{
|
||||
label: this.$t('map.publish'),
|
||||
handler: this.publish
|
||||
@ -261,6 +265,9 @@ export default {
|
||||
assetmanager3d() {
|
||||
this.$emit('assetmanager3d');
|
||||
},
|
||||
stationmanager3d(){
|
||||
this.$emit('stationmanager3d');
|
||||
},
|
||||
jlmap3d() {
|
||||
this.$emit('jlmap3d');
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user