新版三维车站客流管理代码修改(未实装)

This commit is contained in:
sunzhenyu 2021-03-11 17:10:50 +08:00
parent e4e19cd224
commit 9434928436
30 changed files with 3840 additions and 500 deletions

View File

@ -91,3 +91,43 @@ export function gousuo3dAction(group, data) {
data: data data: data
}); });
} }
// 存储数据
export function saveStationManagerData(data) {
return request({
url: `/api/pfp`,
method: 'post',
data: data
});
}
// 更新数据
export function updateStationManagerData(id,data) {
return request({
url: `/api/pfp/${id}`,
method: 'put',
data: data
});
}
// 查询数据列表
export function getStationManagerDataList() {
const datad = request({
url: `/api/pfp/list`,
method: 'get'
});
return datad.then();
}
// 查询数据
export function getStationManagerData(id) {
const datad = request({
url: `/api/pfp/${id}`,
method: 'get'
});
return datad.then();
}
// 删除数据
export function deleteStationManagerData(id) {
return request({
url: `/api/pfp/${id}`,
method: 'delete',
});
}

View File

@ -0,0 +1,280 @@
import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
import store from '@/store/index';
// 定于仿真socket接口
export function silumationConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi,sockStationPass,jl3d) {
const scope = this;
this.teststomp = new StompClient();
let start = true;
let topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() };
socketon(topic);
function socketon(topic) {
try {
scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function(topic) {
scope.teststomp.unsubscribe(topic);
};
// 仿真socket接口回调函数
function callback(Response) {
const data = JSON.parse(Response.body);
if(data.type == "PFV"){
for(let i=0;i<passerStation.stationlist.length;i++){
if(passerStation.stationlist[i].code == data.body){
jl3d.changestation(passerStation.stationlist[i].name);
updateValue(passerStation.stationlist[i].name);
i = passerStation.stationlist.length;
}
}
}
// /** 站台客流当前人数信息 */
// if(data.type == "STAND_PFI"){
//
// let newStandData = data.body;
// let count = 0;
// for(let j=0;j<passerStation.stationlist.length;j++){
// count = 0;
//
// for(let i=0;i<newStandData.length;i++){
//
//
// if(passerStation.stationlist[j].topstand == newStandData[i].standCode){
//
// passerStation.stationlist[j].topspeed = newStandData[i].to;
// passerStation.stationlist[j].toppassers = newStandData[i].num;
// count++;
// }
// if(passerStation.stationlist[j].downstand == newStandData[i].standCode){
//
// passerStation.stationlist[j].downspeed = newStandData[i].to;
// passerStation.stationlist[j].downpassers = newStandData[i].num;
// count++;
// }
//
// if(count == 2){
// i = newStandData.length;
// }
// }
// }
//
// jl3d.updateNowStationData();
//
// if(start){
// start = false;
// jl3d.initTrafficStart();
// }
//
// // jl3d.allStationData = data.body;
// }
// if(data.type == "TRAIN_PFI_BL"){
//
// if(toptrain.nowcode == data.body.code && topswitch == true){
//
// //根据上下车人数创建人
// jl3d.updateNowLeaveData("top",data.body.out);
// setTimeout(function(){
// passerAi.passerout("top","start",data.body.in)
// }, 5000);
//
// }
// if(downtrain.nowcode == data.body.code && downswitch == true){
// //根据上下车人数创建人
// jl3d.updateNowLeaveData("down",data.body.out);
// setTimeout(function(){
// passerAi.passerout("down","start",data.body.in);
// }, 5000);
// }
// }
if(data.type == "DeviceCtrl_3D"){
if(data.body.type == "PSD"){
if(data.body.code == passerStation.nowStation.toppsd){
if(data.body.open == 0){
passerAi.passerout("top","end");
deviceaction.top.action.reset();
deviceaction.top.action.time =deviceaction.top.action._clip.duration;
deviceaction.top.action.timeScale = -1;
deviceaction.top.action.play();
}else{
deviceaction.top.action.reset();
deviceaction.top.action.time = 0;
deviceaction.top.action.timeScale = 1;
deviceaction.top.action.play();
}
}
if(data.body.code == passerStation.nowStation.downpsd){
if(data.body.open == 0){
deviceaction.down.action.reset();
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
deviceaction.down.action.timeScale = -1;
deviceaction.down.action.play();
passerAi.passerout("down","end");
}else{
deviceaction.down.action.reset();
deviceaction.down.action.time = 0;
deviceaction.down.action.timeScale = 1;
deviceaction.down.action.play();
}
}
}
if(data.body.type == "TRAIN_DOOR"){
if(toptrain.nowcode == data.body.code){
if(data.body.open == "0"){
closetraindoor(toptrain,data.body.doorCode,"top");
}else{
opentraindoor(toptrain,data.body.doorCode,"top");
}
}
if(downtrain.nowcode == data.body.code){
if(data.body.open == "0"){
closetraindoor(downtrain,data.body.doorCode,"down");
}else{
opentraindoor(downtrain,data.body.doorCode,"down");
}
}
}
}
if(data.type == "TrainRun_3D"){
for(let i=0,leni = data.body.length;i<leni;i++){
if(data.body[i].section == passerStation.nowStation.topsection){
if(toptrain.nowcode != data.body[i].code){
toptrain.nowcode = data.body[i].code;
sockStationPass.topswitch = true;
}
toptrain.position.copy(toptrain.curve.getPointAt(data.body[i].offset));
}else{
if(downtrain.nowcode == data.body[i].code){
sockStationPass.topswitch = false
toptrain.position.x -= 1;
}
}
if(data.body[i].section == passerStation.nowStation.downsection){
if(downtrain.nowcode != data.body[i].code){
downtrain.nowcode = data.body[i].code;
sockStationPass.downswitch = true;
}
downtrain.position.copy(downtrain.curve.getPointAt(data.body[i].offset));
}else{
if(downtrain.nowcode == data.body[i].code){
sockStationPass.downswitch = false;
downtrain.position.x += 1;
}
}
}
}
if(data.type == 'Device_Load_Destroy_3D'){
start = true;
toptrain.nowcode = null;
downtrain.nowcode = null;
console.log("仿真重开=====================");
}
if(data.type == 'Simulation_Over') {
store.dispatch('LogOut').then(() => {
location.reload();
});
}
}
let actions;
function opentraindoor(train,doorcode,direct){
// console.log(train);
if(direct == "top"){
// if(doorcode == "1"){
// actions = train.action.down;
// }
//
// if(doorcode == "2"){
actions = train.action.top;
// }
}else{
// if(doorcode == "1"){
actions = train.action.top;
// }
//
// if(doorcode == "2"){
// actions = train.action.down;
// }
}
for(let an=actions.length-1;an>=0;an--){
actions[an].reset();
actions[an].time = 0;
actions[an].timeScale = 1;
actions[an].play();
}
}
function closetraindoor(train,doorcode,direct){
if(direct == "top"){
// if(doorcode == "1"){
// actions = train.action.down;
// }
// if(doorcode == "2"){
actions = train.action.top;
// }
toptrain.nowcode = null;
}else{
// if(doorcode == "1"){
actions = train.action.top;
// }
// if(doorcode == "2"){
// actions = train.action.down;
// }
downtrain.nowcode = null;
}
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();
}
}
}

View File

