This commit is contained in:
zyy 2020-05-06 13:11:52 +08:00
commit 515880d1c9
30 changed files with 1488 additions and 340 deletions

View File

@ -102,6 +102,41 @@ export function Jdqcontrol(){
part.msg = "绝缘轴用冻石瓷料制成,抗冲击强度足够。"; part.msg = "绝缘轴用冻石瓷料制成,抗冲击强度足够。";
selectmodel.children[i].text = "绝缘轴"; selectmodel.children[i].text = "绝缘轴";
} }
if(selectmodel.children[i].name =="cichuihuqi"){
part.text = "磁吹弧器";
part.msg = "磁吹弧器。";
selectmodel.children[i].text = "磁吹弧器";
}
if(selectmodel.children[i].name =="jiaqiangdongjiediandanyuan"){
part.text = "加强接点单元";
part.msg = "加强接点单元。";
selectmodel.children[i].text = "加强接点单元";
}
if(selectmodel.children[i].name =="yunmugehupian"){
part.text = "云母隔弧片";
part.msg = "云母隔弧片。";
selectmodel.children[i].text = "云母隔弧片";
}
if(selectmodel.children[i].name =="yapian1"){
part.text = "压片";
part.msg = "压片。";
selectmodel.children[i].text = "压片";
}
if(selectmodel.children[i].name =="jiedian1"){
part.text = "接点";
part.msg = "接点。";
selectmodel.children[i].text = "接点";
}
if(selectmodel.children[i].name =="ccichuihuqi"){
part.text = "磁吹弧器";
part.msg = "磁吹弧器。";
selectmodel.children[i].text = "磁吹弧器";
}
// if(part.text == null){
// console.log(selectmodel.children[i].name);
// }
scope.devicelist.push(part); scope.devicelist.push(part);
} }

View File

@ -1,185 +1,487 @@
export function Moveanimate(){ export function Moveanimate(main){
let scope = this; let scope = this;
this.helpbox = null;
this.textplane = null;
//动画列表 //动画列表
this.animatelist = []; this.animatelist = [];
this.playlist = null;
this.playorder = 0;
//动画播放器开关 //动画播放器开关
this.enable = true; this.enable = true;
//动画开关状态
this.status = true;
//当前动画模型
this.nowmodelname = undefined;
//定义所有继电器部件动画 //定义所有继电器部件动画
this.initlist = function(modellist){ // this.initlist = function(modellist){
// 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)); // for(let j=0,lenj=modellist.length;j<lenj;j++){
// 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); // 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++){ for(let j=0,lenj=modellist.length;j<lenj;j++){
scope.animatelist[modellist[j].code+"chaijie"] = [];
scope.animatelist[modellist[j].code+"fuwei"] = [];
for(let i=0,leni=modellist[j].children.length;i<leni;i++){ for(let i=0,leni=modellist[j].children.length;i<leni;i++){
if(modellist[j].children[i].name == "dizuo"){ if(modellist[j].children[i].name == "dizuo"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-150)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"dizuoon",points1,0.5,true,0);
let points2 = []; 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-150));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,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+"dizuooff",points2,true); 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"){ if(modellist[j].children[i].name == "Lxing"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-50,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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"Lxingon",points1,0.5,true,0);
let points2 = []; 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-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)); 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,true); 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"){ if(modellist[j].children[i].name == "jiaoxingxiantie"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+25)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"jiaoxingxiantieon",points1,0.5,true,0);
let points2 = []; 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+25));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,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+"jiaoxingxiantieoff",points2,true); 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"){ if(modellist[j].children[i].name == "xianquan"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-100,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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"xianquanon",points1,0.5,true,0);
let points2 = []; 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-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)); 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,true); 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"){ if(modellist[j].children[i].name == "zhongchuipian"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y-25,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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"zhongchuipianon",points1,0.5,true,0);
let points2 = []; 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+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)); 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,true); 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"){ if(modellist[j].children[i].name == "lagan"){
let points1 = []; 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));
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)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"laganon",points1,0.5,true,0);
let points2 = []; 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+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)); 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,true); 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"){ if(modellist[j].children[i].name == "dongjiedianzhou"){
let points1 = []; 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));
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)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"dongjiedianzhouon",points1,0.5,true,0);
let points2 = []; 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+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)); 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,true); 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"){ if(modellist[j].children[i].name == "neibu"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"neibuon",points1,0.5,true,0);
let points2 = []; 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-50));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,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+"neibuoff",points2,true); 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"){ if(modellist[j].children[i].name == "jiedian"){
let points1 = []; 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));
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)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"jiedianon",points1,0.5,true,0);
let points2 = []; 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+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)); 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,true); 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"){ if(modellist[j].children[i].name == "yapian"){
let points1 = []; 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));
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)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"yapianon",points1,0.5,true,0);
let points2 = []; 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+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)); 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,true); 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"){ if(modellist[j].children[i].name == "fanghuozhao"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z+200)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"fanghuozhaoon",points1,0.5,true,0);
let points2 = []; 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+200));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,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+"fanghuozhaooff",points2,true); 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"){ if(modellist[j].children[i].name == "dianyuanpian"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,modellist[j].children[i].position.z-50)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"dianyuanpianon",points1,0.5,true,0);
let points2 = []; 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-50));
points2.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y,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+"dianyuanpianoff",points2,true); 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"){ if(modellist[j].children[i].name == "xinpian"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+150,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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"xinpianon",points1,0.5,true,0);
let points2 = []; 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+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)); 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,true); 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"){ if(modellist[j].children[i].name =="jueyuanzhou"){
let points1 = []; 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));
points1.push(new THREE.Vector3(modellist[j].children[i].position.x,modellist[j].children[i].position.y+100,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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"jueyuanzhouon",points1,0.5,true,0);
let points2 = []; 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+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)); 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,true); 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"){ if(modellist[j].children[i].name =="cigang"){
let points1 = []; 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));
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)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"chaijie"],modellist[j].children[i],modellist[j].name+"cigangon",points1,0.5,true,0);
let points2 = []; 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-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)); 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,true); scope.initanimate(scope.animatelist[modellist[j].code+"fuwei"],modellist[j].children[i],modellist[j].name+"cigangoff",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:"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[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:"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]}
];
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(modelobject,name,points,type){ this.initanimate = function(list,modelobject,name,points,speed,type,nextname){
let curve = new THREE.CatmullRomCurve3(points); let curve = new THREE.CatmullRomCurve3(points);
@ -195,51 +497,122 @@ export function Moveanimate(){
connectmodel:modelobject, connectmodel:modelobject,
enable:false, enable:false,
status:"start", status:"start",
speed:0.05, speed:speed,
next:null
}; };
scope.animatelist[name] = animate; // 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(){ this.animateupdate = function(){
// console.log(scope.animatelist);
if(scope.enable){ if(scope.enable){
//遍历动画列表将启动的动画位置更新 if(scope.playlist){
for(let k in scope.animatelist){
if(scope.animatelist[k].enable){ for(let i=0;i<scope.playlist[scope.playorder].length;i++){
// 动画播放结束 if(scope.playlist[scope.playorder][i].status == "start"){
if(scope.animatelist[k].progress>=1){
let point = scope.animatelist[k].curve.getPointAt(1); }
if(scope.playlist[scope.playorder][i].progress>=1){
let point = scope.playlist[scope.playorder][i].curve.getPointAt(1);
//更新模型坐标 //更新模型坐标
scope.animatelist[k].connectmodel.position.x = point.x; scope.playlist[scope.playorder][i].connectmodel.position.x = point.x;
scope.animatelist[k].connectmodel.position.y = point.y; scope.playlist[scope.playorder][i].connectmodel.position.y = point.y;
scope.animatelist[k].connectmodel.position.z = point.z; scope.playlist[scope.playorder][i].connectmodel.position.z = point.z;
scope.animatelist[k].enable = false; scope.playlist[scope.playorder][i].enable = false;
scope.animatelist[k].status = "end"; scope.playlist[scope.playorder][i].status = "end";
scope.animatelist[k].progress = 0; scope.playlist[scope.playorder][i].progress = 0;
console.log(scope.playorder);
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{ }else{
//根据动画进度获取动画轨迹上点 scope.playorder += 1;
}
}
let point = scope.animatelist[k].curve.getPointAt(scope.animatelist[k].progress);
}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.animatelist[k].connectmodel.position.x = point.x; scope.playlist[scope.playorder][i].connectmodel.position.x = point.x;
scope.animatelist[k].connectmodel.position.y = point.y; scope.playlist[scope.playorder][i].connectmodel.position.y = point.y;
scope.animatelist[k].connectmodel.position.z = point.z; 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.animatelist[k].directchange){ if(scope.playlist[scope.playorder][i].directchange){
let tangent = scope.animatelist[k].curve.getPointAt(scope.animatelist[k].progress+0.001); let tangent = scope.playlist[scope.playorder][i].curve.getPointAt(scope.playlist[scope.playorder][i].progress+0.001);
// scope.animatelist[k] // scope.animatelist[k]
tangent = null; tangent = null;
} }
//增加动画进度,释放点变量 //增加动画进度,释放点变量
scope.animatelist[k].progress += scope.animatelist[k].speed; scope.playlist[scope.playorder][i].progress += scope.playlist[scope.playorder][i].speed;
point = null; point = null;
} }
} }
} }
} }
} }

