This commit is contained in:
fan 2021-08-03 10:37:33 +08:00
commit c79fc46135
7 changed files with 59 additions and 50 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

@ -995,29 +995,29 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
function signalupdate(data) {
code = data.code;
if(data.red == 1){
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}
if(data.yellow == 1){
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}
if(data.green == 1){
signallist.list[code].mesh.getObjectByName("green").material.map = materials[2];
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}

View File

@ -798,29 +798,29 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
code = data.code;
if(signallist.list[code]){
if(data.red == 1){
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}
if(data.yellow == 1){
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}
if(data.green == 1){
signallist.list[code].mesh.getObjectByName("green").material.map = materials[2];
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}

View File

@ -33,7 +33,7 @@ function settexture(materiallist,name,textureurl){
// onLoad回调
function ( texture ) {
texture.name = name;
materiallist.push(texture);
materiallist[name] = texture;
},
// 目前暂不支持onProgress的回调

View File

@ -320,8 +320,8 @@
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
console.log(angle);
console.log(this.userRole );
// console.log(angle);
// console.log(this.userRole );
if(angle<127 && angle>46){
if(angle<63 && angle>46){
if(this.touchstate != "Drive"){
@ -330,7 +330,7 @@
gear:"Drive"
};
trainSimulationGear(this.group,data).then(netdata => {
console.log(netdata);
// console.log(netdata);
if(netdata.code == "200"){
this.toutransform = "rotate(140deg)";
this.touchstate = "Drive";

View File

@ -141,7 +141,7 @@ import axios from 'axios';
methods: {
changeTrainSelect(mode){
if(mode == "isTraining"){
this.isTraining = false;
// this.isTraining = false;
}
},
currentsel(selVal){

View File

@ -160,7 +160,7 @@ export default {
}
},
mounted() {
// window.updatemmic1 = this.updatemmic1;
window.updatemmic1 = this.updatemmic1;
this.init();
},
beforeDestroy() {
@ -215,7 +215,6 @@ export default {
},
updatetrainstatus(newdata){
// console.log(newdata);
if(typeof(newdata.eb) != "undefined"){
this.updateEbStatus(newdata.eb);
@ -249,7 +248,6 @@ export default {
if(newdata.jump){
}
console.log(newdata.parking);
if(newdata.parking != undefined){
this.m4parking = newdata.parking;
this.updateM4(newdata);
@ -269,7 +267,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 +313,7 @@ export default {
}
}else{
this.nowspeed = parseInt(speed);
this.updatemmic1(this.nowspeed);
if(this.mmimodel.updatezz){
this.mmimodel.updatezz(speed);
}
@ -343,7 +343,7 @@ export default {
},
updateM4(newdata){
console.log(newdata );
if(newdata.parking != undefined){
if(newdata.parking == true){
this.m4image = this.images.m4['in'];
@ -360,7 +360,7 @@ export default {
}
},
updateTiaoting(newdata){
console.log(newdata);
if(newdata.jump != undefined){
if(newdata.jump == true){
this.tiaotingimage = this.images.n['tiaoting'];
@ -548,25 +548,27 @@ export default {
this.malen = +parseInt(len)/2*10+"px";
}
},
updatemmic1(nowspeed){
if(this.nowspeed != 0 ){
this.newc1state = 'duoxing';
}else{
this.newc1state = 'none';
updatemmic1(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){