单独分出大铁三维单体设备,剔除无用接口,修改大铁驾驶界面,调试接口

This commit is contained in:
sunzhenyu 2021-06-03 18:03:44 +08:00
parent 426677ab57
commit 1258bc4771
40 changed files with 2966 additions and 459 deletions

View File

@ -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({ return request({
url: `/common/simulation/${group}/members`, url: `/common/simulation/${group}/members?role=${role}`,
method: 'get' method: 'get'
}); });
} }

View File

@ -25,7 +25,7 @@ import { DriverLoadNew } from '@/jlmap3d/main/loaders/DriverLoadNew';
// connect // connect
import {Jl3dDrivingNew} from '@/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew'; import {Jl3dDrivingNew} from '@/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew';
import { getPublishMapVersion, getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; import {getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
// utils // utils
import { UpdateTrain } from '@/jlmap3d/jl3ddrive/moveupdate/UpdateTrain'; import { UpdateTrain } from '@/jlmap3d/jl3ddrive/moveupdate/UpdateTrain';

View File

@ -25,7 +25,7 @@ import { MaintainerLoad } from '@/jlmap3d/jl3dmaintainer/maintainerload';
//connect //connect
import {Maintainerconnect } from '@/jlmap3d/jl3dmaintainer/maintainerconnect'; import {Maintainerconnect } from '@/jlmap3d/jl3dmaintainer/maintainerconnect';
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
//utils //utils
// import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain'; // import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain';

View File

@ -9,7 +9,7 @@ import { ModelManager } from '@/jlmap3d/jl3dpassflow/loader.js';
//骨骼动画模型辅助工具 //骨骼动画模型辅助工具
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.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站台对象 //cctv站台对象
import { PasserStation } from '@/jlmap3d/jl3dpassflow/model/passerstation.js'; import { PasserStation } from '@/jlmap3d/jl3dpassflow/model/passerstation.js';
//cctv检票机对象 //cctv检票机对象

View 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;
}
}
}
}
}
}

View 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.');
}
);
}

View 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);
}
}
}
}

View 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 }

File diff suppressed because it is too large Load Diff

View 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);
} );
});
}

View 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.' );
}
);
}

View File