View File

@ -7,6 +7,8 @@ import { ModelManager } from '@/jlmap3d/jl3ddevicetrain/loader.js';
import { Moveanimate } from '@/jlmap3d/jl3ddevicetrain/component/moveanimate.js'; import { Moveanimate } from '@/jlmap3d/jl3ddevicetrain/component/moveanimate.js';
import { Jdqcontrol } from '@/jlmap3d/jl3ddevicetrain/component/jdqcontrol.js'; import { Jdqcontrol } from '@/jlmap3d/jl3ddevicetrain/component/jdqcontrol.js';
import { DragControls } from '@/jlmap3d/main/control/DragControls.js';
import StompClient from '@/jlmap3d/jl3ddevicetrain/component/StompClient.js'; import StompClient from '@/jlmap3d/jl3ddevicetrain/component/StompClient.js';
// import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js'; // import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
@ -31,27 +33,31 @@ export function Jl3ddevice(dom,serviceid) {
this.animastats = false; this.animastats = false;
//当前选中模型 //当前选中模型
this.selectmodel = null; this.selectmodel = null;
//当前动画播放模型
this.animationmodel = null;
//初始化webgl渲染 //初始化webgl渲染
let renderer = new THREE.WebGLRenderer({ antialias: true,alpha: true }); let renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio( window.devicePixelRatio ); renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize(dom.offsetWidth, dom.offsetHeight); renderer.setSize(dom.offsetWidth, dom.offsetHeight);
// renderer.shadowMap.enabled = true; // renderer.shadowMap.enabled = true;
// renderer.shadowMap.type = THREE.PCFSoftShadowMap; // renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.setClearColor( 0x000000, 0 ); renderer.setClearColor( 0x000000, 0 );
this.dom.appendChild(renderer.domElement); this.dom.appendChild(renderer.domElement);
//定义相机 //定义相机
let camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 5000); let camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 4000);
camera.position.set(-1000, 1500, 0); camera.position.set(-1000, 1500, 0);
camera.aspect = dom.offsetWidth / dom.offsetHeight; camera.aspect = dom.offsetWidth / dom.offsetHeight;
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
//视角轨迹控制器 //视角轨迹控制器
this.controls = new THREE.OrbitControls(camera, dom); this.controls = new THREE.OrbitControls(camera, dom);
this.controls.enabled = true;
this.controls.target = new THREE.Vector3(500,1000,0); this.controls.target = new THREE.Vector3(500,1000,0);
this.controls.screenSpacePanning = true; this.controls.screenSpacePanning = true;
this.controls.update(); this.controls.update();
this.controls.maxDistance = 3000;
//定义场景(渲染容器) //定义场景(渲染容器)
let scene = new THREE.Scene(); let scene = new THREE.Scene();
@ -72,8 +78,9 @@ export function Jl3ddevice(dom,serviceid) {
// grid.material.transparent = true; // grid.material.transparent = true;
// grid.position.x = 10000; // grid.position.x = 10000;
// scene.add( grid ); // scene.add( grid );
let objects = [];
let dragcontrol = new THREE.DragControls( objects, camera, scope.dom );
dragcontrol.enabled = false;
//菜单选中设备更新设备较少 //菜单选中设备更新设备较少
this.updateselect = function(updata){ this.updateselect = function(updata){
@ -91,14 +98,12 @@ export function Jl3ddevice(dom,serviceid) {
}; };
settext(updata.mesh,point) settext(updata.mesh,point)
getdevicemsg(updata.mesh.name); getdevicemsg(updata.mesh.name);
// moveanima.animatelist[scope.selectmodel.name+"select1"].enable = true;
// console.log(intersects[0].object);
scene.add( helpbox ); scene.add( helpbox );
} }
//返回设备选择 //返回设备选择
this.backselect = function(){ this.backselect = function(){
move2(); move3();
updatemenulist(scope.jdqcontrol.devicelist); updatemenulist(scope.jdqcontrol.devicelist);
scope.modelmanager.controllist[0].position.set(19,1270,-275); scope.modelmanager.controllist[0].position.set(19,1270,-275);
@ -141,8 +146,10 @@ export function Jl3ddevice(dom,serviceid) {
}; };
//设备分解、归位动画按钮 //设备分解、归位动画按钮
this.disperdevice = function(){ this.disperdevice1 = function(){
if(scope.status == '1'){ if(scope.status == '1'){
if(moveanima.status == true){
if(scope.animastats == false){ if(scope.animastats == false){
scope.animastats = true; scope.animastats = true;
move1(); move1();
@ -150,14 +157,36 @@ export function Jl3ddevice(dom,serviceid) {
scope.animastats = false; scope.animastats = false;
move2(); move2();
} }
}
} }
}; };
this.disperdevice2 = function(){
if(scope.status == '1'){
if(moveanima.status == true){
if(scope.animastats == false){
scope.animastats = true;
moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"chaijie"],true);
} else if(scope.animastats == true){
scope.animastats = false;
moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"fuwei"],true);
}
}
}
};
// let stats = new Stats(); // let stats = new Stats();
// dom.appendChild( stats.dom ); // dom.appendChild( stats.dom );
document.addEventListener( "mousedown", onselect, false ); document.addEventListener( "mousedown", onselect, false );
document.addEventListener( "mouseup", onmouseup, false );
document.addEventListener( "touchstart", ontouch, false ); document.addEventListener( "touchstart", ontouch, false );
window.onresize = function () { window.onresize = function () {
camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight; camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight;
@ -167,12 +196,12 @@ export function Jl3ddevice(dom,serviceid) {
this.jdqcontrol = new Jdqcontrol(); this.jdqcontrol = new Jdqcontrol();
let moveanima = new Moveanimate(); let moveanima = new Moveanimate(scope);
this.anime = null; this.anime = null;
this.modelmanager = new ModelManager(); this.modelmanager = new ModelManager();
this.modelmanager.loadpromise(Staticmodel, scope.mixers,scene).then(function (data) { this.modelmanager.loadpromise(Staticmodel, scope.mixers,scene).then(function (data) {
moveanima.initlist( scope.modelmanager.controllist); moveanima.initlistnew( scope.modelmanager.controllist);
connect = new StompClient(); connect = new StompClient();
// debugger // debugger
connect.subscribe("/queue/simulation/"+serviceid,callback); connect.subscribe("/queue/simulation/"+serviceid,callback);
@ -195,6 +224,7 @@ export function Jl3ddevice(dom,serviceid) {
connect.send("/app/topic/simulation/"+serviceid+"/relay/"+msg.id+"/control/"+msg.on,{}); connect.send("/app/topic/simulation/"+serviceid+"/relay/"+msg.id+"/control/"+msg.on,{});
} }
this.upmodelaction = function(type,index){ this.upmodelaction = function(type,index){
if(type == "0"){ if(type == "0"){
@ -210,6 +240,23 @@ export function Jl3ddevice(dom,serviceid) {
scope.modelmanager.actionlist[index].play(); scope.modelmanager.actionlist[index].play();
} }
}; };
this.buttoncontrol = function(action){
if("startstop"){
moveanima.startstop();
}
if("next"){
moveanima.next();
}
if("before"){
moveanima.before();
}
};
this.resetmodel = function(){
moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"fuwei"],true);
};
//循环渲染函数 //循环渲染函数
let delta; let delta;
let data; let data;
@ -227,9 +274,12 @@ export function Jl3ddevice(dom,serviceid) {
// scope.controls.update(); // scope.controls.update();
// stats.update(); // stats.update();
delta = clock.getDelta(); delta = clock.getDelta();
if(textplane){
textplane.lookAt(camera.position);
}
if (scope.mixers) { if (scope.mixers) {
for (let i = 0; i < scope.mixers.length; i++) { for (let i = 0; i < scope.mixers.length; i++) {
if (scope.mixers[i]) { if (scope.mixers[i]._actions[0].isRunning()) {
scope.mixers[i].update(delta); scope.mixers[i].update(delta);
} }
} }
@ -239,109 +289,17 @@ export function Jl3ddevice(dom,serviceid) {
function move1(){ function move1(){
for(let i=0,leni=scope.selectmodel.children.length;i<leni;i++){ moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"on"],true);
if(scope.selectmodel.children[i].name == "dizuo"){
moveanima.animatelist[scope.selectmodel.name+"dizuoon"].enable = true;
}
if(scope.selectmodel.children[i].name == "Lxing"){
moveanima.animatelist[scope.selectmodel.name+"Lxingon"].enable = true;
}
if(scope.selectmodel.children[i].name == "jiaoxingxiantie"){
moveanima.animatelist[scope.selectmodel.name+"jiaoxingxiantieon"].enable = true;
}
if(scope.selectmodel.children[i].name == "xianquan"){
moveanima.animatelist[scope.selectmodel.name+"xianquanon"].enable = true;
}
if(scope.selectmodel.children[i].name == "zhongchuipian"){
moveanima.animatelist[scope.selectmodel.name+"zhongchuipianon"].enable = true;
}
if(scope.selectmodel.children[i].name == "lagan"){
moveanima.animatelist[scope.selectmodel.name+"laganon"].enable = true;
}
if(scope.selectmodel.children[i].name == "dongjiedianzhou"){
moveanima.animatelist[scope.selectmodel.name+"dongjiedianzhouon"].enable = true;
}
if(scope.selectmodel.children[i].name == "neibu"){
moveanima.animatelist[scope.selectmodel.name+"neibuon"].enable = true;
}
if(scope.selectmodel.children[i].name == "jiedian"){
moveanima.animatelist[scope.selectmodel.name+"jiedianon"].enable = true;
}
if(scope.selectmodel.children[i].name == "yapian"){
moveanima.animatelist[scope.selectmodel.name+"yapianon"].enable = true;
}
if(scope.selectmodel.children[i].name == "fanghuozhao"){
moveanima.animatelist[scope.selectmodel.name+"fanghuozhaoon"].enable = true;
}
if(scope.selectmodel.children[i].name == "dianyuanpian"){
moveanima.animatelist[scope.selectmodel.name+"dianyuanpianon"].enable = true;
}
if(scope.selectmodel.children[i].name == "xinpian"){
moveanima.animatelist[scope.selectmodel.name+"xinpianon"].enable = true;
}
if(scope.selectmodel.children[i].name =="jueyuanzhou"){
moveanima.animatelist[scope.selectmodel.name+"jueyuanzhouon"].enable = true;
}
if(scope.selectmodel.children[i].name =="cigang"){
moveanima.animatelist[scope.selectmodel.name+"cigangon"].enable = true;
}
}
} }
function move2(){ function move2(){
if(scope.selectmodel){ if(scope.selectmodel){
moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"off"],true);
for(let i=0,leni=scope.selectmodel.children.length;i<leni;i++){
if(scope.selectmodel.children[i].name == "dizuo"){
moveanima.animatelist[scope.selectmodel.name+"dizuooff"].enable = true;
}
if(scope.selectmodel.children[i].name == "Lxing"){
moveanima.animatelist[scope.selectmodel.name+"Lxingoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "jiaoxingxiantie"){
moveanima.animatelist[scope.selectmodel.name+"jiaoxingxiantieoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "xianquan"){
moveanima.animatelist[scope.selectmodel.name+"xianquanoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "zhongchuipian"){
moveanima.animatelist[scope.selectmodel.name+"zhongchuipianoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "lagan"){
moveanima.animatelist[scope.selectmodel.name+"laganoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "dongjiedianzhou"){
moveanima.animatelist[scope.selectmodel.name+"dongjiedianzhouoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "neibu"){
moveanima.animatelist[scope.selectmodel.name+"neibuoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "jiedian"){
moveanima.animatelist[scope.selectmodel.name+"jiedianoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "yapian"){
moveanima.animatelist[scope.selectmodel.name+"yapianoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "fanghuozhao"){
moveanima.animatelist[scope.selectmodel.name+"fanghuozhaooff"].enable = true;
}
if(scope.selectmodel.children[i].name == "dianyuanpian"){
moveanima.animatelist[scope.selectmodel.name+"dianyuanpianoff"].enable = true;
}
if(scope.selectmodel.children[i].name == "xinpian"){
moveanima.animatelist[scope.selectmodel.name+"xinpianoff"].enable = true;
}
if(scope.selectmodel.children[i].name =="jueyuanzhou"){
moveanima.animatelist[scope.selectmodel.name+"jueyuanzhouoff"].enable = true;
}
if(scope.selectmodel.children[i].name =="cigang"){
moveanima.animatelist[scope.selectmodel.name+"cigangoff"].enable = true;
}
} }
} }
function move3(){
moveanima.setplaylist(moveanima.animatelist[scope.selectmodel.code+"fuwei"],true);
} }
function ontouch(event){ function ontouch(event){
if(scope.status == '0'){ if(scope.status == '0'){
@ -464,16 +422,23 @@ export function Jl3ddevice(dom,serviceid) {
textplane.material.dispose(); textplane.material.dispose();
} }
if(intersects[0]){ if(intersects[0]){
dragcontrol.setObjects(intersects[0].object);
if(intersects[0].object.raycastoff){ if(intersects[0].object.raycastoff){
helpbox = new THREE.BoxHelper( intersects[0].object.parent, 0xff0000 ); helpbox = new THREE.BoxHelper( intersects[0].object.parent, 0xff0000 );
settext(intersects[0].object.parent,intersects[0].point); settext(intersects[0].object.parent,intersects[0].point);
getdevicemsg(intersects[0].object.parent.name); getdevicemsg(intersects[0].object.parent.name);
}else{ }else{
helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 ); helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
settext(intersects[0].object,intersects[0].point); settext(intersects[0].object,intersects[0].point);
getdevicemsg(intersects[0].object.name); getdevicemsg(intersects[0].object.name);
} }
scope.controls.enabled = false;
dragcontrol.enabled = true;
scene.add( helpbox ); scene.add( helpbox );
} }
} }
@ -481,6 +446,47 @@ export function Jl3ddevice(dom,serviceid) {
} }
} }
function onmouseup(event){
// event.preventDefault();
scope.controls.enabled = true;
dragcontrol.enabled = false;
//
// dragcontrol.setObjects(null);
// document.removeEventListener("mouseup", onmouseup, false );
}
this.animationmsgshowon = function(nowobject){
scope.animationmodel = nowobject;
if(helpbox){
scope.animationmodel.helpbox = null;
scene.remove( helpbox );
helpbox = undefined;
}
settext(scope.animationmodel,scope.animationmodel.position);
// console.log(scope.animationmodel);
helpbox = new THREE.BoxHelper( scope.animationmodel, 0xff0000 );
moveanima.updatehelpbox(helpbox,textplane);
// settext(intersects[0].object,intersects[0].point);
// getdevicemsg(intersects[0].object.name);
scene.add( helpbox );
getdevicemsg(nowobject.name);
}
this.animationmsgshowoff = function(nowobject){
if(helpbox){
scope.animationmodel.helpbox = null;
scene.remove( helpbox );
helpbox = undefined;
}
if(textplane){
scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
scope.animationmodel = null;
}
function getdevicemsg(selectname){ function getdevicemsg(selectname){
// console.log(selectname); // console.log(selectname);
@ -493,6 +499,7 @@ export function Jl3ddevice(dom,serviceid) {
} }
} }
function settext(intersects,point){ function settext(intersects,point){
if(scope.status == '1'){
if(intersects.text){ if(intersects.text){
let textgeometry = new THREE.PlaneBufferGeometry( 300, 200, 1 ); let textgeometry = new THREE.PlaneBufferGeometry( 300, 200, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(intersects.text)); let textt = new THREE.CanvasTexture(getTextCanvas(intersects.text));
@ -517,12 +524,16 @@ export function Jl3ddevice(dom,serviceid) {
textplane.lookAt(camera.position); textplane.lookAt(camera.position);
// scope.textlist.push(textplane); // scope.textlist.push(textplane);
// newmesh.children[0].add(textplane); // newmesh.children[0].add(textplane);
scene.add(textplane); scene.add(textplane);
textgeometry.dispose(); textgeometry.dispose();
textmaterial.dispose(); textmaterial.dispose();
textt.dispose(); textt.dispose();
} }
}
} }
var beauty = new Image(); var beauty = new Image();
@ -530,6 +541,7 @@ export function Jl3ddevice(dom,serviceid) {
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){
if(scope.status == '1'){
var canvas = document.getElementById('canvastexture'); var canvas = document.getElementById('canvastexture');
canvas.width = 256; canvas.width = 256;
@ -555,5 +567,6 @@ export function Jl3ddevice(dom,serviceid) {
return data; return data;
} }
}
} }

View File

@ -0,0 +1,570 @@
import { Staticmodel } from '@/jlmap3d/jl3ddevicetrain/config.js';
//loader
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
import { ModelManager } from '@/jlmap3d/jl3ddevicetrain/loader.js';
import { Moveanimate } from '@/jlmap3d/jl3ddevicetrain/component/moveanimate.js';
import { Jdqcontrol } from '@/jlmap3d/jl3ddevicetrain/component/jdqcontrol.js';
import StompClient from '@/jlmap3d/jl3ddevicetrain/component/StompClient.js';
// import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
// import StompClient from '@/utils/sock';
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
var clock = new THREE.Clock();
export function Jl3ddevice(dom,serviceid) {
let scope = this;
//helpbox选中包围框
//textplane三维介绍标牌
let helpbox,textplane;
let connect = null;
this.dom = dom;
this.nowcode = null;
this.animateswitch = false;
this.mixers = [];
this.showmodel = null;
//场景状态
this.status = 0;
//动画状态
this.animastats = false;
//当前选中模型
this.selectmodel = null;
//初始化webgl渲染
let renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize(dom.offsetWidth, dom.offsetHeight);
// renderer.shadowMap.enabled = true;
// renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.setClearColor( 0x000000, 0 );
this.dom.appendChild(renderer.domElement);
//定义相机
let camera = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 5000);
camera.position.set(-1000, 1500, 0);
camera.aspect = dom.offsetWidth / dom.offsetHeight;
camera.updateProjectionMatrix();
//视角轨迹控制器
this.controls = new THREE.OrbitControls(camera, dom);
this.controls.target = new THREE.Vector3(500,1000,0);
this.controls.screenSpacePanning = true;
this.controls.update();
//定义场景(渲染容器)
let scene = new THREE.Scene();
var bgTexture = new THREE.TextureLoader().load("../../static/background/other.jpg");
scene.background = bgTexture;
//定义全局光
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
scene.add(ambientLight);
var light = new THREE.HemisphereLight( 0xffffff, 0x444444 );
light.position.set( 0, 200, 0 );
scene.add( light );
//网格地面
// var grid = new THREE.GridHelper( 1000, 20, 0x000000, 0x000000 );
// grid.material.opacity = 0.2;
// grid.material.transparent = true;
// grid.position.x = 10000;
// scene.add( grid );
//菜单选中设备更新设备较少
this.updateselect = function(updata){
// console.log(updata);
if(helpbox){
scene.remove( helpbox );
helpbox = null;
}
helpbox = new THREE.BoxHelper( updata.mesh, 0xff0000 );
// console.log(updata.mesh);
let point = {
x:updata.mesh.matrixWorld.elements[12],
y:updata.mesh.matrixWorld.elements[13],
z:updata.mesh.matrixWorld.elements[14]
};
settext(updata.mesh,point)
getdevicemsg(updata.mesh.name);
// moveanima.animatelist[scope.selectmodel.name+"select1"].enable = true;
// console.log(intersects[0].object);
scene.add( helpbox );
}
//返回设备选择
this.backselect = function(){
move2();
updatemenulist(scope.jdqcontrol.devicelist);
scope.modelmanager.controllist[0].position.set(19,1270,-275);
scope.modelmanager.controllist[0].rotation.y = -Math.PI/2;
scope.modelmanager.controllist[0].rotation.z = -Math.PI/2;
scope.modelmanager.controllist[1].position.set(19,1270,-165);
scope.modelmanager.controllist[1].rotation.y = -Math.PI/2;
scope.modelmanager.controllist[1].rotation.z = -Math.PI/2;
scope.modelmanager.controllist[2].position.set(19,1270,-55);
scope.modelmanager.controllist[2].rotation.y = -Math.PI/2;
scope.modelmanager.controllist[2].rotation.z = -Math.PI/2;
scope.modelmanager.controllist[3].position.set(19,1270,65);
scope.modelmanager.controllist[3].rotation.y = -Math.PI/2;
scope.modelmanager.controllist[3].rotation.z = -Math.PI/2;
scope.modelmanager.controllist[4].position.set(19,1270,170);
scope.modelmanager.controllist[4].rotation.y = -Math.PI/2;
scope.modelmanager.controllist[4].rotation.z = -Math.PI/2;
scope.modelmanager.controllist[5].position.set(19,1270,280);
scope.modelmanager.controllist[5].rotation.y = -Math.PI/2;
scope.modelmanager.controllist[5].rotation.z = -Math.PI/2;
camera.position.set(-1000, 1500, 0);
scope.controls.target = new THREE.Vector3(500,1000,0);
scope.controls.update();
scope.status = '0';
if(textplane){
scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
scope.selectmodel = null;
scope.jdqcontrol.devicelist = [];
scope.animastats = false;
updatemsg();
};
//设备分解、归位动画按钮
this.disperdevice = function(){
if(scope.status == '1'){
if(moveanima.status == true){
if(scope.animastats == false){
scope.animastats = true;
move1();
} else if(scope.animastats == true){
scope.animastats = false;
move2();
}
}
}
};
// let stats = new Stats();
// dom.appendChild( stats.dom );
document.addEventListener( "mousedown", onselect, false );
document.addEventListener( "touchstart", ontouch, false );
window.onresize = function () {
camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight;
camera.updateProjectionMatrix();
renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight);
}
this.jdqcontrol = new Jdqcontrol();
let moveanima = new Moveanimate(scope);
this.anime = null;
this.modelmanager = new ModelManager();
this.modelmanager.loadpromise(Staticmodel, scope.mixers,scene).then(function (data) {
moveanima.initlistnew( scope.modelmanager.controllist);
connect = new StompClient();
// debugger
connect.subscribe("/queue/simulation/"+serviceid,callback);
animate();
});
this.sendmsg = function (type,index){
// console.log(index);
let msg = {
// deskId:serviceid,
id:index+1,
on:null
};
if(type == "0"){
msg.on = true;
}
if(type == "1"){
msg.on = false;
}
//"/app/topic/relay/"+msg.id+"/control/"+msg.on
connect.send("/app/topic/simulation/"+serviceid+"/relay/"+msg.id+"/control/"+msg.on,{});
}
this.upmodelaction = function(type,index){
if(type == "0"){
scope.modelmanager.actionlist[index].reset();
scope.modelmanager.actionlist[index].time = 0;
scope.modelmanager.actionlist[index].timeScale = 1;
scope.modelmanager.actionlist[index].play();
}
if(type == "1"){
scope.modelmanager.actionlist[index].reset();
scope.modelmanager.actionlist[index].time = scope.modelmanager.actionlist[index]._clip.duration;
scope.modelmanager.actionlist[index].timeScale = -1;
scope.modelmanager.actionlist[index].play();
}
};
//循环渲染函数
let delta;
let data;
function callback(Response){
// console.log(Response);
data = JSON.parse(Response.body);
// console.log(data);
upjdqstats(data);
}
function animate() {
scope.anime = requestAnimationFrame(animate);
renderer.render(scene, camera);
moveanima.animateupdate();
// scope.controls.update();
// stats.update();
delta = clock.getDelta();
if (scope.mixers) {
for (let i = 0; i < scope.mixers.length; i++) {
if (scope.mixers[i]._actions[0].isRunning()) {
scope.mixers[i].update(delta);
}
}
}
}
function move1(){
console.log(scope.selectmodel);
moveanima.animatelist[scope.selectmodel.code+"fanghuozhao"+"on"].enable = true;
// for(let i=0,leni=scope.selectmodel.children.length;i<leni;i++){
//
// if(scope.selectmodel.children[i].name == "dizuo"){
// moveanima.animatelist[scope.selectmodel.name+"dizuoon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "Lxing"){
// moveanima.animatelist[scope.selectmodel.name+"Lxingon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "jiaoxingxiantie"){
// moveanima.animatelist[scope.selectmodel.name+"jiaoxingxiantieon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "xianquan"){
// moveanima.animatelist[scope.selectmodel.name+"xianquanon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "zhongchuipian"){
// moveanima.animatelist[scope.selectmodel.name+"zhongchuipianon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "lagan"){
// moveanima.animatelist[scope.selectmodel.name+"laganon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "dongjiedianzhou"){
// moveanima.animatelist[scope.selectmodel.name+"dongjiedianzhouon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "neibu"){
// moveanima.animatelist[scope.selectmodel.name+"neibuon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "jiedian"){
// moveanima.animatelist[scope.selectmodel.name+"jiedianon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "yapian"){
// moveanima.animatelist[scope.selectmodel.name+"yapianon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "fanghuozhao"){
// moveanima.animatelist[scope.selectmodel.name+"fanghuozhaoon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "dianyuanpian"){
// moveanima.animatelist[scope.selectmodel.name+"dianyuanpianon"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "xinpian"){
// moveanima.animatelist[scope.selectmodel.name+"xinpianon"].enable = true;
// }
// if(scope.selectmodel.children[i].name =="jueyuanzhou"){
// moveanima.animatelist[scope.selectmodel.name+"jueyuanzhouon"].enable = true;
// }
// if(scope.selectmodel.children[i].name =="cigang"){
// moveanima.animatelist[scope.selectmodel.name+"cigangon"].enable = true;
// }
// }
}
function move2(){
if(scope.selectmodel){
moveanima.animatelist[scope.selectmodel.code+"yapian"+"off"].enable = true;
// for(let i=0,leni=scope.selectmodel.children.length;i<leni;i++){
//
// if(scope.selectmodel.children[i].name == "dizuo"){
// moveanima.animatelist[scope.selectmodel.name+"dizuooff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "Lxing"){
// moveanima.animatelist[scope.selectmodel.name+"Lxingoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "jiaoxingxiantie"){
// moveanima.animatelist[scope.selectmodel.name+"jiaoxingxiantieoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "xianquan"){
// moveanima.animatelist[scope.selectmodel.name+"xianquanoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "zhongchuipian"){
// moveanima.animatelist[scope.selectmodel.name+"zhongchuipianoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "lagan"){
// moveanima.animatelist[scope.selectmodel.name+"laganoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "dongjiedianzhou"){
// moveanima.animatelist[scope.selectmodel.name+"dongjiedianzhouoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "neibu"){
// moveanima.animatelist[scope.selectmodel.name+"neibuoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "jiedian"){
// moveanima.animatelist[scope.selectmodel.name+"jiedianoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "yapian"){
// moveanima.animatelist[scope.selectmodel.name+"yapianoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "fanghuozhao"){
// moveanima.animatelist[scope.selectmodel.name+"fanghuozhaooff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "dianyuanpian"){
// moveanima.animatelist[scope.selectmodel.name+"dianyuanpianoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name == "xinpian"){
// moveanima.animatelist[scope.selectmodel.name+"xinpianoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name =="jueyuanzhou"){
// moveanima.animatelist[scope.selectmodel.name+"jueyuanzhouoff"].enable = true;
// }
// if(scope.selectmodel.children[i].name =="cigang"){
// moveanima.animatelist[scope.selectmodel.name+"cigangoff"].enable = true;
// }
// }
}
}
function ontouch(event){
if(scope.status == '0'){
let raycaster = new THREE.Raycaster();
//定义平面鼠标点击坐标
let mouse = new THREE.Vector2();
mouse.x = (event.touches[0].pageX / dom.offsetWidth) * 2 - 1;
mouse.y = -(event.touches[0].pageY / dom.offsetHeight) * 2 + 1;
raycaster.setFromCamera( mouse, camera );
for(let i=0,leni=scope.modelmanager.controllist.length;i<leni;i++){
let intersects = raycaster.intersectObjects( scope.modelmanager.controllist[i].children,true);
if(intersects[0]){
scope.modelmanager.controllist[i].position.set(10000,0,0);
scope.modelmanager.controllist[i].rotation.y = 0;
scope.modelmanager.controllist[i].rotation.z = 0;
camera.position.set(10800, 500, 0);
scope.controls.target = new THREE.Vector3(10000,0,0);
scope.jdqcontrol.jdqdevicelist(scope.modelmanager.controllist[i]);
updatemenulist(scope.jdqcontrol.devicelist);
scope.controls.update();
scope.selectmodel = scope.modelmanager.controllist[i];
scope.status = '1';
}
}
}
if(scope.status == '1'){
//定义光线
let raycaster = new THREE.Raycaster();
//定义平面鼠标点击坐标
let mouse = new THREE.Vector2();
mouse.x = (event.touches[0].pageX / dom.offsetWidth) * 2 - 1;
mouse.y = -(event.touches[0].pageY / dom.offsetHeight) * 2 + 1;
raycaster.setFromCamera( mouse, camera );
let intersects = raycaster.intersectObjects( scope.modelmanager.controllist,true);
if(helpbox){
scene.remove( helpbox );
helpbox = null;
}
if(textplane){
scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
if(intersects[0]){
if(intersects[0].object.raycastoff){
helpbox = new THREE.BoxHelper( intersects[0].object.parent, 0xff0000 );
settext(intersects[0].object.parent,intersects[0].point);
getdevicemsg(intersects[0].object.parent.name);
}else{
helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
settext(intersects[0].object,intersects[0].point);
getdevicemsg(intersects[0].object.name);
}
scene.add( helpbox );
}
}
}
function onselect(event){
if(event.button == '0'){
if(scope.status == '0'){
let raycaster = new THREE.Raycaster();
//定义平面鼠标点击坐标
let mouse = new THREE.Vector2();
mouse.x = (event.clientX / dom.offsetWidth) * 2 - 1;
mouse.y = -(event.clientY / dom.offsetHeight) * 2 + 1;
raycaster.setFromCamera( mouse, camera );
for(let i=0,leni=scope.modelmanager.controllist.length;i<leni;i++){
let intersects = raycaster.intersectObjects( scope.modelmanager.controllist[i].children,true);
if(intersects[0]){
scope.modelmanager.controllist[i].position.set(10000,0,0);
scope.modelmanager.controllist[i].rotation.y = 0;
scope.modelmanager.controllist[i].rotation.z = 0;
camera.position.set(10800, 500, 0);
scope.controls.target = new THREE.Vector3(10000,0,0);
scope.jdqcontrol.jdqdevicelist(scope.modelmanager.controllist[i]);
updatemenulist(scope.jdqcontrol.devicelist);
scope.controls.update();
scope.selectmodel = scope.modelmanager.controllist[i];
scope.status = '1';
i = scope.modelmanager.controllist.length;
}
}
}
if(scope.status == '1'){
//定义光线
let raycaster = new THREE.Raycaster();
//定义平面鼠标点击坐标
let mouse = new THREE.Vector2();
mouse.x = (event.clientX / dom.offsetWidth) * 2 - 1;
mouse.y = -(event.clientY / dom.offsetHeight) * 2 + 1;
raycaster.setFromCamera( mouse, camera );
let intersects = raycaster.intersectObjects( scope.modelmanager.controllist,true);
if(helpbox){
scene.remove( helpbox );
helpbox = null;
}
if(textplane){
scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
if(intersects[0]){
if(intersects[0].object.raycastoff){
helpbox = new THREE.BoxHelper( intersects[0].object.parent, 0xff0000 );
settext(intersects[0].object.parent,intersects[0].point);
getdevicemsg(intersects[0].object.parent.name);
}else{
helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
settext(intersects[0].object,intersects[0].point);
getdevicemsg(intersects[0].object.name);
}
scene.add( helpbox );
}
}
}
}
this.animationmsgshow = function(nowobject){
getdevicemsg(nowobject.name);
}
function getdevicemsg(selectname){
// console.log(selectname);
for(let i=0,leni=scope.jdqcontrol.devicelist.length;i<leni;i++){
if(selectname == scope.jdqcontrol.devicelist[i].name){
updatemsg(scope.jdqcontrol.devicelist[i].text,scope.jdqcontrol.devicelist[i].msg);
i=leni;
}
}
}
function settext(intersects,point){
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){
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

@ -6,43 +6,42 @@ export function ModelManager(){
this.controllist = []; this.controllist = [];
this.actionlist = []; this.actionlist = [];
let jdq1 = { let jdq1 = {
code:jdq1, code:"jdq1",
locateType:"01", locateType:"01",
mesh:null, mesh:null,
action:null action:null
}; };
let jdq2 = { let jdq2 = {
code:jdq2, code:"jdq2",
locateType:"01", locateType:"01",
mesh:null, mesh:null,
action:null action:null
}; };
let jdq3 = { let jdq3 = {
code:jdq3, code:"jdq3",
locateType:"01", locateType:"01",
mesh:null, mesh:null,
action:null action:null
}; };
let jdq4 = { let jdq4 = {
code:jdq4, code:"jdq4",
locateType:"01", locateType:"01",
mesh:null, mesh:null,
action:null action:null
}; };
let jdq5 = { let jdq5 = {
code:jdq5, code:"jdq5",
locateType:"01", locateType:"01",
mesh:null, mesh:null,
action:null action:null
}; };
let jdq6 = { let jdq6 = {
code:jdq6, code:"jdq6",
locateType:"01", locateType:"01",
mesh:null, mesh:null,
action:null action:null
}; };
this.jdqg = { this.jdqg = {
code:null, code:null,
locateType:"00", locateType:"00",
@ -164,7 +163,9 @@ function fbxpromise(asset,mixers,model){
} }
} }
object.name = asset.name; object.name = asset.name;
object.code = model.code;
model.mesh = object; model.mesh = object;
if(object.animations.length>0){ if(object.animations.length>0){

View File

@ -6,6 +6,7 @@
THREE.DragControls = function ( _objects, _camera, _domElement ) { THREE.DragControls = function ( _objects, _camera, _domElement ) {
if ( _objects instanceof THREE.Camera ) { if ( _objects instanceof THREE.Camera ) {
console.warn( 'THREE.DragControls: Constructor now expects ( objects, camera, domElement )' ); console.warn( 'THREE.DragControls: Constructor now expects ( objects, camera, domElement )' );
@ -27,7 +28,7 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
// //
var scope = this; var scope = this;
this.nowobject = _objects;
function activate() { function activate() {
_domElement.addEventListener( 'mousemove', onDocumentMouseMove, false ); _domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
@ -84,13 +85,15 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
} }
_raycaster.setFromCamera( _mouse, _camera ); _raycaster.setFromCamera( _mouse, _camera );
if( scope.nowobject.parent){
var intersects = _raycaster.intersectObjects( _objects ); var intersects = _raycaster.intersectObjects( scope.nowobject.parent.children );
if ( intersects.length > 0 ) { if ( intersects.length > 0 ) {
var object = intersects[ 0 ].object; var object = intersects[ 0 ].object;
if(scope.nowobject.raycastoff){
object = intersects[ 0 ].object.parent;
}
_plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _worldPosition.setFromMatrixPosition( object.matrixWorld ) ); _plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _worldPosition.setFromMatrixPosition( object.matrixWorld ) );
if ( _hovered !== object ) { if ( _hovered !== object ) {
@ -117,17 +120,22 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
} }
}
function onDocumentMouseDown( event ) { function onDocumentMouseDown( event ) {
event.preventDefault(); event.preventDefault();
_raycaster.setFromCamera( _mouse, _camera ); _raycaster.setFromCamera( _mouse, _camera );
if( scope.nowobject.parent){
var intersects = _raycaster.intersectObjects( _objects ); var intersects = _raycaster.intersectObjects( scope.nowobject.parent.children );
if ( intersects.length > 0 ) { if ( intersects.length > 0 ) {
_selected = intersects[ 0 ].object; _selected = intersects[ 0 ].object;
if(scope.nowobject.raycastoff){
_selected = intersects[ 0 ].object.parent;
}
if ( _raycaster.ray.intersectPlane( _plane, _intersection ) ) { if ( _raycaster.ray.intersectPlane( _plane, _intersection ) ) {
@ -142,6 +150,8 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
} }
}
} }
@ -200,12 +210,15 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
_mouse.y = - ( ( event.clientY - rect.top ) / rect.height ) * 2 + 1; _mouse.y = - ( ( event.clientY - rect.top ) / rect.height ) * 2 + 1;
_raycaster.setFromCamera( _mouse, _camera ); _raycaster.setFromCamera( _mouse, _camera );
if( scope.nowobject.parent){
var intersects = _raycaster.intersectObjects( _objects ); var intersects = _raycaster.intersectObjects( scope.nowobject.parent.children );
if ( intersects.length > 0 ) { if ( intersects.length > 0 ) {
_selected = intersects[ 0 ].object; _selected = intersects[ 0 ].object;
if(scope.nowobject.raycastoff){
_selected = intersects[ 0 ].object.parent;
}
_plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _worldPosition.setFromMatrixPosition( _selected.matrixWorld ) ); _plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _worldPosition.setFromMatrixPosition( _selected.matrixWorld ) );
@ -222,6 +235,8 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
} }
}
} }
@ -253,9 +268,9 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
// Backward compatibility // Backward compatibility
this.setObjects = function () { this.setObjects = function (array) {
scope.nowobject = array;
console.error( 'THREE.DragControls: setObjects() has been removed.' ); // console.error( 'THREE.DragControls: setObjects() has been removed.' );
}; };

View File

@ -148,7 +148,7 @@ class SkinCode extends defaultStyle {
}, },
lamp: { lamp: {
bgShow: false, // 是否被选中 bgShow: false, // 是否被选中
guidName: 'chengdu_03', // 成都三号线引导类型 guidName: 'singleRY', // 成都三号线引导类型
borderVariable: true, // 信号灯边框可变 borderVariable: true, // 信号灯边框可变
stopWidth: 2, // 禁止线宽度 stopWidth: 2, // 禁止线宽度
borderWidth: 2, // 信号灯边框线宽度 borderWidth: 2, // 信号灯边框线宽度

View File

@ -139,7 +139,7 @@ class SkinCode extends defaultStyle {
}, },
lamp: { lamp: {
bgShow: false, // 是否被选中 bgShow: false, // 是否被选中
guidName: 'ningbo_01', // 默认引导类型 guidName: 'double', // 默认引导类型
stopWidth: 2, // 禁止线宽度 stopWidth: 2, // 禁止线宽度
borderWidth: 1, // 信号灯边框线宽度 borderWidth: 1, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色 borderColor: '#3149C3', // 信号灯边框线颜色

View File

@ -144,7 +144,7 @@ class SkinCode extends defaultStyle {
lamp: { lamp: {
bgShow: true, // 是否被选中 bgShow: true, // 是否被选中
logicDisplayNone: true, // 逻辑点灯斜线不显示 logicDisplayNone: true, // 逻辑点灯斜线不显示
guidName: 'haerbin_01', // 默认引导类型 guidName: 'doubleAndBase', // 默认引导类型
stopWidth: 2, // 禁止线宽度 stopWidth: 2, // 禁止线宽度
borderWidth: 0, // 信号灯边框线宽度 borderWidth: 0, // 信号灯边框线宽度
borderColor: '#FF0000', // 信号灯边框线颜色 (虚拟信号机) borderColor: '#FF0000', // 信号灯边框线颜色 (虚拟信号机)

View File

@ -146,7 +146,7 @@ class SkinCode extends defaultStyle {
}, },
lamp: { lamp: {
bgShow: false, // 是否被选中 bgShow: false, // 是否被选中
guidName: 'ningbo_01', // 默认引导类型 guidName: 'double', // 默认引导类型
borderVariable: true, // 信号灯边框可变 borderVariable: true, // 信号灯边框可变
stopWidth: 2, // 禁止线宽度 stopWidth: 2, // 禁止线宽度
borderWidth: 2, // 信号灯边框线宽度 borderWidth: 2, // 信号灯边框线宽度

View File

@ -160,18 +160,18 @@ class SkinCode extends defaultStyle {
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: 'white', // 信号灯字体默认色 defaultColor: 'white', // 信号灯字体默认色
blockColor: '#EF0C08', // 信号灯字体锁定颜色 blockColor: '#FFFFFF', // 信号灯字体锁定颜色
checkColor: '#00FF00' // 信号保护区段检查颜色 checkColor: '#00FF00' // 信号保护区段检查颜色
}, },
lamp: { lamp: {
bgShow: false, // 是否被选中 bgShow: false, // 是否被选中
guidName: 'defult', // 默认引导类型 guidName: 'singleRY', // 默认引导类型
borderVariable: true, // 信号灯边框可变 borderVariable: true, // 信号灯边框可变
stopWidth: 2, // 禁止线宽度 stopWidth: 2, // 禁止线宽度
borderWidth: 2, // 信号灯边框线宽度 borderWidth: 2, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色 borderColor: '#3149C3', // 信号灯边框线颜色
radiusR: 5, // 信号灯半径 radiusR: 5, // 信号灯半径
blockColor: '#C0C0C0', // 信号灯锁闭 blockColor: '#EF0C08', // 信号灯锁闭
grayColor: '#C0C0C0', // 信号灯灰色 grayColor: '#C0C0C0', // 信号灯灰色
redColor: 'red', // 信号灯红色 redColor: 'red', // 信号灯红色
greenColor: 'green', // 信号灯绿色 greenColor: 'green', // 信号灯绿色

View File

@ -108,6 +108,18 @@ class ESigLamp extends Group {
getBoundingRect() { getBoundingRect() {
return this.lamp.getBoundingRect(); return this.lamp.getBoundingRect();
} }
setAnimationStart(color) {
this.lamp && this.lamp.animateStyle(true)
.when(0, { fill: this.model.style.backgroundColor })
.when(1000, { fill: color })
.when(2000, { fill: this.model.style.backgroundColor })
.when(3000, { fill: color })
.start();
}
setAnimationEnd() {
this.lamp && this.lamp.stopAnimation(false);
}
} }
export default ESigLamp; export default ESigLamp;

View File

@ -89,7 +89,7 @@ class Signal extends Group {
// 信号灯 // 信号灯
const endPoint = this.sigPost.getLampPosition(model.lampPostType); const endPoint = this.sigPost.getLampPosition(model.lampPostType);
this.lamps = []; this.lamps = [];
if ((style.Signal.lamp.guidName == 'ningbo_01' || style.Signal.lamp.guidName == 'haerbin_01') && this.count == 1) { if ((style.Signal.lamp.guidName === 'double' || style.Signal.lamp.guidName === 'doubleAndBase') && this.count == 1) {
this.count = 2; this.count = 2;
} }
for (let i = 0; i < this.count; i++) { for (let i = 0; i < this.count; i++) {
@ -331,7 +331,7 @@ class Signal extends Group {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色 this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor); this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色 if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00'); this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { if (this.model.logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
@ -342,7 +342,7 @@ class Signal extends Group {
openLateral() { openLateral() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色 if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00'); this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色 if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
@ -361,16 +361,17 @@ class Signal extends Group {
// 引导 // 引导
guid() { guid() {
if (this.style.Signal.lamp.guidName == 'ningbo_01' || this.style.Signal.lamp.guidName == 'haerbin_01') { if (this.style.Signal.lamp.guidName === 'double') {
this.lamps[1].show(); this.lamps[1].show();
} }
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色 if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.lamps[1].show();
this.sigPost.setColor('#00FF00'); this.sigPost.setColor('#00FF00');
} }
if (this.style.Signal.lamp.guidName != 'chengdu_03') { // 双灯 允许引导信号 if (this.style.Signal.lamp.guidName !== 'singleRY') { // 双灯 允许引导信号
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
} else if (this.style.Signal.lamp.guidName == 'chengdu_03') { } else if (this.style.Signal.lamp.guidName === 'singleRY') {
this.lamps[0].setStyle({ fill: this.style.Signal.lamp.yellowColor, stroke: this.style.Signal.lamp.redColor, lineWidth: 2.5 }); this.lamps[0].setStyle({ fill: this.style.Signal.lamp.yellowColor, stroke: this.style.Signal.lamp.redColor, lineWidth: 2.5 });
} }
} }
@ -378,7 +379,7 @@ class Signal extends Group {
// 封锁 // 封锁
block() { block() {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色 if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#000080'); this.sigPost.setColor('#000080');
} }
this.sigName.setColor(this.style.Signal.text.blockColor); this.sigName.setColor(this.style.Signal.text.blockColor);
@ -408,7 +409,7 @@ class Signal extends Group {
// 逻辑点灯 // 逻辑点灯
logicalLight() { logicalLight() {
if (this.style.Signal.lamp.guidName != 'haerbin_01') { // 哈尔滨不显示 X状态的逻辑点灯 if (this.style.Signal.lamp.guidName !== 'doubleAndBase') { // 哈尔滨不显示 X状态的逻辑点灯
this.lamps.forEach(lamp => { lamp.setStop(true); }); this.lamps.forEach(lamp => { lamp.setStop(true); });
} }
} }
@ -424,7 +425,7 @@ class Signal extends Group {
this.sigRoute.show(); this.sigRoute.show();
this.sigRoute.setStyle({ fill: this.style.Signal.auto.manualControl }); this.sigRoute.setStyle({ fill: this.style.Signal.auto.manualControl });
} }
if (this.style.Signal.lamp.guidName == 'haerbin_01') { if (this.style.Signal.lamp.guidName === 'doubleAndBase') {
this.sigName.setColor(this.style.Signal.text.ArtificialRouteColor); this.sigName.setColor(this.style.Signal.text.ArtificialRouteColor);
} }
if (this.style.Signal.auto.lampstandard) { if (this.style.Signal.auto.lampstandard) {
@ -441,7 +442,7 @@ class Signal extends Group {
this.sigAuto.setColor(this.style.Signal.auto.autoRoute); this.sigAuto.setColor(this.style.Signal.auto.autoRoute);
this.sigAuto.show(); this.sigAuto.show();
} }
if (this.style.Signal.lamp.guidName == 'haerbin_01') { if (this.style.Signal.lamp.guidName === 'doubleAndBase') {
this.sigName.setColor(this.style.Signal.text.AutoRouteColor); this.sigName.setColor(this.style.Signal.text.AutoRouteColor);
this.setAutoClose(); this.setAutoClose();
} }
@ -480,12 +481,6 @@ class Signal extends Group {
.when(1000, { textFill: this.style.Signal.ciConfirm.textColor }) .when(1000, { textFill: this.style.Signal.ciConfirm.textColor })
.when(2000, { textFill: this.style.backgroundColor }) .when(2000, { textFill: this.style.backgroundColor })
.start(); .start();
this.sigBack && this.sigBack.animateStyle(true)
.when(0, { fill: this.style.backgroundColor })
.when(1000, { fill: this.style.Signal.sigBack.color })
.when(2000, { fill: this.style.backgroundColor })
.when(3000, { fill: this.style.Signal.sigBack.color })
.start();
} }
} }
@ -500,10 +495,10 @@ class Signal extends Group {
this.sigBack && this.sigBack.hide(); this.sigBack && this.sigBack.hide();
this.sigName.setColor(this.style.Signal.text.defaultColor); this.sigName.setColor(this.style.Signal.text.defaultColor);
this.sigPost.setColor(this.style.Signal.post.standardColor); // 设置底座默认颜色 this.sigPost.setColor(this.style.Signal.post.standardColor); // 设置底座默认颜色
if (this.style.Signal.lamp.guidName == 'chengdu_03') { if (this.style.Signal.lamp.guidName === 'singleRY') {
this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth }); this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth });
} }
if (this.style.Signal.lamp.guidName == 'ningbo_01' || this.style.Signal.lamp.guidName == 'haerbin_01') { if (this.style.Signal.lamp.guidName === 'double' || this.style.Signal.lamp.guidName === 'doubleAndBase') {
this.lamps[1].hide(); this.lamps[1].hide();
} }
this.insideTriangle && this.insideTriangle.hide(); this.insideTriangle && this.insideTriangle.hide();
@ -511,6 +506,8 @@ class Signal extends Group {
this.ciConfirm && this.ciConfirm.stopAnimation(false); this.ciConfirm && this.ciConfirm.stopAnimation(false);
this.ciConfirm && this.ciConfirm.hide(); this.ciConfirm && this.ciConfirm.hide();
this.sigBack && this.sigBack.hide(); this.sigBack && this.sigBack.hide();
this.sigBack && this.sigBack.stopAnimation(false);
this.lamps && this.lamps[0].setAnimationEnd();
} }
setState(model) { setState(model) {
@ -557,6 +554,18 @@ class Signal extends Group {
if (model.isCiConfirm) { if (model.isCiConfirm) {
this.setCiConfirm(); this.setCiConfirm();
} }
if (model.isRequestLock) {
this.sigBack && this.sigBack.show();
this.sigBack && this.sigBack.animateStyle(true)
.when(0, { fill: this.style.backgroundColor })
.when(1000, { fill: this.style.Signal.sigBack.color })
.when(2000, { fill: this.style.backgroundColor })
.when(3000, { fill: this.style.Signal.sigBack.color })
.start();
}
if (model.isRequestGuide) {
this.lamps && this.lamps[0] && this.lamps[0].setAnimationStart(this.style.Signal.lamp.yellowColor);
}
} }
getBoundingRect() { getBoundingRect() {
@ -567,9 +576,6 @@ class Signal extends Group {
if (this.insideTriangle) { if (this.insideTriangle) {
rect.union(this.insideTriangle.getBoundingRect()); rect.union(this.insideTriangle.getBoundingRect());
} }
if (this.ciConfirm) {
rect.union(this.ciConfirm.getBoundingRect());
}
return rect; return rect;
} }

View File

@ -8,6 +8,7 @@
import PopMenu from '@/components/PopMenu/popTip'; import PopMenu from '@/components/PopMenu/popTip';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
import deviceType from '@/jmapNew/constant/deviceType';
export default { export default {
name: 'CancelMenu', name: 'CancelMenu',
@ -215,7 +216,12 @@ export default {
operation: eachCmd.operation.code, operation: eachCmd.operation.code,
param: eachCmd.param // param: eachCmd.param //
}; };
this.$store.dispatch('training/updateMapState', [{code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 1}]); const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 1};
if (eachCmd.device._type === deviceType.Signal) {
deviceStatus.isRequestLock = 0;
deviceStatus.isRequestGuide = 0;
}
this.$store.dispatch('training/updateMapState', [deviceStatus]);
} else { } else {
operate = { operate = {
send: true, send: true,
@ -223,7 +229,12 @@ export default {
cmdType: eachCmd.cmdType, cmdType: eachCmd.cmdType,
param: eachCmd.param // param: eachCmd.param //
}; };
this.$store.dispatch('training/updateMapState', [{code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 0}]); const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 0};
if (eachCmd.device._type === deviceType.Signal) {
deviceStatus.isRequestLock = 0;
deviceStatus.isRequestGuide = 0;
}
this.$store.dispatch('training/updateMapState', [deviceStatus]);
} }
this.$store.dispatch('menuOperation/spliceRequestList', {deviceCode:eachCmd.device.code, operateCode:eachCmd.operation.code}); this.$store.dispatch('menuOperation/spliceRequestList', {deviceCode:eachCmd.device.code, operateCode:eachCmd.operation.code});
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {

View File

@ -34,6 +34,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import deviceType from '@/jmapNew/constant/deviceType';
export default { export default {
name: 'CancelMenu', name: 'CancelMenu',
@ -92,6 +93,11 @@ export default {
}, },
cancel() { cancel() {
if (this.row && this.row.deviceCode) { if (this.row && this.row.deviceCode) {
if (this.row.operateCode === OperationEvent.Signal.lock.menu.operation || this.row.operateCode === OperationEvent.Signal.unlock.menu.operation) {
this.$store.dispatch('training/updateMapState', {code: this.row.device.code, _type: 'Signal', isRequestLock: 0});
} else if ( this.row.operateCode === OperationEvent.Signal.guide.menu.operation) {
this.$store.dispatch('training/updateMapState', {code: this.row.device.code, _type: 'Signal', isRequestGuide: 0});
}
this.$store.dispatch('menuOperation/spliceRequestList', this.row); this.$store.dispatch('menuOperation/spliceRequestList', this.row);
} }
}, },
@ -110,7 +116,12 @@ export default {
operation: eachCmd.operation.code, operation: eachCmd.operation.code,
param: eachCmd.param // param: eachCmd.param //
}; };
this.$store.dispatch('training/updateMapState', [{code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 1}]); const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 1};
if (eachCmd.device._type === deviceType.Signal) {
deviceStatus.isRequestLock = 0;
deviceStatus.isRequestGuide = 0;
}
this.$store.dispatch('training/updateMapState', [deviceStatus]);
} else { } else {
operate = { operate = {
send: true, send: true,
@ -118,7 +129,12 @@ export default {
cmdType: eachCmd.cmdType, cmdType: eachCmd.cmdType,
param: eachCmd.param // param: eachCmd.param //
}; };
this.$store.dispatch('training/updateMapState', [{code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 0}]); const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 0};
if (eachCmd.device._type === deviceType.Signal) {
deviceStatus.isRequestLock = 0;
deviceStatus.isRequestGuide = 0;
}
this.$store.dispatch('training/updateMapState', [deviceStatus]);
} }
this.$store.dispatch('menuOperation/spliceRequestList', {deviceCode:eachCmd.device.code, operateCode:eachCmd.operation.code}); this.$store.dispatch('menuOperation/spliceRequestList', {deviceCode:eachCmd.device.code, operateCode:eachCmd.operation.code});
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {

View File

@ -424,6 +424,7 @@ export default {
param: {signalCode: this.selected.code}, param: {signalCode: this.selected.code},
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
}); });
this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: 'Signal', isRequestLock: 1}]);
} else { } else {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(step);
} }
@ -449,6 +450,7 @@ export default {
ciConfirm: true, ciConfirm: true,
param: {signalCode: this.selected.code} param: {signalCode: this.selected.code}
}); });
this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: 'Signal', isRequestLock: 1}]);
} else { } else {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(step);
} }
@ -482,6 +484,7 @@ export default {
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
param: step.param param: step.param
}); });
this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: 'Signal', isRequestGuide: 1}]);
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(step); this.$refs.noticeInfo.doShow(step);

