diff --git a/package.json b/package.json index bd4521b4a..ca598995f 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "compression-webpack-plugin": "^3.0.0", "connect": "3.6.6", "copy-webpack-plugin": "^4.5.2", + "eslint": "5.15.3", "eslint-plugin-vue": "5.2.2", "file-loader": "^3.0.1", diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js index 65802534c..8ddb3f7ba 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js @@ -4,894 +4,881 @@ import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcI import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp'; import { getToken } from '@/utils/auth'; -import router from '@/router'; +import router from '@/router/index_APP_TARGET'; // 定于仿真socket接口 -export function Jl3dDriving(mixers,updatemmi,sound,translation,routegroup) { +export function Jl3dDriving(mixers, updatemmi, sound, translation, routegroup) { - let scope = this; - this.map = null; - let toppic = '/app/topic/simulation/client/'+routegroup+'/drive'; - var trainlisttest = null; - var sectionlist = null; - var signallist = null; - var stationstandlist = null; - var sectionlist = null; - var materials = null; - var actions = null; - var rails = null; - var links = null; + const scope = this; + this.map = null; + const toppic = '/app/topic/simulation/client/' + routegroup + '/drive'; + var trainlisttest = null; + var sectionlist = null; + var signallist = null; + var stationstandlist = null; + var sectionlist = null; + var materials = null; + var actions = null; + var rails = null; + var links = null; - var scenes = null; + var scenes = null; - var code = null; + var code = null; - var drivingcode = null; - var drivingspeed = null; - var drivingaptspeed = null; + var drivingcode = null; + var drivingspeed = null; + var drivingaptspeed = null; - let driverswitch = false; + let driverswitch = false; - let stoptimer = null; - let num = 30; - let pointstand = null; - // run as plane = 01; - // reset = 02; - var datatype = '00'; - this.teststomp = new StompClient(); - this.topic = '/user/queue/simulation/jl3d/'+routegroup; - let header = {'X-Token': getToken() }; + const stoptimer = null; + const num = 30; + const pointstand = null; + // run as plane = 01; + // reset = 02; + var datatype = '00'; + this.teststomp = new StompClient(); + this.topic = '/user/queue/simulation/jl3d/' + routegroup; + const header = {'X-Token': getToken() }; - this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) { - // console.log(mapdata); - // console.log(newtrainlisttest); - trainlisttest = newtrainlisttest; - sectionlist = newsectionlist; - signallist = newsignallist; - stationstandlist = newstationstandlist; - materials = materiallist; - scenes = scene; - actions = nowaction; - links = newlinklist; - rails = newrails; - }; + this.updatamap = function(newsectionlist, newlinklist, newsignallist, newstationstandlist, newtrainlisttest, newrealsectionlist, newrails, materiallist, nowaction, scene) { + // console.log(mapdata); + // console.log(newtrainlisttest); + trainlisttest = newtrainlisttest; + sectionlist = newsectionlist; + signallist = newsignallist; + stationstandlist = newstationstandlist; + materials = materiallist; + scenes = scene; + actions = nowaction; + links = newlinklist; + rails = newrails; + }; - this.initdrivercode = function(code) { - drivingcode = code; - }; + this.initdrivercode = function(code) { + drivingcode = code; + }; - this.socketon = function(topic) { - try { - // console.log("teststomp"); - scope.teststomp.subscribe(topic, callback, header); - } catch (error) { - console.error('websocket订阅失败'); - } + this.socketon = function(topic) { + try { + // console.log("teststomp"); + scope.teststomp.subscribe(topic, callback, header); + } catch (error) { + console.error('websocket订阅失败'); + } - }; + }; - this.socketoff = function(topic) { - scope.teststomp.unsubscribe(topic); - for (let i=0; i0) { - // updatemmi.updatenowspeed(data.body[tl].v); - // } else { - - updatemmi.updatenowspeed(Math.abs(data.body[tl].v)); - // console.log(data.body[i]); - - // } - } - } - - - - if (code == drivingcode) { - // if(sound.volswitch == true){ - // sound.setVolume( data.body[tl].v/100 ); - // } - if (data.body[tl].atpv) { - updatemmi.updateatpspeed(data.body[tl].atpv); - } else { - updatemmi.updateatpspeed(-1); - } - if (data.body[tl].atov) { - updatemmi.updateatospeed(data.body[tl].atov); - } else { - updatemmi.updateatospeed(-1); - } - if(trainlisttest.list[code].progress<1){ - let syncdata = { - type: 'Train', - code: code, - linkCode: trainlisttest.list[code].nowcode, - percent: 0 - }; - if (trainlisttest.list[code].status == '02') { - if(trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode){ - if((trainlisttest.list[code].linkOffsetPercent/trainlisttest.list[code].pc)>=trainlisttest.list[code].targetpercent){ - syncdata.percent = trainlisttest.list[code].progress; - }else{ - syncdata.percent = trainlisttest.list[code].progress*trainlisttest.list[code].pc; - } - }else{ - syncdata.percent = trainlisttest.list[code].progress; - } - - } else { - if(trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode){ - if((trainlisttest.list[code].linkOffsetPercent/trainlisttest.list[code].pc)<=trainlisttest.list[code].targetpercent){ - syncdata.percent = (1 - trainlisttest.list[code].progress); - }else{ - syncdata.percent = (1 - trainlisttest.list[code].progress)*trainlisttest.list[code].pc; - } - }else{ - syncdata.percent = (1 - trainlisttest.list[code].progress); - } - } - // console.log("send"); - // console.log(trainlisttest.list[code]); - // - // console.log(syncdata); - // console.log("============="); - scope.teststomp.send(toppic, syncdata); - } - - } - } - } - } - - function trainstatus(data){ - // console.log(data.body); - for (let i=data.body.length-1; i>=0; i--) { - // 遍历列车对象组 - // console.log(trainlisttest); - if (trainlisttest) { - - code = data.body[i].code; - // 剔除不显示的车 - // 找到对应列车 - - if (code == drivingcode) { - - driverswitch = data.body[i].runMode; - //更新车组号 - updatemmi.updatetrainnum(data.body[i].groupNumber); - //更新列车 - if (data.body[i].parkRemainTime>0) { - updatemmi.updatestoptime(translation.stopTime+parseInt(data.body[i].parkRemainTime)); - } else { - if (data.body[i].runMode == '02') { - updatemmi.updatestoptime(translation.trainAtoOn); - } else { - if (trainlisttest.list[code].isStandTrack == true && trainlisttest.list[code].progress>0.95 && trainlisttest.list[code].speed<=0) { - // if(stoptimer){ - // - // }else{ - // stoptimer = setInterval(function(){ - // if(num >=0){ - // updatemmi.updatestoptime("停站时间:"+num); - // num --; - // } - // },1000); - // } - - } else { - updatemmi.updatestoptime(translation.trainAtoOff); - } - } - } - } - trainlisttest.list[code].runMode = data.body[i].runMode; - - // 车门开关验证 - if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // console.log("close"); - trainlisttest.list[code].doorStatus = '01'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = actions[code].top[an]._clip.duration; - actions[code].top[an].timeScale = -1; - actions[code].top[an].play(); - } - } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // console.log("open"); - trainlisttest.list[code].doorStatus = '02'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = 0; - actions[code].top[an].timeScale = 1; - actions[code].top[an].play(); - } - } - // if (data.body[i].directionType == '02') { - // - // } else { - // if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // // console.log("close"); - // trainlisttest.list[code].doorStatus = '01'; - // for (let an=actions[code].down.length-1; an>=0; an--) { - // actions[code].down[an].reset(); - // actions[code].down[an].time = actions[code].top[an]._clip.duration; - // actions[code].down[an].timeScale = -1; - // actions[code].down[an].play(); - // } - // } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // // console.log("open"); - // trainlisttest.list[code].doorStatus = '02'; - // for (let an=actions[code].down.length-1; an>=0; an--) { - // actions[code].down[an].reset(); - // actions[code].down[an].time = 0; - // actions[code].down[an].timeScale = 1; - // actions[code].down[an].play(); - // } - // } - // } - // 遍历获取所在轨道 - - if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) { - - if (rails.linkrail[data.body[i].linkCode]) { - // console.log(trainlisttest.group); - if(trainlisttest.group.children.length<1){ - trainlisttest.group.add(trainlisttest.list[code]); - drivingcode = code; - updatemmi.updatedrivingcode(drivingcode); - } - if(trainlisttest.list[code].mixerpush == false){ - for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi=0; i--) { - // 0xFFFFFF - // 0xCD0000 红 - // 0xEEEE00 黄 - // 0x32CD32 绿 - if (data.body[i]._type == 'Signal') { - if (signallist) { - signalupdate(data.body[i]); - } - } - - if (data.body[i]._type == 'StationStand' ) { - if (actions) { - standupdate(data.body[i]); - } - } - - if (data.body[i]._type == 'Switch') { - if (sectionlist) { - switchupdate(data.body[i]); - } - } - - } - } - - function standupdate(data) { - code = data.code; - if ( actions[code]) { - if (data.screenDoorOpenStatus == '02' && actions[code].status == '01') { - actions[code].status = '00'; - } - if (data.screenDoorOpenStatus == '02' && actions[code].status == '00') { - actions[code].status = '02'; - actions[code].action.reset(); - actions[code].action.time = 0; - actions[code].action.timeScale = 1; - actions[code].action.play(); - } - - if (data.screenDoorOpenStatus == '01' && actions[code].status == '02') { - actions[code].status = '00'; - } - if (data.screenDoorOpenStatus == '01' && actions[code].status == '00') { - actions[code].status = '01'; - actions[code].action.reset(); - actions[code].action.time = actions[code].action._clip.duration; - actions[code].action.timeScale = -1; - actions[code].action.play(); - } - } - - } - - function signalupdate(data) { - code = data.code; - if (data.lightType == '01') { - if (signallist.list[code].mesh.code) { - signallist.list[code].mesh.status = data.status; - - // 55 - // 33 - // 77 - // 关闭 - if (data.status == '01') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[0]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - // 开放 - if (data.status == '02') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[2]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - } - if (data.status == '03') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - // 引导 - if (data.status == '03') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[0]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - // 封锁 - if (data.status == '04') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - // 故障 - if (data.status == '05') { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - - } - - } else if (data.lightType == '02') { - if (signallist.list[code].mesh.code) { - signallist.list[code].mesh.getObjectByName("red").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; - signallist.list[code].mesh.getObjectByName("green").material.map = materials[3]; - signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; - - } - - } - - } - - function switchupdate(data) { - code = data.code; - for (let j=sectionlist.switchs.modellist.length-1; j>=0; j--) { - if (rails.switchrail[code]) { - if (rails.switchrail[code].locateType != data.locateType) { - // console.log("道岔变化:"+code); - if (data.locateType == '02') { - // console.log("02 反位"); - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = 0; - actions[sectionlist.switchs.modellist[j].code].timeScale = 1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = "02"; - - let testswitch = rails.switchrail[code]; - if(rails.switchrail[code].directtype == "1"){ - // console.log("道岔朝向1向左"); - // console.log("aleft:"+testswitch.clink); - // console.log("cright:"+testswitch.alink); - rails.linkrail[testswitch.alink].lconnect = testswitch.clink; - rails.linkrail[testswitch.clink].rconnect = testswitch.alink; - }else if(rails.switchrail[code].directtype == "2"){ - // console.log("道岔朝向2向右"); - // console.log("aright:"+testswitch.clink); - // console.log("cleft:"+testswitch.alink); - rails.linkrail[testswitch.alink].rconnect = testswitch.clink; - rails.linkrail[testswitch.clink].lconnect = testswitch.alink; - } - - } else if (data.locateType == '01') { - // console.log("01 定位"); - if (actions[sectionlist.switchs.modellist[j].code]) { - sectionlist.switchs.modellist[j].locateType = data.locateType; - actions[sectionlist.switchs.modellist[j].code].reset(); - actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration; - actions[sectionlist.switchs.modellist[j].code].timeScale = -1; - actions[sectionlist.switchs.modellist[j].code].play(); - } - - rails.switchrail[code].locateType = "01"; - let testswitch = rails.switchrail[code]; - if(rails.switchrail[code].directtype == "1"){ - // console.log("道岔朝向1向左"); - // console.log("aleft"+testswitch.blink); - // console.log("cright:"+testswitch.alink); - rails.linkrail[testswitch.alink].lconnect = testswitch.blink; - rails.linkrail[testswitch.blink].rconnect = testswitch.alink; - }else if(rails.switchrail[code].directtype == "2"){ - // console.log("道岔朝向2向右"); - // console.log("aright:"+testswitch.blink); - // console.log("cleft:"+testswitch.alink); - rails.linkrail[testswitch.alink].rconnect = testswitch.blink; - rails.linkrail[testswitch.blink].lconnect = testswitch.alink; - } - - } - } - j = 0; - } - } - } + function trainspeed(data) { + // console.log(data); + if (trainlisttest) { + for (let tl = 0; tl < data.body.length; tl++) { + code = data.body[tl].id; + if (trainlisttest.list[code].speed != data.body[tl].v) { + trainlisttest.list[code].speed = data.body[tl].v; + + if (trainlisttest.list[code].runMode == '02') { + + if (trainlisttest.list[code].isStandTrack == true) { + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); + } else { + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); + } + } else { + + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v * 10 / 36 / 25 / trainlisttest.list[code].len); + } + + if (code == drivingcode) { + // if (data.body[tl].v >0) { + // updatemmi.updatenowspeed(data.body[tl].v); + // } else { + + updatemmi.updatenowspeed(Math.abs(data.body[tl].v)); + // console.log(data.body[i]); + + // } + } + } + + if (code == drivingcode) { + // if(sound.volswitch == true){ + // sound.setVolume( data.body[tl].v/100 ); + // } + if (data.body[tl].atpv) { + updatemmi.updateatpspeed(data.body[tl].atpv); + } else { + updatemmi.updateatpspeed(-1); + } + if (data.body[tl].atov) { + updatemmi.updateatospeed(data.body[tl].atov); + } else { + updatemmi.updateatospeed(-1); + } + if (trainlisttest.list[code].progress < 1) { + const syncdata = { + type: 'Train', + code: code, + linkCode: trainlisttest.list[code].nowcode, + percent: 0 + }; + if (trainlisttest.list[code].status == '02') { + if (trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode) { + if ((trainlisttest.list[code].linkOffsetPercent / trainlisttest.list[code].pc) >= trainlisttest.list[code].targetpercent) { + syncdata.percent = trainlisttest.list[code].progress; + } else { + syncdata.percent = trainlisttest.list[code].progress * trainlisttest.list[code].pc; + } + } else { + syncdata.percent = trainlisttest.list[code].progress; + } + + } else { + if (trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode) { + if ((trainlisttest.list[code].linkOffsetPercent / trainlisttest.list[code].pc) <= trainlisttest.list[code].targetpercent) { + syncdata.percent = (1 - trainlisttest.list[code].progress); + } else { + syncdata.percent = (1 - trainlisttest.list[code].progress) * trainlisttest.list[code].pc; + } + } else { + syncdata.percent = (1 - trainlisttest.list[code].progress); + } + } + // console.log("send"); + // console.log(trainlisttest.list[code]); + // + // console.log(syncdata); + // console.log("============="); + scope.teststomp.send(toppic, syncdata); + } + + } + } + } + } + + function trainstatus(data) { + // console.log(data.body); + for (let i = data.body.length - 1; i >= 0; i--) { + // 遍历列车对象组 + // console.log(trainlisttest); + if (trainlisttest) { + + code = data.body[i].code; + // 剔除不显示的车 + // 找到对应列车 + + if (code == drivingcode) { + + driverswitch = data.body[i].runMode; + // 更新车组号 + updatemmi.updatetrainnum(data.body[i].groupNumber); + // 更新列车 + if (data.body[i].parkRemainTime > 0) { + updatemmi.updatestoptime(translation.stopTime + parseInt(data.body[i].parkRemainTime)); + } else { + if (data.body[i].runMode == '02') { + updatemmi.updatestoptime(translation.trainAtoOn); + } else { + if (trainlisttest.list[code].isStandTrack == true && trainlisttest.list[code].progress > 0.95 && trainlisttest.list[code].speed <= 0) { + // if(stoptimer){ + // + // }else{ + // stoptimer = setInterval(function(){ + // if(num >=0){ + // updatemmi.updatestoptime("停站时间:"+num); + // num --; + // } + // },1000); + // } + + } else { + updatemmi.updatestoptime(translation.trainAtoOff); + } + } + } + } + trainlisttest.list[code].runMode = data.body[i].runMode; + + // 车门开关验证 + if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { + // console.log("close"); + trainlisttest.list[code].doorStatus = '01'; + for (let an = actions[code].top.length - 1; an >= 0; an--) { + actions[code].top[an].reset(); + actions[code].top[an].time = actions[code].top[an]._clip.duration; + actions[code].top[an].timeScale = -1; + actions[code].top[an].play(); + } + } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { + // console.log("open"); + trainlisttest.list[code].doorStatus = '02'; + for (let an = actions[code].top.length - 1; an >= 0; an--) { + actions[code].top[an].reset(); + actions[code].top[an].time = 0; + actions[code].top[an].timeScale = 1; + actions[code].top[an].play(); + } + } + // if (data.body[i].directionType == '02') { + // + // } else { + // if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { + // // console.log("close"); + // trainlisttest.list[code].doorStatus = '01'; + // for (let an=actions[code].down.length-1; an>=0; an--) { + // actions[code].down[an].reset(); + // actions[code].down[an].time = actions[code].top[an]._clip.duration; + // actions[code].down[an].timeScale = -1; + // actions[code].down[an].play(); + // } + // } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { + // // console.log("open"); + // trainlisttest.list[code].doorStatus = '02'; + // for (let an=actions[code].down.length-1; an>=0; an--) { + // actions[code].down[an].reset(); + // actions[code].down[an].time = 0; + // actions[code].down[an].timeScale = 1; + // actions[code].down[an].play(); + // } + // } + // } + // 遍历获取所在轨道 + + if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) { + + if (rails.linkrail[data.body[i].linkCode]) { + // console.log(trainlisttest.group); + if (trainlisttest.group.children.length < 1) { + trainlisttest.group.add(trainlisttest.list[code]); + drivingcode = code; + updatemmi.updatedrivingcode(drivingcode); + } + if (trainlisttest.list[code].mixerpush == false) { + for (let mi = 0, lenmi = trainlisttest.list[code].mixer.length; mi < lenmi; mi++) { + mixers.push(trainlisttest.list[code].mixer[mi]); + } + trainlisttest.list[code].mixerpush = true; + } + // trainlisttest.group.add(trainlisttest.list[code]); + trainlisttest.list[code].position.y = 0; + trainlisttest.list[code].progress = 0; + // trainlisttest.list[code].oldoffset = data.body[i].sectionOffsetPercent; + trainlisttest.list[code].dispose = false; + trainlisttest.list[code].nowcode = data.body[i].linkCode; + + trainlisttest.list[code].pc = 1; + // console.log(data.body[i]); + if (data.body[i].directionType == '02') { // 向右 + + if (data.body[i].targetStation) { + + trainlisttest.list[code].stopstation = data.body[i].targetStation; + // console.log(rails.stops[data.body[i].targetStation].direct2.percent); + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].progress = data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + } else { + trainlisttest.list[code].progress = data.body[i].linkOffsetPercent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + } + + trainlisttest.list[code].status = '02'; + + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; + const point = rails.linkrail[data.body[i].linkCode].lineleft.getPointAt(trainlisttest.list[code].progress); + trainlisttest.list[code].rotation.y = 0; + trainlisttest.list[code].position.x = point.x; + trainlisttest.list[code].position.y = 0; + for (let tl = 0; tl < 6; tl++) { + trainlisttest.list[code].children[tl].position.z = point.z; + } + } else if (data.body[i].directionType == '03') { // 向左 + + // if(trainlisttest.list[code].rname == "006"){ + // console.log("0000000000000000"); + // console.log(data.body[i].linkOffsetPercent); + // } + if (data.body[i].targetStation) { + + trainlisttest.list[code].stopstation = data.body[i].targetStation; + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; + // console.log(data.body[i].targetLinkPercent); + // console.log(rails.stops[data.body[i].targetStation].direct1.percent); + // console.log(trainlisttest.list[code].pc); + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + } else { + trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + } + // console.log("progress:"+trainlisttest.list[code].progress); + // console.log("linkOffsetPercent:"+trainlisttest.list[code].linkOffsetPercent); + // console.log("datatarget:"+ data.body[i].targetLinkPercent); + // console.log("directpercent:"+trainlisttest.list[code].targetpercent); + // console.log("===================="); + trainlisttest.list[code].status = '03'; + + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; + const point = rails.linkrail[data.body[i].linkCode].lineright.getPointAt(trainlisttest.list[code].progress); + trainlisttest.list[code].rotation.y = Math.PI; + trainlisttest.list[code].position.x = point.x; + trainlisttest.list[code].position.y = 0; + for (let tl = 0; tl < 6; tl++) { + trainlisttest.list[code].children[tl].position.z = -point.z; + } + } + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + // trainlisttest.list[code].isStandTrack = sectionlist.sections.datalist[data.body[i].sectionCode].isStandTrack; + + // trainlisttest.list[code].len = sectionlist.sections.datalist[data.body[i].sectionCode].distance; + + if (data.body[i].speed == 0) { + trainlisttest.list[code].speeds = data.body[i].speed; + trainlisttest.list[code].speeds = 0; + // trainlisttest.list[code].startmark = 1; + } else { + trainlisttest.list[code].speeds = data.body[i].speed; + trainlisttest.list[code].speeds = parseFloat(data.body[i].speed * 10 / 36 / 25 / trainlisttest.list[code].len); + } + + } + + } else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) { + trainlisttest.group.remove(trainlisttest.list[code]); + trainlisttest.list[code].progress = null; + trainlisttest.list[code].dispose = true; + code = trainlisttest.group.children[i].name; + trainlisttest.list[code].rotation.y = 0; + trainlisttest.list[code].doorStatus = '01'; + trainlisttest.list[code].speed = 0; + trainlisttest.list[code].position.x = -50000; + trainlisttest.list[code].position.y = -50000; + trainlisttest.list[code].pc = 1; + } else if (trainlisttest.list[code].dispose == data.body[i].dispose && data.body[i].dispose == false) { + + if (rails.linkrail[data.body[i].linkCode]) { + if (driverswitch == '02' && code == drivingcode) { + updatemmi.updatenowspeed(data.body[i].speed); + if (data.body[i].atpSpeed) { + updatemmi.updateatpspeed(data.body[i].atpSpeed); + } else { + updatemmi.updateatpspeed(-1); + } + if (data.body[i].targetSpeed) { + updatemmi.updateatospeed(data.body[i].targetSpeed); + } else { + updatemmi.updateatospeed(-1); + } + if (data.body[i].maLen) { + updatemmi.updatenowlen(data.body[i].maLen); + } else { + updatemmi.updatenowlen(0); + } + // if(trainlisttest.list[code].isStandTrack == true){ + // pointstand = null; + // if(data.body[i].directionType == "02"){ + // pointstand = trainlisttest.list[code].curve.getPointAt(data.body[i].sectionOffsetPercent); + // }else{ + // pointstand = trainlisttest.list[code].curve.getPointAt(1-data.body[i].sectionOffsetPercent); + // } + // console.log(data.body[i].sectionOffsetPercent) + // console.log(pointstand.x); + // + // trainlisttest.list[code].position.x = pointstand.x; + // } + } + if (driverswitch == '05' && code == drivingcode) { + if (data.body[i].maLen) { + updatemmi.updatenowlen(data.body[i].maLen); + } else { + updatemmi.updatenowlen(0); + } + } + if (trainlisttest.list[code].status != data.body[i].directionType) { + if (data.body[i].directionType == '02') { // 向右 + + trainlisttest.list[code].progress = 0; + const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; + const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14]; + trainlisttest.list[code].rotation.y = 0; + trainlisttest.list[code].position.x = rotaposx; + for (let tl = 0; tl < 6; tl++) { + trainlisttest.list[code].children[tl].position.z = rotaposz; + } + + trainlisttest.list[code].progress = (rotaposx - rails.linkrail[data.body[i].linkCode].lp.x) / rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].status = '02'; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; + trainlisttest.list[code].nextcurve = null; + + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + + } else if (data.body[i].directionType == '03') { // 向左 + trainlisttest.list[code].progress = 0; + const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; + const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]); + trainlisttest.list[code].rotation.y = Math.PI; + trainlisttest.list[code].position.x = rotaposx; + for (let tl = 0; tl < 6; tl++) { + trainlisttest.list[code].children[tl].position.z = -rotaposz; + } + trainlisttest.list[code].progress = 1 - (rotaposx - rails.linkrail[data.body[i].linkCode].lp.x) / rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].status = '03'; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; + trainlisttest.list[code].nextcurve = null; + + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + + } + } + let nextcode; + + if (code == drivingcode) { + // console.log(data.body[i].targetStation); + // console.log("netpercent"); + // console.log(data.body[i].targetLinkPercent); + // console.log(data.body[i].linkOffsetPercent); + // console.log("3dpercent"); + // if(rails.stops[data.body[i].targetStation]){ + // console.log(rails.stops[data.body[i].targetStation].direct2.percent); + // } + // + // console.log(trainlisttest.list[code].progress); + // console.log(trainlisttest.list[code].pc); + // console.log("==============="); + // console.log(data.body[i]); + if (data.body[i].directionType == '02') { + if (trainlisttest.list[code].stopstation != data.body[i].targetStation) { + trainlisttest.list[code].stopstation = data.body[i].targetStation; + if (data.body[i].targetStation) { + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + + // trainlisttest.list[code].progress = trainlisttest.list[code].linkOffsetPercent*trainlisttest.list[code].pc; + } + } + + trainlisttest.list[code].status = '02'; + nextcode = rails.linkrail[data.body[i].linkCode].rconnect; + if (nextcode) { + // console.log(rails.linkrail[nextcode].lineleft.points); + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } else { + + trainlisttest.list[code].nextlen = 0; + } + } else if (data.body[i].directionType == '03') { + if (trainlisttest.list[code].stopstation != data.body[i].targetStation) { + trainlisttest.list[code].stopstation = data.body[i].targetStation; + if (data.body[i].targetStation) { + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + // trainlisttest.list[code].progress = (1-trainlisttest.list[code].linkOffsetPercent)*trainlisttest.list[code].pc; + } + } + trainlisttest.list[code].status = '03'; + nextcode = rails.linkrail[data.body[i].linkCode].lconnect; + if (nextcode) { + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } else { + + trainlisttest.list[code].nextlen = 0; + } + } + trainlisttest.list[code].nextcode = nextcode; + + // console.log(trainlisttest.list[code].nowcode); + // console.log(trainlisttest.list[code].nextcode); + // console.log(trainlisttest.list[code].curve.points); + // console.log(trainlisttest.list[code].nextcurve.points); + // console.log("========================="); + + } else { + + // trainlisttest.list[code].stopstation = data.body[i].targetStation; + // // console.log(rails.stops[data.body[i].targetStation].direct2.percent); + // trainlisttest.list[code].pc = data.body[i].targetLinkPercent/rails.stops[data.body[i].targetStation].direct2.percent; + // trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; + // trainlisttest.list[code].progress = data.body[i].linkOffsetPercent*trainlisttest.list[code].pc; + // trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + // trainlisttest.list[code].targetLink = data.body[i].targetLink; + + let nextcode; + if (data.body[i].directionType == '02') { + if (rails.linkrail[data.body[i].linkCode].lineleft) { + nextcode = rails.linkrail[data.body[i].linkCode].rconnect; + trainlisttest.list[code].status = '02'; + if (nextcode) { + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } + trainlisttest.list[code].nowcode = data.body[i].linkCode; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].progress = data.body[i].linkOffsetPercent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + if (data.body[i].targetStation) { + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct2.percent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + trainlisttest.list[code].progress = data.body[i].linkOffsetPercent / trainlisttest.list[code].pc; + } + trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed * 10 / 36 / 25 / trainlisttest.list[code].len); + } + } else if (data.body[i].directionType == '03') { + if (rails.linkrail[data.body[i].linkCode].lineright) { + nextcode = rails.linkrail[data.body[i].linkCode].lconnect; + trainlisttest.list[code].status = '03'; + + if (nextcode) { + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } + trainlisttest.list[code].nowcode = data.body[i].linkCode; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].progress = 1 - data.body[i].linkOffsetPercent; + trainlisttest.list[code].linkOffsetPercent = data.body[i].linkOffsetPercent; + if (data.body[i].targetStation) { + trainlisttest.list[code].pc = data.body[i].targetLinkPercent / rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].targetpercent = rails.stops[data.body[i].targetStation].direct1.percent; + trainlisttest.list[code].targetLink = data.body[i].targetLink; + trainlisttest.list[code].progress = (1 - data.body[i].linkOffsetPercent) / trainlisttest.list[code].pc; + } + trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed * 10 / 36 / 25 / trainlisttest.list[code].len); + } + } + trainlisttest.list[code].nextcode = nextcode; + } + + // console.log(data.body[i].linkOffsetPercent); + // console.log(trainlisttest.list[code].progress); + // console.log(trainlisttest.list[code].curve.points); + // console.log(trainlisttest.list[code].nextcurve.points); + // console.log(trainlisttest.list[code].len); + // console.log(trainlisttest.list[code].nextlen); + // console.log("=========================================="); + } + } + + } + } + } + + function simulationreset(data) { + // console.log(data); + for (const k in trainlisttest.list) { + trainlisttest.list[k].dispose = true; + trainlisttest.group.remove(trainlisttest.list[k]); + trainlisttest.list[k].stopstation = null; + trainlisttest.list[k].pc = null; + trainlisttest.list[k].targetpercent = null; + trainlisttest.list[k].progress = null; + trainlisttest.list[k].linkOffsetPercent = null; + trainlisttest.list[k].targetLink = null; + drivingcode = null; + } + } + + function devicestatus(data) { + for (let i = data.body.length - 1; i >= 0; i--) { + // 0xFFFFFF + // 0xCD0000 红 + // 0xEEEE00 黄 + // 0x32CD32 绿 + if (data.body[i]._type == 'Signal') { + if (signallist) { + signalupdate(data.body[i]); + } + } + + if (data.body[i]._type == 'StationStand' ) { + if (actions) { + standupdate(data.body[i]); + } + } + + if (data.body[i]._type == 'Switch') { + if (sectionlist) { + switchupdate(data.body[i]); + } + } + + } + } + + function standupdate(data) { + code = data.code; + if ( actions[code]) { + if (data.screenDoorOpenStatus == '02' && actions[code].status == '01') { + actions[code].status = '00'; + } + if (data.screenDoorOpenStatus == '02' && actions[code].status == '00') { + actions[code].status = '02'; + actions[code].action.reset(); + actions[code].action.time = 0; + actions[code].action.timeScale = 1; + actions[code].action.play(); + } + + if (data.screenDoorOpenStatus == '01' && actions[code].status == '02') { + actions[code].status = '00'; + } + if (data.screenDoorOpenStatus == '01' && actions[code].status == '00') { + actions[code].status = '01'; + actions[code].action.reset(); + actions[code].action.time = actions[code].action._clip.duration; + actions[code].action.timeScale = -1; + actions[code].action.play(); + } + } + + } + + function signalupdate(data) { + code = data.code; + if (data.lightType == '01') { + if (signallist.list[code].mesh.code) { + signallist.list[code].mesh.status = data.status; + + // 55 + // 33 + // 77 + // 关闭 + if (data.status == '01') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[0]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + // 开放 + if (data.status == '02') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[2]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + } + if (data.status == '03') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[1]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + // 引导 + if (data.status == '03') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[0]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[1]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + // 封锁 + if (data.status == '04') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + // 故障 + if (data.status == '05') { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + + } + + } else if (data.lightType == '02') { + if (signallist.list[code].mesh.code) { + signallist.list[code].mesh.getObjectByName('red').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('red').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('yellow').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('yellow').material.map.needsUpdate = true; + signallist.list[code].mesh.getObjectByName('green').material.map = materials[3]; + signallist.list[code].mesh.getObjectByName('green').material.map.needsUpdate = true; + + } + + } + + } + + function switchupdate(data) { + code = data.code; + for (let j = sectionlist.switchs.modellist.length - 1; j >= 0; j--) { + if (rails.switchrail[code]) { + if (rails.switchrail[code].locateType != data.locateType) { + // console.log("道岔变化:"+code); + if (data.locateType == '02') { + // console.log("02 反位"); + if (actions[sectionlist.switchs.modellist[j].code]) { + sectionlist.switchs.modellist[j].locateType = data.locateType; + actions[sectionlist.switchs.modellist[j].code].reset(); + actions[sectionlist.switchs.modellist[j].code].time = 0; + actions[sectionlist.switchs.modellist[j].code].timeScale = 1; + actions[sectionlist.switchs.modellist[j].code].play(); + } + + rails.switchrail[code].locateType = '02'; + + const testswitch = rails.switchrail[code]; + if (rails.switchrail[code].directtype == '1') { + // console.log("道岔朝向1向左"); + // console.log("aleft:"+testswitch.clink); + // console.log("cright:"+testswitch.alink); + rails.linkrail[testswitch.alink].lconnect = testswitch.clink; + rails.linkrail[testswitch.clink].rconnect = testswitch.alink; + } else if (rails.switchrail[code].directtype == '2') { + // console.log("道岔朝向2向右"); + // console.log("aright:"+testswitch.clink); + // console.log("cleft:"+testswitch.alink); + rails.linkrail[testswitch.alink].rconnect = testswitch.clink; + rails.linkrail[testswitch.clink].lconnect = testswitch.alink; + } + + } else if (data.locateType == '01') { + // console.log("01 定位"); + if (actions[sectionlist.switchs.modellist[j].code]) { + sectionlist.switchs.modellist[j].locateType = data.locateType; + actions[sectionlist.switchs.modellist[j].code].reset(); + actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration; + actions[sectionlist.switchs.modellist[j].code].timeScale = -1; + actions[sectionlist.switchs.modellist[j].code].play(); + } + + rails.switchrail[code].locateType = '01'; + const testswitch = rails.switchrail[code]; + if (rails.switchrail[code].directtype == '1') { + // console.log("道岔朝向1向左"); + // console.log("aleft"+testswitch.blink); + // console.log("cright:"+testswitch.alink); + rails.linkrail[testswitch.alink].lconnect = testswitch.blink; + rails.linkrail[testswitch.blink].rconnect = testswitch.alink; + } else if (rails.switchrail[code].directtype == '2') { + // console.log("道岔朝向2向右"); + // console.log("aright:"+testswitch.blink); + // console.log("cleft:"+testswitch.alink); + rails.linkrail[testswitch.alink].rconnect = testswitch.blink; + rails.linkrail[testswitch.blink].lconnect = testswitch.alink; + } + + } + } + j = 0; + } + } + } } diff --git a/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js b/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js index 049c23a3e..616ac18be 100644 --- a/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js +++ b/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js @@ -1,7 +1,7 @@ import StompClient from '@/utils/sock'; import { displayTopic } from '@/utils/stomp'; import { getToken } from '@/utils/auth'; -import router from '@/router'; +import router from '@/router/index_APP_TARGET'; // 定于仿真socket接口 export function Jlmap3dSubscribe(worker,routegroup) { diff --git a/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue b/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue index 7f4caa8e5..ce4cec576 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue @@ -311,7 +311,7 @@ import { OperationEvent } from '@/scripts/ConstDic'; // import { now } from '@/utils/date'; import ConfirmTip from './childDialog/confirmTip'; import { sendCommand } from '@/api/jmap/training'; -import router from '@/router'; +import router from '@/router/index_APP_TARGET'; export default { name: 'SectionCmdSpeed', diff --git a/src/jmap/theme/chengdu_04/menus/dialog/speedCmdControl.vue b/src/jmap/theme/chengdu_04/menus/dialog/speedCmdControl.vue index 46caafc6b..51ef2250f 100644 --- a/src/jmap/theme/chengdu_04/menus/dialog/speedCmdControl.vue +++ b/src/jmap/theme/chengdu_04/menus/dialog/speedCmdControl.vue @@ -311,7 +311,7 @@ import { OperationEvent } from '@/scripts/ConstDic'; // import { now } from '@/utils/date'; import ConfirmTip from './childDialog/confirmTip'; import { sendCommand } from '@/api/jmap/training'; -import router from '@/router'; +import router from '@/router/index_APP_TARGET'; export default { name: 'SectionCmdSpeed', diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue index 88403ea4d..ab699a9eb 100644 --- a/src/layout/components/Logout.vue +++ b/src/layout/components/Logout.vue @@ -20,7 +20,7 @@ + + + + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 4e90ba429..fe927965e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -102,10 +102,9 @@ import QrcodeVue from 'qrcode.vue'; import { getLoginWmurl, checkLoginStatus } from '@/api/login'; import { LoginParams } from '@/utils/login'; import bgImg from '@/assets/bg1.jpg'; -import { loginInfo } from '@/scripts/ConstDic'; +import { loginInfo, UrlConfig } from '@/scripts/ConstDic'; import { removeToken } from '@/utils/auth'; import LangStorage from '@/utils/lang'; -import { UrlConfig } from '@/router/index'; import logoImgXty from '@/assets/logo_xty.png'; import logoImgGzb from '@/assets/logo_gzb.png'; import logoImgHyd from '@/assets/logo_hyd.png'; diff --git a/src/views/newMap/displayNew/LeftSlider.vue b/src/views/newMap/displayNew/LeftSlider.vue index 325dd9394..cd97ec8f2 100644 --- a/src/views/newMap/displayNew/LeftSlider.vue +++ b/src/views/newMap/displayNew/LeftSlider.vue @@ -39,7 +39,7 @@ import { getPublishLessonTree } from '@/api/jmap/lesson'; import { trainingNotifyNew } from '@/api/simulation'; import { launchFullscreen } from '@/utils/screen'; -import { UrlConfig } from '@/router/index'; +import { UrlConfig } from '@/scripts/ConstDic'; export default { name: 'LeftSlider', data() { diff --git a/src/views/newMap/displayNew/menuLesson.vue b/src/views/newMap/displayNew/menuLesson.vue index 8025e1ad2..be6d49fb9 100644 --- a/src/views/newMap/displayNew/menuLesson.vue +++ b/src/views/newMap/displayNew/menuLesson.vue @@ -30,7 +30,7 @@ import { startTrainingNew, endTrainingNew } from '@/api/jmap/training'; import { trainingNotifyNew } from '@/api/simulation'; import { TrainingMode } from '@/scripts/ConstDic'; import { timeFormat } from '@/utils/date'; -import { UrlConfig } from '@/router/index'; +import { UrlConfig } from '@/scripts/ConstDic'; export default { name: 'MenuLesson', diff --git a/src/views/newMap/newDesignUser/demonList.vue b/src/views/newMap/newDesignUser/demonList.vue index 868856f8f..92f0fc4df 100644 --- a/src/views/newMap/newDesignUser/demonList.vue +++ b/src/views/newMap/newDesignUser/demonList.vue @@ -34,7 +34,7 @@