修改三维驾驶门开关逻辑

This commit is contained in:
sunzhenyu 2021-09-07 14:53:36 +08:00
parent 453435ae94
commit 297e417113
2 changed files with 13 additions and 15 deletions

View File

@ -837,7 +837,6 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}
}else if(trainmodel.openleft != data.open && data.open == "1"){
trainmodel.openleft = "1";
console.log(data);
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;

View File

@ -215,6 +215,8 @@
},
oldDoorMode:"",
oldDoorSelection:"",
doorModePut:true,
doorSelectionPut:true,
}
},
watch: {
@ -279,7 +281,7 @@
this.angleoffset.y = domoffset.y;
e.preventDefault();
this.doorModePut = true;
document.getElementById("doormodeniu").onmousemove = this.doormodetouchmove;
document.getElementById("doormodeniu").onmouseup = this.doormodetouchend;
@ -301,7 +303,7 @@
this.angleoffset.y = domoffset.y;
e.preventDefault();
this.doorSelectionPut = true;
document.getElementById("doorpickniu").onmousemove = this.doordirecttouchmove;
document.getElementById("doorpickniu").onmouseup = this.doordirecttouchend;
},
@ -332,11 +334,12 @@
}else if(angle<250 && angle>=210){
command.doorMode = "MM";
}
if(command.doorMode != this.oldDoorMode ){
if(this.doorModePut == true && this.oldDoorMode != command.doorMode){
this.doorModePut = false;
this.oldDoorMode = command.doorMode;
trainSimulationDoorMode(this.group,command).then(netdata => {
if(netdata.data == true){
}
});
}
}
@ -362,15 +365,11 @@
}else if(angle<250 && angle>=210){
command.doorSelection = "R";
}
console.log(angle);
console.log(command.doorSelection);
console.log(this.oldDoorSelection);
if(command.doorSelection != this.oldDoorSelection){
// console.log(command.doorSelection);
if(this.doorSelectionPut == true && this.oldDoorSelection != command.doorSelection ){
this.doorSelectionPut = false;
this.oldDoorSelection = command.doorSelection;
trainSimulationDoorSelection(this.group,command).then(netdata => {
if(netdata.data == true){
}
});
}
}
@ -504,7 +503,7 @@
};
trainSimulationDoorControl(this.group,data).then(netdata => {
// console.log(netdata);
this.doorleftimg = this.greenimg;
// this.doorleftimg = this.greenimg;
});
},
@ -526,7 +525,7 @@
};
trainSimulationDoorControl(this.group,data).then(netdata => {
// console.log(netdata);
this.doorrightimg = this.greenimg;
// this.doorrightimg = this.greenimg;
});
},
atoaclick: function (e){