View File

@ -34,7 +34,9 @@ class Model {
atsAutoTriggerShow: true, // ATS自动触发表示灯显示 atsAutoTriggerShow: true, // ATS自动触发表示灯显示
isStartSignal: 0, // 是否进路排列选中始端信号机 isStartSignal: 0, // 是否进路排列选中始端信号机
isTerminalSignal: 0, // 是否进路排列待选终端信号机 isTerminalSignal: 0, // 是否进路排列待选终端信号机
isCiConfirm: 0 // 是否联锁确认(并未进行联锁确认,前端根据流程给的值) isCiConfirm: 0, // 是否联锁确认(并未进行联锁确认,前端根据流程给的值)
isRequestLock: 0, // 是否请求封锁或请求解封
isRequestGuide: 0 // 是否请求引导
}; };
this['private'][deviceType.Train] = { this['private'][deviceType.Train] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式 nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式

View File

@ -13,7 +13,11 @@
</div> </div>
<div class="menudown"> <div class="menudown">
<el-button-group> <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="beforeclick">上一个</el-button>
<el-button type="primary" @click="startstop">暂停</el-button>
<el-button type="primary" @click="nextclick">下一个</el-button> -->
<el-button type="primary" @click="back">复位</el-button>
</el-button-group> </el-button-group>
</div> </div>
@ -91,7 +95,8 @@
msgshow:false, msgshow:false,
devicename:"", devicename:"",
devicemsg:"", devicemsg:"",
devicestats:"设备分解", devicestats:"分布拆解",
disperreset:"整体拆解",
statsa1700:"off", statsa1700:"off",
statsb1700:"off", statsb1700:"off",
statsc1700:"off", statsc1700:"off",
@ -138,10 +143,14 @@
handler: function (newVal, oldVal) { handler: function (newVal, oldVal) {
if (newVal != oldVal) { if (newVal != oldVal) {
if(newVal == false){ if(newVal == false){
this.devicestats = "设备分解"; this.devicestats = "分布拆解";
this.disperreset = "整体拆解";
} }
if(newVal == true){ if(newVal == true){
this.devicestats = "设备归位"; this.devicestats = "分布复位";
this.disperreset = "整体复位";
} }
} }
} }
@ -175,7 +184,7 @@
this.jl3d.backselect(); this.jl3d.backselect();
}, },
dispersed(device) { dispersed(device) {
this.jl3d.disperdevice(); this.jl3d.disperdevice1();
}, },
updatemenulist(devicelist) { updatemenulist(devicelist) {
this.devicelist = devicelist; this.devicelist = devicelist;
@ -335,8 +344,22 @@
this.jl3d.sendmsg(1,5); this.jl3d.sendmsg(1,5);
} }
}, },
back(changedata) { alldisper(){
window.close(); this.jl3d.disperdevice2();
},
// startstop(changedata) {
// this.jl3d.buttoncontrol("startstop");
// },
// nextclick(changedata) {
// this.jl3d.buttoncontrol("next");
// },
// beforeclick(changedata) {
// this.jl3d.buttoncontrol("before");
// },
back() {
this.jl3d.resetmodel();
// move3();
// window.close();
}, },
} }
} }

