Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
eaa61c5a55
@ -510,7 +510,7 @@ export default {
|
||||
switchId: 'Switch ID',
|
||||
turnBackSectionCode: 'Turn back track ID:',
|
||||
routeTriggerSectionList: 'The approach automatically triggers the segment data:',
|
||||
nearSectionCodeColon: 'Close to extent ID:',
|
||||
nearSectionCodeColon: 'Close to extent ID(CBTC):',
|
||||
|
||||
thenList: 'Then list',
|
||||
startStation: 'Originating station',
|
||||
@ -587,5 +587,27 @@ export default {
|
||||
logicalSectionEndOffset: 'Logical section start offset:',
|
||||
associateSwitchSection: 'Associate switch section:',
|
||||
failedToSetParkingPointOffset: 'failed to set parking point offset: the actual length of the section is less than the offset distance.',
|
||||
correlationWindow: 'Correlation window'
|
||||
correlationWindow: 'Correlation window',
|
||||
showConditions: 'Show conditions:',
|
||||
localCenter: 'Local&Center',
|
||||
local: 'Local',
|
||||
center: 'Center',
|
||||
autoTurnedList: 'Auto turned list',
|
||||
autoTurnedName: 'Auto turned list',
|
||||
reentryRoute: 'Reentry route',
|
||||
basicRoute: 'Basic route',
|
||||
reentrySection: 'Reentry section',
|
||||
reentryRoute2: 'Reentry route 2',
|
||||
basicRoute2: 'Basic route 2',
|
||||
reentrySection2: 'Reentry section 2',
|
||||
setPriority: 'Set priority',
|
||||
associatedStationList: 'Associated station list:',
|
||||
whetherAutoRoute: 'Whether auto route',
|
||||
hostileData: 'Hostile data',
|
||||
routeContinuesToProtectSectorData: 'Route continues to protect sector data',
|
||||
physicalSectionID: 'Physical section ID',
|
||||
physicalSectionName: 'Physical section name',
|
||||
routePhysicalSectionData: 'Route physical section data',
|
||||
routeSideDefenseSwitch: 'Route side defense switch',
|
||||
switchID: 'Switch ID'
|
||||
};
|
||||
|
@ -448,7 +448,7 @@ export default {
|
||||
switchId: '道岔',
|
||||
turnBackSectionCode: '折返轨:',
|
||||
routeTriggerSectionList: '自动追踪接近区段:',
|
||||
nearSectionCodeColon: '接近区段:',
|
||||
nearSectionCodeColon: '接近区段(CBTC):',
|
||||
|
||||
thenList: '交路列表',
|
||||
startStation: '起始站',
|
||||
@ -580,5 +580,29 @@ export default {
|
||||
logicalSectionEndOffset: '逻辑区段终点偏移:',
|
||||
associateSwitchSection: '关联道岔区段:',
|
||||
failedToSetParkingPointOffset: '设置停车点偏移量失败:区段实际长度小于偏移距离。',
|
||||
correlationWindow: '关联车次窗'
|
||||
correlationWindow: '关联车次窗',
|
||||
showConditions: '显示条件:',
|
||||
localCenter: '现地&行调',
|
||||
local: '现地',
|
||||
center: '行调',
|
||||
autoTurnedList: '自动折返列表',
|
||||
autoTurnedName: '自动折返名称',
|
||||
reentryRoute: '折返进路',
|
||||
basicRoute: '基础进路',
|
||||
reentrySection: '折返区段',
|
||||
reentryRoute2: '折返进路2',
|
||||
basicRoute2: '基础进路2',
|
||||
reentrySection2: '折返区段2',
|
||||
setPriority: '设置优先级',
|
||||
associatedStationList: '关联站台列表:',
|
||||
whetherAutoRoute: '是否自定进路',
|
||||
hostileData: '敌对数据',
|
||||
routeContinuesToProtectSectorData: '进路延续保护区段数据',
|
||||
physicalSectionID: '物理区段ID',
|
||||
physicalSectionName: '物理区段名称',
|
||||
routePhysicalSectionData: '进路物理区段数据',
|
||||
routeSideDefenseSwitch: '进路侧防道岔',
|
||||
switchID: '道岔ID',
|
||||
normalPosition: '定位',
|
||||
reversePosition: '反位'
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
export function SetCamera(dom) {
|
||||
var camera = new THREE.PerspectiveCamera(60, dom.clientWidth/dom.clientHeight, 1, 3000);
|
||||
var camera = new THREE.PerspectiveCamera(60, dom.clientWidth/dom.clientHeight, 1, 2000);
|
||||
camera.position.set( 0, 0, 0 );
|
||||
camera.aspect = window.innerWidth / window.innerHeight;
|
||||
camera.updateProjectionMatrix();
|
||||
|
@ -1,9 +1,5 @@
|
||||
export function SetRender(dom) {
|
||||
var renderer = new THREE.WebGLRenderer({antialias: true});
|
||||
var renderer = new THREE.WebGLRenderer();//{antialias: true}
|
||||
renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
||||
// renderer.gammaInput = true;
|
||||
// renderer.gammaOutput = true;
|
||||
// renderer.setPixelRatio( window.devicePixelRatio );
|
||||
//renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
return renderer;
|
||||
}
|
||||
|
@ -13,11 +13,11 @@ export function SetScene(project) {
|
||||
var bgTexture;
|
||||
// console.log(project);
|
||||
if(project == "login" || project == undefined){
|
||||
bgTexture = new THREE.TextureLoader().load("../../static/background/background.jpg");
|
||||
bgTexture = new THREE.TextureLoader().load("../../static/background/other.jpg");
|
||||
}else if(project == "hyd"){
|
||||
bgTexture = new THREE.TextureLoader().load("../../static/background/other.jpg");
|
||||
}
|
||||
scene.background = bgTexture;
|
||||
// cubeTexture.dispose();
|
||||
// cubeTexture.dispos e();
|
||||
return scene;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ export function Jlmap3ddata(mapid,scope){
|
||||
assetloader.assetpromise(scene)
|
||||
.then(function(data){
|
||||
|
||||
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,scene,assetloader);
|
||||
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata.stationStandList,scene,assetloader);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
|
@ -56,7 +56,6 @@ export function getmodels(data) {
|
||||
// postmap.sections.link = JSON.stringify(links);
|
||||
|
||||
//section隧道
|
||||
console.log(data.mapdata.sectionlist.sections);
|
||||
let sections = [];
|
||||
|
||||
for(let i=0;i<data.mapdata.sectionlist.sections.datalist.length;i++){
|
||||
@ -124,7 +123,8 @@ export function getmodels(data) {
|
||||
code:data.mapdata.signallist.list[i].mesh.code,
|
||||
position:data.mapdata.signallist.list[i].mesh.position,
|
||||
rotation:data.mapdata.signallist.list[i].mesh.rotation,
|
||||
scale:data.mapdata.signallist.list[i].mesh.scale
|
||||
scale:data.mapdata.signallist.list[i].mesh.scale,
|
||||
virtual:data.mapdata.signallist.list[i].mesh.virtual
|
||||
}
|
||||
|
||||
signals.push(signal);
|
||||
|
@ -57,15 +57,14 @@ export function getmodels(data) {
|
||||
|
||||
//section隧道
|
||||
let sections = [];
|
||||
console.log(data.mapdata.sectionlist.sections.datalist);
|
||||
// console.log(data.mapdata.sectionlist.sections.datalist);
|
||||
for(let i in data.mapdata.sectionlist.sections.datalist){
|
||||
|
||||
console.log(data.mapdata.sectionlist.sections.datalist[i]);
|
||||
let section = {
|
||||
// uuid:data.mapdata.sectionlist.sections.modellist[i].uuid,
|
||||
code:data.mapdata.sectionlist.sections.datalist[i].code,
|
||||
name:data.mapdata.sectionlist.sections.datalist[i].name,
|
||||
lengthFact:data.mapdata.sectionlist.sections.datalist[i].lengthFact,
|
||||
lengthFact:data.mapdata.sectionlist.sections.datalist[i].mesh.lengthFact,
|
||||
standTrack:data.mapdata.sectionlist.sections.datalist[i].standTrack,
|
||||
rightlist:data.mapdata.sectionlist.sections.datalist[i].rightlist,
|
||||
leftlist:data.mapdata.sectionlist.sections.datalist[i].leftlist,
|
||||
|
@ -91,7 +91,7 @@ export function SectionList() {
|
||||
// newsection.iscur = "3";
|
||||
// }
|
||||
if(sectiondata[i].standTrack == true){
|
||||
console.log(sectiondata[i].code);
|
||||
// console.log(sectiondata[i].code);
|
||||
|
||||
sectiondata[i].startx = sectiondata[i].points[0].x;
|
||||
sectiondata[i].starty = sectiondata[i].points[0].y;
|
||||
@ -182,7 +182,7 @@ export function SectionList() {
|
||||
};
|
||||
// console.log(stationlist[i]);
|
||||
|
||||
console.log(stationlist[i].direction1.section);
|
||||
// console.log(stationlist[i].direction1.section);
|
||||
for(let j=0,lenj = scope.stopsection.length;j<lenj;j++){
|
||||
if(scope.stopsection[j].code == stationlist[i].direction2.section){
|
||||
realstopsection.topsection = scope.stopsection[j];
|
||||
@ -313,10 +313,15 @@ export function SectionList() {
|
||||
}
|
||||
let stations = jlmap3ddata.stationstandlist.list;
|
||||
let num;
|
||||
let num2;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].deviceType == "stand"){
|
||||
num = j;
|
||||
}
|
||||
if(assetloader.modellist[j].deviceType == "standwaice"){
|
||||
num2 = j;
|
||||
assetloader.modellist[num2].mesh.rotation.x = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for(let j=0,lenj=stations.length;j<lenj;j++){
|
||||
@ -324,8 +329,13 @@ export function SectionList() {
|
||||
// console.log(scope.sections.datalist[stations[j].direction1.section]);
|
||||
let x = scope.sections.datalist[stations[j].direction1.section].mesh.position.x;
|
||||
let z = (scope.sections.datalist[stations[j].direction1.section].mesh.position.z+scope.sections.datalist[stations[j].direction2.section].mesh.position.z)/2;
|
||||
let mesh;
|
||||
if(stations[j].direction1.inside == true){
|
||||
mesh = assetloader.modellist[num].mesh.clone(true);
|
||||
}else{
|
||||
mesh = assetloader.modellist[num2].mesh.clone(true);
|
||||
}
|
||||
|
||||
var mesh = assetloader.modellist[num].mesh.clone(true);
|
||||
jlmap3ddata.stationstandlist.list[j].modelid = assetloader.modellist[num].modelid;
|
||||
jlmap3ddata.stationstandlist.list[j].mesh = mesh;
|
||||
// console.log(x);
|
||||
@ -867,8 +877,8 @@ export function SectionList() {
|
||||
name:sectiondata[i].name,
|
||||
standTrack:sectiondata[i].standTrack,
|
||||
rail:sectiondata[i].rail,
|
||||
rightlist:sectiondata[i].rightlist,
|
||||
leftlist:sectiondata[i].leftlist,
|
||||
rightlist:rightlist,
|
||||
leftlist:leftlist,
|
||||
rsection:sectiondata[i].rsection,
|
||||
lsection:sectiondata[i].lsection,
|
||||
csection:sectiondata[i].csection,
|
||||
@ -879,7 +889,9 @@ export function SectionList() {
|
||||
};
|
||||
|
||||
let len = newsection.lengthFact;
|
||||
|
||||
if(sectiondata[i].code == "T208"){
|
||||
console.log(newsection.lengthFact);
|
||||
}
|
||||
let testmesh2 = autorail.clone(true);
|
||||
for(let i=0;i<autorail.rightlist.length;i++){
|
||||
testmesh2.geometry.attributes.position.array[autorail.rightlist[i]*3] = len;
|
||||
@ -896,8 +908,9 @@ export function SectionList() {
|
||||
testmesh2.geometry.computeBoundingSphere();
|
||||
testmesh2.geometry.center();
|
||||
testmesh2.code = newsection.code;
|
||||
testmesh2.rightlist = sectiondata[i].rightlist,
|
||||
testmesh2.leftlist = sectiondata[i].leftlist,
|
||||
testmesh2.rightlist = sectiondata[i].rightlist;
|
||||
testmesh2.leftlist = sectiondata[i].leftlist;
|
||||
testmesh2.lengthFact = newsection.lengthFact;
|
||||
testmesh2.position.set(sectiondata[i].position.x,sectiondata[i].position.y,sectiondata[i].position.z);
|
||||
testmesh2.rotation.set(sectiondata[i].rotation._x,sectiondata[i].rotation._y,sectiondata[i].rotation._z);
|
||||
scope.sectiongroup.add(testmesh2);
|
||||
|
@ -29,93 +29,102 @@ export function SignalList() {
|
||||
}
|
||||
}
|
||||
for(let i=0;i<data.length;i++){
|
||||
console.log(data[i]);
|
||||
if(data[i].virtual == false){
|
||||
let newsignal = new SignalModel(data[i]);
|
||||
console.log();
|
||||
if(haddata == false){
|
||||
// console.log(data[i])
|
||||
let newmesh = assetloader.modellist[num].mesh.clone(true);
|
||||
|
||||
let newsignal = new SignalModel(data[i]);
|
||||
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(haddata == false){
|
||||
// console.log(data[i])
|
||||
let newmesh = assetloader.modellist[num].mesh.clone(true);
|
||||
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.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;
|
||||
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;
|
||||
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);
|
||||
|
||||
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;
|
||||
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.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.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.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);
|
||||
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;
|
||||
|
||||
}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;
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
newmesh.children[j].code = netsignal[i].code;
|
||||
// newsignal.mesh = newmesh;
|
||||
newsignal.mesh.status = "01";
|
||||
scope.group.add(newmesh);
|
||||
scope.list.push(newsignal);
|
||||
}
|
||||
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");
|
||||
});
|
||||
@ -123,36 +132,52 @@ export function SignalList() {
|
||||
|
||||
this.loadpromise = function(signaldata,scene,assetloader,data){
|
||||
return new Promise(function(resolve, reject){
|
||||
for(let i=0;i<signaldata.length;i++){
|
||||
let newsignal = new SignalModel(signaldata[i]);
|
||||
let num;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].id == signaldata[i].modelid){
|
||||
num = j;
|
||||
}
|
||||
console.log("+++++++++++++++++++++++++++++++++++++");
|
||||
console.log(signaldata);
|
||||
let num;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].id == signaldata[0].modelid){
|
||||
num = j;
|
||||
}
|
||||
// console.log(signaldata[i]);
|
||||
let newmesh = assetloader.modellist[num].mesh.clone(true);
|
||||
// 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[i].right;
|
||||
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);
|
||||
}
|
||||
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.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[i].right;
|
||||
newmesh.virtual = data[i].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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
console.log(scope.group.children);
|
||||
scene.add(scope.group);
|
||||
resolve("loadedsignal");
|
||||
});
|
||||
|
@ -24,7 +24,6 @@ export function StationStandList() {
|
||||
scope.group.name = "station";
|
||||
scene.add(scope.group);
|
||||
//遍历车站数据
|
||||
// console.log(stationstanddata);
|
||||
for(let i=0;i<stationdata.length;i++){
|
||||
|
||||
let newstationstand = new StationStandModel(stationdata[i]);
|
||||
@ -40,19 +39,14 @@ export function StationStandList() {
|
||||
newstationstand.name = stationdata[i].name;
|
||||
|
||||
newstationstand.code = stationdata[i].code;
|
||||
// console.log(stationstanddata[j]);
|
||||
|
||||
// console.log(newstationstand.name);
|
||||
//向右上行
|
||||
// console.log(stationstanddata[j]);
|
||||
if(stationstanddata[j].right == true){
|
||||
// console.log(stationstanddata[j]);
|
||||
newstationstand.direction1.code = stationstanddata[j].code;
|
||||
newstationstand.direction1.position = stationstanddata[j].position;
|
||||
newstationstand.direction1.name = stationstanddata[j].name;
|
||||
newstationstand.direction1.screenDoorOpenStatus = "01";
|
||||
newstationstand.direction1.section = stationstanddata[j].standTrackCode;
|
||||
// console.log(stationstanddata[j].standTrackCode);
|
||||
newstationstand.direction1.inside = stationstanddata[j].inside;
|
||||
}
|
||||
//向左下行
|
||||
if(stationstanddata[j].right == false){
|
||||
@ -61,7 +55,7 @@ export function StationStandList() {
|
||||
newstationstand.direction2.name = stationstanddata[j].name;
|
||||
newstationstand.direction2.screenDoorOpenStatus = "01";
|
||||
newstationstand.direction2.section = stationstanddata[j].standTrackCode;
|
||||
// console.log(stationstanddata[j].standTrackCode);
|
||||
newstationstand.direction2.inside = stationstanddata[j].inside;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -71,7 +65,6 @@ export function StationStandList() {
|
||||
}
|
||||
|
||||
}
|
||||
// console.log(scope.list);
|
||||
|
||||
//建立需要显示车的车站模型对象
|
||||
// for(let i=0;i<scope.list.length;i++){
|
||||
@ -162,37 +155,56 @@ export function StationStandList() {
|
||||
resolve("loadedstation");
|
||||
});
|
||||
}
|
||||
this.loadpromise = function(jlmap3ddata,standsdata,scene,assetloader){
|
||||
this.loadpromise = function(jlmap3ddata,standsdata,jlmapstanddata,scene,assetloader){
|
||||
return new Promise(function(resolve, reject){
|
||||
console.log(standsdata);
|
||||
|
||||
let stations = jlmap3ddata.stationstandlist.list;
|
||||
let num;
|
||||
let num2;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].deviceType == "stand"){
|
||||
num = j;
|
||||
}
|
||||
if(assetloader.modellist[j].deviceType == "standwaice"){
|
||||
num2 = j;
|
||||
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
|
||||
}
|
||||
}
|
||||
|
||||
// console.log("+++++++++++++");
|
||||
// console.log(jlmapstanddata);
|
||||
// console.log(standsdata);
|
||||
for(let i=0;i<standsdata.length;i++){
|
||||
let newstationstand = new StationStandModel(standsdata[i]);
|
||||
let newstationmesh;
|
||||
for(let j=0;j<jlmapstanddata.length;j++){
|
||||
if(jlmapstanddata[j].code == standsdata[i].direction1.code){
|
||||
if(jlmapstanddata[j].inside == true){
|
||||
newstationmesh = assetloader.modellist[num].mesh.clone(true);
|
||||
}else{
|
||||
newstationmesh = assetloader.modellist[num2].mesh.clone(true);
|
||||
}
|
||||
// console.log(jlmapstanddata[j]);
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.direction1.code = standsdata[i].direction1.code;
|
||||
newstationstand.direction1.name = standsdata[i].direction1.name;
|
||||
newstationstand.direction2.code = standsdata[i].direction2.code;
|
||||
newstationstand.direction2.name = standsdata[i].direction2.name;
|
||||
|
||||
newstationstand.code = standsdata[i].code;
|
||||
newstationstand.name = standsdata[i].name;
|
||||
newstationstand.direction1.code = standsdata[i].direction1.code;
|
||||
newstationstand.direction1.name = standsdata[i].direction1.name;
|
||||
newstationstand.direction2.code = standsdata[i].direction2.code;
|
||||
newstationstand.direction2.name = standsdata[i].direction2.name;
|
||||
// console.log(standsdata[i]);
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
scope.group.add(newstationmesh);
|
||||
scope.list.push(newstationstand);
|
||||
j = jlmapstanddata.length;
|
||||
}
|
||||
}
|
||||
|
||||
let newstationmesh = assetloader.modellist[num].mesh.clone(true);
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
scope.group.add(newstationmesh);
|
||||
scope.list.push(newstationstand);
|
||||
}
|
||||
scene.add(scope.group);
|
||||
resolve("loadedstation");
|
||||
|
@ -20,7 +20,7 @@ import {OrbitControls} from '@/jlmap3d/main/control/OrbitControls.js';
|
||||
import { DragControls } from '@/jlmap3d/main/control/DragControls.js';
|
||||
|
||||
// 加载器
|
||||
import { ModelLoad } from '@/jlmap3d/main/loaders/simulationloader';
|
||||
import { DriverLoad } from '@/jlmap3d/main/loaders/DriverLoad';
|
||||
// connect
|
||||
import {Jl3dDriving} from '@/jlmap3d/jl3ddrive/moveupdate/DrivingConnect';
|
||||
import { getPublishMapVersion, getPublishMapDetail, getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
@ -200,7 +200,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
}, 2000);
|
||||
// 初始化加载数据和模型
|
||||
getPublish3dMapDetail(mapId).then(netdata => {
|
||||
ModelLoad(data, scope, netdata.data, sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails, camera, controls3, scene,mixers,storemod);
|
||||
DriverLoad(data, scope, netdata.data, sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails, camera, controls3, scene,mixers,storemod);
|
||||
});
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
|
744
src/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe.js
Normal file
744
src/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe.js
Normal file
@ -0,0 +1,744 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
|
||||
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
|
||||
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
|
||||
// 定于仿真socket接口
|
||||
export function Jlmap3dSubscribe(jlmap3d,routegroup,jsonwebwork) {
|
||||
|
||||
const 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;
|
||||
|
||||
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;
|
||||
|
||||
let data = null;
|
||||
// run as plane = 01;
|
||||
// reset = 02;
|
||||
|
||||
var datatype = '00';
|
||||
this.teststomp = new StompClient();
|
||||
this.topic = '/user/queue/simulation/jl3d/'+routegroup;
|
||||
let header = {'X-Token': getToken() };
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
topic:this.topic,
|
||||
token:getToken(),
|
||||
};
|
||||
jsonwebwork.postMessage(connectmsg);
|
||||
jsonwebwork.onmessage = function (event) {
|
||||
// console.log(event.data);
|
||||
// if(event.data.type == 'Simulation_Driver_Change'){
|
||||
// drivingcode = event.data.body.code;
|
||||
// jlmap3d.updatedrivingcode( event.data.body.code);
|
||||
// }
|
||||
// if(data.type == 'Simulation_TrainSpeed'){
|
||||
// trainspeed(data);
|
||||
// }
|
||||
// console.log(event);
|
||||
// if(event.data.type == 'SJL3D_TrainStatus'){
|
||||
// trainstatus(event.data);
|
||||
// }
|
||||
// if(event.data.type == 'Simulation_DeviceStatus'){
|
||||
// devicestatus(event.data);
|
||||
// }
|
||||
if(event.data._type == 'Simulation_Driver_Change'){
|
||||
drivingcode = event.data.body.code;
|
||||
jlmap3d.updatedrivingcode( event.data.body.code);
|
||||
}
|
||||
if(event.data._type == 'Train'){
|
||||
// console.log(event.data);
|
||||
trainstatus(event.data);
|
||||
}
|
||||
if (event.data._type== 'Signal' && signallist) {
|
||||
// console.log(event.data);
|
||||
signalupdate(event.data);
|
||||
}
|
||||
|
||||
if (event.data._type== 'StationStand' && actions) {
|
||||
// console.log(event.data);
|
||||
standupdate(event.data);
|
||||
}
|
||||
|
||||
if (event.data._type == 'Switch' && sectionlist) {
|
||||
// console.log(event.data);
|
||||
switchupdate(event.data);
|
||||
}
|
||||
// if(event.data._type = ''){
|
||||
// trainstatus(event.data);
|
||||
// }
|
||||
// if(event.data.type == 'Simulation_DeviceStatus'){
|
||||
// devicestatus(event.data);
|
||||
// }
|
||||
if(event.data.type == 'Simulation_Reset'){
|
||||
simulationreset(event.data);
|
||||
}
|
||||
};
|
||||
|
||||
// jsonwebwork.onmessage = function (event) {
|
||||
// console.log(event.data);
|
||||
// if(event.data.type == 'Simulation_Driver_Change'){
|
||||
// drivingcode = event.data.body.code;
|
||||
// jlmap3d.updatedrivingcode( event.data.body.code);
|
||||
// }
|
||||
// // if(event.data.type == 'Simulation_TrainSpeed'){
|
||||
// // trainspeed(event.data);
|
||||
// // }
|
||||
// if(event.data.type == 'SJL3D_TrainStatus'){
|
||||
// trainstatus(event.data);
|
||||
// }
|
||||
// if(event.data.type == 'Simulation_DeviceStatus'){
|
||||
// devicestatus(event.data);
|
||||
// }
|
||||
// if(event.data.type == 'Simulation_Reset'){
|
||||
// simulationreset(event.data);
|
||||
// }
|
||||
// };
|
||||
|
||||
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) {
|
||||
// console.log(mapdata);
|
||||
|
||||
trainlisttest = newtrainlisttest;
|
||||
sectionlist = newsectionlist;
|
||||
signallist = newsignallist;
|
||||
stationstandlist = newstationstandlist;
|
||||
materials = materiallist;
|
||||
scenes = scene;
|
||||
actions = nowaction;
|
||||
links = newlinklist;
|
||||
rails = newrails;
|
||||
|
||||
};
|
||||
|
||||
this.socketon = function(topic) {
|
||||
try {
|
||||
// console.log("teststomp");
|
||||
// scope.teststomp.subscribe(topic, callback, header);
|
||||
} catch (error) {
|
||||
console.error('websocket订阅失败');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.socketoff = function(topic) {
|
||||
scope.teststomp.unsubscribe(topic);
|
||||
for (let i=0; i<trainlisttest.group.children.length; i++) {
|
||||
if (trainlisttest.group.children[i].dispose == false) {
|
||||
code = trainlisttest.group.children[i].name;
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].doorStatus = '01';
|
||||
trainlisttest.list[code].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) {
|
||||
|
||||
}
|
||||
|
||||
function trainspeed(data){
|
||||
if (trainlisttest) {
|
||||
|
||||
for (let tl = 0; tl<data.body.length; tl++) {
|
||||
code = data.body[tl].id;
|
||||
if(trainlisttest.list[code].speed != data.body[tl].v){
|
||||
trainlisttest.list[code].speed = data.body[tl].v;
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/18/trainlisttest.list[code].len);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function trainstatus(data){
|
||||
// for (let i=data.body.length-1; i>=0; i--) {
|
||||
// console.log(data.body[i]);
|
||||
|
||||
// console.log(data);
|
||||
// 遍历列车对象组
|
||||
if (trainlisttest) {
|
||||
code = data.code;
|
||||
// 剔除不显示的车
|
||||
// 找到对应列车
|
||||
|
||||
|
||||
if ( trainlisttest.list[code]) {
|
||||
|
||||
trainlisttest.list[code].runMode = data.runMode;
|
||||
// 车门开关验证
|
||||
// if(data.directionType == "02"){
|
||||
if (trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == '01') {
|
||||
// console.log("close");
|
||||
trainlisttest.list[code].doorStatus = '01';
|
||||
for (let an=actions[code].top.length-1; an>=0; an--) {
|
||||
actions[code].top[an].reset();
|
||||
actions[code].top[an].time = actions[code].top[an]._clip.duration;
|
||||
actions[code].top[an].timeScale = -1;
|
||||
actions[code].top[an].play();
|
||||
}
|
||||
} else if (trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == '02') {
|
||||
// console.log("open");
|
||||
trainlisttest.list[code].doorStatus = '02';
|
||||
for (let an=actions[code].top.length-1; an>=0; an--) {
|
||||
actions[code].top[an].reset();
|
||||
actions[code].top[an].time = 0;
|
||||
actions[code].top[an].timeScale = 1;
|
||||
actions[code].top[an].play();
|
||||
}
|
||||
}
|
||||
// if(trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == "01"){
|
||||
// //console.log("close");
|
||||
// trainlisttest.list[code].doorStatus = "01";
|
||||
// for(let an=actions[code].down.length-1;an>=0;an--){
|
||||
// actions[code].down[an].reset();
|
||||
// actions[code].down[an].time = actions[code].top[an]._clip.duration;
|
||||
// actions[code].down[an].timeScale = -1;
|
||||
// actions[code].down[an].play();
|
||||
// }
|
||||
// }else if(trainlisttest.list[code].doorStatus != data.doorStatus && data.doorStatus == "02"){
|
||||
// //console.log("open");
|
||||
// trainlisttest.list[code].doorStatus = "02";
|
||||
// for(let an=actions[code].down.length-1;an>=0;an--){
|
||||
// actions[code].down[an].reset();
|
||||
// actions[code].down[an].time = 0;
|
||||
// actions[code].down[an].timeScale = 1;
|
||||
// actions[code].down[an].play();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// 遍历获取所在轨道
|
||||
if (trainlisttest.list[code].dispose != data.dispose && data.dispose == false) {
|
||||
|
||||
if (rails.linkrail[data.linkCode]) {
|
||||
trainlisttest.group.add(trainlisttest.list[code]);
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
// trainlisttest.list[code].progress = 0;
|
||||
trainlisttest.list[code].dispose = false;
|
||||
trainlisttest.list[code].nowcode = data.linkCode;
|
||||
trainlisttest.list[code].nextcode = null;
|
||||
trainlisttest.list[code].pc = 1;
|
||||
|
||||
if(trainlisttest.list[code].mixerpush == false){
|
||||
for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi<lenmi;mi++){
|
||||
jlmap3d.mixers.push(trainlisttest.list[code].mixer[mi]);
|
||||
}
|
||||
trainlisttest.list[code].mixerpush = true;
|
||||
// console.log(trainlisttest.list[code].mixerpush);
|
||||
}
|
||||
|
||||
if (data.directionType == '02') { // 向右
|
||||
|
||||
|
||||
if(data.targetStation){
|
||||
trainlisttest.list[code].stopstation = data.targetStation;
|
||||
// console.log(rails.stops[data.targetStation].direct2.percent);
|
||||
trainlisttest.list[code].pc = data.targetLinkPercent/rails.stops[data.targetStation].direct2.percent;
|
||||
trainlisttest.list[code].targetpercent = rails.stops[data.targetStation].direct2.percent;
|
||||
trainlisttest.list[code].progress = data.linkOffsetPercent/trainlisttest.list[code].pc;
|
||||
trainlisttest.list[code].linkOffsetPercent = data.linkOffsetPercent;
|
||||
trainlisttest.list[code].targetLink = data.targetLink;
|
||||
// console.log(data.targetLinkPercent);
|
||||
// console.log(rails.stops[data.targetStation].direct2.percent);
|
||||
// console.log(trainlisttest.list[code].progress);
|
||||
// console.log("===================");
|
||||
let point = rails.linkrail[data.linkCode].lineleft.getPointAt(trainlisttest.list[code].progress);
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = point.x;
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = point.z;
|
||||
}
|
||||
|
||||
}else{
|
||||
trainlisttest.list[code].progress = data.linkOffsetPercent/trainlisttest.list[code].pc;
|
||||
trainlisttest.list[code].linkOffsetPercent = data.linkOffsetPercent;
|
||||
let point = rails.linkrail[data.linkCode].lineleft.getPointAt(trainlisttest.list[code].progress);
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = point.x;
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = point.z;
|
||||
}
|
||||
}
|
||||
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.linkCode].lineleft;
|
||||
trainlisttest.list[code].len = rails.linkrail[data.linkCode].lengthfact;
|
||||
trainlisttest.list[code].status = '02';
|
||||
} else if (data.directionType == '03') { // 向左
|
||||
|
||||
// if(trainlisttest.list[code].rname == "006"){
|
||||
// console.log("0000000000000000");
|
||||
// console.log(data.linkOffsetPercent);
|
||||
// }
|
||||
if(data.targetStation){
|
||||
|
||||
trainlisttest.list[code].stopstation = data.targetStation;
|
||||
trainlisttest.list[code].pc = data.targetLinkPercent/rails.stops[data.targetStation].direct1.percent;
|
||||
trainlisttest.list[code].targetpercent = rails.stops[data.targetStation].direct1.percent;
|
||||
trainlisttest.list[code].progress = 1-(data.linkOffsetPercent/trainlisttest.list[code].pc);
|
||||
trainlisttest.list[code].linkOffsetPercent = data.linkOffsetPercent;
|
||||
trainlisttest.list[code].targetLink = data.targetLink;
|
||||
// console.log(data.targetLinkPercent);
|
||||
// console.log(rails.stops[data.targetStation].direct1.percent);
|
||||
// console.log(trainlisttest.list[code].progress);
|
||||
// console.log("===================");
|
||||
let point = rails.linkrail[data.linkCode].lineright.getPointAt(trainlisttest.list[code].progress);
|
||||
|
||||
trainlisttest.list[code].rotation.y = Math.PI;
|
||||
trainlisttest.list[code].position.x = point.x;
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = -point.z;
|
||||
}
|
||||
}else{
|
||||
trainlisttest.list[code].progress = data.linkOffsetPercent/trainlisttest.list[code].pc;
|
||||
trainlisttest.list[code].linkOffsetPercent = data.linkOffsetPercent;
|
||||
let point = rails.linkrail[data.linkCode].lineleft.getPointAt(trainlisttest.list[code].progress);
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = point.x;
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = point.z;
|
||||
}
|
||||
}
|
||||
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.linkCode].lineright;
|
||||
trainlisttest.list[code].len = rails.linkrail[data.linkCode].lengthfact;
|
||||
trainlisttest.list[code].status = '03';
|
||||
|
||||
// trainlisttest.list[code].curve = rails.linkrail[data.linkCode].lineright;
|
||||
}
|
||||
|
||||
|
||||
trainlisttest.list[code].len = rails.linkrail[data.linkCode].lengthfact;
|
||||
// trainlisttest.list[code].isStandTrack = sectionlist.sections.datalist[data.sectionCode].isStandTrack;
|
||||
|
||||
// trainlisttest.list[code].len = sectionlist.sections.datalist[data.sectionCode].distance;
|
||||
|
||||
if(trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode){
|
||||
trainlisttest.list[code].statsstop = 0;
|
||||
}else{
|
||||
trainlisttest.list[code].statsstop = 1;
|
||||
}
|
||||
if(data.speed == 0){
|
||||
trainlisttest.list[code].speeds = data.speed;
|
||||
trainlisttest.list[code].speeds = 0;
|
||||
// trainlisttest.list[code].startmark = 1;
|
||||
}else{
|
||||
trainlisttest.list[code].speeds = data.speed;
|
||||
trainlisttest.list[code].speeds = parseFloat(data.speed*10/36/18/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
}
|
||||
} else if (trainlisttest.list[code].dispose != data.dispose && data.dispose == true) {
|
||||
trainlisttest.group.remove(trainlisttest.list[code]);
|
||||
trainlisttest.list[code].progress = null;
|
||||
trainlisttest.list[code].dispose = true;
|
||||
code = trainlisttest.group.children[i].name;
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].doorStatus = '01';
|
||||
trainlisttest.list[code].speed = 0;
|
||||
trainlisttest.list[code].position.x = -50000;
|
||||
trainlisttest.list[code].position.y = -50000;
|
||||
trainlisttest.list[code].pc = 1;
|
||||
|
||||
} else if (trainlisttest.list[code].dispose == data.dispose && data.dispose == false) {
|
||||
|
||||
// if(data.){
|
||||
//
|
||||
// }
|
||||
if (data.directionType == '02' && trainlisttest.list[code].status != data.directionType) { // 向右
|
||||
|
||||
|
||||
let rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
|
||||
let rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14];
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = rotaposz;
|
||||
}
|
||||
|
||||
trainlisttest.list[code].progress = (rotaposx-rails.linkrail[data.linkCode].lp.x)/rails.linkrail[data.linkCode].lengthfact;
|
||||
trainlisttest.list[code].status = '02';
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.linkCode].lineleft;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
|
||||
trainlisttest.list[code].len = rails.linkrail[data.linkCode].lengthfact;
|
||||
|
||||
} else if (data.directionType == '03'&& trainlisttest.list[code].status != data.directionType) { // 向左
|
||||
|
||||
let rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
|
||||
let rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]);
|
||||
trainlisttest.list[code].rotation.y = Math.PI;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = -rotaposz;
|
||||
}
|
||||
trainlisttest.list[code].progress = 1-(rotaposx-rails.linkrail[data.linkCode].lp.x)/rails.linkrail[data.linkCode].lengthfact;
|
||||
trainlisttest.list[code].status = '03';
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.linkCode].lineright;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
|
||||
trainlisttest.list[code].len = rails.linkrail[data.linkCode].lengthfact;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(trainlisttest.list[code].nextcode == null ){//&& trainlisttest.list[code].stopstation == data.targetStation
|
||||
// if(data.groupNumber == "016"){
|
||||
// console.log(trainlisttest.list[code].nextcode);
|
||||
// console.log(trainlisttest.list[code].stopstation);
|
||||
// console.log(data.targetStation);
|
||||
// console.log(data.body[i]);
|
||||
// console.log(trainlisttest.list[code]);
|
||||
// }
|
||||
// if(trainlisttest.list[code].targetLink != trainlisttest.list[code].nowcode){
|
||||
let nextcode;
|
||||
if(data.directionType == '02'){
|
||||
|
||||
trainlisttest.list[code].status = '02';
|
||||
// console.log(rails.linkrail[trainlisttest.list[code].nowcode]);
|
||||
|
||||
if(rails.linkrail[trainlisttest.list[code].nowcode]){
|
||||
nextcode = rails.linkrail[trainlisttest.list[code].nowcode].rconnect;
|
||||
}
|
||||
|
||||
if(nextcode){
|
||||
trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft;
|
||||
trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact;
|
||||
}else{
|
||||
|
||||
trainlisttest.list[code].nextlen = 0;
|
||||
}
|
||||
}else if(data.directionType == '03'){
|
||||
|
||||
trainlisttest.list[code].status = '03';
|
||||
if(rails.linkrail[trainlisttest.list[code].nowcode]){
|
||||
nextcode = rails.linkrail[trainlisttest.list[code].nowcode].lconnect;
|
||||
}
|
||||
if(nextcode){
|
||||
trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright;
|
||||
trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact;
|
||||
}else{
|
||||
|
||||
trainlisttest.list[code].nextlen = 0;
|
||||
}
|
||||
}
|
||||
trainlisttest.list[code].nextcode = nextcode;
|
||||
|
||||
// }
|
||||
|
||||
if(trainlisttest.list[code].curve == null){
|
||||
trainlisttest.list[code].len = trainlisttest.list[code].nextlen;
|
||||
trainlisttest.list[code].nowcode = trainlisttest.list[code].nextcode;
|
||||
trainlisttest.list[code].curve = trainlisttest.list[code].nextcurve;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
trainlisttest.list[code].nextlen = null;
|
||||
trainlisttest.list[code].nextcode = null;
|
||||
}
|
||||
}
|
||||
if(data.groupNumber == "016"){
|
||||
// console.log(data.targetLink);
|
||||
// console.log(trainlisttest.list[code].nowcode);
|
||||
//
|
||||
// console.log(trainlisttest.list[code].progress);
|
||||
// console.log("==============");
|
||||
}
|
||||
trainlisttest.list[code].targetLink = data.targetLink;
|
||||
if(trainlisttest.list[code].stopstation != data.targetStation){
|
||||
|
||||
if(data.directionType == '02'){
|
||||
if(data.targetStation){
|
||||
trainlisttest.list[code].pc = data.targetLinkPercent/rails.stops[data.targetStation].direct2.percent;
|
||||
trainlisttest.list[code].targetpercent = rails.stops[data.targetStation].direct2.percent;
|
||||
// trainlisttest.list[code].linkOffsetPercent = data.linkOffsetPercent;
|
||||
// trainlisttest.list[code].targetLink = data.targetLink;
|
||||
}
|
||||
|
||||
|
||||
trainlisttest.list[code].status = '02';
|
||||
}else if(data.directionType == '03'){
|
||||
if(data.targetStation){
|
||||
trainlisttest.list[code].pc = data.targetLinkPercent/rails.stops[data.targetStation].direct1.percent;
|
||||
trainlisttest.list[code].targetpercent = rails.stops[data.targetStation].direct1.percent;
|
||||
// trainlisttest.list[code].linkOffsetPercent = data.linkOffsetPercent;
|
||||
// trainlisttest.list[code].targetLink = data.targetLink;
|
||||
}
|
||||
|
||||
trainlisttest.list[code].status = '03';
|
||||
|
||||
}
|
||||
trainlisttest.list[code].stopstation = data.targetStation;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(trainlisttest.list[code].targetLink == trainlisttest.list[code].nowcode){
|
||||
trainlisttest.list[code].statsstop = 0;
|
||||
}else{
|
||||
trainlisttest.list[code].statsstop = 1;
|
||||
}
|
||||
// console.log(data.body[i]);
|
||||
|
||||
if(trainlisttest.list[code].speed != data.speed){
|
||||
trainlisttest.list[code].speed = data.speed;
|
||||
trainlisttest.list[code].speeds = parseFloat(data.speed*10/36/18/trainlisttest.list[code].len);
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
function standupdate(data) {
|
||||
code = data.code;
|
||||
if ( actions[code]) {
|
||||
if (data.screenDoorOpenStatus == '02' && actions[code].status == '01') {
|
||||
actions[code].status = '00';
|
||||
}
|
||||
if (data.screenDoorOpenStatus == '02' && actions[code].status == '00') {
|
||||
actions[code].status = '02';
|
||||
actions[code].action.reset();
|
||||
actions[code].action.time = 0;
|
||||
actions[code].action.timeScale = 1;
|
||||
actions[code].action.play();
|
||||
}
|
||||
|
||||
if (data.screenDoorOpenStatus == '01' && actions[code].status == '02') {
|
||||
actions[code].status = '00';
|
||||
}
|
||||
if (data.screenDoorOpenStatus == '01' && actions[code].status == '00') {
|
||||
actions[code].status = '01';
|
||||
actions[code].action.reset();
|
||||
actions[code].action.time = actions[code].action._clip.duration;
|
||||
actions[code].action.timeScale = -1;
|
||||
actions[code].action.play();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function devicestatus(data){
|
||||
for (let i= 0,leni = data.body.length; i<leni; i++) {
|
||||
// 0xFFFFFF
|
||||
// 0xCD0000 红
|
||||
// 0xEEEE00 黄
|
||||
// 0x32CD32 绿
|
||||
|
||||
if (data._type == 'Signal' && signallist) {
|
||||
if (signallist) {
|
||||
// console.log(data.body[i]);
|
||||
signalupdate(data.body[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (data._type == 'StationStand' && actions) {
|
||||
if (actions) {
|
||||
standupdate(data.body[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (data._type == 'Switch' && sectionlist) {
|
||||
if (sectionlist) {
|
||||
switchupdate(data.body[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
function signalupdate(data) {
|
||||
code = data.code;
|
||||
// console.log(data);
|
||||
if (data.lightType == '01') {
|
||||
if (signallist.list[code].mesh.code) {
|
||||
signallist.list[code].mesh.status = data.status;
|
||||
|
||||
// 55
|
||||
// 33
|
||||
// 77
|
||||
// 关闭
|
||||
if (data.status == '01') {
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
// 开放
|
||||
if (data.status == '02') {
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[2];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
if (data.status == '03') {
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
// 引导
|
||||
if (data.status == '03') {
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[0];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[1];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
// 封锁
|
||||
if (data.status == '04') {
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
// 故障
|
||||
if (data.status == '05') {
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
if (data.status == '06') {
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if (data.lightType == '01') {
|
||||
if (signallist.list[code].mesh.code) {
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function switchupdate(data) {
|
||||
code = data.code;
|
||||
for (let j=sectionlist.switchs.modellist.length-1; j>=0; j--) {
|
||||
if (rails.switchrail[code]) {
|
||||
if (rails.switchrail[code].locateType != data.locateType) {
|
||||
if (data.locateType == '02') {
|
||||
if (actions[sectionlist.switchs.modellist[j].code]) {
|
||||
sectionlist.switchs.modellist[j].locateType = data.locateType;
|
||||
actions[sectionlist.switchs.modellist[j].code].reset();
|
||||
actions[sectionlist.switchs.modellist[j].code].time = 0;
|
||||
actions[sectionlist.switchs.modellist[j].code].timeScale = 1;
|
||||
actions[sectionlist.switchs.modellist[j].code].play();
|
||||
}
|
||||
|
||||
rails.switchrail[code].locateType = "02";
|
||||
|
||||
let testswitch = rails.switchrail[code];
|
||||
// console.log(testswitch);
|
||||
// console.log(rails.linkrail[testswitch.alink]);
|
||||
// console.log(rails.linkrail[testswitch.clink]);
|
||||
if(rails.switchrail[code].directtype == "1"){
|
||||
rails.linkrail[testswitch.alink].lconnect = testswitch.clink;
|
||||
rails.linkrail[testswitch.clink].rconnect = testswitch.alink;
|
||||
}else if(rails.switchrail[code].directtype == "2"){
|
||||
rails.linkrail[testswitch.alink].rconnect = testswitch.clink;
|
||||
rails.linkrail[testswitch.clink].lconnect = testswitch.alink;
|
||||
}
|
||||
|
||||
} else if (data.locateType == '01') {
|
||||
if (actions[sectionlist.switchs.modellist[j].code]) {
|
||||
sectionlist.switchs.modellist[j].locateType = data.locateType;
|
||||
actions[sectionlist.switchs.modellist[j].code].reset();
|
||||
actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration;
|
||||
actions[sectionlist.switchs.modellist[j].code].timeScale = -1;
|
||||
actions[sectionlist.switchs.modellist[j].code].play();
|
||||
}
|
||||
|
||||
rails.switchrail[code].locateType = "01";
|
||||
let testswitch = rails.switchrail[code];
|
||||
// console.log(testswitch);
|
||||
// console.log(rails.linkrail[testswitch.alink]);
|
||||
// console.log(rails.linkrail[testswitch.clink]);
|
||||
if(rails.switchrail[code].directtype == "1"){
|
||||
rails.linkrail[testswitch.alink].lconnect = testswitch.blink;
|
||||
rails.linkrail[testswitch.blink].rconnect = testswitch.alink;
|
||||
}else if(rails.switchrail[code].directtype == "2"){
|
||||
rails.linkrail[testswitch.alink].rconnect = testswitch.blink;
|
||||
rails.linkrail[testswitch.blink].lconnect = testswitch.alink;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
j = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
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--;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
518
src/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribeNew.js
Normal file
518
src/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribeNew.js
Normal file
@ -0,0 +1,518 @@
|
||||
import StompClient from '@/utils/sock';
|
||||
|
||||
// import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation';
|
||||
// import { creatSubscribe, clearSubscribe, displayTopic, screenTopic } from '@/utils/stomp';
|
||||
import { getBaseUrl } from '@/utils/baseUrl'
|
||||
import { getToken } from '@/utils/auth';
|
||||
|
||||
// 定于仿真socket接口
|
||||
export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
|
||||
|
||||
const 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;
|
||||
|
||||
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;
|
||||
|
||||
let data = null;
|
||||
// run as plane = 01;
|
||||
// reset = 02;
|
||||
|
||||
var datatype = '00';
|
||||
this.teststomp = new StompClient();
|
||||
this.topic = '/user/queue/simulation/jl3d/'+routegroup;
|
||||
let header = {'X-Token': getToken() };
|
||||
let connectmsg = {
|
||||
type:'init',
|
||||
baseurl:getBaseUrl(),
|
||||
topic:this.topic,
|
||||
token:getToken(),
|
||||
};
|
||||
jsonwebwork.postMessage(connectmsg);
|
||||
jsonwebwork.onmessage = function (event) {
|
||||
// console.log(event.data);
|
||||
|
||||
|
||||
// if(event.data.deviceType == "TRAIN"){
|
||||
// // console.log(event.data);
|
||||
//
|
||||
// }
|
||||
if(event.data.type == "Train_Hmi_3D"){
|
||||
trainhmi(event.data);
|
||||
return;
|
||||
}
|
||||
|
||||
if(event.data.type == 'TrainRun_3D'){
|
||||
for(let i=0,leni=event.data.body.length;i<leni;i++){
|
||||
// console.log(event.data.body[i]);
|
||||
trainrun(event.data.body[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// if(event.data.type == 'TRAIN'){
|
||||
// // console.log(event.data);
|
||||
// trainrun(event.data);
|
||||
// }
|
||||
if (event.data.type== 'SIGNAL' && signallist) {
|
||||
signalupdate(event.data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.data.type== "PSD" && actions) {
|
||||
standupdate(event.data);
|
||||
return;
|
||||
}
|
||||
if (event.data.type == "SWITCH") {
|
||||
switchupdate(event.data);
|
||||
return;
|
||||
}
|
||||
if (event.data.type == 'TRAIN_DOOR') {
|
||||
traindoorupdate(event.data);
|
||||
return;
|
||||
}
|
||||
|
||||
if(event.data.type == 'Simulation_Reset'){
|
||||
simulationreset(event.data);
|
||||
return;
|
||||
}
|
||||
if(event.data.type == 'Simulation_DeviceStatus'){
|
||||
initall(event.data.body);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) {
|
||||
trainlisttest = newtrainlisttest;
|
||||
sectionlist = newsectionlist;
|
||||
signallist = newsignallist;
|
||||
stationstandlist = newstationstandlist;
|
||||
materials = materiallist;
|
||||
scenes = scene;
|
||||
actions = nowaction;
|
||||
links = newlinklist;
|
||||
rails = newrails;
|
||||
};
|
||||
|
||||
this.socketon = function(topic) {
|
||||
try {
|
||||
// console.log("teststomp");
|
||||
// scope.teststomp.subscribe(topic, callback, header);
|
||||
} catch (error) {
|
||||
console.error('websocket订阅失败');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.socketoff = function(topic) {
|
||||
scope.teststomp.unsubscribe(topic);
|
||||
for (let i=0; i<trainlisttest.group.children.length; i++) {
|
||||
if (trainlisttest.group.children[i].dispose == false) {
|
||||
code = trainlisttest.group.children[i].name;
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].open = '1';
|
||||
trainlisttest.list[code].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--;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function trainrun(data){
|
||||
let code = data.code;
|
||||
if(trainlisttest.list[code].dispose == "0"){
|
||||
if(trainlisttest.list[code].curve == null){
|
||||
if (data.right == '1') { // 向右
|
||||
|
||||
trainlisttest.list[code].progress = data.offset;
|
||||
trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
||||
if(rails.sectionrail[data.section].standTrack){
|
||||
trainlisttest.list[code].statsstop = 0;
|
||||
}
|
||||
let point = rails.sectionrail[data.section].lineleft.getPointAt(trainlisttest.list[code].progress);
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = point.x;
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = parseFloat(point.z);
|
||||
}
|
||||
|
||||
trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
|
||||
|
||||
if(data.next){
|
||||
trainlisttest.list[code].nextcode = data.next;
|
||||
trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
|
||||
trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
||||
}
|
||||
trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
||||
trainlisttest.list[code].status = '1';
|
||||
|
||||
} else if (data.right == '0') { // 向左
|
||||
trainlisttest.list[code].progress = 1-data.offset;
|
||||
trainlisttest.list[code].isstandsection = rails.sectionrail[data.section].standTrack;
|
||||
if(rails.sectionrail[data.section].standTrack){
|
||||
trainlisttest.list[code].statsstop = 0;
|
||||
}
|
||||
let point = rails.sectionrail[data.section].lineright.getPointAt(trainlisttest.list[code].progress);
|
||||
|
||||
trainlisttest.list[code].rotation.y = Math.PI;
|
||||
trainlisttest.list[code].position.x = point.x;
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = parseFloat(-point.z);
|
||||
}
|
||||
|
||||
trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
|
||||
if(data.next){
|
||||
trainlisttest.list[code].nextcode = data.next;
|
||||
trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
|
||||
trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
||||
}
|
||||
trainlisttest.list[code].len = rails.sectionrail[data.section].lengthfact;
|
||||
trainlisttest.list[code].status = '0';
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
//后端数据驱动车的位置更新与代码驱动车的移动相结合
|
||||
if(data.code != trainlisttest.list[code].code){
|
||||
if (data.right == '1') { // 向右
|
||||
trainlisttest.list[code].nowcode = data.code;
|
||||
trainlisttest.list[code].curve = rails.sectionrail[data.section].lineleft;
|
||||
trainlisttest.list[code].progress = data.offset;
|
||||
trainlisttest.list[code].nextcode = data.next;
|
||||
trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineleft;
|
||||
trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
||||
trainlisttest.list[code].nextissection = rails.sectionrail[data.next].standTrack;
|
||||
} else if (data.right == '0') { // 向左
|
||||
trainlisttest.list[code].nowcode = data.code;
|
||||
trainlisttest.list[code].curve = rails.sectionrail[data.section].lineright;
|
||||
trainlisttest.list[code].progress = 1-data.offset;
|
||||
trainlisttest.list[code].nextcode = data.next;
|
||||
trainlisttest.list[code].nextcurve = rails.sectionrail[data.next].lineright;
|
||||
trainlisttest.list[code].nextlen = rails.sectionrail[data.next].lengthfact;
|
||||
trainlisttest.list[code].nextissection = rails.sectionrail[data.next].standTrack;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(data.speed == 0){
|
||||
trainlisttest.list[code].speeds = 0;
|
||||
trainlisttest.list[code].statsstop = 0;
|
||||
}else{
|
||||
trainlisttest.list[code].speeds = parseFloat(data.speed*10/36/18/trainlisttest.list[code].len);
|
||||
}
|
||||
if(data.right != trainlisttest.list[code].status){
|
||||
|
||||
trainlisttest.list[code].status = data.right;
|
||||
trainlisttest.list[code].curve = null;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
trainlisttest.list[code].nextlen = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 trainhmi(data){
|
||||
// console.log(data);
|
||||
for(let i=0,leni=data.body.length;i<leni;i++){
|
||||
code =data.body[i].code;
|
||||
if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == "0") {
|
||||
|
||||
if (rails.sectionrail[data.body[i].section]) {
|
||||
|
||||
trainlisttest.group.add(trainlisttest.list[code]);
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
// trainlisttest.list[code].progress = 0;
|
||||
trainlisttest.list[code].dispose = "0";
|
||||
trainlisttest.list[code].nowcode = data.body[i].section;
|
||||
trainlisttest.list[code].nextcode = null;
|
||||
trainlisttest.list[code].curve = null;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
trainlisttest.list[code].pc = 1;
|
||||
|
||||
if(trainlisttest.list[code].mixerpush == false){
|
||||
for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi<lenmi;mi++){
|
||||
jlmap3d.mixers.push(trainlisttest.list[code].mixer[mi]);
|
||||
}
|
||||
trainlisttest.list[code].mixerpush = true;
|
||||
}
|
||||
}
|
||||
} else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == "1") {
|
||||
trainlisttest.list[code].status = 1;
|
||||
trainlisttest.group.remove(trainlisttest.list[code]);
|
||||
trainlisttest.list[code].progress = null;
|
||||
trainlisttest.list[code].dispose = "1";
|
||||
code = trainlisttest.group.children[i].name;
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].open = '1';
|
||||
trainlisttest.list[code].curve = null;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
trainlisttest.list[code].speed = 0;
|
||||
trainlisttest.list[code].position.x = -50000;
|
||||
trainlisttest.list[code].position.y = -50000;
|
||||
trainlisttest.list[code].pc = 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function traindoorupdate(data){
|
||||
let code = data.code;
|
||||
if(data.doorCode == "0"){
|
||||
|
||||
if(trainlisttest.list[code].open != data.open && data.open == "0"){
|
||||
trainlisttest.list[code].open = "0";
|
||||
for(let an=actions[code].down.length-1;an>=0;an--){
|
||||
actions[code].down[an].reset();
|
||||
actions[code].down[an].time = actions[code].top[an]._clip.duration;
|
||||
actions[code].down[an].timeScale = -1;
|
||||
actions[code].down[an].play();
|
||||
}
|
||||
}else if(trainlisttest.list[code].open != data.open && data.open == "1"){
|
||||
trainlisttest.list[code].open = "1";
|
||||
for(let an=actions[code].down.length-1;an>=0;an--){
|
||||
actions[code].down[an].reset();
|
||||
actions[code].down[an].time = 0;
|
||||
actions[code].down[an].timeScale = 1;
|
||||
actions[code].down[an].play();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (trainlisttest.list[code].open != data.open && data.open == '0') {
|
||||
trainlisttest.list[code].open = '0';
|
||||
for (let an=actions[code].top.length-1; an>=0; an--) {
|
||||
actions[code].top[an].reset();
|
||||
actions[code].top[an].time = actions[code].top[an]._clip.duration;
|
||||
actions[code].top[an].timeScale = -1;
|
||||
actions[code].top[an].play();
|
||||
}
|
||||
} else if (trainlisttest.list[code].open != data.open && data.open == '1') {
|
||||
trainlisttest.list[code].open = "1";
|
||||
for(let an=actions[code].top.length-1;an>=0;an--){
|
||||
actions[code].top[an].reset();
|
||||
actions[code].top[an].time = 0;
|
||||
actions[code].top[an].timeScale = 1;
|
||||
actions[code].top[an].play();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function trainstatus(data){
|
||||
// 遍历列车对象组
|
||||
if (trainlisttest) {
|
||||
|
||||
code = data.code;
|
||||
// 剔除不显示的车
|
||||
// 找到对应列车
|
||||
if ( trainlisttest.list[code]) {
|
||||
|
||||
trainlisttest.list[code].driveMode = data.driveMode;
|
||||
trainlisttest.list[code].status = data.right;
|
||||
// 车门开关验证
|
||||
|
||||
|
||||
// 遍历获取所在轨道
|
||||
if (trainlisttest.list[code].dispose != data.dispose && data.dispose == "0") {
|
||||
if (rails.sectionrail[data.sectionCode]) {
|
||||
|
||||
trainlisttest.group.add(trainlisttest.list[code]);
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
// trainlisttest.list[code].progress = 0;
|
||||
trainlisttest.list[code].dispose = "0";
|
||||
trainlisttest.list[code].nowcode = data.sectionCode;
|
||||
trainlisttest.list[code].nextcode = null;
|
||||
trainlisttest.list[code].curve = null;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
trainlisttest.list[code].pc = 1;
|
||||
|
||||
if(trainlisttest.list[code].mixerpush == false){
|
||||
for(let mi=0,lenmi=trainlisttest.list[code].mixer.length;mi<lenmi;mi++){
|
||||
jlmap3d.mixers.push(trainlisttest.list[code].mixer[mi]);
|
||||
}
|
||||
trainlisttest.list[code].mixerpush = true;
|
||||
}
|
||||
}
|
||||
} else if (trainlisttest.list[code].dispose != data.dispose && data.dispose == "1") {
|
||||
trainlisttest.list[code].status = 1;
|
||||
trainlisttest.group.remove(trainlisttest.list[code]);
|
||||
trainlisttest.list[code].progress = null;
|
||||
trainlisttest.list[code].dispose = "1";
|
||||
code = trainlisttest.group.children[i].name;
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].open = '1';
|
||||
trainlisttest.list[code].curve = null;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
trainlisttest.list[code].speed = 0;
|
||||
trainlisttest.list[code].position.x = -50000;
|
||||
trainlisttest.list[code].position.y = -50000;
|
||||
trainlisttest.list[code].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.redOpen == 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("green").material.map = materials[3];
|
||||
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
|
||||
}
|
||||
|
||||
if(data.yellowOpen == 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.greenOpen == 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--;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -441,7 +441,7 @@ export function Jlmap3dSubscribe(jlmap3d,routegroup,jsonwebwork) {
|
||||
trainlisttest.list[code].nextlen = 0;
|
||||
}
|
||||
}else if(data.directionType == '03'){
|
||||
|
||||
|
||||
trainlisttest.list[code].status = '03';
|
||||
if(rails.linkrail[trainlisttest.list[code].nowcode]){
|
||||
nextcode = rails.linkrail[trainlisttest.list[code].nowcode].lconnect;
|
||||
|
174
src/jlmap3d/jl3dsimulation/connect/UpdateTrainNew.js
Normal file
174
src/jlmap3d/jl3dsimulation/connect/UpdateTrainNew.js
Normal file
@ -0,0 +1,174 @@
|
||||
|
||||
export function UpdateTrainNew(camera,traindata){
|
||||
if(traindata != undefined ){
|
||||
for(let j=traindata.group.children.length-1;j>=0;j--){
|
||||
//判断是否有移动事件
|
||||
|
||||
let trainmodel = traindata.group.children[j];
|
||||
|
||||
if(trainmodel.speeds > 0 && trainmodel.speeds){
|
||||
let speed = null;
|
||||
if(traindata.group.children[j].progress >=0&&traindata.group.children[j].progress<=1){
|
||||
|
||||
let movecurve = trainmodel.curve;
|
||||
if(trainmodel.status == "1"){
|
||||
|
||||
let point = movecurve.getPointAt(trainmodel.progress);
|
||||
let worldpositionz = trainmodel.children[0].position.z;
|
||||
|
||||
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
let offset = Math.abs( point.z -parseFloat(worldpositionz));
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.02){
|
||||
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||
let tangent = movecurve.getTangentAt(traindata.group.children[j].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;
|
||||
}
|
||||
|
||||
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++){
|
||||
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]+8)>=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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
trainmodel.progress += trainmodel.speeds;
|
||||
// if(trainmodel.statsstop == 0){
|
||||
// if((1-trainmodel.progress) > 0.95){
|
||||
//
|
||||
// trainmodel.progress += trainmodel.speeds;
|
||||
// }
|
||||
//
|
||||
// }else{
|
||||
// trainmodel.progress += trainmodel.speeds;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
if(trainmodel.status == "0"){
|
||||
let point = movecurve.getPointAt(trainmodel.progress);
|
||||
let worldpositionz = trainmodel.children[0].position.z;
|
||||
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.02){
|
||||
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||
let tangent = movecurve.getTangentAt(traindata.group.children[j].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;
|
||||
|
||||
}
|
||||
|
||||
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++){
|
||||
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]-8)<=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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
trainmodel.progress += trainmodel.speeds;
|
||||
// if(trainmodel.statsstop == 0){
|
||||
// if(trainmodel.progress < 0.95){
|
||||
// trainmodel.progress += trainmodel.speeds;
|
||||
// }
|
||||
// }else{
|
||||
// trainmodel.progress += trainmodel.speeds;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
if(trainmodel.nextcurve){
|
||||
trainmodel.progress = 0;
|
||||
trainmodel.len = trainmodel.nextlen;
|
||||
if(trainmodel.nextcode){
|
||||
trainmodel.nowcode = trainmodel.nextcode;
|
||||
trainmodel.isstandsection = trainmodel.nextissection;
|
||||
if(trainmodel.isstandsection){
|
||||
trainmodel.statsstop = 0;
|
||||
}else{
|
||||
trainmodel.statsstop = 1;
|
||||
}
|
||||
}
|
||||
|
||||
trainmodel.speeds = parseFloat(trainmodel.speed*10/36/25/trainmodel.len);
|
||||
trainmodel.curve = trainmodel.nextcurve;
|
||||
trainmodel.nextcurve = null;
|
||||
trainmodel.nextlen = null;
|
||||
trainmodel.nextcode = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -19,14 +19,19 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
||||
// import { DragControls } from '@/jlmap3d/main/control/DragControls';
|
||||
|
||||
//加载器
|
||||
import { ModelLoad } from '@/jlmap3d/main/loaders/ModelLoad';
|
||||
import { SimulationLoad } from '@/jlmap3d/main/loaders/SimulationLoad';
|
||||
import { SimulationLoadNew } from '@/jlmap3d/main/loaders/SimulationLoadNew';
|
||||
|
||||
//connect
|
||||
import {Jlmap3dSubscribe } from '@/jlmap3d/jl3dsimulation/connect/TrainingConnect';
|
||||
import {Jlmap3dSubscribe } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribe';
|
||||
import {Jlmap3dSubscribeNew } from '@/jlmap3d/jl3dsimulation/connect/Jlmap3dSubscribeNew';
|
||||
|
||||
import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
|
||||
|
||||
//utils
|
||||
// import { UpdateTrain } from '@/jlmap3d/main/utils/UpdateTrain';
|
||||
import { UpdateTrain } from '@/jlmap3d/jl3dsimulation/connect/UpdateTrainTest';
|
||||
import { UpdateTrainNew } from '@/jlmap3d/jl3dsimulation/connect/UpdateTrainNew';
|
||||
// import { ReStart } from '@/jlmap3d/main/utils/ReStart';
|
||||
|
||||
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
|
||||
@ -39,8 +44,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
let scope = this;
|
||||
|
||||
this.dom = dom;
|
||||
//渲染循环开关
|
||||
this.animateswitch = false;
|
||||
//初始化webgl渲染
|
||||
let renderer = SetRender(dom);
|
||||
renderer.domElement.style.position = "absolute";
|
||||
@ -54,7 +57,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
let controls = new THREE.OrbitControls(camera);
|
||||
controls.maxPolarAngle = Math.PI/2;
|
||||
//controls.minPolarAngle = Math.PI/8;
|
||||
controls.maxDistance = 4800;
|
||||
controls.maxDistance = 2000;
|
||||
//模型加载器
|
||||
this.assetloader = new AssetLoader();
|
||||
//替换材质组,例:信号机不同灯光
|
||||
@ -85,29 +88,40 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
progress:0,
|
||||
moveswitch:false
|
||||
};
|
||||
this.webwork = new Worker("../../static/workertest/trainworker.js");
|
||||
this.jsonwebwork = new Worker("../../static/workertest/jsonworker.js");
|
||||
//地图模型数据
|
||||
let mapdata = new Jl3ddata();
|
||||
//订阅仿真socket
|
||||
// console.log(routegroup);
|
||||
this.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
|
||||
// this.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
|
||||
//连接到通信
|
||||
//console.log(this.Subscribe.config);
|
||||
//this.webwork.postMessage(this.Subscribe.teststomp);
|
||||
|
||||
this.Subscribe.socketon(scope.Subscribe.topic);
|
||||
|
||||
this.webwork = new Worker("../../static/workertest/trainworker.js");
|
||||
//初始化加载数据和模型getPublishMapDetail
|
||||
getPublishMapDetail(skinCode).then(data => {
|
||||
let mapnetdata = data.data;
|
||||
getPublish3dMapDetail(skinCode).then(netdata => {
|
||||
ModelLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scene,storemod);
|
||||
let assetsdata = JSON.parse(netdata.data.sections);
|
||||
if(assetsdata.link){
|
||||
scope.datatype = "old";
|
||||
scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js");
|
||||
scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
|
||||
scope.Subscribe.socketon(scope.Subscribe.topic);
|
||||
SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scene,storemod);
|
||||
|
||||
}else{
|
||||
scope.datatype = "new";
|
||||
scope.jsonwebworknew = new Worker("../../static/workertest/jsonworkernew.js");
|
||||
scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew);
|
||||
scope.Subscribe.socketon(scope.Subscribe.topic);
|
||||
SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scene,storemod);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
//
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
let stats = new Stats();
|
||||
dom.appendChild( stats.dom );
|
||||
|
||||
// var timer = setInterval(function() {
|
||||
// if(trainlisttest){
|
||||
@ -145,7 +159,6 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
// }
|
||||
//
|
||||
// }, 2000);
|
||||
controls.upscene(scope.animateswitch);
|
||||
//开启渲染
|
||||
animate();
|
||||
startWorker(scope.webwork);
|
||||
@ -158,27 +171,26 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
//renderer.setAnimationLoop(animate);
|
||||
requestAnimationFrame(animate);
|
||||
//判断渲染是否开启
|
||||
// if(scope.animateswitch == true){
|
||||
// if(camera.position.y<4000){
|
||||
//
|
||||
// }
|
||||
//根据相机渲染场景
|
||||
renderer.render(scene,camera);
|
||||
// console.log(scope.animateswitch);
|
||||
//检测动画构造器播放动画
|
||||
|
||||
// }
|
||||
// stats.update();
|
||||
stats.update();
|
||||
}
|
||||
|
||||
function startWorker(webwork){
|
||||
|
||||
if(typeof(Worker)!=="undefined"){
|
||||
|
||||
|
||||
scope.webwork.onmessage = function (event) {
|
||||
//更新列车位置
|
||||
UpdateTrain(camera,trainlisttest);
|
||||
if(scope.datatype == "new"){
|
||||
|
||||
UpdateTrainNew(camera,trainlisttest);
|
||||
}else{
|
||||
UpdateTrain(camera,trainlisttest);
|
||||
}
|
||||
|
||||
if(camerarail.moveswitch == true){
|
||||
// console.log(camerarail.progress);
|
||||
if(camerarail.progress>=0.99){
|
||||
@ -272,12 +284,10 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
|
||||
|
||||
this.animateon = function(){
|
||||
controls.enabled = true;
|
||||
// scope.animateswitch = true;
|
||||
};
|
||||
|
||||
this.animateoff = function(){
|
||||
controls.enabled = false;
|
||||
// scope.animateswitch = false;
|
||||
};
|
||||
|
||||
this.loaderdata = function(loadsectionlist,loadlinklist,loadsignallist,loadstationstandlist,loadtrainlisttest,loadrealsectionlist,loadrails){
|
||||
|
@ -133,10 +133,6 @@ THREE.OrbitControls = function ( object, domElement ) {
|
||||
scope.data.trainlisttest = newtrainlisttest;
|
||||
}
|
||||
|
||||
this.upscene = function(animateswitch){
|
||||
// scope.animateswitch = animateswitch;
|
||||
}
|
||||
|
||||
// this method is exposed, but perhaps it would be better if we can make it private...
|
||||
this.update = function () {
|
||||
|
||||
|
@ -142,7 +142,9 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
|
||||
// _movemesh.geometry.computeBoundingBox();
|
||||
_movemesh.geometry.computeBoundingSphere();
|
||||
_movemesh.geometry.center();
|
||||
_movemesh.lengthfact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]])*2+28;
|
||||
// _movemesh.lengthfact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]])*2+28;
|
||||
_movemesh.lengthFact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]*3] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]*3]);
|
||||
|
||||
// testmesh2.position.z = 50;
|
||||
|
||||
// testmesh2.geometry.center();
|
||||
|
@ -32,13 +32,20 @@ let defaulttrain = {
|
||||
|
||||
let defaultstation = {
|
||||
id:"8",
|
||||
name:"福州车站",
|
||||
name:"内侧车站",
|
||||
deviceType:"stand",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
assetUrl:"../../static/model/station/fuzhou.FBX"
|
||||
}//modelurl+"/models/station/fuzhou/fuzhou.FBX"
|
||||
|
||||
let waicestation = {
|
||||
id:"10",
|
||||
name:"外侧车站",
|
||||
deviceType:"standwaice",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
assetUrl:"../../static/model/station/waicestation.FBX"
|
||||
}
|
||||
let defaulttopstation = {
|
||||
id:"104",
|
||||
name:"福州车站1",
|
||||
@ -163,6 +170,8 @@ export function AssetLoader(){
|
||||
let station = new AssetModel(defaultstation);
|
||||
scope.modellist.push(station);
|
||||
|
||||
let wstation = new AssetModel(waicestation);
|
||||
scope.modellist.push(wstation);
|
||||
// let topstation = new AssetModel(defaulttopstation);
|
||||
// scope.modellist.push(topstation);
|
||||
|
||||
@ -237,6 +246,8 @@ export function AssetLoader(){
|
||||
let station = new AssetModel(defaultstation);
|
||||
scope.modellist.push(station);
|
||||
|
||||
let wstation = new AssetModel(waicestation);
|
||||
scope.modellist.push(wstation);
|
||||
// let topstation = new AssetModel(defaulttopstation);
|
||||
// scope.modellist.push(topstation);
|
||||
|
||||
|
@ -18,7 +18,7 @@ import {RailListN} from '@/jlmap3d/main/newmodel/RailListN.js';
|
||||
import { Loading } from 'element-ui';
|
||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
||||
|
||||
export function ModelLoad(data,scope,netdata,sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,camera,controls,scene,mixerss,storemod){
|
||||
export function DriverLoad(data,scope,netdata,sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,camera,controls,scene,mixerss,storemod){
|
||||
//console.log(mapdata);
|
||||
Materialload(scope);
|
||||
//console.log(data);
|
||||
@ -131,7 +131,7 @@ export function ModelLoad(data,scope,netdata,sectionlist,linklist,signallist,sta
|
||||
|
||||
// // mapdata = jlmap3ddata;
|
||||
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails);
|
||||
// scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,scope.materiallist,scope.actions,scope.sceneload);
|
||||
scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,scope.materiallist,scope.actions,scope.sceneload);
|
||||
// scope.webwork.postMessage("on");
|
||||
// console.log(stationstandlist);
|
||||
// updatemenulist(stationstandlist.list,trainlisttest.list);
|
@ -19,7 +19,7 @@ import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
||||
import { Loading } from 'element-ui';
|
||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
||||
|
||||
export function ModelLoad(data,scope,netdata,mapdata,camera,controls,scene,storemod){
|
||||
export function SimulationLoad(data,scope,netdata,mapdata,camera,controls,scene,storemod){
|
||||
//console.log(mapdata);
|
||||
Materialload(scope);
|
||||
//console.log(data);
|
||||
@ -40,108 +40,12 @@ export function ModelLoad(data,scope,netdata,mapdata,camera,controls,scene,store
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if(isSection == true){
|
||||
init3d(data,netdata);
|
||||
}else if(isNewdata == true){
|
||||
initnew3d(data,netdata);
|
||||
}else{
|
||||
loadingInstance.close();
|
||||
alert("没有三维数据");
|
||||
}
|
||||
|
||||
function initnew3d(data,netdata){
|
||||
console.log(data);
|
||||
console.log(netdata);
|
||||
let mapdata = data;
|
||||
//初始化轨道和道岔
|
||||
// lengthfact(data);
|
||||
|
||||
// linklist = new LinkList();
|
||||
sectionlist = new SectionListN();
|
||||
signallist = new SignalListN();
|
||||
switchlist = new SwitchListN();
|
||||
//初始化站台
|
||||
stationstandlist = new StationStandListN();
|
||||
//初始化测试列车
|
||||
trainlisttest = new TrainList();
|
||||
// realsectionlist = new RealSectionList();
|
||||
|
||||
rails = new RailListN();
|
||||
|
||||
let sectiondata = JSON.parse(netdata.sections);
|
||||
let switchdata = JSON.parse(netdata.switchs);
|
||||
let signaldata = JSON.parse(netdata.signals);
|
||||
let standsdata = JSON.parse(netdata.stands);
|
||||
|
||||
assetloader.setmodellist(netdata.assets);
|
||||
|
||||
assetloader.assetpromise(sceneload)
|
||||
// .then(function(data){
|
||||
// return linklist.loadpromise(loaderdata.link,sceneload,assetloader);
|
||||
// })
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
//,netdata.stands,mixers,actions,"0"
|
||||
return stationstandlist.loadpromise(mapdata.stationList,standsdata,sceneload,assetloader,mixers,actions,"02");
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return sectionlist.loadpromise(mapdata.sectionList,sectiondata.section,scene,assetloader);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return signallist.loadpromise(mapdata.signalList,signaldata,sceneload,assetloader);
|
||||
})
|
||||
.then(function(data){
|
||||
return switchlist.loadpromise(mapdata.switchList,switchdata,sceneload,assetloader);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
//console.log(assetloader);
|
||||
return trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"02");
|
||||
})
|
||||
.then(function(data){
|
||||
return new Promise(function(resolve, reject){
|
||||
let stopoffset = 64;
|
||||
rails.init(sectiondata.section,sectiondata,switchdata,sceneload);
|
||||
resolve("loadrail");
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
.then(function(data){
|
||||
// for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
|
||||
// if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "suidao"){
|
||||
// // scope.assetloader.modellist[mn].mesh.rotation.x = Math.PI/2;
|
||||
// // scope.assetloader.modellist[mn].mesh.position.y -=0.1;
|
||||
// // console.log(scope.assetloader.modellist[mn].mesh);
|
||||
// scene.add(scope.assetloader.modellist[mn].mesh);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
scope.animateswitch = true;
|
||||
|
||||
// // mapdata = jlmap3ddata;
|
||||
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails);
|
||||
// scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,scope.materiallist,scope.actions,scope.sceneload);
|
||||
// scope.webwork.postMessage("on");
|
||||
// console.log(stationstandlist);
|
||||
updatemenulist(stationstandlist.list,trainlisttest.list);
|
||||
loadingInstance.close();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function init3d(data,netdata){
|
||||
let mapdata = data;
|
||||
// console.log(data);
|
182
src/jlmap3d/main/loaders/SimulationLoadNew.js
Normal file
182
src/jlmap3d/main/loaders/SimulationLoadNew.js
Normal file
@ -0,0 +1,182 @@
|
||||
//componnent
|
||||
import {SectionList} from '@/jlmap3d/main/model/SectionList.js';
|
||||
import {SignalList} from '@/jlmap3d/main/model/SignalList.js';
|
||||
import {StationStandList} from '@/jlmap3d/main/model/StationStandList.js';
|
||||
import {TrainList} from '@/jlmap3d/main/model/TrainList.js';
|
||||
import {RealSectionList} from '@/jlmap3d/main/model/RealSectionList.js';
|
||||
import {LinkList} from '@/jlmap3d/main/model/LinkList.js';
|
||||
import {RailList} from '@/jlmap3d/main/model/RailList.js';
|
||||
|
||||
import {TrainListN} from '@/jlmap3d/main/newmodel/TrainListN.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 {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
|
||||
|
||||
import { Loading } from 'element-ui';
|
||||
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
|
||||
|
||||
export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,scene,storemod){
|
||||
//console.log(mapdata);
|
||||
Materialload(scope);
|
||||
//console.log(data);
|
||||
//console.log(scope);
|
||||
let sceneload = scene;
|
||||
let backdata = scope;
|
||||
let jlmap3ddata = mapdata;
|
||||
let assetloader = scope.assetloader;
|
||||
|
||||
let mixers = scope.mixers;
|
||||
let actions = scope.actions;
|
||||
|
||||
let linklist,sectionlist,signallist,stationstandlist,trainlisttest,switchlist,realsectionlist,rails;
|
||||
|
||||
let loadingInstance = Loading.service({ fullscreen: true });
|
||||
|
||||
let isSection = false;
|
||||
let isNewdata = false;
|
||||
if(netdata.assets){
|
||||
initnew3d(data,netdata);
|
||||
}else{
|
||||
loadingInstance.close();
|
||||
alert("没有三维数据");
|
||||
}
|
||||
|
||||
function initnew3d(data,netdata){
|
||||
|
||||
let mapdata = data;
|
||||
//初始化轨道和道岔
|
||||
// lengthfact(data);
|
||||
|
||||
// linklist = new LinkList();
|
||||
sectionlist = new SectionListN();
|
||||
signallist = new SignalListN();
|
||||
switchlist = new SwitchListN();
|
||||
//初始化站台
|
||||
stationstandlist = new StationStandListN();
|
||||
//初始化测试列车
|
||||
trainlisttest = new TrainListN();
|
||||
// realsectionlist = new RealSectionList();
|
||||
|
||||
rails = new RailListN();
|
||||
|
||||
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;
|
||||
assetloader.setmodellist(netdata.assets);
|
||||
|
||||
assetloader.assetpromise(sceneload)
|
||||
// .then(function(data){
|
||||
// return linklist.loadpromise(loaderdata.link,sceneload,assetloader);
|
||||
// })
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
//,netdata.stands,mixers,actions,"0"
|
||||
return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"02");
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return sectionlist.loadpromise(mapdata.sectionList,sectiondata.section,scene,assetloader);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(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){
|
||||
//console.log(data);
|
||||
//console.log(assetloader);
|
||||
return trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"02");
|
||||
})
|
||||
.then(function(data){
|
||||
return new Promise(function(resolve, reject){
|
||||
let stopoffset = 64;
|
||||
rails.init(sectiondata.section,sectiondata,switchdata,sceneload);
|
||||
resolve("loadrail");
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
.then(function(data){
|
||||
// for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
|
||||
// if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "suidao"){
|
||||
// // scope.assetloader.modellist[mn].mesh.rotation.x = Math.PI/2;
|
||||
// // scope.assetloader.modellist[mn].mesh.position.y -=0.1;
|
||||
// // console.log(scope.assetloader.modellist[mn].mesh);
|
||||
// scene.add(scope.assetloader.modellist[mn].mesh);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
console.log("scene+++++++++++++++++++++++++++++++++");
|
||||
console.log(sceneload);
|
||||
// // mapdata = jlmap3ddata;
|
||||
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails);
|
||||
scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,scope.materiallist,scope.actions,scope.sceneload);
|
||||
scope.webwork.postMessage("on");
|
||||
scope.jsonwebworknew.postMessage("connect");
|
||||
updatemenulist(stationstandlist.list,trainlisttest.list);
|
||||
loadingInstance.close();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function onProgress( xhr ) {
|
||||
|
||||
if ( xhr.lengthComputable ) {
|
||||
|
||||
let percentComplete = xhr.loaded / xhr.total * 100;
|
||||
//console.log( 'model ' + Math.round( percentComplete, 2 ) + '% downloaded' );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onError() {}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function lengthfact(data){
|
||||
let linklist = [];
|
||||
//console.log(data);
|
||||
for(let i=0;i<data.linkList.length;i++){
|
||||
|
||||
let dx = Math.abs(data.linkList[i].lp.x - data.linkList[i].rp.x);
|
||||
let dy = Math.abs(data.linkList[i].lp.y - data.linkList[i].rp.y);
|
||||
let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
|
||||
|
||||
let link = {
|
||||
code:data.linkList[i].code,
|
||||
lengthfact:data.linkList[i].lengthFact,
|
||||
distance:distance
|
||||
};
|
||||
linklist.push(link);
|
||||
}
|
||||
|
||||
let sectionlist = [];
|
||||
for(let i=0;i<data.sectionList.length;i++){
|
||||
for(let j=0;j<linklist.length;j++){
|
||||
if(linklist[j].code == data.sectionList[i].linkCode){
|
||||
let sectionoffset = data.sectionList[i].offsetRight - data.sectionList[i].offsetLeft;
|
||||
let sectionlengthfact = sectionoffset/linklist[j].distance*linklist[j].lengthfact
|
||||
let section = {
|
||||
code:data.sectionList[i].code,
|
||||
lengthfact:sectionoffset
|
||||
};
|
||||
sectionlist.push(section);
|
||||
j = linklist.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//console.log(sectionlist);
|
||||
}
|
@ -20,7 +20,7 @@ export function RailListN(){
|
||||
rp:section[i].rp,
|
||||
lconnect:null,
|
||||
rconnect:null,
|
||||
lengthfact:section[i].lengthfact,
|
||||
lengthfact:section[i].lengthFact,
|
||||
lineleft:null,
|
||||
lineright:null,
|
||||
points:[],
|
||||
@ -145,8 +145,10 @@ export function RailListN(){
|
||||
//
|
||||
|
||||
for(let i=0;i<section.length;i++){
|
||||
|
||||
scope.sectionrail[section[i].code].lineleft = new THREE.CatmullRomCurve3(scope.sectionrail[section[i].code].points);
|
||||
scope.sectionrail[section[i].code].lineleft.curveType = "centripetal";
|
||||
scope.sectionrail[section[i].code].lineleft.name = section[i].code;
|
||||
// scope.sectionrail[section[i].code].lineleft.tension = 0.2;
|
||||
let rightpoints = [];
|
||||
scope.sectionrail[section[i].code].points.forEach(item=>{
|
||||
@ -156,39 +158,46 @@ export function RailListN(){
|
||||
rightpoints.reverse();
|
||||
scope.sectionrail[section[i].code].lineright = new THREE.CatmullRomCurve3(rightpoints);
|
||||
scope.sectionrail[section[i].code].lineright.curveType = "centripetal";
|
||||
scope.sectionrail[section[i].code].lineright.name = section[i].code;
|
||||
if(section[i].standTrack == true){
|
||||
scope.sectionrail[section[i].code].standTrack = true;
|
||||
}else{
|
||||
scope.sectionrail[section[i].code].standTrack = false;
|
||||
}
|
||||
|
||||
//
|
||||
for(let n=0,nm=scope.sectionrail[section[i].code].lineleft.points.length;n<nm;n++){
|
||||
var geometry = new THREE.CircleGeometry( 0.05, 16 );
|
||||
var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
||||
var circle = new THREE.Mesh( geometry, material );
|
||||
// console.log(n);
|
||||
// console.log(scope.sectionrail[section[i].code].lineleft.points[n]);
|
||||
circle.position.x = scope.sectionrail[section[i].code].lineleft.points[n].x;
|
||||
circle.position.y = scope.sectionrail[section[i].code].lineleft.points[n].y;
|
||||
circle.position.z = scope.sectionrail[section[i].code].lineleft.points[n].z;
|
||||
circle.rotation.x = -Math.PI/2;
|
||||
scene.add( circle );
|
||||
}
|
||||
// scope.sectionrail[section[i].code].lineright.tension = 0.11;
|
||||
var points = scope.sectionrail[section[i].code].lineleft.getPoints( 50 );
|
||||
var geometry = new THREE.BufferGeometry().setFromPoints( points );
|
||||
var material;
|
||||
if(scope.sectionrail[section[i].code].type == "a"){
|
||||
material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
|
||||
}
|
||||
if(scope.sectionrail[section[i].code].type == "b"){
|
||||
material = new THREE.LineBasicMaterial( { color : 0x00ff00 } );
|
||||
}
|
||||
if(scope.sectionrail[section[i].code].type == "c"){
|
||||
material = new THREE.LineBasicMaterial( { color : 0x0000ff } );
|
||||
}
|
||||
|
||||
|
||||
// Create the final object to add to the scene
|
||||
var curveObject = new THREE.Line( geometry, material );
|
||||
|
||||
curveObject.position.y = Math.random();
|
||||
scene.add(curveObject);
|
||||
// for(let n=0,nm=scope.sectionrail[section[i].code].lineleft.points.length;n<nm;n++){
|
||||
// var geometry = new THREE.CircleGeometry( 0.05, 16 );
|
||||
// var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
||||
// var circle = new THREE.Mesh( geometry, material );
|
||||
// // console.log(n);
|
||||
// // console.log(scope.sectionrail[section[i].code].lineleft.points[n]);
|
||||
// circle.position.x = scope.sectionrail[section[i].code].lineleft.points[n].x;
|
||||
// circle.position.y = scope.sectionrail[section[i].code].lineleft.points[n].y;
|
||||
// circle.position.z = scope.sectionrail[section[i].code].lineleft.points[n].z;
|
||||
// circle.rotation.x = -Math.PI/2;
|
||||
// scene.add( circle );
|
||||
// }
|
||||
// // scope.sectionrail[section[i].code].lineright.tension = 0.11;
|
||||
// var points = scope.sectionrail[section[i].code].lineleft.getPoints( 50 );
|
||||
// var geometry = new THREE.BufferGeometry().setFromPoints( points );
|
||||
// var material;
|
||||
// if(scope.sectionrail[section[i].code].type == "a"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
|
||||
// }
|
||||
// if(scope.sectionrail[section[i].code].type == "b"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0x00ff00 } );
|
||||
// }
|
||||
// if(scope.sectionrail[section[i].code].type == "c"){
|
||||
// material = new THREE.LineBasicMaterial( { color : 0x0000ff } );
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // Create the final object to add to the scene
|
||||
// var curveObject = new THREE.Line( geometry, material );
|
||||
//
|
||||
// curveObject.position.y = Math.random();
|
||||
// scene.add(curveObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ this.loadpromise = function(sectionList,sectiondata,scene,assetloader){
|
||||
scene.add(scope.sectiongroup);
|
||||
return new Promise(function(resolve, reject){
|
||||
// console.log(sectiondata);
|
||||
let mergegeometry = new THREE.Geometry();
|
||||
for(let i=0,leni = sectiondata.length;i<leni;i++){
|
||||
let newsection = {
|
||||
code:sectiondata[i].code,
|
||||
@ -81,16 +82,26 @@ this.loadpromise = function(sectionList,sectiondata,scene,assetloader){
|
||||
testmesh2.geometry.attributes.uv.needsUpdate = true;
|
||||
testmesh2.geometry.computeBoundingSphere();
|
||||
testmesh2.geometry.center();
|
||||
testmesh2.code = newsection.code;
|
||||
testmesh2.rightlist = sectiondata[i].rightlist,
|
||||
testmesh2.leftlist = sectiondata[i].leftlist,
|
||||
testmesh2.position.set(sectiondata[i].position.x,sectiondata[i].position.y,sectiondata[i].position.z);
|
||||
testmesh2.rotation.set(sectiondata[i].rotation._x,sectiondata[i].rotation._y,sectiondata[i].rotation._z);
|
||||
scope.sectiongroup.add(testmesh2);
|
||||
newsection.mesh = testmesh2;
|
||||
testmesh2.matrixAutoUpdate = false;
|
||||
// scope.sectiongroup.add(testmesh2);
|
||||
// newsection.mesh = testmesh2;
|
||||
scope.sections.datalist[newsection.code] = newsection;
|
||||
|
||||
// console.log(newsection);
|
||||
testmesh2.updateMatrix();
|
||||
mergegeometry.merge(new THREE.Geometry().fromBufferGeometry(testmesh2.geometry),testmesh2.matrix);
|
||||
// console.log(testmesh2);
|
||||
testmesh2.geometry.dispose();
|
||||
for(let j in testmesh2.material){
|
||||
testmesh2.material[j].map.dispose();
|
||||
testmesh2.material[j].dispose();
|
||||
}
|
||||
testmesh2 = null;
|
||||
}
|
||||
let mergemesh = new THREE.Mesh( mergegeometry, autorail.material );
|
||||
mergemesh.matrixAutoUpdate = false;
|
||||
scope.sectiongroup.add(mergemesh);
|
||||
resolve("loadersection");
|
||||
});
|
||||
|
||||
|
@ -9,40 +9,53 @@ export function SignalListN() {
|
||||
this.list = [];
|
||||
|
||||
this.group = new THREE.Group();
|
||||
|
||||
this.group.name = "signallist";
|
||||
this.loadpromise = function(data,signaldata,scene,assetloader){
|
||||
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
for(let i=0;i<signaldata.length;i++){
|
||||
let newsignal = new SignalModel(signaldata[i]);
|
||||
let selectmesh = null;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].deviceType == "signal"){
|
||||
selectmesh = assetloader.modellist[j].mesh;
|
||||
for(let j=0,lenj = data.length;j<lenj;j++){
|
||||
if(data[j].code == signaldata[i].code){
|
||||
if(data[j].virtual == false){
|
||||
// console.log(signaldata[i]);
|
||||
let newsignal = new SignalModel(signaldata[i]);
|
||||
let selectmesh = null;
|
||||
for(let j=0;j<assetloader.modellist.length;j++){
|
||||
if(assetloader.modellist[j].deviceType == "signal"){
|
||||
selectmesh = assetloader.modellist[j].mesh;
|
||||
}
|
||||
}
|
||||
// console.log(signaldata[i]);
|
||||
let newmesh = selectmesh.clone(true);
|
||||
// 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.code = signaldata[i].code;
|
||||
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;
|
||||
newmesh.scale.x = signaldata[i].scale.x;
|
||||
newmesh.scale.y = signaldata[i].scale.y;
|
||||
newmesh.scale.z = signaldata[i].scale.z;
|
||||
|
||||
// newmesh.matrixAutoUpdate = false;
|
||||
newsignal.mesh = newmesh;
|
||||
newsignal.mesh.status = "01";
|
||||
scope.group.add(newsignal.mesh);
|
||||
scope.list[signaldata[i].code] = newsignal;
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(signaldata[i]);
|
||||
let newmesh = selectmesh.clone(true);
|
||||
// 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 = selectmesh.id;
|
||||
newmesh.code = signaldata[i].code;
|
||||
newmesh.right = data[i].right;
|
||||
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[signaldata[i].code] = newsignal;
|
||||
}
|
||||
data = null;
|
||||
signaldata = null;
|
||||
scene.add(scope.group);
|
||||
resolve("loadedsignal");
|
||||
});
|
||||
|
@ -1,36 +1,5 @@
|
||||
export function SignalModel(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;
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ export function StationStandListN() {
|
||||
this.list = [];
|
||||
|
||||
this.group = new THREE.Group();
|
||||
|
||||
this.group.name = "station";
|
||||
this.textlist = [];
|
||||
|
||||
this.loadpromise = function(stationdata,standsdata,scene,assetloader,mixers,actionss,mode){
|
||||
this.loadpromise = function(stationdata,standsdata,psddata,scene,assetloader,mixers,actionss,mode){
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
let stations = stationdata;
|
||||
@ -43,9 +43,9 @@ export function StationStandListN() {
|
||||
newstationmesh.position.x = standsdata[i].position.x;
|
||||
newstationmesh.position.y = standsdata[i].position.y;
|
||||
newstationmesh.position.z = standsdata[i].position.z;
|
||||
newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
// newstationmesh.rotation.x = standsdata[i].rotation._x;
|
||||
// newstationmesh.rotation.y = standsdata[i].rotation._y;
|
||||
// newstationmesh.rotation.z = standsdata[i].rotation._z;
|
||||
newstationstand.mesh = newstationmesh;
|
||||
scope.group.add(newstationmesh);
|
||||
|
||||
@ -60,43 +60,55 @@ export function StationStandListN() {
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
|
||||
|
||||
let key = newstationstand.direction1.name;
|
||||
actionss[key] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( newstationmesh.children[j].animations[0])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
//actionss[key].play();
|
||||
mixers.push(mixer);
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
if(psddata[n].standCode == newstationstand.direction2.code){
|
||||
|
||||
let key = psddata[n].code;
|
||||
actionss[key] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( newstationmesh.children[j].animations[0])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
//actionss[key].play();
|
||||
mixers.push(mixer);
|
||||
n = psddata.length;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(newstationmesh.children[j].name == "down"){
|
||||
newstationmesh.children[j].animations = [];
|
||||
newstationmesh.children[j].animations.push(newclip.clone());
|
||||
|
||||
let mixer = new THREE.AnimationMixer( newstationmesh.children[j] );
|
||||
for(let n=0;n<psddata.length;n++){
|
||||
if(psddata[n].standCode == newstationstand.direction1.code){
|
||||
|
||||
let key = newstationstand.direction2.name;
|
||||
actionss[key] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( newstationmesh.children[j].animations[0])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
//actionss[key].play();
|
||||
mixers.push(mixer);
|
||||
let key = psddata[n].code;
|
||||
actionss[key] = {
|
||||
status:"01",
|
||||
action:mixer.clipAction( newstationmesh.children[j].animations[0])
|
||||
};
|
||||
actionss[key].action.setLoop(THREE.LoopOnce);
|
||||
actionss[key].action.clampWhenFinished = true;
|
||||
//actionss[key].play();
|
||||
mixers.push(mixer);
|
||||
n = psddata.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// console.log(newstationmesh);
|
||||
if(mode){
|
||||
if(mode == "02"){
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 271, 374, 1 );
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(stationdata[i]));
|
||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
textplane.name = stationdata[i].code;
|
||||
textplane.position.y = 300;
|
||||
textplane.position.y = 70;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
//textplane.position.x = -30;
|
||||
scope.textlist.push(textplane);
|
||||
@ -112,6 +124,8 @@ export function StationStandListN() {
|
||||
}
|
||||
}
|
||||
// scene.add(scope.textlist);
|
||||
stationdata = null;
|
||||
psddata = null;
|
||||
scene.add(scope.group);
|
||||
resolve("loadedstation");
|
||||
});
|
||||
@ -121,37 +135,38 @@ export function StationStandListN() {
|
||||
//canvas文字贴图方法
|
||||
//PS:待提炼 增强功能
|
||||
var stationcanvas = new Image();
|
||||
stationcanvas.src = "../../static/texture/msgt.png";
|
||||
stationcanvas.src = "../../static/texture/msgtnew.png";
|
||||
function getTextCanvas(text){
|
||||
let canvas = document.getElementById('canvastexture');
|
||||
|
||||
canvas.width = 256;
|
||||
canvas.height = 512;
|
||||
canvas.width = 128;
|
||||
canvas.height = 256;
|
||||
// canvas.style.width = width;
|
||||
// canvas.style.height = height;
|
||||
|
||||
let ctx = canvas.getContext('2d');
|
||||
//ctx.fillStyle = '#FFFFFF';
|
||||
ctx.fillRect(0, 0,256,512);
|
||||
ctx.fillRect(0, 0,128,256);
|
||||
|
||||
ctx.fillStyle = '#FFFFFF';
|
||||
// ctx.textAlign = 'center';
|
||||
// ctx.textBaseline = 'middle';
|
||||
ctx.clearRect(0,0,256,512);
|
||||
ctx.clearRect(0,0,128,256);
|
||||
|
||||
ctx.drawImage(stationcanvas,0,0,256,512);
|
||||
ctx.drawImage(stationcanvas,0,0,128,256);
|
||||
|
||||
ctx.font = "20px Verdana";
|
||||
ctx.fillText("车站名称: "+text.name, 20,58);
|
||||
ctx.font = "10px";
|
||||
ctx.fillText("车站: "+text.name, 15,25);
|
||||
|
||||
ctx.fillText("漫游", 30,100);
|
||||
ctx.fillText("信息", 114,100);
|
||||
ctx.fillText("备忘", 190,100);
|
||||
ctx.fillText("漫游", 18,48);
|
||||
ctx.fillText("信息", 54,48);
|
||||
ctx.fillText("备忘", 93,48);
|
||||
|
||||
ctx.fillText("车站序号: "+text.name, 10,155);
|
||||
ctx.fillText("车站序号: "+text.name, 10,115);
|
||||
|
||||
ctx.fillText("公里标记:"+text.kmPost,10 ,256*3/4);
|
||||
ctx.fillText("公里标记:",10 ,135);
|
||||
ctx.fillText(text.kmPost,10 ,155);
|
||||
|
||||
let data = ctx.getImageData(0, 0,256,512);
|
||||
let data = ctx.getImageData(0, 0,128,256);
|
||||
return data;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export function SwitchListN() {
|
||||
modellist:[]
|
||||
};
|
||||
|
||||
this.loadpromise = function(jlmap3ddata,switchdata,scene,assetloader){
|
||||
this.loadpromise = function(jlmap3ddata,switchdata,scene,assetloader,mixers,actions){
|
||||
return new Promise(function(resolve, reject){
|
||||
scene.add( scope.switchgroup );
|
||||
// let sectiondata = jlmap3ddata.sectionlist.sections.datalist;
|
||||
@ -47,9 +47,18 @@ export function SwitchListN() {
|
||||
autoswitch.rotation.x = switchdata[i].rotation._x;
|
||||
autoswitch.rotation.y = switchdata[i].rotation._y;
|
||||
autoswitch.rotation.z = switchdata[i].rotation._z;
|
||||
// autoswitch.matrixAutoUpdate = false;
|
||||
autoswitch.animations = assetloader.modellist[num].mesh.animations;
|
||||
|
||||
let mixer = new THREE.AnimationMixer( autoswitch );
|
||||
actions[autoswitch.code] = {
|
||||
normal:"00",
|
||||
action:mixer.clipAction( autoswitch.animations[0])
|
||||
};
|
||||
actions[autoswitch.code].action.setLoop(THREE.LoopOnce);
|
||||
actions[autoswitch.code].action.clampWhenFinished = true;
|
||||
mixers.push(mixer);
|
||||
}
|
||||
|
||||
// console.log(scope.switchs.modellist);
|
||||
resolve("loadedswitch");
|
||||
});
|
||||
|
247
src/jlmap3d/main/newmodel/TrainListN.js
Normal file
247
src/jlmap3d/main/newmodel/TrainListN.js
Normal file
@ -0,0 +1,247 @@
|
||||
import {TrainModel} from '@/jlmap3d/edit/editmodel/TrainModel.js';
|
||||
|
||||
export function TrainListN() {
|
||||
|
||||
let scope = this;
|
||||
|
||||
this.type = "trainlist";
|
||||
|
||||
this.list = {};
|
||||
|
||||
this.group = new THREE.Group();
|
||||
this.group.name = "train";
|
||||
this.textlist = [];
|
||||
|
||||
this.initpromise = function(data,scene,assetloader,mixers,actionss,mode){
|
||||
return new Promise(function(resolve, reject){
|
||||
let selectmesh,ntracks1,ntracks2,tclip,fclip;
|
||||
for(let n=assetloader.modellist.length-1;n>=0;n--){
|
||||
if(assetloader.modellist[n].deviceType == "train"){
|
||||
|
||||
selectmesh = assetloader.modellist[n].mesh
|
||||
|
||||
ntracks1 = assetloader.modellist[n].animations.slice(16,27);
|
||||
|
||||
tclip = new THREE.AnimationClip("three",2,ntracks1);
|
||||
|
||||
ntracks2 = assetloader.modellist[n].animations.slice(0,15);
|
||||
|
||||
fclip = new THREE.AnimationClip("four",2,ntracks2);
|
||||
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
//遍历列车数据
|
||||
// console.log(data.length);
|
||||
for(let i=0;i<data.length;i++){
|
||||
|
||||
|
||||
actionss[data[i].code] = {
|
||||
top:[],
|
||||
down:[]
|
||||
};
|
||||
let newmesh = selectmesh.clone(true);
|
||||
newmesh.mixer = [];
|
||||
// console.log("-------------------------");
|
||||
// console.log(data[i]);
|
||||
for(let j=0;j<newmesh.children.length;j++){
|
||||
|
||||
if(newmesh.children[j].name == "c1" || newmesh.children[j].name == "c6"){
|
||||
// console.log("===================");
|
||||
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
|
||||
|
||||
if(newmesh.children[j].children[n].name == "top"){
|
||||
newmesh.children[j].children[n].animations = [];
|
||||
newmesh.children[j].children[n].animations.push(tclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
|
||||
// console.log(n);
|
||||
// console.log(newmesh.children[j].children[n]);
|
||||
newmesh.mixer.push(mixer);
|
||||
newmesh.mixerpush = false;
|
||||
// mixers.push(mixer);
|
||||
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
|
||||
//action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
actionss[data[i].code].top.push(action);
|
||||
|
||||
}
|
||||
|
||||
if(newmesh.children[j].children[n].name == "down"){
|
||||
newmesh.children[j].children[n].animations = [];
|
||||
newmesh.children[j].children[n].animations.push(tclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
|
||||
|
||||
newmesh.mixer.push(mixer);
|
||||
newmesh.mixerpush = false;
|
||||
// mixers.push(mixer);
|
||||
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
|
||||
//action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
actionss[data[i].code].down.push(action);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
|
||||
if(newmesh.children[j].children[n].name == "top"){
|
||||
newmesh.children[j].children[n].animations = [];
|
||||
newmesh.children[j].children[n].animations.push(fclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
|
||||
newmesh.mixer.push(mixer);
|
||||
newmesh.mixerpush = false;
|
||||
// mixers.push(mixer);
|
||||
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
|
||||
//action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
actionss[data[i].code].top.push(action);
|
||||
}
|
||||
|
||||
if(newmesh.children[j].children[n].name == "down"){
|
||||
newmesh.children[j].children[n].animations = [];
|
||||
newmesh.children[j].children[n].animations.push(fclip.clone());
|
||||
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
|
||||
newmesh.mixer.push(mixer);
|
||||
newmesh.mixerpush = false;
|
||||
// mixers.push(mixer);
|
||||
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
|
||||
//action.play();
|
||||
action.setLoop(THREE.LoopOnce);
|
||||
action.clampWhenFinished = true;
|
||||
actionss[data[i].code].down.push(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
//newmesh.children[j].name = data[i].code;
|
||||
newmesh.children[j].code = data[i].code;
|
||||
newmesh.children[j].axis = new THREE.Vector3();
|
||||
newmesh.children[j].up = new THREE.Vector3(1, 0, 0);
|
||||
// newmesh.axis = new THREE.Vector3();
|
||||
// newmesh.up = new THREE.Vector3(1, 0, 0);
|
||||
// var pos = new THREE.Mesh( geometryp, materialp);
|
||||
// pos.position.x = -73.5;
|
||||
// newmesh.children[j].add( pos );
|
||||
newmesh.children[j].rotalist = [];
|
||||
// console.log(newmesh);
|
||||
}
|
||||
//
|
||||
// // newmesh.children[4].add(newmesh.children[5]);
|
||||
// // newmesh.children[3].add(newmesh.children[4]);
|
||||
// // newmesh.children[2].add(newmesh.children[3]);
|
||||
// // newmesh.children[1].add(newmesh.children[2]);
|
||||
// // newmesh.children[0].add(newmesh.children[1]);
|
||||
// for(let n=newmesh.children.length-1;n>=1;n--){
|
||||
// newmesh.children[n].position.x = -76;
|
||||
// newmesh.children[n-1].add(newmesh.children[n]);
|
||||
// }
|
||||
//创建列车字牌
|
||||
if(mode){
|
||||
if(mode == "02"){
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 64, 32, 1 );
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(data[i]));
|
||||
let textmaterial = new THREE.MeshBasicMaterial( {
|
||||
side: THREE.DoubleSide,
|
||||
map:textt ,transparent: true,
|
||||
alphaTest:0.1
|
||||
} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
textplane.name = data[i].code;
|
||||
textplane.position.x = 0;
|
||||
textplane.position.y = 0;
|
||||
textplane.position.z = 20;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
textplane.tcode = data[i].code;
|
||||
//textplane.rotation.x = Math.PI;
|
||||
scope.textlist.push(textplane);
|
||||
newmesh.children[0].add(textplane);
|
||||
textgeometry.dispose();
|
||||
textmaterial.dispose();
|
||||
textt.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//group.add(textplane);
|
||||
newmesh.first = false;
|
||||
newmesh.name = data[i].code;
|
||||
newmesh.rname = data[i].groupNumber;
|
||||
newmesh.groupNumber = data[i].groupNumber;
|
||||
|
||||
newmesh.position.set(0,-50000,0);
|
||||
// newmesh.children[0].position.y = 0;
|
||||
//newmesh.rotation.y = Math.PI/2;
|
||||
newmesh.status = "00";
|
||||
newmesh.nowcode = null;
|
||||
newmesh.curve = null;
|
||||
newmesh.doorStatus = "01";
|
||||
newmesh.dispose = 1;
|
||||
newmesh.nowsection = null;
|
||||
newmesh.nextsection = null;
|
||||
newmesh.speed = 0;
|
||||
newmesh.speeds = 0;
|
||||
newmesh.progress = null;
|
||||
newmesh.startmark = 0;
|
||||
newmesh.open = null;
|
||||
newmesh.statsstop = 0;
|
||||
|
||||
|
||||
scope.list[data[i].code] = newmesh;
|
||||
//scene.add(newmesh);
|
||||
}
|
||||
// console.log(selectmesh);
|
||||
// for(let i=0,leni=selectmesh.children.length;i<leni;i++){
|
||||
// selectmesh.children[i].geometry.dispose();
|
||||
// selectmesh.children[i].material.dispose();
|
||||
// }
|
||||
data = null;
|
||||
scene.add(scope.group);
|
||||
resolve("loadedtrain");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let onProgress = function ( xhr ) {
|
||||
|
||||
if ( xhr.lengthComputable ) {
|
||||
|
||||
let percentComplete = xhr.loaded / xhr.total * 100;
|
||||
console.log( Math.round( percentComplete, 2 ) + '% downloaded' );
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
let onError = function () { };
|
||||
|
||||
var beauty = new Image();
|
||||
beauty.src = "../../static/texture/guidenew.png";
|
||||
//canvas文字贴图方法
|
||||
//PS:待提炼 增强功能
|
||||
function getTextCanvas(text){
|
||||
var canvas = document.getElementById('canvastexture');
|
||||
|
||||
canvas.width = 128;
|
||||
canvas.height = 64;
|
||||
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
//var bg = canvas.createPattern(img, "no-repeat");
|
||||
//ctx.fillStyle = bg;
|
||||
ctx.fillRect(0, 0,128,64);
|
||||
ctx.font = "8px Verdana";
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.clearRect(0,0,128,64);
|
||||
//console.log(text.groupNumber);
|
||||
ctx.drawImage(beauty,0,0,128, 64);
|
||||
ctx.fillText("车组号:"+text.groupNumber, 40,10);
|
||||
ctx.fillText("车组人员:XXX", 40,20);
|
||||
// ctx.fillText("速度:XXX.XXX", 40,30);
|
||||
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
|
||||
let data = ctx.getImageData(0, 0,128,64);
|
||||
return data;
|
||||
}
|
@ -1,8 +1,5 @@
|
||||
export function TrainModel(opts) {
|
||||
|
||||
var scope = this;
|
||||
|
||||
this.mesh = null;
|
||||
this.meshurl = null;
|
||||
this.picurl = null;
|
||||
}
|
||||
|
@ -125,5 +125,7 @@ export default class defaultStyle {
|
||||
export const drawSectionStyle = {
|
||||
routePhysicalSection: 'rgba(255,255,0,0.5)',
|
||||
continueProtectSection: 'rgba(255,0,255,0.5)',
|
||||
signalNearSection: 'rgba(255, 0, 0, 0.5)'
|
||||
signalNearSectionCBTC: 'rgba(255, 0, 0, 0.5)',
|
||||
signalNearSectionReserve: 'rgba(160, 32, 240, 0.5)',
|
||||
signalNearSection: 'rgba(124, 252, 0, 0.5)'
|
||||
};
|
||||
|
@ -134,15 +134,18 @@ class SkinCode extends defaultStyle {
|
||||
color: '#7F7F7F' // 区段边界符颜色
|
||||
},
|
||||
block: {
|
||||
special: false, // 区段特殊显示
|
||||
special: false // 区段特殊显示
|
||||
},
|
||||
trainPosition:{
|
||||
display: false // 列车实时位置显示
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Signal] = {
|
||||
distance: 0, // 设备距离区段的距离
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardColor: '#5578B6', // 灯灯柱颜色
|
||||
standardWidth: 1.5 // 灯柱宽度
|
||||
},
|
||||
@ -207,10 +210,36 @@ class SkinCode extends defaultStyle {
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.MapCycleButtonVO] = {
|
||||
// 是否显示
|
||||
visibleConditions: '03',
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
subtitleText: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 17 // 等于副标题距离
|
||||
},
|
||||
lamp: {
|
||||
lineDash: null, // 灯的包围框
|
||||
borderShow: false, // 是否显示边框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
},
|
||||
OutFrame: {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.StationStand] = {
|
||||
common: { // 通用属性
|
||||
textFontSize: 8, // 站台默认字体大小
|
||||
functionButtonShow: ['01'] // 功能灯按钮显示条件(prdType)
|
||||
functionButtonShow: '03' // 功能灯按钮显示条件(01所有模式下显示 02 行调显示 03现地显示)
|
||||
},
|
||||
safetyDoor: { // 屏蔽门
|
||||
height: 1.6, // 站台屏蔽门高度
|
||||
@ -266,7 +295,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
lampColor: '#5A5D5A' // 功能按钮颜色
|
||||
lampColor: '#5A5D5A' // 功能按钮颜色
|
||||
}
|
||||
};
|
||||
|
||||
@ -291,7 +320,7 @@ class SkinCode extends defaultStyle {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: true, // 公里标显示
|
||||
functionButtonShow: ['01'], // 功能灯按钮(引导总锁)显示条件(prdType)
|
||||
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
|
||||
kilometerPosition: 'down', // 公里标位置
|
||||
fontWeight: 'bold', // 文字错细
|
||||
text: {
|
||||
@ -367,8 +396,8 @@ class SkinCode extends defaultStyle {
|
||||
monolockColor: '#870E10' // 道岔单锁颜色
|
||||
},
|
||||
sectionAction: {
|
||||
flag: false, // 道岔 关联区段显示
|
||||
spareColor: '#5b5b5b', // 区段显示颜色
|
||||
flag: false, // 道岔 关联区段显示
|
||||
spareColor: '#5b5b5b' // 区段显示颜色
|
||||
},
|
||||
core: {
|
||||
length: 6 // 道岔单边长度
|
||||
@ -379,7 +408,7 @@ class SkinCode extends defaultStyle {
|
||||
rectShow: false // 道岔单锁 矩形框是否显示
|
||||
},
|
||||
block: { // 道岔封锁配置
|
||||
blockName: 'default', // 默认道岔封锁类型
|
||||
blockName: 'default', // 默认道岔封锁类型
|
||||
nameBorderShow: true, // 道岔名称是否有包围框 显示
|
||||
contentRectShow: false // 道岔封锁显示
|
||||
},
|
||||
@ -463,14 +492,14 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.AutomaticRoute] = {
|
||||
// 是否显示
|
||||
displayCondition: [], // 显示条件 prdType
|
||||
displayCondition: '03', // 显示条件 prdType
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
}
|
||||
@ -603,24 +632,11 @@ class SkinCode extends defaultStyle {
|
||||
trainRColor: '#A0522D'
|
||||
}
|
||||
], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM
|
||||
runControlStatus: [
|
||||
{ status: '01', hShow: false, sShow: false },
|
||||
{ status: '02', hShow: true, sShow: false },
|
||||
{ status: '03', hShow: false, sShow: true }
|
||||
], // 设置运行控制状态类型 01正常 02扣车 03停跳
|
||||
doorStatus: [
|
||||
{status: true, dShow: false},
|
||||
{status: false, dShow: true}
|
||||
], // 设置车门状态类型 true车门关闭且锁闭
|
||||
communicationStatus: [
|
||||
{status: 'CBTC', trainColor: '#725A64'},
|
||||
{status: 'ITC', trainColor: '#C0C0C0'},
|
||||
{status: 'IL', trainColor: '#C0C0C0'}
|
||||
], // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL
|
||||
alarmStatus: [
|
||||
{ status: '01', aShow: false },
|
||||
{ status: '02', aShow: true }
|
||||
], // 设置报警状态 01不报警 02报警
|
||||
serverNoType: [
|
||||
{ type: '01', showColor: '#FFFFFF' },
|
||||
{ type: '02', showColor: '#FFF000' }
|
||||
|
@ -135,6 +135,9 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
block: {
|
||||
special: false, // 区段特殊显示
|
||||
},
|
||||
trainPosition:{
|
||||
display: true // 列车实时位置显示
|
||||
}
|
||||
};
|
||||
|
||||
@ -205,8 +208,8 @@ class SkinCode extends defaultStyle {
|
||||
this[deviceType.StationStand] = {
|
||||
common: { // 通用属性
|
||||
textFontSize: 10, // 站台默认字体大小
|
||||
haveJumpShow: true, // 站台是否有列车停跳显示
|
||||
functionButtonShow: [] // 功能灯按钮显示条件(prdType)
|
||||
haveJumpShow: false, // 站台是否有列车停跳显示
|
||||
functionButtonShow: '03' // 功能灯按钮显示条件(01所有模式下显示 02 行调显示 03现地显示)
|
||||
},
|
||||
safetyDoor: { // 屏蔽门
|
||||
height: 3, // 站台屏蔽门高度
|
||||
@ -233,9 +236,9 @@ class SkinCode extends defaultStyle {
|
||||
autoChangeEndsColor: '#0BF400' // 站台自动换端
|
||||
},
|
||||
detainCar: { // 扣车
|
||||
text: '扣', // 扣车显示内容
|
||||
text: 'H', // 扣车显示内容
|
||||
position: -1, // 扣车方向
|
||||
offset: {x: -8, y: -20}, // 扣车偏移量
|
||||
offset: {x: -8, y: 13}, // 扣车偏移量
|
||||
trainColor: 'yellow', // 车站扣车颜色
|
||||
centerTrainColor: 'white', // 中心扣车颜色
|
||||
andCenterTrainColor: 'red', // 车站+中心扣车颜色
|
||||
@ -286,13 +289,37 @@ class SkinCode extends defaultStyle {
|
||||
borderColor: '#FFFFFF' // 延迟解锁边框颜色
|
||||
}
|
||||
};
|
||||
this[deviceType.MapCycleButtonVO] = {
|
||||
// 是否显示
|
||||
visibleConditions: '03',
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
subtitleText: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 17 // 等于副标题距离
|
||||
},
|
||||
lamp: {
|
||||
lineDash: null, // 灯的包围框
|
||||
borderShow: false, // 是否显示边框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
},
|
||||
OutFrame: {
|
||||
|
||||
}
|
||||
};
|
||||
this[deviceType.Station] = {
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: false, // 公里标显示
|
||||
functionButtonShow: ['01'], // 功能灯按钮(引导总锁)显示条件(prdType)
|
||||
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
|
||||
kilometerPosition: 'up', // 公里标朝向
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
@ -423,7 +450,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.AutomaticRoute] = {
|
||||
// 是否显示
|
||||
displayCondition: [], // 显示条件 prdType
|
||||
displayCondition: '03', // 显示条件 prdType
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
@ -570,36 +597,11 @@ class SkinCode extends defaultStyle {
|
||||
trainRColor: '#A0522D'
|
||||
}
|
||||
], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM
|
||||
runControlStatus: [
|
||||
{
|
||||
status: '01',
|
||||
hShow: false,
|
||||
sShow: false
|
||||
},
|
||||
{
|
||||
status: '02',
|
||||
hShow: true,
|
||||
sShow: false
|
||||
},
|
||||
{
|
||||
status: '03',
|
||||
hShow: false,
|
||||
sShow: true
|
||||
}
|
||||
], // 设置运行控制状态类型 01正常 02扣车 03停跳
|
||||
doorStatus: [
|
||||
{status: true, dShow: false},
|
||||
{status: false, dShow: true}
|
||||
], // 设置车门状态类型 true车门关闭且锁闭
|
||||
communicationStatus: [
|
||||
{status: 'CBTC', trainColor: '#000099'},
|
||||
{status: 'ITC', trainColor: '#747474'},
|
||||
{status: 'IL', trainColor: '#747474'}
|
||||
], // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL
|
||||
alarmStatus: [
|
||||
{status: '01', aShow: false},
|
||||
{status: '02', aShow: true}
|
||||
] // 设置报警状态 01不报警 02报警
|
||||
] // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -137,15 +137,18 @@ class SkinCode extends defaultStyle {
|
||||
distance: 5 // 限速线距离区段距离
|
||||
},
|
||||
block: {
|
||||
special: false, // 区段特殊显示
|
||||
special: false // 区段特殊显示
|
||||
},
|
||||
trainPosition:{
|
||||
display: false // 列车实时位置显示
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Signal] = {
|
||||
distance: 10, // 设备距离区段的距离
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardColor: '#FFFFFF', // 灯柱颜色
|
||||
standardWidth: 2 // 灯柱宽度
|
||||
},
|
||||
@ -209,7 +212,7 @@ class SkinCode extends defaultStyle {
|
||||
common: { // 通用属性
|
||||
textFontSize: 10, // 站台默认字体大小
|
||||
haveJumpShow: true, // 站台是否有列车停跳显示
|
||||
functionButtonShow: ['01'] // 功能灯按钮显示条件(prdType)
|
||||
functionButtonShow: '03' // 功能灯按钮显示条件(prdType)
|
||||
},
|
||||
safetyDoor: { // 屏蔽门
|
||||
height: 3, // 站台屏蔽门高度
|
||||
@ -225,7 +228,7 @@ class SkinCode extends defaultStyle {
|
||||
designatedJumpStopColor: '#808080' // 站台指定列车跳停颜色
|
||||
},
|
||||
standEmergent: { // 紧急关闭
|
||||
flicker: true, // 闪烁
|
||||
flicker: true, // 闪烁
|
||||
mergentR: 5, // 站台紧急关闭半径
|
||||
offset: {x: 0, y: 15}, // 站台紧急关闭偏移量
|
||||
closeColor: '#F61107' // 站台紧急关闭颜色
|
||||
@ -239,7 +242,7 @@ class SkinCode extends defaultStyle {
|
||||
detainCar: { // 扣车
|
||||
text: '扣', // 扣车显示内容
|
||||
position: -1, // 扣车方向
|
||||
offset: {x: -8, y: -20}, // 扣车偏移量
|
||||
offset: {x: -8, y: 13}, // 扣车偏移量
|
||||
trainColor: '#FFFF00', // 车站扣车颜色
|
||||
centerTrainColor: '#C0C0C0', // 中心扣车颜色
|
||||
andCenterTrainColor: '#C0C0C0', // 车站+中心扣车颜色
|
||||
@ -255,8 +258,8 @@ class SkinCode extends defaultStyle {
|
||||
text: '跳', // 停跳显示内容
|
||||
position: -1, // 停跳方向
|
||||
offset: {x: -8, y: 10},
|
||||
textColor: '#0000FF', // 停跳文字颜色
|
||||
arcColor: '#0000FF', // 停跳圆圈颜色
|
||||
textColor: '#00ffcc', // 停跳文字颜色
|
||||
arcColor: '#00ffcc', // 停跳圆圈颜色
|
||||
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
|
||||
r: 8 // 圆半径大小
|
||||
},
|
||||
@ -272,7 +275,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
lampColor: '#5A5D5A' // 功能按钮颜色
|
||||
lampColor: '#5A5D5A' // 功能按钮颜色
|
||||
}
|
||||
};
|
||||
|
||||
@ -297,7 +300,7 @@ class SkinCode extends defaultStyle {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: false, // 公里标显示
|
||||
functionButtonShow: ['01'], // 功能灯按钮(引导总锁)显示条件(prdType)
|
||||
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
|
||||
kilometerPosition: 'up', // 公里标朝向
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
@ -307,7 +310,7 @@ class SkinCode extends defaultStyle {
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#FFFF00', // 控制灯颜色
|
||||
guideColor: '#5A5D5A' // 引导总锁灯颜色
|
||||
guideColor: '#5A5D5A' // 引导总锁灯颜色
|
||||
},
|
||||
turnBack: { // 按图折返
|
||||
lamp: 1, // 灯数量
|
||||
@ -365,8 +368,8 @@ class SkinCode extends defaultStyle {
|
||||
monolockColor: '#FFFFFF' // 道岔单锁颜色
|
||||
},
|
||||
sectionAction: {
|
||||
flag: false, // 道岔 关联区段显示
|
||||
spareColor: '#5b5b5b', // 区段显示颜色
|
||||
flag: false, // 道岔 关联区段显示
|
||||
spareColor: '#5b5b5b' // 区段显示颜色
|
||||
},
|
||||
core: {
|
||||
length: 6 // 道岔单边长度
|
||||
@ -379,7 +382,7 @@ class SkinCode extends defaultStyle {
|
||||
rectBorderColor: '#fff' // 矩形边框颜色
|
||||
},
|
||||
block: { // 道岔封锁配置
|
||||
blockName: 'default', // 默认道岔封锁类型
|
||||
blockName: 'default', // 默认道岔封锁类型
|
||||
nameBorderShow: false, // 道岔名称是否有包围框 显示
|
||||
contentRectShow: true, // 道岔封锁显示
|
||||
contentRectColor: 'red' // 道岔封锁边框颜色
|
||||
@ -436,30 +439,55 @@ class SkinCode extends defaultStyle {
|
||||
subtitleText: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 17 // 等于副标题距离
|
||||
distance: 17 // 等于副标题距离
|
||||
},
|
||||
lamp: {
|
||||
lineDash: null, // 灯的包围框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
lineDash: null, // 灯的包围框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
}
|
||||
};
|
||||
this[deviceType.AutomaticRoute] = {
|
||||
// 是否显示
|
||||
displayCondition: ['01'], // 显示条件prdType 为01
|
||||
displayCondition: '03', // 显示条件prdType 为01
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
}
|
||||
};
|
||||
this[deviceType.MapCycleButtonVO] = {
|
||||
// 是否显示
|
||||
visibleConditions: '03',
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
subtitleText: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 17 // 等于副标题距离
|
||||
},
|
||||
lamp: {
|
||||
borderShow: false, // 是否显示边框
|
||||
lineDash: null, // 灯的包围框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
},
|
||||
OutFrame: {
|
||||
|
||||
}
|
||||
};
|
||||
this[deviceType.TrainWindow] = {
|
||||
lineColor: '#4DD43F', // 车次窗颜色
|
||||
lineDash: null, // 车次窗虚线间隔
|
||||
@ -607,36 +635,11 @@ class SkinCode extends defaultStyle {
|
||||
trainRColor: '#FF0000'
|
||||
}
|
||||
], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM
|
||||
runControlStatus: [
|
||||
{
|
||||
status: '01',
|
||||
hShow: false,
|
||||
sShow: false
|
||||
},
|
||||
{
|
||||
status: '02',
|
||||
hShow: true,
|
||||
sShow: false
|
||||
},
|
||||
{
|
||||
status: '03',
|
||||
hShow: false,
|
||||
sShow: true
|
||||
}
|
||||
], // 设置运行控制状态类型 01正常 02扣车 03停跳
|
||||
doorStatus: [
|
||||
{status: true, dShow: false},
|
||||
{status: false, dShow: true}
|
||||
], // 设置车门状态类型 true车门关闭且锁闭
|
||||
communicationStatus: [
|
||||
{status: 'CBTC', trainColor: '#000099'},
|
||||
{status: 'ITC', trainColor: '#747474'},
|
||||
{status: 'IL', trainColor: '#747474'}
|
||||
], // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL
|
||||
alarmStatus: [
|
||||
{status: '01', aShow: false},
|
||||
{status: '02', aShow: true}
|
||||
] // 设置报警状态 01不报警 02报警
|
||||
] // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -128,6 +128,9 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
block: {
|
||||
special: false, // 区段特殊显示
|
||||
},
|
||||
trainPosition:{
|
||||
display: false // 列车实时位置显示
|
||||
}
|
||||
};
|
||||
|
||||
@ -197,7 +200,7 @@ class SkinCode extends defaultStyle {
|
||||
this[deviceType.StationStand] = {
|
||||
common: { // 通用属性
|
||||
textFontSize: 11, // 站台默认字体大小
|
||||
functionButtonShow: [] // 功能灯按钮显示条件(prdType)
|
||||
functionButtonShow: '03' // 功能灯按钮显示条件(01所有模式下显示 02 行调显示 03现地显示)
|
||||
},
|
||||
safetyDoor: { // 屏蔽门
|
||||
height: 3, // 站台屏蔽门高度
|
||||
@ -269,13 +272,37 @@ class SkinCode extends defaultStyle {
|
||||
borderColor: '#FFFFFF' // 延迟解锁边框颜色
|
||||
}
|
||||
};
|
||||
this[deviceType.MapCycleButtonVO] = {
|
||||
// 是否显示
|
||||
visibleConditions: '03',
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
subtitleText: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 17 // 等于副标题距离
|
||||
},
|
||||
lamp: {
|
||||
lineDash: null, // 灯的包围框
|
||||
borderShow: false, // 是否显示边框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
},
|
||||
OutFrame: {
|
||||
|
||||
}
|
||||
};
|
||||
this[deviceType.Station] = {
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: true, // 公里标显示
|
||||
functionButtonShow: ['01'], // 功能灯按钮(引导总锁)显示条件(prdType)
|
||||
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
|
||||
kilometerPosition: 'up', // 公里标朝向
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
@ -439,7 +466,7 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.AutomaticRoute] = {
|
||||
// 是否显示
|
||||
displayCondition: [], // 显示条件 prdType
|
||||
displayCondition: '03', // 显示条件 prdType
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
|
@ -127,16 +127,19 @@ class SkinCode extends defaultStyle {
|
||||
color: '#3149C3' // 区段边界符颜色
|
||||
},
|
||||
block: {
|
||||
special: true, // 区段特殊显示
|
||||
special: true // 区段特殊显示
|
||||
},
|
||||
trainPosition:{
|
||||
display: false // 列车实时位置显示
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Signal] = {
|
||||
distance: 10, // 设备距离区段的距离
|
||||
post: {
|
||||
standardShow: true, // 灯柱显示
|
||||
standardLength: 4, // 高柱长度
|
||||
standardHeight: 5, // 灯柱高度
|
||||
standardShow: true, // 灯柱显示
|
||||
standardLength: 4, // 高柱长度
|
||||
standardHeight: 5, // 灯柱高度
|
||||
standardColor: '#3149C3', // 灯柱颜色
|
||||
standardWidth: 4 // 灯柱宽度
|
||||
},
|
||||
@ -152,7 +155,7 @@ class SkinCode extends defaultStyle {
|
||||
nameBorderShow: true // 信号机名字边框显示
|
||||
},
|
||||
lamp: {
|
||||
logicDisplayNone: true, // 逻辑点灯斜线不显示
|
||||
logicDisplayNone: true, // 逻辑点灯斜线不显示
|
||||
guidName: 'defult', // 默认引导类型
|
||||
stopWidth: 2, // 禁止线宽度
|
||||
borderWidth: 1, // 信号灯边框线宽度
|
||||
@ -200,7 +203,8 @@ class SkinCode extends defaultStyle {
|
||||
common: { // 通用属性
|
||||
textFontSize: 11, // 站台默认字体大小
|
||||
special: true, // 特殊站台
|
||||
functionButtonShow: [] // 功能灯按钮显示条件(prdType)
|
||||
haveJumpShow: true, // 站台是否有列车停跳显示
|
||||
functionButtonShow: '03' // 功能灯按钮显示条件(01所有模式下显示 02 行调显示 03现地显示)
|
||||
},
|
||||
safetyDoor: { // 屏蔽门
|
||||
height: 3, // 站台屏蔽门高度
|
||||
@ -211,7 +215,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
stand: { // 站台
|
||||
headFontSize: 11, // 站台首端字体大小
|
||||
textFill: '#fff', // 站台字体颜色
|
||||
textFill: '#fff', // 站台字体颜色
|
||||
spareColor: '#00ffff', // 站台空闲颜色
|
||||
stopColor: '#FEFE00', // 站台列车停站颜色
|
||||
jumpStopColor: '#9A99FF', // 站台跳停颜色
|
||||
@ -230,14 +234,23 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
detainCar: { // 扣车
|
||||
text: 'H', // 扣车显示内容
|
||||
fontSize: 18, // 扣车字体大小
|
||||
fontSize: 18, // 扣车字体大小
|
||||
position: -1, // 扣车方向
|
||||
offset: { x: -8, y: -6 }, // 扣车偏移量
|
||||
trainColor: '#E4EF50', // 车站扣车颜色
|
||||
centerTrainColor: '#FFFFFF', // 中心扣车颜色
|
||||
centerTrainColor: 'red', // 中心扣车颜色
|
||||
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
|
||||
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
|
||||
},
|
||||
jump: {
|
||||
text: '跳', // 停跳显示内容
|
||||
position: -1, // 停跳方向
|
||||
offset: { x: -8, y: 0 },
|
||||
textColor: '#0000FF', // 停跳文字颜色
|
||||
arcColor: '#0000FF', // 停跳圆圈颜色
|
||||
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
|
||||
r: 8 // 圆半径大小
|
||||
},
|
||||
stopTime: { // 停站时间
|
||||
position: 1, // 运行时间方向
|
||||
offset: { x: -8, y: 26 }, // 运行时间偏移量
|
||||
@ -255,7 +268,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
lampColor: '#5A5D5A' // 功能按钮颜色
|
||||
lampColor: '#5A5D5A' // 功能按钮颜色
|
||||
}
|
||||
};
|
||||
|
||||
@ -274,16 +287,40 @@ class SkinCode extends defaultStyle {
|
||||
borderColor: '#FFFFFF' // 延迟解锁边框颜色
|
||||
}
|
||||
};
|
||||
this[deviceType.MapCycleButtonVO] = {
|
||||
// 是否显示
|
||||
visibleConditions: '03',
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
subtitleText: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 17 // 等于副标题距离
|
||||
},
|
||||
lamp: {
|
||||
lineDash: null, // 灯的包围框
|
||||
borderShow: false, // 是否显示边框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
},
|
||||
OutFrame: {
|
||||
|
||||
}
|
||||
};
|
||||
this[deviceType.Station] = {
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: true, // 公里标显示
|
||||
functionButtonShow: ['01'], // 功能灯按钮(引导总锁)显示条件(prdType)
|
||||
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件
|
||||
kilometerPosition: 'up', // 公里标朝向
|
||||
text: {
|
||||
borderShow: true, // 车站包围框显示
|
||||
borderShow: true, // 车站包围框显示
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
@ -357,18 +394,18 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
sectionAction: {
|
||||
flag: true, // 道岔 关联区段显示
|
||||
spareColor: '#5b5b5b', // 区段显示颜色
|
||||
spareColor: '#5b5b5b', // 区段显示颜色 (灰色)
|
||||
},
|
||||
core: {
|
||||
splice: true, // 哈尔滨特殊显示
|
||||
splice: true, // 哈尔滨特殊显示
|
||||
length: 6 // 道岔单边长度
|
||||
},
|
||||
block: { // 道岔封锁配置
|
||||
blockName: 'default', // 默认道岔封锁类型
|
||||
blockName: 'default', // 默认道岔封锁类型
|
||||
nameBorderShow: false, // 道岔名称是否有包围框 显示
|
||||
contentRectShow: false, // 道岔封锁显示
|
||||
contentRectColor: '#fff', // 道岔封锁名称颜色
|
||||
rhomboidShow: true, // 道岔单独显示
|
||||
contentRectColor: '#fff', // 道岔封锁名称颜色
|
||||
rhomboidShow: true // 道岔单独显示
|
||||
},
|
||||
monolock: { // 道岔单锁配置
|
||||
locationColor: '#fff', // 道岔单锁定位颜色 (红色)
|
||||
@ -451,14 +488,14 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.AutomaticRoute] = {
|
||||
// 是否显示
|
||||
displayCondition: ['01'],
|
||||
displayCondition: '03',
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
}
|
||||
@ -488,6 +525,7 @@ class SkinCode extends defaultStyle {
|
||||
lrPadding: 1, // 两边间隔
|
||||
upPadding: 1, // 上边距离
|
||||
trainBodyFillColor: '#000000', // 列车车身填充颜色
|
||||
trainSidelineColor: '#FFFF00',
|
||||
trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式
|
||||
},
|
||||
hsda: {
|
||||
@ -500,11 +538,12 @@ class SkinCode extends defaultStyle {
|
||||
textAContent: '警' // textA文本
|
||||
},
|
||||
trainAtrStatus: {
|
||||
trainAtrStatusOffset: { x: 68, y: 9},
|
||||
trainAtrStatusOffset: { x: 74, y: 8},
|
||||
r: 5
|
||||
},
|
||||
travelSigns: {
|
||||
trainTravelSignsOffset: { x:3, y: 3}
|
||||
trainTravelLeftSignsOffset: { x:3, y: 3},
|
||||
trainTravelRightSignsOffset: { x: 62, y: 3}
|
||||
},
|
||||
delayTime: {
|
||||
trainDelayTimeOffset: { x:5, y: 14}
|
||||
@ -524,13 +563,15 @@ class SkinCode extends defaultStyle {
|
||||
trainServer: {
|
||||
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
||||
defaultServiceNumber: 'BB', // 默认服务号(表号)
|
||||
trainServerOffset: { x: 35, y: 3 }// 列车服务号偏移
|
||||
trainServerOffset: { x: 35, y: 3 }, // 列车服务号偏移
|
||||
fontColor: '#00C300'
|
||||
},
|
||||
trainTarget: {
|
||||
tripNumberPrefix: '000', // 车次号前缀
|
||||
defaultDirectionCode: '', // 默认车次号1
|
||||
defaultTripNumber: 'CCC', // 默认车次号2
|
||||
trainTargetOffset: { x: 10, y: 3 }// 列车车次号偏移
|
||||
trainTargetOffset: { x: 10, y: 3 }, // 列车车次号偏移
|
||||
fontColor: '#00C300'
|
||||
},
|
||||
trainTargetNumber: {
|
||||
groupNumberPrefix: '000', // 车组号前缀
|
||||
@ -543,7 +584,7 @@ class SkinCode extends defaultStyle {
|
||||
trainHeadTriangleSecond: { x: 4, y: 7.5 }, // 列车车头三角坐标2偏移量
|
||||
trainHeadTriangleThird: { x: 0, y: 15 }, // 列车车头三角坐标3偏移量
|
||||
trainHeadRectHeight: 15, // 列车车头矩形高度
|
||||
trainConntWidth: 4, // 列车竖杠的宽度
|
||||
trainConntWidth: 0, // 列车竖杠的宽度
|
||||
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
|
||||
},
|
||||
common: {
|
||||
@ -557,7 +598,7 @@ class SkinCode extends defaultStyle {
|
||||
fixedCoordinates: true, // 列车车组号等固定坐标
|
||||
trainHeight: 40, // 列车高度
|
||||
trainHeadDistance: 2, // 列车和车头之间的间距
|
||||
trainWidth: 76, // 列车长度
|
||||
trainWidth: 82, // 列车长度
|
||||
trainTextFontSize: 12, // 列车字号
|
||||
fontFamily: 'consolas', // 默认字体 族类
|
||||
nameFontSize: 12, // 字体大小
|
||||
|
@ -134,16 +134,19 @@ class SkinCode extends defaultStyle {
|
||||
color: 'white' // 区段边界符颜色
|
||||
},
|
||||
block: {
|
||||
special: false, // 区段特殊显示
|
||||
blockGlint: true, // 区段封锁闪烁显示
|
||||
special: false, // 区段特殊显示
|
||||
blockGlint: true // 区段封锁闪烁显示
|
||||
},
|
||||
trainPosition:{
|
||||
display: false // 列车实时位置显示
|
||||
}
|
||||
};
|
||||
|
||||
this[deviceType.Signal] = {
|
||||
distance: 8, // 设备距离区段的距离
|
||||
post: {
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardLength: 6, // 高柱长度
|
||||
standardHeight: 6, // 灯柱高度
|
||||
standardColor: '#C0C0C0', // 灯柱颜色
|
||||
standardWidth: 2 // 灯柱宽度
|
||||
},
|
||||
@ -205,7 +208,7 @@ class SkinCode extends defaultStyle {
|
||||
|
||||
this[deviceType.MapCycleButtonVO] = {
|
||||
// 是否显示
|
||||
visible: true,
|
||||
visibleConditions: '01',
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
@ -214,12 +217,13 @@ class SkinCode extends defaultStyle {
|
||||
subtitleText: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 17 // 等于副标题距离
|
||||
distance: 17 // 等于副标题距离
|
||||
},
|
||||
lamp: {
|
||||
lineDash: null, // 灯的包围框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
borderShow: true, // 是否显示边框
|
||||
lineDash: null, // 灯的包围框
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
},
|
||||
@ -231,8 +235,8 @@ class SkinCode extends defaultStyle {
|
||||
this[deviceType.StationStand] = {
|
||||
common: { // 通用属性
|
||||
textFontSize: 10, // 站台默认字体大小
|
||||
haveJumpShow: false , // 站台是否有列车停跳显示
|
||||
functionButtonShow: [] // 功能灯按钮显示条件(prdType)
|
||||
haveJumpShow: false, // 站台是否有列车停跳显示
|
||||
functionButtonShow: '03' // 功能灯按钮显示条件(01所有模式下显示 02 行调显示 03现地显示)
|
||||
},
|
||||
safetyDoor: { // 屏蔽门
|
||||
height: 3, // 站台屏蔽门高度
|
||||
@ -293,7 +297,7 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
lampColor: '#5A5D5A' // 功能按钮颜色
|
||||
lampColor: '#5A5D5A' // 功能按钮颜色
|
||||
}
|
||||
};
|
||||
|
||||
@ -318,7 +322,7 @@ class SkinCode extends defaultStyle {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: false, // 公里标显示
|
||||
functionButtonShow: ['01'], // 功能灯按钮(引导总锁)显示条件(prdType)
|
||||
functionButtonShow: '03', // 功能灯按钮(引导总锁)显示条件 01全部模式下显示 02 行调显示 03 现地显示
|
||||
kilometerPosition: 'up', // 公里标朝向
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
@ -353,7 +357,7 @@ class SkinCode extends defaultStyle {
|
||||
lamp: {
|
||||
count: 4, // 控制模式的个数
|
||||
offset: { x: 20, y: 0 }, // 偏移量
|
||||
radiusR: 5, // 控制模式灯的半径
|
||||
radiusR: 6, // 控制模式灯的半径
|
||||
distance: 46, // 控制模式之间灯之间的距离
|
||||
grayColor: '#C0C0C0', // 控制模式灰色
|
||||
greenColor: 'green', // 控制模式绿色
|
||||
@ -364,8 +368,8 @@ class SkinCode extends defaultStyle {
|
||||
substationControlShow: true, // 站控按钮显示
|
||||
interconnectedControlShow: false, // 联锁控显示
|
||||
centerControlButtonShow: true, // 中控显示
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
stroke: '#FFFFFF', // 框的颜色
|
||||
fill: 'rgba(0,0,0,0)' // 填充色
|
||||
},
|
||||
arrow: {
|
||||
show: false // 控制模式箭头显隐
|
||||
@ -384,12 +388,12 @@ class SkinCode extends defaultStyle {
|
||||
borderColor: '#FE0000', // 道岔边框颜色
|
||||
lossColor: 'lightgreen', // 道岔失去颜色
|
||||
locateColor: 'lightgreen', // 道岔定位颜色
|
||||
inversionColor: '#FFFF00', // 道岔反位颜色
|
||||
inversionColor: '#FFFF00', // 道岔反位颜色
|
||||
monolockColor: '#FFFFFF' // 道岔单锁颜色
|
||||
},
|
||||
sectionAction: {
|
||||
flag: false, // 道岔 关联区段显示
|
||||
spareColor: '#5b5b5b', // 区段显示颜色
|
||||
flag: false, // 道岔 关联区段显示
|
||||
spareColor: '#5b5b5b' // 区段显示颜色
|
||||
},
|
||||
core: {
|
||||
length: 10 // 道岔单边长度
|
||||
@ -398,13 +402,13 @@ class SkinCode extends defaultStyle {
|
||||
locationColor: '#FF0000', // 道岔单锁'定位'颜色 (红色)
|
||||
inversionColor: '#FF0000', // 道岔单锁'反位'颜色 (红色)
|
||||
rectShow: false, // 道岔单锁 矩形框是否显示
|
||||
arcShow: true, // 道岔单锁 圆形显示
|
||||
arcBorderColor: 'green', // 圆形单锁框边框颜色
|
||||
arcShow: true, // 道岔单锁 圆形显示
|
||||
arcBorderColor: 'green', // 圆形单锁框边框颜色
|
||||
rectWidth: 22, // 矩形框 宽高
|
||||
rectBorderColor: '#fff' // 矩形边框颜色
|
||||
},
|
||||
block: { // 道岔封锁配置
|
||||
blockName: 'ningbo_01', // 默认道岔封锁类型
|
||||
blockName: 'ningbo_01', // 默认道岔封锁类型
|
||||
nameBorderShow: true, // 道岔名称是否有包围框 显示
|
||||
contentRectShow: false, // 道岔封锁显示
|
||||
contentRectColor: 'red' // 道岔封锁边框颜色
|
||||
@ -454,14 +458,14 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
this[deviceType.AutomaticRoute] = {
|
||||
// 是否显示
|
||||
displayCondition: [], // 显示条件 prdType
|
||||
displayCondition: '03', // 显示条件 prdType
|
||||
text: {
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
distance: 5 // 灯跟文字距离
|
||||
},
|
||||
lamp: {
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
fill: 'rgba(0,0,0,0)', // 填充色
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
|
||||
}
|
||||
@ -488,10 +492,10 @@ class SkinCode extends defaultStyle {
|
||||
lrPaddingHSDA: 3, // HSDA两边间隔
|
||||
upPaddingHSDA: 4, // HSDA上边距离
|
||||
trainHSDATextFontSize: 8, // 列车HDSA字号
|
||||
textHContent: '扣', // textH文本
|
||||
textSContent: '跳', // textS文本
|
||||
textDContent: '门', // textD文本
|
||||
textAContent: '警' // textA文本
|
||||
textHContent: 'H', // textH文本
|
||||
textSContent: 'S', // textS文本
|
||||
textDContent: 'D', // textD文本
|
||||
textAContent: 'A' // textA文本
|
||||
},
|
||||
trainNumber: {
|
||||
targetCodePrefix: '000', // 目的地码前缀
|
||||
@ -613,33 +617,8 @@ class SkinCode extends defaultStyle {
|
||||
// trainRColor: '#A0522D'
|
||||
// }
|
||||
], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM
|
||||
runControlStatus: [
|
||||
{
|
||||
status: '01',
|
||||
hShow: false,
|
||||
sShow: false
|
||||
},
|
||||
{
|
||||
status: '02',
|
||||
hShow: true,
|
||||
sShow: false
|
||||
},
|
||||
{
|
||||
status: '03',
|
||||
hShow: false,
|
||||
sShow: true
|
||||
}
|
||||
], // 设置运行控制状态类型 01正常 02扣车 03停跳
|
||||
doorStatus: [
|
||||
{ status: true, dShow: false },
|
||||
{ status: false, dShow: true }
|
||||
], // 设置车门状态类型 true车门关闭且锁闭
|
||||
communicationStatus: [
|
||||
], // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL
|
||||
alarmStatus: [
|
||||
{ status: '01', aShow: false },
|
||||
{ status: '02', aShow: true }
|
||||
] // 设置报警状态 01不报警 02报警
|
||||
] // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { deepAssign } from '@/utils/index';
|
||||
// import deviceType from './deviceType';
|
||||
|
||||
// 所有默认状态在这里都要有 用来转换后台发送的数据状态
|
||||
class Status {
|
||||
@ -118,6 +119,9 @@ class Status {
|
||||
handleOutFrame(device) {
|
||||
this.statusObj = { };
|
||||
}
|
||||
handleText(device) {
|
||||
this.statusObj = { };
|
||||
}
|
||||
getStatus() {
|
||||
return this.statusObj;
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ class Jlmap {
|
||||
|
||||
this.$keyboardController = new KeyboardController(this);
|
||||
this.$keyboardController.enable();
|
||||
this.showConfig = opts.showConfig;
|
||||
}
|
||||
|
||||
loadStyle(lineCode) {
|
||||
@ -159,7 +160,7 @@ class Jlmap {
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||
const nDevice = deepAssign(oDevice || {}, elem);
|
||||
this.$painter.delete(oDevice);
|
||||
delete this.mapDevice[code];
|
||||
@ -246,9 +247,23 @@ class Jlmap {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
this.hookHandle(oDevice, elem)
|
||||
this.hookHandle(oDevice, elem);
|
||||
});
|
||||
}
|
||||
updateShowMode(list, showMode) {
|
||||
this.showConfig.showMode = showMode;
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||
oDevice.showMode = showMode;
|
||||
this.$painter.updateShowMode(oDevice);
|
||||
});
|
||||
this.$painter.$transformHandle.revisibleAll();
|
||||
}
|
||||
getShowConfig() {
|
||||
return this.showConfig;
|
||||
}
|
||||
update(list) {
|
||||
this.setUpdateMapDevice(list || []); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
|
||||
(list || []).forEach(elem => {
|
||||
@ -263,12 +278,12 @@ class Jlmap {
|
||||
this.$painter.update(signalDevice);
|
||||
}
|
||||
} else {
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||
if (elem.dispose) {
|
||||
this.$painter.delete(oDevice);
|
||||
} else {
|
||||
// if (this.hookHandle(oDevice, elem)) {
|
||||
this.$painter.update(oDevice);
|
||||
this.$painter.update(oDevice);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ class Painter {
|
||||
try {
|
||||
if (device._dispose) {
|
||||
this.delete(device);
|
||||
} else if (deviceType.Train == device._type) {
|
||||
} else if (deviceType.Train.toUpperCase() == device.deviceType) {
|
||||
this.updateTrain(device);
|
||||
} else {
|
||||
const instance = device.instance;
|
||||
@ -161,7 +161,14 @@ class Painter {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新显示模式
|
||||
*/
|
||||
updateShowMode(device) {
|
||||
if (device && device.instance) {
|
||||
device.instance.setShowMode();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 更新transform变化
|
||||
* @param {*} opt
|
||||
|
@ -6,6 +6,7 @@ import Arc from 'zrender/src/graphic/shape/Arc';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import EMouse from './EMouse';
|
||||
import {isShowThePrdType} from '../../utils/handlePath';
|
||||
|
||||
export default class Automactic extends Group {
|
||||
constructor(model, style) {
|
||||
@ -16,9 +17,14 @@ export default class Automactic extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
if (isShowThePrdType(model.prdType, style.MapCycleButtonVO.visibleConditions) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
if (model.previewOrMapDraw) {
|
||||
this.setShowMode();
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
@ -76,21 +82,24 @@ export default class Automactic extends Group {
|
||||
});
|
||||
this.add(this.subtitleText);
|
||||
}
|
||||
const arcRect = this.getArcBoundingRect();
|
||||
this.arcBorder = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
silent: true,
|
||||
shape: arcRect,
|
||||
style: {
|
||||
lineDash: this.style.MapCycleButtonVO.lamp.lineDash,
|
||||
stroke: this.style.MapCycleButtonVO.lamp.stroke,
|
||||
fill: this.style.MapCycleButtonVO.lamp.fill
|
||||
}
|
||||
});
|
||||
|
||||
if (this.style.MapCycleButtonVO.lamp.borderShow) {
|
||||
const arcRect = this.getArcBoundingRect();
|
||||
this.arcBorder = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
silent: true,
|
||||
shape: arcRect,
|
||||
style: {
|
||||
lineDash: this.style.MapCycleButtonVO.lamp.lineDash,
|
||||
stroke: this.style.MapCycleButtonVO.lamp.stroke,
|
||||
fill: this.style.MapCycleButtonVO.lamp.fill
|
||||
}
|
||||
});
|
||||
this.add(this.arcBorder);
|
||||
}
|
||||
this.add(this.control);
|
||||
this.add(this.text);
|
||||
this.add(this.arcBorder);
|
||||
}
|
||||
|
||||
// 设置状态
|
||||
@ -129,4 +138,19 @@ export default class Automactic extends Group {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
setShowMode() {
|
||||
const showMode = this.model.showMode;
|
||||
const showConditions = this.style.MapCycleButtonVO.visibleConditions;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.control.show();
|
||||
this.text.show();
|
||||
this.subtitleText && this.subtitleText.show();
|
||||
this.arcBorder && this.arcBorder.show();
|
||||
} else {
|
||||
this.control.hide();
|
||||
this.text.hide();
|
||||
this.subtitleText && this.subtitleText.hide();
|
||||
this.arcBorder && this.arcBorder.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group';
|
||||
import Arc from 'zrender/src/graphic/shape/Arc';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
import EMouse from './EMouse';
|
||||
import {isShowThePrdType} from '../../utils/handlePath';
|
||||
|
||||
export default class LcControl extends Group {
|
||||
constructor(model, style) {
|
||||
@ -15,18 +16,14 @@ export default class LcControl extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
const arr = window.location.href.split('?')[1].split('&');
|
||||
this.prdType = '';
|
||||
arr.forEach(elem => {
|
||||
if (elem.split('=')[0] === 'prdType') {
|
||||
this.prdType = elem.split('=')[1];
|
||||
}
|
||||
});
|
||||
if (!this.prdType || this.style.AutomaticRoute.displayCondition.indexOf(this.prdType) !== -1) {
|
||||
if (isShowThePrdType(model.prdType, style.AutomaticRoute.displayCondition) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
if (model.previewOrMapDraw) {
|
||||
this.setShowMode();
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
@ -111,4 +108,17 @@ export default class LcControl extends Group {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
setShowMode() {
|
||||
const showMode = this.model.showMode;
|
||||
const showConditions = this.style.AutomaticRoute.displayCondition;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.control.show();
|
||||
this.text.show();
|
||||
this.subtitleText && this.subtitleText.show();
|
||||
} else {
|
||||
this.control.hide();
|
||||
this.text.hide();
|
||||
this.subtitleText && this.subtitleText.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ export default class LcControl extends Group {
|
||||
cy: model.position.y,
|
||||
r: this.style.LcControl.lamp.radiusR
|
||||
},
|
||||
subType: 'Control',
|
||||
lineWidth: 0,
|
||||
fill: this.style.LcControl.lamp.controlColor
|
||||
},
|
||||
@ -75,4 +76,5 @@ export default class LcControl extends Group {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -6,77 +6,79 @@ import EControl from '../element/EControl';
|
||||
import EMouse from './EMouse';
|
||||
|
||||
export default class LimitControl extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this.selected = false;
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 20;
|
||||
this.create(model);
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this.selected = false;
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 20;
|
||||
this.create(model);
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
|
||||
create(model) {
|
||||
this.control = new EControl({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
arc: {
|
||||
shape: {
|
||||
cx: model.position.x,
|
||||
cy: model.position.y,
|
||||
r: this.style.LimitControl.lamp.radiusR
|
||||
},
|
||||
lineWidth: 0,
|
||||
fill: this.style.LimitControl.lamp.controlColor,
|
||||
mouseover: this.mouseoverArc,
|
||||
mouseout: this.mouseoutArc
|
||||
},
|
||||
text: {
|
||||
position: [0, 0],
|
||||
x: model.position.x,
|
||||
y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
|
||||
fontWeight: this.style.LimitControl.text.fontWeight,
|
||||
fontSize: this.style.LimitControl.text.fontSize,
|
||||
fontFamily: this.style.fontFamily,
|
||||
text: model.name,
|
||||
textFill: '#fff',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
mouseover: this.mouseoverText,
|
||||
mouseout: this.mouseoutText
|
||||
},
|
||||
style: this.style
|
||||
});
|
||||
create(model) {
|
||||
this.control = new EControl({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
arc: {
|
||||
shape: {
|
||||
cx: model.position.x,
|
||||
cy: model.position.y,
|
||||
r: this.style.LimitControl.lamp.radiusR
|
||||
},
|
||||
subType: 'Control',
|
||||
lineWidth: 0,
|
||||
fill: this.style.LimitControl.lamp.controlColor,
|
||||
mouseover: this.mouseoverArc,
|
||||
mouseout: this.mouseoutArc
|
||||
},
|
||||
text: {
|
||||
position: [0, 0],
|
||||
x: model.position.x,
|
||||
y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
|
||||
fontWeight: this.style.LimitControl.text.fontWeight,
|
||||
fontSize: this.style.LimitControl.text.fontSize,
|
||||
fontFamily: this.style.fontFamily,
|
||||
text: model.name,
|
||||
textFill: '#fff',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
mouseover: this.mouseoverText,
|
||||
mouseout: this.mouseoutText
|
||||
},
|
||||
style: this.style
|
||||
});
|
||||
|
||||
this.add(this.control);
|
||||
}
|
||||
this.add(this.control);
|
||||
}
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
}
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
if (this.style.LimitControl.mouseOverStyle) {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
createMouseEvent() {
|
||||
if (this.style.LimitControl.mouseOverStyle) {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
|
||||
getShapeTipPoint() {
|
||||
if (this.control) {
|
||||
var distance = 2;
|
||||
var rect = this.control.getBoundingRect();
|
||||
return {
|
||||
x: rect.x + rect.width / 2,
|
||||
y: rect.y - distance
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
getShapeTipPoint() {
|
||||
if (this.control) {
|
||||
var distance = 2;
|
||||
var rect = this.control.getBoundingRect();
|
||||
return {
|
||||
x: rect.x + rect.width / 2,
|
||||
y: rect.y - distance
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import {isShowThePrdType} from '../../utils/handlePath';
|
||||
|
||||
export default class Line2 extends Group {
|
||||
constructor(model, style) {
|
||||
@ -10,8 +11,13 @@ export default class Line2 extends Group {
|
||||
this.z = 0;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
if (model.previewOrMapDraw) {
|
||||
this.setShowMode();
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
@ -51,4 +57,18 @@ export default class Line2 extends Group {
|
||||
setState(model) {
|
||||
this.setLineType(model.type);
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
const showMode = this.model.showMode;
|
||||
const showConditions = this.model.showConditions;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.eachChild((child) => {
|
||||
child.show();
|
||||
});
|
||||
} else {
|
||||
this.eachChild((child) => {
|
||||
child.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import {isShowThePrdType} from '../../utils/handlePath';
|
||||
|
||||
export default class OutFrame extends Group {
|
||||
constructor(model, style) {
|
||||
@ -10,8 +11,13 @@ export default class OutFrame extends Group {
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 0;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
if (model.previewOrMapDraw) {
|
||||
this.setShowMode();
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
@ -38,4 +44,14 @@ export default class OutFrame extends Group {
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
const showMode = this.model.showMode;
|
||||
const showConditions = this.model.showConditions;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.box && this.box.show();
|
||||
} else {
|
||||
this.box && this.box.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ export default class Line2 extends Group {
|
||||
const style = this.style;
|
||||
this.safeDoor = new ESafeDoor({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
z: this.z + 1,
|
||||
style: style,
|
||||
x: model.position.x,
|
||||
y: model.position.y - (model.height / 2),
|
||||
@ -65,6 +65,9 @@ export default class Line2 extends Group {
|
||||
|
||||
setState(model) {
|
||||
/** 设置屏蔽门开关*/
|
||||
// if (model.name == 'Psd44') {
|
||||
// console.log(model, model.screenDoorOpenStatus, '1 为关门 0 为开门');
|
||||
// }
|
||||
model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/
|
||||
model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/
|
||||
|
||||
@ -93,4 +96,6 @@ export default class Line2 extends Group {
|
||||
this.on('mouseover', () => { this.highlight.mouseover(); });
|
||||
}
|
||||
}
|
||||
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -66,4 +66,5 @@ export default class Resource extends Group {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -51,6 +51,26 @@ export default class ESeparator extends Group {
|
||||
this.add(this.circle);
|
||||
}
|
||||
|
||||
createCircleArc() {
|
||||
const model = this.model;
|
||||
this.circleArc = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
cx: model.point.x,
|
||||
cy: model.point.y,
|
||||
r: this.style.Section.line.width + 2
|
||||
},
|
||||
style: {
|
||||
stroke: 'red',
|
||||
GBaseLineWidth: 0.5,
|
||||
fill: this.style.transparentColor
|
||||
}
|
||||
});
|
||||
this.add(this.circleArc);
|
||||
}
|
||||
|
||||
setType() {
|
||||
const type = this.model.sepType;
|
||||
const model = this.model;
|
||||
@ -80,6 +100,8 @@ export default class ESeparator extends Group {
|
||||
this.createModel(points, lineWidth, stroke);
|
||||
} else if (type === '04') { // 侵限分隔符
|
||||
this.createCircle();
|
||||
} else if (type === '05') { // 特色分隔符
|
||||
this.createCircleArc();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ import ETextName from '../element/ETextName'; // 名称文字 (共有)
|
||||
import ERelease from './ERelease'; // 线段 (共有)
|
||||
import ELimitLines from './ELimitLines'; // 区段限速 (私有)
|
||||
import ELines from './ELines'; // 创建多线条 曲线 (私有)
|
||||
import EblockLines from './EblockLines'; // 区段封锁特有
|
||||
import EblockLines from './EblockLines'; // 区段封锁特有
|
||||
import ESeparator from './ESeparator'; // 分隔符 (私有)
|
||||
import EMouse from './EMouse';
|
||||
import { EAxle } from './EAxle'; // 创建计轴 (私有)
|
||||
@ -577,7 +577,7 @@ export default class Section extends Group {
|
||||
recover() {
|
||||
if (this.section) {
|
||||
this.section.stopAnimation(true);
|
||||
this.sectionBlock && this.sectionBlock.hide(); // 因此特殊区段
|
||||
this.sectionBlock && this.sectionBlock.hide(); // 因此特殊区段
|
||||
this.section.setStyle({
|
||||
fill: this.style.backgroundColor,
|
||||
stroke: this.style.Section.line.spareColor,
|
||||
@ -591,6 +591,7 @@ export default class Section extends Group {
|
||||
this.remove(this.speedLimitLeft);
|
||||
this.remove(this.speedLimitRight);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -781,18 +782,24 @@ export default class Section extends Group {
|
||||
}
|
||||
|
||||
/** 设置状态*/
|
||||
setState(model) {
|
||||
setState(model, flag = false) {
|
||||
this.recover();
|
||||
// 实际上就是 状态重置 必须在设置其他状态之前 设置颜色之类的
|
||||
if (this.style.Switch.sectionAction.flag && model.relSwitchCode) {
|
||||
if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) {
|
||||
const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode];
|
||||
// const switchModel = store.getters['map/getDeviceByCode'](model.relSwitchCode);
|
||||
// if (switchModel.name == 'D1801' || switchModel.name == 'D1802' || switchModel.name == 'D1803' || switchModel.name == 'D1804') {
|
||||
// console.log('switchModel', switchModel, switchModel.name, switchModel.normalPosition, '1 定位 0 反位');
|
||||
// }
|
||||
if (switchModel.normalPosition != 0) { // 定位情况
|
||||
const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode];
|
||||
sectionC && sectionC.instance && sectionC.instance.section.setStyle({ stroke: this.style.Switch.sectionAction.spareColor });
|
||||
const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode];
|
||||
sectionB && sectionB.instance && sectionB.instance.setState(sectionB, true);
|
||||
} else if (switchModel.normalPosition == 0) { // 反位情况
|
||||
const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode];
|
||||
sectionB && sectionB.instance && sectionB.instance.section.setStyle({ stroke: this.style.Switch.sectionAction.spareColor });
|
||||
const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode];
|
||||
sectionC && sectionC.instance && sectionC.instance.setState(sectionC, true);
|
||||
}
|
||||
}
|
||||
/** 道岔保护区段锁闭 */
|
||||
@ -856,7 +863,7 @@ export default class Section extends Group {
|
||||
if (this.selectedType === type) {
|
||||
return;
|
||||
}
|
||||
if (selected && !this.selectedType) {
|
||||
if (selected && type) {
|
||||
this.section && this.section.setStyle({ stroke: drawSectionStyle[type] });
|
||||
} else {
|
||||
this.section && this.section.setStyle({ stroke: this.style.Section.line.spareColor });
|
||||
@ -879,5 +886,5 @@ export default class Section extends Group {
|
||||
mouseover() {
|
||||
this.section && this.section.setStyle({ stroke: 'rgba(255,255,255,0.8)' });
|
||||
}
|
||||
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -588,6 +588,7 @@ class Signal extends Group {
|
||||
});
|
||||
}
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
||||
export default Signal;
|
||||
|
@ -10,6 +10,7 @@ import EArrow from './EArrow';
|
||||
import { arrow } from '../utils/ShapePoints';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
import {isShowThePrdType} from '../../utils/handlePath';
|
||||
|
||||
export default class Station extends Group {
|
||||
constructor(model, style) {
|
||||
@ -20,18 +21,15 @@ export default class Station extends Group {
|
||||
this.z = 40;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
const arr = window.location.href.split('?')[1].split('&');
|
||||
this.prdType = '';
|
||||
arr.forEach(elem => {
|
||||
if (elem.split('=')[0] === 'prdType') {
|
||||
this.prdType = elem.split('=')[1];
|
||||
}
|
||||
});
|
||||
|
||||
this.create();
|
||||
this.createTurnBack(); // 创建按图折返
|
||||
if (!this.prdType || style.Station.functionButtonShow.indexOf(this.prdType) !== -1) {
|
||||
if (isShowThePrdType(model.prdType, style.Station.functionButtonShow) || model.previewOrMapDraw) {
|
||||
this.createGuideTotalLock(); // 创建引导总锁
|
||||
}
|
||||
if (model.previewOrMapDraw) {
|
||||
this.setShowMode();
|
||||
}
|
||||
this.createControlMode();
|
||||
this.setState(model);
|
||||
this.checkIsDrawMap();
|
||||
@ -120,15 +118,18 @@ export default class Station extends Group {
|
||||
if (model.guideTotalLock) {
|
||||
this.guideLamp = new EControl({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
z: 1000,
|
||||
arc: {
|
||||
shape: {
|
||||
cx: model.guideTotalLockPoint.x,
|
||||
cy: model.guideTotalLockPoint.y,
|
||||
r: style.Station.lamp.radiusR
|
||||
},
|
||||
subType: 'GuideLamp',
|
||||
lineWidth: 0,
|
||||
fill: style.Station.lamp.guideColor
|
||||
fill: style.Station.lamp.guideColor,
|
||||
onmouseover: this.guideMouseOver,
|
||||
onmouseout: this.guideMouseOut
|
||||
},
|
||||
text: {
|
||||
position: [0, 0],
|
||||
@ -312,26 +313,26 @@ export default class Station extends Group {
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
switch (model.controlMode) {
|
||||
case '': // 无状态
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case 'Center': // 中控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
break;
|
||||
case 'Local': // 站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case 'Emergency': // 紧急站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case '': // 无状态
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case 'Center': // 中控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
break;
|
||||
case 'Local': // 站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case 'Emergency': // 紧急站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -367,4 +368,14 @@ export default class Station extends Group {
|
||||
this.on('mouseover', () => { this.EMouse.mouseover(); });
|
||||
}
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
const showMode = this.model.showMode;
|
||||
const showConditions = this.style.Station.functionButtonShow;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.guideLamp && this.guideLamp.show();
|
||||
} else {
|
||||
this.guideLamp && this.guideLamp.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -178,4 +178,5 @@ export default class StationControl extends Group {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -86,5 +86,6 @@ export default class StationCounter extends Group {
|
||||
getShapeTipPoint() {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
||||
|
@ -104,4 +104,5 @@ export default class StationDelayUnlock extends Group {
|
||||
getShapeTipPoint() {
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ class EDetain extends Group {
|
||||
this.model = model;
|
||||
this.isNew = false;
|
||||
this.detain = null;
|
||||
if (this.model.style.StationStand.common.special) {
|
||||
this.create('E');
|
||||
}
|
||||
// if (this.model.style.StationStand.common.special) {
|
||||
this.create();
|
||||
// }
|
||||
}
|
||||
|
||||
create(textName) {
|
||||
@ -90,8 +90,13 @@ class EDetain extends Group {
|
||||
this.detain.hide();
|
||||
}
|
||||
|
||||
show() {
|
||||
this.create('H');
|
||||
show(nameText) {
|
||||
if (this.model.style.StationStand.common.special && nameText) {
|
||||
this.create();
|
||||
this.detain.setStyle('text', nameText);
|
||||
} else {
|
||||
this.create();
|
||||
}
|
||||
this.detain.show();
|
||||
}
|
||||
}
|
||||
|
@ -11,43 +11,84 @@ class EJump extends Group {
|
||||
this.setStatus(model.allSkip, model.assignSkip);
|
||||
}
|
||||
|
||||
create() {
|
||||
create(textName) {
|
||||
if (!this.isNew) {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
|
||||
this.isNew = true;
|
||||
this.jump = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
style: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
fontWeight: 'normal',
|
||||
fontSize: style.StationStand.common.textFontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
text: style.StationStand.jump.text,
|
||||
textFill: style.StationStand.jump.textColor,
|
||||
textAlign: model.textAlign,
|
||||
textVerticalAlign: model.textVerticalAlign
|
||||
if (style.StationStand.common.special) {
|
||||
// inside true 内侧
|
||||
const gag = 22;
|
||||
const gagX = 6; // 左右间隔
|
||||
let height = '';
|
||||
let position = '';
|
||||
if (model.right) {
|
||||
if (model.inside) {
|
||||
height = -gag;
|
||||
position = -model.width / 4 - gagX;
|
||||
} else {
|
||||
height = gag;
|
||||
position = model.width / 4 + gagX;
|
||||
}
|
||||
} else {
|
||||
if (model.inside) {
|
||||
height = gag;
|
||||
position = model.width / 4 + gagX;
|
||||
} else {
|
||||
height = -gag;
|
||||
position = -model.width / 4 - gagX;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.jumpArc = new Arc({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
cx: model.cx,
|
||||
cy: model.cy,
|
||||
r: style.StationStand.jump.r
|
||||
},
|
||||
style: {
|
||||
stroke: style.StationStand.jump.arcColor,
|
||||
fill: style.StationStand.jump.fillColor
|
||||
}
|
||||
});
|
||||
this.add(this.jumpArc);
|
||||
this.add(this.jump);
|
||||
this.jumpArc.hide();
|
||||
this.jump = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: model.x + position,
|
||||
y: model.y + height,
|
||||
text: textName,
|
||||
textAlign: 'center',
|
||||
fontWeight: 'blod',
|
||||
fontSize: `${style.StationStand.detainCar.fontSize} px ${style.fontFamily}`,
|
||||
textFill: textName == 'S' ? 'green' : '#fff',
|
||||
textVerticalAlign: 'middle'
|
||||
}
|
||||
});
|
||||
this.add(this.jump);
|
||||
} else {
|
||||
this.jump = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
style: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
fontWeight: 'normal',
|
||||
fontSize: style.StationStand.common.textFontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
text: style.StationStand.jump.text,
|
||||
textFill: style.StationStand.jump.textColor,
|
||||
textAlign: model.textAlign,
|
||||
textVerticalAlign: model.textVerticalAlign
|
||||
}
|
||||
});
|
||||
this.jumpArc = new Arc({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
cx: model.cx,
|
||||
cy: model.cy,
|
||||
r: style.StationStand.jump.r
|
||||
},
|
||||
style: {
|
||||
stroke: style.StationStand.jump.arcColor,
|
||||
fill: style.StationStand.jump.fillColor
|
||||
}
|
||||
});
|
||||
this.add(this.jumpArc);
|
||||
this.add(this.jump);
|
||||
this.jumpArc.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,11 +97,13 @@ class EJump extends Group {
|
||||
this.jump.setStyle('text', val);
|
||||
}
|
||||
setStatus(allSkip, assignSkip) {
|
||||
this.jumpArc.hide();
|
||||
if (assignSkip) {
|
||||
this.jumpArc.hide(); // 指定站台跳停
|
||||
} else if (allSkip) {
|
||||
this.jumpArc.show(); // 站台全部跳停
|
||||
if (this.jumpArc) {
|
||||
this.jumpArc.hide();
|
||||
if (assignSkip) {
|
||||
this.jumpArc.hide(); // 指定站台跳停
|
||||
} else if (allSkip) {
|
||||
this.jumpArc.show(); // 站台全部跳停
|
||||
}
|
||||
}
|
||||
}
|
||||
setColor(color) {
|
||||
@ -73,8 +116,13 @@ class EJump extends Group {
|
||||
this.jump.hide();
|
||||
}
|
||||
|
||||
show() {
|
||||
this.create();
|
||||
show(nameText) {
|
||||
if (this.model.style.StationStand.common.special && nameText) {
|
||||
this.create();
|
||||
this.jump.setStyle('text', nameText);
|
||||
} else {
|
||||
this.create();
|
||||
}
|
||||
this.jump.show();
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import EHighlight from '../element/EHighlight';
|
||||
import ETrainStop from './ETrainStop';
|
||||
import ETrainDepart from './ETrainDepart';
|
||||
import EControl from '../element/EControl';
|
||||
import {isShowThePrdType} from '../../utils/handlePath';
|
||||
|
||||
class StationStand extends Group {
|
||||
constructor(model, style) {
|
||||
@ -23,18 +24,14 @@ class StationStand extends Group {
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 1;
|
||||
this.doors = new Group();
|
||||
const arr = window.location.href.split('?')[1].split('&');
|
||||
this.prdType = '';
|
||||
arr.forEach(elem => {
|
||||
if (elem.split('=')[0] === 'prdType') {
|
||||
this.prdType = elem.split('=')[1];
|
||||
}
|
||||
});
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
if (!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1 ) {
|
||||
if (isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow) || model.previewOrMapDraw) {
|
||||
this.createFunctionButton();
|
||||
}
|
||||
if (model.previewOrMapDraw) {
|
||||
this.setShowMode();
|
||||
}
|
||||
this.setVisible(model.visible);
|
||||
this.setState(model);
|
||||
this.checkIsDrawMap();
|
||||
@ -179,10 +176,14 @@ class StationStand extends Group {
|
||||
/** 列车停跳 */
|
||||
if (style.StationStand.common.haveJumpShow) {
|
||||
const jumpDirct = model.right ? -1 : 1;
|
||||
const jumpX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
|
||||
const jumpY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
|
||||
let jumpX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
|
||||
let jumpY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
|
||||
const jumpCX = model.position.x - jumpDirct * (style.StationStand.jump.offset.x - model.width / 2);
|
||||
const jumpCY = model.position.y + jumpDirct * style.StationStand.jump.offset.y;
|
||||
if (style.StationStand.common.special) {
|
||||
jumpX = model.position.x;
|
||||
jumpY = model.position.y;
|
||||
}
|
||||
this.jump = new EJump({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 1,
|
||||
@ -191,6 +192,9 @@ class StationStand extends Group {
|
||||
y: jumpY,
|
||||
cx: jumpCX,
|
||||
cy: jumpCY,
|
||||
width: model.width,
|
||||
inside: model.inside,
|
||||
right: model.right,
|
||||
textAlign: 'center',
|
||||
textVerticalAlign: 'middle',
|
||||
allSkip: model.allSkip,
|
||||
@ -229,6 +233,7 @@ class StationStand extends Group {
|
||||
cy: model.stopJumpLampPoint.y,
|
||||
r: style.Station.lamp.radiusR
|
||||
},
|
||||
subType: 'StopJumpLamp',
|
||||
lineWidth: 0,
|
||||
fill: style.StationStand.lamp.lampColor
|
||||
},
|
||||
@ -258,6 +263,7 @@ class StationStand extends Group {
|
||||
cy: model.cancelStopJumpLampPoint.y,
|
||||
r: style.Station.lamp.radiusR
|
||||
},
|
||||
subType: 'CancelStopJumpLamp',
|
||||
lineWidth: 0,
|
||||
fill: style.StationStand.lamp.lampColor
|
||||
},
|
||||
@ -287,6 +293,7 @@ class StationStand extends Group {
|
||||
cy: model.upDetainLampPoint.y,
|
||||
r: style.Station.lamp.radiusR
|
||||
},
|
||||
subType: 'UpDetainLamp',
|
||||
lineWidth: 0,
|
||||
fill: style.StationStand.lamp.lampColor
|
||||
},
|
||||
@ -316,6 +323,7 @@ class StationStand extends Group {
|
||||
cy: model.downDetainLampPoint.y,
|
||||
r: style.Station.lamp.radiusR
|
||||
},
|
||||
subType: 'DownDetainLamp',
|
||||
lineWidth: 0,
|
||||
fill: style.StationStand.lamp.lampColor
|
||||
},
|
||||
@ -326,7 +334,7 @@ class StationStand extends Group {
|
||||
fontWeight: style.StationStand.text.fontWeight,
|
||||
fontSize: style.StationStand.text.fontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
text: '上行扣车',
|
||||
text: '下行扣车',
|
||||
textFill: '#fff',
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
@ -348,9 +356,9 @@ class StationStand extends Group {
|
||||
recover() {
|
||||
this.time && this.time.hide();
|
||||
this.level && this.level.hide();
|
||||
if (!this.style.StationStand.common.special) {
|
||||
this.detain && this.detain.hide();
|
||||
}
|
||||
// if (!this.style.StationStand.common.special) {
|
||||
this.detain && this.detain.hide();
|
||||
// }
|
||||
this.emergent && this.emergent.hide();
|
||||
this.trainStop && this.trainStop.hide(); // 列车停站
|
||||
this.trainDepart && this.trainDepart.hide();
|
||||
@ -381,6 +389,10 @@ class StationStand extends Group {
|
||||
if (!this.style.StationStand.common.special) {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
|
||||
}
|
||||
if (this.style.StationStand.common.special) {
|
||||
this.detain && this.detain.show('E');
|
||||
this.detain && this.detain.setColor('#fff');
|
||||
}
|
||||
this.emergent && this.emergent.show();
|
||||
if (this.style.StationStand.standEmergent.flicker) {
|
||||
this.emergent.getElement().animateStyle(true)
|
||||
@ -394,7 +406,12 @@ class StationStand extends Group {
|
||||
/** 指定列车跳站*/
|
||||
designatedJumpStop() {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.designatedJumpStopColor);
|
||||
this.jump && this.jump.show();
|
||||
if (this.style.StationStand.common.special) {
|
||||
this.jump && this.jump.show('S');
|
||||
this.jump && this.jump.setColor('green');
|
||||
} else {
|
||||
this.jump && this.jump.show();
|
||||
}
|
||||
this.jump && this.jump.setStatus(0, 1);
|
||||
}
|
||||
|
||||
@ -407,25 +424,42 @@ class StationStand extends Group {
|
||||
/** 站台跳停*/
|
||||
jumpStop() {
|
||||
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.jumpStopColor);
|
||||
this.jump && this.jump.show();
|
||||
if (this.style.StationStand.common.special) {
|
||||
this.jump && this.jump.show('S');
|
||||
this.jump && this.jump.setColor('green');
|
||||
} else {
|
||||
this.jump && this.jump.show();
|
||||
}
|
||||
this.jump && this.jump.setStatus(1, 0);
|
||||
}
|
||||
|
||||
/** 车站扣车*/
|
||||
standDetainTrain() {
|
||||
this.detain && this.detain.show();
|
||||
if (this.style.StationStand.common.special) {
|
||||
this.detain && this.detain.show('H');
|
||||
} else {
|
||||
this.detain && this.detain.show();
|
||||
}
|
||||
this.detain && this.detain.setColor(this.style.StationStand.detainCar.detainTrainTextColor);
|
||||
}
|
||||
|
||||
/** 中心扣车*/
|
||||
centerDetainTrain() {
|
||||
this.detain && this.detain.show();
|
||||
if (this.style.StationStand.common.special) {
|
||||
this.detain && this.detain.show('H');
|
||||
} else {
|
||||
this.detain && this.detain.show();
|
||||
}
|
||||
this.detain && this.detain.setColor(this.style.StationStand.detainCar.centerTrainColor);
|
||||
}
|
||||
|
||||
/** 中心+车站扣车*/
|
||||
standAndCenterDetainTrain() {
|
||||
this.detain && this.detain.show();
|
||||
if (this.style.StationStand.common.special) {
|
||||
this.detain && this.detain.show('H');
|
||||
} else {
|
||||
this.detain && this.detain.show();
|
||||
}
|
||||
this.detain && this.detain.setColor(this.style.StationStand.detainCar.andCenterTrainColor);
|
||||
}
|
||||
|
||||
@ -473,11 +507,12 @@ class StationStand extends Group {
|
||||
}
|
||||
|
||||
/** 设置跳停*/
|
||||
// this.unJumpStop(); // 未设置跳停
|
||||
model.assignSkip && this.designatedJumpStop(); // 指定站台跳停
|
||||
// model.allSkip = 1;
|
||||
model.assignSkip && this.designatedJumpStop(); // 指定列车跳停
|
||||
model.allSkip && this.jumpStop(); // 站台全部跳停
|
||||
|
||||
/** 设置扣车*/
|
||||
// model.centerHoldTrain = 1;
|
||||
if (model.stationHoldTrain && model.centerHoldTrain) {
|
||||
this.standAndCenterDetainTrain(); // 中心+车站扣车
|
||||
} else if (model.stationHoldTrain) {
|
||||
@ -530,5 +565,21 @@ class StationStand extends Group {
|
||||
this.on('mouseover', () => { this.highlight.mouseover(); });
|
||||
}
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
const showMode = this.model.showMode;
|
||||
const showConditions = this.style.StationStand.common.functionButtonShow;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.stopJumpLampButton && this.stopJumpLampButton.show();
|
||||
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.show();
|
||||
this.upDetainLamp && this.upDetainLamp.show();
|
||||
this.downDetainLamp && this.downDetainLamp.show();
|
||||
} else {
|
||||
this.stopJumpLampButton && this.stopJumpLampButton.hide();
|
||||
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.hide();
|
||||
this.upDetainLamp && this.upDetainLamp.hide();
|
||||
this.downDetainLamp && this.downDetainLamp.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default StationStand;
|
||||
|
@ -201,7 +201,7 @@ export default class Switch extends Group {
|
||||
stroke: this.style.Switch.monolock.rectBorderColor,
|
||||
fill: this.style.transparentColor
|
||||
});
|
||||
|
||||
|
||||
this.lockArc = new ELockArc({ // 锁定矩形
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 6,
|
||||
@ -264,7 +264,7 @@ export default class Switch extends Group {
|
||||
/** 恢复状态*/
|
||||
recover() {
|
||||
this.lockRect.hide(); // 矩形包围框
|
||||
this.lockArc.hide(); // 圆形单锁框
|
||||
this.lockArc.hide(); // 圆形单锁框
|
||||
this.setSwitchCoreColor(this.style.backgroundColor);
|
||||
this.name.getNameText().stopAnimation(false);
|
||||
this.swCore.stopAnimation(false);
|
||||
@ -441,6 +441,16 @@ export default class Switch extends Group {
|
||||
model.blockade && this.block();
|
||||
/** 区段切除*/
|
||||
model.cutOff && this.setSwitchCutOff();
|
||||
if (this.style.Switch.sectionAction.flag) {
|
||||
const switchModel = Vue.prototype.$jlmap.mapDevice[model.code];
|
||||
if (switchModel.normalPosition != 0) { // 定位情况
|
||||
const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode];
|
||||
sectionC && sectionC.instance && sectionC.instance.setState(sectionC);
|
||||
} else if (switchModel.normalPosition == 0) { // 反位情况
|
||||
const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode];
|
||||
sectionB && sectionB.instance && sectionB.instance.setState(sectionB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getBoundingRect() {
|
||||
@ -472,4 +482,5 @@ export default class Switch extends Group {
|
||||
this.on('mouseover', () => { this.highlight.mouseover(); });
|
||||
}
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -1,44 +1,60 @@
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import {isShowThePrdType} from '../../utils/handlePath';
|
||||
|
||||
export default class Text2 extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.name = model.code;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 6;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.name = model.code;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 6;
|
||||
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
if (model.previewOrMapDraw) {
|
||||
this.setShowMode();
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
var model = this.model;
|
||||
var [direction, content] = model.content.split('::');
|
||||
if (direction == 'V') {
|
||||
content = content.split('').join('\n');
|
||||
} else if (direction != 'H') {
|
||||
content = model.content;
|
||||
}
|
||||
create() {
|
||||
var model = this.model;
|
||||
var [direction, content] = model.content.split('::');
|
||||
if (direction == 'V') {
|
||||
content = content.split('').join('\n');
|
||||
} else if (direction != 'H') {
|
||||
content = model.content;
|
||||
}
|
||||
|
||||
this.text = new Text({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
text: content,
|
||||
textFont: model.font,
|
||||
textFill: model.fontColor,
|
||||
textAlign: 'middle'
|
||||
}
|
||||
});
|
||||
this.add(this.text);
|
||||
}
|
||||
this.text = new Text({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
text: content,
|
||||
textFont: model.font,
|
||||
textFill: model.fontColor,
|
||||
textAlign: 'middle'
|
||||
}
|
||||
});
|
||||
this.add(this.text);
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
}
|
||||
setState(model) {
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
const showMode = this.model.showMode;
|
||||
const showConditions = this.model.showConditions;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.text && this.text.show();
|
||||
} else {
|
||||
this.text && this.text.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,9 +27,9 @@ class EMouse extends Group {
|
||||
}
|
||||
let text = '';
|
||||
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.targetCode ? this.device.model.targetCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.runControlStatus == '01' ? 'Normal' : this.device.model.runControlStatus == '03' ? 'Skip to continue moving' : 'Detained'}\n Stationary: ${this.device.model.runStatus == '02' ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
|
||||
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.targetCode ? this.device.model.targetCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${!this.device.model.hold ? 'Normal' : 'Detained'}\n \n 跳停状态: ${!this.device.model.jump ? 'Normal' : 'Skip to continue moving'}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 {
|
||||
text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;
|
||||
text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? 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`;
|
||||
}
|
||||
// 文字描述
|
||||
this.arrowText = new Text({
|
||||
|
51
src/jmapNew/shape/Train/ETriangle.js
Normal file
51
src/jmapNew/shape/Train/ETriangle.js
Normal file
@ -0,0 +1,51 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
|
||||
/** 创建三角形*/
|
||||
export default class ETriangle extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.z;
|
||||
this.create(model);
|
||||
}
|
||||
|
||||
create(model) {
|
||||
if (model && model.point) {
|
||||
const right = model.right == 1 ? 1 : -1;
|
||||
this.angle = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
points:[[model.point.x + 10 * right, model.point.y], [model.point.x, model.point.y - 6], [model.point.x, model.point.y + 6]]
|
||||
},
|
||||
style: {
|
||||
stroke:'#FFFF00',
|
||||
lineWidth: 0.5,
|
||||
fill: '#FFFF00'
|
||||
}
|
||||
});
|
||||
this.add(this.angle);
|
||||
}
|
||||
}
|
||||
|
||||
updateTriangle(model, right) {
|
||||
const trainRight = right == 1 ? 1 : -1;
|
||||
const data = [[model.x + 10 * trainRight, model.y], [model.x, model.y - 6], [model.x, model.y + 6]];
|
||||
// this.angle.shape.points.push([model.x + 10 * trainRight, model.y]);
|
||||
// this.angle.attr('shape', { points: this.angle.shape.points });
|
||||
this.angle.attr({
|
||||
shape: {
|
||||
points:data
|
||||
}
|
||||
});
|
||||
this.angle.animateTo({
|
||||
shape: {
|
||||
points:data
|
||||
}
|
||||
}, 10, 0, 'elasticOut', function () {
|
||||
});
|
||||
this.dirty();
|
||||
}
|
||||
}
|
@ -5,167 +5,167 @@ import ETextName from '../element/ETextName'; // 名称文字 (共有)
|
||||
import EMouse from './EMouse';
|
||||
import store from '@/store';
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
import BoundingRect from "zrender/src/core/BoundingRect";
|
||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
|
||||
/** 车身*/
|
||||
export default class TrainBody extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.deviceModel = model.model;
|
||||
this.nameFormat = model.nameFormat;
|
||||
this.create();
|
||||
this.createMouse(); // 鼠标事件
|
||||
}
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.deviceModel = model.model;
|
||||
this.nameFormat = model.nameFormat;
|
||||
this.create();
|
||||
this.createMouse(); // 鼠标事件
|
||||
}
|
||||
|
||||
createMouse() {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
if (this.deviceModel.down) {
|
||||
store.dispatch('map/setTrainDetails', this.deviceModel);
|
||||
this.mouseEvent.mouseover();
|
||||
}
|
||||
createMouse() {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
if (this.deviceModel.down) {
|
||||
store.dispatch('map/setTrainDetails', this.deviceModel);
|
||||
this.mouseEvent.mouseover();
|
||||
}
|
||||
|
||||
this.on('mouseover', () => {
|
||||
store.dispatch('map/setTrainDetails', this.deviceModel);
|
||||
this.mouseEvent.mouseover();
|
||||
});
|
||||
this.on('mouseout', () => {
|
||||
store.dispatch('map/setTrainDetails', null);
|
||||
this.mouseEvent.mouseout();
|
||||
});
|
||||
}
|
||||
this.on('mouseover', () => {
|
||||
store.dispatch('map/setTrainDetails', this.deviceModel);
|
||||
this.mouseEvent.mouseover();
|
||||
});
|
||||
this.on('mouseout', () => {
|
||||
store.dispatch('map/setTrainDetails', null);
|
||||
this.mouseEvent.mouseout();
|
||||
});
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
this.trainBodyBox = new TrainBodyBox({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
point: model.point,
|
||||
style: style
|
||||
});
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
this.trainBodyBox = new TrainBodyBox({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
point: model.point,
|
||||
style: style
|
||||
});
|
||||
|
||||
const beginX = (model.point.x + style.Train.trainBody.lrPadding);
|
||||
const beginY = (model.point.y - style.Train.hsda.trainHSDATextFontSize - style.Train.hsda.upPaddingHSDA);
|
||||
const margin = (style.Train.common.trainWidth - style.Train.hsda.lrPaddingHSDA * 2) / 4;
|
||||
const beginX = (model.point.x + style.Train.trainBody.lrPadding);
|
||||
const beginY = (model.point.y - style.Train.hsda.trainHSDATextFontSize - style.Train.hsda.upPaddingHSDA);
|
||||
const margin = (style.Train.common.trainWidth - style.Train.hsda.lrPaddingHSDA * 2) / 4;
|
||||
|
||||
this.textH = style.Train.common.haveTextHSDA ? new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
x: parseInt(beginX + margin * 0),
|
||||
y: parseInt(beginY),
|
||||
text: style.Train.hsda.textHContent,
|
||||
textFill: style.trainYellowColor,
|
||||
fontSize: style.Train.hsda.trainHSDATextFontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}) : '';
|
||||
this.textS = style.Train.common.haveTextHSDA ? new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
x: parseInt(beginX + margin * 1),
|
||||
y: parseInt(beginY),
|
||||
text: style.Train.hsda.textSContent,
|
||||
textFill: style.trainBlueColor,
|
||||
fontSize: style.Train.hsda.trainHSDATextFontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}) : '';
|
||||
this.textD = style.Train.common.haveTextHSDA ? new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
x: parseInt(beginX + margin * 2),
|
||||
y: parseInt(beginY),
|
||||
text: style.Train.hsda.textDContent,
|
||||
textFill: style.trainGreenColor,
|
||||
fontSize: style.Train.hsda.trainHSDATextFontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}) : '';
|
||||
this.textA = style.Train.common.haveTextHSDA ? new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
x: parseInt(beginX + margin * 3),
|
||||
y: parseInt(beginY),
|
||||
text: style.Train.hsda.textAContent,
|
||||
textFill: style.trainRedColor,
|
||||
fontSize: style.Train.hsda.trainHSDATextFontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}) : '';
|
||||
const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号)
|
||||
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
|
||||
?(model.directionCode||style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
|
||||
:model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号
|
||||
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.targetCode || style.Train.trainNumber.defaultTargetCode) + ''; // 目的地码
|
||||
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber) + ''; // 车组号
|
||||
this.textTrainServer = new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z+1,
|
||||
x: parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.trainServer.trainServerOffset.y),
|
||||
text: serviceNumber.substring(serviceNumber.length - style.Train.trainServer.serviceNumberPrefix.length),
|
||||
textFill: style.trainTextColor,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'left',
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.textTrainTarget = new ETextName({
|
||||
zlevel: this.model.zlevel,
|
||||
z: this.model.z+1,
|
||||
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
|
||||
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
|
||||
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length),
|
||||
textFill: style.trainTextColor,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: style.Train.trainTarget.trainTargetTextAlign,
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.textTrainNumber = new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z+1,
|
||||
x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y),
|
||||
text: targetCode.substring(targetCode.length - 3),
|
||||
textFill: style.trainTextColor,
|
||||
textStroke: style.trainTextColor,
|
||||
fontWeight: 400,
|
||||
textStrokeWidth: 0,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'left',
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.textTrainTargetNumber = new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z+1,
|
||||
x: parseInt(model.point.x + style.Train.trainTargetNumber.trainTargetNumberOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.trainTargetNumber.trainTargetNumberOffset.y),
|
||||
text: groupNumber.substring(groupNumber.length - 3),
|
||||
textFill: style.trainTextColor,
|
||||
textStroke: style.trainTextColor,
|
||||
textStrokeWidth: 0,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'left',
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.formatChangePosition(model, style);
|
||||
this.add(this.trainBodyBox);
|
||||
if (style.Train.common.haveTextHSDA) {
|
||||
this.add(this.textH);
|
||||
this.add(this.textS);
|
||||
this.add(this.textD);
|
||||
this.add(this.textA);
|
||||
}
|
||||
if (style.Train.common.hasAtrStatus) {
|
||||
this.textH = style.Train.common.haveTextHSDA ? new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
x: parseInt(beginX + margin * 0),
|
||||
y: parseInt(beginY),
|
||||
text: style.Train.hsda.textHContent,
|
||||
textFill: style.trainYellowColor,
|
||||
fontSize: style.Train.hsda.trainHSDATextFontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}) : '';
|
||||
this.textS = style.Train.common.haveTextHSDA ? new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
x: parseInt(beginX + margin * 1),
|
||||
y: parseInt(beginY),
|
||||
text: style.Train.hsda.textSContent,
|
||||
textFill: style.trainBlueColor,
|
||||
fontSize: style.Train.hsda.trainHSDATextFontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}) : '';
|
||||
this.textD = style.Train.common.haveTextHSDA ? new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
x: parseInt(beginX + margin * 2),
|
||||
y: parseInt(beginY),
|
||||
text: style.Train.hsda.textDContent,
|
||||
textFill: style.trainGreenColor,
|
||||
fontSize: style.Train.hsda.trainHSDATextFontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}) : '';
|
||||
this.textA = style.Train.common.haveTextHSDA ? new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
x: parseInt(beginX + margin * 3),
|
||||
y: parseInt(beginY),
|
||||
text: style.Train.hsda.textAContent,
|
||||
textFill: style.trainRedColor,
|
||||
fontSize: style.Train.hsda.trainHSDATextFontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
}) : '';
|
||||
const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号)
|
||||
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
|
||||
? (model.directionCode || style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
|
||||
: model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号
|
||||
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.targetCode || style.Train.trainNumber.defaultTargetCode) + ''; // 目的地码
|
||||
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber) + ''; // 车组号
|
||||
this.textTrainServer = new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
x: parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.trainServer.trainServerOffset.y),
|
||||
text: serviceNumber.substring(serviceNumber.length - style.Train.trainServer.serviceNumberPrefix.length),
|
||||
textFill: model.style.Train.trainServer.fontColor || style.trainTextColor,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'left',
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.textTrainTarget = new ETextName({
|
||||
zlevel: this.model.zlevel,
|
||||
z: this.model.z + 1,
|
||||
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
|
||||
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
|
||||
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length),
|
||||
textFill: model.style.Train.trainTarget.fontColor || style.trainTextColor,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: style.Train.trainTarget.trainTargetTextAlign,
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.textTrainNumber = new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y),
|
||||
text: targetCode.substring(targetCode.length - 3),
|
||||
textFill: style.trainTextColor,
|
||||
textStroke: style.trainTextColor,
|
||||
fontWeight: 400,
|
||||
textStrokeWidth: 0,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'left',
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.textTrainTargetNumber = new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
x: parseInt(model.point.x + style.Train.trainTargetNumber.trainTargetNumberOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.trainTargetNumber.trainTargetNumberOffset.y),
|
||||
text: groupNumber.substring(groupNumber.length - 3),
|
||||
textFill: style.trainTextColor,
|
||||
textStroke: style.trainTextColor,
|
||||
textStrokeWidth: 0,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: style.Train.common.fontFamily,
|
||||
textAlign: 'left',
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.formatChangePosition(model, style);
|
||||
this.add(this.trainBodyBox);
|
||||
if (style.Train.common.haveTextHSDA) {
|
||||
this.add(this.textH);
|
||||
this.add(this.textS);
|
||||
this.add(this.textD);
|
||||
this.add(this.textA);
|
||||
}
|
||||
if (style.Train.common.hasAtrStatus) {
|
||||
this.atrStatus = new Circle({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
@ -178,16 +178,18 @@ export default class TrainBody extends Group {
|
||||
fill: '#ff0000'
|
||||
}
|
||||
});
|
||||
this.add(this.atrStatus);
|
||||
// this.add(this.atrStatus);
|
||||
}
|
||||
if (style.Train.common.hasTravelSigns) {
|
||||
const travelSignsOffsetX = this.deviceModel.right ? style.Train.travelSigns.trainTravelRightSignsOffset.x : style.Train.travelSigns.trainTravelLeftSignsOffset.x;
|
||||
const travelSignsOffsetY = this.deviceModel.right ? style.Train.travelSigns.trainTravelRightSignsOffset.y : style.Train.travelSigns.trainTravelLeftSignsOffset.y;
|
||||
this.travelSigns = new ETextName({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
x: parseInt(model.point.x + style.Train.travelSigns.trainTravelSignsOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.travelSigns.trainTravelSignsOffset.y),
|
||||
text: '<',
|
||||
textFill: style.trainTextColor,
|
||||
x: parseInt(model.point.x + travelSignsOffsetX),
|
||||
y: parseInt(model.point.y + travelSignsOffsetY),
|
||||
text: this.deviceModel.right ? '>' : '<',
|
||||
textFill: '#00C300',
|
||||
textStroke: style.trainTextColor,
|
||||
textStrokeWidth: 0,
|
||||
fontSize: model.fontSize,
|
||||
@ -221,7 +223,7 @@ export default class TrainBody extends Group {
|
||||
x: parseInt(model.point.x + style.Train.travelNum.trainTravelNumOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.travelNum.trainTravelNumOffset.y),
|
||||
text: 'AA',
|
||||
textFill: style.trainTextColor,
|
||||
textFill: '#00C300',
|
||||
textStroke: style.trainTextColor,
|
||||
textStrokeWidth: 0,
|
||||
fontSize: model.fontSize,
|
||||
@ -238,7 +240,7 @@ export default class TrainBody extends Group {
|
||||
x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x),
|
||||
y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y),
|
||||
text: '0',
|
||||
textFill: style.trainTextColor,
|
||||
textFill: '#DADA00',
|
||||
textStroke: style.trainTextColor,
|
||||
textStrokeWidth: 0,
|
||||
fontSize: model.fontSize,
|
||||
@ -248,55 +250,55 @@ export default class TrainBody extends Group {
|
||||
});
|
||||
this.add(this.delayTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
removeTrainDetail() {
|
||||
this.mouseEvent.mouseout();
|
||||
store.dispatch('map/setTrainDetails', null);
|
||||
this.deviceModel.down = false;
|
||||
}
|
||||
setTrainColor(color) {
|
||||
this.trainBodyBox && this.trainBodyBox.setStyle('fill', color);
|
||||
}
|
||||
setTextTrainServerColor(color) {
|
||||
this.textTrainServer&&this.textTrainServer.setStyle('textFill', color);
|
||||
this.textTrainServer&&this.textTrainServer.setStyle('textStroke', color);
|
||||
}
|
||||
setTextTrainTargetColor(color) {
|
||||
this.textTrainTarget&&this.textTrainTarget.setStyle('textFill', color);
|
||||
this.textTrainTarget&&this.textTrainTarget.setStyle('textStroke', color);
|
||||
}
|
||||
setTextTrainNumberColor(color) {
|
||||
this.textTrainNumber&&this.textTrainNumber.setStyle('textFill', color);
|
||||
this.textTrainNumber&&this.textTrainNumber.setStyle('textStroke', color);
|
||||
}
|
||||
setTextTrainTargetNumberColor(color) {
|
||||
this.textTrainTargetNumber&&this.textTrainTargetNumber.setStyle('textFill', color);
|
||||
this.textTrainTargetNumber&&this.textTrainTargetNumber.setStyle('textStroke', color);
|
||||
}
|
||||
setHShow(isShow) {
|
||||
if (this.textH) {
|
||||
isShow ? this.textH.show() : this.textH.hide();
|
||||
}
|
||||
}
|
||||
setSShow(isShow) {
|
||||
if (this.textS) {
|
||||
isShow ? this.textS.show() : this.textS.hide();
|
||||
}
|
||||
}
|
||||
setDShow(isShow) {
|
||||
if (this.textD) {
|
||||
isShow ? this.textD.show() : this.textD.hide();
|
||||
}
|
||||
}
|
||||
setAShow(isShow) {
|
||||
if (this.textA) {
|
||||
isShow ? this.textA.show() : this.textA.hide();
|
||||
}
|
||||
}
|
||||
setBodyBoxShape(key, color) {
|
||||
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
|
||||
}
|
||||
removeTrainDetail() {
|
||||
this.mouseEvent.mouseout();
|
||||
store.dispatch('map/setTrainDetails', null);
|
||||
this.deviceModel.down = false;
|
||||
}
|
||||
setTrainColor(color) {
|
||||
this.trainBodyBox && this.trainBodyBox.setStyle('fill', color);
|
||||
}
|
||||
setTextTrainServerColor(color) {
|
||||
this.textTrainServer && this.textTrainServer.setStyle('textFill', color);
|
||||
this.textTrainServer && this.textTrainServer.setStyle('textStroke', color);
|
||||
}
|
||||
setTextTrainTargetColor(color) {
|
||||
this.textTrainTarget && this.textTrainTarget.setStyle('textFill', color);
|
||||
this.textTrainTarget && this.textTrainTarget.setStyle('textStroke', color);
|
||||
}
|
||||
setTextTrainNumberColor(color) {
|
||||
this.textTrainNumber && this.textTrainNumber.setStyle('textFill', color);
|
||||
this.textTrainNumber && this.textTrainNumber.setStyle('textStroke', color);
|
||||
}
|
||||
setTextTrainTargetNumberColor(color) {
|
||||
this.textTrainTargetNumber && this.textTrainTargetNumber.setStyle('textFill', color);
|
||||
this.textTrainTargetNumber && this.textTrainTargetNumber.setStyle('textStroke', color);
|
||||
}
|
||||
setHShow(isShow) {
|
||||
if (this.textH) {
|
||||
isShow ? this.textH.show() : this.textH.hide();
|
||||
}
|
||||
}
|
||||
setSShow(isShow) {
|
||||
if (this.textS) {
|
||||
isShow ? this.textS.show() : this.textS.hide();
|
||||
}
|
||||
}
|
||||
setDShow(isShow) {
|
||||
if (this.textD) {
|
||||
isShow ? this.textD.show() : this.textD.hide();
|
||||
}
|
||||
}
|
||||
setAShow(isShow) {
|
||||
if (this.textA) {
|
||||
isShow ? this.textA.show() : this.textA.hide();
|
||||
}
|
||||
}
|
||||
setBodyBoxShape(key, color) {
|
||||
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
|
||||
}
|
||||
getBoundingRect() {
|
||||
let rect = null;
|
||||
this.eachChild(elem => {
|
||||
@ -313,29 +315,29 @@ export default class TrainBody extends Group {
|
||||
});
|
||||
return rect || new BoundingRect(0, 0, 0, 0);
|
||||
}
|
||||
formatChangePosition(model, style) {
|
||||
if (this.nameFormat) {
|
||||
const arr = this.nameFormat.split(':');
|
||||
let widthText = 0;
|
||||
arr.forEach(ele => {
|
||||
if (ele == 'targetCode') {
|
||||
formatChangePosition(model, style) {
|
||||
if (this.nameFormat) {
|
||||
const arr = this.nameFormat.split(':');
|
||||
let widthText = 0;
|
||||
arr.forEach(ele => {
|
||||
if (ele == 'targetCode') {
|
||||
!style.Train.common.fixedCoordinates && this.textTrainNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset) );
|
||||
widthText += this.textTrainNumber.getBoundingRect().width;
|
||||
this.add(this.textTrainNumber);
|
||||
} else if (ele == 'serviceNumber') {
|
||||
widthText += this.textTrainNumber.getBoundingRect().width;
|
||||
this.add(this.textTrainNumber);
|
||||
} else if (ele == 'serviceNumber') {
|
||||
!style.Train.common.fixedCoordinates && this.textTrainServer.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
|
||||
widthText += this.textTrainServer.getBoundingRect().width;
|
||||
this.add(this.textTrainServer);
|
||||
} else if (ele == 'tripNumber') {
|
||||
widthText += this.textTrainServer.getBoundingRect().width;
|
||||
this.add(this.textTrainServer);
|
||||
} else if (ele == 'tripNumber') {
|
||||
!style.Train.common.fixedCoordinates && this.textTrainTarget.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
|
||||
widthText += this.textTrainTarget.getBoundingRect().width;
|
||||
this.add(this.textTrainTarget);
|
||||
} else if (ele == 'groupNumber') {
|
||||
widthText += this.textTrainTarget.getBoundingRect().width;
|
||||
this.add(this.textTrainTarget);
|
||||
} else if (ele == 'groupNumber') {
|
||||
!style.Train.common.fixedCoordinates && this.textTrainTargetNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset));
|
||||
widthText += this.textTrainTargetNumber.getBoundingRect().width;
|
||||
this.add(this.textTrainTargetNumber);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
widthText += this.textTrainTargetNumber.getBoundingRect().width;
|
||||
this.add(this.textTrainTargetNumber);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ import TrainHead from './TrainHead';
|
||||
import TrainBody from './TrainBody';
|
||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import ETriangle from '../Train/ETriangle';
|
||||
import store from '@/store';
|
||||
|
||||
/** 列车 */
|
||||
export default class Train extends Group {
|
||||
@ -29,7 +31,7 @@ export default class Train extends Group {
|
||||
});
|
||||
}
|
||||
this.create();
|
||||
this.setState(model);
|
||||
this.setState(model, this);
|
||||
}
|
||||
|
||||
_computed() {
|
||||
@ -41,9 +43,11 @@ export default class Train extends Group {
|
||||
y: model.trainWindowModel.point.y
|
||||
};
|
||||
if (model.right) {
|
||||
this.point.x = this.point.x + model.trainWindowModel.width / 2 - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth;
|
||||
this.point.x = this.point.x - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2;
|
||||
this.point.y = this.point.y - style.Train.common.trainHeight / 2;
|
||||
} else {
|
||||
this.point.x = this.point.x - model.trainWindowModel.width / 2 + style.Train.trainHead.trainConntWidth * this.newScale;
|
||||
this.point.x = this.point.x + style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2;
|
||||
this.point.y = this.point.y + model.trainWindowModel.height - style.Train.common.trainHeight / 2;
|
||||
}
|
||||
} else {
|
||||
this.point = model.position;
|
||||
@ -69,7 +73,6 @@ export default class Train extends Group {
|
||||
directionType: model.directionType,
|
||||
directionCode: model.directionCode,
|
||||
sectionModel: model.sectionModel,
|
||||
runControlStatus: model.runControlStatus,
|
||||
runStatus: model.runStatus,
|
||||
fontSize: this.fontSize,
|
||||
nameFormat: this.nameFormat,
|
||||
@ -102,6 +105,22 @@ export default class Train extends Group {
|
||||
scale: this.newScale
|
||||
});
|
||||
|
||||
const data = this.model.physicalCode;
|
||||
const oldmodel = store.getters['map/getDeviceByCode'](data);
|
||||
const leftPoint = oldmodel.points[0];
|
||||
const rightPoint = oldmodel.points[oldmodel.points.length - 1];
|
||||
const right = this.model.right == 1 ? 1 : 0;
|
||||
this.startX = leftPoint.x + (1 - right) * (rightPoint.x - leftPoint.x);
|
||||
this.startY = leftPoint.y + (1 - right) * (rightPoint.y - leftPoint.y);
|
||||
this.triangle = new ETriangle({
|
||||
style: this.style,
|
||||
zlevel: this.zlevel,
|
||||
z:10,
|
||||
right: this.model.right,
|
||||
point:{x:this.startX, y:this.startY}
|
||||
});
|
||||
this.add(this.triangle);
|
||||
|
||||
this.add(this.trainB);
|
||||
this.add(this.trainL);
|
||||
this.add(this.trainR);
|
||||
@ -115,6 +134,25 @@ export default class Train extends Group {
|
||||
getShapeTipPoint() {
|
||||
}
|
||||
|
||||
updateSection() {
|
||||
const train = this.model;
|
||||
if (train.physicalCode && train.offsetp) {
|
||||
const data = train.physicalCode;
|
||||
const oldmodel = store.getters['map/getDeviceByCode'](data);
|
||||
const leftPoint = oldmodel.points[0];
|
||||
const rightPoint = oldmodel.points[oldmodel.points.length - 1];
|
||||
if (this.triangle) {
|
||||
this.startX = leftPoint.x + (rightPoint.x - leftPoint.x) * train.offsetp;
|
||||
this.startY = leftPoint.y + (rightPoint.y - leftPoint.y) * train.offsetp;
|
||||
const point = {x:this.startX, y:this.startY};
|
||||
this.triangle.point = point;
|
||||
this.triangle.updateTriangle(point, train.right);
|
||||
this.triangle.dirty();
|
||||
this.dirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 恢复颜色状态
|
||||
recover() {
|
||||
this.trainB && this.trainB.setHShow(false);
|
||||
@ -238,27 +276,35 @@ export default class Train extends Group {
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置运行控制状态类型
|
||||
setRunControlStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.runControlStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.runControlStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setHShow(item.hShow);
|
||||
this.trainB && this.trainB.setSShow(item.sShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// 设置扣车状态
|
||||
setHoldStatus(status) {
|
||||
if (status) {
|
||||
this.trainB && this.trainB.setHShow(true);
|
||||
} else {
|
||||
this.trainB && this.trainB.setHShow(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置跳停状态
|
||||
setJumpStatus(status) {
|
||||
if (status) {
|
||||
this.trainB && this.trainB.setSShow(true);
|
||||
} else {
|
||||
this.trainB && this.trainB.setSShow(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置车门状态类型
|
||||
setDoorStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.doorStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.doorStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setDShow(item.dShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (status != undefined) {
|
||||
if (status) {
|
||||
this.trainB && this.trainB.setDShow(false);
|
||||
} else {
|
||||
this.trainB && this.trainB.setDShow(true);
|
||||
}
|
||||
} else {
|
||||
this.trainB && this.trainB.setDShow(false);
|
||||
}
|
||||
}
|
||||
// 设置通信状态类型
|
||||
@ -274,13 +320,10 @@ export default class Train extends Group {
|
||||
}
|
||||
// 设置报警状态
|
||||
setAlarmStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.alarmStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.alarmStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setAShow(item.aShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (status) {
|
||||
this.trainB && this.trainB.setAShow(true);
|
||||
} else {
|
||||
this.trainB && this.trainB.setAShow(false);
|
||||
}
|
||||
}
|
||||
setTrainTypeStatus(type) {
|
||||
@ -296,7 +339,7 @@ export default class Train extends Group {
|
||||
}
|
||||
}
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
setState(model, object) {
|
||||
const flag = model.trainWindowModel ? model.trainWindowModel.reversal : false;
|
||||
if (model) {
|
||||
this.recover();
|
||||
@ -309,6 +352,14 @@ export default class Train extends Group {
|
||||
this.setCommunicationStatus(model.runLevel);
|
||||
// this.setTrainTypeStatus(model.type); 配合早晚点设置
|
||||
this.setDoorStatus(model.doorCloseLock);
|
||||
this.setAlarmStatus(model.alarmStatus);
|
||||
this.setHoldStatus(model.hold);
|
||||
this.setJumpStatus(model.jump);
|
||||
|
||||
const style = this.style;
|
||||
if (style.Section.trainPosition.display) {
|
||||
this.updateSection(object);
|
||||
}
|
||||
}
|
||||
// let points = [];
|
||||
// if (model) {
|
||||
@ -396,4 +447,5 @@ export default class Train extends Group {
|
||||
|
||||
this.add(this.trainBorder);
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ class TrainWindow extends Group {
|
||||
getInstanceByCode(code) {
|
||||
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
||||
export default TrainWindow;
|
||||
|
@ -31,6 +31,7 @@ export default class ZcControl extends Group {
|
||||
cy: model.position.y,
|
||||
r: this.style.ZcControl.lamp.radiusR
|
||||
},
|
||||
subType: 'Control',
|
||||
lineWidth: 0,
|
||||
fill: this.style.ZcControl.lamp.controlColor,
|
||||
mouseover: this.mouseoverArc,
|
||||
@ -79,4 +80,5 @@ export default class ZcControl extends Group {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -30,4 +30,5 @@ export default class checkBox extends Group {
|
||||
});
|
||||
this.add(this.box);
|
||||
}
|
||||
setShowMode() {}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export default class EControl extends Group {
|
||||
|
||||
create() {
|
||||
this.control = new Arc({
|
||||
_subType: 'Control',
|
||||
_subType: this.arcStyle.subType,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: this.arcStyle.shape,
|
||||
@ -30,7 +30,6 @@ export default class EControl extends Group {
|
||||
onmouseover: this.arcStyle.mouseover,
|
||||
onmouseout: this.arcStyle.mouseout
|
||||
});
|
||||
|
||||
this.text = new Text({
|
||||
_subType: 'Text',
|
||||
zlevel: this.zlevel,
|
||||
@ -103,4 +102,12 @@ export default class EControl extends Group {
|
||||
this.text.setStyle('textFill', color);
|
||||
}
|
||||
}
|
||||
hide() {
|
||||
this.control.hide();
|
||||
this.text.hide();
|
||||
}
|
||||
show() {
|
||||
this.control.show();
|
||||
this.text.show();
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ export default {
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 信号关灯
|
||||
@ -169,7 +169,7 @@ export default {
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 信号重开
|
||||
@ -189,7 +189,7 @@ export default {
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 取消
|
||||
|
@ -137,7 +137,7 @@ export default {
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
@ -306,7 +306,7 @@ export default {
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 进路交自动控
|
||||
@ -329,7 +329,7 @@ export default {
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
|
@ -1,157 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="beijing-01__systerm route-lock" :title="title" :visible.sync="show" width="340px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>车站名称</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>信号机名称</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>信号按钮列表</span>
|
||||
<el-table ref="table" :data="tempData" border style="width: 100%" size="mini" highlight-current-row
|
||||
:height="140">
|
||||
<el-table-column prop="name" label="按钮名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="按钮状态">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
|
||||
export default {
|
||||
name: 'RouteLock',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
tempData: [],
|
||||
operate: null,
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.lock.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '封锁信号按钮'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
//入股不是断点激活,而是第一次显示需要初始化
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
/** status 04:封锁*/
|
||||
let signal = (selected || {}).state;
|
||||
this.tempData = [{ code: selected.code, name: selected.name, status: signal.status != '04' ? '未封锁' : '封锁' }]
|
||||
let timer = setInterval(() => {
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.setCurrentRow(this.tempData[0]);
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
// mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.lock.menu.operation
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -195,7 +195,7 @@ export default {
|
||||
// 设置新选的进路区段为切除状态
|
||||
row.routeSectionList.forEach(elem => {
|
||||
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
|
||||
if (section.logicSectionCodeList && section.logicSectionCodeList.length){
|
||||
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
|
||||
section.logicSectionCodeList.forEach(item => {
|
||||
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item));
|
||||
sec.cutOff = true;
|
||||
@ -246,7 +246,7 @@ export default {
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -1,435 +1,455 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="beijing-01__systerm section-cmd-control" :title="title" :visible.sync="show" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">命令信息</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option v-for="option in typeList" :key="option.code" :label="option.name"
|
||||
:value="option.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="车站名称" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="区段名称" label-width="100px">
|
||||
<el-input v-model="sectionName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
|
||||
highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="50" label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" :width="160" label="时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="context" :width="180" label="执行过程">
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" label="执行结果">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="notice">{{message}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
|
||||
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
|
||||
v-show="timeCountConfirm>0">({{timeCountConfirm}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdClose" @click="close">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm section-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">命令信息</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option
|
||||
v-for="option in typeList"
|
||||
:key="option.code"
|
||||
:label="option.name"
|
||||
:value="option.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="车站名称" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="区段名称" label-width="100px">
|
||||
<el-input v-model="sectionName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
class="table"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
height="200"
|
||||
>
|
||||
<el-table-column prop="order" :width="50" label="序号" />
|
||||
<el-table-column prop="date" :width="160" label="时间" />
|
||||
<el-table-column prop="context" :width="180" label="执行过程" />
|
||||
<el-table-column prop="result" label="执行结果" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
|
||||
v-show="timeCountConfirm>0"
|
||||
>({{ timeCountConfirm }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdClose" @click="close">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import { now } from '@/utils/date';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import { now } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'SectionCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
sectionName: ''
|
||||
export default {
|
||||
name: 'SectionCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
sectionName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Section.unlock.menu.operation, name: '区段解封' },
|
||||
{ code: OperationEvent.Section.fault.menu.operation, name: '区段故障解锁' },
|
||||
{ code: OperationEvent.Section.axlePreReset.menu.operation, name: '区段计轴预复位' }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.order.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Section.unlock.menu.operation, name: '区段解封' },
|
||||
{ code: OperationEvent.Section.fault.menu.operation, name: '区段故障解锁' },
|
||||
{ code: OperationEvent.Section.axlePreReset.menu.operation, name: '区段计轴预复位' },
|
||||
]
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return '区段解封';
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return '区段故障解锁';
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
return '区段计轴预复位';
|
||||
}
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm1.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && 1 <= index && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm2.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.stop.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
let section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name
|
||||
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation || '';
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return '区段故障解锁';
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
return '区段计轴预复位';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
this.setMessage('请点击“下达”按钮,下达命令!');
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && index >= 1 && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name;
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name;
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation || '';
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage('请点击“下达”按钮,下达命令!');
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation ||
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation ||
|
||||
this.operation == OperationEvent.Section.unlock.menu.operation ||
|
||||
this.operation == OperationEvent.Section.cancelSpeed.menu.operation ||
|
||||
this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.order.operation
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.order.operation
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.order.operation
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认1”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认2”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm2.operation;
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
stop() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
close() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
})
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.order.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认1”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认2”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm2.operation;
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
};
|
||||
</script>
|
||||
|
@ -77,9 +77,7 @@ export default {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
return '区段封锁';
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
this.radio = '2';
|
||||
return '区段控制';
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
@ -129,10 +127,7 @@ export default {
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
/** 区段封锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
/** 轨道区段切除*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
@ -140,16 +135,6 @@ export default {
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
over:true,
|
||||
operation: OperationEvent.Section.lock.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SWITCH_SINGLE_LOCK
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 轨道区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
@ -197,7 +182,7 @@ export default {
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -159,23 +159,6 @@ export default {
|
||||
return '提前发车';
|
||||
}
|
||||
return '';
|
||||
// this.earlyDepar = false;
|
||||
// if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
// this.radio1 = '1';
|
||||
// return '扣车';
|
||||
// } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
// this.radio1 = '2';
|
||||
// return '取消扣车';
|
||||
// } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
// this.earlyDepar = true;
|
||||
// if (this.selected.direction == '01') {
|
||||
// this.radio2 = '2';
|
||||
// } else {
|
||||
// this.radio2 = '1';
|
||||
// }
|
||||
// return '提前发车';
|
||||
// }
|
||||
// return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -309,7 +292,7 @@ export default {
|
||||
this.$refs.noticeInfo.doShow(operate, [error.message]);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
|
@ -1,180 +0,0 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__systerm stand-detain-train-all" :title="title" :visible.sync="show" width="340px" :before-close="doClose"
|
||||
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray; ">
|
||||
<span class="base-label">范围</span>
|
||||
<el-row>
|
||||
<el-radio-group v-model="upDown" @change="choose">
|
||||
<el-col :span="10">
|
||||
<el-radio label="02" :id="upDown == '01' ? domIdChoose : ''">上行全线</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="8">
|
||||
<el-radio label="01" :id="upDown == '02' ? domIdChoose : ''">下行全线</el-radio>
|
||||
</el-col>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<span>扣车站台列表(中心设置)</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" empty-text="所有站台都无扣车状态!" height="160" highlight-current-row>
|
||||
<el-table-column prop="stationName" label="车站名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="standName" :width="140" label="扣车站台">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrainAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
upDown: '01',
|
||||
tempData: [],
|
||||
disabled: true,
|
||||
operation: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList',
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
// if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.menu.operation) {
|
||||
if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) {
|
||||
return '全线取消扣车';
|
||||
} else {
|
||||
return '全线取消跳停';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadTableData() {
|
||||
this.tempData = [];
|
||||
this.stationStandList.forEach(elem => {
|
||||
/** status 01: 未扣车*/
|
||||
let stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).state;
|
||||
let station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {}).model;
|
||||
if (station && stand && stand.holdStatus != '01' && Number(elem.direction) === Number(this.upDown)) {
|
||||
this.tempData.push({ stationName: station.name, standName: elem.name });
|
||||
}
|
||||
});
|
||||
|
||||
//如果存在未扣车的情况,才可以做此操作
|
||||
if (this.tempData.length > 0) {
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
//不是断点激活的菜单应该将状态初始化
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.upDown = selected.direction;
|
||||
this.loadTableData();
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
choose(upDown) {
|
||||
//重新设置扣车站台
|
||||
this.loadTableData();
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
|
||||
val: `${upDown}`,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
|
||||
val: this.upDown,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,459 +1,472 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="beijing-01__systerm switch-cmd-control" :title="title" :visible.sync="show" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">命令信息</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option v-for="option in typeList" :key="option.code" :label="option.name"
|
||||
:value="option.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="车站名称" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="道岔名称" label-width="80px">
|
||||
<el-input v-model="switchName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
|
||||
highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="50" label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" :width="160" label="时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="context" :width="180" label="执行过程">
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" label="执行结果">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="notice">{{message}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
|
||||
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
|
||||
v-show="timeCountConfirm>0">({{timeCountConfirm}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdClose" @click="close">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm switch-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">命令信息</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option
|
||||
v-for="option in typeList"
|
||||
:key="option.code"
|
||||
:label="option.name"
|
||||
:value="option.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="车站名称" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="道岔名称" label-width="80px">
|
||||
<el-input v-model="switchName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
class="table"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
height="200"
|
||||
>
|
||||
<el-table-column prop="order" :width="50" label="序号" />
|
||||
<el-table-column prop="date" :width="160" label="时间" />
|
||||
<el-table-column prop="context" :width="180" label="执行过程" />
|
||||
<el-table-column prop="result" label="执行结果" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
|
||||
v-show="timeCountConfirm>0"
|
||||
>({{ timeCountConfirm }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdClose" @click="close">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import { now } from '@/utils/date';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import { now } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'SwitchCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
switchName: ''
|
||||
export default {
|
||||
name: 'SwitchCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
switchName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Switch.unlock.menu.operation, name: '道岔单解' },
|
||||
{ code: OperationEvent.Switch.fault.menu.operation, name: '道岔故障解锁' },
|
||||
{ code: OperationEvent.Switch.axlePreReset.menu.operation, name: '道岔计轴预复位' }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.order.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Switch.unlock.menu.operation, name: '道岔单解' },
|
||||
{ code: OperationEvent.Switch.unblock.menu.operation, name: '道岔解封' },
|
||||
{ code: OperationEvent.Switch.fault.menu.operation, name: '道岔故障解锁' },
|
||||
{ code: OperationEvent.Switch.axlePreReset.menu.operation, name: '道岔计轴预复位' },
|
||||
]
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '道岔单解';
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return '道岔解封';
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
return '道岔故障解锁';
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
return '道岔计轴复位';
|
||||
}
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm1.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && 1 <= index && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm2.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.stop.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '道岔单解';
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
return '道岔故障解锁';
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
return '道岔计轴复位';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
this.setMessage('请点击“下达”按钮,下达命令!');
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && index >= 1 && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage('请点击“下达”按钮,下达命令!');
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
command() {
|
||||
/** 道岔单解/道岔解封/道岔故障解锁/道岔计轴复位*/
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation ||
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
command() {
|
||||
/** 道岔单解/道岔解封/道岔故障解锁/道岔计轴复位*/
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.unblock.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.fault.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.axlePreReset.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
|
||||
},
|
||||
commandNoPopUp() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认1”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm1.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认2”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm2.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm2.operation;
|
||||
}
|
||||
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
stop() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.stop.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
close() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
})
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.order.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认1”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认2”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm2.operation;
|
||||
}
|
||||
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常,' + error.message });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
};
|
||||
</script>
|
||||
|
@ -66,11 +66,7 @@ export default {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
return '道岔封锁';
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
return '道岔强扳';
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
return '区段切除';
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
return '区段激活';
|
||||
@ -111,13 +107,7 @@ export default {
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
/** 道岔封锁*/
|
||||
this.block();
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
/** 道岔强扳*/
|
||||
this.turnoutForce();
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
@ -125,25 +115,6 @@ export default {
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.block.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 道岔强扮
|
||||
turnoutForce() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.turnoutForce.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_FORCE_TURN
|
||||
};
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
@ -189,7 +160,7 @@ export default {
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -22,10 +22,9 @@ import AlxeEffective from './dialog/alxeEffective';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { mouseCancelState } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'SectionMenu',
|
||||
@ -72,16 +71,6 @@ export default {
|
||||
handler: this.axlePreReset,
|
||||
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
|
||||
},
|
||||
{
|
||||
label: '区段封锁',
|
||||
handler: this.lock,
|
||||
cmdType: CMD.Section.CMD_SECTION_BLOCK
|
||||
},
|
||||
{
|
||||
label: '区段解封',
|
||||
handler: this.unlock,
|
||||
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
|
||||
},
|
||||
{
|
||||
label: '区段设置限速',
|
||||
handler: this.setSpeed,
|
||||
@ -137,6 +126,11 @@ export default {
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount': function(val) {
|
||||
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
|
||||
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -176,6 +170,18 @@ export default {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
operationHandler(buttonOperation, selectType) {
|
||||
switch (buttonOperation) {
|
||||
case OperationEvent.Signal.guide.button.operation: {
|
||||
// 区故解
|
||||
break;
|
||||
}
|
||||
case OperationEvent.Signal.guide.button.operation: {
|
||||
// 计轴复位
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
// // 设置计轴失效
|
||||
// alxeFailure() {
|
||||
// const operate = {
|
||||
@ -291,40 +297,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段解锁
|
||||
lock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Section.lock.menu.operation,
|
||||
param: {
|
||||
sectionCode: `${this.selected.code}`
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段封锁
|
||||
unlock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Section.unlock.menu.operation,
|
||||
param: {
|
||||
sectionCode: `${this.selected.code}`
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置速度
|
||||
setSpeed() {
|
||||
// let operate = {
|
||||
|
@ -2,7 +2,6 @@
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<route-selection ref="routeSelection" />
|
||||
<route-lock ref="routeLock" />
|
||||
<route-control ref="routeControl" />
|
||||
<route-cmd-control ref="routeCmdControl" />
|
||||
<route-hand-control ref="routeHandControl" />
|
||||
@ -15,7 +14,6 @@
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import RouteControl from './dialog/routeControl';
|
||||
import RouteSelection from './dialog/routeSelection';
|
||||
import RouteLock from './dialog/routeLock';
|
||||
import RouteCmdControl from './dialog/routeCmdControl';
|
||||
import RouteHandControl from './dialog/routeHandControl';
|
||||
import RouteDetail from './dialog/routeDetail';
|
||||
@ -24,7 +22,7 @@ import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import {OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
@ -33,7 +31,6 @@ export default {
|
||||
PopMenu,
|
||||
RouteControl,
|
||||
RouteSelection,
|
||||
RouteLock,
|
||||
RouteCmdControl,
|
||||
RouteHandControl,
|
||||
RouteDetail,
|
||||
@ -96,19 +93,16 @@ export default {
|
||||
label: '排列进路',
|
||||
handler: this.arrangementRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
// auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消进路',
|
||||
handler: this.cancelTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
// auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '信号重开',
|
||||
handler: this.reopenSignal,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
// auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
@ -117,13 +111,11 @@ export default {
|
||||
label: '进路交人工控',
|
||||
handler: this.humanControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
|
||||
// auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '进路交自动控',
|
||||
handler: this.atsAutoControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
// auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '查询进路控制状态',
|
||||
@ -151,21 +143,6 @@ export default {
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
debugger;
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount': function(val) {
|
||||
if (this.buttonOperation) {
|
||||
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected._type);
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
@ -176,8 +153,23 @@ export default {
|
||||
]),
|
||||
...mapGetters('map', [
|
||||
'routeList'
|
||||
]),
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount': function(val) {
|
||||
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Signal') {
|
||||
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
@ -236,16 +228,18 @@ export default {
|
||||
// 引导总锁
|
||||
break;
|
||||
}
|
||||
case OperationEvent.Signal.guide.button.operation: {
|
||||
case OperationEvent.Signal.setAutoInterlock.button.operation: {
|
||||
// 自动进路
|
||||
break;
|
||||
}
|
||||
case OperationEvent.Signal.guide.button.operation: {
|
||||
// 区故解
|
||||
break;
|
||||
}
|
||||
case OperationEvent.Signal.guide.button.operation: {
|
||||
// 计轴复位
|
||||
if (selectType.fleetMode != undefined) {
|
||||
if (selectType.fleetMode) {
|
||||
this.singalCancelPassModel(selectType);
|
||||
} else {
|
||||
this.singalPassModel(selectType);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow({}, `信号机[${selectType.name}(${selectType.code})]没有已锁闭进路,不能设置联锁自动进路`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -341,42 +335,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// // 信号封锁
|
||||
// lock() {
|
||||
// const operate = {
|
||||
// start: true,
|
||||
// send: true,
|
||||
// code: this.selected.code,
|
||||
// type: MapDeviceType.Signal.type,
|
||||
// label: MapDeviceType.Signal.label,
|
||||
// operation: OperationEvent.Signal.lock.menu.operation
|
||||
// };
|
||||
|
||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
// if (valid) {
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.routeLock.doShow(operate.operation, this.selected);
|
||||
// }
|
||||
// }).catch(() => {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
// });
|
||||
// },
|
||||
// // 信号解封
|
||||
// unlock() {
|
||||
// const operate = {
|
||||
// start: true,
|
||||
// code: this.selected.code,
|
||||
// type: MapDeviceType.Signal.type,
|
||||
// label: MapDeviceType.Signal.label,
|
||||
// operation: OperationEvent.Signal.unlock.menu.operation
|
||||
// };
|
||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
// if (valid) {
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.routeCmdControl.doShow(operate, this.selected);
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 信号重开
|
||||
reopenSignal() {
|
||||
const operate = {
|
||||
@ -457,6 +415,44 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置通过模式
|
||||
singalPassModel(selectType) {
|
||||
const operate = {
|
||||
start: true,
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
|
||||
param: {
|
||||
signalCode:selectType.code
|
||||
},
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 取消通过模式
|
||||
singalCancelPassModel(selectType) {
|
||||
const operate = {
|
||||
start: true,
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
|
||||
param: {
|
||||
signalCode:selectType.code
|
||||
},
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 查询进路状态
|
||||
detail() {
|
||||
const step = {
|
||||
|
@ -6,7 +6,6 @@
|
||||
<stand-detail ref="standDetail" />
|
||||
<stand-run-level ref="standRunLevel" />
|
||||
<stand-stop-time ref="standStopTime" />
|
||||
<stand-detain-train-all ref="standDetainTrainAll" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<stand-back-strategy ref="standBackStrategy" />
|
||||
</div>
|
||||
@ -20,11 +19,10 @@ import StandBackStrategy from './dialog/standBackStrategy';
|
||||
import StandDetail from './dialog/standDetail';
|
||||
import StandRunLevel from './dialog/standRunLevel';
|
||||
import StandStopTime from './dialog/standStopTime';
|
||||
import StandDetainTrainAll from './dialog/standDetainTrainAll';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import {OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { mouseCancelState } from './utils/menuItemStatus';
|
||||
@ -39,8 +37,7 @@ export default {
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll
|
||||
StandStopTime
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -55,78 +52,6 @@ export default {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [
|
||||
// {
|
||||
// label: '设置扣车',
|
||||
// handler: this.setDetainTrain,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
|
||||
// auth: { station: true, center: false }
|
||||
// },
|
||||
// {
|
||||
// label: '取消扣车',
|
||||
// handler: this.cancelDetainTrain,
|
||||
// cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
|
||||
// auth: { station: true, center: true }
|
||||
// },
|
||||
// {
|
||||
// label: '设置跳停',
|
||||
// handler: this.setJumpStop,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
|
||||
// auth: { station: true, center: false }
|
||||
// },
|
||||
// {
|
||||
// label: '取消跳停',
|
||||
// handler: this.cancelJumpStop,
|
||||
// cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
|
||||
// auth: { station: true, center: true }
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '提前发车',
|
||||
// handler: this.earlyDeparture,
|
||||
// cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART,
|
||||
// auth: { station: true, center: true }
|
||||
// },
|
||||
// {
|
||||
// label: '设置停站时间',
|
||||
// handler: this.setStopTime,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
|
||||
// auth: { station: true, center: true }
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '站台详细信息',
|
||||
// handler: this.detail,
|
||||
// cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS,
|
||||
// auth: { station: true, center: true }
|
||||
// },
|
||||
// {
|
||||
// label: '运行时间控制',
|
||||
// handler: this.setRunLevel,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
|
||||
// auth: { station: false, center: false }
|
||||
// },
|
||||
// {
|
||||
// label: '设置提前发车',
|
||||
// handler: this.earlyDeparture,
|
||||
// cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART,
|
||||
// auth: { station: false, center: false }
|
||||
// },
|
||||
// {
|
||||
// label: '人工折返策略设置',
|
||||
// handler: this.setBackStrategy,
|
||||
// cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
|
||||
// auth: { station: false, center: false }
|
||||
// }
|
||||
// {
|
||||
// label: '查询站台状态',
|
||||
// handler: this.detail,
|
||||
// disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
// auth: { station: false, center: false }
|
||||
// }
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
@ -351,22 +276,6 @@ export default {
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 全线取消扣车
|
||||
// cancelDetainTrainAll() {
|
||||
// const operate = {
|
||||
// start: true,
|
||||
// code: this.selected.code,
|
||||
// type: MapDeviceType.StationStand.type,
|
||||
// label: MapDeviceType.StationStand.label,
|
||||
// operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||
// };
|
||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
// if (valid) {
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
const operate = {
|
||||
@ -484,7 +393,7 @@ export default {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
|
@ -22,7 +22,7 @@ import AlxeEffective from './dialog/alxeEffective';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import {OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { mouseCancelState } from './utils/menuItemStatus';
|
||||
@ -52,6 +52,8 @@ export default {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: '轨道切除',
|
||||
handler: this.split,
|
||||
@ -61,24 +63,6 @@ export default {
|
||||
label: '轨道激活',
|
||||
handler: this.active,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
||||
}
|
||||
// {
|
||||
// label: '查看站场设备状态',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: '轨道切除',
|
||||
handler: this.split,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '轨道激活',
|
||||
handler: this.active,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
@ -92,8 +76,7 @@ export default {
|
||||
{
|
||||
label: '设置临时限速',
|
||||
handler: this.setSpeed,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
|
||||
auth: { station: false, center: true }
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
|
||||
}
|
||||
// {
|
||||
// type: 'separator'
|
||||
@ -191,7 +174,6 @@ export default {
|
||||
break;
|
||||
}
|
||||
case OperationEvent.Switch.lock.button.operation: {
|
||||
debugger;
|
||||
// 道岔单锁
|
||||
if (!selectType.singleLock) {
|
||||
this.lock(selectType);
|
||||
@ -270,7 +252,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔解封
|
||||
// 道岔解锁
|
||||
unlock(selectType) {
|
||||
const operate = {
|
||||
start: true,
|
||||
@ -289,57 +271,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔封锁
|
||||
// block() {
|
||||
// const operate = {
|
||||
// start: true,
|
||||
// code: this.selected.code,
|
||||
// operation: OperationEvent.Switch.block.menu.operation,
|
||||
// param: {
|
||||
// switchCode: `${this.selected.code}`
|
||||
// }
|
||||
// };
|
||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
// if (valid) {
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.switchControl.doShow(operate, this.selected);
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 道岔解封
|
||||
// unblock() {
|
||||
// const operate = {
|
||||
// start: true,
|
||||
// code: this.selected.code,
|
||||
// operation: OperationEvent.Switch.unblock.menu.operation,
|
||||
// param: {
|
||||
// switchCode: `${this.selected.code}`
|
||||
// }
|
||||
// };
|
||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
// if (valid) {
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 道岔强扳
|
||||
// switchTurnoutForce() {
|
||||
// const operate = {
|
||||
// start: true,
|
||||
// code: this.selected.code,
|
||||
// operation: OperationEvent.Switch.turnoutForce.menu.operation,
|
||||
// param: {
|
||||
// switchCode: `${this.selected.code}`
|
||||
// }
|
||||
// };
|
||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
// if (valid) {
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.switchControl.doShow(operate, this.selected);
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 单操到定位
|
||||
locate(selectType) {
|
||||
const operate = {
|
||||
|
@ -388,7 +388,6 @@ export default {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
debugger;
|
||||
if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation || this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
this.radio = selected.direction;
|
||||
} else if (this.operation == OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
|
@ -19,20 +19,20 @@
|
||||
</span>
|
||||
</button>
|
||||
<!-- 流程未做暂不显示 -->
|
||||
<!-- <button :id="Switch.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.guideLock.button.operation)">
|
||||
<span style="color: red">
|
||||
<button :id="Switch.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.guideLock.button.operation)">
|
||||
<span style="color: #800000">
|
||||
<center><b>引</b><b>导</b></center>
|
||||
<center><b>总</b><b>锁</b></center>
|
||||
</span>
|
||||
</button> -->
|
||||
</button>
|
||||
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, 'Signal')">
|
||||
<span style="color: red">
|
||||
<span style="color: #800000">
|
||||
<center><b>总</b></center>
|
||||
<center><b>人</b><b>解</b></center>
|
||||
</span>
|
||||
</button>
|
||||
<button :id="Section.fault.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Section.fault.button.operation, 'Section')">
|
||||
<span style="color: black">
|
||||
<span style="color: #800000">
|
||||
<center><b>区</b></center>
|
||||
<center><b>故</b><b>解</b></center>
|
||||
</span>
|
||||
@ -56,7 +56,7 @@
|
||||
</span>
|
||||
</button>
|
||||
<button :id="Switch.unlock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.unlock.button.operation, 'Switch')">
|
||||
<span style="color: red">
|
||||
<span style="color: #800000">
|
||||
<center><b>道</b><b>岔</b></center>
|
||||
<center><b>解</b><b>锁</b></center>
|
||||
</span>
|
||||
@ -331,10 +331,10 @@ export default {
|
||||
}
|
||||
} else if (deviceList.length === 2) {
|
||||
this.routeList.forEach(item => {
|
||||
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code){
|
||||
item.type
|
||||
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
|
||||
item.type;
|
||||
const operate = this.handelOperate(item);
|
||||
console.log(operate,item);
|
||||
console.log(operate, item);
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
||||
}
|
||||
});
|
||||
|
226
src/jmapNew/theme/haerbin_01/menus/dialog/trainInitPlan.vue
Normal file
226
src/jmapNew/theme/haerbin_01/menus/dialog/trainInitPlan.vue
Normal file
@ -0,0 +1,226 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="haerbin-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="300px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="el-dialog-div">
|
||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules" label-position="left">
|
||||
<el-form-item prop="trainCode" label="车组号:">
|
||||
<!--<el-input v-model="addModel.trainCode"/>-->
|
||||
<el-select v-model="addModel.trainCode" filterable>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="车次号:" prop="tripNumber">
|
||||
<!--<el-input v-model="addModel.tripNumber"/>-->
|
||||
<el-select v-model="addModel.tripNumber" @change="tripNumberChange" filterable>
|
||||
<el-option
|
||||
v-for="tripNum in tripNumberList"
|
||||
:key="tripNum"
|
||||
:label="tripNum"
|
||||
:value="tripNum"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务号:" prop="serviceNumber">
|
||||
<el-select v-model="addModel.serviceNumber" filterable>
|
||||
<el-option
|
||||
v-for="serviceNumber in serviceNumberList"
|
||||
:key="serviceNumber"
|
||||
:label="serviceNumber"
|
||||
:value="serviceNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'TrainCreateNumber',
|
||||
mixins: [
|
||||
CancelMouseState
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
selected: null,
|
||||
sectionName: '',
|
||||
tripNumberList: [],
|
||||
serviceNumberList: [],
|
||||
addModel: {
|
||||
trainCode:'',
|
||||
tripNumber:'',
|
||||
serviceNumber: ''
|
||||
},
|
||||
rules: {
|
||||
trainCode: [
|
||||
{ required: true, message: '请输入列车编码', trigger: 'blur'}
|
||||
],
|
||||
serviceNumber: [
|
||||
{ required: true, message: '请输入服务号', trigger: 'change'}
|
||||
],
|
||||
tripNumber: [
|
||||
{ required: true, message: '请输入车次号', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'trainList',
|
||||
'stationStandList',
|
||||
'trainWindowSectionCode'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.createPlanTrain.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '新建计划车';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
tripNumberChange(tripNumber) {
|
||||
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
|
||||
this.serviceNumberList = [];
|
||||
resp.data.forEach(item => {
|
||||
if (!this.serviceNumberList.includes(item)) {
|
||||
this.serviceNumberList.push(item);
|
||||
}
|
||||
});
|
||||
});
|
||||
if (this.serviceNumberList.length === 1) {
|
||||
this.addModel.serviceNumber = this.serviceNumberList[0];
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
this.addModel = {
|
||||
trainCode:'',
|
||||
tripNumber:'',
|
||||
serviceNumber: ''
|
||||
};
|
||||
getTripNumberList(this.$route.query.group).then(resp => {
|
||||
this.tripNumberList = [];
|
||||
resp.data.forEach(item => {
|
||||
if (!this.tripNumberList.includes(item)) {
|
||||
this.tripNumberList.push(item);
|
||||
}
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$messageBox(error.message);
|
||||
});
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
||||
param: {
|
||||
sectionCode: this.trainWindowSectionCode,
|
||||
trainCode: this.addModel.trainCode, // 车组号
|
||||
serviceNumber: this.addModel.serviceNumber, // 服务号
|
||||
tripNumber: this.addModel.tripNumber // 车次号
|
||||
}
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
this.$messageBox(error.message);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.chengdou-03__systerm .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -5px;
|
||||
top: -18px;
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
.el-dialog-div {
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
@ -7,6 +7,7 @@
|
||||
<train-move ref="trainMove" />
|
||||
<train-switch ref="trainSwitch" />
|
||||
<train-edit-number ref="trainEditNumber" />
|
||||
<train-init-plan ref="trainInitPlan"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -22,6 +23,7 @@ import TrainDelete from './dialog/trainDelete';
|
||||
import TrainMove from './dialog/trainMove';
|
||||
import TrainSwitch from './dialog/trainSwitch';
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
import TrainInitPlan from './dialog/trainInitPlan';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
|
||||
export default {
|
||||
@ -33,7 +35,8 @@ export default {
|
||||
TrainDelete,
|
||||
TrainMove,
|
||||
TrainSwitch,
|
||||
TrainEditNumber
|
||||
TrainEditNumber,
|
||||
TrainInitPlan
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -47,44 +50,19 @@ export default {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [],
|
||||
Local: [
|
||||
{
|
||||
label: '新建计划列车',
|
||||
handler: this.createPlanTrain,
|
||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||
}
|
||||
],
|
||||
Center: [
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.addTrainId'),
|
||||
// handler: this.addTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.deleteTrainId'),
|
||||
// handler: this.delTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.editTrainId'),
|
||||
// handler: this.editTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.editTrainNo'),
|
||||
// handler: this.editTrainNo,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.moveTrainId'),
|
||||
// handler: this.moveTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.switchTrainId'),
|
||||
// handler: this.switchTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// }
|
||||
{
|
||||
label: '新建计划列车',
|
||||
handler: this.createPlanTrain,
|
||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
@ -162,6 +140,23 @@ export default {
|
||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
}
|
||||
},
|
||||
createPlanTrain() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||
param: {
|
||||
trainWindowCode: this.selected.code
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainInitPlan.doShow(step, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const step = {
|
||||
|
@ -207,27 +207,27 @@ export default {
|
||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
};
|
||||
|
||||
this.sendCommand(operate)
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 道岔定位
|
||||
locate() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.locate.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
|
||||
};
|
||||
|
||||
this.sendCommand(operate)
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 道岔反位
|
||||
reverse() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.reverse.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
|
||||
};
|
||||
|
||||
this.sendCommand(operate)
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 区段切除
|
||||
split() {
|
||||
@ -236,7 +236,7 @@ export default {
|
||||
operation: OperationEvent.Switch.split.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
|
||||
};
|
||||
this.sendCommand(operate)
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 区段激活
|
||||
active() {
|
||||
@ -245,7 +245,7 @@ export default {
|
||||
operation: OperationEvent.Switch.active.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
||||
};
|
||||
this.sendCommand(operate)
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
@ -49,12 +49,12 @@ export default {
|
||||
{
|
||||
label: '定操',
|
||||
handler: this.locate,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
|
||||
},
|
||||
{
|
||||
label: '反操',
|
||||
handler: this.reverse,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
|
||||
},
|
||||
{
|
||||
label: '道岔单锁',
|
||||
@ -81,12 +81,12 @@ export default {
|
||||
{
|
||||
label: '定操',
|
||||
handler: this.locate,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
|
||||
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
|
||||
},
|
||||
{
|
||||
label: '反操',
|
||||
handler: this.reverse,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
|
||||
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
|
25
src/jmapNew/utils/handlePath.js
Normal file
25
src/jmapNew/utils/handlePath.js
Normal file
@ -0,0 +1,25 @@
|
||||
export function getPrdType() {
|
||||
let prdType = '';
|
||||
const path = window.location.href;
|
||||
if (path.includes('?')) {
|
||||
const arr = window.location.href.split('?')[1].split('&');
|
||||
arr.forEach(elem => {
|
||||
if (elem.split('=')[0] === 'prdType') {
|
||||
prdType = elem.split('=')[1];
|
||||
}
|
||||
});
|
||||
}
|
||||
return prdType;
|
||||
}
|
||||
export function isShowThePrdType (prdType, showConditions) {
|
||||
if (showConditions === '01' || (showConditions === '02' && prdType === '02') || (showConditions === '03' && prdType === '01')) {
|
||||
return true;
|
||||
} else if (!showConditions) {
|
||||
return true; // 兼容老数据没有showConditions
|
||||
}
|
||||
|
||||
}
|
||||
export function isPreviewOrMapDraw() {
|
||||
const path = window.location.href;
|
||||
return path.indexOf('map/draw') !== -1 || path.indexOf('mapPreviewNew') !== -1;
|
||||
}
|
@ -30,105 +30,105 @@ export function calculateDCenter(viewRect, zrbound) {
|
||||
return { dx: dx, dy: dy };
|
||||
}
|
||||
|
||||
export function deviceFactory(type, elem) {
|
||||
return {...deviceRender[type], ...elem};
|
||||
export function deviceFactory(type, elem, showConfig) {
|
||||
return {...deviceRender[type], ...elem, ...showConfig};
|
||||
}
|
||||
|
||||
export function createDevice(type, elem, propConvert) {
|
||||
const device = deviceFactory(type, Object.assign(elem, { _type: type } ));
|
||||
export function createDevice(type, elem, propConvert, showConfig) {
|
||||
const device = deviceFactory(type, Object.assign(elem, { _type: type } ), showConfig);
|
||||
return propConvert ? propConvert.initPrivateProps(device) : device;
|
||||
}
|
||||
|
||||
export function parser(data, skinCode) {
|
||||
export function parser(data, skinCode, showConfig) {
|
||||
var mapDevice = {};
|
||||
var propConvert = skinCode ? Vue.prototype.$theme.loadPropConvert(skinCode) : null;
|
||||
if (data) {
|
||||
zrUtil.each(data.sectionList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.signalList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.stationList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Station, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Station, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.stationStandList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationStand, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationStand, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.stationControlList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationControl, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationControl, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.counterList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationCounter, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationCounter, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.delayShowList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationDelayUnlock, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.StationDelayUnlock, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.lineList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.espList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Esp, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Esp, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.psdList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Psd, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Psd, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.textList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.zcList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.ZcControl, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.ZcControl, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.lcList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.LcControl, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.LcControl, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.tempSpeedLimitList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.LimitControl, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.LimitControl, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.resourceList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Resource, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Resource, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.trainList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Train, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Train, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.Line || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.Text || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.cycleButtonList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.MapCycleButtonVO, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.MapCycleButtonVO, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.automaticRouteButtonList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.AutomaticRoute, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.AutomaticRoute, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.outerFrameList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.OutFrame, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.OutFrame, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.trainWindowList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.TrainWindow, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.TrainWindow, elem, propConvert, showConfig);
|
||||
if (elem.sectionCode) {
|
||||
const section = mapDevice[elem.sectionCode];
|
||||
if (section) {
|
||||
@ -138,7 +138,7 @@ export function parser(data, skinCode) {
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.switchList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert);
|
||||
mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert, showConfig);
|
||||
const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode];
|
||||
const lnodeSection = mapDevice[mapDevice[elem.code].sectionBCode];
|
||||
const rnodeSection = mapDevice[mapDevice[elem.code].sectionCCode];
|
||||
|
@ -33,7 +33,11 @@ export default {
|
||||
/** 定位(定操) */
|
||||
CMD_SWITCH_NORMAL_POSITION:{value:'Switch_Normal_Position', label:'单操到定位'},
|
||||
/** 反位(反操) */
|
||||
CMD_SWITCH_REVERSE_POSITION:{value:'Switch_Reverse_Position', label:'单操到反位'}
|
||||
CMD_SWITCH_REVERSE_POSITION:{value:'Switch_Reverse_Position', label:'单操到反位'},
|
||||
/** 道岔定操(联动) */
|
||||
CMD_SWITCH_TURN_NP_CHAIN: {value: 'Switch_Turn_NP_Chain', label: '道岔定操(联动)'},
|
||||
/** 道岔反操(联动)*/
|
||||
CMD_SWITCH_TURN_RP_CHAIN: {value: 'Switch_Turn_RP_Chain', label: '道岔反操(联动)'}
|
||||
},
|
||||
|
||||
// 控制模式操作
|
||||
|
@ -195,7 +195,7 @@ const map = {
|
||||
mapDataLoadedCount: 0, // 地图数据加载完成标识
|
||||
trainDetails: null, // 地图'列车详情'显示
|
||||
deleteCount: 0, // 绘图快捷删除标识
|
||||
updateCount: 0, // 绘图快捷修改标识
|
||||
updateCount: 0, // 绘图快捷修改标识
|
||||
mousemove: 0 // 实训战场图移动标识
|
||||
},
|
||||
|
||||
@ -515,7 +515,11 @@ const map = {
|
||||
setMapData: (state, map) => {
|
||||
if (map && map.skinVO) {
|
||||
state.map = map;
|
||||
state.mapDevice = parser(map, map.skinVO.code);
|
||||
let showConfig = {};
|
||||
if (Vue.prototype.$jlmap) {
|
||||
showConfig = Vue.prototype.$jlmap.getShowConfig();
|
||||
}
|
||||
state.mapDevice = parser(map, map.skinVO.code, showConfig);
|
||||
Vue.prototype.$jlmap && Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
||||
} else {
|
||||
state.map = null;
|
||||
|
@ -11,6 +11,7 @@ const menuOperation = {
|
||||
mbmpCount: 0, // 地图按钮菜单位置变更标识
|
||||
buttonOperation: null, // 按钮菜单是否被按下
|
||||
selected: {}, // 选中的地图对象
|
||||
subType: '', // 选中的设备子元素类型
|
||||
selectedCount: 0, // 选中对象变更标识
|
||||
menu: null, // 弹出菜单设备
|
||||
menuPosition: {}, // 弹出菜单位置
|
||||
@ -26,6 +27,9 @@ const menuOperation = {
|
||||
selected: (state) => {
|
||||
return state.selected;
|
||||
},
|
||||
subType: (state) => {
|
||||
return state.subType;
|
||||
},
|
||||
mbmpCount: (state) => {
|
||||
return state.mbmpCount;
|
||||
},
|
||||
@ -71,7 +75,8 @@ const menuOperation = {
|
||||
state.buttonOperation = operation;
|
||||
},
|
||||
setSelected: (state, selected) => {
|
||||
state.selected = selected;
|
||||
state.selected = selected.device;
|
||||
state.subType = selected.subType;
|
||||
state.selectedCount += 1;
|
||||
},
|
||||
mbmpCountIncrement: (state) => {
|
||||
|
@ -2,7 +2,7 @@ import store from '@/store';
|
||||
import { Notification } from 'element-ui';
|
||||
|
||||
function handle(state, data) {
|
||||
console.log(data, 'socket订阅');
|
||||
// console.log(data, 'socket订阅');
|
||||
const msg = data.body;
|
||||
const path = window.location.href;
|
||||
switch (data.type) {
|
||||
|
@ -22,7 +22,7 @@ export function creatSubscribe(topic, header) {
|
||||
function callback(Response) {
|
||||
if (store) {
|
||||
var data = JSON.parse(Response.body);
|
||||
// console.log(data);
|
||||
// console.log(Response.body);
|
||||
store.dispatch('socket/setStomp', data);
|
||||
} else {
|
||||
callback(Response);
|
||||
|
@ -33,15 +33,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
// import ShowProperty from '@/views/jlmap3d/show/property';
|
||||
|
||||
import { simulationNotify, setTrainingCbtcInitTime } from '@/api/simulation';
|
||||
|
||||
import { UrlConfig } from '@/router/index';
|
||||
// import Vue from 'vue';
|
||||
// import localStore from 'storejs';
|
||||
// import { mapGetters } from 'vuex';
|
||||
//
|
||||
// // import ShowProperty from '@/views/jlmap3d/show/property';
|
||||
//
|
||||
// import { simulationNotify, setTrainingCbtcInitTime } from '@/api/simulation';
|
||||
//
|
||||
// import { UrlConfig } from '@/router/index';
|
||||
|
||||
import { JLmap3d } from '@/jlmap3d/jl3dsimulation/jlmap3d.js';
|
||||
|
||||
@ -81,19 +81,6 @@ export default {
|
||||
token:null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'jlmap3d.selectmodel.code': {
|
||||
deep: true,
|
||||
handler: function (newVal, oldVal) {
|
||||
if (newVal != oldVal) {
|
||||
// this.selectmodel = this.jlmap3dedit.selectmodel;
|
||||
// this.$refs.property.switchproperty();
|
||||
// console.log(this.jlmap3dedit.selectmodel);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
// console.log("destroy");
|
||||
if (this.jlmap3d) {
|
||||
@ -136,7 +123,7 @@ export default {
|
||||
let project = this.$route.query.project;
|
||||
// console.log(project);
|
||||
|
||||
|
||||
|
||||
if(project){
|
||||
|
||||
this.jlmap3d = new JLmap3d(dom, mapdata, skinCode,this.$store,group,project);
|
||||
|
@ -27,9 +27,6 @@ export default {
|
||||
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
init: function() {
|
||||
|
@ -59,16 +59,6 @@ export default {
|
||||
filterText(val) {
|
||||
this.$refs.tree2.filter(val);
|
||||
},
|
||||
modellist: function() {
|
||||
this.$nextTick(function(){
|
||||
////console.log("nextTick");
|
||||
})
|
||||
},
|
||||
texturelist: function() {
|
||||
this.$nextTick(function(){
|
||||
////console.log("nextTick");
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
modelselect(index){
|
||||
|
@ -99,7 +99,7 @@ export default {
|
||||
}
|
||||
|
||||
this.selected = device;
|
||||
this.$store.dispatch('menuOperation/setSelected', device);
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
|
||||
},
|
||||
@ -119,7 +119,7 @@ export default {
|
||||
if (device) {
|
||||
this.selected = device = this.getSelectedByLineCode(device);
|
||||
if (!this.buttonOperation) {
|
||||
this.$store.dispatch('menuOperation/setSelected', device);
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
|
||||
if (!this.checkShouldPop(device)) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null });
|
||||
} else {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user