修改三维驾驶面板逻辑

This commit is contained in:
sunzhenyu 2021-07-30 19:02:10 +08:00
parent 87f94e2dbe
commit a31a6288f7
3 changed files with 44 additions and 33 deletions

View File

@ -310,19 +310,26 @@ export function JLmap3dEdit(dom, data, mapid) {
let downStandTrack = scope.mapdata.sectionlist.sections.datalist[changeData.stands[changeData.stands.length-1].section];
console.log(scope.mapdata.sectionlist.sections);
console.log(topStandTrack);
console.log(downStandTrack);
console.log(topStandTrack.mesh.railpoint[0].x);
console.log(topStandTrack.mesh.railpoint[2].x);
console.log(downStandTrack.mesh.railpoint[0].x);
console.log(downStandTrack.mesh.railpoint[2].x);
let rightpos = topStandTrack.rightStopPercent*(topStandTrack.railpoint[2].x -topStandTrack.railpoint[0].x)+topStandTrack.railpoint[0].x;
let leftpos = downStandTrack.leftStopPercent*(downStandTrack.railpoint[2].x -downStandTrack.railpoint[0].x)+downStandTrack.railpoint[0].x;
let rightpos = topStandTrack.leftStopPercent*(topStandTrack.mesh.railpoint[2].x -topStandTrack.mesh.railpoint[0].x)+topStandTrack.mesh.railpoint[0].x;
let leftpos = downStandTrack.rightStopPercent*(downStandTrack.mesh.railpoint[2].x -downStandTrack.mesh.railpoint[0].x)+downStandTrack.mesh.railpoint[0].x;
let rightX = changeData.mesh.position.x-63.2 - rightpos;
let leftX = changeData.mesh.position.x+63.2 - leftpos;
topStandTrack.mesh.position.x = topStandTrack.mesh.position.x + rightX;
let rightX = changeData.mesh.position.x-63.4 - rightpos;
let leftX = changeData.mesh.position.x+63.4 - leftpos;
console.log("----------------------------");
console.log(rightpos);
console.log(leftpos);
console.log("----------------------------");
console.log(rightX);
console.log(leftX);
topStandTrack.mesh.position.x = topStandTrack.mesh.position.z + rightX;
downStandTrack.mesh.position.x = downStandTrack.mesh.position.x + leftX;
// changeStation.position.set(topStandTrack.railpoint[0].x+(topStandTrack.leftStopPointOffset+topStandTrack.rightStopPointOffset)/2,topStandTrack.railpoint[1].y,(topStandTrack.railpoint[1].z+downStandTrack.railpoint[1].z)/2);
//
// // changeStation.position.set(topStandTrack.railpoint[0].x+(topStandTrack.leftStopPointOffset+topStandTrack.rightStopPointOffset)/2,topStandTrack.railpoint[1].y,(topStandTrack.railpoint[1].z+downStandTrack.railpoint[1].z)/2);
topStandTrack.mesh.railpoint[0].x = topStandTrack.mesh.railpoint[0].x+rightX;
topStandTrack.mesh.railpoint[2].x = topStandTrack.mesh.railpoint[2].x+rightX;

View File

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

View File

@ -160,7 +160,7 @@ export default {
}
},
mounted() {
// window.updatemmic1 = this.updatemmic1;
window.updatemmic1 = this.updatemmic1;
this.init();
},
beforeDestroy() {
@ -215,7 +215,7 @@ export default {
},
updatetrainstatus(newdata){
// console.log(newdata);
console.log(newdata);
if(typeof(newdata.eb) != "undefined"){
this.updateEbStatus(newdata.eb);
@ -249,7 +249,6 @@ export default {
if(newdata.jump){
}
console.log(newdata.parking);
if(newdata.parking != undefined){
this.m4parking = newdata.parking;
this.updateM4(newdata);
@ -269,7 +268,9 @@ export default {
this.tiaotinghold = newdata.hold;
this.updateTiaoting(newdata);
}
if(newdata.tow != undefined){
updatemmic1(newdata.tow);
}
this.updatemmidoormode(newdata.leftDoorCanClose,newdata.rightDoorCanClose);
},
@ -313,7 +314,7 @@ export default {
}
}else{
this.nowspeed = parseInt(speed);
this.updatemmic1(this.nowspeed);
if(this.mmimodel.updatezz){
this.mmimodel.updatezz(speed);
}
@ -548,25 +549,28 @@ export default {
this.malen = +parseInt(len)/2*10+"px";
}
},
updatemmic1(nowspeed){
if(this.nowspeed != 0 ){
this.newc1state = 'duoxing';
}else{
this.newc1state = 'none';
updatemmic1(tow){
console.log("tow:"+tow);
if(tow == "1"){
this.c1image = this.images.c1["qianyin"];
}
if(nowspeed>this.oldspeed){
this.newc1state = 'qianyin';
}else if(nowspeed<this.oldspeed){
this.newc1state = 'zhidong';
if(tow == "2"){
this.c1image = this.images.c1["zhidong"];
}
if(this.c1state != this.newc1state){
this.c1state = this.newc1state;
this.c1image = this.images.c1[this.c1state];
if(tow == "3"){
this.c1image = this.images.c1["duoxing"];
}
if(tow == "4"){
this.c1image = this.images.c1["none"];
}
// if(tow){
// this.newc1state = 'duoxing';
// }
//
// if(this.c1state != this.newc1state){
// this.c1state = this.newc1state;
// this.c1image = this.images.c1[this.c1state];
// }
},
updateMmiNextStation(next){
if(next){