View File

@ -144,9 +144,10 @@ export default {
this.$emit('showMap'); this.$emit('showMap');
}, },
initLoad() { initLoad() {
if (this.enabledTab === 'route' || this.enabledTab == 'runLevel') { if (this.enabledTab === 'route') {
this.$refs[this.enabledTabMenu[this.enabledTab]].initLoad(); this.$refs[this.enabledTabMenu[this.enabledTab]].initLoad();
} }
this.tabBeforeLeave(this.enabledTab);
}, },
createRouteEvent() { // createRouteEvent() { //
this.$refs[this.enabledTabMenu[this.enabledTab]].createRouteEvent(); this.$refs[this.enabledTabMenu[this.enabledTab]].createRouteEvent();
@ -164,16 +165,14 @@ export default {
this.$emit('setCenter', code); this.$emit('setCenter', code);
}, },
drawMap() { drawMap() {
this.$refs.routeOperate && this.$refs.routeOperate.batchSectionListFocus(false); this.tabBeforeLeave('', this.enabledTab);
this.$refs.signalOperate && this.$refs.signalOperate.batchSectionListFocus(false);
this.$refs.runLevelOperate && this.$refs.runLevelOperate.batchSectionListFocus(false);
this.$emit('selectView', 'draft'); this.$emit('selectView', 'draft');
}, },
tabBeforeLeave(activeName, oldActiveName) { tabBeforeLeave(activeName, oldActiveName) {
if (oldActiveName === 'route' || oldActiveName === 'signal' || oldActiveName == 'runLevel') { if (oldActiveName === 'route' || oldActiveName === 'signal' || oldActiveName == 'runLevel' || oldActiveName == 'routing') {
this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false); this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false);
} }
if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel') { if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel' || activeName == 'routing') {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true); this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true);
}); });