@ -0,0 +1,283 @@
import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
import store from '@/store/index';
// 定于仿真socket接口
export function stationConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi,jl3d) {
const scope = this;
this.teststomp = new StompClient();
let start = true;
let topic = '/user/queue/simulation/passenger/'+routegroup;
let header = {'X-Token': getToken() };
this.topswitch = false;
this.downswitch = false;
socketon(topic);
function socketon(topic) {
try {
scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function(topic) {
scope.teststomp.unsubscribe(topic);
};
// 仿真socket接口回调函数
function callback(Response) {
const data = JSON.parse(Response.body);
// if(data.type == "PFV"){
//
// for(let i=0;i<passerStation.stationlist.length;i++){
// if(passerStation.stationlist[i].code == data.body){
// jl3d.changestation(passerStation.stationlist[i].name);
// updateValue(passerStation.stationlist[i].name);
// i = passerStation.stationlist.length;
// }
// }
//
// }
/** 站台客流当前人数信息 */
if(data.type == "STAND_PFI"){
let newStandData = data.body;
let count = 0;
for(let j=0;j<passerStation.stationlist.length;j++){
count = 0;
for(let i=0;i<newStandData.length;i++){
if(passerStation.stationlist[j].topstand == newStandData[i].standCode){
passerStation.stationlist[j].topspeed = newStandData[i].to;
passerStation.stationlist[j].toppassers = newStandData[i].num;
count++;
}
if(passerStation.stationlist[j].downstand == newStandData[i].standCode){
passerStation.stationlist[j].downspeed = newStandData[i].to;
passerStation.stationlist[j].downpassers = newStandData[i].num;
count++;
}
if(count == 2){
i = newStandData.length;
}
}
}
jl3d.updateNowStationData();
if(start){
start = false;
jl3d.initTrafficStart();
}
// jl3d.allStationData = data.body;
}
if(data.type == "TRAIN_PFI_BL"){
if(toptrain.nowcode == data.body.code && scope.topswitch == true){
//根据上下车人数创建人
jl3d.updateNowLeaveData("top",data.body.out);
setTimeout(function(){
passerAi.passerout("top","start",data.body.in)
}, 5000);
}
if(downtrain.nowcode == data.body.code && scope.downswitch == true){
//根据上下车人数创建人
jl3d.updateNowLeaveData("down",data.body.out);
setTimeout(function(){
passerAi.passerout("down","start",data.body.in);
}, 5000);
}
}
//
// if(data.type == "DeviceCtrl_3D"){
// if(data.body.type == "PSD"){
//
// if(data.body.code == passerStation.nowStation.toppsd){
// if(data.body.open == 0){
//
// passerAi.passerout("top","end");
// deviceaction.top.action.reset();
// deviceaction.top.action.time =deviceaction.top.action._clip.duration;
// deviceaction.top.action.timeScale = -1;
// deviceaction.top.action.play();
//
// }else{
//
// deviceaction.top.action.reset();
// deviceaction.top.action.time = 0;
// deviceaction.top.action.timeScale = 1;
// deviceaction.top.action.play();
// }
// }
// if(data.body.code == passerStation.nowStation.downpsd){
// if(data.body.open == 0){
//
// deviceaction.down.action.reset();
// deviceaction.down.action.time = deviceaction.down.action._clip.duration;
// deviceaction.down.action.timeScale = -1;
// deviceaction.down.action.play();
// passerAi.passerout("down","end");
// }else{
//
// deviceaction.down.action.reset();
// deviceaction.down.action.time = 0;
// deviceaction.down.action.timeScale = 1;
// deviceaction.down.action.play();
// }
//
// }
// }
//
// if(data.body.type == "TRAIN_DOOR"){
//
// if(toptrain.nowcode == data.body.code){
//
// if(data.body.open == "0"){
// closetraindoor(toptrain,data.body.doorCode,"top");
//
// }else{
// opentraindoor(toptrain,data.body.doorCode,"top");
//
// }
//
// }
//
// if(downtrain.nowcode == data.body.code){
//
// if(data.body.open == "0"){
// closetraindoor(downtrain,data.body.doorCode,"down");
//
// }else{
// opentraindoor(downtrain,data.body.doorCode,"down");
//
// }
//
// }
//
// }
// }
//
// if(data.type == "TrainRun_3D"){
//
// for(let i=0,leni = data.body.length;i<leni;i++){
// if(data.body[i].section == passerStation.nowStation.topsection){
// if(toptrain.nowcode != data.body[i].code){
// toptrain.nowcode = data.body[i].code;
// topswitch = true;
// }
// toptrain.position.copy(toptrain.curve.getPointAt(data.body[i].offset));
//
//
// }else{
// if(downtrain.nowcode == data.body[i].code){
// topswitch = false
// toptrain.position.x -= 1;
// }
//
// }
//
// if(data.body[i].section == passerStation.nowStation.downsection){
// if(downtrain.nowcode != data.body[i].code){
// downtrain.nowcode = data.body[i].code;
// downswitch = true;
// }
// downtrain.position.copy(downtrain.curve.getPointAt(data.body[i].offset));
//
// }else{
// if(downtrain.nowcode == data.body[i].code){
// downswitch = false;
// downtrain.position.x += 1;
// }
//
// }
// }
// }
// if(data.type == 'Device_Load_Destroy_3D'){
// start = true;
// toptrain.nowcode = null;
// downtrain.nowcode = null;
// console.log("仿真重开=====================");
// }
//
//
// if(data.type == 'Simulation_Over') {
// store.dispatch('LogOut').then(() => {
// location.reload();
// });
// }
}
let actions;
function opentraindoor(train,doorcode,direct){
// console.log(train);
if(direct == "top"){
// if(doorcode == "1"){
// actions = train.action.down;
// }
//
// if(doorcode == "2"){
actions = train.action.top;
// }
}else{
// if(doorcode == "1"){
actions = train.action.top;
// }
//
// if(doorcode == "2"){
// actions = train.action.down;
// }
}
for(let an=actions.length-1;an>=0;an--){
actions[an].reset();
actions[an].time = 0;
actions[an].timeScale = 1;
actions[an].play();
}
}
function closetraindoor(train,doorcode,direct){
if(direct == "top"){
// if(doorcode == "1"){
// actions = train.action.down;
// }
// if(doorcode == "2"){
actions = train.action.top;
// }
toptrain.nowcode = null;
}else{
// if(doorcode == "1"){
actions = train.action.top;
// }
// if(doorcode == "2"){
// actions = train.action.down;
// }
downtrain.nowcode = null;
}
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();
}
}
}

View File

@ -13,7 +13,7 @@
// Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish // Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish
// Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move // Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move
THREE.StationManagerControls = function ( object, domElement ,camera,scene,transformControl) { THREE.StationManagerControls = function ( object, domElement ,regionManager,scene,transformControl) {
this.object = object; this.object = object;
this.selectRegion = null; this.selectRegion = null;
this.planeMesh = []; this.planeMesh = [];
@ -22,7 +22,7 @@ THREE.StationManagerControls = function ( object, domElement ,camera,scene,trans
trainlisttest : null trainlisttest : null
}; };
let camera = object;
this.animateswitch = null; this.animateswitch = null;
this.scene = null; this.scene = null;
@ -31,6 +31,7 @@ THREE.StationManagerControls = function ( object, domElement ,camera,scene,trans
//画线:Orbit 绘图:Draw //画线:Orbit 绘图:Draw
this.controlMode = "Orbit"; this.controlMode = "Orbit";
this.drawColor = 0x2894FF; this.drawColor = 0x2894FF;
this.drawRegion = "";
this.drawSwitch = false; this.drawSwitch = false;
this.drawGroup = new THREE.Group(); this.drawGroup = new THREE.Group();
scene.add(this.drawGroup); scene.add(this.drawGroup);
@ -816,29 +817,25 @@ THREE.StationManagerControls = function ( object, domElement ,camera,scene,trans
for(let k in scope.planeMesh){ for(let k in scope.planeMesh){
intersects = raycaster.intersectObject( scope.planeMesh[k] ); intersects = raycaster.intersectObject( scope.planeMesh[k] );
if(intersects[0]){ if(intersects[0]){
var geometry = new THREE.PlaneGeometry( 1, 1, 1 ); // var geometry = new THREE.PlaneGeometry( 1, 1, 1 );
var material = new THREE.MeshBasicMaterial( {color: scope.drawColor, side: THREE.DoubleSide} ); // var material = new THREE.MeshBasicMaterial( {color: scope.drawColor, side: THREE.DoubleSide} );
drawMesh = new THREE.Mesh( geometry, material );
drawMesh.renderOrder = 8;
// drawMesh.rotation.x = Math.PI/2;
scope.drawGroup.add( drawMesh );
drawMesh.underFloor = k;
drawStartPoint = intersects[0].point; drawStartPoint = intersects[0].point;
drawMesh = regionManager.creatRegion(scope.drawRegion,scope.drawColor,drawStartPoint,k);
state = "Draw"; state = "Draw";
} }
} }
}else{ }else{
mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1; mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
raycaster.setFromCamera( mouse, camera ); raycaster.setFromCamera( mouse, camera );
intersects = raycaster.intersectObjects( scope.drawGroup.children ); intersects = raycaster.intersectObjects( scope.drawGroup.children,true );
console.log(scope.drawGroup);
console.log(intersects);
if(intersects[0]){ if(intersects[0]){
scope.selectRegion = intersects[0].object; scope.selectRegion = intersects[0].object;
transformControl.attach(scope.selectRegion); transformControl.attach(scope.selectRegion.parent);
console.log(intersects[0]); jl3dStationManagerUpdateSelectModel(scope.selectRegion.parent);
}else{ }else{
} }
@ -897,34 +894,34 @@ THREE.StationManagerControls = function ( object, domElement ,camera,scene,trans
mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1; mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
raycaster.setFromCamera( mouse, camera ); raycaster.setFromCamera( mouse, camera );
for(let k in scope.planeMesh){ // for(let k in scope.planeMesh){
intersects = raycaster.intersectObject( scope.planeMesh[k] ); // intersects = raycaster.intersectObject( scope.planeMesh[k] );
if(intersects[0]){ // if(intersects[0]){
drawEndPoint = intersects[0].point; // drawEndPoint = intersects[0].point;
let points = [ // let points = [
//
new THREE.Vector3(drawStartPoint.x,drawStartPoint.y,drawStartPoint.z), // new THREE.Vector3(drawStartPoint.x,drawStartPoint.y,drawStartPoint.z),
new THREE.Vector3(drawEndPoint.x,drawStartPoint.y,drawStartPoint.z), // new THREE.Vector3(drawEndPoint.x,drawStartPoint.y,drawStartPoint.z),
new THREE.Vector3(drawStartPoint.x,drawStartPoint.y,drawEndPoint.z), // new THREE.Vector3(drawStartPoint.x,drawStartPoint.y,drawEndPoint.z),
new THREE.Vector3(drawEndPoint.x,drawStartPoint.y,drawEndPoint.z) // new THREE.Vector3(drawEndPoint.x,drawStartPoint.y,drawEndPoint.z)
]; // ];
for(let i=0;i<drawMesh.geometry.vertices.length;i++){ // for(let i=0;i<drawMesh.geometry.vertices.length;i++){
drawMesh.geometry.vertices[i].set(points[i].x,points[i].y,points[i].z); // drawMesh.geometry.vertices[i].set(points[i].x,points[i].y,points[i].z);
} // }
//
//
// drawMesh.geometry.vertices = points; // // drawMesh.geometry.vertices = points;
drawMesh.geometry.verticesNeedUpdate = true; // drawMesh.geometry.verticesNeedUpdate = true;
drawMesh.geometry.computeBoundingBox(); // drawMesh.geometry.computeBoundingBox();
drawMesh.geometry.center(); // drawMesh.geometry.center();
drawMesh.position.set( // drawMesh.position.set(
(drawStartPoint.x+drawEndPoint.x)/2, // (drawStartPoint.x+drawEndPoint.x)/2,
drawStartPoint.y+0.1, // drawStartPoint.y+0.1,
(drawStartPoint.z+drawEndPoint.z)/2 // (drawStartPoint.z+drawEndPoint.z)/2
); // );
//
} // }
} // }

View File

@ -16,7 +16,7 @@ import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '
//cctv站台对象 //cctv站台对象
import { PasserStation } from '@/jlmap3d/jl3dstationmanager/model/passerstation.js'; import { PasserStation } from '@/jlmap3d/jl3dstationmanager/model/passerstation.js';
//cctv检票机对象 //cctv检票机对象
import { PasserCheckDoor } from '@/jlmap3d/jl3dstationmanager/model/passercheckdoor.js'; import { checkRegion } from '@/jlmap3d/jl3dstationmanager/model/region/checkRegion.js';
//cctv列车对象 //cctv列车对象
import { PasserTrain } from '@/jlmap3d/jl3dstationmanager/model/passertrain.js'; import { PasserTrain } from '@/jlmap3d/jl3dstationmanager/model/passertrain.js';
//cctv行人对象 //cctv行人对象
@ -24,10 +24,11 @@ import { PasserHuman } from '@/jlmap3d/jl3dstationmanager/model/passerhuman.js';
//cctv行人ai //cctv行人ai
import { PasserAi } from '@/jlmap3d/jl3dstationmanager/passerai/passerai.js'; import { PasserAi } from '@/jlmap3d/jl3dstationmanager/passerai/passerai.js';
//行人寻路相关工具 //行人寻路相关工具
import { ZoneManager } from '@/jlmap3d/jl3dstationmanager/model/zonemanager.js'; import { regionManager } from '@/jlmap3d/jl3dstationmanager/model/regionManager.js';
import { PathFinder } from '@/jlmap3d/jl3dstationmanager/passerai/pathfinder.js'; import { PathFinder } from '@/jlmap3d/jl3dstationmanager/passerai/pathfinder.js';
//cctv通信工具 //车站仿真
import { PassflowConnect } from '@/jlmap3d/jl3dtrafficplan/connect/stationconnect.js'; import { silumationConnect } from '@/jlmap3d/jl3dstationmanager/connect/silumationConnect.js';
import { stationConnect } from '@/jlmap3d/jl3dstationmanager/connect/stationConnect.js';
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import store from '@/store/index'; import store from '@/store/index';
@ -47,7 +48,7 @@ let mixers = [];
let monitor; let monitor;
//寻路相关对象 //寻路相关对象
let passerZone = new ZoneManager(); let sceneRegion = new regionManager();
let pathFinder = new PathFinder(); let pathFinder = new PathFinder();
let path; let path;
@ -59,7 +60,7 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/traffi
//老版本临时ai控制 //老版本临时ai控制
let olddataai = false; let olddataai = false;
export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) { export function Jl3dStationManager(dom,skinCode,routegroup,initCode) {
// let stats = new Stats(); // let stats = new Stats();
// dom.appendChild( stats.dom ); // dom.appendChild( stats.dom );
@ -133,7 +134,7 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
} ); } );
scene.add(transformControl); scene.add(transformControl);
let controls = new THREE.StationManagerControls(camerass, dom,camerass,scene,transformControl); let controls = new THREE.StationManagerControls(camerass, dom,sceneRegion,scene,transformControl);
// controls.maxPolarAngle = Math.PI / 2; // controls.maxPolarAngle = Math.PI / 2;
// controls.minPolarangle = Math.PI / 5; // controls.minPolarangle = Math.PI / 5;
// controls.maxDistance = 800; // controls.maxDistance = 800;
@ -142,6 +143,7 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
controls.target.set( 1, 0, 0 ); controls.target.set( 1, 0, 0 );
controls.controlMode = "Orbit"; controls.controlMode = "Orbit";
controls.update(); controls.update();
sceneRegion.initRegionManager(controls);
this.selectmodel = null; this.selectmodel = null;
@ -160,7 +162,7 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
let passerHuman = new PasserHuman(); let passerHuman = new PasserHuman();
let passerAi = new PasserAi(passerZone,pathFinder); let passerAi = new PasserAi(sceneRegion,pathFinder);
this.anime = null; this.anime = null;
@ -168,21 +170,19 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
// let loadingInstance = Loading.service({ fullscreen: true }); // let loadingInstance = Loading.service({ fullscreen: true });
let stationlist = []; let stationlist = [];
let socktest = null; let sockStation = null;
let sockStationPass = null;
let passerStation = new PasserStation(); let passerStation = new PasserStation();
let passerCheckDoor = new PasserCheckDoor(); let passerCheckDoor = new checkRegion();
let passerTrain = new PasserTrain(); let passerTrain = new PasserTrain();
// document.addEventListener( "mousedown", onselect, false ); // document.addEventListener( "mousedown", onselect, false );
console.log(skinCode);
getPublish3dMapDetail(skinCode).then(netdata3d => {
console.log("1");
passerStation.loadMaterial(netdata3d);
this.modelmanager.loadpromise(Staticmodel, scope.mixers,"2").then(function (data) { this.modelmanager.loadpromise(Staticmodel, scope.mixers,"2").then(function (data) {
// console.log(scope.modelmanager.station.mesh.getObjectByName("top")); console.log("2");
// 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); passerStation.initStationAnimation(scope.modelmanager.station.mesh,mixers,deviceaction,scene);
passerCheckDoor.initCheckDoorInAnimation(scope.modelmanager.zhajiin.mesh,mixers,deviceaction,scene); passerCheckDoor.initCheckDoorInAnimation(scope.modelmanager.zhajiin.mesh,mixers,deviceaction,scene);
passerCheckDoor.initCheckDoorOutAnimation(scope.modelmanager.zhajiout.mesh,mixers,deviceaction,scene); passerCheckDoor.initCheckDoorOutAnimation(scope.modelmanager.zhajiout.mesh,mixers,deviceaction,scene);
@ -190,12 +190,38 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
passerTrain.initTrain(scope.modelmanager.train.mesh,mixers,deviceaction,scene); passerTrain.initTrain(scope.modelmanager.train.mesh,mixers,deviceaction,scene);
scene.add(scope.modelmanager.section.mesh); scene.add(scope.modelmanager.section.mesh);
scene.add(scope.modelmanager.futi.mesh);
monitor = scope.modelmanager.monitor.mesh; monitor = scope.modelmanager.monitor.mesh;
scene.add(monitor); scene.add(monitor);
console.log("animate");
getPublishMapDetail(skinCode).then(netdata => {
console.log("3");
passerHuman.initHumans(scope.modelmanager.man1.mesh,scope.modelmanager.man2.mesh);
scene.add(humanlist);
scene.add(topWaitPassers);
scene.add(downWaitPassers);
scene.add(outStationPassers);
passerStation.initStationList(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList);
sockStationPass = new stationConnect(deviceaction,passerTrain.toptrain,passerTrain.downtrain,routegroup,passerStation,passerAi,scope);
sockStation = new silumationConnect(deviceaction,passerTrain.toptrain,passerTrain.downtrain,routegroup,passerStation,passerAi,sockStationPass,scope);
store.dispatch('app/animationsClose');
let checkobject = setInterval(function(){
clearInterval(checkobject);
//进站控制
startWorker();
passerWebWork.postMessage(["on"]);
},1000);
});
animate(); animate();
}) })
});
this.initTrafficStart = function(){ this.initTrafficStart = function(){
passerStation.initCodeStation(initCode); passerStation.initCodeStation(initCode);
@ -239,7 +265,7 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
scope.humanInSpeed = passerStation.nowStation.topspeed+passerStation.nowStation.downspeed; scope.humanInSpeed = passerStation.nowStation.topspeed+passerStation.nowStation.downspeed;
passerHuman.speed = scope.humanInSpeed; passerHuman.speed = scope.humanInSpeed;
passerWebWork.postMessage(["changespeed",scope.humanInSpeed/30]); passerWebWork.postMessage(["changespeed",scope.humanInSpeed/30]);
} };
this.updateNowLeaveData = function(direct,outNum){ this.updateNowLeaveData = function(direct,outNum){
if(direct == "top"){ if(direct == "top"){
@ -248,8 +274,8 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
for(let i=0;i<waitForCreatOutTop.length;i++){ for(let i=0;i<waitForCreatOutTop.length;i++){
for(let j=0;j<waitForCreatOutTop[i];j++){ for(let j=0;j<waitForCreatOutTop[i];j++){
setTimeout(function(){ setTimeout(function(){
// console.log(passerZone.list["standtop"].doorpoints[i]); // console.log(sceneRegion.list["standtop"].doorpoints[i]);
passerHuman.newHumanCreate(outStationPassers,passerZone.list["standtop"].doorpoints[i],5,"top",i); passerHuman.newHumanCreate(outStationPassers,sceneRegion.list["standtop"].doorpoints[i],5,"top",i);
}, Math.random()*1000*j); }, Math.random()*1000*j);
} }
} }
@ -258,8 +284,8 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
for(let i=0;i<waitForCreatOutDown.length;i++){ for(let i=0;i<waitForCreatOutDown.length;i++){
for(let j=0;j<waitForCreatOutDown[i];j++){ for(let j=0;j<waitForCreatOutDown[i];j++){
setTimeout(function(){ setTimeout(function(){
// console.log(passerZone.list["standdown"].doorpoints[i]); // console.log(sceneRegion.list["standdown"].doorpoints[i]);
passerHuman.newHumanCreate(outStationPassers,passerZone.list["standdown"].doorpoints[i],5,"down",i); passerHuman.newHumanCreate(outStationPassers,sceneRegion.list["standdown"].doorpoints[i],5,"down",i);
}, Math.random()*1000*j); }, Math.random()*1000*j);
} }
} }
@ -354,7 +380,7 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
passerHuman.moveAnimateUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman); passerHuman.moveAnimateUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman);
passerAi.aiUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman,passerCheckDoor,deviceaction); passerAi.aiUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman,passerCheckDoor,deviceaction);
// passerZone.zoneActionCheck(humanlist,passerHuman,passerCheckDoor,deviceaction); // sceneRegion.zoneActionCheck(humanlist,passerHuman,passerCheckDoor,deviceaction);
delta = clock.getDelta(); delta = clock.getDelta();
for(let i=mixers.length-1;i>=0;i--){ for(let i=mixers.length-1;i>=0;i--){
@ -396,9 +422,9 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
//1--top //1--top
//2-- down //2-- down
if(direct == 1){ if(direct == 1){
passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter1"),0,waitForCreatIn[0].overGoal); passerHuman.newHumanCreate(humanlist,sceneRegion.getzoneposition("enter1"),0,waitForCreatIn[0].overGoal);
}else{ }else{
passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter2"),0,waitForCreatIn[0].overGoal); passerHuman.newHumanCreate(humanlist,sceneRegion.getzoneposition("enter2"),0,waitForCreatIn[0].overGoal);
} }
waitForCreatIn.shift(); waitForCreatIn.shift();
} }
@ -426,32 +452,41 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
this.changeDrawType = function(drawType){ this.changeDrawType = function(drawType){
console.log(drawType); console.log(drawType);
controls.drawSwitch = true; controls.drawSwitch = true;
if(drawType == "stationRegion"){ if(drawType == "startRegion"){
controls.drawColor = 0x2894FF; controls.drawColor = 0x2894FF;
controls.drawRegion = "startRegion";
} }
if(drawType == "securityRegion"){ if(drawType == "securityRegion"){
controls.drawColor = 0xFF0000; controls.drawColor = 0xFF0000;
controls.drawRegion = "securityRegion";
} }
if(drawType == "checkRegion"){ if(drawType == "checkRegion"){
controls.drawColor = 0x9F35FF; controls.drawColor = 0x9F35FF;
controls.drawRegion = "checkRegion";
} }
if(drawType == "standRegion"){ if(drawType == "standRegion"){
controls.drawColor = 0x00EC00; controls.drawColor = 0x00EC00;
controls.drawRegion = "standRegion";
} }
if(drawType == "ticketRegion"){ if(drawType == "ticketRegion"){
controls.drawColor = 0x00FFFF; controls.drawColor = 0x00FFFF;
controls.drawRegion = "ticketRegion";
} }
if(drawType == "elevatorRegion"){ if(drawType == "elevatorRegion"){
controls.drawColor = 0xFFFF37; controls.drawColor = 0xFFFF37;
controls.drawRegion = "elevatorRegion";
} }
if(drawType == "stairsRegion"){ if(drawType == "stairsRegion"){
controls.drawColor = 0xFF5809; controls.drawColor = 0xFF5809;
controls.drawRegion = "stairsRegion";
} }
if(drawType == "escalatorRegion"){ if(drawType == "escalatorRegion"){
controls.drawColor = 0x5CADAD; controls.drawColor = 0x5CADAD;
controls.drawRegion = "escalatorRegion";
} }
if(drawType == "unaccessRegion"){ if(drawType == "unaccessRegion"){
controls.drawColor = 0x272727; controls.drawColor = 0x272727;
controls.drawRegion = "unaccessRegion";
} }
} }
@ -479,6 +514,25 @@ export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
controls.deleteRegion(); controls.deleteRegion();
} }
this.saveAllData = function(){
let data1 = sceneRegion.saveRegionData();
let newSaveData = {
name:"4",
regionData:JSON.stringify(data1),
sceneConfig:JSON.stringify([]),
simulationConfig:JSON.stringify([]),
};
console.log(newSaveData);
// newSaveData.regionData.push();
return newSaveData;
}
this.loadData = function(data){
let regionData = JSON.parse(data.regionData);
sceneRegion.loadRegionData(regionData);
};
//循环渲染函数 //循环渲染函数
function animate() { function animate() {

View File

@ -75,6 +75,14 @@ export function ModelManager(){
action:null action:null
}; };
this.futi = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
//读取模型 //读取模型
this.loadpromise = function (data,mixers,loadmode){ this.loadpromise = function (data,mixers,loadmode){
mode = loadmode; mode = loadmode;
@ -107,6 +115,10 @@ export function ModelManager(){
if(data[i].type == "seat"){ if(data[i].type == "seat"){
initlist.push(fbxpromise(data[i],mixers,scope.seat)); initlist.push(fbxpromise(data[i],mixers,scope.seat));
} }
if(data[i].type == "cctvFuti"){
initlist.push(fbxpromise(data[i],mixers,scope.futi));
}
} }
//promise按顺序加载 //promise按顺序加载
return new Promise(function(resolve, reject){ return new Promise(function(resolve, reject){

View File

@ -17,8 +17,8 @@ var Staticmodel = [
name: "车站", name: "车站",
deviceType: "cctvStation", deviceType: "cctvStation",
type: "cctvStation", type: "cctvStation",
url: BASE_ASSET_API + "/MODEL/2021-02-20/1296-89217.FBX" url: BASE_ASSET_API + "/MODEL/2021-03-11/1344-16880.FBX"
//未分拆上下层模型 /MODEL/2021-01-27/323-88925.FBX //2021.3.11/MODEL/2021-02-20/1296-89217.FBX
//最早模型 /MODEL/2020-11-23/79-95086.FBX //最早模型 /MODEL/2020-11-23/79-95086.FBX
},{ },{
id: "4", id: "4",
@ -50,6 +50,13 @@ var Staticmodel = [
deviceType: "cctvSection", deviceType: "cctvSection",
type: "cctvSection", type: "cctvSection",
url: BASE_ASSET_API + "/MODEL/2020-07-20/45-36330.FBX" url: BASE_ASSET_API + "/MODEL/2020-07-20/45-36330.FBX"
},
{
id: "9",
name: "电扶梯",
deviceType: "cctvFuti",
type: "cctvFuti",
url: BASE_ASSET_API + "/MODEL/2021-03-11/1345-1782.FBX"
} }

View File

@ -7,18 +7,60 @@ export function PasserHuman() {
let originanima2 = null; let originanima2 = null;
//初始化人物模型动画 //初始化人物模型动画
this.initHumans = function(object1,object2,mixers,deviceaction,scene){ this.initHumans = function(object1,object2,mixers,deviceaction,scene){
originhuman1 = object1; originhuman1 = creatHuman();
originhuman1.progress = 1; originhuman1.progress = 1;
// scene.add(originhuman1); // scene.add(originhuman1);
originhuman2 = object2; originhuman2 = creatHuman();
//
let mixer1 = new THREE.AnimationMixer( originhuman1 ); // let mixer1 = new THREE.AnimationMixer( originhuman1 );
let mixer2 = new THREE.AnimationMixer( originhuman2 ); // let mixer2 = new THREE.AnimationMixer( originhuman2 );
originanima1 = originhuman1.animations[ 0 ]; // originanima1 = originhuman1.animations[ 0 ];
originanima2 = originhuman2.animations[ 0 ]; // originanima2 = originhuman2.animations[ 0 ];
originhuman1.remove(originhuman1.children[2]); // originhuman1.remove(originhuman1.children[2]);
} }
function creatHuman(){
let human = new THREE.Group();
var geometry = new THREE.CircleBufferGeometry( 0.5, 32 );
var material = new THREE.MeshBasicMaterial( { color: 0x0000E3 } );
let humanHead = new THREE.Mesh( geometry, material );
humanHead.rotation.x = -Math.PI/2;
humanHead.position.y = 0.01;
human.add(humanHead);
var geometry = new THREE.CircleBufferGeometry( 1.5, 32 );
var material = new THREE.MeshBasicMaterial( {
color: 0xCECEFF,
opacity: 0.3,
transparent: true, } );
let humanBody = new THREE.Mesh( geometry, material );
humanBody.rotation.x = -Math.PI/2;
human.add(humanBody);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(0.3,-0.6,0);
var v2 = new THREE.Vector3(-0.3,-0.6,0);
var v3 = new THREE.Vector3(0,-1.3,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: 0x0000E3 } );
var humanDirect= new THREE.Mesh(geom, material);
humanDirect.rotation.x = -Math.PI/2;
humanDirect.position.y = 0.01;
human.add(humanDirect);
return human;
}
//创建新的进站乘客 //创建新的进站乘客
this.newInHuman= function(humanlist,position){ this.newInHuman= function(humanlist,position){
if(scope.humanWaitIn.length != 0){ if(scope.humanWaitIn.length != 0){
@ -47,18 +89,18 @@ export function PasserHuman() {
let mantype = Math.floor(Math.random()*(3-1+1))+1; let mantype = Math.floor(Math.random()*(3-1+1))+1;
if(mantype == 1){ if(mantype == 1){
newhuman = THREE.SkeletonUtils.clone( originhuman1 ); // newhuman = THREE.SkeletonUtils.clone( originhuman1 );
newhuman = originhuman1.clone( ); newhuman = originhuman1.clone( );
newhuman.animations = []; // newhuman.animations = [];
// newhuman.animations.push(originanima1.clone()); // newhuman.animations.push(originanima1.clone());
}else{ }else{
newhuman = THREE.SkeletonUtils.clone( originhuman2 ); // newhuman = THREE.SkeletonUtils.clone( originhuman2 );
newhuman = originhuman2.clone( ); newhuman = originhuman2.clone( );
newhuman.animations = []; // newhuman.animations = [];
// newhuman.animations.push(originanima2.clone()); // newhuman.animations.push(originanima2.clone());
} }
let mixer = new THREE.AnimationMixer( newhuman ); // let mixer = new THREE.AnimationMixer( newhuman );
newhuman.position.copy(position); newhuman.position.copy(position);
if(overGoal){ if(overGoal){

View File

@ -41,20 +41,22 @@ export function PasserStation() {
let mixer = new THREE.AnimationMixer( object ,mixers ,deviceaction ,scene); let mixer = new THREE.AnimationMixer( object ,mixers ,deviceaction ,scene);
let newclip = object.animations[ 0 ]; let newclip = object.animations[ 0 ];
for(let j=0;j<object.children.length;j++){ let standfloor = object.getObjectByName("1CENG");
console.log(object);
for(let j=0;j<standfloor.children.length;j++){
if(object.children[j].name == "top"){ if(standfloor.children[j].name == "top"){
// let geometry = new THREE.BoxBufferGeometry( 50, 50, 50 ); // let geometry = new THREE.BoxBufferGeometry( 50, 50, 50 );
// let material = new THREE.MeshBasicMaterial( {color: 0x00ff00} ); // let material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
// let cube = new THREE.Mesh( geometry, material ); // let cube = new THREE.Mesh( geometry, material );
// cube.position.copy(object.children[j].position); // cube.position.copy(object.children[j].position);
// scene.add( cube ); // scene.add( cube );
object.children[j].animations = []; standfloor.children[j].animations = [];
object.children[j].animations.push(newclip.clone()); standfloor.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( object.children[j] ); let mixer = new THREE.AnimationMixer( standfloor.children[j] );
let action =mixer.clipAction( object.children[j].animations[0]) let action =mixer.clipAction( standfloor.children[j].animations[0])
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
// action.play(); // action.play();
@ -64,16 +66,16 @@ export function PasserStation() {
action:action, action:action,
mixer:mixer, mixer:mixer,
}; };
deviceaction[object.children[j].name] = device; deviceaction[standfloor.children[j].name] = device;
} }
if(object.children[j].name == "down"){ if(standfloor.children[j].name == "down"){
object.children[j].animations = []; standfloor.children[j].animations = [];
object.children[j].animations.push(newclip.clone()); standfloor.children[j].animations.push(newclip.clone());
let mixer = new THREE.AnimationMixer( object.children[j] ); let mixer = new THREE.AnimationMixer( standfloor.children[j] );
let action =mixer.clipAction( object.children[j].animations[0]) let action =mixer.clipAction( standfloor.children[j].animations[0])
// action.play(); // action.play();
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
@ -83,7 +85,7 @@ export function PasserStation() {
action:action, action:action,
mixer:mixer, mixer:mixer,
}; };
deviceaction[object.children[j].name] = device; deviceaction[standfloor.children[j].name] = device;
} }
} }
object.traverse( function ( child ) { object.traverse( function ( child ) {
@ -94,8 +96,8 @@ export function PasserStation() {
} ); } );
scope.stationMesh = object; scope.stationMesh = object;
scope.top = object.getObjectByName("1"); scope.top = object.getObjectByName("1CENG");
scope.down = object.getObjectByName("2"); scope.down = object.getObjectByName("2CENG");
originTopPosition.copy(scope.top.position); originTopPosition.copy(scope.top.position);
originDownPosition.copy(scope.down.position); originDownPosition.copy(scope.down.position);
scope.topfloor = object.getObjectByName("1floor"); scope.topfloor = object.getObjectByName("1floor");
@ -170,7 +172,23 @@ export function PasserStation() {
//加载线路车站名贴图 //加载线路车站名贴图
this.loadMaterial = function(netdata3d){ this.loadMaterial = function(netdata3d){
Materialload(scope,JSON.parse(netdata3d.data.assets).stationTextureList[0]); Materialload(scope,JSON.parse(netdata3d.data.assets).stationTextureList[0]);
} };
this.initCodeStation = function(initCode){
for(let i=0,leni=scope.stationlist.length;i<leni;i++){
// console.log(scope.stationlist[i]);
if(scope.stationlist[i].downstand == initCode || scope.stationlist[i].topstand == initCode){
scope.nowStation = scope.stationlist[i];
if(scope.stationtexture["stationlist"]){
scope.stationMesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowStation.code];
scope.stationMesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
updatestationlist(scope.stationlist,scope.stationlist[i].name);
i=leni;
}
}
};
this.apartPosition = function(drawGroup){ this.apartPosition = function(drawGroup){
// scope.down.position.y = scope.top.position.y; // scope.down.position.y = scope.top.position.y;
@ -178,12 +196,13 @@ export function PasserStation() {
scope.down.position.z -= 75; scope.down.position.z -= 75;
if(drawGroup.children.length>0){ if(drawGroup.children.length>0){
for(let i=0;i<drawGroup.children.length;i++){ for(let i=0;i<drawGroup.children.length;i++){
// drawGroup.children[i].position.y = scope.top.position.y; for(let j=0;j<drawGroup.children[i].children.length;j++){
if(drawGroup.children[i].underFloor == "1floor"){ if(drawGroup.children[i].children[j].underFloor == "1floor"){
drawGroup.children[i].position.z += 75; drawGroup.children[i].children[j].position.z += 75;
} }
if(drawGroup.children[i].underFloor == "2floor"){ if(drawGroup.children[i].children[j].underFloor == "2floor"){
drawGroup.children[i].position.z -= 75; drawGroup.children[i].children[j].position.z -= 75;
}
} }
} }
} }
@ -195,13 +214,15 @@ export function PasserStation() {
if(drawGroup.children.length>0){ if(drawGroup.children.length>0){
for(let i=0;i<drawGroup.children.length;i++){ for(let i=0;i<drawGroup.children.length;i++){
if(drawGroup.children[i].underFloor == "1floor"){ for(let j=0;j<drawGroup.children[i].children.length;j++){
drawGroup.children[i].position.z -= 75; if(drawGroup.children[i].children[j].underFloor == "1floor"){
// drawGroup.children[i].position.y = scope.top.position.y; drawGroup.children[i].children[j].position.z -= 75;
} // drawGroup.children[i].position.y = scope.top.position.y;
if(drawGroup.children[i].underFloor == "2floor"){ }
drawGroup.children[i].position.z += 75; if(drawGroup.children[i].children[j].underFloor == "2floor"){
// drawGroup.children[i].position.y = scope.down.position.y; drawGroup.children[i].children[j].position.z += 75;
// drawGroup.children[i].position.y = scope.down.position.y;
}
} }
} }
} }

View File

@ -1,5 +1,84 @@
export function PasserCheckDoor(data) { export function checkRegion(data) {
var scope = this; var scope = this;
this.group = new THREE.Group();
this.creatCheckRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
newRegion.status = "1";
//连接设备
newRegion.connectDevice = "*";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0x9F35FF);
newRegion.regionType = "checkRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
newRegion.connectDevice = regionData[i].connectDevice;
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
//入口闸机组 //入口闸机组
this.zhajiin = []; this.zhajiin = [];
//出口闸机组 //出口闸机组

View File

@ -0,0 +1,83 @@
//电梯区域
export function elevatorRegion() {
let scope = this;
this.list = [];
this.group = new THREE.Group();
this.creatElevatorRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
newRegion.status = "1";
//连接设备
newRegion.connectDevice = "*";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0xFFFF37);
newRegion.regionType = "elevatorRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
newRegion.connectDevice = regionData[i].connectDevice;
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
}

View File

@ -0,0 +1,83 @@
//扶梯区域
export function escalatorRegion() {
let scope = this;
this.list = [];
this.group = new THREE.Group();
this.creatEscalatorRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
newRegion.status = "1";
//连接设备
newRegion.connectDevice = "*";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0x5CADAD);
newRegion.regionType = "escalatorRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
newRegion.connectDevice = regionData[i].connectDevice;
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
}

View File

@ -0,0 +1,89 @@
//安检区域
export function securityRegion() {
let scope = this;
this.list = [];
this.group = new THREE.Group();
this.creatSecurityRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
//连接设备
newRegion.connectDevice = "*";
//停留时间
newRegion.stayTime = "1";
//区域状态
newRegion.status = "1";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0xFF0000);
newRegion.regionType = "securityRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
newRegion.connectDevice = regionData[i].connectDevice;
newRegion.stayTime = regionData[i].stayTime;
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
}

View File

@ -0,0 +1,83 @@
//楼梯区域
export function stairsRegion() {
let scope = this;
this.list = [];
this.group = new THREE.Group();
this.creatStairsRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
newRegion.status = "1";
//连接设备
newRegion.connectDevice = "*";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0xFF5809);
newRegion.regionType = "stairsRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
newRegion.connectDevice = regionData[i].connectDevice;
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
}

View File

@ -0,0 +1,87 @@
//站台区域
export function standRegion() {
let scope = this;
this.list = [];
this.group = new THREE.Group();
this.creatStandRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
//区域状态
newRegion.status = "1";
//连接设备
newRegion.connectDevice = "*";
//区域方向
newRegion.direction = "1";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0x00EC00);
newRegion.regionType = "standRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
newRegion.direction = regionData[i].direction;
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
}

View File

@ -0,0 +1,95 @@
//入口区域
export function startRegion() {
let scope = this;
this.list = [];
this.group = new THREE.Group();
this.creatStartRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
//入口乘客比例
newRegion.startWeight = "%";
//出口乘客比例
newRegion.endWeight = "%";
//目标权重
newRegion.targetWeight = "%";
//区域状态
newRegion.status = "1";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0x2894FF);
newRegion.regionType = "startRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
//入口乘客比例
newRegion.startWeight = regionData[i].startWeight;
//出口乘客比例
newRegion.endWeight = regionData[i].endWeight;
//目标权重
newRegion.targetWeight = regionData[i].targetWeight;
//区域状态
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
}

View File

@ -0,0 +1,91 @@
//售票区域
export function ticketRegion() {
let scope = this;
this.list = [];
this.group = new THREE.Group();
this.creatTicketRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
//停留时间
newRegion.stayTime = 0;
//区域状态
newRegion.status = "1";
//连接设备
newRegion.connectDevice = "*";
//运行状态
newRegion.runType = "auto";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0x00FFFF);
newRegion.regionType = "ticketRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
newRegion.runType = regionData[i].runType;
newRegion.connectDevice = regionData[i].connectDevice;
newRegion.stayTime = regionData[i].stayTime;
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
}

View File

@ -0,0 +1,80 @@
//禁行区域
export function unaccessRegion() {
let scope = this;
this.list = [];
this.group = new THREE.Group();
this.creatUnaccessRegion = function(regionType,regionColor,pos,underFloor){
let newRegion = creatRegion(regionColor);
newRegion.regionType = regionType;
newRegion.deviceType = "region";
newRegion.status = "1";
newRegion.position.set(
pos.x,
pos.y+0.1,
pos.z
);
newRegion.underFloor = underFloor;
newRegion.renderOrder = 8;
scope.group.add(newRegion);
};
this.loadRegionData = function(regionData){
if(regionData.length>0){
for(let i=0;i<regionData.length;i++){
let newRegion = creatRegion(0x272727);
newRegion.regionType = "unaccessRegion";
newRegion.deviceType = "region";
newRegion.name = regionData[i].name;
newRegion.status = regionData[i].status;
newRegion.underFloor = regionData[i].underFloor;
newRegion.position.set(
regionData[i].pos.x,
regionData[i].pos.y,
regionData[i].pos.z
);
newRegion.rotation.set(
regionData[i].rot.x,
regionData[i].rot.y,
regionData[i].rot.z
);
newRegion.renderOrder = 8;
scope.group.add(newRegion);
}
}
}
function creatRegion(color){
let region = new THREE.Group();
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 4 );
var material = new THREE.MeshBasicMaterial( { color: color } );
let regionHead = new THREE.Mesh( geometry, material );
regionHead.rotation.x = -Math.PI/2;
regionHead.position.y = 0.01;
region.add(regionHead);
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(1,-1,0);
var v2 = new THREE.Vector3(-1,-1,0);
var v3 = new THREE.Vector3(0,-2,0);
geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);
geom.faces.push(new THREE.Face3(0, 1, 2));
geom.computeFaceNormals();
var material = new THREE.MeshBasicMaterial( { color: color } );
var regionDirect= new THREE.Mesh(geom, material);
regionDirect.rotation.x = -Math.PI/2;
regionDirect.position.y = 0.01;
region.add(regionDirect);
return region;
}
}

View File

@ -0,0 +1,290 @@
import { startRegion } from '@/jlmap3d/jl3dstationmanager/model/region/startRegion.js';
import { securityRegion } from '@/jlmap3d/jl3dstationmanager/model/region/securityRegion.js';
import { checkRegion } from '@/jlmap3d/jl3dstationmanager/model/region/checkRegion.js';
import { standRegion } from '@/jlmap3d/jl3dstationmanager/model/region/standRegion.js';
import { ticketRegion } from '@/jlmap3d/jl3dstationmanager/model/region/ticketRegion.js';
import { elevatorRegion } from '@/jlmap3d/jl3dstationmanager/model/region/elevatorRegion.js';
import { stairsRegion } from '@/jlmap3d/jl3dstationmanager/model/region/stairsRegion.js';
import { escalatorRegion } from '@/jlmap3d/jl3dstationmanager/model/region/escalatorRegion.js';
import { unaccessRegion } from '@/jlmap3d/jl3dstationmanager/model/region/unaccessRegion.js';
//区域管理器
export function regionManager() {
var scope = this;
this.name = "test";
this.startRegion = new startRegion();
this.securityRegion = new securityRegion();
this.checkRegion = new checkRegion();
this.standRegion = new standRegion();
this.ticketRegion = new ticketRegion();
this.elevatorRegion = new elevatorRegion();
this.stairsRegion = new stairsRegion();
this.escalatorRegion = new escalatorRegion();
this.unaccessRegion = new unaccessRegion();
let group = null;
this.initRegionManager = function(control){
group = control.drawGroup;
control.drawGroup.add(scope.startRegion.group);
control.drawGroup.add(scope.securityRegion.group);
control.drawGroup.add(scope.checkRegion.group);
control.drawGroup.add(scope.standRegion.group);
control.drawGroup.add(scope.ticketRegion.group);
control.drawGroup.add(scope.elevatorRegion.group);
control.drawGroup.add(scope.stairsRegion.group);
control.drawGroup.add(scope.escalatorRegion.group);
control.drawGroup.add(scope.unaccessRegion.group);
}
this.creatRegion = function(regionType,regionColor,pos,underFloor){
switch(regionType){
case "startRegion":
scope.startRegion.creatStartRegion(regionType,regionColor,pos,underFloor);
break;
case "securityRegion":
scope.securityRegion.creatSecurityRegion(regionType,regionColor,pos,underFloor);
break;
case "checkRegion":
scope.checkRegion.creatCheckRegion(regionType,regionColor,pos,underFloor);
break;
case "standRegion":
scope.standRegion.creatStandRegion(regionType,regionColor,pos,underFloor);
break;
case "ticketRegion":
scope.ticketRegion.creatTicketRegion(regionType,regionColor,pos,underFloor);
break;
case "elevatorRegion":
scope.elevatorRegion.creatElevatorRegion(regionType,regionColor,pos,underFloor);
break;
case "stairsRegion":
scope.stairsRegion.creatStairsRegion(regionType,regionColor,pos,underFloor);
break;
case "escalatorRegion":
scope.escalatorRegion.creatEscalatorRegion(regionType,regionColor,pos,underFloor);
break;
case "unaccessRegion":
scope.unaccessRegion.creatUnaccessRegion(regionType,regionColor,pos,underFloor);
break;
default:break;
}
};
//存储区域数据
this.saveRegionData = function(){
// console.log();
let newSaveData = {
startRegion:[],
securityRegion:[],
checkRegion:[],
standRegion:[],
ticketRegion:[],
elevatorRegion:[],
stairsRegion:[],
escalatorRegion:[],
unaccessRegion:[],
};
for(let i=0;i<scope.startRegion.group.children.length;i++){
newSaveData.startRegion.push({
name:scope.startRegion.group.children[i].name,
status:scope.startRegion.group.children[i].status,
startWeight:scope.startRegion.group.children[i].startWeight,
endWeight:scope.startRegion.group.children[i].endWeight,
targetWeight:scope.startRegion.group.children[i].targetWeight,
connectDevice:scope.startRegion.group.children[i].connectDevice,
underFloor:scope.startRegion.group.children[i].underFloor,
pos:{
x:scope.startRegion.group.children[i].position.x,
y:scope.startRegion.group.children[i].position.y,
z:scope.startRegion.group.children[i].position.z
},
rot:{
x:scope.startRegion.group.children[i].rotation.x,
y:scope.startRegion.group.children[i].rotation.y,
z:scope.startRegion.group.children[i].rotation.z
},
});
}
for(let i=0;i<scope.securityRegion.group.children.length;i++){
newSaveData.securityRegion.push({
name:scope.securityRegion.group.children[i].name,
status:scope.securityRegion.group.children[i].status,
stayTime:scope.securityRegion.group.children[i].stayTime,
connectDevice:scope.securityRegion.group.children[i].connectDevice,
underFloor:scope.securityRegion.group.children[i].underFloor,
pos:{
x:scope.securityRegion.group.children[i].position.x,
y:scope.securityRegion.group.children[i].position.y,
z:scope.securityRegion.group.children[i].position.z
},
rot:{
x:scope.securityRegion.group.children[i].rotation.x,
y:scope.securityRegion.group.children[i].rotation.y,
z:scope.securityRegion.group.children[i].rotation.z
},
});
}
for(let i=0;i<scope.checkRegion.group.children.length;i++){
newSaveData.checkRegion.push({
name:scope.checkRegion.group.children[i].name,
status:scope.checkRegion.group.children[i].status,
connectDevice:scope.checkRegion.group.children[i].connectDevice,
underFloor:scope.checkRegion.group.children[i].underFloor,
pos:{
x:scope.checkRegion.group.children[i].position.x,
y:scope.checkRegion.group.children[i].position.y,
z:scope.checkRegion.group.children[i].position.z
},
rot:{
x:scope.checkRegion.group.children[i].rotation.x,
y:scope.checkRegion.group.children[i].rotation.y,
z:scope.checkRegion.group.children[i].rotation.z
},
});
}
for(let i=0;i<scope.standRegion.group.children.length;i++){
newSaveData.standRegion.push({
name:scope.standRegion.group.children[i].name,
status:scope.standRegion.group.children[i].status,
direction:scope.standRegion.group.children[i].direction,
underFloor:scope.standRegion.group.children[i].underFloor,
pos:{
x:scope.standRegion.group.children[i].position.x,
y:scope.standRegion.group.children[i].position.y,
z:scope.standRegion.group.children[i].position.z
},
rot:{
x:scope.standRegion.group.children[i].rotation.x,
y:scope.standRegion.group.children[i].rotation.y,
z:scope.standRegion.group.children[i].rotation.z
},
});
}
for(let i=0;i<scope.ticketRegion.group.children.length;i++){
newSaveData.ticketRegion.push({
name:scope.ticketRegion.group.children[i].name,
status:scope.ticketRegion.group.children[i].status,
stayTime:scope.ticketRegion.group.children[i].stayTime,
runType:scope.ticketRegion.group.children[i].runType,
connectDevice:scope.ticketRegion.group.children[i].connectDevice,
underFloor:scope.ticketRegion.group.children[i].underFloor,
pos:{
x:scope.ticketRegion.group.children[i].position.x,
y:scope.ticketRegion.group.children[i].position.y,
z:scope.ticketRegion.group.children[i].position.z
},
rot:{
x:scope.ticketRegion.group.children[i].rotation.x,
y:scope.ticketRegion.group.children[i].rotation.y,
z:scope.ticketRegion.group.children[i].rotation.z
},
});
}
for(let i=0;i<scope.elevatorRegion.group.children.length;i++){
newSaveData.elevatorRegion.push({
name:scope.elevatorRegion.group.children[i].name,
status:scope.elevatorRegion.group.children[i].status,
connectDevice:scope.elevatorRegion.group.children[i].connectDevice,
underFloor:scope.elevatorRegion.group.children[i].underFloor,
pos:{
x:scope.elevatorRegion.group.children[i].position.x,
y:scope.elevatorRegion.group.children[i].position.y,
z:scope.elevatorRegion.group.children[i].position.z
},
rot:{
x:scope.elevatorRegion.group.children[i].rotation.x,
y:scope.elevatorRegion.group.children[i].rotation.y,
z:scope.elevatorRegion.group.children[i].rotation.z
},
});
}
for(let i=0;i<scope.stairsRegion.group.children.length;i++){
newSaveData.stairsRegion.push({
name:scope.stairsRegion.group.children[i].name,
status:scope.stairsRegion.group.children[i].status,
connectDevice:scope.stairsRegion.group.children[i].connectDevice,
underFloor:scope.stairsRegion.group.children[i].underFloor,
pos:{
x:scope.stairsRegion.group.children[i].position.x,
y:scope.stairsRegion.group.children[i].position.y,
z:scope.stairsRegion.group.children[i].position.z
},
rot:{
x:scope.stairsRegion.group.children[i].rotation.x,
y:scope.stairsRegion.group.children[i].rotation.y,
z:scope.stairsRegion.group.children[i].rotation.z
},
});
}
for(let i=0;i<scope.escalatorRegion.group.children.length;i++){
newSaveData.escalatorRegion.push({
name:scope.escalatorRegion.group.children[i].name,
status:scope.escalatorRegion.group.children[i].status,
connectDevice:scope.escalatorRegion.group.children[i].connectDevice,
underFloor:scope.escalatorRegion.group.children[i].underFloor,
pos:{
x:scope.escalatorRegion.group.children[i].position.x,
y:scope.escalatorRegion.group.children[i].position.y,
z:scope.escalatorRegion.group.children[i].position.z
},
rot:{
x:scope.escalatorRegion.group.children[i].rotation.x,
y:scope.escalatorRegion.group.children[i].rotation.y,
z:scope.escalatorRegion.group.children[i].rotation.z
},
});
}
for(let i=0;i<scope.unaccessRegion.group.children.length;i++){
newSaveData.unaccessRegion.push({
name:scope.unaccessRegion.group.children[i].name,
status:scope.unaccessRegion.group.children[i].status,
underFloor:scope.unaccessRegion.group.children[i].underFloor,
pos:{
x:scope.unaccessRegion.group.children[i].position.x,
y:scope.unaccessRegion.group.children[i].position.y,
z:scope.unaccessRegion.group.children[i].position.z
},
rot:{
x:scope.unaccessRegion.group.children[i].rotation.x,
y:scope.unaccessRegion.group.children[i].rotation.y,
z:scope.unaccessRegion.group.children[i].rotation.z
},
});
}
return newSaveData;
};
//读取区域数据
this.loadRegionData = function(data){
console.log(data);
scope.startRegion.loadRegionData(data.startRegion);
scope.securityRegion.loadRegionData(data.securityRegion);
scope.checkRegion.loadRegionData(data.checkRegion);
scope.standRegion.loadRegionData(data.standRegion);
scope.ticketRegion.loadRegionData(data.ticketRegion);
scope.elevatorRegion.loadRegionData(data.elevatorRegion);
scope.stairsRegion.loadRegionData(data.stairsRegion);
scope.escalatorRegion.loadRegionData(data.escalatorRegion);
scope.unaccessRegion.loadRegionData(data.unaccessRegion);
};
//获取区域范围内点
this.getInitPos = function(name){
};
//获取目标区域
this.getTargetPos = function(name){
};
}

View File

@ -1,331 +0,0 @@
import { ZoneModel } from '@/jlmap3d/jl3dstationmanager/model/zonemodel.js';
//进站区域1
let enter1 = {
code : '001',
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)
]
};
//进站区域2
let enter2 = {
code : '002',
name : "enter2",
type : "normal",
stage : "0",
randompoint : new THREE.Vector3(27,9.8,16),
railpoints : [
new THREE.Vector3(34,9.8,31.5),
new THREE.Vector3(32,9.8,31.5)
]
};
//安检区域
let security = {
code : '003',
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)
]
};
//进方向闸机区域
let entergate = {
code : '004',
name : "entergate",
type : "device",
stage : "2",
randompoint : new THREE.Vector3(2.3,9.8,13),
railpoints : [
new THREE.Vector3(6.3,9.8,18.1),
new THREE.Vector3(4.8,9.8,18.1),
new THREE.Vector3(3.4,9.8,18.1),
new THREE.Vector3(2.1,9.8,18.1),
new THREE.Vector3(0.7,9.8,18.1)
]
};
//站台上车区域
let standtop = {
code : '005',
name : "standtop",
type : "stand",
stage : "3",
randompoint : new THREE.Vector3(-64,1.77,0.38),
doorpoints:[
new THREE.Vector3(-62.1,1.77,-4.38),
new THREE.Vector3(-57.54,1.77,-4.38),
new THREE.Vector3(-53.1,1.77,-4.38),
new THREE.Vector3(-42.5,1.77,-4.38),
new THREE.Vector3(-37.6,1.77,-4.38),
new THREE.Vector3(-33.6,1.77,-4.38),
new THREE.Vector3(-20.8,1.77,-4.38),
new THREE.Vector3(-16.6,1.77,-4.38),
new THREE.Vector3(-12,1.77,-4.38),
new THREE.Vector3(0.5,1.77,-4.38),
new THREE.Vector3(4.8,1.77,-4.38),
new THREE.Vector3(9.27,1.77,-4.38),
new THREE.Vector3(21.6,1.77,-4.38),
new THREE.Vector3(26.2,1.77,-4.38),
new THREE.Vector3(30.48,1.77,-4.38),
new THREE.Vector3(43.2,1.77,-4.38),
new THREE.Vector3(47.5,1.77,-4.38),
new THREE.Vector3(51.9,1.77,-4.38)
],
// new THREE.Vector3(-62.84,1.77,-4.38),
// new THREE.Vector3(-58.11,1.77,-4.38),
// new THREE.Vector3(-53.47,1.77,-4.38),
// new THREE.Vector3(-45.45,1.77,-4.38),
// new THREE.Vector3(-41.1,1.77,-4.38),
// new THREE.Vector3(-36.33,1.77,-4.38),
// new THREE.Vector3(-31.5,1.77,-4.38),
// new THREE.Vector3(-23.65,1.77,-4.38),
// new THREE.Vector3(-18.98,1.77,-4.38),
// new THREE.Vector3(-14.46,1.77,-4.38),
// new THREE.Vector3(-10,1.77,-4.38),
// new THREE.Vector3(-2.2,1.77,-4.38),
// new THREE.Vector3(2.49,1.77,-4.38),
// new THREE.Vector3(7.17,1.77,-4.38),
// new THREE.Vector3(11.8,1.77,-4.38),
// new THREE.Vector3(19.41,1.77,-4.38),
// new THREE.Vector3(24.09,1.77,-4.38),
// new THREE.Vector3(28.72,1.77,-4.38),
// new THREE.Vector3(33.46,1.77,-4.38),
// new THREE.Vector3(41.24,1.77,-4.38),
// new THREE.Vector3(45.82,1.77,-4.38),
// new THREE.Vector3(50.69,1.77,-4.38)
railpoints : [
new THREE.Vector3(53.1,1.77,-1.8),
new THREE.Vector3(-63.5,1.77,-1.8)
]
};
//站台下车区域
let standdown = {
code : '006',
name : "standdown",
type : "stand",
stage : "3",
randompoint : new THREE.Vector3(-64,1.77,21),
doorpoints:[
new THREE.Vector3(-62.1,1.77,27),
new THREE.Vector3(-57.54,1.77,27),
new THREE.Vector3(-53.1,1.77,27),
new THREE.Vector3(-42.5,1.77,27),
new THREE.Vector3(-37.6,1.77,27),
new THREE.Vector3(-33.6,1.77,27),
new THREE.Vector3(-20.8,1.77,27),
new THREE.Vector3(-16.6,1.77,27),
new THREE.Vector3(-12,1.77,27),
new THREE.Vector3(0.5,1.77,27),
new THREE.Vector3(4.8,1.77,27),
new THREE.Vector3(9.27,1.77,27),
new THREE.Vector3(21.6,1.77,27),
new THREE.Vector3(26.2,1.77,27),
new THREE.Vector3(30.48,1.77,27),
new THREE.Vector3(43.2,1.77,27),
new THREE.Vector3(47.5,1.77,27),
new THREE.Vector3(51.9,1.77,27)
],
// new THREE.Vector3(-62.84,1.77,27),
// new THREE.Vector3(-58.11,1.77,27),
// new THREE.Vector3(-53.47,1.77,27),
// new THREE.Vector3(-45.45,1.77,27),
// new THREE.Vector3(-41.1,1.77,27),
// new THREE.Vector3(-36.33,1.77,27),
// new THREE.Vector3(-31.5,1.77,27),
// new THREE.Vector3(-23.65,1.77,27),
// new THREE.Vector3(-18.98,1.77,27),
// new THREE.Vector3(-14.46,1.77,27),
// new THREE.Vector3(-10,1.77,27),
// new THREE.Vector3(-2.2,1.77,27),
// new THREE.Vector3(2.49,1.77,27),
// new THREE.Vector3(7.17,1.77,27),
// new THREE.Vector3(11.8,1.77,27),
// new THREE.Vector3(19.41,1.77,27),
// new THREE.Vector3(24.09,1.77,27),
// new THREE.Vector3(28.72,1.77,27),
// new THREE.Vector3(33.46,1.77,27),
// new THREE.Vector3(41.24,1.77,27),
// new THREE.Vector3(45.82,1.77,27),
// new THREE.Vector3(50.69,1.77,27)
railpoints : [
new THREE.Vector3(53.1,1.77,24),
new THREE.Vector3(-64,1.77,24)
]
};
//4是刚下车状态
//出方向闸机区域
let exitgate = {
code : '007',
name : "exitgate",
type : "device",
stage : "5",
randompoint : new THREE.Vector3(-16,9.8,-0.4),
railpoints : [
new THREE.Vector3(18,9.8,-0.27),
new THREE.Vector3(18,9.8,1.18),
new THREE.Vector3(18,9.8,2.64),
new THREE.Vector3(18,9.8,4.1),
new THREE.Vector3(18,9.8,5.4)
]
};
//出站台区域1
let exit1 = {
code : '008',
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)
]
};
//出站台区域2
let exit2 = {
code : '009',
name : "exit2",
type : "normal",
stage : "6",
randompoint : new THREE.Vector3(),
railpoints : [
new THREE.Vector3(28.3,9.8,28),
new THREE.Vector3(30.2,9.8,28)
]
};
let enternum = 0;
let exitnum = 0;
//区域管理器
export function ZoneManager() {
var scope = this;
this.name = "test";
this.list = [];
initzone();
//初始化区域对象
function initzone(){
scope.list[enter1.name] = new ZoneModel(enter1);
scope.list[enter2.name] = new ZoneModel(enter2);
scope.list[security.name] = new ZoneModel(security);
scope.list[entergate.name] = new ZoneModel(entergate);
scope.list[standtop.name] = new ZoneModel(standtop);
scope.list[standdown.name] = new ZoneModel(standdown);
scope.list[exitgate.name] = new ZoneModel(exitgate);
scope.list[exit1.name] = new ZoneModel(exit1);
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.getstandposition = function(name){
let n = Math.round(Math.random()*17);
if(n>=1){
n=n;
}else{
n=0;
}
let randompoint = new THREE.Vector3(0,scope.list[name].doorpoints[n].y,0);
if(name == "standtop"){
randompoint.x = scope.list[name].doorpoints[n].x + Math.random()*3;
randompoint.z = scope.list[name].doorpoints[n].z +4+Math.random()*5;
}
if(name == "standdown"){
randompoint.x = scope.list[name].doorpoints[n].x + Math.random()*3;
randompoint.z = scope.list[name].doorpoints[n].z -4-Math.random()*5;
}
let standdata = {
door:n,
point:randompoint
};
return standdata;
}
this.getgateposition = function(name){
let randompoint = new THREE.Vector3(0,0,0);
let standdata = {
door:null,
point:null
};
if(name == "entergate"){
randompoint.x = scope.list[name].railpoints[enternum].x ;
randompoint.y = scope.list[name].railpoints[enternum].y ;
randompoint.z = scope.list[name].railpoints[enternum].z ;
standdata.door = 4-enternum;
enternum += 1;
if(enternum>4){
enternum = 0;
}
}
if(name == "exitgate"){
randompoint.x = scope.list[name].railpoints[exitnum].x ;
randompoint.y = scope.list[name].railpoints[exitnum].y ;
randompoint.z = scope.list[name].railpoints[exitnum].z ;
standdata.door = 4-exitnum;
exitnum += 1;
if(exitnum>4){
exitnum = 0;
}
}
standdata.point = randompoint;
return standdata;
}
this.getzoneposition = function(name){
// let random = Math.random();
let position = scope.list[name].railline.getPointAt(Math.random());
return position;
}
this.zoneActionCheck = function(){
}
}

View File

@ -1,20 +0,0 @@
export function ZoneModel(data) {
var scope = this;
//code
this.code = data.code;
//命名
this.name = data.name;
this.type = data.type;
this.stage = data.stage;
this.status = 0;
this.randompoint = data.randompoint;
//轨迹点
this.railpoints = data.railpoints;
this.railline = new THREE.CatmullRomCurve3(data.railpoints);
if(data.doorpoints){
this.doorpoints = data.doorpoints;
}else{
this.doorpoints = null;
}
}

View File

@ -22,7 +22,7 @@ export function PathFinder(){
// load a resource // load a resource
loaderObj.load( loaderObj.load(
// resource URL // resource URL
JL3D_LOCAL_STATIC+'/jl3d/path/path.obj', JL3D_LOCAL_STATIC+'/jl3d/path/stationmanager.obj',
// called when resource is loaded // called when resource is loaded
function ( object ) { function ( object ) {

View File

@ -6,7 +6,7 @@
<el-tab-pane label="基础区域绘制" name="trackedit" > <el-tab-pane label="基础区域绘制" name="trackedit" >
<el-row> <el-row>
<el-button id="stationRegion" class="editbutton stationRegion" @click="actionClick($event)">入口区域</el-button> <el-button id="startRegion" class="editbutton startRegion" @click="actionClick($event)">入口区域</el-button>
</el-row> </el-row>
<el-row> <el-row>
<el-button id="securityRegion" class="editbutton securityRegion" @click="actionClick($event)">安检区域</el-button> <el-button id="securityRegion" class="editbutton securityRegion" @click="actionClick($event)">安检区域</el-button>
@ -141,7 +141,7 @@ export default {
padding: 1cm padding: 1cm
} }
.stationRegion{ .startRegion{
background:#2894FF; background:#2894FF;
} }
.securityRegion{ .securityRegion{

View File

@ -4,8 +4,58 @@
<el-tabs class="mapControl" :tab-position="tabPosition" v-model="activeName" type="card" @tab-click="handleClick" > <el-tabs class="mapControl" :tab-position="tabPosition" v-model="activeName" type="card" @tab-click="handleClick" >
<el-tab-pane label="区域属性" name="trackedit" > <el-tab-pane label="区域属性" name="regionEditor" >
<el-form ref="form" label-width="130px" size="mini" v-if="selectModel">
<el-form-item label="uuid:" v-if="selectModel.uuid" disabled="true">
<el-input v-model="selectModel.uuid" ></el-input>
</el-form-item>
<el-form-item label="区域类型:" v-if="selectModel.regionType" disabled="true">
<el-input v-model="selectModel.regionType"></el-input>
</el-form-item>
<el-form-item label="区域状态:" v-if="selectModel.status" disabled="true">
<el-input v-model="selectModel.status"></el-input>
</el-form-item>
<el-form-item label="入口乘客比例:" v-if="selectModel.startWeight" disabled="true">
<el-input v-model="selectModel.startWeight"></el-input>
</el-form-item>
<el-form-item label="出口乘客比例:" v-if="selectModel.endWeight" disabled="true">
<el-input v-model="selectModel.endWeight"></el-input>
</el-form-item>
<el-form-item label="买票乘客比例:" v-if="selectModel.targetWeight" disabled="true">
<el-input v-model="selectModel.targetWeight"></el-input>
</el-form-item>
<el-form-item label="乘客停留时间:" v-if="selectModel.stayTime" disabled="true">
<el-input v-model="selectModel.stayTime"></el-input>
</el-form-item>
<el-form-item label="售票处状态:" v-if="selectModel.runType" disabled="true">
<el-input v-model="selectModel.runType"></el-input>
</el-form-item>
<el-form-item label="站台方向:" v-if="selectModel.direction" disabled="true">
<el-input v-model="selectModel.direction"></el-input>
</el-form-item>
<el-form-item label="连接设备:" v-if="selectModel.connectDevice" disabled="true">
<el-input v-model="selectModel.connectDevice"></el-input>
</el-form-item>
<!-- <el-button v-if="selectModel.meshtype == 'section'" @click="leftAlignment">区段左对齐</el-button>
<el-button v-if="selectModel.meshtype == 'section'" @click="rightAlignment">区段右对齐</el-button> -->
</el-form>
</el-tab-pane> </el-tab-pane>
@ -35,6 +85,7 @@ export default {
tabPosition:'top', tabPosition:'top',
size:'medium', size:'medium',
isActive:-1, isActive:-1,
selectModel:null,
} }
}, },
beforeDestroy() { beforeDestroy() {
@ -42,21 +93,18 @@ export default {
}, },
mounted() { mounted() {
window.jl3dStationManagerUpdateSelectModel = this.jl3dStationManagerUpdateSelectModel;
}, },
methods: { methods: {
init: function() { init: function() {
}, },
back() { back: function() {
}, },
handleClick(tab, event) { handleClick: function(tab, event) {
// console.log(tab);
// if(tab.name == "pathedit"){
// this.$emit('saction',this.activeName);
// }
this.isActive = -1; this.isActive = -1;
if(tab.name == "trackedit"){ if(tab.name == "trackedit"){
@ -72,7 +120,11 @@ export default {
} }
},
jl3dStationManagerUpdateSelectModel: function(selected){
this.selectModel = selected;
this.activeName = "regionEditor";
console.log(this.selectModel);
}, },

View File

@ -3,16 +3,56 @@
<el-row class="managerbutton"> <el-row class="managerbutton">
<el-button @click="switchViews" round>{{switchButtonName}}</el-button> <el-button @click="switchViews" round>{{switchButtonName}}</el-button>
<!-- 仿真操作按钮 --> <!-- 仿真操作按钮 -->
<el-button round >显示隐藏区域</el-button> <el-button v-show="!viewStatus" round @click="startSimulation">开始仿真</el-button>
<el-button round >显示隐藏热力图</el-button> <el-button v-show="!viewStatus" round >显示隐藏区域</el-button>
<el-button v-show="!viewStatus" round >显示隐藏热力图</el-button>
<!-- 绘图操作按钮 --> <!-- 绘图操作按钮 -->
<el-button round @click="deleteRegion">删除区域</el-button> <el-button v-show="viewStatus" round @click="deleteRegion">删除区域</el-button>
<el-button round>保存方案</el-button> <el-button v-show="viewStatus" round @click="saveData">保存方案</el-button>
<el-button round>加载方案</el-button> <el-button v-show="viewStatus" round @click="loadData">加载方案</el-button>
<!-- 其他 --> <!-- 其他 -->
<el-button round>退出</el-button> <el-button round>退出</el-button>
</el-row> </el-row>
<Draw-Type @changeDrawType=changeDrawType ></Draw-Type>
<div class="dataLoadDiv" v-show="showSaveList">
<el-input v-model="saveDataName"></el-input>
<div class="modelname" @click="saveNewData(saveDataName)">存新方案</div>
<div class="modelname" @click="updateSaveData(saveDataName)">更新方案</div>
</div>
<div class="dataLoadDiv" v-show="showLoadList">
<div class="dataLoadTittle">已存储方案列表:</div>
<el-scrollbar style="margin-bottom:1px">
<el-form ref="form" label-width="130px" size="mini">
<div class="dataListDiv" v-for="(asset,index) in nowDataList" >
<div >
<div class="modelname">方案名称:{{asset.name }}</div>
<div class="modelname">方案修改日期:{{asset.updateTime }}</div>
<div class="modelname" @click="modelSelect(asset.id)">加载方案</div>
<div class="modelname" @click="deletSelect(asset.id)">删除方案</div>
</div>
</div>
</el-form>
</el-scrollbar>
</div>
<div v-show="!viewStatus" class="station" :style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}">
<div style="margin-top:5%;font-size: 30px;">当前车站:</div>
<el-select v-model="value" class="listmenu" placeholder="当前车站" @change="currentsel">
<el-option
v-for="item in stationlist"
:key="item.name"
:label="item.text"
:value="item.name"
:disabled="item.disabled"
/>
</el-select>
</div>
<Station-Data v-show="!viewStatus"></Station-Data>
<Draw-Type v-show="viewStatus" @changeDrawType=changeDrawType ></Draw-Type>
<Pro-Perty></Pro-Perty> <Pro-Perty></Pro-Perty>
<div id="jl3d" class="jl3dstationmanagerdraw"> <div id="jl3d" class="jl3dstationmanagerdraw">
</div> </div>
@ -24,20 +64,41 @@
import { Jl3dStationManager } from '@/jlmap3d/jl3dstationmanager/jl3dstationmanager.js'; import { Jl3dStationManager } from '@/jlmap3d/jl3dstationmanager/jl3dstationmanager.js';
import StationData from '@/views/jlmap3d/trafficplan/component/stationdata';
import DrawType from '@/views/jlmap3d/stationmanager/component/drawtype'; import DrawType from '@/views/jlmap3d/stationmanager/component/drawtype';
import ProPerty from '@/views/jlmap3d/stationmanager/component/property'; import ProPerty from '@/views/jlmap3d/stationmanager/component/property';
import { saveStationManagerData,updateStationManagerData,getStationManagerDataList,getStationManagerData,deleteStationManagerData} from '@/api/jlmap3d/load3ddata';
export default { export default {
name: 'jl3devacuation', name: 'jl3devacuation',
components: { components: {
StationData,
DrawType, DrawType,
ProPerty, ProPerty,
}, },
data() { data() {
return { return {
group:'',
mapid:'',
lineCode:'',
deviceCode:'',
localStatic:JL3D_LOCAL_STATIC, localStatic:JL3D_LOCAL_STATIC,
jl3d: null, jl3d: null,
switchButtonName:'仿真视角', switchButtonName:'仿真视角',
viewStatus:false, viewStatus:false,
stationlist:[],
value:'',
nowDataList:[
{
name:"test",
updateTime:"2021年3月5日",
},
],
showLoadList:false,
showSaveList:false,
dataId:null,
saveDataName:"",
} }
}, },
watch: { watch: {
@ -48,8 +109,12 @@
}, },
mounted() { mounted() {
window.updatestationlist = this.updatestationlist;
this.group = this.$route.query.group;
this.mapid = this.$route.query.mapid;
this.lineCode = this.$route.query.lineCode;
this.initCode = this.$route.query.deviceCode;
this.initnewdata(); this.initnewdata();
}, },
beforeDestroy() { beforeDestroy() {
@ -57,7 +122,7 @@
methods: { methods: {
initnewdata: function (group,header){ initnewdata: function (group,header){
let dom = document.getElementById('jl3d'); let dom = document.getElementById('jl3d');
this.jl3d = new Jl3dStationManager(dom); this.jl3d = new Jl3dStationManager(dom,this.mapid,this.group,this.initCode);
}, },
changeDrawType(drawTypeName){ changeDrawType(drawTypeName){
// console.log(drawTypeName); // console.log(drawTypeName);
@ -74,10 +139,92 @@
this.viewStatus = false; this.viewStatus = false;
this.jl3d.changeControlMode(false); this.jl3d.changeControlMode(false);
} }
},
startSimulation(){
}, },
deleteRegion(){ deleteRegion(){
this.jl3d.deleteRegion(); this.jl3d.deleteRegion();
}, },
currentsel(selVal) {
this.jl3d.changestation(selVal);
// let oldgroupnum = this.groupnum;
this.value = selVal;
},
saveData(){
this.showSaveList = true;
},
saveNewData(nowName){
let newSaveData = this.jl3d.saveAllData();
newSaveData.name = nowName;
saveStationManagerData(newSaveData).then(data => {
if(data.code == "200"){
//console.log("");
console.log(data);
this.dataId = data.data;
this.showSaveList = false;
}
}).catch(error => {
console.log(error);
});
},
updateSaveData(nowName){
if(this.dataId){
let newSaveData = this.jl3d.saveAllData();
newSaveData.name = nowName;
updateStationManagerData(this.dataId,newSaveData).then(data => {
if(data.code == "200"){
//console.log("");
console.log(data);
this.showSaveList = false;
}
}).catch(error => {
console.log(error);
});
}else{
}
},
loadData(){
this.showLoadList = true;
getStationManagerDataList().then(netdata => {
console.log(netdata);
this.nowDataList = netdata.data;
});
},
deletSelect(deleteId){
deleteStationManagerData(deleteId).then(netdata => {
console.log(netdata);
});
this.showLoadList = false;
},
modelSelect(loadId){
console.log(loadId);
getStationManagerData(loadId).then(netdata => {
console.log(netdata);
this.dataId = loadId;
this.saveDataName = netdata.data.name;
this.jl3d.loadData(netdata.data);
});
this.showLoadList = false;
},
updatestationlist(list,nowname) {
if(nowname){
this.value = nowname;
}else{
this.value = list[0].name;
}
for(let i=0;i<list.length;i++){
list[i].text = list[i].name+'(现有乘客'+(list[i].downpassers+list[i].toppassers)+'人)';
}
this.stationlist = list;
},
} }
} }
@ -96,8 +243,46 @@
/* left: 0; */ /* left: 0; */
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 9; /* z-index: 9; */
} }
.dataLoadDiv{
position: absolute;
z-index: 10;
width:40%;
height:60;
top:20%;
left:30%;
background-color: #fff;
border-radius:5px;
border:solid 2px #000;
}
.dataLoadTittle{
text-align:center;
font-size: 20px;
}
.dataListDiv {
float:left;
position: relative;
width:100%;
height:100px;
border-radius:5px;
border:solid 2px #000;
}
.station{
width:250px;
height:100px;
top:0;
left:0;
text-align: center;
/* right:500px; */
/* bottom:0; */
position: absolute;
background-size: 100% 100%;
border-radius:10px;
z-index: 10;
}
.managerbutton{ .managerbutton{
width:50%; width:50%;
left:25%; left:25%;

View File

@ -117,6 +117,7 @@ export default {
.stationdata{ .stationdata{
top:100px; top:100px;
left:0; left:0;
z-index: 10;
position: absolute; position: absolute;
} }
.datatab{ .datatab{

View File

@ -395,6 +395,8 @@ export default {
runPassenger(this.$route.query.group, em.deviceCode).then(netdata => { runPassenger(this.$route.query.group, em.deviceCode).then(netdata => {
if (netdata.data) { if (netdata.data) {
const routeData = this.$router.resolve({ const routeData = this.$router.resolve({
// /jlmap3d/trafficplan
// /design/jlmap3d/jl3dstationmanager
path:'/jlmap3d/trafficplan', path:'/jlmap3d/trafficplan',
query:{ query:{
mapid:this.$route.query.mapId, mapid:this.$route.query.mapId,

View File

@ -28,7 +28,6 @@
@refresh="loadInitData" @refresh="loadInitData"
@jlmap3d="jlmap3d" @jlmap3d="jlmap3d"
@assetmanager3d="assetmanager3d" @assetmanager3d="assetmanager3d"
@stationmanager3d="stationmanager3d"
/> />
</div> </div>
</div> </div>
@ -155,9 +154,7 @@ export default {
assetmanager3d() { assetmanager3d() {
this.$router.push({ path: '/design/jlmap3d/assetmanager' }); this.$router.push({ path: '/design/jlmap3d/assetmanager' });
}, },
stationmanager3d() {
this.$router.push({ path: '/design/jlmap3d/jl3dstationmanager' });
},
importMap() { importMap() {

View File

@ -102,10 +102,6 @@ export default {
label: this.$t('map.assetmanager3d'), label: this.$t('map.assetmanager3d'),
handler: this.assetmanager3d handler: this.assetmanager3d
}, },
// {
// label: this.$t('map.stationmanager3d'),
// handler: this.stationmanager3d
// },
{ {
label: this.$t('map.publish'), label: this.$t('map.publish'),
handler: this.publish handler: this.publish
@ -265,9 +261,6 @@ export default {
assetmanager3d() { assetmanager3d() {
this.$emit('assetmanager3d'); this.$emit('assetmanager3d');
}, },
stationmanager3d(){
this.$emit('stationmanager3d');
},
jlmap3d() { jlmap3d() {
this.$emit('jlmap3d'); this.$emit('jlmap3d');
}, },

File diff suppressed because it is too large Load Diff