修改三维设备页面道岔转辙机

This commit is contained in:
sunzhenyu 2020-05-11 10:13:54 +08:00
parent ffb90ccdfd
commit 275e4bab27
10 changed files with 1210 additions and 24 deletions

View File

@ -0,0 +1,674 @@
export function Moveanimate(main){
let scope = this;
this.helpbox = null;
this.textplane = null;
//动画列表
this.animatelist = [];
this.playlist = null;
this.playorder = 0;
//动画播放器开关
this.enable = true;
//动画开关状态
this.status = true;
//当前动画模型
this.nowmodelname = undefined;
//定义所有继电器部件动画
// this.initlist = function(modellist){
//
// for(let j=0,lenj=modellist.length;j<lenj;j++){
//
// for(let i=0,leni=modellist[j].children.length;i<leni;i++){
//
// if(modellist[j].children[i].name == "dizuo"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-150));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"dizuoon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-150));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"dizuooff",points2,0.5,true,0);
//
//
// }
// if(modellist[j].children[i].name == "Lxing"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"Lxingon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,modellist[j].children[i].position.z));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"Lxingoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "jiaoxingxiantie"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+25));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"jiaoxingxiantieon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+25));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"jiaoxingxiantieoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "xianquan"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"xianquanon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,modellist[j].children[i].position.z));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"xianquanoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "zhongchuipian"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-25,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"zhongchuipianon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+25,modellist[j].children[i].position.z));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"zhongchuipianoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "lagan"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+50));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"laganon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+50));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"laganoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "dongjiedianzhou"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+25));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"dongjiedianzhouon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+25));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"dongjiedianzhouoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "neibu"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"neibuon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"neibuoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "jiedian"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z-15));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"jiedianon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z-15));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"jiedianoff",points2,0.5,true,0);
//
// }
// if(modellist[j].children[i].name == "yapian"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z-25));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"yapianon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z-25));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"yapianoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "fanghuozhao"){
// let points1 = [];
//
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+200));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"fanghuozhaoon",points1,0.5,true,0);
//
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+200));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"fanghuozhaooff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "dianyuanpian"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"dianyuanpianon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"dianyuanpianoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name == "xinpian"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+150,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"xinpianon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+150,modellist[j].children[i].position.z));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"xinpianoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name =="jueyuanzhou"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"jueyuanzhouon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"jueyuanzhouoff",points2,0.5,true,0);
// }
// if(modellist[j].children[i].name =="cigang"){
// let points1 = [];
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,modellist[j].children[i].position.z+100));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"cigangon",points1,0.5,true,0);
// let points2 = [];
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,modellist[j].children[i].position.z+100));
// points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"cigangoff",points2,0.5,true,0);
// }
// }
//
// }
// //
//
//
//
// }
this.initlistnew = function(modellist){
for(let j=0,lenj=modellist.length;j<lenj;j++){
console.log(modellist[j].code+"==================================");
scope.animatelist[modellist[j].code+"chaijie"] = [];
scope.animatelist[modellist[j].code+"fuwei"] = [];
for(let i=0,leni=modellist[j].children.length;i<leni;i++){
console.log(modellist[j].children[i].name);
if(modellist[j].children[i].name == "dizuo"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-150));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"dizuoon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-150));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"dizuooff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "Lxing"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"Lxingon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,modellist[j].children[i].position.z));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"Lxingoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "jiaoxingxiantie"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+25));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"jiaoxingxiantieon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+25));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"jiaoxingxiantieoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "xianquan"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"xianquanon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,modellist[j].children[i].position.z));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"xianquanoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "zhongchuipian"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-25,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"zhongchuipianon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+25,modellist[j].children[i].position.z));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"zhongchuipianoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "lagan"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+50));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"laganon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+50));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"laganoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "dongjiedianzhou"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+25));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"dongjiedianzhouon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+25));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"dongjiedianzhouoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "neibu"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"neibuon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"neibuoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "jiedian"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z-15));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"jiedianon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z-15));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"jiedianoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "yapian"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z-25));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"yapianon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z-25));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"yapianoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "fanghuozhao"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+200));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"fanghuozhaoon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+200));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"fanghuozhaooff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "dianyuanpian"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"dianyuanpianon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"dianyuanpianoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name == "xinpian"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+150,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"xinpianon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+150,modellist[j].children[i].position.z));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"xinpianoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name =="jueyuanzhou"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"jueyuanzhouon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"jueyuanzhouoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name =="cigang"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,modellist[j].children[i].position.z+100));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"cigangon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,modellist[j].children[i].position.z+100));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"cigangoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name =="ccichuihuqi"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,modellist[j].children[i].position.z+100));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"ccichuihuqion",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,modellist[j].children[i].position.z+100));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"ccichuihuqioff",points2,0.5,true,0);
}
if(modellist[j].children[i].name =="cichuihuqi"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,modellist[j].children[i].position.z+100));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"cichuihuqion",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,modellist[j].children[i].position.z+100));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"cichuihuqioff",points2,0.5,true,0);
}
if(modellist[j].children[i].name =="jiaqiangdongjiediandanyuan"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+25,modellist[j].children[i].position.z+100));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"jiaqiangdongjiediandanyuanon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+25,modellist[j].children[i].position.z+100));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"jiaqiangdongjiediandanyuanoff",points2,0.5,true,0);
}
if(modellist[j].children[i].name =="yunmugehupian"){
let points1 = [];
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+100));
scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"yunmugehupianon",points1,0.5,true,0);
let points2 = [];
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,modellist[j].children[i].position.z+100));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"yunmugehupianoff",points2,0.5,true,0);
}
}
}
// let points = [];
// points.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// points.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z));
// scope.initanimate(modellist[j].children[i],modellist[j].name+"select1",points,true);
let modelorderlist = [];
modelorderlist[modellist[0].code] = [
{name:"fanghuozhao",pos:[0,0,200]},
{name:"dizuo",pos:[0,0,-150]},
{name:"dianyuanpian",pos:[0,0,-50]},
{name:"neibu",pos:[0,0,-25]},
{name:"xianquan",pos:[0,-200,0]},
{name:"Lxing",pos:[0,-150,0]},
{name:"jiaoxingxiantie",pos:[0,-100,50]},
{name:"zhongchuipian",pos:[0,-100,-50]},
{name:"jiedian",pos:[0,0,100]},
{name:"dongjiedianzhou",pos:[0,100,100]},
{name:"jueyuanzhou",pos:[0,150,50]},
{name:"lagan",pos:[0,150,0]},
{name:"yapian",pos:[0,0,25]}
];
modelorderlist[modellist[1].code] = [
{name:"fanghuozhao",pos:[0,0,200]},
{name:"dizuo",pos:[0,0,-150]},
{name:"dianyuanpian",pos:[0,0,-50]},
{name:"neibu",pos:[0,0,-25]},
{name:"xianquan",pos:[0,-200,0]},
{name:"Lxing",pos:[0,-150,0]},
{name:"jiaoxingxiantie",pos:[0,-100,50]},
{name:"zhongchuipian",pos:[0,-100,-50]},
{name:"jiedian",pos:[0,0,100]},
{name:"dongjiedianzhou",pos:[0,100,100]},
{name:"jueyuanzhou",pos:[0,150,50]},
{name:"lagan",pos:[0,150,0]},
{name:"yapian",pos:[0,0,25]}
];
modelorderlist[modellist[2].code] = [
{name:"fanghuozhao",pos:[0,0,200]},
{name:"dizuo",pos:[0,0,-150]},
{name:"dianyuanpian",pos:[0,0,-50]},
{name:"neibu",pos:[0,0,-25]},
{name:"xianquan",pos:[0,-200,0]},
{name:"Lxing",pos:[0,-150,0]},
{name:"jiaoxingxiantie",pos:[0,-100,50]},
{name:"zhongchuipian",pos:[0,-100,-50]},
{name:"jiedian",pos:[0,0,100]},
{name:"dongjiedianzhou",pos:[0,100,100]},
{name:"jueyuanzhou",pos:[0,150,50]},
{name:"lagan",pos:[0,150,0]},
{name:"yapian",pos:[0,0,25]}
];
modelorderlist[modellist[3].code] = [
{name:"fanghuozhao",pos:[0,0,200]},
{name:"dizuo",pos:[0,0,-150]},
{name:"dianyuanpian",pos:[0,0,-50]},
{name:"neibu",pos:[0,0,-25]},
{name:"xianquan",pos:[0,-200,0]},
{name:"Lxing",pos:[0,-150,0]},
{name:"jiaoxingxiantie",pos:[0,-100,50]},
{name:"zhongchuipian",pos:[0,-100,-50]},
{name:"jiedian",pos:[0,0,100]},
{name:"dongjiedianzhou",pos:[0,100,100]},
{name:"jueyuanzhou",pos:[0,150,50]},
{name:"lagan",pos:[0,150,0]},
{name:"yapian",pos:[0,0,25]}
];
modelorderlist[modellist[4].code] = [
{name:"fanghuozhao",pos:[0,0,200]},
{name:"dizuo",pos:[0,0,-150]},
{name:"dianyuanpian",pos:[0,0,-50]},
{name:"neibu",pos:[0,0,-25]},
{name:"xianquan",pos:[0,-200,0]},
{name:"Lxing",pos:[0,-150,0]},
{name:"zhongchuipian",pos:[0,-100,-50]},
{name:"jiaoxingxiantie",pos:[0,-100,50]},
{name:"jiedian",pos:[0,150,100]},
{name:"dongjiedianzhou",pos:[0,150,75]},
{name:"jueyuanzhou",pos:[0,150,50]},
{name:"yunmugehupian",pos:[0,100,100]},
{name:"jiaqiangdongjiediandanyuan",pos:[0,75,75]},
{name:"cichuihuqi",pos:[0,75,25]},
{name:"lagan",pos:[0,150,0]},
{name:"yapian1",pos:[0,0,100]},
{name:"yapian",pos:[0,0,10]}
];
modelorderlist[modellist[5].code] = [
{name:"fanghuozhao",pos:[0,0,200]},
{name:"dizuo",pos:[0,0,-150]},
{name:"dianyuanpian",pos:[0,0,-50]},
{name:"neibu",pos:[0,0,-25]},
{name:"xianquan",pos:[0,-200,0]},
{name:"cigang",pos:[0,-200,50]},
{name:"Lxing",pos:[0,-150,0]},
{name:"jiaoxingxiantie",pos:[0,-100,50]},
{name:"zhongchuipian",pos:[0,-100,-50]},
{name:"jiedian",pos:[0,0,100]},
{name:"dongjiedianzhou",pos:[0,100,100]},
{name:"jueyuanzhou",pos:[0,150,50]},
{name:"ccichuihuqi",pos:[0,-50,75]},
{name:"lagan",pos:[0,150,0]},
{name:"yapian",pos:[0,0,25]}
];
for(let j=0,lenj=modellist.length;j<lenj;j++){
scope.animatelist[modellist[j].code+"on"] = [];
scope.animatelist[modellist[j].code+"off"] = [];
for(let i=0,leni=modelorderlist[modellist[j].code].length;i<leni;i++){
let orderdata = modelorderlist[modellist[j].code];
let modelon = modellist[j].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[modellist[j].code+"on"],modelon,modellist[j].code+modelon.name+"on",pointson,0.01,true,i);
scope.initanimate(scope.animatelist[modellist[j].code+"off"],modelon,modellist[j].code+modelon.name+"off",pointsoff,0.01,true,leni-i-1);
// }else if((i+1)<leni){
// scope.initanimate(modelon,modellist[j].code+modelon.name+"on",pointson,0.01,true,modellist[j].code+orderdata[i+1].name+"on");
// scope.initanimate(modelon,modellist[j].code+modelon.name+"off",pointsoff,0.01,true,modellist[j].code+orderdata[i-1].name+"off");
// }else{
// scope.initanimate(modelon,modellist[j].code+modelon.name+"on",pointson,0.01,true);
// scope.initanimate(modelon,modellist[j].code+modelon.name+"off",pointsoff,0.01,true,modellist[j].code+orderdata[i-1].name+"off");
// }
// if(modellist[j].children[i].name == "xinpian"){
// }
// if(modellist[j].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);
if(nextname){
// list[nextname] = animate;
// animate.next = nextname;
}else{
// list.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";
}
}
this.updatehelpbox = function(nowhelpbox,nowtextplane){
scope.textplane = nowtextplane;
scope.helpbox = nowhelpbox;
}
this.startstop = function(){
}
this.next = function(){
}
this.before = function(){
}
//动画播放器
this.animateupdate = function(){
// console.log(scope.animatelist);
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,119 @@
export function Textconfig(){
let scope = this;
this.devicelist = [];
this.jdqinit = function(){
}
this.jdqraycast = function(){
}
//配置继电器文字信息
this.initdevicetext = function(selectmodel){
if(scope.devicelist.length>0){
scope.devicelist = [];
}
for(let i=0,leni=selectmodel.children.length;i<leni;i++){
console.log(selectmodel.children[i].name);
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 = "启动片";
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);
// }
scope.devicelist.push(part);
}
}
}

