Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0cb4088f6c
@ -5,10 +5,10 @@ NODE_ENV = 'development'
|
||||
# base api
|
||||
# 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://oss.joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
||||
# VUE_APP_BASE_API = 'http://192.168.3.6:9000'
|
||||
# VUE_APP_VOICE_API = 'http://119.3.163.89/oss/joylink'
|
||||
# VUE_APP_UPLOAD_API = 'http://joylink.club/jlfile'
|
||||
# VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
||||
# VUE_APP_VOICE_API = 'http://192.168.8.110:9008'
|
||||
|
||||
|
||||
|
8
.env.heb
8
.env.heb
@ -3,7 +3,7 @@ NODE_ENV = 'production'
|
||||
VUE_APP_PRO = 'local'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'http://160.20.60.15:9000'
|
||||
VUE_APP_VOICE_API = 'http://160.20.60.15/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'http://160.20.60.15'
|
||||
VUE_APP_BASE_SITE='http://160.20.60.15'
|
||||
# VUE_APP_BASE_API = 'http://160.20.60.15:9000'
|
||||
# VUE_APP_VOICE_API = 'http://160.20.60.15/oss/joylink'
|
||||
# VUE_APP_UPLOAD_API = 'http://160.20.60.15'
|
||||
# VUE_APP_BASE_SITE='http://160.20.60.15'
|
||||
|
@ -3,7 +3,7 @@ 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'
|
||||
VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||
# 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'
|
||||
# VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||
|
@ -2,7 +2,7 @@
|
||||
NODE_ENV = 'production'
|
||||
|
||||
# base api
|
||||
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'
|
||||
VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||
# 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'
|
||||
# VUE_APP_BASE_SITE='https://joylink.club/cbtc'
|
||||
|
@ -2,7 +2,7 @@
|
||||
NODE_ENV = 'test'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink'
|
||||
VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
||||
# VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
||||
# VUE_APP_VOICE_API = 'https://joylink.club/oss/joylink'
|
||||
# VUE_APP_UPLOAD_API = 'https://upload.joylink.club'
|
||||
# VUE_APP_BASE_SITE='https://test.joylink.club/cbtc'
|
||||
|
@ -17,7 +17,7 @@
|
||||
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "0.18.0",
|
||||
"axios": "^0.18.0",
|
||||
"echarts": "^4.7.0",
|
||||
"element-ui": "^2.12.0",
|
||||
"file-saver": "^1.3.3",
|
||||
@ -70,9 +70,9 @@
|
||||
"eslint-plugin-vue": "5.2.2",
|
||||
"file-loader": "^3.0.1",
|
||||
"html-webpack-plugin": "3.2.0",
|
||||
"node-sass": "^4.9.0",
|
||||
"node-sass": "^4.14.1",
|
||||
"runjs": "^4.3.2",
|
||||
"sass-loader": "^7.1.0",
|
||||
"sass-loader": "^7.3.1",
|
||||
"script-ext-html-webpack-plugin": "2.1.3",
|
||||
"script-loader": "^0.7.2",
|
||||
"serve-static": "^1.13.2",
|
||||
|
21
src/App.vue
21
src/App.vue
@ -3,6 +3,16 @@
|
||||
<router-view />
|
||||
<deomon-topic ref="deomonTopic" />
|
||||
<img v-show="loading" :src="loadingImg" class="AppAll">
|
||||
<div
|
||||
v-if="!$store.state.user.baseUrl"
|
||||
v-loading="!$store.state.user.baseUrl"
|
||||
element-loading-text="拼命加载中"
|
||||
element-loading-background="rgba(0, 0, 0, 0)"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
style="width: 100%;height: 100%;"
|
||||
>
|
||||
<img :src="appLoading" class="centerImg">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -13,6 +23,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 AppLoading from '@/assets/appLoading.png';
|
||||
import { openIndexedDB } from '@/utils/indexedDb';
|
||||
|
||||
export default {
|
||||
@ -26,6 +37,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loadingImg: LoadingImg,
|
||||
appLoading: AppLoading,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
@ -113,4 +125,13 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.AppAll{position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 2003}
|
||||
.centerImg {
|
||||
position: absolute;
|
||||
left:50%;
|
||||
top: 50%;
|
||||
width: 480px;
|
||||
height: 456px;
|
||||
margin-left: -240px;
|
||||
margin-top: -228px;
|
||||
}
|
||||
</style>
|
||||
|
49
src/api/audioResources.js
Normal file
49
src/api/audioResources.js
Normal file
@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 创建音频资源
|
||||
export function createAudioResources(data) {
|
||||
return request({
|
||||
url: `/api/audioResources`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 查询所有音频资源
|
||||
export function queryAllAudioResources() {
|
||||
return request({
|
||||
url: `/api/audioResources/list`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 删除音频资源
|
||||
export function deleteAudioResources(id) {
|
||||
return request({
|
||||
url: `/api/audioResources/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
// 更新音频资源
|
||||
export function updateAudioResources(id, data) {
|
||||
return request({
|
||||
url: `/api/audioResources/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 分页查询音频资源
|
||||
export function pagedAudioResources(params) {
|
||||
return request({
|
||||
url: `/api/audioResources/paged`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 上传音频文件
|
||||
export function uploadAudio(file) {
|
||||
return request({
|
||||
url: `/api/upload/AUDIO?appId=00001&appSecret=joylink00001`,
|
||||
method: 'post',
|
||||
data: file,
|
||||
upload: true
|
||||
});
|
||||
}
|
@ -309,3 +309,10 @@ export function getUserDuration(params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 获取单位二维码 */
|
||||
export function getCompanyQrCode(orgId) {
|
||||
return request({
|
||||
url: `/api/company/${orgId}/qrCode`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
113
src/api/iscs.js
113
src/api/iscs.js
@ -49,3 +49,116 @@ export function queryHasIscs(params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
// iscs设备创建
|
||||
export function createIscsDevcie(data) {
|
||||
return request({
|
||||
url: `/api/iscsDevice`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 查询所有iscs设备
|
||||
export function queryAllIscsDevice() {
|
||||
return request({
|
||||
url: `/api/iscsDevice/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 根据id查询iscs设备
|
||||
export function queryIscsDevcieById(id) {
|
||||
return request({
|
||||
url:
|
||||
`/api/iscsDevice/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 根据mapId获取Iscs设备list
|
||||
export function queryIscsDeviceListByMapId(mapId) {
|
||||
return request({
|
||||
url: `/api/iscsDevice/list/mapId/${mapId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 分页查询ISCS设备
|
||||
export function pagedIscsDevice(params) {
|
||||
return request({
|
||||
url: `/api/iscsDevice/paged`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 删除ISCS设备
|
||||
export function deleteIscsDevice(id) {
|
||||
return request({
|
||||
url: `/api/iscsDevice/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
// 根据mapId查询设备列表
|
||||
export function getIscsDeviceListByMapId(mapId) {
|
||||
return request({
|
||||
url: `/api/iscsDevice/list/mapId/${mapId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 根据条件查询设备列表
|
||||
export function queryIscsDeviceCod(params) {
|
||||
return request({
|
||||
url: `/api/iscsDevice/list/criteria`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 批量创建ISCS设备
|
||||
export function batchCreateIscsDevcie(data) {
|
||||
return request({
|
||||
url: `/api/iscsDevice/create/batch`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 创建ISCS系统资源
|
||||
export function createIscsResources(data) {
|
||||
return request({
|
||||
url: `/api/systemRes`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 查询所有ISCS系统资源
|
||||
export function queryAllIscsResources() {
|
||||
return request({
|
||||
url: `/api/systemRes/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 根据id查询ISCS系统资源
|
||||
export function queryIscsResourcesById(id) {
|
||||
return request({
|
||||
url: `/api/systemRes/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 分页查询ISCS系统资源
|
||||
export function pagedIscsResources(params) {
|
||||
return request({
|
||||
url: `/api/systemRes/paged`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 删除ISCS系统资源
|
||||
export function deleteIscsResources(id) {
|
||||
return request({
|
||||
url: `/api/systemRes/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
// 按条件查询ISCS系统资源
|
||||
export function queryIscsResourcesCod(params) {
|
||||
return request({
|
||||
url: `/api/systemRes/list/criteria`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
import store from '@/store/index';
|
||||
const publicPath = process.env.VUE_APP_PRO == 'local' ? '' : '/cbtc';
|
||||
|
||||
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;
|
||||
const BASE_UPLOAD_API = store.state.user.uploadUrl;
|
||||
export const BASE_ASSET_API = store.state.user.resourcesUrl;
|
||||
// console.log(JL3D_LOCAL_STATIC);
|
||||
// console.log(BASE_UPLOAD_API);
|
||||
// console.log(BASE_ASSET_API);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
//获取三维课程草稿列表
|
||||
export function getLesson3dDrftList(params) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/paging`,
|
||||
@ -7,7 +7,7 @@ export function getLesson3dDrftList(params) {
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
//获取三维课程草稿数据
|
||||
export function getLesson3dData(lessonId) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/${lessonId}`,
|
||||
@ -15,13 +15,47 @@ export function getLesson3dData(lessonId) {
|
||||
params: ''
|
||||
});
|
||||
}
|
||||
//获取三维课程发布数据
|
||||
export function getPublishLesson3dData(lessonId) {
|
||||
return request({
|
||||
url: `/api/lesson3d/${lessonId}`,
|
||||
method: 'get',
|
||||
params: ''
|
||||
});
|
||||
}
|
||||
//上架课程
|
||||
export function onlineLesson3d(lessonId) {
|
||||
return request({
|
||||
url: `/api/lesson3d/${lessonId}/online`,
|
||||
method: 'put',
|
||||
params: ''
|
||||
});
|
||||
}
|
||||
//下架课程
|
||||
export function offlineLesson3d(lessonId) {
|
||||
return request({
|
||||
url: `/api/lesson3d/${lessonId}/offline`,
|
||||
method: 'put',
|
||||
params: ''
|
||||
});
|
||||
}
|
||||
|
||||
export function getSelectLesson3dList(params) {
|
||||
return request({
|
||||
url: `/api/lesson3d/list`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
//查询发布课程
|
||||
export function publishedLesson3d() {
|
||||
export function publishedLesson3d(params) {
|
||||
return request({
|
||||
url: `/api/lesson3d/paging`,
|
||||
method: 'get',
|
||||
params: ''
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
@ -39,7 +73,7 @@ export function publishLesson3d(lessonId) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/${lessonId}/publish`,
|
||||
method: 'post',
|
||||
data: ""
|
||||
data: ''
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -90,3 +90,25 @@ export function getExamListByMapIdAndPrdType(mapId, prdType) {
|
||||
params: { prdType: prdType }
|
||||
});
|
||||
}
|
||||
/** 更新试卷规则 */
|
||||
export function updateExamRule(data) {
|
||||
return request({
|
||||
url: `/api/exam/update/rules`,
|
||||
method: 'put',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
/** 检查并更新【规则数据异常】状态 */
|
||||
export function checkAndUpdateAbnormal(mapId) {
|
||||
return request({
|
||||
url: `/api/exam/checkAndUpdateAbnormal/${mapId}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 重新生成考试规则 */
|
||||
export function regenerateRule (mapId) {
|
||||
return request({
|
||||
url: `/api/exam/regenerateRules/${mapId}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
@ -66,3 +66,43 @@ export function getClassGradeList(examId, params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询组织学生单次考试成绩曲线 */
|
||||
export function getClassGradeStatistic(orgId, examId) {
|
||||
return request({
|
||||
url: `/api/userExam/curve/${orgId}/${examId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询组织学生单次考试成绩曲线 */
|
||||
export function getStuGradeStatistic(userId) {
|
||||
return request({
|
||||
url: `/api/userExam/curve/${userId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
/** 个人仿真数据统计 */
|
||||
export function getSimulationTimeChart(mapId) {
|
||||
return request({
|
||||
url: `/api/stats/simulation/${mapId}/stats`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 课程内实训数据统计
|
||||
export function getLessonTimeChart(id) {
|
||||
return request({
|
||||
url: `/api/stats/lesson/${id}/stats`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 课程列表
|
||||
export function getLessonList() {
|
||||
return request({
|
||||
url: '/api/stats/lesson/list',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -37,38 +37,6 @@ export function getDeviceDetail(id) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 添加/修改屏蔽门设备网关映射配置 */
|
||||
export function setPsdConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/psd`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加/修改信号机设备网关映射配置 */
|
||||
export function setSignalConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/signal`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加/修改信号机设备网关映射配置 */
|
||||
export function setSwitchConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/switch`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加/修改端头控制盒网关映射配置 */
|
||||
export function setPslConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/psl`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加/修改ibp盘网关映射配置 */
|
||||
export function setIbpConfig(id, data) {
|
||||
return request({
|
||||
@ -77,15 +45,6 @@ export function setIbpConfig(id, data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加/修改psc控制柜网关映射配置 */
|
||||
export function setPscConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/psc`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加/修改ibp设备配置 */
|
||||
export function setVrIbpConfig(id, data) {
|
||||
return request({
|
||||
@ -177,3 +136,11 @@ export function setIlwConfig(id, data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加/修改设备配置 */
|
||||
export function setDeviceConfig(data) {
|
||||
return request({
|
||||
url: `/api/device/config/updateConfig`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
40
src/api/projectServer.js
Normal file
40
src/api/projectServer.js
Normal file
@ -0,0 +1,40 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 获取请求baseURL */
|
||||
export function getBaseUrlByProject(project) {
|
||||
return request({
|
||||
url: `/api/projectServer/project/${project}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 分页查询项目服务器 */
|
||||
export function projectServerPaging(params) {
|
||||
return request({
|
||||
url: `/api/projectServer/paging`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 创建项目服务器数据 */
|
||||
export function createProjectServer(data) {
|
||||
return request({
|
||||
url: `/api/projectServer`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 修改项目服务器数据 */
|
||||
export function updateProjectServer(id, data) {
|
||||
return request({
|
||||
url: `/api/projectServer/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 删除项目服务器数据 */
|
||||
export function deleteProjectServer(id) {
|
||||
return request({
|
||||
url: `/api/projectServer/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
@ -234,7 +234,7 @@ export function handleIbpPress(group, stationCode, buttonCode) {
|
||||
return request({
|
||||
url: `/simulation/${group}/ibp/press/${stationCode}/${buttonCode}`,
|
||||
method: 'put'
|
||||
})
|
||||
});
|
||||
}
|
||||
/** 处理ibp盘事件(松开) */
|
||||
|
||||
@ -242,7 +242,7 @@ export function handleIbpRelease(group, stationCode, buttonCode) {
|
||||
return request({
|
||||
url: `/simulation/${group}/ibp/release/${stationCode}/${buttonCode}`,
|
||||
method: 'put'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/** 预览脚本仿真(新版)*/
|
||||
@ -497,3 +497,19 @@ export function getStandListByRunLineOrTrainCode(group, params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 上饶列车控制 */
|
||||
export function srTrainControl(group, params) {
|
||||
return request({
|
||||
url: `/api/sr/${group}/control`,
|
||||
method: 'put',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 条件查询仿真中的ISCS资源 */
|
||||
export function queryIscsResourcesByGroup(group, params) {
|
||||
return request({
|
||||
url: `simulation/${group}/iscs/systemResources`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ export const meansUrl = `/api/upload/MEANS?appId=${productIdentify}`;
|
||||
// export const regulationUrl = `/api/upload/regulation?appId=${productIdentify}`;
|
||||
|
||||
export function getUrl(relatedUrl) {
|
||||
return `${process.env.VUE_APP_UPLOAD_API}${relatedUrl}`;
|
||||
return `${this.$store.state.user.uploadUrl}${relatedUrl}`;
|
||||
}
|
||||
|
||||
export function uploadFile(url, data) {
|
||||
|
BIN
src/assets/appLoading.png
Normal file
BIN
src/assets/appLoading.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
BIN
src/assets/icon/favicon_say.png
Normal file
BIN
src/assets/icon/favicon_say.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 163 KiB |
BIN
src/assets/left_train.png
Normal file
BIN
src/assets/left_train.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
BIN
src/assets/right_train.png
Normal file
BIN
src/assets/right_train.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
Binary file not shown.
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 67 KiB |
@ -75,9 +75,9 @@ export default {
|
||||
loading: true,
|
||||
name: 'file',
|
||||
size: 3,
|
||||
action: `${process.env.VUE_APP_UPLOAD_API}/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
|
||||
action: `${this.$store.state.user.uploadUrl}/api/upload/PICTURE?appId=00001&appSecret=joylink00001`,
|
||||
response: (res) => {
|
||||
return `${process.env.VUE_APP_VOICE_API}${res.data}`;
|
||||
return `${this.$store.state.user.resourcesUrl}${res.data}`;
|
||||
},
|
||||
error: () => { that.$message.error('图片上传失败,请检查网络状态'); },
|
||||
sizeError: () => { that.$message.error('图片上传失败,图片大小限制3MB'); } // 图片超过大小的回调
|
||||
|
@ -198,7 +198,7 @@ export default {
|
||||
taiwan: 'taiwan',
|
||||
america: 'America',
|
||||
companyInfo:'Beijing Jiulian Technology Co., Ltd',
|
||||
companyTel:'Tel: +86 13289398171',
|
||||
companyTel:'Tel: +86 13910989830',
|
||||
companyICP:'Copyright ©2018 Beijing Jiulian Technology Co., Ltd ICP: 18028522',
|
||||
enterPermissionNum:'please input number',
|
||||
enterPermissionNumInt:'number must interger',
|
||||
|
@ -74,7 +74,9 @@ export default {
|
||||
courseDescription: 'Course description',
|
||||
editCourse: 'Edit course',
|
||||
createCourse: 'Create course',
|
||||
courseRelease: 'Course release',
|
||||
courseRelease: 'Course offonline',
|
||||
courseOnline: 'Course online',
|
||||
courseOffline: 'Course offonline',
|
||||
releaseAssociatedCity: 'Release associated city:',
|
||||
releaseAssociatedMap: 'Release associated map:',
|
||||
trainingSequence: 'Training sequence',
|
||||
|
@ -99,5 +99,9 @@ export default {
|
||||
publishISCSManage:'publish ISCS Manage',
|
||||
voiceTraining: 'Voice Training',
|
||||
mapGroup: 'Map Group',
|
||||
drawingMange:'Drawing Mange'
|
||||
drawingMange:'Drawing Mange',
|
||||
projectServer: 'Project Server',
|
||||
audioResourcesManage: 'Audio Resources Manage',
|
||||
iscsDeviceManage: 'ISCS Device Manage',
|
||||
iscsResourcesManage: 'ISCS Resources Manage'
|
||||
};
|
||||
|
@ -123,6 +123,8 @@ export default {
|
||||
|
||||
coursePublishSuccessful: 'Successful course release',
|
||||
coursePublishFailed: 'Course launch failed',
|
||||
offlineSuccessful: 'Successful offline',
|
||||
offlineFailed: 'Course offline',
|
||||
startOperationHint: 'This operation will start the task. Do you want to continue?',
|
||||
cancelsTaskHint: 'This action cancels the task. Do you want to continue?',
|
||||
automaticGenerationTrainingSuccess: 'Automatic generation of training success',
|
||||
|
@ -198,8 +198,8 @@ export default {
|
||||
taiwan: '台湾',
|
||||
america: '美国',
|
||||
companyInfo:'北京玖琏科技有限公司',
|
||||
companyTel:'联系电话: 13289398171',
|
||||
companyICP:'Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号',
|
||||
companyTel:'联系电话: 13910989830',
|
||||
companyICP:'Copyright ©2018 北京玖琏科技有限公司 京ICP备2021039716号',
|
||||
enterPermissionNum:'请输入权限数量',
|
||||
enterPermissionNumInt:'权限数量需为整数',
|
||||
perpetual: '永久',
|
||||
|
@ -74,6 +74,8 @@ export default {
|
||||
editCourse: '编辑课程',
|
||||
createCourse: '创建课程',
|
||||
courseRelease: '课程发布',
|
||||
courseOnline: '课程上架',
|
||||
courseOffline: '课程下架',
|
||||
releaseAssociatedCity: '发布关联城市:',
|
||||
releaseAssociatedMap: '发布关联地图:',
|
||||
trainingSequence: '实训排序',
|
||||
@ -124,4 +126,3 @@ export default {
|
||||
copy: '复制',
|
||||
prdType:'产品类型'
|
||||
};
|
||||
|
||||
|
@ -103,5 +103,9 @@ export default {
|
||||
publishISCSManage:'发布ISCS管理',
|
||||
voiceTraining: '语音训练',
|
||||
mapGroup: '地图分组',
|
||||
drawingMange:'图纸管理'
|
||||
drawingMange:'图纸管理',
|
||||
projectServer: '项目域名',
|
||||
audioResourcesManage: '音频资源管理',
|
||||
iscsDeviceManage: 'ISCS设备管理',
|
||||
iscsResourcesManage: 'ISCS资源管理'
|
||||
};
|
||||
|
@ -123,6 +123,8 @@ export default {
|
||||
trainModelNameRepeat: '列车模型数据重复',
|
||||
coursePublishSuccessful: '课程发布成功',
|
||||
coursePublishFailed: '课程发布失败',
|
||||
offlineSuccessful: '课程下架成功',
|
||||
offlineFailed: '课程下架失败',
|
||||
startOperationHint: '此操作将开始任务, 是否继续?',
|
||||
cancelsTaskHint: '此操作将取消任务, 是否继续?',
|
||||
automaticGenerationTrainingSuccess: '自动生成实训成功',
|
||||
|
@ -1,7 +1,10 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export function SetCamera(dom) {
|
||||
var camera = new THREE.PerspectiveCamera(60, dom.clientWidth/dom.clientHeight, 1, 2000);
|
||||
var camera = new THREE.PerspectiveCamera(60, dom.clientWidth/dom.clientHeight, 1, 3000);
|
||||
camera.position.set( 0, 0, 0 );
|
||||
camera.aspect = window.innerWidth / window.innerHeight;
|
||||
camera.updateProjectionMatrix();
|
||||
|
||||
return camera;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ export function SetScene(project) {
|
||||
bgTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/other.jpg");
|
||||
}
|
||||
scene.background = bgTexture;
|
||||
|
||||
// cubeTexture.dispos e();
|
||||
return scene;
|
||||
}
|
||||
|
155
src/jlmap3d/config/WeatherManager.js
Normal file
155
src/jlmap3d/config/WeatherManager.js
Normal file
@ -0,0 +1,155 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export function WeatherManager(scene){
|
||||
let scope = this;
|
||||
let spriteSwitch = false;
|
||||
let spriteSpeed = 0;
|
||||
let spriteRota = 0;
|
||||
|
||||
let zsTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/zs.jpg" );
|
||||
let zwTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/zw.jpg" );
|
||||
let bwTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/bw.jpg" );
|
||||
let ywTexture = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/background/yw.jpg" );
|
||||
|
||||
let rainPoint = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/sprite/rainsprite.png" );
|
||||
let snowPoint = new THREE.TextureLoader().load(JL3D_LOCAL_STATIC+"/sprite/snowsprite.png" );
|
||||
|
||||
let geometry = new THREE.SphereGeometry( 3000, 32, 32 );
|
||||
let material = new THREE.MeshBasicMaterial( {map:zsTexture,side:THREE.DoubleSide} );
|
||||
scope.skybox = new THREE.Mesh( geometry, material);
|
||||
scope.skybox.position.set( 0, 0, 0 );
|
||||
|
||||
let spritMaterial = new THREE.PointsMaterial({ //用图片初始化顶点材质
|
||||
size: 2,
|
||||
map: snowPoint,
|
||||
transparent: true
|
||||
});
|
||||
|
||||
let positions = [];
|
||||
|
||||
this.drops = 20000;
|
||||
this.geom = new THREE.BufferGeometry();
|
||||
this.velocityY = [];
|
||||
|
||||
for(let i = 0; i < this.drops; i++){
|
||||
positions.push( Math.random() * 800 - 400 );
|
||||
positions.push( Math.random() * 800 );
|
||||
positions.push( Math.random() * 800 - 400 );
|
||||
this.velocityY.push(0.5 + Math.random() / 2); //初始化每个粒子的坐标和粒子在Y方向的速度
|
||||
}
|
||||
|
||||
//确定各个顶点的位置坐标
|
||||
this.geom.setAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );
|
||||
this.instance = new THREE.Points(this.geom, spritMaterial); //初始化粒子系统
|
||||
|
||||
|
||||
|
||||
this.changeweather = function(type){
|
||||
scene.fog = null;
|
||||
switch (type) {
|
||||
case 'zaoshang':
|
||||
scope.skybox.material.map = zsTexture;
|
||||
break;
|
||||
case 'zhongwu':
|
||||
scope.skybox.material.map = zwTexture;
|
||||
break;
|
||||
case 'bangwan':
|
||||
scope.skybox.material.map = bwTexture;
|
||||
break;
|
||||
case 'yewan':
|
||||
scope.skybox.material.map = ywTexture;
|
||||
break;
|
||||
|
||||
|
||||
case 'sunny':
|
||||
spriteSwitch = false;
|
||||
break;
|
||||
case 'yt':
|
||||
spriteSwitch = false;
|
||||
scene.fog = new THREE.Fog(0xE0E0E0, 1000, 3500);
|
||||
break;
|
||||
case 'rain':
|
||||
scope.instance.material.map = rainPoint;
|
||||
spriteSwitch = true;
|
||||
spriteSpeed = 0.01;
|
||||
spriteRota = 0;
|
||||
scope.instance.material.size = 0.5;
|
||||
scene.fog = new THREE.Fog(0xE0E0E0, 1000, 3500);
|
||||
break;
|
||||
case 'snow':
|
||||
scope.instance.material.map = snowPoint;
|
||||
spriteSwitch = true;
|
||||
spriteSpeed = 0.0001;
|
||||
spriteRota = 0.002;
|
||||
scope.instance.material.size = 1.5;
|
||||
scene.fog = new THREE.Fog(0xE0E0E0, 1000, 3500);
|
||||
break;
|
||||
case 'dy':
|
||||
spriteSwitch = false;
|
||||
scene.fog = new THREE.Fog(0xE0E0E0, 500, 3000);
|
||||
break;
|
||||
case 'sand':
|
||||
scene.fog = new THREE.Fog(0x977C00, 1, 1000);
|
||||
break;
|
||||
case 'wm':
|
||||
spriteSwitch = false;
|
||||
scene.fog = new THREE.Fog(0x9D9D9D, 1, 1000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// if(type == "sunny"){
|
||||
// scope.skybox.material.map = sunnyTexture;
|
||||
// spriteSwitch = false;
|
||||
// }
|
||||
// if(type == "evening"){
|
||||
// scope.skybox.material.map = eveningTexture;
|
||||
// spriteSwitch = false;
|
||||
// }
|
||||
// if(type == "rain"){
|
||||
// scope.skybox.material.map = rainTexture;
|
||||
|
||||
// }
|
||||
// if(type == "snow"){
|
||||
// scope.skybox.material.map = rainTexture;
|
||||
|
||||
// }
|
||||
|
||||
if(spriteSwitch == true){
|
||||
if(scope.skybox.children.length == 0){
|
||||
scope.skybox.add(scope.instance);
|
||||
}
|
||||
}else{
|
||||
scope.skybox.remove(scope.instance);
|
||||
}
|
||||
|
||||
scope.skybox.material.map.needsUpdate = true;
|
||||
scope.instance.material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
this.update = function(cameraPos){
|
||||
|
||||
scope.skybox.position.x = cameraPos.x;
|
||||
scope.skybox.position.z = cameraPos.z;
|
||||
|
||||
if(spriteSwitch == true){
|
||||
let positions = this.geom.attributes.position.array;
|
||||
|
||||
for(let i=0; i<this.drops * 3; i+=3){ //改变Y坐标,加速运动
|
||||
this.velocityY[i/3] += Math.random() * spriteSpeed;
|
||||
positions[ i + 1 ] -= this.velocityY[i/3];
|
||||
if(positions[ i + 1 ] < 30){
|
||||
positions[ i + 1 ] = 800;
|
||||
this.velocityY[i/3] = 0.5 + Math.random()* spriteSpeed;
|
||||
}
|
||||
}
|
||||
this.instance.rotation.y += spriteRota;
|
||||
this.geom.attributes.position.needsUpdate = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -342,6 +342,10 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
|
||||
scope.raycasterstatus = false;
|
||||
scope.nowobject = null;
|
||||
updatemenulist();
|
||||
if(data._type == "Station"){
|
||||
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
if (data._type == "Switch") {
|
||||
// scope.modelmanager.switchmodel.locateType = data.body.locateType;
|
||||
|
@ -165,7 +165,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
|
||||
// datanew();
|
||||
|
||||
DriverLoadNew(mapnetdata,scope,netdata.data,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls3,scene,mixers);
|
||||
DriverLoadNew(mapnetdata,scope,netdata.data,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls3,scene,mixers,project);
|
||||
var timer = setInterval(function() {
|
||||
if(trainlisttest){
|
||||
if(trainlisttest.group){
|
||||
@ -386,7 +386,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
realsectionlist = loadrealsectionlist;
|
||||
rails = loadrails;
|
||||
|
||||
// console.log(trainlisttest.group.children[0]);
|
||||
console.log(trainlisttest);
|
||||
trainlisttest.group.children[0].getObjectByName("C6").add(cameracctv);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import store from '@/store/index';
|
||||
import { getToken } from '@/utils/auth';
|
||||
|
||||
// 定于仿真socket接口
|
||||
@ -43,7 +42,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
let header = {'X-Token': getToken() };
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
baseurl:store.state.user.baseUrl,
|
||||
topic:this.topic,
|
||||
token:getToken(),
|
||||
};
|
||||
@ -364,7 +363,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
// if(data.code = "336"){
|
||||
// console.log(data);
|
||||
// }
|
||||
|
||||
if(rails.sectionrail[data.section]){
|
||||
if(data.section != updateTrainModel.nowsection){
|
||||
updateTrainModel.nowsection = data.section;
|
||||
updateTrainModel.curve = rails.sectionrail[data.section].lineleft;
|
||||
@ -522,6 +521,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
updateTrainModel.position.x = -100000;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -537,7 +540,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
trainmodel.code = data.code;
|
||||
trainmodel.nowcode = data.code;
|
||||
}
|
||||
|
||||
if(rails.sectionrail[data.section]){
|
||||
//改变当前列车行驶的区段code
|
||||
if(data.section != trainmodel.nowsection){
|
||||
trainmodel.nowsection = data.section;
|
||||
@ -797,10 +800,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// let pos = ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1006,7 +1006,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
}
|
||||
function signalupdate(data) {
|
||||
code = data.code;
|
||||
|
||||
if(signallist.list[code]){
|
||||
if(data.command == 'No'){
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
@ -1072,8 +1072,11 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function initswitch(data) {
|
||||
code = data.code;
|
||||
if(actions[code]){
|
||||
if (data.command == 'NP') {
|
||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||
actions[code].action.reset();
|
||||
@ -1090,10 +1093,11 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
|
||||
actions[code].command = data.command;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function switchupdate(data) {
|
||||
code = data.code;
|
||||
if (actions[code].command != data.command) {
|
||||
if (actions[code].command != data.command && actions[code]) {
|
||||
if (data.command == 'NP') {
|
||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||
actions[code].action.reset();
|
||||
|
@ -20,9 +20,9 @@ import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
||||
import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
import store from '@/store/index';
|
||||
|
||||
var clock = new THREE.Clock();
|
||||
|
||||
@ -176,7 +176,7 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
|
||||
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
baseurl:store.state.user.baseUrl,
|
||||
topic:'/user/queue/simulation/jl3d/'+group,
|
||||
token:getToken(),
|
||||
};
|
||||
|
@ -15,7 +15,7 @@ import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
||||
import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import store from '@/store/index';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
|
||||
@ -174,7 +174,7 @@ export function Jl3dOtherVR(dom,group,skinCode) {
|
||||
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
baseurl:store.state.user.baseUrl,
|
||||
topic:'/user/queue/simulation/jl3d/'+group,
|
||||
token:getToken(),
|
||||
};
|
||||
|
@ -10,9 +10,9 @@ import { ModelManagerVR } from '@/jlmap3d/jl3dmaintainer/jl3dTrainRescue/trainre
|
||||
import { VRButton } from '@/jlmap3d/jl3dmaintainer/jl3dFaultDeviceVr/utils/VRButton.js';
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
import store from '@/store/index';
|
||||
|
||||
var clock = new THREE.Clock();
|
||||
|
||||
@ -170,7 +170,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
|
||||
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
baseurl:store.state.user.baseUrl,
|
||||
topic:'/user/queue/simulation/jl3d/'+group,
|
||||
token:getToken(),
|
||||
};
|
||||
|
@ -2,8 +2,8 @@ import StompClient from '@/utils/sock';
|
||||
|
||||
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
|
||||
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
// 定于仿真socket接口
|
||||
export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
@ -45,7 +45,7 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
let header = {'X-Token': getToken() };
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
baseurl:store.state.user.baseUrl,
|
||||
topic:this.topic,
|
||||
token:getToken(),
|
||||
};
|
||||
@ -325,6 +325,7 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
function trainrunnew(data){
|
||||
let code = data.code;
|
||||
|
||||
if(rails.sectionrail[data.section]){
|
||||
if(trainlisttest.list[code].right != data.right){
|
||||
|
||||
if(data.right == "0"){
|
||||
@ -514,6 +515,10 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
trainlisttest.list[code].position.x = -100000;
|
||||
}
|
||||
|
||||
}
|
||||
function trainrun(data){
|
||||
let code = data.code;
|
||||
@ -871,6 +876,7 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
|
||||
function signalupdate(data) {
|
||||
code = data.code;
|
||||
if(signallist.list[code]){
|
||||
if(data.command == 'No'){
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
@ -933,11 +939,12 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function initswitch(data) {
|
||||
code = data.code;
|
||||
if(actions[code]){
|
||||
if (data.command == 'NP') {
|
||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||
actions[code].action.reset();
|
||||
@ -953,12 +960,14 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
actions[code].action.play();
|
||||
actions[code].command = data.command;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function switchupdate(data) {
|
||||
code = data.code;
|
||||
|
||||
if(actions[code]){
|
||||
if (actions[code].command != data.command) {
|
||||
if (data.command == 'NP') {
|
||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||
@ -977,6 +986,8 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function simulationreset(data){
|
||||
for(let i=0;i<trainlisttest.group.children.length;i++){
|
||||
trainlisttest.group.children[i].dispose = true;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
@ -68,7 +68,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
// 定义场景(渲染容器)
|
||||
let scene = SetScene(project);
|
||||
scene.background = new THREE.CubeTextureLoader()
|
||||
.setPath( 'https://oss.joylink.club/oss/joylink/PICTURE/2021-06-15/' )
|
||||
.setPath( 'https://joylink.club/oss/joylink/PICTURE/2021-06-15/' )
|
||||
.load( [ '18-75117.jpg', '17-78286.jpg', '19-62689.jpg', '15-95146.jpg', '16-99183.jpg', '14-94914.jpg' ] );
|
||||
|
||||
let meshCloud;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { AssetModel } from '@/jlmap3d/main/loaders/model/Assetmodel';
|
||||
import { Assetmaterial } from '@/jlmap3d/main/loaders/model/Assetmaterial';
|
||||
import { getBaseUrl } from '@/utils/baseUrl';
|
||||
import store from '@/store/index';
|
||||
import { Loading } from 'element-ui';
|
||||
const BASE_API = getBaseUrl();
|
||||
const BASE_API = store.state.user.baseUrl;
|
||||
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
let signal5 = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import store from '@/store/index';
|
||||
import { getToken } from '@/utils/auth';
|
||||
|
||||
// 定于仿真socket接口
|
||||
@ -45,7 +45,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
let header = {'X-Token': getToken() };
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
baseurl:store.state.user.baseUrl,
|
||||
topic:this.topic,
|
||||
token:getToken(),
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ import StompClient from '@/utils/sock';
|
||||
|
||||
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
|
||||
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import store from '@/store/index';
|
||||
import { getToken } from '@/utils/auth';
|
||||
|
||||
// 定于仿真socket接口
|
||||
@ -46,7 +46,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
let header = {'X-Token': getToken() };
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
baseurl:store.state.user.baseUrl,
|
||||
topic:this.topic,
|
||||
token:getToken(),
|
||||
};
|
||||
@ -165,6 +165,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
|
||||
function trainRunNew(data){
|
||||
let code = data.code;
|
||||
if(rails.sectionrail[data.section]){
|
||||
if(trainlisttest.list[code].right != data.right){
|
||||
if(data.right == "0"){
|
||||
|
||||
@ -433,6 +434,10 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
trainlisttest.list[code].position.x = -1000000;
|
||||
}
|
||||
|
||||
}
|
||||
function trainrun(data){
|
||||
let code = data.code;
|
||||
@ -868,6 +873,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
|
||||
function initswitch(data) {
|
||||
code = data.code;
|
||||
if(actions[code]){
|
||||
if (data.command == 'NP') {
|
||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||
actions[code].action.reset();
|
||||
@ -884,9 +890,11 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
actions[code].command = data.command;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function switchupdate(data) {
|
||||
code = data.code;
|
||||
if(actions[code]){
|
||||
if (actions[code].command != data.command) {
|
||||
if (data.command == 'NP') {
|
||||
// sectionlist.switchs.modellist[j].normal = data.normal;
|
||||
@ -905,6 +913,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function simulationreset(data){
|
||||
for(let i=0;i<trainlisttest.group.children.length;i++){
|
||||
trainlisttest.group.children[i].dispose = true;
|
||||
|
@ -14,7 +14,10 @@ import { SetRender } from '@/jlmap3d/config/SetRender';
|
||||
import { SetScene } from '@/jlmap3d/config/SetScene';
|
||||
import { SetLights } from '@/jlmap3d/config/SetLights';
|
||||
|
||||
//controls
|
||||
import { WeatherManager } from '@/jlmap3d/config/WeatherManager';
|
||||
|
||||
//controlManager.oribitControl
|
||||
import { ControlManager } from '@/jlmap3d/jl3dsimulation/manager/controlmanager.js';
|
||||
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
||||
// import { DragControls } from '@/jlmap3d/main/control/DragControls';
|
||||
|
||||
@ -36,31 +39,21 @@ import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
|
||||
var clock = new THREE.Clock();
|
||||
|
||||
export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.dom = dom;
|
||||
//初始化webgl渲染
|
||||
let renderer = SetRender(dom);
|
||||
renderer.domElement.style.position = "absolute";
|
||||
renderer.domElement.style.top = "0";
|
||||
document.getElementById('testjlmap3d').appendChild(renderer.domElement);
|
||||
|
||||
//定义相机
|
||||
let camera = SetCamera(dom);
|
||||
|
||||
//定义场景(渲染容器)
|
||||
let scene = SetScene(project);
|
||||
let scenesimulation = new THREE.Group();
|
||||
let scenestation = new THREE.Group();
|
||||
scene.add(scenesimulation);
|
||||
scene.add(scenestation);
|
||||
//定义镜头操作
|
||||
let controls = new THREE.OrbitControls(camera);
|
||||
controls.maxPolarAngle = Math.PI/2;
|
||||
// controls.screenSpacePanning = true;
|
||||
//controls.minPolarAngle = Math.PI/8;
|
||||
controls.maxDistance = 1000;
|
||||
|
||||
let controlManager = new ControlManager( dom,scene);
|
||||
|
||||
let weatherManager = new WeatherManager(scene);
|
||||
scene.add(weatherManager.skybox);
|
||||
// scene.add(weatherManager.instance);
|
||||
|
||||
//模型加载器
|
||||
this.assetloader = new AssetLoader();
|
||||
//替换材质组,例:信号机不同灯光
|
||||
@ -73,8 +66,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
this.selectmodel = null;
|
||||
//鼠标点击模型切换
|
||||
this.raycasterswitch = "null";
|
||||
//选中物体描边方框
|
||||
this.helpbox = null;
|
||||
//车门,站台门道岔动画构造器
|
||||
this.mixers = [];
|
||||
//模型操作命令组
|
||||
@ -88,6 +79,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
let trainlisttest = null;
|
||||
let realsectionlist = null;
|
||||
let rails = null;
|
||||
let backgroundModel = null;
|
||||
|
||||
//轨道相机
|
||||
let camerarail = {
|
||||
@ -110,7 +102,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
scope.jsonwebworknew = new Worker(JL3D_LOCAL_STATIC+"/workertest/jsonworkernew.js");
|
||||
scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew);
|
||||
scope.Subscribe.socketon(scope.Subscribe.topic);
|
||||
SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);
|
||||
SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,controlManager.orbitCamera,controlManager.oribitControl,scenesimulation,project);
|
||||
});
|
||||
});
|
||||
|
||||
@ -124,7 +116,19 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
//循环渲染
|
||||
requestAnimationFrame(animate);
|
||||
//根据相机渲染场景
|
||||
renderer.render(scene,camera);
|
||||
|
||||
if(controlManager.controlMode == "free"){
|
||||
controlManager.updateOrbitControl();
|
||||
}
|
||||
if(controlManager.controlMode == "fps"){
|
||||
controlManager.updateFpsControl();
|
||||
}
|
||||
if(controlManager.controlMode == "train"){
|
||||
controlManager.updateTrainControl();
|
||||
}
|
||||
|
||||
weatherManager.update(controlManager.orbitCamera.position);
|
||||
// console.log(controlManager.orbitCamera.position);
|
||||
// stats.update();
|
||||
}
|
||||
|
||||
@ -137,7 +141,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
if(scope.datatype == "new"){
|
||||
|
||||
}else{
|
||||
UpdateTrain(camera,trainlisttest);
|
||||
UpdateTrain(controlManager.orbitCamera,trainlisttest);
|
||||
}
|
||||
|
||||
delta = clock.getDelta();
|
||||
@ -157,13 +161,13 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
}else{
|
||||
let point = camerarail.curve.getPointAt(camerarail.progress);
|
||||
let tangent = camerarail.curve.getPointAt(camerarail.progress+0.001);
|
||||
camera.position.x = point.x;
|
||||
camera.position.y = point.y;
|
||||
camera.position.z = point.z;
|
||||
controlManager.orbitCamera.position.x = point.x;
|
||||
controlManager.orbitCamera.position.y = point.y;
|
||||
controlManager.orbitCamera.position.z = point.z;
|
||||
camerarail.progress += 0.003;
|
||||
// controls.target = new THREE.Vector3(point.x+1,point.y,point.z);
|
||||
controls.target = new THREE.Vector3(tangent.x,tangent.y,tangent.z);
|
||||
controls.update();
|
||||
// controlManager.oribitControl.target = new THREE.Vector3(point.x+1,point.y,point.z);
|
||||
controlManager.oribitControl.target = new THREE.Vector3(tangent.x,tangent.y,tangent.z);
|
||||
controlManager.oribitControl.update();
|
||||
point = null;
|
||||
}
|
||||
|
||||
@ -176,11 +180,9 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
|
||||
//释放场景缓存关闭渲染循环
|
||||
this.dispose = function(){
|
||||
renderer.setAnimationLoop(null);
|
||||
renderer.dispose();
|
||||
scene.dispose();
|
||||
controls.dispose();
|
||||
camera = null;
|
||||
controlManager.oribitControl.dispose();
|
||||
controlManager.orbitCamera = null;
|
||||
scope.assetloader = null;
|
||||
|
||||
mapdata = null;
|
||||
@ -188,7 +190,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
|
||||
scope.materiallist = null;
|
||||
scope.selectmodel = null;
|
||||
scope.helpbox = null;
|
||||
scope.mixers = null;
|
||||
scope.actions = null;
|
||||
scope.Subscribe = null;
|
||||
@ -196,13 +197,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
//scope = null;
|
||||
}
|
||||
|
||||
this.rayswitch = function(value){
|
||||
this.raycasterswitch = value;
|
||||
if(scope.helpbox){
|
||||
scene.remove( scope.helpbox );
|
||||
scope.helpbox = null;
|
||||
}
|
||||
};
|
||||
|
||||
//切换显示车站信息
|
||||
this.showstationmsg = function(showtype){
|
||||
@ -219,7 +213,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
|
||||
//切换显示列车信息
|
||||
this.showtrainmsg = function(showtype){
|
||||
console.log(trainlisttest);
|
||||
if(showtype == "show"){
|
||||
for(let st=0;st<trainlisttest.textlist.length;st++){
|
||||
trainlisttest.list[trainlisttest.textlist[st].name].children[0].add(trainlisttest.textlist[st]);
|
||||
@ -230,18 +223,21 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.changeweather = function(weathertype){
|
||||
// console.log(weathertype);
|
||||
weatherManager.changeweather(weathertype);
|
||||
}
|
||||
//开启轨道镜头交互
|
||||
this.animateon = function(){
|
||||
controls.enabled = true;
|
||||
controlManager.oribitControl.enabled = true;
|
||||
};
|
||||
//关闭轨道镜头交互
|
||||
this.animateoff = function(){
|
||||
controls.enabled = false;
|
||||
controlManager.oribitControl.enabled = false;
|
||||
};
|
||||
|
||||
//更新加载后数据
|
||||
this.loaderdata = function(loadsectionlist,loadlinklist,loadsignallist,loadstationstandlist,loadtrainlisttest,loadrealsectionlist,loadrails){
|
||||
this.loaderdata = function(loadsectionlist,loadlinklist,loadsignallist,loadstationstandlist,loadtrainlisttest,loadrealsectionlist,loadrails,bgmodel){
|
||||
|
||||
sectionlist = loadsectionlist;
|
||||
linklist = loadlinklist;
|
||||
@ -251,58 +247,57 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
trainlisttest = loadtrainlisttest;
|
||||
realsectionlist = loadrealsectionlist;
|
||||
rails = loadrails;
|
||||
backgroundModel = bgmodel;
|
||||
}
|
||||
|
||||
this.eventon = function(){
|
||||
//raycaster交互模型点击事件
|
||||
document.getElementById("testjlmap3d").addEventListener( "mousedown", onselect, false );
|
||||
//窗口自适应
|
||||
window.addEventListener( 'resize', onWindowResize, false );
|
||||
|
||||
controls.update();
|
||||
};
|
||||
|
||||
this.eventoff = function(){
|
||||
//console.log("off");
|
||||
//raycaster交互模型点击事件
|
||||
document.getElementById("testjlmap3d").removeEventListener( "mousedown", onselect, false );
|
||||
//窗口自适应
|
||||
window.removeEventListener( 'resize', onWindowResize, false );
|
||||
};
|
||||
|
||||
this.enterStopStation = function(){
|
||||
jl3dSimulationGlobeFunction('changeview','fps');
|
||||
controlManager.attachFpsCamera(backgroundModel,{x:-2212,y:10.7,z:-15.7});
|
||||
}
|
||||
//根据菜单选项切换相机位置
|
||||
this.updatecamera = function(mesh,type){
|
||||
if(type == "station"){
|
||||
camera.position.x = mesh.position.x;
|
||||
camera.position.y = mesh.position.y+800;
|
||||
camera.position.z = mesh.position.z+300;
|
||||
controlManager.orbitCamera.position.x = mesh.position.x;
|
||||
controlManager.orbitCamera.position.y = mesh.position.y+800;
|
||||
controlManager.orbitCamera.position.z = mesh.position.z+300;
|
||||
//更新相机方向
|
||||
controls.target = new THREE.Vector3(mesh.position.x,mesh.position.y,mesh.position.z);
|
||||
}
|
||||
if(type == "train"){
|
||||
camera.position.x = mesh.position.x;
|
||||
camera.position.y = mesh.position.y+800;
|
||||
camera.position.z = mesh.children[2].matrixWorld.elements[14]+300;
|
||||
//更新相机方向
|
||||
controls.target = new THREE.Vector3(mesh.position.x,mesh.position.y,mesh.children[2].matrixWorld.elements[14]);
|
||||
}
|
||||
|
||||
controlManager.oribitControl.target = new THREE.Vector3(mesh.position.x,mesh.position.y,mesh.position.z);
|
||||
if(stationstandlist && trainlisttest){
|
||||
controls.upmodeldirect(stationstandlist,trainlisttest);
|
||||
controlManager.oribitControl.upmodeldirect(stationstandlist,trainlisttest);
|
||||
}
|
||||
controls.update();
|
||||
controlManager.oribitControl.update();
|
||||
|
||||
}
|
||||
|
||||
//窗口自适应
|
||||
function onWindowResize() {
|
||||
camera.aspect = window.innerWidth / window.innerHeight;
|
||||
camera.updateProjectionMatrix();
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
if(type == "train"){
|
||||
controlManager.attachTrainCamera(mesh);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.backFpsView = function(){
|
||||
controlManager.deattachFpsCamera();
|
||||
if(stationstandlist && trainlisttest){
|
||||
controlManager.oribitControl.upmodeldirect(stationstandlist,trainlisttest);
|
||||
}
|
||||
controlManager.oribitControl.update();
|
||||
}
|
||||
|
||||
this.backTrainView = function(){
|
||||
controlManager.deattachTrainCamera();
|
||||
if(stationstandlist && trainlisttest){
|
||||
controlManager.oribitControl.upmodeldirect(stationstandlist,trainlisttest);
|
||||
}
|
||||
controlManager.oribitControl.update();
|
||||
}
|
||||
|
||||
//三维交互点击事件函数
|
||||
function onselect(event) {
|
||||
if(event.button == "0"){
|
||||
if(controlManager.controlMode != 'fps' && event.button == "0" && stationstandlist){
|
||||
//定义光线
|
||||
let raycaster = new THREE.Raycaster();
|
||||
//定义平面鼠标点击坐标
|
||||
@ -310,79 +305,16 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
|
||||
mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
|
||||
|
||||
raycaster.setFromCamera( mouse, camera );
|
||||
if(scope.helpbox){
|
||||
scene.remove( scope.helpbox );
|
||||
scope.helpbox = null;
|
||||
}
|
||||
|
||||
if(scope.raycasterswitch == "stand"){
|
||||
raycaster.setFromCamera( mouse, controlManager.orbitCamera );
|
||||
//从站台对象组获取点击目标
|
||||
let intersects1 = raycaster.intersectObjects( stationstandlist.textlist);
|
||||
let intersects1 = raycaster.intersectObjects( stationstandlist.group.children,true);
|
||||
|
||||
//获取最近处点击到的模型对象
|
||||
if(intersects1[0]){
|
||||
//遍历对象组获取对象坐标更新相机数据
|
||||
for(let j=0;j<stationstandlist.list.length;j++){
|
||||
if(intersects1[0].object.name == stationstandlist.list[j].mesh.code){
|
||||
camera.position.x = stationstandlist.list[j].mesh.position.x;
|
||||
camera.position.y = stationstandlist.list[j].mesh.position.y+200;
|
||||
camera.position.z = stationstandlist.list[j].mesh.position.z+300;
|
||||
//更新相机方向
|
||||
controls.target = new THREE.Vector3(stationstandlist.list[j].mesh.position.x,stationstandlist.list[j].mesh.position.y,stationstandlist.list[j].mesh.position.z);
|
||||
controls.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(scope.raycasterswitch == "train"){
|
||||
let intersects = raycaster.intersectObjects( trainlisttest.textlist);
|
||||
if(intersects[0]){
|
||||
for(let j=0;j<trainlisttest.list.length;j++){
|
||||
if(intersects[0].object.name == trainlisttest.list[j].name){
|
||||
// console.log(trainlisttest.list[j].position.x);
|
||||
// console.log(trainlisttest.list[j].position.y);
|
||||
// console.log(trainlisttest.list[j].children[2].matrixWorld.elements[14]);
|
||||
camera.position.x = trainlisttest.list[j].position.x;
|
||||
camera.position.y = 200;
|
||||
camera.position.z = trainlisttest.list[j].children[2].matrixWorld.elements[14]+300;
|
||||
//console.log(camera.position);
|
||||
controls.target = new THREE.Vector3(trainlisttest.list[j].children[2].matrixWorld.elements[12],trainlisttest.list[j].children[2].matrixWorld.elements[13],trainlisttest.list[j].children[2].matrixWorld.elements[14]);
|
||||
controls.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(scope.raycasterswitch == "section"){
|
||||
//console.log(sectionlist.sections.modellist);
|
||||
let intersects = raycaster.intersectObjects( linklist.linksgroup.children,true);
|
||||
if(intersects[0]){
|
||||
// console.log(intersects[0].object);
|
||||
scope.helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
|
||||
scene.add( scope.helpbox );
|
||||
}
|
||||
}
|
||||
|
||||
if(scope.raycasterswitch == "signal"){
|
||||
|
||||
let intersects = raycaster.intersectObjects( signallist.group.children,true);
|
||||
|
||||
if(intersects[0]){
|
||||
// console.log(intersects[0].object.matrixWorld);
|
||||
scope.helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
|
||||
scene.add( scope.helpbox );
|
||||
}
|
||||
}
|
||||
|
||||
if(scope.raycasterswitch == "switch"){
|
||||
console.log(sectionlist);
|
||||
let intersects = raycaster.intersectObjects( sectionlist.switchs.modellist,true);
|
||||
|
||||
if(intersects[0]){
|
||||
scope.helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
|
||||
|
||||
scene.add( scope.helpbox );
|
||||
if(!intersects1[0].object.modeltype){
|
||||
jl3dSimulationGlobeFunction('changeview','fps');
|
||||
controlManager.attachFpsCamera(intersects1[0].object.parent,intersects1[0].point);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -422,8 +354,8 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
|
||||
|
||||
// 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();
|
||||
// controlManager.oribitControl.target = new THREE.Vector3(controlManager.orbitCamera.position.x+1,controlManager.orbitCamera.position.y,controlManager.orbitCamera.position.z);
|
||||
// controlManager.oribitControl.update();
|
||||
camerarail.curve = new THREE.CatmullRomCurve3(points);
|
||||
|
||||
}
|
||||
|
428
src/jlmap3d/jl3dsimulation/manager/controlmanager.js
Normal file
428
src/jlmap3d/jl3dsimulation/manager/controlmanager.js
Normal file
@ -0,0 +1,428 @@
|
||||
|
||||
import { Capsule } from '@/jlmap3d/utils/math/Capsule.js';
|
||||
|
||||
import { Octree } from '@/jlmap3d/utils/math/Octree.js';
|
||||
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import { OBJLoader } from '@/jlmap3d/main/loaders/OBJLoader';
|
||||
|
||||
export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
|
||||
let scope = this;
|
||||
this.controlMode = "free";
|
||||
this.controls = {};
|
||||
this.nowCamera = null;
|
||||
this.eventHitMode = false;
|
||||
let modelManager;
|
||||
|
||||
let examList = {};
|
||||
let examData = {};
|
||||
|
||||
let eventBoxs = [];
|
||||
let raycasterBoxs = [];
|
||||
let actionList = [];
|
||||
let eventTrigger;
|
||||
let nowActions = [];
|
||||
let allOverAction;
|
||||
let trainDeviceMode = false;
|
||||
let fpsMouseStatus = false;
|
||||
|
||||
|
||||
var audiopbm = JL3D_LOCAL_STATIC+'/lesson3d/audio/pbm.wav';
|
||||
audiopbm = new Audio(audiopbm);
|
||||
|
||||
let renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
||||
// renderer.autoClear = false;
|
||||
renderer.sortObjects = true;
|
||||
renderer.domElement.style.position = "absolute";
|
||||
renderer.domElement.style.top = "0";
|
||||
document.getElementById('testjlmap3d').appendChild(renderer.domElement);
|
||||
|
||||
this.orbitCamera = new THREE.PerspectiveCamera(60, dom.clientWidth/dom.clientHeight, 1, 4000);
|
||||
this.orbitCamera.position.set(0, 0, 0);
|
||||
this.orbitCamera.aspect = window.innerWidth / window.innerHeight;
|
||||
this.orbitCamera.updateProjectionMatrix();
|
||||
|
||||
this.oribitControl = new THREE.OrbitControls(scope.orbitCamera,dom);
|
||||
this.oribitControl.maxPolarAngle = Math.PI / 2;
|
||||
this.oribitControl.maxDistance = 800;
|
||||
this.oribitControl.update();
|
||||
|
||||
let trainCamera = new THREE.PerspectiveCamera( 75,dom.offsetWidth / dom.offsetHeight, 0.1, 1000 );
|
||||
trainCamera.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
trainCamera.updateProjectionMatrix();
|
||||
|
||||
let fpsCamera = new THREE.PerspectiveCamera( 75,dom.offsetWidth / dom.offsetHeight, 0.1, 6000 );
|
||||
fpsCamera.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
fpsCamera.rotation.order = 'YXZ';
|
||||
|
||||
let attachBox = new THREE.Mesh(
|
||||
new THREE.BoxGeometry(1,1.5, 1),
|
||||
new THREE.MeshBasicMaterial({color: 0xff00000,transparent: true,opacity: 0 })//RED box
|
||||
);
|
||||
let hitBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3());
|
||||
hitBox.setFromObject(attachBox);
|
||||
scene.add(attachBox);
|
||||
|
||||
//fps control
|
||||
const GRAVITY = 30;
|
||||
|
||||
const NUM_SPHERES = 20;
|
||||
const SPHERE_RADIUS = 0.1;
|
||||
|
||||
const sphereGeometry = new THREE.SphereGeometry( SPHERE_RADIUS, 16, 16 );
|
||||
const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0x888855, roughness: 0.8, metalness: 0.5, } );
|
||||
|
||||
const spheres = [];
|
||||
let sphereIdx = 0;
|
||||
|
||||
for ( let i = 0; i < NUM_SPHERES; i ++ ) {
|
||||
|
||||
const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial );
|
||||
|
||||
|
||||
scene.add( sphere );
|
||||
|
||||
spheres.push( { mesh: sphere, collider: new THREE.Sphere( new THREE.Vector3( 0, - 100, 0 ), SPHERE_RADIUS ), velocity: new THREE.Vector3() } );
|
||||
|
||||
}
|
||||
|
||||
const worldOctree = new Octree();
|
||||
|
||||
const playerCollider = new Capsule( new THREE.Vector3( 0, 10, 0 ), new THREE.Vector3( 0, 11.5, 0 ), 1 );
|
||||
// playerCollider.set(
|
||||
// new THREE.Vector3(
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.x,
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.y,
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.z),
|
||||
// new THREE.Vector3(
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.x,
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.y+1.5,
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.z ), 1);
|
||||
// attachBox.position.x = lessonData.lessonProgress[lessonIndex].cameraPosition.x;
|
||||
// attachBox.position.y = lessonData.lessonProgress[lessonIndex].cameraPosition.y ;
|
||||
// attachBox.position.z = lessonData.lessonProgress[lessonIndex].cameraPosition.z;
|
||||
|
||||
|
||||
|
||||
|
||||
const playerVelocity = new THREE.Vector3();
|
||||
const playerDirection = new THREE.Vector3();
|
||||
|
||||
let playerOnFloor = false;
|
||||
|
||||
const keyStates = {};
|
||||
let clock = new THREE.Clock();
|
||||
|
||||
let nowStation = "";
|
||||
this.attachFpsCamera = function(mesh,point){
|
||||
nowStation = mesh;
|
||||
worldOctree.fromGraphNode( nowStation );
|
||||
scope.nowCamera = fpsCamera;
|
||||
scope.oribitControl.enabled = false;
|
||||
|
||||
attachBox.position.x = point.x;
|
||||
attachBox.position.y = point.y;
|
||||
attachBox.position.z = point.z;
|
||||
playerCollider.set(
|
||||
new THREE.Vector3(
|
||||
point.x,
|
||||
point.y,
|
||||
point.z),
|
||||
new THREE.Vector3(
|
||||
point.x,
|
||||
point.y+1.5,
|
||||
point.z ), 1);
|
||||
scope.orbitCamera.position.x = point.x;
|
||||
scope.orbitCamera.position.y = point.y+800;
|
||||
scope.orbitCamera.position.z = point.z+300;
|
||||
//更新相机方向
|
||||
scope.oribitControl.target = new THREE.Vector3(point.x,point.y,point.z);
|
||||
|
||||
scope.controlMode = "fps";
|
||||
}
|
||||
this.deattachFpsCamera = function(){
|
||||
scope.oribitControl.enabled = true;
|
||||
scope.controlMode = "free";
|
||||
scope.orbitCamera.position.x = nowStation.position.x;
|
||||
scope.orbitCamera.position.y = nowStation.position.y+800;
|
||||
scope.orbitCamera.position.z = nowStation.children[2].matrixWorld.elements[14]+300;
|
||||
//更新相机方向
|
||||
scope.oribitControl.target = new THREE.Vector3(nowStation.position.x,nowStation.position.y,nowStation.children[2].matrixWorld.elements[14]);
|
||||
scope.oribitControl.enabled = true;
|
||||
// playerCollider = new Capsule( new THREE.Vector3( 0, 10, 0 ), new THREE.Vector3( 0, 11.9, 0 ), 1 );
|
||||
}
|
||||
|
||||
let nowTrain = "";
|
||||
this.attachTrainCamera = function(mesh){
|
||||
scope.oribitControl.enabled = false;
|
||||
nowTrain = mesh;
|
||||
this.controlMode = "train";
|
||||
mesh.children[0].add(trainCamera);
|
||||
trainCamera.position.x = 10;
|
||||
trainCamera.position.y = 0;
|
||||
trainCamera.position.z = 4.5;
|
||||
trainCamera.rotation.x = Math.PI/2;
|
||||
trainCamera.rotation.y = -Math.PI/2;
|
||||
}
|
||||
|
||||
this.deattachTrainCamera = function(){
|
||||
|
||||
scope.oribitControl.enabled = true;
|
||||
scope.controlMode = "free";
|
||||
scope.orbitCamera.position.x = nowTrain.position.x;
|
||||
scope.orbitCamera.position.y = nowTrain.position.y+800;
|
||||
scope.orbitCamera.position.z = nowTrain.children[2].matrixWorld.elements[14]+300;
|
||||
//更新相机方向
|
||||
scope.oribitControl.target = new THREE.Vector3(nowTrain.position.x,nowTrain.position.y,nowTrain.children[2].matrixWorld.elements[14]);
|
||||
scope.oribitControl.enabled = true;
|
||||
}
|
||||
|
||||
this.updateOrbitControl = function(){
|
||||
scope.oribitControl.update();
|
||||
render(scope.orbitCamera);
|
||||
};
|
||||
|
||||
this.updateFpsControl = function(){
|
||||
const deltaTime = Math.min( 0.1, clock.getDelta() );
|
||||
|
||||
controls( deltaTime );
|
||||
|
||||
updatePlayer( deltaTime );
|
||||
|
||||
updateSpheres( deltaTime );
|
||||
render(fpsCamera);
|
||||
};
|
||||
|
||||
|
||||
this.updateTrainControl = function(){
|
||||
render(trainCamera);
|
||||
}
|
||||
|
||||
this.updatePos = function(pos){
|
||||
playerCollider.set(
|
||||
new THREE.Vector3(
|
||||
pos.x,
|
||||
pos.y,
|
||||
pos.z),
|
||||
new THREE.Vector3(
|
||||
pos.x,
|
||||
pos.y+1.5,
|
||||
pos.z ), 1);
|
||||
}
|
||||
|
||||
document.addEventListener( 'keydown', ( event ) => {
|
||||
|
||||
keyStates[ event.code ] = true;
|
||||
|
||||
} );
|
||||
|
||||
document.addEventListener( 'keyup', ( event ) => {
|
||||
|
||||
keyStates[ event.code ] = false;
|
||||
|
||||
} );
|
||||
|
||||
document.addEventListener( 'mousedown', (event) => {
|
||||
fpsMouseStatus = true;
|
||||
});
|
||||
|
||||
document.body.addEventListener( 'mousemove', ( event ) => {
|
||||
if(fpsMouseStatus == true){
|
||||
fpsCamera.rotation.y -= event.movementX / 500;
|
||||
fpsCamera.rotation.x -= event.movementY / 500;
|
||||
}
|
||||
// if ( document.pointerLockElement === document.body ) {
|
||||
// }
|
||||
} );
|
||||
|
||||
document.addEventListener( 'mouseup', () => {
|
||||
fpsMouseStatus = false;
|
||||
} );
|
||||
|
||||
|
||||
|
||||
function playerCollitions() {
|
||||
|
||||
const result = worldOctree.capsuleIntersect( playerCollider );
|
||||
|
||||
playerOnFloor = false;
|
||||
|
||||
if ( result ) {
|
||||
|
||||
playerOnFloor = result.normal.y > 0;
|
||||
|
||||
if ( ! playerOnFloor ) {
|
||||
|
||||
playerVelocity.addScaledVector( result.normal, - result.normal.dot( playerVelocity ) );
|
||||
|
||||
}
|
||||
|
||||
playerCollider.translate( result.normal.multiplyScalar( result.depth ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updatePlayer( deltaTime ) {
|
||||
|
||||
if ( playerOnFloor ) {
|
||||
|
||||
const damping = Math.exp( - 3 * deltaTime ) - 1;
|
||||
playerVelocity.addScaledVector( playerVelocity, damping );
|
||||
|
||||
} else {
|
||||
if(playerVelocity.y>-10){
|
||||
playerVelocity.y -= GRAVITY * deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
const deltaPosition = playerVelocity.clone().multiplyScalar( deltaTime );
|
||||
playerCollider.translate( deltaPosition );
|
||||
|
||||
playerCollitions();
|
||||
|
||||
fpsCamera.position.copy( playerCollider.end );
|
||||
|
||||
}
|
||||
|
||||
function spheresCollisions() {
|
||||
|
||||
for ( let i = 0; i < spheres.length; i ++ ) {
|
||||
|
||||
const s1 = spheres[ i ];
|
||||
|
||||
for ( let j = i + 1; j < spheres.length; j ++ ) {
|
||||
|
||||
const s2 = spheres[ j ];
|
||||
|
||||
const d2 = s1.collider.center.distanceToSquared( s2.collider.center );
|
||||
const r = s1.collider.radius + s2.collider.radius;
|
||||
const r2 = r * r;
|
||||
|
||||
if ( d2 < r2 ) {
|
||||
|
||||
const normal = s1.collider.clone().center.sub( s2.collider.center ).normalize();
|
||||
const v1 = normal.clone().multiplyScalar( normal.dot( s1.velocity ) );
|
||||
const v2 = normal.clone().multiplyScalar( normal.dot( s2.velocity ) );
|
||||
s1.velocity.add( v2 ).sub( v1 );
|
||||
s2.velocity.add( v1 ).sub( v2 );
|
||||
|
||||
const d = ( r - Math.sqrt( d2 ) ) / 2;
|
||||
|
||||
s1.collider.center.addScaledVector( normal, d );
|
||||
s2.collider.center.addScaledVector( normal, - d );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateSpheres( deltaTime ) {
|
||||
|
||||
spheres.forEach( sphere =>{
|
||||
|
||||
sphere.collider.center.addScaledVector( sphere.velocity, deltaTime );
|
||||
|
||||
const result = worldOctree.sphereIntersect( sphere.collider );
|
||||
|
||||
if ( result ) {
|
||||
|
||||
sphere.velocity.addScaledVector( result.normal, - result.normal.dot( sphere.velocity ) * 1.5 );
|
||||
sphere.collider.center.add( result.normal.multiplyScalar( result.depth ) );
|
||||
|
||||
} else {
|
||||
|
||||
sphere.velocity.y -= GRAVITY * deltaTime;
|
||||
|
||||
}
|
||||
|
||||
const damping = Math.exp( - 1.5 * deltaTime ) - 1;
|
||||
sphere.velocity.addScaledVector( sphere.velocity, damping );
|
||||
|
||||
spheresCollisions();
|
||||
|
||||
sphere.mesh.position.copy( sphere.collider.center );
|
||||
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
function getForwardVector() {
|
||||
|
||||
fpsCamera.getWorldDirection( playerDirection );
|
||||
playerDirection.y = 0;
|
||||
playerDirection.normalize();
|
||||
|
||||
return playerDirection;
|
||||
|
||||
}
|
||||
|
||||
function getSideVector() {
|
||||
|
||||
fpsCamera.getWorldDirection( playerDirection );
|
||||
playerDirection.y = 0;
|
||||
playerDirection.normalize();
|
||||
playerDirection.cross( fpsCamera.up );
|
||||
|
||||
return playerDirection;
|
||||
|
||||
}
|
||||
|
||||
function controls( deltaTime ) {
|
||||
|
||||
const speed = 25;
|
||||
|
||||
if ( playerOnFloor ) {
|
||||
|
||||
if ( keyStates[ 'KeyW' ] ) {
|
||||
|
||||
playerVelocity.add( getForwardVector().multiplyScalar( speed * deltaTime ) );
|
||||
|
||||
}
|
||||
|
||||
if ( keyStates[ 'KeyS' ] ) {
|
||||
|
||||
playerVelocity.add( getForwardVector().multiplyScalar( - speed * deltaTime ) );
|
||||
|
||||
}
|
||||
|
||||
if ( keyStates[ 'KeyA' ] ) {
|
||||
|
||||
playerVelocity.add( getSideVector().multiplyScalar( - speed * deltaTime ) );
|
||||
|
||||
}
|
||||
|
||||
if ( keyStates[ 'KeyD' ] ) {
|
||||
|
||||
playerVelocity.add( getSideVector().multiplyScalar( speed * deltaTime ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( keyStates[ 'Space' ] ) {
|
||||
|
||||
playerVelocity.y = 10;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function render(camera){
|
||||
renderer.render( scene, camera );
|
||||
}
|
||||
window.onresize = function () {
|
||||
scope.orbitCamera.aspect = window.innerWidth / window.innerHeight;
|
||||
scope.orbitCamera.updateProjectionMatrix();
|
||||
fpsCamera.aspect = window.innerWidth / window.innerHeight;
|
||||
fpsCamera.updateProjectionMatrix();
|
||||
renderer.setSize(dom.offsetWidth,dom.offsetHeight);
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
import StompClient from '@/utils/sock';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
import store from '@/store/index';
|
||||
|
||||
|
@ -16,7 +16,8 @@ import { ControlManager } from '@/jlmap3d/lesson3d/manager/controlmanager.js';
|
||||
|
||||
import { AnimateManager } from '@/jlmap3d/lesson3d/manager/animatemanager.js';
|
||||
|
||||
import { Fire } from '@/jlmap3d/lesson3d/utils/fire.js';
|
||||
|
||||
import { AccidentManager } from '@/jlmap3d/lesson3dedit/manager/accidentmanager.js';
|
||||
|
||||
import { Loading } from 'element-ui';
|
||||
|
||||
@ -29,7 +30,6 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
|
||||
let scope = this;
|
||||
this.dom = dom;
|
||||
this.nowSceneType = "";
|
||||
@ -51,21 +51,26 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
light.position.set( 0, 4000, 0 );
|
||||
scene.add( light );
|
||||
|
||||
// let fire = new Fire();
|
||||
// fire.init(scene);
|
||||
var audionext = JL3D_LOCAL_STATIC+'/lesson3d/audio/next.wav';
|
||||
audionext = new Audio(audionext);
|
||||
|
||||
let animateManager = new AnimateManager();
|
||||
|
||||
|
||||
let controlManager = new ControlManager( dom,scene,lessonData,lessonIndex);
|
||||
|
||||
let accidentManager = new AccidentManager(scene);
|
||||
accidentManager.initAccident('player');
|
||||
if(lessonData.accidentList){
|
||||
accidentManager.loadAccidentList(lessonData.accidentList)
|
||||
}
|
||||
let loadingInstance = Loading.service({ fullscreen: true });
|
||||
let assetModelManager = new AssetModelManager(scope,scene,controlManager);
|
||||
let assetModelManager = new AssetModelManager(scope,scene);
|
||||
|
||||
assetModelManager.lessonAssetsLoader(lessonData).then((result) => {
|
||||
scope.nowSceneType = lessonData.lessonProgress[0].progressScene;
|
||||
animateManager.initAnimation(assetModelManager);
|
||||
|
||||
console.log(lessonData.trainDeviceData);
|
||||
// console.log(lessonData.trainDeviceData);
|
||||
controlManager.init(animateManager.actions,assetModelManager,lessonData.trainDeviceData);
|
||||
|
||||
startLesson();
|
||||
@ -76,8 +81,6 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
//console.log(error);
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.actionModelControl = function(actionType,actionModel){
|
||||
|
||||
if(actionType == "remove"){
|
||||
@ -88,6 +91,11 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
}else if(actionType == "changeIndex"){
|
||||
actionModel.visible = true;
|
||||
assetModelManager.otherModel.add(actionModel);
|
||||
audionext.play();
|
||||
}else if(actionType == "showaccident"){
|
||||
accidentManager.addAccident(actionModel,scope.nowSceneType);
|
||||
}else if(actionType == "removeaccident"){
|
||||
accidentManager.removeAccident(actionModel,scope.nowSceneType);
|
||||
}
|
||||
|
||||
}
|
||||
@ -98,14 +106,13 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
|
||||
this.changeIndex = function(nowIndex){
|
||||
if(nowIndex!=0){
|
||||
audionext.play();
|
||||
oldIndex = lessonIndex;
|
||||
if(lessonData.lessonProgress[oldIndex].roleName == nowRole){
|
||||
updateExam(lessonData.lessonProgress[oldIndex],oldIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
lessonIndex = nowIndex;
|
||||
|
||||
// console.log(nowIndex);
|
||||
@ -114,6 +121,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
// console.log(lessonData.lessonProgress[lessonIndex].roleName);
|
||||
if(lessonData.lessonProgress[lessonIndex].roleName == nowRole){
|
||||
assetModelManager.changeSceneGroup(scope.nowSceneType);
|
||||
accidentManager.changeSceneGroup(scope.nowSceneType);
|
||||
controlManager.initRoleMode(true,nowRole);
|
||||
controlManager.initControlMode(lessonIndex);
|
||||
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,true,assetModelManager.lessonTriggerList[scope.nowSceneType]);
|
||||
@ -121,6 +129,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
} else{
|
||||
if(lessonData.lessonProgress[lessonIndex].roleName == 'kong'){
|
||||
assetModelManager.changeSceneGroup(scope.nowSceneType);
|
||||
accidentManager.changeSceneGroup(scope.nowSceneType);
|
||||
controlManager.initRoleMode(false,nowRole);
|
||||
}
|
||||
controlManager.initRoleMode(false,nowRole);
|
||||
@ -204,7 +213,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
if(controlManager.controlMode == "non"){
|
||||
controlManager.updateOrbitControl();
|
||||
}
|
||||
// fire.update();
|
||||
accidentManager.update();
|
||||
animateManager.updateAnimation();
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
|
@ -8,9 +8,12 @@ export function AnimateManager() {
|
||||
|
||||
let mixers = [];
|
||||
this.actions = [];
|
||||
|
||||
let clock = new THREE.Clock();
|
||||
let mixerUpdateDelta;
|
||||
|
||||
|
||||
this.initAnimation = function(assetModelManager){
|
||||
|
||||
|
||||
for(let k in assetModelManager.staticAsset){
|
||||
if(assetModelManager.staticAsset[k].mesh.animations.length > 0){
|
||||
// console.log(assetModelManager.staticAsset[k]);
|
||||
@ -22,8 +25,8 @@ export function AnimateManager() {
|
||||
for(let i=0;i <assetModelManager.staticAsset[k].mesh.children.length;i++){
|
||||
if(assetModelManager.staticAsset[k].mesh.children[i].type == "Group"){
|
||||
assetModelManager.staticAsset[k].mesh.children[i].animations = [];
|
||||
//
|
||||
// console.log(assetModelManager.staticAsset[k].mesh.children[i]);
|
||||
//console.log(assetModelManager.staticAsset[k].mesh);
|
||||
|
||||
assetModelManager.staticAsset[k].mesh.children[i].animations.push(animations.clone());
|
||||
let mixer = new THREE.AnimationMixer( assetModelManager.staticAsset[k].mesh.children[i] );
|
||||
|
||||
@ -31,7 +34,8 @@ export function AnimateManager() {
|
||||
|
||||
scope.actions[actionName] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( assetModelManager.staticAsset[k].mesh.children[i].animations[ 0 ])
|
||||
action:mixer.clipAction( assetModelManager.staticAsset[k].mesh.children[i].animations[ 0 ]),
|
||||
actionType:assetModelManager.staticAsset[k].mesh.name,
|
||||
};
|
||||
|
||||
scope.actions[actionName].action.setLoop(THREE.LoopOnce);
|
||||
@ -56,14 +60,30 @@ export function AnimateManager() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(let j in assetModelManager.lessonTriggerList){
|
||||
for(let i =0;i<assetModelManager.lessonTriggerList[j].length;i++){
|
||||
if(assetModelManager.lessonTriggerList[j][i].cloneanimations){
|
||||
let animations = assetModelManager.lessonTriggerList[j][i].animations;
|
||||
let mixer = new THREE.AnimationMixer( assetModelManager.lessonTriggerList[j][i] );
|
||||
let actionName = assetModelManager.lessonTriggerList[j][i].name;
|
||||
|
||||
scope.actions[actionName] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( assetModelManager.lessonTriggerList[j][i].animations[ 0 ])
|
||||
};
|
||||
// scope.actions[actionName].action.play();
|
||||
mixers.push(mixer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let clock = new THREE.Clock();
|
||||
let mixerUpdateDelta;
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.updateAnimation = function(){
|
||||
mixerUpdateDelta = clock.getDelta();
|
||||
|
||||
|
||||
for(let i=mixers.length-1;i>=0;i--){
|
||||
if(mixers[i]._actions[0].isRunning()){
|
||||
mixers[i].update( mixerUpdateDelta );
|
||||
|
@ -112,9 +112,7 @@ export function AssetModelManager(editor,scene) {
|
||||
scope.lessonTriggerList["dc"] = [];
|
||||
|
||||
this.changeSceneGroup = function(groupType){
|
||||
// console.log(groupType);
|
||||
// console.log(editor.nowSceneType);
|
||||
// console.log(scope.lessonTriggerList[editor.nowSceneType]);
|
||||
|
||||
editor.nowSceneType = groupType;
|
||||
scene.remove(this.otherModel);
|
||||
this.otherModel = groupList[groupType];
|
||||
@ -153,10 +151,14 @@ export function AssetModelManager(editor,scene) {
|
||||
initTriggerList();
|
||||
let modelList = lessonData.modelList;
|
||||
for(let i=0;i<modelList.length;i++){
|
||||
// console.log(modelList[i]);
|
||||
let newModelTrigger = scope.loadAsset[modelList[i].modelId].mesh.clone(true);
|
||||
if(scope.loadAsset[modelList[i].modelId].mesh.animations.length>0){
|
||||
newModelTrigger.animations = scope.loadAsset[modelList[i].modelId].mesh.animations;
|
||||
newModelTrigger.cloneanimations = true;
|
||||
}
|
||||
newModelTrigger.showType = "loadModel";
|
||||
newModelTrigger.label = modelList[i].label;
|
||||
newModelTrigger.name = modelList[i].label;
|
||||
newModelTrigger.modelId = modelList[i].modelId;
|
||||
newModelTrigger.visible = modelList[i].visible;
|
||||
newModelTrigger.position.x = modelList[i].pos.x;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
import { Capsule } from '@/jlmap3d/lesson3d/math/Capsule.js';
|
||||
import { Capsule } from '@/jlmap3d/utils/math/Capsule.js';
|
||||
|
||||
import { Octree } from '@/jlmap3d/lesson3d/math/Octree.js';
|
||||
import { Octree } from '@/jlmap3d/utils/math/Octree.js';
|
||||
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import { OBJLoader } from '@/jlmap3d/main/loaders/OBJLoader';
|
||||
@ -29,6 +29,9 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
let trainDeviceMode = false;
|
||||
let trainDeviceList = [];
|
||||
|
||||
var audiopbm = JL3D_LOCAL_STATIC+'/lesson3d/audio/pbm.wav';
|
||||
audiopbm = new Audio(audiopbm);
|
||||
|
||||
let renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setClearColor(new THREE.Color(0x000000));
|
||||
renderer.setViewport( 0, 0, dom.offsetWidth, dom.offsetHeight);
|
||||
@ -130,7 +133,6 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
this.initRoleMode = function(rMode,role){
|
||||
roleMode = rMode;
|
||||
nowRole = role;
|
||||
// console.log(roleMode);
|
||||
};
|
||||
|
||||
this.initExam = function(newExamList,newExamData){
|
||||
@ -297,6 +299,10 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
actionEvent("remove",raycasterBoxs[i],raycasterBoxs[i].mesh);
|
||||
jumpEvent("action",raycasterBoxs[i]);
|
||||
}else if(raycasterBoxs[i].actionMode == "play"){
|
||||
// console.log(raycasterBoxs[i]);
|
||||
if(raycasterBoxs[i].action.actionType == "PBMDH"){
|
||||
audiopbm.play();
|
||||
}
|
||||
if(raycasterBoxs[i].animateModel != "播放动画的模型"){
|
||||
if(raycasterBoxs[i].action.status == "01"){
|
||||
raycasterBoxs[i].action.status = "02";
|
||||
@ -604,6 +610,8 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
attachBox.position.x = lessonData.lessonProgress[nowLessonIndex].cameraPosition.x;
|
||||
attachBox.position.y = lessonData.lessonProgress[nowLessonIndex].cameraPosition.y ;
|
||||
attachBox.position.z = lessonData.lessonProgress[nowLessonIndex].cameraPosition.z;
|
||||
console.log(lessonData.lessonProgress[nowLessonIndex]);
|
||||
fpsCamera.lookAt(lessonData.lessonProgress[nowLessonIndex].cameraTarget.x,lessonData.lessonProgress[nowLessonIndex].cameraTarget.y,lessonData.lessonProgress[nowLessonIndex].cameraTarget.z);
|
||||
}
|
||||
|
||||
}
|
||||
@ -639,7 +647,6 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
for(let i=0;i<actions.length;i++){
|
||||
|
||||
if(actions[i].actionType == "auto"){
|
||||
|
||||
if(actions[i].actionMode == "play"){
|
||||
for(let j=0;j<eventTrigger.length;j++){
|
||||
if(eventTrigger[j].label == actions[i].actionModel){
|
||||
@ -689,6 +696,13 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(actions[i].actionMode == "showaccident"){
|
||||
actionEvent("showaccident",actions[i],actions[i].actionModel);
|
||||
}
|
||||
if(actions[i].actionMode == "removeaccident"){
|
||||
actionEvent("removeaccident",actions[i],actions[i].actionModel);
|
||||
}
|
||||
}
|
||||
if(roleMode){
|
||||
if(actions[i].actionType == "contact"){
|
||||
|
18
src/jlmap3d/lesson3d/toolsmodel/bagitemdata.js
Normal file
18
src/jlmap3d/lesson3d/toolsmodel/bagitemdata.js
Normal file
@ -0,0 +1,18 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export function BagItemData() {
|
||||
let scope = this;
|
||||
|
||||
this.dataList = [];
|
||||
|
||||
scope.dataList["ztg"] = [
|
||||
{
|
||||
id:"pbmys",
|
||||
name:"屏蔽门钥匙",
|
||||
type:"equip",
|
||||
pic:JL3D_LOCAL_STATIC+"/lesson3d/item/pbmys.png",
|
||||
status:false,
|
||||
},
|
||||
];
|
||||
|
||||
}
|
@ -4,12 +4,25 @@ export function Fire() {
|
||||
var last_time_activate = Date.now();
|
||||
|
||||
|
||||
this.createNew = function(scene,pos){
|
||||
this.createAdd = function(scene,pos){
|
||||
scope.points = new Points(pos);
|
||||
scope.points.init(pos);
|
||||
scene.add(scope.points.obj);
|
||||
}
|
||||
|
||||
this.createNew = function(scene,pos){
|
||||
scope.points = new Points(pos);
|
||||
scope.points.init(pos);
|
||||
}
|
||||
|
||||
this.addAccident = function(scene){
|
||||
scene.add(scope.points.obj);
|
||||
}
|
||||
|
||||
this.removeAccident = function(scene){
|
||||
scene.remove(scope.points.obj);
|
||||
}
|
||||
|
||||
this.update = function(){
|
||||
var now = Date.now();
|
||||
scope.points.update();
|
||||
|
@ -182,7 +182,7 @@ export function Lesson3dEditor(dom,lessonData) {
|
||||
var intersects = raycaster.intersectObjects( scene.children,true );
|
||||
|
||||
if(intersects.length>0){
|
||||
accidentManager.createNewAccident(accidentData,intersects[0].point,scope.nowSceneType);
|
||||
accidentManager.createAddAccident(accidentData,intersects[0].point,scope.nowSceneType);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ export function AccidentManager(scene) {
|
||||
|
||||
this.accidentList = [];
|
||||
|
||||
this.accidentMode = '';
|
||||
this.accidentGroup = new THREE.Group();
|
||||
|
||||
//场景中可触发事件模型
|
||||
@ -32,7 +33,7 @@ export function AccidentManager(scene) {
|
||||
|
||||
scene.add(scope.accidentGroup);
|
||||
|
||||
this.initAccident = function(nowSceneType){
|
||||
this.initAccident = function(type){
|
||||
let accidentData = [
|
||||
{
|
||||
id:'1',
|
||||
@ -40,8 +41,13 @@ export function AccidentManager(scene) {
|
||||
type:"fire"
|
||||
}
|
||||
];
|
||||
scope.accidentMode = type;
|
||||
if(scope.accidentMode == 'player'){
|
||||
|
||||
}else{
|
||||
jl3dUpdateAccidentData(accidentData);
|
||||
}
|
||||
}
|
||||
|
||||
this.saveDataList = function(){
|
||||
let saveList = [];
|
||||
@ -66,17 +72,37 @@ export function AccidentManager(scene) {
|
||||
}
|
||||
return saveList;
|
||||
}
|
||||
this.addAccident = function(addLable,nowSceneType){
|
||||
for(let i=0;i<scope.accidentList[updateSceneType].length;i++){
|
||||
if(scope.accidentList[updateSceneType][i].label == addLable){
|
||||
scope.accidentList[updateSceneType][i].object.addAccident(groupList[nowSceneType]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.removeAccident = function(removeLable,nowSceneType){
|
||||
for(let i=0;i<scope.accidentList[updateSceneType].length;i++){
|
||||
if(scope.accidentList[updateSceneType][i].label == removeLable){
|
||||
scope.accidentList[updateSceneType][i].object.removeAccident(groupList[nowSceneType]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.changeSceneGroup = function(nowSceneType){
|
||||
if(scope.accidentGroup.children.length>0){
|
||||
scope.accidentGroup.remove(scope.accidentGroup.children[0]);
|
||||
}
|
||||
|
||||
scope.accidentGroup.add(groupList[nowSceneType]);
|
||||
if(scope.accidentMode == 'player'){
|
||||
|
||||
}else{
|
||||
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
|
||||
}
|
||||
updateSceneType = nowSceneType;
|
||||
}
|
||||
|
||||
this.createNewAccident = function(type,pos,nowSceneType){
|
||||
this.createAddAccident = function(type,pos,nowSceneType){
|
||||
|
||||
var rand = Math.floor(Math.random () * 900) + 100;
|
||||
|
||||
@ -92,11 +118,15 @@ export function AccidentManager(scene) {
|
||||
};
|
||||
if(type == "fire"){
|
||||
newAccident.object = new Fire();
|
||||
newAccident.object.createNew(groupList[nowSceneType],pos);
|
||||
newAccident.object.createAdd(groupList[nowSceneType],pos);
|
||||
}
|
||||
scope.accidentList[nowSceneType].push(newAccident);
|
||||
if(scope.accidentMode == 'player'){
|
||||
|
||||
}else{
|
||||
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
|
||||
}
|
||||
}
|
||||
|
||||
this.deleteAccident = function(selectAccident,nowSceneType){
|
||||
groupList[nowSceneType].remove(selectAccident.object.points.obj);
|
||||
@ -104,7 +134,9 @@ export function AccidentManager(scene) {
|
||||
for(let i=0;i<scope.accidentList[nowSceneType].length;i++){
|
||||
if(scope.accidentList[nowSceneType][i].id == selectAccident.id){
|
||||
scope.accidentList[nowSceneType].splice(i,1);
|
||||
|
||||
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -112,7 +144,6 @@ export function AccidentManager(scene) {
|
||||
|
||||
|
||||
this.loadAccidentList = function(accidentList){
|
||||
console.log(accidentList);
|
||||
for(let i=0;i<accidentList.length;i++){
|
||||
let newAccident = {
|
||||
id:accidentList[i].id,
|
||||
@ -126,10 +157,13 @@ export function AccidentManager(scene) {
|
||||
};
|
||||
if(accidentList[i].type == "fire"){
|
||||
newAccident.object = new Fire();
|
||||
if(scope.accidentMode == 'player'){
|
||||
newAccident.object.createNew(groupList[accidentList[i].sceneType],accidentList[i].pos);
|
||||
}else{
|
||||
newAccident.object.createAdd(groupList[accidentList[i].sceneType],accidentList[i].pos);
|
||||
}
|
||||
}
|
||||
scope.accidentList[accidentList[i].sceneType].push(newAccident);
|
||||
// jl3dUpdateAccidentlist(scope.accidentList[accidentList[i].sceneType]);
|
||||
}
|
||||
}
|
||||
|
||||
|
18
src/jlmap3d/lesson3dedit/toolsmodel/bagitemdata.js
Normal file
18
src/jlmap3d/lesson3dedit/toolsmodel/bagitemdata.js
Normal file
@ -0,0 +1,18 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export function BagItemData() {
|
||||
let scope = this;
|
||||
|
||||
this.dataList = [];
|
||||
|
||||
scope.dataList["ztg"] = [
|
||||
{
|
||||
id:"pbmys",
|
||||
name:"屏蔽门钥匙",
|
||||
type:"equip",
|
||||
pic:JL3D_LOCAL_STATIC+"/lesson3d/item/pbmys.png",
|
||||
status:false,
|
||||
},
|
||||
];
|
||||
|
||||
}
|
@ -257,6 +257,52 @@ export function JobPaneData() {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"信号楼值班员",
|
||||
value:"xhlzby",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"工电调度",
|
||||
value:"gddd",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"通号调度",
|
||||
value:"scdd",
|
||||
@ -349,6 +395,121 @@ export function JobPaneData() {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"电力调度",
|
||||
value:"dldd",
|
||||
text:"负责供电系统的正常运行。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"环控调度",
|
||||
value:"hkdd",
|
||||
text:"负责监控地铁环控系统运行。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"信息调度",
|
||||
value:"xxdd",
|
||||
text:"负责故障发生时通报信息。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"安检人员",
|
||||
value:"ajry",
|
||||
text:"负责地铁安检并维护秩序",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"防疫部门",
|
||||
value:"fybm",
|
||||
text:"报告疫情事件。",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"报警中心",
|
||||
value:"bjzx",
|
||||
|
@ -1,113 +1,148 @@
|
||||
import { AssetModel } from '@/jlmap3d/main/loaders/model/Assetmodel';
|
||||
import { Assetmaterial } from '@/jlmap3d/main/loaders/model/Assetmaterial';
|
||||
import { getBaseUrl } from '@/utils/baseUrl';
|
||||
import { Loading } from 'element-ui';
|
||||
const BASE_API = getBaseUrl();
|
||||
import { JL3D_LOCAL_STATIC,BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
import {
|
||||
AssetModel
|
||||
} from '@/jlmap3d/main/loaders/model/Assetmodel';
|
||||
import {
|
||||
Assetmaterial
|
||||
} from '@/jlmap3d/main/loaders/model/Assetmaterial';
|
||||
import {
|
||||
Loading
|
||||
} from 'element-ui';
|
||||
import {
|
||||
JL3D_LOCAL_STATIC,
|
||||
BASE_ASSET_API
|
||||
} from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
let defaultsignal = {
|
||||
id:"3",
|
||||
name:"低位三灯",
|
||||
deviceType:"signal",
|
||||
type:"low",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-07-10/13-42231.FBX"
|
||||
id: "3",
|
||||
name: "低位三灯",
|
||||
deviceType: "signal",
|
||||
type: "low",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-10/13-42231.FBX"
|
||||
}
|
||||
|
||||
let defaulttrain = {
|
||||
id:"9",
|
||||
name:"6节列车",
|
||||
deviceType:"train",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-11-16/57-53841.FBX"
|
||||
id: "9",
|
||||
name: "6节列车",
|
||||
deviceType: "train",
|
||||
type: "num4",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-11-16/57-53841.FBX"
|
||||
}
|
||||
|
||||
|
||||
let defaultstation = {
|
||||
id:"8",
|
||||
name:"内侧车站",
|
||||
deviceType:"stand",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-11-16/52-60478.FBX"
|
||||
id: "8",
|
||||
name: "内侧车站",
|
||||
deviceType: "stand",
|
||||
type: "num4",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-11-16/52-60478.FBX"
|
||||
}
|
||||
let waicestation = {
|
||||
id:"10",
|
||||
name:"外侧车站",
|
||||
deviceType:"standwaice",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-11-16/53-61736.FBX"
|
||||
id: "10",
|
||||
name: "外侧车站",
|
||||
deviceType: "standwaice",
|
||||
type: "num4",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-11-16/53-61736.FBX"
|
||||
}
|
||||
|
||||
let defaultswitch = {
|
||||
id:"11",
|
||||
name:"道岔",
|
||||
deviceType:"switch",
|
||||
type:"fuzhou",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-07-10/17-43789.FBX"
|
||||
id: "11",
|
||||
name: "道岔",
|
||||
deviceType: "switch",
|
||||
type: "fuzhou",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-10/17-43789.FBX"
|
||||
}
|
||||
|
||||
|
||||
let defaultsuidao = {
|
||||
id:"16",
|
||||
name:"suidao",
|
||||
deviceType:"suidao",
|
||||
type:"suidao",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-07-10/21-35677.FBX"
|
||||
id: "16",
|
||||
name: "suidao",
|
||||
deviceType: "suidao",
|
||||
type: "suidao",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-10/21-35677.FBX"
|
||||
}
|
||||
|
||||
|
||||
|
||||
let defaultbackground = {
|
||||
id:"16",
|
||||
name:"background",
|
||||
deviceType:"background",
|
||||
type:"background",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-07-10/21-35677.FBX"
|
||||
id: "16",
|
||||
name: "background",
|
||||
deviceType: "background",
|
||||
type: "background",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-10/21-35677.FBX"
|
||||
}
|
||||
|
||||
let defaultautorail = {
|
||||
id:"100",
|
||||
name:"autorail",
|
||||
deviceType:"autorail",
|
||||
type:"autorail",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/auto/rail.FBX"
|
||||
id: "100",
|
||||
name: "autorail",
|
||||
deviceType: "autorail",
|
||||
type: "autorail",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/auto/rail.FBX"
|
||||
}
|
||||
|
||||
let autoswitch = {
|
||||
id:"104",
|
||||
name:"道岔",
|
||||
deviceType:"autoswitch",
|
||||
type:"fuzhou",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-07-10/17-43789.FBX"
|
||||
id: "104",
|
||||
name: "道岔",
|
||||
deviceType: "autoswitch",
|
||||
type: "fuzhou",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-10/17-43789.FBX"
|
||||
}
|
||||
|
||||
let autoswitch1 = {
|
||||
id:"102",
|
||||
name:"道岔1",
|
||||
deviceType:"autoswitch1",
|
||||
type:"fuzhou",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-07-10/17-43789.FBX"
|
||||
id: "102",
|
||||
name: "道岔1",
|
||||
deviceType: "autoswitch1",
|
||||
type: "fuzhou",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-10/17-43789.FBX"
|
||||
}
|
||||
|
||||
let autoswitch2 = {
|
||||
id:"103",
|
||||
name:"道岔2",
|
||||
deviceType:"autoswitch2",
|
||||
type:"fuzhou",
|
||||
picUrl:"",
|
||||
url:BASE_ASSET_API+"/MODEL/2020-07-10/17-43789.FBX"
|
||||
id: "103",
|
||||
name: "道岔2",
|
||||
deviceType: "autoswitch2",
|
||||
type: "fuzhou",
|
||||
picUrl: "",
|
||||
url: BASE_ASSET_API + "/MODEL/2020-07-10/17-43789.FBX"
|
||||
}
|
||||
|
||||
export function AssetLoader(){
|
||||
|
||||
let nologonc = {
|
||||
id: "n1",
|
||||
name: "高架内侧车站",
|
||||
deviceType: "nologonc",
|
||||
type: "nologonc",
|
||||
picUrl: "",
|
||||
url: "/MODEL/2021-11-26/531-67215.FBX"
|
||||
}
|
||||
|
||||
let nologowc = {
|
||||
id: "n2",
|
||||
name: "高架外侧车站",
|
||||
deviceType: "nologowc",
|
||||
type: "nologowc",
|
||||
picUrl: "",
|
||||
url: "/MODEL/2021-11-26/532-84618.FBX"
|
||||
}
|
||||
|
||||
let nologohc = {
|
||||
id: "n3",
|
||||
name: "换乘车站",
|
||||
deviceType: "nologohc",
|
||||
type: "nologohc",
|
||||
picUrl: "",
|
||||
url: "/MODEL/2021-11-26/534-3276.FBX"
|
||||
}
|
||||
|
||||
export function AssetLoader() {
|
||||
|
||||
let scope = this;
|
||||
|
||||
@ -120,8 +155,8 @@ export function AssetLoader(){
|
||||
|
||||
this.materiallist = [];
|
||||
//初始化资源加载器
|
||||
this.setmodellist = function (data,trainoffset){
|
||||
if(trainoffset){
|
||||
this.setmodellist = function(data, trainoffset) {
|
||||
if (trainoffset) {
|
||||
scope.trainoffset = trainoffset;
|
||||
}
|
||||
let defaultmodel1 = new AssetModel(defaultsignal);
|
||||
@ -136,7 +171,6 @@ export function AssetLoader(){
|
||||
let suidao = new AssetModel(defaultsuidao);
|
||||
scope.modellist.push(suidao);
|
||||
|
||||
|
||||
let background = new AssetModel(defaultbackground);
|
||||
scope.modellist.push(defaultbackground);
|
||||
|
||||
@ -147,12 +181,12 @@ export function AssetLoader(){
|
||||
scope.modellist.push(defaultswitch2);
|
||||
|
||||
let modeldata = JSON.parse(data);
|
||||
for(let j=0;j<modeldata.length;j++){
|
||||
for (let j = 0; j < modeldata.length; j++) {
|
||||
let had = false;
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
for (let i = 0; i < scope.modellist.length; i++) {
|
||||
|
||||
|
||||
if(scope.modellist[i].id == modeldata[j].id){
|
||||
if (scope.modellist[i].id == modeldata[j].id) {
|
||||
|
||||
had = true;
|
||||
|
||||
@ -161,7 +195,7 @@ export function AssetLoader(){
|
||||
|
||||
}
|
||||
|
||||
if(had == false){
|
||||
if (had == false) {
|
||||
let model = new AssetModel(modeldata[j]);
|
||||
scope.modellist.push(modeldata[j]);
|
||||
}
|
||||
@ -169,64 +203,69 @@ export function AssetLoader(){
|
||||
}
|
||||
|
||||
}
|
||||
this.setModelListOver = function (data,trainoffset,others){
|
||||
if(trainoffset){
|
||||
this.setModelListOver = function(data, trainoffset, others, project) {
|
||||
if (trainoffset) {
|
||||
scope.trainoffset = trainoffset;
|
||||
}
|
||||
if(others){
|
||||
|
||||
if (project == "nologo") {
|
||||
let nologoStationNc = new AssetModel(nologonc);
|
||||
scope.modellist.push(nologonc);
|
||||
|
||||
let nologoStationWc = new AssetModel(nologowc);
|
||||
scope.modellist.push(nologowc);
|
||||
|
||||
let nologoStationHc = new AssetModel(nologohc);
|
||||
scope.modellist.push(nologohc);
|
||||
}
|
||||
|
||||
if (project == "say") {
|
||||
let nologoStationNc = new AssetModel(nologonc);
|
||||
scope.modellist.push(nologonc);
|
||||
let nologoStationHc = new AssetModel(nologohc);
|
||||
scope.modellist.push(nologohc);
|
||||
}
|
||||
|
||||
if (others) {
|
||||
let otherData = others;
|
||||
// console.log(data);
|
||||
for(let j=0;j<otherData.length;j++){
|
||||
for (let j = 0; j < otherData.length; j++) {
|
||||
let model = new AssetModel(otherData[j]);
|
||||
// console.log(otherData[j]);
|
||||
scope.modellist.push(otherData[j]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let modeldata = data;
|
||||
|
||||
for(let j=0;j<modeldata.length;j++){
|
||||
for (let j = 0; j < modeldata.length; j++) {
|
||||
let had = false;
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
|
||||
if(scope.modellist[i].id == modeldata[j].id){
|
||||
|
||||
for (let i = 0; i < scope.modellist.length; i++) {
|
||||
if (scope.modellist[i].id == modeldata[j].id) {
|
||||
had = true;
|
||||
|
||||
i = scope.modellist.length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(had == false){
|
||||
if(modeldata[j].url != ""){
|
||||
if (had == false) {
|
||||
if (modeldata[j].url != "") {
|
||||
let model = new AssetModel(modeldata[j]);
|
||||
scope.modellist.push(modeldata[j]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.setmodellistnew = function (data,trainoffset){
|
||||
this.setmodellistnew = function(data, trainoffset) {
|
||||
|
||||
if(trainoffset){
|
||||
if (trainoffset) {
|
||||
scope.trainoffset = trainoffset;
|
||||
}
|
||||
|
||||
|
||||
let modeldata = JSON.parse(data);
|
||||
|
||||
for(let j=0;j<modeldata.assets.length;j++){
|
||||
for (let j = 0; j < modeldata.assets.length; j++) {
|
||||
let had = false;
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
for (let i = 0; i < scope.modellist.length; i++) {
|
||||
|
||||
if(scope.modellist[i].id == modeldata.assets[j].id){
|
||||
if (scope.modellist[i].id == modeldata.assets[j].id) {
|
||||
|
||||
had = true;
|
||||
|
||||
@ -235,7 +274,7 @@ export function AssetLoader(){
|
||||
|
||||
}
|
||||
|
||||
if(had == false){
|
||||
if (had == false) {
|
||||
let model = new AssetModel(modeldata.assets[j]);
|
||||
scope.modellist.push(modeldata.assets[j]);
|
||||
|
||||
@ -249,23 +288,23 @@ export function AssetLoader(){
|
||||
assetname: "spmxa",
|
||||
deviceType: "spmxa",
|
||||
id: "spmxa",
|
||||
mesh:"",
|
||||
mesh: "",
|
||||
packageName: "spmxa",
|
||||
type: "spmxa",
|
||||
url: "/MODEL/2021-04-13/1427-29057.FBX",
|
||||
};
|
||||
this.assetPromiseOver = function (scene){
|
||||
this.assetPromiseOver = function(scene) {
|
||||
let initlist = [];
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
for (let i = 0; i < scope.modellist.length; i++) {
|
||||
// console.log(scope.modellist);
|
||||
initlist.push(fbxPromiseOver(scope.modellist[i]));
|
||||
if(scope.modellist[i].packageName == "西安三隧道"){
|
||||
if (scope.modellist[i].packageName == "西安三隧道") {
|
||||
scope.modellist.push(specilModelXiAn);
|
||||
initlist.push(fbxPromiseOver(specilModelXiAn));
|
||||
}
|
||||
}
|
||||
|
||||
return new Promise(function(resolve, reject){
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
|
||||
Promise.all(initlist).then((result) => {
|
||||
@ -279,13 +318,13 @@ export function AssetLoader(){
|
||||
}
|
||||
|
||||
|
||||
this.assetpromise = function (scene){
|
||||
this.assetpromise = function(scene) {
|
||||
let initlist = [];
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
for (let i = 0; i < scope.modellist.length; i++) {
|
||||
initlist.push(fbxpromiseold(scope.modellist[i]));
|
||||
|
||||
}
|
||||
return new Promise(function(resolve, reject){
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
|
||||
Promise.all(initlist).then((result) => {
|
||||
@ -298,8 +337,8 @@ export function AssetLoader(){
|
||||
});
|
||||
}
|
||||
|
||||
this.assetinit = function(scene){
|
||||
return new Promise(function(resolve, reject){
|
||||
this.assetinit = function(scene) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let signal = new AssetModel(defaultsignal);
|
||||
scope.modellist.push(signal);
|
||||
|
||||
@ -326,17 +365,17 @@ export function AssetLoader(){
|
||||
scope.modellist.push(autoswitchs);
|
||||
|
||||
fbxpromise(signal)
|
||||
.then(function(data){
|
||||
.then(function(data) {
|
||||
////console.log(data);
|
||||
// console.log("test");
|
||||
return fbxpromise(train);
|
||||
})
|
||||
.then(function(data){
|
||||
.then(function(data) {
|
||||
////console.log(data);
|
||||
// console.log("test");
|
||||
return fbxpromise(station);
|
||||
})
|
||||
.then(function(data){
|
||||
.then(function(data) {
|
||||
////console.log(data);
|
||||
// console.log("test");
|
||||
return fbxpromise(wstation);
|
||||
@ -349,30 +388,32 @@ export function AssetLoader(){
|
||||
// ////console.log(data);
|
||||
// return fbxpromise(autosuidao);
|
||||
// })
|
||||
.then(function(data){
|
||||
.then(function(data) {
|
||||
////console.log(data);
|
||||
// console.log("defaultswitch1");
|
||||
return fbxpromise(defaultswitch1);
|
||||
})
|
||||
.then(function(data){
|
||||
.then(function(data) {
|
||||
// console.log("defaultswitch2");
|
||||
////console.log(data);
|
||||
return fbxpromise(defaultswitch2);
|
||||
})
|
||||
.then(function(data){
|
||||
.then(function(data) {
|
||||
////console.log(data);
|
||||
// console.log("autoswitchs");
|
||||
return fbxpromise(autoswitchs);
|
||||
})
|
||||
.then(function(data){
|
||||
.then(function(data) {
|
||||
////console.log(scope.modellist);
|
||||
resolve("loaderassets");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.loadnewsection = function(newdata,jlmap3dedit){
|
||||
let loadingInstance = Loading.service({ fullscreen: true });
|
||||
this.loadnewsection = function(newdata, jlmap3dedit) {
|
||||
let loadingInstance = Loading.service({
|
||||
fullscreen: true
|
||||
});
|
||||
let scene = jlmap3dedit.scene;
|
||||
let newmodel = new AssetModel(newdata);
|
||||
let jlmap3ddata = jlmap3dedit.mapdata;
|
||||
@ -380,29 +421,29 @@ export function AssetLoader(){
|
||||
|
||||
scene.remove(jlmap3dedit.exportmodel);
|
||||
var loader = new THREE.FBXLoader();
|
||||
loader.load( newdata.assetUrl, function ( object ) {
|
||||
loader.load(newdata.assetUrl, function(object) {
|
||||
|
||||
let newmesh = object;
|
||||
|
||||
//let mixer = new THREE.AnimationMixer( newmesh );
|
||||
////console.log(jlmap3ddata.sectionlist);
|
||||
for(let i=0;i<newmesh.children.length;i++){
|
||||
for (let i = 0; i < newmesh.children.length; i++) {
|
||||
|
||||
let name = newmesh.children[i].name.split("_");
|
||||
let newmeshname = name[0]+"_"+name[1]+"_"+name[2]+"."+name[3];
|
||||
let newmeshname = name[0] + "_" + name[1] + "_" + name[2] + "." + name[3];
|
||||
|
||||
if(name[0] == "Switch"){
|
||||
for(let j=0;j<jlmap3ddata.sectionlist.switchs.datalist.length;j++){
|
||||
if (name[0] == "Switch") {
|
||||
for (let j = 0; j < jlmap3ddata.sectionlist.switchs.datalist.length; j++) {
|
||||
|
||||
if(jlmap3ddata.sectionlist.switchs.datalist[j].name == newmeshname){
|
||||
if (jlmap3ddata.sectionlist.switchs.datalist[j].name == newmeshname) {
|
||||
//绿色道岔
|
||||
var box = new THREE.BoxHelper( newmesh.children[i], 0x00EE00 );
|
||||
var box = new THREE.BoxHelper(newmesh.children[i], 0x00EE00);
|
||||
scene.add(box);
|
||||
let nowname = jlmap3ddata.sectionlist.switchs.datalist[j].name;
|
||||
let nowcode = jlmap3ddata.sectionlist.switchs.datalist[j].code;
|
||||
newmesh.children[i].name = nowname;
|
||||
newmesh.children[i].code = nowcode;
|
||||
for(let n=0;n<newmesh.children[i].children.length;n++){
|
||||
for (let n = 0; n < newmesh.children[i].children.length; n++) {
|
||||
newmesh.children[i].children[n].code = nowcode;
|
||||
}
|
||||
|
||||
@ -413,21 +454,21 @@ export function AssetLoader(){
|
||||
}
|
||||
}
|
||||
|
||||
if(name[0] == "Section"){
|
||||
if (name[0] == "Section") {
|
||||
|
||||
//物理区段
|
||||
for(let j=0;j<jlmap3ddata.sectionlist.sections.datalist.length;j++){
|
||||
for (let j = 0; j < jlmap3ddata.sectionlist.sections.datalist.length; j++) {
|
||||
|
||||
if(jlmap3ddata.sectionlist.sections.datalist[j].name == newmeshname){
|
||||
if (jlmap3ddata.sectionlist.sections.datalist[j].name == newmeshname) {
|
||||
|
||||
if(jlmap3ddata.sectionlist.sections.datalist[j].isStandTrack == true){
|
||||
if (jlmap3ddata.sectionlist.sections.datalist[j].isStandTrack == true) {
|
||||
//红色站台区段
|
||||
var box = new THREE.BoxHelper( newmesh.children[i], 0xff0000 );
|
||||
}else{
|
||||
var box = new THREE.BoxHelper(newmesh.children[i], 0xff0000);
|
||||
} else {
|
||||
//蓝色其他区段
|
||||
var box = new THREE.BoxHelper( newmesh.children[i], 0x0000ff );
|
||||
var box = new THREE.BoxHelper(newmesh.children[i], 0x0000ff);
|
||||
}
|
||||
scene.add( box );
|
||||
scene.add(box);
|
||||
|
||||
let nowname = jlmap3ddata.sectionlist.sections.datalist[j].name;
|
||||
let nowcode = jlmap3ddata.sectionlist.sections.datalist[j].code;
|
||||
@ -441,10 +482,10 @@ export function AssetLoader(){
|
||||
}
|
||||
}
|
||||
|
||||
if(name[0] == "Singal"){
|
||||
if (name[0] == "Singal") {
|
||||
|
||||
for(let j=0;j<jlmap3ddata.signallist.list.length;j++){
|
||||
if(jlmap3ddata.signallist.list[j].mesh.code == newmeshname){
|
||||
for (let j = 0; j < jlmap3ddata.signallist.list.length; j++) {
|
||||
if (jlmap3ddata.signallist.list[j].mesh.code == newmeshname) {
|
||||
jlmap3ddata.signallist.list[j].mesh.position.x = newmesh.children[i].position.x;
|
||||
jlmap3ddata.signallist.list[j].mesh.position.y = newmesh.children[i].position.y;
|
||||
jlmap3ddata.signallist.list[j].mesh.position.z = newmesh.children[i].position.z;
|
||||
@ -454,10 +495,10 @@ export function AssetLoader(){
|
||||
}
|
||||
}
|
||||
|
||||
if(name[0] == "Station"){
|
||||
if (name[0] == "Station") {
|
||||
|
||||
for(let j=0;j<jlmap3ddata.stationstandlist.list.length;j++){
|
||||
if(jlmap3ddata.stationstandlist.list[j].mesh.code == newmeshname){
|
||||
for (let j = 0; j < jlmap3ddata.stationstandlist.list.length; j++) {
|
||||
if (jlmap3ddata.stationstandlist.list[j].mesh.code == newmeshname) {
|
||||
jlmap3ddata.stationstandlist.list[j].mesh.position.x = newmesh.children[i].position.x;
|
||||
jlmap3ddata.stationstandlist.list[j].mesh.position.y = newmesh.children[i].position.y;
|
||||
jlmap3ddata.stationstandlist.list[j].mesh.position.z = newmesh.children[i].position.z;
|
||||
@ -472,25 +513,25 @@ export function AssetLoader(){
|
||||
scene.add(newmesh);
|
||||
loadingInstance.close();
|
||||
//console.log("add");
|
||||
} );
|
||||
});
|
||||
|
||||
}
|
||||
//新载入资源
|
||||
this.loadnewasset = function(jlmap3dedit,newdata,num){
|
||||
this.loadnewasset = function(jlmap3dedit, newdata, num) {
|
||||
|
||||
let newmodel = new AssetModel(newdata);
|
||||
scope.modellist.push(newmodel);
|
||||
fbxload(newmodel);
|
||||
|
||||
var loader = new THREE.FBXLoader();
|
||||
loader.load( newdata.assetUrl, function ( object ) {
|
||||
loader.load(newdata.assetUrl, function(object) {
|
||||
|
||||
jlmap3dedit.transcontrol.detach();
|
||||
jlmap3dedit.mapdata.signallist.group.remove(jlmap3dedit.mapdata.signallist.list[num].mesh);
|
||||
|
||||
object.name = newdata.uuid;
|
||||
object.code = jlmap3dedit.mapdata.signallist.list[num].mesh.code;
|
||||
for(let j=0;j<object.children.length;j++){
|
||||
for (let j = 0; j < object.children.length; j++) {
|
||||
object.children[j].code = jlmap3dedit.mapdata.signallist.list[num].mesh.code;
|
||||
}
|
||||
|
||||
@ -510,20 +551,20 @@ export function AssetLoader(){
|
||||
|
||||
jlmap3dedit.mapdata.signallist.list[num].mesh = object;
|
||||
|
||||
jlmap3dedit.mapdata.signallist.group.add( object );
|
||||
jlmap3dedit.mapdata.signallist.group.add(object);
|
||||
jlmap3dedit.transcontrol.attach(jlmap3dedit.selectmodel);
|
||||
jlmap3dedit.selectmodel = jlmap3dedit.mapdata.signallist.list[num].mesh;
|
||||
return jlmap3dedit.selectmodel;
|
||||
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
this.loadoldasset = function(jlmap3dedit,newdata,num){
|
||||
this.loadoldasset = function(jlmap3dedit, newdata, num) {
|
||||
|
||||
let assetnum = null;
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
for (let i = 0; i < scope.modellist.length; i++) {
|
||||
|
||||
if(newdata.uuid == scope.modellist[i].uuid){
|
||||
if (newdata.uuid == scope.modellist[i].uuid) {
|
||||
assetnum = i;
|
||||
}
|
||||
}
|
||||
@ -535,7 +576,7 @@ export function AssetLoader(){
|
||||
|
||||
newmesh.name = scope.modellist[assetnum].uuid;
|
||||
newmesh.code = jlmap3dedit.mapdata.signallist.list[num].mesh.code;
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
for (let j = 0; j < newmesh.children.length; j++) {
|
||||
newmesh.children[j].code = jlmap3dedit.mapdata.signallist.list[num].mesh.code;
|
||||
}
|
||||
|
||||
@ -550,54 +591,54 @@ export function AssetLoader(){
|
||||
jlmap3dedit.mapdata.signallist.list[num].mesh = null;
|
||||
jlmap3dedit.mapdata.signallist.list[num].mesh = newmesh;
|
||||
|
||||
jlmap3dedit.mapdata.signallist.group.add( jlmap3dedit.mapdata.signallist.list[num].mesh );
|
||||
jlmap3dedit.mapdata.signallist.group.add(jlmap3dedit.mapdata.signallist.list[num].mesh);
|
||||
jlmap3dedit.transcontrol.attach(jlmap3dedit.mapdata.signallist.list[num].mesh);
|
||||
jlmap3dedit.selectmodel = jlmap3dedit.mapdata.signallist.list[num].mesh;
|
||||
return jlmap3dedit.selectmodel;
|
||||
}
|
||||
//去除未加载资源并释放内存
|
||||
this.updatelist = function(){
|
||||
this.updatelist = function() {
|
||||
|
||||
}
|
||||
//创建新模型
|
||||
this.createmodel = function(){
|
||||
this.createmodel = function() {
|
||||
|
||||
}
|
||||
//创建新材质
|
||||
this.creatematerial = function(){
|
||||
this.creatematerial = function() {
|
||||
|
||||
}
|
||||
|
||||
function fbxload(asset){
|
||||
function fbxload(asset) {
|
||||
|
||||
var loader = new THREE.FBXLoader();
|
||||
loader.load( asset.assetUrl, function ( object ) {
|
||||
loader.load(asset.assetUrl, function(object) {
|
||||
|
||||
//object.scale.set(0.1,0.1,0.1);
|
||||
asset.mesh = object;
|
||||
|
||||
} );
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function fbxpromise(asset){
|
||||
return new Promise(function(resolve, reject){
|
||||
function fbxpromise(asset) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var loader = new THREE.FBXLoader();
|
||||
loader.load( asset.url, function ( object ) {
|
||||
let mixer = new THREE.AnimationMixer( object );
|
||||
loader.load(asset.url, function(object) {
|
||||
let mixer = new THREE.AnimationMixer(object);
|
||||
//object.traverse(function (node) {//获取其中对象
|
||||
// node.frustumCulled = true;
|
||||
//});
|
||||
|
||||
if(asset.deviceType == "train" ){
|
||||
if (asset.deviceType == "train") {
|
||||
|
||||
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){
|
||||
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+scope.trainoffset;
|
||||
object.children[i].position.x = object.children[i].position.x + scope.trainoffset;
|
||||
//object.children[i].position.y = j*10;
|
||||
realtrain.add(object.children[i]);
|
||||
i--;
|
||||
@ -607,35 +648,35 @@ export function AssetLoader(){
|
||||
asset.mesh = realtrain;
|
||||
asset.animations = object.animations[0].tracks;
|
||||
|
||||
}else{
|
||||
} else {
|
||||
asset.mesh = object;
|
||||
|
||||
}
|
||||
//object.scale.set(0.1,0.1,0.1);
|
||||
|
||||
resolve("fbxload");
|
||||
} );
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function fbxpromiseold(asset){
|
||||
return new Promise(function(resolve, reject){
|
||||
function fbxpromiseold(asset) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var loader = new THREE.FBXLoader();
|
||||
loader.load( asset.assetUrl, function ( object ) {
|
||||
let mixer = new THREE.AnimationMixer( object );
|
||||
loader.load(asset.assetUrl, function(object) {
|
||||
let mixer = new THREE.AnimationMixer(object);
|
||||
//object.traverse(function (node) {//获取其中对象
|
||||
// node.frustumCulled = true;
|
||||
//});
|
||||
asset.type = asset.deviceType;
|
||||
if(asset.deviceType == "train"){
|
||||
if (asset.deviceType == "train") {
|
||||
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){
|
||||
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+scope.trainoffset;
|
||||
object.children[i].position.x = object.children[i].position.x + scope.trainoffset;
|
||||
//object.children[i].position.y = j*10;
|
||||
realtrain.add(object.children[i]);
|
||||
i--;
|
||||
@ -645,40 +686,40 @@ export function AssetLoader(){
|
||||
asset.mesh = realtrain;
|
||||
asset.animations = object.animations[0].tracks;
|
||||
|
||||
}else{
|
||||
} else {
|
||||
asset.mesh = object;
|
||||
|
||||
}
|
||||
//object.scale.set(0.1,0.1,0.1);
|
||||
|
||||
resolve("fbxload");
|
||||
} );
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function fbxPromiseOver(asset){
|
||||
return new Promise(function(resolve, reject){
|
||||
function fbxPromiseOver(asset) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var loader = new THREE.FBXLoader();
|
||||
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
|
||||
let mixer = new THREE.AnimationMixer( object );
|
||||
loader.load(BASE_ASSET_API + asset.url, function(object) {
|
||||
let mixer = new THREE.AnimationMixer(object);
|
||||
//object.traverse(function (node) {//获取其中对象
|
||||
// node.frustumCulled = true;
|
||||
//});
|
||||
|
||||
if(asset.code){
|
||||
if (asset.code) {
|
||||
scope.modelgroup[asset.code] = object;
|
||||
}else{
|
||||
if(asset.type == "train" && object.children.length>4){
|
||||
} else {
|
||||
if (asset.type == "train" && object.children.length > 4) {
|
||||
|
||||
let realtrain = new THREE.Group();
|
||||
let j = object.children.length;
|
||||
for(j;j>0;j--){
|
||||
let name = "C"+j;
|
||||
for(let i=0;i<object.children.length;i++){
|
||||
if(object.children[i].name == name){
|
||||
for (j; 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+scope.trainoffset;
|
||||
object.children[i].position.x = object.children[i].position.x + scope.trainoffset;
|
||||
//object.children[i].position.y = j*10;
|
||||
realtrain.add(object.children[i]);
|
||||
i--;
|
||||
@ -688,12 +729,12 @@ export function AssetLoader(){
|
||||
asset.mesh = realtrain;
|
||||
asset.animations = object.animations[0].tracks;
|
||||
|
||||
}else if(asset.type == "train" && object.name == "C6"){
|
||||
} else if (asset.type == "train" && object.name == "C6") {
|
||||
let realtrain = new THREE.Group();
|
||||
object.position.x = object.position.x+scope.trainoffset;
|
||||
object.position.x = object.position.x + scope.trainoffset;
|
||||
realtrain.add(object);
|
||||
asset.mesh = realtrain;
|
||||
}else{
|
||||
} else {
|
||||
asset.mesh = object;
|
||||
|
||||
}
|
||||
@ -702,7 +743,7 @@ export function AssetLoader(){
|
||||
//object.scale.set(0.1,0.1,0.1);
|
||||
|
||||
resolve("fbxload");
|
||||
} );
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import {TdtList} from '@/jlmap3d/main/newmodel/TdtList.js';
|
||||
import { Loading } from 'element-ui';
|
||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
||||
|
||||
export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls,scene,mixerss){
|
||||
export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls,scene,mixerss,project){
|
||||
//console.log(mapdata);
|
||||
|
||||
//console.log(data);
|
||||
@ -81,11 +81,11 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
|
||||
}
|
||||
|
||||
|
||||
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,0,JSON.parse(netdata.assets).others);
|
||||
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,0,JSON.parse(netdata.assets).others,project);
|
||||
|
||||
assetloader.assetPromiseOver(sceneload)
|
||||
.then(function(data){
|
||||
return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"01",JSON.parse(netdata.assets).others);
|
||||
return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"01",JSON.parse(netdata.assets).others,project);
|
||||
})
|
||||
.then(function(data){
|
||||
return sectionlist.loadpromise(mapdata.sectionList,sectiondata.section,rails,scene,assetloader);
|
||||
|
@ -14,7 +14,7 @@ import store from '@/store/index';
|
||||
// import { Loading } from 'element-ui';
|
||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
||||
|
||||
export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,scene){
|
||||
export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,scene,project){
|
||||
//console.log(mapdata);
|
||||
|
||||
//console.log(data);
|
||||
@ -23,6 +23,8 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
let jlmap3ddata = mapdata;
|
||||
let assetloader = scope.assetloader;
|
||||
|
||||
let bgmodel = null;
|
||||
|
||||
let mixers = scope.mixers;
|
||||
let actions = scope.actions;
|
||||
|
||||
@ -48,7 +50,6 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
let mapdata = data;
|
||||
//初始化轨道和道岔
|
||||
// lengthfact(data);
|
||||
|
||||
sectionlist = new SectionListN();
|
||||
signallist = new SignalListN();
|
||||
switchlist = new SwitchListN();
|
||||
@ -76,7 +77,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
}
|
||||
}
|
||||
}
|
||||
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,1.3,JSON.parse(netdata.assets).others);
|
||||
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,1.3,JSON.parse(netdata.assets).others,project);
|
||||
// assetloader.setmodellistnew(netdata.assets);
|
||||
|
||||
|
||||
@ -86,7 +87,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
//console.log(data);
|
||||
//,netdata.stands,mixers,actions,"0"
|
||||
|
||||
return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"02",JSON.parse(netdata.assets).others);
|
||||
return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"02",JSON.parse(netdata.assets).others,project);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
@ -117,6 +118,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
if(scope.assetloader.modellist[mn].type == "suidao"){
|
||||
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
|
||||
scene.add(scope.assetloader.modellist[mn].mesh);
|
||||
bgmodel = scope.assetloader.modellist[mn].mesh;
|
||||
mn = scope.assetloader.modellist.length;
|
||||
}
|
||||
}
|
||||
@ -169,7 +171,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
|
||||
controls.upmodeldirect(stationstandlist,trainlisttest);
|
||||
controls.update();
|
||||
|
||||
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails);
|
||||
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,bgmodel);
|
||||
scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,tdt,scope.materiallist,scope.actions,scope.sceneload);
|
||||
scope.webwork.postMessage("on");
|
||||
scope.jsonwebworknew.postMessage("connect");
|
||||
|
@ -1,5 +1,9 @@
|
||||
import {StationStandModel} from '@/jlmap3d/main/newmodel/StationStandModel.js';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import {
|
||||
StationStandModel
|
||||
} from '@/jlmap3d/main/newmodel/StationStandModel.js';
|
||||
import {
|
||||
JL3D_LOCAL_STATIC
|
||||
} from '@/api/jlmap3d/assets3d.js';
|
||||
export function StationStandListN() {
|
||||
|
||||
let scope = this;
|
||||
@ -12,19 +16,19 @@ export function StationStandListN() {
|
||||
this.group.name = "station";
|
||||
this.textlist = [];
|
||||
|
||||
this.initpromise = function(stationdata,standsdata,psddata,scene,assetloader,mixers,actionss,mode){
|
||||
return new Promise(function(resolve, reject){
|
||||
this.initpromise = function(stationdata, standsdata, psddata, scene, assetloader, mixers, actionss, mode) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
let stations = stationdata;
|
||||
let selectmesh1;
|
||||
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].deviceType == "stand"){
|
||||
for (let j = 0; j < assetloader.modellist.length; j++) {
|
||||
if (assetloader.modellist[j].deviceType == "stand") {
|
||||
selectmesh1 = assetloader.modellist[j].mesh;
|
||||
}
|
||||
}
|
||||
|
||||
for(let i=0;i<standsdata.length;i++){
|
||||
for (let i = 0; i < standsdata.length; i++) {
|
||||
let newstationstand = new StationStandModel(standsdata[i]);
|
||||
|
||||
newstationstand.code = standsdata[i].code;
|
||||
@ -52,22 +56,22 @@ export function StationStandListN() {
|
||||
|
||||
scope.list[standsdata[i].code] = newstationstand;
|
||||
|
||||
let newclip = selectmesh1.animations[ 0 ];
|
||||
for(let j=0;j<newstationmesh.children.length;j++){
|
||||
let newclip = selectmesh1.animations[0];
|
||||
for (let j = 0; j < newstationmesh.children.length; j++) {
|
||||
|
||||
if(newstationmesh.children[j].name == "top"){
|
||||
if (newstationmesh.children[j].name == "top") {
|
||||
newstationmesh.children[j].animations = [];
|
||||
newstationmesh.children[j].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
|
||||
let mixer = new THREE.AnimationMixer(newstationmesh.children[j]);
|
||||
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
if(psddata[n].standCode == newstationstand.direction2.code){
|
||||
for (let n = 0; n < psddata.length; n++) {
|
||||
if (psddata[n].standCode == newstationstand.direction2.code) {
|
||||
|
||||
let key = psddata[n].code;
|
||||
actionss[key] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( newstationmesh.children[j].animations[0])
|
||||
status: "01",
|
||||
action: mixer.clipAction(newstationmesh.children[j].animations[0])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
@ -78,18 +82,18 @@ export function StationStandListN() {
|
||||
}
|
||||
|
||||
}
|
||||
if(newstationmesh.children[j].name == "down"){
|
||||
if (newstationmesh.children[j].name == "down") {
|
||||
newstationmesh.children[j].animations = [];
|
||||
newstationmesh.children[j].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
if(psddata[n].standCode == newstationstand.direction1.code){
|
||||
let mixer = new THREE.AnimationMixer(newstationmesh.children[j]);
|
||||
for (let n = 0; n < psddata.length; n++) {
|
||||
if (psddata[n].standCode == newstationstand.direction1.code) {
|
||||
|
||||
let key = psddata[n].code;
|
||||
actionss[key] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( newstationmesh.children[j].animations[0])
|
||||
status: "01",
|
||||
action: mixer.clipAction(newstationmesh.children[j].animations[0])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
@ -102,16 +106,21 @@ export function StationStandListN() {
|
||||
|
||||
}
|
||||
|
||||
if(mode){
|
||||
if(mode == "02"){
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
|
||||
if (mode) {
|
||||
if (mode == "02") {
|
||||
let textgeometry = new THREE.PlaneBufferGeometry(65, 90, 1);
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(stationdata[i]));
|
||||
|
||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
let textmaterial = new THREE.MeshBasicMaterial({
|
||||
side: THREE.DoubleSide,
|
||||
map: textt,
|
||||
transparent: true
|
||||
});
|
||||
let textplane = new THREE.Mesh(textgeometry, textmaterial);
|
||||
textplane.name = stationdata[i].code;
|
||||
textplane.modeltype = "textplane";
|
||||
textplane.position.y = 80;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
textplane.rotation.x = Math.PI / 2;
|
||||
//textplane.position.x = -30;
|
||||
scope.textlist.push(textplane);
|
||||
newstationmesh.add(textplane);
|
||||
@ -133,46 +142,73 @@ export function StationStandListN() {
|
||||
});
|
||||
|
||||
}
|
||||
this.loadpromise = function(stationdata,standsdata,psddata,scene,assetloader,mixers,actionss,mode,otherStation){
|
||||
return new Promise(function(resolve, reject){
|
||||
this.loadpromise = function(stationdata, standsdata, psddata, scene, assetloader, mixers, actionss, mode, otherStation, project) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
// console.log(standsdata);
|
||||
let stations = stationdata;
|
||||
let selectmesh1;
|
||||
let selectmesh2;
|
||||
let selectmesh3;
|
||||
let specilmesh;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
|
||||
let nologonc, nologowc, nologohc;
|
||||
|
||||
for (let j = 0; j < assetloader.modellist.length; j++) {
|
||||
// console.log(assetloader.modellist[j].type);
|
||||
if(assetloader.modellist[j].type == "stationInside"){
|
||||
if (assetloader.modellist[j].type == "stationInside") {
|
||||
selectmesh1 = assetloader.modellist[j].mesh;
|
||||
}
|
||||
if(assetloader.modellist[j].type == "stationOutside"){
|
||||
if (assetloader.modellist[j].type == "stationOutside") {
|
||||
selectmesh2 = assetloader.modellist[j].mesh;
|
||||
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
|
||||
}
|
||||
if(assetloader.modellist[j].type == "stationThree"){
|
||||
if (assetloader.modellist[j].type == "stationThree") {
|
||||
selectmesh3 = assetloader.modellist[j].mesh;
|
||||
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
|
||||
}
|
||||
if(assetloader.modellist[j].type == "spmxa"){
|
||||
if (assetloader.modellist[j].type == "spmxa") {
|
||||
specilmesh = assetloader.modellist[j].mesh;
|
||||
}
|
||||
|
||||
if (project == "nologo") {
|
||||
if (assetloader.modellist[j].type == "nologonc") {
|
||||
nologonc = assetloader.modellist[j].mesh;
|
||||
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
|
||||
}
|
||||
if (assetloader.modellist[j].type == "nologowc") {
|
||||
nologowc = assetloader.modellist[j].mesh;
|
||||
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
|
||||
}
|
||||
if (assetloader.modellist[j].type == "nologohc") {
|
||||
nologohc = assetloader.modellist[j].mesh;
|
||||
}
|
||||
}
|
||||
selectmesh1.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
if (project == "say") {
|
||||
if (assetloader.modellist[j].type == "nologonc") {
|
||||
nologonc = assetloader.modellist[j].mesh;
|
||||
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
|
||||
}
|
||||
if (assetloader.modellist[j].type == "nologohc") {
|
||||
nologohc = assetloader.modellist[j].mesh;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
selectmesh1.traverse(function(child) {
|
||||
|
||||
if (child.isMesh) {
|
||||
child.renderOrder = 9;
|
||||
}
|
||||
|
||||
} );
|
||||
selectmesh2.traverse( function ( child ) {
|
||||
});
|
||||
selectmesh2.traverse(function(child) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
if (child.isMesh) {
|
||||
child.renderOrder = 9;
|
||||
}
|
||||
|
||||
} );
|
||||
});
|
||||
// selectmesh3.traverse( function ( child ) {
|
||||
//
|
||||
// if ( child.isMesh ) {
|
||||
@ -182,19 +218,19 @@ export function StationStandListN() {
|
||||
// } );
|
||||
//新车门动画获取待定
|
||||
let allClear = 0;
|
||||
for(let j=0;j<standsdata.length;j++){
|
||||
for (let j = 0; j < standsdata.length; j++) {
|
||||
|
||||
allClear = 0;
|
||||
for(let i=0;i<psddata.length;i++){
|
||||
for (let i = 0; i < psddata.length; i++) {
|
||||
|
||||
for(let n=0;n<standsdata[j].stands.length;n++){
|
||||
if(psddata[i].standCode == standsdata[j].stands[n].code){
|
||||
for (let n = 0; n < standsdata[j].stands.length; n++) {
|
||||
if (psddata[i].standCode == standsdata[j].stands[n].code) {
|
||||
allClear++;
|
||||
standsdata[j].stands[n].position = psddata[i].position;
|
||||
}
|
||||
}
|
||||
|
||||
if(allClear == standsdata[j].stands.length){
|
||||
if (allClear == standsdata[j].stands.length) {
|
||||
standsdata[j].stands.sort(compare);
|
||||
i = psddata.length;
|
||||
}
|
||||
@ -203,7 +239,8 @@ export function StationStandListN() {
|
||||
//
|
||||
//
|
||||
// console.log(psddata);
|
||||
for(let i=0;i<standsdata.length;i++){
|
||||
|
||||
for (let i = 0; i < standsdata.length; i++) {
|
||||
|
||||
|
||||
let newstationstand = new StationStandModel(standsdata[i]);
|
||||
@ -221,47 +258,82 @@ export function StationStandListN() {
|
||||
// newstationstand.direction2.name = standsdata[i].direction2.name;
|
||||
// newstationstand.direction2.screenDoorOpenStatus = "01";
|
||||
let newstationmesh = null;
|
||||
let newclip =null;
|
||||
let newclip = null;
|
||||
|
||||
let nowModelType = "normal";
|
||||
|
||||
if(otherStation){
|
||||
for(let o=0;o<otherStation.length;o++){
|
||||
if(standsdata[i].code == otherStation[o].code){
|
||||
let selectmeshother = assetloader.modelgroup[ otherStation[o].code];
|
||||
if (otherStation) {
|
||||
for (let o = 0; o < otherStation.length; o++) {
|
||||
if (standsdata[i].code == otherStation[o].code) {
|
||||
let selectmeshother = assetloader.modelgroup[otherStation[o].code];
|
||||
newstationmesh = selectmeshother;
|
||||
newclip = selectmeshother.animations[ 0 ];
|
||||
newclip = selectmeshother.animations[0];
|
||||
nowModelType = "specil";
|
||||
newstationmesh.traverse( function ( child ) {
|
||||
newstationmesh.traverse(function(child) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
if (child.isMesh) {
|
||||
child.renderOrder = 9;
|
||||
}
|
||||
|
||||
} );
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if(nowModelType == "normal"){
|
||||
if(standsdata[i].stands.length<=2){
|
||||
if(standsdata[i].inside == undefined){
|
||||
if (nowModelType == "normal") {
|
||||
if (standsdata[i].stands.length <= 2) {
|
||||
|
||||
if (standsdata[i].inside == undefined) {
|
||||
newstationmesh = selectmesh1.clone(true);
|
||||
newclip = selectmesh1.animations[ 0 ];
|
||||
}else if(standsdata[i].inside == true){
|
||||
newclip = selectmesh1.animations[0];
|
||||
} else if (standsdata[i].inside == true) {
|
||||
newstationmesh = selectmesh1.clone(true);
|
||||
newclip = selectmesh1.animations[ 0 ];
|
||||
}else{
|
||||
newclip = selectmesh1.animations[0];
|
||||
} else {
|
||||
newstationmesh = selectmesh2.clone(true);
|
||||
newclip = selectmesh2.animations[ 0 ];
|
||||
newclip = selectmesh2.animations[0];
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
newstationmesh = selectmesh3.clone(true);
|
||||
newclip = selectmesh3.animations[ 0 ];
|
||||
newclip = selectmesh3.animations[0];
|
||||
}
|
||||
|
||||
if(standsdata[i].code == "Station17596"){
|
||||
if (standsdata[i].code == "Station17596") {
|
||||
newstationmesh = specilmesh.clone(true);
|
||||
newclip = specilmesh.animations[ 0 ];
|
||||
newclip = specilmesh.animations[0];
|
||||
}
|
||||
|
||||
if (project == "nologo") {
|
||||
if (i == 1) {
|
||||
newstationmesh = nologohc.clone(true);
|
||||
newclip = nologohc.animations[0];
|
||||
}
|
||||
if (i == 2) {
|
||||
newstationmesh = selectmesh2.clone(true);
|
||||
newclip = selectmesh2.animations[0];
|
||||
}
|
||||
if (i == 3) {
|
||||
newstationmesh = nologonc.clone(true);
|
||||
newclip = nologonc.animations[0];
|
||||
}
|
||||
if (i == 4) {
|
||||
newstationmesh = nologowc.clone(true);
|
||||
newclip = nologowc.animations[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (project == "say") {
|
||||
if (i == 1) {
|
||||
newstationmesh = nologohc.clone(true);
|
||||
newclip = nologohc.animations[0];
|
||||
}
|
||||
if (i == 3) {
|
||||
newstationmesh = nologonc.clone(true);
|
||||
newclip = nologonc.animations[0];
|
||||
}
|
||||
if (i == 4) {
|
||||
newstationmesh = nologonc.clone(true);
|
||||
newclip = nologonc.animations[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,24 +354,25 @@ export function StationStandListN() {
|
||||
//
|
||||
scope.list[standsdata[i].code] = newstationstand;
|
||||
//
|
||||
for(let j=0;j<standsdata[i].stands.length;j++){
|
||||
let num = j+1;
|
||||
for (let j = 0; j < standsdata[i].stands.length; j++) {
|
||||
let num = j + 1;
|
||||
|
||||
let addAnimaMesh = newstationmesh.getObjectByName('door'+num);
|
||||
let addAnimaMesh = newstationmesh.getObjectByName('door' + num);
|
||||
|
||||
if(addAnimaMesh){
|
||||
newstationmesh.getObjectByName('door'+num).animations = [];
|
||||
newstationmesh.getObjectByName('door'+num).animations.push(newclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newstationmesh.getObjectByName('door'+num) );
|
||||
if (addAnimaMesh) {
|
||||
newstationmesh.getObjectByName('door' + num).animations = [];
|
||||
if (newclip) {
|
||||
newstationmesh.getObjectByName('door' + num).animations.push(newclip.clone());
|
||||
let mixer = new THREE.AnimationMixer(newstationmesh.getObjectByName('door' + num));
|
||||
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
for (let n = 0; n < psddata.length; n++) {
|
||||
|
||||
if(psddata[n].standCode == standsdata[i].stands[j].code){
|
||||
if (psddata[n].standCode == standsdata[i].stands[j].code) {
|
||||
|
||||
let key = psddata[n].code;
|
||||
actionss[key] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( newstationmesh.getObjectByName('door'+num).animations[0])
|
||||
status: "01",
|
||||
action: mixer.clipAction(newstationmesh.getObjectByName('door' + num).animations[0])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
@ -314,17 +387,23 @@ export function StationStandListN() {
|
||||
|
||||
}
|
||||
|
||||
if(mode){
|
||||
if(mode == "02"){
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
|
||||
}
|
||||
|
||||
if (mode) {
|
||||
if (mode == "02") {
|
||||
let textgeometry = new THREE.PlaneBufferGeometry(65, 90, 1);
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(standsdata[i]));
|
||||
|
||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
let textmaterial = new THREE.MeshBasicMaterial({
|
||||
side: THREE.DoubleSide,
|
||||
map: textt,
|
||||
transparent: true
|
||||
});
|
||||
let textplane = new THREE.Mesh(textgeometry, textmaterial);
|
||||
textplane.name = standsdata[i].code;
|
||||
|
||||
textplane.modeltype = "textplane";
|
||||
textplane.position.y = 70;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
textplane.rotation.x = Math.PI / 2;
|
||||
textplane.position.z = 80;
|
||||
scope.textlist.push(textplane);
|
||||
newstationmesh.add(textplane);
|
||||
@ -344,7 +423,7 @@ export function StationStandListN() {
|
||||
|
||||
}
|
||||
}
|
||||
var compare = function (obj1, obj2) {
|
||||
var compare = function(obj1, obj2) {
|
||||
var val1 = obj1.position.y;
|
||||
var val2 = obj2.position.y;
|
||||
if (val1 < val2) {
|
||||
@ -358,8 +437,9 @@ var compare = function (obj1, obj2) {
|
||||
//canvas文字贴图方法
|
||||
//PS:待提炼 增强功能
|
||||
var stationcanvas = new Image();
|
||||
stationcanvas.src = JL3D_LOCAL_STATIC+"/texture/msgtnew.png";
|
||||
function getTextCanvas(text){
|
||||
stationcanvas.src = JL3D_LOCAL_STATIC + "/texture/msgtnew.png";
|
||||
|
||||
function getTextCanvas(text) {
|
||||
let canvas = document.getElementById('canvastexture');
|
||||
|
||||
canvas.width = 128;
|
||||
@ -369,27 +449,27 @@ function getTextCanvas(text){
|
||||
|
||||
let ctx = canvas.getContext('2d');
|
||||
//ctx.fillStyle = '#FFFFFF';
|
||||
ctx.fillRect(0, 0,128,256);
|
||||
ctx.fillRect(0, 0, 128, 256);
|
||||
|
||||
ctx.fillStyle = '#FFFFFF';
|
||||
// ctx.textAlign = 'center';
|
||||
// ctx.textBaseline = 'middle';
|
||||
ctx.clearRect(0,0,128,256);
|
||||
ctx.clearRect(0, 0, 128, 256);
|
||||
|
||||
ctx.drawImage(stationcanvas,0,0,128,256);
|
||||
ctx.drawImage(stationcanvas, 0, 0, 128, 256);
|
||||
|
||||
ctx.font = "10px";
|
||||
ctx.fillText("车站: "+text.name, 15,25);
|
||||
ctx.fillText("车站: " + text.name, 15, 25);
|
||||
|
||||
ctx.fillText("漫游", 18,48);
|
||||
ctx.fillText("信息", 54,48);
|
||||
ctx.fillText("备忘", 93,48);
|
||||
ctx.fillText("漫游", 18, 48);
|
||||
ctx.fillText("信息", 54, 48);
|
||||
ctx.fillText("备忘", 93, 48);
|
||||
|
||||
ctx.fillText("车站序号: "+text.name, 10,115);
|
||||
ctx.fillText("车站序号: " + text.name, 10, 115);
|
||||
|
||||
ctx.fillText("公里标记:",10 ,135);
|
||||
ctx.fillText(text.kmPost,10 ,155);
|
||||
ctx.fillText("公里标记:", 10, 135);
|
||||
ctx.fillText(text.kmPost, 10, 155);
|
||||
|
||||
let data = ctx.getImageData(0, 0,128,256);
|
||||
let data = ctx.getImageData(0, 0, 128, 256);
|
||||
return data;
|
||||
}
|
||||
|
529
src/jlmap3d/otherproject/xzexam/component/moveanimate.js
Normal file
529
src/jlmap3d/otherproject/xzexam/component/moveanimate.js
Normal file
@ -0,0 +1,529 @@
|
||||
//转辙机动画
|
||||
export function Moveanimate(main){
|
||||
let scope = this;
|
||||
//内容信息显示plane
|
||||
this.helpbox = null;
|
||||
this.textplane = null;
|
||||
//动画列表
|
||||
this.animatelist = [];
|
||||
this.playlist = null;
|
||||
this.playorder = 0;
|
||||
//动画播放器开关
|
||||
this.enable = true;
|
||||
//动画开关状态
|
||||
this.status = true;
|
||||
//当前动画模型
|
||||
this.nowmodelname = undefined;
|
||||
|
||||
//定义屏蔽门零件动画
|
||||
|
||||
this.initDoorAnima = function(animaModel){
|
||||
scope.animatelist[animaModel.animacode+"chaijie"] = [];
|
||||
scope.animatelist[animaModel.animacode+"fuwei"] = [];
|
||||
for(let i=0,leni=animaModel.children.length;i<leni;i++){
|
||||
if(animaModel.children[i].name == "SJZZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+10));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"dizuoon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+10));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"dizuooff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "HLGJZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+8));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"Lxingon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+8));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"Lxingoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "HLGJY"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+8));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"jiaoxingxiantieon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+8));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"jiaoxingxiantieoff",points2,0.5,true,0);
|
||||
}
|
||||
|
||||
if(animaModel.children[i].name == "PDJ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+6));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"zhongchuipianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.xx,animaModel.children[i].position.y+4,animaModel.children[i].position.z+6));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"zhongchuipianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "PDJ1"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+6));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"laganon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+6));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"laganoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "HLZZZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+4));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"dongjiedianzhouon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+4));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"dongjiedianzhouoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "HLZZY"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+4));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"neibuon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+4,animaModel.children[i].position.z+4));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"neibuoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "CLPD"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z+4));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"jiedianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z+4));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"jiedianoff",points2,0.5,true,0);
|
||||
|
||||
}
|
||||
if(animaModel.children[i].name == "LCB"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+8,animaModel.children[i].position.z+2));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"yapianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+8,animaModel.children[i].position.z+2));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"yapianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "DCU"){
|
||||
let points1 = [];
|
||||
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+8,animaModel.children[i].position.z+2));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"fanghuozhaoon",points1,0.5,true,0);
|
||||
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+8,animaModel.children[i].position.z+2));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"fanghuozhaooff",points2,0.5,true,0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// let points = [];
|
||||
// points.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
// points.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
// scope.initanimate(animaModel.children[i],animaModel.name+"select1",points,true);
|
||||
let modelorderlist = [];
|
||||
|
||||
modelorderlist[animaModel.animacode] = [
|
||||
{name:"SJZZ",pos:[0,4,10]},
|
||||
{name:"HLGJZ",pos:[0,4,8]},
|
||||
{name:"HLGJY",pos:[0,4,8]},
|
||||
{name:"PDJ",pos:[0,4,6]},
|
||||
{name:"PDJ1",pos:[0,4,6]},
|
||||
{name:"HLZZZ",pos:[0,4,4]},
|
||||
{name:"HLZZY",pos:[0,4,4]},
|
||||
{name:"CLPD",pos:[0,6,4]},
|
||||
{name:"LCB",pos:[0,8,2]},
|
||||
{name:"DCU",pos:[0,8,2]},
|
||||
];
|
||||
|
||||
scope.animatelist[animaModel.animacode+"on"] = [];
|
||||
scope.animatelist[animaModel.animacode+"off"] = [];
|
||||
|
||||
for(let i=0,leni=modelorderlist[animaModel.animacode].length;i<leni;i++){
|
||||
|
||||
let orderdata = modelorderlist[animaModel.animacode];
|
||||
let modelon = animaModel.getObjectByName(orderdata[i].name);
|
||||
// modelon.helpbox = undefined;
|
||||
let pointson = [];
|
||||
pointson.push(new THREE.Vector3(modelon.position.x,modelon.position.y,modelon.position.z));
|
||||
pointson.push(new THREE.Vector3(modelon.position.x+orderdata[i].pos[0],modelon.position.y+orderdata[i].pos[1],modelon.position.z+orderdata[i].pos[2]));
|
||||
|
||||
let pointsoff = [];
|
||||
pointsoff.push(new THREE.Vector3(modelon.position.x+orderdata[i].pos[0],modelon.position.y+orderdata[i].pos[1],modelon.position.z+orderdata[i].pos[2]));
|
||||
pointsoff.push(new THREE.Vector3(modelon.position.x,modelon.position.y,modelon.position.z));
|
||||
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"on"],modelon,animaModel.animacode+modelon.name+"on",pointson,0.03,true,i);
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"off"],modelon,animaModel.animacode+modelon.name+"off",pointsoff,0.03,true,leni-i-1);
|
||||
|
||||
}
|
||||
}
|
||||
//定义转辙机零件动画
|
||||
this.initSwitchAnima = function(animaModel){
|
||||
scope.animatelist[animaModel.animacode+"chaijie"] = [];
|
||||
scope.animatelist[animaModel.animacode+"fuwei"] = [];
|
||||
for(let i=0,leni=animaModel.children.length;i<leni;i++){
|
||||
if(animaModel.children[i].name == "DDJ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x-1.5,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"dizuoon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x-1.5,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"dizuooff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "DJZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x-3,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"Lxingon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x-3,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"Lxingoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "DINGK"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+9,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"jiaoxingxiantieon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+9,animaModel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"jiaoxingxiantieoff",points2,0.5,true,0);
|
||||
}
|
||||
|
||||
if(animaModel.children[i].name == "SZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x-1.5,animaModel.children[i].position.y,animaModel.children[i].position.z-1));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"zhongchuipianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.xx-1.5,animaModel.children[i].position.y,animaModel.children[i].position.z-1));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"zhongchuipianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "JSQ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x-3,animaModel.children[i].position.y+3,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"laganon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x-3,animaModel.children[i].position.y+3,animaModel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"laganoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "YWJCQ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z+3));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"dongjiedianzhouon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z+3));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"dongjiedianzhouoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "ESWCJJ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"neibuon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"neibuoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "AQJD"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z-2));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"jiedianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z-2));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"jiedianoff",points2,0.5,true,0);
|
||||
|
||||
}
|
||||
if(animaModel.children[i].name == "QDP"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z-3));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"yapianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z-3));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"yapianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "SDP"){
|
||||
let points1 = [];
|
||||
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z-4));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"fanghuozhaoon",points1,0.5,true,0);
|
||||
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z-4));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"fanghuozhaooff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "ZDKBQ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+3,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"dianyuanpianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+3,animaModel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"dianyuanpianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name == "ZZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x+3,animaModel.children[i].position.y+3,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"xinpianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x+3,animaModel.children[i].position.y+3,animaModel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"xinpianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name =="BSG"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x+1,animaModel.children[i].position.y,animaModel.children[i].position.z-5));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"jueyuanzhouon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x+1,animaModel.children[i].position.y,animaModel.children[i].position.z-5));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"jueyuanzhouoff",points2,0.5,true,0);
|
||||
}
|
||||
if(animaModel.children[i].name =="DZG"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x-1,animaModel.children[i].position.y,animaModel.children[i].position.z-5));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"cigangon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x-1,animaModel.children[i].position.y,animaModel.children[i].position.z-5));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"cigangoff",points2,0.5,true,0);
|
||||
}
|
||||
|
||||
if(animaModel.children[i].name =="CTK"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"chaijie"],animaModel.children[i],animaModel.name+"ccichuihuqion",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y+6,animaModel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"fuwei"],animaModel.children[i],animaModel.name+"ccichuihuqioff",points2,0.5,true,0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// let points = [];
|
||||
// points.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
// points.push(new THREE.Vector3(animaModel.children[i].position.x,animaModel.children[i].position.y,animaModel.children[i].position.z));
|
||||
// scope.initanimate(animaModel.children[i],animaModel.name+"select1",points,true);
|
||||
let modelorderlist = [];
|
||||
|
||||
modelorderlist[animaModel.animacode] = [
|
||||
{name:"SZ",pos:[-1.5,0,-1]},
|
||||
{name:"DINGK",pos:[0,9,0]},
|
||||
|
||||
{name:"DJZ",pos:[-3,0,0]},
|
||||
{name:"DDJ",pos:[-1.5,0,0]},
|
||||
|
||||
{name:"JSQ",pos:[-3,3,0]},
|
||||
|
||||
{name:"ZDKBQ",pos:[0,3,0]},
|
||||
{name:"ZZ",pos:[3,3,0]},
|
||||
|
||||
{name:"ESWCJJ",pos:[0,6,0]},
|
||||
{name:"CTK",pos:[0,6,0]},
|
||||
{name:"YWJCQ",pos:[0,6,3]},
|
||||
{name:"AQJD",pos:[0,6,-2]},
|
||||
{name:"QDP",pos:[0,6,-3]},
|
||||
{name:"SDP",pos:[0,6,-4]},
|
||||
|
||||
{name:"BSG",pos:[1,0,-5]},
|
||||
{name:"DZG",pos:[-1,0,-5]}
|
||||
];
|
||||
|
||||
scope.animatelist[animaModel.animacode+"on"] = [];
|
||||
scope.animatelist[animaModel.animacode+"off"] = [];
|
||||
|
||||
for(let i=0,leni=modelorderlist[animaModel.animacode].length;i<leni;i++){
|
||||
|
||||
let orderdata = modelorderlist[animaModel.animacode];
|
||||
let modelon = animaModel.getObjectByName(orderdata[i].name);
|
||||
// modelon.helpbox = undefined;
|
||||
let pointson = [];
|
||||
pointson.push(new THREE.Vector3(modelon.position.x,modelon.position.y,modelon.position.z));
|
||||
pointson.push(new THREE.Vector3(modelon.position.x+orderdata[i].pos[0],modelon.position.y+orderdata[i].pos[1],modelon.position.z+orderdata[i].pos[2]));
|
||||
|
||||
let pointsoff = [];
|
||||
pointsoff.push(new THREE.Vector3(modelon.position.x+orderdata[i].pos[0],modelon.position.y+orderdata[i].pos[1],modelon.position.z+orderdata[i].pos[2]));
|
||||
pointsoff.push(new THREE.Vector3(modelon.position.x,modelon.position.y,modelon.position.z));
|
||||
|
||||
// if(i == 0){
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"on"],modelon,animaModel.animacode+modelon.name+"on",pointson,0.03,true,i);
|
||||
scope.initanimate(scope.animatelist[animaModel.animacode+"off"],modelon,animaModel.animacode+modelon.name+"off",pointsoff,0.03,true,leni-i-1);
|
||||
// }else if((i+1)<leni){
|
||||
// scope.initanimate(modelon,animaModel.animacode+modelon.name+"on",pointson,0.03,true,animaModel.animacode+orderdata[i+1].name+"on");
|
||||
// scope.initanimate(modelon,animaModel.animacode+modelon.name+"off",pointsoff,0.03,true,animaModel.animacode+orderdata[i-1].name+"off");
|
||||
// }else{
|
||||
// scope.initanimate(modelon,animaModel.animacode+modelon.name+"on",pointson,0.03,true);
|
||||
// scope.initanimate(modelon,animaModel.animacode+modelon.name+"off",pointsoff,0.03,true,animaModel.animacode+orderdata[i-1].name+"off");
|
||||
// }
|
||||
|
||||
// if(animaModel.children[i].name == "xinpian"){
|
||||
// }
|
||||
// if(animaModel.children[i].name =="cigang"){
|
||||
// }
|
||||
}
|
||||
}
|
||||
//动画对象定义
|
||||
this.initanimate = function(list,modelobject,name,points,speed,type,nextname){
|
||||
|
||||
let curve = new THREE.CatmullRomCurve3(points);
|
||||
// curve动画轨迹
|
||||
// progress动画进度
|
||||
// enable当前动画开关
|
||||
// speed动画速度
|
||||
let animate = {
|
||||
name:name,
|
||||
curve:curve,
|
||||
progress:0,
|
||||
directchange:false,
|
||||
connectmodel:modelobject,
|
||||
enable:false,
|
||||
status:"start",
|
||||
speed:speed,
|
||||
next:null
|
||||
};
|
||||
// list[nextname] = [];
|
||||
if(list[nextname] == undefined){
|
||||
list[nextname] = [];
|
||||
}
|
||||
list[nextname].push(animate);
|
||||
|
||||
}
|
||||
|
||||
//设置动画播放列表
|
||||
this.setplaylist = function(nowlist,enable){
|
||||
|
||||
scope.playlist = nowlist;
|
||||
scope.enable = enable;
|
||||
scope.playorder = 0;
|
||||
for(let i=0;i<scope.playlist[scope.playorder].length;i++){
|
||||
scope.playlist[scope.playorder][i].status = "start";
|
||||
}
|
||||
}
|
||||
|
||||
//更新信息plane内容
|
||||
this.updatehelpbox = function(nowhelpbox,nowtextplane){
|
||||
scope.textplane = nowtextplane;
|
||||
scope.helpbox = nowhelpbox;
|
||||
}
|
||||
|
||||
this.startstop = function(){
|
||||
|
||||
}
|
||||
|
||||
this.next = function(){
|
||||
|
||||
}
|
||||
|
||||
this.before = function(){
|
||||
|
||||
}
|
||||
|
||||
//动画播放器
|
||||
this.animateupdate = function(){
|
||||
|
||||
if(scope.enable){
|
||||
if(scope.playlist){
|
||||
|
||||
for(let i=0;i<scope.playlist[scope.playorder].length;i++){
|
||||
if(scope.playlist[scope.playorder][i].status == "start"){
|
||||
|
||||
}
|
||||
if(scope.playlist[scope.playorder][i].progress>=1){
|
||||
let point = scope.playlist[scope.playorder][i].curve.getPointAt(1);
|
||||
//更新模型坐标
|
||||
scope.playlist[scope.playorder][i].connectmodel.position.x = point.x;
|
||||
scope.playlist[scope.playorder][i].connectmodel.position.y = point.y;
|
||||
scope.playlist[scope.playorder][i].connectmodel.position.z = point.z;
|
||||
scope.playlist[scope.playorder][i].enable = false;
|
||||
scope.playlist[scope.playorder][i].status = "end";
|
||||
scope.playlist[scope.playorder][i].progress = 0;
|
||||
|
||||
if(i >= scope.playlist[scope.playorder].length-1){
|
||||
if(scope.playorder >= scope.playlist.length-1 ){
|
||||
scope.playlist = null;
|
||||
scope.status = true;
|
||||
scope.enable = false;
|
||||
main.animationmsgshowoff();
|
||||
scope.nowmodelname = undefined;
|
||||
scope.playorder = null;
|
||||
break;
|
||||
}else{
|
||||
scope.playorder += 1;
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
// console.log(scope.animatelist[k].connectmodel);
|
||||
if(scope.nowmodelname != scope.playlist[scope.playorder][i].connectmodel.name){
|
||||
scope.nowmodelname = scope.playlist[scope.playorder][i].connectmodel.name;
|
||||
main.animationmsgshowon(scope.playlist[scope.playorder][i].connectmodel);
|
||||
}
|
||||
//根据动画进度获取动画轨迹上点
|
||||
scope.status = false;
|
||||
let point = scope.playlist[scope.playorder][i].curve.getPointAt(scope.playlist[scope.playorder][i].progress);
|
||||
|
||||
//更新模型坐标
|
||||
scope.playlist[scope.playorder][i].connectmodel.position.x = point.x;
|
||||
scope.playlist[scope.playorder][i].connectmodel.position.y = point.y;
|
||||
scope.playlist[scope.playorder][i].connectmodel.position.z = point.z;
|
||||
|
||||
if(scope.helpbox){
|
||||
scope.helpbox.update();
|
||||
}
|
||||
if(scope.textplane){
|
||||
|
||||
scope.textplane.position.x = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[12];
|
||||
scope.textplane.position.y = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[13]+100;
|
||||
scope.textplane.position.z = scope.playlist[scope.playorder][i].connectmodel.matrixWorld.elements[14];
|
||||
}
|
||||
//判断模型转向
|
||||
if(scope.playlist[scope.playorder][i].directchange){
|
||||
let tangent = scope.playlist[scope.playorder][i].curve.getPointAt(scope.playlist[scope.playorder][i].progress+0.001);
|
||||
// scope.animatelist[k]
|
||||
tangent = null;
|
||||
}
|
||||
//增加动画进度,释放点变量
|
||||
scope.playlist[scope.playorder][i].progress += scope.playlist[scope.playorder][i].speed;
|
||||
point = null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
38
src/jlmap3d/otherproject/xzexam/component/signallight.js
Normal file
38
src/jlmap3d/otherproject/xzexam/component/signallight.js
Normal file
@ -0,0 +1,38 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
//信号机贴图
|
||||
export function Signallightload(lights) {
|
||||
|
||||
settexture(lights, "red", JL3D_LOCAL_STATIC+'/device/signal/1.jpg');
|
||||
|
||||
settexture(lights, "yellow", JL3D_LOCAL_STATIC+'/device/signal/2.jpg');
|
||||
|
||||
settexture(lights, "green", JL3D_LOCAL_STATIC+'/device/signal/3.jpg');
|
||||
|
||||
settexture(lights, "black", JL3D_LOCAL_STATIC+'/device/signal/4.jpg');
|
||||
}
|
||||
|
||||
//加载贴图
|
||||
function settexture(lights, name, textureurl) {
|
||||
var loader = new THREE.TextureLoader();
|
||||
|
||||
// 加载一个资源
|
||||
loader.load(
|
||||
// 资源URL
|
||||
textureurl,
|
||||
|
||||
// onLoad回调
|
||||
function (texture) {
|
||||
texture.name = name;
|
||||
lights[name] = texture;
|
||||
},
|
||||
|
||||
// 目前暂不支持onProgress的回调
|
||||
undefined,
|
||||
|
||||
// onError回调
|
||||
function (err) {
|
||||
console.error('An error happened.');
|
||||
}
|
||||
);
|
||||
}
|
204
src/jlmap3d/otherproject/xzexam/component/textconfig.js
Normal file
204
src/jlmap3d/otherproject/xzexam/component/textconfig.js
Normal file
@ -0,0 +1,204 @@
|
||||
|
||||
export function Textconfig(){
|
||||
let scope = this;
|
||||
|
||||
this.devicelist = [];
|
||||
|
||||
|
||||
//配置继电器文字信息
|
||||
this.initdevicetext = function(selectmodel){
|
||||
if(scope.devicelist.length>0){
|
||||
scope.devicelist = [];
|
||||
}
|
||||
console.log(selectmodel.deviceType);
|
||||
if(selectmodel.deviceType == "DeviceSwitch"){
|
||||
initSwitchText(selectmodel);
|
||||
}
|
||||
if(selectmodel.deviceType == "DeviceDoor"){
|
||||
initDoorText(selectmodel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function initDoorText(selectmodel){
|
||||
for(let i=0,leni=selectmodel.children.length;i<leni;i++){
|
||||
let part= {
|
||||
name:selectmodel.children[i].name,
|
||||
text:null,
|
||||
mesh:selectmodel.children[i],
|
||||
index:i,
|
||||
show:true,
|
||||
msg:null,
|
||||
};
|
||||
|
||||
|
||||
|
||||
if(selectmodel.children[i].name == "HLGJZ"){
|
||||
part.text = "滑轮挂件左";
|
||||
part.msg = "滑轮挂件左";
|
||||
selectmodel.children[i].text = "滑轮挂件左";
|
||||
}
|
||||
if(selectmodel.children[i].name == "HLGJY"){
|
||||
part.text = "滑轮挂件右";
|
||||
part.msg = "滑轮挂件右";
|
||||
selectmodel.children[i].text = "滑轮挂件右";
|
||||
}
|
||||
if(selectmodel.children[i].name == "HLZZZ"){
|
||||
part.text = "滑轮装置左";
|
||||
part.msg = "滑轮装置左";
|
||||
selectmodel.children[i].text = "滑轮装置左";
|
||||
}
|
||||
if(selectmodel.children[i].name == "HLZZY"){
|
||||
part.text = "滑轮装置右";
|
||||
part.msg = "滑轮装置右";
|
||||
selectmodel.children[i].text = "滑轮装置右";
|
||||
}
|
||||
if(selectmodel.children[i].name == "CLPD"){
|
||||
part.text = "齿轮皮带";
|
||||
part.msg = "齿轮皮带";
|
||||
selectmodel.children[i].text = "齿轮皮带";
|
||||
}
|
||||
if(selectmodel.children[i].name == "SJZZ"){
|
||||
part.text = "锁紧装置";
|
||||
part.msg = "锁紧装置";
|
||||
selectmodel.children[i].text = "锁紧装置";
|
||||
}
|
||||
if(selectmodel.children[i].name == "DCU"){
|
||||
part.text = "门控单元";
|
||||
part.msg = "门控单元";
|
||||
selectmodel.children[i].text = "门控单元";
|
||||
}
|
||||
if(selectmodel.children[i].name == "MJL"){
|
||||
part.text = "门机梁";
|
||||
part.msg = "门机梁";
|
||||
selectmodel.children[i].text = "门机梁";
|
||||
}
|
||||
if(selectmodel.children[i].name =="LCB"){
|
||||
part.text = "就地控制盒";
|
||||
part.msg = "就地控制盒";
|
||||
selectmodel.children[i].text = "就地控制盒";
|
||||
}
|
||||
|
||||
if(selectmodel.children[i].name =="PDJ"){
|
||||
part.text = "皮带夹左";
|
||||
part.msg = "皮带夹左";
|
||||
selectmodel.children[i].text = "皮带夹左";
|
||||
}
|
||||
|
||||
if(selectmodel.children[i].name =="PDJ1"){
|
||||
part.text = "皮带夹右";
|
||||
part.msg = "皮带夹右";
|
||||
selectmodel.children[i].text = "皮带夹右";
|
||||
}
|
||||
|
||||
|
||||
// if(part.text == null){
|
||||
// console.log(selectmodel.children[i].name);
|
||||
// }
|
||||
if(part.text){
|
||||
scope.devicelist.push(part);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function initSwitchText(selectmodel){
|
||||
for(let i=0,leni=selectmodel.children.length;i<leni;i++){
|
||||
let part= {
|
||||
name:selectmodel.children[i].name,
|
||||
text:null,
|
||||
mesh:selectmodel.children[i],
|
||||
index:i,
|
||||
show:true,
|
||||
msg:null,
|
||||
};
|
||||
if(selectmodel.children[i].name == "AQJD"){
|
||||
part.text = "安全接点";
|
||||
part.msg = "安全接点应接触良好。在插入手摇把或钥匙时,安全接点应可靠断开,非经人工恢复不得接通电路。";
|
||||
selectmodel.children[i].text = "安全接点";
|
||||
}
|
||||
if(selectmodel.children[i].name == "DDJ"){
|
||||
part.text = "电动机";
|
||||
part.msg = "电动转辙机的电动机在转辙机转换时起机械传动动作源的作用。";
|
||||
selectmodel.children[i].text = "电动机";
|
||||
}
|
||||
if(selectmodel.children[i].name == "DINGK"){
|
||||
part.text = "机盖";
|
||||
part.msg = "用于防护机内零部件。";
|
||||
selectmodel.children[i].text = "机盖";
|
||||
}
|
||||
if(selectmodel.children[i].name == "SZ"){
|
||||
part.text = "锁";
|
||||
part.msg = "用于将机盖锁在底壳上,并用专用钥匙才能打开。最早锁是从底壳内紧固,机外无法拆卸,但由于加工质量及其他原因导致无法开盖,故目前已改为从底壳外紧固。";
|
||||
selectmodel.children[i].text = "锁";
|
||||
}
|
||||
if(selectmodel.children[i].name == "YWJCQ"){
|
||||
part.text = "移位接触器";
|
||||
part.msg = "移位接触器是一只非复式辙动开关,它有一组常闭接点,在转辙机中位于机壳侧壁齿条块顶杆的上方。它的作用是用它的常闭接点窜联在道岔表示电路中,监督主挤切削的状态是否完好,在道岔被挤时,如果表示杆被推或拉的动慢不足,检查柱未被顶起,而主副挤切销被挤断,动作杆在齿条块内位移,导致顶杆上升,使位移接点断开,切断转辙机表示电路,向行车值班员报警";
|
||||
selectmodel.children[i].text = "移位接触器";
|
||||
}
|
||||
if(selectmodel.children[i].name == "ZDKBQ"){
|
||||
part.text = "自动开闭器";
|
||||
part.msg = "1.构成转辙机启动电路后,在转换过程中,以其机械动作构成两次接点变位,监督转辙机转换全过程动作是否按要求完成。2.道岔被挤时,表示杆移动将检查柱顶起,使自动开闭器一排动接点离开静接点,从而切断道岔表示电路。";
|
||||
selectmodel.children[i].text = "自动开闭器";
|
||||
}
|
||||
if(selectmodel.children[i].name == "SDP"){
|
||||
part.text = "速动片";
|
||||
part.msg = "速动片的作用是检查主轴解锁、转换和锁闭三个动作过程的完成,并最后使自动开闭器迅速切断电机动作电路,接通表示电路。";
|
||||
selectmodel.children[i].text = "速动片";
|
||||
}
|
||||
if(selectmodel.children[i].name == "JSQ"){
|
||||
part.text = "减速器";
|
||||
part.msg = "将电动机输出的高转速、低转距的机械能,转变成低转速、大转距的机械能,防止非正常情况下损坏机件或烧毁电动机。";
|
||||
selectmodel.children[i].text = "减速器";
|
||||
}
|
||||
if(selectmodel.children[i].name == "BSG"){
|
||||
part.text = "表示杆";
|
||||
part.msg = "检查道岔尖轨的开通方向,监督道岔的状态,给自动开闭器的准确动作提供充分条件。";
|
||||
selectmodel.children[i].text = "表示杆";
|
||||
}
|
||||
if(selectmodel.children[i].name == "DZG"){
|
||||
part.text = "动作杆";
|
||||
part.msg = "齿条块和动作杆是转辙机转换道岔最后的执行部件。它们不仅要有足够的机械强度,还要在每次转换结束将道岔锁住。此外,当发生挤岔事故时,尽可能保证转辙机内部机件不受损坏。";
|
||||
selectmodel.children[i].text = "动作杆";
|
||||
}
|
||||
if(selectmodel.children[i].name == "CTK"){
|
||||
part.text = "齿条块";
|
||||
part.msg = "齿条块和动作杆是转辙机转换道岔最后的执行部件。它们不仅要有足够的机械强度,还要在每次转换结束将道岔锁住。此外,当发生挤岔事故时,尽可能保证转辙机内部机件不受损坏。";
|
||||
selectmodel.children[i].text = "齿条块";
|
||||
}
|
||||
if(selectmodel.children[i].name == "ZZ"){
|
||||
part.text = "主轴";
|
||||
part.msg = "主轴主要由主轴套、承轴、止挡栓和锁闭齿轮等附件与主轴组成。主轴的作用是推动大齿块以转换道岔并和削尖齿相配合完成对道岔的机械锁闭。";
|
||||
selectmodel.children[i].text = "主轴";
|
||||
}
|
||||
if(selectmodel.children[i].name == "DJZ"){
|
||||
part.text = "电机罩";
|
||||
part.msg = "保护电机。";
|
||||
selectmodel.children[i].text = "电机罩";
|
||||
}
|
||||
if(selectmodel.children[i].name == "DK"){
|
||||
part.text = "底壳";
|
||||
part.msg = "固定转辙机的各部件,确保相关部件的轴向或径向通信。";
|
||||
selectmodel.children[i].text = "底壳";
|
||||
}
|
||||
if(selectmodel.children[i].name =="QDP"){
|
||||
part.text = "启动片";
|
||||
part.msg = "1.起输出轴与主轴间的十字接头作用,使主轴随输出轴同时旋转。2.控制自动开闭器动作,在道岔转换前切断原表示电路,并为电机反转电路准备条件。";
|
||||
selectmodel.children[i].text = "启动片";
|
||||
}
|
||||
if(selectmodel.children[i].name =="ESWCJJ"){
|
||||
part.text = "二十位插接件";
|
||||
part.msg = "用于机内外电缆连接,方便更换转辙机。";
|
||||
selectmodel.children[i].text = "二十位插接件";
|
||||
}
|
||||
// if(part.text == null){
|
||||
// console.log(selectmodel.children[i].name);
|
||||
// }
|
||||
if(part.text){
|
||||
scope.devicelist.push(part);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
161
src/jlmap3d/otherproject/xzexam/jl3dxzexam.js
Normal file
161
src/jlmap3d/otherproject/xzexam/jl3dxzexam.js
Normal file
@ -0,0 +1,161 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//loader
|
||||
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
|
||||
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
||||
|
||||
import { ModelManager } from '@/jlmap3d/otherproject/xzexam/loader.js';
|
||||
import { Moveanimate } from '@/jlmap3d/otherproject/xzexam/component/moveanimate.js';
|
||||
|
||||
var clock = new THREE.Clock();
|
||||
export function Jl3dXzexam(dom) {
|
||||
|
||||
|
||||
var scope = this;
|
||||
|
||||
this.dom = dom;
|
||||
this.nowcode = null;
|
||||
this.animateswitch = false;
|
||||
this.mixers = [];
|
||||
this.showmodel = null;
|
||||
|
||||
|
||||
//动画状态
|
||||
this.animastats = false;
|
||||
|
||||
//初始化webgl渲染
|
||||
this.renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
|
||||
this.renderer.setClearColor(new THREE.Color(0x000000));
|
||||
this.renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
||||
this.renderer.shadowMap.enabled = true;
|
||||
this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
||||
this.dom.appendChild(this.renderer.domElement);
|
||||
|
||||
//定义相机
|
||||
this.camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 2000);
|
||||
this.camera.position.set(27, 2.4, -1);
|
||||
this.camera.rotation.y = Math.PI/2;
|
||||
this.camera.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
this.camera.updateProjectionMatrix();
|
||||
//定义场景(渲染容器)
|
||||
this.scene = new THREE.Scene();
|
||||
this.scene.background = new THREE.Color(0xa0a0a0);
|
||||
|
||||
|
||||
let moveanima = new Moveanimate(scope);
|
||||
|
||||
//定义全局光
|
||||
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
|
||||
this.scene.add(ambientLight);
|
||||
|
||||
|
||||
//定义轨道视角控制器
|
||||
this.controls = new THREE.OrbitControls(this.camera, dom);
|
||||
this.controls.maxPolarAngle = Math.PI / 2;
|
||||
this.controls.minPolarangle = Math.PI / 5;
|
||||
this.controls.maxDistance = 30;
|
||||
this.controls.screenSpacePanning = true;
|
||||
this.controls.update();
|
||||
|
||||
document.addEventListener( "mousedown", onselect, false );
|
||||
function onselect(){
|
||||
// console.log(scope.camera.position);
|
||||
}
|
||||
this.anime = null;
|
||||
|
||||
let modelCzsb,modelFadianji,modelZcg,modelQjd,modelShengzi;
|
||||
this.modelmanager = new ModelManager();
|
||||
scope.modelmanager.loadpromise(scope.mixers).then(function (data) {
|
||||
scope.scene.add(scope.modelmanager.model2.mesh);
|
||||
modelCzsb = scope.modelmanager.model2.mesh.getObjectByName("CZSB");
|
||||
scope.modelmanager.model2.mesh.remove(modelCzsb);
|
||||
// modelCzsb.visible = false;
|
||||
modelFadianji = scope.modelmanager.model2.mesh.getObjectByName("FADIANJI");
|
||||
scope.modelmanager.model2.mesh.remove(modelFadianji);
|
||||
modelZcg = scope.modelmanager.model2.mesh.getObjectByName("ZCG");
|
||||
scope.modelmanager.model2.mesh.remove(modelZcg);
|
||||
modelQjd = scope.modelmanager.model2.mesh.getObjectByName("QJD");
|
||||
scope.modelmanager.model2.mesh.remove(modelQjd);
|
||||
modelShengzi = scope.modelmanager.model2.mesh.getObjectByName("SHENGZI");
|
||||
scope.modelmanager.model2.mesh.remove(modelShengzi);
|
||||
|
||||
let human1 = scope.modelmanager.model1.mesh;
|
||||
human1.position.set(25, 0, 1.8);
|
||||
// human1.rotation.y = -Math.PI/2;
|
||||
let human2 = human1.clone(true);
|
||||
human2.position.set(25, 0, -2);
|
||||
// human2.rotation.y = -Math.PI/2;
|
||||
|
||||
scope.scene.add(human1);
|
||||
scope.scene.add(human2);
|
||||
animate();
|
||||
});
|
||||
|
||||
window.onresize = function () {
|
||||
scope.renderer.setSize(dom.offsetWidth,dom.offsetHeight);
|
||||
}
|
||||
|
||||
|
||||
this.changeIndex = function(index){
|
||||
if(index == "1"){
|
||||
// modelCzsb.visible = true;
|
||||
scope.modelmanager.model2.mesh.add(modelCzsb);
|
||||
}
|
||||
if(index == "2"){
|
||||
scope.modelmanager.model2.mesh.add(modelFadianji);
|
||||
}
|
||||
if(index == "3"){
|
||||
scope.modelmanager.model2.mesh.add(modelZcg);
|
||||
}
|
||||
if(index == "4"){
|
||||
scope.modelmanager.model2.mesh.add(modelQjd);
|
||||
}
|
||||
if(index == "5"){
|
||||
scope.modelmanager.model2.mesh.add(modelShengzi);
|
||||
}
|
||||
if(index == "6"){
|
||||
scope.modelmanager.model2.action.play();
|
||||
}
|
||||
if(index == "7"){
|
||||
scope.modelmanager.model2.mesh.remove(modelCzsb);
|
||||
scope.modelmanager.model2.mesh.remove(modelFadianji);
|
||||
scope.modelmanager.model2.mesh.remove(modelZcg);
|
||||
scope.modelmanager.model2.mesh.remove(modelQjd);
|
||||
scope.modelmanager.model2.mesh.remove(modelShengzi);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let stopTime = 0;
|
||||
//循环渲染函数
|
||||
function animate() {
|
||||
|
||||
scope.anime = requestAnimationFrame(animate);
|
||||
scope.renderer.render(scope.scene, scope.camera);
|
||||
scope.controls.update();
|
||||
//scope.camera.lookAt(plane);
|
||||
// moveanima.animateupdate();
|
||||
let delta = clock.getDelta();
|
||||
if (scope.mixers) {
|
||||
for (let i = 0; i < scope.mixers.length; i++) {
|
||||
scope.mixers[i].update(delta);
|
||||
|
||||
// if (scope.mixers[i]) {
|
||||
// if( scope.mixers[i].staticType){
|
||||
// // console.log(scope.mixers[i].time);
|
||||
// if(scope.mixers[i]._actions[0].time<stopTime){
|
||||
// scope.mixers[i].update(delta);
|
||||
// }else{
|
||||
// scope.mixers[i]._actions[0].paused = true;
|
||||
// }
|
||||
// }else{
|
||||
// scope.mixers[i].update(delta);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
75
src/jlmap3d/otherproject/xzexam/loader.js
Normal file
75
src/jlmap3d/otherproject/xzexam/loader.js
Normal file
@ -0,0 +1,75 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
|
||||
export function ModelManager(){
|
||||
let scope = this;
|
||||
|
||||
this.model1 = {};
|
||||
this.model2 = {};
|
||||
|
||||
this.loadpromise = function (mixers){
|
||||
let initlist = [];
|
||||
let staticJyHuman = {
|
||||
assetname: "救援人员",
|
||||
deviceType: "JyHuman",
|
||||
id: "xz1",
|
||||
packageName: "救援人员",
|
||||
type: "static",
|
||||
url: "/MODEL/2021-11-19/527-70780.FBX"
|
||||
};
|
||||
initlist.push(fbxpromise(staticJyHuman,mixers,scope.model1));
|
||||
|
||||
let staticJyScene = {
|
||||
assetname: "列车救援场景",
|
||||
deviceType: "JyScene",
|
||||
id: "xz2",
|
||||
packageName: "列车救援场景",
|
||||
type: "static",
|
||||
url: "/MODEL/2021-11-19/528-20265.FBX"
|
||||
};
|
||||
initlist.push(fbxpromise(staticJyScene,mixers,scope.model2));
|
||||
|
||||
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
Promise.all(initlist).then((result) => {
|
||||
resolve("success"); //['成功了', 'success']
|
||||
}).catch((error) => {
|
||||
//console.log(error);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fbxpromise(asset,mixers,model){
|
||||
return new Promise(function(resolve, reject){
|
||||
var loader = new THREE.FBXLoader();
|
||||
let modelurl;
|
||||
|
||||
modelurl = BASE_ASSET_API+asset.url;
|
||||
loader.load( modelurl, function ( object ) {
|
||||
let mixer = new THREE.AnimationMixer( object );
|
||||
object.traverse( function ( child ) {
|
||||
if ( child.isMesh ) {
|
||||
child.castShadow = true;
|
||||
child.receiveShadow = true;
|
||||
}
|
||||
} );
|
||||
|
||||
model.mesh = object;
|
||||
|
||||
if(object.animations.length>0){
|
||||
model.action = mixer.clipAction( object.animations[ 0 ] );
|
||||
model.action.setLoop(THREE.LoopOnce);
|
||||
model.action.clampWhenFinished = true;
|
||||
mixers.push(mixer);
|
||||
}
|
||||
|
||||
resolve(asset.deviceType);
|
||||
} );
|
||||
|
||||
});
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
|
||||
import { Capsule } from '@/jlmap3d/lesson3d/math/Capsule.js';
|
||||
import { Capsule } from '@/jlmap3d/utils/math/Capsule.js';
|
||||
|
||||
import { Octree } from '@/jlmap3d/lesson3d/math/Octree.js';
|
||||
import { Octree } from '@/jlmap3d/utils/math/Octree.js';
|
||||
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import { OBJLoader } from '@/jlmap3d/main/loaders/OBJLoader';
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
import { Capsule } from '@/jlmap3d/lesson3d/math/Capsule.js';
|
||||
import { Capsule } from '@/jlmap3d/utils/math/Capsule.js';
|
||||
var Octree = ( function () {
|
||||
|
||||
var _v1 = new THREE.Vector3();
|
@ -29,7 +29,7 @@ class Pathfinding {
|
||||
// not-recommended these days, so go ahead and start warning.
|
||||
console.warn('[three-pathfinding]: Use BufferGeometry, not Geometry, to create zone.');
|
||||
} else {
|
||||
geometry = new Geometry().fromBufferGeometry(geometry);
|
||||
geometry = new THREE.Geometry().fromBufferGeometry(geometry);
|
||||
}
|
||||
|
||||
return Builder.buildZone(geometry);
|
||||
|
@ -13,7 +13,8 @@ const mapDeviceStyle = {
|
||||
'12': 'ningbo_03', // 宁波三号线
|
||||
'13': 'race_01', // 2020国赛线路
|
||||
'14':'nanjing_02', // 南京二号线
|
||||
'15': 'datie_01' // 大铁线路一
|
||||
'15': 'datie_01', // 大铁线路一
|
||||
'16': 'datie_02' // 大铁线路二
|
||||
};
|
||||
|
||||
export function selectLineCode(code) {
|
||||
|
@ -608,7 +608,7 @@ class SkinCode extends defaultStyle {
|
||||
lineDash: [3, 3], // 车次窗虚线间隔
|
||||
lineWidth: 1, // 车次窗线宽
|
||||
trainWindowSmooth: 0.01, // 车次窗矩形圆滑程度
|
||||
show: true // 车次窗是否显示
|
||||
show: false // 车次窗是否显示
|
||||
};
|
||||
this[deviceType.SplitStation] = {
|
||||
lineLength: 15, // 箭头线长度
|
||||
|
@ -549,7 +549,7 @@ class SkinCode extends defaultStyle {
|
||||
lineDash: null, // 车次窗虚线间隔
|
||||
lineWidth: 1, // 车次窗线宽
|
||||
trainWindowSmooth: 0, // 车次窗矩形圆滑程度
|
||||
show: true // 车次窗是否显示
|
||||
show: false // 车次窗是否显示
|
||||
};
|
||||
this[deviceType.SplitStation] = {
|
||||
lineLength: 15, // 箭头线长度
|
||||
|
@ -746,7 +746,7 @@ class SkinCode extends defaultStyle {
|
||||
lineDash: null, // 车次窗虚线间隔
|
||||
lineWidth: 1, // 车次窗线宽
|
||||
trainWindowSmooth: 0, // 车次窗矩形圆滑程度
|
||||
show: true // 车次窗是否显示
|
||||
show: false // 车次窗是否显示
|
||||
};
|
||||
this[deviceType.SplitStation] = {
|
||||
lineLength: 15, // 箭头线长度
|
||||
|
@ -394,17 +394,19 @@ class SkinCode extends defaultStyle {
|
||||
greenColor: '#00FF00', // 控制模式绿色
|
||||
redColor: '#FF0000', // 控制模式红色
|
||||
yellowColor: '#FFFF00', // 控制模式黄色
|
||||
purpleColor:'#840084' // 控制模式紫色
|
||||
purpleColor:'#840084', // 控制模式紫色
|
||||
strokeColor: '#fff',
|
||||
lineWidth: 1
|
||||
},
|
||||
emergencyControl: { // 紧急站控
|
||||
show: true,
|
||||
show: false,
|
||||
offset: { x: 0, y: 0 },
|
||||
text: '紧急站控',
|
||||
arrowShow: false,
|
||||
grayColor: '#7F7F7F'
|
||||
},
|
||||
centerControl: { // 中控
|
||||
show: true,
|
||||
show: false,
|
||||
offset: { x: 0, y: 0 },
|
||||
text: '中控',
|
||||
buttonShow: false,
|
||||
@ -412,18 +414,37 @@ class SkinCode extends defaultStyle {
|
||||
grayColor: '#7F7F7F'
|
||||
},
|
||||
substationControl: { // 站控按钮
|
||||
show: true,
|
||||
show: false,
|
||||
offset: { x: 0, y: 0 },
|
||||
text: '站控',
|
||||
arrowShow: false,
|
||||
grayColor: '#7F7F7F'
|
||||
},
|
||||
interconnectedControl: { // 联锁控
|
||||
show: true,
|
||||
show: false,
|
||||
offset: { x: 0, y: 0 },
|
||||
text: '联锁控',
|
||||
arrowShow: false,
|
||||
grayColor: '#7F7F7F'
|
||||
},
|
||||
veryControl: {
|
||||
show: true,
|
||||
offset: { x: 0, y: 0 },
|
||||
text: '非常站控'
|
||||
},
|
||||
selfDiscipline: {
|
||||
show: true,
|
||||
offset: { x: 0, y: 0 },
|
||||
text: '允许自律'
|
||||
},
|
||||
selfDisciplineControl: {
|
||||
show: true,
|
||||
offset: { x: 0, y: 0 },
|
||||
text: '自律控制'
|
||||
},
|
||||
veryControlButton: {
|
||||
offset: { x: 0, y: 0 },
|
||||
text: '非常站控'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
1052
src/jmapNew/config/skinCode/datie_02.js
Normal file
1052
src/jmapNew/config/skinCode/datie_02.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -84,7 +84,7 @@ class SkinCode extends defaultStyle {
|
||||
invadeColor: '#EF0C08', // 区段侵入颜色
|
||||
spareColor: '#3F3F3F', // 区段空闲颜色
|
||||
communicationOccupiedColor: '#FE0000', // 区段通信车占用颜色
|
||||
unCommunicationOccupiedColor: '#FE0000', // 区段非通讯车占用颜色
|
||||
unCommunicationOccupiedColor: '#A600A6', // 区段非通讯车占用颜色
|
||||
routeLockColor: '#FFFFFF', // 区段路由锁定颜色
|
||||
faultLockColor: '#00FF00', // 区段故障锁闭颜色
|
||||
undefinedColor: '#0071C1', // 区段未定义颜色
|
||||
@ -581,7 +581,7 @@ class SkinCode extends defaultStyle {
|
||||
lineDash: null, // 车次窗虚线间隔
|
||||
lineWidth: 1, // 车次窗线宽
|
||||
trainWindowSmooth: 0, // 车次窗矩形圆滑程度
|
||||
show: true // 车次窗是否显示
|
||||
show: false // 车次窗是否显示
|
||||
};
|
||||
this[deviceType.SplitStation] = {
|
||||
lineLength: 15, // 箭头线长度
|
||||
|
@ -654,7 +654,7 @@ class SkinCode extends defaultStyle {
|
||||
trainHeight: 10, // 列车高度
|
||||
trainHeadDistance: 2, // 列车和车头之间的间距
|
||||
trainWidth: 76, // 列车长度
|
||||
trainTextFontSize: 10, // 列车字号
|
||||
trainTextFontSize: 16, // 列车字号
|
||||
fontFamily: 'consolas', // 默认字体 族类
|
||||
haveTextHSDA: false, // 是否需创建textHSDA对象
|
||||
haveArrowText: true, // 是否需创建arrowText对象
|
||||
@ -673,6 +673,7 @@ class SkinCode extends defaultStyle {
|
||||
{status: '07', showColor: '#FFFF00'}
|
||||
], // 目的地状态 01准点 02早点 03严重早点 04晚点 05严重晚点 06头码车 07ATP切除
|
||||
destinationStatusSetText: 'trainServer', // 目的地状态设置的对应哪个text的颜色
|
||||
runLineHide: true, // 运行时列车line 竖杆隐藏
|
||||
directionType: [
|
||||
{
|
||||
type: 1,
|
||||
|
@ -172,6 +172,9 @@ class SkinCode extends defaultStyle {
|
||||
whiteColor: '#FFFFFF', // 信号灯白色
|
||||
blueColor: '#000080' // 信号灯蓝色
|
||||
},
|
||||
virtual: { // 虚拟信号机
|
||||
lamp: 'triangle' // 灯型 三角形
|
||||
},
|
||||
route: {
|
||||
direction: false, // 自动进路方向
|
||||
offset: { x: -4, y: 0 }, // 自动进路偏移量
|
||||
@ -630,7 +633,7 @@ class SkinCode extends defaultStyle {
|
||||
lineDash: null, // 车次窗虚线间隔
|
||||
lineWidth: 1, // 车次窗线宽
|
||||
trainWindowSmooth: 0, // 车次窗矩形圆滑程度
|
||||
show: true // 车次窗是否显示
|
||||
show: false // 车次窗是否显示
|
||||
};
|
||||
this[deviceType.SplitStation] = {
|
||||
lineLength: 15, // 箭头线长度
|
||||
|
@ -21,7 +21,8 @@ class SkinCode extends defaultStyle {
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||
approachColor: '#FFFFFF',
|
||||
occupyColor: '#FF0000' // 计轴区段占用字体颜色
|
||||
occupyColor: '#FF0000', // 计轴区段占用字体颜色
|
||||
invalidColor:'#ff0000' // // 计轴故障
|
||||
},
|
||||
logicText: {
|
||||
z: 10,
|
||||
@ -93,9 +94,9 @@ class SkinCode extends defaultStyle {
|
||||
protectiveLockColor: '#9DFF6E', // 区段保护锁闭
|
||||
delayUnlockColor: '#00FF00', // 延时解锁
|
||||
|
||||
faultLockColor: '#9B4A0A', // 区段故障锁定颜色
|
||||
faultLockColor: '#00FF00', // 区段故障锁定颜色
|
||||
|
||||
invalidColor: '#ff0000', // 计轴故障
|
||||
invalidColor: '', // 计轴故障
|
||||
undefinedColor: '#0071C1', // 区段未定义颜色
|
||||
atcExcisionColor: '#A0522D', // 区段atc切除颜色
|
||||
atsExcisionColor: '#A0522D', // 区段ats切除颜色
|
||||
@ -225,6 +226,15 @@ class SkinCode extends defaultStyle {
|
||||
whiteColor: '#FFFFFF', // 信号灯白色
|
||||
blueColor: '#0010FF' // 信号灯蓝色
|
||||
},
|
||||
virtual: { // 虚拟信号机
|
||||
bg: { // 虚拟信号机背景
|
||||
fillColor:'#FFFFFF', // 信号背景颜色
|
||||
strokecolor:'#FFFFFF', // 信号描边颜色
|
||||
lineWidth: 1, // 信号背景描边宽度
|
||||
distanceX: 2, // 信号背景x偏移距离
|
||||
distanceY: 0 // 信号背景Y偏移距离
|
||||
}
|
||||
},
|
||||
route: {
|
||||
direction: false, // 自动进路方向
|
||||
offset: { x: -4, y: 0 }, // 自动进路偏移量
|
||||
@ -261,7 +271,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
transmission: { // 传输信号机
|
||||
fillColor: '#f00',
|
||||
fillColorVirtual: '#000080',
|
||||
fillColorVirtual: '#f00',
|
||||
sideLength: 20,
|
||||
textColor: '#fff',
|
||||
strokeColor: '#00FFFF'
|
||||
@ -703,7 +713,7 @@ class SkinCode extends defaultStyle {
|
||||
lineDash: null, // 车次窗虚线间隔
|
||||
lineWidth: 1, // 车次窗线宽
|
||||
trainWindowSmooth: 0, // 车次窗矩形圆滑程度
|
||||
show: true // 车次窗是否显示
|
||||
show: false // 车次窗是否显示
|
||||
};
|
||||
this[deviceType.SplitStation] = {
|
||||
lineLength: 15, // 箭头线长度
|
||||
|
@ -354,8 +354,8 @@ class SkinCode extends defaultStyle {
|
||||
borderBackgroundColor: '#22DFDF', // 边框背景色
|
||||
borderColor: '#fff', // 边框颜色
|
||||
textShadowColor: '#22DFDF', // 字体阴影颜色
|
||||
coreBackgroundColor: '#00BFFF', // 岔芯颜色 浅蓝色
|
||||
coreBackgroundColorOver: '#001AFC' // 岔芯颜色 深蓝色
|
||||
coreBackgroundColor: '#00BFFF', // 岔心颜色 浅蓝色
|
||||
coreBackgroundColorOver: '#001AFC' // 岔心颜色 深蓝色
|
||||
}
|
||||
};
|
||||
|
||||
@ -663,7 +663,7 @@ class SkinCode extends defaultStyle {
|
||||
lineDash: [3], // 车次窗虚线间隔
|
||||
lineWidth: 0.5, // 车次窗线宽
|
||||
trainWindowSmooth: 0, // 车次窗矩形圆滑程度
|
||||
show: true // 车次窗是否显示
|
||||
show: false // 车次窗是否显示
|
||||
};
|
||||
this[deviceType.SplitStation] = {
|
||||
lineLength: 15, // 箭头线长度
|
||||
|
@ -271,8 +271,8 @@ class SkinCode extends defaultStyle {
|
||||
mergentR:4, // 站台折返策略边数
|
||||
position: 0, // 折返方向
|
||||
offset: {x: -16, y: -15}, // 折返偏移量
|
||||
noHumanColor: '#0F16DA', // 站台无人折返
|
||||
autoChangeEndsColor: '#0BF400' // 站台自动换端
|
||||
noHumanColor: '#0BF400', // 站台无人折返
|
||||
autoChangeEndsColor: '#0F16DA' // 站台自动换端
|
||||
},
|
||||
|
||||
common: { // 通用属性
|
||||
|
@ -604,7 +604,7 @@ class SkinCode extends defaultStyle {
|
||||
lineDash: null, // 车次窗虚线间隔
|
||||
lineWidth: 1, // 车次窗线宽
|
||||
trainWindowSmooth: 0, // 车次窗矩形圆滑程度
|
||||
show: true // 车次窗是否显示
|
||||
show: false // 车次窗是否显示
|
||||
};
|
||||
this[deviceType.NoOneReturn] = {
|
||||
displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示)
|
||||
|
@ -285,4 +285,49 @@ deviceRender[deviceType.IndicatorLight] = {
|
||||
_type: deviceType.IndicatorLight,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 接发车指示灯 */
|
||||
deviceRender[deviceType.PickOrDepartArrow] = {
|
||||
_type: deviceType.PickOrDepartArrow,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 区间占用 区间监控 */
|
||||
deviceRender[deviceType.SectionOccupied] = {
|
||||
_type: deviceType.SectionOccupied,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 辅助状态 */
|
||||
deviceRender[deviceType.AssistStatus] = {
|
||||
_type: deviceType.AssistStatus,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 总辅助状态 */
|
||||
deviceRender[deviceType.TotalAssist] = {
|
||||
_type: deviceType.TotalAssist,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 发车辅助 */
|
||||
deviceRender[deviceType.DepartAssist] = {
|
||||
_type: deviceType.DepartAssist,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 接车辅助 */
|
||||
deviceRender[deviceType.PickAssist] = {
|
||||
_type: deviceType.PickAssist,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 复原状态灯 */
|
||||
deviceRender[deviceType.Recovery] = {
|
||||
_type: deviceType.Recovery,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 事故状态灯 */
|
||||
deviceRender[deviceType.Accident] = {
|
||||
_type: deviceType.Accident,
|
||||
zlevel: 1
|
||||
};
|
||||
/** 闭塞状态灯 */
|
||||
deviceRender[deviceType.Occlusion] = {
|
||||
_type: deviceType.Occlusion,
|
||||
zlevel: 1
|
||||
};
|
||||
export default deviceRender;
|
||||
|
@ -50,7 +50,15 @@ const deviceType = {
|
||||
FloodGate: 'FloodGate',
|
||||
DirectionRod: 'DirectionRod',
|
||||
Responder: 'Responder',
|
||||
SignalButton: 'SignalButton'
|
||||
SignalButton: 'SignalButton',
|
||||
PickOrDepartArrow: 'PickOrDepartArrow',
|
||||
Occlusion: 'Occlusion',
|
||||
Accident: 'Accident',
|
||||
Recovery: 'Recovery',
|
||||
PickAssist: 'PickAssist',
|
||||
DepartAssist: 'DepartAssist',
|
||||
TotalAssist: 'TotalAssist',
|
||||
AssistStatus: 'AssistStatus',
|
||||
SectionOccupied: 'SectionOccupied'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
@ -209,6 +209,21 @@ class Jlmap {
|
||||
setTimeout(() => { this.setCenter(deviceCode); }, 60);
|
||||
}
|
||||
}
|
||||
setCenterOffset(deviceCode, offset) {
|
||||
const arr = Object.keys(this.mapDevice);
|
||||
if (arr.length != 0) {
|
||||
const device = this.mapDevice[deviceCode];
|
||||
if (device && device.instance) {
|
||||
var rect = createBoundingRect(device.instance);
|
||||
rect.x += offset.x;
|
||||
rect.y += offset.y;
|
||||
var dcenter = calculateDCenter(rect, this.$zr.getWidth() / 2);
|
||||
this.setOptions(dcenter);
|
||||
}
|
||||
} else {
|
||||
setTimeout(() => { this.setCenter(deviceCode, offset); }, 60);
|
||||
}
|
||||
}
|
||||
setRevoverBigScreen() {
|
||||
this.screenFlag = false;
|
||||
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
|
||||
|
@ -122,7 +122,6 @@ class MouseController extends Eventful {
|
||||
this._dragging = false;
|
||||
}
|
||||
if (this._zoomOnMouseWheel && this.$jmap.mapDevice['check_box'] && this._previewOrMapDraw ) {
|
||||
console.log(this.isMoveRight, 'mouseup');
|
||||
this.eventTarget = this.$jmap.mapDevice['check_box'].instance;
|
||||
this.handleBoundingRect(this.eventTarget);
|
||||
let em;
|
||||
|
@ -154,8 +154,7 @@ class Painter {
|
||||
trainDevice.overLapIndex = index;
|
||||
trainDevice.instance && this.mapInstanceLevel[deviceType.Train].remove(trainDevice.instance);
|
||||
trainDevice.instance = null;
|
||||
trainDevice.zrOffsetX = this.$jmap.$options.offsetX;
|
||||
trainDevice.zrOffsetY = this.$jmap.$options.offsetY;
|
||||
trainDevice.zrOptions = this.$jmap.$options;
|
||||
this.add(trainDevice);
|
||||
});
|
||||
|
||||
|
@ -350,6 +350,15 @@ export function updateMapData(state, model) {
|
||||
case deviceType.Axle: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.IndicatorLight: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.PickOrDepartArrow: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.Occlusion: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.Accident: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.Recovery: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.PickAssist: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.DepartAssist: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.TotalAssist: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.AssistStatus: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.SectionOccupied: updateForList(model, state, 'indicatorLightList'); break;
|
||||
case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break;
|
||||
case deviceType.Arrow: updateForList(model, state, 'arrowList'); break;
|
||||
case deviceType.Power: updateForList(model, state, 'powerLineList'); break;
|
||||
|
@ -84,7 +84,7 @@ class EHorizontal2Door extends Group {
|
||||
this.stand2.setStyle('fill', style.Psd.horizontal2Door.defaultColor);
|
||||
}
|
||||
}
|
||||
if (model.noStatus) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
this.stand1.setStyle('fill', '#7F7F7F');
|
||||
this.stand2.setStyle('fill', '#7F7F7F');
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class ERect2Door extends Group {
|
||||
this.psd.setStyle('fill', style.Psd.rectDoor.defaultColor);
|
||||
}
|
||||
}
|
||||
if (model.noStatus) {
|
||||
if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) {
|
||||
this.psd.setStyle('fill', '#7F7F7F');
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user