增加三维驾驶超速报警和牵引状态mmi显示,增加剧本设计中三维驾驶

This commit is contained in:
sunzhenyu 2020-06-17 18:16:49 +08:00
parent 3ec20a75c6
commit b70feae183
9 changed files with 145 additions and 60 deletions

View File

@ -73,3 +73,12 @@ export function getPublish3dMapDetail(id) {
});
return datad.then();
}
/** 更新地图3d数据*/
export function tuoguan3ddrive(group,on,data) {
return request({
url: `/api/scriptSimulation/${group}/${on}/trust`,
method: 'put',
data: data
});
}

View File

@ -102,13 +102,13 @@ export function getmodels(data) {
deviceType:"suidaobg",
type:"nbsuidao",
picUrl:"",
assetUrl:"../../static/model/suidao/nbsuidao.FBX"
assetUrl:"../../static/model/suidao/suidao.FBX"
}
assets.push(backgroundmodel);
models.assets = assets;
models.stationtexture = "nb1";
models.istexture = true;
models.stationtexture = "fz1";
models.istexture = false;
console.log(models);
postmap.assets = JSON.stringify(models);
//link轨道

View File

@ -85,23 +85,23 @@
}
},
watch: {
move:function(val,oldval) {
if(val != oldval){
let command ={
code:this.groupNum,
operation:"602",
type:"07",
param:val
};
// if(this.drawWay == 'true'){
throttle(trainSimulationForce(this.group,this.groupNum,val),200,true);
//
// }else{
// throttle(sendSimulationCommand(this.group,command),200,true);
// }
}
},
// move:function(val,oldval) {
// if(val != oldval){
// let command ={
// code:this.groupNum,
// operation:"602",
// type:"07",
// param:val
// };
// // if(this.drawWay == 'true'){
// throttle(trainSimulationForce(this.group,this.groupNum,val),200,true);
// //
// // }else{
// // throttle(sendSimulationCommand(this.group,command),200,true);
// // }
//
// }
// },
touchstate:function(val,oldval){
if(val != oldval){
// if(this.userRole == "DRIVER"){
@ -234,6 +234,9 @@
}
}
throttle(trainSimulationForce(this.group,this.groupNum, this.move),200,true);
updatemmic1(this.move);
},
speedend: function(event){
document.getElementById("div1").onmousemove = null;

View File

@ -119,7 +119,7 @@
<img class="buttonimg" :src="doorrightimg" />
<div class="buttontext">{{ $t('jlmap3d.closeRightDoor') }}</div>
</div>
<div id="urgestop" class="panebutton" style="bottom:6%;left:73%;">
<div id="urgestop" class="panebutton" style="bottom:6%;left:73%;" @click="ebstop">
<img class="buttonimg" :src="urgestopimg" />
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
</div>
@ -140,7 +140,7 @@
<script>
import Vue from 'vue';
// import { sendSimulationCommand } from '@/api/simulation.js';
import { trainSimulationDriveMode, trainSimulationAto ,trainSimulationAtp,trainSimulationChangeHead,trainSimulationDoorControl } from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
import { trainSimulationDriveMode, trainSimulationAto ,trainSimulationAtp,trainSimulationChangeHead,trainSimulationDoorControl,trainSimulationEb } from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
export default {
name: 'TopRightPane',
@ -425,6 +425,11 @@
},
cbtcclick: function (e){
},
ebstop: function (e){
trainSimulationEb(this.group,this.groupNum).then(netdata => {
// console.log(netdata);
});
},
updatabuttonlight: function (data){
// console.log(data);

View File

@ -8,7 +8,9 @@
</div>
<div class="display-draft">
<el-button-group>
<!-- <el-button type="primary" @click="raystand">站台选择</el-button> -->
<el-button type="primary" v-show="tuoguanbutton" @click="tuoguan">{{ tuoguanbuttonmsg }}</el-button>
<el-button type="primary" @click="cctvplane">{{ cctvbuttonmsg }}</el-button>
<el-button type="primary" @click="showplane">{{ showbuttonmsg }}</el-button>
<el-button type="primary" @click="back">{{$t('global.back')}}</el-button>
@ -47,9 +49,9 @@ import { mapGetters } from 'vuex';
// import ShowProperty from '@/views/jlmap3d/show/property';
import { simulationNotify, setTrainingCbtcInitTime } from '@/api/simulation';
import { simulationNotify, setTrainingCbtcInitTime, getSimulationInfoNew } from '@/api/simulation';
import { getPublishMapDetail, getPublish3dMapDetail } from '@/api/jlmap3d/load3ddata';
import { getPublishMapDetail, getPublish3dMapDetail,tuoguan3ddrive } from '@/api/jlmap3d/load3ddata';
import { UrlConfig } from '@/scripts/ConstDic';
@ -88,6 +90,9 @@ export default {
dcontrolshow: false,
msgshow:false,
controlmsg:"不能选择其它列车",
tuoguanbutton:false,
tuoguanbuttonmsg:"托管",
tuoguanstatus:false,
};
},
watch: {
@ -161,11 +166,24 @@ export default {
// this.$destroy();
}
},
computed: {
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
},
},
mounted() {
this.mmishow = true;
window.datanew = this.datanew;
window.updatestatus = this.updatestatus;
if(this.$route.query.group){
getSimulationInfoNew(this.$route.query.group).then(netdata => {
console.log(netdata);
if(netdata.data.type == "SCRIPT_MAKING"){
this.tuoguanbutton = true;
}
});
}
// this.$refs.mmiui.init();
},
methods: {
@ -262,6 +280,11 @@ export default {
}
},
tuoguan(){
tuoguan3ddrive(this.$route.query.group,this.tuoguanstatus,{}).then(netdata => {
console.log(netdata);
});
},
updatestatus(newdata){
this.trainnum = newdata.groupNumber;
this.$refs.mmiui.updatetrainstatus(newdata);

View File

@ -6,7 +6,7 @@
</div>
<div class = "top">
<div style="background:yellow;left:5%;width:10%;height:100%;">
<div style="left:5%;width:10%;height:100%;" :style="{background:a1state}">
</div>
<div class="toptext" style="left:16%;top:15px;">
@ -140,7 +140,8 @@ export default {
m9image:null,
m10state:"jinduan",
m10image:null,
c1state:"qianyin",
newc1state:"none",
c1state:"none",
c1image:null,
c2state:"rm",
c2image:null,
@ -149,8 +150,14 @@ export default {
c5state:"normal",
c5image:null,
images:null,
newa1state:"black",
a1state:"black",
}
},
mounted() {
window.updatemmic1 = this.updatemmic1;
this.init();
},
beforeDestroy() {
@ -183,8 +190,8 @@ export default {
this.m8image = this.images.m8['jinjizhidong'];
this.m9image = this.images.m9['ato'];
this.m10image = this.images.m10['jinduan'];
this.c1image = this.images.c1['qianyin'];
this.c2image = this.images.c2['rm'];
this.c1image = this.images.c1['none'];
this.c2image = this.images.c2['none'];
this.c3image = this.images.c3['normal'];
this.c5image = this.images.c5['normal'];
},
@ -204,18 +211,20 @@ export default {
},
updatetrainstatus(newdata){
//
console.log(newdata);
this.updatemmispeedview(newdata.v,newdata.pv,newdata.tv);
this.updatemmilen(newdata.maLen);
this.updatammirunlevel(newdata.runLevel);
this.updatemmidrivemodelevel(newdata.runLevel,newdata.driveMode,newdata.atoOn,newdata.atpOn);
// this.updatammirunlevel(newdata.runLevel);
//
// this.updatemmidrivemode(newdata.driveMode);
//
// this.updatemmiatoatp(newdata.atoOn,newdata.atpOn);
this.updatemmidrivemode(newdata.driveMode);
this.updatemmistation(newdata.endStation,newdata.nextStation);
this.updatemmiatoatp(newdata.atoOn,newdata.atpOn);
this.updatemmidoormode(newdata.leftDoorCanClose,newdata.rightDoorCanClose);
},
updatemmistate(aaa){
@ -234,6 +243,19 @@ export default {
if(this.mmimodel.updateato){
this.mmimodel.updateato(atospeed);
}
console.log(this.m9state1);
if(this.m9state1 == false){
if(speed>atospeed){
this.newa1state = "yellow";
}else{
this.newa1state = "black";
}
if(this.newa1state != this.a1state){
this.a1state = this.newa1state;
}
}
},
@ -308,43 +330,35 @@ export default {
//
// }
},
updatammirunlevel(drivedata){
if(drivedata != this.m2state){
if(drivedata == "CBTC"){
this.m2state = drivedata;
updatemmidrivemodelevel(runlevel,dirvemode,atoon,atpon){
if(runlevel != this.m2state){
if(runlevel == "CBTC"){
this.m2state = runlevel;
this.m2image = this.images.m2['cbtc'];
}else if(drivedata == "IL"){
this.m2state = drivedata;
}else if(runlevel == "IL"){
this.m2state = runlevel;
this.m2image = this.images.m2['il'];
}else{
this.m2state = drivedata;
this.m2state = runlevel;
this.m2image = this.images.m2['start'];
}
}
},
updatemmidrivemode(drivedata){
if(drivedata != this.m1state){
if(drivedata == "CM"){
this.m1state = drivedata;
if(dirvemode != this.m1state){
if(dirvemode == "CM"){
this.m1state = dirvemode;
this.m1image = this.images.m1['cm'];
}else if(drivedata == "RM"){
this.m1state = drivedata;
}else if(dirvemode == "RM"){
this.m1state = dirvemode;
this.m1image = this.images.m1['rm'];
}else if(drivedata == "AM"){
this.m1state = drivedata;
}else if(dirvemode == "AM"){
this.m1state = dirvemode;
this.m1image = this.images.m1['am'];
}else{
this.m1state = null;
this.m1image = this.images.m1['start'];
}
}
},
updatemmiatoatp(atoon,atpon){
//
if(this.m9state1 != atoon){
this.m9state1 = atoon;
@ -352,6 +366,7 @@ export default {
}else{
this.m9image = this.images.m9["ato"];
// this.c2image = this.images.c2['none'];
}
}
@ -363,6 +378,7 @@ export default {
this.m9image = this.images.m9["atp"];
}
}
},
updatemmidoormode(leftDoorCanClose,rightDoorCanClose){
if(leftDoorCanClose != this.m5stateleft|| rightDoorCanClose != this.m5stateright){
@ -417,6 +433,26 @@ export default {
this.malen = +parseInt(len)/2*10+"px";
}
},
updatemmic1(qspeed){
if(this.nowspeed != 0 ){
this.newc1state = 'duoxing';
}else{
this.newc1state = 'none';
}
if(qspeed>0){
this.newc1state = 'qianyin';
}else if(qspeed<0){
this.newc1state = 'zhidong';
}
if(this.c1state != this.newc1state){
this.c1state = this.newc1state;
this.c1image = this.images.c1[this.c1state];
}
},
updatemmistation(end,next){
if(next != this.nextstation || end != this.endstation){
this.endstation = end;
@ -425,9 +461,6 @@ export default {
},
},
mounted() {
this.init();
},
beforeDestroy() {
}
}

View File

@ -52,7 +52,7 @@
@showScheduling="showScheduling"
/>
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :group="group" :data-error="dataError" />
<menu-script v-if="isScript" ref="menuScript" @script3ddriveshow="script3ddriveshow" :offset-bottom="offsetBottom" :group="group" :data-error="dataError" />
<menu-practice
v-if="isPractice"
@ -245,6 +245,8 @@ export default {
return this.mode === 'practice';
},
isDrive() {
console.log(this.mode);
console.log(this.prdType);
return this.prdType == '04';
},
isShowScheduling() {
@ -624,6 +626,11 @@ export default {
window.open(routeData.href, '_blank', 'noopener noreferrer');
}
},
script3ddriveshow(){
this.panelShow = false;
this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group);
},
passflow() {
const routeData = this.$router.resolve({
path:'/jlmap3d/passengerflow',

View File

@ -7,6 +7,7 @@
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
</el-button-group> -->
<el-button-group>
<el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ $t('joinTraining.driverPerspective') }}</el-button>
<el-button v-if="!isScriptCommand" type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('scriptRecord.drivingByPlan') }}</el-button>
<el-button v-if="!isScriptCommand" type="danger" :disabled="dataError" @click="end">初始化</el-button>
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
@ -196,6 +197,9 @@ export default {
Notification.closeAll();
});
},
jumpjlmap3d() {
this.$emit('script3ddriveshow');
},
async loadSystemTime() {
}

View File

@ -100,6 +100,7 @@ export default {
return this.userRole == 'STATION_SUPERVISOR';
},
isDriver() {
console.log(this.userRole);
return this.userRole == 'DRIVER';
},
isAdmin() {