Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test_tmt
@ -301,3 +301,11 @@ export function getOrgTreeById(orgId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 查询学生在地图下仿真使用时长和实训使用时长 */
|
||||
export function getUserDuration(params) {
|
||||
return request({
|
||||
url: `api/company/usage/students`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
@ -29,9 +29,13 @@ export function sendSimulationCommand(group, memberId, type, data) {
|
||||
});
|
||||
}
|
||||
/** 获取仿真成员列表 */
|
||||
export function getMemberListCommon(group) {
|
||||
export function getMemberListCommon(group,role) {
|
||||
|
||||
if(!role){
|
||||
role = "";
|
||||
}
|
||||
return request({
|
||||
url: `/common/simulation/${group}/members`,
|
||||
url: `/common/simulation/${group}/members?role=${role}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -451,6 +451,27 @@ export function getSimulationDestinationList(group) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取PSL盘状态 */
|
||||
export function getPslStatus(group, standCode) {
|
||||
return request({
|
||||
url: `/simulation/${group}/${standCode}/psl/status`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 按下PSL盘按钮
|
||||
* @param {String} button
|
||||
* YXJZ-允许/禁止;
|
||||
* HSJC-互锁解除;
|
||||
* KM-开门;
|
||||
* GM-关门;
|
||||
* SD-试灯;
|
||||
*/
|
||||
export function pressPslButton(group, standCode, button) {
|
||||
return request({
|
||||
url: `/simulation/${group}/${standCode}/psl/${button}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 查询运行线或者列车经过的站台 */
|
||||
export function getStandListByRunLineOrTrainCode(group, params) {
|
||||
return request({
|
||||
|
BIN
src/assets/psl_images/green_btn.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
src/assets/psl_images/green_off.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
src/assets/psl_images/green_on.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
src/assets/psl_images/key.png
Normal file
After Width: | Height: | Size: 12 KiB |
22
src/assets/psl_images/psl_icons.js
Normal file
@ -0,0 +1,22 @@
|
||||
import red_on from "@/assets/psl_images/red_on.png";
|
||||
import red_off from "@/assets/psl_images/red_off.png";
|
||||
import red_btn from "@/assets/psl_images/red_btn.png";
|
||||
import green_on from "@/assets/psl_images/green_on.png";
|
||||
import green_off from "@/assets/psl_images/green_off.png";
|
||||
import green_btn from "@/assets/psl_images/green_btn.png";
|
||||
import top_on from "@/assets/psl_images/top_on.png";
|
||||
import top_off from "@/assets/psl_images/top_off.png";
|
||||
import key from "@/assets/psl_images/key.png";
|
||||
const icons = {
|
||||
red_on,
|
||||
red_off,
|
||||
red_btn,
|
||||
green_on,
|
||||
green_off,
|
||||
green_btn,
|
||||
top_on,
|
||||
top_off,
|
||||
key
|
||||
};
|
||||
|
||||
export default icons;
|
BIN
src/assets/psl_images/red_btn.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
src/assets/psl_images/red_off.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
src/assets/psl_images/red_on.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/psl_images/top_off.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
src/assets/psl_images/top_on.png
Normal file
After Width: | Height: | Size: 13 KiB |
@ -25,7 +25,7 @@ import { DriverLoadNew } from '@/jlmap3d/main/loaders/DriverLoadNew';
|
||||
// connect
|
||||
import {Jl3dDrivingNew} from '@/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew';
|
||||
|
||||
import { getPublishMapVersion, getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
// utils
|
||||
import { UpdateTrain } from '@/jlmap3d/jl3ddrive/moveupdate/UpdateTrain';
|
||||
|
@ -25,7 +25,7 @@ import { MaintainerLoad } from '@/jlmap3d/jl3dmaintainer/maintainerload';
|
||||
//connect
|
||||
import {Maintainerconnect } from '@/jlmap3d/jl3dmaintainer/maintainerconnect';
|
||||
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
//utils
|
||||
// import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain';
|
||||
|
@ -9,7 +9,7 @@ import { ModelManager } from '@/jlmap3d/jl3dpassflow/loader.js';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
//获取信息接口
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
//cctv站台对象
|
||||
import { PasserStation } from '@/jlmap3d/jl3dpassflow/model/passerstation.js';
|
||||
//cctv检票机对象
|
||||
|
374
src/jlmap3d/jl3drailwaydevice/component/moveanimate.js
Normal file
@ -0,0 +1,374 @@
|
||||
//转辙机动画
|
||||
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.initlistnew = function(switchmodel){
|
||||
scope.animatelist[switchmodel.animacode+"chaijie"] = [];
|
||||
scope.animatelist[switchmodel.animacode+"fuwei"] = [];
|
||||
for(let i=0,leni=switchmodel.children.length;i<leni;i++){
|
||||
if(switchmodel.children[i].name == "DDJ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1.5,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"dizuoon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x-1.5,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"dizuooff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "DJZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-3,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"Lxingon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x-3,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"Lxingoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "DINGK"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+9,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"jiaoxingxiantieon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+9,switchmodel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jiaoxingxiantieoff",points2,0.5,true,0);
|
||||
}
|
||||
|
||||
if(switchmodel.children[i].name == "SZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1.5,switchmodel.children[i].position.y,switchmodel.children[i].position.z-1));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"zhongchuipianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.xx-1.5,switchmodel.children[i].position.y,switchmodel.children[i].position.z-1));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"zhongchuipianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "JSQ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-3,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"laganon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x-3,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"laganoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "YWJCQ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z+3));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"dongjiedianzhouon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z+3));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"dongjiedianzhouoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "ESWCJJ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"neibuon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"neibuoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "AQJD"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-2));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"jiedianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-2));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jiedianoff",points2,0.5,true,0);
|
||||
|
||||
}
|
||||
if(switchmodel.children[i].name == "QDP"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-3));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"yapianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-3));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"yapianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "SDP"){
|
||||
let points1 = [];
|
||||
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-4));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"fanghuozhaoon",points1,0.5,true,0);
|
||||
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z-4));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"fanghuozhaooff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "ZDKBQ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"dianyuanpianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"dianyuanpianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name == "ZZ"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x+3,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"xinpianon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x+3,switchmodel.children[i].position.y+3,switchmodel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"xinpianoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name =="BSG"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x+1,switchmodel.children[i].position.y,switchmodel.children[i].position.z-5));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"jueyuanzhouon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x+1,switchmodel.children[i].position.y,switchmodel.children[i].position.z-5));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"jueyuanzhouoff",points2,0.5,true,0);
|
||||
}
|
||||
if(switchmodel.children[i].name =="DZG"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x-1,switchmodel.children[i].position.y,switchmodel.children[i].position.z-5));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"cigangon",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x-1,switchmodel.children[i].position.y,switchmodel.children[i].position.z-5));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"cigangoff",points2,0.5,true,0);
|
||||
}
|
||||
|
||||
if(switchmodel.children[i].name =="CTK"){
|
||||
let points1 = [];
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
points1.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"chaijie"],switchmodel.children[i],switchmodel.name+"ccichuihuqion",points1,0.5,true,0);
|
||||
let points2 = [];
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y+6,switchmodel.children[i].position.z));
|
||||
points2.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"fuwei"],switchmodel.children[i],switchmodel.name+"ccichuihuqioff",points2,0.5,true,0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// let points = [];
|
||||
// points.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
// points.push(new THREE.Vector3(switchmodel.children[i].position.x,switchmodel.children[i].position.y,switchmodel.children[i].position.z));
|
||||
// scope.initanimate(switchmodel.children[i],switchmodel.name+"select1",points,true);
|
||||
let modelorderlist = [];
|
||||
|
||||
modelorderlist[switchmodel.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[switchmodel.animacode+"on"] = [];
|
||||
scope.animatelist[switchmodel.animacode+"off"] = [];
|
||||
|
||||
for(let i=0,leni=modelorderlist[switchmodel.animacode].length;i<leni;i++){
|
||||
|
||||
let orderdata = modelorderlist[switchmodel.animacode];
|
||||
let modelon = switchmodel.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[switchmodel.animacode+"on"],modelon,switchmodel.animacode+modelon.name+"on",pointson,0.03,true,i);
|
||||
scope.initanimate(scope.animatelist[switchmodel.animacode+"off"],modelon,switchmodel.animacode+modelon.name+"off",pointsoff,0.03,true,leni-i-1);
|
||||
// }else if((i+1)<leni){
|
||||
// scope.initanimate(modelon,switchmodel.animacode+modelon.name+"on",pointson,0.03,true,switchmodel.animacode+orderdata[i+1].name+"on");
|
||||
// scope.initanimate(modelon,switchmodel.animacode+modelon.name+"off",pointsoff,0.03,true,switchmodel.animacode+orderdata[i-1].name+"off");
|
||||
// }else{
|
||||
// scope.initanimate(modelon,switchmodel.animacode+modelon.name+"on",pointson,0.03,true);
|
||||
// scope.initanimate(modelon,switchmodel.animacode+modelon.name+"off",pointsoff,0.03,true,switchmodel.animacode+orderdata[i-1].name+"off");
|
||||
// }
|
||||
|
||||
// if(switchmodel.children[i].name == "xinpian"){
|
||||
// }
|
||||
// if(switchmodel.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/jl3drailwaydevice/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.');
|
||||
}
|
||||
);
|
||||
}
|
113
src/jlmap3d/jl3drailwaydevice/component/textconfig.js
Normal file
@ -0,0 +1,113 @@
|
||||
|
||||
export function Textconfig(){
|
||||
let scope = this;
|
||||
|
||||
this.devicelist = [];
|
||||
|
||||
|
||||
//配置继电器文字信息
|
||||
this.initdevicetext = function(selectmodel){
|
||||
if(scope.devicelist.length>0){
|
||||
scope.devicelist = [];
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
57
src/jlmap3d/jl3drailwaydevice/config.js
Normal file
@ -0,0 +1,57 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
var Staticmodel = {
|
||||
Switch: {
|
||||
id: "1",
|
||||
name: "道岔",
|
||||
deviceType: "Switch",
|
||||
type: "fuzhou",
|
||||
picUrl: "",
|
||||
assetUrl: JL3D_LOCAL_STATIC+"/device/switch/ZD6D.FBX"
|
||||
},//"https://joylink.club/oss/wx/switch/switch.FBX"
|
||||
|
||||
Signal: {
|
||||
id: "2",
|
||||
name: "信号机",
|
||||
deviceType: "Signal",
|
||||
type: "low",
|
||||
picUrl: "",
|
||||
assetUrl: JL3D_LOCAL_STATIC+"/device/signal/signal.FBX"
|
||||
},
|
||||
stationstand: {
|
||||
id: "3",
|
||||
name: "站台",
|
||||
deviceType: "stationstand",
|
||||
type: "low",
|
||||
picUrl: "",
|
||||
assetUrl: JL3D_LOCAL_STATIC+"/device/stationstand/stationstand.FBX"
|
||||
//https://joylink.club/oss/wx/stationstand/stationstand.FBX
|
||||
|
||||
|
||||
},
|
||||
section: {
|
||||
id: "4",
|
||||
name: "区段",
|
||||
deviceType: "section",
|
||||
type: "low",
|
||||
picUrl: "",
|
||||
assetUrl: JL3D_LOCAL_STATIC+"/device/section/section.FBX"
|
||||
//https://joylink.club/oss/wx/stationstand/stationstand.FBX
|
||||
|
||||
|
||||
},
|
||||
room: {
|
||||
id: "5",
|
||||
name: "通号设备间",
|
||||
deviceType: "room",
|
||||
type: "low",
|
||||
picUrl: "",
|
||||
assetUrl: JL3D_LOCAL_STATIC+"/device/room/room.FBX"
|
||||
//https://joylink.club/oss/wx/stationstand/stationstand.FBX
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export { Staticmodel }
|
1002
src/jlmap3d/jl3drailwaydevice/jl3ddeviceNew.js
Normal file
142
src/jlmap3d/jl3drailwaydevice/loader.js
Normal file
@ -0,0 +1,142 @@
|
||||
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.staticswitchmodel = {
|
||||
code:"switch",
|
||||
locateType:"01",
|
||||
mesh:null,
|
||||
action:[]
|
||||
};
|
||||
|
||||
this.switchmodel = {
|
||||
code:"switch",
|
||||
locateType:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.signalmodel = {
|
||||
code:"signal",
|
||||
lightType:"01",
|
||||
status:"01",
|
||||
switchLocateType:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.standmodel = {
|
||||
code:"stand",
|
||||
screenDoorOpenStatus:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.sectionmodel = {
|
||||
code:"section",
|
||||
sectionstatus:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.roommodel = {
|
||||
code:"room",
|
||||
sectionstatus:"01",
|
||||
mesh:null,
|
||||
action:null
|
||||
};
|
||||
|
||||
this.loadpromise = function (data,mixers){
|
||||
let initlist = [];
|
||||
let staticSwitch = {
|
||||
assetname: "转辙教学模型",
|
||||
deviceType: "staticSwitch",
|
||||
id: "x11",
|
||||
packageName: "转辙教学模型",
|
||||
type: "staticSwitch",
|
||||
url: "/device/switch/511DHcongxinzuo22222222222222(1).fbx"
|
||||
};
|
||||
initlist.push(fbxpromise(staticSwitch,mixers,scope.staticswitchmodel));
|
||||
|
||||
for(let i=0,leni=data.length;i<leni;i++){
|
||||
if(data[i].deviceType == "DeviceSignal"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.signalmodel));
|
||||
}
|
||||
if(data[i].deviceType == "DeviceSwitch"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.switchmodel));
|
||||
}
|
||||
if(data[i].deviceType == "DeviceDoor"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.standmodel));
|
||||
}
|
||||
if(data[i].deviceType == "DeviceSection"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.sectionmodel));
|
||||
}
|
||||
if(data[i].deviceType == "MaintainerRoom"){
|
||||
initlist.push(fbxpromise(data[i],mixers,scope.roommodel));
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
if(asset.type == "staticSwitch"){
|
||||
modelurl = JL3D_LOCAL_STATIC+asset.url;
|
||||
}else{
|
||||
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;
|
||||
}
|
||||
} );
|
||||
object.animacode = model.code;
|
||||
model.mesh = object;
|
||||
if(object.animations.length>0){
|
||||
if(asset.type == "staticSwitch"){
|
||||
|
||||
// for(let i=0;i<object.animations.length;i++){
|
||||
// model.action[object.animations[i].name] = mixer.clipAction( object.animations[ i ] );
|
||||
// model.action[object.animations[i].name].duration = object.animations[ i ].duration;
|
||||
// model.action[object.animations[i].name].setLoop(THREE.LoopOnce);
|
||||
// model.action[object.animations[i].name].clampWhenFinished = true;
|
||||
// }
|
||||
model.action = mixer.clipAction( object.animations[ 0 ] );
|
||||
model.action.setLoop(THREE.LoopOnce);
|
||||
model.action.clampWhenFinished = true;
|
||||
model.action.stopTime = 0;
|
||||
mixer.staticType = "staticSwitch";
|
||||
mixers.push(mixer);
|
||||
}else{
|
||||
model.action = mixer.clipAction( object.animations[ 0 ] );
|
||||
model.action.setLoop(THREE.LoopOnce);
|
||||
model.action.clampWhenFinished = true;
|
||||
mixers.push(mixer);
|
||||
}
|
||||
|
||||
//model.action.play();
|
||||
}
|
||||
|
||||
resolve(asset.deviceType);
|
||||
} );
|
||||
|
||||
});
|
||||
}
|
53
src/jlmap3d/jl3drailwaydevice/standtextureload.js
Normal file
@ -0,0 +1,53 @@
|
||||
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export function Standtextureload(jlmap3dedit,standTextureData){
|
||||
for(let i=0,leni=standTextureData.urls.length;i<leni;i++){
|
||||
setstationtexture(jlmap3dedit.stationtexture,standTextureData.urls[i].name,BASE_ASSET_API + standTextureData.urls[i].url);
|
||||
}
|
||||
}
|
||||
|
||||
function settexture(materiallist,name,textureurl){
|
||||
var loader = new THREE.TextureLoader();
|
||||
|
||||
// 加载一个资源
|
||||
loader.load(
|
||||
// 资源URL
|
||||
textureurl,
|
||||
|
||||
// onLoad回调
|
||||
function ( texture ) {
|
||||
texture.name = name;
|
||||
materiallist.push(texture);
|
||||
},
|
||||
|
||||
// 目前暂不支持onProgress的回调
|
||||
undefined,
|
||||
|
||||
// onError回调
|
||||
function ( err ) {
|
||||
console.error( 'An error happened.' );
|
||||
}
|
||||
);
|
||||
}
|
||||
function setstationtexture(stationtexture,name,textureurl){
|
||||
var loader = new THREE.TextureLoader();
|
||||
// 加载一个资源
|
||||
loader.load(
|
||||
// 资源URL
|
||||
textureurl,
|
||||
|
||||
// onLoad回调
|
||||
function ( texture ) {
|
||||
texture.name = name;
|
||||
stationtexture[name] = texture;
|
||||
},
|
||||
|
||||
// 目前暂不支持onProgress的回调
|
||||
undefined,
|
||||
|
||||
// onError回调
|
||||
function ( err ) {
|
||||
console.error( 'An error happened.' );
|
||||
}
|
||||
);
|
||||
}
|
@ -1,4 +1,12 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function changeDriveTrain(group,memberId,userId) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/member/${memberId}/playby/${userId}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取仿真成员列表(新版地图)
|
||||
export function getSimulationMembersNew(group) {
|
||||
return request({
|
||||
@ -67,10 +75,10 @@ export function trainSimulationEb(group, data) {
|
||||
});
|
||||
}
|
||||
|
||||
// 改变列车牵引/制动力
|
||||
export function trainSimulationForce(group,memberId, data) {
|
||||
// 列车驾驶
|
||||
export function trainSimulationForce(group,memberId, data,operate) {
|
||||
return request({
|
||||
url: `/common/simulation/${group}/member/${memberId}/operate/Train_Drive_Speed_Control`,
|
||||
url: `/common/simulation/${group}/member/${memberId}/operate/${operate}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Vue from 'vue';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
// 模型loader
|
||||
import { AssetLoader } from '@/jlmap3d/main/loaders/AssetLoader.js';
|
||||
import { AssetLoader } from '@/jlmap3d/jl3drailwaydrive/loader/AssetLoader.js';
|
||||
import {DDSLoader} from '@/jlmap3d/main/loaders/DDSLoader.js';
|
||||
import {OBJLoader} from '@/jlmap3d/main/loaders/OBJLoader.js';
|
||||
import {MTLLoader} from '@/jlmap3d/main/loaders/MTLLoader.js';
|
||||
@ -25,7 +25,7 @@ import { DriverLoadNew } from '@/jlmap3d/jl3drailwaydrive/loader/DriverLoadNew';
|
||||
// connect
|
||||
import {Jl3dDrivingNew} from '@/jlmap3d/jl3drailwaydrive/moveupdate/DrivingConnectNew';
|
||||
|
||||
import { getPublishMapVersion, getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
// utils
|
||||
import { UpdateTrain } from '@/jlmap3d/jl3drailwaydrive/moveupdate/UpdateTrain';
|
||||
@ -135,6 +135,8 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
// sound.play();
|
||||
// });
|
||||
|
||||
|
||||
|
||||
let controls3 = new MouseControls(camera, 1.6);
|
||||
controls3.enabled = false;
|
||||
// controls3.getObject().rotation.x = Math.PI/2;
|
||||
|
486
src/jlmap3d/jl3drailwaydrive/loader/AssetLoader.js
Normal file
@ -0,0 +1,486 @@
|
||||
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';
|
||||
|
||||
let signal5 = {
|
||||
id:"s1",
|
||||
name:"竖5灯",
|
||||
deviceType:"signal5",
|
||||
type:"static",
|
||||
mesh:"",
|
||||
url:JL3D_LOCAL_STATIC+"/jl3d/railway/model/signal5.FBX"
|
||||
}
|
||||
|
||||
let signal32 = {
|
||||
id:"s2",
|
||||
name:"32灯",
|
||||
deviceType:"signal32",
|
||||
type:"static",
|
||||
mesh:"",
|
||||
url:JL3D_LOCAL_STATIC+"/jl3d/railway/model/signal32.FBX"
|
||||
}
|
||||
|
||||
let signal3 = {
|
||||
id:"s3",
|
||||
name:"3灯",
|
||||
deviceType:"signal3",
|
||||
type:"static",
|
||||
mesh:"",
|
||||
url:JL3D_LOCAL_STATIC+"/jl3d/railway/model/signal3.FBX"
|
||||
}
|
||||
|
||||
let signal2 = {
|
||||
id:"s4",
|
||||
name:"2灯",
|
||||
deviceType:"signal2",
|
||||
type:"static",
|
||||
mesh:"",
|
||||
url:JL3D_LOCAL_STATIC+"/jl3d/railway/model/signal2.FBX"
|
||||
}
|
||||
|
||||
|
||||
export function AssetLoader(){
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.name = null;
|
||||
|
||||
this.trainoffset = 0;
|
||||
|
||||
this.modellist = [];
|
||||
this.modelgroup = [];
|
||||
|
||||
this.materiallist = [];
|
||||
|
||||
this.setModelListOver = function (data,trainoffset,others){
|
||||
|
||||
if(trainoffset){
|
||||
scope.trainoffset = trainoffset;
|
||||
}
|
||||
|
||||
let signal5model = new AssetModel(signal5);
|
||||
scope.modellist.push(signal5);
|
||||
|
||||
let signal32model = new AssetModel(signal32);
|
||||
scope.modellist.push(signal32);
|
||||
|
||||
let signal3model = new AssetModel(signal3);
|
||||
scope.modellist.push(signal3);
|
||||
|
||||
let signal2model = new AssetModel(signal2);
|
||||
scope.modellist.push(signal2);
|
||||
|
||||
|
||||
let modeldata = data;
|
||||
|
||||
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){
|
||||
|
||||
had = true;
|
||||
|
||||
i = scope.modellist.length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(had == false){
|
||||
if(modeldata[j].url != ""){
|
||||
let model = new AssetModel(modeldata[j]);
|
||||
scope.modellist.push(modeldata[j]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.assetPromiseOver = function (scene){
|
||||
let initlist = [];
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
initlist.push(fbxPromiseOver(scope.modellist[i]));
|
||||
}
|
||||
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
|
||||
Promise.all(initlist).then((result) => {
|
||||
|
||||
resolve("loaderassets"); //['成功了', 'success']
|
||||
}).catch((error) => {
|
||||
//console.log(error);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.assetpromise = function (scene){
|
||||
let initlist = [];
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
initlist.push(fbxpromiseold(scope.modellist[i]));
|
||||
|
||||
}
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
|
||||
Promise.all(initlist).then((result) => {
|
||||
|
||||
resolve("loaderassets"); //['成功了', 'success']
|
||||
}).catch((error) => {
|
||||
//console.log(error);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
this.assetinit = function(scene){
|
||||
return new Promise(function(resolve, reject){
|
||||
let signal = new AssetModel(defaultsignal);
|
||||
scope.modellist.push(signal);
|
||||
|
||||
let train = new AssetModel(defaulttrain);
|
||||
scope.modellist.push(train);
|
||||
|
||||
let station = new AssetModel(defaultstation);
|
||||
scope.modellist.push(station);
|
||||
|
||||
let wstation = new AssetModel(waicestation);
|
||||
scope.modellist.push(wstation);
|
||||
|
||||
let autorail = new AssetModel(defaultautorail);
|
||||
scope.modellist.push(autorail);
|
||||
|
||||
let defaultswitch1 = new AssetModel(autoswitch1);
|
||||
scope.modellist.push(defaultswitch1);
|
||||
|
||||
let defaultswitch2 = new AssetModel(autoswitch2);
|
||||
scope.modellist.push(defaultswitch2);
|
||||
|
||||
|
||||
let autoswitchs = new AssetModel(autoswitch);
|
||||
scope.modellist.push(autoswitchs);
|
||||
|
||||
fbxpromise(signal)
|
||||
.then(function(data){
|
||||
////console.log(data);
|
||||
// console.log("test");
|
||||
return fbxpromise(train);
|
||||
})
|
||||
.then(function(data){
|
||||
////console.log(data);
|
||||
// console.log("test");
|
||||
return fbxpromise(station);
|
||||
})
|
||||
.then(function(data){
|
||||
////console.log(data);
|
||||
// console.log("test");
|
||||
return fbxpromise(wstation);
|
||||
})
|
||||
// .then(function(data){
|
||||
// ////console.log(data);
|
||||
// return fbxpromise(autorail);
|
||||
// })
|
||||
// .then(function(data){
|
||||
// ////console.log(data);
|
||||
// return fbxpromise(autosuidao);
|
||||
// })
|
||||
.then(function(data){
|
||||
////console.log(data);
|
||||
// console.log("defaultswitch1");
|
||||
return fbxpromise(defaultswitch1);
|
||||
})
|
||||
.then(function(data){
|
||||
// console.log("defaultswitch2");
|
||||
////console.log(data);
|
||||
return fbxpromise(defaultswitch2);
|
||||
})
|
||||
.then(function(data){
|
||||
////console.log(data);
|
||||
// console.log("autoswitchs");
|
||||
return fbxpromise(autoswitchs);
|
||||
})
|
||||
.then(function(data){
|
||||
////console.log(scope.modellist);
|
||||
resolve("loaderassets");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.loadnewsection = function(newdata,jlmap3dedit){
|
||||
let loadingInstance = Loading.service({ fullscreen: true });
|
||||
let scene = jlmap3dedit.scene;
|
||||
let newmodel = new AssetModel(newdata);
|
||||
let jlmap3ddata = jlmap3dedit.mapdata;
|
||||
scope.modellist.push(newmodel);
|
||||
|
||||
scene.remove(jlmap3dedit.exportmodel);
|
||||
var loader = new THREE.FBXLoader();
|
||||
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++){
|
||||
|
||||
let name = newmesh.children[i].name.split("_");
|
||||
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(jlmap3ddata.sectionlist.switchs.datalist[j].name == newmeshname){
|
||||
//绿色道岔
|
||||
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++){
|
||||
newmesh.children[i].children[n].code = nowcode;
|
||||
}
|
||||
|
||||
jlmap3ddata.sectionlist.switchs.modellist[j] = newmesh.children[i];
|
||||
j = jlmap3ddata.sectionlist.switchs.datalist.length;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(name[0] == "Section"){
|
||||
|
||||
//物理区段
|
||||
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].isStandTrack == true){
|
||||
//红色站台区段
|
||||
var box = new THREE.BoxHelper( newmesh.children[i], 0xff0000 );
|
||||
}else{
|
||||
//蓝色其他区段
|
||||
var box = new THREE.BoxHelper( newmesh.children[i], 0x0000ff );
|
||||
}
|
||||
scene.add( box );
|
||||
|
||||
let nowname = jlmap3ddata.sectionlist.sections.datalist[j].name;
|
||||
let nowcode = jlmap3ddata.sectionlist.sections.datalist[j].code;
|
||||
newmesh.children[i].name = nowname;
|
||||
newmesh.children[i].code = nowcode;
|
||||
jlmap3ddata.sectionlist.sections.modellist[j] = newmesh.children[i];
|
||||
j = jlmap3ddata.sectionlist.sections.datalist.length;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(name[0] == "Singal"){
|
||||
|
||||
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;
|
||||
|
||||
j = jlmap3ddata.signallist.list.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(name[0] == "Station"){
|
||||
|
||||
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;
|
||||
|
||||
j = jlmap3ddata.stationstandlist.list.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
scene.add(newmesh);
|
||||
loadingInstance.close();
|
||||
//console.log("add");
|
||||
} );
|
||||
|
||||
}
|
||||
//新载入资源
|
||||
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 ) {
|
||||
|
||||
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++){
|
||||
object.children[j].code = jlmap3dedit.mapdata.signallist.list[num].mesh.code;
|
||||
}
|
||||
|
||||
object.position.x = jlmap3dedit.mapdata.signallist.list[num].mesh.position.x;
|
||||
object.position.y = jlmap3dedit.mapdata.signallist.list[num].mesh.position.y;
|
||||
object.position.z = jlmap3dedit.mapdata.signallist.list[num].mesh.position.z;
|
||||
|
||||
object.rotation.x = jlmap3dedit.mapdata.signallist.list[num].mesh.rotation.x;
|
||||
object.rotation.y = jlmap3dedit.mapdata.signallist.list[num].mesh.rotation.y;
|
||||
object.rotation.z = jlmap3dedit.mapdata.signallist.list[num].mesh.rotation.z;
|
||||
|
||||
object.scale.x = jlmap3dedit.mapdata.signallist.list[num].mesh.scale.x;
|
||||
object.scale.y = jlmap3dedit.mapdata.signallist.list[num].mesh.scale.y;
|
||||
object.scale.z = jlmap3dedit.mapdata.signallist.list[num].mesh.scale.z;
|
||||
//object.scale.set(0.1,0.1,0.1);
|
||||
jlmap3dedit.mapdata.signallist.list[num].mesh = null;
|
||||
|
||||
jlmap3dedit.mapdata.signallist.list[num].mesh = 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){
|
||||
|
||||
let assetnum = null;
|
||||
for(let i=0;i<scope.modellist.length;i++){
|
||||
|
||||
if(newdata.uuid == scope.modellist[i].uuid){
|
||||
assetnum = i;
|
||||
}
|
||||
}
|
||||
|
||||
jlmap3dedit.transcontrol.detach();
|
||||
jlmap3dedit.mapdata.signallist.group.remove(jlmap3dedit.mapdata.signallist.list[num].mesh);
|
||||
|
||||
let newmesh = scope.modellist[assetnum].mesh.clone(true);
|
||||
|
||||
newmesh.name = scope.modellist[assetnum].uuid;
|
||||
newmesh.code = jlmap3dedit.mapdata.signallist.list[num].mesh.code;
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
newmesh.children[j].code = jlmap3dedit.mapdata.signallist.list[num].mesh.code;
|
||||
}
|
||||
|
||||
newmesh.position.x = jlmap3dedit.mapdata.signallist.list[num].mesh.position.x;
|
||||
newmesh.position.y = jlmap3dedit.mapdata.signallist.list[num].mesh.position.y;
|
||||
newmesh.position.z = jlmap3dedit.mapdata.signallist.list[num].mesh.position.z;
|
||||
|
||||
newmesh.rotation.x = jlmap3dedit.mapdata.signallist.list[num].mesh.rotation.x;
|
||||
newmesh.rotation.y = jlmap3dedit.mapdata.signallist.list[num].mesh.rotation.y;
|
||||
newmesh.rotation.z = jlmap3dedit.mapdata.signallist.list[num].mesh.rotation.z;
|
||||
|
||||
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.transcontrol.attach(jlmap3dedit.mapdata.signallist.list[num].mesh);
|
||||
jlmap3dedit.selectmodel = jlmap3dedit.mapdata.signallist.list[num].mesh;
|
||||
return jlmap3dedit.selectmodel;
|
||||
}
|
||||
//去除未加载资源并释放内存
|
||||
this.updatelist = function(){
|
||||
|
||||
}
|
||||
//创建新模型
|
||||
this.createmodel = function(){
|
||||
|
||||
}
|
||||
//创建新材质
|
||||
this.creatematerial = function(){
|
||||
|
||||
}
|
||||
|
||||
function fbxPromiseOver(asset){
|
||||
return new Promise(function(resolve, reject){
|
||||
var loader = new THREE.FBXLoader();
|
||||
console.log(asset);
|
||||
if(asset.type == "static"){
|
||||
loader.load(asset.url, function ( object ) {
|
||||
let mixer = new THREE.AnimationMixer( object );
|
||||
//object.traverse(function (node) {//获取其中对象
|
||||
// node.frustumCulled = true;
|
||||
//});
|
||||
|
||||
if(asset.code){
|
||||
scope.modelgroup[asset.code] = object;
|
||||
}else{
|
||||
asset.mesh = object;
|
||||
}
|
||||
|
||||
//object.scale.set(0.1,0.1,0.1);
|
||||
|
||||
resolve("fbxload");
|
||||
} );
|
||||
|
||||
}else{
|
||||
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){
|
||||
scope.modelgroup[asset.code] = object;
|
||||
}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){
|
||||
|
||||
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--;
|
||||
}
|
||||
}
|
||||
}
|
||||
asset.mesh = realtrain;
|
||||
asset.animations = object.animations[0].tracks;
|
||||
|
||||
}else if(asset.type == "train" && object.name == "C6"){
|
||||
let realtrain = new THREE.Group();
|
||||
object.position.x = object.position.x+scope.trainoffset;
|
||||
realtrain.add(object);
|
||||
asset.mesh = realtrain;
|
||||
}else{
|
||||
asset.mesh = object;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//object.scale.set(0.1,0.1,0.1);
|
||||
|
||||
resolve("fbxload");
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
//componnent
|
||||
|
||||
|
||||
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
||||
import {Materialload} from '@/jlmap3d/jl3drailwaydrive/loader/Materialload.js';
|
||||
|
||||
import {SectionListN} from '@/jlmap3d/main/newmodel/SectionListN';
|
||||
import {SignalListN} from '@/jlmap3d/main/newmodel/SignalListN';
|
||||
import {StationStandListN} from '@/jlmap3d/main/newmodel/StationStandListN';
|
||||
import {SwitchListN} from '@/jlmap3d/main/newmodel/SwitchListN';
|
||||
import {RailListN} from '@/jlmap3d/main/newmodel/RailListN.js';
|
||||
import {TrainListN} from '@/jlmap3d/main/newmodel/TrainListN.js';
|
||||
import {TdtList} from '@/jlmap3d/main/newmodel/TdtList.js';
|
||||
import {SectionListN} from '@/jlmap3d/jl3drailwaydrive/model/SectionListN';
|
||||
import {SignalListN} from '@/jlmap3d/jl3drailwaydrive/model/SignalListN';
|
||||
import {StationStandListN} from '@/jlmap3d/jl3drailwaydrive/model/StationStandListN';
|
||||
import {SwitchListN} from '@/jlmap3d/jl3drailwaydrive/model/SwitchListN';
|
||||
import {RailListN} from '@/jlmap3d/jl3drailwaydrive/model/RailListN.js';
|
||||
import {TrainListN} from '@/jlmap3d/jl3drailwaydrive/model/TrainListN.js';
|
||||
import {TdtList} from '@/jlmap3d/jl3drailwaydrive/model/TdtList.js';
|
||||
|
||||
import { Loading } from 'element-ui';
|
||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
||||
@ -111,6 +111,7 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
|
||||
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
|
||||
if(scope.assetloader.modellist[mn].deviceType && scope.assetloader.modellist[mn].type == "suidao"){
|
||||
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
|
||||
scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,tdt,scope.materiallist,scope.actions,scope.sceneload);
|
||||
|
||||
// scope.assetloader.modellist[mn].mesh.position.y = 10;
|
||||
scene.add(scope.assetloader.modellist[mn].mesh);
|
||||
|
74
src/jlmap3d/jl3drailwaydrive/loader/Materialload.js
Normal file
@ -0,0 +1,74 @@
|
||||
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export function Materialload(jlmap3dedit,standTextureData){
|
||||
if(jlmap3dedit.materiallist){
|
||||
settexture(jlmap3dedit.materiallist,"red",JL3D_LOCAL_STATIC+'/jl3d/railway/texture/1.jpg');
|
||||
|
||||
settexture(jlmap3dedit.materiallist,"yellow",JL3D_LOCAL_STATIC+'/jl3d/railway/texture/2.jpg');
|
||||
|
||||
settexture( jlmap3dedit.materiallist,"green",JL3D_LOCAL_STATIC+'/jl3d/railway/texture/3.jpg');
|
||||
|
||||
settexture( jlmap3dedit.materiallist,"white",JL3D_LOCAL_STATIC+'/jl3d/railway/texture/4.jpg');
|
||||
|
||||
settexture( jlmap3dedit.materiallist,"blue",JL3D_LOCAL_STATIC+'/jl3d/railway/texture/5.jpg');
|
||||
|
||||
settexture( jlmap3dedit.materiallist,"black",JL3D_LOCAL_STATIC+'/jl3d/railway/texture/6.jpg');
|
||||
}
|
||||
if(standTextureData){
|
||||
if(standTextureData.urls.length > 1){
|
||||
for(let i=0,leni=standTextureData.urls.length;i<leni;i++){
|
||||
setstationtexture(jlmap3dedit.stationtexture,standTextureData.urls[i].name,BASE_ASSET_API + standTextureData.urls[i].url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function settexture(materiallist,name,textureurl){
|
||||
var loader = new THREE.TextureLoader();
|
||||
|
||||
// 加载一个资源
|
||||
loader.load(
|
||||
// 资源URL
|
||||
textureurl,
|
||||
|
||||
// onLoad回调
|
||||
function ( texture ) {
|
||||
texture.name = name;
|
||||
materiallist[name] = texture;
|
||||
},
|
||||
|
||||
// 目前暂不支持onProgress的回调
|
||||
undefined,
|
||||
|
||||
// onError回调
|
||||
function ( err ) {
|
||||
console.error( 'An error happened.' );
|
||||
}
|
||||
);
|
||||
}
|
||||
function setstationtexture(stationtexture,name,textureurl){
|
||||
var loader = new THREE.TextureLoader();
|
||||
|
||||
// 加载一个资源
|
||||
loader.load(
|
||||
// 资源URL
|
||||
textureurl,
|
||||
|
||||
// onLoad回调
|
||||
function ( texture ) {
|
||||
texture.name = name;
|
||||
stationtexture[name] = texture;
|
||||
},
|
||||
|
||||
// 目前暂不支持onProgress的回调
|
||||
undefined,
|
||||
|
||||
// onError回调
|
||||
function ( err ) {
|
||||
console.error( 'An error happened.' );
|
||||
}
|
||||
);
|
||||
}
|
277
src/jlmap3d/jl3drailwaydrive/model/RailListN.js
Normal file
@ -0,0 +1,277 @@
|
||||
export function RailListN(){
|
||||
let scope = this;
|
||||
|
||||
this.sectionrail = [];
|
||||
|
||||
this.switchrail = [];
|
||||
|
||||
this.stops = [];
|
||||
|
||||
this.setrail = function(){
|
||||
|
||||
};
|
||||
// this.init = function(section,linklist,scene){
|
||||
this.init = function(section,sectionList,switchdata,scene){
|
||||
// console.log(section);
|
||||
// console.log(switchdata);
|
||||
for(let i=0;i<section.length;i++){
|
||||
scope.sectionrail[section[i].code] = {
|
||||
lp:section[i].lp,
|
||||
rp:section[i].rp,
|
||||
lconnect:null,
|
||||
rconnect:null,
|
||||
lengthfact:section[i].lengthFact,
|
||||
lineleft:null,
|
||||
lineright:null,
|
||||
points:[],
|
||||
type:null
|
||||
};
|
||||
}
|
||||
|
||||
for(let i=0;i<switchdata.length;i++){
|
||||
|
||||
if(scope.sectionrail[switchdata[i].pb].lp.x < switchdata[i].position.x){
|
||||
scope.sectionrail[switchdata[i].pa].lswitch = switchdata[i].code;
|
||||
scope.sectionrail[switchdata[i].pa].type = "a";
|
||||
scope.sectionrail[switchdata[i].pb].rswitch = switchdata[i].code;
|
||||
scope.sectionrail[switchdata[i].pb].type = "b";
|
||||
}else{
|
||||
scope.sectionrail[switchdata[i].pa].rswitch = switchdata[i].code;
|
||||
scope.sectionrail[switchdata[i].pa].type = "a";
|
||||
scope.sectionrail[switchdata[i].pb].lswitch = switchdata[i].code;
|
||||
scope.sectionrail[switchdata[i].pb].type = "b";
|
||||
}
|
||||
//
|
||||
if(scope.sectionrail[switchdata[i].pc].lp.x < switchdata[i].position.x){
|
||||
scope.sectionrail[switchdata[i].pa].lswitch = switchdata[i].code;
|
||||
scope.sectionrail[switchdata[i].pa].type = "a";
|
||||
scope.sectionrail[switchdata[i].pc].rswitch = switchdata[i].code;
|
||||
scope.sectionrail[switchdata[i].pc].type = "c";
|
||||
}else{
|
||||
scope.sectionrail[switchdata[i].pa].rswitch = switchdata[i].code;
|
||||
scope.sectionrail[switchdata[i].pa].type = "a";
|
||||
scope.sectionrail[switchdata[i].pc].lswitch = switchdata[i].code;
|
||||
scope.sectionrail[switchdata[i].pc].type = "c";
|
||||
}
|
||||
}
|
||||
for(let i=0;i<section.length;i++){
|
||||
// if(scope.sectionrail[section[i].code].type == "a" || scope.sectionrail[section[i].code].type == "b" || ){
|
||||
// }
|
||||
|
||||
if(scope.sectionrail[section[i].code].type == "c" ){
|
||||
scope.sectionrail[section[i].code].points.push(new THREE.Vector3(scope.sectionrail[section[i].code].lp.x,0,scope.sectionrail[section[i].code].lp.z));
|
||||
scope.sectionrail[section[i].code].points.push(new THREE.Vector3(scope.sectionrail[section[i].code].rp.x,0,scope.sectionrail[section[i].code].rp.z));
|
||||
}else{
|
||||
scope.sectionrail[section[i].code].points.push(new THREE.Vector3(scope.sectionrail[section[i].code].lp.x,0,scope.sectionrail[section[i].code].lp.z));
|
||||
scope.sectionrail[section[i].code].points.push(new THREE.Vector3(scope.sectionrail[section[i].code].rp.x,0,scope.sectionrail[section[i].code].rp.z));
|
||||
|
||||
}
|
||||
}
|
||||
// for(let i=0;i<section.length;i++){
|
||||
//
|
||||
//
|
||||
// if(section[i].rotation._z == 0){
|
||||
// scope.sectionrail[section[i].code].type = "a";
|
||||
//
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(scope.sectionrail[section[i].code].lp.x,0,scope.sectionrail[section[i].code].lp.z));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(scope.sectionrail[section[i].code].rp.x,0,scope.sectionrail[section[i].code].rp.z));
|
||||
//
|
||||
// }else{
|
||||
//
|
||||
// if(section[i].rotation._z>0){
|
||||
// let testline = new THREE.CatmullRomCurve3([
|
||||
// new THREE.Vector3(scope.sectionrail[section[i].code].lp.x,0,scope.sectionrail[section[i].code].lp.z),
|
||||
// new THREE.Vector3(scope.sectionrail[section[i].code].rp.x,0,scope.sectionrail[section[i].code].rp.z)
|
||||
// ]);
|
||||
//
|
||||
// scope.sectionrail[section[i].code].type = "b";
|
||||
// if(scope.sectionrail[section[i].code].lswitch){
|
||||
// let switchpoint1 = scope.sectionrail[section[i].code].lp;
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint1.x,0,switchpoint1.z));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint1.x+0.5,0,switchpoint1.z));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint1.x+1,0,switchpoint1.z-0.02));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint1.x+1.5,0,switchpoint1.z-0.09));
|
||||
// // scope.sectionrail[section[i].code].points.push(testline.getPointAt(0.7));
|
||||
// scope.sectionrail[section[i].code].points.push(testline.getPointAt(1));
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// if(scope.sectionrail[section[i].code].rswitch){
|
||||
// let switchpoint2 = scope.sectionrail[section[i].code].rp;
|
||||
// scope.sectionrail[section[i].code].points.push(testline.getPointAt(0));
|
||||
// // scope.sectionrail[section[i].code].points.push(testline.getPointAt(0.3));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint2.x-1.5,0,switchpoint2.z+0.09));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint2.x-1,0,switchpoint2.z+0.02));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint2.x-0.5,0,switchpoint2.z));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint2.x,0,switchpoint2.z));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }else{
|
||||
// let testline = new THREE.CatmullRomCurve3([
|
||||
// new THREE.Vector3(scope.sectionrail[section[i].code].lp.x,0,scope.sectionrail[section[i].code].lp.z),
|
||||
// new THREE.Vector3(scope.sectionrail[section[i].code].rp.x,0,scope.sectionrail[section[i].code].rp.z)
|
||||
// ]);
|
||||
// scope.sectionrail[section[i].code].type = "c";
|
||||
//
|
||||
// if(scope.sectionrail[section[i].code].lswitch){
|
||||
// let switchpoint1 = scope.sectionrail[section[i].code].lp;
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint1.x,0,switchpoint1.z));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint1.x+0.5,0,switchpoint1.z));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint1.x+1,0,switchpoint1.z+0.02));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint1.x+1.5,0,switchpoint1.z+0.09));
|
||||
// // scope.sectionrail[section[i].code].points.push(testline.getPointAt(0.7));
|
||||
// scope.sectionrail[section[i].code].points.push(testline.getPointAt(1));
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// if(scope.sectionrail[section[i].code].rswitch){
|
||||
// let switchpoint2 = scope.sectionrail[section[i].code].rp;
|
||||
// scope.sectionrail[section[i].code].points.push(testline.getPointAt(0));
|
||||
// // scope.sectionrail[section[i].code].points.push(testline.getPointAt(0.3));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint2.x-1.5,0,switchpoint2.z-0.09));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint2.x-1,0,switchpoint2.z-0.02));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint2.x-0.5,0,switchpoint2.z));
|
||||
// scope.sectionrail[section[i].code].points.push(new THREE.Vector3(switchpoint2.x,0,switchpoint2.z));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
|
||||
for(let i=0;i<section.length;i++){
|
||||
|
||||
scope.sectionrail[section[i].code].lineleft = new THREE.CatmullRomCurve3(scope.sectionrail[section[i].code].points);
|
||||
scope.sectionrail[section[i].code].lineleft.curveType = "chordal";
|
||||
scope.sectionrail[section[i].code].lineleft.tension = 0.15;
|
||||
scope.sectionrail[section[i].code].lineleft.name = section[i].code;
|
||||
let rightpoints = [];
|
||||
scope.sectionrail[section[i].code].points.forEach(item=>{
|
||||
rightpoints.push(item);
|
||||
}
|
||||
);
|
||||
rightpoints.reverse();
|
||||
scope.sectionrail[section[i].code].lineright = new THREE.CatmullRomCurve3(rightpoints);
|
||||
scope.sectionrail[section[i].code].lineright.curveType = "chordal";
|
||||
scope.sectionrail[section[i].code].lineright.tension = 0.15;
|
||||
scope.sectionrail[section[i].code].lineright.name = section[i].code;
|
||||
if(section[i].standTrack == true){
|
||||
scope.sectionrail[section[i].code].standTrack = true;
|
||||
// var geometry = new THREE.CircleGeometry( 5, 16 );
|
||||
// var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
||||
// var circle1 = new THREE.Mesh( geometry, material );
|
||||
// var circle2 = new THREE.Mesh( geometry, material );
|
||||
// circle1.position.x = scope.sectionrail[section[i].code].points[0].x;
|
||||
// circle1.position.y = 5;
|
||||
// circle1.position.z = scope.sectionrail[section[i].code].points[0].z;
|
||||
// circle1.rotation.x = -Math.PI/2;
|
||||
// circle2.position.x = scope.sectionrail[section[i].code].points[1].x;
|
||||
// circle2.position.y = 5;
|
||||
// circle2.position.z = scope.sectionrail[section[i].code].points[1].z;
|
||||
// circle2.rotation.x = -Math.PI/2;
|
||||
// scene.add( circle1 );
|
||||
// scene.add( circle2 );
|
||||
// console.log(scope.sectionrail[section[i].code]);
|
||||
}else{
|
||||
scope.sectionrail[section[i].code].standTrack = false;
|
||||
}
|
||||
|
||||
//
|
||||
// for(let n=0,nm=scope.sectionrail[section[i].code].lineleft.points.length;n<nm;n++){
|
||||
// var geometry = new THREE.CircleGeometry( 0.05, 16 );
|
||||
// var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
||||
// var circle = new THREE.Mesh( geometry, material );
|
||||
// // console.log(n);
|
||||
// // console.log(scope.sectionrail[section[i].code].lineleft.points[n]);
|
||||
// circle.position.x = scope.sectionrail[section[i].code].lineleft.points[n].x;
|
||||
// circle.position.y = scope.sectionrail[section[i].code].lineleft.points[n].y;
|
||||
// circle.position.z = scope.sectionrail[section[i].code].lineleft.points[n].z;
|
||||
// circle.rotation.x = -Math.PI/2;
|
||||
// scene.add( circle );
|
||||
// }
|
||||
// // scope.sectionrail[section[i].code].lineright.tension = 0.11;
|
||||
// var points = scope.sectionrail[section[i].code].lineleft.getPoints( 50 );
|
||||
// var geometry = new THREE.BufferGeometry().setFromPoints( points );
|
||||
// var material;
|
||||
// if(scope.sectionrail[section[i].code].type == "a"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
|
||||
// }
|
||||
// if(scope.sectionrail[section[i].code].type == "b"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0x00ff00 } );
|
||||
// }
|
||||
// if(scope.sectionrail[section[i].code].type == "c"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0x0000ff } );
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // Create the final object to add to the scene
|
||||
// var curveObject = new THREE.Line( geometry, material );
|
||||
//
|
||||
// curveObject.position.y = Math.random();
|
||||
// scene.add(curveObject);
|
||||
}
|
||||
|
||||
}
|
||||
this.setrails = function(sectioncode,points,standtrack,lengthfact,scene){
|
||||
scope.sectionrail[sectioncode] = {
|
||||
lengthfact:lengthfact,
|
||||
lineleft:null,
|
||||
lineright:null,
|
||||
standTrack:standtrack,
|
||||
};
|
||||
let leftpoints = [];
|
||||
let rightpoints = [];
|
||||
for(let i=0;i<points.length;i++){
|
||||
leftpoints.push(points[i]);
|
||||
rightpoints.push(points[points.length-i-1]);
|
||||
}
|
||||
|
||||
scope.sectionrail[sectioncode].lineleft = new THREE.CatmullRomCurve3(leftpoints);
|
||||
scope.sectionrail[sectioncode].lineleft.type = "catmullrom";
|
||||
scope.sectionrail[sectioncode].lineleft.closed = false;
|
||||
scope.sectionrail[sectioncode].lineleft.name = sectioncode;
|
||||
|
||||
scope.sectionrail[sectioncode].lineright = new THREE.CatmullRomCurve3(rightpoints);
|
||||
scope.sectionrail[sectioncode].lineright.type = "catmullrom";
|
||||
scope.sectionrail[sectioncode].lineright.closed = false;
|
||||
scope.sectionrail[sectioncode].lineright.name = sectioncode;
|
||||
|
||||
// for(let n=0,nm=scope.sectionrail[sectioncode].lineleft.points.length;n<nm;n++){
|
||||
// var geometry = new THREE.CircleGeometry( 0.05, 16 );
|
||||
// var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
||||
// var circle = new THREE.Mesh( geometry, material );
|
||||
// // console.log(n);
|
||||
// // console.log(scope.sectionrail[section[i].code].lineleft.points[n]);
|
||||
// circle.position.x = scope.sectionrail[sectioncode].lineleft.points[n].x;
|
||||
// circle.position.y = scope.sectionrail[sectioncode].lineleft.points[n].y;
|
||||
// circle.position.z = scope.sectionrail[sectioncode].lineleft.points[n].z;
|
||||
// circle.rotation.x = -Math.PI/2;
|
||||
// scene.add( circle );
|
||||
// }
|
||||
// // scope.sectionrail[section[i].code].lineright.tension = 0.11;
|
||||
// var points = scope.sectionrail[sectioncode].lineleft.getPoints( 50 );
|
||||
// var geometry = new THREE.BufferGeometry().setFromPoints( points );
|
||||
// var material;
|
||||
// if(scope.sectionrail[sectioncode].type == "a"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
|
||||
// }
|
||||
// if(scope.sectionrail[sectioncode].type == "b"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0x00ff00 } );
|
||||
// }
|
||||
// if(scope.sectionrail[sectioncode].type == "c"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0x0000ff } );
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // Create the final object to add to the scene
|
||||
// var curveObject = new THREE.Line( geometry, material );
|
||||
//
|
||||
// curveObject.position.y = Math.random();
|
||||
// scene.add(curveObject);
|
||||
}
|
||||
}
|
240
src/jlmap3d/jl3drailwaydrive/model/SectionListN.js
Normal file
@ -0,0 +1,240 @@
|
||||
import {SectionModel} from '@/jlmap3d/main/newmodel/SectionModel.js';
|
||||
import {SwitchModel} from '@/jlmap3d/main/newmodel/SwitchModel.js';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
export function SectionListN() {
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.type = "sectionlist";
|
||||
|
||||
this.sectiongroup = new THREE.Group();
|
||||
this.sectiongroup.name = "section";
|
||||
|
||||
|
||||
this.sections = {
|
||||
datalist:[],
|
||||
modellist:[]
|
||||
};
|
||||
this.stopsection = [];
|
||||
this.standtrack = [];
|
||||
var autorail;
|
||||
this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
|
||||
|
||||
var texture = new THREE.TextureLoader().load( JL3D_LOCAL_STATIC+'/test/z0251.png' );
|
||||
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
|
||||
texture.anisotropy = 0;
|
||||
texture.magFilter = THREE.NearestFilter;
|
||||
texture.minFilter = THREE.NearestFilter;
|
||||
texture.repeat.set( 1,1);
|
||||
|
||||
var selectmaterial = new THREE.MeshPhongMaterial( { map: texture,transparent:true,alphaTest:0.1 } );
|
||||
|
||||
// for(let i=0;i<assetloader.modellist.length;i++){
|
||||
// if(assetloader.modellist[i].deviceType == "autorail"){
|
||||
// autorail = assetloader.modellist[i].mesh.children[0];
|
||||
// }
|
||||
// }
|
||||
// let count = autorail.geometry.attributes.position.count;
|
||||
// let rightlist = [];
|
||||
// let leftlist = [];
|
||||
// for(let i=0;i<count;i++){
|
||||
// if(autorail.geometry.attributes.position.array[i*3] >0.49){
|
||||
// rightlist.push(i);
|
||||
// }
|
||||
// if(autorail.geometry.attributes.position.array[i*3] <-0.49){
|
||||
// leftlist.push(i);
|
||||
// }
|
||||
// }
|
||||
// autorail.rightlist = rightlist;
|
||||
// autorail.leftlist = leftlist;
|
||||
scene.add(scope.sectiongroup);
|
||||
return new Promise(function(resolve, reject){
|
||||
// console.log(sectiondata);
|
||||
let mergegeometry = new THREE.Geometry();
|
||||
for(let i=0,leni = sectiondata.length;i<leni;i++){
|
||||
|
||||
let newsection = {
|
||||
code:sectiondata[i].code,
|
||||
name:sectiondata[i].name,
|
||||
standTrack:sectiondata[i].standTrack,
|
||||
rail:sectiondata[i].rail,
|
||||
railpoint:sectiondata[i].railpoint,
|
||||
lengthFact:sectiondata[i].lengthFact,
|
||||
|
||||
lconnect:null,
|
||||
rconnect:null,
|
||||
lineleft:null,
|
||||
lineright:null,
|
||||
points:[],
|
||||
type:null,
|
||||
|
||||
rp:sectiondata[i].rp,
|
||||
lp:sectiondata[i].lp,
|
||||
mesh:null
|
||||
};
|
||||
|
||||
// newsection.railpoint.length>2
|
||||
let len = newsection.lengthFact;
|
||||
// let testmesh2 = autorail.clone(true);
|
||||
// for(let i=0;i<autorail.rightlist.length;i++){
|
||||
// testmesh2.geometry.attributes.position.array[autorail.rightlist[i]*3] = len;
|
||||
// testmesh2.geometry.attributes.uv.array[autorail.rightlist[i]*2] = testmesh2.geometry.attributes.position.array[0]-testmesh2.geometry.attributes.position.array[3];
|
||||
// }
|
||||
// let newrail = new THREE.BufferGeometry();
|
||||
// newrail.copy(testmesh2.geometry);
|
||||
// testmesh2.geometry = newrail;
|
||||
// testmesh2.geometry.attributes.position.needsUpdate = true;
|
||||
// testmesh2.geometry.attributes.uv.needsUpdate = true;
|
||||
// testmesh2.geometry.computeBoundingSphere();
|
||||
// testmesh2.geometry.center();
|
||||
// testmesh2.position.set(sectiondata[i].position.x,sectiondata[i].position.y,sectiondata[i].position.z);
|
||||
// testmesh2.rotation.set(sectiondata[i].rotation._x,sectiondata[i].rotation._y,sectiondata[i].rotation._z);
|
||||
// testmesh2.matrixAutoUpdate = false;
|
||||
// scope.sections.datalist[newsection.code] = newsection;
|
||||
// testmesh2.updateMatrix();
|
||||
// mergegeometry.merge(new THREE.Geometry().fromBufferGeometry(testmesh2.geometry),testmesh2.matrix);
|
||||
// testmesh2.geometry.dispose();
|
||||
// for(let j in testmesh2.material){
|
||||
// testmesh2.material[j].map.dispose();
|
||||
// testmesh2.material[j].dispose();
|
||||
// }
|
||||
// testmesh2 = null;
|
||||
|
||||
if(newsection.railpoint.length>=3){
|
||||
// console.log(newsection);
|
||||
let height = Math.random()/1000;
|
||||
var closedSpline;
|
||||
|
||||
if(Math.abs(newsection.railpoint[0].y-newsection.railpoint[2].y)>0.01){
|
||||
closedSpline = new THREE.CatmullRomCurve3( [
|
||||
new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z),
|
||||
new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[1].y,newsection.railpoint[1].z+0.0001),
|
||||
new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z)
|
||||
] );
|
||||
}else{
|
||||
closedSpline = new THREE.CatmullRomCurve3( [
|
||||
new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[2].y,newsection.railpoint[0].z),
|
||||
new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[2].y,newsection.railpoint[1].z+0.0001),
|
||||
new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z)
|
||||
] );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// closedSpline.type = 'catmullrom';
|
||||
closedSpline.curveType = "chordal";
|
||||
closedSpline.tension = 0.15;
|
||||
closedSpline.closed = false;
|
||||
var extrudeSettings = {
|
||||
steps : 6,
|
||||
curveSegments : 1,
|
||||
bevelSegments : 1,
|
||||
bevelEnabled : false,
|
||||
extrudePath : closedSpline,
|
||||
};
|
||||
var shape = new THREE.Shape();
|
||||
|
||||
len = closedSpline.getLength();
|
||||
|
||||
|
||||
if(Math.abs(newsection.railpoint[0].y - newsection.railpoint[2].y)>0.01){
|
||||
shape.moveTo( -2, 0 );
|
||||
shape.lineTo( 2, 0 );
|
||||
}else{
|
||||
shape.moveTo( 0,-2 );
|
||||
shape.lineTo( 0, 2 );
|
||||
}
|
||||
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
|
||||
var mesh = new THREE.Mesh( geometry, selectmaterial );
|
||||
let count = mesh.geometry.attributes.position.count/3;
|
||||
|
||||
for(let i=0;i<count;i++){
|
||||
let ui=i*6;
|
||||
if(i%2 != 0){
|
||||
mesh.geometry.attributes.uv.array[ui] = 0;
|
||||
mesh.geometry.attributes.uv.array[ui+1] = 1;
|
||||
mesh.geometry.attributes.uv.array[ui+2] = len/6;
|
||||
mesh.geometry.attributes.uv.array[ui+3] = 1;
|
||||
mesh.geometry.attributes.uv.array[ui+4] = len/6;
|
||||
mesh.geometry.attributes.uv.array[ui+5] = 0;
|
||||
}else{
|
||||
mesh.geometry.attributes.uv.array[ui] = 0;
|
||||
mesh.geometry.attributes.uv.array[ui+1] = 0;
|
||||
mesh.geometry.attributes.uv.array[ui+2] = 0;
|
||||
mesh.geometry.attributes.uv.array[ui+3] = 1;
|
||||
mesh.geometry.attributes.uv.array[ui+4] = len/6;
|
||||
mesh.geometry.attributes.uv.array[ui+5] = 0;
|
||||
}
|
||||
}
|
||||
mergegeometry.merge(new THREE.Geometry().fromBufferGeometry(mesh.geometry),mesh.matrix);
|
||||
mesh.geometry.dispose();
|
||||
mesh.material.map.dispose();
|
||||
mesh.material.dispose();
|
||||
rails.setrails(sectiondata[i].code,closedSpline.points,sectiondata[i].standTrack,len,scene);
|
||||
}else{
|
||||
let height = Math.random()/1000;
|
||||
var closedSpline = new THREE.CatmullRomCurve3( [
|
||||
new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z),
|
||||
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[0].z),
|
||||
] );
|
||||
|
||||
// closedSpline.type = 'catmullrom';
|
||||
closedSpline.curveType = "chordal";
|
||||
closedSpline.tension = 0.15;
|
||||
closedSpline.closed = false;
|
||||
// Set up settings for later extrusion
|
||||
var extrudeSettings = {
|
||||
steps : 5,
|
||||
curveSegments : 1,
|
||||
bevelSegments : 1,
|
||||
bevelEnabled : false,
|
||||
extrudePath : closedSpline,
|
||||
};
|
||||
var shape = new THREE.Shape();
|
||||
|
||||
// Extrude the triangle along the CatmullRom curve
|
||||
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
|
||||
var mesh = new THREE.Mesh( geometry, selectmaterial );
|
||||
let count = mesh.geometry.attributes.position.count/3;
|
||||
|
||||
for(let i=0;i<count;i++){
|
||||
let ui=i*6;
|
||||
if(i%2 != 0){
|
||||
mesh.geometry.attributes.uv.array[ui] = 0;
|
||||
mesh.geometry.attributes.uv.array[ui+1] = 1;
|
||||
mesh.geometry.attributes.uv.array[ui+2] = len;
|
||||
mesh.geometry.attributes.uv.array[ui+3] = 1;
|
||||
mesh.geometry.attributes.uv.array[ui+4] = len;
|
||||
mesh.geometry.attributes.uv.array[ui+5] = 0;
|
||||
}else{
|
||||
mesh.geometry.attributes.uv.array[ui] = 0;
|
||||
mesh.geometry.attributes.uv.array[ui+1] = 0;
|
||||
mesh.geometry.attributes.uv.array[ui+2] = 0;
|
||||
mesh.geometry.attributes.uv.array[ui+3] = 1;
|
||||
mesh.geometry.attributes.uv.array[ui+4] = len;
|
||||
mesh.geometry.attributes.uv.array[ui+5] = 0;
|
||||
}
|
||||
}
|
||||
mergegeometry.merge(new THREE.Geometry().fromBufferGeometry(mesh.geometry),mesh.matrix);
|
||||
mesh.geometry.dispose();
|
||||
mesh.material.map.dispose();
|
||||
mesh.material.dispose();
|
||||
|
||||
rails.setrails(sectiondata[i].code,closedSpline.points,sectiondata[i].standTrack,len,scene);
|
||||
}
|
||||
}
|
||||
// let mergemesh = new THREE.Mesh( mergegeometry, autorail.material );
|
||||
let mergemesh = new THREE.Mesh( mergegeometry, selectmaterial );
|
||||
mergemesh.matrixAutoUpdate = false;
|
||||
scope.sectiongroup.add(mergemesh);
|
||||
|
||||
resolve("loadersection");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
this.resetsection = function(scene){
|
||||
scene.remove(scope.sectiongroup);
|
||||
};
|
||||
|
||||
}
|
30
src/jlmap3d/jl3drailwaydrive/model/SectionModel.js
Normal file
@ -0,0 +1,30 @@
|
||||
export function SectionModel(data) {
|
||||
var scope = this;
|
||||
//命名
|
||||
this.name = null;
|
||||
//code
|
||||
this.code = null;
|
||||
//索引位置
|
||||
this.index = null;
|
||||
//轨迹点
|
||||
this.rail = [];
|
||||
|
||||
this.railline = null;
|
||||
//长度
|
||||
this.distance = [];
|
||||
|
||||
this.isStandTrack = null;
|
||||
|
||||
this.rsection = null;
|
||||
|
||||
this.lsection = null;
|
||||
|
||||
this.type = null;
|
||||
//指向模型
|
||||
this.mesh = null;
|
||||
// //模型地址
|
||||
// this.meshurl = null;
|
||||
// //贴图地址
|
||||
// this.picurl = null;
|
||||
|
||||
}
|
100
src/jlmap3d/jl3drailwaydrive/model/SignalListN.js
Normal file
@ -0,0 +1,100 @@
|
||||
import {SignalModel} from '@/jlmap3d/main/newmodel/SignalModel.js';
|
||||
|
||||
export function SignalListN() {
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.type = "signallist";
|
||||
|
||||
this.list = [];
|
||||
|
||||
this.group = new THREE.Group();
|
||||
this.group.name = "signallist";
|
||||
this.loadpromise = function(data,signaldata,scene,assetloader){
|
||||
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
let signal5 = null;
|
||||
let signal32 = null;
|
||||
let signal3 = null;
|
||||
let signal2 = null;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].deviceType == "signal5"){
|
||||
signal5 = assetloader.modellist[j].mesh;
|
||||
}
|
||||
if(assetloader.modellist[j].deviceType == "signal32"){
|
||||
signal32 = assetloader.modellist[j].mesh;
|
||||
}
|
||||
if(assetloader.modellist[j].deviceType == "signal3"){
|
||||
signal3 = assetloader.modellist[j].mesh;
|
||||
}
|
||||
if(assetloader.modellist[j].deviceType == "signal2"){
|
||||
signal2 = assetloader.modellist[j].mesh;
|
||||
}
|
||||
}
|
||||
|
||||
for(let i=0;i<signaldata.length;i++){
|
||||
for(let j=0,lenj = data.length;j<lenj;j++){
|
||||
if(data[j].code == signaldata[i].code){
|
||||
if(data[j].virtual == false){
|
||||
// console.log(signaldata[i]);
|
||||
let newsignal = new SignalModel(signaldata[i]);
|
||||
let newmesh;
|
||||
if(data[j].type == "ARRIVAL"){
|
||||
newmesh = signal5.clone();
|
||||
}else if(data[j].type == "EXIT"){
|
||||
newmesh = signal32.clone(true);
|
||||
}else if(data[j].type == "PASSING"){
|
||||
newmesh = signal3.clone(true);
|
||||
}else if(data[j].type == "SHUNTING"){
|
||||
newmesh = signal2.clone(true);
|
||||
}
|
||||
//
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
let newmaterial = new THREE.MeshPhongMaterial();
|
||||
newmaterial.copy(newmesh.children[j].material);
|
||||
|
||||
newmesh.children[j].material = newmaterial;
|
||||
newmesh.children[j].material.needsUpdate = true;
|
||||
newmaterial.dispose();
|
||||
// newmesh.children[j].material.map
|
||||
}
|
||||
|
||||
// newmesh.uuid = signaldata[i].id;
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
newmesh.children[j].code = signaldata[i].code;
|
||||
}
|
||||
newmesh.name = signaldata[i].name;
|
||||
newmesh.code = signaldata[i].code;
|
||||
|
||||
newmesh.deviceType = data[j].type;
|
||||
newmesh.lightType = 0;
|
||||
|
||||
newmesh.position.x = signaldata[i].position.x;
|
||||
newmesh.position.y = signaldata[i].position.y;
|
||||
newmesh.position.z = signaldata[i].position.z;
|
||||
newmesh.rotation.x = signaldata[i].rotation._x;
|
||||
newmesh.rotation.y = signaldata[i].rotation._y;
|
||||
newmesh.rotation.z = signaldata[i].rotation._z;
|
||||
// newmesh.scale.x = signaldata[i].scale.x;
|
||||
// newmesh.scale.y = signaldata[i].scale.y;
|
||||
// newmesh.scale.z = signaldata[i].scale.z;
|
||||
|
||||
// newmesh.matrixAutoUpdate = false;
|
||||
newsignal.mesh = newmesh;
|
||||
newsignal.mesh.status = "01";
|
||||
scope.group.add(newsignal.mesh);
|
||||
scope.list[signaldata[i].code] = newsignal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
data = null;
|
||||
signaldata = null;
|
||||
scene.add(scope.group);
|
||||
resolve("loadedsignal");
|
||||
});
|
||||
};
|
||||
|
||||
}
|
5
src/jlmap3d/jl3drailwaydrive/model/SignalModel.js
Normal file
@ -0,0 +1,5 @@
|
||||
export function SignalModel(data) {
|
||||
|
||||
this.uuid = null;
|
||||
this.mesh = null;
|
||||
}
|
395
src/jlmap3d/jl3drailwaydrive/model/StationStandListN.js
Normal file
@ -0,0 +1,395 @@
|
||||
import {StationStandModel} from '@/jlmap3d/main/newmodel/StationStandModel.js';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
export function StationStandListN() {
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.type = "stationstandlist";
|
||||
|
||||
this.list = [];
|
||||
|
||||
this.group = new THREE.Group();
|
||||
this.group.name = "station";
|
||||
this.textlist = [];
|
||||
|
||||
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"){
|
||||
selectmesh1 = assetloader.modellist[j].mesh;
|
||||
}
|
||||
}
|
||||
|
||||
for(let i=0;i<standsdata.length;i++){
|
||||
let newstationstand = new StationStandModel(standsdata[i]);
|
||||
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.type = "station";
|
||||
newstationstand.num = i;
|
||||
|
||||
newstationstand.direction1.code = standsdata[i].direction1.code;
|
||||
newstationstand.direction1.name = standsdata[i].direction1.name;
|
||||
newstationstand.direction1.screenDoorOpenStatus = "01";
|
||||
|
||||
newstationstand.direction2.code = standsdata[i].direction2.code;
|
||||
newstationstand.direction2.name = standsdata[i].direction2.name;
|
||||
newstationstand.direction2.screenDoorOpenStatus = "01";
|
||||
|
||||
let newstationmesh = selectmesh1.clone(true);
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
scope.group.add(newstationmesh);
|
||||
|
||||
scope.list[standsdata[i].code] = newstationstand;
|
||||
|
||||
let newclip = selectmesh1.animations[ 0 ];
|
||||
for(let j=0;j<newstationmesh.children.length;j++){
|
||||
|
||||
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] );
|
||||
|
||||
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])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
//actionss[key].play();
|
||||
mixers.push(mixer);
|
||||
n = psddata.length;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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 key = psddata[n].code;
|
||||
actionss[key] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( newstationmesh.children[j].animations[0])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
//actionss[key].play();
|
||||
mixers.push(mixer);
|
||||
n = psddata.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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 );
|
||||
textplane.name = stationdata[i].code;
|
||||
textplane.position.y = 80;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
//textplane.position.x = -30;
|
||||
scope.textlist.push(textplane);
|
||||
newstationmesh.add(textplane);
|
||||
textgeometry.dispose();
|
||||
textmaterial.dispose();
|
||||
textt.dispose();
|
||||
// let newtopstation = topstationmesh.clone(true);
|
||||
// newtopstation.position.x = map[k].mesh.position.x;
|
||||
// newtopstation.position.z = map[k].mesh.position.z;
|
||||
// scene.add(newtopstation);
|
||||
}
|
||||
}
|
||||
}
|
||||
// scene.add(scope.textlist);
|
||||
stationdata = null;
|
||||
psddata = null;
|
||||
scene.add(scope.group);
|
||||
resolve("loadedstation");
|
||||
});
|
||||
|
||||
}
|
||||
this.loadpromise = function(stationdata,standsdata,psddata,scene,assetloader,mixers,actionss,mode,otherStation){
|
||||
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++){
|
||||
// console.log(assetloader.modellist[j].type);
|
||||
if(assetloader.modellist[j].type == "stationInside"){
|
||||
selectmesh1 = assetloader.modellist[j].mesh;
|
||||
}
|
||||
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"){
|
||||
selectmesh3 = assetloader.modellist[j].mesh;
|
||||
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
|
||||
}
|
||||
if(assetloader.modellist[j].type == "spmxa"){
|
||||
specilmesh = assetloader.modellist[j].mesh;
|
||||
}
|
||||
|
||||
}
|
||||
selectmesh1.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
child.renderOrder = 9;
|
||||
}
|
||||
|
||||
} );
|
||||
selectmesh2.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
child.renderOrder = 9;
|
||||
}
|
||||
|
||||
} );
|
||||
// selectmesh3.traverse( function ( child ) {
|
||||
//
|
||||
// if ( child.isMesh ) {
|
||||
// child.renderOrder = 9;
|
||||
// }
|
||||
//
|
||||
// } );
|
||||
//新车门动画获取待定
|
||||
let allClear = 0;
|
||||
for(let j=0;j<standsdata.length;j++){
|
||||
|
||||
allClear = 0;
|
||||
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){
|
||||
allClear++;
|
||||
standsdata[j].stands[n].position = psddata[i].position;
|
||||
}
|
||||
}
|
||||
|
||||
if(allClear == standsdata[j].stands.length){
|
||||
standsdata[j].stands.sort(compare);
|
||||
i = psddata.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
//
|
||||
// console.log(psddata);
|
||||
for(let i=0;i<standsdata.length;i++){
|
||||
|
||||
|
||||
let newstationstand = new StationStandModel(standsdata[i]);
|
||||
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.type = "station";
|
||||
newstationstand.num = i;
|
||||
newstationstand.stands = standsdata[i].stands;
|
||||
// newstationstand.direction1.code = standsdata[i].direction1.code;
|
||||
// newstationstand.direction1.name = standsdata[i].direction1.name;
|
||||
// newstationstand.direction1.screenDoorOpenStatus = "01";
|
||||
//
|
||||
// newstationstand.direction2.code = standsdata[i].direction2.code;
|
||||
// newstationstand.direction2.name = standsdata[i].direction2.name;
|
||||
// newstationstand.direction2.screenDoorOpenStatus = "01";
|
||||
let newstationmesh = 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];
|
||||
newstationmesh = selectmeshother;
|
||||
newclip = selectmeshother.animations[ 0 ];
|
||||
nowModelType = "specil";
|
||||
newstationmesh.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
child.renderOrder = 9;
|
||||
}
|
||||
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
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){
|
||||
newstationmesh = selectmesh1.clone(true);
|
||||
newclip = selectmesh1.animations[ 0 ];
|
||||
}else{
|
||||
newstationmesh = selectmesh2.clone(true);
|
||||
newclip = selectmesh2.animations[ 0 ];
|
||||
}
|
||||
}else{
|
||||
newstationmesh = selectmesh3.clone(true);
|
||||
newclip = selectmesh3.animations[ 0 ];
|
||||
}
|
||||
|
||||
if(standsdata[i].code == "Station17596"){
|
||||
newstationmesh = specilmesh.clone(true);
|
||||
newclip = specilmesh.animations[ 0 ];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
newstationmesh.code = standsdata[i].code;
|
||||
newstationmesh.name = standsdata[i].code;
|
||||
// console.log(newstationmesh.name);
|
||||
// console.log(standsdata[i].inside);
|
||||
newstationmesh.inside = standsdata[i].inside;
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
scope.group.add(newstationmesh);
|
||||
//
|
||||
scope.list[standsdata[i].code] = newstationstand;
|
||||
//
|
||||
for(let j=0;j<standsdata[i].stands.length;j++){
|
||||
let num = j+1;
|
||||
|
||||
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) );
|
||||
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
|
||||
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])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
//actionss[key].play();
|
||||
|
||||
n = psddata.length;
|
||||
}
|
||||
}
|
||||
|
||||
mixers.push(mixer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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 );
|
||||
textplane.name = standsdata[i].code;
|
||||
|
||||
textplane.position.y = 70;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
textplane.position.z = 80;
|
||||
scope.textlist.push(textplane);
|
||||
newstationmesh.add(textplane);
|
||||
textgeometry.dispose();
|
||||
textmaterial.dispose();
|
||||
textt.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// scene.add(scope.textlist);
|
||||
stationdata = null;
|
||||
psddata = null;
|
||||
scene.add(scope.group);
|
||||
resolve("loadedstation");
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
var compare = function (obj1, obj2) {
|
||||
var val1 = obj1.position.y;
|
||||
var val2 = obj2.position.y;
|
||||
if (val1 < val2) {
|
||||
return -1;
|
||||
} else if (val1 > val2) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//canvas文字贴图方法
|
||||
//PS:待提炼 增强功能
|
||||
var stationcanvas = new Image();
|
||||
stationcanvas.src = JL3D_LOCAL_STATIC+"/texture/msgtnew.png";
|
||||
function getTextCanvas(text){
|
||||
let canvas = document.getElementById('canvastexture');
|
||||
|
||||
canvas.width = 128;
|
||||
canvas.height = 256;
|
||||
// canvas.style.width = width;
|
||||
// canvas.style.height = height;
|
||||
|
||||
let ctx = canvas.getContext('2d');
|
||||
//ctx.fillStyle = '#FFFFFF';
|
||||
ctx.fillRect(0, 0,128,256);
|
||||
|
||||
ctx.fillStyle = '#FFFFFF';
|
||||
// ctx.textAlign = 'center';
|
||||
// ctx.textBaseline = 'middle';
|
||||
ctx.clearRect(0,0,128,256);
|
||||
|
||||
ctx.drawImage(stationcanvas,0,0,128,256);
|
||||
|
||||
ctx.font = "10px";
|
||||
ctx.fillText("车站: "+text.name, 15,25);
|
||||
|
||||
ctx.fillText("漫游", 18,48);
|
||||
ctx.fillText("信息", 54,48);
|
||||
ctx.fillText("备忘", 93,48);
|
||||
|
||||
ctx.fillText("车站序号: "+text.name, 10,115);
|
||||
|
||||
ctx.fillText("公里标记:",10 ,135);
|
||||
ctx.fillText(text.kmPost,10 ,155);
|
||||
|
||||
let data = ctx.getImageData(0, 0,128,256);
|
||||
return data;
|
||||
}
|
35
src/jlmap3d/jl3drailwaydrive/model/StationStandModel.js
Normal file
@ -0,0 +1,35 @@
|
||||
export function StationStandModel(opts) {
|
||||
|
||||
var scope = this;
|
||||
|
||||
this.uuid = null;
|
||||
this.code = null;
|
||||
this.name = null;
|
||||
this.modelid = null;
|
||||
this.type = null;
|
||||
this.inside = null;
|
||||
this.ismodel = false;
|
||||
this.istexture = false;
|
||||
this.modelurl = null;
|
||||
this.stands = [];
|
||||
this.direction1= {
|
||||
position:null,
|
||||
name:null,
|
||||
screenDoorOpenStatus:null,
|
||||
mesh:null,
|
||||
openpos:[],
|
||||
closepos:[]
|
||||
}
|
||||
this.direction2= {
|
||||
position:null,
|
||||
name:null,
|
||||
screenDoorOpenStatus:null,
|
||||
mesh:null,
|
||||
openpos:[],
|
||||
closepos:[]
|
||||
}
|
||||
|
||||
this.mesh = null;
|
||||
this.meshurl = null;
|
||||
this.picurl = null;
|
||||
}
|
67
src/jlmap3d/jl3drailwaydrive/model/SwitchListN.js
Normal file
@ -0,0 +1,67 @@
|
||||
import {SwitchModel} from '@/jlmap3d/main/newmodel/SwitchModel.js';
|
||||
|
||||
export function SwitchListN() {
|
||||
|
||||
let scope = this;
|
||||
this.type = "switchlist";
|
||||
|
||||
this.switchgroup = new THREE.Group();
|
||||
this.switchgroup.name = "switch";
|
||||
|
||||
this.switchs = {
|
||||
datalist:[],
|
||||
modellist:[]
|
||||
};
|
||||
|
||||
this.loadpromise = function(jlmap3ddata,switchdata,scene,assetloader,mixers,actions){
|
||||
return new Promise(function(resolve, reject){
|
||||
scene.add( scope.switchgroup );
|
||||
// let sectiondata = jlmap3ddata.sectionlist.sections.datalist;
|
||||
// console.log(sectiondata);
|
||||
let num;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].type == "switch"){
|
||||
num = j;
|
||||
}
|
||||
};
|
||||
for(let i=0,leni = switchdata.length;i<leni;i++){
|
||||
// console.log(switchdata[i]);
|
||||
let newswitch = {
|
||||
code:switchdata[i].code,
|
||||
name:switchdata[i].name,
|
||||
pa:switchdata[i].pa,
|
||||
pb:switchdata[i].pb,
|
||||
pc:switchdata[i].pc,
|
||||
directtype:null,
|
||||
locateType:0
|
||||
};
|
||||
let autoswitch = assetloader.modellist[num].mesh.clone(true);
|
||||
autoswitch.code = switchdata[i].code;
|
||||
for(let j=0;j<autoswitch.children.length;j++){
|
||||
autoswitch.children[j].code = switchdata[i].code;
|
||||
}
|
||||
scope.switchs.datalist.push(newswitch);
|
||||
scope.switchgroup.add(autoswitch);
|
||||
autoswitch.position.set(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z);
|
||||
autoswitch.rotation.x = switchdata[i].rotation._x;
|
||||
autoswitch.rotation.y = switchdata[i].rotation._y;
|
||||
autoswitch.rotation.z = switchdata[i].rotation._z;
|
||||
// autoswitch.matrixAutoUpdate = false;
|
||||
autoswitch.animations = assetloader.modellist[num].mesh.animations;
|
||||
|
||||
let mixer = new THREE.AnimationMixer( autoswitch );
|
||||
actions[autoswitch.code] = {
|
||||
normal:"00",
|
||||
action:mixer.clipAction( autoswitch.animations[0])
|
||||
};
|
||||
actions[autoswitch.code].action.setLoop(THREE.LoopOnce);
|
||||
actions[autoswitch.code].action.clampWhenFinished = true;
|
||||
mixers.push(mixer);
|
||||
}
|
||||
// console.log(scope.switchs.modellist);
|
||||
resolve("loadedswitch");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
22
src/jlmap3d/jl3drailwaydrive/model/SwitchModel.js
Normal file
@ -0,0 +1,22 @@
|
||||
export function SwitchModel() {
|
||||
|
||||
var scope = this;
|
||||
//命名
|
||||
this.name = null;
|
||||
//code
|
||||
this.code = null;
|
||||
//索引位置
|
||||
this.index = null;
|
||||
//轨迹点
|
||||
this.rail = [];
|
||||
//长度
|
||||
this.distance = null;
|
||||
|
||||
this.action = null;
|
||||
//指向模型
|
||||
this.mesh = null;
|
||||
// //模型地址
|
||||
// this.meshurl = null;
|
||||
// //贴图地址
|
||||
// this.picurl = null;
|
||||
}
|
100
src/jlmap3d/jl3drailwaydrive/model/TdtList.js
Normal file
@ -0,0 +1,100 @@
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
export function TdtList() {
|
||||
let scope = this;
|
||||
|
||||
let materialList = [];
|
||||
|
||||
this.initTdt = function(stationData,sectionData,railData,scene){
|
||||
|
||||
return new Promise(function(resolve, reject){
|
||||
var loader = new THREE.FBXLoader();
|
||||
|
||||
loader.load( JL3D_LOCAL_STATIC+"/test/TDTModel.FBX" , function ( object ) {
|
||||
|
||||
let stopSections = [];
|
||||
for(let i=0;i<sectionData.length;i++){
|
||||
if(sectionData[i].standTrack == true){
|
||||
stopSections[sectionData[i].code] = sectionData[i];
|
||||
}
|
||||
}
|
||||
// console.log(stationData);
|
||||
for(let k in stationData){
|
||||
for(let i=0;i<stationData[k].stands.length;i++){
|
||||
let newmesh = object.clone(true);
|
||||
|
||||
newmesh.canvas = document.createElement("canvas");
|
||||
newmesh.canvas.width = 128;
|
||||
newmesh.canvas.height = 64;
|
||||
newmesh.getObjectByName("TDT").material = new THREE.MeshPhongMaterial();
|
||||
let newImg = new THREE.CanvasTexture(getTextCanvas(newmesh.canvas,"",30));
|
||||
newmesh.getObjectByName("TDT").material.map = newImg;
|
||||
newmesh.getObjectByName("TDT").material.needsUpdate = true;
|
||||
|
||||
materialList[stationData[k].stands[i].code] = newmesh;
|
||||
let sectionCode = stationData[k].stands[i].section;
|
||||
|
||||
let pos = stationData[k].mesh.position;
|
||||
if(stationData[k].stands[i].right == true){
|
||||
newmesh.rotation.y = -Math.PI/2;
|
||||
newmesh.position.set(pos.x+75,0,pos.z+14.8);
|
||||
|
||||
}else{
|
||||
newmesh.rotation.y = Math.PI/2;
|
||||
newmesh.position.set(pos.x-75,0,pos.z-14.8);
|
||||
|
||||
}
|
||||
|
||||
|
||||
scene.add(newmesh);
|
||||
}
|
||||
}
|
||||
|
||||
resolve("TdtLoad");
|
||||
} );
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
this.updateTdt = function(data){
|
||||
for(let i=0;i<data.length;i++){
|
||||
let newImg = null;
|
||||
|
||||
if(data[i].hold == true){
|
||||
newImg = new THREE.CanvasTexture(getTextCanvas(materialList[data[i].standCode].canvas,"H",30));
|
||||
}else if(data[i].jump == true){
|
||||
newImg = new THREE.CanvasTexture(getTextCanvas(materialList[data[i].standCode].canvas,"=",30));
|
||||
}else{
|
||||
newImg = new THREE.CanvasTexture(getTextCanvas(materialList[data[i].standCode].canvas,data[i].remain,30));
|
||||
}
|
||||
|
||||
materialList[data[i].standCode].getObjectByName("TDT").material.map = newImg;
|
||||
materialList[data[i].standCode].getObjectByName("TDT").material.map.needsUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
var beauty = new Image();
|
||||
beauty.src = JL3D_LOCAL_STATIC+"/test/tdttexture.jpg";
|
||||
//canvas文字贴图方法
|
||||
//PS:待提炼 增强功能
|
||||
function getTextCanvas(canvas,text,font){
|
||||
// let canvas = document.getElementById('canvastexture');
|
||||
|
||||
|
||||
|
||||
let ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillRect(0, 0,128,64);
|
||||
ctx.font = font+"px Verdana";
|
||||
ctx.fillStyle = '#e9a26a';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.clearRect(0,0,128,64);
|
||||
//console.log(text.groupNumber);
|
||||
ctx.drawImage(beauty,0,0,128, 64);
|
||||
ctx.fillText(text, 64,32);
|
||||
return canvas;
|
||||
}
|
||||
|
||||
|
||||
}
|
400
src/jlmap3d/jl3drailwaydrive/model/TrainListN.js
Normal file
@ -0,0 +1,400 @@
|
||||
import {TrainModel} from '@/jlmap3d/edit/testEditorModel/TrainModel.js';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
export function TrainListN() {
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.type = "trainlist";
|
||||
|
||||
this.list = {};
|
||||
this.updatStatus = false;
|
||||
this.otherTrainmodels = [];
|
||||
this.otherTrainList = {};
|
||||
this.group = new THREE.Group();
|
||||
this.group.name = "train";
|
||||
this.textlist = [];
|
||||
this.trainmesh = null;
|
||||
|
||||
this.addDriveTrain = function(data){
|
||||
this.updatStatus = true;
|
||||
|
||||
let leni = data.length-scope.otherTrainmodels.length;
|
||||
|
||||
for(let i=0;i<leni;i++){
|
||||
let newmesh = scope.trainmesh.clone(true);
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
newmesh.children[j].axis = new THREE.Vector3();
|
||||
newmesh.children[j].up = new THREE.Vector3(1, 0, 0);
|
||||
|
||||
newmesh.children[j].rotalist = [];
|
||||
}
|
||||
|
||||
newmesh.first = false;
|
||||
newmesh.name = "othertrain";
|
||||
newmesh.code = "";
|
||||
newmesh.groupNumber = "";
|
||||
newmesh.right = "3";
|
||||
newmesh.position.set(0,0,0);
|
||||
newmesh.status = "00";
|
||||
newmesh.nowcode = null;
|
||||
newmesh.nowsection = "";
|
||||
newmesh.curve = null;
|
||||
newmesh.doorStatus = "01";
|
||||
newmesh.speed = 0;
|
||||
newmesh.speeds = 0;
|
||||
newmesh.offset = null;
|
||||
newmesh.openleft = '0';
|
||||
newmesh.openright = '0';
|
||||
|
||||
|
||||
scope.group.add(newmesh);
|
||||
scope.otherTrainmodels.push(newmesh);
|
||||
}
|
||||
scope.otherTrainList = [];
|
||||
for(let j=0,lenj = data.length;j<lenj;j++){
|
||||
scope.otherTrainmodels[j].code = data[j].code;
|
||||
scope.otherTrainList[data[j].code] = this.otherTrainmodels[j];
|
||||
}
|
||||
|
||||
this.updatStatus = false;
|
||||
}
|
||||
|
||||
this.removeDriveTrain = function(removeLength){
|
||||
console.log(removeLength);
|
||||
|
||||
scope.group.remove(scope.otherTrainmodels[0]);
|
||||
scope.otherTrainmodels.splice(0,removeLength);
|
||||
}
|
||||
|
||||
this.drivertrain = function(data,scene,assetloader,mixers,actionss,mode){
|
||||
|
||||
return new Promise(function(resolve, reject){
|
||||
// console.log(data);
|
||||
|
||||
let selectmesh,ntracks1,ntracks2,tclip,fclip;
|
||||
for(let n=assetloader.modellist.length-1;n>=0;n--){
|
||||
if(assetloader.modellist[n].type == "train"){
|
||||
|
||||
selectmesh = assetloader.modellist[n].mesh;
|
||||
scope.trainmesh = assetloader.modellist[n].mesh;
|
||||
// ntracks1 = assetloader.modellist[n].animations.slice(16,27);
|
||||
//
|
||||
// tclip = new THREE.AnimationClip("three",2,ntracks1);
|
||||
//
|
||||
// ntracks2 = assetloader.modellist[n].animations.slice(0,15);
|
||||
//
|
||||
// fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
|
||||
// ntracks2 = assetloader.modellist[n].animations.slice(6,14);
|
||||
//
|
||||
// fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
//
|
||||
// ntracks1 = assetloader.modellist[n].animations.slice(0,6);
|
||||
|
||||
tclip = new THREE.AnimationClip("three",2,assetloader.modellist[n].animations);
|
||||
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
|
||||
actionss["traindoor"] = {
|
||||
top:[],
|
||||
down:[]
|
||||
};
|
||||
let newmesh = selectmesh.clone(true);
|
||||
newmesh.mixer = [];
|
||||
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
// console.log("===================");
|
||||
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
|
||||
|
||||
if(newmesh.children[j].children[n].name == "top"){
|
||||
newmesh.children[j].children[n].animations = [];
|
||||
newmesh.children[j].children[n].animations.push(tclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
|
||||
// console.log(n);
|
||||
// console.log(newmesh.children[j].children[n]);
|
||||
newmesh.mixer.push(mixer);
|
||||
newmesh.mixerpush = false;
|
||||
|
||||
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
|
||||
//action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
actionss["traindoor"].top.push(action);
|
||||
mixers.push(mixer);
|
||||
}
|
||||
|
||||
if(newmesh.children[j].children[n].name == "down"){
|
||||
newmesh.children[j].children[n].animations = [];
|
||||
newmesh.children[j].children[n].animations.push(tclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
|
||||
|
||||
newmesh.mixer.push(mixer);
|
||||
newmesh.mixerpush = false;
|
||||
|
||||
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
|
||||
//action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
actionss["traindoor"].down.push(action);
|
||||
mixers.push(mixer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
newmesh.children[j].axis = new THREE.Vector3();
|
||||
newmesh.children[j].up = new THREE.Vector3(1, 0, 0);
|
||||
// newmesh.axis = new THREE.Vector3();
|
||||
// newmesh.up = new THREE.Vector3(1, 0, 0);
|
||||
// var pos = new THREE.Mesh( geometryp, materialp);
|
||||
// pos.position.x = -73.5;
|
||||
// newmesh.children[j].add( pos );
|
||||
newmesh.children[j].rotalist = [];
|
||||
// console.log(newmesh);
|
||||
}
|
||||
|
||||
newmesh.first = false;
|
||||
newmesh.name = "drivetrain";
|
||||
newmesh.code = "";
|
||||
newmesh.groupNumber = "";
|
||||
newmesh.right = "3";
|
||||
newmesh.position.set(0,0,0);
|
||||
newmesh.status = "00";
|
||||
newmesh.nowcode = null;
|
||||
newmesh.nowsection = null;
|
||||
newmesh.curve = null;
|
||||
newmesh.doorStatus = "01";
|
||||
newmesh.speed = 0;
|
||||
newmesh.speeds = 0;
|
||||
newmesh.offset = null;
|
||||
newmesh.openleft = '0';
|
||||
newmesh.openright = '0';
|
||||
|
||||
|
||||
scope.group.add(newmesh);
|
||||
scope.list[0] = newmesh;
|
||||
scene.add(scope.group);
|
||||
resolve("loadedtrain");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.initpromise = function(data,scene,assetloader,mixers,actionss,mode){
|
||||
return new Promise(function(resolve, reject){
|
||||
let selectmesh,ntracks1,ntracks2,tclip,fclip;
|
||||
for(let n=assetloader.modellist.length-1;n>=0;n--){
|
||||
if(assetloader.modellist[n].type == "train"){
|
||||
|
||||
selectmesh = assetloader.modellist[n].mesh;
|
||||
// ntracks1 = assetloader.modellist[n].animations.slice(16,27);
|
||||
//
|
||||
// tclip = new THREE.AnimationClip("three",2,ntracks1);
|
||||
//
|
||||
// ntracks2 = assetloader.modellist[n].animations.slice(0,15);
|
||||
//
|
||||
// fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
|
||||
// ntracks2 = assetloader.modellist[n].animations.slice(6,14);
|
||||
//
|
||||
// fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
//
|
||||
// ntracks1 = assetloader.modellist[n].animations.slice(0,6);
|
||||
tclip = new THREE.AnimationClip("three",2,assetloader.modellist[n].animations);
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
|
||||
selectmesh.traverse( function ( child ) {
|
||||
|
||||
if ( child.isMesh ) {
|
||||
child.renderOrder = 8;
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
//遍历列车数据
|
||||
// console.log(data.length);
|
||||
for(let i=0;i<data.length;i++){
|
||||
|
||||
|
||||
actionss[data[i].groupNumber] = {
|
||||
top:[],
|
||||
down:[]
|
||||
};
|
||||
let newmesh = selectmesh.clone(true);
|
||||
newmesh.mixer = [];
|
||||
// console.log("-------------------------");
|
||||
// console.log(data[i]);
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
|
||||
// console.log("===================");
|
||||
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
|
||||
|
||||
if(newmesh.children[j].children[n].name == "top"){
|
||||
newmesh.children[j].children[n].animations = [];
|
||||
newmesh.children[j].children[n].animations.push(tclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
|
||||
// console.log(n);
|
||||
// console.log(newmesh.children[j].children[n]);
|
||||
newmesh.mixer.push(mixer);
|
||||
newmesh.mixerpush = false;
|
||||
// mixers.push(mixer);
|
||||
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
|
||||
//action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
actionss[data[i].groupNumber].top.push(action);
|
||||
|
||||
}
|
||||
|
||||
if(newmesh.children[j].children[n].name == "down"){
|
||||
newmesh.children[j].children[n].animations = [];
|
||||
newmesh.children[j].children[n].animations.push(tclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
|
||||
|
||||
newmesh.mixer.push(mixer);
|
||||
newmesh.mixerpush = false;
|
||||
// mixers.push(mixer);
|
||||
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
|
||||
//action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
actionss[data[i].groupNumber].down.push(action);
|
||||
}
|
||||
}
|
||||
|
||||
//newmesh.children[j].name = data[i].code;
|
||||
newmesh.children[j].groupNumber = data[i].groupNumber;
|
||||
newmesh.children[j].axis = new THREE.Vector3();
|
||||
newmesh.children[j].up = new THREE.Vector3(1, 0, 0);
|
||||
// newmesh.axis = new THREE.Vector3();
|
||||
// newmesh.up = new THREE.Vector3(1, 0, 0);
|
||||
// var pos = new THREE.Mesh( geometryp, materialp);
|
||||
// pos.position.x = -73.5;
|
||||
// newmesh.children[j].add( pos );
|
||||
newmesh.children[j].rotalist = [];
|
||||
// console.log(newmesh);
|
||||
}
|
||||
|
||||
//
|
||||
// // newmesh.children[4].add(newmesh.children[5]);
|
||||
// // newmesh.children[3].add(newmesh.children[4]);
|
||||
// // newmesh.children[2].add(newmesh.children[3]);
|
||||
// // newmesh.children[1].add(newmesh.children[2]);
|
||||
// // newmesh.children[0].add(newmesh.children[1]);
|
||||
// for(let n=newmesh.children.length-1;n>=1;n--){
|
||||
// newmesh.children[n].position.x = -76;
|
||||
// newmesh.children[n-1].add(newmesh.children[n]);
|
||||
// }
|
||||
//创建列车字牌
|
||||
if(mode){
|
||||
if(mode == "02"){
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 64, 32, 1 );
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(data[i]));
|
||||
let textmaterial = new THREE.MeshBasicMaterial( {
|
||||
side: THREE.DoubleSide,
|
||||
map:textt ,transparent: true,
|
||||
alphaTest:0.1
|
||||
} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
textplane.name = data[i].groupNumber;
|
||||
textplane.position.x = 0;
|
||||
textplane.position.y = 0;
|
||||
textplane.position.z = 20;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
textplane.tcode = data[i].code;
|
||||
//textplane.rotation.x = Math.PI;
|
||||
scope.textlist.push(textplane);
|
||||
newmesh.children[0].add(textplane);
|
||||
textgeometry.dispose();
|
||||
textmaterial.dispose();
|
||||
textt.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//group.add(textplane);
|
||||
newmesh.first = false;
|
||||
newmesh.name = data[i].groupNumber;
|
||||
newmesh.rname = data[i].groupNumber;
|
||||
newmesh.groupNumber = data[i].groupNumber;
|
||||
|
||||
newmesh.position.set(0,-50000,0);
|
||||
// newmesh.children[0].position.y = 0;
|
||||
//newmesh.rotation.y = Math.PI/2;
|
||||
newmesh.status = "00";
|
||||
newmesh.nowcode = null;
|
||||
newmesh.curve = null;
|
||||
newmesh.doorStatus = "01";
|
||||
newmesh.dispose = 1;
|
||||
newmesh.nowsection = null;
|
||||
newmesh.nextsection = null;
|
||||
newmesh.speed = 0;
|
||||
newmesh.speeds = 0;
|
||||
newmesh.progress = null;
|
||||
newmesh.startmark = 0;
|
||||
newmesh.open = null;
|
||||
newmesh.statsstop = 0;
|
||||
newmesh.openleft = '0';
|
||||
newmesh.openright = '0';
|
||||
|
||||
scope.list[data[i].groupNumber] = newmesh;
|
||||
//scene.add(newmesh);
|
||||
}
|
||||
// console.log(selectmesh);
|
||||
// for(let i=0,leni=selectmesh.children.length;i<leni;i++){
|
||||
// selectmesh.children[i].geometry.dispose();
|
||||
// selectmesh.children[i].material.dispose();
|
||||
// }
|
||||
data = null;
|
||||
scene.add(scope.group);
|
||||
resolve("loadedtrain");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let onProgress = function ( xhr ) {
|
||||
|
||||
if ( xhr.lengthComputable ) {
|
||||
|
||||
let percentComplete = xhr.loaded / xhr.total * 100;
|
||||
console.log( Math.round( percentComplete, 2 ) + '% downloaded' );
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
let onError = function () { };
|
||||
|
||||
var beauty = new Image();
|
||||
beauty.src = JL3D_LOCAL_STATIC+"/texture/guidenew.png";
|
||||
//canvas文字贴图方法
|
||||
//PS:待提炼 增强功能
|
||||
function getTextCanvas(text){
|
||||
var canvas = document.getElementById('canvastexture');
|
||||
|
||||
canvas.width = 128;
|
||||
canvas.height = 64;
|
||||
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
//var bg = canvas.createPattern(img, "no-repeat");
|
||||
//ctx.fillStyle = bg;
|
||||
ctx.fillRect(0, 0,128,64);
|
||||
ctx.font = "8px Verdana";
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.clearRect(0,0,128,64);
|
||||
//console.log(text.groupNumber);
|
||||
ctx.drawImage(beauty,0,0,128, 64);
|
||||
ctx.fillText("车组号:"+text.groupNumber, 40,10);
|
||||
ctx.fillText("车组人员:XXX", 40,20);
|
||||
// ctx.fillText("速度:XXX.XXX", 40,30);
|
||||
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
|
||||
let data = ctx.getImageData(0, 0,128,64);
|
||||
return data;
|
||||
}
|
5
src/jlmap3d/jl3drailwaydrive/model/TrainModel.js
Normal file
@ -0,0 +1,5 @@
|
||||
export function TrainModel(opts) {
|
||||
|
||||
var scope = this;
|
||||
this.mesh = null;
|
||||
}
|
13
src/jlmap3d/jl3drailwaydrive/model/jl3ddata.js
Normal file
@ -0,0 +1,13 @@
|
||||
export function Jl3ddata() {
|
||||
let scope = this;
|
||||
|
||||
this.id = null;
|
||||
this.mapId = null;
|
||||
this.sectionlist = null;
|
||||
this.linklist = null;
|
||||
this.signallist = null;
|
||||
this.stationstandlist = null;
|
||||
this.trainlisttest = null;
|
||||
this.realsectionlist = null;
|
||||
|
||||
}
|
@ -40,6 +40,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
// let toppic = '/app/topic/simulation/client/'+routegroup+'/drive';
|
||||
console.log(routegroup);
|
||||
this.topic = '/queue/simulation/'+routegroup+'/trainPosition';
|
||||
let allDeviceTopic = '/queue/simulation/'+routegroup+'/srDeviceState';
|
||||
let hmiTopic = '/queue/simulation/'+routegroup+'/train/001/Hmi';
|
||||
let header = {'X-Token': getToken() };
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
@ -49,87 +51,6 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
};
|
||||
|
||||
//切换车辆修改列车属性
|
||||
function changeNowTrain(data){
|
||||
if(data[i][3] == "0"){
|
||||
|
||||
if(data.rightDoorCanClose == false){
|
||||
trainmodel.openright = '0';
|
||||
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
|
||||
actions["traindoor"].down[an].reset();
|
||||
actions["traindoor"].down[an].time = 0;
|
||||
actions["traindoor"].down[an].timeScale = -1;
|
||||
actions["traindoor"].down[an].play();
|
||||
}
|
||||
}else{
|
||||
trainmodel.openright = "1";
|
||||
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
||||
actions["traindoor"].down[an].reset();
|
||||
actions["traindoor"].down[an].time = actions["traindoor"].top[an]._clip.duration;
|
||||
actions["traindoor"].down[an].timeScale = 1;
|
||||
actions["traindoor"].down[an].play();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(data.leftDoorCanClose == false){
|
||||
trainmodel.openleft = "0";
|
||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||
actions["traindoor"].top[an].reset();
|
||||
actions["traindoor"].top[an].time = 0;
|
||||
actions["traindoor"].top[an].timeScale = -1;
|
||||
actions["traindoor"].top[an].play();
|
||||
}
|
||||
}else{
|
||||
trainmodel.openleft = "1";
|
||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||
actions["traindoor"].top[an].reset();
|
||||
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
|
||||
actions["traindoor"].top[an].timeScale = 1;
|
||||
actions["traindoor"].top[an].play();
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
if(data.leftDoorCanClose == false){
|
||||
|
||||
trainmodel.openleft = "0";
|
||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||
actions["traindoor"].top[an].reset();
|
||||
actions["traindoor"].top[an].time = 0;
|
||||
actions["traindoor"].top[an].timeScale = -1;
|
||||
actions["traindoor"].top[an].play();
|
||||
}
|
||||
}else{
|
||||
trainmodel.openleft = "1";
|
||||
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
|
||||
actions["traindoor"].top[an].reset();
|
||||
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
|
||||
actions["traindoor"].top[an].timeScale = 1;
|
||||
actions["traindoor"].top[an].play();
|
||||
}
|
||||
}
|
||||
|
||||
if(data.rightDoorCanClose == false){
|
||||
trainmodel.openright = '0';
|
||||
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
|
||||
actions["traindoor"].down[an].reset();
|
||||
actions["traindoor"].down[an].time = 0;
|
||||
actions["traindoor"].down[an].timeScale = -1;
|
||||
actions["traindoor"].down[an].play();
|
||||
}
|
||||
|
||||
}else{
|
||||
trainmodel.openright = "1";
|
||||
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
|
||||
actions["traindoor"].down[an].reset();
|
||||
actions["traindoor"].down[an].time = actions["traindoor"].top[an]._clip.duration;
|
||||
actions["traindoor"].down[an].timeScale = 1;
|
||||
actions["traindoor"].down[an].play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails,newtdt, materiallist, nowaction, scene) {
|
||||
// console.log(mapdata);
|
||||
// console.log(newtrainlisttest);
|
||||
@ -152,8 +73,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
|
||||
this.socketon = function() {
|
||||
try {
|
||||
// console.log("teststomp");
|
||||
scope.teststomp.subscribe(scope.topic, callback, header);
|
||||
scope.teststomp.subscribe(hmiTopic, callback, header);
|
||||
scope.teststomp.subscribe(allDeviceTopic, callback, header);
|
||||
|
||||
} catch (error) {
|
||||
console.error('websocket订阅失败');
|
||||
}
|
||||
@ -176,7 +99,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let initStatus = true;
|
||||
// 仿真socket接口回调函数
|
||||
function callback(Response) {
|
||||
// console.log(Response);
|
||||
@ -184,10 +107,27 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
|
||||
let data = JSON.parse(Response.body);
|
||||
if(data.trainPosList){
|
||||
// console.log(data.trainPosList);
|
||||
// console.log(data.trainPosList);
|
||||
|
||||
nowTrainRun(data.trainPosList);
|
||||
return;
|
||||
}
|
||||
if(data.srSignalList){
|
||||
for(let i=0;i<data.srSignalList.length;i++){
|
||||
|
||||
if(signallist.list[data.srSignalList[i][0]].mesh){
|
||||
signalLightUpdate(data.srSignalList[i][0],data.srSignalList[i][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(data.srSignal){
|
||||
signalLightUpdate(data.srSignal[0],data.srSignal[1]);
|
||||
}
|
||||
|
||||
if(data.hmi){
|
||||
if(initStatus == true){
|
||||
initStatus = false;
|
||||
updateDriveValue(data.hmi);
|
||||
}
|
||||
updateSpeedView(data.hmi[1]);
|
||||
}
|
||||
// stats.update();
|
||||
// 遍历后台数据
|
||||
@ -196,8 +136,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
|
||||
}
|
||||
|
||||
|
||||
function DeviceDestroy(data){
|
||||
// console.log(data);
|
||||
for(let i=0,leni=data.length;i<leni;i++){
|
||||
|
||||
if(data[i].type == "SIGNAL"){
|
||||
@ -249,10 +189,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
}
|
||||
|
||||
function otherTrainUpdate(data,updateTrainModel){
|
||||
// console.log(data);
|
||||
// if(data.code = "336"){
|
||||
// console.log(data);
|
||||
// }
|
||||
|
||||
|
||||
if(data.section != updateTrainModel.nowsection){
|
||||
updateTrainModel.nowsection = data.section;
|
||||
@ -305,7 +242,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
// trainmodel.position.z = point.z;
|
||||
|
||||
}
|
||||
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
|
||||
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children["black"].rotalist.length > 0){
|
||||
|
||||
for(let rs = 1;rs<updateTrainModel.children.length;rs++){
|
||||
//console.log(rs);
|
||||
@ -381,7 +318,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
}
|
||||
|
||||
|
||||
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
|
||||
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children["black"].rotalist.length > 0){
|
||||
for(let rs = 1;rs<updateTrainModel.children.length;rs++){
|
||||
//console.log(rs);
|
||||
if(updateTrainModel.children[rs].rotalist[0]){
|
||||
@ -415,7 +352,6 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
}
|
||||
//更新当前驾驶车辆
|
||||
function nowTrainRun(data){
|
||||
console.log(data);
|
||||
for(let i=0;i<data.length;i++){
|
||||
//改变当前列车code
|
||||
if(data[0][0] != trainmodel.code){
|
||||
@ -787,29 +723,29 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
function signalupdate(data) {
|
||||
code = data.code;
|
||||
if(data.red == 1){
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials["white"];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
if(data.yellow == 1){
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["white"];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
if(data.green == 1){
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[2];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}else{
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials["white"];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
@ -856,6 +792,189 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
|
||||
}
|
||||
}
|
||||
|
||||
function signalLightUpdate(code,lightType){
|
||||
signallist.list[code].mesh.lightType = lightType;
|
||||
if(signallist.list[code].mesh.deviceType == "ARRIVAL"){
|
||||
if(lightType == '0'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
if(lightType == '3'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["yellow"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '7'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["yellow"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["yellow"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '1'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["red"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '9'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["red"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["white"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '6'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["green"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["yellow"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
}else if(signallist.list[code].mesh.deviceType == "EXIT"){
|
||||
if(lightType == '0'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '1'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["red"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '2'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["green"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '3'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["yellow"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("04").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("05").material.map.needsUpdate = true;
|
||||
}
|
||||
}else if(signallist.list[code].mesh.deviceType == "PASSING"){
|
||||
if(lightType == '0'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '1'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["red"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '2'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["green"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
}
|
||||
if(lightType == '3'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["yellow"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("03").material.map.needsUpdate = true;
|
||||
}
|
||||
}else if(signallist.list[code].mesh.deviceType == "SHUNTING"){
|
||||
if(lightType == '0'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
if(lightType == '10'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["blue"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
if(lightType == '11'){
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map = materials["white"];
|
||||
signallist.list[code].mesh.getObjectByName("01").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map = materials["black"];
|
||||
signallist.list[code].mesh.getObjectByName("02").material.map.needsUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function simulationreset(data){
|
||||
for(let i=0;i<trainlisttest.group.children.length;i++){
|
||||
trainlisttest.group.children[i].dispose = true;
|
||||
|
@ -24,7 +24,7 @@ import { SimulationLoadNew } from '@/jlmap3d/main/loaders/SimulationLoadNew';
|
||||
//connect
|
||||
import {Jlmap3dSubscribeNew } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribeNew';
|
||||
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
//utils
|
||||
// import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain';
|
||||
|
@ -12,7 +12,7 @@ import { ModelManager } from '@/jlmap3d/jl3dstationmanager/loader/loader.js';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
//获取信息接口
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
//cctv站台对象
|
||||
import { PasserStation } from '@/jlmap3d/jl3dstationmanager/model/passerstation.js';
|
||||
//cctv检票机对象
|
||||
|
@ -10,7 +10,7 @@ import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/loader/loader.js';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
//获取信息接口
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
//cctv站台对象
|
||||
import { PasserStation } from '@/jlmap3d/jl3dtrafficplan/model/passerstation.js';
|
||||
//cctv检票机对象
|
||||
|
@ -10,7 +10,7 @@ import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/loader/loader.js';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
//获取信息接口
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
//cctv列车对象
|
||||
import { PasserTrain } from '@/jlmap3d/jl3dtrafficplan/model/passertrain.js';
|
||||
|
@ -1,7 +1,7 @@
|
||||
//静态资源文件路劲
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//获取信息接口
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
import { sectionModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/sectionmodel';
|
||||
import { signalModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/signalmodel';
|
||||
|
@ -665,8 +665,7 @@ export function AssetLoader(){
|
||||
//object.traverse(function (node) {//获取其中对象
|
||||
// node.frustumCulled = true;
|
||||
//});
|
||||
console.log(asset.type);
|
||||
console.log(object);
|
||||
|
||||
if(asset.code){
|
||||
scope.modelgroup[asset.code] = object;
|
||||
}else{
|
||||
|
@ -663,10 +663,12 @@ class SkinCode extends defaultStyle {
|
||||
directionArrow: {
|
||||
},
|
||||
soonerOrLater: {
|
||||
level: 3,
|
||||
level: 5,
|
||||
serviceNumber: true,
|
||||
severeEarlyColor: '#FF00FF',
|
||||
earlyColor: '#00FF00',
|
||||
lateColor: '#800000',
|
||||
lateColor: '#FFFF00',
|
||||
severeLateColor: '#800000',
|
||||
normalColor: '#FFF'
|
||||
},
|
||||
hsda: {
|
||||
|
@ -13,7 +13,19 @@ class EMouse extends Group {
|
||||
}
|
||||
create() {
|
||||
let destinationText = LangStorage.getLang() == 'en' ? 'unknown' : '未知';
|
||||
if (this.device.style.Train.soonerOrLater && this.device.style.Train.soonerOrLater.level === 5) {
|
||||
if (this.device.style.Train.soonerOrLater && this.device.style.Train.soonerOrLater.level === 5 && this.device.style.Train.soonerOrLater.serviceNumber) {
|
||||
if (this.device.model.dt > 240) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'early seriously' : '严重早点';
|
||||
} else if (this.device.model.dt > 120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'early' : '早点';
|
||||
} else if (this.device.model.dt < -240) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'late seriously ' : '严重晚点';
|
||||
} else if (this.device.model.dt < -120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'late' : '晚点';
|
||||
} else {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'on time' : '准点';
|
||||
}
|
||||
} else if (this.device.style.Train.soonerOrLater && this.device.style.Train.soonerOrLater.level === 5) {
|
||||
if (this.device.model.dt > 120) {
|
||||
destinationText = LangStorage.getLang() == 'en' ? 'early seriously' : '严重早点';
|
||||
} else if (this.device.model.dt >= 15 && this.device.model.dt <= 120) {
|
||||
@ -53,7 +65,7 @@ class EMouse extends Group {
|
||||
text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${direction ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? (this.device.model.sectionModel.parentName ? this.device.model.sectionModel.parentName : this.device.model.sectionModel.name) : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.hold ? 'Detained' : 'Normal'}\n \n 跳停状态: ${this.device.model.jump ? 'Skip to continue moving' : 'Normal'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
|
||||
} else {
|
||||
if (this.device.style.Train.moreTrainDetail) {
|
||||
text = `列车类型: ${trainType}\n来\0\0\0\0源:人工标记\n车\0组\0号: ${this.device.model.groupNumber}\n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n早\0晚\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\nATP报告方向: ${direction ? '上行' : '下行'}\n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? (this.device.model.sectionModel.parentName ? this.device.model.sectionModel.parentName : this.device.model.sectionModel.name) : ''}\n所在车站: \n车次通信: 通信车\n运行时间: \n停站时间: \n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n车载扣车: 不执行\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'}\n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车状态: ${this.device.model.runLevel || 'CTC'}车\n最高信号系统控制: CTC\n驾驶模式: ${this.device.model.driveMode}模式\n最高ATP模式: AM\nATP1状态: 激活\nATP2状态: 备用\n速度: ${this.device.model.speed || 0} km/h\n车门状态: ${this.device.model.speed ? '关闭' : direction ? '左开右关' : '左关右开'}\n制动状态: 无紧急制动\n停车保证: 可保证停车\n站台无法进入: 否\n前方站台停车点: 中间\n折法策略: \n折返状态: \n屏蔽门开门许可: 是\n运营里程: 无效\n总重量: 196T\n车长: 11860cm\n列车编组: 1`;
|
||||
text = `列车类型: ${trainType}\n来\0\0\0\0源:人工标记\n车\0组\0号: ${this.device.model.groupNumber}\n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n早\0晚\0点: ${destinationText}${this.parseDt(this.device.model.dt)}\n运行方向: ${direction ? '上行' : '下行'}\nATP报告方向: ${direction ? '上行' : '下行'}\n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? (this.device.model.sectionModel.parentName ? this.device.model.sectionModel.parentName : this.device.model.sectionModel.name) : ''}\n所在车站: \n车次通信: 通信车\n运行时间: \n停站时间: \n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n车载扣车: 不执行\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'}\n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车状态: ${this.device.model.runLevel || 'CTC'}车\n最高信号系统控制: CTC\n驾驶模式: ${this.device.model.driveMode}模式\n最高ATP模式: AM\nATP1状态: 激活\nATP2状态: 备用\n速度: ${this.device.model.speed || 0} km/h\n车门状态: ${this.device.model.speed ? '关闭' : direction ? '左开右关' : '左关右开'}\n制动状态: 无紧急制动\n停车保证: 可保证停车\n站台无法进入: 否\n前方站台停车点: 中间\n折法策略: \n折返状态: \n屏蔽门开门许可: 是\n运营里程: 无效\n总重量: 196T\n车长: 11860cm\n列车编组: 1`;
|
||||
} else {
|
||||
text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? (this.device.model.sectionModel.parentName ? this.device.model.sectionModel.parentName : this.device.model.sectionModel.name) : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.hold ? '扣车' : '正常'}\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;
|
||||
}
|
||||
@ -111,7 +123,21 @@ class EMouse extends Group {
|
||||
this.trainBorder.hide();
|
||||
}
|
||||
}
|
||||
|
||||
parseDt(dt) {
|
||||
const time = Math.abs(dt);
|
||||
if (time < 120) {
|
||||
return '';
|
||||
} else if (time < 3600) {
|
||||
const m = Math.floor(time / 60);
|
||||
const s = time % 60;
|
||||
return m + '分' + s + '秒';
|
||||
} else {
|
||||
const h = Math.floor(time / 3600);
|
||||
const m = Math.floor( time % 3600 / 60);
|
||||
const s = time % 60;
|
||||
return h + '小时' + m + '分' + s + '秒';
|
||||
}
|
||||
}
|
||||
mouseover() {
|
||||
if (this.device.model.style.Train.common.trainTip) {
|
||||
this.device.deviceModel.__down = true;
|
||||
|
@ -381,7 +381,17 @@ export default class TrainBody extends Group {
|
||||
}
|
||||
}
|
||||
setSoonerOrLater(dt) {
|
||||
if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 5) {
|
||||
if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 5 && this.style.Train.soonerOrLater.serviceNumber) {
|
||||
if (dt > 240) {
|
||||
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.severeEarlyColor});
|
||||
} else if (dt > 120) {
|
||||
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.earlyColor});
|
||||
} else if (dt < -240) {
|
||||
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.severeLateColor});
|
||||
} else if (dt < -120) {
|
||||
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.lateColor});
|
||||
}
|
||||
} else if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 5) {
|
||||
if (dt > 120) {
|
||||
this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.severeEarlyColor});
|
||||
this.delayTime && this.delayTime.setStyle({textFill: this.style.Train.soonerOrLater.severeEarlyColor});
|
||||
|
223
src/jmapNew/theme/components/menus/dialog/psl.vue
Normal file
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="xian-01__systerm psl-panel"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="psl-title">
|
||||
<div>{{ title }}</div>
|
||||
</div>
|
||||
<div class="psl-content">
|
||||
<!-- <div class="content-row">
|
||||
<div class="btn">
|
||||
<div class="btn-text">
|
||||
有滑动门/应急门未关闭且锁紧指示灯
|
||||
</div>
|
||||
<img
|
||||
:src="getIcon('top', indicators.lock ? 'on' : 'off')"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="content-row">
|
||||
<div class="cell">
|
||||
<div class="btn-text">PSL操作指示灯</div>
|
||||
<img
|
||||
:src="
|
||||
getIcon('red', indicators.pslczLight ? 'on' : 'off')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="btn-text">互锁解除指示灯</div>
|
||||
<img
|
||||
:src="
|
||||
getIcon('red', indicators.hsjcLight ? 'on' : 'off')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell">
|
||||
<div class="btn-text">开门状态指示灯</div>
|
||||
<img
|
||||
:src="getIcon('red', indicators.kmLight ? 'on' : 'off')"
|
||||
/>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="btn-text">关门状态指示灯</div>
|
||||
<img
|
||||
:src="
|
||||
getIcon('green', indicators.gmLight ? 'on' : 'off')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">禁止</div>
|
||||
<img
|
||||
:src="getIcon('key')"
|
||||
:class="['key', { 'key-on': indicators.yxjzKey }]"
|
||||
@click="btnClickHandler('YXJZ')"
|
||||
/>
|
||||
<div class="btn-text-opt">允许</div>
|
||||
</div>
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">禁止</div>
|
||||
<img
|
||||
:src="getIcon('key')"
|
||||
:class="['key', { 'key-on': indicators.hsjcKey }]"
|
||||
@click="btnClickHandler('HSJC')"
|
||||
/>
|
||||
<div class="btn-text-opt">互锁解除</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">开门按钮</div>
|
||||
<img
|
||||
:src="getIcon('red', 'btn')"
|
||||
@click="btnClickHandler('KM')"
|
||||
/>
|
||||
</div>
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">关门按钮</div>
|
||||
<img
|
||||
:src="getIcon('green', 'btn')"
|
||||
@click="btnClickHandler('GM')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-row">
|
||||
<div class="cell btn">
|
||||
<div class="btn-text">试灯按钮</div>
|
||||
<img class="btn-sd btn-img"
|
||||
:src="getIcon('green', 'btn')"
|
||||
@mousedown.left="btnClickHandler('SD')"
|
||||
@mouseup.left="btnClickHandler('SD')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import icons from "@/assets/psl_images/psl_icons";
|
||||
import { getPslStatus, pressPslButton } from "@/api/simulation";
|
||||
let standCode, group;
|
||||
export default {
|
||||
name: "PSL",
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
indicators: {
|
||||
// lock: false,
|
||||
pslczLight: false,
|
||||
hsjcLight: false,
|
||||
kmLight: false,
|
||||
gmLight: false,
|
||||
yxjzKey: false,
|
||||
hsjcKey: false
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return "PSL";
|
||||
},
|
||||
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
});
|
||||
standCode = selected.code;
|
||||
group = this.$route.query.group;
|
||||
this.initData(group, standCode);
|
||||
},
|
||||
|
||||
initData(group, standCode) {
|
||||
getPslStatus(group, standCode)
|
||||
.then(resp => {
|
||||
if (resp.data) {
|
||||
this.indicators = resp.data;
|
||||
}
|
||||
})
|
||||
.catch(err => {});
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
},
|
||||
getIcon(type, status) {
|
||||
return status !== undefined
|
||||
? icons[`${type}_${status}`]
|
||||
: icons[type];
|
||||
},
|
||||
btnClickHandler(btnType) {
|
||||
pressPslButton(group, standCode, btnType);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"$store.state.socket.simulationPslStatus": function(val) {
|
||||
if (val && val[standCode]) {
|
||||
Object.assign(this.indicators, val[standCode])
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.psl-title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
color: #000;
|
||||
font-size: 18px;
|
||||
margin: 30px 0;
|
||||
}
|
||||
.psl-content {
|
||||
.content-row {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
margin: 10px 0;
|
||||
.cell {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
.key {
|
||||
transition: 0.1s;
|
||||
}
|
||||
.key-on {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.btn-text-opt {
|
||||
position: absolute;
|
||||
left: 80%;
|
||||
top: 35%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -17,7 +17,7 @@
|
||||
<el-form ref="form" :model="formModel" :rules="rules">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="targetDeviceCode" label="目的地:">
|
||||
<el-select ref="faultSelect1" v-model="formModel.targetDeviceCode" size="small" style="height: 32px;line-height: 32px;" placeholder="请选择">
|
||||
<el-select ref="faultSelect1" v-model="formModel.targetDeviceCode" filterable size="small" style="height: 32px;line-height: 32px;" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in selectedList"
|
||||
:key="item.code"
|
||||
@ -25,6 +25,9 @@
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-tooltip style="margin-left: 10px;" effect="dark" content="可在站场图上进行点选" placement="top-start">
|
||||
<i class="el-icon-warning" />
|
||||
</el-tooltip>
|
||||
<!--<el-button-->
|
||||
<!--:type="field == 'selectedCode' ? 'danger' : 'primary'"-->
|
||||
<!--size="small"-->
|
||||
|
@ -14,7 +14,13 @@
|
||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules" @submit.native.prevent>
|
||||
<div style="width: 96%;">
|
||||
<el-form-item label="限速值:" label-width="95px" prop="speedLimit">
|
||||
<el-input v-model="addModel.speedLimit" size="small" />
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-input v-model="addModel.speedLimit" style="width: 130px;margin-right: 10px;" size="small" />
|
||||
<span>km/h</span>
|
||||
<el-tooltip style="margin-left: 10px;" effect="dark" content="值为25-65之间,-1为取消限速" placement="top-start">
|
||||
<i class="el-icon-warning" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
@ -88,7 +94,7 @@ export default {
|
||||
validateLimit(rule, value, callback) {
|
||||
const num = Number(value);
|
||||
if (num) {
|
||||
if (num >= 25 && num <= 65) {
|
||||
if ((num >= 25 && num <= 65) || num === -1) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error('限速值应该在25-65之间'));
|
||||
|
@ -445,3 +445,11 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.xian-01__systerm .el-dialog .base-label {
|
||||
left: -7px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
|
@ -415,3 +415,11 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.xian-01__systerm .el-dialog .base-label {
|
||||
left: -7px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
|
@ -188,3 +188,11 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.xian-01__systerm .el-dialog .base-label {
|
||||
left: -7px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
|
@ -244,3 +244,11 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.xian-01__systerm .el-dialog .base-label {
|
||||
left: -7px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
|
@ -479,3 +479,11 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.xian-01__systerm .el-dialog .base-label {
|
||||
left: -7px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
|
@ -46,7 +46,7 @@ export default {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [
|
||||
{
|
||||
{
|
||||
label: '上电解锁',
|
||||
handler: this.powerUnLock,
|
||||
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK
|
||||
|
@ -9,6 +9,7 @@
|
||||
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
|
||||
<stand-back-strategy ref="standBackStrategy" />
|
||||
<set-fault ref="setFault" pop-class="xian-01__systerm" />
|
||||
<psl ref="psl" pop-class="xian-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -22,6 +23,7 @@ import StandStopTime from './dialog/standStopTime';
|
||||
import StandDetainTrainAll from './dialog/standDetainTrainAll';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import Psl from '@/jmapNew/theme/components/menus/dialog/psl';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
@ -39,7 +41,8 @@ export default {
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll,
|
||||
SetFault
|
||||
SetFault,
|
||||
Psl
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -174,7 +177,17 @@ export default {
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
// 非故障模式 且 角色为车站值班员时 增加PSL盘
|
||||
if (this.operatemode !== OperateMode.FAULT && this.$store.state.training.prdType === '01') {
|
||||
this.menu = [
|
||||
...this.menu,
|
||||
{
|
||||
label: 'PSL',
|
||||
handler: this.openPsl
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
@ -291,8 +304,13 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 触发故障管理
|
||||
triggerFaultManagement() {
|
||||
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
|
||||
},
|
||||
// 打开PSL面板
|
||||
openPsl(){
|
||||
this.$refs.psl.doShow(this.selected)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -121,51 +121,56 @@ export default {
|
||||
],
|
||||
menuDirective: [
|
||||
{
|
||||
label: '确认运行至前方站',
|
||||
handler: this.nextStation
|
||||
},
|
||||
{
|
||||
label: '越引导信号行驶',
|
||||
handler: this.handleOverFuideSignal
|
||||
},
|
||||
{
|
||||
label: '越红灯行驶',
|
||||
handler: this.handleOverEedLight
|
||||
},
|
||||
{
|
||||
label: '开关门',
|
||||
handler: this.handleOpenOrCloseDoor
|
||||
},
|
||||
{
|
||||
label: '限速指令',
|
||||
handler: this.handleSpeedLimit
|
||||
},
|
||||
{
|
||||
label: '换端',
|
||||
handler: this.handleTurnDirection
|
||||
},
|
||||
{
|
||||
label: '驾驶至',
|
||||
handler: this.handleDriveTo
|
||||
},
|
||||
{
|
||||
label: '切换驾驶模式',
|
||||
label: '故障处理',
|
||||
children: [
|
||||
{
|
||||
label: '转URM模式',
|
||||
handler: this.handleApplyUrmMode
|
||||
label: '切换驾驶模式',
|
||||
children: [
|
||||
{
|
||||
label: '转URM模式',
|
||||
handler: this.handleApplyUrmMode
|
||||
},
|
||||
{
|
||||
label: '转RM模式',
|
||||
handler: this.handleApplyRmMode
|
||||
},
|
||||
{
|
||||
label: '转CM模式',
|
||||
handler: this.handleApplyCmMode
|
||||
},
|
||||
{
|
||||
label: '转AM模式',
|
||||
handler: this.handleApplyAmMode
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '转RM模式',
|
||||
handler: this.handleApplyRmMode
|
||||
label: '确认运行至前方站',
|
||||
handler: this.nextStation
|
||||
},
|
||||
{
|
||||
label: '转CM模式',
|
||||
handler: this.handleApplyCmMode
|
||||
label: '越引导信号行驶',
|
||||
handler: this.handleOverFuideSignal
|
||||
},
|
||||
{
|
||||
label: '转AM模式',
|
||||
handler: this.handleApplyAmMode
|
||||
label: '越红灯行驶',
|
||||
handler: this.handleOverEedLight
|
||||
},
|
||||
{
|
||||
label: '开关门',
|
||||
handler: this.handleOpenOrCloseDoor
|
||||
},
|
||||
{
|
||||
label: '限速指令',
|
||||
handler: this.handleSpeedLimit
|
||||
},
|
||||
{
|
||||
label: '换端',
|
||||
handler: this.handleTurnDirection
|
||||
},
|
||||
{
|
||||
label: '驾驶至',
|
||||
handler: this.handleDriveTo
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -207,11 +212,13 @@ export default {
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
} else {
|
||||
this.menu = [...this.menuDirective, ...this.menu];
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
if (!this.$store.state.scriptRecord.bgSet) {
|
||||
this.menu = [...this.menuForce, ...this.menuDirective];
|
||||
this.menu = [...this.menuForce];
|
||||
} else {
|
||||
this.menu = [...this.menuForce];
|
||||
}
|
||||
|
@ -802,7 +802,7 @@ export default {
|
||||
trainingName: '设置联锁自动进路({5})',
|
||||
trainingRemark: '设置联锁自动进路',
|
||||
trainingType: 'Signal',
|
||||
productTypes: ['01'],
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '04', orderNum: 1, operateCode: '309', tip: '鼠标右键菜单选择【设置联锁自动进路】' },
|
||||
{ deviceType: '04', orderNum: 2, operateCode: '309', tip: '鼠标左键点击【确定】按钮' }
|
||||
@ -816,7 +816,7 @@ export default {
|
||||
trainingName: '取消联锁自动进路({5})',
|
||||
trainingRemark: '取消联锁自动进路',
|
||||
trainingType: 'Signal',
|
||||
productTypes: ['01'],
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '04', orderNum: 1, operateCode: '310', tip: '鼠标右键菜单选择【取消联锁自动进路】' },
|
||||
{ deviceType: '04', orderNum: 2, operateCode: '310', tip: '鼠标左键点击【确定】按钮' }
|
||||
@ -830,7 +830,7 @@ export default {
|
||||
trainingName: '设置联锁自动触发({5})',
|
||||
trainingRemark: '设置联锁自动触发',
|
||||
trainingType: 'Signal',
|
||||
productTypes: ['01'],
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '04', orderNum: 1, operateCode: '311', tip: '鼠标右键菜单选择【设置联锁自动触发】' },
|
||||
{ deviceType: '04', orderNum: 2, operateCode: '311', tip: '鼠标左键点击【确定】按钮' }
|
||||
@ -844,7 +844,7 @@ export default {
|
||||
trainingName: '取消联锁自动触发({5})',
|
||||
trainingRemark: '取消联锁自动触发',
|
||||
trainingType: 'Signal',
|
||||
productTypes: ['01'],
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '04', orderNum: 1, operateCode: '312', tip: '鼠标右键菜单选择【取消联锁自动触发】' },
|
||||
{ deviceType: '04', orderNum: 2, operateCode: '312', tip: '鼠标左键点击【确定】按钮' }
|
||||
|
@ -21,6 +21,7 @@ const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation')
|
||||
const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
|
||||
const Jlmap3dTrafficPlan = () => import('@/views/jlmap3d/trafficplan/jl3dtrafficplan');
|
||||
const Jlmap3dTrafficTrain = () => import('@/views/jlmap3d/trafficplan/jl3dtraffictrain');
|
||||
const Jl3dRailwayDrive = () => import('@/views/jlmap3d/railwaydrive/jl3drailwaydrive');
|
||||
// 三维沙盘测试
|
||||
const Jlmap3dSandBoxTest = () => import('@/views/jlmap3d/trafficplan/jl3dtestview');
|
||||
// 三维车站管理测试
|
||||
@ -160,6 +161,7 @@ const CreateLesson = () => import('@/views/organization/draftLessonManage/create
|
||||
const EditLessonContent = () => import('@/views/organization/draftLessonManage/editLessonContent');
|
||||
const SortLesson = () => import('@/views/organization/draftLessonManage/sortLesson');
|
||||
const StudentManage = () => import('@/views/organization/classManage/studentManage/index');
|
||||
const DurationView = () => import('@/views/organization/classManage/durationView');
|
||||
const GradeList = () => import('@/views/organization/examManage/gradeList');
|
||||
const CreateRule = () => import('@/views/organization/ruleManage/createRule');
|
||||
const TotalGrade = () => import('@/views/organization/ruleManage/totalGrade');
|
||||
@ -328,6 +330,11 @@ export const constantRoutes = [
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{
|
||||
path: '/jlmap3d/lesson3dplayer',
|
||||
component: Jl3dRailwayDrive,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/jlmap3d/devicemodel',
|
||||
component: Jlmap3dModel,
|
||||
@ -579,6 +586,11 @@ export const publicAsyncRoute = [
|
||||
component: StudentManage,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'durationView',
|
||||
component: DurationView,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'examRule/draft/:mode/:ruleId/:lessonId',
|
||||
component: PublishExamRuleDraft,
|
||||
|
@ -189,6 +189,9 @@ function handle(state, data) {
|
||||
store.dispatch('training/over');
|
||||
}
|
||||
break;
|
||||
case 'Simulation_PslStatus':
|
||||
state.simulationPslStatus = msg;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
@ -333,7 +336,8 @@ const socket = {
|
||||
simulationAlarmInfo: [], // 仿真报警信息
|
||||
deviceStateMessages: null, // 新版订阅设备状态消息
|
||||
simulationSpeed: 1, // 仿真倍速
|
||||
simulationPause: false
|
||||
simulationPause: false,
|
||||
simulationPslStatus: [], //PSL面板按钮状态信息
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
|
153
src/views/jlmap3d/railwaydevice/component/devicelist.vue
Normal file
@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<div class="editassets" :style="{'background-image': 'url('+localStatic+'/texture/devicelistpane.png)'}">
|
||||
<div class="asset-list">
|
||||
<!-- <el-tabs v-model="activeName"> -->
|
||||
<div class="devicelisttop">
|
||||
<p style="font-size:20px;color:#FFFFFF;">设备部件</p>
|
||||
</div>
|
||||
<div class="devicelistbottom">
|
||||
<div class="displaylist " v-for="(part,index) in devicelist" @click="deviceselect(index,part)" v-show="true" >
|
||||
<div >
|
||||
<p style="border:1px solid #FFFFFF;">{{part.text}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- </el-tabs> -->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
export default {
|
||||
name: 'Jl3ddeviceList',
|
||||
components: {
|
||||
|
||||
},
|
||||
props: ['devicelist'],
|
||||
data() {
|
||||
return {
|
||||
localStatic:JL3D_LOCAL_STATIC,
|
||||
activeName: 'train',
|
||||
filterText: '',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
devicetype:true,
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.tree2.filter(val);
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
deviceselect(index,train){
|
||||
this.$emit('sdevice',train);
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
},
|
||||
init: function() {
|
||||
|
||||
},
|
||||
back() {
|
||||
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.editassets {
|
||||
position: absolute;
|
||||
float:right;
|
||||
right:2%;
|
||||
top:10%;
|
||||
width: 20%;
|
||||
height: 80%;
|
||||
// background-color: #FFFFFF;
|
||||
|
||||
// border-radius:5px;
|
||||
background-repeat: no-repeat;
|
||||
overflow: hidden;
|
||||
background-size:90% 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.asset-list{
|
||||
// position:absolute;
|
||||
|
||||
width: 85%;
|
||||
height: 100%;
|
||||
|
||||
|
||||
|
||||
}
|
||||
.el-tabs{
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.el-scrollbar__wrap.default-scrollbar__wrap {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.devicelisttop{
|
||||
height:10%;
|
||||
width:100%;
|
||||
top:0;
|
||||
}
|
||||
.devicelistbottom{
|
||||
height:85%;
|
||||
width:100%;
|
||||
top:10%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.displaylist {
|
||||
float:left;
|
||||
position: relative;
|
||||
width:90px;
|
||||
// height:20px;
|
||||
font-size:19px;
|
||||
color:#FFFFFF;
|
||||
margin:0px 5px 0px 5px;
|
||||
|
||||
}
|
||||
.modelpic{
|
||||
left:0;
|
||||
position: absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.modeltop{
|
||||
bottom:0;
|
||||
z-index:0;
|
||||
}
|
||||
.modeldown{
|
||||
top:0;
|
||||
z-index:0;
|
||||
}
|
||||
|
||||
</style>
|
99
src/views/jlmap3d/railwaydevice/component/devicemsg.vue
Normal file
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div class="showmsg"
|
||||
:style="{'background-image': 'url('+localStatic+'/texture/devicemsgpane.png)'}"
|
||||
v-show="msgshow">
|
||||
|
||||
<div class="msgtop">
|
||||
{{devicename}}
|
||||
</div>
|
||||
<div class="msgdown">
|
||||
{{devicemsg}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
export default {
|
||||
name: 'Jl3ddeviceMsg',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
localStatic:JL3D_LOCAL_STATIC,
|
||||
msgshow:false,
|
||||
devicename:"",
|
||||
devicemsg:"",
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
updatemsg(name,text) {
|
||||
// console.log(name);
|
||||
// console.log(text);
|
||||
if(name){
|
||||
this.msgshow = true;
|
||||
this.devicename = name;
|
||||
this.devicemsg = text;
|
||||
}else{
|
||||
this.msgshow = false;
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
mounted() {
|
||||
window.updatemsg = this.updatemsg;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
.showmsg{
|
||||
position: absolute;
|
||||
float:left;
|
||||
left:2%;
|
||||
bottom:15%;
|
||||
width: 20%;
|
||||
height: 70%;
|
||||
z-index: 10;
|
||||
background-repeat:no-repeat;
|
||||
background-size: 90% 100%;
|
||||
|
||||
}
|
||||
.msgtop{
|
||||
text-align: center;
|
||||
width: 80%;
|
||||
height:10%;
|
||||
float: left;
|
||||
position: absolute;
|
||||
top:10%;
|
||||
font-size:18px;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
|
||||
.msgdown{
|
||||
position: absolute;
|
||||
top:20%;
|
||||
left:5%;
|
||||
width: 80%;
|
||||
height:75%;
|
||||
float: left;
|
||||
font-size:16px;
|
||||
color:#FFFFFF;
|
||||
word-wrap:break-word;
|
||||
letter-spacing:2px;
|
||||
overflow-y:scroll;
|
||||
}
|
||||
|
||||
</style>
|
348
src/views/jlmap3d/railwaydevice/jl3drailwaydevice.vue
Normal file
@ -0,0 +1,348 @@
|
||||
<template>
|
||||
<div id="jl3d" style="z-index: 2010" class="jl3ddraw">
|
||||
<Jl3ddevice-Msg v-show="isswitch ">
|
||||
</Jl3ddevice-Msg>
|
||||
<Jl3ddevice-List v-show="!actionshow &&isswitch" :devicelist="devicelist" @sdevice="sdevice">
|
||||
</Jl3ddevice-List>
|
||||
<canvas id="canvastexture" ></canvas>
|
||||
<div class="jl3dcontrolpane" v-show="isswitch">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="back">初始化</el-button>
|
||||
<el-button type="primary" @click="alldisper">{{disperreset}}</el-button>
|
||||
<el-button type="primary" @click="dispersed">{{devicestats}}</el-button>
|
||||
<el-button type="primary" @click="switchhide">{{switchshow}}</el-button>
|
||||
<el-button type="primary" @click="actionmodechange">{{actioncontrol}}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
<div class="jl3dactionpane" v-show="actionshow && isswitch">
|
||||
<el-button-group>
|
||||
<el-button type="primary" v-for="item in actionList" :key="item.type" @click="changeAction(item)">{{item.name}}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
<div id="jl3dwindow" v-show="isPsd" class="windowbutton"
|
||||
:style="{'background-image': 'url('+localStatic+'/texture/fk.png)'}"
|
||||
@click="windowchange"></div>
|
||||
|
||||
<div id="jl3dclose" v-show="isPsd" class="backbutton"
|
||||
:style="{'background-image': 'url('+localStatic+'/texture/xx.png)'}"
|
||||
@click="close3ddeviceview"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import { Jl3ddeviceNew } from '@/jlmap3d/jl3drailwaydevice/jl3ddeviceNew.js';
|
||||
|
||||
import Jl3ddeviceMsg from '@/views/jlmap3d/railwaydevice/component/devicemsg';
|
||||
import Jl3ddeviceList from '@/views/jlmap3d/railwaydevice/component/devicelist';
|
||||
|
||||
export default {
|
||||
name: 'Jl3dRailwayDevice',
|
||||
components: {
|
||||
Jl3ddeviceMsg,
|
||||
Jl3ddeviceList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
localStatic:JL3D_LOCAL_STATIC,
|
||||
datastatus:"",
|
||||
jl3d: null,
|
||||
psdlist:this.$store.state.map.map.psdList,
|
||||
windowstatus:false,
|
||||
devicelist:[],
|
||||
devicestats:"分步拆解",
|
||||
disperreset:"整体拆解",
|
||||
switchshow:"隐藏轨道",
|
||||
switchstatus:true,
|
||||
actioncontrol:"启用手摇道岔操作模式",
|
||||
actionshow:false,
|
||||
isPsd:true,
|
||||
isswitch:false,
|
||||
actionList:[
|
||||
{
|
||||
name:"步骤1:查看道岔",
|
||||
type:"action1",
|
||||
text:"看道岔开通位置,判断道岔是否需要改变,道岔上是否已加有钩锁器。尖轨与基本轨间空隙是否有异物。面对尖轨如左侧尖轨密贴基本轨,右侧尖轨与基本轨之间有缝隙,则该道岔开通右位。右侧尖轨密贴基本轨,左侧尖轨与基本轨之间有缝隙,则该道岔开通左位。",
|
||||
},
|
||||
{
|
||||
name:"步骤2:断电开锁",
|
||||
type:"action2",
|
||||
text:"断开道岔电源,打开盖孔板,如道岔原先已加锁,断电之后方可拆下钩锁器。",
|
||||
},
|
||||
{
|
||||
name:"步骤3:摇动道岔",
|
||||
type:"action3",
|
||||
text:"插入手摇把,摇动道岔,转到所需位置,在听到“咔嚓”落槽声后停止。如何判断手摇把摇动方向:手摇把插入转辙机时,手柄指向轨道侧时采用“顺拉逆推”,反之则采用“顺推逆拉”。这里“推”和“拉”指面向轨道时尖轨的运动方向",
|
||||
},
|
||||
{
|
||||
name:"步骤4:确认道岔",
|
||||
type:"action4",
|
||||
text:"面对道岔尖轨手指尖轨和另一人共同确认,尖轨与基本轨密贴,尖轨与基本轨无异物,才可以加锁。",
|
||||
},
|
||||
{
|
||||
name:"步骤5:加锁",
|
||||
type:"action5",
|
||||
text:"双人确认,道岔位置开通正确后,用钩锁器,锁定道岔,密贴尖轨。加锁器位置应在距尖轨头端,第二和第三块枕木之间",
|
||||
},
|
||||
{
|
||||
name:"步骤6:汇报情况",
|
||||
type:"action6",
|
||||
text:"人员及工器具出清,至安全区域后,向车控室汇报,道岔开通位置及加锁情况。",
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'jl3d.animastats': {
|
||||
handler: function (newVal, oldVal) {
|
||||
if (newVal != oldVal) {
|
||||
if(newVal == false){
|
||||
this.devicestats = "分步拆解";
|
||||
|
||||
this.disperreset = "整体拆解";
|
||||
}
|
||||
if(newVal == true){
|
||||
this.devicestats = "分步复位";
|
||||
|
||||
this.disperreset = "整体复位";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount': {
|
||||
handler: function (newVal, oldVal) {
|
||||
if(this.datastatus == "new"){
|
||||
if (newVal != oldVal) {
|
||||
if(this.$store.state.menuOperation.selected._type){
|
||||
if(this.$store.state.menuOperation.selected._type == "StationStand"){
|
||||
let standcode = this.$store.state.menuOperation.selected.code;
|
||||
for(let i=0,leni=this.psdlist.length;i<leni;i++){
|
||||
if(standcode == this.psdlist[i].standCode){
|
||||
this.jl3d.selectmodel(Vue.prototype.$jlmap.mapDevice[this.psdlist[i].code]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this.jl3d.selectmodel(this.$store.state.menuOperation.selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
// '$store.state.socket.device': {
|
||||
// deep: true,
|
||||
// handler: function (newVal, oldVal) {
|
||||
// if (newVal.code == oldVal.code) {
|
||||
// this.jl3d.updateaction(newVal);
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// },
|
||||
// '$store.state.socket.simulationOverCount': function () {
|
||||
// this.unsubscribe();
|
||||
// }
|
||||
},
|
||||
computed: {
|
||||
code() {
|
||||
return this.$route.query.code;
|
||||
},
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
window.updatemenulist = this.updatemenulist;
|
||||
window.psdModelShow = this.psdModelShow;
|
||||
let code = this.$route.query.code;
|
||||
let group = this.$route.query.group;
|
||||
let header = this.$route.query.token;
|
||||
// console.log(this.$store.state.menuOperation);
|
||||
// console.log(this.$store.state.map.map.linkList);
|
||||
// console.log(this.$store.state.map.map.linkList);
|
||||
|
||||
if(this.$route.query.type == "VR_PSD"){
|
||||
this.isPsd = false;
|
||||
let changeelement = document.getElementById('jl3d');
|
||||
changeelement.style.width = '100%';
|
||||
changeelement.style.height = '100%';
|
||||
changeelement.style.top = '0';
|
||||
this.windowstatus = true;
|
||||
// this.jl3d.updatewindowstatus('1');
|
||||
}
|
||||
//定义转辙机动画
|
||||
this.datastatus = "new";
|
||||
this.initnewdata(group,header);
|
||||
|
||||
if(this.$route.query.type == "VR_PSD"){
|
||||
this.jl3d.updatewindowstatus('1');
|
||||
this.psdCode = this.$route.query.psdCode;
|
||||
}
|
||||
// const mapdata = this.$store.getters['map/map'];
|
||||
// console.log(mapdata);
|
||||
// if (group) {
|
||||
// this.init(group,header);
|
||||
// // this.subscribe(code,group,header);
|
||||
// }
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
methods: {
|
||||
initnewdata: function (group,header){
|
||||
let dom = document.getElementById('jl3d');
|
||||
this.jl3d = new Jl3ddeviceNew(dom,group,header,this.mapId);
|
||||
},
|
||||
close3ddeviceview: function(){
|
||||
this.$emit('closedevice3dview');
|
||||
},
|
||||
windowchange: function(){
|
||||
let changeelement = document.getElementById('jl3d');
|
||||
if(this.windowstatus){
|
||||
changeelement.style.width = '50%';
|
||||
changeelement.style.height = '50%';
|
||||
changeelement.style.top = '25%';
|
||||
this.windowstatus = false;
|
||||
this.jl3d.updatewindowstatus('0');
|
||||
}else{
|
||||
changeelement.style.width = '100%';
|
||||
changeelement.style.height = '100%';
|
||||
changeelement.style.top = '0';
|
||||
this.windowstatus = true;
|
||||
this.jl3d.updatewindowstatus('1');
|
||||
}
|
||||
if(this.jl3d.domresize){
|
||||
this.jl3d.domresize();
|
||||
}
|
||||
},
|
||||
updatemenulist(devicelist) {
|
||||
if(devicelist){
|
||||
this.devicelist = devicelist;
|
||||
this.isswitch = true;
|
||||
}else{
|
||||
this.devicelist = [];
|
||||
this.isswitch = false;
|
||||
}
|
||||
|
||||
this.actionshow = false;
|
||||
this.actioncontrol = "启用手摇道岔操作模式";
|
||||
},
|
||||
sdevice(changedata) {
|
||||
this.jl3d.updateselect(changedata);
|
||||
},
|
||||
dispersed(){
|
||||
this.jl3d.disperdevice1();
|
||||
},
|
||||
alldisper(){
|
||||
this.jl3d.disperdevice2();
|
||||
},
|
||||
back(){
|
||||
this.jl3d.resetmodel();
|
||||
},
|
||||
switchhide(){
|
||||
if(this.switchstatus){
|
||||
this.switchstatus = false;
|
||||
this.switchshow = "显示轨道";
|
||||
this.jl3d.hideswitch(this.switchstatus);
|
||||
}else{
|
||||
this.switchstatus = true;
|
||||
this.switchshow = "隐藏轨道";
|
||||
this.jl3d.hideswitch(this.switchstatus);
|
||||
}
|
||||
},
|
||||
actionmodechange(){
|
||||
if(this.actionshow == false){
|
||||
this.actionshow = true;
|
||||
this.actioncontrol = "关闭手摇道岔操作模式";
|
||||
this.jl3d.changeStaticSwitch(false);
|
||||
}else{
|
||||
this.actionshow = false;
|
||||
this.actioncontrol = "启用手摇道岔操作模式";
|
||||
this.jl3d.changeStaticSwitch(true);
|
||||
this.jl3d.changeAnimate("reset");
|
||||
}
|
||||
},
|
||||
changeAction(action){
|
||||
if(action.text){
|
||||
updatemsg(action.name,action.text);
|
||||
}
|
||||
this.jl3d.changeAnimate(action.type);
|
||||
},
|
||||
psdModelShow(){
|
||||
if(this.psdCode){
|
||||
let data={
|
||||
code:this.$route.query.psdCode,
|
||||
_type:"Psd"
|
||||
};
|
||||
this.jl3d.selectmodel(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* #jl3d {
|
||||
width: 937px;
|
||||
height: 937px;
|
||||
} */
|
||||
|
||||
.jl3ddraw {
|
||||
z-index: 3001;
|
||||
position: absolute;
|
||||
float: right;
|
||||
top:25%;
|
||||
/* left: 0; */
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
z-index: 1500;
|
||||
}
|
||||
|
||||
#canvastexture {
|
||||
position: absolute;
|
||||
float: left;
|
||||
left: 0;
|
||||
z-index: -12;
|
||||
}
|
||||
|
||||
.windowbutton{
|
||||
width:25px;
|
||||
height:25px;
|
||||
position: absolute;
|
||||
right:60px;
|
||||
top:5px;
|
||||
background-repeat:no-repeat;
|
||||
background-size:100%;
|
||||
}
|
||||
.backbutton{
|
||||
width:25px;
|
||||
height:25px;
|
||||
position: absolute;
|
||||
right:15px;
|
||||
top:5px;
|
||||
background-repeat:no-repeat;
|
||||
background-size:100%;
|
||||
}
|
||||
|
||||
#canvastexture {
|
||||
position: absolute;
|
||||
float: left;
|
||||
left: 0;
|
||||
z-index: -12;
|
||||
}
|
||||
.jl3dcontrolpane{
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
}
|
||||
|
||||
.jl3dactionpane{
|
||||
position: absolute;
|
||||
bottom:0;
|
||||
right:0;
|
||||
}
|
||||
|
||||
</style>
|
@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<div style="width:100%;height:50%;position:absolute;bottom:4%">
|
||||
<div id="start" class="panebutton2" style="bottom:1%;left:5%;" >
|
||||
<div style="width:100%;height:100%;position:absolute;">
|
||||
<!-- <div id="start" class="panebutton2" style="bottom:1%;left:125px;" >
|
||||
<img class="buttonimg2" :src="start" />
|
||||
</div> -->
|
||||
|
||||
<div id="direct" class="brakebutton" style="bottom:5%;left:110px;">
|
||||
<img class="brakeimg" :src="brakeallimgurl" />
|
||||
<img id="directimgbrakeall" class="brakeimg" :src="brakeallimgurlt" :style="{transform:braketransall}" @mousedown="touchstartbrakeall" />
|
||||
</div>
|
||||
|
||||
<div id="direct" class="panebutton2" style="bottom:1%;left:25%;">
|
||||
<img class="buttonimg2" :src="direct" />
|
||||
<img id="directimg" class="buttonimg2" :src="directoffpng" :style="{transform:toutransform}" @mousedown="touchstart" />
|
||||
<div class="directbutton" style="top:0px;right:0;">{{ $t('jlmap3d.front') }}</div>
|
||||
<div class="directbutton" style="top:18px;right:0;">0</div>
|
||||
<div class="directbutton" style="top:36px;right:0;">{{ $t('jlmap3d.later') }}</div>
|
||||
<div id="direct" class="brakebutton" style="bottom:5%;left:440px;">
|
||||
<img class="brakeimg" :src="brakeimgurl" />
|
||||
<img id="directimgbrake" class="brakeimg" :src="brakeimgurlt" :style="{transform:braketrans}" @mousedown="touchstartbrake" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="div1" class ="pane-box">
|
||||
<img class="paneimg" :src="pane"/>
|
||||
<div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '0px': '0px'}">{{ $t('jlmap3d.traction') }}</div>
|
||||
<div class="panelb" :style="{right: isZh? '80px': '80px', top: '70px'}">0</div>
|
||||
<div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '130px': '130px'}">{{ $t('jlmap3d.braking') }}</div>
|
||||
<div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '145px': '145px'}">{{ $t('jlmap3d.quick') }}</div>
|
||||
<img id="div2" class="lgimg" :src="lg" :style="{top:movex}" @mousedown="speedstart" />
|
||||
<!-- @mouseup="speedend" -->
|
||||
</div>
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
<script>
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import { trainSimulationForce,trainSimulationGear } from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js';
|
||||
import { trainSimulationForce } from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js';
|
||||
|
||||
import store from '@/store/index';
|
||||
import { throttle } from '@/utils/throttle.js';
|
||||
@ -53,13 +53,17 @@
|
||||
apoimg:"",
|
||||
touchcontrol:true,
|
||||
touchstate:"Neutral",
|
||||
toutransform:"rotate(175deg)",
|
||||
braketrans:"rotate(394deg)",
|
||||
braketransall:"rotate(394deg)",
|
||||
start:JL3D_LOCAL_STATIC+"/jl3d/control/start.png",
|
||||
direct:JL3D_LOCAL_STATIC+"/jl3d/control/direct.png",
|
||||
brakeimgurl:JL3D_LOCAL_STATIC+"/jl3d/railway/st.png",
|
||||
brakeimgurlt:JL3D_LOCAL_STATIC+"/jl3d/railway/st1.png",
|
||||
brakeallimgurl:JL3D_LOCAL_STATIC+"/jl3d/railway/yuan.png",
|
||||
brakeallimgurlt:JL3D_LOCAL_STATIC+"/jl3d/railway/yuan11.png",
|
||||
directz:JL3D_LOCAL_STATIC+"/jl3d/control/directfront.png",
|
||||
directoffpng:JL3D_LOCAL_STATIC+"/jl3d/control/directoff.png",
|
||||
pane:JL3D_LOCAL_STATIC+"/jl3d/control/pane.png",
|
||||
lg:JL3D_LOCAL_STATIC+"/jl3d/control/lg.png",
|
||||
pane:JL3D_LOCAL_STATIC+"/jl3d/railway/lg.png",
|
||||
lg:JL3D_LOCAL_STATIC+"/jl3d/railway/yuahdfgdfre.png",
|
||||
|
||||
iconrotate:45,//旋转deg
|
||||
icontranslateX:100,//沿x轴位移px
|
||||
@ -103,11 +107,7 @@
|
||||
// },
|
||||
touchstate:function(val,oldval){
|
||||
if(val != oldval){
|
||||
// if(this.userRole == "DRIVER"){
|
||||
// trainSimulationGear(this.group,this.groupNum,this.touchstate).then(netdata => {
|
||||
//
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -144,14 +144,23 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
updateInitStatus : function(data){
|
||||
this.moveheight = data[4]/100*235;
|
||||
this.movex = this.moveheight+15 +"px";
|
||||
let angle = 397 - data[6]/150*83;
|
||||
let angleall =397 - data[5]/100*105;
|
||||
this.braketrans = "rotate("+angle+"deg)";
|
||||
this.braketransall = "rotate("+angleall+"deg)";
|
||||
|
||||
},
|
||||
centerstate : function(gear){
|
||||
this.touchstate = gear;
|
||||
if(this.touchstate == "Drive"){
|
||||
this.toutransform = "rotate(140deg)";
|
||||
this.braketransall = "rotate(140deg)";
|
||||
}else if(this.touchstate == "Neutral"){
|
||||
this.toutransform = "rotate(175deg)";
|
||||
this.braketransall = "rotate(175deg)";
|
||||
}else if(this.touchstate == "Reverse"){
|
||||
this.toutransform = "rotate(205deg)";
|
||||
this.braketransall = "rotate(205deg)";
|
||||
}
|
||||
},
|
||||
centercontrol : function(){
|
||||
@ -201,55 +210,36 @@
|
||||
},
|
||||
speedchange: function(event){
|
||||
this.moveheight = event.pageY-this.movelimit.y;
|
||||
this.movex = this.moveheight-7 +"px";
|
||||
this.movex = this.moveheight-15 +"px";
|
||||
// if(this.atostate == true){
|
||||
// this.$store.dispatch('app/setAtoState', false);
|
||||
// }
|
||||
if(this.moveheight<=1){
|
||||
this.moveheight=1;
|
||||
this.movex=-6+"px";
|
||||
}
|
||||
if(this.moveheight>=159){
|
||||
this.moveheight=159;
|
||||
this.movex=153+"px";
|
||||
}
|
||||
if(this.moveheight<86&&this.moveheight>73){
|
||||
this.movex=72+"px";
|
||||
this.move = this.moveheight/235;
|
||||
if(this.moveheight<=40){
|
||||
this.moveheight=30;
|
||||
this.movex=23+"px";
|
||||
this.move = 0;
|
||||
}else if(this.moveheight<0&&this.moveheight>159){
|
||||
|
||||
}else{
|
||||
|
||||
if(this.moveheight>=86){
|
||||
this.move = -(this.moveheight-82)/65;
|
||||
}
|
||||
if(this.moveheight<=73){
|
||||
this.move = (73 - this.moveheight)/75;
|
||||
}
|
||||
this.movex=this.moveheight-7+"px";
|
||||
if(this.moveheight>=145){
|
||||
this.movex= 150+"px";
|
||||
this.move = -1;
|
||||
}
|
||||
|
||||
}
|
||||
if(this.moveheight>=235){
|
||||
this.moveheight=235;
|
||||
this.movex=235+"px";
|
||||
this.move = 1;
|
||||
}
|
||||
let param = {
|
||||
// id:this.groupNum,
|
||||
id:"001",
|
||||
p:parseInt(this.move*100)
|
||||
pos:parseInt(this.move*100)
|
||||
};
|
||||
console.log(param.p);
|
||||
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
|
||||
console.log(this.group);
|
||||
console.log(userInfo.memberId);
|
||||
|
||||
throttle(
|
||||
trainSimulationForce(this.group,userInfo.memberId,param).then(res => {
|
||||
trainSimulationForce(this.group,userInfo.memberId,param,"Train_Drive_Throttle_Change").then(res => {
|
||||
// console.log(res);
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
,200,true);
|
||||
// updatemmic1(param.percent);
|
||||
updatemmic1(param.percent);
|
||||
},
|
||||
speedend: function(event){
|
||||
document.getElementById("div1").onmousemove = null;
|
||||
@ -265,35 +255,36 @@
|
||||
this.iconrotate=0;
|
||||
}
|
||||
},
|
||||
touchstart:function(e){
|
||||
touchstartbrake:function(e){
|
||||
|
||||
|
||||
let domoffset = document.getElementById("directimg").getBoundingClientRect();
|
||||
let domoffset = document.getElementById("directimgbrake").getBoundingClientRect();
|
||||
// movelimit
|
||||
this.angleoffset.x = domoffset.x;
|
||||
this.angleoffset.y = domoffset.y;
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
document.getElementById("directimg").onmousemove = this.touchmove;
|
||||
document.getElementById("directimg").onmouseup = this.touchend;
|
||||
document.getElementById("directimgbrake").onmousemove = this.touchmovebrake;
|
||||
document.getElementById("directimgbrake").onmouseup = this.touchendbrake;
|
||||
|
||||
|
||||
},
|
||||
touchmove:function(e){//finger move 触发
|
||||
touchmovebrake:function(e){//finger move 触发
|
||||
// console.log(e);
|
||||
this.getAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
|
||||
this.getAnglebrake(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
|
||||
},
|
||||
touchend:function(e){
|
||||
document.getElementById("directimg").onmousemove = null;
|
||||
document.getElementById("directimg").onmouseup = null;
|
||||
touchendbrake:function(e){
|
||||
document.getElementById("directimgbrake").onmousemove = null;
|
||||
document.getElementById("directimgbrake").onmouseup = null;
|
||||
},
|
||||
getAngle:function(mx,my){
|
||||
getAnglebrake:function(mx,my){
|
||||
//圆心坐标
|
||||
// console.log(mx);
|
||||
// console.log(my);
|
||||
let px=30;
|
||||
let py=30;
|
||||
let px=150;
|
||||
let py=150;
|
||||
let x = Math.abs(px-mx);
|
||||
let y = Math.abs(py-my);
|
||||
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
|
||||
@ -324,59 +315,128 @@
|
||||
if(mx<px&&my<py){//鼠标在第二象限
|
||||
angle = 360 - angle;
|
||||
}
|
||||
console.log(angle);
|
||||
console.log(this.userRole );
|
||||
if(angle<127 && angle>46){
|
||||
if(angle<63 && angle>46){
|
||||
if(this.touchstate != "Drive"){
|
||||
let data = {
|
||||
groupNumber:this.groupNum,
|
||||
gear:"Drive"
|
||||
};
|
||||
trainSimulationGear(this.group,data).then(netdata => {
|
||||
console.log(netdata);
|
||||
if(netdata.code == "200"){
|
||||
this.toutransform = "rotate(140deg)";
|
||||
this.touchstate = "Drive";
|
||||
document.getElementById("directimg").onmousemove = null;
|
||||
document.getElementById("directimg").onmouseup = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}else if(angle<93 && angle>68){
|
||||
if(this.touchstate != "Neutral"){
|
||||
let data = {
|
||||
groupNumber:this.groupNum,
|
||||
gear:"Neutral"
|
||||
};
|
||||
trainSimulationGear(this.group,data).then(netdata => {
|
||||
if(netdata.code == "200"){
|
||||
this.toutransform = "rotate(175deg)";
|
||||
this.touchstate = "Neutral";
|
||||
document.getElementById("directimg").onmousemove = null;
|
||||
document.getElementById("directimg").onmouseup = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}else if(angle<127 && angle>101){
|
||||
if(this.touchstate != "Reverse"){
|
||||
let data = {
|
||||
groupNumber:this.groupNum,
|
||||
gear:"Reverse"
|
||||
};
|
||||
trainSimulationGear(this.group,data).then(netdata => {
|
||||
if(netdata.code == "200"){
|
||||
this.toutransform = "rotate(205deg)";
|
||||
this.touchstate = "Reverse";
|
||||
document.getElementById("directimg").onmousemove = null;
|
||||
document.getElementById("directimg").onmouseup = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
angle += 180;
|
||||
|
||||
if(angle >292 && angle<427){
|
||||
let stopspeed = 0;
|
||||
if(angle>=397){
|
||||
stopspeed = 0;
|
||||
this.braketrans = "rotate("+angle+"deg)";
|
||||
}
|
||||
|
||||
if(angle<397 && angle>314){
|
||||
stopspeed = (397 - angle)/83;
|
||||
this.braketrans = "rotate("+angle+"deg)";
|
||||
}
|
||||
|
||||
if(angle<314){
|
||||
stopspeed = 1;
|
||||
this.braketrans = "rotate("+292+"deg)";
|
||||
}
|
||||
let param = {
|
||||
// id:this.groupNum,
|
||||
id:"001",
|
||||
pos:parseInt(stopspeed*150)
|
||||
};
|
||||
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
|
||||
throttle(
|
||||
trainSimulationForce(this.group,userInfo.memberId,param,"Train_Drive_Auto_Break ").then(res => {
|
||||
// console.log(res);
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
}),200,true);
|
||||
updatemmic1(param.percent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
touchstartbrakeall:function(e){
|
||||
|
||||
|
||||
let domoffset = document.getElementById("directimgbrakeall").getBoundingClientRect();
|
||||
// movelimit
|
||||
this.angleoffset.x = domoffset.x;
|
||||
this.angleoffset.y = domoffset.y;
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
document.getElementById("directimgbrakeall").onmousemove = this.touchmovebrakeall;
|
||||
document.getElementById("directimgbrakeall").onmouseup = this.touchendbrakeall;
|
||||
|
||||
|
||||
},
|
||||
touchmovebrakeall:function(e){//finger move 触发
|
||||
// console.log(e);
|
||||
this.getAnglebrakeall(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
|
||||
},
|
||||
touchendbrakeall:function(e){
|
||||
document.getElementById("directimgbrakeall").onmousemove = null;
|
||||
document.getElementById("directimgbrakeall").onmouseup = null;
|
||||
},
|
||||
getAnglebrakeall:function(mx,my){
|
||||
//圆心坐标
|
||||
// console.log(mx);
|
||||
// console.log(my);
|
||||
|
||||
let px=150;
|
||||
let py=150;
|
||||
let x = Math.abs(px-mx);
|
||||
let y = Math.abs(py-my);
|
||||
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
|
||||
let cos = y/z;
|
||||
let radina = Math.acos(cos);//用反三角函数求弧度
|
||||
let angle = Math.floor(180/(Math.PI/radina));//将弧度转换成角度
|
||||
|
||||
if(mx>px&&my>py){//鼠标在第四象限
|
||||
angle = 180 - angle;
|
||||
}
|
||||
|
||||
if(mx==px&&my>py){//鼠标在y轴负方向上
|
||||
angle = 180;
|
||||
}
|
||||
|
||||
if(mx>px&&my==py){//鼠标在x轴正方向上
|
||||
angle = 90;
|
||||
}
|
||||
|
||||
if(mx<px&&my>py){//鼠标在第三象限
|
||||
angle = 180+angle;
|
||||
}
|
||||
|
||||
if(mx<px&&my==py){//鼠标在x轴负方向
|
||||
angle = 270;
|
||||
}
|
||||
|
||||
if(mx<px&&my<py){//鼠标在第二象限
|
||||
angle = 360 - angle;
|
||||
}
|
||||
angle += 180;
|
||||
if(angle >292 && angle<431){
|
||||
let stopspeed = 0;
|
||||
this.braketransall = "rotate("+angle+"deg)";
|
||||
if(angle>=397){
|
||||
stopspeed = 0;
|
||||
}
|
||||
|
||||
if(angle<397 && angle>292){
|
||||
stopspeed = (397 - angle)/105;
|
||||
}
|
||||
let param = {
|
||||
// id:this.groupNum,
|
||||
id:"001",
|
||||
pos:parseInt(stopspeed*100)
|
||||
};
|
||||
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
|
||||
throttle(
|
||||
trainSimulationForce(this.group,userInfo.memberId,param,"Train_Drive_Single_Break ").then(res => {
|
||||
// console.log(res);
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
}),200,true);
|
||||
updatemmic1(param.percent);
|
||||
}
|
||||
|
||||
},
|
||||
@ -385,20 +445,36 @@
|
||||
</script>
|
||||
|
||||
<style >
|
||||
.brakebutton{
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
cursor:pointer;
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
}
|
||||
.brakeimg{
|
||||
top:0;
|
||||
left:0px;
|
||||
position: absolute;
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
|
||||
.pane-box{
|
||||
right: 30px;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
bottom: 10px;
|
||||
width:120px;
|
||||
height:160px;
|
||||
height:300px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
.lgimg{
|
||||
width: 60px;
|
||||
right:4px;
|
||||
left:30px;
|
||||
bottom:0px;
|
||||
height: 15px;
|
||||
height: 60px;
|
||||
position: absolute;
|
||||
cursor:pointer;
|
||||
}
|
||||
@ -415,8 +491,8 @@
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
width:100px;
|
||||
height:160px;
|
||||
width:120px;
|
||||
height:230px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
<div style="position: absolute;right:50%;top:50%;z-index:10;background: #EBEBEB;" v-show="tuoguanbutton" @click="tuoguan">{{ tuoguanbuttonmsg }}</div>
|
||||
<div style="position: absolute;right:50%;top:60%;z-index:10;background: #EBEBEB;" v-show="isTraining" >
|
||||
<!-- <div style="position: absolute;left:43%;top:5%;z-index:10;background: #EBEBEB;" v-show="isTraining" >
|
||||
<el-select v-model="value" :placeholder="initMsg" @change="currentsel" @visible-change="clickselect" >
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
@ -14,15 +14,15 @@
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<Centerc-Pane ref="centercontrol" :group-num="groupnum" :user-role="userrole" />
|
||||
|
||||
<!-- <Left-Pane ref="leftcontrol" /> -->
|
||||
|
||||
<!-- <Right-Pane ref="rightcontrol" /> -->
|
||||
<Right-Pane ref="rightcontrol" />
|
||||
|
||||
<TopRight-Pane ref="topcontrol" :group-num="groupnum" />
|
||||
<!-- <TopRight-Pane ref="topcontrol" :group-num="groupnum" /> -->
|
||||
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from '@/store/index';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
import CentercPane from '@/views/jlmap3d/railwaydrive/drivecontrol/centerpane';
|
||||
@ -59,11 +60,13 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
|
||||
import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
||||
import { bindSimulationTrain,getSimulationTrainlistNew,getSimulationMembersNew,trainSimulationEb,trainSimulationForce,trainSimulationGear} from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js';
|
||||
import { getSimulationInfoNew } from '@/api/simulation';
|
||||
import { bindSimulationTrain,getSimulationTrainlistNew,getSimulationMembersNew,trainSimulationEb,trainSimulationForce,trainSimulationGear,changeDriveTrain } from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js';
|
||||
import { getSimulationInfoNew} from '@/api/simulation';
|
||||
import { tuoguan3ddrive } from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
import { getToken } from '@/utils/auth';
|
||||
|
||||
import { getMemberListCommon, getUserListCommon } from '@/api/rtSimulation';
|
||||
// import Vue from 'vue';
|
||||
// import StompClient from '@/utils/stompclient.js';
|
||||
import axios from 'axios';
|
||||
@ -145,9 +148,12 @@ import axios from 'axios';
|
||||
}
|
||||
},
|
||||
currentsel(selVal){
|
||||
console.log(selVal);
|
||||
let oldgroupnum = this.groupnum;
|
||||
this.groupnum = selVal;
|
||||
bindSimulationTrain(this.group,this.groupnum).then(netdata => {
|
||||
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
|
||||
console.log(userInfo.id);
|
||||
changeDriveTrain(this.group,selVal,userInfo.id).then(netdata => {
|
||||
this.selVal = selVal;
|
||||
this.dialogVisible = true;
|
||||
// this.groupnum = selVal;
|
||||
@ -169,7 +175,6 @@ import axios from 'axios';
|
||||
},
|
||||
clickselect(e){
|
||||
if(e == true){
|
||||
|
||||
this.updatetrainlist();
|
||||
}
|
||||
},
|
||||
@ -210,7 +215,7 @@ import axios from 'axios';
|
||||
this.trainlist = netdata.data;
|
||||
for(let i=0;i<netdata.data.length;i++){
|
||||
let option= {
|
||||
value: netdata.data[i].groupNumber,
|
||||
value: netdata.data[i].id,
|
||||
label: netdata.data[i].groupNumber,
|
||||
name:null,
|
||||
}
|
||||
@ -219,7 +224,7 @@ import axios from 'axios';
|
||||
if(netdata.data[i].name){
|
||||
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
|
||||
this.initMsg = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
|
||||
this.groupNumber = netdata.data[i].groupNumber;
|
||||
this.groupNumber = netdata.data[i].id;
|
||||
option.disabled = true;
|
||||
}
|
||||
|
||||
@ -254,8 +259,8 @@ import axios from 'axios';
|
||||
}
|
||||
this.options.sort(
|
||||
function(obj1,obj2) {
|
||||
let val1 = obj1.value;
|
||||
let val2 = obj2.value;
|
||||
let val1 = obj1.label;
|
||||
let val2 = obj2.label;
|
||||
return val1 - val2;
|
||||
}
|
||||
);
|
||||
@ -284,45 +289,49 @@ import axios from 'axios';
|
||||
},
|
||||
updateDriveValue(newvalue){
|
||||
|
||||
if(newvalue != this.value){
|
||||
this.value = newvalue;
|
||||
this.groupnum = newvalue;
|
||||
}
|
||||
this.$refs.centercontrol.updateInitStatus(newvalue);
|
||||
this.$refs.rightcontrol.updateInitStatus(newvalue);
|
||||
},
|
||||
updatetrainlist(){
|
||||
getSimulationTrainlistNew(this.group).then(netdata => {
|
||||
this.options = [];
|
||||
this.trainlist = netdata.data;
|
||||
for(let i=0;i<netdata.data.length;i++){
|
||||
let option= {
|
||||
value: netdata.data[i].groupNumber,
|
||||
label: netdata.data[i].groupNumber,
|
||||
name:null,
|
||||
}
|
||||
option.disabled = false;
|
||||
|
||||
if(netdata.data[i].name){
|
||||
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
|
||||
this.initMsg = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
|
||||
this.groupNumber = netdata.data[i].groupNumber;
|
||||
option.disabled = true;
|
||||
}
|
||||
if(netdata.data[i].driverId){
|
||||
if(netdata.data[i].driverId == this.userId){
|
||||
this.selVal = netdata.data[i].groupNumber;
|
||||
this.groupnum = netdata.data[i].groupNumber;
|
||||
getMemberListCommon(this.$route.query.group,"DRIVER").then(netdata => {
|
||||
console.log(netdata.data);
|
||||
this.options = [];
|
||||
this.trainlist = netdata.data;
|
||||
for(let i=0;i<netdata.data.length;i++){
|
||||
let option= {
|
||||
value: netdata.data[i].id,
|
||||
label: netdata.data[i].deviceId,
|
||||
name:null,
|
||||
}
|
||||
}
|
||||
this.options.push(option);
|
||||
}
|
||||
this.options.sort(
|
||||
function(obj1,obj2) {
|
||||
let val1 = obj1.value;
|
||||
let val2 = obj2.value;
|
||||
return val1 - val2;
|
||||
}
|
||||
);
|
||||
option.disabled = false;
|
||||
|
||||
if(netdata.data[i].userId){
|
||||
option.label = netdata.data[i].userId+"正在驾驶"+netdata.data[i].deviceId;
|
||||
this.initMsg = netdata.data[i].userId+"正在驾驶"+netdata.data[i].deviceId;
|
||||
this.groupNumber = netdata.data[i].id;
|
||||
option.disabled = true;
|
||||
}
|
||||
if(netdata.data[i].driverId){
|
||||
if(netdata.data[i].driverId == this.userId){
|
||||
this.selVal = netdata.data[i].deviceId;
|
||||
this.groupnum = netdata.data[i].deviceId;
|
||||
}
|
||||
}
|
||||
this.options.push(option);
|
||||
}
|
||||
this.options.sort(
|
||||
function(obj1,obj2) {
|
||||
let val1 = obj1.label;
|
||||
let val2 = obj2.label;
|
||||
return val1 - val2;
|
||||
}
|
||||
);
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取仿真成员列表失败!');
|
||||
});
|
||||
|
||||
|
||||
|
||||
//获取当前录制托管状态
|
||||
if(this.tuoguanbutton == true){
|
||||
|
||||
@ -343,34 +352,7 @@ import axios from 'axios';
|
||||
}
|
||||
|
||||
}
|
||||
// getSimulationMembersNew(this.group).then(netdata => {
|
||||
|
||||
// for(let i=0,leni=netdata.data.length;i<leni;i++){
|
||||
// if(netdata.data[i].userId){
|
||||
// if(netdata.data[i].userId == this.userId){
|
||||
// this.userrole = netdata.data[i].role;
|
||||
// if(netdata.data[i].trust){
|
||||
// this.tuoguanstatus = netdata.data[i].trust;
|
||||
// if(this.tuoguanstatus){
|
||||
// this.tuoguanbuttonmsg = "取消托管";
|
||||
// }else{
|
||||
// this.tuoguanbuttonmsg = "托管";
|
||||
// }
|
||||
// }
|
||||
// i=leni;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// this.userrole = netdata.data.role;
|
||||
// if(netdata.data.trust){
|
||||
// this.tuoguanstatus = netdata.data.trust;
|
||||
// if(this.tuoguanstatus){
|
||||
// this.tuoguanbuttonmsg = "取消托管";
|
||||
// }else{
|
||||
// this.tuoguanbuttonmsg = "托管";
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
@ -380,9 +362,9 @@ import axios from 'axios';
|
||||
|
||||
<style>
|
||||
.drivepane{
|
||||
width:30%;
|
||||
height:320px;
|
||||
right:500px;
|
||||
width:60%;
|
||||
height:333px;
|
||||
right:0;
|
||||
bottom:0;
|
||||
position: absolute;
|
||||
background-size: 100% 100%;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<!-- <div style="width:25%;height:100%;position:absolute;left:75%;">
|
||||
<div style="width:30%;height:100%;position:absolute;right:0%;">
|
||||
|
||||
<div id="dropen" class="panebutton" style="bottom:1%;left:1%;" @tap="droclick">
|
||||
<img class="buttonimg" :src="redlimg" />
|
||||
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
|
||||
</div>
|
||||
<!-- <div id="dropen" class="panebutton" style="bottom:1%;left:1%;" @tap="droclick">
|
||||
<img class="buttonimg" :src="redlimg" />
|
||||
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="drclose" class="panebutton" style="bottom:1%;left:41%;" @tap="drcclick">
|
||||
@ -15,16 +15,21 @@
|
||||
<div id="urgestop" class="panebutton" style="top:1%;left:1%;">
|
||||
<img class="buttonimg" :src="urgestopimg" />
|
||||
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
|
||||
</div> -->
|
||||
|
||||
<div id="stallpane" class="stalldiv" style="top:10%;left:0%;">
|
||||
<img id="nowstall" :style="{top:stalltop,left:stallleft}" class="nowstallimg" :src="nowstallimgurl" />
|
||||
<img class="stallimg" :src="stallimgurl" />
|
||||
</div>
|
||||
|
||||
<div id="doorpick" class="panebutton2" style="top:1%;left:33%;">
|
||||
<img class="buttonimg2" :src="zuoimg" />
|
||||
<img class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @touchstart='doordirecttouchstart' @touchmove='doordirecttouchmove' @touchend='doordirecttouchend'/>
|
||||
<div class="tfbutton" style="font-size:1px;top:13px;left:5px;">{{ $t('jlmap3d.leftSide') }}</div>
|
||||
<div class="tfbutton" style="font-size:1px;top:5px;left:33px;">{{ $t('jlmap3d.location0') }}</div>
|
||||
<div class="tfbutton" style="font-size:1px;top:13px;left:50px;">{{ $t('jlmap3d.rightSide') }}</div>
|
||||
<div class="buttontext2">{{ $t('jlmap3d.doorSideChoose') }}</div>
|
||||
</div> -->
|
||||
<div id="directpane" class="directbutton" style="bottom:10%;left:0;">
|
||||
<img class="rightbuttonbcimg" :src="zuoimg" />
|
||||
<img id="directimgdiv" class="rightbuttonbcimg" :src="niuimg" :style="{transform:doordirecttou}" @mousedown='doordirecttouchstart' />
|
||||
</div>
|
||||
|
||||
<div id="clutch" class="directbutton" style="bottom:10%;left:150px;">
|
||||
<img class="rightbuttonbcimg" :src="liheimg" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@ -34,6 +39,10 @@
|
||||
import Vue from 'vue';
|
||||
// import { sendSimulationCommand } from '@/api/simulation.js';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
import store from '@/store/index';
|
||||
import { trainSimulationForce } from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js';
|
||||
|
||||
export default {
|
||||
name: 'RightPane',
|
||||
components: {
|
||||
@ -43,13 +52,25 @@
|
||||
return {
|
||||
redlimg:JL3D_LOCAL_STATIC+"/jl3d/control/redl.png",
|
||||
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
|
||||
zuoimg:JL3D_LOCAL_STATIC+"/jl3d/control/zuo.png",
|
||||
zuoimg:JL3D_LOCAL_STATIC+"/jl3d/railway/direct.png",
|
||||
liheimg:JL3D_LOCAL_STATIC+"/jl3d/railway/lihe.png",
|
||||
stallimgurl:JL3D_LOCAL_STATIC+"/jl3d/railway/stall.jpg",
|
||||
nowstallimgurl:JL3D_LOCAL_STATIC+"/jl3d/railway/yuahdfgdfre.png",
|
||||
niuimg:JL3D_LOCAL_STATIC+"/jl3d/control/niu.png",
|
||||
urgestopimg:JL3D_LOCAL_STATIC+"/jl3d/control/urgestop.png",
|
||||
stalltop:"29px",
|
||||
stallleft:"127px",
|
||||
stallh:1,
|
||||
stalll:2,
|
||||
directType:0,
|
||||
oldDirectType:0,
|
||||
doordirecttou:"rotate(0deg)",
|
||||
doormodetou:"rotate(0deg)",
|
||||
watertou:"rotate(0deg)",
|
||||
washtou:"rotate(0deg)",
|
||||
angleoffset: {
|
||||
x: null,
|
||||
y: null
|
||||
},
|
||||
|
||||
stalls:[],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -57,7 +78,7 @@
|
||||
},
|
||||
computed: {
|
||||
group() {
|
||||
return this.$store.state.app.group;
|
||||
return this.$route.query.group;
|
||||
},
|
||||
code() {
|
||||
return this.$store.state.app.code;
|
||||
@ -70,201 +91,254 @@
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
||||
window.addEventListener('keyup',this.handleKeyup);
|
||||
let stall1 = [
|
||||
{
|
||||
l:15,
|
||||
t:-15,
|
||||
type:"-1",
|
||||
},
|
||||
{
|
||||
l:68,
|
||||
t:-15,
|
||||
type:"2",
|
||||
},
|
||||
{
|
||||
l:127,
|
||||
t:-15,
|
||||
type:"5",
|
||||
},
|
||||
{
|
||||
l:169,
|
||||
t:-15,
|
||||
type:"6",
|
||||
},
|
||||
{
|
||||
l:212,
|
||||
t:-15,
|
||||
type:"8",
|
||||
}
|
||||
];
|
||||
let stall2 = [
|
||||
{
|
||||
l:15,
|
||||
t:29,
|
||||
type:"0",
|
||||
},
|
||||
{
|
||||
l:68,
|
||||
t:29,
|
||||
type:"0",
|
||||
},
|
||||
{
|
||||
l:127,
|
||||
t:29,
|
||||
type:"0",
|
||||
},
|
||||
{
|
||||
l:169,
|
||||
t:29,
|
||||
type:"0",
|
||||
},
|
||||
{
|
||||
l:212,
|
||||
t:29,
|
||||
type:"0",
|
||||
}
|
||||
];
|
||||
let stall3 = [
|
||||
{
|
||||
l:15,
|
||||
t:72,
|
||||
type:"1",
|
||||
},
|
||||
{
|
||||
l:68,
|
||||
t:72,
|
||||
type:"3",
|
||||
},
|
||||
{
|
||||
l:127,
|
||||
t:72,
|
||||
type:"4",
|
||||
},
|
||||
{
|
||||
l:169,
|
||||
t:72,
|
||||
type:"7",
|
||||
},
|
||||
{
|
||||
l:212,
|
||||
t:72,
|
||||
type:"9",
|
||||
}
|
||||
];
|
||||
this.stalls.push(stall1);
|
||||
this.stalls.push(stall2);
|
||||
this.stalls.push(stall3);
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
rightstate : function(rights){
|
||||
updateInitStatus : function(data){
|
||||
if(data[2] == "1"){
|
||||
this.doordirecttou = "rotate("+320+"deg)";
|
||||
this.oldDirectType = 1;
|
||||
}
|
||||
if(data[2] == "0"){
|
||||
this.doordirecttou = "rotate("+360+"deg)";
|
||||
this.oldDirectType = 0;
|
||||
}
|
||||
if(data[2] == "-1"){
|
||||
this.doordirecttou = "rotate("+399+"deg)";
|
||||
this.oldDirectType = -1;
|
||||
}
|
||||
if(data[2] == "2"){
|
||||
this.doordirecttou = "rotate("+442+"deg)";
|
||||
this.oldDirectType = 2;
|
||||
}
|
||||
|
||||
},
|
||||
rightcontrol : function(){
|
||||
switch (data[3]) {
|
||||
case -1:
|
||||
this.stallh = 0;
|
||||
this.stalll = 0;
|
||||
break;
|
||||
case 0:
|
||||
this.stallh = 1;
|
||||
this.stalll = 2;
|
||||
break;
|
||||
case 1:
|
||||
this.stallh = 2;
|
||||
this.stalll = 0;
|
||||
break;
|
||||
case 2:
|
||||
this.stallh = 0;
|
||||
this.stalll = 1;
|
||||
break;
|
||||
case 3:
|
||||
this.stallh = 2;
|
||||
this.stalll = 1;
|
||||
break;
|
||||
case 4:
|
||||
this.stallh = 2;
|
||||
this.stalll = 2;
|
||||
break;
|
||||
case 5:
|
||||
this.stallh = 0;
|
||||
this.stalll = 2;
|
||||
break;
|
||||
case 6:
|
||||
this.stallh = 0;
|
||||
this.stalll = 3;
|
||||
break;
|
||||
case 7:
|
||||
this.stallh = 2;
|
||||
this.stalll = 3;
|
||||
break;
|
||||
case 8:
|
||||
this.stallh = 0;
|
||||
this.stalll = 4;
|
||||
break;
|
||||
case 9:
|
||||
this.stallh = 2;
|
||||
this.stalll = 4;
|
||||
}
|
||||
|
||||
},
|
||||
showmsg:function(data){
|
||||
wx.showToast({
|
||||
title: data,
|
||||
icon: 'loading',
|
||||
duration: 2000
|
||||
});
|
||||
},
|
||||
showcontrolmsg:function(data,callback){
|
||||
this.controlmsg = data;
|
||||
this.msgshow = true;
|
||||
|
||||
callback = callback || function(){
|
||||
this.setData();
|
||||
this.stalltop = this.stalls[this.stallh][this.stalll].t +"px";
|
||||
this.stallleft = this.stalls[this.stallh][this.stalll].l +"px";
|
||||
},
|
||||
handleKeyup(event){
|
||||
const e = event || window.event || arguments.callee.caller.arguments[0];
|
||||
if(!e) return;
|
||||
const {key,keyCode} = e;
|
||||
//上
|
||||
if(keyCode == "38"){
|
||||
if(this.stallh >=1){
|
||||
this.stallh = this.stallh - 1;
|
||||
}
|
||||
}
|
||||
//下
|
||||
if(keyCode == "40"){
|
||||
if(this.stallh<2){
|
||||
this.stallh = this.stallh + 1;
|
||||
}
|
||||
}
|
||||
//左
|
||||
if(keyCode == "37"){
|
||||
if(this.stallh == 1){
|
||||
if(this.stalll>=1){
|
||||
this.stalll = this.stalll - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//右
|
||||
if(keyCode == "39"){
|
||||
if(this.stallh == 1){
|
||||
if(this.stallh == 1){
|
||||
if(this.stalll<4){
|
||||
this.stalll = this.stalll + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.stalltop = this.stalls[this.stallh][this.stalll].t +"px";
|
||||
this.stallleft = this.stalls[this.stallh][this.stalll].l +"px";
|
||||
|
||||
let param = {
|
||||
// id:this.groupNum,
|
||||
id:"001",
|
||||
pos:parseInt(this.stalls[this.stallh][this.stalll].type)
|
||||
};
|
||||
setTimeout( callback.bind(this),2000);
|
||||
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
|
||||
|
||||
},
|
||||
droclick: function (e){
|
||||
//console.log("右侧车门开");
|
||||
if(this.movespeed == 0){
|
||||
this.showcontrolmsg(this.$t('jlmap3d.rightDoorOpen'));
|
||||
this.controlsend(this.traincode,"604","07","");
|
||||
}
|
||||
},
|
||||
drcclick: function (e){
|
||||
//console.log("右侧车门关");
|
||||
if(this.movespeed == 0){
|
||||
this.showcontrolmsg(this.$t('jlmap3d.rightDoorClose'));
|
||||
this.controlsend(this.traincode,"606","07","");
|
||||
}
|
||||
},
|
||||
urgestopclick: function (e){
|
||||
trainSimulationForce(this.group,userInfo.memberId,param,"Train_Drive_Gear_Change").then(res => {
|
||||
// console.log(res);
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
},
|
||||
controlsend:function(traincode,operation,type,param){
|
||||
if(this.$store.state.app.userRole == "Driver"){
|
||||
let command ={
|
||||
code: traincode,
|
||||
operation: operation,
|
||||
type: type,
|
||||
param: param
|
||||
};
|
||||
// sendSimulationCommand(this.group,command);
|
||||
}else{
|
||||
|
||||
}
|
||||
},
|
||||
watertouchstart:function(e){
|
||||
// let command ={
|
||||
// code:this.traincode,
|
||||
// operation:"607",
|
||||
// type:"07",
|
||||
// param:""
|
||||
// };
|
||||
// command.param = this.touchstate;
|
||||
// sendSimulationCommand(this.group,command).then(netdata => {
|
||||
// if(netdata.data == true){
|
||||
this.touchcontrol = true;
|
||||
// }
|
||||
// });
|
||||
},
|
||||
watertouchmove:function(e){//finger move 触发
|
||||
if(this.touchcontrol == true){
|
||||
let px=140;
|
||||
let py=400;
|
||||
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
|
||||
if(angle<338 && angle>245){
|
||||
if(angle<295 && angle>245){
|
||||
this.watertou = "rotate(359deg)";
|
||||
}else if(angle<338 && angle>295){
|
||||
this.watertou = "rotate(412deg)";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watertouchend:function(e){
|
||||
this.touchcontrol = false;
|
||||
},
|
||||
washtouchstart:function(e){
|
||||
// let command ={
|
||||
// code:this.traincode,
|
||||
// operation:"607",
|
||||
// type:"07",
|
||||
// param:""
|
||||
// };
|
||||
// command.param = this.touchstate;
|
||||
// sendSimulationCommand(this.group,command).then(netdata => {
|
||||
// if(netdata.data == true){
|
||||
this.touchcontrol = true;
|
||||
// }
|
||||
// });
|
||||
},
|
||||
washtouchmove:function(e){//finger move 触发
|
||||
if(this.touchcontrol == true){
|
||||
let px=140;
|
||||
let py=510;
|
||||
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
|
||||
// console.log(angle);
|
||||
// this.washtou = "rotate("+(angle+85)+"deg)";
|
||||
if(angle<360 && angle>245){
|
||||
if(angle<295 && angle>245){
|
||||
this.washtou = "rotate(359deg)";
|
||||
}else if(angle<338 && angle>295){
|
||||
this.washtou = "rotate(412deg)";
|
||||
}else if(angle<360 && angle>338){
|
||||
this.washtou = "rotate(90deg)";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
washtouchend:function(e){
|
||||
this.touchcontrol = false;
|
||||
},
|
||||
doordirecttouchstart:function(e){
|
||||
// let command ={
|
||||
// code:this.traincode,
|
||||
// operation:"607",
|
||||
// type:"07",
|
||||
// param:""
|
||||
// };
|
||||
// command.param = this.touchstate;
|
||||
// sendSimulationCommand(this.group,command).then(netdata => {
|
||||
// if(netdata.data == true){
|
||||
this.touchcontrol = true;
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
let domoffset = document.getElementById("directimgdiv").getBoundingClientRect();
|
||||
// movelimit
|
||||
this.angleoffset.x = domoffset.x;
|
||||
this.angleoffset.y = domoffset.y;
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
document.getElementById("directimgdiv").onmousemove = this.doordirecttouchmove;
|
||||
document.getElementById("directimgdiv").onmouseup = this.doordirecttouchup;
|
||||
|
||||
|
||||
},
|
||||
doordirecttouchmove:function(e){//finger move 触发
|
||||
if(this.touchcontrol == true){
|
||||
let px=230;
|
||||
let py=180;
|
||||
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
|
||||
if(angle<338 && angle>219){
|
||||
if(angle<245 && angle>219){
|
||||
this.doordirecttou = "rotate(305deg)";
|
||||
}else if(angle<295 && angle>245){
|
||||
this.doordirecttou = "rotate(359deg)";
|
||||
}else if(angle<338 && angle>295){
|
||||
this.doordirecttou = "rotate(412deg)";
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(e);
|
||||
|
||||
this.getAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
|
||||
},
|
||||
doordirecttouchend:function(e){
|
||||
this.touchcontrol = false;
|
||||
doordirecttouchup:function(e){
|
||||
document.getElementById("directimgdiv").onmousemove = null;
|
||||
document.getElementById("directimgdiv").onmouseup = null;
|
||||
},
|
||||
doormodetouchstart:function(e){
|
||||
// let command ={
|
||||
// code:this.traincode,
|
||||
// operation:"607",
|
||||
// type:"07",
|
||||
// param:""
|
||||
// };
|
||||
// command.param = this.touchstate;
|
||||
// sendSimulationCommand(this.group,command).then(netdata => {
|
||||
// if(netdata.data == true){
|
||||
this.touchcontrol = true;
|
||||
// }
|
||||
// });
|
||||
},
|
||||
doormodetouchmove:function(e){//finger move 触发
|
||||
if(this.touchcontrol == true){
|
||||
let px=230;
|
||||
let py=280;
|
||||
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
|
||||
if(angle<338 && angle>219){
|
||||
if(angle<245 && angle>219){
|
||||
this.doormodetou = "rotate(305deg)";
|
||||
Vue.prototype.$stomp.send("/app/topic/simulation/drive","AA");
|
||||
}else if(angle<295 && angle>245){
|
||||
this.doormodetou = "rotate(359deg)";
|
||||
Vue.prototype.$stomp.send("/app/topic/simulation/drive","AM");
|
||||
}else if(angle<338 && angle>295){
|
||||
this.doormodetou = "rotate(412deg)";
|
||||
Vue.prototype.$stomp.send("/app/topic/simulation/drive","MM");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
doormodetouchend:function(e){
|
||||
this.touchcontrol = false;
|
||||
},
|
||||
getAngle:function(px,py,mx,my){
|
||||
|
||||
getAngle:function(mx,my){
|
||||
|
||||
let px=50;
|
||||
let py=50;
|
||||
// let x = Math.abs(px-mx);
|
||||
// let y = Math.abs(py-my);
|
||||
// let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
|
||||
// let cos = y/z;
|
||||
// let radina = Math.acos(cos);//用反三角函数求弧度
|
||||
// let angle = Math.floor(180/(Math.PI/radina));//将弧度转换成角度
|
||||
|
||||
|
||||
//圆心坐标
|
||||
let x = Math.abs(px-mx);
|
||||
let y = Math.abs(py-my);
|
||||
@ -277,26 +351,62 @@
|
||||
angle = 180 - angle;
|
||||
}
|
||||
|
||||
if(mx==px&&my>py){//鼠标在y轴负方向上
|
||||
angle = 180;
|
||||
}
|
||||
// if(mx==px&&my>py){//鼠标在y轴负方向上
|
||||
// angle = 180;
|
||||
// }
|
||||
|
||||
if(mx>px&&my==py){//鼠标在x轴正方向上
|
||||
angle = 90;
|
||||
}
|
||||
// if(mx>px&&my==py){//鼠标在x轴正方向上
|
||||
// angle = 90;
|
||||
// }
|
||||
|
||||
if(mx<px&&my>py){//鼠标在第三象限
|
||||
angle = 180+angle;
|
||||
}
|
||||
|
||||
if(mx<px&&my==py){//鼠标在x轴负方向
|
||||
angle = 270;
|
||||
}
|
||||
//
|
||||
// if(mx<px&&my==py){//鼠标在x轴负方向
|
||||
// angle = 270;
|
||||
// }
|
||||
|
||||
if(mx<px&&my<py){//鼠标在第二象限
|
||||
angle = 360 - angle;
|
||||
}
|
||||
return angle;
|
||||
|
||||
angle = angle + 180;
|
||||
// console.log(angle);
|
||||
if(angle<=356){
|
||||
|
||||
this.doordirecttou = "rotate("+320+"deg)";
|
||||
this.directType = 1;
|
||||
}
|
||||
if(angle>356 && angle<372){
|
||||
this.doordirecttou = "rotate("+360+"deg)";
|
||||
this.directType = 0;
|
||||
}
|
||||
|
||||
if(angle>372 && angle<421){
|
||||
this.doordirecttou = "rotate("+399+"deg)";
|
||||
this.directType = -1;
|
||||
}
|
||||
|
||||
if(angle>421){
|
||||
this.doordirecttou = "rotate("+442+"deg)";
|
||||
this.directType = 2;
|
||||
}
|
||||
if(this.oldDirectType != this.directType){
|
||||
this.oldDirectType = this.directType;
|
||||
let param = {
|
||||
// id:this.groupNum,
|
||||
id:"001",
|
||||
pos:parseInt(this.directType)
|
||||
};
|
||||
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
|
||||
|
||||
trainSimulationForce(this.group,userInfo.memberId,param,"Train_Drive_Change_Over_Switch").then(res => {
|
||||
// console.log(res);
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
@ -304,5 +414,40 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.stalldiv{
|
||||
width: 280px;
|
||||
height: 140px;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
cursor:pointer;
|
||||
}
|
||||
.stallimg{
|
||||
left:0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.nowstallimg{
|
||||
width:50px;
|
||||
height:50px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.directbutton{
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.rightbuttonbcimg{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
}
|
||||
</style>
|
||||
|
@ -10,8 +10,8 @@
|
||||
<el-button-group>
|
||||
|
||||
<!-- <el-button type="primary" @click="raystand">站台选择</el-button> -->
|
||||
<el-button type="primary" @click="cctvplane">{{ cctvbuttonmsg }}</el-button>
|
||||
<el-button type="primary" @click="showplane">{{ showbuttonmsg }}</el-button>
|
||||
<!-- <el-button type="primary" @click="cctvplane">{{ cctvbuttonmsg }}</el-button> -->
|
||||
<!-- <el-button type="primary" @click="showplane">{{ showbuttonmsg }}</el-button> -->
|
||||
<el-button type="primary" @click="back">{{backmsg}}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
@ -276,18 +276,20 @@ export default {
|
||||
|
||||
back() {
|
||||
|
||||
if(this.$route.query.type == "DRIVE"){
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
}else{
|
||||
this.$emit('showdriving');
|
||||
this.jlmap3d.eventoff();
|
||||
this.jlmap3d.animateoff();
|
||||
// this.jlmap3d = null;
|
||||
}
|
||||
|
||||
|
||||
// if(this.$route.query.type == "DRIVE"){
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
// location.reload();
|
||||
// });
|
||||
// }else{
|
||||
// this.$emit('showdriving');
|
||||
// this.jlmap3d.eventoff();
|
||||
// this.jlmap3d.animateoff();
|
||||
// // this.jlmap3d = null;
|
||||
// }
|
||||
this.jlmap3d.eventoff();
|
||||
this.jlmap3d.animateoff();
|
||||
this.jlmap3d = null;
|
||||
history.go(-1);
|
||||
|
||||
},
|
||||
showplane() {
|
||||
|
@ -157,6 +157,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
window.updatemmic1 = this.updatemmic1;
|
||||
window.updateSpeedView = this.updateSpeedView
|
||||
this.init();
|
||||
},
|
||||
beforeDestroy() {
|
||||
@ -218,7 +219,7 @@ export default {
|
||||
}
|
||||
|
||||
//更新车组号
|
||||
this.updateMmiSpeedView(newdata.v,newdata.pv,newdata.tv);
|
||||
this.updateSpeedView(newdata.v,newdata.pv,newdata.tv);
|
||||
|
||||
if(newdata.maLen){
|
||||
|
||||
@ -254,7 +255,7 @@ export default {
|
||||
this.m8image = this.images.m8["none"];
|
||||
}
|
||||
},
|
||||
updateMmiSpeedView(speed,atpspeed,atospeed) {
|
||||
updateSpeedView(speed) {
|
||||
|
||||
// if(this.m9state1 == false){
|
||||
// console.log(this.nowspeed);
|
||||
@ -267,15 +268,7 @@ export default {
|
||||
this.mmimodel.updatezz(0);
|
||||
}
|
||||
|
||||
this.nowatpspeed = 0;
|
||||
if(this.mmimodel.updateatp){
|
||||
this.mmimodel.updateatp(0);
|
||||
}
|
||||
|
||||
this.nowatospeed = 0;
|
||||
if(this.mmimodel.updateato){
|
||||
this.mmimodel.updateato(0);
|
||||
}
|
||||
|
||||
if(this.newa1state != this.a1state){
|
||||
this.a1state = this.newa1state;
|
||||
@ -287,24 +280,6 @@ export default {
|
||||
this.mmimodel.updatezz(speed);
|
||||
}
|
||||
|
||||
this.nowatpspeed = parseInt(atpspeed);
|
||||
if(this.mmimodel.updateatp){
|
||||
this.mmimodel.updateatp(atpspeed);
|
||||
}
|
||||
|
||||
this.nowatospeed = parseInt(atospeed);
|
||||
if(this.mmimodel.updateato){
|
||||
this.mmimodel.updateato(atospeed);
|
||||
}
|
||||
if(this.nowspeed>this.nowatospeed){
|
||||
this.newa1state = "yellow";
|
||||
}else{
|
||||
this.newa1state = "black";
|
||||
}
|
||||
if(this.newa1state != this.a1state){
|
||||
this.a1state = this.newa1state;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,24 +5,24 @@
|
||||
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
|
||||
<el-button v-if="jl3dmodelShow && !isContest && project !== 'bjd'" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
|
||||
<!-- 司机视角 -->
|
||||
<el-button v-if="$route.query.lineCode === '15'" size="small" type="jumpjlmap3d" @click="jumpjlmap3dDriver">司机视角</el-button>
|
||||
<!-- <el-button v-if="$route.query.lineCode === '15'" size="small" type="jumpjlmap3d" @click="jumpjlmap3dDriver">司机视角</el-button> -->
|
||||
<el-button v-if="$route.query.lineCode === '15'" size="small" @click="clCaAnCall">经典案例分析</el-button>
|
||||
<el-button v-if="$route.query.lineCode === '15'" size="small" @click="normStudy">规范学习</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<Jl3d-Device
|
||||
<Jl3dRailway-Device
|
||||
v-if="deviceif"
|
||||
v-show="deviceShow"
|
||||
ref="Jl3dDevice"
|
||||
ref="Jl3dRailwayDevice"
|
||||
:panel-show="deviceShow"
|
||||
@closedevice3dview="jumpjlmap3dmodel"
|
||||
@closedevice3dview="jumpjlmap3dmodeFl"
|
||||
/>
|
||||
<Jl3dRailway-Drive v-show="drivingShow" ref="Jl3dRailwayDrive" :panel-show="drivingShow" @showdriving="showdriving" />
|
||||
<draw-select ref="drawSelect" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
||||
import Jl3dRailwayDevice from '@/views/jlmap3d/railwaydevice/jl3drailwaydevice';
|
||||
import Jl3dRailwayDrive from '@/views/jlmap3d/railwaydrive/jl3drailwaydrive';
|
||||
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
@ -33,7 +33,7 @@ import DrawSelect from '@/jmapNew/theme/datie_01/menus/dialog/drawSelect';
|
||||
export default {
|
||||
name:'DemonMenu',
|
||||
components:{
|
||||
Jl3dDevice,
|
||||
Jl3dRailwayDevice,
|
||||
Jl3dRailwayDrive,
|
||||
DrawSelect
|
||||
},
|
||||
@ -140,6 +140,10 @@ export default {
|
||||
console.log('获取留言板信息失败');
|
||||
});
|
||||
}
|
||||
|
||||
if(this.$route.query.project == "zzww"){
|
||||
this.jumpjlmap3dDriver();
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
menuClick() {
|
||||
|
@ -64,7 +64,9 @@ export default {
|
||||
{ code: 'BLOCKING', name: '阻挡信号机'},
|
||||
{ code: 'PASSING', name: '通过信号机'},
|
||||
{ code: 'TRANSMISSION', name: '传输信号机' },
|
||||
{ code: 'SHUNTING', name: '调车信号机' }
|
||||
{ code: 'SHUNTING', name: '调车信号机' },
|
||||
{ code: 'ARRIVAL', name: '进站信号机' },
|
||||
{ code: 'EXIT', name: '出站信号机' }
|
||||
],
|
||||
field:'',
|
||||
editModel: getModel('Signal'),
|
||||
|
170
src/views/organization/classManage/durationView.vue
Normal file
@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<div style="padding: 20px 0;">
|
||||
<div style="padding: 20px;font-size: 24px;text-align: center;">{{ $route.query.className }}</div>
|
||||
<el-button type="text" style="position: fixed;right: 20px;top: 70px;" @click="back">返回</el-button>
|
||||
<el-card class="box-card" style="padding: 22px 2px 0 2px;">
|
||||
<el-form ref="form" :model="form" :rules="rules">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="地图:" prop="mapId">
|
||||
<el-select v-model="form.mapId" size="small" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in mapIdList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="开始日期:" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
:placeholder="$t('global.chooseDate')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="结束日期:" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
:placeholder="$t('global.chooseDate')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<div style="text-align: right;">
|
||||
<el-button type="primary" size="small" @click="queryFunction">查询</el-button>
|
||||
<el-button type="primary" size="small" @click="resetFunction">重置</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 15px">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
label="姓名"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="account"
|
||||
label="学号"
|
||||
/>
|
||||
<el-table-column prop="simulationDuration" label="仿真时长">
|
||||
<template slot-scope="scope">
|
||||
<span> {{ parseTime(scope.row.simulationDuration) }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="trainingDuration" label="实训时长">
|
||||
<template slot-scope="scope">
|
||||
<span> {{ parseTime(scope.row.trainingDuration) }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserDuration } from '@/api/company';
|
||||
import { getMapListByProjectCode } from '@/api/jmap/map';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'StudentManage',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
mapId: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
},
|
||||
tableData: [],
|
||||
mapIdList: [],
|
||||
loadingDurationView: false,
|
||||
rules: {
|
||||
mapId: [
|
||||
{ required: true, message: '请选择地图', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
getMapListByProjectCode(this.project).then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
queryFunction() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
let startTime = '';
|
||||
let endTime = '';
|
||||
if (this.form.startTime) {
|
||||
startTime = this.form.startTime + ' 00:00:00';
|
||||
}
|
||||
if (this.form.endTime) {
|
||||
endTime = this.form.endTime + ' 23:59:59';
|
||||
}
|
||||
const param = { mapId: this.form.mapId, startTime: startTime, endTime: endTime, clsId: this.$route.query.classId };
|
||||
getUserDuration(param).then(resp => {
|
||||
this.tableData = resp.data;
|
||||
}).catch((error) => {
|
||||
this.$message.error(`获取学生使用时长失败:${error.message}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.durationViewListPage.refresh(true);
|
||||
});
|
||||
},
|
||||
parseTime(time) {
|
||||
if (!time) { return ''; }
|
||||
const hours = Math.floor(time / 3600);
|
||||
const minutes = Math.floor((time % 3600) / 60);
|
||||
return hours + '小时' + minutes + '分';
|
||||
},
|
||||
resetFunction() {
|
||||
this.form.startTime = '';
|
||||
this.form.endTime = '';
|
||||
this.queryFunction();
|
||||
},
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.title_content {
|
||||
width: 100%;
|
||||
margin: 20px 0 30px;
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.box-card{
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
@ -67,7 +67,7 @@ export default {
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '350',
|
||||
width: '450',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑班级',
|
||||
@ -87,6 +87,11 @@ export default {
|
||||
handleClick: this.handleGradeCheck,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '时长查看',
|
||||
handleClick: this.handleDurationView,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDeleteClass,
|
||||
@ -139,6 +144,9 @@ export default {
|
||||
handleStudentDetail( index, row ) {
|
||||
this.$router.push({ path: '/info/studentManage', query: { classId: row.id, className: row.name, creatorId: row.creatorId} });
|
||||
},
|
||||
handleDurationView(index, row) {
|
||||
this.$router.push({ path: '/info/durationView', query: { classId: row.id, className: row.name } });
|
||||
},
|
||||
classCreate() {
|
||||
this.$refs.createClass.doShow();
|
||||
}
|
||||
|
BIN
static/jl3d/railway/direct.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
static/jl3d/railway/lg.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
static/jl3d/railway/lihe.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
static/jl3d/railway/model/signal2.FBX
Normal file
BIN
static/jl3d/railway/model/signal3.FBX
Normal file
BIN
static/jl3d/railway/model/signal32.FBX
Normal file
BIN
static/jl3d/railway/model/signal5.FBX
Normal file
BIN
static/jl3d/railway/st.png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
static/jl3d/railway/st1.png
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
static/jl3d/railway/stall.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
static/jl3d/railway/stall1.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
static/jl3d/railway/texture/1.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
static/jl3d/railway/texture/2.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
static/jl3d/railway/texture/3.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
static/jl3d/railway/texture/4.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
static/jl3d/railway/texture/5.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
static/jl3d/railway/texture/6.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
static/jl3d/railway/yuahdfgdfre.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
static/jl3d/railway/yuan.png
Normal file
After Width: | Height: | Size: 221 KiB |
BIN
static/jl3d/railway/yuan11.png
Normal file
After Width: | Height: | Size: 69 KiB |