Merge remote-tracking branch 'origin/test'

This commit is contained in:
joylink_zhangsai 2021-06-01 18:28:45 +08:00
commit 82d9118a70
106 changed files with 11991 additions and 1478 deletions

View File

@ -484,18 +484,20 @@ export function postFlankProtection(data) {
}
// 更新进路侧防数据
export function putFlankProtection(data) {
export function putFlankProtection(mapId, data) {
return request({
url: `/api/draftMap/flankProtection/${data.id}`,
// url: `/api/draftMap/flankProtection/${data.id}`,
url: `/api/draftMap/${mapId}/fls/${data.code}`,
method: 'put',
data
});
}
// 删除进路侧防
export function delFlankProtection(id) {
export function delFlankProtection(mapId, code) {
return request({
url: `/api/draftMap/flankProtection/${id}`,
// url: `/api/draftMap/flankProtection/${id}`,
url: `/api/draftMap/${mapId}/fls/${code}`,
method: 'delete'
});
}
@ -511,11 +513,19 @@ export function getFlankProtectionDetail(id) {
// 查询进路侧防明细list
export function getFlankProtectionList(mapId, params) {
return request({
url: `/api/draftMap/flankProtection/${mapId}/paging`,
// url: `/api/draftMap/flankProtection/${mapId}/paging`,
url: `/api/draftMap/${mapId}/fls/paging`,
method: 'get',
params
});
}
// 查询进路侧防明细list
export function getDraftMapFlsList(mapId) {
return request({
url: `/api/draftMap/${mapId}/fls/all`,
method: 'get'
});
}
// /** 创建车站区段停站时间 */
// export function createStationParkTime(data) {
// return request({

View File

@ -1,6 +1,6 @@
<template>
<div v-if="show" class="pop-menu" :class="popMenuClass" :style="{ left: tPosition.x+'px', top: tPosition.y+'px' }">
<pop-menu-item v-for="(option, i) in menu" :key="i" :option="option" :pop-class="popClass" :allowedColor="allowedColor" :disabledColor="disabledColor" @close="close" />
<pop-menu-item v-for="(option, i) in menu" :key="i" :option="option" :pop-class="popClass" :allowed-color="allowedColor" :disabled-color="disabledColor" @close="close" />
</div>
</template>
@ -30,14 +30,14 @@ export default {
return '';
}
},
allowedColor: {
type: String,
default: '#000'
},
allowedColor: {
type: String,
default: '#000'
},
disabledColor: {
type: String,
default: '#ccc'
}
type: String,
default: '#ccc'
}
},
data() {
return {
@ -139,5 +139,6 @@ $item-border: #909399;
margin: 0px;
z-index: 9999;
border: 1px solid $item-border;
overflow: visible !important;
}
</style>

View File

@ -379,7 +379,9 @@ export default {
// this.pageIndex = 1;
this.queryData[this.currentpagerConfig.pageSize] = this.pageSize;
this.queryData[this.currentpagerConfig.pageIndex] = this.pageIndex;
this.queryList.reload();
// this.queryList.reload();
this.choose = null;
this.commitQuery();
},
//
queryExport(queryData) {
@ -455,7 +457,10 @@ export default {
}
//
// this.queryData._time = this.$moment()._d.getTime();
this.queryList.reload();
// this.queryList.reload();
this.choose = null;
this.commitQuery();
},
/**
* 改变分页大小回调函数执行完毕后iview会自动触发changePage事件去查第一页数据

View File

@ -36,7 +36,6 @@ export function deviceFactory(type, elem) {
export function parser(data) {
var ibpDevice = {};
if (data) {
Object.assign(data.background);
ibpDevice[data.background.code] = deviceFactory(deviceType.Background, data.background);
store.dispatch('ibp/setIbpBgDevice', ibpDevice[data.background.code]);
zrUtil.each(data.textList || [], elem => {

View File

@ -113,29 +113,32 @@ export function initDataSave(data) {
postmap.signals = JSON.stringify(signals);
//车站
let stands = [];
for(let i=0;i<data.mapdata.stationstandlist.list.length;i++){
let station = {
// uuid:data.mapdata.stationstandlist.list[i].uuid,
code:data.mapdata.stationstandlist.list[i].code,
name:data.mapdata.stationstandlist.list[i].name,
// modelid:data.mapdata.stationstandlist.list[i].modelid,
position:data.mapdata.stationstandlist.list[i].mesh.position,
rotation:data.mapdata.stationstandlist.list[i].mesh.rotation,
scale:data.mapdata.stationstandlist.list[i].mesh.scale,
inside:data.mapdata.stationstandlist.list[i].inside,
stands:data.mapdata.stationstandlist.list[i].stands,
// direction1:{
// name:data.mapdata.stationstandlist.list[i].direction1.name,
// code:data.mapdata.stationstandlist.list[i].direction1.code
// },
// direction2:{
// name:data.mapdata.stationstandlist.list[i].direction2.name,
// code:data.mapdata.stationstandlist.list[i].direction2.code
// }
console.log(data.mapdata.stationstandlist);
if(data.mapdata.stationstandlist){
for(let i=0;i<data.mapdata.stationstandlist.list.length;i++){
let station = {
// uuid:data.mapdata.stationstandlist.list[i].uuid,
code:data.mapdata.stationstandlist.list[i].code,
name:data.mapdata.stationstandlist.list[i].name,
// modelid:data.mapdata.stationstandlist.list[i].modelid,
position:data.mapdata.stationstandlist.list[i].mesh.position,
rotation:data.mapdata.stationstandlist.list[i].mesh.rotation,
scale:data.mapdata.stationstandlist.list[i].mesh.scale,
inside:data.mapdata.stationstandlist.list[i].inside,
stands:data.mapdata.stationstandlist.list[i].stands,
// direction1:{
// name:data.mapdata.stationstandlist.list[i].direction1.name,
// code:data.mapdata.stationstandlist.list[i].direction1.code
// },
// direction2:{
// name:data.mapdata.stationstandlist.list[i].direction2.name,
// code:data.mapdata.stationstandlist.list[i].direction2.code
// }
}
stands.push(station);
}
stands.push(station);
}
postmap.stands = JSON.stringify(stands);
//列车
let trains = [];

View File

@ -144,29 +144,31 @@ export function specilDataSave(data) {
postmap.signals = JSON.stringify(signals);
//车站
let stands = [];
for(let i=0;i<data.mapdata.stationstandlist.list.length;i++){
let station = {
// uuid:data.mapdata.stationstandlist.list[i].uuid,
code:data.mapdata.stationstandlist.list[i].code,
name:data.mapdata.stationstandlist.list[i].name,
// modelid:data.mapdata.stationstandlist.list[i].modelid,
position:data.mapdata.stationstandlist.list[i].mesh.position,
rotation:data.mapdata.stationstandlist.list[i].mesh.rotation,
scale:data.mapdata.stationstandlist.list[i].mesh.scale,
inside:data.mapdata.stationstandlist.list[i].inside,
stands:data.mapdata.stationstandlist.list[i].stands,
// direction1:{
// name:data.mapdata.stationstandlist.list[i].direction1.name,
// code:data.mapdata.stationstandlist.list[i].direction1.code
// },
// direction2:{
// name:data.mapdata.stationstandlist.list[i].direction2.name,
// code:data.mapdata.stationstandlist.list[i].direction2.code
// }
if(data.mapdata.stationstandlist){
for(let i=0;i<data.mapdata.stationstandlist.list.length;i++){
let station = {
// uuid:data.mapdata.stationstandlist.list[i].uuid,
code:data.mapdata.stationstandlist.list[i].code,
name:data.mapdata.stationstandlist.list[i].name,
// modelid:data.mapdata.stationstandlist.list[i].modelid,
position:data.mapdata.stationstandlist.list[i].mesh.position,
rotation:data.mapdata.stationstandlist.list[i].mesh.rotation,
scale:data.mapdata.stationstandlist.list[i].mesh.scale,
inside:data.mapdata.stationstandlist.list[i].inside,
stands:data.mapdata.stationstandlist.list[i].stands,
// direction1:{
// name:data.mapdata.stationstandlist.list[i].direction1.name,
// code:data.mapdata.stationstandlist.list[i].direction1.code
// },
// direction2:{
// name:data.mapdata.stationstandlist.list[i].direction2.name,
// code:data.mapdata.stationstandlist.list[i].direction2.code
// }
}
stands.push(station);
}
stands.push(station);
}
postmap.stands = JSON.stringify(stands);
//列车
let trains = [];

View File

@ -9,6 +9,10 @@ import {StationStandList} from '@/jlmap3d/edit/testEditorModel/StationStandList.
import {SwitchList} from '@/jlmap3d/edit/testEditorModel/SwitchList.js';
import {RailList} from '@/jlmap3d/edit/testEditorModel/RailList.js';
import {rSectionList} from '@/jlmap3d/edit/railwayModel/rSectionList.js';
import {rSignalList} from '@/jlmap3d/edit/railwayModel/rSignalList.js';
import {rSwitchList} from '@/jlmap3d/edit/railwayModel/rSwitchList.js';
import axios from 'axios';
import { Loading } from 'element-ui';
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
@ -23,6 +27,7 @@ export function jl3dEditorLoader(mapid,scope){
get3dMapData(editmapid).then(data => {
if(data.data ){
console.log(data);
if(data.data.assets){
// initData(editmapid,data.data.id);
loadData(editmapid,data.data);
@ -58,39 +63,65 @@ export function jl3dEditorLoader(mapid,scope){
jlmap3ddata.id = data3did;
jlmap3ddata.mapId = mapid;
// //初始化站台
jlmap3ddata.stationstandlist = new StationStandList();
//初始化轨道和道岔 暂时
jlmap3ddata.sectionlist = new SectionList();
if(mapdata.skinVO.name == "大铁线路"){
jlmap3ddata.sectionlist = new rSectionList();
jlmap3ddata.signallist = new SignalList();
jlmap3ddata.signallist = new rSignalList();
jlmap3ddata.switchlist = new SwitchList();
//
jlmap3ddata.raillist = new RailList();
jlmap3ddata.raillist.setrail();
jlmap3ddata.switchlist = new rSwitchList();
assetloader.assetinit(scene)
.then(function(data){
//console.log(data);
return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
})
.then(function(data){
//console.log(data);
return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
})
.then(function(data){
return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
})
.then(function(data){
//console.log(data);
loadingInstance.close();
});
}else{
// //初始化站台
jlmap3ddata.stationstandlist = new StationStandList();
//初始化轨道和道岔 暂时
jlmap3ddata.sectionlist = new SectionList();
jlmap3ddata.signallist = new SignalList();
jlmap3ddata.switchlist = new SwitchList();
//
jlmap3ddata.raillist = new RailList();
jlmap3ddata.raillist.setrail();
assetloader.assetinit(scene)
.then(function(data){
//console.log(data);
return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
})
.then(function(data){
//console.log(data);
return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
})
.then(function(data){
//console.log(data);
return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
})
.then(function(data){
return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
})
.then(function(data){
//console.log(data);
loadingInstance.close();
});
}
assetloader.assetinit(scene)
.then(function(data){
//console.log(data);
return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
})
.then(function(data){
//console.log(data);
return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
})
.then(function(data){
//console.log(data);
return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
})
.then(function(data){
return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
})
.then(function(data){
//console.log(data);
loadingInstance.close();
});
//初始化信号
//SetObj(mapdata,scope);
@ -104,58 +135,21 @@ export function jl3dEditorLoader(mapid,scope){
jlmap3ddata.mapId = mapid;
let mapdata = data.data;
// //初始化站台
jlmap3ddata.stationstandlist = new StationStandList();
//初始化轨道和道岔 暂时
jlmap3ddata.sectionlist = new SectionList();
if(mapdata.skinVO.name == "大铁线路"){
jlmap3ddata.sectionlist = new rSectionList();
jlmap3ddata.signallist = new SignalList();
jlmap3ddata.signallist = new rSignalList();
jlmap3ddata.switchlist = new SwitchList();
jlmap3ddata.switchlist = new rSwitchList();
jlmap3ddata.raillist = new RailList();
console.log(netdata);
let sectiondata = JSON.parse(netdata.sections);
let switchdata = JSON.parse(netdata.switchs);
let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands);
jlmap3dasset = JSON.parse(netdata.assets);
let sectiondata = JSON.parse(netdata.sections);
let switchdata = JSON.parse(netdata.switchs);
let signaldata = JSON.parse(netdata.signals);
jlmap3dasset = JSON.parse(netdata.assets);
if(jlmap3dasset.sceneAssetList == undefined){
// loadEditAllAsset(jlmap3dasset);
assetloader.setmodellistnew(netdata.assets,5);
assetloader.assetpromise(scene)
.then(function(data){
// return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata.stationStandList,scene,assetloader);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,scene);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList);
})
.then(function(data){
// return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
return jlmap3ddata.switchlist.loadpromise(jlmap3ddata,switchdata,scene,assetloader);
})
.then(function(data){
//console.log(data);
loadingInstance.close();
});
}else{
loadEditAllAsset(jlmap3dasset);
assetloader.setModelListOver(jlmap3dasset.sceneAssetList,5,jlmap3dasset.others);
assetloader.assetPromiseOver(scene)
.then(function(data){
// return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata,scene,assetloader,jlmap3dasset.others);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
@ -174,9 +168,82 @@ export function jl3dEditorLoader(mapid,scope){
//console.log(data);
loadingInstance.close();
});
}else{
// //初始化站台
jlmap3ddata.stationstandlist = new StationStandList();
//初始化轨道和道岔 暂时
jlmap3ddata.sectionlist = new SectionList();
jlmap3ddata.signallist = new SignalList();
jlmap3ddata.switchlist = new SwitchList();
jlmap3ddata.raillist = new RailList();
console.log(netdata);
let sectiondata = JSON.parse(netdata.sections);
let switchdata = JSON.parse(netdata.switchs);
let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands);
jlmap3dasset = JSON.parse(netdata.assets);
if(jlmap3dasset.sceneAssetList == undefined){
// loadEditAllAsset(jlmap3dasset);
assetloader.setmodellistnew(netdata.assets,5);
assetloader.assetpromise(scene)
.then(function(data){
// return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata.stationStandList,scene,assetloader);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,scene);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList);
})
.then(function(data){
// return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
return jlmap3ddata.switchlist.loadpromise(jlmap3ddata,switchdata,scene,assetloader);
})
.then(function(data){
//console.log(data);
loadingInstance.close();
});
}else{
loadEditAllAsset(jlmap3dasset);
assetloader.setModelListOver(jlmap3dasset.sceneAssetList,5,jlmap3dasset.others);
assetloader.assetPromiseOver(scene)
.then(function(data){
// return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata,scene,assetloader,jlmap3dasset.others);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,mapdata.sectionList,mapdata.switchList,scene);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList);
})
.then(function(data){
// return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
return jlmap3ddata.switchlist.loadpromise(jlmap3ddata,switchdata,scene,assetloader);
})
.then(function(data){
//console.log(data);
loadingInstance.close();
});
}
}
});
}

View File

@ -188,9 +188,12 @@ export function JLmap3dEdit(dom, data, mapid) {
// let exportmodels = scope.mapdata.stationstandlist.group;
let exportSectionModel = scope.mapdata.sectionlist.sectiongroup;
objDownload("section",exporter.parse( exportSectionModel ));
if(scope.mapdata.stationstandlist){
let exportStationModel = scope.mapdata.stationstandlist.group;
objDownload("station",exporter.parse( exportStationModel ));
}
let exportStationModel = scope.mapdata.stationstandlist.group;
objDownload("station",exporter.parse( exportStationModel ));
}

View File

@ -0,0 +1,846 @@
import {SectionModel} from '@/jlmap3d/edit/testEditorModel/SectionModel.js';
import {SwitchModel} from '@/jlmap3d/edit/testEditorModel/SwitchModel.js';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export function rSectionList() {
let scope = this;
this.type = "sectionlist";
this.sectiongroup = new THREE.Group();
this.sectiongroup.name = "section";
this.sections = {
datalist:[],
modellist:[]
};
this.stopsection = [];
this.standtrack = [];
var autorail;
var color = new THREE.Color(0xFF0000);
var colorArray = new Float32Array([Math.random(),Math.random(),Math.random()]);
this.initpromise = function(jlmap3ddata,assetloader,sectiondata,switchdata,scene){
var texture = new THREE.TextureLoader().load( JL3D_LOCAL_STATIC+'/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1);
var selectmaterial = new THREE.MeshPhongMaterial( { map: texture,transparent:true,alphaTest:0.1 } );
scene.add(scope.sectiongroup);
return new Promise(function(resolve, reject){
//收集需要显示区段
for(let i=0;i<sectiondata.length;i++){
if(sectiondata[i].type == "01" || sectiondata[i].type == "03"){
//初始化区段对象数据
let newsection = new SectionModel(sectiondata[i]);
// console.log(sectiondata[i]);
newsection.name = sectiondata[i].name;
newsection.code = sectiondata[i].code;
newsection.index = i;
newsection.type = sectiondata[i].type;
newsection.lengthFact = sectiondata[i].lengthFact;
newsection.stationcode = sectiondata[i].stationCode;
newsection.rsection = sectiondata[i].rightSectionCode;
newsection.lsection = sectiondata[i].leftSectionCode;
newsection.points = sectiondata[i].points;
newsection.pointslength = sectiondata[i].points.length-1;
newsection.railpoint = [];
// console.log(sectiondata[i].points.length);
newsection.standTrack = sectiondata[i].standTrack;
newsection.endbuild = false;
newsection.rp = {
x:0,
y:0,
z:0
};
newsection.lp = {
x:0,
y:0,
z:0
};
scope.sections.datalist[sectiondata[i].code] = newsection;
// sections.modellist.push("");
}
}
//连接区段
for(let i=0;i<switchdata.length;i++){
let acode = switchdata[i].sectionACode;
let bcode = switchdata[i].sectionBCode;
let ccode = switchdata[i].sectionCCode;
// console.log(switchdata[i]);
let aposx = (scope.sections.datalist[acode].points[0].x + scope.sections.datalist[acode].points[scope.sections.datalist[acode].pointslength].x)/2;
let cposx = (scope.sections.datalist[ccode].points[0].x + scope.sections.datalist[ccode].points[scope.sections.datalist[ccode].pointslength].x)/2;
let aposy = (scope.sections.datalist[acode].points[0].y + scope.sections.datalist[acode].points[scope.sections.datalist[acode].pointslength].y)/2;
let cposy = (scope.sections.datalist[ccode].points[0].y + scope.sections.datalist[ccode].points[scope.sections.datalist[ccode].pointslength].y)/2;
// console.log("----------------");
if(aposx > cposx){
if(aposy < cposy){
// ——A
// /C
scope.sections.datalist[ccode].ctype = 1;
}else{
// \C
// ——A
scope.sections.datalist[ccode].ctype = 2;
}
}else{
if(aposy < cposy){
// A——
// \C
scope.sections.datalist[ccode].ctype = 3;
}else{
// /C
// A——
scope.sections.datalist[ccode].ctype = 4;
}
}
scope.sections.datalist[acode].csection = ccode;
if(scope.sections.datalist[ccode].ctype == 1 || scope.sections.datalist[ccode].ctype == 2){
if(scope.sections.datalist[acode].lsection == "" || scope.sections.datalist[acode].lsection == undefined){
scope.sections.datalist[acode].lsection = bcode;
}
if(scope.sections.datalist[bcode].rsection == "" || scope.sections.datalist[bcode].rsection == undefined){
scope.sections.datalist[bcode].rsection = acode;
}
if(scope.sections.datalist[ccode].rsection == "" || scope.sections.datalist[ccode].rsection == undefined){
scope.sections.datalist[ccode].rsection = acode;
}else if(scope.sections.datalist[ccode].lsection == "" || scope.sections.datalist[ccode].lsection == undefined){
scope.sections.datalist[ccode].lsection = acode;
}
}
if(scope.sections.datalist[ccode].ctype == 3 || scope.sections.datalist[ccode].ctype == 4){
if(scope.sections.datalist[acode].rsection == "" || scope.sections.datalist[acode].rsection == undefined){
scope.sections.datalist[acode].rsection = bcode;
}
if(scope.sections.datalist[bcode].lsection == "" ||scope.sections.datalist[bcode].lsection == undefined ){
scope.sections.datalist[bcode].lsection = acode;
}
if(scope.sections.datalist[ccode].rsection == "" || scope.sections.datalist[ccode].rsection == undefined){
scope.sections.datalist[ccode].rsection = acode;
}else if(scope.sections.datalist[ccode].lsection == "" || scope.sections.datalist[ccode].lsection == undefined){
scope.sections.datalist[ccode].lsection = acode;
}
}
}
scope.sections.datalist["T1"].railpoint.push({
x:0,
y:0,
z:0
});
scope.sections.datalist["T1"].railpoint.push({
x:50,
y:0,
z:0
});
scope.sections.datalist["T1"].railpoint.push({
x:100,
y:0,
z:0
});
console.log(scope.sections.datalist);
console.log("START BUILD !!!!!!!!!!!!!!!!!");
buildsectionall(scope.sections.datalist["T1"]);
resolve("loadersection");
});
};
function createsection(origin,position,start,py){
var texture = new THREE.TextureLoader().load( JL3D_LOCAL_STATIC+'/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1);
var selectmaterial = new THREE.MeshPhongMaterial( { map: texture,transparent:true,alphaTest:0.1 } );
position.z = py;
let len = scope.sections.datalist[start].lengthFact;
let height = Math.random()/1000;
scope.sections.datalist[start].railpoint = [
new THREE.Vector3(position.x,height,position.z),
new THREE.Vector3(position.x+0.5,height,position.z+0.0001),
new THREE.Vector3(position.x+len,height,position.z),
];
let closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(position.x,height,position.z),
new THREE.Vector3(position.x+0.5,height,position.z+0.0001),
new THREE.Vector3(position.x+len,height,position.z),
] );
closedSpline.type = 'catmullrom';
closedSpline.closed = false;
var extrudeSettings = {
steps : 5,
curveSegments : 1,
bevelSegments : 1,
bevelEnabled : false,
extrudePath : closedSpline,
};
var shape = new THREE.Shape();
shape.moveTo( 0,-2 );
shape.lineTo( 0, 2 );
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
var randomMaterail = new THREE.MeshLambertMaterial({
//color:color.fromArray(colorArray)
color:0xFFFFFF*Math.random()
})
let testmesh2;
if(scope.sections.datalist[start].standTrack == false){
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
}else{
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
}
// closedSpline.arcLengthDivisions;
let count = testmesh2.geometry.attributes.position.count/3;
for(let i=0;i<count;i++){
let ui=i*6;
if(i%2 != 0){
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 1;
testmesh2.geometry.attributes.uv.array[ui+2] = len/5;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}else{
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 0;
testmesh2.geometry.attributes.uv.array[ui+2] = 0;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}
}
testmesh2.code = start;
testmesh2.railpoint = scope.sections.datalist[start].railpoint;
testmesh2.lengthFact = scope.sections.datalist[start].railpoint.lengthFact;
scope.sections.datalist[start].mesh = testmesh2;
scope.sectiongroup.add( testmesh2 );
let topstartpoint = {
x:position.x+scope.sections.datalist[start].lengthFact,
y:0,
z:position.z
};
// console.log(origin+"******************************");
// console.log(start);
// console.log(origin);
if(scope.sections.datalist[start].standTrack == true && start != origin){
// console.log(start+"到达");
// console.log("++++++++++++++++++++++++");
return ;
}else if(scope.sections.datalist[start].rsection == undefined){
return ;
}else{
return createsection(origin,topstartpoint,scope.sections.datalist[start].rsection,py);
}
}
function findnextsection(findarray,start){
if(start == undefined){
return findarray;
}
if(scope.sections.datalist[start].rsection == undefined){
return null;
}
if(scope.sections.datalist[start].standTrack == true){
findarray.endSection = scope.sections.datalist[start];
return findarray;
}else{
findarray.sectionArrays.push(scope.sections.datalist[start]);
findarray.distance = findarray.distance + scope.sections.datalist[start].lengthFact;
return findnextsection(findarray,scope.sections.datalist[start].rsection);
// }
}
}
function compare(property){
return function(a,b){
var value1 = a[property];
var value2 = b[property];
return value1 - value2;
}
}
function buildsectionall(origin){
if(origin.rsection){
if(scope.sections.datalist[origin.rsection].endbuild == false){
scope.sections.datalist[origin.rsection].endbuild = true;
if(scope.sections.datalist[origin.rsection].mesh == null){
buildsection(origin,scope.sections.datalist[origin.rsection],"right");
buildsectionall(scope.sections.datalist[origin.rsection]);
}else{
buildsectionall(scope.sections.datalist[origin.rsection]);
}
}
}
if(origin.lsection){
if(scope.sections.datalist[origin.lsection].endbuild == false){
scope.sections.datalist[origin.lsection].endbuild = true;
if(scope.sections.datalist[origin.lsection].mesh == null){
buildsection(origin,scope.sections.datalist[origin.lsection],"left");
buildsectionall(scope.sections.datalist[origin.lsection]);
}else{
buildsectionall(scope.sections.datalist[origin.lsection]);
}
}
}
if(origin.csection){
if(scope.sections.datalist[origin.csection].endbuild == false){
scope.sections.datalist[origin.csection].endbuild = true;
if(scope.sections.datalist[origin.csection].mesh == null){
buildsection(origin,scope.sections.datalist[origin.csection],"cross");
buildsectionall(scope.sections.datalist[origin.csection]);
}else{
buildsectionall(scope.sections.datalist[origin.csection]);
}
}
}
// return ;
}
function buildsection(origin,data,type){
let len = data.lengthFact;
let height = Math.random()/1000;
var closedSpline;
let initRotation;
if(data.points[0].x == data.points[data.pointslength].x && data.points[0].y == data.points[data.pointslength].y){
}else{
if(type == "right"){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
data.rp.x = (data.points[data.pointslength].x-data.points[0].x)*data.lengthFact/distance+origin.railpoint[2].x;
data.rp.z = (data.points[data.pointslength].y-data.points[0].y)*data.lengthFact/distance+origin.railpoint[2].z;
data.lp.x = origin.railpoint[2].x;
data.lp.z = origin.railpoint[2].z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
initRotation = 0.2678;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(initRotation);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(initRotation);
}else if(data.points[0].y<data.points[data.pointslength].y){
initRotation = -0.2678;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(initRotation);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(initRotation);
}else{
data.rp.z = data.lp.z;
}
closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(data.lp.x,0,data.lp.z),
new THREE.Vector3((data.lp.x+data.rp.x)/2,0,(data.lp.z+data.rp.z)/2-0.001),
new THREE.Vector3(data.rp.x,0,data.rp.z),
] );
data.railpoint = [
new THREE.Vector3(data.lp.x,0,data.lp.z),
new THREE.Vector3((data.lp.x+data.rp.x)/2,0,(data.lp.z+data.rp.z)/2-0.001),
new THREE.Vector3(data.rp.x,0,data.rp.z),
];
}
if(type == "left"){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
data.lp.x = (data.points[0].x-data.points[data.pointslength].x)*data.lengthFact/distance+origin.railpoint[0].x;
data.lp.z = (data.points[0].y-data.points[data.pointslength].y)*data.lengthFact/distance+origin.railpoint[0].z;
data.rp.x = origin.railpoint[0].x;
data.rp.z = origin.railpoint[0].z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
initRotation = 0.2678;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(initRotation);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(initRotation);
}else if(data.points[0].y<data.points[data.pointslength].y){
initRotation = -0.2678;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(initRotation);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(initRotation);
}else{
data.lp.z = data.rp.z;
}
closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(data.lp.x,0,data.lp.z),
new THREE.Vector3((data.lp.x+data.rp.x)/2,0,(data.lp.z+data.rp.z)/2-0.001),
new THREE.Vector3(data.rp.x,0,data.rp.z),
] );
data.railpoint = [
new THREE.Vector3(data.lp.x,0,data.lp.z),
new THREE.Vector3((data.lp.x+data.rp.x)/2,0,(data.lp.z+data.rp.z)/2-0.001),
new THREE.Vector3(data.rp.x,0,data.rp.z),
];
}
// console.log(data.ctype);
if(type == "cross"){
// console.log(data.ctype);
// console.log(scope.sections.datalist[data.code].points.length);
// console.log(scope.sections.datalist[data.code]);
if(data.ctype == "1"||data.ctype == "2" ){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
data.lp.x = (data.points[0].x-data.points[data.pointslength].x)*data.lengthFact/distance+origin.railpoint[0].x;
data.lp.z = (data.points[0].y-data.points[data.pointslength].y)*data.lengthFact/distance+origin.railpoint[0].z;
data.rp.x = origin.railpoint[0].x;
data.rp.z = origin.railpoint[0].z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
initRotation = 0.2678;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(initRotation);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(initRotation);
}else if(data.points[0].y<data.points[data.pointslength].y){
initRotation = -0.2678;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(initRotation);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(initRotation);
}else{
data.lp.z = data.rp.z;
}
}
if(data.ctype == "3" || data.ctype == "4"){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
data.rp.x = (data.points[data.pointslength].x-data.points[0].x)*data.lengthFact/distance+origin.railpoint[2].x;
data.rp.z = (data.points[data.pointslength].y-data.points[0].y)*data.lengthFact/distance+origin.railpoint[2].z;
data.lp.x = origin.railpoint[2].x;
data.lp.z = origin.railpoint[2].z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
initRotation = 0.2678;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(initRotation);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(initRotation);
}else if(data.points[0].y<data.points[data.pointslength].y){
initRotation = -0.2678;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(initRotation);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(initRotation);
}else{
data.lp.z = data.rp.z;
}
}
closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(data.lp.x,0,data.lp.z),
new THREE.Vector3((data.lp.x+data.rp.x)/2,0,(data.lp.z+data.rp.z)/2-0.001),
new THREE.Vector3(data.rp.x,0,data.rp.z),
] );
data.railpoint = [
new THREE.Vector3(data.lp.x,0,data.lp.z),
new THREE.Vector3((data.lp.x+data.rp.x)/2,0,(data.lp.z+data.rp.z)/2-0.001),
new THREE.Vector3(data.rp.x,0,data.rp.z),
];
}
closedSpline.type = 'catmullrom';
closedSpline.closed = false;
var extrudeSettings = {
steps : 5,
curveSegments : 1,
bevelSegments : 1,
bevelEnabled : false,
extrudePath : closedSpline,
};
var shape = new THREE.Shape();
shape.moveTo( 0,-2 );
shape.lineTo( 0, 2 );
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
var randomMaterail = new THREE.MeshLambertMaterial({
//color:color.fromArray(colorArray)
color:0xFFFFFF*Math.random()
})
let testmesh2 = new THREE.Mesh( geometry, randomMaterail );
testmesh2.railpoint = data.railpoint;
testmesh2.lengthFact = data.lengthFact;
// closedSpline.arcLengthDivisions;
let count = testmesh2.geometry.attributes.position.count/3;
for(let i=0;i<count;i++){
let ui=i*6;
if(i%2 != 0){
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 1;
testmesh2.geometry.attributes.uv.array[ui+2] = len/5;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}else{
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 0;
testmesh2.geometry.attributes.uv.array[ui+2] = 0;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}
}
testmesh2.code = data.code;
testmesh2.lengthFact = data.lengthFact;
scope.sectiongroup.add( testmesh2 );
data.mesh = testmesh2;
}
}
this.loadpromise = function(jlmap3ddata,assetloader,sectiondata,section2d,switch2d,scene){
var texture = new THREE.TextureLoader().load( JL3D_LOCAL_STATIC+'/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1);
var selectmaterial = new THREE.MeshPhongMaterial( { map: texture,transparent:true,alphaTest:0.1 } );
scene.add(scope.sectiongroup);
return new Promise(function(resolve, reject){
for(let i=0,leni = sectiondata.length;i<leni;i++){
let newsection = {
code:sectiondata[i].code,
name:sectiondata[i].name,
standTrack:sectiondata[i].standTrack,
// rail:sectiondata[i].rail,
lengthFact:sectiondata[i].lengthFact,
// rp:sectiondata[i].rp,
// lp:sectiondata[i].lp,
railpoint:sectiondata[i].railpoint,
mesh:null
};
let testmesh2 = null;
if(newsection.railpoint.length>2){
let height = Math.random()/1000;
var closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z),
new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[1].y,newsection.railpoint[1].z+0.0001),
new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z)
] );
closedSpline.type = 'catmullrom';
closedSpline.closed = false;
var extrudeSettings = {
steps : 5,
curveSegments : 1,
bevelSegments : 1,
bevelEnabled : false,
extrudePath : closedSpline,
};
var shape = new THREE.Shape();
if(newsection.railpoint[0].y != newsection.railpoint[2].y){
shape.moveTo( -2, 0 );
shape.lineTo( 2, 0 );
}else{
shape.moveTo( 0,-2 );
shape.lineTo( 0, 2 );
}
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
var randomMaterail = new THREE.MeshLambertMaterial({
//color:color.fromArray(colorArray)
color:0xFFFFFF*Math.random()
});
if(newsection.standTrack == false){
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
}else{
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
}
testmesh2.railpoint = [
{x:newsection.railpoint[0].x,y:newsection.railpoint[0].y,z:newsection.railpoint[0].z},
{x:newsection.railpoint[1].x,y:newsection.railpoint[1].y,z:newsection.railpoint[1].z},
{x:newsection.railpoint[2].x,y:newsection.railpoint[2].y,z:newsection.railpoint[2].z},
];
testmesh2.lengthFact = newsection.railpoint[2].x-newsection.railpoint[0].x;
let len = testmesh2.lengthFact;
// testmesh2.lengthFact = newsection.lengthFact;
// let len = newsection.lengthFact;
// closedSpline.arcLengthDivisions;
let count = testmesh2.geometry.attributes.position.count/3;
for(let i=0;i<count;i++){
let ui=i*6;
if(i%2 != 0){
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 1;
testmesh2.geometry.attributes.uv.array[ui+2] = len/5;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}else{
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 0;
testmesh2.geometry.attributes.uv.array[ui+2] = 0;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}
}
if(testmesh2){
testmesh2.code = newsection.code;
testmesh2.standTrack = newsection.standTrack;
testmesh2.meshtype = "section";
// testmesh2.geometry.computeBoundingBox();
// testmesh2.geometry.center()
// testmesh2.position.set(sectiondata[i].position.x,sectiondata[i].position.y,sectiondata[i].position.z);
scope.sectiongroup.add(testmesh2);
newsection.mesh = testmesh2;
scope.sections.datalist[newsection.code] = newsection;
}
}else{
let height = Math.random()/1000;
var closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z),
new THREE.Vector3((newsection.railpoint[0].x+newsection.railpoint[1].x)/2,height,newsection.railpoint[0].z+0.0001),
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[1].z)
] );
closedSpline.type = 'catmullrom';
closedSpline.closed = false;
var extrudeSettings = {
steps : 5,
curveSegments : 1,
bevelSegments : 1,
bevelEnabled : false,
extrudePath : closedSpline,
};
var shape = new THREE.Shape();
shape.moveTo( 0,-2 );
shape.lineTo( 0, 2 );
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
var randomMaterail = new THREE.MeshLambertMaterial({
//color:color.fromArray(colorArray)
color:0xFFFFFF*Math.random()
});
if(newsection.standTrack == false){
testmesh2 = new THREE.Mesh( geometry, randomMaterail );
}else{
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
}
testmesh2.railpoint = [
{x:newsection.railpoint[0].x,y:height,z:newsection.railpoint[0].z},
{x:(newsection.railpoint[0].x+newsection.railpoint[1].x)/2,y:height,z:newsection.railpoint[1].z},
{x:newsection.railpoint[1].x,y:height,z:newsection.railpoint[1].z},
];
testmesh2.lengthFact = newsection.railpoint[1].x-newsection.railpoint[0].x;
let len = testmesh2.lengthFact;
// closedSpline.arcLengthDivisions;
let count = testmesh2.geometry.attributes.position.count/3;
for(let i=0;i<count;i++){
let ui=i*6;
if(i%2 != 0){
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 1;
testmesh2.geometry.attributes.uv.array[ui+2] = len/5;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}else{
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 0;
testmesh2.geometry.attributes.uv.array[ui+2] = 0;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}
}
if(testmesh2){
testmesh2.code = newsection.code;
testmesh2.standTrack = newsection.standTrack;
testmesh2.meshtype = "section";
// testmesh2.geometry.computeBoundingBox();
// testmesh2.geometry.center()
// testmesh2.position.set(sectiondata[i].position.x,sectiondata[i].position.y,sectiondata[i].position.z);
scope.sectiongroup.add(testmesh2);
newsection.mesh = testmesh2;
scope.sections.datalist[newsection.code] = newsection;
}
}
}
for(let i=0;i<section2d.length;i++){
if(section2d[i].type == "01" || section2d[i].type == "03"){
if(scope.sections.datalist[section2d[i].code]){
scope.sections.datalist[section2d[i].code].rsection = section2d[i].rightSectionCode;
scope.sections.datalist[section2d[i].code].lsection = section2d[i].leftSectionCode;
scope.sections.datalist[section2d[i].code].points = section2d[i].points;
scope.sections.datalist[section2d[i].code].pointslength = section2d[i].points.length-1;
if(section2d[i].standTrack == true){
scope.sections.datalist[section2d[i].code].standLeftX = section2d[i].points[0].x;
scope.sections.datalist[section2d[i].code].standLeftY = section2d[i].points[0].y;
scope.sections.datalist[section2d[i].code].standRightLeftX = section2d[i].points[1].x;
scope.sections.datalist[section2d[i].code].standRightRightY = section2d[i].points[1].y;
scope.sections.datalist[section2d[i].code].leftStopPointOffset = section2d[i].leftStopPointOffset;
scope.sections.datalist[section2d[i].code].rightStopPointOffset = section2d[i].leftStopPointOffset+120;
scope.sections.datalist[section2d[i].code].leftStopPercent = section2d[i].leftStopPointOffset/section2d[i].lengthFact;
scope.sections.datalist[section2d[i].code].rightStopPercent = section2d[i].rightStopPointOffset/section2d[i].lengthFact;
}
}
}
}
//连接区段
for(let i=0;i<switch2d.length;i++){
let acode = switch2d[i].sectionACode;
let bcode = switch2d[i].sectionBCode;
let ccode = switch2d[i].sectionCCode;
// console.log(switchdata[i]);
// console.log(scope.sections.datalist[acode]);
let aposx = (scope.sections.datalist[acode].points[0].x + scope.sections.datalist[acode].points[scope.sections.datalist[acode].pointslength].x)/2;
let cposx = (scope.sections.datalist[ccode].points[0].x + scope.sections.datalist[ccode].points[scope.sections.datalist[ccode].pointslength].x)/2;
let aposy = (scope.sections.datalist[acode].points[0].y + scope.sections.datalist[acode].points[scope.sections.datalist[acode].pointslength].y)/2;
let cposy = (scope.sections.datalist[ccode].points[0].y + scope.sections.datalist[ccode].points[scope.sections.datalist[ccode].pointslength].y)/2;
// console.log("----------------");
if(aposx > cposx){
if(aposy < cposy){
// ——A
// /C
scope.sections.datalist[ccode].ctype = 1;
}else{
// \C
// ——A
scope.sections.datalist[ccode].ctype = 2;
}
}else{
if(aposy < cposy){
// A——
// \C
scope.sections.datalist[ccode].ctype = 3;
}else{
// /C
// A——
scope.sections.datalist[ccode].ctype = 4;
}
}
scope.sections.datalist[acode].csection = ccode;
if(scope.sections.datalist[ccode].ctype == 1 || scope.sections.datalist[ccode].ctype == 2){
if(scope.sections.datalist[acode].lsection == "" || scope.sections.datalist[acode].lsection == undefined){
scope.sections.datalist[acode].lsection = bcode;
}
if(scope.sections.datalist[bcode].rsection == "" || scope.sections.datalist[bcode].rsection == undefined){
scope.sections.datalist[bcode].rsection = acode;
}
if(scope.sections.datalist[ccode].rsection == "" || scope.sections.datalist[ccode].rsection == undefined){
scope.sections.datalist[ccode].rsection = acode;
}else if(scope.sections.datalist[ccode].lsection == "" || scope.sections.datalist[ccode].lsection == undefined){
scope.sections.datalist[ccode].lsection = acode;
}
}
if(scope.sections.datalist[ccode].ctype == 3 || scope.sections.datalist[ccode].ctype == 4){
if(scope.sections.datalist[acode].rsection == "" || scope.sections.datalist[acode].rsection == undefined){
scope.sections.datalist[acode].rsection = bcode;
}
if(scope.sections.datalist[bcode].lsection == "" ||scope.sections.datalist[bcode].lsection == undefined ){
scope.sections.datalist[bcode].lsection = acode;
}
if(scope.sections.datalist[ccode].rsection == "" || scope.sections.datalist[ccode].rsection == undefined){
scope.sections.datalist[ccode].rsection = acode;
}else if(scope.sections.datalist[ccode].lsection == "" || scope.sections.datalist[ccode].lsection == undefined){
scope.sections.datalist[ccode].lsection = acode;
}
}
}
resolve("loadersection");
});
}
}

View File

@ -0,0 +1,30 @@
export function rSectionModel(data) {
var scope = this;
//命名
this.name = null;
//code
this.code = null;
//索引位置
this.index = null;
//轨迹点
this.rail = [];
this.railline = null;
//长度
this.distance = [];
this.isStandTrack = null;
this.rsection = null;
this.lsection = null;
this.type = null;
//指向模型
this.mesh = null;
// //模型地址
// this.meshurl = null;
// //贴图地址
// this.picurl = null;
}

View File

@ -0,0 +1,281 @@
import {SignalModel} from '@/jlmap3d/edit/testEditorModel/SignalModel.js';
export function rSignalList() {
let scope = this;
this.type = "signallist";
this.list = [];
this.group = new THREE.Group();
this.initpromise = function(jlmap3ddata,data,scene,assetloader,netdata){
return new Promise(function(resolve, reject){
scope.group.name = "signal";
// console.log(data);
//遍历信号数据
let netsignal = null;
let haddata = false;
if(netdata){
netsignal = JSON.parse(netdata);
haddata = true;
}
let sectiondata = jlmap3ddata.sectionlist.sections.datalist;
let num;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].deviceType == "signal"){
num = j;
}
}
for(let i=0;i<data.length;i++){
if(data[i].virtual == false){
let newsignal = new SignalModel(data[i]);
if(haddata == false){
// console.log(data[i])
let newmesh = assetloader.modellist[num].mesh.clone(true);
newmesh.name = data[i].name;
newmesh.modelid = assetloader.modellist[num].id;
newmesh.code = data[i].code;
newmesh.sectionCode = data[i].sectionCode;
newmesh.right = data[i].right;
newmesh.virtual = data[i].virtual;
for(let j=0;j<newmesh.children.length;j++){
newmesh.children[j].code = data[i].code;
}
let section = sectiondata[data[i].sectionCode];
let posx = null;
if(section.lsection == undefined){
section = sectiondata[section.rsection];
data[i].sectionOffset = section.lengthFact;
data[i].sectionCode = section.rsection;
}
if(section.rsection == undefined){
section = sectiondata[section.lsection];
data[i].sectionOffset = 0;
data[i].sectionCode = section.rsection;
}
if(data[i].sectionOffset > section.lengthFact/2){
posx = section.mesh.position.x + data[i].sectionOffset - section.lengthFact/2;
}else{
posx = section.mesh.position.x - (section.lengthFact/2 - data[i].sectionOffset);
}
//根据线路方向修改信号灯位置
if(data[i].right == false){
if(section.standTrack == true){
posx = posx - 7;
}
newmesh.position.set(posx,0,section.mesh.position.z-3);
newmesh.rotation.z = ( Math.PI / 2 );
}else if(data[i].right == true){
if(section.standTrack == true){
posx = posx + 7;
}
newmesh.position.set(posx,0,section.mesh.position.z+3);
newmesh.rotation.z = ( - Math.PI / 2 );
}
newmesh.scale.x = 0.05;
newmesh.scale.y = 0.05;
newmesh.scale.z = 0.05;
newmesh.sectionOffset = data[i].sectionOffset;
newmesh.sectionCode = data[i].sectionCode;
newmesh.right = data[i].right;
newsignal.mesh = newmesh;
newsignal.sectionOffset = data[i].sectionOffset;
newsignal.mesh.status = "01";
newsignal.name = data[i].name;
newsignal.modelid = assetloader.modellist[num].id;
newsignal.code = data[i].code;
newsignal.sectionCode = data[i].sectionCode;
newsignal.right = data[i].right;
scope.group.add(newmesh);
scope.list.push(newsignal);
}else{
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].id == netsignal[i].modelid){
num = j;
}
}
let newmesh = assetloader.modellist[num].mesh.clone(true);
newmesh.uuid = netsignal[i].id;
newmesh.name = netsignal[i].name;
newmesh.modelid = assetloader.modellist[num].id;
newmesh.code = netsignal[i].code;
newmesh.virtual = data[i].virtual;
for(let j=0;j<newmesh.children.length;j++){
newmesh.children[j].code = netsignal[i].code;
}
newmesh.position.x = netsignal[i].position.x;
newmesh.position.y = netsignal[i].position.y;
newmesh.position.z = netsignal[i].position.z;
newmesh.rotation.x = netsignal[i].rotation._x;
newmesh.rotation.y = netsignal[i].rotation._y;
newmesh.rotation.z = netsignal[i].rotation._z;
newmesh.scale.x = netsignal[i].scale.x;
newmesh.scale.y = netsignal[i].scale.y;
newmesh.scale.z = netsignal[i].scale.z;
// newsignal.mesh = newmesh;
newsignal.mesh.status = "01";
scope.group.add(newmesh);
scope.list.push(newsignal);
}
}
}
scene.add(scope.group);
resolve("loadedsignal");
});
}
this.loadpromise = function(signaldata,scene,assetloader,data){
return new Promise(function(resolve, reject){
let num;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].type == "signal"){
num = j;
}
}
for(let i=0;i<signaldata.length;i++){
//signaldata[i].virtual == "false"
for(let n=0;n<data.length;n++){
if(signaldata[i].code == data[n].code){
if(data[n].virtual == false){
let newsignal = new SignalModel(signaldata[i]);
// console.log(signaldata[i]);
let newmesh = assetloader.modellist[num].mesh.clone(true);
newmesh.sectionCode = data[n].sectionCode;
newmesh.sectionOffset = data[n].sectionOffset;
// newmesh.uuid = signaldata[i].id;
for(let j=0;j<newmesh.children.length;j++){
newmesh.children[j].code = signaldata[i].code;
}
newmesh.name = signaldata[i].name;
newmesh.modelid = assetloader.modellist[num].id;
newmesh.code = signaldata[i].code;
newmesh.right = data[n].right;
newmesh.virtual = data[n].virtual;
newmesh.position.x = signaldata[i].position.x;
newmesh.position.y = signaldata[i].position.y;
newmesh.position.z = signaldata[i].position.z;
newmesh.rotation.x = signaldata[i].rotation._x;
newmesh.rotation.y = signaldata[i].rotation._y;
newmesh.rotation.z = signaldata[i].rotation._z;
newsignal.mesh = newmesh;
newsignal.mesh.status = "01";
scope.group.add(newsignal.mesh);
scope.list.push(newsignal);
n = data.length;
}
}
}
}
scene.add(scope.group);
resolve("loadedsignal");
});
};
this.resetsignal = function(jlmap3ddata){
// console.log(jlmap3ddata.linksgroup);
let sectiondata = jlmap3ddata.sectionlist.sectiongroup.children;
for(let i=0;i<scope.group.children.length;i++){
let signaldata = scope.group.children[i];
for(let j=0;j<sectiondata.length;j++){
if(sectiondata[j].code == signaldata.sectionCode){
let section = sectiondata[j];
let posx = null;
// console.log(section);
posx = section.railpoint[0].x + signaldata.sectionOffset;
//根据线路方向修改信号灯位置
if(signaldata.right == false){
if(section.standTrack == true){
posx = posx - 7;
}
signaldata.position.set(posx,0,section.railpoint[0].z-3);
signaldata.rotation.z = ( Math.PI / 2 );
}else if(signaldata.right == true){
if(section.standTrack == true){
posx = posx + 7;
}
signaldata.position.set(posx,0,section.railpoint[0].z+3);
signaldata.rotation.z = ( - Math.PI / 2 );
}
j = sectiondata.length;
}
}
}
};
this.init = function(data,realsectionlist,scene,assetloader){
scope.group.name = "signal";
//遍历信号数据
for(let i=0;i<data.length;i++){
let newsignal = new SignalModel(data);
let newmesh = assetloader.modellist[0].mesh.clone(true);
newmesh.name = assetloader.modellist[0].id;
newmesh.code = data[i].code;
for(let j=0;j<newmesh.children.length;j++){
newmesh.children[j].code = data[i].code;
}
//根据线路方向修改信号灯位置
if(data[i].directionType == "01"){
newmesh.position.set(data[i].position.x,1,data[i].position.y-10);
newmesh.rotation.z = ( Math.PI / 2 );
}else if(data[i].directionType == "02"){
newmesh.position.set(data[i].position.x,1,data[i].position.y+10);
newmesh.rotation.z = ( - Math.PI / 2 );
}
//newmesh.scale.set(0.1,0.1,0.1);
newsignal.mesh = newmesh;
newsignal.mesh.status = "01";
scope.group.add(newsignal.mesh);
scope.list.push(newsignal);
}
scene.add(scope.group);
}
this.reposition = function(){
}
this.update = function(){
}
this.renderon = function(){
}
this.renderoff = function(){
}
this.dispose = function(){
}
}

View File

@ -0,0 +1,36 @@
export function rSignalModel(data) {
this.uuid = null;
this.code = null;
this.name = null;
this.modelid = null;
this.type = null;
this.direction = null;
this.ismodel = false;
this.istexture = false;
this.modelurl = null;
// this.textures = {
// red:null,
// yellor:null,
// green:null
// }
// this.position = {
// x:0,
// y:0,
// z:0
// };
// this.rotation = {
// x:0,
// y:0,
// z:0
// };
// this.scale = {
// x:0,
// y:0,
// z:0
// }
this.mesh = null;
this.meshurl = null;
this.picurl = null;
}

View File

@ -0,0 +1,135 @@
import {SwitchModel} from '@/jlmap3d/edit/testEditorModel/SwitchModel.js';
export function rSwitchList() {
let scope = this;
this.type = "switchlist";
this.switchgroup = new THREE.Group();
this.switchgroup.name = "switch";
this.switchs = {
datalist:[],
modellist:[]
};
this.initpromise = function(jlmap3ddata,data,scene,assetloader,netdata){
// console.log(jlmap3ddata);
return new Promise(function(resolve, reject){
scene.add( scope.switchgroup );
let sectiondata = jlmap3ddata.sectionlist.sections.datalist;
// console.log(sectiondata);
let num;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].deviceType == "autoswitch"){
num = j;
}
};
for(let i=0,leni = data.length;i<leni;i++){
let newswitch = {
code:data[i].code,
name:data[i].name,
pa:data[i].sectionACode,
pb:data[i].sectionBCode,
pc:data[i].sectionCCode
};
let autoswitch = assetloader.modellist[num].mesh.clone(true);
autoswitch.code = data[i].code;
scope.switchs.datalist.push(newswitch);
scope.switchs.modellist.push(autoswitch);
scope.switchgroup.add(autoswitch);
if(sectiondata[data[i].sectionACode].mesh.position.x >sectiondata[data[i].sectionBCode].mesh.position.x){
autoswitch.position.set(sectiondata[data[i].sectionACode].lp.x,0,sectiondata[data[i].sectionACode].lp.z);
autoswitch.rotation.z = Math.PI;
}else{
autoswitch.position.set(sectiondata[data[i].sectionACode].rp.x,0,sectiondata[data[i].sectionACode].rp.z);
}
}
resolve("loadedswitch");
});
}
this.loadpromise = function(jlmap3ddata,switchdata,scene,assetloader){
return new Promise(function(resolve, reject){
scene.add( scope.switchgroup );
// let sectiondata = jlmap3ddata.sectionlist.sections.datalist;
// console.log(sectiondata);
let num;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].type == "switch"){
num = j;
}
if(assetloader.modellist[j].deviceType == "autoswitch"){
num = j;
}
};
for(let i=0,leni = switchdata.length;i<leni;i++){
// console.log(switchdata[i]);
let newswitch = {
code:switchdata[i].code,
name:switchdata[i].name,
pa:switchdata[i].pa,
pb:switchdata[i].pb,
pc:switchdata[i].pc
};
// console.log(newswitch.pa);
let autoswitch = assetloader.modellist[num].mesh.clone(true);
autoswitch.code = switchdata[i].code;
for(let j=0;j<autoswitch.children.length;j++){
autoswitch.children[j].code = switchdata[i].code;
}
scope.switchs.datalist.push(newswitch);
scope.switchs.modellist.push(autoswitch);
scope.switchgroup.add(autoswitch);
autoswitch.position.set(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z);
autoswitch.rotation.x = switchdata[i].rotation._x;
autoswitch.rotation.y = switchdata[i].rotation._y;
autoswitch.rotation.z = switchdata[i].rotation._z;
}
resolve("loadedswitch");
});
}
this.resetswitch = function(data){
// console.log("reset");
let sectiondata = data.sectionlist.sectiongroup;
for(let i=0;i<scope.switchs.datalist.length;i++){
let sectionA = sectiondata.getObjectByProperty("code",scope.switchs.datalist[i].pa);
let sectionB = sectiondata.getObjectByProperty("code",scope.switchs.datalist[i].pb);
if(sectionA.railpoint[0].x > sectionB.railpoint[0].x){
scope.switchs.modellist[i].position.set(sectionA.railpoint[0].x,0,sectionA.railpoint[0].z);
}else{
scope.switchs.modellist[i].position.set(sectionA.railpoint[1].x,0,sectionA.railpoint[1].z);
}
}
}
this.update = function(){
}
this.renderon = function(){
}
this.renderoff = function(){
}
this.dispose = function(){
}
}

View File

@ -0,0 +1,22 @@
export function rSwitchModel() {
var scope = this;
//命名
this.name = null;
//code
this.code = null;
//索引位置
this.index = null;
//轨迹点
this.rail = [];
//长度
this.distance = null;
this.action = null;
//指向模型
this.mesh = null;
// //模型地址
// this.meshurl = null;
// //贴图地址
// this.picurl = null;
}

View File

@ -0,0 +1,133 @@
import request from '@/utils/request';
// 获取仿真成员列表(新版地图)
export function getSimulationMembersNew(group) {
return request({
url: `/simulation/${group}/members`,
method: 'get'
});
}
// 获取仿真会话消息列表(新版地图)
export function getSimulationContextListNew(group, conversationId) {
return request({
url: `/simulation/${group}/conversation/${conversationId}`,
method: 'get'
});
}
// 获取客户端已经进入仿真的用户仿真所在group(新版地图)
export function getSimulationRunningNew(params) {
return request({
url: `/simulation/running`,
method: 'get',
params
});
}
// 根据group获取仿真对象新版地图
export function getSimulationByGroupNew(group) {
return request({
url: `/simulation/${group}`,
method: 'get'
});
}
// 获取/创建仿真会话(新版地图)
export function getSimulationConversationIdNew(params, group) {
return request({
url: `/simulation/${group}/wx/conversation`,
method: 'get',
params: params
});
}
// 仿真驾驶车辆列表(新版地图)
export function getSimulationTrainlistNew(group) {
return request({
url: `/simulation/driving/${group}/trainList`,
method: 'get',
params: ''
});
}
// 新版仿真驾驶发送命令
export function bindSimulationTrain(group, groupNumber) {
return request({
url: `/simulation/driving/${group}/bindTrain/${groupNumber}`,
method: 'post',
params: ''
});
}
// EB紧急制动
export function trainSimulationEb(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_EB`,
method: 'post',
data: data
});
}
// 改变列车牵引/制动力
export function trainSimulationForce(group,memberId, data) {
return request({
url: `/common/simulation/${group}/member/${memberId}/operate/Train_Drive_Speed_Control`,
method: 'post',
data: data
});
}
// 改变列车档位
export function trainSimulationGear(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_Gear_Change`,
method: 'post',
data: data
});
}
// 改变列车运行级别
export function trainSimulationDriveMode(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_Drive_Mode_Change`,
method: 'post',
data: data
});
}
// ATP切除
// ATO
export function trainSimulationAtp(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_ATP_Change`,
method: 'post',
data: data
});
}
// ATO
export function trainSimulationAto(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_ATO_Open`,
method: 'post',
data: data
});
}
// 换端
export function trainSimulationChangeHead(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_Change_Head`,
method: 'post',
data: data
});
}
//
export function trainSimulationDoorControl(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_Door_On_Off`,
method: 'post',
data: data
});
}

View File

@ -0,0 +1,519 @@
import Vue from 'vue';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
// 模型loader
import { AssetLoader } from '@/jlmap3d/main/loaders/AssetLoader.js';
import {DDSLoader} from '@/jlmap3d/main/loaders/DDSLoader.js';
import {OBJLoader} from '@/jlmap3d/main/loaders/OBJLoader.js';
import {MTLLoader} from '@/jlmap3d/main/loaders/MTLLoader.js';
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader.js';
// data
import { Jl3ddata } from '@/jlmap3d/main/newmodel/jl3ddata';
// setconfig
import { SetCamera } from '@/jlmap3d/config/SetCamera';
import { SetRender } from '@/jlmap3d/config/SetRender';
import { SetScene } from '@/jlmap3d/config/SetScene';
import { SetLights } from '@/jlmap3d/config/SetLights';
// controls
import {OrbitControls} from '@/jlmap3d/main/control/OrbitControls.js';
import { DragControls } from '@/jlmap3d/main/control/DragControls.js';
// 加载器
import { DriverLoadNew } from '@/jlmap3d/jl3drailwaydrive/loader/DriverLoadNew';
// connect
import {Jl3dDrivingNew} from '@/jlmap3d/jl3drailwaydrive/moveupdate/DrivingConnectNew';
import { getPublishMapVersion, getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
// utils
import { UpdateTrain } from '@/jlmap3d/jl3drailwaydrive/moveupdate/UpdateTrain';
// import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrainTest';
import { ReStart } from '@/jlmap3d/main/utils/ReStart';
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
import {MouseControls} from '@/jlmap3d/main/control/FirstControls';
var clock = new THREE.Clock();
export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,project) {
let scope = this;
let stats =null;
// let driverWebWorker = null;
// let stats = new Stats();
// dom.appendChild( stats.dom );
//界面更新函数
let updatemmi = {};
this.dom = dom;
// 渲染循环开关
this.animateswitch = false;
this.cctvswitch = false;
// 初始化webgl渲染
let renderer = SetRender(dom);
renderer.domElement.style.position = 'absolute';
renderer.domElement.style.top = '0';
var renderercctv = new THREE.WebGLRenderer();
renderercctv.setSize(dom.offsetWidth*0.2, dom.offsetHeight*0.2);
renderercctv.domElement.style.position = 'absolute';
renderercctv.domElement.style.top = '0';
document.getElementById('jlsimulation').appendChild(renderer.domElement);
document.getElementById('jlcctv').appendChild(renderercctv.domElement);
// 定义相机
//let camera = SetCamera(dom);
// 定义场景(渲染容器)
let scene = SetScene(project);
let speed = 0;
let drivingcode = null;
// 模型加载器
this.assetloader = new AssetLoader();
// 替换材质组,例:信号机不同灯光
this.materiallist = [];
//替换材质组(站台的)
this.stationtexture = [];
// 初始化场景线框和灯光 暂时
SetLights(scene);
// 点击选中的模型
this.selectmodel = null;
// 鼠标点击模型切换
this.raycasterswitch = 'stand';
// 选中物体描边方框
this.helpbox = null;
// 车门,站台门道岔动画构造器
let mixers = [];
// 模型操作命令组
this.actions = {};
this.nowspeed = null;
this.nowmxlen = null;
this.atpspeed = null;
this.atospeed = null;
// this.trainnum = null;
this.stime = null;
this.drivecount = 0;
this.drivedata = null;
var sectionlist = null;
var linklist = null;
var signallist = null;
var stationstandlist = null;
var switchlist = null;
var trainlisttest = null;
var realsectionlist = null;
var rails = null;
this.webwork=new Worker(JL3D_LOCAL_STATIC+'/workertest/trainworker.js');
// 地图模型数据
let mapdata = new Jl3ddata();
let camera = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 0.1, 400000);
camera.position.set( 0, 0, 0 );
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
camera.rotation.x = 0;
let listener = new THREE.AudioListener();
listener.position.y = -2;
camera.add( listener );
let sound = new THREE.Audio( listener );
// load a sound and set it as the Audio object's buffer
// let audioLoader = new THREE.AudioLoader();
// audioLoader.load( JL3D_LOCAL_STATIC+'/audio/trainmove.ogg', function( buffer ) {
// sound.setBuffer( buffer );
// sound.setLoop( true );
// sound.setVolume( 0 );
// sound.volswitch = false;
// sound.play();
// });
let controls3 = new MouseControls(camera, 1.6);
controls3.enabled = false;
// controls3.getObject().rotation.x = Math.PI/2;
scene.add(controls3.getObject());
let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50);
cameracctv.position.set( -3, 0,4.5 );
cameracctv.rotation.y = -Math.PI/2;
cameracctv.rotation.x = Math.PI/2;
// camera.add(cameracctv);
// 初始化加载数据和模型
getPublishMapDetail(mapId).then(data => {
let mapnetdata = data.data;
getPublish3dMapDetail(mapId).then(netdata => {
// console.log(netdata);
let assetsdata = JSON.parse(netdata.data.sections);
scope.datatype = "new";
// driverWebWorker = new Worker(JL3D_LOCAL_STATIC+"/workertest/railwayWorker.js");
scope.Subscribe = new Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,stats);
// datanew();
DriverLoadNew(mapnetdata,scope,netdata.data,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls3,scene,mixers);
var timer = setInterval(function() {
if(trainlisttest){
if(trainlisttest.group){
if(trainlisttest.group.children[0]){
updatemmi.updatedrivingcodenew(trainlisttest.group.children[0].code);
scope.Subscribe.initdrivercode(trainlisttest.group.children[0].code);
scope.Subscribe.socketon();
clearInterval(timer);
}
}
}
}, 2000);
});
});
// getPublish3dMapDetail(mapId).then(netdata => {
// DriverLoad(data, scope, netdata.data, sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails, camera, controls3, scene,mixers,storemod);
// });
// 开启渲染
animate();
startWorker();
// 动画时间
let delta;
// 循环渲染函数
function animate() {
// 循环渲染
// requestAnimationFrame(animate);
// renderer.setAnimationLoop(animate);
requestAnimationFrame(animate);
// 判断渲染是否开启
if (scope.animateswitch == true) {
// 根据相机渲染场景
renderer.render(scene, camera);
//cctv渲染
if(scope.cctvswitch == true){
renderercctv.render(scene,cameracctv);
}
//相机按键位移
// controls3.update();
// stats.update();
}
}
function updatcontrols() {
if (drivingcode) {
controls3.getObject().position.x = trainlisttest.list[drivingcode].matrixWorld.elements[12]-27;
controls3.getObject().position.y=5;
controls3.getObject().position.z = trainlisttest.list[drivingcode].children[0].matrixWorld.elements[14]+5;
}
}
function startWorker() {
if (typeof (Worker)!=='undefined') {
scope.webwork.onmessage = function (event) {
// 更新列车位置
if(scope.datatype == "old"){
UpdateTrain(camera, trainlisttest);
}
//
delta = clock.getDelta();
for (let i=mixers.length-1; i>=0; i--) {
if(mixers[i]._actions[0].isRunning()){
mixers[i].update( delta );
}
}
};
}
}
updatemmi.updatenowspeed = function(speed) {
scope.nowspeed = speed;
};
updatemmi.updatenowlen = function(maLen) {
scope.nowmxlen = maLen;
};
updatemmi.updateatpspeed = function(atpspeed) {
scope.atpspeed = atpspeed;
};
updatemmi.updateatospeed = function(atospeed) {
scope.atospeed = atospeed;
};
// updatemmi.updatetrainnum = function(trainnum) {
// scope.trainnum = trainnum;
// };
// updatemmi.updatestoptime = function(stime) {
// scope.stime = stime;
// };
// updatemmi.updatedrivedata = function(drivedata) {
// scope.drivecount += 1;
// scope.drivedata = drivedata;
// };
updatemmi.updatedrivingcode = function(code) {
// console.log(trainlisttest);
drivingcode = code;
trainlisttest.group.children[0].children[0].add(controls3.getObject());
controls3.getObject().position.x = 10;
controls3.getObject().position.y = 0;
controls3.getObject().position.z = 4.5;
controls3.getObject().rotation.x = Math.PI/2;
controls3.getObject().rotation.y = -Math.PI/2;
};
updatemmi.updatedrivingcodenew = function(code) {
drivingcode = code;
trainlisttest.group.children[0].children[0].add(controls3.getObject());
controls3.getObject().position.x = 10;
controls3.getObject().position.y = 0;
controls3.getObject().position.z = 4.5;
controls3.getObject().rotation.x = Math.PI/2;
controls3.getObject().rotation.y = -Math.PI/2;
};
this.dispose = function() {
renderer.setAnimationLoop(null);
renderer.dispose();
scene.dispose();
// controls.dispose();
camera = null;
scope.assetloader = null;
mapdata = null;
scope.selectmodel = null;
scope.materiallist = null;
scope.selectmodel = null;
scope.helpbox = null;
mixers = null;
scope.actions = null;
scope.Subscribe = null;
// sound.stop();
scope.webwork.terminate();
};
this.rayswitch = function(value) {
this.raycasterswitch = value;
if (scope.helpbox) {
scene.remove( scope.helpbox );
scope.helpbox = null;
}
};
this.showstationmsg = function(showtype) {
if (showtype == 'show') {
for (let st=0; st<stationstandlist.group.children.length; st++) {
stationstandlist.group.children[st].add(stationstandlist.textlist[st]);
}
} else {
for (let st=0; st<stationstandlist.group.children.length; st++) {
stationstandlist.group.children[st].remove(stationstandlist.textlist[st]);
}
}
};
this.showtrainmsg = function(showtype) {
if (showtype == 'show') {
for (let st=0; st<trainlisttest.textlist.length; st++) {
trainlisttest.list[trainlisttest.textlist[st].tcode].children[0].add(trainlisttest.textlist[st]);
}
} else {
for (let st=0; st<trainlisttest.textlist.length; st++) {
trainlisttest.list[trainlisttest.textlist[st].tcode].children[0].remove(trainlisttest.textlist[st]);
}
}
};
this.restart = function() {
ReStart(mapdata);
};
this.animateon = function() {
// controls.enabled = false;
scope.animateswitch = true;
};
this.animateoff = function() {
// controls.enabled = false;
scope.animateswitch = false;
};
this.cctvon = function() {
scope.cctvswitch = true;
};
this.cctvoff = function() {
scope.cctvswitch = false;
};
this.endsocket = function() {
scope.Subscribe.socketoff(scope.Subscribe.topic);
};
this.loaderdata = function(loadsectionlist,loadlinklist,loadsignallist,loadstationstandlist,loadtrainlisttest,loadrealsectionlist,loadrails){
sectionlist = loadsectionlist;
linklist = loadlinklist;
signallist = loadsignallist;
stationstandlist = loadstationstandlist;
trainlisttest = loadtrainlisttest;
realsectionlist = loadrealsectionlist;
rails = loadrails;
console.log(trainlisttest.group);
trainlisttest.group.children[0].add(cameracctv);
}
this.eventon = function() {
// raycaster交互模型点击事件
document.getElementById('jlsimulation').addEventListener( 'mousedown', onselect, false );
// 窗口自适应
window.addEventListener( 'resize', onWindowResized, false );
// sound.volswitch = true;
// controls.update();
};
this.eventoff = function() {
// console.log("off");
// raycaster交互模型点击事件
document.getElementById('jlsimulation').removeEventListener( 'mousedown', onselect, false );
// 窗口自适应
window.removeEventListener( 'resize', onWindowResized, false );
// sound.volswitch = false;
// sound.setVolume( 0 );
};
this.updatecamera = function(mesh, type) {
if (type == 'simulation') {
camera.position.x = mesh.position.x-300;
camera.position.y = 100;
camera.position.z = mesh.children[0].position.z;
// controls.target = new THREE.Vector3(mesh.position.x,0,mesh.children[0].position.z);
}
// console.log(mesh);
if (type == 'station') {
camera.position.x = mesh.position.x;
camera.position.y = mesh.position.y+800;
camera.position.z = mesh.position.z+300;
// 更新相机方向
// controls.target = new THREE.Vector3(mesh.position.x,mesh.position.y,mesh.position.z);
}
if (type == 'train') {
camera.position.x = mesh.position.x;
camera.position.y = mesh.position.y+800;
camera.position.z = mesh.children[2].matrixWorld.elements[14]+300;
}
};
function onWindowResized() {
// 窗口自适应
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
// 三维交互点击事件函数
function onselect(event) {
if (event.button == '0') {
// 定义光线
let raycaster = new THREE.Raycaster();
// 定义平面鼠标点击坐标
let mouse = new THREE.Vector2();
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
raycaster.setFromCamera( mouse, camera );
if (scope.helpbox) {
scene.remove( scope.helpbox );
scope.helpbox = null;
}
if (scope.raycasterswitch == 'stand') {
// 从站台对象组获取点击目标
let intersects1 = raycaster.intersectObjects( stationstandlist.textlist);
// 获取最近处点击到的模型对象
if (intersects1[0]) {
// 遍历对象组获取对象坐标更新相机数据
for (let j=0; j<stationstandlist.list.length; j++) {
if (intersects1[0].object.name == stationstandlist.list[j].mesh.code) {
camera.position.x = stationstandlist.list[j].mesh.position.x;
camera.position.y = stationstandlist.list[j].mesh.position.y+200;
camera.position.z = stationstandlist.list[j].mesh.position.z+300;
// 更新相机方向
// controls.target = new THREE.Vector3(stationstandlist.list[j].mesh.position.x,stationstandlist.list[j].mesh.position.y,stationstandlist.list[j].mesh.position.z);
// controls.update();
}
}
}
}
if (scope.raycasterswitch == 'train') {
let intersects = raycaster.intersectObjects( trainlisttest.textlist);
if (intersects[0]) {
for (let j=0; j<trainlisttest.list.length; j++) {
if (intersects[0].object.name == trainlisttest.list[j].name) {
camera.position.x = trainlisttest.list[j].position.x;
camera.position.y = 200;
camera.position.z = trainlisttest.list[j].children[2].matrixWorld.elements[14]+300;
}
}
}
}
if (scope.raycasterswitch == 'section') {
// console.log(sectionlist.sections.modellist);
let intersects = raycaster.intersectObjects( sectionlist.sections.modellist, true);
if (intersects[0]) {
scope.helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
scene.add( scope.helpbox );
}
}
if (scope.raycasterswitch == 'signal') {
let intersects = raycaster.intersectObjects( signallist.group.children, true);
if (intersects[0]) {
scope.helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
scene.add( scope.helpbox );
}
}
if (scope.raycasterswitch == 'switch') {
let intersects = raycaster.intersectObjects( sectionlist.switchs.modellist, true);
if (intersects[0]) {
scope.helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
scene.add( scope.helpbox );
}
}
}
}
}

View File

@ -0,0 +1,176 @@
//componnent
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
import {SectionListN} from '@/jlmap3d/main/newmodel/SectionListN';
import {SignalListN} from '@/jlmap3d/main/newmodel/SignalListN';
import {StationStandListN} from '@/jlmap3d/main/newmodel/StationStandListN';
import {SwitchListN} from '@/jlmap3d/main/newmodel/SwitchListN';
import {RailListN} from '@/jlmap3d/main/newmodel/RailListN.js';
import {TrainListN} from '@/jlmap3d/main/newmodel/TrainListN.js';
import {TdtList} from '@/jlmap3d/main/newmodel/TdtList.js';
import { Loading } from 'element-ui';
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,switchlist,stationstandlist,trainlisttest,rails,camera,controls,scene,mixerss){
//console.log(mapdata);
//console.log(data);
//console.log(scope);
let sceneload = scene;
let backdata = scope;
let assetloader = scope.assetloader;
let animateswitch = scope.animateswitch;
let mixers = mixerss;
let actions = scope.actions;
let linklist,realsectionlist;
let loadingInstance = Loading.service({ fullscreen: true });
let isSection = false;
let isNewdata = false;
if(netdata.assets){
let assetsdata = JSON.parse(netdata.sections);
// console.log(assetsdata.link);
if(assetsdata.link){
isSection = true;
}else{
isNewdata = true;
}
}
// console.log(isNewdata);
// console.log(netdata);
if(isNewdata == true){
initnew3d(data,netdata);
}else{
loadingInstance.close();
alert("没有三维数据");
}
function initnew3d(data,netdata){
Materialload(scope,JSON.parse(netdata.assets).stationTextureList[0]);
let mapdata = data;
//初始化轨道和道岔
sectionlist = new SectionListN();
signallist = new SignalListN();
switchlist = new SwitchListN();
//初始化站台
stationstandlist = new StationStandListN();
//初始化测试列车
trainlisttest = new TrainListN();
// realsectionlist = new RealSectionList();
rails = new RailListN();
let tdt = new TdtList();
let sectiondata = JSON.parse(netdata.sections);
let switchdata = JSON.parse(netdata.switchs);
let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands);
let psddata = data.psdList;
for(let i=0;i<standsdata.length;i++){
for(let j=0;j<mapdata.stationStandList.length;j++){
if(standsdata[i].code == mapdata.stationStandList[j].stationCode){
standsdata[i].inside = mapdata.stationStandList[j].inside;
j = mapdata.stationStandList.length;
}
}
}
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,0,JSON.parse(netdata.assets).others);
assetloader.assetPromiseOver(sceneload)
// .then(function(data){
// return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"01",JSON.parse(netdata.assets).others);
// })
.then(function(data){
return sectionlist.loadpromise(mapdata.sectionList,sectiondata.section,rails,scene,assetloader);
})
.then(function(data){
return signallist.loadpromise(mapdata.signalList,signaldata,sceneload,assetloader);
})
.then(function(data){
return switchlist.loadpromise(mapdata.switchList,switchdata,sceneload,assetloader,mixers,actions);
})
.then(function(data){
return trainlisttest.drivertrain(mapdata.trainList,sceneload,assetloader,mixers,actions,"01");
})
// .then(function(data){
// //console.log(data);
// //console.log(assetloader);
// console.log(stationstandlist);
// return tdt.initTdt(stationstandlist.list,mapdata.sectionList,rails.sectionrail,sceneload);
// })
.then(function(data){
return new Promise(function(resolve, reject){
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
if(scope.assetloader.modellist[mn].deviceType && scope.assetloader.modellist[mn].type == "suidao"){
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
// scope.assetloader.modellist[mn].mesh.position.y = 10;
scene.add(scope.assetloader.modellist[mn].mesh);
}
}
resolve("loadedsuidao");
});
})
// .then(function(data){
// return new Promise(function(resolve, reject){
//
// if(scope.stationtexture["stationlist"]){
// for(let mm=0;mm< stationstandlist.group.children.length;mm++){
// let stationname = stationstandlist.group.children[mm].name;
// if(stationstandlist.group.children[mm].getObjectByName("zhantailiebiao")){
// stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
// stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
//
// }
// if(stationstandlist.group.children[mm].getObjectByName("menkuangyanse")){
// stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
// stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map.needsUpdate = true;
// }
//
//
//
// if(stationstandlist.group.children[mm].getObjectByName("zhantaiming")){
// let newmaterial = stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.clone();
// newmaterial.map =scope.stationtexture[stationname];
// stationstandlist.group.children[mm].getObjectByName("zhantaiming").material = newmaterial;
// stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.map.needsUpdate = true;
// }
//
// }
//
// }
// resolve("mergemodel");
// });
// })
.then(function(data){
scope.animateswitch = true;
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails);
scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,tdt,scope.materiallist,scope.actions,scope.sceneload);
scope.webwork.postMessage("on");
loadingInstance.close();
});
}
function onProgress( xhr ) {
if ( xhr.lengthComputable ) {
let percentComplete = xhr.loaded / xhr.total * 100;
}
}
function onError() {}
}

View File

@ -0,0 +1,874 @@
import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
// 定于仿真socket接口
export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,stats) {
let scope = this;
this.map = null;
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;
let tdt = null;
let trainmodel = null;
var scenes = null;
var code = null;
var drivingcode = null;
var drivingspeed = null;
var drivingaptspeed = null;
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();
// let toppic = '/app/topic/simulation/client/'+routegroup+'/drive';
console.log(routegroup);
this.topic = '/queue/simulation/'+routegroup+'/trainPosition';
let header = {'X-Token': getToken() };
let connectmsg = {
type:'init',
baseurl:getBaseUrl(),
topic:this.topic,
token:getToken(),
};
//切换车辆修改列车属性
function changeNowTrain(data){
if(data[i][3] == "0"){
if(data.rightDoorCanClose == false){
trainmodel.openright = '0';
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0;
actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play();
}
}else{
trainmodel.openright = "1";
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].down[an].timeScale = 1;
actions["traindoor"].down[an].play();
}
}
if(data.leftDoorCanClose == false){
trainmodel.openleft = "0";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;
actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play();
}
}else{
trainmodel.openleft = "1";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = 1;
actions["traindoor"].top[an].play();
}
}
}else{
if(data.leftDoorCanClose == false){
trainmodel.openleft = "0";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;
actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play();
}
}else{
trainmodel.openleft = "1";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = 1;
actions["traindoor"].top[an].play();
}
}
if(data.rightDoorCanClose == false){
trainmodel.openright = '0';
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0;
actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play();
}
}else{
trainmodel.openright = "1";
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].down[an].timeScale = 1;
actions["traindoor"].down[an].play();
}
}
}
}
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails,newtdt, materiallist, nowaction, scene) {
// console.log(mapdata);
// console.log(newtrainlisttest);
trainmodel = newtrainlisttest.group.children[0];
trainlisttest = newtrainlisttest;
sectionlist = newsectionlist;
signallist = newsignallist;
stationstandlist = newstationstandlist;
materials = materiallist;
scenes = scene;
actions = nowaction;
links = newlinklist;
rails = newrails;
tdt = newtdt;
};
this.initdrivercode = function(code) {
drivingcode = code;
};
this.socketon = function() {
try {
// console.log("teststomp");
scope.teststomp.subscribe(scope.topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function() {
scope.teststomp.unsubscribe(scope.topic);
for (let i=0; i<trainlisttest.group.children.length; i++) {
if (trainlisttest.group.children[i].dispose == false) {
code = trainlisttest.group.children[i].name;
trainmodel.rotation.y = 0;
trainmodel.doorStatus = '01';
trainmodel.speed = 0;
trainlisttest.group.children[i].dispose = true;
trainlisttest.group.children[i].position.x = -50000;
trainlisttest.group.children[i].position.y = -50000;
trainlisttest.group.remove(trainlisttest.group.children[i]);
i--;
}
}
};
// 仿真socket接口回调函数
function callback(Response) {
// console.log(Response);
// 对象化数据
let data = JSON.parse(Response.body);
if(data.trainPosList){
// console.log(data.trainPosList);
// console.log(data.trainPosList);
nowTrainRun(data.trainPosList);
return;
}
// stats.update();
// 遍历后台数据
// console.log(data);
}
function DeviceDestroy(data){
// console.log(data);
for(let i=0,leni=data.length;i<leni;i++){
if(data[i].type == "SIGNAL"){
signalupdate(data[i]);
}
if(data[i].type == "SWITCH"){
switchupdate(data[i]);
}
if(data[i].type == "PSD"){
standupdate(data[i]);
}
if(data[i].type == "TRAIN_DOOR"){
traindoorupdate(data[i]);
}
}
}
function tdtUpdate(data){
tdt.updateTdt(data.body);
}
function otherTrainRun(data){
if(data.length > trainlisttest.otherTrainmodels.length && trainlisttest.updatStatus == false){
trainlisttest.addDriveTrain(data);
}else if(data.length < trainlisttest.otherTrainmodels.length){
let removelength = trainlisttest.otherTrainmodels.length - data.length;
trainlisttest.removeDriveTrain(removelength);
}else{
for(let i=0,leni=data.length;i<leni;i++){
let updateTrain = trainlisttest.otherTrainmodels[i];
if(data[i].code != trainmodel.code){
otherTrainUpdate(data[i],updateTrain);
}else{
updateTrain.position.x = -99999;
}
}
}
}
function otherTrainUpdate(data,updateTrainModel){
// console.log(data);
// if(data.code = "336"){
// console.log(data);
// }
if(data.section != updateTrainModel.nowsection){
updateTrainModel.nowsection = data.section;
updateTrainModel.curve = rails.sectionrail[data.section].lineleft;
}
if(updateTrainModel.right != data[i][3]){
if(data[i][3] == "0"){
updateTrainModel.right = "0";
updateTrainModel.rotation.y = Math.PI;
let point = updateTrainModel.curve.getPointAt(data[i][2]);
updateTrainModel.position.x = point.x;
for (let tl=0; tl<updateTrainModel.children.length; tl++) {
updateTrainModel.children[tl].position.z = point.z;
}
}else{
updateTrainModel.right = "1";
updateTrainModel.rotation.y = 0;
let point = updateTrainModel.curve.getPointAt(data[i][2]);
updateTrainModel.position.x = point.x;
for (let tl=0; tl<updateTrainModel.children.length; tl++) {
updateTrainModel.children[tl].position.z = point.z;
}
}
}
if(updateTrainModel.curve && updateTrainModel.offset != data[i][2]){
updateTrainModel.offset = data[i][2];
let pos = updateTrainModel.curve.getPointAt(data[i][2]);
updateTrainModel.position.x = pos.x;
// trainmodel.children[0].position.z = pos.z;
if(data[i][3] == "0"){
if(-updateTrainModel.children[0].position.z != pos.z){
updateTrainModel.children[0].up = new THREE.Vector3(1,0,0);
let tangent = updateTrainModel.curve.getTangentAt(data[i][2]).normalize();
updateTrainModel.children[0].axis.crossVectors(updateTrainModel.children[0].up, tangent).normalize();
let radians = Math.acos(updateTrainModel.children[0].up.dot(tangent));
updateTrainModel.children[0].quaternion.setFromAxisAngle(updateTrainModel.children[0].axis, radians);
updateTrainModel.children[0].rotation.x = -Math.PI/2;
updateTrainModel.children[0].rotation.z = updateTrainModel.children[0].rotation.y;
updateTrainModel.children[0].rotation.y = 0;
let rotas = {
posr:pos,
rota:updateTrainModel.children[0].rotation.z
}
updateTrainModel.children[1].rotalist.push(rotas);
let offsetz = pos.z + updateTrainModel.children[0].position.z;
updateTrainModel.children[0].position.z -= offsetz;
// trainmodel.position.z = point.z;
}
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
for(let rs = 1;rs<updateTrainModel.children.length;rs++){
//console.log(rs);
if(updateTrainModel.children[rs].rotalist[0]){
let offsetz = parseFloat(updateTrainModel.children[rs].rotalist[0].posr.z) + parseFloat(updateTrainModel.children[rs].position.z);
updateTrainModel.children[rs].position.z -= offsetz;
for(let xh=0;xh<updateTrainModel.children[rs].rotalist.length;xh++){
if((updateTrainModel.children[rs].matrixWorld.elements[12]+10)>=updateTrainModel.children[rs].rotalist[0].posr.x){
if(rs != updateTrainModel.children.length-1){
let asd = updateTrainModel.children[rs].rotalist[0];
updateTrainModel.children[rs+1].rotalist.push(asd);
}
//let offsetx = trainmodel.children[1].matrixWorld.elements[12]-trainmodel.children[0].children[3].matrixWorld.elements[12];
updateTrainModel.children[rs].rotation.z = updateTrainModel.children[rs].rotalist[0].rota;
updateTrainModel.children[rs].rotalist.splice(0,1)
xh--;
}else{
xh = updateTrainModel.children[rs].rotalist.length;
}
}
//console.log(trainmodel.children[rs].rotalist.length);
}
}
// console.log(trainmodel.rotalist);
// }
}else{
//
if(updateTrainModel.children[0].position.z < pos.z){
updateTrainModel.children[0].up = new THREE.Vector3(-1,0,0);
let tangent = updateTrainModel.curve.getTangentAt(data[i][2]).normalize();
updateTrainModel.children[0].axis.crossVectors(updateTrainModel.children[0].up, tangent).normalize();
let radians = Math.acos(updateTrainModel.children[0].up.dot(tangent));
updateTrainModel.children[0].quaternion.setFromAxisAngle(updateTrainModel.children[0].axis, radians);
updateTrainModel.children[0].rotation.x = -Math.PI/2;
updateTrainModel.children[0].rotation.z = updateTrainModel.children[0].rotation.y;
updateTrainModel.children[0].rotation.y = 0;
let rotas = {
posr:pos,
rota:updateTrainModel.children[0].rotation.z
}
updateTrainModel.children[1].rotalist.push(rotas);
let offsetz = parseFloat(pos.z) - parseFloat(updateTrainModel.children[0].position.z);
updateTrainModel.children[0].position.z += offsetz;
}else if(updateTrainModel.children[0].position.z > pos.z){
updateTrainModel.children[0].up = new THREE.Vector3(1,0,0);
let tangent = updateTrainModel.curve.getTangentAt(data[i][2]).normalize();
updateTrainModel.children[0].axis.crossVectors(updateTrainModel.children[0].up, tangent).normalize();
let radians = Math.acos(updateTrainModel.children[0].up.dot(tangent));
updateTrainModel.children[0].quaternion.setFromAxisAngle(updateTrainModel.children[0].axis, radians);
updateTrainModel.children[0].rotation.x = -Math.PI/2;
updateTrainModel.children[0].rotation.z = updateTrainModel.children[0].rotation.y;
updateTrainModel.children[0].rotation.y = 0;
let rotas = {
posr:pos,
rota:updateTrainModel.children[0].rotation.z
}
updateTrainModel.children[1].rotalist.push(rotas);
let offsetz = parseFloat(pos.z) - parseFloat(updateTrainModel.children[0].position.z);
updateTrainModel.children[0].position.z += offsetz;
}
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
for(let rs = 1;rs<updateTrainModel.children.length;rs++){
//console.log(rs);
if(updateTrainModel.children[rs].rotalist[0]){
let offsetz = parseFloat(updateTrainModel.children[rs].rotalist[0].posr.z) - parseFloat(updateTrainModel.children[rs].matrixWorld.elements[14]);
updateTrainModel.children[rs].position.z += offsetz;
for(let xh=0;xh<updateTrainModel.children[rs].rotalist.length;xh++){
if((updateTrainModel.children[rs].matrixWorld.elements[12]-10)<=updateTrainModel.children[rs].rotalist[0].posr.x){
if(rs != updateTrainModel.children.length-1){
let asd = updateTrainModel.children[rs].rotalist[0];
updateTrainModel.children[rs+1].rotalist.push(asd);
}
updateTrainModel.children[rs].rotation.z = updateTrainModel.children[rs].rotalist[0].rota;
updateTrainModel.children[rs].rotalist.splice(0,1)
xh--;
}else{
xh = updateTrainModel.children[rs].rotalist.length;
}
}
}
}
// }
}
}
}
//更新当前驾驶车辆
function nowTrainRun(data){
console.log(data);
for(let i=0;i<data.length;i++){
//改变当前列车code
if(data[0][0] != trainmodel.code){
if(trainlisttest.otherTrainList[trainmodel.code] && trainmodel.code){
trainlisttest.otherTrainList[trainmodel.code].offset = 0;
}
trainmodel.code = data[0][0];
trainmodel.nowcode = data[0][0];
}
//改变当前列车行驶的区段code
if(data[i][1] != trainmodel.nowsection){
trainmodel.nowsection = data[i][1] ;
trainmodel.curve = rails.sectionrail[data[i][1]].lineleft;
}
//判断转向
if(trainmodel.right != data[i][3] ){
if(data[i][3] == "0"){
trainmodel.right = "0";
trainmodel.rotation.y = Math.PI;
let point = trainmodel.curve.getPointAt(data[i][2] );
trainmodel.position.x = point.x;
for (let tl=0; tl<trainmodel.children.length; tl++) {
trainmodel.children[tl].position.z = point.z;
}
}else{
trainmodel.right = "1";
trainmodel.rotation.y = 0;
let point = trainmodel.curve.getPointAt(data[i][2] );
trainmodel.position.x = point.x;
for (let tl=0; tl<trainmodel.children.length; tl++) {
trainmodel.children[tl].position.z = point.z;
}
if(trainmodel.openleft == "1"){
trainmodel.openleft = "0";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].stop();
}
trainmodel.openright = "1";
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
actions["traindoor"].down[an].timeScale = 1;
actions["traindoor"].down[an].play();
}
}else if(trainmodel.openright == "1"){
trainmodel.openright = "0";
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].stop();
}
trainmodel.openleft = "1";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = 1;
actions["traindoor"].top[an].play();
}
}
}
}
if(trainmodel.curve && trainmodel.offset != data[i][2]){
trainmodel.offset = data[i][2];
let pos = trainmodel.curve.getPointAt(data[i][2]);
trainmodel.position.x = pos.x;
// trainmodel.children[0].position.z = pos.z;
if(data[i][3] == "0"){
if(-trainmodel.children[0].position.z != pos.z || trainmodel.children[0].position.y != pos.y){
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
let tangent = trainmodel.curve.getTangentAt(data[i][2]).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
let newRotationZ = trainmodel.children[0].rotation.z;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = -newRotationZ;
let rotas = {
posr:pos,
roty:trainmodel.children[0].rotation.y,
rotz:trainmodel.children[0].rotation.z
}
let offsetz = pos.z + trainmodel.children[0].position.z;
trainmodel.children[0].position.z -= offsetz;
}
}else{
//
let rotas = {
posr:null,
roty:null,
rotz:null,
};
if(trainmodel.children[0].position.z < pos.z ){
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
let tangent = trainmodel.curve.getTangentAt(data[i][2]).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
rotas.posr = pos;
// rotas.roty = trainmodel.children[0].rotation.y;
rotas.rotz = trainmodel.children[0].rotation.z;
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
trainmodel.children[0].position.z += offsetz;
}else if(trainmodel.children[0].position.z > pos.z){
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
let tangent = trainmodel.curve.getTangentAt(data[i][2]).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
rotas.posr = pos;
// rotas.roty = trainmodel.children[0].rotation.y;
rotas.rotz = trainmodel.children[0].rotation.z;
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
trainmodel.children[0].position.z += offsetz;
}
if(trainmodel.children[0].position.y != pos.y){
if(rotas.posr == null){
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
let tangent = trainmodel.curve.getTangentAt(data[i][2]).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
rotas.posr = pos;
rotas.roty = trainmodel.children[0].rotation.y;
rotas.rotz = trainmodel.children[0].rotation.z;
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
trainmodel.children[0].position.z += offsetz;
let offsety = parseFloat(pos.y) - parseFloat(trainmodel.children[0].position.y);
trainmodel.children[0].position.y += offsety;
}else{
rotas.roty = trainmodel.children[0].rotation.y;
let offsety = parseFloat(rotas.posr.y) - parseFloat(trainmodel.children[0].position.y);
trainmodel.children[0].position.y += offsety;
}
}
}
}
}
}
function initall(data){
for(let i=0,leni=data.length;i<leni;i++){
if(data[i].deviceType == "SWITCH"){
initswitch(data[i]);
}
if(data[i].deviceType == "PSD"){
initstand(data[i]);
}
}
}
function traindoorupdate(data){
// console.log(data);
// console.log("direct:"+trainmodel.right);
// console.log(trainmodel.openleft);
// console.log(trainmodel.openright);
if(trainmodel.code == data.code){
if(trainmodel.right == "0"){
if(data.doorCode == "2"){
if(trainmodel.openleft != data.open && data.open == "0"){
trainmodel.openleft = "0";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play();
}
}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;
actions["traindoor"].top[an].timeScale = 1;
actions["traindoor"].top[an].play();
}
}
}else{
if (trainmodel.openright != data.open && data.open == '0') {
trainmodel.openright = '0';
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play();
}
} else if (trainmodel.openright != data.open && data.open == '1') {
trainmodel.openright = "1";
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0;
actions["traindoor"].down[an].timeScale = 1;
actions["traindoor"].down[an].play();
}
}
}
}else{
if(data.doorCode == "1"){
if(trainmodel.openleft != data.open && data.open == "0"){
trainmodel.openleft = "0";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play();
}
}else if(trainmodel.openleft != data.open && data.open == "1"){
trainmodel.openleft = "1";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;
actions["traindoor"].top[an].timeScale = 1;
actions["traindoor"].top[an].play();
}
}
}else{
if (trainmodel.openright != data.open && data.open == '0') {
trainmodel.openright = '0';
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play();
}
} else if (trainmodel.openright != data.open && data.open == '1') {
trainmodel.openright = "1";
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0;
actions["traindoor"].down[an].timeScale = 1;
actions["traindoor"].down[an].play();
}
}
}
}
}
}
function trainstatus(data){
// 遍历列车对象组
if (trainlisttest) {
code = data.code;
// 剔除不显示的车
// 找到对应列车
if ( trainmodel) {
trainmodel.driveMode = data.driveMode;
trainmodel.status = data[i][3];
// 车门开关验证
// 遍历获取所在轨道
if (trainmodel.dispose != data.dispose && data.dispose == "0") {
if (rails.sectionrail[data.sectionCode]) {
trainlisttest.group.add(trainmodel);
trainmodel.position.y = 0;
// trainmodel.progress = 0;
trainmodel.dispose = "0";
trainmodel.nowcode = data.sectionCode;
trainmodel.nextcode = null;
trainmodel.curve = null;
trainmodel.nextcurve = null;
trainmodel.pc = 1;
if(trainmodel.mixerpush == false){
for(let mi=0,lenmi=trainmodel.mixer.length;mi<lenmi;mi++){
jlmap3d.mixers.push(trainmodel.mixer[mi]);
}
trainmodel.mixerpush = true;
}
}
} else if (trainmodel.dispose != data.dispose && data.dispose == "1") {
trainmodel.status = 1;
trainlisttest.group.remove(trainmodel);
trainmodel.progress = null;
trainmodel.dispose = "1";
code = trainlisttest.group.children[i].name;
trainmodel.rotation.y = 0;
trainmodel.openleft = '1';
trainmodel.openright = '1';
trainmodel.curve = null;
trainmodel.nextcurve = null;
trainmodel.speed = 0;
trainmodel.position.x = -50000;
trainmodel.position.y = -50000;
trainmodel.pc = 1;
}
}
}
}
function initstand(data) {
code = data.code;
if ( actions[code]) {
if (data.close == '1') {
actions[code].status = '1';
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.close == '0') {
actions[code].status = '0';
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
}
}
}
function standupdate(data) {
code = data.code;
if ( actions[code]) {
if (data.open == '1') {
actions[code].status = '1';
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.open == '0') {
actions[code].status = '0';
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.red == 1){
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
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.needsUpdate = true;
}
if(data.yellow == 1){
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
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.needsUpdate = true;
}
if(data.green == 1){
signallist.list[code].mesh.getObjectByName("green").material.map = materials[2];
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.needsUpdate = true;
}
}
function initswitch(data) {
code = data.code;
if (data.routeLock == '0') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].normal = "02";
} else if (data.routeLock == '1') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].normal = "01";
}
}
function switchupdate(data) {
code = data.code;
if (actions[code].normal != data.normal) {
if (data.normal == '02') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
actions[code].normal = "02";
} else if (data.normal == '01') {
// sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
actions[code].normal = "01";
}
}
}
function simulationreset(data){
for(let i=0;i<trainlisttest.group.children.length;i++){
trainlisttest.group.children[i].dispose = true;
trainlisttest.group.children[i].stopstation = null;
trainlisttest.group.children[i].pc = null;
trainlisttest.group.children[i].targetpercent = null;
trainlisttest.group.children[i].progress = null;
trainlisttest.group.children[i].linkOffsetPercent = null;
trainlisttest.group.children[i].targetLink = null;
trainlisttest.group.remove(trainlisttest.group.children[i]);
i--;
}
}
}

View File

@ -0,0 +1,307 @@
export function UpdateTrain(camera,traindata,control){
if(traindata != undefined && traindata.group.children[0]){//traindata.group.children[0].dispose == false
if(traindata.group.children[0].progress != null){
// console.log(traindata.group);
let trainmodel = traindata.group.children[0];
if(trainmodel.speeds > 0 && trainmodel.speeds){
let speed = null;
// console.log(traindata.group.children[0].progress);
if(traindata.group.children[0].progress >=0&&traindata.group.children[0].progress<=1){
let movecurve = trainmodel.curve;
if(trainmodel.status == "03" && movecurve.points.length>1){
let point = movecurve.getPointAt(traindata.group.children[0].progress);
trainmodel.position.x = point.x;
trainmodel.position.y = 0;
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.005){
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
let rotas = {
posr:point,
rota:trainmodel.children[0].rotation.z
}
trainmodel.children[1].rotalist.push(rotas);
let offsetz = parseFloat(trainmodel.children[0].matrixWorld.elements[14]) - parseFloat(point.z);
trainmodel.children[0].position.z += offsetz;
// trainmodel.position.z = point.z;
}
trainmodel.position.x = point.x;
trainmodel.position.y = 0;
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
//console.log(rs);
if(trainmodel.children[rs].rotalist[0]){
let offsetz = parseFloat(trainmodel.children[rs].matrixWorld.elements[14]) - parseFloat(trainmodel.children[rs].rotalist[0].posr.z);
trainmodel.children[rs].position.z += offsetz;
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
if((trainmodel.children[rs].matrixWorld.elements[12]-10)<=trainmodel.children[rs].rotalist[0].posr.x){
if(rs != 5){
let asd = trainmodel.children[rs].rotalist[0];
trainmodel.children[rs+1].rotalist.push(asd);
}
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rota;
trainmodel.children[rs].rotalist.splice(0,1)
xh--;
}else{
xh = trainmodel.children[rs].rotalist.length;
}
}
//console.log(trainmodel.children[rs].rotalist.length);
}
}
}
trainmodel.progress += trainmodel.speeds;
}
if(trainmodel.status == "02" && movecurve.points.length>1){
let point = movecurve.getPointAt(trainmodel.progress);
trainmodel.position.x = point.x;
trainmodel.position.y = 0;
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.005){
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
let rotas = {
posr:point,
rota:trainmodel.children[0].rotation.z
}
trainmodel.children[1].rotalist.push(rotas);
let offsetz = parseFloat(point.z) - parseFloat(trainmodel.children[0].matrixWorld.elements[14]);
trainmodel.children[0].position.z += offsetz;
// trainmodel.position.z = point.z;
}
trainmodel.position.x = point.x;
trainmodel.position.y = 0;
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
//console.log(rs);
if(trainmodel.children[rs].rotalist[0]){
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) - parseFloat(trainmodel.children[rs].matrixWorld.elements[14]);
trainmodel.children[rs].position.z += offsetz;
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
if((trainmodel.children[rs].matrixWorld.elements[12]+10)>=trainmodel.children[rs].rotalist[0].posr.x){
if(rs != 5){
let asd = trainmodel.children[rs].rotalist[0];
trainmodel.children[rs+1].rotalist.push(asd);
}
//let offsetx = trainmodel.children[1].matrixWorld.elements[12]-trainmodel.children[0].children[3].matrixWorld.elements[12];
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rota;
trainmodel.children[rs].rotalist.splice(0,1)
xh--;
}else{
xh = trainmodel.children[rs].rotalist.length;
}
}
//console.log(trainmodel.children[rs].rotalist.length);
}
}
// console.log(trainmodel.rotalist);
}
trainmodel.progress += trainmodel.speeds;
}
}else{
if(trainmodel.nextcurve){
// if(trainmodel.status == '02'){
// }else if(trainmodel.status == '03'){
// }
trainmodel.progress = 0;
trainmodel.len = trainmodel.nextlen;
trainmodel.nowcode = trainmodel.nextcode;
trainmodel.speeds = parseFloat(trainmodel.speed*10/36/25/trainmodel.len);
trainmodel.curve = trainmodel.nextcurve;
trainmodel.nextcurve = null;
trainmodel.nextlen = null;
trainmodel.nextcode = null;
}
// console.log(trainmodel.name);
// console.log(trainmodel.progress);
// console.log(trainmodel.nextcurve);
// if(trainmodel.status == "02"){
// trainmodel.progress = 0;
// }else if(trainmodel.status == "03"){
// trainmodel.progress = 1;
// }
// trainmodel.curve = trainmodel.nextcurve;
}
}else if(trainmodel.speeds < 0 && trainmodel.speeds){
let speed = null;
if(traindata.group.children[0].progress >=0&&traindata.group.children[0].progress<=1){
let movecurve = trainmodel.curve;
if(trainmodel.status == "03" && trainmodel.progress>0 && movecurve.points.length>1){
let point = movecurve.getPointAt(traindata.group.children[0].progress);
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.005){
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
let rotas = {
posr:point,
rota:trainmodel.children[0].rotation.z
}
trainmodel.children[1].rotalist.push(rotas);
let offsetz = parseFloat(trainmodel.children[0].matrixWorld.elements[14]) - parseFloat(point.z);
trainmodel.children[0].position.z += offsetz;
//trainmodel.position.z = point.z;
}
trainmodel.position.x = point.x;
trainmodel.position.y = 0;
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
//console.log(rs);
if(trainmodel.children[rs].rotalist[0]){
let offsetz = parseFloat(trainmodel.children[rs].matrixWorld.elements[14]) - parseFloat(trainmodel.children[rs].rotalist[0].posr.z);
trainmodel.children[rs].position.z += offsetz;
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
if((trainmodel.children[rs].matrixWorld.elements[12]-9)<=trainmodel.children[rs].rotalist[0].posr.x){
if(rs != 5){
let asd = trainmodel.children[rs].rotalist[0];
trainmodel.children[rs+1].rotalist.push(asd);
}
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rota;
trainmodel.children[rs].rotalist.splice(0,1)
xh--;
}else{
xh = trainmodel.children[rs].rotalist.length;
}
}
//console.log(trainmodel.children[rs].rotalist.length);
}
}
}
if(trainmodel.progress > -(trainmodel.speeds)){
trainmodel.progress += trainmodel.speeds;
}
}
if(trainmodel.status == "02" && movecurve.points.length>1 && trainmodel.progress>0){
let point = movecurve.getPointAt(trainmodel.progress);
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.005){
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
let rotas = {
posr:point,
rota:trainmodel.children[0].rotation.z
}
trainmodel.children[1].rotalist.push(rotas);
let offsetz = parseFloat(point.z) - parseFloat(trainmodel.children[0].matrixWorld.elements[14]);
trainmodel.children[0].position.z += offsetz;
//trainmodel.position.z = point.z;
}
trainmodel.position.x = point.x;
trainmodel.position.y = 0;
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
//console.log(rs);
if(trainmodel.children[rs].rotalist[0]){
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) - parseFloat(trainmodel.children[rs].matrixWorld.elements[14]);
trainmodel.children[rs].position.z += offsetz;
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
if((trainmodel.children[rs].matrixWorld.elements[12]+6)>=trainmodel.children[rs].rotalist[0].posr.x){
if(rs != 5){
let asd = trainmodel.children[rs].rotalist[0];
trainmodel.children[rs+1].rotalist.push(asd);
}
//let offsetx = trainmodel.children[1].matrixWorld.elements[12]-trainmodel.children[0].children[3].matrixWorld.elements[12];
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rota;
trainmodel.children[rs].rotalist.splice(0,1)
xh--;
}else{
xh = trainmodel.children[rs].rotalist.length;
}
}
//console.log(trainmodel.children[rs].rotalist.length);
}
}
// console.log(trainmodel.rotalist);
}
// console.log(trainmodel.nextcurve);
if(trainmodel.progress > -(trainmodel.speeds)){
trainmodel.progress += trainmodel.speeds;
}
}
}
}
}
}
// }
}

View File

@ -589,7 +589,7 @@ export function AssetLoader(){
// node.frustumCulled = true;
//});
if(asset.deviceType == "train"){
if(asset.deviceType == "train" ){
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){
@ -665,10 +665,12 @@ export function AssetLoader(){
//object.traverse(function (node) {//获取其中对象
// node.frustumCulled = true;
//});
console.log(asset.type);
console.log(object);
if(asset.code){
scope.modelgroup[asset.code] = object;
}else{
if(asset.type == "train"){
if(asset.type == "train" && object.children.length>4){
let realtrain = new THREE.Group();
let j = object.children.length;
@ -687,6 +689,11 @@ export function AssetLoader(){
asset.mesh = realtrain;
asset.animations = object.animations[0].tracks;
}else if(asset.type == "train" && object.name == "C6"){
let realtrain = new THREE.Group();
object.position.x = object.position.x+scope.trainoffset;
realtrain.add(object);
asset.mesh = realtrain;
}else{
asset.mesh = object;

View File

@ -137,8 +137,9 @@ class SkinCode extends defaultStyle {
standardLength: 6, // 高柱长度
standardHeight: 6, // 灯柱高度
standardColor: '#C0C0C0', // 灯柱颜色
standardVerticalWidth: 2, // 灯柱竖杆宽度
standardRailWidth: 2 // 灯柱横杆宽度
standardVerticalWidth: 2, // 灯柱竖杆宽度
standardRailWidth: 2, // 灯柱横杆宽度
approachLockColor: '#FFFF00' // 接近锁闭灯柱颜色
},
text: {
show: true, // 信号机名称显示
@ -256,7 +257,7 @@ class SkinCode extends defaultStyle {
yellowColor: 'yellow', // 控制模式黄色
stroke: '#FFFFFF', // 框的颜色
fill: 'rgba(0,0,0,0)', // 填充色
textColorNoChange: true
textColorNoChange: true
},
emergencyControl: { // 紧急站控
show: true,
@ -353,8 +354,8 @@ class SkinCode extends defaultStyle {
borderBackgroundColor: '#22DFDF', // 边框背景色
borderColor: '#fff', // 边框颜色
textShadowColor: '#22DFDF', // 字体阴影颜色
coreBackgroundColor: '#00BFFF', // 岔芯颜色 浅蓝色
coreBackgroundColorOver: '#001AFC', // 岔芯颜色 深蓝色
coreBackgroundColor: '#00BFFF', // 岔芯颜色 浅蓝色
coreBackgroundColorOver: '#001AFC' // 岔芯颜色 深蓝色
}
};
@ -858,7 +859,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
this[deviceType.IndicatorLight] = {};
this[deviceType.IndicatorLight] = {};
}
}

View File

@ -638,6 +638,7 @@ class SkinCode extends defaultStyle {
horizontalDistance: 7// 箭头三角水平高度
};
this[deviceType.Train] = {
moreTrainDetail: true,
trainBody: {
fontFamily: 'consolas',
trainBodyLineWidth: 0, // 车身line宽
@ -792,7 +793,7 @@ class SkinCode extends defaultStyle {
};
this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
this[deviceType.IndicatorLight] = {};
this[deviceType.IndicatorLight] = {};
}
}

View File

@ -46,6 +46,7 @@ class Jlmap {
this.stationCode = '';
this.isUpdateShowTrainList = false;
this.isUpdateRunLineTrain = false;
this._disposeFlag = false;
}
// 初始化属性有鼠标事件 缩放等
@ -212,7 +213,6 @@ class Jlmap {
this.screenFlag = false;
this.$painter.updateTransform({ scaleRate: opts.scaleRate, offsetX: opts.offsetX, offsetY: opts.offsetY });
}
setUpdateScreen(opts) {
this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 });
this.screenFlag = true;
@ -654,6 +654,11 @@ class Jlmap {
this.$painter.clear();
}
clearView() {
// this.mapDevice = {};
this.$painter.clear();
}
dispose() {
this.off(this.events.Pan, this.optionsHandler);
this.off(this.events.Zoom, this.optionsHandler);
@ -664,6 +669,7 @@ class Jlmap {
this.$keyboardController.dispose();
this.$zr && zrender.dispose(this.$zr);
this.$painter.dispose();
this._disposeFlag = true;
}
on(eventname, cb, context) {

View File

@ -77,8 +77,7 @@ class Painter {
*/
add(device) {
try {
// const instance = shapefactory(device, this.$jmap);
const instance = this.newGraph(device);
const instance = device.instance || this.newGraph(device);
if (instance) {
device.instance = instance;
this.$transformHandle.transformView(instance);
@ -149,10 +148,9 @@ class Painter {
const overlapTrainList = this.checkTrainOverlap(device);
overlapTrainList.forEach((item, index) => {
const trainDevice = this.$jmap.getDeviceByCode(item);
trainDevice._type = deviceRender['Train']._type;
trainDevice.zlevel = deviceRender['Train'].zlevel;
trainDevice.overLapIndex = index;
trainDevice.instance && this.mapInstanceLevel[deviceType.Train].remove(trainDevice.instance);
trainDevice.instance = null;
this.add(trainDevice);
});

View File

@ -18,6 +18,7 @@ export default class Line2 extends Group {
this.isShowShape = true;
this.create();
this.setState(model);
this.setShowMode(true);
this.checkIsDrawMap();
}
@ -42,24 +43,24 @@ export default class Line2 extends Group {
currentTypeList.forEach(element => {
this[element].recover();
});
}
}
setAshShow() {
this.safetyDoorNormal && this.safetyDoorNormal.setColor('#7F7F7F');
}
setAshShow() {
this.safetyDoorNormal && this.safetyDoorNormal.setColor('#7F7F7F');
}
setState(model) {
this.recover();
if (!this.isShowShape) return;
if (model._free) {
this.setAshShow();
} else {
const currentTypeList = this.style.Psd.elemnetType;
currentTypeList.forEach(element => {
this[element].setState(model);
});
}
if (model._free) {
this.setAshShow();
} else {
const currentTypeList = this.style.Psd.elemnetType;
currentTypeList.forEach(element => {
this[element].setState(model);
});
}
}
drawSelected(selected) {
@ -75,7 +76,20 @@ export default class Line2 extends Group {
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
setShowMode() {}
setShowMode(flag) {
const showMode = this.model.showMode;
if (!flag) {
this.eachChild(item => {
item.show();
});
this.setState(this.model);
}
if (showMode == '05') {
this.eachChild(item => {
item.hide();
});
}
}
setShowStation(flag) {
if (flag) {
this.eachChild(item => {

View File

@ -66,7 +66,7 @@ export default class Section extends Group {
this.create();
this.createMouseEvent();
this.setState(model);
this.setShowMode();
this.setShowMode(true);
}
create() {
@ -424,9 +424,8 @@ export default class Section extends Group {
}
/** 设置状态*/
setState(model, flag = false) {
if (!this.isShowShape) return;
if (!this.isShowShape || model.showMode === '05') return;
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
// 先初始化为灰色
@ -469,7 +468,7 @@ export default class Section extends Group {
model.signalDerailer && exec(DerailerMap[model.signalDerailer], this.derailer, this.style);
/** 道岔区段更新岔心颜色 */
if (model.type === '03' && model.switch) {
if (model.type === '03' && model.switch && model.showMode !== '05') {
const sectionSwitch = this.mapDevice[model.switch.code];
if (sectionSwitch && sectionSwitch.sectionACode === model.code) {
sectionSwitch.instance && sectionSwitch.instance.setState(sectionSwitch);
@ -573,7 +572,13 @@ export default class Section extends Group {
mouseover() {
this.line && this.line.setStyle({ stroke: 'rgba(255,255,255,0.8)' });
}
setShowMode() {
setShowMode(flag = false) {
if (!flag) {
this.eachChild(item => {
item.show();
});
this.setState(this.model);
}
if (this.model.showMode === '05') {
this.line.setStyle({stroke: this.style.Section.line.troColor, lineWidth: this.style.Section.line.troWidth});
this.separator && this.separator.hide();

View File

@ -212,8 +212,8 @@ class Signal extends Group {
this.createMouseEvent();
this.checkIsDrawMap();
this.transformRotation(this);
this.setShowMode();
this.setState(model);
this.setShowMode(true);
// this.checkIsDrawMap();
}
@ -733,7 +733,12 @@ class Signal extends Group {
// this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
// this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.blueColor);
// }
// 信号机接近锁闭
handleApproachLock() {
if (this.style.Signal.post.approachLockColor) { // 设置底座颜色
this.sigPost.setColor(this.style.Signal.post.approachLockColor);
}
}
fault() {
if (this.style.Signal.lamp.faultType == 'flash') {
this.lamps[0].faultShow();
@ -929,7 +934,7 @@ class Signal extends Group {
}
setState(model) {
if (!this.isShowShape || this.model.type === 'TRANSMISSION') {
if (!this.isShowShape || this.model.type === 'TRANSMISSION' || model.showMode === '05') {
return;
}
const path = window.location.href;
@ -1032,6 +1037,7 @@ class Signal extends Group {
if (model.hasSelected) {
this.sigName && this.sigName.setAnimationStart(this.style.Signal.text.defaultColor);
}
model.approachLock && this.handleApproachLock();
// 信号机故障
model.fault && this.fault();
if (model.guideTime) {
@ -1143,14 +1149,24 @@ class Signal extends Group {
});
}
}
setShowMode() {
setShowMode(flag = false) {
const showMode = this.model.showMode;
if (!flag) {
this.eachChild(item => {
item.show();
});
this.setState(this.model);
}
if (showMode == '03') {
this.lowButton && this.lowButton.show();
this.model.prdType = '01';
} else if (showMode == '02') {
this.lowButton && this.lowButton.hide();
this.model.prdType = '02';
} else if (showMode == '05') {
this.eachChild(item => {
item.hide();
});
}
}
setShowStation(stationCode) {

View File

@ -169,7 +169,6 @@ export default class Station extends Group {
this.createInterconnectedControl(); // 联锁控
}
}
}
this.setState(model);
}
@ -194,25 +193,27 @@ export default class Station extends Group {
this.add(this.stationControlAU);
}
createTroButton() {
const model = this.model;
const rect = this.stationText.getBoundingRect();
this.troButton = new Rect({
zlevel: this.zlevel,
z: this.z,
_subType: 'troButton',
shape: {
x: model.position.x + rect.width / 2 + 5,
y: model.position.y,
width: 25,
height: 25
},
style: {
lineWidth: 1,
stroke: '#fff',
fill: '#00f'
}
});
this.add(this.troButton);
if (!this.troButton) {
const model = this.model;
const rect = this.stationText.getBoundingRect();
this.troButton = new Rect({
zlevel: this.zlevel,
z: this.z,
_subType: 'troButton',
shape: {
x: model.position.x + rect.width / 2 + 5,
y: model.position.y,
width: 25,
height: 25
},
style: {
lineWidth: 1,
stroke: '#fff',
fill: '#00f'
}
});
this.add(this.troButton);
}
}
createControlModeCC() { // 西安二
const model = this.model;
@ -776,6 +777,8 @@ export default class Station extends Group {
setShowMode() {
if (this.model.showMode === '05') {
this.createTroButton(); // 创建轨道预览按钮
} else {
this.troButton && this.troButton.hide();
}
}
setShowStation(flag) {

View File

@ -230,11 +230,16 @@ class StationStand extends Group {
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.StationStand.common.functionButtonShow;
this.setVisible(this.model.visible);
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.stopJumpLamp && this.stopJumpLamp.show();
this.cancelStopJumpLamp && this.cancelStopJumpLamp.show();
this.upDetainLamp && this.upDetainLamp.show();
this.downDetainLamp && this.downDetainLamp.show();
} else if (showMode === '05') {
this.eachChild(item => {
item.hide();
});
} else {
this.stopJumpLamp && this.stopJumpLamp.hide();
this.cancelStopJumpLamp && this.cancelStopJumpLamp.hide();

View File

@ -31,7 +31,7 @@ export default class Switch extends Group {
this.createMouseEvent();
this.setState(model);
this.checkIsDrawMap();
this.setShowMode();
this.setShowMode(true);
}
createMouseEvent() {
@ -674,9 +674,8 @@ export default class Switch extends Group {
}
}
setState(model) {
if (!this.isShowShape) return;
if (!this.isShowShape || model.showMode === '05') return;
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (model.normalPosition) {
@ -798,7 +797,13 @@ export default class Switch extends Group {
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
setShowMode() {
setShowMode(flag = false) {
if (!flag) {
this.eachChild(item => {
item.show();
});
this.setState(this.model);
}
if ( this.model.showMode === '05') {
this.eachChild(item => {
item.hide();

View File

@ -52,7 +52,7 @@ class EMouse extends Group {
if (LangStorage.getLang() == 'en') {
text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${direction ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? (this.device.model.sectionModel.parentName ? this.device.model.sectionModel.parentName : this.device.model.sectionModel.name) : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.hold ? 'Detained' : 'Normal'}\n \n 跳停状态: ${this.device.model.jump ? 'Skip to continue moving' : 'Normal'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
} else {
if (Vue.prototype.$jlmap.lineCode == '11' || Vue.prototype.$jlmap.lineCode == '10') {
if (this.device.style.Train.moreTrainDetail) {
text = `列车类型: ${trainType}\n\0\0\0\0源:人工标记\n\0\0号: ${this.device.model.groupNumber}\n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\nATP报告方向: ${direction ? '上行' : '下行'}\n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? (this.device.model.sectionModel.parentName ? this.device.model.sectionModel.parentName : this.device.model.sectionModel.name) : ''}\n所在车站: \n车次通信: 通信车\n运行时间: \n停站时间: \n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n车载扣车: 不执行\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'}\n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车状态: ${this.device.model.runLevel || 'CTC'}\n最高信号系统控制: CTC\n驾驶模式: ${this.device.model.driveMode}模式\n最高ATP模式: AM\nATP1状态: 激活\nATP2状态: 备用\n速度: ${this.device.model.speed || 0} km/h\n车门状态: ${this.device.model.speed ? '关闭' : direction ? '左开右关' : '左关右开'}\n制动状态: 无紧急制动\n停车保证: 可保证停车\n站台无法进入: 否\n前方站台停车点: 中间\n折法策略: \n折返状态: \n屏蔽门开门许可: 是\n运营里程: 无效\n总重量: 196T\n车长: 11860cm\n列车编组: 1`;
} else {
text = `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? (this.device.model.sectionModel.parentName ? this.device.model.sectionModel.parentName : this.device.model.sectionModel.name) : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.hold ? '扣车' : '正常'}\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;

View File

@ -45,10 +45,10 @@ export default class TrainBody extends Group {
: model.tripNumber || style.Train.trainTarget.defaultTripNumber); // 车次号
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (style.Train.trainTargetNumber.lineNumber || '') + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber); // 车组号
const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || model.model.specialServiceNumber || style.Train.trainServer.defaultServiceNumber);// 服务号(表号)
let targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); // 目的地码
if (Vue.prototype.$jlmap.lineCode == '09') { // 暂时先写死 后面有了删掉就好
targetCode = '01';
}
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.destinationCode || style.Train.trainNumber.defaultTargetCode); // 目的地码
// if (Vue.prototype.$jlmap.lineCode == '09') { // 暂时先写死 后面有了删掉就好
// targetCode = '01';
// }
// 服务号
this.textTrainServer = new ETextName({
zlevel: model.zlevel,

View File

@ -357,7 +357,7 @@ export default class Train extends Group {
this.setSoonerOrLater(model.dt);
}
if (this.style.Train.common.cbtcSpeedColor && model.runLevel === 'CBTC') { // 南京二号线 ctc列车随速度变化 列车部分颜色发生变化
this.trainB.setSpeedColor(model.speed);
this.trainB && this.trainB.setSpeedColor(model.speed);
}
this.setDoorStatus(model.doorCloseLock);
this.setAlarmStatus(model.alarmStatus);

View File

@ -18,6 +18,7 @@ class TrainWindow extends Group {
this.create();
this.createMouseEvent();
this.setState(model);
this.setShowMode();
}
create() {
if (this.prdType !== '01') {
@ -83,7 +84,14 @@ class TrainWindow extends Group {
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
}
// 设置显示模式
setShowMode() {}
setShowMode() {
const showMode = this.model.showMode;
if (showMode == '05') {
this.eachChild(item => {
item.hide();
});
}
}
setShowStation(flag) {
if (flag) {
this.eachChild(item => {

View File

@ -12,6 +12,7 @@
<train-set-head ref="trainSetHead" />
<train-set-work ref="trainSetWork" />
<train-flag ref="trainFlag" />
<speed-limit ref="speedLimit" pop-class="beijing-01__systerm" />
<set-fault ref="setFault" pop-class="beijing-01__systerm" />
</div>
</template>
@ -36,6 +37,7 @@ import TrainFlag from './dialog/trainFlag';
// import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -54,7 +56,8 @@ export default {
TrainSetHead,
TrainSetWork,
TrainFlag,
SetFault
SetFault,
SpeedLimit
},
props: {
selected: {
@ -227,10 +230,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -238,6 +237,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -342,19 +378,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -381,6 +404,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
limitSpeed() {
const operate = {

View File

@ -2,6 +2,7 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<notice-info ref="noticeInfo" pop-class="chengdou-01__system" />
<speed-limit ref="speedLimit" pop-class="chengdou-01__system" />
<set-fault ref="setFault" pop-class="chengdou-01__system" />
</div>
</template>
@ -16,6 +17,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CancelMouseState from '@/mixin/CancelMouseState';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
@ -23,7 +25,8 @@ export default {
components: {
PopMenu,
NoticeInfo,
SetFault
SetFault,
SpeedLimit
},
mixins: [
CancelMouseState
@ -140,10 +143,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -151,6 +150,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -252,19 +288,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -291,6 +314,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
limitSpeed() {
const operate = {

View File

@ -8,6 +8,7 @@
<train-move-number ref="trainMoveNumber" />
<train-delete-number ref="trainDeleteNumber" />
<train-detail-info ref="trainDetailInfo" />
<speed-limit ref="speedLimit" pop-class="chengdou-03__systerm" />
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
</div>
</template>
@ -29,6 +30,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
export default {
name: 'MenuTrain',
@ -41,7 +43,8 @@ export default {
TrainCreateNumber,
TrainDeleteNumber,
TrainDetailInfo,
SetFault
SetFault,
SpeedLimit
},
mixins: [
CancelMouseState
@ -123,10 +126,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -134,6 +133,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -223,19 +259,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -262,6 +285,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
limitSpeed() {
const operate = {

View File

@ -17,7 +17,7 @@
<el-form ref="form" :model="formModel" :rules="rules">
<el-col :span="24">
<el-form-item prop="targetDeviceCode" label="目的地:">
<el-select ref="faultSelect1" v-model="formModel.targetDeviceCode" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
<el-select ref="faultSelect1" v-model="formModel.targetDeviceCode" size="small" style="height: 32px;line-height: 32px;" placeholder="请选择">
<el-option
v-for="item in selectedList"
:key="item.code"
@ -25,11 +25,11 @@
:value="item.code"
/>
</el-select>
<el-button
:type="field == 'selectedCode' ? 'danger' : 'primary'"
size="small"
@click="hover('selectedCode')"
>激活</el-button>
<!--<el-button-->
<!--:type="field == 'selectedCode' ? 'danger' : 'primary'"-->
<!--size="small"-->
<!--@click="hover('selectedCode')"-->
<!--&gt;激活</el-button>-->
</el-form-item>
</el-col>
</el-form>
@ -109,7 +109,7 @@ export default {
targetDeviceCode: ''
},
groupNumber: '',
field: '',
field: 'selectedCode',
selected: null,
rules: {
faultType: [
@ -125,11 +125,7 @@ export default {
]),
selectedList() {
let list = [];
let sectionList = [];
if (this.sectionList && this.sectionList.length) {
sectionList = this.sectionList.filter(elem => { return (elem.standTrack || elem.reentryTrack || elem.transferTrack); });
}
list = [...sectionList, ...this.trainList];
list = [...this.sectionList, ...this.trainList];
return list;
},
show() {
@ -147,7 +143,7 @@ export default {
} else if (this.operation == OperationEvent.MixinCommand.cancelStoppage.menu.operation) {
return '取消故障';
} else if (this.operation == OperationEvent.MixinCommand.collocation.menu.operation) {
return '设置托管';
return '驾驶至';
}
return '';
}
@ -160,7 +156,7 @@ export default {
},
'$store.state.menuOperation.selectedCount':function(em) {
const device = this.$store.state.menuOperation.selected;
if (device && device.code && this.judge && this.field) {
if (device && device.code && this.judge && this.field && this.show) {
if (device._type == 'Section' || device._type == 'Train') {
this.deviceSelect(device);
}
@ -168,9 +164,9 @@ export default {
}
},
methods: {
hover(field) {
this.field = field == this.field ? '' : field;
},
// hover(field) {
// this.field = field == this.field ? '' : field;
// },
doShow(operate, selected, judge) {
this.$root.$emit('dialogOpen', selected);
this.selected = selected;
@ -189,12 +185,12 @@ export default {
this.deviceName = deviceType[selected._type];
}
this.faultList = deviceFaultType[selected._type];
if (selected._type == 'Switch' && this.popClass == 'xian-01__systerm' ) {
// && this.$route.query.lineCode == '11'
this.faultList = this.faultList.filter(fault=>{
return fault.value != 'NORMAL_SPLIT' && fault.value != 'REVERSE_SPLIT';
});
}
// if (selected._type == 'Switch' && this.popClass == 'xian-01__systerm' ) {
// // && this.$route.query.lineCode == '11'
// this.faultList = this.faultList.filter(fault=>{
// return fault.value != 'NORMAL_SPLIT' && fault.value != 'REVERSE_SPLIT';
// });
// }
if (this.faultList && this.faultList.length) {
this.form.faultType = this.faultList[0].value;
}
@ -302,10 +298,10 @@ export default {
deviceSelect(em) {
if (this.field == 'selectedCode' && em._type == 'Section') {
this.formModel.targetDeviceCode = em.code;
this.field = '';
// this.field = '';
} else if (this.field == 'selectedCode' && em._type == 'Train') {
this.formModel.targetDeviceCode = em.code;
this.field = '';
// this.field = '';
}
}
}

View File

@ -98,7 +98,7 @@ export default {
}
},
doShow(selected) {
this.$root.$emit('dialogOpen', selected);
this.$root.$emit('dialogOpen', selected);
this.selected = selected;
this.addModel = {
speedLimit:''
@ -112,7 +112,7 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},

View File

@ -14,6 +14,7 @@
<train-set-work ref="trainSetWork" />
<trainSetWorkATP ref="trainSetWorkATP" />
<set-fault ref="setFault" pop-class="foshan-01__systerm" />
<speed-limit ref="speedLimit" pop-class="foshan-01__systerm" />
</div>
</template>
@ -24,15 +25,12 @@ import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import TrainDelete from './dialog/trainDelete';
import TrainDefine from './dialog/trainDefine';
import TrainMove from './dialog/trainMove';
// import TrainEdit from './dialog/trainEdit';
import TrainSetPlan from './dialog/trainSetPlan';
import TrainControl from '@/jmapNew/theme/components/menus/dialog/trainControl';
// import TrainMoveEvently from './dialog/trainMoveEvently';
// import TrainDeletePlan from './dialog/trainDeletePlan';
import TrainSetHead from './dialog/trainSetHead';
import TrainSetWork from './dialog/trainSetWork';
import trainSetWorkATP from './dialog/trainSetWorkATP';
// import TrainFlag from './dialog/trainFlag';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@ -57,7 +55,8 @@ export default {
TrainSetWork,
trainSetWorkATP,
SetFault,
TrainControl
TrainControl,
SpeedLimit
},
props: {
selected: {
@ -135,10 +134,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -146,6 +141,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -242,18 +274,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -278,6 +298,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
limitSpeed() {
const step = {

View File

@ -7,6 +7,7 @@
<train-move ref="trainMove" />
<train-switch ref="trainSwitch" />
<train-edit-number ref="trainEditNumber" />
<speed-limit ref="speedLimit" pop-class="fuzhou-01__systerm" />
<set-fault ref="setFault" pop-class="fuzhou-01__systerm" />
</div>
</template>
@ -25,6 +26,7 @@ import TrainMove from './dialog/trainMove';
import TrainSwitch from './dialog/trainSwitch';
import TrainEditNumber from './dialog/trainEditNumber';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
@ -37,7 +39,8 @@ export default {
TrainMove,
TrainSwitch,
TrainEditNumber,
SetFault
SetFault,
SpeedLimit
},
props: {
selected: {
@ -100,10 +103,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -111,6 +110,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -214,19 +250,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -253,6 +276,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
limitSpeed() {
const step = {

View File

@ -7,6 +7,7 @@
<!-- <train-move ref="trainMove" /> -->
<!-- <train-switch ref="trainSwitch" /> -->
<!-- <train-edit-number ref="trainEditNumber" /> -->
<speed-limit ref="speedLimit" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
@ -25,6 +26,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
// import TrainSwitch from './dialog/trainSwitch';
// import TrainEditNumber from './dialog/trainEditNumber';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
@ -37,7 +39,8 @@ export default {
// TrainMove,
// TrainSwitch,
// TrainEditNumber,
SetFault
SetFault,
SpeedLimit
},
props: {
selected: {
@ -76,10 +79,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -87,6 +86,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -208,19 +244,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Drive_Ahead',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -247,6 +270,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
}

View File

@ -1,277 +0,0 @@
<template>
<div
ref="jlmapCanvas"
class="jlmap-canvas"
>
<div :id="canvasId" class="display_canvas" />
</div>
</template>
<script>
import Jlmap from '@/jmapNew/map';
import { deepAssign } from '@/utils/index';
import deviceType from '@/jmapNew/constant/deviceType';
import { mapGetters } from 'vuex';
import { parser } from '@/jmapNew/utils/parser';
export default {
name: 'JLocalmapVisual',
props: {
type: {
type: String,
required: true
},
deviceCode: {
type: String,
default: () => {
return '';
}
}
},
data() {
return {
loading: true,
offset: {
x: 0,
y: 0
},
map: null,
mapDevice: {},
routeData: [],
mapData: null,
autoReentryData: []
};
},
computed: {
canvasId() {
return ['map', Math.random().toFixed(5) * 100000].join('_');
},
...mapGetters('map', [
'bigScreenConfig'
]),
width() {
return this.$store.state.app.width - 30;
},
height() {
return this.$store.state.app.height - 60;
}
},
watch: {
'$store.state.config.canvasSizeCount': function (val) {
this.resetSize();
},
'$store.state.map.mapViewLoadedCount':function() {
this.$store.dispatch('map/setTrainWindowShow', false);
this.map.off('zoom');
this.handleUpdateScreen();
}
},
created() {
},
mounted() {
this.init();
},
beforeDestroy() {
if (this.map) {
this.map.dispose();
this.map = null;
}
},
methods: {
init() {
document.getElementById(this.canvasId).oncontextmenu = function (e) {
return false;
};
if (!this.map) {
this.map = new Jlmap({
dom: document.getElementById(this.canvasId),
config: {
renderer: 'canvas',
width: this.width,
height: this.height
},
options: {
scaleRate: 1,
offsetX: 0,
offsetY: 0,
zoomOnMouseWheel: false
},
showConfig: {
prdType: '02',
previewOrMapDraw: true,
showMode: '02'
},
methods: {}
});
}
this.map.on('selected', this.onSelected, this);
window.document.oncontextmenu = function () {
return false;
};
},
loadData(mapData, con) {
try {
this.mapData = mapData;
if (this.mapData.skinVO) {
const config = this.map.getShowConfig();
Object.assign(config, con);
this.mapDevice = parser(this.mapData, this.mapData.skinVO.code, config);
}
this.setMap(this.mapData, this.mapDevice);
} catch (error) {
console.log('[ERROR] ', error);
}
},
onSelected(em) {
if (em.deviceType === 'Station' && em.subType === 'troButton') {
this.$emit('goTroDetail', em.deviceCode);
}
},
//
setMap(data, mapDevice) {
if (data.skinVO) {
this.routeData = this.$store.state.map.routeData;
this.autoReentryData = this.$store.state.map.autoReentryData;
this.map.setMap(data, mapDevice, {
routeData: this.routeData,
autoReentryData: this.autoReentryData
});
if (this.type === 'troDetail') {
this.setCenter(this.deviceCode);
} else {
this.handleUpdateScreen();
}
} else {
this.mapDevice = {};
this.map.clear();
}
},
setCenter(deviceCode) {
this.map.setCenter(deviceCode);
},
handleUpdateScreen() {
this.maskOpen = false;
if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
const offsetList = this.bigScreenConfig.offsetList;
const width = this.bigScreenConfig.width;
const height = this.bigScreenConfig.height;
if (this.widthLeft) {
const size = {
width: (this.$store.state.app.width - (this.widthLeft || 450) - 2) * width,
height: this.height * height,
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
this.map.setUpdateScreen(size);
} else {
const size = {
width: (this.$store.state.app.width - 2) * width,
height: this.$store.state.app.height * height,
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
this.map.setUpdateScreen(size);
}
} else {
this.maskOpen = true;
// this.$messageBox('线, ');
}
},
// jlmap
resetSize() {
this.$nextTick(() => {
this.map && this.map.resize({ width: 1920, height: 960 });
});
},
//
setLevelVisible(levels) {
this.map && this.map.setLevelVisible(levels);
},
setMapFree() {
const list = [];
Object.values(this.mapDevice).forEach((elem) => {
const code = elem.code;
const type = elem._type;
//
type != deviceType.Train &&
list.push({ code, _type: type, _free: true });
});
this.map.update(list, false);
},
//
setCenterWithOffset(code, dx, y) {
this.map.setCenterWithOffset(code, dx, y - this.height / 2);
},
//
updateMapDevice(elems) {
const list = [];
elems.forEach((elem) => {
if (elem.code) {
list.push(deepAssign(this.mapDevice[elem.code], elem));
}
});
this.map.update(list, false);
},
getDeviceByCode(code) {
return this.mapDevice[code];
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.mask {
opacity: 0;
background: #000;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9;
}
.jlmap-canvas {
position: relative;
-moz-user-select: none;
-o-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
background: #000;
float: left;
}
.title {
text-align: right;
font-size: 14px;
color: #606266;
line-height: 32px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-weight: 700;
}
.zoom-view {
position: absolute;
bottom: 0;
background: #fff;
padding-top: 5px;
height: 42px;
border-bottom: 1px #f3f3f3 solid;
border-right: 1px #f3f3f3 solid;
}
/deep/ {
.el-form.el-form--inline {
height: 28px !important;
line-height: 28px !important;
}
.el-loading-mask {
background-color: rgba(0, 0, 0, 0.3);
}
}
</style>

View File

@ -1,66 +0,0 @@
<template>
<el-dialog
class="haerbin-01__systerm"
:modal="false"
:title="title"
:visible.sync="show"
:fullscreen="true"
:before-close="doClose"
:z-index="2000"
>
<map-visual ref="map" type="rps" />
</el-dialog>
</template>
<script>
import MapVisual from './mapVisual';
export default {
name: 'RPS',
components: {
MapVisual
},
data() {
return {
dialogShow: false,
mapData: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '背投系统';
}
},
methods: {
doShow() {
this.dialogShow = true;
this.$nextTick(function () {
this.mapData = JSON.parse(JSON.stringify(this.$store.state.map.map));
this.$refs.map.loadData(this.mapData, {});
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
}
}
};
</script>
<style scoped>
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1) !important;
position: relative;
border: 2px solid rgb(144, 144, 144, 0.8);
border-radius: 6px;
font-size: 14px;
}
/deep/ .el-dialog .el-dialog__body{
background: rgba(100, 100, 100, 1) !important;
border: 0 !important;
}
</style>

View File

@ -1,78 +0,0 @@
<template>
<el-dialog
class="haerbin-01__systerm"
:modal="false"
:title="title"
:visible.sync="show"
:fullscreen="true"
:before-close="doClose"
:z-index="2000"
>
<map-visual ref="map" type="tro" @goTroDetail="goTroDetail" />
</el-dialog>
</template>
<script>
import MapVisual from './mapVisual';
export default {
name: 'TRO',
components: {
MapVisual
},
data() {
return {
dialogShow: false,
mapData: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '轨道总览';
}
},
methods: {
doShow() {
this.dialogShow = true;
this.$nextTick(function () {
const map = this.$store.state.map.map;
const data = {
sectionList: map.sectionList,
scaling: map.scaling,
skinVO: map.skinVO,
stationList: map.stationList,
origin: map.origin,
bigScreenConfig: map.bigScreenConfig,
switchList: map.switchList
};
this.mapData = JSON.parse(JSON.stringify(data));
this.$refs.map.loadData(this.mapData, { showMode: '05' });
});
},
goTroDetail(deviceCode) {
this.doClose();
this.$emit('goTroDetail', deviceCode);
},
doClose() {
this.loading = false;
this.dialogShow = false;
}
}
};
</script>
<style scoped>
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1) !important;
position: relative;
border: 2px solid rgb(144, 144, 144, 0.8);
border-radius: 6px;
font-size: 14px;
}
/deep/ .el-dialog .el-dialog__body{
background: rgba(100, 100, 100, 1) !important;
border: 0 !important;
}
</style>

View File

@ -1,112 +0,0 @@
<template>
<el-dialog
class="haerbin-01__systerm"
:modal="false"
:title="title"
:visible.sync="show"
:fullscreen="true"
:before-close="doClose"
:z-index="2000"
>
<map-visual ref="map" type="troDetail" :device-code="deviceCode" />
<div style="width: 150px;height: 35px;display: flex;position: absolute; bottom: 60px;left: calc(50% - 75px);z-index: 9999;justify-content: space-between;justify-items: center;">
<div class="arrow-button" @click="changeStation(-1)"><i class="el-icon-back" /></div>
<div class="arrow-button" @click="goTroDialog"><i class="el-icon-top" /><i class="el-icon-top" /></div>
<div class="arrow-button" @click="changeStation(1)"><i class="el-icon-right" /></div>
</div>
</el-dialog>
</template>
<script>
import MapVisual from './mapVisual';
export default {
name: 'TRO',
components: {
MapVisual
},
props: {
stationList: {
type: Array,
required: true
}
},
data() {
return {
dialogShow: false,
mapData: null,
deviceCode: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '轨道详览';
}
},
methods: {
doShow(deviceCode) {
this.dialogShow = true;
this.deviceCode = deviceCode;
this.$nextTick(function () {
const map = this.$store.state.map.map;
const data = {
sectionList: map.sectionList,
scaling: map.scaling,
skinVO: map.skinVO,
stationList: map.stationList,
origin: map.origin,
bigScreenConfig: map.bigScreenConfig,
switchList: map.switchList
};
this.mapData = JSON.parse(JSON.stringify(data));
this.$refs.map.loadData(this.mapData, {showMode: '02'});
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
goTroDialog() {
this.doClose();
this.$emit('goTroDialog');
},
changeStation(value) {
const device = this.$store.getters['map/getDeviceByCode'](this.deviceCode);
const stationSn = device.sn + value;
const station = this.stationList.find((item) => {
return item.sn === stationSn;
});
if (station) {
this.deviceCode = station.code;
this.$refs.map.setCenter(this.deviceCode);
}
}
}
};
</script>
<style scoped>
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1) !important;
position: relative;
border: 2px solid rgb(144, 144, 144, 0.8);
border-radius: 6px;
font-size: 14px;
}
/deep/ .el-dialog .el-dialog__body{
background: rgba(100, 100, 100, 1) !important;
border: 0 !important;
}
.arrow-button{
width: 45px;
height: 30px;
color: #00f;
background: #99a9bf;
font-size: 22px;
line-height: 30px;
text-align: center;
cursor: pointer;
}
</style>

View File

@ -1,13 +1,13 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<menu-bar v-if="$store.state.training.prdType === '01' || $store.state.training.prdType === '02'" ref="menuBar" :selected="selected" :loginActive="loginActive" :isIgnoreLogin="isIgnoreLogin" @login="login" />
<menu-bar v-if="$store.state.training.prdType === '01'" ref="menuBar" :selected="selected" :login-active="loginActive" :is-ignore-login="isIgnoreLogin" @login="login" />
<menu-train ref="menuTrain" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<menu-button v-if="isShowButton" ref="menuButton" :selected="selected" :loginActive="loginActive" :isIgnoreLogin="isIgnoreLogin" :inputStr="inputStr" />
<menu-button v-if="isShowButton" ref="menuButton" :selected="selected" :login-active="loginActive" :is-ignore-login="isIgnoreLogin" :input-str="inputStr" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" pop-class="haerbin-01__systerm" />
<passive-Timeout ref="passiveTimeout" />
@ -50,25 +50,25 @@ export default {
return null;
}
}
},
data() {
return {
loginActive: false,
inputStr: ''
}
},
},
data() {
return {
loginActive: false,
inputStr: ''
};
},
computed: {
...mapGetters('config', [
'width'
]),
isShowButton() {
return this.$store.state.training.prdType === '01' || this.$store.state.training.prdType === '02';
},
isIgnoreLogin() {
return /jointTrainingNew/.test(this.$route.path) ||
},
isIgnoreLogin() {
return /jointTrainingNew/.test(this.$route.path) ||
/scriptDisplayNew/.test(this.$route.path) ||
/displayNew\/[teach|exam|manage]/.test(this.$route.path)
}
/displayNew\/[teach|exam|manage]/.test(this.$route.path);
}
},
watch: {
isShowBar(val) {
@ -79,13 +79,13 @@ export default {
this.$nextTick(() => {
this.$store.dispatch('config/updateMenuBar');
});
},
methods: {
login(inputStr) {
this.loginActive = !!inputStr
this.inputStr = inputStr;
}
}
},
methods: {
login(inputStr) {
this.loginActive = !!inputStr;
this.inputStr = inputStr;
}
}
};
</script>

View File

@ -170,11 +170,6 @@
<alarm-table-hmi ref="alarmTableHmi" />
<train-control ref="trainControl" :offset="10" />
<log-detail ref="logDetail" />
<rps-dialog ref="rpsDialog" />
<tra-dialog ref="traDialog" />
<ttl-dialog ref="ttlDialog" />
<tro-dialog ref="troDialog" @goTroDetail="goTroDetail" />
<tro-detail-dialog ref="troDetailDialog" :station-list="stationList" @goTroDialog="troClick" />
<audio id="buzzer" controls loop="loop" style="width: 0;height: 0">
<source :src="buzzerAudio" type="audio/mpeg">
</audio>
@ -190,12 +185,6 @@ import BuzzerAudio from '@/assets/buzzer.mp3';
import AlarmTableHmi from './menuDialog/alarmTableHmi';
import AlarmTableLow from './menuDialog/alarmTableLow';
import TrainControl from './dialog/trainControl';
import RpsDialog from './dialog/rps';
import TraDialog from './dialog/tra';
import TtlDialog from './dialog/ttl';
import TroDialog from './dialog/tro';
import TroDetailDialog from './dialog/troDetail';
import LogDetail from './menuDialog/logDetail';
export default {
@ -204,12 +193,7 @@ export default {
AlarmTableLow,
AlarmTableHmi,
TrainControl,
LogDetail,
RpsDialog,
TroDialog,
TraDialog,
TtlDialog,
TroDetailDialog
LogDetail
},
props: {
selected: {
@ -268,7 +252,8 @@ export default {
'order'
]),
...mapGetters('map', [
'stationList'
'stationList',
'trainList'
]),
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
@ -502,9 +487,6 @@ export default {
traClick() {
this.$refs.traDialog.doShow();
},
ttlClick() {
this.$refs.ttlDialog.doShow();
},
goTroDetail(deviceCode) {
this.$refs.troDetailDialog.doShow(deviceCode);
},

View File

@ -1,5 +1,15 @@
<template>
<el-dialog class="haerbin-01__systerm manage-user" title="报警列表" :before-close="handleClose" :visible.sync="show" width="70%" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-dialog
class="haerbin-01__systerm manage-user"
title="报警列表"
:before-close="handleClose"
:visible.sync="show"
width="70%"
:z-index="2000"
:modal="false"
append-to-body
:close-on-click-modal="false"
>
<div style="text-align: center;">
<div style="text-align: left;width: 90%;margin-left: 5%;border: 1px solid #808080;border-radius: 5px;padding: 10px;">
<el-row>

View File

@ -7,6 +7,7 @@
<!-- <train-move ref="trainMove" /> -->
<!-- <train-switch ref="trainSwitch" /> -->
<!-- <train-edit-number ref="trainEditNumber" /> -->
<speed-limit ref="speedLimit" pop-class="haerbin-01__systerm" />
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
</div>
</template>
@ -25,6 +26,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
// import TrainSwitch from './dialog/trainSwitch';
// import TrainEditNumber from './dialog/trainEditNumber';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
@ -32,6 +34,7 @@ export default {
components: {
PopMenu,
NoticeInfo,
SpeedLimit,
// TrainControl,
// TrainDelete,
// TrainMove,
@ -76,10 +79,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -87,6 +86,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -207,19 +243,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Drive_Ahead',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -246,6 +269,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
}

View File

@ -9,7 +9,7 @@
<train-set-head ref="trainSetHead" />
<train-set-work ref="trainSetWork" />
<trainSetWorkATP ref="trainSetWorkATP" />
<SpeedLimit ref="speedLimit" pop-class="ningbo-01__systerm" />
<speed-limit ref="speedLimit" pop-class="ningbo-01__systerm" />
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
</div>
</template>
@ -214,29 +214,50 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
},
{
label: 'URM模式驾驶',
handler: this.handleURMTrain
},
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开/关门',
handler: this.handleOpenCloseDoor
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -327,19 +348,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -366,31 +374,92 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
handleURMTrain() {
const group = this.$route.query.group;
const param = {
commandType: 'Drive_In_Urm_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
// /
handleOpenCloseDoor() {
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();

View File

@ -215,29 +215,50 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
},
{
label: 'URM模式驾驶',
handler: this.handleURMTrain
},
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开/关门',
handler: this.handleOpenCloseDoor
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -327,19 +348,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -366,14 +374,15 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
handleURMTrain() {
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Drive_In_Urm_Mode',
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
@ -382,15 +391,75 @@ export default {
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
// /
handleOpenCloseDoor() {
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();

View File

@ -225,10 +225,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '限速指令',
handler: this.handleSpeedLimit
@ -237,10 +233,6 @@ export default {
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
},
{
label: 'URM模式驾驶',
handler: this.handleURMTrain
},
{
label: '越红灯行驶',
handler: this.handleOverEedLight
@ -248,6 +240,35 @@ export default {
{
label: '开/关门',
handler: this.handleOpenCloseDoor
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -361,19 +382,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -400,21 +408,60 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
handleURMTrain() {
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Drive_In_Urm_Mode',
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
// /
handleOpenCloseDoor() {
@ -430,6 +477,28 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
limitSpeed() {
const operate = {

View File

@ -1,6 +1,6 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="xian-01__systerm" />
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="xian-01__systerm" disabled-color="#aaa" />
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
<train-control ref="trainControl" pop-class="xian-01__systerm" />
<train-delete ref="trainDelete" />
@ -8,6 +8,7 @@
<train-switch ref="trainSwitch" />
<train-edit-number ref="trainEditNumber" />
<train-detail ref="trainDetail" />
<speed-limit ref="speedLimit" pop-class="xian-01__systerm" />
<set-fault ref="setFault" pop-class="xian-01__systerm" />
<!-- <select-station ref="selectStation" @selectStationCode="selectStationCode" /> -->
</div>
@ -29,6 +30,7 @@ import TrainSwitch from './dialog/trainSwitch';
import TrainEditNumber from './dialog/trainEditNumber';
import TrainDetail from './dialog/trainDetail';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
@ -42,7 +44,8 @@ export default {
TrainSwitch,
TrainEditNumber,
TrainDetail,
SetFault
SetFault,
SpeedLimit
// SelectStation
},
props: {
@ -121,10 +124,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -132,6 +131,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -328,47 +364,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
//
// const list = [];
// let direction = this.selected.right == 1;
// if (!this.$store.state.map.mapConfig.upRight) {
// direction = this.selected.right != 1;
// }
// let parentModel = this.selected.sectionModel;
// if (this.selected.sectionModel.parentCode) {
// parentModel = this.$store.getters['map/getDeviceByCode'](this.selected.sectionModel.parentCode);
// }
// this.stationList.forEach((item, index) => {
// const data = this.$store.getters['map/getDeviceByCode'](item.code);
// if (data.sectionCode) {
// const model = this.$store.getters['map/getDeviceByCode'](data.sectionCode);
// if (!direction && model.points[model.points.length - 1].x < parentModel.points[parentModel.points.length - 1].x) {
// list.push(item);
// } else if (direction && model.points[model.points.length - 1].x > parentModel.points[parentModel.points.length - 1].x) {
// list.push(item);
// }
// } else {
// if (!direction && index == 0) {
// list.push(item);
// } else if (direction && index == this.stationList.length - 1) {
// list.push(item);
// }
// }
// });
// this.$refs.selectStation.doShow(this.stationList);
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
// selectStationCode(code) {
// const group = this.$route.query.group;
// const param = {
@ -409,6 +404,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
undeveloped() {
this.doClose();
this.$alert('实现中......', '提示', {

View File

@ -11,6 +11,7 @@
<idle-running-mode ref="idleRunningMode" />
<train-mode ref="trainMode" />
<train-detail ref="trainDetail" />
<speed-limit ref="speedLimit" pop-class="xian-02__system" />
<set-fault ref="setFault" pop-class="xian-02__system" />
</div>
</template>
@ -28,6 +29,7 @@ import TrainUpdatePlan from './dialog/trainUpdatePlan';
import IdleRunningMode from './dialog/idleRunningMode';
import TrainMode from './dialog/trainMode';
import TrainDetail from './dialog/trainDetail';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@ -49,7 +51,8 @@ export default {
TrainUpdatePlan,
IdleRunningMode,
TrainMode,
TrainDetail
TrainDetail,
SpeedLimit
},
props: {
selected: {
@ -238,10 +241,6 @@ export default {
label: '确认运行至前方站',
handler: this.nextStation
},
{
label: '进路闭塞法行车',
handler: this.routeBlockRun
},
{
label: '越引导信号行驶',
handler: this.handleOverFuideSignal
@ -249,6 +248,43 @@ export default {
{
label: '越红灯行驶',
handler: this.handleOverEedLight
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '限速指令',
handler: this.handleSpeedLimit
},
{
label: '换端',
handler: this.handleTurnDirection
},
{
label: '驾驶至',
handler: this.handleDriveTo
},
{
label: '切换驾驶模式',
children: [
{
label: '转URM模式',
handler: this.handleApplyUrmMode
},
{
label: '转RM模式',
handler: this.handleApplyRmMode
},
{
label: '转CM模式',
handler: this.handleApplyCmMode
},
{
label: '转AM模式',
handler: this.handleApplyAmMode
}
]
}
],
menuSpeed: [
@ -349,19 +385,6 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
routeBlockRun() {
const group = this.$route.query.group;
const param = {
commandType: 'Route_Block_Drive',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate})=>{
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleOverFuideSignal() {
const group = this.$route.query.group;
const param = {
@ -388,6 +411,97 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
const group = this.$route.query.group;
const param = {
commandType: 'Open_Or_Close_Door',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleSpeedLimit() { //
this.$refs.speedLimit.doShow(this.selected);
},
//
handleDriveTo() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
handleTurnDirection() {
const group = this.$route.query.group;
const param = {
commandType: 'Turn_Direction',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error)=> {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyUrmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_URM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyRmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_RM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyCmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_CM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) =>{
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handleApplyAmMode() {
const group = this.$route.query.group;
const param = {
commandType: 'Apply_AM_Mode',
targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id,
params: {}
};
commitTrainSend(group, param).then(({valid, operate}) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
trainCancleOrderStop() {
this.trainOrder(true);

View File

@ -34,6 +34,7 @@ const Jlmap3dOtherVR = () => import('@/views/jlmap3d/maintainer/jl3dothervr');
const DisplayNew = () => import('@/views/newMap/displayNew/index');
const DisplayCity = () => import('@/views/newMap/displayCity/index');
const DisplayBaSiDi = () => import('@/views/newMap/displayBaSiDi/index');
const DesignDisplayNew = () => import('@/views/newMap/displayNew/scriptDisplay/scriptPreview/index');
const PracticeDisplay = () => import('@/views/newMap/displayNew/practiceDisplay');
const BigLPFStrategy = () => import('@/views/newMap/displayNew/bigLPFStrategy');
@ -393,6 +394,11 @@ export const publicAsyncRoute = [
component: DisplayCity,
hidden: true
},
{
path: '/displayBaSiDi/:mode',
component: DisplayBaSiDi,
hidden: true
},
{
path: '/design/displayNew/:mode',
component: DesignDisplayNew,

View File

@ -222,6 +222,11 @@ export default {
{ name: '固定应答器', value: 'FB'},
{ name: '可变应答器', value: 'VB'},
{ name: '填充应答器', value: 'IB'}
],
loadRuleList: [
{ label: '每日加载', value:'EVERY_DAY' },
{ label: '周内加载', value: 'WITHIN_A_WEEK' },
{ label: '周末加载', value: 'WEEKEND' }
]
}
};

View File

@ -324,7 +324,9 @@ export default {
/** 列车在指定站台跳停 */
CMD_TRAIN_SKIP_STOP : { value: 'Train_Skip_Stop', label: '指定站台跳停' },
/** 列车取消指定站台的跳停 */
CMD_TRAIN_CANCEL_SKIP_STOP : { value: 'Train_Cancel_Skip_Stop', label: '取消指定站台跳停' }
CMD_TRAIN_CANCEL_SKIP_STOP : { value: 'Train_Cancel_Skip_Stop', label: '取消指定站台跳停' },
/** 换端 */
CMD_TRAIN_TURN_DIRECTION: { value: 'Turn_Direction', label: '换端' }
},
TrainWindow: {
/** 修改列车识别号 */

View File

@ -61,8 +61,8 @@ const config = {
commit('updateMenuBar');
},
setCurrentCancasId: ({state, dispatch, commit }, payLoad) => {
commit('setCanvasId', payLoad.id);
setCurrentCancasId: async ({state, dispatch, commit }, payLoad) => {
await commit('setCanvasId', payLoad.id);
dispatch('resetCanvasOffset');
},

View File

@ -15,7 +15,7 @@ function handleSimulationStateMsg(state, type) {
store.dispatch('scriptRecord/updateSimulationPause', true);
break;
case 1:
store.dispatch('scriptRecord/updateSimulationPause', true);
store.dispatch('scriptRecord/updateSimulationPause', false);
state.simulationPause = false;
break;
case 4:

View File

@ -13,13 +13,16 @@ export function getTopic(type, group) {
let topic = '';
switch (type) {
case 'SYSTIME':
topic = `/user/queue/simulation/${group}/sysTime`;
// topic = `/user/queue/simulation/${group}/sysTime`;
topic = `/queue/simulation/${group}/sysTime`;
break;
case 'ATS':
topic = `/user/queue/simulation/${group}/ats`;
// topic = `/user/queue/simulation/${group}/ats`;
topic = `/queue/simulation/${group}/ats`;
break;
case 'STATE':
topic = `/user/queue/simulation/${group}/state`;
// topic = `/user/queue/simulation/${group}/state`;
topic = `/queue/simulation/${group}/state`;
break;
}
return topic;

View File

@ -249,6 +249,11 @@ export default {
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations');
}
// if (this.currentPrdType === '02' && this.courseModel.lineCode === '14') {
// this.$router.push({ path: `/displayBaSiDi/demon`, query: query });
// } else {
// this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
// }
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
launchFullscreen();
}).catch(error=>{

View File

@ -394,12 +394,17 @@ export default {
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Switch_Hook_Lock: '道岔钩锁',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
Set_Speed_Limit:'设置限速',
Turn_Direction: '换端',
Drive_To: '驾驶至',
Apply_URM_Mode: '转URM模式',
Apply_RM_Mode: '转RM模式',
Apply_CM_Mode: '转CM模式',
Apply_AM_Mode: '转AM模式'
};
resultData = member.label + '对【' + targetName.label + '】下达【' + CommandList[element.commandInitiateVO.commandType] + '】指令';
} else if (element.type == 'Drive') {

View File

@ -312,12 +312,17 @@ export default {
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Switch_Hook_Lock: '道岔钩锁',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
Set_Speed_Limit:'设置限速',
Turn_Direction: '换端',
Drive_To: '驾驶至',
Apply_URM_Mode: '转URM模式',
Apply_RM_Mode: '转RM模式',
Apply_CM_Mode: '转CM模式',
Apply_AM_Mode: '转AM模式'
};
resultData = member.label + '对【' + targetName.label + '】下达【' + CommandList[element.commandInitiateVO.commandType] + '】指令';
} else if (element.type == 'Drive') {

View File

@ -250,12 +250,17 @@ export default {
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Switch_Hook_Lock: '道岔钩锁',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
Set_Speed_Limit:'设置限速',
Turn_Direction: '换端',
Drive_To: '驾驶至',
Apply_URM_Mode: '转URM模式',
Apply_RM_Mode: '转RM模式',
Apply_CM_Mode: '转CM模式',
Apply_AM_Mode: '转AM模式'
};
resultData = member.label + '对【' + targetName.label + '】下达【' + CommandList[element.commandInitiateVO.commandType] + '】指令';
} else if (element.type == 'Drive') {

View File

@ -425,7 +425,7 @@ import axios from 'axios';
/* position: absolute; */
color: #FFFFFF;
font-size: 4px;
font-size: 13px;
}
.buttontext2{
width:100%;
@ -433,7 +433,7 @@ import axios from 'axios';
position: absolute;
color: #FFFFFF;
font-size: 4px;
font-size: 13px;
}

View File

@ -0,0 +1,436 @@
<template>
<div style="width:100%;height:50%;position:absolute;bottom:4%">
<div id="start" class="panebutton2" style="bottom:1%;left:5%;" >
<img class="buttonimg2" :src="start" />
</div>
<div id="direct" class="panebutton2" style="bottom:1%;left:25%;">
<img class="buttonimg2" :src="direct" />
<img id="directimg" class="buttonimg2" :src="directoffpng" :style="{transform:toutransform}" @mousedown="touchstart" />
<div class="directbutton" style="top:0px;right:0;">{{ $t('jlmap3d.front') }}</div>
<div class="directbutton" style="top:18px;right:0;">0</div>
<div class="directbutton" style="top:36px;right:0;">{{ $t('jlmap3d.later') }}</div>
</div>
<div id="div1" class ="pane-box">
<img class="paneimg" :src="pane"/>
<div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '0px': '0px'}">{{ $t('jlmap3d.traction') }}</div>
<div class="panelb" :style="{right: isZh? '80px': '80px', top: '70px'}">0</div>
<div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '130px': '130px'}">{{ $t('jlmap3d.braking') }}</div>
<div class="panelb" :style="{right: isZh? '80px': '80px', top: isZh? '145px': '145px'}">{{ $t('jlmap3d.quick') }}</div>
<img id="div2" class="lgimg" :src="lg" :style="{top:movex}" @mousedown="speedstart" />
<!-- @mouseup="speedend" -->
</div>
</div>
</template>
<script>
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import { trainSimulationForce,trainSimulationGear } from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js';
import store from '@/store/index';
import { throttle } from '@/utils/throttle.js';
export default {
name: 'CentercPane',
components: {
},
props: {
groupNum: {
type: String,
default: null
},
userRole: {
type: String,
default: null
}
},
data() {
return {
move:0,
movex:"73px",
apoimg:"",
touchcontrol:true,
touchstate:"Neutral",
toutransform:"rotate(175deg)",
start:JL3D_LOCAL_STATIC+"/jl3d/control/start.png",
direct:JL3D_LOCAL_STATIC+"/jl3d/control/direct.png",
directz:JL3D_LOCAL_STATIC+"/jl3d/control/directfront.png",
directoffpng:JL3D_LOCAL_STATIC+"/jl3d/control/directoff.png",
pane:JL3D_LOCAL_STATIC+"/jl3d/control/pane.png",
lg:JL3D_LOCAL_STATIC+"/jl3d/control/lg.png",
iconrotate:45,//deg
icontranslateX:100,//沿xpx
icontranslateY:100,//沿ypx
mouseX:0,
mouseY:0,
objX:0,
objY:0,
isDown:false,
angleoffset: {
x: null,
y: null
},
movelimit: {
x: null,
y: null
},
moveheight:null,
speedlimit:160,
}
},
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);
// // }
//
// }
// },
touchstate:function(val,oldval){
if(val != oldval){
// if(this.userRole == "DRIVER"){
// trainSimulationGear(this.group,this.groupNum,this.touchstate).then(netdata => {
//
// });
// }
}
}
},
computed: {
group() {
return this.$route.query.group;
},
code() {
return this.$store.state.app.code;
},
traincode() {
return this.$store.state.app.driverTrain;
},
atostate(){
return this.$store.state.app.atostate;
},
iconstyle:function(){//
let arr = new Array();
arr.push('transform:');//
arr.push('translateX('+this.icontranslateX+'px) ');
arr.push('translateY('+this.icontranslateY+'px) ');
arr.push('rotate('+this.iconrotate+'deg) ');
return arr.join("");
},
isZh() {
return this._i18n.locale == 'zh';
}
},
mounted() {
},
beforeDestroy() {
},
methods: {
centerstate : function(gear){
this.touchstate = gear;
if(this.touchstate == "Drive"){
this.toutransform = "rotate(140deg)";
}else if(this.touchstate == "Neutral"){
this.toutransform = "rotate(175deg)";
}else if(this.touchstate == "Reverse"){
this.toutransform = "rotate(205deg)";
}
},
centercontrol : function(){
},
setData : function(){
this.msgshow = false;
},
showcontrolmsg:function(data,callback){
this.controlmsg = data;
this.msgshow = true;
callback = callback || function(){
this.setData();
};
setTimeout( callback.bind(this),2000);
},
startclick: function (e){
this.showcontrolmsg(this.$t('jlmap3d.drive'));
},
onChange: function(e){
this.move = e.detail.x;
},
controlsend:function(traincode,operation,type,param){
if(this.userRole == "Driver"){
let command ={
code:traincode,
operation:operation,
type:type,
param:param
};
// sendSimulationCommand(this.group,command);
}else{
}
},
speedstart: function(event){
let domoffset = document.getElementById("div1").getBoundingClientRect();
// movelimit
this.movelimit.x = domoffset.x;
this.movelimit.y = domoffset.y;
event.preventDefault();
document.getElementById("div1").onmousemove = this.speedchange;
document.getElementById("div2").onmouseup = this.speedend;
},
speedchange: function(event){
this.moveheight = event.pageY-this.movelimit.y;
this.movex = this.moveheight-7 +"px";
// if(this.atostate == true){
// this.$store.dispatch('app/setAtoState', false);
// }
if(this.moveheight<=1){
this.moveheight=1;
this.movex=-6+"px";
}
if(this.moveheight>=159){
this.moveheight=159;
this.movex=153+"px";
}
if(this.moveheight<86&&this.moveheight>73){
this.movex=72+"px";
this.move = 0;
}else if(this.moveheight<0&&this.moveheight>159){
}else{
if(this.moveheight>=86){
this.move = -(this.moveheight-82)/65;
}
if(this.moveheight<=73){
this.move = (73 - this.moveheight)/75;
}
this.movex=this.moveheight-7+"px";
if(this.moveheight>=145){
this.movex= 150+"px";
this.move = -1;
}
}
let param = {
// id:this.groupNum,
id:"001",
p:parseInt(this.move*100)
};
console.log(param.p);
const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
console.log(this.group);
console.log(userInfo.memberId);
throttle(
trainSimulationForce(this.group,userInfo.memberId,param).then(res => {
// console.log(res);
}).catch((error) => {
console.log(error);
})
,200,true);
// updatemmic1(param.percent);
},
speedend: function(event){
document.getElementById("div1").onmousemove = null;
document.getElementById("div2").onmouseup = null;
},
click:function(){//
if (this.iconrotate==0) {
this.iconrotate=315;
}else {
this.iconrotate=0;
}
},
touchstart:function(e){
let domoffset = document.getElementById("directimg").getBoundingClientRect();
// movelimit
this.angleoffset.x = domoffset.x;
this.angleoffset.y = domoffset.y;
e.preventDefault();
document.getElementById("directimg").onmousemove = this.touchmove;
document.getElementById("directimg").onmouseup = this.touchend;
},
touchmove:function(e){//finger move
// console.log(e);
this.getAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
},
touchend:function(e){
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
},
getAngle:function(mx,my){
//
// console.log(mx);
// console.log(my);
let px=30;
let py=30;
let x = Math.abs(px-mx);
let y = Math.abs(py-my);
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
let cos = y/z;
let radina = Math.acos(cos);//
let angle = Math.floor(180/(Math.PI/radina));//
if(mx>px&&my>py){//
angle = 180 - angle;
}
if(mx==px&&my>py){//y
angle = 180;
}
if(mx>px&&my==py){//x
angle = 90;
}
if(mx<px&&my>py){//
angle = 180+angle;
}
if(mx<px&&my==py){//鼠标在x轴负方向
angle = 270;
}
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
console.log(angle);
console.log(this.userRole );
if(angle<127 && angle>46){
if(angle<63 && angle>46){
if(this.touchstate != "Drive"){
let data = {
groupNumber:this.groupNum,
gear:"Drive"
};
trainSimulationGear(this.group,data).then(netdata => {
console.log(netdata);
if(netdata.code == "200"){
this.toutransform = "rotate(140deg)";
this.touchstate = "Drive";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}else if(angle<93 && angle>68){
if(this.touchstate != "Neutral"){
let data = {
groupNumber:this.groupNum,
gear:"Neutral"
};
trainSimulationGear(this.group,data).then(netdata => {
if(netdata.code == "200"){
this.toutransform = "rotate(175deg)";
this.touchstate = "Neutral";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}else if(angle<127 && angle>101){
if(this.touchstate != "Reverse"){
let data = {
groupNumber:this.groupNum,
gear:"Reverse"
};
trainSimulationGear(this.group,data).then(netdata => {
if(netdata.code == "200"){
this.toutransform = "rotate(205deg)";
this.touchstate = "Reverse";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}
}
},
},
}
</script>
<style >
.pane-box{
right: 30px;
top: 0px;
width:120px;
height:160px;
overflow: hidden;
position: absolute;
}
.lgimg{
width: 60px;
right:4px;
bottom:0px;
height: 15px;
position: absolute;
cursor:pointer;
}
.panelb {
position: absolute;
font-size: 24rpx;
color: #fff;
text-align: center;
vertical-align: middle;
/* transform: rotate(90deg); */
}
.paneimg{
position: absolute;
right: 0px;
bottom: 0px;
width:100px;
height:160px;
position: absolute;
}
.directbutton{
color:#FFFFFF;
font-size: 13px;
position:absolute;
}
.tfbutton{
color:#000000;
font-size: 1px;
position:absolute;
}
</style>

View File

@ -0,0 +1,457 @@
<template>
<div class="drivepane" :style="{'background-image': 'url('+localStatic+'/jl3d/control/scene.png)'}">
<div style="position: absolute;right:50%;top:50%;z-index:10;background: #EBEBEB;" v-show="tuoguanbutton" @click="tuoguan">{{ tuoguanbuttonmsg }}</div>
<div style="position: absolute;right:50%;top:60%;z-index:10;background: #EBEBEB;" v-show="isTraining" >
<el-select v-model="value" :placeholder="initMsg" @change="currentsel" @visible-change="clickselect" >
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
>
</el-option>
</el-select>
</div>
<Centerc-Pane ref="centercontrol" :group-num="groupnum" :user-role="userrole" />
<!-- <Left-Pane ref="leftcontrol" /> -->
<!-- <Right-Pane ref="rightcontrol" /> -->
<TopRight-Pane ref="topcontrol" :group-num="groupnum" />
<!--
<div class="switchpane" style="left:0;top:47.5%;transform: rotate(90deg);" v-show="switchleft" @tap="switchl">
<image class="switchimg" :src="jiantou" />
</div>
<div class="switchpane" style="left:47.5%;top:0;transform: rotate(180deg);" v-show="switchtop" @tap="switcht">
<image class="switchimg" :src="jiantou" />
</div>
<div class="switchpane" style="right:0;top:47.5%;transform: rotate(270deg);" v-show="switchright" @tap="switchr">
<image class="switchimg" :src="jiantou" />
</div>
<div class="switchpane" style="right:47.5%;bottom:0;" v-show="switchbottom" @tap="switchb">
<image class="switchimg" :src="jiantou" />
</div> -->
</div>
</template>
<script>
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import CentercPane from '@/views/jlmap3d/railwaydrive/drivecontrol/centerpane';
import LeftPane from '@/views/jlmap3d/railwaydrive/drivecontrol/leftpane';
import RightPane from '@/views/jlmap3d/railwaydrive/drivecontrol/rightpane';
import TopRightPane from '@/views/jlmap3d/railwaydrive/drivecontrol/toprightpane';
import StompClient from '@/utils/sock';
import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
import { bindSimulationTrain,getSimulationTrainlistNew,getSimulationMembersNew,trainSimulationEb,trainSimulationForce,trainSimulationGear} from '@/jlmap3d/jl3drailwaydrive/drivecontrol/simulation.js';
import { getSimulationInfoNew } from '@/api/simulation';
import { tuoguan3ddrive } from '@/api/jlmap3d/load3ddata';
import { getToken } from '@/utils/auth';
// import Vue from 'vue';
// import StompClient from '@/utils/stompclient.js';
import axios from 'axios';
export default {
name: 'DriveControl',
components: {
CentercPane,
LeftPane,
RightPane,
TopRightPane,
},
data() {
return {
isTraining:true,
localStatic:JL3D_LOCAL_STATIC,
options: [],
initMsg:"请选择列车",
value: '',
teststomp:null,
topid:null,
trainlist:null,
groupnum:"",
userrole:'',
nowdrive:null,
tuoguanbutton:false,
tuoguanbuttonmsg:"托管",
tuoguanstatus:false,
}
},
watch: {
// '$store.state.training.memberData':{
// handler(val){
// if(this.tuoguanbutton == true){
// console.log(val);
// }
// },
// deep:true //true
// }
},
onLoad(e) {
},
onReady() {
},
computed: {
group() {
return this.$route.query.group;
},
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
},
},
async mounted() {
// if(this.$route.query.group){
// getSimulationInfoNew(this.$route.query.group).then(netdata => {
//
// if(netdata.data.type == "SCRIPT_MAKING"){
// this.tuoguanbutton = true;
// }
// this.inittrainlist();
// });
// }
window.updateDriverTrust = this.updateDriverTrust;
window.updateDriveValue = this.updateDriveValue;
// this.teststomp = new StompClient();
},
beforeDestroy() {
},
methods: {
changeTrainSelect(mode){
if(mode == "isTraining"){
this.isTraining = false;
}
},
currentsel(selVal){
let oldgroupnum = this.groupnum;
this.groupnum = selVal;
bindSimulationTrain(this.group,this.groupnum).then(netdata => {
this.selVal = selVal;
this.dialogVisible = true;
// this.groupnum = selVal;
for(let i=0;i<this.trainlist.length;i++){
if(this.trainlist[i].groupNumber == this.groupnum){
// console.log(this.trainlist[i].gear);
// this.groupnum
this.$refs.centercontrol.centerstate(this.trainlist[i].gear);
}
}
this.nowdrive = this.groupnum;
}).catch(error => {
this.groupnum = oldgroupnum;
this.selVal = oldgroupnum;
this.$emit('warningmsg',error.message);
this.value = this.nowdrive;
});
},
clickselect(e){
if(e == true){
this.updatetrainlist();
}
},
tuoguan(){
let posttrust = null;
if(this.tuoguanstatus){
posttrust = false;
}else{
posttrust = true;
}
tuoguan3ddrive(this.$route.query.group,{}).then(netdata => {
// this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.userId});
this.tuoguanstatus = posttrust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}).catch((error) => {
});
},
updateDriverTrust(code,trustStatus){
if(this.tuoguanstatus != trustStatus){
this.tuoguanstatus = trustStatus;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
this.$store.dispatch('training/updateMemberTrust', {deviceCode:code,trust:trustStatus});
}
},
inittrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => {
this.options = [];
this.trainlist = netdata.data;
for(let i=0;i<netdata.data.length;i++){
let option= {
value: netdata.data[i].groupNumber,
label: netdata.data[i].groupNumber,
name:null,
}
option.disabled = false;
if(netdata.data[i].name){
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.initMsg = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.groupNumber = netdata.data[i].groupNumber;
option.disabled = true;
}
if(netdata.data[i].driverId){
if(netdata.data[i].driverId == this.userId){
this.selVal = netdata.data[i].groupNumber;
this.groupnum = netdata.data[i].groupNumber;
this.dialogVisible = true;
for(let i=0;i<this.trainlist.length;i++){
if(this.trainlist[i].groupNumber == this.groupnum){
// console.log(this.trainlist[i].gear);
// this.groupnum
this.$refs.centercontrol.centerstate(this.trainlist[i].gear);
}
}
this.value = this.groupnum;
this.nowdrive = this.groupnum;
// bindSimulationTrain(this.group,this.selVal).then(netdata => {
//
//
// }).catch(error => {
// });
}
}
this.options.push(option);
}
this.options.sort(
function(obj1,obj2) {
let val1 = obj1.value;
let val2 = obj2.value;
return val1 - val2;
}
);
});
//
if(this.tuoguanbutton == true){
let netdata = this.$store.state.training.memberData;
for(let k in netdata){
if(netdata[k].userId == this.userId){
// console.log(this.$store.state.scriptRecord.type);
this.userrole = netdata[k].type;
if(netdata[k].trust){
this.tuoguanstatus = netdata[k].trust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}
break;
}
}
}
},
updateDriveValue(newvalue){
if(newvalue != this.value){
this.value = newvalue;
this.groupnum = newvalue;
}
},
updatetrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => {
this.options = [];
this.trainlist = netdata.data;
for(let i=0;i<netdata.data.length;i++){
let option= {
value: netdata.data[i].groupNumber,
label: netdata.data[i].groupNumber,
name:null,
}
option.disabled = false;
if(netdata.data[i].name){
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.initMsg = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.groupNumber = netdata.data[i].groupNumber;
option.disabled = true;
}
if(netdata.data[i].driverId){
if(netdata.data[i].driverId == this.userId){
this.selVal = netdata.data[i].groupNumber;
this.groupnum = netdata.data[i].groupNumber;
}
}
this.options.push(option);
}
this.options.sort(
function(obj1,obj2) {
let val1 = obj1.value;
let val2 = obj2.value;
return val1 - val2;
}
);
});
//
if(this.tuoguanbutton == true){
let netdata = this.$store.state.training.memberData;
for(let k in netdata){
if(netdata[k].userId == this.userId){
// console.log(this.$store.state.scriptRecord.type);
this.userrole = netdata[k].type;
if(netdata[k].trust){
this.tuoguanstatus = netdata[k].trust;
if(this.tuoguanstatus){
this.tuoguanbuttonmsg = "取消托管";
}else{
this.tuoguanbuttonmsg = "托管";
}
}
break;
}
}
// getSimulationMembersNew(this.group).then(netdata => {
// for(let i=0,leni=netdata.data.length;i<leni;i++){
// if(netdata.data[i].userId){
// if(netdata.data[i].userId == this.userId){
// this.userrole = netdata.data[i].role;
// if(netdata.data[i].trust){
// this.tuoguanstatus = netdata.data[i].trust;
// if(this.tuoguanstatus){
// this.tuoguanbuttonmsg = "";
// }else{
// this.tuoguanbuttonmsg = "";
// }
// }
// i=leni;
// }
// }
// }
// this.userrole = netdata.data.role;
// if(netdata.data.trust){
// this.tuoguanstatus = netdata.data.trust;
// if(this.tuoguanstatus){
// this.tuoguanbuttonmsg = "";
// }else{
// this.tuoguanbuttonmsg = "";
// }
// }
// });
}
}
},
}
</script>
<style>
.drivepane{
width:30%;
height:320px;
right:500px;
bottom:0;
position: absolute;
background-size: 100% 100%;
border-radius:10px;
}
.panebutton{
height: 73px;
width: 60px;
position: absolute;
text-align: center;
cursor:pointer;
}
.panebutton2{
height: 73px;
width: 80px;
position: absolute;
text-align: center;
cursor:pointer;
}
.buttonimg{
top:0;
/* position: absolute; */
height: 40px;
width: 40px;
}
.buttonimg2{
top:0;
left:10px;
position: absolute;
height: 60px;
width: 60px;
}
.buttontext{
width:100%;
bottom:0px;
/* position: absolute; */
color: #FFFFFF;
font-size: 4px;
}
.buttontext2{
width:100%;
bottom:0px;
position: absolute;
color: #FFFFFF;
font-size: 4px;
}
.switchpane{
width:30px;
height:30px;
position:absolute;
cursor:pointer;
}
.switchimg{
width:100%;
height:100%;
}
.selecttraintext{
font-size: 18px;
}
</style>

View File

@ -0,0 +1,415 @@
<template>
<div style="width:25%;height:100%;position:absolute;bottom:0;left:0;">
<!-- ATB启动 -->
<!-- <div id="atb" class="panebutton" style="top:3%;left:42%;" @tap="atbclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.ATBStart') }}</div>
</div> -->
<!-- BM/CBTC -->
<!-- <div id="bmcbtc" class="panebutton" style="top:3%;left:56%;" @tap="bmcbtcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">BM/CBTC</div>
</div> -->
<!-- RM -->
<!-- <div id="rm" class="panebutton" style="top:3%;left:70%;" @tap="rmclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">RM</div>
</div> -->
<!-- 关左门 -->
<!-- <div id="dlclose" class="panebutton" style="bottom:3%;left:3%;" @tap="dlcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.closeLeftDoor') }}</div>
</div> -->
<!-- 开左门A -->
<!-- <div id="dlopen" class="panebutton" style="bottom:3%;left:14%;" @tap="dloclick">
<img class="buttonimg" :src="redimg" />
<div class="buttontext">{{ $t('jlmap3d.openLeftDoor') }}</div>
</div> -->
<!-- ATO启动A -->
<!-- <div id="atoa" class="panebutton" style="bottom:3%;left:42%;" @tap="atoaclick">
<img class="buttonimg" :src="apoimg" />
<div class="buttontext">{{ $t('jlmap3d.ATOStart') }}</div>
</div> -->
<!-- cbtc -->
<!-- <div id="cbtc" class="panebutton" style="bottom:3%;left:70%;" @tap="cbtcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">CBTC</div>
</div> -->
<!-- 电笛按钮 -->
<!-- <div id="elflute" class="panebutton" style="bottom:3%;left:84%;" @tap="elfluteclick">
<img class="buttonimg" :src="grayimg" />
<div class="buttontext">{{ $t('jlmap3d.electricHornButton') }}</div>
</div> -->
</div>
</template>
<script>
import Vue from 'vue';
// import { sendSimulationCommand } from '@/api/simulation.js';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export default {
name: 'LeftPane',
components: {
},
data() {
return {
apoimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
greenzimg:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
redzimg:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
redimg:JL3D_LOCAL_STATIC+"/jl3d/control/red.png",
greenlimg:JL3D_LOCAL_STATIC+"/jl3d/control/greenl.png",
grayimg:JL3D_LOCAL_STATIC+"/jl3d/control/gray.png",
zuoimg:JL3D_LOCAL_STATIC+"/jl3d/control/zuo.png",
niuimg:JL3D_LOCAL_STATIC+"/jl3d/control/niu.png",
aircomimg:JL3D_LOCAL_STATIC+"/jl3d/control/aircom.png",
passlighttf:"rotate(0deg)",
sivtf:"rotate(0deg)",
driverlighttf:"rotate(0deg)",
headlighttf:"rotate(0deg)",
}
},
watch: {
'$store.state.app.atostate': function (val,newval) {
if(val != newval){
if(newval == true){
this.apoimg = this.greenimg;
this.$store.dispatch('app/setAtoState', false);
}else{
this.apoimg = this.greenlimg;
this.$store.dispatch('app/setAtoState', true);
}
}
},
},
computed: {
group() {
return this.$store.state.app.group;
},
code() {
return this.$store.state.app.code;
},
traincode() {
return this.$store.state.app.driverTrain;
},
movespeed() {
return this.$store.state.app.movespeed;
},
drivedirect() {
return this.$store.state.app.drivedirect;
},
atostate(){
return this.$store.state.app.atostate;
}
},
mounted() {
},
beforeDestroy() {
},
methods: {
leftstate : function(lefts){
if(lefts.ato == true){
this.apoimg = this.greenlimg;
this.$store.dispatch('app/setAtoState', true);
}else{
this.apoimg = this.greenimg;
this.$store.dispatch('app/setAtoState', false);
}
},
leftcontrol : function(){
},
showmsg:function(data){
wx.showToast({
title: data,
icon: 'loading',
duration: 2000
});
},
setData : function(){
this.msgshow = false;
},
showcontrolmsg:function(data,callback){
this.controlmsg = data;
this.msgshow = true;
callback = callback || function(){
this.setData();
};
setTimeout( callback.bind(this),2000);
},
//
dloclick: function (e){
console.log(this.$t('jlmap3d.leftDoorOpen'));
if(this.movespeed == 0){
//this.showcontrolmsg("");
this.controlsend(this.traincode,"603","07","");
}
},
//
dlcclick: function (e){
console.log(this.$t('jlmap3d.leftDoorClose'));
if(this.movespeed == 0){
//this.showcontrolmsg("");
this.controlsend(this.traincode,"605","07","");
}
},
//
breakerclick: function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","breaker");
},
//
carwashclick: function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","carwash");
},
//
aircomclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","aircom");
},
//ATB
atbclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","atb");
},
//BMCBTC
bmcbtcclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","bm");
},
//RM
rmclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","rm");
},
//
relieveclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","relieve");
},
//ATOA
atoaclick : function (e){
//console.log("ato");
if(this.movespeed == 0){
if(this.drivedirect == "Drive"){
this.controlsend(this.traincode,"601","07","");
this.apoimg = this.greenlimg;
this.showcontrolmsg(this.$t('jlmap3d.ATOStart'));
this.$store.dispatch('app/setAtoState', true);
}
}
},
//ATOB
atobclick : function (e){
if(this.movespeed == 0){
if(this.drivedirect == "Drive"){
this.controlsend(this.traincode,"601","07","");
this.apoimg = this.greenimg;
this.showcontrolmsg(this.$t('jlmap3d.ATOStart'));
this.$store.dispatch('app/setAtoState', true);
}
}
},
//CBTC
cbtcclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","cbtc");
},
//
elfluteclick : function (e){
Vue.prototype.$stomp.send("/app/topic/simulation/drive","elflute");
},
controlsend:function(traincode,operation,type,param){
if(this.$store.state.app.userRole == "Driver"){
let command ={
code: traincode,
operation: operation,
type: type,
param: param
};
// sendSimulationCommand(this.group,command);
}else{
}
},
passlighttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
passlighttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=75;
let py=155;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<360 && angle>245){
if(angle<327 && angle>245){
this.passlighttf = "rotate(359deg)";
}else if(angle<360 && angle>327){
this.passlighttf = "rotate(90deg)";
}
}
}
},
passlighttouchend:function(e){
this.touchcontrol = false;
},
sivtouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
sivtouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=75;
let py=255;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<360 && angle>245){
if(angle<327 && angle>245){
this.sivtf = "rotate(359deg)";
}else if(angle<360 && angle>327){
this.sivtf = "rotate(90deg)";
}
}
}
},
sivtouchend:function(e){
this.touchcontrol = false;
},
driverlighttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
driverlighttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=75;
let py=355;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<360 && angle>245){
if(angle<327 && angle>245){
this.driverlighttf = "rotate(359deg)";
}else if(angle<360 && angle>327){
this.driverlighttf = "rotate(90deg)";
}
}
}
},
driverlighttouchend:function(e){
this.touchcontrol = false;
},
headlighttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
headlighttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=75;
let py=455;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<360 && angle>245){
if(angle<295 && angle>245){
this.headlighttf = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.headlighttf = "rotate(405deg)";
}else if(angle<360 && angle>338){
this.headlighttf = "rotate(90deg)";
}
}
}
},
headlighttouchend:function(e){
this.touchcontrol = false;
},
getAngle:function(px,py,mx,my){
//
let x = Math.abs(px-mx);
let y = Math.abs(py-my);
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
let cos = y/z;
let radina = Math.acos(cos);//
let angle = Math.floor(180/(Math.PI/radina));//
if(mx>px&&my>py){//
angle = 180 - angle;
}
if(mx==px&&my>py){//y
angle = 180;
}
if(mx>px&&my==py){//x
angle = 90;
}
if(mx<px&&my>py){//
angle = 180+angle;
}
if(mx<px&&my==py){//鼠标在x轴负方向
angle = 270;
}
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
return angle;
},
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,308 @@
<template>
<!-- <div style="width:25%;height:100%;position:absolute;left:75%;">
<div id="dropen" class="panebutton" style="bottom:1%;left:1%;" @tap="droclick">
<img class="buttonimg" :src="redlimg" />
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
</div>
<div id="drclose" class="panebutton" style="bottom:1%;left:41%;" @tap="drcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.closeRightDoor') }}</div>
</div>
<div id="urgestop" class="panebutton" style="top:1%;left:1%;">
<img class="buttonimg" :src="urgestopimg" />
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
</div>
<div id="doorpick" class="panebutton2" style="top:1%;left:33%;">
<img class="buttonimg2" :src="zuoimg" />
<img class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @touchstart='doordirecttouchstart' @touchmove='doordirecttouchmove' @touchend='doordirecttouchend'/>
<div class="tfbutton" style="font-size:1px;top:13px;left:5px;">{{ $t('jlmap3d.leftSide') }}</div>
<div class="tfbutton" style="font-size:1px;top:5px;left:33px;">{{ $t('jlmap3d.location0') }}</div>
<div class="tfbutton" style="font-size:1px;top:13px;left:50px;">{{ $t('jlmap3d.rightSide') }}</div>
<div class="buttontext2">{{ $t('jlmap3d.doorSideChoose') }}</div>
</div> -->
</div>
</template>
<script>
import Vue from 'vue';
// import { sendSimulationCommand } from '@/api/simulation.js';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export default {
name: 'RightPane',
components: {
},
data() {
return {
redlimg:JL3D_LOCAL_STATIC+"/jl3d/control/redl.png",
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
zuoimg:JL3D_LOCAL_STATIC+"/jl3d/control/zuo.png",
niuimg:JL3D_LOCAL_STATIC+"/jl3d/control/niu.png",
urgestopimg:JL3D_LOCAL_STATIC+"/jl3d/control/urgestop.png",
doordirecttou:"rotate(0deg)",
doormodetou:"rotate(0deg)",
watertou:"rotate(0deg)",
washtou:"rotate(0deg)",
}
},
watch: {
},
computed: {
group() {
return this.$store.state.app.group;
},
code() {
return this.$store.state.app.code;
},
traincode() {
return this.$store.state.app.driverTrain;
},
movespeed() {
return this.$store.state.app.movespeed;
},
},
mounted() {
},
beforeDestroy() {
},
methods: {
rightstate : function(rights){
},
rightcontrol : function(){
},
showmsg:function(data){
wx.showToast({
title: data,
icon: 'loading',
duration: 2000
});
},
showcontrolmsg:function(data,callback){
this.controlmsg = data;
this.msgshow = true;
callback = callback || function(){
this.setData();
};
setTimeout( callback.bind(this),2000);
},
droclick: function (e){
//console.log("");
if(this.movespeed == 0){
this.showcontrolmsg(this.$t('jlmap3d.rightDoorOpen'));
this.controlsend(this.traincode,"604","07","");
}
},
drcclick: function (e){
//console.log("");
if(this.movespeed == 0){
this.showcontrolmsg(this.$t('jlmap3d.rightDoorClose'));
this.controlsend(this.traincode,"606","07","");
}
},
urgestopclick: function (e){
},
controlsend:function(traincode,operation,type,param){
if(this.$store.state.app.userRole == "Driver"){
let command ={
code: traincode,
operation: operation,
type: type,
param: param
};
// sendSimulationCommand(this.group,command);
}else{
}
},
watertouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
watertouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=140;
let py=400;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<338 && angle>245){
if(angle<295 && angle>245){
this.watertou = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.watertou = "rotate(412deg)";
}
}
}
},
watertouchend:function(e){
this.touchcontrol = false;
},
washtouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
washtouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=140;
let py=510;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
// console.log(angle);
// this.washtou = "rotate("+(angle+85)+"deg)";
if(angle<360 && angle>245){
if(angle<295 && angle>245){
this.washtou = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.washtou = "rotate(412deg)";
}else if(angle<360 && angle>338){
this.washtou = "rotate(90deg)";
}
}
}
},
washtouchend:function(e){
this.touchcontrol = false;
},
doordirecttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
doordirecttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=230;
let py=180;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<338 && angle>219){
if(angle<245 && angle>219){
this.doordirecttou = "rotate(305deg)";
}else if(angle<295 && angle>245){
this.doordirecttou = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.doordirecttou = "rotate(412deg)";
}
}
}
},
doordirecttouchend:function(e){
this.touchcontrol = false;
},
doormodetouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
doormodetouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=230;
let py=280;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<338 && angle>219){
if(angle<245 && angle>219){
this.doormodetou = "rotate(305deg)";
Vue.prototype.$stomp.send("/app/topic/simulation/drive","AA");
}else if(angle<295 && angle>245){
this.doormodetou = "rotate(359deg)";
Vue.prototype.$stomp.send("/app/topic/simulation/drive","AM");
}else if(angle<338 && angle>295){
this.doormodetou = "rotate(412deg)";
Vue.prototype.$stomp.send("/app/topic/simulation/drive","MM");
}
}
}
},
doormodetouchend:function(e){
this.touchcontrol = false;
},
getAngle:function(px,py,mx,my){
//
let x = Math.abs(px-mx);
let y = Math.abs(py-my);
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
let cos = y/z;
let radina = Math.acos(cos);//
let angle = Math.floor(180/(Math.PI/radina));//
if(mx>px&&my>py){//
angle = 180 - angle;
}
if(mx==px&&my>py){//y
angle = 180;
}
if(mx>px&&my==py){//x
angle = 90;
}
if(mx<px&&my>py){//
angle = 180+angle;
}
if(mx<px&&my==py){//鼠标在x轴负方向
angle = 270;
}
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
return angle;
},
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,478 @@
<template>
<div style="width:100%;height:48%;position:absolute;top:0px;">
<!-- 换端 -->
<!-- <div id="ch" class="panebutton" style="top:8%;left:3%;"@click="changehead">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.ChangeHead') }}</div>
</div> -->
<!-- BM/CBTC -->
<!-- <div id="bmcbtc" class="panebutton" style="top:8%;left:17%;" @click="bmcbtcclick">
<img class="buttonimg" :src="cbtcbuttonimg" />
<div class="buttontext">BM/CBTC</div>
</div> -->
<!-- RM -->
<!-- <div id="rm" class="panebutton" style="top:8%;left:31%;" @click="rmclick">
<img class="buttonimg" :src="rmbuttonimg" />
<div class="buttontext">RM</div>
</div> -->
<!-- 关左门 -->
<!-- <div id="dlclose" class="panebutton" style="top:8%;left:45%;" @click="dlcclick">
<img class="buttonimg" :src="doorleftimg" />
<div class="buttontext">{{ $t('jlmap3d.closeLeftDoor') }}</div>
</div> -->
<!-- 开左门A -->
<!-- <div id="dlopen" class="panebutton" style="top:8%;left:59%;" @click="dloclick">
<img class="buttonimg" :src="redimg" />
<div class="buttontext">{{ $t('jlmap3d.openLeftDoor') }}</div>
</div> -->
<!-- ATO启动A -->
<!-- <div id="atoa" class="panebutton" style="top:8%;left:73%;" @click="atoaclick">
<img class="buttonimg" :src="atobuttonimg" />
<div class="buttontext">{{ $t('jlmap3d.ATOStart') }}</div>
</div> -->
<!-- 受电弓升 -->
<!-- <div id="sg" class="panebutton" style="bottom:6%;left:3%;" @click="sgclink">
<img class="buttonimg" :src="sgimg" />
<div class="buttontext">{{ $t('jlmap3d.electricGongSheng') }}</div>
</div> -->
<!-- 受电弓降 -->
<!-- <div id="jg" class="panebutton" style="bottom:6%;left:17%;" @click="jgclick">
<img class="buttonimg" :src="jgimg" />
<div class="buttontext">{{ $t('jlmap3d.pantographFall') }}</div>
</div> -->
<!-- ATP切除 -->
<!-- <div id="atp" class="panebutton" style="bottom:6%;left:31%;" @click="atpclick">
<img class="buttonimg" :src="atpimg" />
<div class="buttontext">{{ $t('jlmap3d.removalATP') }}</div>
</div> -->
<!-- <div id="dropen" class="panebutton" style="bottom:6%;left:45%;" @click="droclick">
<img class="buttonimg" :src="redlimg" />
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
</div>
<div id="drclose" class="panebutton" style="bottom:6%;left:59%;" @click="drcclick">
<img class="buttonimg" :src="doorrightimg" />
<div class="buttontext">{{ $t('jlmap3d.closeRightDoor') }}</div>
</div>
<div id="urgestop" class="panebutton" style="bottom:6%;left:73%;" @click="ebstop">
<img class="buttonimg" :style="urgestopStyle" :src="urgestopimg" />
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
</div>
<div id="doorpick" class="panebutton2" style="bottom:6%;left:85%;">
<img class="buttonimg2" :src="zuoimg" />
<img class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @touchstart='doordirecttouchstart' @touchmove='doordirecttouchmove' @touchend='doordirecttouchend'/>
<div class="tfbutton" style="font-size:1px;top:13px;left:5px;">{{ $t('jlmap3d.leftSide') }}</div>
<div class="tfbutton" style="font-size:1px;top:8px;left:33px;">{{ $t('jlmap3d.location0') }}</div>
<div class="tfbutton" style="font-size:1px;top:13px;left:50px;">{{ $t('jlmap3d.rightSide') }}</div>
<div class="buttontext2">{{ $t('jlmap3d.doorSideChoose') }}</div>
</div> -->
</div>
</template>
<script>
import Vue from 'vue';
// import { sendSimulationCommand } from '@/api/simulation.js';
import { trainSimulationDriveMode, trainSimulationAto ,trainSimulationAtp,trainSimulationChangeHead,trainSimulationDoorControl,trainSimulationEb } from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export default {
name: 'TopRightPane',
components: {
},
data() {
return {
move:0,
movex:"20%",
apoimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
sgimg:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
jgimg:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
atpimg:JL3D_LOCAL_STATIC+"/jl3d/control/atp.png",
slimg:JL3D_LOCAL_STATIC+"/jl3d/control/gray.png",
zuoimg:JL3D_LOCAL_STATIC+"/jl3d/control/zuo.png",
niuimg:JL3D_LOCAL_STATIC+"/jl3d/control/niu.png",
toutransform:"rotate(0deg)",
redlimg:JL3D_LOCAL_STATIC+"/jl3d/control/redl.png",
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
urgestopimg:JL3D_LOCAL_STATIC+"/jl3d/control/urgestop.png",
iconrotate:0,
doordirecttou:"rotate(0deg)",
doormodetou:"rotate(0deg)",
watertou:"rotate(0deg)",
washtou:"rotate(0deg)",
greenzimg:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
redzimg:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
redimg:JL3D_LOCAL_STATIC+"/jl3d/control/red.png",
greenlimg:JL3D_LOCAL_STATIC+"/jl3d/control/greenl.png",
grayimg:JL3D_LOCAL_STATIC+"/jl3d/control/gray.png",
aircomimg:JL3D_LOCAL_STATIC+"/jl3d/control/aircom.png",
passlighttf:"rotate(0deg)",
sivtf:"rotate(0deg)",
driverlighttf:"rotate(0deg)",
headlighttf:"rotate(0deg)",
// atoOn:null,
atobuttonimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
// driveMode:null,
rmbuttonimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
// runLevel:null,
cbtcbuttonimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
doorleftstatus:false,
doorrightstatus:false,
doorleftimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
doorrightimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
//lightdark
sgl:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
jgl:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
sgd:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
jgd:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
}
},
watch: {
},
props: {
groupNum: {
type: String,
default: null
},
},
computed: {
group() {
return this.$route.query.group;
},
urgestopStyle:function(){
let arr = new Array();
arr.push('transform:');
arr.push('rotate('+this.iconrotate+'deg) ');
return arr.join("");
}
},
mounted() {
window.updatabuttonlight = this.updatabuttonlight;
window.updatedoorlight = this.updatedoorlight;
},
beforeDestroy() {
},
methods: {
topstate : function(tops){
if(tops.atpCutOff == true){
}else{
}
},
topcontrol : function(){
},
showmsg:function(data){
wx.showToast({
title: data,
icon: 'loading',
duration: 2000
});
},
showcontrolmsg:function(data,callback){
this.controlmsg = data;
this.msgshow = true;
callback = callback || function(){
this.setData();
};
setTimeout( callback.bind(this),2000);
},
stopmodetouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
stopmodetouchmove:function(e){//finger move
if(this.touchcontrol == true){
this.getAngle(e.changedTouches[0].clientX,e.changedTouches[0].clientY);
}
},
stopmodetouchend:function(e){
this.touchcontrol = false;
},
getAngle:function(mx,my){
//
let px=140;
let py=510;
let x = Math.abs(px-mx);
let y = Math.abs(py-my);
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
let cos = y/z;
let radina = Math.acos(cos);//
let angle = Math.floor(180/(Math.PI/radina));//
if(mx>px&&my>py){//
angle = 180 - angle;
}
if(mx==px&&my>py){//y
angle = 180;
}
if(mx>px&&my==py){//x
angle = 90;
}
if(mx<px&&my>py){//
angle = 180+angle;
}
if(mx<px&&my==py){//鼠标在x轴负方向
angle = 270;
}
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
if(angle<338 && angle>219){
if(angle<245 && angle>219){
this.toutransform = "rotate(305deg)";
}else if(angle<295 && angle>245){
this.toutransform = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.toutransform = "rotate(412deg)";
}
}
},
doordirecttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
doordirecttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=230;
let py=180;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<338 && angle>219){
if(angle<245 && angle>219){
this.doordirecttou = "rotate(305deg)";
}else if(angle<295 && angle>245){
this.doordirecttou = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.doordirecttou = "rotate(412deg)";
}
}
}
},
doordirecttouchend:function(e){
this.touchcontrol = false;
},
sgclink: function (e){
//console.log("");
},
jgclick: function (e){
//console.log("");
},
slclick: function (e){
//console.log("");
},
atpclick: function (e){
//console.log("atp");
let data = {
groupNumber:this.groupNum,
cutOff:true,
};
trainSimulationAtp(this.group,data).then(netdata => {
// console.log(netdata);
});
},
atbclick: function (e){
},
changehead: function(e){
let data = {
groupNumber:this.groupNum,
};
trainSimulationChangeHead(this.group,data).then(netdata => {
// console.log(netdata);
});
},
bmcbtcclick: function (e){
let data = {
groupNumber:this.groupNum,
driveMode:"CM"
};
trainSimulationDriveMode(this.group,data).then(netdata => {
// console.log(netdata);
});
},
rmclick: function (e){
let data = {
groupNumber:this.groupNum,
driveMode:"RM"
};
trainSimulationDriveMode(this.group,data).then(netdata => {
// console.log(netdata);
});
},
updatedoorlight: function (newdata){
if(newdata.leftDoorCanClose != undefined){
// this.doorleftstatus = newdata.leftDoorCanClose;
if(newdata.leftDoorCanClose == true){
this.doorleftimg = this.greenlimg;
}else{
this.doorleftimg = this.greenimg;
}
}
if(newdata.rightDoorCanClose != undefined){
// this.doorrightstatus = newdata.rightDoorCanClose;
if(newdata.rightDoorCanClose == true){
this.doorrightimg = this.greenlimg;
}else{
this.doorrightimg = this.greenimg;
}
}
},
dloclick: function (e){
let data = {
groupNumber:this.groupNum,
right:false,
open:true,
};
trainSimulationDoorControl(this.group,data).then(netdata => {
// console.log(netdata);
});
},
dlcclick: function (e){
let data = {
groupNumber:this.groupNum,
right:false,
open:false,
};
trainSimulationDoorControl(this.group,data).then(netdata => {
// console.log(netdata);
this.doorleftimg = this.greenimg;
});
},
droclick: function (e){
let data = {
groupNumber:this.groupNum,
right:true,
open:true,
};
trainSimulationDoorControl(this.group,data).then(netdata => {
// console.log(netdata);
});
},
drcclick: function (e){
let data = {
groupNumber:this.groupNum,
right:true,
open:false,
};
trainSimulationDoorControl(this.group,data).then(netdata => {
// console.log(netdata);
this.doorrightimg = this.greenimg;
});
},
atoaclick: function (e){
let data = {
groupNumber:this.groupNum,
};
trainSimulationAto(this.group,data).then(netdata => {
// console.log(netdata);
});
},
cbtcclick: function (e){
},
ebstop: function (e){
let data = {
groupNumber:this.groupNum,
};
trainSimulationEb(this.group,data).then(netdata => {
// console.log(netdata);
});
},
updatabuttonlight: function (data){
// console.log(data);
if(data.runLevel){
// this.runLevel = data.runLevel;
if(data.runLevel == "CBTC"){
this.cbtcbuttonimg = this.greenlimg;
}else{
this.cbtcbuttonimg = this.greenimg;
}
}
if(data.driveMode){
// this.driveMode = data.driveMode;
if(data.driveMode == "RM"){
this.rmbuttonimg = this.greenlimg;
}else{
this.rmbuttonimg = this.greenimg;
}
}
if(typeof(data.atoOn) != "undefined"){
// console.log(data.atoOn);
// this.atoOn = data.atoOn;
if(data.atoOn){
this.atobuttonimg = this.greenlimg;
}else{
this.atobuttonimg = this.greenimg;
}
}
if(typeof(data.circuitEB) != "undefined"){
if(data.circuitEB){
this.iconrotate = 0;
}else{
this.iconrotate = 160;
}
}
}
},
}
</script>
<style>
.aa{
transition: all 2s;
}
.go{
transform:rotate(-180deg);
transition: all 2s;
}
</style>

View File

@ -0,0 +1,459 @@
<template>
<div id="drivediv" class="jalmap3ddiv" >
<!-- <div class="trainstatus">
{{$t('jlmap3d.trainGroupNumber')}}{{ trainnum }}</br>
{{ stoptimes }}
</div> -->
<div class="display-draft">
<el-button-group>
<!-- <el-button type="primary" @click="raystand">站台选择</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">{{backmsg}}</el-button>
</el-button-group>
</div>
<!-- <Jlmap3d-Msg v-bind:msgdata="msgdata" >
</Jlmap3d-Msg > -->
<div id="jlsimulation" class="jlmap3ddraw">
<canvas id="canvastexture" />
</div>
<div id="jlcctv" v-show="cctvshow" class="jlmap3cctv">
</div>
<div class="msg" v-show ="msgshow">
<div class="msgtext">
{{controlmsg}}
</div>
</div>
<Drive-Mmi v-if="mmishow" ref="mmiui" />
<!-- <Drive-Tms v-if="mmishow" /> -->
<Drive-Control v-if="dcontrolshow" ref="dcontrol" @warningmsg="warningmsg" @warningmsgoff="warningmsgoff" />
</div>
</template>
<script>
import Vue from 'vue';
import localStore from 'storejs';
import axios from 'axios';
import store from '@/store/index';
import { mapGetters } from 'vuex';
// import ShowProperty from '@/views/jlmap3d/show/property';
import { simulationNotify, setTrainingCbtcInitTime } from '@/api/simulation';
import { getPublishMapDetail, getPublish3dMapDetail } from '@/api/jlmap3d/load3ddata';
import { UrlConfig } from '@/scripts/ConstDic';
import { JLmapDriving } from '@/jlmap3d/jl3drailwaydrive/jl3drailwaydrive';
import DriveMmi from '@/views/jlmap3d/railwaydrive/sceneview/mmiview';
import DriveTms from '@/views/jlmap3d/railwaydrive/sceneview/tmsview';
import DriveControl from '@/views/jlmap3d/railwaydrive/drivecontrol/drivecontrol';
var train;
export default {
name: 'Jl3dRailwayDrive',
components: {
DriveMmi,
// DriveTms,
DriveControl
},
data() {
return {
driveIndex:1500,
trainlist: null,
stationlist: null,
msgdata: null,
training: {
id: '',
name: '',
remarks: ''
},
mapdata: null,
jlmap3d: null,
selectmodel: null,
cctvshow:true,
cctvbuttonmsg: this.$t('jlmap3d.surveillanceHidden'),
mmishow: false,
showbuttonmsg: this.$t('jlmap3d.trainInstrumentationDisplay'),
backmsg:this.$t('global.back'),
// trainnum: '',
// stoptimes: '',
dcontrolshow: true,
msgshow:false,
controlmsg:"不能选择其它列车",
};
},
watch: {
'jlmap3d.nowspeed': {
handler: function (newVal, oldVal) {
if (newVal != oldVal) {
if (this.mmishow == true) {
this.$refs.mmiui.updatespeed(newVal);
}
}
}
},
'jlmap3d.nowmxlen': {
handler: function (newVal, oldVal) {
if (newVal != oldVal) {
if (this.mmishow == true) {
this.$refs.mmiui.updatelen(newVal);
}
}
}
},
'jlmap3d.atpspeed': {
handler: function (newVal, oldVal) {
if (newVal != oldVal) {
if (this.mmishow == true) {
this.$refs.mmiui.updateatpspeed(newVal);
}
}
}
},
'jlmap3d.atospeed': {
handler: function (newVal, oldVal) {
if (newVal != oldVal) {
if (this.mmishow == true) {
this.$refs.mmiui.updateatospeed(newVal);
}
}
}
},
// 'jlmap3d.trainnum': {
// handler: function (newVal, oldVal) {
// if (newVal != oldVal) {
// this.trainnum = newVal;
// }
// }
// },
// 'jlmap3d.stime': {
// handler: function (newVal, oldVal) {
// if (newVal != oldVal) {
// this.stoptimes = newVal;
// }
// }
// },
// 'jlmap3d.drivecount': {
// handler: function (newVal, oldVal) {
// if (newVal != oldVal) {
// this.$refs.mmiui.updatedrivedata(this.jlmap3d.drivedata);
// }
// }
// },
},
beforeDestroy() {
if (this.jlmap3d) {
this.jlmap3d.webwork.postMessage('off');
this.jlmap3d.webwork.terminate();
this.jlmap3d.endsocket();
this.jlmap3d.dispose();
this.jlmap3d = null;
// this.$destroy();
}
},
destroyed(){
// window.removeEventListener('popstate', this.goBack, false);
},
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.type == "DRIVE"){
this.backmsg = "退出";
}
// if (window.history && window.history.pushState) {
// history.pushState(null, null, document.URL);
// window.addEventListener('popstate', this.goBack, false);
// }
// this.$refs.mmiui.init();
},
methods: {
// goBack(){
// console.log(this.$route);
// if(this.$route.query.type == "DRIVE"){
// store.dispatch('LogOut').then(() => {
// location.reload();
// });
// }else{
// this.$emit('showdriving');
// if(this.jlmap3d){
// this.jlmap3d.eventoff();
// this.jlmap3d.animateoff();
// }
//
// // this.jlmap3d = null;
// }
// },
show: function (skinCode,group,zindex,isTraining) {
// console.log("show");
// console.log(skinCode);
// console.log(this.jlmap3d);
if(zindex){
this.driveIndex = zindex;
document.getElementById("drivediv").style.zIndex = zindex;
}
if (this.jlmap3d == null) {
this.init(skinCode,group);
} else {
// this.jlmap3d.restart();
this.jlmap3d.eventon();
this.jlmap3d.animateon();
}
if(isTraining){
this.$refs.dcontrol.changeTrainSelect(isTraining);
}
},
init: function (skinCode,group) {
const mapdata = this.$store.getters['map/map'];
const dom = document.getElementById('app');
let translation = {
trainAtoOn: this.$t('jlmap3d.trainAtoOn'),
trainAtoOff: this.$t('jlmap3d.trainAtoOff'),
stopTime: this.$t('jlmap3d.stopTime')
};
let project = this.$route.query.project;
// console.log(project);
if(project){
this.jlmap3d = new JLmapDriving(dom, mapdata, skinCode,this.$store,translation,group,project);
}else{
this.jlmap3d = new JLmapDriving(dom, mapdata, skinCode,this.$store,translation,group,project);
}
// console.log(translation);
// this.jlmap3d = new JLmapDriving(dom, mapdata, skinCode,this.$store,translation,group);
this.jlmap3d.eventon();
this.cctvshow = false;
},
raystand() {
this.jlmap3d.rayswitch('stand');
},
raytrain() {
this.jlmap3d.rayswitch('train');
},
raysection() {
this.jlmap3d.rayswitch('section');
},
raysignal() {
this.jlmap3d.rayswitch('signal');
},
rayswitch() {
this.jlmap3d.rayswitch('switch');
},
sstation(changedata) {
this.jlmap3d.updatecamera(changedata.mesh, 'station');
},
strain(changedata) {
if (changedata.dispose == false) {
this.jlmap3d.updatecamera(changedata, 'train');
}
},
back() {
if(this.$route.query.type == "DRIVE"){
store.dispatch('LogOut').then(() => {
location.reload();
});
}else{
this.$emit('showdriving');
this.jlmap3d.eventoff();
this.jlmap3d.animateoff();
// this.jlmap3d = null;
}
},
showplane() {
if (this.mmishow == true) {
this.showbuttonmsg = this.$t('jlmap3d.trainInstrumentationHidden');
this.mmishow = false;
} else {
this.showbuttonmsg = this.$t('jlmap3d.trainInstrumentationDisplay');
this.mmishow = true;
}
},
datanew(){
this.dcontrolshow = true;
},
cctvplane() {
if (this.cctvshow == true) {
this.cctvbuttonmsg = this.$t('jlmap3d.surveillanceHidden');
this.cctvshow = false;
this.jlmap3d.cctvoff();
} else {
this.cctvbuttonmsg = this.$t('jlmap3d.surveillanceDisplay');
this.cctvshow = true;
this.jlmap3d.cctvon();
}
},
updatestatus(newdata){
// if(newdata.groupNumber){
// this.trainnum = newdata.groupNumber;
//
// updateDriveValue(this.trainnum);
// }
updatedoorlight(newdata);
if(this.$refs.mmiui){
this.$refs.mmiui.updatetrainstatus(newdata);
}
updatabuttonlight(newdata);
},
warningmsg(nowmsg){
this.controlmsg = nowmsg;
this.msgshow = true;
setTimeout(this.warningmsgoff,3000);
},
warningmsgoff(){
this.msgshow = false;
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.display-card {
z-index: 9;
display: inline;
position: absolute;
top: 17px;
float: left;
left: 160px;
height: 32px;
}
.display-card .el-row {
line-height: 32px !important;
}
.display-score {
background-color: black;
display: -moz-inline-box;
display: inline-block;
text-align: left;
/* border: 1px solid lightskyblue; */
/* width: 100px; */
height: 32px;
line-height: 24px;
border-radius: 4px;
padding-left: 2px;
margin-left: 10px;
font-family: "Microsoft" !important;
font-size: 18px !important;
color: #fff;
}
.display-draft {
/* z-index: 1000; */
position: absolute;
float: right;
right: 40px;
top: 28px;
}
#jlsimulation {
width: 937px;
height: 937px;
}
.trainstatus{
left:48%;
top:0;
width:fit-content;
width:-webkit-fit-content;
width:-moz-fit-content;
height:60px;
background: #000000;
position:absolute;
text-align: left;
color:white;
font-size:25px;
}
.jalmap3ddiv {
position: absolute;
width: 100%;
height: 100%;
top:0;
z-index: 1500;
}
.jlmap3ddraw {
float: left;
left: 0;
//left:20%;
width: 100%;
height: 100%;
position:absolute;
z-index: -1;
}
.jlmap3cctv{
float: left;
left: 0;
top:0;
//left:20%;
width: 20%;
height: 20%;
position:absolute;
z-index: -1;
}
#canvastexture {
position: absolute;
float: left;
left: 0;
z-index: -12;
}
.msg{
width:40%;
height:50px;
left:30%;
top:0;
text-align: center;
position:absolute;
}
.msgtext{
width:100%;
height:50px;
border-radius:5px;
background:#C0C0C0;
color:#FFFFFF;
font-size: 40px;
}
</style>

View File

@ -0,0 +1,78 @@
/* N区 跳停扣车显示 */
.narea{
left:0px;top:0;
}
/* D区 信息设置按钮 */
.darea{
right:0px;top:0;
}
/* M1区 当前驾驶模式显示 */
.m1area{
left:0px;top:12%;
}
/* M2区 当前运行等级显示 */
.m2area{
right:0px;top:12%;
}
/* M3区 折返状态显示 */
.m3area{
left:0px;top:24%;
}
/* M4区 列车进入停车窗显示 */
.m4area{
right:0px;top:24%;
}
/* M5区 车门状态及门允许侧显示 */
.m5area{
left:0px;top:36%;
}
/* M6区 发车信息显示 */
.m6area{
right:0px;top:36%;
}
/* M7区 客室门控制模式显示 */
.m7area{
left:0px;top:48%;
}
/* M8区 屏蔽门状态显示 */
.m8area{
right:0px;top:48%;
}
/* M9区 设备故障显示 */
.m9area{
left:0px;top:60%;
}
/* M10区 停车场/车辆段的转换区显示 */
.m10area{
right:0px;top:60%;
}
/* C1区 ATO牵引制动状态显示 */
.c1area{
}
/* C2区 最高预设驾驶模式显示 */
.c2area{
left:70px;
}
/* C3区 列车完整性状态显示 */
.c3area{
left:140px;
}
/* C5区 列车头尾设备状态显示 */
.c5area{
right:0;
}

View File

@ -0,0 +1,127 @@
import Vue from 'vue';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export function mmirender(dom) {
let scope = this;
let scene = new THREE.Scene();
scene.add( new THREE.AmbientLight( 0xffffff ) );
// camera
let camera = new THREE.PerspectiveCamera( 30, 360 / 200, 1, 100 );
camera.position.set( 0, 0, 80 );
let renderer = new THREE.WebGLRenderer( );
// renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( 360, 200 );
var geometry = new THREE.PlaneBufferGeometry( 80, 80, 2 );
var material = new THREE.MeshBasicMaterial( {color: 0x000000, side: THREE.DoubleSide} );
var plane = new THREE.Mesh( geometry, material );
scene.add( plane );
var texture = new THREE.TextureLoader().load( JL3D_LOCAL_STATIC+'/jl3d/biao.png' );
var geometry = new THREE.PlaneBufferGeometry( 60, 60, 2 );
var material = new THREE.MeshBasicMaterial( {map: texture, side: THREE.DoubleSide} );
var kd = new THREE.Mesh( geometry, material );
kd.position.x = -5;
scene.add( kd );
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 2 );
var material = new THREE.MeshBasicMaterial( {color: 0x000000, side: THREE.DoubleSide} );
var zc = new THREE.Mesh( geometry, material );
zc.position.x = 2.48;
zc.position.y = -0.34;
zc.position.z = 1;
//zc.rotation.y = Math.PI;
//0刻度-Math.PI*65.8/100
//110刻度-Math.PI*234.8/100
zc.rotation.z = -Math.PI*65.8/100;
scene.add( zc );
var geometry = new THREE.PlaneBufferGeometry( 14, 0.8, 2 );
var material = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
var zz = new THREE.Mesh( geometry, material );
zz.position.z = 1;
zz.position.x = 11;
zc.add( zz );
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 2 );
var material = new THREE.MeshBasicMaterial( {color: 0x000000, side: THREE.DoubleSide} );
var atp = new THREE.Mesh( geometry, material );
atp.position.x = 2.48;
atp.position.y = -0.34;
atp.position.z = 1;
//zc.rotation.y = Math.PI;
//0刻度-Math.PI*65.8/100
//110刻度-Math.PI*234.8/100
atp.rotation.z = -Math.PI*65.8/100;
scene.add( atp );
var geometry = new THREE.CircleBufferGeometry(1.5, 1 );
var material = new THREE.MeshBasicMaterial( {color: 0xea0000, side: THREE.DoubleSide} );
var atpmark = new THREE.Mesh( geometry, material );
atpmark.position.z = 1;
atpmark.position.x = 21;
atpmark.rotation.y = Math.PI;
atp.add( atpmark );
var geometry = new THREE.PlaneBufferGeometry( 2, 2, 2 );
var material = new THREE.MeshBasicMaterial( {color: 0x000000, side: THREE.DoubleSide} );
var ato = new THREE.Mesh( geometry, material );
ato.position.x = 2.48;
ato.position.y = -0.34;
ato.position.z = 1;
//zc.rotation.y = Math.PI;
//0刻度-Math.PI*65.8/100
//110刻度-Math.PI*234.8/100
ato.rotation.z = -Math.PI*65.8/100;
scene.add( ato );
var geometry = new THREE.CircleBufferGeometry(1.5, 1 );
var material = new THREE.MeshBasicMaterial( {color: 0xEEEE00, side: THREE.DoubleSide} );
var atomark = new THREE.Mesh( geometry, material );
atomark.position.z = 1;
atomark.position.x = 21;
atomark.rotation.y = Math.PI;
ato.add( atomark );
dom.appendChild( renderer.domElement);
renderer.render( scene, camera );
// animate();
function animate() {
//zc.rotation.z -= 0.01;
// requestAnimationFrame(animate);
}
this.updatezz = function(speed){
zc.rotation.z = -Math.PI*(65.8+169*speed/110)/100;
renderer.render( scene, camera );
}
this.updateatp = function(atpspeed){
if(atpspeed<0){
atp.position.x = 10000;
}else{
atp.position.x = 2.48;
atp.rotation.z = -Math.PI*(65.8+169*atpspeed/110)/100;
}
// renderer.render( scene, camera );
}
this.updateato = function(atospeed){
if(atospeed<0){
ato.position.x = 10000;
}else{
ato.position.x = 2.48;
ato.rotation.z = -Math.PI*(65.8+169*atospeed/110)/100;
}
// renderer.render( scene, camera );
}
}

View File

@ -0,0 +1,98 @@
import Vue from 'vue';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export function mmiimage() {
let scope = this;
//n
this.n = [];
this.n['tiaoting'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/n-tiaoting.png';
this.n['kouche'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/n-kouche.png';
this.n['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
//d
this.d = []
this.d['info'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/d-info.png';
this.m1 = [];
this.m1['start'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m1['am'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-am.png';
this.m1['cm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-cm.png';
this.m1['rm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-rm.png';
this.m2 = [];
this.m2['start'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m2['il'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-il.png';
this.m2['itc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-itc.png';
this.m2['cbtc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m2-cbtc.png';
this.m3 = [];
this.m3['zhefan'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m3-zhefan.png';
this.m3['zhefanzhong'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m3-zhefanzhong.png';
this.m3['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m4 = [];
this.m4['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m4['out'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m4-out.png';
this.m4['in'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m4-in.png';
this.m5 = [];
this.m5['state15'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m5-15.png';
this.m5['rightdoor'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m5-rightdoor.png';
this.m5['leftdoor'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m5-leftdoor.png';
this.m5['noalloffdoor'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m5-noalloffdoor.png';
this.m5['noallondoor'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m5-noallondoor.png';
this.m6 = [];
this.m6['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m6['fache'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m6-fache.png';
this.m6['closedoor'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m6-closedoor.png';
this.m7 = [];
this.m7['momc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m7-momc.png';
this.m7['aomc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m7-aomc.png';
this.m7['aoac'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m7-aoac.png';
this.m7['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m8 = [];
this.m8['dahua'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m8-dahua.png';
this.m8['jinjizhidong'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m8-jinjizhidong.png';
this.m8['doornotclose'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m8-doornotclose.png';
this.m8['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m9 = [];
this.m9['rad'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m9-rad.png';
this.m9['atp'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m9-atp.png';
this.m9['ato'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m9-ato.png';
this.m9['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.m10 = [];
this.m10['jinduan'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m10-jinduan.png';
this.m10['shiwei'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m10-shiwei.png';
this.m10['querenxinhao'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m10-querenxinhao.png';
this.m10['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.c1 = [];
this.c1['qianyin'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c1-qianyin.png';
this.c1['duoxing'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c1-duoxing.png';
this.c1['zhidong'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c1-zhidong.png';
this.c1['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.c2 = [];
this.c2['rm'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/m1-rm.png';
this.c2['cmi'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-cm-i.png';
this.c2['cmc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-cm-c.png';
this.c2['ami'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-am-i.png';
this.c2['amc'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c2-am-c.png';
this.c2['none'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/none.png';
this.c3 = [];
this.c3['normal'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c3-normal.png';
this.c3['lose'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c3-lose.png';
this.c5 = [];
this.c5['normal'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c5-normal.png';
this.c5['lose'] = JL3D_LOCAL_STATIC+'/jl3d/mmi/c5-lose.png';
}

View File

@ -0,0 +1,647 @@
<template>
<div class = "mmi" >
<div id="meter" class = "meter" >
<div class="speedshow" >{{nowspeed}}</div>
<div class="maxlenshow" :style="{height:malen}"></div>
</div>
<div class = "top">
<!-- <div style="left:5%;width:10%;height:100%;" :style="{background:a1state}">
</div> -->
<!-- <div class="toptext" style="left:16%;top:15px;">
{{$t('jlmap3d.terminal')}}{{endstation}}
</div>
<div class="toptext" style="left:46%;top:15px;">
{{$t('jlmap3d.nextStation')}}{{nextstation}}
</div> -->
<!-- <div class="toptext" style="left:76%;top:15px;">
T0002
</div>
<div class="toptext" style="left:88%;top:15px;">
C00001
</div> -->
</div>
<!-- <div class = "right">
<div class = "rightstatus narea n-tiaoting" :style="{backgroundImage: 'url(' + nimage + ')' }">
</div>
<div class = "rightstatus darea d-info" :style="{backgroundImage: 'url(' + dimage + ')' }">
</div>
<div class = "rightstatus m1area m1-am" :style="{backgroundImage: 'url(' + m1image + ')' }">
</div>
<div class = "rightstatus m2area m2-cbtc" :style="{backgroundImage: 'url(' + m2image + ')' }">
</div>
<div class = "rightstatus m3area m3-zhefan" :style="{backgroundImage: 'url(' + m3image + ')' }">
</div>
<div class = "rightstatus m4area m4-in" :style="{backgroundImage: 'url(' + m4image + ')' }">
</div>
<div class = "rightstatus m5area m5-15" :style="{backgroundImage: 'url(' + m5image + ')' }">
</div>
<div class = "rightstatus m6area m6-fache" :style="{backgroundImage: 'url(' + m6image + ')' }">
</div>
<div class = "rightstatus m7area m7-aoac" :style="{backgroundImage: 'url(' + m7image + ')' }">
</div>
<div class = "rightstatus m8area m8-doornotclose" :style="{backgroundImage: 'url(' + m8image + ')' }">
</div>
<div class = "rightstatus m9area m9-ato" :style="{backgroundImage: 'url(' + m9image + ')' }">
</div>
<div class = "rightstatus m10area m10-querenxinhao" :style="{backgroundImage: 'url(' + m10image + ')' }">
</div>
<div class = "righttext" style="left:0px;bottom:0;">
{{$t('jlmap3d.confirmSignalOpen')}}
</div>
</div> -->
<div class = "down">
<!-- <div class="trainstatus">
<div id="ato" class="downstatus c1area c1-qianyin" :style="{backgroundImage: 'url(' + c1image + ')' }">
</div>
<div id="trainmode" class="downstatus c2area c2-rm" :style="{backgroundImage: 'url(' + c2image + ')' }">
</div>
<div id="trainintegrity" class="downstatus c3area c3-normal" :style="{backgroundImage: 'url(' + c3image + ')' }">
</div>
<div id="traindevice" class="downstatus c5area c5-normal" :style="{backgroundImage: 'url(' + c5image + ')' }">
</div>
</div> -->
<div class="errortext">
{{$t('jlmap3d.faultInformation')}}
</div>
<div id="time" class="timetext">
</div>
<div id="timeupdate" class="timeup">
</div>
</div>
</div>
</template>
<script>
import axios from 'axios';
import { prefixIntrger } from '@/utils/date';
import { mmirender } from '@/views/jlmap3d/drive/sceneview/mmi';
import { mmiimage } from '@/views/jlmap3d/drive/sceneview/mmiimage';
export default {
name: 'SimulationMmi',
components: {
},
data() {
return {
timer: '',
malen:0+"px",
nowspeed:0,
nowatpspeed:0,
nowatospeed:0,
endstation:'',
nextstation:'',
mmimodel:null,
nstate:"tiaoting",
nimage:null,
dstate:"info",
dimage:null,
m1state:null,
m1image:null,
m2state:"null",
m2image:null,
m3state:"zhefan",
m3image:null,
m4state:"out",
m4image:null,
m5stateleft:false,
m5stateright:false,
m5image:null,
m6state:"fache",
m6image:null,
m7state:"aoac",
m7image:null,
m8state:"jinjizhidong",
m8image:null,
m9state1:null,
m9state2:null,
m9image:null,
m10state:"jinduan",
m10image:null,
newc1state:"none",
c1state:"none",
c1image:null,
c2state:"rm",
c2image:null,
c3state:"normal",
c3image:null,
c5state:"normal",
c5image:null,
images:null,
newa1state:"black",
a1state:"black",
ebStatus:false,
}
},
mounted() {
window.updatemmic1 = this.updatemmic1;
this.init();
},
beforeDestroy() {
},
// watch: {
// '$store.state.training.initTime': function (initTime) {
// let date = new Date(initTime);
// this.timer = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}:${prefixIntrger(date.getSeconds(), 2)}`;
// document.getElementById("timeupdate").innerHTML = this.timer;
// }
// },
methods: {
init(){
this.time();
let dom = document.getElementById("meter");
this.mmimodel = new mmirender(dom);
this.images = new mmiimage();
this.setimage();
},
setimage(){
this.nimage = this.images.n['tiaoting'];
this.dimage = this.images.d['info'];
this.m1image = this.images.m1['rm'];
this.m2image = this.images.m2['cbtc'];
this.m3image = this.images.m3['zhefan'];
this.m4image = this.images.m4['out'];
this.m5image = this.images.m5['noalloffdoor'];
this.m6image = this.images.m6['fache'];
this.m7image = this.images.m7['aoac'];
this.m8image = this.images.m8['none'];
this.m9image = this.images.m9['ato'];
this.m10image = this.images.m10['jinduan'];
this.c1image = this.images.c1['none'];
this.c2image = this.images.c2['none'];
this.c3image = this.images.c3['normal'];
this.c5image = this.images.c5['normal'];
},
time(){
let vWeek,vWeek_s,vDay;
vWeek = ["星期天","星期一","星期二","星期三","星期四","星期五","星期六"];
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
let hours = date.getHours();
let minutes = date.getMinutes();
let seconds = date.getSeconds();
vWeek_s = date.getDay();
document.getElementById("time").innerHTML = year + "/" + month + "/" + day + "/" + "\t" + vWeek[vWeek_s];
},
updatetrainstatus(newdata){
if(typeof(newdata.eb) != "undefined"){
this.updateEbStatus(newdata.eb);
}
//
this.updateMmiSpeedView(newdata.v,newdata.pv,newdata.tv);
if(newdata.maLen){
this.updateMmiLen(newdata.maLen);
}
this.updatemmidrivemodelevel(newdata.runLevel,newdata.driveMode,newdata.atoOn,newdata.atpOn);
// this.updatammirunlevel(newdata.runLevel);
//
// this.updatemmidrivemode(newdata.driveMode);
//
// this.updatemmiatoatp(newdata.atoOn,newdata.atpOn);
if(newdata.nextStation){
this.updateMmiNextStation(newdata.nextStation);
}
if(newdata.endStation){
this.updateMmiEndStation(newdata.endStation);
}
this.updatemmidoormode(newdata.leftDoorCanClose,newdata.rightDoorCanClose);
},
updatemmistate(aaa){
},
updateEbStatus(ebData){
this.ebStatus = ebData;
if(this.ebStatus){
this.m8image = this.images.m8["jinjizhidong"];
}else{
this.m8image = this.images.m8["none"];
}
},
updateMmiSpeedView(speed,atpspeed,atospeed) {
// if(this.m9state1 == false){
// console.log(this.nowspeed);
// console.log(this.nowatospeed);
if(this.ebStatus){
this.newa1state = "red";
this.nowspeed = 0;
if(this.mmimodel.updatezz){
this.mmimodel.updatezz(0);
}
this.nowatpspeed = 0;
if(this.mmimodel.updateatp){
this.mmimodel.updateatp(0);
}
this.nowatospeed = 0;
if(this.mmimodel.updateato){
this.mmimodel.updateato(0);
}
if(this.newa1state != this.a1state){
this.a1state = this.newa1state;
}
}else{
this.nowspeed = parseInt(speed);
if(this.mmimodel.updatezz){
this.mmimodel.updatezz(speed);
}
this.nowatpspeed = parseInt(atpspeed);
if(this.mmimodel.updateatp){
this.mmimodel.updateatp(atpspeed);
}
this.nowatospeed = parseInt(atospeed);
if(this.mmimodel.updateato){
this.mmimodel.updateato(atospeed);
}
if(this.nowspeed>this.nowatospeed){
this.newa1state = "yellow";
}else{
this.newa1state = "black";
}
if(this.newa1state != this.a1state){
this.a1state = this.newa1state;
}
}
},
updatedrivedata(drivedata){
// if(drivedata == "breaker"){
//
// }
// if(drivedata == "carwash"){
//
// }
// if(drivedata == "aircom"){
//
// }
// if(drivedata == "atb"){
//
// }
// if(drivedata == "bm"){
//
// }
// if(drivedata == "rm"){
// if(this.m1state == "start"){
// this.m1state = 'rm';
// this.m1image = this.images.m1[this.m1state];
// }else if(this.m1state == "rm"){
// this.m1state = 'am';
// this.m1image = this.images.m1[this.m1state];
// }else if(this.m1state == "am"){
// this.m1state = 'cm';
// this.m1image = this.images.m1[this.m1state];
// }else if(this.m1state == "cm"){
// this.m1state = 'start';
// this.m1image = this.images.m1[this.m1state];
// }
//
// }
// if(drivedata == "cbtc"){
// if(this.m2state == "start"){
// this.m2state = 'il';
// this.m2image = this.images.m2[this.m2state];
// }else if(this.m2state == "il"){
// this.m2state = 'itc';
// this.m2image = this.images.m2[this.m2state];
// }else if(this.m2state == "itc"){
// this.m2state = 'cbtc';
// this.m2image = this.images.m2[this.m2state];
// }else if(this.m2state == "cbtc"){
// this.m2state = 'start';
// this.m2image = this.images.m2[this.m2state];
// }
// }
// //doormode
// if(drivedata == "AA"){
// this.m7state = 'aoac';
// this.m7image = this.images.m7[this.m7state];
// }
// if(drivedata == "AM"){
// this.m7state = 'aomc';
// this.m7image = this.images.m7[this.m7state];
// }
// if(drivedata == "MM"){
// this.m7state = 'momc';
// this.m7image = this.images.m7[this.m7state];
// }
//
// if(drivedata == "elflute"){
//
// }
// if(drivedata == "relieve"){
//
// }
},
updatemmidrivemodelevel(runlevel,dirvemode,atoon,atpon){
if(runlevel){
if(runlevel == "CBTC"){
this.m2state = runlevel;
this.m2image = this.images.m2['cbtc'];
}else if(runlevel == "IL"){
this.m2state = runlevel;
this.m2image = this.images.m2['il'];
}else{
this.m2state = runlevel;
this.m2image = this.images.m2['start'];
}
}
if(dirvemode){
if(dirvemode == "CM"){
this.m1state = dirvemode;
this.m1image = this.images.m1['cm'];
}else if(dirvemode == "RM"){
this.m1state = dirvemode;
this.m1image = this.images.m1['rm'];
}else if(dirvemode == "AM"){
this.m1state = dirvemode;
this.m1image = this.images.m1['am'];
}else{
this.m1state = null;
this.m1image = this.images.m1['start'];
}
}
//
if(this.m9state1){
this.m9state1 = atoon;
if(atoon){
}else{
this.m9image = this.images.m9["ato"];
// this.c2image = this.images.c2['none'];
}
}
if(this.m9state2 != atpon){
this.m9state2 = atpon;
if(atpon){
}else{
this.m9image = this.images.m9["atp"];
}
}
},
updatemmidoormode(leftDoorCanClose,rightDoorCanClose){
if(leftDoorCanClose != this.m5stateleft|| rightDoorCanClose != this.m5stateright){
this.m5stateleft = leftDoorCanClose;
this.m5stateright = rightDoorCanClose;
if(this.m5stateleft == this.m5stateright == true){
this.m5image = this.images.m5['noalloffdoor'];
}
if(this.m5stateleft == false && this.m5stateright == false){
this.m5image = this.images.m5['noallondoor'];
}
if(this.m5stateleft != this.m5stateright){
if(this.m5stateleft){
this.m5image = this.images.m5['leftdoor'];
}else{
this.m5image = this.images.m5['rightdoor'];
}
}
}
},
updateMmiLen(len) {
//this.malen = 150+"px";
if(len>=750){
this.malen = 158+"px";
}
if(len>=500 && len<750){
this.malen = 146+parseInt(len-500)/250*12+"px";
}
if(len>=200 && len<500){
this.malen = 128+parseInt(len-200)/300*20+"px";
}
if(len>=100 && len<200){
this.malen = 111+parseInt(len-100)/100*17+"px";
}
if(len>=50 && len<100){
this.malen = 95+parseInt(len-50)/50*16+"px";
}
if(len>=20 && len<50){
this.malen = 73+parseInt(len-20)/30*22+"px";
}
if(len>=10 && len<20){
this.malen = 57+parseInt(len-1)/10*16+"px";
}
if(len>=5 && len<10){
this.malen = 40+parseInt(len-5)/5*17+"px";
}
if(len>=2 && len<5){
this.malen = 20+parseInt(len-2)/3*20+"px";
}
if(len<2){
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];
}
},
updateMmiNextStation(next){
if(next){
this.nextstation = next;
}
},
updateMmiEndStation(end){
if(end){
this.endstation = end;
}
},
},
beforeDestroy() {
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@import "./mmi.css";
.mmi{
width:500px;
height:333px;
background: black;
position:absolute;
bottom:0;
}
.meter{
width:60%;
height:56%;
position:absolute;
left:5%;
top:15%;
}
.speedshow{
width:30px;
height:30px;
position:absolute;
top:87px;
left:176px;
font-size:27px;
color:white;
text-align:center;
}
.maxlenshow{
width:25px;
height:0px;
position:absolute;
bottom:0px;
left:55px;
background:green;
}
.top{
width:90%;
height:10%;
position:absolute;
left:5%;
top:2.5%;
}
.toptext{
position:absolute;
color:white;
font-size:13px;
}
.right{
width:25%;
height:82.5%;
position:absolute;
right:5%;
top:15%;
}
.rightstatus{
position:absolute;
width:40%;
height:10%;
background-size:100% 100%;
}
.righttext{
width:100%;
height:60px;
color:white;
font-size: 18px;
position:absolute;
}
.down{
width:65%;
height:26%;
position:absolute;
left:5%;
top:74%;
color:white;
}
.downstatus{
width:60px;
height:30px;
position:absolute;
background-size:100% 100%;
}
.trainstatus{
width:90%;
height:30%;
top:2.5%;
left:5%;
position:absolute;
}
.errortext{
width:90%;
height:25px;
bottom:30%;
left:0;
font-size:20px;
position:absolute;
}
.timetext{
width:65%;
height:20px;
bottom:0;
left:0;
position:absolute;
text-align: center;
}
.timeup{
width:30%;
height:20px;
bottom:0;
right:5%;
position:absolute;
text-align: center;
}
</style>

View File

@ -0,0 +1,95 @@
<template>
<div class = "tmsfault" >
<div class = "tmsvoltage">{{voltage}}</div>
<div class = "tmscurrent">{{current}}</div>
<div class = "tmslevel">{{level}}</div>
<div class = "tmsspeed">{{speed}}</div>
</div>
</template>
<script>
import axios from 'axios';
export default {
name: 'TmsFault',
components: {
},
data() {
return {
voltage:"750V",
current:"0A",
level:"",
speed:"km/h",
}
},
mounted() {
},
beforeDestroy() {
},
watch: {
},
methods: {
init(){
},
},
beforeDestroy() {
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.tmsfault{
position: absolute;
// border-style:solid;
// border-color: #ffffff;
top:7%;
width:100%;
height:84%;
color:white;
}
.tmsvoltage{
top:7%;
left:3%;
width: 15%;
position: absolute;
text-align: center;
// border-style:solid;
// border-color: #ffffff;
}
.tmscurrent{
top:7%;
left:19%;
width: 15%;
position: absolute;
text-align: center;
// border-style:solid;
// border-color: #ffffff;
}
.tmslevel{
top:7%;
left:60%;
width: 20%;
position: absolute;
text-align: center;
// border-style:solid;
// border-color: #ffffff;
}
.tmsspeed{
top:7%;
left:82%;
width: 15%;
position: absolute;
text-align: center;
// border-style:solid;
// border-color: #ffffff;
}
</style>

View File

@ -0,0 +1,57 @@
<template>
<div class = "tms" :style="{'background-image': 'url('+localStatic+'/jl3d/tms.png)'}" >
<Tms-Fault>
</Tms-Fault>
</div>
</template>
<script>
import axios from 'axios';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import TmsFault from '@/views/jlmap3d/drive/sceneview/tmscomponent/tmsfault';
export default {
name: 'DriveTms',
components: {
TmsFault,
},
data() {
return {
localStatic:JL3D_LOCAL_STATIC,
}
},
beforeDestroy() {
},
watch: {
},
methods: {
},
mounted() {
},
beforeDestroy() {
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.tms{
width:500px;
height:333px;
background-size:100% 100%;
position:absolute;
bottom:0;
right:0;
}
</style>

View File

@ -0,0 +1,390 @@
<template>
<el-dialog
v-dialogDrag
:visible.sync="dialogVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="false"
z-index="1999"
:modal="false"
width="100%"
>
<div style="height: 130px;">
<div class="haerbin-01__systerm nav">
<el-row style="padding: 3px;">
<el-col :span="20">
<div style="width: calc(100% - 10px);border: 2px solid #DDD9CA;border-radius: 1px;height: 132px;">
<el-row style="padding: 4px;">
<div class="tip-content-box">
<div v-if="tipContent[0]">{{ `${tipContent[0].level}` }}</div>
<div v-if="tipContent[0]">{{ `${tipContent[0].time}` }}</div>
<div v-if="tipContent[0]">{{ `${tipContent[0].confirm ? '确认': '未确认'}` }}</div>
</div>
<div class="tip-content-box">
<div v-if="tipContent[1]">{{ `${tipContent[1].level}` }}</div>
<div v-if="tipContent[1]">{{ `${tipContent[1].time}` }}</div>
<div v-if="tipContent[1]">{{ `${tipContent[1].confirm ? '确认': '未确认'}` }}</div>
</div>
<div class="tip-content-box">
<div v-if="tipContent[2]">{{ `${tipContent[2].level}` }}</div>
<div v-if="tipContent[2]">{{ `${tipContent[2].time}` }}</div>
<div v-if="tipContent[2]">{{ `${tipContent[2].confirm ? '确认': '未确认'}` }}</div>
</div>
</el-row>
<div style="padding: 5px;height:20px;line-height: 20px;border-top: 2px solid #DDD9CA;display: flex;justify-content: space-between;">
<div>
<div class="div-simulate-button" style="width: 40px;" @click="handleDialogShow('rpsDialog')">背投</div>
<div class="div-simulate-button" style="width: 40px;" @click="handleDialogShow('carPack')">车场</div>
<div class="div-simulate-button" style="width: 40px;" @click="handleDialogShow('troDialog')">轨道</div>
<div class="div-simulate-button" style="width: 40px;">系统</div>
<div class="div-simulate-button" style="width: 40px;" @click="handleDialogShow('traDialog')">列车</div>
</div>
<div>
<div class="div-simulate-button" style="width: 40px;">联锁</div>
<div class="div-simulate-button" style="width: 40px;" @click="handleDialogShow('tmtDialog')">列监</div>
<div class="div-simulate-button" style="width: 40px;">运图</div>
<div class="div-simulate-button" style="width: 55px;" @click="handleDialogShow('ttlDialog')">时刻表</div>
<div class="div-simulate-button" style="width: 40px;">编表</div>
<div class="div-simulate-button" style="width: 40px;">调度</div>
<div class="div-simulate-button" style="width: 40px;">站控</div>
<div class="div-simulate-button" style="width: 40px;">计划</div>
</div>
<div>
<div class="div-simulate-button" style="width: 40px;">SDM</div>
</div>
<div>
<div class="div-simulate-button" style="width: 55px;">管理员</div>
<div class="div-simulate-button" style="width: 40px;">职权</div>
</div>
<div>
<div class="div-simulate-button" style="width: 40px;">拷屏</div>
<div class="div-simulate-button" style="width: 40px;">录放</div>
<div class="div-simulate-button" style="width: 40px;">布局</div>
</div>
</div>
</div>
</el-col>
<el-col :span="2">
<div style="width: calc(100% - 10px);border: 2px solid #DDD9CA;border-radius: 1px;">
<el-row style="margin-top: 20px;margin-bottom: 18px;">
<el-col :span="16">
<el-row class="button-row">
<div style="width: 25px;" class="div-simulate-button" :style="{background:isNoRecoverLevelA || isNoConfirmLevelA?'#F00':'#DDD' }" :class="{'headerBox' :isNoConfirmLevelA}" @click="showHimAlarm('A')">A</div>
<div style="width: 25px;" class="div-simulate-button" :style="{background:isNoRecoverLevelB || isNoConfirmLevelB?'#F00':'#DDD' }" :class="{'headerBox' :isNoConfirmLevelB}" @click="showHimAlarm('B')">B</div>
<div style="width: 25px;" class="div-simulate-button" :style="{background:isNoRecoverLevelC?'#F00':'#DDD' }" @click="showHimAlarm('C')">C</div>
</el-row>
<el-row class="button-row" style="margin-top: 20px;">
<div style="width: 40px;" class="div-simulate-button" @click="showHimAlarm">报警</div>
<div style="width: 40px;" class="div-simulate-button" @click="undeveloped">运图</div>
</el-row>
</el-col>
<el-col :span="8">
<div style="width: 40px;height: 60px;line-height: 60px;" class="div-simulate-button" @click="controlAudio(false)">静音</div>
</el-col>
</el-row>
<el-row class="button-row" style="margin: 10px 0;">
<div style="width: 40px;" class="div-simulate-button" @click="undeveloped">档案</div>
<div style="width: 40px;" class="div-simulate-button" @click="undeveloped">归档</div>
<div style="width: 40px;" class="div-simulate-button" @click="undeveloped">统计</div>
</el-row>
</div>
</el-col>
<el-col :span="2" style="border: 2px solid #DDD9CA;border-radius: 1px;">
<el-row style="height: 88px;">
<div style="font-size: 15px;color: #000;display: flex;justify-content: space-around;align-items: center;margin-top: 40px;">
<span>{{ dateString }}</span>
<span>{{ time }}</span>
</div>
</el-row>
<el-row class="button-row" style="margin: 10px 0;">
<div style="width: 40px;" class="div-simulate-button" @click="undeveloped">锁屏</div>
<div style="width: 40px;" class="div-simulate-button" @click="undeveloped">退出</div>
</el-row>
</el-col>
</el-row>
</div>
<alarm-table-hmi ref="alarmTableHmi" />
<audio id="buzzer" controls loop="loop" style="width: 0;height: 0">
<source :src="buzzerAudio" type="audio/mpeg">
</audio>
<div class="display-draft">
<el-button-group class="button-group-box">
<template v-if="!dataError">
<el-button type="success" :disabled="isDisable" size="small" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
<el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
</template>
<el-button type="primary" size="small" @click="back">{{ $t('display.demon.back') }}</el-button>
</el-button-group>
</div>
</div>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date';
import BuzzerAudio from '@/assets/buzzer.mp3';
import AlarmTableHmi from '@/jmapNew/theme/nanjing_02/menus/menuDialog/alarmTableHmi';
import { prefixIntrger } from '@/utils/date';
export default {
name: 'BaSiDi',
components: {
AlarmTableHmi
},
props: {
dataError: {
type: Boolean,
required: true
},
isDisable: {
type: Boolean,
required: true
}
},
data() {
return {
dialogVisible: true,
tipContent: [],
buzzerAudio: BuzzerAudio,
sound: false,
noConfirmMapA: {},
noConfirmMapB: {},
confirmNoRecoverMapA: {},
confirmNoRecoverMapB: {},
confirmNoRecoverMapC: {},
noConfirmMapAString: '{}',
noConfirmMapBString: '{}',
confirmNoRecoverMapAString: '{}',
confirmNoRecoverMapBString: '{}',
confirmNoRecoverMapCString: '{}',
time: '00:00:00',
dateString: '00.00.0000'
};
},
computed: {
...mapGetters('training', [
'mode',
'started',
'steps',
'order'
]),
...mapGetters('map', [
'stationList',
'trainList'
]),
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
},
isNoConfirmLevelA() {
return this.noConfirmMapAString !== '{}';
},
isNoConfirmLevelB() {
return this.noConfirmMapBString !== '{}';
},
isNoRecoverLevelA() {
return this.confirmNoRecoverMapAString !== '{}';
},
isNoRecoverLevelB() {
return this.confirmNoRecoverMapBString !== '{}';
},
isNoRecoverLevelC() {
return this.confirmNoRecoverMapCString !== '{}';
}
},
watch: {
'$store.state.training.initTime': function (initTime) {
const date = new Date(initTime);
this.initDate(date);
},
'$store.state.socket.simulationTimeSync': function (time) { // 仿
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`));
},
'$store.state.socket.simulationAlarmInfo': function(val) {
(val || []).forEach(item => {
if (!item.confirmed) {
this.tipContent.push(item);
this.handleAlarm(item);
if (this.tipContent.length > 3) {
this.tipContent.shift();
}
if (item.level === 'A') {
this.noConfirmMapA[item.code] = item;
this.noConfirmMapAString = JSON.stringify(this.noConfirmMapA);
} else if (item.level === 'B') {
this.noConfirmMapB[item.code] = item;
this.noConfirmMapBString = JSON.stringify(this.noConfirmMapB);
}
} else if (!item.recovered) {
if (item.level === 'A') {
delete this.noConfirmMapA[item.code];
this.confirmNoRecoverMapA[item.code] = item;
this.noConfirmMapAString = JSON.stringify(this.noConfirmMapA);
this.confirmNoRecoverMapAString = JSON.stringify(this.confirmNoRecoverMapA);
} else if (item.level === 'B') {
delete this.noConfirmMapB[item.code];
this.confirmNoRecoverMapB[item.code] = item;
this.noConfirmMapBString = JSON.stringify(this.noConfirmMapB);
this.confirmNoRecoverMapBString = JSON.stringify(this.confirmNoRecoverMapB);
} else if (item.level === 'C') {
this.confirmNoRecoverMapC[item.code] = item;
this.confirmNoRecoverMapCString = JSON.stringify(this.confirmNoRecoverMapC);
}
} else {
if (item.level === 'A') {
delete this.noConfirmMapA[item.code];
delete this.confirmNoRecoverMapA[item.code];
this.noConfirmMapAString = JSON.stringify(this.noConfirmMapA);
this.confirmNoRecoverMapAString = JSON.stringify(this.confirmNoRecoverMapA);
} else if (item.level === 'B') {
delete this.noConfirmMapB[item.code];
delete this.confirmNoRecoverMapB[item.code];
this.noConfirmMapBString = JSON.stringify(this.noConfirmMapB);
this.confirmNoRecoverMapBString = JSON.stringify(this.confirmNoRecoverMapB);
} else if (item.level === 'C') {
delete this.confirmNoRecoverMapC[item.code];
this.confirmNoRecoverMapCString = JSON.stringify(this.confirmNoRecoverMapC);
}
}
});
}
},
methods: {
undeveloped() {
this.doClose();
this.$alert(this.$t('menu.menuBar.implemented'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
callback: action => {
}
});
},
showHimAlarm(level) {
this.$refs.alarmTableHmi.doShow(level);
},
controlAudio(val) {
const audio = document.getElementById('buzzer');
this.sound = val;
if (audio !== null) {
if (val) {
audio.play();
} else if (val === false) {
audio.pause();
}
}
},
handleDialogShow(type) {
this.$emit('handleDialogShow', type);
},
selectBeginTime() {
this.$emit('selectBeginTime');
},
end() {
this.$emit('end');
},
back() {
this.$emit('back');
},
initDate(date) {
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}:${prefixIntrger(date.getSeconds(), 2)}`;
const years = date.getFullYear() + '';
let months = date.getMonth() + 1 + '';
let dates = date.getDate() + '';
if (months.length < 2) { months = '0' + months; }
if (dates.length < 2) { dates = '0' + dates; }
this.dateString = dates + '.' + months + '.' + years;
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss";
$width: 30px;
$height: 90px;
$menuPadding: 10px;
$menuItemHeight: 30px;
$menuItemWidth: 190px;
$menuItemPadding: 5px;
.nav {
display: block;
cursor: pointer;
color: #0000;
background: -webkit-linear-gradient(#FDFDFE, #DEE3F3);
background: -o-linear-gradient(#FDFDFE, #DEE3F3);
background: -moz-linear-gradient(#FDFDFE, #DEE3F3);
background: linear-gradient(#FDFDFE, #DEE3F3);
border: 1px solid #B6BCCC !important;
border-bottom: 2px solid #B6BCCC !important;
list-style: none;
}
.div-simulate-button{
height: 20px;
line-height: 20px;
display: inline-block;
font-size: 14px;
color: #303030;
border: 1px solid #44556D;
background: #DDD;
text-align: center;
border-radius: 1px;
width: 80px;
}
.tip-content-box{
height: 30px;
width: 100%;
line-height: 30px;
background: #001528;
color: #C20F29;
font-size: 14px;
display: flex;
justify-content: space-around;
}
.button-row{
height: 20px;
line-height: 20px;
display: flex;
justify-content:space-between;
}
@keyframes fade {
from {
opacity: 1.0;
}
50% {
opacity: 0.4;
}
to {
opacity: 1.0;
}
}
@-webkit-keyframes fade {
from {
opacity: 1.0;
}
50% {
opacity: 0.4;
}
to {
opacity: 1.0;
}
}
.headerBox {
background: #f00;
animation: fade 600ms infinite;
-webkit-animation: fade 600ms infinite;
}
/deep/.el-dialog__body{
padding: 0;
}
.display-draft {
position: fixed;
right: 10px;
bottom: 15px;
.button-group-box{
float: right;
}
}
</style>

View File

@ -0,0 +1,261 @@
<template>
<el-dialog v-dialogDrag class="nanjing-02__systerm route-setting" :title="title" :visible.sync="show" width="900px" label-position="top" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<div style="padding: 5px;">
<div class="content_box">
<div class="el-button" :class="activeIndex == 0 ? 'active' : ''" style="width: 49%;" @click="handleSelect(0)">Mileage and inspection</div>
<div class="el-button" :class="activeIndex == 1 ? 'active' : ''" style="width: 49%;" @click="handleSelect(1)">Cargroup management</div>
</div>
<div v-if="activeIndex == 0" class="table">
<span>Range of car group number: 401(1/6) - 450(1/6)</span>
<el-table
ref="tempTable"
class="table_content_box"
:data="tempData1"
border
style="width: 100%"
header-cell-class-name="table_header_box"
size="mini"
highlight-current-row
:height="340"
>
<el-table-column prop="firstGroup" label="First car group" style="margin-left:30px" :width="100" />
<el-table-column prop="lastGroup" label="Last car group" :width="100" />
<el-table-column prop="totalmileage" label="Total mileage" :width="95" />
<el-table-column prop="recentDate" label="Recent inspection date" :width="150" />
<el-table-column prop="mileageSince" label="Mileage since recent inspection" :width="200" />
<el-table-column prop="correction" label="Correction mileage" />
<el-table-column label="Carry out inspection" :width="100">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.carryOut" />
</template>
</el-table-column>
</el-table>
</div>
<div v-if="activeIndex == 1" class="table">
<span>Range of car group number: 401(1/6) - 450(1/6)</span>
<el-table
ref="tempTable"
class="table_content_box"
:data="tempData"
border
style="width: 100%"
header-cell-class-name="table_header_box"
size="mini"
highlight-current-row
:height="340"
>
<el-table-column prop="serviceNo" label="Train service No." style="margin-left:30px" :width="90" />
<el-table-column prop="trainId" label="Train-ID" :width="80" />
<el-table-column prop="firstGroup" label="First car group" :width="70" />
<el-table-column prop="lastGroup" label="Last car group" :width="70" />
<el-table-column prop="startStation" label="Start station" :width="110">
<template slot-scope="scope">
<el-select v-model="scope.row.startStation" clearable placeholder="请选择" size="mini">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="startTime" label="Start time">
<template slot-scope="scope">
<span>{{ scope.row.startTime }}</span>
</template>
</el-table-column>
<el-table-column prop="terminalStation" label="Terminal station" :width="110">
<template slot-scope="scope">
<el-select v-model="scope.row.terminalStation" clearable placeholder="请选择" size="mini">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="terminalTime" label="Terminal time">
<template slot-scope="scope">
<span>{{ scope.row.terminalTime }}</span>
</template>
</el-table-column>
<el-table-column label="In service" :width="65">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.inService" />
</template>
</el-table-column>
</el-table>
</div>
<div style="overflow: hidden;">
<el-button style="float: left;" @click="cancel">Refresh</el-button>
<el-button style="float: left;" @click="cancel">Load</el-button>
<el-button style="float: left;" @click="cancel">Delete</el-button>
<el-button style="float: left;" @click="cancel">Insert</el-button>
<el-button style="float: right;" @click="cancel">Close</el-button>
<el-button class="disabled" :loading="loading" style="float: right;" @click="commit">Execute</el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import { EventBus } from '@/scripts/event-bus';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteCreate',
data() {
return {
dialogShow: false,
loading: false,
selected: null,
activeIndex: 0,
tempData1: [
{
firstGroup: '4011',
lastGroup: '4016',
totalmileage: '0',
recentDate: '01.01.1970',
mileageSince: '0',
correction: '0',
carryOut: false
},
{
firstGroup: '4021',
lastGroup: '4026',
totalmileage: '0',
recentDate: '01.01.1970',
mileageSince: '0',
correction: '0',
carryOut: false
}
],
tempData: [
{
serviceNo: 47,
trainId: '07474807',
firstGroup: '',
lastGroup: '',
startStation: '',
startTime: '24.07.2008 22:08:51',
terminalStation: '',
terminalTime: '24.07.2008 22:08:51',
inService: false
},
{
serviceNo: 67,
trainId: '07474808',
firstGroup: '',
lastGroup: '',
startStation: '',
startTime: '24.07.2008 22:08:51',
terminalStation: '',
terminalTime: '24.07.2008 22:08:51',
inService: false
}
]
};
},
computed: {
...mapGetters('map', [
'map',
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '[bjdvt1/a1bj]-0-Process/Realtime - Depot Service';
}
},
methods: {
loadInitData(map) {
console.log(map, 11111);
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
this.loadInitData(this.map);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
handleSelect(tab) {
this.activeIndex = tab;
},
commit() {
// const operate = {
// send: true,
// operation: OperationEvent.Section.newtrain.menu.operation,
// cmdType: CMD.Section.CMD_NEW_TRAIN,
// val: '' + this.direction + '::' + this.trainCode
// };
// this.loading = true;
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// this.loading = false;
// if (valid) {
// this.doClose();
// }
// }).catch(() => {
// this.loading = false;
// this.doClose();
// EventBus.$emit('sendMsg', {message: ''});
// });
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.route-setting {
.content_box {
margin-bottom: 10px;
.el-button{
&.active{
background: #969696;
}
}
}
.table_content_box{
margin-bottom: 20px;
}
/deep/ {
.table{
.table_header_box{
.cell{
text-align: center;
word-break: break-word;
}
}
}
}
}
</style>

View File

@ -0,0 +1,460 @@
<template>
<div class="main" :style="{width: '100%',height:'100%',position:'absolute',overflow:'hidden'}" style="background: #000;">
<ba-si-di
ref="baSiDi"
:is-disable="isDisable"
:data-error="dataError"
@handleDialogShow="handleDialogShow"
@end="end"
@back="back"
@selectBeginTime="selectBeginTime"
/>
<rps-dialog ref="rpsDialog" :train-list="trainList" />
<tro-dialog ref="troDialog" :train-list="trainList" :station-list="stationList" />
<car-pack ref="carPack" />
<tro-detail ref="troDetail" :train-list="trainList" :station-list="stationList" @goTroDialog="troClick" />
<tra-dialog ref="traDialog" />
<ttl-dialog ref="ttlDialog" />
<tmt-dialog ref="tmtDialog" />
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
</div>
</template>
<script>
import { getSessionStorage } from '@/utils/auth';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { timeFormat } from '@/utils/date';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, displayTopic, getTopic } from '@/utils/stomp';
import SetTime from '@/views/newMap/displayNew/demon/setTime';
import { clearSimulation, getSimulationInfoNew, ranAsPlan, exitRunPlan } from '@/api/simulation';
import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import { getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
import { getMemberListCommon, getUserListCommon } from '@/api/rtSimulation';
import BaSiDi from './baSiDi';
import RpsDialog from './rps';
import TroDialog from './tro';
import CarPack from './carPack';
import TroDetail from './troDetail';
import TraDialog from './tra';
import TtlDialog from './ttl';
import TmtDialog from './tmt';
import parseStatus from '@/utils/parseStatus';
export default {
name: 'DisplayDraft',
components: {
BaSiDi,
SetTime,
RpsDialog,
CarPack,
TroDialog,
TroDetail,
TraDialog,
TtlDialog,
TmtDialog
},
data() {
return {
offset: 15,
offsetBottom: 15,
tipBottom: 0,
textStatusHeight: 0,
planRunning:false,
dataError: false,
group:''
};
},
computed:{
...mapGetters([
'canvasWidth'
]),
...mapGetters('map', [
'stationList',
'trainList'
]),
mode() {
return this.$route.params.mode;
},
project() {
return getSessionStorage('project');
},
isDemon() {
return this.mode === 'demon' && this.project != 'drts';
},
isContest() {
return this.mode === 'demon' && this.project == 'drts';
},
mapId() {
return this.$route.query.mapId;
},
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
},
projectDevice() {
return this.$route.query.projectDevice;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch:{
'$store.state.socket.permissionOver': function () {
this.$alert('用户权限已被收回', '提示', {
confirmButtonText: '确定',
callback: action => {
this.back();
}
});
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length) {
this.statusMessage(val);
}
},
'$store.state.socket.deviceStateMessages': function (val) {
if (val) {
this.statusMessageNew(val);
}
},
'$store.state.config.menuBarLoadedCount': function (val) { // menuBar
this.setPosition();
},
'$store.state.app.windowSizeCount': function() { //
this.setWindowSize();
},
'$store.state.training.prdType': function (val) { //
this.setPosition();
},
'$store.state.map.mapViewLoadedCount': function (val) { //
if (this.planRunning) {
this.$store.dispatch('training/simulationStart');
}
},
'$store.state.socket.memberChangeCount': function () { // 仿
this.initMemberUserInfo();
},
'$store.state.socket.simulationStart':function(val) {
if (val) {
this.$store.dispatch('training/simulationStart');
}
},
$route() {
if (!this.isLesson && !this.isExam) {
this.initLoadData();
}
},
'$store.state.menuOperation.selectedCount':function(em) {
const device = this.$store.state.menuOperation.selected;
if (device && device._type === 'Station' && this.$store.state.menuOperation.subType === 'troButton') {
this.$refs.troDialog.doClose();
this.$refs.troDetail.doShow(device.code);
}
}
},
beforeDestroy() {
this.clearSubscribe();
this.clearSubscribeNew();
clearSimulation(this.group);
this.$store.dispatch('training/reset');
},
async mounted() {
const _that = this;
window.onbeforeunload = () => { _that.clearSubscribe(); _that.clearSubscribeNew(); };
this.setWindowSize();
this.initLoadData();
this.initMemberUserInfo(true);
this.$store.dispatch('app/animationsClose');
},
methods:{
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
// 仿退
async back() {
this.$router.go(-1);
},
async statusMessage(list) {
if (this.$jlmap) {
await this.$store.dispatch('training/updateMapState', list);
} else {
this.$store.commit('map/updateMapDevice', list);
}
await this.$store.dispatch('socket/setEquipmentStatus');
},
async statusMessageNew(deviceStatus) {
const list = parseStatus(deviceStatus);
await this.$store.dispatch('training/updateMapState', list);
await this.$store.dispatch('socket/setDeviceStateMessages');
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
async subscribeNew() {
this.clearSubscribeNew();
const header = { 'X-Token': getToken() };
creatSubscribe(getTopic('ATS', this.$route.query.group), header);
creatSubscribe(getTopic('SYSTIME', this.$route.query.group), header);
creatSubscribe(getTopic('STATE', this.$route.query.group), header);
await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribeNew() {
clearSubscribe(getTopic('ATS', this.$route.query.group));
clearSubscribe(getTopic('SYSTIME', this.$route.query.group));
clearSubscribe(getTopic('STATE', this.$route.query.group));
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.groupModel}`);
},
initMemberUserInfo(isFirst = false) {
if (this.$route.query.newApi + '' === 'true') {
getMemberListCommon(this.$route.query.group).then(resp => {
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.$store.state.user.id });
getUserListCommon(this.$route.query.group).then(res => {
this.$store.dispatch('training/setSimulationUserList', res.data);
if (isFirst) { this.subscribeNew(); }
}).catch(() => {
this.$messageBox('获取所有仿真用户失败!');
});
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
} else {
// 仿
getSimulationMemberList(this.$route.query.group).then(resp => {
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.$store.state.user.id });
getAllSimulationUser(this.$route.query.group).then(res => {
this.$store.dispatch('training/setSimulationUserList', res.data);
if (isFirst) {
this.subscribe();
}
}).catch(() => {
this.$messageBox('获取所有仿真用户失败!');
});
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
}
},
//
setPosition() {
this.$nextTick(() => {
this.offset = 10;
this.offsetBottom = 15;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
const menuBottom = document.getElementById('menuButton');
const menuButtonsBox = document.getElementById('menuButtons_box');
const textStatus = document.getElementById('textStatus');
if (menuBar) {
this.offset = (menuBar.offsetHeight || 0) + 15;
}
if (menuTool) {
this.offset = (menuTool.offsetHeight || 0) + 15;
}
const buttonWidth = this.width - 1200; // B box widht
if (menuBottom && buttonWidth < 780) {
this.offsetBottom = (menuBottom.offsetHeight || 0) + 15;
}
if (menuButtonsBox) {
this.tipBottom = (menuButtonsBox.offsetHeight || 0) + 15;
}
if (textStatus) {
this.textStatusHeight = textStatus.offsetHeight || 0;
textStatus.style.top = this.offset - 15 + 'px';
}
});
},
//
setWindowSize() {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
},
//
initLoadData() {
this.group = this.$route.query.group;
this.$store.dispatch('training/reset');
this.loadSimulationInfo();
this.loadMapData();
},
// 仿group仿
async loadSimulationInfo() {
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data) {
if (!resp.data.dataError) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); //
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan);
this.planRunning = resp.data.planRunning;
if (resp.data.planRunning) {
this.$store.commit('training/start');
}
} else {
this.$messageBox('此地图数据正在维护中,无法运行!');
}
this.dataError = resp.data.dataError;
}
},
selectBeginTime() {
this.$refs.setTime.doShow();
},
//
loadMapData() {
if (parseInt(this.mapId)) {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
loadMapDataById(this.mapId, 'simulation');
} else {
this.endViewLoading();
}
},
start(model) { // 仿
const data = {
time: model.initTime
};
if (this.$route.query.prdType === '04') {
data.loadNumber = model.loadNum;
}
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch(error => {
let message = '';
switch (error.code) {
case '5001':
message = this.$t('error.mapDataError');
break;
case '5002':
message = this.$t('error.runningChartDataError');
break;
case '5003':
message = this.$t('error.runningChartIsNotLoaded');
break;
case '5004':
message = this.$t('error.runningDataError');
break;
case '5000':
message = this.$t('error.systemError');
break;
case '4000':
message = this.$t('error.simulationDoesNotExist');
break;
case '4001':
message = this.$t('error.simulationOperationIsNotDefined');
break;
case '4002':
message = this.$t('error.simulationOperationProcessingMethodNotFound');
break;
case '4003':
message = this.$t('error.simulationOperationFailed');
break;
case '4004':
message = this.$t('error.operationConflict');
break;
default:
message = '按计划行车异常,请退出重试!';
// this.$messageBox(',退!');
break;
}
this.$messageBox(message + '' + this.$t('error.startSimulationFailed'));
});
},
end() {
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/resetActiveTrainList', false);
this.$store.dispatch('map/setTrainWindowShow', false);
});
});
}).catch(() => {
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
troClick() {
this.$refs.troDialog.doShow();
},
handleDialogShow(type) {
this.$refs[type].doShow();
}
}
};
</script>
<style>
.nanjing-02__systerm .el-dialog {
background: #d8d8d8;
border: 2px solid rgba(144, 144, 144, 0.8);
border-radius: 6px;
color: #000;
font-size: 14px;
}
.nanjing-02__systerm .el-dialog .el-dialog__header {
padding: 5px;
height: 30px;
background-image: linear-gradient(#A5A5BA, #FDFEFD);
border-radius: 4px 4px 0 0;
}
.nanjing-02__systerm .el-dialog .el-dialog__title {
position: absolute;
top: 4px;
color: #000;
border-radius: 4px;
padding: 0px 2px;
height: 20px;
line-height: 24px;
font-size: 15px;
}
.nanjing-02__systerm .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 6px;
right: 5px;
line-height: 16px;
}
.nanjing-02__systerm .el-dialog .el-dialog__headerbtn .el-dialog__close{
color: #fff;
}
.nanjing-02__systerm .el-dialog .el-dialog__body {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 5px;
padding-right: 5px;
margin: 0px 1px 1px;
border: 2px solid rgb(212 212 212);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
background: #E6E6E6;
opacity: 1;
}
.nanjing-02__systerm .el-dialog .el-button {
height: 26px;
line-height: 24px;
font-size: 13px;
padding: 0px;
width: 80px;
border: 1px solid #8B958A;
border-radius: 0px !important;
color: #000;
background: #E6E6E6;
}
.nanjing-02__systerm .el-dialog .el-button.disabled {
border: 1px solid #B1B1B1;
color: #ABABAB;
}
</style>

View File

@ -0,0 +1,154 @@
<template>
<el-dialog
:modal="false"
:title="title"
:visible.sync="show"
:fullscreen="true"
:before-close="doClose"
:z-index="2003"
>
<map-system-draft ref="mapCanvas" :no-menu="true" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import MapSystemDraft from '@/views/newMap/mapsystemNew/common/index';
import Vue from 'vue';
export default {
name: 'RPS',
components: {
MapSystemDraft
},
props: {
trainList: {
type: Array,
required: true
}
},
data() {
return {
dialogShow: false,
mapData: null,
selfJmap: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '背投系统';
},
width() {
return this.$store.state.app.width - 5;
},
height() {
return this.$store.state.app.height - 50;
},
...mapGetters('map', [
'bigScreenConfig'
])
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) { //
if (this.dialogShow) {
this.handleUpdateScreen();
this.$refs.mapCanvas && this.$refs.mapCanvas.mapViewLoaded(false);
}
},
'$store.state.app.windowSizeCount': function() { //
this.$store.dispatch('config/resize', { width:this.width, height: this.height });
}
},
beforeDestroy() {
if (this.selfJmap && this.selfJmap._disposeFlag) {
this.destroy();
}
},
methods: {
doShow() {
this.dialogShow = true;
if (this.selfJmap) { Vue.prototype.$jlmap = this.selfJmap; }
this.$jlmap && this.$jlmap.clearTrainView();
this.$store.dispatch('config/resize', { width:this.width, height: this.height });
this.$nextTick(function() {
this.$refs.mapCanvas.setMap(this.$store.state.map.map);
const mapDevice = this.$store.state.map.mapDevice;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowMode(list, '02');
this.$store.dispatch('training/updateMapState', list);
});
},
destroy() {
this.selfJmap.dispose();
},
handleUpdateScreen() {
this.maskOpen = false;
if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
const offsetList = this.bigScreenConfig.offsetList;
const width = this.bigScreenConfig.width;
const height = this.bigScreenConfig.height;
const size = {
width: (this.$store.state.app.width - 2) * width,
height: this.$store.state.app.height * height,
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
this.$jlmap.setUpdateScreen(size);
const mapDevice = this.$store.state.map.mapDevice;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowMode(list, '02');
} else {
this.maskOpen = true;
// this.$messageBox('线, ');
}
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$jlmap && this.$jlmap.clearTrainView();
this.selfJmap = Vue.prototype.$jlmap;
}
}
};
</script>
<style scoped>
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1);
position: relative;
border: 2px solid rgba(144, 144, 144, 0.8);
border-radius: 6px;
font-size: 14px;
}
/deep/ .el-dialog .el-dialog__body{
background: rgba(100, 100, 100, 1);
border: 0;
padding: 0;
}
/deep/ .el-dialog .el-dialog__header {
padding: 5px;
height: 30px;
}
/deep/ .el-dialog .el-dialog__title {
color: #fff;
}
/deep/ .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 4px;
right: 5px;
line-height: 16px;
}
/deep/ .el-dialog__headerbtn .el-dialog__close{
color: #fff;
}
</style>

View File

@ -0,0 +1,227 @@
<template>
<el-dialog
v-dialogDrag
class="route-setting"
:title="title"
:visible.sync="show"
width="900px"
label-position="top"
:before-close="doClose"
:z-index="2009"
:modal="false"
:close-on-click-modal="false"
>
<div style="padding: 5px;">
<el-row>
<el-col :span="12"><span>所选位置</span></el-col>
<el-col :span="12"><span>列车号</span></el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="sectionName" size="mini" style="width: 400px;" :disabled="true" />
</el-col>
<el-col :span="12">
<el-input v-model="trainCode" :max-length="7" size="mini" style="width: 310px;" />
<el-button size="mini" icon="el-icon-search" @click="trainFind" />
<el-button size="mini" icon="el-icon-refresh-left" @click="resetTrainCode" />
</el-col>
</el-row>
<div style="display: flex;justify-content: space-around;margin-top: 20px;">
<el-button size="mini" style="width: 280px;" @click="changeOperationType('show')">显示列车信息</el-button>
<el-button size="mini" style="width: 280px;" @click="changeOperationType('update')">修改列车资料</el-button>
<el-button size="mini" style="width: 280px;" @click="changeOperationType('create')">创建列车号</el-button>
</div>
<div style="display: flex;justify-content: space-around;margin-top: 10px;">
<el-button size="mini" style="width: 280px;" @click="changeOperationType('delete')">删除列车号</el-button>
<el-button size="mini" style="width: 280px;" @click="changeOperationType('move')">步进列车号</el-button>
<el-button size="mini" style="width: 280px;" @click="changeOperationType('resort')">重排列车号</el-button>
</div>
<div v-if="operationType === 'show'">
<el-table :data="tableData" border style="width: 100%;margin-top: 20px;" height="200">
<el-table-column prop="date" label="方向" />
<el-table-column prop="name" label="列车号" />
<el-table-column prop="address" label="位置" />
<el-table-column prop="address" label="ARS" />
<el-table-column prop="address" label="晚点" />
</el-table>
</div>
<div v-else-if="operationType === 'create'" style="display: flex;justify-content: space-between;">
<div>
<el-table :data="tableData" border style="width: 280px;margin-top: 20px;" height="200">
<el-table-column prop="date" label="方向" width="60" />
<el-table-column prop="name" label="列车号" width="157" />
<el-table-column prop="address" label="位置" width="60" />
</el-table>
</div>
<div>
<div style="margin-top: 20px;display: flex;justify-content: space-between;padding: 5px;align-items: center;">
<span>位置</span>
<el-input size="mini" style="width: 150px;" />
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;align-items: center;margin-top: 10px;">
<span>新列车号</span>
<el-input size="mini" style="width: 150px;" />
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;margin-top: 10px;">
<span>设置该列车为自动排列</span>
<el-radio v-model="autoArrange" label="true">开启</el-radio>
<el-radio v-model="autoArrange" label="false">关闭</el-radio>
</div>
<div style="display: flex;justify-content: space-between;padding: 5px;align-items: center;margin-top: 10px;">
<span>车组号</span>
<el-input size="mini" style="width: 60px;" />
<div style="border: 1px solid #DCDFE6;padding: 4px 5px;border-radius: 3px;">&lt;&gt;</div>
<el-input size="mini" style="width: 60px;" />
</div>
</div>
<div>
<div style="margin-top: 20px;height: 20px;">插入位置之前</div>
<el-table :data="tableData" border style="width: 280px;" height="180">
<el-table-column prop="date" label="方向" width="60" />
<el-table-column prop="name" label="列车号" width="157" />
<el-table-column prop="address" label="位置" width="60" />
</el-table>
</div>
</div>
<div v-else-if="operationType === 'delete'" style="display: flex;">
<div>
<el-table :data="tableData" border style="width: 280px;margin-top: 20px;" height="200">
<el-table-column prop="date" label="方向" width="60" />
<el-table-column prop="name" label="列车号" width="157" />
<el-table-column prop="address" label="位置" width="60" />
</el-table>
</div>
<div style="width: 250px;display: flex;justify-content: space-between;margin-top: 20px;margin-left: 10px;align-items: center;height: 25px;">
<div>所选列车号</div>
<el-input style="width: 150px;" size="mini" />
</div>
</div>
</div>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import { EventBus } from '@/scripts/event-bus';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteCreate',
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tableData: [],
sectionName: '',
trainCode: '',
operationType: 'create',
autoArrange: false
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '列监';
}
},
methods: {
loadInitData(map) {
// console.log(map, 11111);
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
this.loadInitData();
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
handleSelect(tab) {
this.activeIndex = tab;
},
trainFind() {
const train = this.$store.getters['map/getDeviceByCode'](this.trainCode);
this.tableData = [train];
},
resetTrainCode() {
this.trainCode = '';
},
changeOperationType(type) {
this.operationType = type;
},
commit() {
// const operate = {
// send: true,
// operation: OperationEvent.Section.newtrain.menu.operation,
// cmdType: CMD.Section.CMD_NEW_TRAIN,
// val: '' + this.direction + '::' + this.trainCode
// };
// this.loading = true;
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// this.loading = false;
// if (valid) {
// this.doClose();
// }
// }).catch(() => {
// this.loading = false;
// this.doClose();
// EventBus.$emit('sendMsg', {message: ''});
// });
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.route-setting {
.content_box {
margin-bottom: 10px;
.el-button{
&.active{
background: #969696;
}
}
}
.table_content_box{
margin-bottom: 20px;
}
/deep/ {
.table{
.table_header_box{
.cell{
text-align: center;
word-break: break-word;
}
}
}
}
}
</style>

View File

@ -27,7 +27,7 @@
</template>
<script>
import trainTrunkDown from '@/assets/baSiDi/up.png';
import TrainTrunkDetail from './trainTrunkDetail.vue';
import TrainTrunkDetail from '../../../jmapNew/theme/nanjing_02/menus/dialog/trainTrunkDetail.vue';
export default {
name:'Tra',
components:{
@ -63,7 +63,6 @@ export default {
});
},
doClose() {
// this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
@ -77,7 +76,7 @@ export default {
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1) !important;
position: relative;
border: 2px solid rgb(144, 144, 144, 0.8);
border: 2px solid rgba(144, 144, 144, 0.8);
border-radius: 6px;
font-size: 14px;
display: flex;

View File

@ -0,0 +1,178 @@
<template>
<el-dialog
:modal="false"
:title="title"
:visible.sync="show"
:fullscreen="true"
:before-close="doClose"
:z-index="2003"
>
<div>
<map-system-draft ref="mapCanvas" :no-menu="true" @back="back" />
</div>
</el-dialog>
</template>
<script>
import MapSystemDraft from '@/views/newMap/mapsystemNew/common/index';
import { mapGetters } from 'vuex';
import ButtonDbupIcon from '@/assets/baSiDi/dbup.png';
import ButtonRightIcon from '@/assets/baSiDi/right.png';
import ButtonLeftIcon from '@/assets/baSiDi/left.png';
import Vue from 'vue';
export default {
name: 'TRO',
components: {
MapSystemDraft
},
props: {
stationList: {
type: Array,
required: true
},
trainList: {
type: Array,
required: true
}
},
data() {
return {
dialogShow: false,
mapData: null,
deviceCode: '',
selfJmap: null,
buttonDbup: ButtonDbupIcon,
buttonRight: ButtonRightIcon,
buttonLeft: ButtonLeftIcon
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '轨道总览';
},
width() {
return this.$store.state.app.width - 5;
},
height() {
return this.$store.state.app.height - 50;
},
...mapGetters('map', [
'bigScreenConfig'
])
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) { //
if (this.dialogShow) {
this.showTroMode();
this.$refs.mapCanvas && this.$refs.mapCanvas.mapViewLoaded(false);
}
},
'$store.state.app.windowSizeCount': function() { //
this.$store.dispatch('config/resize', { width:this.width, height: this.height });
}
},
beforeDestroy() {
if (this.selfJmap && this.selfJmap._disposeFlag) {
this.destroy();
}
},
methods: {
doShow() {
this.dialogShow = true;
this.$jlmap && this.$jlmap.clearTrainView();
if (this.selfJmap) { Vue.prototype.$jlmap = this.selfJmap; }
this.$store.dispatch('config/resize', { width:this.width, height: this.height });
this.$nextTick(function() {
this.$refs.mapCanvas.setMap(this.$store.state.map.map);
const mapDevice = this.$store.state.map.mapDevice;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowMode(list, '05');
this.$store.dispatch('training/updateMapState', list);
});
},
destroy() {
this.selfJmap.dispose();
},
showTroMode() {
const mapDevice = this.$store.state.map.mapDevice;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.handleUpdateScreen();
this.$jlmap.updateShowMode(list, '05'); //
},
handleUpdateScreen() {
this.maskOpen = false;
if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
const offsetList = this.bigScreenConfig.offsetList;
const width = this.bigScreenConfig.width;
const height = this.bigScreenConfig.height;
const size = {
width: (this.$store.state.app.width - 2) * width,
height: this.$store.state.app.height * height,
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
this.$jlmap.setUpdateScreen(size);
} else {
this.maskOpen = true;
// this.$messageBox('线, ');
}
},
back() {},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$jlmap && this.$jlmap.clearTrainView();
this.selfJmap = Vue.prototype.$jlmap;
}
}
};
</script>
<style scoped>
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1);
position: relative;
border: 2px solid rgba(144, 144, 144, 0.8);
border-radius: 6px;
font-size: 14px;
}
/deep/ .el-dialog .el-dialog__body{
background: rgba(100, 100, 100, 1);
border: 0;
padding: 0;
}
/deep/ .el-dialog .el-dialog__header {
padding: 5px;
height: 30px;
}
/deep/ .el-dialog .el-dialog__title {
color: #fff;
}
/deep/ .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 4px;
right: 5px;
line-height: 16px;
}
/deep/ .el-dialog__headerbtn .el-dialog__close{
color: #fff;
}
.arrow-button{
width: 45px;
height: 30px;
cursor: pointer;
background-size: 45px 30px;
background-repeat: no-repeat;
}
</style>

View File

@ -0,0 +1,184 @@
<template>
<el-dialog
:modal="false"
:title="title"
:visible.sync="show"
:fullscreen="true"
append-to-body
:before-close="doClose"
:z-index="2000"
>
<div style="text-align: center;">
<map-system-draft ref="mapCanvas" />
<div class="button-box" style="">
<div class="arrow-button" :style="{backgroundImage: 'url(' + buttonLeft + ')' }" @click="changeStation(-1)" />
<div class="arrow-button" :style="{backgroundImage: 'url(' + buttonDbup + ')' }" @click="goTroDialog" />
<div class="arrow-button" :style="{backgroundImage: 'url(' + buttonRight + ')' }" @click="changeStation(1)" />
</div>
</div>
</el-dialog>
</template>
<script>
import MapSystemDraft from '@/views/newMap/mapsystemNew/common/index';
import ButtonDbupIcon from '@/assets/baSiDi/dbup.png';
import ButtonRightIcon from '@/assets/baSiDi/right.png';
import ButtonLeftIcon from '@/assets/baSiDi/left.png';
import Vue from 'vue';
export default {
name: 'TRO',
components: {
MapSystemDraft
},
props: {
stationList: {
type: Array,
required: true
},
trainList: {
type: Array,
required: true
}
},
data() {
return {
dialogShow: false,
mapData: null,
deviceCode: '',
buttonDbup: ButtonDbupIcon,
buttonRight: ButtonRightIcon,
buttonLeft: ButtonLeftIcon,
selfJmap: null
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '轨道详览';
},
width() {
return this.$store.state.app.width - 10;
},
height() {
return this.$store.state.app.height - 40;
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) { //
if (this.dialogShow) {
const list = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
Vue.prototype.$jlmap.updateShowMode(list, '02');
this.$refs.mapCanvas && this.$refs.mapCanvas.setCenter(this.deviceCode);
this.$refs.mapCanvas && this.$refs.mapCanvas.mapViewLoaded(false);
}
},
'$store.state.app.windowSizeCount': function() { //
this.$store.dispatch('config/resize', { width:this.width, height: this.height });
}
},
beforeDestroy() {
if (this.selfJmap && !this.selfJmap._disposeFlag) {
this.destroy();
}
},
methods: {
doShow(deviceCode) {
this.dialogShow = true;
if (this.selfJmap) { Vue.prototype.$jlmap = this.selfJmap; }
this.$jlmap && this.$jlmap.clearTrainView();
this.$store.dispatch('config/resize', { width:this.width, height: this.height });
this.deviceCode = deviceCode;
this.$nextTick(function() {
this.$refs.mapCanvas.setMap(this.$store.state.map.map);
const mapDevice = this.$store.state.map.mapDevice;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowMode(list, '02');
this.$store.dispatch('training/updateMapState', list);
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.selfJmap = Vue.prototype.$jlmap;
},
destroy() {
this.selfJmap.dispose();
},
goTroDialog() {
this.doClose();
this.$emit('goTroDialog');
},
changeStation(value) {
const device = this.$store.getters['map/getDeviceByCode'](this.deviceCode);
const stationSn = device.sn + value;
const station = this.stationList.find((item) => {
return item.sn === stationSn;
});
if (station) {
this.deviceCode = station.code;
this.$refs.mapCanvas && this.$refs.mapCanvas.setCenter(this.deviceCode);
}
}
}
};
</script>
<style scoped>
/deep/ .el-dialog {
background: rgba(100, 100, 100, 1);
position: relative;
border: 2px solid rgba(144, 144, 144, 0.8);
border-radius: 6px;
font-size: 14px;
}
/deep/ .el-dialog .el-dialog__body{
background: rgba(100, 100, 100, 1);
border: 0;
padding: 0;
}
/deep/ .el-dialog .el-dialog__header {
padding: 5px;
height: 30px;
}
/deep/ .el-dialog .el-dialog__title {
color: #fff;
}
/deep/ .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 4px;
right: 5px;
line-height: 16px;
}
/deep/ .el-dialog__headerbtn .el-dialog__close{
color: #fff;
}
.arrow-button{
width: 45px;
height: 30px;
cursor: pointer;
background-size: 45px 30px;
background-repeat: no-repeat;
}
.button-box{
width: 150px;
height: 35px;
display: flex;
position: absolute;
bottom: 60px;
left: calc(50% - 75px);
z-index: 9999;
justify-content: space-between;
justify-items: center;
}
</style>

View File

@ -4,6 +4,8 @@
<div class="btn_hover" @click="menuClick">菜单</div>
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
<el-button v-if="jl3dmodelShow && !isContest && project !== 'bjd'" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
<!-- 司机视角 -->
<el-button v-if="$route.query.lineCode === '15'" size="small" type="jumpjlmap3d" @click="jumpjlmap3dDriver">司机视角</el-button>
<el-button v-if="$route.query.lineCode === '15'" size="small" @click="clCaAnCall">经典案例分析</el-button>
<el-button v-if="$route.query.lineCode === '15'" size="small" @click="normStudy">规范学习</el-button>
</el-button-group>
@ -15,11 +17,14 @@
:panel-show="deviceShow"
@closedevice3dview="jumpjlmap3dmodel"
/>
<Jl3dRailway-Drive v-show="drivingShow" ref="Jl3dRailwayDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<draw-select ref="drawSelect" />
</div>
</template>
<script>
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
import Jl3dRailwayDrive from '@/views/jlmap3d/railwaydrive/jl3drailwaydrive';
import { getSessionStorage } from '@/utils/auth';
import { EventBus } from '@/scripts/event-bus';
import { getPostByProjectCode } from '@/api/learn';
@ -29,6 +34,7 @@ export default {
name:'DemonMenu',
components:{
Jl3dDevice,
Jl3dRailwayDrive,
DrawSelect
},
props:{
@ -161,7 +167,14 @@ export default {
}
}
}
},
showdriving() {
this.drivingShow = false;
},
jumpjlmap3dDriver() {
this.drivingShow = true;
this.$refs.Jl3dRailwayDrive.show(this.mapId, this.group);
},
}
};
</script>

View File

@ -177,12 +177,17 @@ export default {
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Switch_Hook_Lock: '道岔钩锁',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
Set_Speed_Limit:'设置限速',
Turn_Direction: '换端',
Drive_To: '驾驶至',
Apply_URM_Mode: '转URM模式',
Apply_RM_Mode: '转RM模式',
Apply_CM_Mode: '转CM模式',
Apply_AM_Mode: '转AM模式'
};
resultData = member.label + '对【' + targetName.label + '】下达【' + CommandList[element.commandInitiateVO.commandType] + '】指令';
} else if (element.type == 'Drive') {

View File

@ -58,12 +58,17 @@ export default {
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Switch_Hook_Lock: '道岔钩锁',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
Set_Speed_Limit:'设置限速',
Turn_Direction: '换端',
Drive_To: '驾驶至',
Apply_URM_Mode: '转URM模式',
Apply_RM_Mode: '转RM模式',
Apply_CM_Mode: '转CM模式',
Apply_AM_Mode: '转AM模式'
};
this.scriptTipMessage = '请对【' + targetName.labelName + '】下达【' + CommandList[val.commandInitiateVO.commandType] + '】指令';
} else if (val.type == 'Drive') {

View File

@ -76,6 +76,7 @@ export default {
operate: null,
concentrationStationList: [],
showMode: '02',
canvasId:'',
localStationShow: false,
previewOrMapDraw: false,
trainingSetStation: false //
@ -85,11 +86,12 @@ export default {
...mapGetters('training', [
'mode'
]),
canvasId() {
const canvasId = ['map', (Math.random().toFixed(5)) * 100000].join('_');
this.$store.dispatch('config/setCurrentCancasId', { id: canvasId });
return canvasId;
},
// canvasId() {
// // debugger;
// const canvasId = ['map', (Math.random().toFixed(5)) * 100000].join('_');
// this.$store.dispatch('config/setCurrentCancasId', { id: canvasId });
// return canvasId;
// },
width() {
return this.$store.state.config.width;
},
@ -207,6 +209,8 @@ export default {
EventBus.$on('refresh', () => {
this.refresh(this.$store.state.map.map);
});
this.canvasId = ['map', (Math.random().toFixed(5)) * 100000].join('_');
this.$store.dispatch('config/setCurrentCancasId', { id: this.canvasId });
},
mounted() {
this.initLoadPage();
@ -265,7 +269,6 @@ export default {
stateUpdate: this.handleStateUpdate
}
});
this.$jlmap.on('dataZoom', this.onDataZoom, this);
this.$jlmap.on('selected', this.onSelected, this);
this.$jlmap.on('contextmenu', this.onContextMenu, this);

View File

@ -1,7 +1,7 @@
<template>
<div id="_Tips_Start_Position" class="mapContext">
<training-tips ref="trainingTips" />
<component :is="menus" :selected="selected" />
<component :is="menus" v-if="!noMenu" :selected="selected" />
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" @onMenu="contextmenu" />
</div>
</template>
@ -21,6 +21,12 @@ export default {
JlmapVisual,
TrainingTips
},
props: {
noMenu: {
type: Boolean,
default: false
}
},
data() {
return {
selected: null,
@ -215,6 +221,9 @@ export default {
},
setCenter(code) {
this.$refs.jlmapVisual && this.$refs.jlmapVisual.setCenter(code);
},
setMap(data) {
this.$refs.jlmapVisual && this.$refs.jlmapVisual.setMap(data);
}
}
};

View File

@ -64,6 +64,7 @@
<script>
import { saveMap, generateCI } from '@/api/jmap/mapdraft';
import { mapGetters } from 'vuex';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'Config',
components: {
@ -92,7 +93,7 @@ export default {
'routeNameUseEndOppositeSignalName', 'generateTbRoute', 'tbRouteNameUseEndOppositeSignalName', 'routeSignalAlwaysGreen',
'routeApartByOverlap', 'overlapOnlySwitch', 'overlapSwitchNpOnly', 'overlapSignalOppositeSwitchNpOnly',
'generateCycle', 'routeButton', 'likeHa1', 'getNearlySignal', 'overlapSettingByTrigger', 'generateFls', 'signalApproachNotPassPreSignal',
'generateDestination'
'generateDestination', 'ctcOverlapOnlyTurnBackStationLock'
],
multipleList: ['sharingECStations'],
selectList: [],
@ -125,7 +126,8 @@ export default {
generateFls: '是否生成侧防:是-生成侧防,不要联动道岔,否-不生成侧防,用联动道岔',
signalApproachNotPassPreSignal:'信号机接近区段不跨过前方同向信号机',
generateDestination: '是否生成目的地码定义(泰雷兹)',
sharingECStations: '共享紧急关闭效果的车站'
sharingECStations: '共享紧急关闭效果的车站',
ctcOverlapOnlyTurnBackStationLock: 'CTC列车进路延续保护仅折返站处锁闭'
}
};
},
@ -244,6 +246,7 @@ export default {
<span>生成站间运行等级数据${resp.data.stationRunlevelCount}</span>`;
instance.type = 'success';
instance.showCancelButton = false;
EventBus.$emit('successCI');
}).catch((error)=> {
if (error.code === 500045) {
this.$message.error('生成并保存联锁关系失败:地图基础信息有误');

View File

@ -15,6 +15,7 @@
// import { mapGetters } from 'vuex';
// import { listMap } from '@/api/jmap/mapdraft';
import { getContinueProtectList, delContinueProtect, putContinueProtect } from '@/api/jmap/mapdraft';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'RouteDetail',
@ -147,6 +148,7 @@ export default {
handleUpload(index, row) {
putContinueProtect(this.$route.params.mapId, row).then(res => {
this.$message.success('更新成功');
EventBus.$emit('successCI');
}).catch(() => {
this.$messageBox('操作异常');
});

View File

@ -4,6 +4,12 @@
<el-form-item label="延续保护名称:" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item label="cbtc模式下需要办理:" prop="setInCbtc">
<el-radio-group v-model="addModel.setInCbtc">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="方向:" prop="right">
<el-radio-group v-model="addModel.right">
<el-radio :label="true">向右</el-radio>
@ -164,6 +170,7 @@ export default {
code: '',
name: '',
right: '',
setInCbtc: false,
mapId: '',
unlockSectionCode:'',
unlockTime: 0,
@ -219,7 +226,6 @@ export default {
}
},
protectData(val, old) {
console.log(val, 'val');
if (val) {
this.addModel = val;
this.addModel.pathList && this.addModel.pathList.forEach(item => {

View File

@ -12,6 +12,8 @@
<script>
import { putContinueProtect } from '@/api/jmap/mapdraft';
import ProtectOperate from './protect';
import { EventBus } from '@/scripts/event-bus';
export default {
name:'BigRouteInfo',
components: {
@ -82,6 +84,7 @@ export default {
this.$message.success('更新成功!');
this.$refs.protect.clear();
this.isModify = false;
EventBus.$emit('successCI');
}).catch(() => {
this.$message.error('更新失败!');
});

View File

@ -13,8 +13,7 @@
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getFlankProtectionList, delFlankProtection, getFlankProtectionDetail } from '@/api/jmap/mapdraft';
import { getFlankProtectionList, delFlankProtection, getDraftMapFlsList } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
@ -29,7 +28,7 @@ export default {
data() {
return {
show: false,
mapList: [],
// mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
@ -37,17 +36,13 @@ export default {
queryForm: {
labelWidth: '120px',
queryObject: {
stationCode: {
code: {
type: 'select',
label: '联锁车站',
label: '侧防code',
config: {
data: []
}
},
number: {
type: 'text',
label: '侧防编号'
},
name: {
type: 'text',
label: '侧防名称'
@ -68,22 +63,18 @@ export default {
title: '侧防code',
prop: 'code'
},
{
title: '侧防编号',
prop: 'number'
},
{
title: '地图名称',
prop: 'mapId'
},
{
title: '连锁站',
prop: 'stationCode'
},
// {
// title: '',
// prop: 'number'
// },
// {
// title: '',
// prop: 'stationCode'
// },
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
width: '300',
buttons: [
{
name: this.$t('map.compile'),
@ -102,21 +93,21 @@ export default {
},
computed: {
...mapGetters('map', [
'stationList'
// 'stationList'
])
},
watch: {
stationList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
if (val[i].ciStation) {
list.push({ label: val[i].name, value: val[i].code });
}
}
this.queryForm.queryObject.stationCode.config.data = list;
}
}
// stationList: function (val, old) {
// const list = [];
// if (val && val.length) {
// for (let i = 0; i < val.length; i++) {
// if (val[i].ciStation) {
// list.push({ label: val[i].name, value: val[i].code });
// }
// }
// this.queryForm.queryObject.stationCode.config.data = list;
// }
// }
},
mounted() {
this.acquireMapList();
@ -143,30 +134,27 @@ export default {
return getFlankProtectionList(this.mapInfo.id, params);
}
},
acquireMapList() { //
listMap({ drawWay:true}).then(response => {
this.mapList = response.data;
acquireMapList() {
getDraftMapFlsList(this.mapInfo.id).then(response => {
this.queryForm.queryObject.code.config.data = response.data;
});
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']);
});
}
// const that = this;
// const list = data.list;
// if (list) {
// list.map(elem => {
// that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
// that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']);
// });
// }
}
return data;
},
editObj(index, row) {
getFlankProtectionDetail(row.id).then(response => {
const data = response.data;
this.$emit('autoMaticoSelected', data);
this.doClose();
});
this.$emit('autoMaticoSelected', row);
this.doClose();
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
@ -176,7 +164,7 @@ export default {
type: 'warning'
}).then(() => {
//
delFlankProtection(row.id).then(response => {
delFlankProtection(this.mapInfo.id, row.code).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.$store.dispatch('map/delFlankProtectList', row);
this.reloadTable();

View File

@ -3,162 +3,132 @@
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="140px" size="mini">
<div class="definition">
<el-form-item label="编号:" prop="number">
<el-input v-model="addModel.number" style="width: 220px;" />
</el-form-item>
<el-form-item label="名称:" prop="name">
<el-input v-model="addModel.name" style="width: 220px;" />
</el-form-item>
<el-form-item label="所属联锁站:" prop="stationCode">
<el-select v-model="addModel.stationCode" clearable :filterable="true" style="width: 220px;" @change="changeStation">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankStationList' ? 'danger' : 'primary'"
@click="hover('flankStationList')"
>{{ $t('map.activate') }}</el-button>
<el-form-item label="侧防1线路:" prop="level1List">
<el-table :data="addModel.level1List" border style="width: 80%">
<el-table-column type="index" label="序号" width="100" />
<el-table-column fixed="right" :label="$t('map.operation')">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteOverlab(addModel.level1List, scope.$index)"
>
移出
</el-button>
<el-button
type="text"
size="small"
@click.native.prevent="editOverlab(addModel.level1List, scope.$index, 'level1List')"
>
编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<div style="height: 100%; position: relative; left: 8%; width: 88%; margin-bottom: 20px;">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-size: 12px;">等级1</span>
</div>
<div style="margin-top: 8px;">
<el-form-item label="侧防道岔:">
<el-select v-model="addModel.level1.protectSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-form-item label="侧防2线路:" prop="level2List">
<el-table :data="addModel.level2List" border style="width: 80%">
<el-table-column type="index" label="序号" width="100" />
<el-table-column fixed="right" :label="$t('map.operation')">
<template slot-scope="scope">
<el-button
:type=" field === 'flankSwitchLevel1' ? 'danger' : 'primary'"
@click="hover('flankSwitchLevel1')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModel.level1.protectSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="侧防信号机:">
<el-select v-model="addModel.level1.protectSignal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in signalList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
type="text"
size="small"
@click.native.prevent="deleteOverlab(addModel.level2List, scope.$index)"
>
移出
</el-button>
<el-button
:type=" field === 'flankSingalLevel1' ? 'danger' : 'primary'"
@click="hover('flankSingalLevel1')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="侧防区域元件:">
<el-select v-model="addModel.level1.areaSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankAreaSwitchLevel1' ? 'danger' : 'primary'"
@click="hover('flankAreaSwitchLevel1')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModel.level1.areaSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</div>
</el-card>
</div>
<div style="height: 100%; position: relative; left: 8%; width: 88%">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-size: 12px;">等级2</span>
</div>
<div style="margin-top: 8px;">
<el-form-item label="侧防道岔:">
<el-select v-model="addModel.level2.protectSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankSwitchLevel2' ? 'danger' : 'primary'"
@click="hover('flankSwitchLevel2')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModel.level2.protectSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="侧防信号机:">
<el-select v-model="addModel.level2.protectSignal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in signalList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankSingalLevel2' ? 'danger' : 'primary'"
@click="hover('flankSingalLevel2')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="侧防区域元件:">
<el-select v-model="addModel.level2.areaSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankAreaSwitchLevel2' ? 'danger' : 'primary'"
@click="hover('flankAreaSwitchLevel2')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModel.level2.areaSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</div>
</el-card>
</div>
type="text"
size="small"
@click.native.prevent="editOverlab(addModel.level2List, scope.$index, 'level2List')"
>
编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</div>
</el-form>
<div style="height: 100%; position: relative; left: 8%; width: 88%; margin-bottom: 20px;">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-size: 14px;">{{ cardTitle }}</span>
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0;" type="text" @click="handleLevel('level1List')">生成等级1</el-button>
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0; margin-right: 10px;" type="text" @click="handleLevel('level2List')">生成等级2</el-button>
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
</el-button-group>
</div>
<div>
<el-form ref="overlabForm" :model="addModelFlank" :rules="overLapRules" label-width="135px" size="mini" style="margin-top: 15px">
<el-form-item label="侧防道岔:">
<el-select v-model="addModelFlank.protectSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankSwitchLevel' ? 'danger' : 'primary'"
@click="hover('flankSwitchLevel')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModelFlank.protectSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="侧防信号机:">
<el-select v-model="addModelFlank.protectSignal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in signalList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankSingalLevel' ? 'danger' : 'primary'"
@click="hover('flankSingalLevel')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="侧防区域元件:">
<el-select v-model="addModelFlank.areaSwitch.switchCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'flankAreaSwitchLevel' ? 'danger' : 'primary'"
@click="hover('flankAreaSwitchLevel')"
>{{ $t('map.activate') }}</el-button>
<el-select v-model="addModelFlank.areaSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
<div class="draft">
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">保存侧防</el-button>
@ -171,7 +141,8 @@
<script>
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { getFlankProtectionList, postFlankProtection, putFlankProtection } from '@/api/jmap/mapdraft';
import { postFlankProtection, putFlankProtection } from '@/api/jmap/mapdraft';
import { deepAssign } from '@/utils/index';
export default {
name: 'RouteOperation',
@ -208,56 +179,49 @@ export default {
code: '',
mapId: '',
id: '',
number: '',
stationCode: '',
name: '',
level1: {
protectSwitch: {
switchCode: '',
normal: ''
},
protectSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
source: {},
level1List: [],
level2List: []
},
addModelFlank: {
protectSwitch: {
switchCode: '',
normal: ''
},
level2: {
protectSwitch: {
switchCode: '',
normal: ''
},
protectSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
protectSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
},
parentIndex: 0,
editShow: false,
overLapRules: {
},
levelList: '',
rules: {
stationCode: [
{ required: true, message: '请选择所属连锁站', trigger: 'change' }
],
number: [
{ required: true, message: '请输入编号', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
]
}
},
cardMode: 'generate'
};
},
computed: {
...mapGetters('map', [
'stationList',
'switchList',
'signalList'
]),
filterStationList() { //
return this.stationList.filter(station=>{
return station.ciStation;
});
cardTitle() {
if (this.cardMode === 'generate') {
return '生成侧防线路';
} else if (this.cardMode === 'edit') {
return '编辑侧防线路';
} else {
return '';
}
}
},
watch: {
@ -268,8 +232,15 @@ export default {
},
routeData(val, old) {
if (val) {
// console.log(this, this.$copyClone);
this.addModel = this.$copyClone(this.addModel, val);
this.addModel = {
code: val.code,
mapId: val.mapId,
id: val.id,
name: val.name,
source: JSON.parse(JSON.stringify(val.source)),
level1List: JSON.parse(JSON.stringify(val.level1List)),
level2List: JSON.parse(JSON.stringify(val.level2List))
};
this.editShow = true;
}
}
@ -283,48 +254,19 @@ export default {
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
if (this.field.toUpperCase() === 'flankSingalLevel1'.toUpperCase()) {
this.addModel.level1.protectSignal = selected.code;
} else if (this.field.toUpperCase() === 'flankSingalLevel2'.toUpperCase()) {
this.addModel.level2.protectSignal = selected.code;
if (this.field.toUpperCase() === 'flankSingalLevel'.toUpperCase()) {
this.addModelFlank.protectSignal = selected.code;
}
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'flankStationList'.toUpperCase()) {
this.addModel.stationCode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
if (this.field.toUpperCase() === 'flankSwitchLevel1'.toUpperCase()) {
this.addModel.level1.protectSwitch.switchCode = selected.code;
} else if (this.field.toUpperCase() === 'flankSwitchLevel2'.toUpperCase()) {
this.addModel.level2.protectSwitch.switchCode = selected.code;
} else if (this.field.toUpperCase() === 'flankAreaSwitchLevel1'.toUpperCase()) {
this.addModel.level1.areaSwitch.switchCode = selected.code;
} else if (this.field.toUpperCase() === 'flankAreaSwitchLevel2'.toUpperCase()) {
this.addModel.level2.areaSwitch.switchCode = selected.code;
if (this.field.toUpperCase() === 'flankSwitchLevel'.toUpperCase()) {
this.addModelFlank.protectSwitch.switchCode = selected.code;
} else if (this.field.toUpperCase() === 'flankAreaSwitchLevel'.toUpperCase()) {
this.addModelFlank.areaSwitch.switchCode = selected.code;
}
}
this.field = '';
}
},
async changeStation(code) {
if (code) {
const params = {
stationCode: code,
number: '',
name: '',
pageSize: 999,
pageNum: 1
};
const res = await getFlankProtectionList(this.mapInfo.id, params);
if (res.data.list.length) {
let num = 0;
res.data.list.forEach(elem => {
if (Number(elem.number) > num) {
num = Number(elem.number);
}
});
this.addModel.number = num + 1;
}
}
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
if (code) { model['code'] = code; }
@ -343,7 +285,6 @@ export default {
this.$message.success('保存成功');
this.loading = false;
this.clear();
this.changeStation(dataModel.stationCode);
}).catch(() => {
this.$messageBox('保存失败');
this.loading = false;
@ -355,13 +296,10 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
const data = this.buildModel();
putFlankProtection(data).then(resp => {
const dataModel = JSON.parse(JSON.stringify(data));
putFlankProtection(this.mapInfo.id, this.addModel).then(resp => {
this.$message.success('更新成功');
this.loading = false;
this.clear();
this.changeStation(dataModel.stationCode);
}).catch(() => {
this.$messageBox('更新失败');
this.loading = false;
@ -371,39 +309,71 @@ export default {
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
// this.$refs.form.resetFields();
this.addModel = {
code: '',
mapId: '',
id: '',
number: '',
name: '',
stationCode: this.addModel.stationCode,
level1: {
protectSwitch: {
switchCode: '',
normal: ''
},
protectSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
},
level2: {
protectSwitch: {
switchCode: '',
normal: ''
},
protectSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
}
level1List: [],
level2List: []
};
this.isSave = true;
}
},
deleteOverlab(list, index) {
list.splice(index, 1);
this.clearOverlab();
this.cardMode = 'generate';
this.levelList = '';
},
editOverlab(list, index, level) {
this.addModelFlank = deepAssign(this.addModelFlank, list[index]);
this.parentIndex = index;
this.cardMode = 'edit';
this.levelList = level;
},
updateOverlab() {
if (this.addModelFlank.protectSwitch.switchCode || this.addModelFlank.protectSignal) {
this.addModel[this.levelList][this.parentIndex] = {
protectSwitch: this.addModelFlank.protectSwitch,
protectSignal: this.addModelFlank.protectSignal,
areaSwitch: this.addModelFlank.areaSwitch
};
this.clearOverlab();
this.cardMode = 'generate';
this.levelList = '';
}
},
cancelOverlab() {
this.clearOverlab();
this.cardMode = 'generate';
this.levelList = '';
},
handleLevel(level) {
if (!this.addModelFlank.protectSwitch.switchCode || !this.addModelFlank.protectSignal) {
this.$messageBox('请选择侧防等级信息!');
} else {
this.addModel[level].push({
protectSwitch: this.addModelFlank.protectSwitch,
protectSignal: this.addModelFlank.protectSignal,
areaSwitch: this.addModelFlank.areaSwitch
});
this.clearOverlab();
}
},
clearOverlab() {
this.addModelFlank = {
protectSwitch: {
switchCode: '',
normal: ''
},
protectSignal: '',
areaSwitch: {
switchCode: '',
normal: ''
}
};
}
}
};

View File

@ -104,10 +104,10 @@ export default {
{label: this.$t('map.routeID'), name:'route', menus:RouteOperate},
{label: '延续保护', name: 'overlap', menus: ContinueProtectOperate},
{label: this.$t('map.signalApprochSection'), name:'signal', menus:SignalOperate}, //
{label: '侧防', name:'flankProtect', menus:FlankProtectOperate},
{label: '自动折返', name:'turned', menus:TurnedOperate},
{label: '目的地码', name:'destination', menus:DestinationOperate},
{label: this.$t('map.automaticSignal'), name:'automatic', menus:AutomaticOperate},
{label: '侧防', name:'flankProtect', menus:FlankProtectOperate},
{label: this.$t('map.routing'), name:'routing', menus:RoutingOperate},
{label: '停站时间', name:'dwellTime', menus:DwellTimeOperate},
{label: '设置运行等级', name:'runLevel', menus:RunLevelOperate}

View File

@ -18,10 +18,11 @@
<script>
import { mapGetters } from 'vuex';
import { listMap, getRouteNewList, delRouteNew, putRouteNew, putSetDraftMapRouteById, getOverlapAllList } from '@/api/jmap/mapdraft';
import { listMap, getRouteNewList, delRouteNew, putRouteNew, putSetDraftMapRouteById } from '@/api/jmap/mapdraft';
// import ProtectDetail from './protectDetail';
import PreViewField from './preview';
import Related from './related';
// import { EventBus } from '@/scripts/event-bus';
export default {
name: 'RouteDetail',
@ -36,6 +37,12 @@ export default {
default() {
return null;
}
},
overlapList: {
type: Array,
default() {
return [];
}
}
},
data() {
@ -48,7 +55,7 @@ export default {
RouteAutoTypeList: [],
SwitchLocateTypeList: [],
ContinueProtectList: [],
overlapList: [], //
// overlapList: [], //
turnBackList: [
{ label: '是', value: true },
{ label: '否', value: false }
@ -256,12 +263,13 @@ export default {
this.SwitchLocateTypeList = list;
});
this.acquireMapList();
this.initProtectData();
},
methods: {
doShow(showType, codeType) {
this.show = true;
this.reloadTable();
this.$nextTick(() => {
this.$refs.queryListPage && this.$refs.queryListPage.commitQuery();
});
if (showType && codeType) {
this.showType = showType;
this.codeType = codeType;
@ -270,11 +278,6 @@ export default {
doClose() {
this.show = false;
},
initProtectData() {
getOverlapAllList(this.$route.params.mapId).then(resp => {
this.overlapList = resp.data;
});
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getRouteNewList(this.mapInfo.id, params);
@ -291,12 +294,7 @@ export default {
const list = data.list;
if (list) {
list.map(elem => {
that.$convertSpecifiedField(elem, that.RouteAutoTypeList, 'code', 'name', ['autoType']);
that.$convertSpecifiedField(elem, that.RouteNatureTypeList, 'code', 'name', ['natureType']);
that.$convertSpecifiedField(elem, that.SwitchLocateTypeList, 'code', 'name', ['overlapSwitchLocateType']);
that.$convertSpecifiedField(elem, that.switchList, 'code', 'name', ['routeOverlapSwitchList']);
that.$convertSpecifiedField(elem, that.signalList, 'code', 'name', ['startSignalCode', 'endSignalCode']);
that.$convertSpecifiedField(elem, that.sectionList, 'code', 'name', ['nearSectionCode', 'autoTriggerSectionCode', 'turnBackSectionCode']);
});
}
}
@ -318,11 +316,8 @@ export default {
});
},
edit(index, row) {
// getRouteNewById(row.mapId).then(response => {
// const data = response.data;
this.$emit('routeSelected', row);
this.doClose();
// });
},
deleteObj(index, row) {
if (row) {

Some files were not shown because too many files have changed in this diff Show More