merge
@ -6,7 +6,8 @@ NODE_ENV = 'development'
|
||||
# VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
# VUE_APP_BASE_API = 'http://192.168.3.4:9000'
|
||||
VUE_APP_BASE_API = 'http://192.168.3.6:9000'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||
VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
# VUE_APP_VOICE_API = 'http://192.168.8.110:9008'
|
||||
|
||||
|
||||
|
@ -5,3 +5,4 @@ VUE_APP_PRO = 'local'
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
8
.env.ntyl
Normal file
@ -0,0 +1,8 @@
|
||||
# just a flag
|
||||
NODE_ENV = 'production'
|
||||
VUE_APP_PRO = 'ntyl'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
@ -2,5 +2,6 @@
|
||||
NODE_ENV = 'production'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||
VUE_APP_BASE_API = 'https://api.joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
|
@ -3,4 +3,5 @@ NODE_ENV = 'test'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||
VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
|
2
.gitignore
vendored
@ -6,7 +6,7 @@ yarn-debug.log*
|
||||
yarn-error.log*
|
||||
package-lock.json
|
||||
tests/**/coverage/
|
||||
/src/utils/baseUrl.js
|
||||
src/utils/baseUrl.js*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
|
@ -9,7 +9,7 @@
|
||||
"dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve",
|
||||
"build": "vue-cli-service build --mode production",
|
||||
"test": "vue-cli-service build --mode staging",
|
||||
"local": "vue-cli-service build --mode native",
|
||||
"local": "vue-cli-service build --mode",
|
||||
"preview": "node build/index.js --preview",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
"test:unit": "jest --clearCache && vue-cli-service test:unit",
|
||||
|
@ -13,6 +13,7 @@ import { loginInfo, ProjectIcon } from '@/scripts/ProjectConfig';
|
||||
import DeomonTopic from '@/views/demonstration/deomonTopic';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import LoadingImg from '@/assets/loading.gif';
|
||||
import { openIndexedDB } from '@/utils/indexedDb';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
@ -72,8 +73,10 @@ export default {
|
||||
await this.$store.dispatch('preLogout');
|
||||
}
|
||||
});
|
||||
|
||||
this.$nextTick(() => { this.subscribe(); });
|
||||
this.$nextTick(() => {
|
||||
this.subscribe();
|
||||
openIndexedDB();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
|
@ -47,3 +47,136 @@ export function setCompanyManager(companyId, data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 获取单位所有部门 */
|
||||
export function getAllDept(companyId) {
|
||||
return request({
|
||||
url: `/api/company/${companyId}/dept`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取单位的部门树结构 */
|
||||
export function getAllDeptTree(companyId) {
|
||||
return request({
|
||||
url: `/api/company/${companyId}/dept/tree`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取部门及其子部门 */
|
||||
export function getDeptAndChild(companyId, deptId) {
|
||||
return request({
|
||||
url: `/api/company/${companyId}/dept/${deptId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取部门及其子树 */
|
||||
export function getDeptTree(companyId, deptId) {
|
||||
return request({
|
||||
url: `/api/company/${companyId}/dept/${deptId}/tree`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取单位所属的职位信息 */
|
||||
export function getCompanyPosition(companyId) {
|
||||
return request({
|
||||
url: `/api/company/${companyId}/position`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 分页获取单位的成员信息 */
|
||||
export function getCompanyMemberPaging(companyId) {
|
||||
return request({
|
||||
url: `/api/company/${companyId}/refUserInfo`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 查询职位信息 */
|
||||
export function getPositionInfo(positionId) {
|
||||
return request({
|
||||
url: `/api/company/position/${positionId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 更新职位信息 */
|
||||
export function updatePositionInfo(positionId, data) {
|
||||
return request({
|
||||
url: `/api/company/position/${positionId}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 删除职位信息 */
|
||||
export function deletePositionInfo(positionId) {
|
||||
return request({
|
||||
url: `/api/company/position/${positionId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 添加职位信息 */
|
||||
export function addPositionInfo(data) {
|
||||
return request({
|
||||
url: `/api/company/position`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 查询部门信息 */
|
||||
export function getDeptInfo(deptId) {
|
||||
return request({
|
||||
url: `/api/company/dept/${deptId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 更新部门信息 */
|
||||
export function updateDeptInfo(deptId, data) {
|
||||
return request({
|
||||
url: `/api/company/dept/${deptId}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 添加部门信息 */
|
||||
export function addDeptInfo(data) {
|
||||
return request({
|
||||
url: `/api/company/dept`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 删除部门信息 */
|
||||
export function deleteDeptInfo(deptId) {
|
||||
return request({
|
||||
url: `/api/company/dept/${deptId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 获取用户单位的部门信息 */
|
||||
export function getCompanyDeptInfo(companyId) {
|
||||
return request({
|
||||
url: `/api/company/${companyId}/userDeparts`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 导入单位成员信息 */
|
||||
export function importCompanyMember(companyId, data) {
|
||||
return request({
|
||||
url: `/api/company/${companyId}/departUserInfo/import`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 分页查询单位部门成员信息 */
|
||||
export function queryDeptInfoPaging(params) {
|
||||
return request({
|
||||
url: `/api/company/dept/${params.deptId}/departUserInfo`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 取消单位的部门成员关系 */
|
||||
export function deleteDepartUserRelation(data) {
|
||||
return request({
|
||||
url: `/api/company/departUserInfo`,
|
||||
method: 'delete',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -147,3 +147,18 @@ export function getSceneExport(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询国赛剧本权限 */
|
||||
export function queryCompetitionPracticalPermissions(params) {
|
||||
return request({
|
||||
url: `/api/v1/competitionPractical/query/permissions`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 国赛获取支付二维码 */
|
||||
export function getPayQrCode(mapId, monthAmount) {
|
||||
return request( {
|
||||
url: `/api/v1/competitionPractical/purchasePermission?mapId=${mapId}&monthAmount=${monthAmount}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ export function getIbpInfoByStation(mapId, stationCode) {
|
||||
// 获取IBP盘数据
|
||||
export function getIbpList(params) {
|
||||
return request({
|
||||
url: `/api/ibp/list`,
|
||||
url: `/api/ibp`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
@ -83,3 +83,11 @@ export function copyIbpData(data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除ibp数据绘图数据(发布的)
|
||||
export function deletePublishIbp(id) {
|
||||
return request({
|
||||
url: `/api/ibp/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
@ -15,3 +15,37 @@ export function getIscsData(params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 分页获取ISCS数据
|
||||
export function getIscsDataByPage(params) {
|
||||
return request({
|
||||
url: '/api/v1/iscs/pagedQuery',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 复制iscs数据
|
||||
export function copyIscsData(data) {
|
||||
return request({
|
||||
url: '/api/v1/iscs/copy',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除iscs数据绘图数据(发布的)
|
||||
export function deleteIscs(id) {
|
||||
return request({
|
||||
url: `/api/v1/iscs/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
// 查询地图下是否有ISCS数据
|
||||
export function queryHasIscs(params) {
|
||||
return request({
|
||||
url: `/api/v1/iscs/hasData`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
@ -1,37 +1,13 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
import { getBaseUrl } from '@/utils/baseUrl';
|
||||
|
||||
// const baseconfig = require('../../../vue.config.js');
|
||||
|
||||
const publicPath = process.env.VUE_APP_PRO == 'local' ? '' : '/cbtc';
|
||||
|
||||
// console.log(publicPath);
|
||||
const BASE_API = getBaseUrl();
|
||||
|
||||
export const JL3D_LOCAL_STATIC = publicPath+"/static";
|
||||
const BASE_UPLOAD_API = process.env.VUE_APP_UPLOAD_API;
|
||||
export const BASE_ASSET_API = process.env.VUE_APP_VOICE_API;
|
||||
// console.log(JL3D_LOCAL_STATIC);
|
||||
let uploadurl = null;
|
||||
let asseturl = null;
|
||||
|
||||
if(BASE_API == "https://test.joylink.club/jlcloud"){
|
||||
uploadurl = "https://joylink.club/jlfile";
|
||||
asseturl = "https://joylink.club/oss/joylink";
|
||||
|
||||
// uploadurl = "https://test.joylink.club/jlfile";
|
||||
// asseturl = "https://test.joylink.club/oss/joylink";
|
||||
}else if(BASE_API == "https://joylink.club/jlcloud"){
|
||||
uploadurl = "https://joylink.club/jlfile";
|
||||
asseturl = "https://joylink.club/oss/joylink";
|
||||
}else{
|
||||
uploadurl = "https://joylink.club/jlfile";
|
||||
asseturl = "https://joylink.club/oss/joylink";
|
||||
// uploadurl = "";
|
||||
// asseturl = "";
|
||||
}
|
||||
const BASE_UPLOAD_API = uploadurl;
|
||||
export const BASE_ASSET_API = asseturl;
|
||||
|
||||
// console.log(BASE_UPLOAD_API);
|
||||
// console.log(BASE_ASSET_API);
|
||||
|
||||
export function getUploadModelUrl() {
|
||||
return (BASE_UPLOAD_API+"/api/upload/MODEL?appId=00001&appSecret=joylink00001");
|
||||
|
@ -91,3 +91,43 @@ export function gousuo3dAction(group, 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',
|
||||
});
|
||||
}
|
||||
|
@ -74,9 +74,9 @@ export function getPublishLessonListByMapId(params) {
|
||||
});
|
||||
}
|
||||
/** 根据班级获取课程 */
|
||||
export function getLessonByClassId(classId) {
|
||||
export function getLessonByClassId(departId) {
|
||||
return request({
|
||||
url: `/api/lesson/class/${classId}`,
|
||||
url: `/api/lesson/depart/${departId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@ -95,10 +95,10 @@ export function aKeyGeneratingLesson(data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 根据课程ID获取班级 */
|
||||
/** 根据课程ID获取部门 */
|
||||
export function getExamClassList(lessonId) {
|
||||
return request({
|
||||
url: `/api/lesson/${lessonId}/classes`,
|
||||
url: `/api/lesson/${lessonId}/departs`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -257,3 +257,17 @@ export function getVersionList(mapId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 查询地图下车站下的区段 */
|
||||
export function getSectionListByStationCode(id, stationCode) {
|
||||
return request({
|
||||
url: `/api/map/${id}/station/${stationCode}/sections`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 查询地图下所有的区段 */
|
||||
export function getSectionListByMapId(id) {
|
||||
return request({
|
||||
url: `/api/map/${id}/sections`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -133,6 +133,25 @@ export function listRoutingData(mapId, params) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页查询公共的交路数据(新版)*/
|
||||
export function listPublicRoutingData(mapId, params) {
|
||||
return request({
|
||||
// url: `/api/mapBuild/${mapId}/routingData`,
|
||||
url: `/api/runPlan/userData/${mapId}/default/routing/page`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户拉取公共的交路数据(新版)*/
|
||||
export function pullPublicRoutingData(mapId, data) {
|
||||
return request({
|
||||
url: `/api/runPlan/userData/${mapId}/default/routing/pull`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建交路(新版)*/
|
||||
export function addRoutingData(data) {
|
||||
return request({
|
||||
@ -187,6 +206,15 @@ export function gernateRoutingSection(data) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成交路区段数据(运行图中)(新版)*/
|
||||
export function gernateRoutingSectionInRunplan(data) {
|
||||
return request({
|
||||
url: `/api/runPlan/userData/routing/path/generate`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新交路(新版)*/
|
||||
export function updateRoutingData(data) {
|
||||
return request({
|
||||
|
@ -30,11 +30,11 @@ export function endTrainingNew(args, group) {
|
||||
});
|
||||
}
|
||||
/** 发送步骤数据 (新版地图) */
|
||||
export function sendTrainingNextStepNew(data, group) {
|
||||
export function sendTrainingNextStepNew(trainingId, data, group) {
|
||||
return request({
|
||||
url: `/api/v1/training/${data.trainingId}/nextStep`,
|
||||
url: `/api/v1/training/${trainingId}/nextStep`,
|
||||
method: 'post',
|
||||
data: data.operation,
|
||||
data: data,
|
||||
params: {group}
|
||||
});
|
||||
}
|
||||
|
@ -82,3 +82,27 @@ export function getPostByProjectCode(projectCode) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 分页查询留言板
|
||||
export function queryPostPage(params) {
|
||||
return request({
|
||||
url: `/api/learn/post`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 创建留言版
|
||||
export function createPost(data) {
|
||||
return request({
|
||||
url: `/api/learn/post`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 修改留言板名称
|
||||
export function updatePost(postId, data) {
|
||||
return request({
|
||||
url: `/api/learn/${postId}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -68,3 +68,10 @@ export function givePermission(data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 创建项目权限包 */
|
||||
export function createProjectPackage(projectCode, num) {
|
||||
return request({
|
||||
url: `/api/distribute/${projectCode}/allMap/distribute?num=${num}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
@ -163,11 +163,11 @@ export function getProjectClassList(projectCode) {
|
||||
}
|
||||
|
||||
// 导出学生成绩
|
||||
export function exportStudentResults(projectCode, data) {
|
||||
export function exportStudentResults(data) {
|
||||
return request({
|
||||
url: `/api/user/project/${projectCode}/export/student`,
|
||||
url: `/api/user/scores`,
|
||||
method: 'put',
|
||||
data: data
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
@ -178,3 +178,19 @@ export function getBindWxQrCodeUrl() {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 绑定单位
|
||||
export function bindCompany(data) {
|
||||
return request({
|
||||
url: `/api/company/bind/company?${data}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 账号注册 */
|
||||
export function registerUser(data) {
|
||||
return request({
|
||||
url: `/api/userinfo/register`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -214,7 +214,21 @@ export function duplicateService(data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 平移计划
|
||||
export function movePlaningService(data) {
|
||||
return request({
|
||||
url: `/api/runPlan/draft/${data.planId}/service/${data.serviceNumber}/move`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 清除数据
|
||||
export function clearPlaningData(planId) {
|
||||
return request({
|
||||
url: `/api/runPlan/draft/${planId}/data`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 增加任务*/
|
||||
export function addPlanTrip(data) {
|
||||
return request({
|
||||
@ -413,6 +427,15 @@ export function postDailyRunPlanLoadGenerate(id) {
|
||||
});
|
||||
}
|
||||
|
||||
// 复制地图运行图到其他地图
|
||||
export function postRunPlanCopyToMaps(id, data) {
|
||||
return request({
|
||||
url: `/api/runPlan/daily/${id}/copyToMaps`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 加载通用排班计划
|
||||
export function postSchedulingCommonGenerate(mapId) {
|
||||
return request({
|
||||
@ -488,3 +511,12 @@ export function getRunLevelDetail(id) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 更新站间运行等级数据
|
||||
export function updateRunlevelDistance(mapId) {
|
||||
return request({
|
||||
url: `/api/runPlan/userData/${mapId}/runlevelDistance`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -221,9 +221,9 @@ export function executeScriptNew(group) {
|
||||
}
|
||||
|
||||
/** 处理ibp盘事件 */
|
||||
export function handlerIbpEvent(group, button, stationCode) {
|
||||
export function handlerIbpEvent(group, button, stationCode, buttonCode) {
|
||||
return request({
|
||||
url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}`,
|
||||
url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}&buttonCode=${buttonCode}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
@ -404,3 +404,36 @@ export function confirmAlarm(group, data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取客流数据基础信息
|
||||
export function getPassengerFlowData(mapId) {
|
||||
return request({
|
||||
url: `/map/${mapId}/passengerFlowData`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 仿真客流数据切换
|
||||
export function changePassengerFlowData(group, passengerFlowId) {
|
||||
return request({
|
||||
url: `/simulation/${group}/passengerFlow/${passengerFlowId}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
// 哈尔滨线路(仿真行调工作站 获取 日志信息)
|
||||
export function getLogList(group, params) {
|
||||
return request({
|
||||
url: `/simulation/${group}/log`,
|
||||
method: 'get',
|
||||
params:params
|
||||
});
|
||||
}
|
||||
/* 宁波三排列进路到 获取路径列表 */
|
||||
export function getPathListByStandCodeOrSignalCode( group, params ) {
|
||||
return request({
|
||||
url: `/simulation/${group}/querySectionPaths`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
BIN
src/assets/home_exam/exam1.png
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
src/assets/home_simulation/simulation1.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
src/assets/home_simulation/simulation2.png
Normal file
After Width: | Height: | Size: 200 KiB |
BIN
src/assets/home_simulation/simulation3.png
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
src/assets/home_simulation/simulation4.png
Normal file
After Width: | Height: | Size: 270 KiB |
BIN
src/assets/home_simulation/simulation5.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
src/assets/home_teach/teach1.png
Normal file
After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 120 KiB |
BIN
src/assets/icon/favicon_cgy.png
Normal file
After Width: | Height: | Size: 309 KiB |
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="show" class="pop-menu" :class="popMenuClass" :style="{ left: tPosition.x+'px', top: tPosition.y+'px' }">
|
||||
<pop-menu-item v-for="(option, i) in menu" :key="i" :option="option" :pop-class="popClass" @close="close" />
|
||||
<pop-menu-item v-for="(option, i) in menu" :key="i" :option="option" :pop-class="popClass" :allowedColor="allowedColor" :disabledColor="disabledColor" @close="close" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -29,7 +29,15 @@ export default {
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
allowedColor: {
|
||||
type: String,
|
||||
default: '#000'
|
||||
},
|
||||
disabledColor: {
|
||||
type: String,
|
||||
default: '#ccc'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -11,7 +11,7 @@
|
||||
<ul v-if="isPopup" ref="popup" class="menu" :style="{display: isShow? 'block': 'table', marginLeft: marginLeft+'px'}">
|
||||
<div class="menu-pop pop-menu">
|
||||
<div v-show="isShow" class="arrow el-icon-arrow-down" />
|
||||
<pop-menu-item v-for="(el, i) in option.children" :key="i" :option="el" :pop-class="popClass" @close="close" />
|
||||
<pop-menu-item v-for="(el, i) in option.children" :key="i" :option="el" :pop-class="popClass" :allowedColor="allowedColor" :disabledColor="disabledColor" @close="close" />
|
||||
<div v-show="isShow" class="arrow el-icon-arrow-up" />
|
||||
</div>
|
||||
</ul>
|
||||
@ -51,13 +51,19 @@ export default {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
disabledColor: {
|
||||
type: String,
|
||||
default: '#000',
|
||||
},
|
||||
allowedColor: {
|
||||
type: String,
|
||||
default: '#ccc'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: -1,
|
||||
allowedColor: '#000',
|
||||
disabledColor: '#ccc'
|
||||
active: -1
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -264,7 +264,7 @@
|
||||
:placeholder="item.placeholder"
|
||||
:disabled="item.disabled"
|
||||
:value-format="'HH:mm:ss'"
|
||||
:picker-options="{ selectableRange: '00:00:00 - 23:59:59' }"
|
||||
:picker-options="{ selectableRange: item.selectableRange ||'00:00:00 - 23:59:59' }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@ -329,6 +329,18 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="checkFieldType(item, 'switchBox')">
|
||||
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">
|
||||
<el-switch
|
||||
v-model="formModel[item.prop]"
|
||||
:active-color="item.activeColor || '#13ce66'"
|
||||
:inactive-color="item.inactiveColor || '#ff4949'"
|
||||
/>
|
||||
<!-- <el-radio-group v-model="formModel[item.prop]">
|
||||
<el-radio v-for="item in item.children" :key="item.value" :label="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group> -->
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</el-form>
|
||||
|
@ -165,14 +165,6 @@
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
<div v-if="queryList.selectCheckShow" style="margin-top: 8px; margin-left: 8px;">
|
||||
<el-button
|
||||
size="mini"
|
||||
:type="'primary'"
|
||||
:disabled="!queryList.selection.length"
|
||||
@click="queryList.selectAllClick(queryList.selection)"
|
||||
>{{ $t('global.selectAdd') }}</el-button>
|
||||
</div>
|
||||
<div v-if="!queryList.paginationHiden" class="page-container " style="text-align: center; margin: 10px 0; height: 40px;">
|
||||
<el-pagination
|
||||
:current-page="pageIndex"
|
||||
@ -184,6 +176,15 @@
|
||||
@current-change="changePage"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="queryList.selectCheckShow" :class="queryList.selectCheckClass?queryList.selectCheckClass:'defaultCheckClass'">
|
||||
<el-button
|
||||
:size="queryList.selectCheckSize?queryList.selectCheckSize:'mini'"
|
||||
:type="'primary'"
|
||||
:disabled="!queryList.selection.length"
|
||||
:loading="queryList.selectCheckLoading?queryList.selectCheckLoading:false"
|
||||
@click="queryList.selectAllClick(queryList.selection)"
|
||||
>{{ queryList.selectCheckText?queryList.selectCheckText:$t('global.selectAdd') }}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@ -463,10 +464,14 @@ export default {
|
||||
if (this.queryList.afterQuery && this.queryList.afterQuery instanceof Function) {
|
||||
this.queryList.afterQuery(response.data);
|
||||
}
|
||||
|
||||
const resultData = response.data;
|
||||
this.$set(this.queryList, 'data', resultData.list);
|
||||
this.$set(this.queryList, 'total', resultData.total);
|
||||
if (resultData.pageNum) {
|
||||
this.pageIndex = resultData.pageNum;
|
||||
this.queryData[this.currentpagerConfig.pageIndex] = resultData.pageNum;
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
self.enableQuery();
|
||||
});
|
||||
@ -514,6 +519,11 @@ export default {
|
||||
onRowClick(row) {
|
||||
this.choose = row;
|
||||
},
|
||||
onReset() {
|
||||
if (this.$refs.queryForm) {
|
||||
this.$refs.queryForm.doClean();
|
||||
}
|
||||
},
|
||||
currentChoose() {
|
||||
return this.choose;
|
||||
},
|
||||
@ -585,4 +595,8 @@ export default {
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
.defaultCheckClass{
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
</style>
|
||||
|
@ -75,9 +75,9 @@ export default {
|
||||
loading: true,
|
||||
name: 'file',
|
||||
size: 3,
|
||||
action: `https://test.joylink.club/jlfile/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
|
||||
action: `${process.env.VUE_APP_UPLOAD_API}/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
|
||||
response: (res) => {
|
||||
return `https://test.joylink.club/oss/joylink${res.data}`;
|
||||
return `${process.env.VUE_APP_VOICE_API}${res.data}`;
|
||||
},
|
||||
error: () => { that.$message.error('图片上传失败,请检查网络状态'); },
|
||||
sizeError: () => { that.$message.error('图片上传失败,图片大小限制3MB'); } // 图片超过大小的回调
|
||||
|
@ -1,4 +1,4 @@
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
|
||||
export default {
|
||||
bind(el) {
|
||||
@ -10,6 +10,7 @@ export default {
|
||||
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
|
||||
|
||||
dialogHeaderEl.onmousedown = (e) => {
|
||||
e.stopPropagation();
|
||||
/** 鼠标按下,计算当前元素距离可视区的距离*/
|
||||
const disX = e.clientX - dialogHeaderEl.offsetLeft;
|
||||
const disY = e.clientY - dialogHeaderEl.offsetTop;
|
||||
@ -30,6 +31,7 @@ export default {
|
||||
}
|
||||
|
||||
document.onmousemove = function (e) {
|
||||
e.stopPropagation();
|
||||
/** 通过事件委托,计算移动的距离*/
|
||||
const l = e.clientX - disX;
|
||||
const t = e.clientY - disY;
|
||||
@ -46,6 +48,7 @@ export default {
|
||||
};
|
||||
|
||||
document.onmouseup = function () {
|
||||
e.stopPropagation();
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
};
|
||||
|
@ -183,6 +183,7 @@ export default {
|
||||
examSystem: 'Examination System',
|
||||
runPlanSystem: 'The run plan system',
|
||||
personalDetails: 'information',
|
||||
organization: 'organization',
|
||||
trainingPlatformEntrance: 'Training platform entrance',
|
||||
designPlatformEntrance: 'Design platform entrance',
|
||||
connect: 'connect',
|
||||
|
@ -41,7 +41,7 @@ export default {
|
||||
blueButton: 'Blue button',
|
||||
yellowButton: 'Yellow button',
|
||||
greenButton: 'Green button',
|
||||
grayButton: 'Gray button',
|
||||
grayButton: 'White button',
|
||||
digitalClockCode: 'Digital clock code',
|
||||
digitalClockWidth: 'Digital clock width',
|
||||
escalatorCode: 'Escalator code',
|
||||
|
@ -103,6 +103,7 @@ export default {
|
||||
statusSignalName: 'Status signal name:',
|
||||
stateSignalsPlotCoordinates: 'State signals plot coordinates:',
|
||||
equipmentStation: 'Equipment centralization station:',
|
||||
signalNoRoute:'No route',
|
||||
|
||||
lineCoding: 'Line coding:',
|
||||
lineType: 'Line type:',
|
||||
@ -144,6 +145,7 @@ export default {
|
||||
jlmap3d: '3d editing',
|
||||
publish3d: '3d',
|
||||
assetmanager3d: '3d Asset Manager',
|
||||
stationmanager3d:'3d Station Manager',
|
||||
automaticSignalList: 'Automatic signal list',
|
||||
automaticSignalCode: 'Automatic signal coding',
|
||||
signalCodeName: 'Signal name',
|
||||
@ -449,12 +451,16 @@ export default {
|
||||
trainmodelUpdate: 'Update train model',
|
||||
trainTypeName: 'Train type name:',
|
||||
trainLength: 'The length of the train:',
|
||||
trainSafeDistance: 'A safe distance from:',
|
||||
trainMaxSafeDistance: 'Maximum safe distance:',
|
||||
averageVelocity: 'The average velocity:',
|
||||
averageDeceleration: 'Mean deceleration:',
|
||||
defaultVelocity: 'The default rate:',
|
||||
maxVelocity: 'Maximum speed:',
|
||||
// trainSafeDistance: 'A safe distance from:',
|
||||
// trainMaxSafeDistance: 'Maximum safe distance:',
|
||||
// averageVelocity: 'The average velocity:',
|
||||
// averageDeceleration: 'Mean deceleration:',
|
||||
// defaultVelocity: 'The default rate:',
|
||||
// maxVelocity: 'Maximum speed:',
|
||||
trainWeight:'The weight of the train:',
|
||||
tong:'t',
|
||||
numberOfCars:'Number of cars',
|
||||
vehicle:'vehicle',
|
||||
|
||||
trainWindowCode: 'Number window code:',
|
||||
trainWindowWidth: 'Train window width:',
|
||||
@ -569,6 +575,10 @@ export default {
|
||||
signalSectionSuccessful: 'Signal close section created successfully!',
|
||||
signalSectionUpdateSucceeded: 'Update signal close to section successful!',
|
||||
|
||||
crossName:'Cross name',
|
||||
relateSectionList:'Related sectionList',
|
||||
cross:'cross',
|
||||
|
||||
belongsSection: 'Belongs section:',
|
||||
coordinateMode: 'Coordinate mode',
|
||||
sectionAssociationMode: 'Section association mode',
|
||||
|
@ -446,6 +446,7 @@ export default {
|
||||
setSwitchbackStrategyTipPrefix: 'Tip: Check the station',
|
||||
setSwitchbackStrategyTipSuffix: 'setting to run the switchback strategy',
|
||||
setSwitchbackStrategy: 'Set switchback strategy',
|
||||
setSectionFaultUnlock:'set section fault unlock',
|
||||
noSwitchback: 'No switchback',
|
||||
noOneSwitchback: 'No one switchback',
|
||||
automaticChange: 'Automatic change',
|
||||
|
@ -212,7 +212,7 @@ export default {
|
||||
addTaskHint1: 'Please set the section running time of the start section ',
|
||||
addTaskHint2: 'to the section',
|
||||
addTaskHint3: '',
|
||||
normalNew: 'Normal new',
|
||||
normalNew: 'New',
|
||||
createFromTheReleaseRunGraph: 'Create from the release run graph',
|
||||
releaseRunGraph: 'Release run graph',
|
||||
newRunGraph: 'New run graph',
|
||||
|
@ -108,7 +108,7 @@ export default {
|
||||
inputQuestionNumber: 'Please input question number',
|
||||
inputQuestionNumberError: 'The number of questions entered must be greater than 0',
|
||||
inputValidNumber: 'Please input valid number',
|
||||
inputNumberError: 'The input value must be greater than the number of questions',
|
||||
inputNumberError: 'The input value must be less than the number of questions',
|
||||
inputScorePerQuestion: 'Please input score per question',
|
||||
selectTestType: 'Please select test type',
|
||||
modifyRules: 'Modify Rules',
|
||||
|
@ -86,5 +86,8 @@ export default {
|
||||
authorApply: 'Grant application',
|
||||
AuthorList: 'Authorization code list',
|
||||
questionsRuleManage: 'Question rule manage',
|
||||
preTheoryData: 'Pre Theory Data'
|
||||
preTheoryData: 'Pre Theory Data',
|
||||
boardManage: 'Message Board Manage',
|
||||
publishIBPManage:'publish IBP Manage',
|
||||
publishISCSManage:'publish ISCS Manage'
|
||||
};
|
||||
|
@ -25,6 +25,8 @@ export default {
|
||||
linkSelectName: 'Enter the Link name',
|
||||
linkSelectDisplayLength: 'Please enter the actual length of the Link',
|
||||
|
||||
pleaseInputCrossName:'Please input cross name',
|
||||
|
||||
lengthShow: 'According to the length of the:',
|
||||
lengthFact: 'The real length:',
|
||||
color: 'color:',
|
||||
@ -114,12 +116,15 @@ export default {
|
||||
trainCode: 'The train model Code cannot be empty',
|
||||
pleaseEnterTrainTypeName: 'Please enter train type name',
|
||||
trainLength: 'Please enter train length',
|
||||
safeDistance: 'Please enter a safe distance',
|
||||
maxSafeDistance: 'Please enter the maximum safe distance',
|
||||
averageVelocity: 'Please enter average speed',
|
||||
averageDeceleration: 'Please enter average deceleration',
|
||||
defaultVelocity: 'Please enter the default speed',
|
||||
maxVelocity: 'Please enter the maximum speed',
|
||||
trainWeight:'Please enter train weight',
|
||||
numberOfCars:'Please enter number Of Cars',
|
||||
|
||||
// safeDistance: 'Please enter a safe distance',
|
||||
// maxSafeDistance: 'Please enter the maximum safe distance',
|
||||
// averageVelocity: 'Please enter average speed',
|
||||
// averageDeceleration: 'Please enter average deceleration',
|
||||
// defaultVelocity: 'Please enter the default speed',
|
||||
// maxVelocity: 'Please enter the maximum speed',
|
||||
|
||||
trainWindowWidth: 'Please enter the number window width',
|
||||
trainWindowHeight: 'Please enter the number window height',
|
||||
|
@ -146,7 +146,7 @@ export default {
|
||||
deleteListHint: 'This will delete the list, will it continue?',
|
||||
setUpASubscriptionMapSuccessfully: 'Setting up a subscription map successfully!',
|
||||
setUpASubscriptionMapFailed: 'Setting up a subscription map failed!',
|
||||
getMapStateDataException: 'Get map state data exception, please refresh the page to reload. If you encounter such problems many times, please contact the development team in an emergency!',
|
||||
getMapStateDataException: 'Simulation error! Please initial', // Get map state data exception, please refresh the page to reload. If you encounter such problems many times, please contact the development team in an emergency!
|
||||
packagedSuccessfully: 'Packaged successfully',
|
||||
oneKeyGeneratedSuccessfully: 'One key generated successfully!',
|
||||
obtainedPermissionSuccessfully: 'Successfully obtained permission',
|
||||
|
@ -183,6 +183,7 @@ export default {
|
||||
examSystem: '考试系统',
|
||||
runPlanSystem: '运行图系统',
|
||||
personalDetails: '个人信息',
|
||||
organization: '单位组织',
|
||||
trainingPlatformEntrance: '实训平台入口',
|
||||
designPlatformEntrance: '设计平台入口',
|
||||
connect: '连接',
|
||||
|
@ -1,69 +1,69 @@
|
||||
export default {
|
||||
stationName: '车站名称:',
|
||||
save: '保存',
|
||||
background: '背景板',
|
||||
line: '线条',
|
||||
text: '文字',
|
||||
rect: '矩形',
|
||||
button: '按钮',
|
||||
circularLamp: '圆形灯',
|
||||
arrow: '箭头',
|
||||
escalatorFrame: '扶梯框',
|
||||
alarm: '报警器',
|
||||
telephoneTerminal: '电话端子',
|
||||
escalator: '扶梯',
|
||||
key: '钥匙',
|
||||
digitalClock: '数字时钟',
|
||||
rotateTip: '旋转提示',
|
||||
alarmCode: '报警器编号',
|
||||
alarmWidth: '报警器宽度',
|
||||
xCoordinate: 'X轴坐标',
|
||||
yCoordinate: 'Y轴坐标',
|
||||
createNow: '立即创建',
|
||||
generateCode: '生成编号',
|
||||
escalatorFrameCode: '扶梯框编号',
|
||||
escalatorFrameWidth: '扶梯框宽度',
|
||||
escalatorFrameHeight: '扶梯框高度',
|
||||
borderWidth: '边框宽度',
|
||||
recommendedSize: '(建议尺寸25)',
|
||||
arrowCode: '箭头编号',
|
||||
arrowDirection: '箭头方向',
|
||||
arrowLength: '箭头长度',
|
||||
arrowWidth: '箭头宽度',
|
||||
arrowColor: '箭头颜色',
|
||||
vertexXCoordinate: '顶点X轴坐标',
|
||||
vertexYCoordinate: '顶点Y轴坐标',
|
||||
up: '向上',
|
||||
down: '向下',
|
||||
left: '向左',
|
||||
right: '向右',
|
||||
backgroundWidth: '背景板宽度',
|
||||
backgroundHeight: '背景板高度',
|
||||
buttonCode: '按钮编号',
|
||||
buttonColor: '按钮颜色',
|
||||
buttonWidth: '按钮宽度',
|
||||
redButton: '红色按钮',
|
||||
blueButton: '蓝色按钮',
|
||||
yellowButton: '黄色按钮',
|
||||
greenButton: '绿色按钮',
|
||||
grayButton: '灰色按钮',
|
||||
digitalClockCode: '数字时钟编号',
|
||||
digitalClockWidth: '数字时钟宽度',
|
||||
escalatorCode: '扶梯编号',
|
||||
escalatorWidth: '扶梯宽度',
|
||||
escalatorHeight: '扶梯高度',
|
||||
escalatorColor: '扶梯颜色',
|
||||
startingDirection: '启动方向',
|
||||
doNotStart: '不启动',
|
||||
startUp: '向上启动',
|
||||
startDown: '向下启动',
|
||||
keyCode: '钥匙编号',
|
||||
keyWidth: '钥匙宽度',
|
||||
keyDirection: '钥匙朝向',
|
||||
level: '水平',
|
||||
vertical: '竖直',
|
||||
upperText: '上侧文字',
|
||||
lowerText: '下侧文本',
|
||||
circularLampCode: '圆形灯编号',
|
||||
circularLampRadius: '圆形灯半径'
|
||||
stationName: '车站名称:',
|
||||
save: '保存',
|
||||
background: '背景板',
|
||||
line: '线条',
|
||||
text: '文字',
|
||||
rect: '矩形',
|
||||
button: '按钮',
|
||||
circularLamp: '圆形灯',
|
||||
arrow: '箭头',
|
||||
escalatorFrame: '扶梯框',
|
||||
alarm: '报警器',
|
||||
telephoneTerminal: '电话端子',
|
||||
escalator: '扶梯',
|
||||
key: '钥匙',
|
||||
digitalClock: '数字时钟',
|
||||
rotateTip: '旋转提示',
|
||||
alarmCode: '报警器编号',
|
||||
alarmWidth: '报警器宽度',
|
||||
xCoordinate: 'X轴坐标',
|
||||
yCoordinate: 'Y轴坐标',
|
||||
createNow: '立即创建',
|
||||
generateCode: '生成编号',
|
||||
escalatorFrameCode: '扶梯框编号',
|
||||
escalatorFrameWidth: '扶梯框宽度',
|
||||
escalatorFrameHeight: '扶梯框高度',
|
||||
borderWidth: '边框宽度',
|
||||
recommendedSize: '(建议尺寸25)',
|
||||
arrowCode: '箭头编号',
|
||||
arrowDirection: '箭头方向',
|
||||
arrowLength: '箭头长度',
|
||||
arrowWidth: '箭头宽度',
|
||||
arrowColor: '箭头颜色',
|
||||
vertexXCoordinate: '顶点X轴坐标',
|
||||
vertexYCoordinate: '顶点Y轴坐标',
|
||||
up: '向上',
|
||||
down: '向下',
|
||||
left: '向左',
|
||||
right: '向右',
|
||||
backgroundWidth: '背景板宽度',
|
||||
backgroundHeight: '背景板高度',
|
||||
buttonCode: '按钮编号',
|
||||
buttonColor: '按钮颜色',
|
||||
buttonWidth: '按钮宽度',
|
||||
redButton: '红色按钮',
|
||||
blueButton: '蓝色按钮',
|
||||
yellowButton: '黄色按钮',
|
||||
greenButton: '绿色按钮',
|
||||
grayButton: '白色按钮',
|
||||
digitalClockCode: '数字时钟编号',
|
||||
digitalClockWidth: '数字时钟宽度',
|
||||
escalatorCode: '扶梯编号',
|
||||
escalatorWidth: '扶梯宽度',
|
||||
escalatorHeight: '扶梯高度',
|
||||
escalatorColor: '扶梯颜色',
|
||||
startingDirection: '启动方向',
|
||||
doNotStart: '不启动',
|
||||
startUp: '向上启动',
|
||||
startDown: '向下启动',
|
||||
keyCode: '钥匙编号',
|
||||
keyWidth: '钥匙宽度',
|
||||
keyDirection: '钥匙朝向',
|
||||
level: '水平',
|
||||
vertical: '竖直',
|
||||
upperText: '上侧文字',
|
||||
lowerText: '下侧文本',
|
||||
circularLampCode: '圆形灯编号',
|
||||
circularLampRadius: '圆形灯半径'
|
||||
};
|
||||
|
@ -15,6 +15,7 @@ export default {
|
||||
edit3d: '三维编辑',
|
||||
publish3d: '三维发布',
|
||||
assetmanager3d: '三维资源管理',
|
||||
stationmanager3d: '三维车站管理',
|
||||
logicalView: '逻辑视图',
|
||||
physicalView: '物理视图',
|
||||
mixedView: '混合视图',
|
||||
@ -81,6 +82,7 @@ export default {
|
||||
statusSignalName: '状态信号名称:',
|
||||
stateSignalsPlotCoordinates: '状态信号画图坐标:',
|
||||
equipmentStation: '所属设备集中站',
|
||||
signalNoRoute:'不生成进路',
|
||||
|
||||
lineCoding: '线条编码:',
|
||||
lineType: '线条类型:',
|
||||
@ -236,7 +238,7 @@ export default {
|
||||
sectionLogicalNumber: '逻辑区段数量',
|
||||
sectionLsectioncode: '左侧区段名称:',
|
||||
sectionRsectioncode: '右侧区段名称:',
|
||||
associatedSection: '所属物理/道岔区段:',
|
||||
associatedSection: '所属物理/道岔/岔心区段:',
|
||||
blockCoding: '区段编码:',
|
||||
sectionType: '区段类型:',
|
||||
sectionNameColon: '区段名称:',
|
||||
@ -393,12 +395,16 @@ export default {
|
||||
trainmodelUpdate: '更新列车模型',
|
||||
trainTypeName: '列车类型名称:',
|
||||
trainLength: '列车长度:',
|
||||
trainSafeDistance: '安全距离:',
|
||||
trainMaxSafeDistance: '最大安全距离:',
|
||||
averageVelocity: '平均速度:',
|
||||
averageDeceleration: '平均减速度:',
|
||||
defaultVelocity: '默认速度:',
|
||||
maxVelocity: '最大速度:',
|
||||
// trainSafeDistance: '安全距离:',
|
||||
// trainMaxSafeDistance: '最大安全距离:',
|
||||
// averageVelocity: '平均速度:',
|
||||
// averageDeceleration: '平均减速度:',
|
||||
// defaultVelocity: '默认速度:',
|
||||
// maxVelocity: '最大速度:',
|
||||
trainWeight:'列车重量',
|
||||
tong:'吨',
|
||||
numberOfCars:'车厢数量',
|
||||
vehicle:'辆',
|
||||
|
||||
trainWindowCode: '车次窗编码:',
|
||||
trainWindowWidth: '车次窗宽度:',
|
||||
@ -563,6 +569,10 @@ export default {
|
||||
interlockingBlocks: '联锁区段',
|
||||
alwaysRed: '是否总是显示红灯',
|
||||
|
||||
crossName:'岔心名称',
|
||||
relateSectionList:'关联区段',
|
||||
cross:'岔心',
|
||||
|
||||
belongsSection: '所属区段:',
|
||||
coordinateMode: '坐标方式',
|
||||
sectionAssociationMode: '区段关联方式',
|
||||
|
@ -441,6 +441,7 @@ export default {
|
||||
setSwitchbackStrategyTipPrefix: '提示: 选中站台',
|
||||
setSwitchbackStrategyTipSuffix: '设置运行折返策略',
|
||||
setSwitchbackStrategy: '设置折返策略',
|
||||
setSectionFaultUnlock:'设置区故解',
|
||||
noSwitchback: '无折返',
|
||||
noOneSwitchback: '无人折返',
|
||||
automaticChange: '自动换端',
|
||||
|
@ -5,12 +5,12 @@ export default {
|
||||
level3: '等级三:',
|
||||
level4: '等级四:',
|
||||
level5: '等级五:',
|
||||
updateData: '更新数据',
|
||||
pleaseInputLevel1: '请输入等级一',
|
||||
pleaseInputLevel2: '请输入等级二',
|
||||
pleaseInputLevel3: '请输入等级三',
|
||||
pleaseInputLevel4: '请输入等级四',
|
||||
pleaseInputLevel5: '请输入等级五',
|
||||
// updateData: '更新数据',
|
||||
// pleaseInputLevel1: '请输入等级一',
|
||||
// pleaseInputLevel2: '请输入等级二',
|
||||
// pleaseInputLevel3: '请输入等级三',
|
||||
// pleaseInputLevel4: '请输入等级四',
|
||||
// pleaseInputLevel5: '请输入等级五',
|
||||
systemOutPut: '系统输出框',
|
||||
selectPrintArea: '选择打印区域',
|
||||
selectDeleteRoute: '选择删除交路',
|
||||
@ -20,9 +20,9 @@ export default {
|
||||
deletePlanCar: '删除计划车'
|
||||
},
|
||||
openRunPlan: {
|
||||
selectRunplan: '选择运行图',
|
||||
// selectRunplan: '选择运行图',
|
||||
delete: '删除',
|
||||
modify: '修改',
|
||||
// modify: '修改',
|
||||
runPlanList: '运行图列表',
|
||||
getRunPlanListFail: '获取运行图列表失败',
|
||||
confirmDeleteRunPlan: '您确认是否删除此运行图?',
|
||||
@ -51,20 +51,20 @@ export default {
|
||||
// endStationTitle 终到站
|
||||
// endSection 终到区段
|
||||
// description 描述
|
||||
detail: '详情:',
|
||||
station: '车站',
|
||||
section: '区段',
|
||||
stopTime: '停站时间',
|
||||
runLevel: '运行等级',
|
||||
arrivalTime: '到点',
|
||||
departureTime: '发点',
|
||||
// detail: '详情:',
|
||||
// station: '车站',
|
||||
// section: '区段',
|
||||
// stopTime: '停站时间',
|
||||
// runLevel: '运行等级',
|
||||
// arrivalTime: '到点',
|
||||
// departureTime: '发点',
|
||||
showDefaultTime: '显示默认停站时间和运行等级',
|
||||
automatic: '自动',
|
||||
default: '默认',
|
||||
modifyTask: '修改任务',
|
||||
setMessageTip1: '请先设置开始区段',
|
||||
setMessageTip2: '终到区段',
|
||||
setMessageTip3: '的站间运行时间',
|
||||
// setMessageTip1: '请先设置开始区段',
|
||||
// setMessageTip2: '终到区段',
|
||||
// setMessageTip3: '的站间运行时间',
|
||||
modifyTaskSuccess: '修改任务成功!',
|
||||
modifyTaskFailed: '修改任务失败',
|
||||
|
||||
@ -74,29 +74,29 @@ export default {
|
||||
endSection: '终点区段',
|
||||
direction: '方向',
|
||||
distance: '距离',
|
||||
operation: '操作',
|
||||
edit: '编辑',
|
||||
save: '保存',
|
||||
cancelAndQuit: '取消&退出',
|
||||
// operation: '操作',
|
||||
// edit: '编辑',
|
||||
// save: '保存',
|
||||
// cancelAndQuit: '取消&退出',
|
||||
modifySuccess: '修改成功!',
|
||||
modifyFailed: '修改失败',
|
||||
modifyRunLevel: '修改运行等级',
|
||||
modifyStopTime:'修改停站时间',
|
||||
|
||||
startStationTips: '起始站发车时间不变',
|
||||
endStationTips: '终到站到达时间不变',
|
||||
startStationTitle: '起始站',
|
||||
startedStation: '起始站台',
|
||||
endStationTitle: '终到站',
|
||||
endedStation: '终到站台',
|
||||
description: '描述',
|
||||
modifyTaskRoute: '修改任务交路',
|
||||
time: '时间',
|
||||
// startStationTips: '起始站发车时间不变',
|
||||
// endStationTips: '终到站到达时间不变',
|
||||
// startStationTitle: '起始站',
|
||||
// startedStation: '起始站台',
|
||||
endStationTitle: '终到站'
|
||||
// endedStation: '终到站台',
|
||||
// description: '描述',
|
||||
// modifyTaskRoute: '修改任务交路',
|
||||
// time: '时间',
|
||||
|
||||
modifyStartTime: '修改开始时间:',
|
||||
modifyStartTimeTitle: '修改起始时间',
|
||||
search: '查找',
|
||||
modifyTwoStationTime: '修改两站之间的时间'
|
||||
// modifyStartTime: '修改开始时间:',
|
||||
// modifyStartTimeTitle: '修改起始时间',
|
||||
// search: '查找',
|
||||
// modifyTwoStationTime: '修改两站之间的时间'
|
||||
},
|
||||
editSmoothRun: {
|
||||
trainProportion: '分车比例',
|
||||
@ -215,7 +215,7 @@ export default {
|
||||
addTaskHint1: '请先设置开始区段',
|
||||
addTaskHint2: '终到区段',
|
||||
addTaskHint3: '的站间运行时间',
|
||||
normalNew: '正常新建',
|
||||
normalNew: '新建',
|
||||
runGraphName: '运行图名称',
|
||||
createFromTheReleaseRunGraph: '从发布运行图创建',
|
||||
releaseRunGraph: '发布运行图',
|
||||
|
@ -109,7 +109,7 @@ export default {
|
||||
inputQuestionNumber: '请输入题数',
|
||||
inputQuestionNumberError: '输入的题数大于0',
|
||||
inputValidNumber: '请输入有效数字',
|
||||
inputNumberError: '输入值必须大于题数',
|
||||
inputNumberError: '输入值必须小于题数',
|
||||
inputScorePerQuestion: '请输入每题分值',
|
||||
// inputNumericType 请输入数字值
|
||||
// addRules 添加规则
|
||||
|
@ -91,5 +91,8 @@ export default {
|
||||
authorApply: '授权申请',
|
||||
AuthorList: '授权列表',
|
||||
questionsRuleManage: '出题规则管理',
|
||||
preTheoryData: '理论导入预处理'
|
||||
preTheoryData: '理论导入预处理',
|
||||
boardManage: '留言板管理',
|
||||
publishIBPManage:'发布IBP盘管理',
|
||||
publishISCSManage:'发布ISCS管理'
|
||||
};
|
||||
|
@ -24,6 +24,8 @@ export default {
|
||||
linkSelectName: '请输入Link名称',
|
||||
linkSelectDisplayLength: '请输入Link实际长度',
|
||||
|
||||
pleaseInputCrossName:'请输入岔心名称',
|
||||
|
||||
lengthShow: '显示长度:',
|
||||
lengthFact: '真实长度:',
|
||||
color: '颜色:',
|
||||
@ -112,12 +114,15 @@ export default {
|
||||
trainCode: '列车模型Code不能为空',
|
||||
pleaseEnterTrainTypeName: '请输入列车类型名称',
|
||||
trainLength: '请输入列车长度',
|
||||
safeDistance: '请输入安全距离',
|
||||
maxSafeDistance: '请输入最大安全距离',
|
||||
averageVelocity: '请输入平均速度',
|
||||
averageDeceleration: '请输入平均减速度',
|
||||
defaultVelocity: '请输入默认速度',
|
||||
maxVelocity: '请输入最大速度',
|
||||
trainWeight:'请输入列车重量',
|
||||
numberOfCars:'请输入车厢数量',
|
||||
|
||||
// safeDistance: '请输入安全距离',
|
||||
// maxSafeDistance: '请输入最大安全距离',
|
||||
// averageVelocity: '请输入平均速度',
|
||||
// averageDeceleration: '请输入平均减速度',
|
||||
// defaultVelocity: '请输入默认速度',
|
||||
// maxVelocity: '请输入最大速度',
|
||||
|
||||
trainWindowWidth: '请输入车次窗宽度',
|
||||
trainWindowHeight: '请输入车次窗高度',
|
||||
|
@ -146,7 +146,7 @@ export default {
|
||||
deleteListHint: '此操作将删除该列表, 是否继续?',
|
||||
setUpASubscriptionMapSuccessfully: '设置订阅地图成功!',
|
||||
setUpASubscriptionMapFailed: '设置订阅地图失败!',
|
||||
getMapStateDataException: '获取地图状态数据异常,请刷新页面重新加载。若多次遇到此类问题,请急时联系开发团队处理!',
|
||||
getMapStateDataException: '仿真出现异常!请初始化', // 获取地图状态数据异常,请刷新页面重新加载。若多次遇到此类问题,请急时联系开发团队处理!
|
||||
packagedSuccessfully: '打包成功',
|
||||
oneKeyGeneratedSuccessfully: '一键生成成功!',
|
||||
obtainedPermissionSuccessfully: '领取权限成功',
|
||||
|
@ -1,7 +1,7 @@
|
||||
import deviceType from './constant/deviceType';
|
||||
import Eventful from 'zrender/src/mixin/Eventful';
|
||||
import * as eventTool from 'zrender/src/core/event';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
// import * as Event from 'zrender/src/core/event';
|
||||
|
||||
class EventModel {
|
||||
@ -199,13 +199,13 @@ class MouseController extends Eventful {
|
||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||
// 视图数据设置点击标志,同步执行
|
||||
oldDevice['down'] = false;
|
||||
oldDevice.instance['__down'] = false;
|
||||
oldInstance.mouseEvent['mouseout'](e);
|
||||
}
|
||||
|
||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||
newDevice['down'] = true;
|
||||
newDevice.instance['__down'] = true;
|
||||
newInstance.mouseEvent['mouseover'](e);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import * as zrUtil from 'zrender/src/core/util';
|
||||
import * as matrix from 'zrender/src/core/matrix';
|
||||
import deviceType from '../constant/deviceType';
|
||||
import deviceRender from '../constant/deviceRender';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
|
||||
export function createTransform(opts) {
|
||||
let transform = matrix.create();
|
||||
|
@ -7,8 +7,8 @@ import deviceType from './constant/deviceType';
|
||||
import KeyboardController from './keyboardController';
|
||||
import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser';
|
||||
import { updateIscsData } from './utils/parser';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import { selectLineCode } from './constant/deviceStyle';
|
||||
import store from '@/store/index';
|
||||
import fuzhouStyle from './constant/skinCode/fuzhou_01.js';
|
||||
|
||||
const renderer = 'canvas';
|
||||
const devicePixelRatio = 1;
|
||||
@ -60,7 +60,7 @@ class Iscs {
|
||||
// 保存原始数据
|
||||
this.data = config;
|
||||
this.lineCode = lineCode;
|
||||
this.style = this.loadStyle(lineCode);
|
||||
this.style = fuzhouStyle;
|
||||
// 保存需展现的画布大小
|
||||
this.canvasSize = {
|
||||
x: 0,
|
||||
@ -112,9 +112,11 @@ class Iscs {
|
||||
|
||||
if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); }
|
||||
}
|
||||
loadStyle(lineCode) {
|
||||
return selectLineCode(lineCode);
|
||||
}
|
||||
|
||||
// loadStyle(lineCode) {
|
||||
// return selectLineCode(lineCode);
|
||||
// }
|
||||
|
||||
setCenter(deviceCode) {
|
||||
const device = this.iscsDevice[deviceCode];
|
||||
if (device && device.instance) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import deviceType from './constant/deviceType';
|
||||
import Eventful from 'zrender/src/mixin/Eventful';
|
||||
import * as eventTool from 'zrender/src/core/event';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
|
||||
class EventModel {
|
||||
constructor(e) {
|
||||
@ -166,13 +166,13 @@ class MouseController extends Eventful {
|
||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||
// 视图数据设置点击标志,同步执行
|
||||
oldDevice['down'] = false;
|
||||
oldDevice.instance['__down'] = false;
|
||||
oldInstance.mouseEvent['mouseout'](e);
|
||||
}
|
||||
|
||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||
newDevice['down'] = true;
|
||||
newDevice.instance['__down'] = true;
|
||||
newInstance.mouseEvent['mouseover'](e);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import deviceType from './constant/deviceType';
|
||||
import Eventful from 'zrender/src/mixin/Eventful';
|
||||
import * as eventTool from 'zrender/src/core/event';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
|
||||
class EventModel {
|
||||
constructor(e) {
|
||||
@ -176,13 +176,13 @@ class MouseController extends Eventful {
|
||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||
// 视图数据设置点击标志,同步执行
|
||||
oldDevice['down'] = false;
|
||||
oldDevice.instance['__down'] = false;
|
||||
oldInstance.mouseEvent['mouseout'](e);
|
||||
}
|
||||
|
||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||
newDevice['down'] = true;
|
||||
newDevice.instance['__down'] = true;
|
||||
newInstance.mouseEvent['mouseover'](e);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ import * as zrUtil from 'zrender/src/core/util';
|
||||
import * as matrix from 'zrender/src/core/matrix';
|
||||
import deviceType from '../constant/deviceType';
|
||||
import deviceRender from '../constant/deviceRender';
|
||||
// import store from '@/store/index_APP_TARGET';
|
||||
// import { deepClone } from '@/utils/index';
|
||||
|
||||
export function createTransform(opts) {
|
||||
|
191
src/jlmap3d/edit/connect/specilDataSave.js
Normal file
@ -0,0 +1,191 @@
|
||||
//import request from '@/utils/request';
|
||||
export function specilDataSave(data) {
|
||||
console.log(data);
|
||||
let postmap = {
|
||||
id:data.mapdata.id,
|
||||
mapId:data.mapdata.mapId,
|
||||
assets:"null",
|
||||
sections:"null",
|
||||
signals:"null",
|
||||
trains:"null",
|
||||
stands:"null",
|
||||
switchs:"null",
|
||||
others:"null",
|
||||
};
|
||||
|
||||
if(data.mapdata.sectionlist.sections== undefined){
|
||||
return postmap;
|
||||
}
|
||||
|
||||
|
||||
if(data == undefined){
|
||||
|
||||
return postmap;
|
||||
}else{
|
||||
|
||||
let specilModel = [
|
||||
{
|
||||
id:"1",
|
||||
name:"天府广场站",
|
||||
code:"Station72223",
|
||||
deviceType:"SimulationStation",
|
||||
type:"Station72223",
|
||||
url:"/MODEL/2020-12-23/119-45721.FBX"
|
||||
},
|
||||
{
|
||||
id:"2",
|
||||
name:"孵化园站",
|
||||
code:"Station95125",
|
||||
deviceType:"SimulationStation",
|
||||
type:"Station95125",
|
||||
url:"/MODEL/2020-12-23/117-12889.FBX"
|
||||
},
|
||||
{
|
||||
id:"3",
|
||||
name:"四河站",
|
||||
code:"Station62009",
|
||||
deviceType:"SimulationStation",
|
||||
type:"Station62009",
|
||||
url:"/MODEL/2020-12-23/118-99249.FBX"
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
data.assetManager.others = specilModel;
|
||||
|
||||
|
||||
let models = data.assetManager;
|
||||
console.log(data.assetManager);
|
||||
postmap.assets = JSON.stringify(models);
|
||||
|
||||
|
||||
//section隧道
|
||||
let sections = [];
|
||||
for(let i in data.mapdata.sectionlist.sections.datalist){
|
||||
|
||||
let section = {
|
||||
// uuid:data.mapdata.sectionlist.sections.modellist[i].uuid,
|
||||
code:data.mapdata.sectionlist.sections.datalist[i].code,
|
||||
name:data.mapdata.sectionlist.sections.datalist[i].name,
|
||||
lengthFact:null,
|
||||
standTrack:data.mapdata.sectionlist.sections.datalist[i].standTrack,
|
||||
rp:data.mapdata.sectionlist.sections.datalist[i].rp,
|
||||
lp:data.mapdata.sectionlist.sections.datalist[i].lp,
|
||||
railpoint:null,
|
||||
rail:data.mapdata.sectionlist.sections.datalist[i].rail,
|
||||
position:null,
|
||||
rotation:null,
|
||||
scale:null,
|
||||
}
|
||||
if(data.mapdata.sectionlist.sections.datalist[i].mesh){
|
||||
let nowmesh = data.mapdata.sectionlist.sectiongroup.getObjectByProperty("code",section.code);
|
||||
section.railpoint = nowmesh.railpoint;
|
||||
section.lengthFact = data.mapdata.sectionlist.sections.datalist[i].mesh.lengthFact;
|
||||
section.position = data.mapdata.sectionlist.sections.datalist[i].mesh.position;
|
||||
section.rotation = data.mapdata.sectionlist.sections.datalist[i].mesh.rotation;
|
||||
section.scale = data.mapdata.sectionlist.sections.datalist[i].mesh.scale;
|
||||
sections.push(section);
|
||||
}
|
||||
|
||||
// if(data.mapdata.sectionlist.sections.datalist[i].rsection){
|
||||
// section.rsection = data.mapdata.sectionlist.sections.datalist[i].rsection;
|
||||
// }
|
||||
// if(data.mapdata.sectionlist.sections.datalist[i].lsection){
|
||||
// section.lsection = data.mapdata.sectionlist.sections.datalist[i].lsection;
|
||||
// }
|
||||
// if(data.mapdata.sectionlist.sections.datalist[i].csection){
|
||||
// section.csection = data.mapdata.sectionlist.sections.datalist[i].csection;
|
||||
// }
|
||||
|
||||
// testmesh1.position.z = link.position.z;
|
||||
|
||||
|
||||
}
|
||||
let arrray = {
|
||||
section:sections,
|
||||
};
|
||||
postmap.sections = JSON.stringify(arrray);
|
||||
//道岔
|
||||
let switchs = [];
|
||||
|
||||
for(let i=0;i<data.mapdata.switchlist.switchs.datalist.length;i++){
|
||||
let switcha = {
|
||||
// uuid:data.mapdata.switchlist.switchs.modellist[i].uuid,
|
||||
code:data.mapdata.switchlist.switchs.datalist[i].code,
|
||||
name:data.mapdata.switchlist.switchs.datalist[i].name,
|
||||
pa:data.mapdata.switchlist.switchs.datalist[i].pa,
|
||||
pb:data.mapdata.switchlist.switchs.datalist[i].pb,
|
||||
pc:data.mapdata.switchlist.switchs.datalist[i].pc,
|
||||
position:data.mapdata.switchlist.switchs.modellist[i].position,
|
||||
rotation:data.mapdata.switchlist.switchs.modellist[i].rotation,
|
||||
scale:data.mapdata.switchlist.switchs.modellist[i].scale
|
||||
}
|
||||
switchs.push(switcha);
|
||||
}
|
||||
postmap.switchs = JSON.stringify(switchs);
|
||||
//信号
|
||||
let signals = [];
|
||||
for(let i=0;i<data.mapdata.signallist.list.length;i++){
|
||||
|
||||
|
||||
let signal = {
|
||||
// uuid:data.mapdata.signallist.list[i].mesh.uuid,
|
||||
name:data.mapdata.signallist.list[i].mesh.name,
|
||||
modelid:data.mapdata.signallist.list[i].mesh.modelid,
|
||||
code:data.mapdata.signallist.list[i].mesh.code,
|
||||
right:data.mapdata.signallist.list[i].mesh.right,
|
||||
position:data.mapdata.signallist.list[i].mesh.position,
|
||||
rotation:data.mapdata.signallist.list[i].mesh.rotation,
|
||||
scale:data.mapdata.signallist.list[i].mesh.scale
|
||||
}
|
||||
|
||||
signals.push(signal);
|
||||
}
|
||||
postmap.signals = JSON.stringify(signals);
|
||||
//车站
|
||||
let stands = [];
|
||||
|
||||
for(let i=0;i<data.mapdata.stationstandlist.list.length;i++){
|
||||
let station = {
|
||||
// uuid:data.mapdata.stationstandlist.list[i].uuid,
|
||||
code:data.mapdata.stationstandlist.list[i].code,
|
||||
name:data.mapdata.stationstandlist.list[i].name,
|
||||
// modelid:data.mapdata.stationstandlist.list[i].modelid,
|
||||
position:data.mapdata.stationstandlist.list[i].mesh.position,
|
||||
rotation:data.mapdata.stationstandlist.list[i].mesh.rotation,
|
||||
scale:data.mapdata.stationstandlist.list[i].mesh.scale,
|
||||
inside:data.mapdata.stationstandlist.list[i].inside,
|
||||
stands:data.mapdata.stationstandlist.list[i].stands,
|
||||
// direction1:{
|
||||
// name:data.mapdata.stationstandlist.list[i].direction1.name,
|
||||
// code:data.mapdata.stationstandlist.list[i].direction1.code
|
||||
// },
|
||||
// direction2:{
|
||||
// name:data.mapdata.stationstandlist.list[i].direction2.name,
|
||||
// code:data.mapdata.stationstandlist.list[i].direction2.code
|
||||
// }
|
||||
}
|
||||
stands.push(station);
|
||||
}
|
||||
postmap.stands = JSON.stringify(stands);
|
||||
//列车
|
||||
let trains = [];
|
||||
for(let i=0;i<data.assetloader.modellist.length;i++){
|
||||
if(data.assetloader.modellist[i].deviceType == "train"){
|
||||
let train = {
|
||||
id:data.assetloader.modellist[i].id,
|
||||
name:data.assetloader.modellist[i].name,
|
||||
deviceType:data.assetloader.modellist[i].deviceType,
|
||||
type:data.assetloader.modellist[i].type,
|
||||
assetUrl:data.assetloader.modellist[i].assetUrl
|
||||
}
|
||||
|
||||
trains.push(train);
|
||||
}
|
||||
}
|
||||
postmap.trains = JSON.stringify(trains);
|
||||
|
||||
return postmap;
|
||||
}
|
||||
|
||||
}
|
@ -114,7 +114,7 @@ export function jl3dEditorLoader(mapid,scope){
|
||||
jlmap3ddata.switchlist = new SwitchList();
|
||||
|
||||
jlmap3ddata.raillist = new RailList();
|
||||
|
||||
console.log(netdata);
|
||||
let sectiondata = JSON.parse(netdata.sections);
|
||||
let switchdata = JSON.parse(netdata.switchs);
|
||||
let signaldata = JSON.parse(netdata.signals);
|
||||
@ -150,11 +150,11 @@ export function jl3dEditorLoader(mapid,scope){
|
||||
});
|
||||
}else{
|
||||
loadEditAllAsset(jlmap3dasset);
|
||||
assetloader.setModelListOver(jlmap3dasset.sceneAssetList,5);
|
||||
assetloader.setModelListOver(jlmap3dasset.sceneAssetList,5,jlmap3dasset.others);
|
||||
assetloader.assetPromiseOver(scene)
|
||||
.then(function(data){
|
||||
// return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
|
||||
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata,scene,assetloader);
|
||||
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata,scene,assetloader,jlmap3dasset.others);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
|
@ -213,13 +213,8 @@ export function SectionList() {
|
||||
stopsections.push(realstopsection);
|
||||
}
|
||||
|
||||
|
||||
console.log(stopsections);
|
||||
|
||||
stopsections.sort(compare("posx"))
|
||||
|
||||
|
||||
|
||||
let leng1 = 0;
|
||||
let leng2 = 0;
|
||||
|
||||
@ -330,13 +325,12 @@ export function SectionList() {
|
||||
createsection(stopsections[0].reals[1].code,downstartpoint,stopsections[0].reals[1].code,34.8);
|
||||
|
||||
for(let i=1,leni=stopsections.length;i<leni;i++){
|
||||
console.log(stopsections[i]);
|
||||
|
||||
if(stopsections[i+1] ){
|
||||
for(let j=0,lenj=stopsections[i].reals.length;j<lenj;j++){
|
||||
|
||||
let topnextpoint = {};
|
||||
console.log(stopsections[i].reals[j].section.code);
|
||||
console.log(scope.sections.datalist[stopsections[i].reals[j].section.code]);
|
||||
|
||||
if(scope.sections.datalist[stopsections[i].reals[j].section.code].railpoint.length == 0){
|
||||
let
|
||||
topnextpoint = {
|
||||
@ -391,10 +385,9 @@ export function SectionList() {
|
||||
//根据站台区段创建站台位置 120停车点距离
|
||||
for(let j=0,lenj=stations.length;j<lenj;j++){
|
||||
// console.log(j);
|
||||
console.log(stations[j]);
|
||||
let direction1 = scope.sections.datalist[stations[j].stands[0].section];
|
||||
let direction2 = scope.sections.datalist[stations[j].stands[1].section];
|
||||
console.log(direction1);
|
||||
|
||||
let x = direction1.railpoint[0].x+direction1.leftStopPointOffset+60;
|
||||
let z = (direction1.railpoint[0].z+direction2.railpoint[0].z)/2;
|
||||
let mesh;
|
||||
@ -427,9 +420,7 @@ export function SectionList() {
|
||||
position.z = py;
|
||||
let len = scope.sections.datalist[start].lengthFact;
|
||||
let height = Math.random()/1000;
|
||||
console.log(origin);
|
||||
console.log(start);
|
||||
console.log("++++++++++++++++++");
|
||||
|
||||
scope.sections.datalist[start].railpoint = [
|
||||
new THREE.Vector3(position.x,height,position.z),
|
||||
new THREE.Vector3(position.x+0.5,height,position.z+0.0001),
|
||||
@ -504,7 +495,6 @@ export function SectionList() {
|
||||
// console.log(origin+"******************************");
|
||||
// console.log(start);
|
||||
// console.log(origin);
|
||||
console.log(scope.sections.datalist[start]);
|
||||
if(scope.sections.datalist[start].standTrack == true && start != origin){
|
||||
// console.log(start+"到达");
|
||||
// console.log("++++++++++++++++++++++++");
|
||||
|
@ -87,11 +87,12 @@ export function StationStandList() {
|
||||
resolve("loadedstation");
|
||||
});
|
||||
}
|
||||
this.loadpromise = function(jlmap3ddata,standsdata,jlmapdata,scene,assetloader){
|
||||
this.loadpromise = function(jlmap3ddata,standsdata,jlmapdata,scene,assetloader,otherStation){
|
||||
return new Promise(function(resolve, reject){
|
||||
// console.log(jlmap3ddata);
|
||||
let jlmapstationdata = jlmapdata.stationList;
|
||||
let jlmapstanddata = jlmapdata.stationStandList;
|
||||
<<<<<<< HEAD
|
||||
// jlmapstationdata.splice(0,1);
|
||||
console.log(standsdata);
|
||||
console.log(jlmapstationdata);
|
||||
@ -108,6 +109,27 @@ export function StationStandList() {
|
||||
|
||||
// console.log(jlmapstationdata);
|
||||
console.log(standsdata);
|
||||
=======
|
||||
//
|
||||
// console.log(jlmapstationdata);
|
||||
//
|
||||
// console.log(standsdata);
|
||||
// console.log(jlmapstationdata);
|
||||
for(let i=0;i<jlmapstationdata.length;i++){
|
||||
if(jlmapstationdata[i].visible == false || jlmapstationdata[i].depot == true){
|
||||
jlmapstationdata.splice(i,1);
|
||||
i--;
|
||||
}else{
|
||||
// console.log(jlmapstationdata[i]);
|
||||
// console.log(standsdata[i]);
|
||||
standsdata[i].code = jlmapstationdata[i].code;
|
||||
standsdata[i].name = jlmapstationdata[i].name;
|
||||
}
|
||||
}
|
||||
// console.log(otherStation);
|
||||
// console.log(standsdata);
|
||||
// console.log(assetloader.modellist);
|
||||
>>>>>>> a2103b0486cf23326ad0cba6d1488e6687de52e7
|
||||
let stations = jlmap3ddata.stationstandlist.list;
|
||||
let num;
|
||||
let num2;
|
||||
@ -153,56 +175,86 @@ export function StationStandList() {
|
||||
section : jlmapstanddata[j].standTrackCode,
|
||||
inside : jlmapstanddata[j].inside,
|
||||
};
|
||||
|
||||
stands.push(changestand);
|
||||
}
|
||||
}
|
||||
newstationstand.stands = stands;
|
||||
if(newstationstand.stands.length<=2){
|
||||
let nowModelType = "normal";
|
||||
if(otherStation){
|
||||
for(let o=0;o<otherStation.length;o++){
|
||||
if(standsdata[i].code == otherStation[o].code){
|
||||
newstationmesh = assetloader.modelgroup[ otherStation[o].code];
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.inside = standsdata[i].inside;
|
||||
|
||||
if(standsdata[i].inside == true){
|
||||
newstationmesh = assetloader.modellist[num].mesh.clone(true);
|
||||
}else{
|
||||
newstationmesh = assetloader.modellist[num2].mesh.clone(true);
|
||||
// console.log(standsdata[i]);
|
||||
newstationmesh.code = standsdata[i].code;
|
||||
newstationmesh.name = standsdata[i].name;
|
||||
newstationmesh.meshtype = "station";
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
scope.group.add(newstationmesh);
|
||||
scope.list.push(newstationstand);
|
||||
nowModelType = "specil";
|
||||
}
|
||||
}
|
||||
// console.log(jlmapstanddata[j]);
|
||||
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.inside = standsdata[i].inside;
|
||||
|
||||
// console.log(standsdata[i]);
|
||||
newstationmesh.code = standsdata[i].code;
|
||||
newstationmesh.name = standsdata[i].name;
|
||||
newstationmesh.meshtype = "station";
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
scope.group.add(newstationmesh);
|
||||
scope.list.push(newstationstand);
|
||||
}else{
|
||||
newstationmesh = assetloader.modellist[num3].mesh.clone(true);
|
||||
// console.log(jlmapstanddata[j]);
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.inside = standsdata[i].inside;
|
||||
// console.log(standsdata[i]);
|
||||
newstationmesh.code = standsdata[i].code;
|
||||
newstationmesh.name = standsdata[i].name;
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
|
||||
scope.group.add(newstationmesh);
|
||||
scope.list.push(newstationstand);
|
||||
}
|
||||
if(nowModelType == "normal"){
|
||||
if(newstationstand.stands.length<=2){
|
||||
|
||||
if(standsdata[i].inside == true){
|
||||
newstationmesh = assetloader.modellist[num].mesh.clone(true);
|
||||
}else{
|
||||
newstationmesh = assetloader.modellist[num2].mesh.clone(true);
|
||||
}
|
||||
// console.log(jlmapstanddata[j]);
|
||||
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.inside = standsdata[i].inside;
|
||||
|
||||
// console.log(standsdata[i]);
|
||||
newstationmesh.code = standsdata[i].code;
|
||||
newstationmesh.name = standsdata[i].name;
|
||||
newstationmesh.meshtype = "station";
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
scope.group.add(newstationmesh);
|
||||
scope.list.push(newstationstand);
|
||||
}else{
|
||||
newstationmesh = assetloader.modellist[num3].mesh.clone(true);
|
||||
// console.log(jlmapstanddata[j]);
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.inside = standsdata[i].inside;
|
||||
// console.log(standsdata[i]);
|
||||
newstationmesh.code = standsdata[i].code;
|
||||
newstationmesh.name = standsdata[i].name;
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
|
||||
scope.group.add(newstationmesh);
|
||||
scope.list.push(newstationstand);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
scene.add(scope.group);
|
||||
resolve("loadedstation");
|
||||
|
@ -15,7 +15,7 @@ import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3dda
|
||||
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
|
||||
var clock = new THREE.Clock();
|
||||
export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||
|
@ -94,7 +94,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
this.nowmxlen = null;
|
||||
this.atpspeed = null;
|
||||
this.atospeed = null;
|
||||
this.trainnum = null;
|
||||
// this.trainnum = null;
|
||||
this.stime = null;
|
||||
this.drivecount = 0;
|
||||
this.drivedata = null;
|
||||
@ -161,7 +161,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
driverWebWorker = new Worker(JL3D_LOCAL_STATIC+"/workertest/driverWebWorker.js");
|
||||
scope.Subscribe = new Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,driverWebWorker,stats);
|
||||
|
||||
datanew();
|
||||
// datanew();
|
||||
|
||||
DriverLoadNew(mapnetdata,scope,netdata.data,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls3,scene,mixers);
|
||||
var timer = setInterval(function() {
|
||||
@ -257,12 +257,12 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
updatemmi.updateatospeed = function(atospeed) {
|
||||
scope.atospeed = atospeed;
|
||||
};
|
||||
updatemmi.updatetrainnum = function(trainnum) {
|
||||
scope.trainnum = trainnum;
|
||||
};
|
||||
updatemmi.updatestoptime = function(stime) {
|
||||
scope.stime = stime;
|
||||
};
|
||||
// updatemmi.updatetrainnum = function(trainnum) {
|
||||
// scope.trainnum = trainnum;
|
||||
// };
|
||||
// updatemmi.updatestoptime = function(stime) {
|
||||
// scope.stime = stime;
|
||||
// };
|
||||
updatemmi.updatedrivedata = function(drivedata) {
|
||||
scope.drivecount += 1;
|
||||
scope.drivedata = drivedata;
|
||||
|
@ -18,6 +18,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
var actions = null;
|
||||
var rails = null;
|
||||
var links = null;
|
||||
let tdt = null;
|
||||
|
||||
let trainmodel = null;
|
||||
var scenes = null;
|
||||
@ -50,7 +51,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
driverWebWorker.onmessage = function (event) {
|
||||
|
||||
let data = event.data;
|
||||
// console.log(data);
|
||||
|
||||
if(data.type == "TDT_3D"){
|
||||
tdtUpdate(data);
|
||||
}
|
||||
|
||||
if(data.type == "Train_Position"){
|
||||
|
||||
@ -70,6 +74,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
|
||||
if(data.body.groupNumber){
|
||||
changeNowTrain(data.body);
|
||||
updateDriveValue(data.body.groupNumber);
|
||||
}
|
||||
|
||||
updatestatus(data.body);
|
||||
@ -185,7 +190,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
}
|
||||
|
||||
}
|
||||
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) {
|
||||
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails,newtdt, materiallist, nowaction, scene) {
|
||||
// console.log(mapdata);
|
||||
// console.log(newtrainlisttest);
|
||||
trainmodel = newtrainlisttest.group.children[0];
|
||||
@ -198,6 +203,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
actions = nowaction;
|
||||
links = newlinklist;
|
||||
rails = newrails;
|
||||
tdt = newtdt;
|
||||
};
|
||||
|
||||
this.initdrivercode = function(code) {
|
||||
@ -245,7 +251,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
let data = JSON.parse(Response.body);
|
||||
// stats.update();
|
||||
// 遍历后台数据
|
||||
console.log(data);
|
||||
// console.log(data);
|
||||
|
||||
if(data.type == "Train_Position"){
|
||||
nowTrainRun(data.body);
|
||||
return;
|
||||
@ -306,14 +313,23 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
}
|
||||
}
|
||||
}
|
||||
function otherTrainRun(data){
|
||||
|
||||
if(data.length != trainlisttest.otherTrainmodels.length && trainlisttest.updatStatus == false){
|
||||
function tdtUpdate(data){
|
||||
|
||||
tdt.updateTdt(data.body);
|
||||
}
|
||||
|
||||
function otherTrainRun(data){
|
||||
if(data.length > trainlisttest.otherTrainmodels.length && trainlisttest.updatStatus == false){
|
||||
trainlisttest.addDriveTrain(data);
|
||||
}else if(data.length < trainlisttest.otherTrainmodels.length){
|
||||
|
||||
let removelength = trainlisttest.otherTrainmodels.length - data.length;
|
||||
trainlisttest.removeDriveTrain(removelength);
|
||||
}else{
|
||||
|
||||
for(let i=0,leni=data.length;i<leni;i++){
|
||||
let updateTrain = trainlisttest.otherTrainList[data[i].code];
|
||||
let updateTrain = trainlisttest.otherTrainmodels[i];
|
||||
|
||||
if(data[i].code != trainmodel.code){
|
||||
|
||||
@ -348,7 +364,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
updateTrainModel.rotation.y = Math.PI;
|
||||
let point = updateTrainModel.curve.getPointAt(data.offset);
|
||||
updateTrainModel.position.x = point.x;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
for (let tl=0; tl<updateTrainModel.children.length; tl++) {
|
||||
updateTrainModel.children[tl].position.z = point.z;
|
||||
}
|
||||
}else{
|
||||
@ -356,7 +372,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
updateTrainModel.rotation.y = 0;
|
||||
let point = updateTrainModel.curve.getPointAt(data.offset);
|
||||
updateTrainModel.position.x = point.x;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
for (let tl=0; tl<updateTrainModel.children.length; tl++) {
|
||||
updateTrainModel.children[tl].position.z = point.z;
|
||||
}
|
||||
}
|
||||
@ -388,9 +404,9 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
// trainmodel.position.z = point.z;
|
||||
|
||||
}
|
||||
if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
|
||||
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
|
||||
|
||||
for(let rs = 1;rs<6;rs++){
|
||||
for(let rs = 1;rs<updateTrainModel.children.length;rs++){
|
||||
//console.log(rs);
|
||||
if(updateTrainModel.children[rs].rotalist[0]){
|
||||
|
||||
@ -400,7 +416,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
for(let xh=0;xh<updateTrainModel.children[rs].rotalist.length;xh++){
|
||||
if((updateTrainModel.children[rs].matrixWorld.elements[12]+10)>=updateTrainModel.children[rs].rotalist[0].posr.x){
|
||||
|
||||
if(rs != 5){
|
||||
if(rs != updateTrainModel.children.length-1){
|
||||
let asd = updateTrainModel.children[rs].rotalist[0];
|
||||
updateTrainModel.children[rs+1].rotalist.push(asd);
|
||||
|
||||
@ -421,7 +437,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
|
||||
}
|
||||
// console.log(trainmodel.rotalist);
|
||||
}
|
||||
// }
|
||||
|
||||
}else{
|
||||
//
|
||||
@ -464,8 +480,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
}
|
||||
|
||||
|
||||
if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
|
||||
for(let rs = 1;rs<6;rs++){
|
||||
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
|
||||
for(let rs = 1;rs<updateTrainModel.children.length;rs++){
|
||||
//console.log(rs);
|
||||
if(updateTrainModel.children[rs].rotalist[0]){
|
||||
let offsetz = parseFloat(updateTrainModel.children[rs].rotalist[0].posr.z) - parseFloat(updateTrainModel.children[rs].matrixWorld.elements[14]);
|
||||
@ -475,7 +491,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
for(let xh=0;xh<updateTrainModel.children[rs].rotalist.length;xh++){
|
||||
if((updateTrainModel.children[rs].matrixWorld.elements[12]-10)<=updateTrainModel.children[rs].rotalist[0].posr.x){
|
||||
|
||||
if(rs != 5){
|
||||
if(rs != updateTrainModel.children.length-1){
|
||||
let asd = updateTrainModel.children[rs].rotalist[0];
|
||||
updateTrainModel.children[rs+1].rotalist.push(asd);
|
||||
|
||||
@ -490,7 +506,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -524,7 +540,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
trainmodel.rotation.y = Math.PI;
|
||||
let point = trainmodel.curve.getPointAt(data.offset);
|
||||
trainmodel.position.x = point.x;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
for (let tl=0; tl<trainmodel.children.length; tl++) {
|
||||
trainmodel.children[tl].position.z = point.z;
|
||||
}
|
||||
|
||||
@ -559,7 +575,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
trainmodel.rotation.y = 0;
|
||||
let point = trainmodel.curve.getPointAt(data.offset);
|
||||
trainmodel.position.x = point.x;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
for (let tl=0; tl<trainmodel.children.length; tl++) {
|
||||
trainmodel.children[tl].position.z = point.z;
|
||||
}
|
||||
|
||||
@ -626,7 +642,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
}
|
||||
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
||||
|
||||
for(let rs = 1;rs<6;rs++){
|
||||
for(let rs = 1;rs<trainmodel.children.length;rs++){
|
||||
//console.log(rs);
|
||||
if(trainmodel.children[rs].rotalist[0]){
|
||||
|
||||
@ -639,7 +655,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
||||
if((trainmodel.children[rs].matrixWorld.elements[12]+10)>=trainmodel.children[rs].rotalist[0].posr.x){
|
||||
|
||||
if(rs != 5){
|
||||
if(rs != trainmodel.children.length-1){
|
||||
let asd = trainmodel.children[rs].rotalist[0];
|
||||
trainmodel.children[rs+1].rotalist.push(asd);
|
||||
|
||||
@ -736,7 +752,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
|
||||
|
||||
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
||||
for(let rs = 1;rs<6;rs++){
|
||||
for(let rs = 1;rs<trainmodel.children.length;rs++){
|
||||
//console.log(rs);
|
||||
if(trainmodel.children[rs].rotalist[0]){
|
||||
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) - parseFloat(trainmodel.children[rs].matrixWorld.elements[14]);
|
||||
@ -748,7 +764,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
||||
if((trainmodel.children[rs].matrixWorld.elements[12]-10)<=trainmodel.children[rs].rotalist[0].posr.x){
|
||||
|
||||
if(rs != 5){
|
||||
if(rs != trainmodel.children.length-1){
|
||||
let asd = trainmodel.children[rs].rotalist[0];
|
||||
trainmodel.children[rs+1].rotalist.push(asd);
|
||||
|
||||
|
@ -167,7 +167,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
|
||||
|
||||
function setpsdstationmap(stationlist){
|
||||
for(let i=0,leni=stationlist.length;i<leni;i++){
|
||||
console.log(stationlist[i]);
|
||||
|
||||
psdtexturemap[stationlist[i].stands[0].code] = stationlist[i].code;
|
||||
psdtexturemap[stationlist[i].stands[1].code] = stationlist[i].code;
|
||||
}
|
||||
@ -285,7 +285,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
|
||||
} else {
|
||||
scope.nowcode = data.code;
|
||||
if (data.type == "room") {
|
||||
|
||||
console.log(scope.modelmanager.roommodel.mesh);
|
||||
scope.showmodel = scope.modelmanager.roommodel.mesh;
|
||||
scope.scene.add(scope.showmodel);
|
||||
scope.camera.position.set(5, 7, -9);
|
||||
|
@ -114,7 +114,6 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
|
||||
|
||||
if(event.data.type == "Device_Fault_Over_3D"){
|
||||
console.log(event.data);
|
||||
|
||||
deletefault(event.data.body.code);
|
||||
warningmsg("已修复故障设备:"+event.data.body.code);
|
||||
@ -127,7 +126,7 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
let fault = event.data.body.faultInfoList;
|
||||
|
||||
for(let i=0,leni= fault.length;i<leni;i++){
|
||||
console.log(fault[i]);
|
||||
|
||||
let newfault = {
|
||||
code:fault[i].code,
|
||||
name:'',
|
||||
|
@ -6,7 +6,7 @@ import {SignalListN} from '@/jlmap3d/main/newmodel/SignalListN';
|
||||
import {StationStandListN} from '@/jlmap3d/main/newmodel/StationStandListN';
|
||||
import {SwitchListN} from '@/jlmap3d/main/newmodel/SwitchListN';
|
||||
import {RailListN} from '@/jlmap3d/main/newmodel/RailListN.js';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
||||
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
||||
@ -15,10 +15,7 @@ import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
||||
|
||||
export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene){
|
||||
//console.log(mapdata);
|
||||
|
||||
//console.log(data);
|
||||
//console.log(scope);
|
||||
let sceneload = scene;
|
||||
let backdata = scope;
|
||||
let jlmap3ddata = mapdata;
|
||||
@ -69,25 +66,20 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene)
|
||||
|
||||
assetloader.assetPromiseOver(sceneload)
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
//,netdata.stands,mixers,actions,"0"
|
||||
|
||||
return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"02");
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return sectionlist.loadpromise(mapdata.sectionList,sectiondata.section,rails,scene,assetloader);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return signallist.loadpromise(mapdata.signalList,signaldata,sceneload,assetloader);
|
||||
})
|
||||
.then(function(data){
|
||||
return switchlist.loadpromise(mapdata.switchList,switchdata,sceneload,assetloader,mixers,actions);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
//console.log(assetloader);
|
||||
return trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"02");
|
||||
})
|
||||
.then(function(data){
|
||||
@ -108,22 +100,27 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene)
|
||||
return new Promise(function(resolve, reject){
|
||||
if(scope.stationtexture["stationlist"]){
|
||||
for(let mm=0;mm< stationstandlist.group.children.length;mm++){
|
||||
let stationname = stationstandlist.group.children[mm].name;
|
||||
let stationname = stationstandlist.group.children[mm].name;
|
||||
if(stationstandlist.group.children[mm].getObjectByName("zhantailiebiao")){
|
||||
|
||||
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
|
||||
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
|
||||
// console.log(stationstandlist.group.children[mm].getObjectByName("menkuangyanse"));
|
||||
if(stationstandlist.group.children[mm].getObjectByName("menkuangyanse")){
|
||||
stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
|
||||
stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
}
|
||||
if(stationstandlist.group.children[mm].getObjectByName("menkuangyanse")){
|
||||
stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
|
||||
stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
if(stationstandlist.group.children[mm].getObjectByName("zhantaiming")){
|
||||
let newmaterial = stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.clone();
|
||||
|
||||
newmaterial.map =scope.stationtexture[stationname];
|
||||
|
||||
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material = newmaterial;
|
||||
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
|
||||
// 定于仿真socket接口
|
||||
export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passerStation,passerAi) {
|
||||
|
@ -29,7 +29,7 @@ import { PathFinder } from '@/jlmap3d/jl3dpassflow/passerai/pathfinder.js';
|
||||
import { PassflowConnect } from '@/jlmap3d/jl3dpassflow/connect/passflowconnect.js';
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import store from '@/store/index';
|
||||
// import { Loading } from 'element-ui';
|
||||
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
|
||||
|
||||
|
@ -20,6 +20,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
var actions = null;
|
||||
var rails = null;
|
||||
var links = null;
|
||||
var tdt = null;
|
||||
|
||||
var scenes = null;
|
||||
|
||||
@ -83,6 +84,10 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(event.data.type == "TDT_3D"){
|
||||
tdtUpdate(event.data);
|
||||
}
|
||||
|
||||
if (event.data.type== "PSD" && actions) {
|
||||
standupdate(event.data);
|
||||
return;
|
||||
@ -110,7 +115,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
}
|
||||
};
|
||||
|
||||
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) {
|
||||
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails,newtdt, materiallist, nowaction, scene) {
|
||||
trainlisttest = newtrainlisttest;
|
||||
sectionlist = newsectionlist;
|
||||
signallist = newsignallist;
|
||||
@ -120,6 +125,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
actions = nowaction;
|
||||
links = newlinklist;
|
||||
rails = newrails;
|
||||
tdt = newtdt;
|
||||
};
|
||||
|
||||
this.socketon = function(topic) {
|
||||
@ -152,6 +158,11 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
}
|
||||
};
|
||||
|
||||
function tdtUpdate(data){
|
||||
|
||||
tdt.updateTdt(data.body);
|
||||
}
|
||||
|
||||
function trainRunNew(data){
|
||||
let code = data.code;
|
||||
|
||||
@ -785,33 +796,36 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
}
|
||||
function signalupdate(data) {
|
||||
code = data.code;
|
||||
if(data.red == 1){
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
if(signallist.list[code]){
|
||||
if(data.red == 1){
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
if(data.yellow == 1){
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
if(data.green == 1){
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[2];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(data.yellow == 1){
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
if(data.green == 1){
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[2];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -403,19 +403,24 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
// points.push(new THREE.Vector3(stationp1.x+38,11,stationp1.z-15));
|
||||
// points.push(new THREE.Vector3(stationp1.x+38,11,stationp1.z+2));
|
||||
// points.push(new THREE.Vector3(stationp1.x+13,5,stationp1.z+2));
|
||||
|
||||
if(stationstandlist.group.children[0].inside == false){
|
||||
points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z-26));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,11,stationp1.z-26));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,7,stationp1.z-26));
|
||||
points.push(new THREE.Vector3(stationp1.x-55,5,stationp1.z-26));
|
||||
if(stationstandlist.group.children[0].code == "Station34"){
|
||||
points.push(new THREE.Vector3(stationp1.x+60,4,stationp1.z-23));
|
||||
points.push(new THREE.Vector3(stationp1.x-55,4,stationp1.z-23));
|
||||
}else{
|
||||
points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z+12));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,11,stationp1.z+12));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,7,stationp1.z+12));
|
||||
points.push(new THREE.Vector3(stationp1.x-55,5,stationp1.z+12));
|
||||
if(stationstandlist.group.children[0].inside == false){
|
||||
points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z-26));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,11,stationp1.z-26));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,7,stationp1.z-26));
|
||||
points.push(new THREE.Vector3(stationp1.x-55,5,stationp1.z-26));
|
||||
}else{
|
||||
points.push(new THREE.Vector3(stationp1.x-65,11,stationp1.z+12));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,11,stationp1.z+12));
|
||||
points.push(new THREE.Vector3(stationp1.x+60,7,stationp1.z+12));
|
||||
points.push(new THREE.Vector3(stationp1.x-55,5,stationp1.z+12));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// points.push(new THREE.Vector3(stationp1.x+40,3,stationp1.z+15));
|
||||
// controls.target = new THREE.Vector3(camera.position.x+1,camera.position.y,camera.position.z);
|
||||
// controls.update();
|
||||
|
438
src/jlmap3d/jl3dstationmanager/component/jl3dactionmanager.js
Normal file
@ -0,0 +1,438 @@
|
||||
import { Staticmodel } from '@/jlmap3d/jl3dtrafficplan/loader/stationconfig.js';
|
||||
//静态资源文件路劲
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//loader
|
||||
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
|
||||
//轨道视角控制
|
||||
import { StationManagerControls } from '@/jlmap3d/jl3dstationmanager/controls/stationManagerControls';
|
||||
//模型管理器
|
||||
import { ModelManager } from '@/jlmap3d/jl3dstationmanager/loader/loader.js';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
//获取信息接口
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
//cctv站台对象
|
||||
import { PasserStation } from '@/jlmap3d/jl3dtrafficplan/model/passerstation.js';
|
||||
//cctv检票机对象
|
||||
import { PasserCheckDoor } from '@/jlmap3d/jl3dtrafficplan/model/passercheckdoor.js';
|
||||
//cctv列车对象
|
||||
import { PasserTrain } from '@/jlmap3d/jl3dtrafficplan/model/passertrain.js';
|
||||
//cctv行人对象
|
||||
import { PasserHuman } from '@/jlmap3d/jl3dtrafficplan/model/passerhuman.js';
|
||||
//cctv渲染器
|
||||
import { PasserRender } from '@/jlmap3d/jl3dpassflow/passerrender/passerrender.js';
|
||||
//cctv行人ai
|
||||
import { PasserAi } from '@/jlmap3d/jl3dtrafficplan/passerai/passerai.js';
|
||||
//行人寻路相关工具
|
||||
import { ZoneManager } from '@/jlmap3d/jl3dtrafficplan/model/zonemanager.js';
|
||||
import { PathFinder } from '@/jlmap3d/jl3dtrafficplan/passerai/pathfinder.js';
|
||||
//cctv通信工具
|
||||
import { PassflowConnect } from '@/jlmap3d/jl3dtrafficplan/connect/stationconnect.js';
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import store from '@/store/index';
|
||||
// import { Loading } from 'element-ui';
|
||||
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
|
||||
|
||||
//动画播放相关
|
||||
let clock = new THREE.Clock();
|
||||
let delta;
|
||||
|
||||
let scene,camerass,renderer;
|
||||
|
||||
let aiswitch = 0;
|
||||
//动画组
|
||||
let mixers = [];
|
||||
//车站摄像机模型
|
||||
let monitor;
|
||||
|
||||
//寻路相关对象
|
||||
let passerZone = new ZoneManager();
|
||||
let pathFinder = new PathFinder();
|
||||
let path;
|
||||
|
||||
//设备动画action组
|
||||
let deviceaction = [];
|
||||
//控制帧率的webworker线程
|
||||
let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/trafficstation.js");
|
||||
|
||||
//老版本临时ai控制
|
||||
let olddataai = false;
|
||||
|
||||
export function Jl3dStationManager(dom,skinCode,routegroup,viewMap,initCode) {
|
||||
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.dom = dom;
|
||||
this.nowcode = null;
|
||||
this.animateswitch = false;
|
||||
this.signallights = [];
|
||||
this.mixers = [];
|
||||
this.showmodel = null;
|
||||
|
||||
this.allStationData = [];
|
||||
this.humanWaitTop = 0;
|
||||
this.humanWaitDown = 0;
|
||||
this.humanInSpeed = 0;
|
||||
this.humanOutSpeed = 0;
|
||||
let waitForCreatIn = [];
|
||||
let waitForCreatOutTop = [];
|
||||
let waitForCreatOutDown = [];
|
||||
//定义相机
|
||||
camerass = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 10000);
|
||||
camerass.position.set(0,200,0);
|
||||
camerass.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
camerass.updateProjectionMatrix();
|
||||
|
||||
//定义场景(渲染容器)
|
||||
scene = new THREE.Scene();
|
||||
// scene.background = new THREE.Color(0xa0a0a0);
|
||||
|
||||
|
||||
var mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 1000, 1000 ), new THREE.MeshPhongMaterial( { color: 0x999999, depthWrite: false } ) );
|
||||
mesh.rotation.x = - Math.PI / 2;
|
||||
mesh.receiveShadow = true;
|
||||
scene.add( mesh );
|
||||
|
||||
var grid = new THREE.GridHelper( 1000, 100, 0x000000, 0x000000 );
|
||||
grid.material.opacity = 0.2;
|
||||
grid.material.transparent = true;
|
||||
scene.add( grid );
|
||||
|
||||
let passerRender = new PasserRender(viewMap);
|
||||
passerRender.initView(dom,scene,camerass);
|
||||
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
|
||||
//定义全局光
|
||||
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
|
||||
scene.add(ambientLight);
|
||||
var light = new THREE.HemisphereLight( 0xffffff, 0x444444 );
|
||||
light.position.set( 0, 4000, 0 );
|
||||
scene.add( light );
|
||||
|
||||
let controls = new THREE.StationManagerControls(camerass, dom,camerass,scene,mesh);
|
||||
// controls.maxPolarAngle = Math.PI / 2;
|
||||
// controls.minPolarangle = Math.PI / 5;
|
||||
// controls.maxDistance = 800;
|
||||
controls.screenSpacePanning = true;
|
||||
|
||||
controls.target.set( 1, 0, 0 );
|
||||
controls.controlMode = "Draw";
|
||||
controls.update();
|
||||
this.selectmodel = null;
|
||||
|
||||
// let mouse = new THREE.Vector2();
|
||||
let raycaster = new THREE.Raycaster();
|
||||
|
||||
//进站运动中乘客
|
||||
let humanlist = new THREE.Group();
|
||||
//上行等待上车乘客
|
||||
let topWaitPassers = new THREE.Group();
|
||||
//下行等待上车乘客
|
||||
let downWaitPassers = new THREE.Group();
|
||||
//出站乘客
|
||||
let outStationPassers = new THREE.Group();
|
||||
|
||||
let passerHuman = new PasserHuman();
|
||||
|
||||
let passerAi = new PasserAi(passerZone,pathFinder);
|
||||
|
||||
this.anime = null;
|
||||
|
||||
this.modelmanager = new ModelManager();
|
||||
// let loadingInstance = Loading.service({ fullscreen: true });
|
||||
|
||||
let stationlist = [];
|
||||
let socktest = null;
|
||||
let passerStation = new PasserStation();
|
||||
let passerCheckDoor = new PasserCheckDoor();
|
||||
let passerTrain = new PasserTrain();
|
||||
|
||||
// document.addEventListener( "mousedown", onselect, false );
|
||||
|
||||
this.modelmanager.loadpromise(Staticmodel, scope.mixers,"2").then(function (data) {
|
||||
// console.log(scope.modelmanager.station.mesh.getObjectByName("top"));
|
||||
// let testtop = scope.modelmanager.station.mesh.getObjectByName("down");
|
||||
// for(let i=0;i<testtop.children.length;i++){
|
||||
// console.log(testtop.children[i].matrixWorld.elements[12]);
|
||||
// console.log(testtop.children[i].matrixWorld.elements);
|
||||
// }
|
||||
// console.log(scope.modelmanager.station.mesh.getObjectByName("down"));
|
||||
passerStation.initStationAnimation(scope.modelmanager.station.mesh,mixers,deviceaction,scene);
|
||||
passerCheckDoor.initCheckDoorInAnimation(scope.modelmanager.zhajiin.mesh,mixers,deviceaction,scene);
|
||||
passerCheckDoor.initCheckDoorOutAnimation(scope.modelmanager.zhajiout.mesh,mixers,deviceaction,scene);
|
||||
|
||||
passerTrain.initTrain(scope.modelmanager.train.mesh,mixers,deviceaction,scene);
|
||||
|
||||
scene.add(scope.modelmanager.section.mesh);
|
||||
|
||||
monitor = scope.modelmanager.monitor.mesh;
|
||||
scene.add(monitor);
|
||||
console.log("animate");
|
||||
animate();
|
||||
})
|
||||
|
||||
this.initTrafficStart = function(){
|
||||
passerStation.initCodeStation(initCode);
|
||||
scope.humanWaitTop = passerStation.nowStation.toppassers;
|
||||
scope.humanWaitDown = passerStation.nowStation.downpassers;
|
||||
scope.humanInSpeed = 0;
|
||||
scope.humanOutSpeed = 0;
|
||||
passerHuman.speed = scope.humanInSpeed;
|
||||
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
|
||||
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
scope.resetscene();
|
||||
}
|
||||
|
||||
this.changestation = function(stationname){
|
||||
passerStation.changestation(stationname);
|
||||
// console.log(passerStation.nowStation);
|
||||
scope.humanWaitTop = passerStation.nowStation.toppassers;
|
||||
scope.humanWaitDown = passerStation.nowStation.downpassers;
|
||||
passerHuman.speed = passerStation.nowStation.topspeed + passerStation.nowStation.downspeed;
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
|
||||
scope.resetscene();
|
||||
}
|
||||
|
||||
this.updateNowStationData = function(){
|
||||
for(let i=0;i<passerStation.nowStation.topspeed;i++){
|
||||
let newIn = {
|
||||
overGoal:"top",
|
||||
};
|
||||
waitForCreatIn.push(newIn);
|
||||
}
|
||||
for(let i=0;i<passerStation.nowStation.downspeed;i++){
|
||||
let newIn = {
|
||||
overGoal:"down",
|
||||
};
|
||||
waitForCreatIn.push(newIn);
|
||||
}
|
||||
|
||||
|
||||
scope.humanInSpeed = passerStation.nowStation.topspeed+passerStation.nowStation.downspeed;
|
||||
passerHuman.speed = scope.humanInSpeed;
|
||||
passerWebWork.postMessage(["changespeed",scope.humanInSpeed/30]);
|
||||
}
|
||||
|
||||
this.updateNowLeaveData = function(direct,outNum){
|
||||
if(direct == "top"){
|
||||
waitForCreatOutTop = getnum(outNum,17);
|
||||
// console.log(waitForCreatOutTop);
|
||||
for(let i=0;i<waitForCreatOutTop.length;i++){
|
||||
for(let j=0;j<waitForCreatOutTop[i];j++){
|
||||
setTimeout(function(){
|
||||
// console.log(passerZone.list["standtop"].doorpoints[i]);
|
||||
passerHuman.newHumanCreate(outStationPassers,passerZone.list["standtop"].doorpoints[i],5,"top",i);
|
||||
}, Math.random()*1000*j);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
waitForCreatOutDown = getnum(outNum,17);
|
||||
for(let i=0;i<waitForCreatOutDown.length;i++){
|
||||
for(let j=0;j<waitForCreatOutDown[i];j++){
|
||||
setTimeout(function(){
|
||||
// console.log(passerZone.list["standdown"].doorpoints[i]);
|
||||
passerHuman.newHumanCreate(outStationPassers,passerZone.list["standdown"].doorpoints[i],5,"down",i);
|
||||
}, Math.random()*1000*j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.resetscene = function(){
|
||||
aiswitch = 1;
|
||||
passerAi.toppasserin = false;
|
||||
passerAi.downpasserin = false;
|
||||
//下车控制开关
|
||||
passerAi.toppasseron = false;
|
||||
passerAi.downpasseron = false;
|
||||
passerAi.toppasserinNum = 0;
|
||||
passerAi.downpasserinNum = 0;
|
||||
|
||||
passerTrain.toptrain.nowcode = null;
|
||||
passerTrain.downtrain.nowcode = null;
|
||||
// humanlist = new THREE.Group();
|
||||
for(let j=0; j<humanlist.children.length;j++){
|
||||
|
||||
humanlist.remove(humanlist.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
|
||||
for(let j=0; j<topWaitPassers.children.length;j++){
|
||||
|
||||
topWaitPassers.remove(topWaitPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
for(let j=0; j<downWaitPassers.children.length;j++){
|
||||
|
||||
downWaitPassers.remove(downWaitPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
for(let j=0; j<outStationPassers.children.length;j++){
|
||||
|
||||
outStationPassers.remove(outStationPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
passerTrain.toptrain.position.y = -20000;
|
||||
passerTrain.downtrain.position.y = -20000;
|
||||
|
||||
deviceaction.down.action.reset();
|
||||
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
|
||||
deviceaction.down.action.timeScale = -1;
|
||||
deviceaction.down.action.play();
|
||||
|
||||
deviceaction.top.action.reset();
|
||||
deviceaction.top.action.time = deviceaction.down.action._clip.duration;
|
||||
deviceaction.top.action.timeScale = -1;
|
||||
deviceaction.top.action.play();
|
||||
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
|
||||
passerTrain.toptrain.action.top[an].reset();
|
||||
passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration;
|
||||
passerTrain.toptrain.action.top[an].timeScale = -1;
|
||||
passerTrain.toptrain.action.top[an].play();
|
||||
}
|
||||
for(let an=passerTrain.toptrain.action.down.length-1;an>=0;an--){
|
||||
passerTrain.toptrain.action.down[an].reset();
|
||||
passerTrain.toptrain.action.down[an].time = passerTrain.toptrain.action.down[an]._clip.duration;
|
||||
passerTrain.toptrain.action.down[an].timeScale = -1;
|
||||
passerTrain.toptrain.action.down[an].play();
|
||||
}
|
||||
// for(let an=actions.length-1;an>=0;an--){
|
||||
// actions[an].reset();
|
||||
// actions[an].time = actions[an]._clip.duration;
|
||||
// actions[an].timeScale = -1;
|
||||
// actions[an].play();
|
||||
// }
|
||||
setTimeout(function(){
|
||||
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
|
||||
aiswitch = 0;
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
function startWorker(){
|
||||
|
||||
let updateaianimate = setInterval(
|
||||
function(){
|
||||
// console.log("?");
|
||||
if(aiswitch == 0){
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
|
||||
passerHuman.moveAnimateUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman);
|
||||
passerAi.aiUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman,passerCheckDoor,deviceaction);
|
||||
// passerZone.zoneActionCheck(humanlist,passerHuman,passerCheckDoor,deviceaction);
|
||||
delta = clock.getDelta();
|
||||
|
||||
for(let i=mixers.length-1;i>=0;i--){
|
||||
if(mixers[i]._actions[0].isRunning()){
|
||||
mixers[i].update( delta );
|
||||
}
|
||||
}
|
||||
// for(let i=topWaitPassers.children.length-1;i>=0;i--){
|
||||
// if(topWaitPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// topWaitPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=downWaitPassers.children.length-1;i>=0;i--){
|
||||
// if(downWaitPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// downWaitPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=outStationPassers.children.length-1;i>=0;i--){
|
||||
// if(outStationPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// outStationPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=humanlist.children.length-1;i>=0;i--){
|
||||
// if(humanlist.children[i].mixer._actions[0].isRunning()){
|
||||
// humanlist.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
, 100);
|
||||
|
||||
passerWebWork.onmessage = function (event) {
|
||||
if(aiswitch == 0){
|
||||
// console.log(humanlist.children.length);
|
||||
|
||||
this.allStationData = [];
|
||||
if(waitForCreatIn.length>0){
|
||||
let direct = Math.floor(Math.random()*(3-1+1))+1;
|
||||
//1--top
|
||||
//2-- down
|
||||
if(direct == 1){
|
||||
passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter1"),0,waitForCreatIn[0].overGoal);
|
||||
}else{
|
||||
passerHuman.newHumanCreate(humanlist,passerZone.getzoneposition("enter2"),0,waitForCreatIn[0].overGoal);
|
||||
}
|
||||
waitForCreatIn.shift();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
//
|
||||
// function onselect(event){
|
||||
// if(event.button == '0'){
|
||||
//
|
||||
// //定义光线
|
||||
// let raycaster = new THREE.Raycaster();
|
||||
// //定义平面鼠标点击坐标
|
||||
// let mouse = new THREE.Vector2();
|
||||
// mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1;
|
||||
// mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1;
|
||||
//
|
||||
// raycaster.setFromCamera( mouse, camerass );
|
||||
//
|
||||
// let intersects = raycaster.intersectObject(scope.modelmanager.station.mesh,true);
|
||||
// console.log(intersects[0].point);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
//循环渲染函数
|
||||
function animate() {
|
||||
passerRender.update();
|
||||
// console.log(passerRender);
|
||||
// console.log("ss");
|
||||
// if(passerRender.state == "freeview"){
|
||||
controls.update();
|
||||
// }
|
||||
// delta = clock.getDelta();
|
||||
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
}
|
||||
|
||||
window.onresize = function () {
|
||||
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
|
||||
}
|
||||
|
||||
this.switchviews = function(viewmode){
|
||||
passerRender.changeRenderMode(viewmode);
|
||||
}
|
||||
|
||||
|
||||
function getnum(num,pnum){
|
||||
let re = [];
|
||||
let base = Math.floor(num/pnum);
|
||||
let reset = num%pnum;
|
||||
for(let i=0;i<pnum;i++){
|
||||
let nownum = base+(i<reset?1:0);
|
||||
re.push(nownum);
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
||||
}
|
280
src/jlmap3d/jl3dstationmanager/connect/silumationConnect.js
Normal 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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
283
src/jlmap3d/jl3dstationmanager/connect/stationConnect.js
Normal 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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
1486
src/jlmap3d/jl3dstationmanager/controls/TransformControls.js
Normal file
1234
src/jlmap3d/jl3dstationmanager/controls/stationManagerControls.js
Normal file
572
src/jlmap3d/jl3dstationmanager/jl3dstationmanager.js
Normal file
@ -0,0 +1,572 @@
|
||||
import { Staticmodel } from '@/jlmap3d/jl3dstationmanager/loader/stationconfig.js';
|
||||
//静态资源文件路劲
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//loader
|
||||
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
|
||||
//轨道视角控制
|
||||
import { StationManagerControls } from '@/jlmap3d/jl3dstationmanager/controls/stationManagerControls';
|
||||
//区域控制
|
||||
import { TransformControls } from '@/jlmap3d/jl3dstationmanager/controls/TransformControls';
|
||||
//模型管理器
|
||||
import { ModelManager } from '@/jlmap3d/jl3dstationmanager/loader/loader.js';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
//获取信息接口
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
//cctv站台对象
|
||||
import { PasserStation } from '@/jlmap3d/jl3dstationmanager/model/passerstation.js';
|
||||
//cctv检票机对象
|
||||
import { checkRegion } from '@/jlmap3d/jl3dstationmanager/model/region/checkRegion.js';
|
||||
//cctv列车对象
|
||||
import { PasserTrain } from '@/jlmap3d/jl3dstationmanager/model/passertrain.js';
|
||||
//cctv行人对象
|
||||
import { PasserHuman } from '@/jlmap3d/jl3dstationmanager/model/passerhuman.js';
|
||||
//cctv行人ai
|
||||
import { PasserAi } from '@/jlmap3d/jl3dstationmanager/passerai/passerai.js';
|
||||
//行人寻路相关工具
|
||||
import { regionManager } from '@/jlmap3d/jl3dstationmanager/model/regionManager.js';
|
||||
import { PathFinder } from '@/jlmap3d/jl3dstationmanager/passerai/pathfinder.js';
|
||||
//车站仿真
|
||||
import { silumationConnect } from '@/jlmap3d/jl3dstationmanager/connect/silumationConnect.js';
|
||||
import { stationConnect } from '@/jlmap3d/jl3dstationmanager/connect/stationConnect.js';
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import store from '@/store/index';
|
||||
// import { Loading } from 'element-ui';
|
||||
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
|
||||
|
||||
//动画播放相关
|
||||
let clock = new THREE.Clock();
|
||||
let delta;
|
||||
|
||||
let scene,camerass,renderer;
|
||||
|
||||
let aiswitch = 0;
|
||||
//动画组
|
||||
let mixers = [];
|
||||
//车站摄像机模型
|
||||
let monitor;
|
||||
|
||||
//寻路相关对象
|
||||
let sceneRegion = new regionManager();
|
||||
let pathFinder = new PathFinder();
|
||||
let path;
|
||||
|
||||
//设备动画action组
|
||||
let deviceaction = [];
|
||||
//控制帧率的webworker线程
|
||||
let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/trafficstation.js");
|
||||
|
||||
//老版本临时ai控制
|
||||
let olddataai = false;
|
||||
|
||||
export function Jl3dStationManager(dom,skinCode,routegroup,initCode) {
|
||||
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.dom = dom;
|
||||
this.nowcode = null;
|
||||
this.animateswitch = false;
|
||||
this.signallights = [];
|
||||
this.mixers = [];
|
||||
this.showmodel = null;
|
||||
|
||||
this.allStationData = [];
|
||||
this.humanWaitTop = 0;
|
||||
this.humanWaitDown = 0;
|
||||
this.humanInSpeed = 0;
|
||||
this.humanOutSpeed = 0;
|
||||
let waitForCreatIn = [];
|
||||
let waitForCreatOutTop = [];
|
||||
let waitForCreatOutDown = [];
|
||||
//定义相机
|
||||
camerass = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.1, 10000);
|
||||
camerass.position.set(0,300,0);
|
||||
camerass.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
camerass.updateProjectionMatrix();
|
||||
|
||||
//定义场景(渲染容器)
|
||||
scene = new THREE.Scene();
|
||||
scene.background = new THREE.Color(0xa0a0a0);
|
||||
|
||||
|
||||
// var mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 1000, 1000 ), new THREE.MeshPhongMaterial( { color: 0x999999, depthWrite: false } ) );
|
||||
// mesh.rotation.x = - Math.PI / 2;
|
||||
// mesh.receiveShadow = true;
|
||||
// scene.add( mesh );
|
||||
|
||||
// var grid = new THREE.GridHelper( 1000, 100, 0x000000, 0x000000 );
|
||||
// grid.material.opacity = 0.2;
|
||||
// grid.material.transparent = true;
|
||||
// scene.add( grid );
|
||||
|
||||
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setClearColor(new THREE.Color(0x000000));
|
||||
renderer.setSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
|
||||
renderer.sortObjects = true;
|
||||
dom.appendChild(renderer.domElement);
|
||||
|
||||
|
||||
|
||||
|
||||
//定义全局光
|
||||
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
|
||||
scene.add(ambientLight);
|
||||
var light = new THREE.HemisphereLight( 0xffffff, 0x444444 );
|
||||
light.position.set( 0, 4000, 0 );
|
||||
scene.add( light );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let transformControl = new THREE.TransformControls( camerass, renderer.domElement );
|
||||
transformControl.addEventListener( 'change', render );
|
||||
|
||||
transformControl.addEventListener( 'dragging-changed', function ( event ) {
|
||||
|
||||
controls.enabled = ! event.value;
|
||||
|
||||
} );
|
||||
scene.add(transformControl);
|
||||
|
||||
let controls = new THREE.StationManagerControls(camerass, dom,sceneRegion,scene,transformControl);
|
||||
// controls.maxPolarAngle = Math.PI / 2;
|
||||
// controls.minPolarangle = Math.PI / 5;
|
||||
// controls.maxDistance = 800;
|
||||
controls.screenSpacePanning = true;
|
||||
|
||||
controls.target.set( 1, 0, 0 );
|
||||
controls.controlMode = "Orbit";
|
||||
controls.update();
|
||||
sceneRegion.initRegionManager(controls);
|
||||
this.selectmodel = null;
|
||||
|
||||
|
||||
|
||||
// let mouse = new THREE.Vector2();
|
||||
let raycaster = new THREE.Raycaster();
|
||||
|
||||
//进站运动中乘客
|
||||
let humanlist = new THREE.Group();
|
||||
//上行等待上车乘客
|
||||
let topWaitPassers = new THREE.Group();
|
||||
//下行等待上车乘客
|
||||
let downWaitPassers = new THREE.Group();
|
||||
//出站乘客
|
||||
let outStationPassers = new THREE.Group();
|
||||
|
||||
let passerHuman = new PasserHuman();
|
||||
|
||||
let passerAi = new PasserAi(sceneRegion,pathFinder);
|
||||
|
||||
this.anime = null;
|
||||
|
||||
this.modelmanager = new ModelManager();
|
||||
// let loadingInstance = Loading.service({ fullscreen: true });
|
||||
|
||||
let stationlist = [];
|
||||
let sockStation = null;
|
||||
let sockStationPass = null;
|
||||
let passerStation = new PasserStation();
|
||||
let passerCheckDoor = new checkRegion();
|
||||
let passerTrain = new PasserTrain();
|
||||
|
||||
// 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) {
|
||||
console.log("2");
|
||||
passerStation.initStationAnimation(scope.modelmanager.station.mesh,mixers,deviceaction,scene);
|
||||
passerCheckDoor.initCheckDoorInAnimation(scope.modelmanager.zhajiin.mesh,mixers,deviceaction,scene);
|
||||
passerCheckDoor.initCheckDoorOutAnimation(scope.modelmanager.zhajiout.mesh,mixers,deviceaction,scene);
|
||||
|
||||
passerTrain.initTrain(scope.modelmanager.train.mesh,mixers,deviceaction,scene);
|
||||
|
||||
scene.add(scope.modelmanager.section.mesh);
|
||||
scene.add(scope.modelmanager.futi.mesh);
|
||||
monitor = scope.modelmanager.monitor.mesh;
|
||||
scene.add(monitor);
|
||||
|
||||
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();
|
||||
})
|
||||
});
|
||||
|
||||
this.initTrafficStart = function(){
|
||||
passerStation.initCodeStation(initCode);
|
||||
scope.humanWaitTop = passerStation.nowStation.toppassers;
|
||||
scope.humanWaitDown = passerStation.nowStation.downpassers;
|
||||
scope.humanInSpeed = 0;
|
||||
scope.humanOutSpeed = 0;
|
||||
passerHuman.speed = scope.humanInSpeed;
|
||||
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
|
||||
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
scope.resetscene();
|
||||
}
|
||||
|
||||
this.changestation = function(stationname){
|
||||
passerStation.changestation(stationname);
|
||||
// console.log(passerStation.nowStation);
|
||||
scope.humanWaitTop = passerStation.nowStation.toppassers;
|
||||
scope.humanWaitDown = passerStation.nowStation.downpassers;
|
||||
passerHuman.speed = passerStation.nowStation.topspeed + passerStation.nowStation.downspeed;
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
|
||||
scope.resetscene();
|
||||
}
|
||||
|
||||
this.updateNowStationData = function(){
|
||||
for(let i=0;i<passerStation.nowStation.topspeed;i++){
|
||||
let newIn = {
|
||||
overGoal:"top",
|
||||
};
|
||||
waitForCreatIn.push(newIn);
|
||||
}
|
||||
for(let i=0;i<passerStation.nowStation.downspeed;i++){
|
||||
let newIn = {
|
||||
overGoal:"down",
|
||||
};
|
||||
waitForCreatIn.push(newIn);
|
||||
}
|
||||
|
||||
|
||||
scope.humanInSpeed = passerStation.nowStation.topspeed+passerStation.nowStation.downspeed;
|
||||
passerHuman.speed = scope.humanInSpeed;
|
||||
passerWebWork.postMessage(["changespeed",scope.humanInSpeed/30]);
|
||||
};
|
||||
|
||||
this.updateNowLeaveData = function(direct,outNum){
|
||||
if(direct == "top"){
|
||||
waitForCreatOutTop = getnum(outNum,17);
|
||||
// console.log(waitForCreatOutTop);
|
||||
for(let i=0;i<waitForCreatOutTop.length;i++){
|
||||
for(let j=0;j<waitForCreatOutTop[i];j++){
|
||||
setTimeout(function(){
|
||||
// console.log(sceneRegion.list["standtop"].doorpoints[i]);
|
||||
passerHuman.newHumanCreate(outStationPassers,sceneRegion.list["standtop"].doorpoints[i],5,"top",i);
|
||||
}, Math.random()*1000*j);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
waitForCreatOutDown = getnum(outNum,17);
|
||||
for(let i=0;i<waitForCreatOutDown.length;i++){
|
||||
for(let j=0;j<waitForCreatOutDown[i];j++){
|
||||
setTimeout(function(){
|
||||
// console.log(sceneRegion.list["standdown"].doorpoints[i]);
|
||||
passerHuman.newHumanCreate(outStationPassers,sceneRegion.list["standdown"].doorpoints[i],5,"down",i);
|
||||
}, Math.random()*1000*j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.resetscene = function(){
|
||||
aiswitch = 1;
|
||||
passerAi.toppasserin = false;
|
||||
passerAi.downpasserin = false;
|
||||
//下车控制开关
|
||||
passerAi.toppasseron = false;
|
||||
passerAi.downpasseron = false;
|
||||
passerAi.toppasserinNum = 0;
|
||||
passerAi.downpasserinNum = 0;
|
||||
|
||||
passerTrain.toptrain.nowcode = null;
|
||||
passerTrain.downtrain.nowcode = null;
|
||||
// humanlist = new THREE.Group();
|
||||
for(let j=0; j<humanlist.children.length;j++){
|
||||
|
||||
humanlist.remove(humanlist.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
|
||||
for(let j=0; j<topWaitPassers.children.length;j++){
|
||||
|
||||
topWaitPassers.remove(topWaitPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
for(let j=0; j<downWaitPassers.children.length;j++){
|
||||
|
||||
downWaitPassers.remove(downWaitPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
for(let j=0; j<outStationPassers.children.length;j++){
|
||||
|
||||
outStationPassers.remove(outStationPassers.children[j]);
|
||||
j--;
|
||||
// j--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
passerTrain.toptrain.position.y = -20000;
|
||||
passerTrain.downtrain.position.y = -20000;
|
||||
|
||||
deviceaction.down.action.reset();
|
||||
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
|
||||
deviceaction.down.action.timeScale = -1;
|
||||
deviceaction.down.action.play();
|
||||
|
||||
deviceaction.top.action.reset();
|
||||
deviceaction.top.action.time = deviceaction.down.action._clip.duration;
|
||||
deviceaction.top.action.timeScale = -1;
|
||||
deviceaction.top.action.play();
|
||||
for(let an=passerTrain.toptrain.action.top.length-1;an>=0;an--){
|
||||
passerTrain.toptrain.action.top[an].reset();
|
||||
passerTrain.toptrain.action.top[an].time = passerTrain.toptrain.action.top[an]._clip.duration;
|
||||
passerTrain.toptrain.action.top[an].timeScale = -1;
|
||||
passerTrain.toptrain.action.top[an].play();
|
||||
}
|
||||
for(let an=passerTrain.toptrain.action.down.length-1;an>=0;an--){
|
||||
passerTrain.toptrain.action.down[an].reset();
|
||||
passerTrain.toptrain.action.down[an].time = passerTrain.toptrain.action.down[an]._clip.duration;
|
||||
passerTrain.toptrain.action.down[an].timeScale = -1;
|
||||
passerTrain.toptrain.action.down[an].play();
|
||||
}
|
||||
// for(let an=actions.length-1;an>=0;an--){
|
||||
// actions[an].reset();
|
||||
// actions[an].time = actions[an]._clip.duration;
|
||||
// actions[an].timeScale = -1;
|
||||
// actions[an].play();
|
||||
// }
|
||||
setTimeout(function(){
|
||||
passerAi.initPasser(humanlist,topWaitPassers,downWaitPassers,passerHuman,scope);
|
||||
aiswitch = 0;
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
function startWorker(){
|
||||
|
||||
let updateaianimate = setInterval(
|
||||
function(){
|
||||
// console.log("?");
|
||||
if(aiswitch == 0){
|
||||
updatePasserData(humanlist.children.length,topWaitPassers.children.length,downWaitPassers.children.length,outStationPassers.children.length,passerHuman.speed);
|
||||
|
||||
passerHuman.moveAnimateUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman);
|
||||
passerAi.aiUpdate(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman,passerCheckDoor,deviceaction);
|
||||
// sceneRegion.zoneActionCheck(humanlist,passerHuman,passerCheckDoor,deviceaction);
|
||||
delta = clock.getDelta();
|
||||
|
||||
for(let i=mixers.length-1;i>=0;i--){
|
||||
if(mixers[i]._actions[0].isRunning()){
|
||||
mixers[i].update( delta );
|
||||
}
|
||||
}
|
||||
// for(let i=topWaitPassers.children.length-1;i>=0;i--){
|
||||
// if(topWaitPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// topWaitPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=downWaitPassers.children.length-1;i>=0;i--){
|
||||
// if(downWaitPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// downWaitPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=outStationPassers.children.length-1;i>=0;i--){
|
||||
// if(outStationPassers.children[i].mixer._actions[0].isRunning()){
|
||||
// outStationPassers.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
// for(let i=humanlist.children.length-1;i>=0;i--){
|
||||
// if(humanlist.children[i].mixer._actions[0].isRunning()){
|
||||
// humanlist.children[i].mixer.update( delta );
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
, 100);
|
||||
|
||||
passerWebWork.onmessage = function (event) {
|
||||
if(aiswitch == 0){
|
||||
// console.log(humanlist.children.length);
|
||||
|
||||
this.allStationData = [];
|
||||
if(waitForCreatIn.length>0){
|
||||
let direct = Math.floor(Math.random()*(3-1+1))+1;
|
||||
//1--top
|
||||
//2-- down
|
||||
if(direct == 1){
|
||||
passerHuman.newHumanCreate(humanlist,sceneRegion.getzoneposition("enter1"),0,waitForCreatIn[0].overGoal);
|
||||
}else{
|
||||
passerHuman.newHumanCreate(humanlist,sceneRegion.getzoneposition("enter2"),0,waitForCreatIn[0].overGoal);
|
||||
}
|
||||
waitForCreatIn.shift();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
//
|
||||
// function onselect(event){
|
||||
// if(event.button == '0'){
|
||||
//
|
||||
// //定义光线
|
||||
// let raycaster = new THREE.Raycaster();
|
||||
// //定义平面鼠标点击坐标
|
||||
// let mouse = new THREE.Vector2();
|
||||
// mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1;
|
||||
// mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1;
|
||||
//
|
||||
// raycaster.setFromCamera( mouse, camerass );
|
||||
//
|
||||
// let intersects = raycaster.intersectObject(scope.modelmanager.station.mesh,true);
|
||||
// console.log(intersects[0].point);
|
||||
// }
|
||||
// }
|
||||
|
||||
this.changeDrawType = function(drawType){
|
||||
console.log(drawType);
|
||||
controls.drawSwitch = true;
|
||||
if(drawType == "startRegion"){
|
||||
controls.drawColor = 0x2894FF;
|
||||
controls.drawRegion = "startRegion";
|
||||
}
|
||||
if(drawType == "securityRegion"){
|
||||
controls.drawColor = 0xFF0000;
|
||||
controls.drawRegion = "securityRegion";
|
||||
}
|
||||
if(drawType == "checkRegion"){
|
||||
controls.drawColor = 0x9F35FF;
|
||||
controls.drawRegion = "checkRegion";
|
||||
}
|
||||
if(drawType == "standRegion"){
|
||||
controls.drawColor = 0x00EC00;
|
||||
controls.drawRegion = "standRegion";
|
||||
}
|
||||
if(drawType == "ticketRegion"){
|
||||
controls.drawColor = 0x00FFFF;
|
||||
controls.drawRegion = "ticketRegion";
|
||||
}
|
||||
if(drawType == "elevatorRegion"){
|
||||
controls.drawColor = 0xFFFF37;
|
||||
controls.drawRegion = "elevatorRegion";
|
||||
}
|
||||
if(drawType == "stairsRegion"){
|
||||
controls.drawColor = 0xFF5809;
|
||||
controls.drawRegion = "stairsRegion";
|
||||
}
|
||||
if(drawType == "escalatorRegion"){
|
||||
controls.drawColor = 0x5CADAD;
|
||||
controls.drawRegion = "escalatorRegion";
|
||||
}
|
||||
if(drawType == "unaccessRegion"){
|
||||
controls.drawColor = 0x272727;
|
||||
controls.drawRegion = "unaccessRegion";
|
||||
}
|
||||
}
|
||||
|
||||
let oldCameraPosition = new THREE.Vector3();
|
||||
let oldCameraTarget = new THREE.Vector3();
|
||||
this.changeControlMode = function(controlMode){
|
||||
|
||||
if(controlMode == false){
|
||||
controls.controlMode = "Orbit";
|
||||
camerass.position.set(oldCameraPosition.x,oldCameraPosition.y,oldCameraPosition.z);
|
||||
controls.target.set( oldCameraTarget.x,oldCameraTarget.y,oldCameraTarget.z);
|
||||
passerStation.resetPosition(controls.drawGroup);
|
||||
}else if(controlMode == true){
|
||||
controls.controlMode = "Draw";
|
||||
oldCameraPosition.copy(camerass.position);
|
||||
oldCameraTarget.copy(controls.target);
|
||||
// camerass.position.set(0,300,0);
|
||||
// controls.target.set( 1, 0, 0 );
|
||||
passerStation.apartPosition(controls.drawGroup);
|
||||
controls.initPlaneMesh(passerStation);
|
||||
}
|
||||
}
|
||||
|
||||
this.deleteRegion = function(){
|
||||
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() {
|
||||
render();
|
||||
// console.log(passerRender);
|
||||
// console.log("ss");
|
||||
// if(passerRender.state == "freeview"){
|
||||
controls.update();
|
||||
// }
|
||||
// delta = clock.getDelta();
|
||||
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
}
|
||||
function render() {
|
||||
|
||||
renderer.render( scene,camerass);
|
||||
|
||||
}
|
||||
|
||||
window.onresize = function () {
|
||||
renderer.setSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
|
||||
}
|
||||
|
||||
|
||||
function getnum(num,pnum){
|
||||
let re = [];
|
||||
let base = Math.floor(num/pnum);
|
||||
let reset = num%pnum;
|
||||
for(let i=0;i<pnum;i++){
|
||||
let nownum = base+(i<reset?1:0);
|
||||
re.push(nownum);
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
||||
}
|
183
src/jlmap3d/jl3dstationmanager/loader/loader.js
Normal file
@ -0,0 +1,183 @@
|
||||
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
import store from '@/store/index';
|
||||
//模型管理器
|
||||
let mode = "0";
|
||||
export function ModelManager(){
|
||||
let scope = this;
|
||||
|
||||
this.man1 = {
|
||||
code:null,
|
||||
locateType:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
this.man2 = {
|
||||
code:null,
|
||||
locateType:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
|
||||
this.station = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.zhajiin = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
this.zhajiout = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.monitor = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.train = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
|
||||
this.section = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.seat = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.futi = {
|
||||
code:null,
|
||||
screenDoorOpenStatus:"01",
|
||||
animations:null,
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
//读取模型
|
||||
this.loadpromise = function (data,mixers,loadmode){
|
||||
mode = loadmode;
|
||||
let initlist = [];
|
||||
for(let i=0,leni=data.length;i<leni;i++){
|
||||
if(data[i].type == "man1" || data[i].type == "cctvMan1"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.man1));
|
||||
}
|
||||
if(data[i].type == "man2" || data[i].type == "cctvMan2"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.man2));
|
||||
}
|
||||
if(data[i].type == "cctvStation"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.station));
|
||||
}
|
||||
if(data[i].type == "cctvGateIn"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.zhajiin));
|
||||
}
|
||||
if(data[i].type == "cctvGateOut"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.zhajiout));
|
||||
}
|
||||
if(data[i].type == "cctvMonitor"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.monitor));
|
||||
}
|
||||
if(data[i].type == "cctvTrain"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.train));
|
||||
}
|
||||
if(data[i].type == "cctvSection"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.section));
|
||||
}
|
||||
if(data[i].type == "seat"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.seat));
|
||||
}
|
||||
|
||||
if(data[i].type == "cctvFuti"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.futi));
|
||||
}
|
||||
}
|
||||
//promise按顺序加载
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
Promise.all(initlist).then((result) => {
|
||||
console.log("success");
|
||||
store.dispatch('app/animationsClose');
|
||||
resolve("success"); //['成功了', 'success']
|
||||
}).catch((error) => {
|
||||
//console.log(error);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
//fbx模型加载
|
||||
function fbxpromise(asset,mixers,model){
|
||||
return new Promise(function(resolve, reject){
|
||||
var loader = new THREE.FBXLoader();
|
||||
if( mode == "2"){
|
||||
loader.load( asset.url, function ( object ) {
|
||||
model.mesh = object;
|
||||
console.log(asset.type);
|
||||
console.log(object);
|
||||
resolve(asset.deviceType);
|
||||
} );
|
||||
|
||||
}else{
|
||||
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
|
||||
|
||||
//列车模型子物体重新排序
|
||||
if(asset.type == "cctvTrain"){
|
||||
// let mixer = new THREE.AnimationMixer( object );
|
||||
let realtrain = new THREE.Group();
|
||||
for(let j=6;j>0;j--){
|
||||
let name = "c"+j;
|
||||
for(let i=0;i<object.children.length;i++){
|
||||
if(object.children[i].name == name){
|
||||
|
||||
object.children[i].position.x = object.children[i].position.x;
|
||||
//object.children[i].position.y = j*10;
|
||||
realtrain.add(object.children[i]);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
model.mesh = realtrain;
|
||||
model.mesh.animations = object.animations[0].tracks;
|
||||
//
|
||||
}else{
|
||||
model.mesh = object;
|
||||
|
||||
}
|
||||
|
||||
resolve(asset.deviceType);
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
65
src/jlmap3d/jl3dstationmanager/loader/stationconfig.js
Normal file
@ -0,0 +1,65 @@
|
||||
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
var Staticmodel = [
|
||||
{
|
||||
id: "1",
|
||||
name: "人物1",
|
||||
deviceType: "man1",
|
||||
type: "man1",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-12-28/165-74879.FBX"
|
||||
},{
|
||||
id: "2",
|
||||
name: "人物2",
|
||||
deviceType: "man2",
|
||||
type: "man2",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-12-28/165-74879.FBX"
|
||||
},{
|
||||
id: "3",
|
||||
name: "车站",
|
||||
deviceType: "cctvStation",
|
||||
type: "cctvStation",
|
||||
url: BASE_ASSET_API + "/MODEL/2021-03-11/1344-16880.FBX"
|
||||
//2021.3.11/MODEL/2021-02-20/1296-89217.FBX
|
||||
//最早模型 /MODEL/2020-11-23/79-95086.FBX
|
||||
},{
|
||||
id: "4",
|
||||
name: "闸机",
|
||||
deviceType: "cctvGateIn",
|
||||
type: "cctvGateIn",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-20/42-7172.FBX"
|
||||
},{
|
||||
id: "5",
|
||||
name: "闸机",
|
||||
deviceType: "cctvGateOut",
|
||||
type: "cctvGateOut",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-20/43-8227.FBX"
|
||||
},{
|
||||
id: "6",
|
||||
name: "摄像机",
|
||||
deviceType: "cctvMonitor",
|
||||
type: "cctvMonitor",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-20/44-24100.FBX"
|
||||
},{
|
||||
id: "7",
|
||||
name: "列车",
|
||||
deviceType: "cctvTrain",
|
||||
type: "cctvTrain",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-11-23/80-14604.FBX"
|
||||
},{
|
||||
id: "8",
|
||||
name: "区段",
|
||||
deviceType: "cctvSection",
|
||||
type: "cctvSection",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-20/45-36330.FBX"
|
||||
},
|
||||
{
|
||||
id: "9",
|
||||
name: "电扶梯",
|
||||
deviceType: "cctvFuti",
|
||||
type: "cctvFuti",
|
||||
url: BASE_ASSET_API + "/MODEL/2021-03-11/1345-1782.FBX"
|
||||
}
|
||||
|
||||
|
||||
];
|
||||
|
||||
export { Staticmodel }
|
340
src/jlmap3d/jl3dstationmanager/model/passerhuman.js
Normal file
@ -0,0 +1,340 @@
|
||||
export function PasserHuman() {
|
||||
let scope = this;
|
||||
//初始人物模型和动画
|
||||
let originhuman1 = null;
|
||||
let originhuman2 = null;
|
||||
let originanima1 = null;
|
||||
let originanima2 = null;
|
||||
//初始化人物模型动画
|
||||
this.initHumans = function(object1,object2,mixers,deviceaction,scene){
|
||||
originhuman1 = creatHuman();
|
||||
originhuman1.progress = 1;
|
||||
// scene.add(originhuman1);
|
||||
originhuman2 = creatHuman();
|
||||
//
|
||||
// let mixer1 = new THREE.AnimationMixer( originhuman1 );
|
||||
// let mixer2 = new THREE.AnimationMixer( originhuman2 );
|
||||
// originanima1 = originhuman1.animations[ 0 ];
|
||||
// originanima2 = originhuman2.animations[ 0 ];
|
||||
// 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){
|
||||
if(scope.humanWaitIn.length != 0){
|
||||
let newhuman;
|
||||
createHumanModel(newhuman,humanlist,position,scope.humanWaitIn[0].stage,scope.humanWaitIn[0].direct,scope.humanWaitIn[0].door);
|
||||
scope.humanWaitIn.shift();
|
||||
}
|
||||
}
|
||||
//创建新的出站乘客
|
||||
this.newOutHuman = function(humanlist,position){
|
||||
if(scope.humanWaitOut.length != 0){
|
||||
let newhuman;
|
||||
createHumanModel(newhuman,humanlist,position,scope.humanWaitOut[0].stage,scope.humanWaitOut[0].direct,scope.humanWaitOut[0].door);
|
||||
scope.humanWaitOut.shift();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//创建新的乘客
|
||||
this.newHumanCreate = function(humanlist,position,stage,direct,door,overGoal){
|
||||
let newhuman;
|
||||
createHumanModel(newhuman,humanlist,position,stage,direct,door,overGoal);
|
||||
}
|
||||
|
||||
function createHumanModel(newhuman,humanlist,position,stage,direct,door,overGoal){
|
||||
let mantype = Math.floor(Math.random()*(3-1+1))+1;
|
||||
|
||||
if(mantype == 1){
|
||||
// newhuman = THREE.SkeletonUtils.clone( originhuman1 );
|
||||
newhuman = originhuman1.clone( );
|
||||
// newhuman.animations = [];
|
||||
// newhuman.animations.push(originanima1.clone());
|
||||
}else{
|
||||
// newhuman = THREE.SkeletonUtils.clone( originhuman2 );
|
||||
newhuman = originhuman2.clone( );
|
||||
// newhuman.animations = [];
|
||||
// newhuman.animations.push(originanima2.clone());
|
||||
}
|
||||
|
||||
// let mixer = new THREE.AnimationMixer( newhuman );
|
||||
newhuman.position.copy(position);
|
||||
|
||||
if(overGoal){
|
||||
newhuman.overGoal = overGoal;
|
||||
}
|
||||
|
||||
|
||||
newhuman.status = 0;
|
||||
|
||||
newhuman.stage = stage;
|
||||
if(direct){
|
||||
if(direct == "top"){
|
||||
newhuman.rotation.y = Math.PI;
|
||||
}
|
||||
newhuman.direct = direct;
|
||||
}else{
|
||||
newhuman.direct = null;
|
||||
}
|
||||
if(newhuman.direct == "top"){
|
||||
newhuman.rotation.y = Math.PI;
|
||||
}
|
||||
newhuman.doorstatus = null;
|
||||
if(door){
|
||||
newhuman.door = door;
|
||||
}else{
|
||||
newhuman.door = null;
|
||||
}
|
||||
// newhuman.action = mixer.clipAction( newhuman.animations[ 0 ] );
|
||||
// newhuman.mixer = mixer;
|
||||
newhuman.runrail = null;
|
||||
newhuman.speed = 0;
|
||||
// newhuman.mixer = mixer;
|
||||
humanlist.add(newhuman);
|
||||
}
|
||||
//定义新模型走路动画
|
||||
this.initMoveAnimate = function(model,name,points,index){
|
||||
model.status = 1;
|
||||
let curve = new THREE.CatmullRomCurve3(points);
|
||||
curve.curvrtype = "catmullrom";
|
||||
// curve.getLength();
|
||||
// curve动画轨迹
|
||||
// progress动画进度
|
||||
// enable当前动画开关
|
||||
// speed动画速度
|
||||
// console.log(curve);
|
||||
|
||||
// model.action.play();
|
||||
model.progress = 0;
|
||||
model.runrail = curve;
|
||||
model.speed = 0.2/curve.getLength();
|
||||
}
|
||||
//更新人物列表中人物的动画
|
||||
this.moveAnimateUpdate = function(humanlist,topWaitPassers,downWaitPassers,outStationPassers,passerHuman){
|
||||
for(let i=0;i<outStationPassers.children.length;i++){
|
||||
if(outStationPassers.children[i].status == 1){
|
||||
if(outStationPassers.children[i].progress>=1){
|
||||
outStationPassers.children[i].progress = 1;
|
||||
// outStationPassers.children[i].action.stop();
|
||||
outStationPassers.children[i].status = 0;
|
||||
|
||||
if(outStationPassers.children[i].stage == 8){
|
||||
passerHuman.uncache(outStationPassers.children[i]);
|
||||
outStationPassers.remove(outStationPassers.children[i]);
|
||||
i--;
|
||||
}else if(outStationPassers.children[i].stage == 7){
|
||||
outStationPassers.children[i].stage = 8;
|
||||
}
|
||||
else if(outStationPassers.children[i].stage == 5){
|
||||
|
||||
outStationPassers.children[i].stage = 7;
|
||||
|
||||
}
|
||||
}else{
|
||||
//根据动画进度获取动画轨迹上点
|
||||
// console.log(i);
|
||||
// console.log(humanlist.children[i].runrail);
|
||||
// console.log(humanlist.children[i].progress);
|
||||
let point = outStationPassers.children[i].runrail.getPointAt(outStationPassers.children[i].progress);
|
||||
|
||||
//更新模型坐标
|
||||
outStationPassers.children[i].position.x = point.x;
|
||||
outStationPassers.children[i].position.y = point.y;
|
||||
outStationPassers.children[i].position.z = point.z;
|
||||
if((outStationPassers.children[i].progress+0.001)<1){
|
||||
let tangent = outStationPassers.children[i].runrail.getPointAt(outStationPassers.children[i].progress+0.001);
|
||||
outStationPassers.children[i].lookAt(new THREE.Vector3(tangent.x,outStationPassers.children[i].position.y,tangent.z));
|
||||
}
|
||||
|
||||
outStationPassers.children[i].progress += outStationPassers.children[i].speed;
|
||||
point = null;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(let i=0;i<topWaitPassers.children.length;i++){
|
||||
if(topWaitPassers.children[i].status == 1){
|
||||
if(topWaitPassers.children[i].progress>=1){
|
||||
topWaitPassers.children[i].progress = 1;
|
||||
// topWaitPassers.children[i].action.stop();
|
||||
topWaitPassers.children[i].status = 0;
|
||||
|
||||
if(topWaitPassers.children[i].stage == 4){
|
||||
passerHuman.uncache(topWaitPassers.children[i]);
|
||||
topWaitPassers.remove(topWaitPassers.children[i]);
|
||||
i--;
|
||||
}
|
||||
}else{
|
||||
//根据动画进度获取动画轨迹上点
|
||||
// console.log(i);
|
||||
// console.log(humanlist.children[i].runrail);
|
||||
// console.log(humanlist.children[i].progress);
|
||||
let point = topWaitPassers.children[i].runrail.getPointAt(topWaitPassers.children[i].progress);
|
||||
|
||||
//更新模型坐标
|
||||
topWaitPassers.children[i].position.x = point.x;
|
||||
topWaitPassers.children[i].position.y = point.y;
|
||||
topWaitPassers.children[i].position.z = point.z;
|
||||
if((topWaitPassers.children[i].progress+0.001)<1){
|
||||
let tangent = topWaitPassers.children[i].runrail.getPointAt(topWaitPassers.children[i].progress+0.001);
|
||||
topWaitPassers.children[i].lookAt(new THREE.Vector3(tangent.x,topWaitPassers.children[i].position.y,tangent.z));
|
||||
}
|
||||
|
||||
topWaitPassers.children[i].progress += topWaitPassers.children[i].speed;
|
||||
point = null;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(let i=0;i<downWaitPassers.children.length;i++){
|
||||
if(downWaitPassers.children[i].status == 1){
|
||||
if(downWaitPassers.children[i].progress>=1){
|
||||
downWaitPassers.children[i].progress = 1;
|
||||
// downWaitPassers.children[i].action.stop();
|
||||
downWaitPassers.children[i].status = 0;
|
||||
if(downWaitPassers.children[i].stage == 4){
|
||||
passerHuman.uncache(downWaitPassers.children[i]);
|
||||
downWaitPassers.remove(downWaitPassers.children[i]);
|
||||
i--;
|
||||
}
|
||||
}else{
|
||||
//根据动画进度获取动画轨迹上点
|
||||
// console.log(i);
|
||||
// console.log(humanlist.children[i].runrail);
|
||||
// console.log(humanlist.children[i].progress);
|
||||
let point = downWaitPassers.children[i].runrail.getPointAt(downWaitPassers.children[i].progress);
|
||||
|
||||
//更新模型坐标
|
||||
downWaitPassers.children[i].position.x = point.x;
|
||||
downWaitPassers.children[i].position.y = point.y;
|
||||
downWaitPassers.children[i].position.z = point.z;
|
||||
if((downWaitPassers.children[i].progress+0.001)<1){
|
||||
let tangent = downWaitPassers.children[i].runrail.getPointAt(downWaitPassers.children[i].progress+0.001);
|
||||
downWaitPassers.children[i].lookAt(new THREE.Vector3(tangent.x,downWaitPassers.children[i].position.y,tangent.z));
|
||||
}
|
||||
|
||||
downWaitPassers.children[i].progress += downWaitPassers.children[i].speed;
|
||||
point = null;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(let i=0;i<humanlist.children.length;i++){
|
||||
if(humanlist.children[i].status == 1){
|
||||
if(humanlist.children[i].progress>=1){
|
||||
//更新模型坐标
|
||||
if(humanlist.children[i].status == 1){
|
||||
|
||||
|
||||
humanlist.children[i].progress = 1;
|
||||
// humanlist.children[i].action.stop();
|
||||
humanlist.children[i].status = 0;
|
||||
if(humanlist.children[i].stage == 3){
|
||||
|
||||
humanlist.children[i].stage = 4;
|
||||
if(humanlist.children[i].direct == "top"){
|
||||
topWaitPassers.add(humanlist.children[i]);
|
||||
i--;
|
||||
}else if(humanlist.children[i].direct == "down"){
|
||||
downWaitPassers.add(humanlist.children[i]);
|
||||
i--;
|
||||
}
|
||||
|
||||
}else if(humanlist.children[i].stage == 2){
|
||||
humanlist.children[i].stage = 3;
|
||||
|
||||
}else if(humanlist.children[i].stage == 1){
|
||||
|
||||
|
||||
humanlist.children[i].stage = 2;
|
||||
|
||||
}else if(humanlist.children[i].stage == 0){
|
||||
// // console.log(humans[i].doors);
|
||||
// zhajiin[humanlist.children[i].doors].waiting = 0;
|
||||
humanlist.children[i].stage = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
//根据动画进度获取动画轨迹上点
|
||||
// console.log(i);
|
||||
// console.log(humanlist.children[i].runrail);
|
||||
// console.log(humanlist.children[i].progress);
|
||||
let point = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress);
|
||||
|
||||
//更新模型坐标
|
||||
humanlist.children[i].position.x = point.x;
|
||||
humanlist.children[i].position.y = point.y;
|
||||
humanlist.children[i].position.z = point.z;
|
||||
if((humanlist.children[i].progress+0.001)<1){
|
||||
let tangent = humanlist.children[i].runrail.getPointAt(humanlist.children[i].progress+0.001);
|
||||
humanlist.children[i].lookAt(new THREE.Vector3(tangent.x,humanlist.children[i].position.y,tangent.z));
|
||||
}
|
||||
|
||||
humanlist.children[i].progress += humanlist.children[i].speed;
|
||||
point = null;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//离开车站释放缓存
|
||||
this.uncache = function(uncachemodel){
|
||||
if(uncachemodel){
|
||||
// uncachemodel.mixer.uncacheAction();
|
||||
uncachemodel.traverse( function ( child ) {
|
||||
if ( child.isMesh ) {
|
||||
child.geometry.dispose();
|
||||
child.material.dispose();
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
246
src/jlmap3d/jl3dstationmanager/model/passerstation.js
Normal file
@ -0,0 +1,246 @@
|
||||
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
||||
|
||||
export function PasserStation() {
|
||||
var scope = this;
|
||||
this.stationMesh = null;
|
||||
this.stationleft = [];
|
||||
this.stationright = [];
|
||||
//替换材质组(站台的)
|
||||
this.stationtexture = [];
|
||||
|
||||
this.stationlist = [];
|
||||
|
||||
this.nowStation = null;
|
||||
|
||||
this.top = null;
|
||||
this.down = null;
|
||||
let originTopPosition = new THREE.Vector3();
|
||||
let originDownPosition = new THREE.Vector3();
|
||||
this.topfloor = null;
|
||||
this.downfloor = null;
|
||||
|
||||
for(let i=0;i<22;i++){
|
||||
let sl = {
|
||||
id:"left"+i,
|
||||
status:0,
|
||||
waiting:0
|
||||
}
|
||||
scope.stationleft.push(sl);
|
||||
}
|
||||
|
||||
for(let i=0;i<22;i++){
|
||||
let sr = {
|
||||
id:"right"+i,
|
||||
status:0,
|
||||
waiting:0
|
||||
}
|
||||
scope.stationright.push(sr);
|
||||
}
|
||||
//初始化车站模型动画
|
||||
this.initStationAnimation = function( object,mixers ,deviceaction ,scene){
|
||||
let mixer = new THREE.AnimationMixer( object ,mixers ,deviceaction ,scene);
|
||||
|
||||
let newclip = object.animations[ 0 ];
|
||||
let standfloor = object.getObjectByName("1CENG");
|
||||
console.log(object);
|
||||
for(let j=0;j<standfloor.children.length;j++){
|
||||
|
||||
if(standfloor.children[j].name == "top"){
|
||||
// let geometry = new THREE.BoxBufferGeometry( 50, 50, 50 );
|
||||
// let material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
|
||||
// let cube = new THREE.Mesh( geometry, material );
|
||||
// cube.position.copy(object.children[j].position);
|
||||
// scene.add( cube );
|
||||
standfloor.children[j].animations = [];
|
||||
standfloor.children[j].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( standfloor.children[j] );
|
||||
|
||||
let action =mixer.clipAction( standfloor.children[j].animations[0])
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
// action.play();
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[standfloor.children[j].name] = device;
|
||||
}
|
||||
if(standfloor.children[j].name == "down"){
|
||||
standfloor.children[j].animations = [];
|
||||
standfloor.children[j].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( standfloor.children[j] );
|
||||
|
||||
|
||||
let action =mixer.clipAction( standfloor.children[j].animations[0])
|
||||
// action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[standfloor.children[j].name] = device;
|
||||
}
|
||||
}
|
||||
object.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
child.renderOrder = 9;
|
||||
}
|
||||
|
||||
} );
|
||||
scope.stationMesh = object;
|
||||
scope.top = object.getObjectByName("1CENG");
|
||||
scope.down = object.getObjectByName("2CENG");
|
||||
originTopPosition.copy(scope.top.position);
|
||||
originDownPosition.copy(scope.down.position);
|
||||
scope.topfloor = object.getObjectByName("1floor");
|
||||
scope.downfloor = object.getObjectByName("2floor");
|
||||
// console.log(deviceaction);
|
||||
scene.add(object);
|
||||
|
||||
}
|
||||
//初始化车站名称数据
|
||||
this.initStationList = function(stationdata,standdata,psddata){
|
||||
let list = [];
|
||||
if(psddata){
|
||||
for(let i=0,leni = standdata.length;i<leni;i++){
|
||||
for(let j=0,lenj = psddata.length;j<lenj;j++){
|
||||
if(standdata[i].code == psddata[j].standCode){
|
||||
standdata[i].name = psddata[j].code;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(let i=0,leni = stationdata.length;i<leni;i++){
|
||||
if(stationdata[i].depot == false){
|
||||
list[stationdata[i].name] = [];
|
||||
for(let j=0,lenj = standdata.length;j<lenj;j++){
|
||||
if(standdata[j].stationCode == stationdata[i].code){
|
||||
list[stationdata[i].name].push(standdata[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(let k in list){
|
||||
if(list[k].length>0){
|
||||
let stationobject = {
|
||||
code : list[k][0].stationCode,
|
||||
name : k,
|
||||
toppsd:null,
|
||||
downpsd:null,
|
||||
topsection:null,
|
||||
downsection:null,
|
||||
};
|
||||
if(list[k][0].position.y<list[k][1].position.y){
|
||||
stationobject.toppsd = list[k][0].name;
|
||||
stationobject.downpsd = list[k][1].name;
|
||||
stationobject.topsection = list[k][0].standTrackCode;
|
||||
stationobject.downsection = list[k][1].standTrackCode;
|
||||
}else{
|
||||
stationobject.toppsd = list[k][1].name;
|
||||
stationobject.downpsd = list[k][0].name;
|
||||
stationobject.topsection = list[k][1].standTrackCode;
|
||||
stationobject.downsection = list[k][0].standTrackCode;
|
||||
}
|
||||
scope.stationlist.push(stationobject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
scope.nowStation = scope.stationlist[0];
|
||||
if(scope.stationtexture["stationlist"]){
|
||||
scope.stationMesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
|
||||
scope.stationMesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
|
||||
if(scope.stationMesh.getObjectByName("menkuangyanse")){
|
||||
scope.stationMesh.getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
|
||||
scope.stationMesh.getObjectByName("menkuangyanse").material.map.needsUpdate = true;
|
||||
}
|
||||
scope.stationMesh.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowStation.code];
|
||||
scope.stationMesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
|
||||
}
|
||||
updatestationlist(scope.stationlist);
|
||||
}else{
|
||||
olddataai = true;
|
||||
}
|
||||
}
|
||||
//加载线路车站名贴图
|
||||
this.loadMaterial = function(netdata3d){
|
||||
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){
|
||||
// scope.down.position.y = scope.top.position.y;
|
||||
scope.top.position.z += 75;
|
||||
scope.down.position.z -= 75;
|
||||
if(drawGroup.children.length>0){
|
||||
for(let i=0;i<drawGroup.children.length;i++){
|
||||
for(let j=0;j<drawGroup.children[i].children.length;j++){
|
||||
if(drawGroup.children[i].children[j].underFloor == "1floor"){
|
||||
drawGroup.children[i].children[j].position.z += 75;
|
||||
}
|
||||
if(drawGroup.children[i].children[j].underFloor == "2floor"){
|
||||
drawGroup.children[i].children[j].position.z -= 75;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.resetPosition = function(drawGroup){
|
||||
scope.top.position.copy(originTopPosition);
|
||||
scope.down.position.copy(originDownPosition);
|
||||
if(drawGroup.children.length>0){
|
||||
for(let i=0;i<drawGroup.children.length;i++){
|
||||
|
||||
for(let j=0;j<drawGroup.children[i].children.length;j++){
|
||||
if(drawGroup.children[i].children[j].underFloor == "1floor"){
|
||||
drawGroup.children[i].children[j].position.z -= 75;
|
||||
// drawGroup.children[i].position.y = scope.top.position.y;
|
||||
}
|
||||
if(drawGroup.children[i].children[j].underFloor == "2floor"){
|
||||
drawGroup.children[i].children[j].position.z += 75;
|
||||
// drawGroup.children[i].position.y = scope.down.position.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//更换场景车站
|
||||
this.changestation = function(stationname){
|
||||
for(let i=0,leni=scope.stationlist.length;i<leni;i++){
|
||||
if(scope.stationlist[i].name == stationname){
|
||||
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;
|
||||
}
|
||||
i=leni;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
134
src/jlmap3d/jl3dstationmanager/model/passertrain.js
Normal file
@ -0,0 +1,134 @@
|
||||
export function PasserTrain() {
|
||||
let scope = this;
|
||||
this.toptrain = null;
|
||||
this.downtrain = null;
|
||||
|
||||
this.dataList = [];
|
||||
//初始化列车模型动画
|
||||
this.initTrain = function(object,mixers,deviceaction,scene){
|
||||
let ntracks1,ntracks2,tclip,fclip;
|
||||
|
||||
if(object.animations){
|
||||
tclip = new THREE.AnimationClip("three",2,object.animations[0].tracks);
|
||||
|
||||
// ntracks1 = object.animations.slice(16,27);
|
||||
//
|
||||
// tclip = new THREE.AnimationClip("three",2,ntracks1);
|
||||
|
||||
// ntracks2 = object.animations.slice(0,15);
|
||||
|
||||
// fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
object.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
child.renderOrder = 8;
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
let newTrain = object.clone(true);
|
||||
newTrain.nowcode = null;
|
||||
scope.toptrain = newTrain;
|
||||
scope.toptrain.action = {
|
||||
top:[],
|
||||
down:[]
|
||||
};
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(-71,0.06,-6.3));
|
||||
points1.push(new THREE.Vector3(60.73,0.06,-6.3));
|
||||
|
||||
|
||||
scope.toptrain.curve = new THREE.CatmullRomCurve3(points1);
|
||||
|
||||
scope.downtrain = object.clone(true);
|
||||
scope.downtrain.nowcode = null;
|
||||
scope.downtrain.action = {
|
||||
top:[],
|
||||
down:[]
|
||||
};
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(-71,0.06,28.68));
|
||||
points2.push(new THREE.Vector3(60.73,0.06,28.68));
|
||||
scope.downtrain.curve = new THREE.CatmullRomCurve3(points2);
|
||||
// console.log(scope.toptrain);
|
||||
|
||||
inittrainanimation(scope.toptrain,tclip,fclip,mixers);
|
||||
inittrainanimation(scope.downtrain,tclip,fclip,mixers);
|
||||
|
||||
|
||||
scope.toptrain.position.z = -20;
|
||||
scope.toptrain.position.y = -20000;
|
||||
scope.toptrain.rotation.y = Math.PI;
|
||||
scope.downtrain.position.z = 40;
|
||||
scope.downtrain.position.y = -20000;
|
||||
scene.add(scope.toptrain);
|
||||
scene.add(scope.downtrain);
|
||||
}
|
||||
//初始化车门动画
|
||||
function inittrainanimation(train,tclip,fclip,mixers){
|
||||
|
||||
for(let j=0;j<train.children.length;j++){
|
||||
// if(train.children[j].name == "c1" || train.children[j].name == "c6"){
|
||||
// console.log(train.children[j].children);
|
||||
for(let n=0,lenn = train.children[j].children.length;n<lenn;n++){
|
||||
if(train.children[j].children[n].name == "top"){
|
||||
train.children[j].children[n].animations = [];
|
||||
train.children[j].children[n].animations.push(tclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
|
||||
|
||||
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
train.action.top.push(action);
|
||||
mixers.push(mixer);
|
||||
}
|
||||
if(train.children[j].children[n].name == "down"){
|
||||
train.children[j].children[n].animations = [];
|
||||
|
||||
train.children[j].children[n].animations.push(tclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
|
||||
|
||||
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
train.action.down.push(action);
|
||||
mixers.push(mixer);
|
||||
}
|
||||
}
|
||||
|
||||
// }else{
|
||||
// for(let n=0,lenn = train.children[j].children.length;n<lenn;n++){
|
||||
// if(train.children[j].children[n].name == "top"){
|
||||
// train.children[j].children[n].animations = [];
|
||||
// train.children[j].children[n].animations.push(fclip.clone());
|
||||
// let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
|
||||
// mixers.push(mixer);
|
||||
// let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
|
||||
// action.setLoop(THREE.LoopOnce);
|
||||
// action.clampWhenFinished = true;
|
||||
// train.action.top.push(action);
|
||||
// mixers.push(mixer);
|
||||
// }
|
||||
// if(train.children[j].children[n].name == "down"){
|
||||
// train.children[j].children[n].animations = [];
|
||||
// train.children[j].children[n].animations.push(fclip.clone());
|
||||
// let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
|
||||
// mixers.push(mixer);
|
||||
// let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );
|
||||
// action.setLoop(THREE.LoopOnce);
|
||||
// action.clampWhenFinished = true;
|
||||
// train.action.down.push(action);
|
||||
// mixers.push(mixer);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
309
src/jlmap3d/jl3dstationmanager/model/region/checkRegion.js
Normal file
@ -0,0 +1,309 @@
|
||||
export function checkRegion(data) {
|
||||
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.zhajiout = [];
|
||||
//定义闸机状态
|
||||
for(let i=0;i<5;i++){
|
||||
let zhaji = {
|
||||
id:"in0"+(i+1),
|
||||
status:0,
|
||||
waiting:0
|
||||
}
|
||||
scope.zhajiin.push(zhaji);
|
||||
}
|
||||
for(let i=0;i<5;i++){
|
||||
let zhaji = {
|
||||
id:"out0"+(i+1),
|
||||
status:0,
|
||||
waiting:0
|
||||
}
|
||||
scope.zhajiout.push(zhaji);
|
||||
}
|
||||
//初始化闸机动画
|
||||
this.initCheckDoorInAnimation = function(object,mixers ,deviceaction ,scene){
|
||||
let mixer = new THREE.AnimationMixer( object );
|
||||
let newclip = object.animations[ 0 ];
|
||||
let newzhaji = object;
|
||||
for(let i=0;i<newzhaji.children.length;i++){
|
||||
if(newzhaji.children[i].name == "in01"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
if(newzhaji.children[i].name == "in02"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
if(newzhaji.children[i].name == "in03"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
if(newzhaji.children[i].name == "in04"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
if(newzhaji.children[i].name == "in05"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
|
||||
}
|
||||
scene.add(newzhaji);
|
||||
|
||||
}
|
||||
//初始化闸机动画
|
||||
this.initCheckDoorOutAnimation = function(object,mixers ,deviceaction ,scene){
|
||||
let mixer = new THREE.AnimationMixer( object );
|
||||
let newclip = object.animations[ 0 ];
|
||||
let newzhaji = object;
|
||||
for(let i=0;i<newzhaji.children.length;i++){
|
||||
if(newzhaji.children[i].name == "out01"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
if(newzhaji.children[i].name == "out02"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
if(newzhaji.children[i].name == "out03"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
if(newzhaji.children[i].name == "out04"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
if(newzhaji.children[i].name == "out05"){
|
||||
newzhaji.children[i].animations = [];
|
||||
newzhaji.children[i].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newzhaji.children[i] );
|
||||
|
||||
let action =mixer.clipAction( newzhaji.children[i].animations[0]);
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
|
||||
mixers.push(mixer);
|
||||
let device = {
|
||||
action:action,
|
||||
mixer:mixer,
|
||||
};
|
||||
deviceaction[object.children[i].name] = device;
|
||||
}
|
||||
|
||||
}
|
||||
scene.add(newzhaji);
|
||||
}
|
||||
//闸机动画控制
|
||||
this.checkDoorControl = function(type,door,deviceaction){
|
||||
let devicenum = door;
|
||||
|
||||
if(type == "in"){
|
||||
let checkDoorId = scope.zhajiin[devicenum].id;
|
||||
deviceaction[checkDoorId].action.reset();
|
||||
deviceaction[checkDoorId].action.time = 0;
|
||||
deviceaction[checkDoorId].action.timeScale = 1;
|
||||
deviceaction[checkDoorId].action.play();
|
||||
}else if(type == "out"){
|
||||
let checkDoorId = scope.zhajiout[devicenum].id;
|
||||
deviceaction[checkDoorId].action.reset();
|
||||
deviceaction[checkDoorId].action.time = 0;
|
||||
deviceaction[checkDoorId].action.timeScale = 1;
|
||||
deviceaction[checkDoorId].action.play();
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
83
src/jlmap3d/jl3dstationmanager/model/region/stairsRegion.js
Normal 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;
|
||||
|
||||
}
|
||||
}
|
87
src/jlmap3d/jl3dstationmanager/model/region/standRegion.js
Normal 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;
|
||||
|
||||
}
|
||||
}
|
95
src/jlmap3d/jl3dstationmanager/model/region/startRegion.js
Normal 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;
|
||||
|
||||
}
|
||||
}
|
91
src/jlmap3d/jl3dstationmanager/model/region/ticketRegion.js
Normal 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;
|
||||
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
290
src/jlmap3d/jl3dstationmanager/model/regionManager.js
Normal 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){
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|