View File

@ -5,7 +5,7 @@ var Staticmodel = {
deviceType: "Switch",
type: "fuzhou",
picUrl: "",
assetUrl: "./../static/model/device/switch/switch.FBX"
assetUrl: "./../static/model/device/switch/DX.FBX"
},//"https://joylink.club/oss/wx/switch/switch.FBX"
//../../static/model/device/switch.FBX
Signal: {

View File

@ -5,6 +5,8 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
import { ModelManager } from '@/jlmap3d/jl3ddevice/loader.js';
import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js';
import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js';
import StompClient from '@/utils/sock';
@ -19,6 +21,10 @@ export function Jl3ddeviceNew(dom,group,token) {
Signallightload(this.signallights);
this.mixers = [];
this.showmodel = null;
this.devicetext = new Textconfig();
//初始化webgl渲染
this.renderer = new THREE.WebGLRenderer({ antialias: true });
@ -67,8 +73,8 @@ export function Jl3ddeviceNew(dom,group,token) {
this.controls.maxPolarAngle = Math.PI / 2;
this.controls.minPolarangle = Math.PI / 5;
this.controls.maxDistance = 80;
this.controls.screenSpacePanning = true;
this.controls.update();
this.selectmodel = null;
let teststomp = new StompClient();
// let topic = '/user/topic/simulation/assistant/'+group;
@ -104,7 +110,11 @@ export function Jl3ddeviceNew(dom,group,token) {
scope.camera.updateProjectionMatrix();
scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight);
}
this.domresize = function(){
scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight;
scope.camera.updateProjectionMatrix();
scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight);
}
this.anime = null;
this.modelmanager = new ModelManager();
@ -145,6 +155,7 @@ export function Jl3ddeviceNew(dom,group,token) {
scope.modelmanager.switchmodel.code = data.code;
scope.showmodel = scope.modelmanager.switchmodel.mesh;
scope.scene.add(scope.showmodel);
scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh);
}
if (data._type == "Signal") {
scope.modelmanager.signalmodel.code = data.code;
@ -350,4 +361,76 @@ export function Jl3ddeviceNew(dom,group,token) {
}
}
function settext(intersects,point){
if(scope.status == '1'){
if(intersects.text){
let textgeometry = new THREE.PlaneBufferGeometry( 300, 200, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(intersects.text));
let textmaterial = new THREE.MeshBasicMaterial( {
side: THREE.DoubleSide,
map:textt ,transparent: true,
alphaTest:0.1
} );
if(textplane){
scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
textplane= new THREE.Mesh( textgeometry, textmaterial );
// textplane.name = data[i].code;
textplane.position.x = point.x;
textplane.position.y = point.y+100;
textplane.position.z = point.z;
// console.log(textplane.position);
// textplane.tcode = data[i].code;
textplane.rotation.y = -Math.PI/2;
textplane.lookAt(camera.position);
// scope.textlist.push(textplane);
// newmesh.children[0].add(textplane);
scene.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
}
}
var beauty = new Image();
beauty.src = "../../static/texture/guide.png";
//canvas文字贴图方法
//PS:待提炼 增强功能
function getTextCanvas(text){
if(scope.status == '1'){
var canvas = document.getElementById('canvastexture');
canvas.width = 256;
canvas.height = 128;
var ctx = canvas.getContext('2d');
//var bg = canvas.createPattern(img, "no-repeat");
//ctx.fillStyle = bg;
ctx.fillRect(0, 0,256,128);
ctx.font = "20px Verdana";
ctx.fillStyle = '#FFFFFF';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.clearRect(0,0,256,128);
//console.log(text.groupNumber);
ctx.drawImage(beauty,0,0,256, 128);
ctx.fillText("设备部件:"+text, 90,30);
// 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,256, 128);
return data;
}
}
}

View File

@ -25,7 +25,7 @@ export function ModelManager(){
mesh:null,
action:null
};
this.loadpromise = function (data,mixers){
let initlist = [];
initlist.push(fbxpromise(data.Switch,mixers,scope.switchmodel));

View File

@ -0,0 +1,150 @@
<template>
<div class="editassets">
<div class="asset-list">
<el-tabs style="margin:5px" v-model="activeName">
<el-tab-pane class="displayscrol" label="设备部件" name="train">
<el-scrollbar ref="devicescrol" style="height:100%;margin-bottom:1px">
<el-form ref="form" label-width="120px" size="mini">
<div class="displaylist" v-for="(part,index) in devicelist" @click="deviceselect(index,part)" v-show="true" >
<div >
<p style="border:1px solid #000;">设备名称:{{part.text}}</p>
</div>
</div>
</el-form>
</el-scrollbar>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
export default {
name: 'Jl3ddeviceList',
components: {
},
props: ['devicelist'],
data() {
return {
activeName: 'train',
filterText: '',
defaultProps: {
children: 'children',
label: 'label'
},
devicetype:true,
}
},
beforeDestroy() {
},
watch: {
filterText(val) {
this.$refs.tree2.filter(val);
},
'devicelist.length':function(newVal){
this.$refs.devicescrol.update()
}
},
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:0;
top:10%;
width: 20%;
height: 90%;
background-color: #FFFFFF;
// background-image:url("/static/texture/menu.png");
// background-repeat: no-repeat;
// background-size: 100%;
// border-radius:5px;
}
.asset-list{
position:absolute;
left:0;
width: 90%;
height: 100%;
left: 5px;
top: 15px;
}
.default-scrollbar {
width: 100%;
height: 100%;
}
.el-scrollbar__wrap.default-scrollbar__wrap {
overflow-x: hidden;
overflow-y: auto;
}
.el-scrollbar__view.default-scrollbar__view {}
.displayscrol{
height: 100%;
}
.displaylist {
float:left;
position: relative;
width:80%;
height:20px;
margin:0px 0px 20px 0px;
}
.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,93 @@
<template>
<div class="showmsg" v-show="msgshow">
<div class="msgtop">
{{devicename}}
</div>
<div class="msgdown">
{{devicemsg}}
</div>
</div>
</template>
<script>
export default {
name: 'Jl3ddeviceMsg',
components: {
},
data() {
return {
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:0;
bottom:0;
width: 20%;
height: 40%;
z-index: 10;
background-image:url("/static/texture/showmsg.png");
background-repeat: no-repeat;
background-size: 100%;
}
.msgtop{
text-align: center;
width: 90%;
height:10%;
position: absolute;
top:10%;
font-size:30px;
color:#FFFFFF;
}
.msgdown{
position: absolute;
top:20%;
left:5%;
width: 90%;
height:80%;
font-size:20px;
color:#FFFFFF;
word-wrap:break-word;
letter-spacing:2px;
}
</style>

View File

@ -1,6 +1,12 @@
<template>
<div id="jl3d" class="jl3ddraw">
<Jl3ddevice-Msg>
</Jl3ddevice-Msg>
<Jl3ddevice-List :devicelist="devicelist" @sdevice="sdevice">
</Jl3ddevice-List>
<canvas id="canvastexture" />
<div id="jl3dwindow" class="windowbutton" @click="windowchange"></div>
<div id="jl3dclose" class="backbutton" @click="close3ddeviceview"></div>
</div>
</template>
<script>
@ -8,15 +14,23 @@
import { Jl3ddevice } from '@/jlmap3d/jl3ddevice/jl3ddevice.js';
import { Jl3ddeviceNew } from '@/jlmap3d/jl3ddevice/jl3ddeviceNew.js';
export default {
name: 'devicemodel',
components: {
import Jl3ddeviceMsg from '@/views/jlmap3d/device/component/devicemsg';
import Jl3ddeviceList from '@/views/jlmap3d/device/component/devicelist';
export default {
name: 'devicehelp',
components: {
Jl3ddeviceMsg,
Jl3ddeviceList
},
data() {
return {
jl3d: null,
psdlist:this.$store.state.map.map.psdList,
windowstatus:false,
devicelist:[],
}
},
watch: {
@ -63,11 +77,13 @@
}
},
mounted() {
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.menuOperation);
// console.log(this.$store.state.map.map.linkList);
if(this.$store.state.map.map.linkList){
this.initolddata(group,header);
}else{
@ -89,7 +105,32 @@
initnewdata: function (group,header){
let dom = document.getElementById('jl3d');
this.jl3d = new Jl3ddeviceNew(dom,group,header);
}
},
close3ddeviceview: function(){
this.$emit('closedevice3dview');
},
windowchange: function(){
let changeelement = document.getElementById('jl3d');
if(this.windowstatus){
changeelement.style.width = '40%';
changeelement.style.height = '60%';
changeelement.style.top = '20%';
this.windowstatus = false;
}else{
changeelement.style.width = '100%';
changeelement.style.height = '100%';
changeelement.style.top = '0';
this.windowstatus = true;
}
if(this.jl3d.domresize){
this.jl3d.domresize();
}
},
sdevice(changedata) {
// this.jl3d.updateselect(changedata);
},
}
}
</script>
@ -115,4 +156,30 @@
left: 0;
z-index: -12;
}
.windowbutton{
width:25px;
height:25px;
position: absolute;
right:40px;
top:5px;
background-color:#00ff00;
}
.backbutton{
width:25px;
height:25px;
position: absolute;
right:10px;
top:5px;
background-color:#ffff00;
}
#canvastexture {
position: absolute;
float: left;
left: 0;
z-index: -12;
}
</style>

View File

@ -528,12 +528,6 @@
word-wrap:break-word;
letter-spacing:2px;
}
#canvastexture {
position: absolute;
float: left;
left: 0;
z-index: -12;
}
#testjlmap3d {
}

View File

@ -69,7 +69,14 @@
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
<left-slider v-if="isShowLeftSlider" :offset-bottom="offsetBottom" @overallTranslation="overallTranslation" />
<Jl3d-Device v-if="deviceShow" ref="Jl3dDevice" :panel-show="deviceShow" />
<Jl3d-Device
v-if="deviceShow"
ref="Jl3dDevice"
:panel-show="deviceShow"
@closedevice3dview="devicemodel"
/>
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />
@ -571,12 +578,11 @@ export default {
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
devicemodel() {
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
},
showScheduling() {
this.$refs.scheduling.doShow();