View File

@ -78,6 +78,12 @@ export default {
}, },
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
},
initLoad() {
this.$refs.routeEdit.batchSectionListFocus(true);
},
batchSectionListFocus(flag) {
this.$refs.routeEdit.batchSectionListFocus(flag);
} }
} }
}; };

View File

@ -99,7 +99,8 @@
<span>{{ formatName(scope.row.sectionCode) }}</span> <span>{{ formatName(scope.row.sectionCode) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" :label="$t('map.operation')" width="50"> <!-- fixed="right" -->
<el-table-column :label="$t('map.operation')" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1" v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1"
@ -261,6 +262,30 @@ export default {
} else { } else {
return []; return [];
} }
},
routeName: {
get() {
var name = '';
if (this.isSave) {
let begStation = ''; let endStation = '';
let begSection = ''; let endSection = '';
if (this.stationList) {
this.stationList.forEach(elem => {
if (elem.code === this.addModel.startStationCode) begStation = elem.name;
if (elem.code === this.addModel.endStationCode) endStation = elem.name;
});
}
if (this.sectionList) {
this.sectionList.forEach(elem => {
if (elem.code === this.addModel.startSectionCode) begSection = '(' + elem.name + ')';
if (elem.code === this.addModel.endSectionCode) endSection = '(' + elem.name + ')';
});
}
name = begStation + begSection + '-' + endStation + endSection;
}
return name;
}
} }
}, },
watch: { watch: {
@ -275,16 +300,21 @@ export default {
} }
}, },
'addModel.parkSectionCodeList':function(val, old) { 'addModel.parkSectionCodeList':function(val, old) {
val.forEach(each=>{ this.changeSectionSelected(val, true);
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode); },
section.instance.drawBatchSelected(section, 'routingSection'); routeName(val, old) {
}); if (val) {
this.addModel.name = val;
}
} }
}, },
mounted() { mounted() {
this.rowDrop(); this.rowDrop();
}, },
beforeDestroy() {
// debugger;
},
methods: { methods: {
// //
rowDrop() { rowDrop() {
@ -498,7 +528,11 @@ export default {
} }
}, },
deleteSection(list, index) { deleteSection(list, index) {
list.splice(index, 1); const data = list.splice(index, 1);
if (data.length > 0) {
const section = this.$store.getters['map/getDeviceByCode'](data[0].sectionCode);
section.instance.drawBatchSelected(section, '');
}
}, },
buildModel(code) { buildModel(code) {
const model = Object.assign({}, this.addModel); const model = Object.assign({}, this.addModel);
@ -537,14 +571,27 @@ export default {
} }
}); });
}, },
clear() { batchSectionListFocus(flag) {
if (this.$refs && this.$refs.form && this.mapInfo) { this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
},
changeSectionSelected(selectedList, flag) {
if (this.addModel.parkSectionCodeList.length > 0) { if (this.addModel.parkSectionCodeList.length > 0) {
this.addModel.parkSectionCodeList.forEach(each=>{ if (flag) {
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
section.instance.drawBatchSelected(section, 'routingSection');
});
} else {
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode); const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
section.instance.drawBatchSelected(section, ''); section.instance.drawBatchSelected(section, '');
}); });
} }
}
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
this.changeSectionSelected(this.addModel.parkSectionCodeList, false);
delete this.addModel.id; delete this.addModel.id;
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id; this.addModel.mapId = this.mapInfo.id;
@ -566,4 +613,17 @@ export default {
/deep/ .el-radio { /deep/ .el-radio {
margin-right: 10px; margin-right: 10px;
} }
/deep/ .el-parkSectionCode-table table tbody tr{
td{
cursor: pointer;
}
}
/deep/ .el-table--enable-row-hover .el-table__body tr:hover>td {
background-color: rgba(0, 0, 0, 0) !important;
}
/deep/ table tbody tr.sortable-chosen{
background: #f5faf7 !important;
}
</style> </style>

View File

@ -197,6 +197,9 @@ export default {
}, },
selectViewDraft(data) { selectViewDraft(data) {
this.viewDraft = data; this.viewDraft = data;
if (data != 'draft') {
this.$refs.dataRelation.initLoad();
}
}, },
loadInitPage() { loadInitPage() {
this.$store.dispatch('training/changeMode', { mode: TrainingMode.MAP_EDIT }); this.$store.dispatch('training/changeMode', { mode: TrainingMode.MAP_EDIT });

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.