@ -1,4 +1,12 @@
import request from '@/utils/request'; 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) { export function getSimulationMembersNew(group) {
return request({ 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({ return request({
url: `/common/simulation/${group}/member/${memberId}/operate/Train_Drive_Speed_Control`, url: `/common/simulation/${group}/member/${memberId}/operate/${operate}`,
method: 'post', method: 'post',
data: data data: data
}); });

View File

@ -25,7 +25,7 @@ import { DriverLoadNew } from '@/jlmap3d/jl3drailwaydrive/loader/DriverLoadNew';
// connect // connect
import {Jl3dDrivingNew} from '@/jlmap3d/jl3drailwaydrive/moveupdate/DrivingConnectNew'; import {Jl3dDrivingNew} from '@/jlmap3d/jl3drailwaydrive/moveupdate/DrivingConnectNew';
import { getPublishMapVersion, getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; import {getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
// utils // utils
import { UpdateTrain } from '@/jlmap3d/jl3drailwaydrive/moveupdate/UpdateTrain'; import { UpdateTrain } from '@/jlmap3d/jl3drailwaydrive/moveupdate/UpdateTrain';

View File

@ -40,6 +40,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
// let toppic = '/app/topic/simulation/client/'+routegroup+'/drive'; // let toppic = '/app/topic/simulation/client/'+routegroup+'/drive';
console.log(routegroup); console.log(routegroup);
this.topic = '/queue/simulation/'+routegroup+'/trainPosition'; this.topic = '/queue/simulation/'+routegroup+'/trainPosition';
let hmiTopic = '/queue/simulation/'+routegroup+'/train/001/Hmi';
let header = {'X-Token': getToken() }; let header = {'X-Token': getToken() };
let connectmsg = { let connectmsg = {
type:'init', type:'init',
@ -154,6 +155,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
try { try {
// console.log("teststomp"); // console.log("teststomp");
scope.teststomp.subscribe(scope.topic, callback, header); scope.teststomp.subscribe(scope.topic, callback, header);
scope.teststomp.subscribe(hmiTopic, callback, header);
} catch (error) { } catch (error) {
console.error('websocket订阅失败'); console.error('websocket订阅失败');
} }
@ -183,11 +185,16 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
// 对象化数据 // 对象化数据
let data = JSON.parse(Response.body); let data = JSON.parse(Response.body);
if(data.trainPosList){ if(data.trainPosList){
// console.log(data.trainPosList); // console.log(data.trainPosList);
// console.log(data.trainPosList); // console.log(data.trainPosList);
nowTrainRun(data.trainPosList); nowTrainRun(data.trainPosList);
return; return;
}
if(data.hmi){
// console.log(data);
updateSpeedView(data.hmi[1]);
} }
// stats.update(); // stats.update();
// 遍历后台数据 // 遍历后台数据
@ -415,7 +422,6 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
} }
//更新当前驾驶车辆 //更新当前驾驶车辆
function nowTrainRun(data){ function nowTrainRun(data){
console.log(data);
for(let i=0;i<data.length;i++){ for(let i=0;i<data.length;i++){
//改变当前列车code //改变当前列车code
if(data[0][0] != trainmodel.code){ if(data[0][0] != trainmodel.code){

View File

@ -24,7 +24,7 @@ import { SimulationLoadNew } from '@/jlmap3d/main/loaders/SimulationLoadNew';
//connect //connect
import {Jlmap3dSubscribeNew } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribeNew'; import {Jlmap3dSubscribeNew } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribeNew';
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; import {getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
//utils //utils
// import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain'; // import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain';

View File

@ -12,7 +12,7 @@ import { ModelManager } from '@/jlmap3d/jl3dstationmanager/loader/loader.js';
//骨骼动画模型辅助工具 //骨骼动画模型辅助工具
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.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站台对象 //cctv站台对象
import { PasserStation } from '@/jlmap3d/jl3dstationmanager/model/passerstation.js'; import { PasserStation } from '@/jlmap3d/jl3dstationmanager/model/passerstation.js';
//cctv检票机对象 //cctv检票机对象

View File

@ -10,7 +10,7 @@ import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/loader/loader.js';
//骨骼动画模型辅助工具 //骨骼动画模型辅助工具
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.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站台对象 //cctv站台对象
import { PasserStation } from '@/jlmap3d/jl3dtrafficplan/model/passerstation.js'; import { PasserStation } from '@/jlmap3d/jl3dtrafficplan/model/passerstation.js';
//cctv检票机对象 //cctv检票机对象

View File

@ -10,7 +10,7 @@ import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/loader/loader.js';
//骨骼动画模型辅助工具 //骨骼动画模型辅助工具
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.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列车对象 //cctv列车对象
import { PasserTrain } from '@/jlmap3d/jl3dtrafficplan/model/passertrain.js'; import { PasserTrain } from '@/jlmap3d/jl3dtrafficplan/model/passertrain.js';

View File

@ -1,7 +1,7 @@
//静态资源文件路劲 //静态资源文件路劲
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; 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 { sectionModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/sectionmodel';
import { signalModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/signalmodel'; import { signalModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/signalmodel';

View File

@ -665,8 +665,7 @@ export function AssetLoader(){
//object.traverse(function (node) {//获取其中对象 //object.traverse(function (node) {//获取其中对象
// node.frustumCulled = true; // node.frustumCulled = true;
//}); //});
console.log(asset.type);
console.log(object);
if(asset.code){ if(asset.code){
scope.modelgroup[asset.code] = object; scope.modelgroup[asset.code] = object;
}else{ }else{

View File

@ -21,6 +21,7 @@ const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation')
const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow'); const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
const Jlmap3dTrafficPlan = () => import('@/views/jlmap3d/trafficplan/jl3dtrafficplan'); const Jlmap3dTrafficPlan = () => import('@/views/jlmap3d/trafficplan/jl3dtrafficplan');
const Jlmap3dTrafficTrain = () => import('@/views/jlmap3d/trafficplan/jl3dtraffictrain'); const Jlmap3dTrafficTrain = () => import('@/views/jlmap3d/trafficplan/jl3dtraffictrain');
const Jl3dRailwayDrive = () => import('@/views/jlmap3d/railwaydrive/jl3drailwaydrive');
// 三维沙盘测试 // 三维沙盘测试
const Jlmap3dSandBoxTest = () => import('@/views/jlmap3d/trafficplan/jl3dtestview'); const Jlmap3dSandBoxTest = () => import('@/views/jlmap3d/trafficplan/jl3dtestview');
// 三维车站管理测试 // 三维车站管理测试
@ -328,6 +329,11 @@ export const constantRoutes = [
hidden: true hidden: true
}, },
{
path: '/jlmap3d/lesson3dplayer',
component: Jl3dRailwayDrive,
hidden: true
},
{ {
path: '/jlmap3d/devicemodel', path: '/jlmap3d/devicemodel',
component: Jlmap3dModel, component: Jlmap3dModel,

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud'; BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪 // BASE_API = 'http://192.168.8.107:9000'; // 袁琪
BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线 // BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线 // BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
// BASE_API = 'http://192.168.3.120:9000'; // 张赛 // BASE_API = 'http://192.168.3.120:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://192.168.8.140:9000'; // 杜康

View 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>

View 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>

View 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>

View File

@ -1,23 +1,23 @@
<template> <template>
<div style="width:100%;height:50%;position:absolute;bottom:4%"> <div style="width:100%;height:100%;position:absolute;">
<div id="start" class="panebutton2" style="bottom:1%;left:5%;" > <!-- <div id="start" class="panebutton2" style="bottom:1%;left:125px;" >
<img class="buttonimg2" :src="start" /> <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>
<div id="direct" class="panebutton2" style="bottom:1%;left:25%;"> <div id="direct" class="brakebutton" style="bottom:5%;left:440px;">
<img class="buttonimg2" :src="direct" /> <img class="brakeimg" :src="brakeimgurl" />
<img id="directimg" class="buttonimg2" :src="directoffpng" :style="{transform:toutransform}" @mousedown="touchstart" /> <img id="directimgbrake" class="brakeimg" :src="brakeimgurlt" :style="{transform:braketrans}" @mousedown="touchstartbrake" />
<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> </div>
<div id="div1" class ="pane-box"> <div id="div1" class ="pane-box">
<img class="paneimg" :src="pane"/> <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" /> <img id="div2" class="lgimg" :src="lg" :style="{top:movex}" @mousedown="speedstart" />
<!-- @mouseup="speedend" --> <!-- @mouseup="speedend" -->
</div> </div>
@ -27,7 +27,7 @@
<script> <script>
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; 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 store from '@/store/index';
import { throttle } from '@/utils/throttle.js'; import { throttle } from '@/utils/throttle.js';
@ -53,13 +53,17 @@
apoimg:"", apoimg:"",
touchcontrol:true, touchcontrol:true,
touchstate:"Neutral", touchstate:"Neutral",
toutransform:"rotate(175deg)", braketrans:"rotate(394deg)",
braketransall:"rotate(394deg)",
start:JL3D_LOCAL_STATIC+"/jl3d/control/start.png", 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", directz:JL3D_LOCAL_STATIC+"/jl3d/control/directfront.png",
directoffpng:JL3D_LOCAL_STATIC+"/jl3d/control/directoff.png", directoffpng:JL3D_LOCAL_STATIC+"/jl3d/control/directoff.png",
pane:JL3D_LOCAL_STATIC+"/jl3d/control/pane.png", pane:JL3D_LOCAL_STATIC+"/jl3d/railway/lg.png",
lg:JL3D_LOCAL_STATIC+"/jl3d/control/lg.png", lg:JL3D_LOCAL_STATIC+"/jl3d/railway/yuahdfgdfre.png",
iconrotate:45,//deg iconrotate:45,//deg
icontranslateX:100,//沿xpx icontranslateX:100,//沿xpx
@ -103,11 +107,7 @@
// }, // },
touchstate:function(val,oldval){ touchstate:function(val,oldval){
if(val != oldval){ if(val != oldval){
// if(this.userRole == "DRIVER"){
// trainSimulationGear(this.group,this.groupNum,this.touchstate).then(netdata => {
//
// });
// }
} }
} }
}, },
@ -147,11 +147,11 @@
centerstate : function(gear){ centerstate : function(gear){
this.touchstate = gear; this.touchstate = gear;
if(this.touchstate == "Drive"){ if(this.touchstate == "Drive"){
this.toutransform = "rotate(140deg)"; this.braketransall = "rotate(140deg)";
}else if(this.touchstate == "Neutral"){ }else if(this.touchstate == "Neutral"){
this.toutransform = "rotate(175deg)"; this.braketransall = "rotate(175deg)";
}else if(this.touchstate == "Reverse"){ }else if(this.touchstate == "Reverse"){
this.toutransform = "rotate(205deg)"; this.braketransall = "rotate(205deg)";
} }
}, },
centercontrol : function(){ centercontrol : function(){
@ -205,51 +205,33 @@
// if(this.atostate == true){ // if(this.atostate == true){
// this.$store.dispatch('app/setAtoState', false); // this.$store.dispatch('app/setAtoState', false);
// } // }
if(this.moveheight<=1){
this.moveheight=1; this.move = this.moveheight/235;
this.movex=-6+"px"; if(this.moveheight<=30){
} this.moveheight=30;
if(this.moveheight>=159){ this.movex=23+"px";
this.moveheight=159;
this.movex=153+"px";
}
if(this.moveheight<86&&this.moveheight>73){
this.movex=72+"px";
this.move = 0; this.move = 0;
}else if(this.moveheight<0&&this.moveheight>159){ }
if(this.moveheight>=235){
}else{ this.moveheight=235;
this.movex=235+"px";
if(this.moveheight>=86){ this.move = 1;
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;
}
} }
let param = { let param = {
// id:this.groupNum, // id:this.groupNum,
id:"001", 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); const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
console.log(this.group);
console.log(userInfo.memberId);
throttle( throttle(
trainSimulationForce(this.group,userInfo.memberId,param).then(res => { trainSimulationForce(this.group,userInfo.memberId,param,"Train_Drive_Throttle_Change").then(res => {
// console.log(res); // console.log(res);
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
}) })
,200,true); ,200,true);
// updatemmic1(param.percent); updatemmic1(param.percent);
}, },
speedend: function(event){ speedend: function(event){
document.getElementById("div1").onmousemove = null; document.getElementById("div1").onmousemove = null;
@ -265,35 +247,36 @@
this.iconrotate=0; this.iconrotate=0;
} }
}, },
touchstart:function(e){ touchstartbrake:function(e){
let domoffset = document.getElementById("directimg").getBoundingClientRect(); let domoffset = document.getElementById("directimgbrake").getBoundingClientRect();
// movelimit // movelimit
this.angleoffset.x = domoffset.x; this.angleoffset.x = domoffset.x;
this.angleoffset.y = domoffset.y; this.angleoffset.y = domoffset.y;
e.preventDefault(); e.preventDefault();
document.getElementById("directimg").onmousemove = this.touchmove; document.getElementById("directimgbrake").onmousemove = this.touchmovebrake;
document.getElementById("directimg").onmouseup = this.touchend; document.getElementById("directimgbrake").onmouseup = this.touchendbrake;
}, },
touchmove:function(e){//finger move touchmovebrake:function(e){//finger move
// console.log(e); // 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){ touchendbrake:function(e){
document.getElementById("directimg").onmousemove = null; document.getElementById("directimgbrake").onmousemove = null;
document.getElementById("directimg").onmouseup = null; document.getElementById("directimgbrake").onmouseup = null;
}, },
getAngle:function(mx,my){ getAnglebrake:function(mx,my){
// //
// console.log(mx); // console.log(mx);
// console.log(my); // console.log(my);
let px=30; let px=150;
let py=30; let py=150;
let x = Math.abs(px-mx); let x = Math.abs(px-mx);
let y = Math.abs(py-my); let y = Math.abs(py-my);
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2)); let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
@ -324,59 +307,128 @@
if(mx<px&&my<py){//鼠标在第二象限 if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle; 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){ angle += 180;
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;
}
});
}
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 +437,36 @@
</script> </script>
<style > <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{ .pane-box{
right: 30px; left: 0px;
top: 0px; bottom: 10px;
width:120px; width:120px;
height:160px; height:300px;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
} }
.lgimg{ .lgimg{
width: 60px; width: 60px;
right:4px; left:30px;
bottom:0px; bottom:0px;
height: 15px; height: 60px;
position: absolute; position: absolute;
cursor:pointer; cursor:pointer;
} }
@ -415,8 +483,8 @@
position: absolute; position: absolute;
right: 0px; right: 0px;
bottom: 0px; bottom: 0px;
width:100px; width:120px;
height:160px; height:230px;
position: absolute; position: absolute;
} }

View File

@ -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: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-select v-model="value" :placeholder="initMsg" @change="currentsel" @visible-change="clickselect" >
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -14,15 +14,15 @@
> >
</el-option> </el-option>
</el-select> </el-select>
</div> </div> -->
<Centerc-Pane ref="centercontrol" :group-num="groupnum" :user-role="userrole" /> <Centerc-Pane ref="centercontrol" :group-num="groupnum" :user-role="userrole" />
<!-- <Left-Pane ref="leftcontrol" /> --> <!-- <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> </template>
<script> <script>
import store from '@/store/index';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import CentercPane from '@/views/jlmap3d/railwaydrive/drivecontrol/centerpane'; import CentercPane from '@/views/jlmap3d/railwaydrive/drivecontrol/centerpane';
@ -59,11 +60,13 @@
import StompClient from '@/utils/sock'; import StompClient from '@/utils/sock';
import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp'; import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
import { bindSimulationTrain,getSimulationTrainlistNew,getSimulationMembersNew,trainSimulationEb,trainSimulationForce,trainSimulationGear} from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js'; import { bindSimulationTrain,getSimulationTrainlistNew,getSimulationMembersNew,trainSimulationEb,trainSimulationForce,trainSimulationGear,changeDriveTrain } from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js';
import { getSimulationInfoNew } from '@/api/simulation'; import { getSimulationInfoNew} from '@/api/simulation';
import { tuoguan3ddrive } from '@/api/jlmap3d/load3ddata'; import { tuoguan3ddrive } from '@/api/jlmap3d/load3ddata';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { getMemberListCommon, getUserListCommon } from '@/api/rtSimulation';
// import Vue from 'vue'; // import Vue from 'vue';
// import StompClient from '@/utils/stompclient.js'; // import StompClient from '@/utils/stompclient.js';
import axios from 'axios'; import axios from 'axios';
@ -145,9 +148,12 @@ import axios from 'axios';
} }
}, },
currentsel(selVal){ currentsel(selVal){
console.log(selVal);
let oldgroupnum = this.groupnum; let oldgroupnum = this.groupnum;
this.groupnum = selVal; 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.selVal = selVal;
this.dialogVisible = true; this.dialogVisible = true;
// this.groupnum = selVal; // this.groupnum = selVal;
@ -169,7 +175,6 @@ import axios from 'axios';
}, },
clickselect(e){ clickselect(e){
if(e == true){ if(e == true){
this.updatetrainlist(); this.updatetrainlist();
} }
}, },
@ -210,7 +215,7 @@ import axios from 'axios';
this.trainlist = netdata.data; this.trainlist = netdata.data;
for(let i=0;i<netdata.data.length;i++){ for(let i=0;i<netdata.data.length;i++){
let option= { let option= {
value: netdata.data[i].groupNumber, value: netdata.data[i].id,
label: netdata.data[i].groupNumber, label: netdata.data[i].groupNumber,
name:null, name:null,
} }
@ -219,7 +224,7 @@ import axios from 'axios';
if(netdata.data[i].name){ if(netdata.data[i].name){
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber; option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.initMsg = 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; option.disabled = true;
} }
@ -254,8 +259,8 @@ import axios from 'axios';
} }
this.options.sort( this.options.sort(
function(obj1,obj2) { function(obj1,obj2) {
let val1 = obj1.value; let val1 = obj1.label;
let val2 = obj2.value; let val2 = obj2.label;
return val1 - val2; return val1 - val2;
} }
); );
@ -290,39 +295,45 @@ import axios from 'axios';
} }
}, },
updatetrainlist(){ updatetrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => { getMemberListCommon(this.$route.query.group,"DRIVER").then(netdata => {
this.options = []; console.log(netdata.data);
this.trainlist = netdata.data; this.options = [];
for(let i=0;i<netdata.data.length;i++){ this.trainlist = netdata.data;
let option= { for(let i=0;i<netdata.data.length;i++){
value: netdata.data[i].groupNumber, let option= {
label: netdata.data[i].groupNumber, value: netdata.data[i].id,
name:null, label: netdata.data[i].deviceId,
} 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;
} }
} option.disabled = false;
this.options.push(option);
} if(netdata.data[i].userId){
this.options.sort( option.label = netdata.data[i].userId+"正在驾驶"+netdata.data[i].deviceId;
function(obj1,obj2) { this.initMsg = netdata.data[i].userId+"正在驾驶"+netdata.data[i].deviceId;
let val1 = obj1.value; this.groupNumber = netdata.data[i].id;
let val2 = obj2.value; option.disabled = true;
return val1 - val2; }
} 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){ if(this.tuoguanbutton == true){
@ -343,34 +354,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 +364,9 @@ import axios from 'axios';
<style> <style>
.drivepane{ .drivepane{
width:30%; width:60%;
height:320px; height:333px;
right:500px; right:0;
bottom:0; bottom:0;
position: absolute; position: absolute;
background-size: 100% 100%; background-size: 100% 100%;

View File

@ -1,10 +1,10 @@
<template> <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"> <!-- <div id="dropen" class="panebutton" style="bottom:1%;left:1%;" @tap="droclick">
<img class="buttonimg" :src="redlimg" /> <img class="buttonimg" :src="redlimg" />
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div> <div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
</div> </div>
<div id="drclose" class="panebutton" style="bottom:1%;left:41%;" @tap="drcclick"> <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%;"> <div id="urgestop" class="panebutton" style="top:1%;left:1%;">
<img class="buttonimg" :src="urgestopimg" /> <img class="buttonimg" :src="urgestopimg" />
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div> <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>
<div id="doorpick" class="panebutton2" style="top:1%;left:33%;"> <div id="directpane" class="directbutton" style="bottom:10%;left:0;">
<img class="buttonimg2" :src="zuoimg" /> <img class="rightbuttonbcimg" :src="zuoimg" />
<img class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @touchstart='doordirecttouchstart' @touchmove='doordirecttouchmove' @touchend='doordirecttouchend'/> <img id="directimgdiv" class="rightbuttonbcimg" :src="niuimg" :style="{transform:doordirecttou}" @mousedown='doordirecttouchstart' />
<div class="tfbutton" style="font-size:1px;top:13px;left:5px;">{{ $t('jlmap3d.leftSide') }}</div> </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 id="clutch" class="directbutton" style="bottom:10%;left:150px;">
<div class="buttontext2">{{ $t('jlmap3d.doorSideChoose') }}</div> <img class="rightbuttonbcimg" :src="liheimg" />
</div> --> </div>
</div> </div>
</template> </template>
@ -34,6 +39,10 @@
import Vue from 'vue'; import Vue from 'vue';
// import { sendSimulationCommand } from '@/api/simulation.js'; // import { sendSimulationCommand } from '@/api/simulation.js';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.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 { export default {
name: 'RightPane', name: 'RightPane',
components: { components: {
@ -43,13 +52,25 @@
return { return {
redlimg:JL3D_LOCAL_STATIC+"/jl3d/control/redl.png", redlimg:JL3D_LOCAL_STATIC+"/jl3d/control/redl.png",
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.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", niuimg:JL3D_LOCAL_STATIC+"/jl3d/control/niu.png",
urgestopimg:JL3D_LOCAL_STATIC+"/jl3d/control/urgestop.png", urgestopimg:JL3D_LOCAL_STATIC+"/jl3d/control/urgestop.png",
stalltop:"29px",
stallleft:"127px",
stallh:1,
stalll:2,
directType:0,
oldDirectType:0,
doordirecttou:"rotate(0deg)", doordirecttou:"rotate(0deg)",
doormodetou:"rotate(0deg)", angleoffset: {
watertou:"rotate(0deg)", x: null,
washtou:"rotate(0deg)", y: null
},
stalls:[],
} }
}, },
watch: { watch: {
@ -57,7 +78,7 @@
}, },
computed: { computed: {
group() { group() {
return this.$store.state.app.group; return this.$route.query.group;
}, },
code() { code() {
return this.$store.state.app.code; return this.$store.state.app.code;
@ -70,201 +91,187 @@
}, },
}, },
mounted() { 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() { beforeDestroy() {
}, },
methods: { methods: {
rightstate : function(rights){ 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";
rightcontrol : function(){ this.stallleft = this.stalls[this.stallh][this.stalll].l +"px";
}, let param = {
showmsg:function(data){ // id:this.groupNum,
wx.showToast({ id:"001",
title: data, pos:parseInt(this.stalls[this.stallh][this.stalll].type)
icon: 'loading',
duration: 2000
});
},
showcontrolmsg:function(data,callback){
this.controlmsg = data;
this.msgshow = true;
callback = callback || function(){
this.setData();
}; };
setTimeout( callback.bind(this),2000); console.log(param);
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
}, trainSimulationForce(this.group,userInfo.memberId,param,"Train_Drive_Gear_Change").then(res => {
droclick: function (e){ // console.log(res);
//console.log(""); }).catch((error) => {
if(this.movespeed == 0){ console.log(error);
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){
},
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){ doordirecttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607", let domoffset = document.getElementById("directimgdiv").getBoundingClientRect();
// type:"07", // movelimit
// param:"" this.angleoffset.x = domoffset.x;
// }; this.angleoffset.y = domoffset.y;
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){ e.preventDefault();
this.touchcontrol = true;
// } document.getElementById("directimgdiv").onmousemove = this.doordirecttouchmove;
// }); document.getElementById("directimgdiv").onmouseup = this.doordirecttouchup;
}, },
doordirecttouchmove:function(e){//finger move doordirecttouchmove:function(e){//finger move
if(this.touchcontrol == true){ // console.log(e);
let px=230;
let py=180; this.getAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
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)";
}
}
}
}, },
doordirecttouchend:function(e){ doordirecttouchup:function(e){
this.touchcontrol = false; document.getElementById("directimgdiv").onmousemove = null;
document.getElementById("directimgdiv").onmouseup = null;
}, },
doormodetouchstart:function(e){
// let command ={ getAngle:function(mx,my){
// code:this.traincode,
// operation:"607", let px=50;
// type:"07", let py=50;
// param:"" // let x = Math.abs(px-mx);
// }; // let y = Math.abs(py-my);
// command.param = this.touchstate; // let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
// sendSimulationCommand(this.group,command).then(netdata => { // let cos = y/z;
// if(netdata.data == true){ // let radina = Math.acos(cos);//
this.touchcontrol = true; // let angle = Math.floor(180/(Math.PI/radina));//
// }
// });
},
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){
// //
let x = Math.abs(px-mx); let x = Math.abs(px-mx);
let y = Math.abs(py-my); let y = Math.abs(py-my);
@ -277,26 +284,62 @@
angle = 180 - angle; angle = 180 - angle;
} }
if(mx==px&&my>py){//y // if(mx==px&&my>py){//y
angle = 180; // angle = 180;
} // }
if(mx>px&&my==py){//x // if(mx>px&&my==py){//x
angle = 90; // angle = 90;
} // }
if(mx<px&&my>py){// if(mx<px&&my>py){//
angle = 180+angle; angle = 180+angle;
} }
//
if(mx<px&&my==py){//鼠标在x轴负方 // if(mx<px&&my==py){//x
angle = 270; // angle = 270;
} // }
if(mx<px&&my<py){//鼠标在第二象限 if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle; 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 +347,40 @@
</script> </script>
<style> <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> </style>

View File

@ -157,6 +157,7 @@ export default {
}, },
mounted() { mounted() {
window.updatemmic1 = this.updatemmic1; window.updatemmic1 = this.updatemmic1;
window.updateSpeedView = this.updateSpeedView
this.init(); this.init();
}, },
beforeDestroy() { 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){ if(newdata.maLen){
@ -254,7 +255,7 @@ export default {
this.m8image = this.images.m8["none"]; this.m8image = this.images.m8["none"];
} }
}, },
updateMmiSpeedView(speed,atpspeed,atospeed) { updateSpeedView(speed) {
// if(this.m9state1 == false){ // if(this.m9state1 == false){
// console.log(this.nowspeed); // console.log(this.nowspeed);
@ -267,15 +268,7 @@ export default {
this.mmimodel.updatezz(0); 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){ if(this.newa1state != this.a1state){
this.a1state = this.newa1state; this.a1state = this.newa1state;
@ -287,24 +280,6 @@ export default {
this.mmimodel.updatezz(speed); 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;
}
} }

View File

@ -10,19 +10,19 @@
<el-button v-if="$route.query.lineCode === '15'" size="small" @click="normStudy">规范学习</el-button> <el-button v-if="$route.query.lineCode === '15'" size="small" @click="normStudy">规范学习</el-button>
</el-button-group> </el-button-group>
</div> </div>
<Jl3d-Device <Jl3dRailway-Device
v-if="deviceif" v-if="deviceif"
v-show="deviceShow" v-show="deviceShow"
ref="Jl3dDevice" ref="Jl3dRailwayDevice"
:panel-show="deviceShow" :panel-show="deviceShow"
@closedevice3dview="jumpjlmap3dmodel" @closedevice3dview="jumpjlmap3dmodeFl"
/> />
<Jl3dRailway-Drive v-show="drivingShow" ref="Jl3dRailwayDrive" :panel-show="drivingShow" @showdriving="showdriving" /> <Jl3dRailway-Drive v-show="drivingShow" ref="Jl3dRailwayDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<draw-select ref="drawSelect" /> <draw-select ref="drawSelect" />
</div> </div>
</template> </template>
<script> <script>
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice'; import Jl3dRailwayDevice from '@/views/jlmap3d/railwaydevice/jl3drailwaydevice';
import Jl3dRailwayDrive from '@/views/jlmap3d/railwaydrive/jl3drailwaydrive'; import Jl3dRailwayDrive from '@/views/jlmap3d/railwaydrive/jl3drailwaydrive';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
@ -33,7 +33,7 @@ import DrawSelect from '@/jmapNew/theme/datie_01/menus/dialog/drawSelect';
export default { export default {
name:'DemonMenu', name:'DemonMenu',
components:{ components:{
Jl3dDevice, Jl3dRailwayDevice,
Jl3dRailwayDrive, Jl3dRailwayDrive,
DrawSelect DrawSelect
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
static/jl3d/railway/lg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
static/jl3d/railway/st.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

BIN
static/jl3d/railway/st1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB